ホーム › System.Rpc › SEC_WINNT_AUTH_IDENTITY_W
SEC_WINNT_AUTH_IDENTITY_W
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| User | WORD* | 8/4 | +0 | +0 | ユーザー名。Unicode(WORD)文字列へのポインター。 |
| UserLength | DWORD | 4 | +8 | +4 | ユーザー名の文字数。 |
| Domain | WORD* | 8/4 | +16 | +8 | ドメイン名。Unicode(WORD)文字列へのポインター。 |
| DomainLength | DWORD | 4 | +24 | +12 | ドメイン名の文字数。 |
| Password | WORD* | 8/4 | +32 | +16 | パスワード。Unicode(WORD)文字列へのポインター。機微情報。 |
| PasswordLength | DWORD | 4 | +40 | +20 | パスワードの文字数。 |
| Flags | SEC_WINNT_AUTH_IDENTITY | 4 | +44 | +24 | 文字列がANSIかUnicodeかを示すフラグ。SEC_WINNT_AUTH_IDENTITYで表す。 |
各言語での定義
#include <windows.h>
// SEC_WINNT_AUTH_IDENTITY_W (x64 48 / x86 28 バイト)
typedef struct SEC_WINNT_AUTH_IDENTITY_W {
WORD* User;
DWORD UserLength;
WORD* Domain;
DWORD DomainLength;
WORD* Password;
DWORD PasswordLength;
SEC_WINNT_AUTH_IDENTITY Flags;
} SEC_WINNT_AUTH_IDENTITY_W;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SEC_WINNT_AUTH_IDENTITY_W
{
public IntPtr User;
public uint UserLength;
public IntPtr Domain;
public uint DomainLength;
public IntPtr Password;
public uint PasswordLength;
public uint Flags;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SEC_WINNT_AUTH_IDENTITY_W
Public User As IntPtr
Public UserLength As UInteger
Public Domain As IntPtr
Public DomainLength As UInteger
Public Password As IntPtr
Public PasswordLength As UInteger
Public Flags As UInteger
End Structureimport ctypes
from ctypes import wintypes
class SEC_WINNT_AUTH_IDENTITY_W(ctypes.Structure):
_fields_ = [
("User", ctypes.c_void_p),
("UserLength", wintypes.DWORD),
("Domain", ctypes.c_void_p),
("DomainLength", wintypes.DWORD),
("Password", ctypes.c_void_p),
("PasswordLength", wintypes.DWORD),
("Flags", wintypes.DWORD),
]#[repr(C)]
pub struct SEC_WINNT_AUTH_IDENTITY_W {
pub User: *mut core::ffi::c_void,
pub UserLength: u32,
pub Domain: *mut core::ffi::c_void,
pub DomainLength: u32,
pub Password: *mut core::ffi::c_void,
pub PasswordLength: u32,
pub Flags: u32,
}import "golang.org/x/sys/windows"
type SEC_WINNT_AUTH_IDENTITY_W struct {
User uintptr
UserLength uint32
Domain uintptr
DomainLength uint32
Password uintptr
PasswordLength uint32
Flags uint32
}type
SEC_WINNT_AUTH_IDENTITY_W = record
User: Pointer;
UserLength: DWORD;
Domain: Pointer;
DomainLength: DWORD;
Password: Pointer;
PasswordLength: DWORD;
Flags: DWORD;
end;const SEC_WINNT_AUTH_IDENTITY_W = extern struct {
User: ?*anyopaque,
UserLength: u32,
Domain: ?*anyopaque,
DomainLength: u32,
Password: ?*anyopaque,
PasswordLength: u32,
Flags: u32,
};type
SEC_WINNT_AUTH_IDENTITY_W {.bycopy.} = object
User: pointer
UserLength: uint32
Domain: pointer
DomainLength: uint32
Password: pointer
PasswordLength: uint32
Flags: uint32struct SEC_WINNT_AUTH_IDENTITY_W
{
void* User;
uint UserLength;
void* Domain;
uint DomainLength;
void* Password;
uint PasswordLength;
uint Flags;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SEC_WINNT_AUTH_IDENTITY_W サイズ: 28 バイト(x86)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; User : WORD* (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; UserLength : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Domain : WORD* (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; DomainLength : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; Password : WORD* (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; PasswordLength : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; Flags : SEC_WINNT_AUTH_IDENTITY (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SEC_WINNT_AUTH_IDENTITY_W サイズ: 48 バイト(x64)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; User : WORD* (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; UserLength : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Domain : WORD* (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; DomainLength : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; Password : WORD* (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; PasswordLength : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; Flags : SEC_WINNT_AUTH_IDENTITY (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SEC_WINNT_AUTH_IDENTITY_W
#field intptr User
#field int UserLength
#field intptr Domain
#field int DomainLength
#field intptr Password
#field int PasswordLength
#field int Flags
#endstruct
stdim st, SEC_WINNT_AUTH_IDENTITY_W ; NSTRUCT 変数を確保
st->UserLength = 100
mes "UserLength=" + st->UserLength