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

LSA_AUTH_INFORMATION

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

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

フィールド

フィールドサイズx64x86説明
LastUpdateTimeLONGLONG8+0+0この認証情報の最終更新日時(100ナノ秒単位)。
AuthTypeLSA_AUTH_INFORMATION_AUTH_TYPE4+8+8認証情報の種類(クリアテキスト/NT等)を示す列挙値。
AuthInfoLengthDWORD4+12+12AuthInfoのバイト長。
AuthInfoBYTE*8/4+16+16認証情報本体の生データへのポインタ。

各言語での定義

#include <windows.h>

// LSA_AUTH_INFORMATION  (x64 24 / x86 24 バイト)
typedef struct LSA_AUTH_INFORMATION {
    LONGLONG LastUpdateTime;
    LSA_AUTH_INFORMATION_AUTH_TYPE AuthType;
    DWORD AuthInfoLength;
    BYTE* AuthInfo;
} LSA_AUTH_INFORMATION;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct LSA_AUTH_INFORMATION
{
    public long LastUpdateTime;
    public uint AuthType;
    public uint AuthInfoLength;
    public IntPtr AuthInfo;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure LSA_AUTH_INFORMATION
    Public LastUpdateTime As Long
    Public AuthType As UInteger
    Public AuthInfoLength As UInteger
    Public AuthInfo As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class LSA_AUTH_INFORMATION(ctypes.Structure):
    _fields_ = [
        ("LastUpdateTime", ctypes.c_longlong),
        ("AuthType", wintypes.DWORD),
        ("AuthInfoLength", wintypes.DWORD),
        ("AuthInfo", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct LSA_AUTH_INFORMATION {
    pub LastUpdateTime: i64,
    pub AuthType: u32,
    pub AuthInfoLength: u32,
    pub AuthInfo: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type LSA_AUTH_INFORMATION struct {
	LastUpdateTime int64
	AuthType uint32
	AuthInfoLength uint32
	AuthInfo uintptr
}
type
  LSA_AUTH_INFORMATION = record
    LastUpdateTime: Int64;
    AuthType: DWORD;
    AuthInfoLength: DWORD;
    AuthInfo: Pointer;
  end;
const LSA_AUTH_INFORMATION = extern struct {
    LastUpdateTime: i64,
    AuthType: u32,
    AuthInfoLength: u32,
    AuthInfo: ?*anyopaque,
};
type
  LSA_AUTH_INFORMATION {.bycopy.} = object
    LastUpdateTime: int64
    AuthType: uint32
    AuthInfoLength: uint32
    AuthInfo: pointer
struct LSA_AUTH_INFORMATION
{
    long LastUpdateTime;
    uint AuthType;
    uint AuthInfoLength;
    void* AuthInfo;
}

HSP用 定義

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

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

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