Win32 API 日本語リファレンス
ホームSecurity.Authentication.Identity › TRUSTED_DOMAIN_AUTH_INFORMATION

TRUSTED_DOMAIN_AUTH_INFORMATION

構造体
サイズx64: 48 バイト / x86: 24 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
IncomingAuthInfosDWORD4+0+0受信方向の現行認証情報の数。
IncomingAuthenticationInformationLSA_AUTH_INFORMATION*8/4+8+4受信方向の現行認証情報配列へのポインタ。
IncomingPreviousAuthenticationInformationLSA_AUTH_INFORMATION*8/4+16+8受信方向の旧認証情報配列へのポインタ。
OutgoingAuthInfosDWORD4+24+12送信方向の現行認証情報の数。
OutgoingAuthenticationInformationLSA_AUTH_INFORMATION*8/4+32+16送信方向の現行認証情報配列へのポインタ。
OutgoingPreviousAuthenticationInformationLSA_AUTH_INFORMATION*8/4+40+20送信方向の旧認証情報配列へのポインタ。

各言語での定義

#include <windows.h>

// TRUSTED_DOMAIN_AUTH_INFORMATION  (x64 48 / x86 24 バイト)
typedef struct TRUSTED_DOMAIN_AUTH_INFORMATION {
    DWORD IncomingAuthInfos;
    LSA_AUTH_INFORMATION* IncomingAuthenticationInformation;
    LSA_AUTH_INFORMATION* IncomingPreviousAuthenticationInformation;
    DWORD OutgoingAuthInfos;
    LSA_AUTH_INFORMATION* OutgoingAuthenticationInformation;
    LSA_AUTH_INFORMATION* OutgoingPreviousAuthenticationInformation;
} TRUSTED_DOMAIN_AUTH_INFORMATION;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TRUSTED_DOMAIN_AUTH_INFORMATION
{
    public uint IncomingAuthInfos;
    public IntPtr IncomingAuthenticationInformation;
    public IntPtr IncomingPreviousAuthenticationInformation;
    public uint OutgoingAuthInfos;
    public IntPtr OutgoingAuthenticationInformation;
    public IntPtr OutgoingPreviousAuthenticationInformation;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TRUSTED_DOMAIN_AUTH_INFORMATION
    Public IncomingAuthInfos As UInteger
    Public IncomingAuthenticationInformation As IntPtr
    Public IncomingPreviousAuthenticationInformation As IntPtr
    Public OutgoingAuthInfos As UInteger
    Public OutgoingAuthenticationInformation As IntPtr
    Public OutgoingPreviousAuthenticationInformation As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class TRUSTED_DOMAIN_AUTH_INFORMATION(ctypes.Structure):
    _fields_ = [
        ("IncomingAuthInfos", wintypes.DWORD),
        ("IncomingAuthenticationInformation", ctypes.c_void_p),
        ("IncomingPreviousAuthenticationInformation", ctypes.c_void_p),
        ("OutgoingAuthInfos", wintypes.DWORD),
        ("OutgoingAuthenticationInformation", ctypes.c_void_p),
        ("OutgoingPreviousAuthenticationInformation", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct TRUSTED_DOMAIN_AUTH_INFORMATION {
    pub IncomingAuthInfos: u32,
    pub IncomingAuthenticationInformation: *mut core::ffi::c_void,
    pub IncomingPreviousAuthenticationInformation: *mut core::ffi::c_void,
    pub OutgoingAuthInfos: u32,
    pub OutgoingAuthenticationInformation: *mut core::ffi::c_void,
    pub OutgoingPreviousAuthenticationInformation: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type TRUSTED_DOMAIN_AUTH_INFORMATION struct {
	IncomingAuthInfos uint32
	IncomingAuthenticationInformation uintptr
	IncomingPreviousAuthenticationInformation uintptr
	OutgoingAuthInfos uint32
	OutgoingAuthenticationInformation uintptr
	OutgoingPreviousAuthenticationInformation uintptr
}
type
  TRUSTED_DOMAIN_AUTH_INFORMATION = record
    IncomingAuthInfos: DWORD;
    IncomingAuthenticationInformation: Pointer;
    IncomingPreviousAuthenticationInformation: Pointer;
    OutgoingAuthInfos: DWORD;
    OutgoingAuthenticationInformation: Pointer;
    OutgoingPreviousAuthenticationInformation: Pointer;
  end;
const TRUSTED_DOMAIN_AUTH_INFORMATION = extern struct {
    IncomingAuthInfos: u32,
    IncomingAuthenticationInformation: ?*anyopaque,
    IncomingPreviousAuthenticationInformation: ?*anyopaque,
    OutgoingAuthInfos: u32,
    OutgoingAuthenticationInformation: ?*anyopaque,
    OutgoingPreviousAuthenticationInformation: ?*anyopaque,
};
type
  TRUSTED_DOMAIN_AUTH_INFORMATION {.bycopy.} = object
    IncomingAuthInfos: uint32
    IncomingAuthenticationInformation: pointer
    IncomingPreviousAuthenticationInformation: pointer
    OutgoingAuthInfos: uint32
    OutgoingAuthenticationInformation: pointer
    OutgoingPreviousAuthenticationInformation: pointer
struct TRUSTED_DOMAIN_AUTH_INFORMATION
{
    uint IncomingAuthInfos;
    void* IncomingAuthenticationInformation;
    void* IncomingPreviousAuthenticationInformation;
    uint OutgoingAuthInfos;
    void* OutgoingAuthenticationInformation;
    void* OutgoingPreviousAuthenticationInformation;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; TRUSTED_DOMAIN_AUTH_INFORMATION サイズ: 24 バイト(x86)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; IncomingAuthInfos : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; IncomingAuthenticationInformation : LSA_AUTH_INFORMATION* (+4, 4byte)  varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; IncomingPreviousAuthenticationInformation : LSA_AUTH_INFORMATION* (+8, 4byte)  varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; OutgoingAuthInfos : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; OutgoingAuthenticationInformation : LSA_AUTH_INFORMATION* (+16, 4byte)  varptr(st)+16 を基点に操作(4byte:入れ子/配列)
; OutgoingPreviousAuthenticationInformation : LSA_AUTH_INFORMATION* (+20, 4byte)  varptr(st)+20 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; TRUSTED_DOMAIN_AUTH_INFORMATION サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; IncomingAuthInfos : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; IncomingAuthenticationInformation : LSA_AUTH_INFORMATION* (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; IncomingPreviousAuthenticationInformation : LSA_AUTH_INFORMATION* (+16, 8byte)  varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; OutgoingAuthInfos : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; OutgoingAuthenticationInformation : LSA_AUTH_INFORMATION* (+32, 8byte)  varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; OutgoingPreviousAuthenticationInformation : LSA_AUTH_INFORMATION* (+40, 8byte)  varptr(st)+40 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global TRUSTED_DOMAIN_AUTH_INFORMATION
    #field int IncomingAuthInfos
    #field intptr IncomingAuthenticationInformation
    #field intptr IncomingPreviousAuthenticationInformation
    #field int OutgoingAuthInfos
    #field intptr OutgoingAuthenticationInformation
    #field intptr OutgoingPreviousAuthenticationInformation
#endstruct

stdim st, TRUSTED_DOMAIN_AUTH_INFORMATION        ; NSTRUCT 変数を確保
st->IncomingAuthInfos = 100
mes "IncomingAuthInfos=" + st->IncomingAuthInfos