ホーム › Security.Authentication.Identity › SEC_WINNT_AUTH_IDENTITY32
SEC_WINNT_AUTH_IDENTITY32
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| User | DWORD | 4 | +0 | +0 | ユーザー名文字列への32ビットオフセット。WOW64互換用の32ビット表現。 |
| UserLength | DWORD | 4 | +4 | +4 | ユーザー名の文字数を示す。 |
| Domain | DWORD | 4 | +8 | +8 | ドメイン名文字列への32ビットオフセット。 |
| DomainLength | DWORD | 4 | +12 | +12 | ドメイン名の文字数を示す。 |
| Password | DWORD | 4 | +16 | +16 | パスワード文字列への32ビットオフセット。 |
| PasswordLength | DWORD | 4 | +20 | +20 | パスワードの文字数を示す。 |
| Flags | DWORD | 4 | +24 | +24 | 文字列がANSIかUnicodeかを示すフラグ。SEC_WINNT_AUTH_IDENTITY_ANSI等。 |
各言語での定義
#include <windows.h>
// SEC_WINNT_AUTH_IDENTITY32 (x64 28 / x86 28 バイト)
typedef struct SEC_WINNT_AUTH_IDENTITY32 {
DWORD User;
DWORD UserLength;
DWORD Domain;
DWORD DomainLength;
DWORD Password;
DWORD PasswordLength;
DWORD Flags;
} SEC_WINNT_AUTH_IDENTITY32;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SEC_WINNT_AUTH_IDENTITY32
{
public uint User;
public uint UserLength;
public uint Domain;
public uint DomainLength;
public uint Password;
public uint PasswordLength;
public uint Flags;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SEC_WINNT_AUTH_IDENTITY32
Public User As UInteger
Public UserLength As UInteger
Public Domain As UInteger
Public DomainLength As UInteger
Public Password As UInteger
Public PasswordLength As UInteger
Public Flags As UInteger
End Structureimport ctypes
from ctypes import wintypes
class SEC_WINNT_AUTH_IDENTITY32(ctypes.Structure):
_fields_ = [
("User", wintypes.DWORD),
("UserLength", wintypes.DWORD),
("Domain", wintypes.DWORD),
("DomainLength", wintypes.DWORD),
("Password", wintypes.DWORD),
("PasswordLength", wintypes.DWORD),
("Flags", wintypes.DWORD),
]#[repr(C)]
pub struct SEC_WINNT_AUTH_IDENTITY32 {
pub User: u32,
pub UserLength: u32,
pub Domain: u32,
pub DomainLength: u32,
pub Password: u32,
pub PasswordLength: u32,
pub Flags: u32,
}import "golang.org/x/sys/windows"
type SEC_WINNT_AUTH_IDENTITY32 struct {
User uint32
UserLength uint32
Domain uint32
DomainLength uint32
Password uint32
PasswordLength uint32
Flags uint32
}type
SEC_WINNT_AUTH_IDENTITY32 = record
User: DWORD;
UserLength: DWORD;
Domain: DWORD;
DomainLength: DWORD;
Password: DWORD;
PasswordLength: DWORD;
Flags: DWORD;
end;const SEC_WINNT_AUTH_IDENTITY32 = extern struct {
User: u32,
UserLength: u32,
Domain: u32,
DomainLength: u32,
Password: u32,
PasswordLength: u32,
Flags: u32,
};type
SEC_WINNT_AUTH_IDENTITY32 {.bycopy.} = object
User: uint32
UserLength: uint32
Domain: uint32
DomainLength: uint32
Password: uint32
PasswordLength: uint32
Flags: uint32struct SEC_WINNT_AUTH_IDENTITY32
{
uint User;
uint UserLength;
uint Domain;
uint DomainLength;
uint 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整数の配列変数で操作します。(x64 レイアウト)
; SEC_WINNT_AUTH_IDENTITY32 サイズ: 28 バイト(x64)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; User : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; UserLength : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Domain : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; DomainLength : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; Password : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; PasswordLength : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; Flags : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SEC_WINNT_AUTH_IDENTITY32
#field int User
#field int UserLength
#field int Domain
#field int DomainLength
#field int Password
#field int PasswordLength
#field int Flags
#endstruct
stdim st, SEC_WINNT_AUTH_IDENTITY32 ; NSTRUCT 変数を確保
st->User = 100
mes "User=" + st->User