ホーム › Security.Authentication.Identity › LSA_DISPATCH_TABLE
LSA_DISPATCH_TABLE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| CreateLogonSession | PLSA_CREATE_LOGON_SESSION | 8/4 | +0 | +0 | ログオンセッションを作成するLSA関数へのポインタ。 |
| DeleteLogonSession | PLSA_DELETE_LOGON_SESSION | 8/4 | +8 | +4 | ログオンセッションを削除するLSA関数へのポインタ。 |
| AddCredential | PLSA_ADD_CREDENTIAL | 8/4 | +16 | +8 | ログオンセッションへ資格情報を追加するLSA関数へのポインタ。 |
| GetCredentials | PLSA_GET_CREDENTIALS | 8/4 | +24 | +12 | ログオンセッションの資格情報を取得するLSA関数へのポインタ。 |
| DeleteCredential | PLSA_DELETE_CREDENTIAL | 8/4 | +32 | +16 | ログオンセッションから資格情報を削除するLSA関数へのポインタ。 |
| AllocateLsaHeap | PLSA_ALLOCATE_LSA_HEAP | 8/4 | +40 | +20 | LSAプロセスヒープからメモリを割り当てる関数へのポインタ。 |
| FreeLsaHeap | PLSA_FREE_LSA_HEAP | 8/4 | +48 | +24 | LSAヒープのメモリを解放する関数へのポインタ。 |
| AllocateClientBuffer | PLSA_ALLOCATE_CLIENT_BUFFER | 8/4 | +56 | +28 | クライアントプロセス内にバッファを割り当てる関数へのポインタ。 |
| FreeClientBuffer | PLSA_FREE_CLIENT_BUFFER | 8/4 | +64 | +32 | クライアントプロセス内のバッファを解放する関数へのポインタ。 |
| CopyToClientBuffer | PLSA_COPY_TO_CLIENT_BUFFER | 8/4 | +72 | +36 | LSAからクライアントバッファへデータを複写する関数へのポインタ。 |
| CopyFromClientBuffer | PLSA_COPY_FROM_CLIENT_BUFFER | 8/4 | +80 | +40 | クライアントバッファからLSAへデータを複写する関数へのポインタ。 |
各言語での定義
#include <windows.h>
// LSA_DISPATCH_TABLE (x64 88 / x86 44 バイト)
typedef struct LSA_DISPATCH_TABLE {
PLSA_CREATE_LOGON_SESSION CreateLogonSession;
PLSA_DELETE_LOGON_SESSION DeleteLogonSession;
PLSA_ADD_CREDENTIAL AddCredential;
PLSA_GET_CREDENTIALS GetCredentials;
PLSA_DELETE_CREDENTIAL DeleteCredential;
PLSA_ALLOCATE_LSA_HEAP AllocateLsaHeap;
PLSA_FREE_LSA_HEAP FreeLsaHeap;
PLSA_ALLOCATE_CLIENT_BUFFER AllocateClientBuffer;
PLSA_FREE_CLIENT_BUFFER FreeClientBuffer;
PLSA_COPY_TO_CLIENT_BUFFER CopyToClientBuffer;
PLSA_COPY_FROM_CLIENT_BUFFER CopyFromClientBuffer;
} LSA_DISPATCH_TABLE;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct LSA_DISPATCH_TABLE
{
public IntPtr CreateLogonSession;
public IntPtr DeleteLogonSession;
public IntPtr AddCredential;
public IntPtr GetCredentials;
public IntPtr DeleteCredential;
public IntPtr AllocateLsaHeap;
public IntPtr FreeLsaHeap;
public IntPtr AllocateClientBuffer;
public IntPtr FreeClientBuffer;
public IntPtr CopyToClientBuffer;
public IntPtr CopyFromClientBuffer;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure LSA_DISPATCH_TABLE
Public CreateLogonSession As IntPtr
Public DeleteLogonSession As IntPtr
Public AddCredential As IntPtr
Public GetCredentials As IntPtr
Public DeleteCredential As IntPtr
Public AllocateLsaHeap As IntPtr
Public FreeLsaHeap As IntPtr
Public AllocateClientBuffer As IntPtr
Public FreeClientBuffer As IntPtr
Public CopyToClientBuffer As IntPtr
Public CopyFromClientBuffer As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class LSA_DISPATCH_TABLE(ctypes.Structure):
_fields_ = [
("CreateLogonSession", ctypes.c_void_p),
("DeleteLogonSession", ctypes.c_void_p),
("AddCredential", ctypes.c_void_p),
("GetCredentials", ctypes.c_void_p),
("DeleteCredential", ctypes.c_void_p),
("AllocateLsaHeap", ctypes.c_void_p),
("FreeLsaHeap", ctypes.c_void_p),
("AllocateClientBuffer", ctypes.c_void_p),
("FreeClientBuffer", ctypes.c_void_p),
("CopyToClientBuffer", ctypes.c_void_p),
("CopyFromClientBuffer", ctypes.c_void_p),
]#[repr(C)]
pub struct LSA_DISPATCH_TABLE {
pub CreateLogonSession: *mut core::ffi::c_void,
pub DeleteLogonSession: *mut core::ffi::c_void,
pub AddCredential: *mut core::ffi::c_void,
pub GetCredentials: *mut core::ffi::c_void,
pub DeleteCredential: *mut core::ffi::c_void,
pub AllocateLsaHeap: *mut core::ffi::c_void,
pub FreeLsaHeap: *mut core::ffi::c_void,
pub AllocateClientBuffer: *mut core::ffi::c_void,
pub FreeClientBuffer: *mut core::ffi::c_void,
pub CopyToClientBuffer: *mut core::ffi::c_void,
pub CopyFromClientBuffer: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type LSA_DISPATCH_TABLE struct {
CreateLogonSession uintptr
DeleteLogonSession uintptr
AddCredential uintptr
GetCredentials uintptr
DeleteCredential uintptr
AllocateLsaHeap uintptr
FreeLsaHeap uintptr
AllocateClientBuffer uintptr
FreeClientBuffer uintptr
CopyToClientBuffer uintptr
CopyFromClientBuffer uintptr
}type
LSA_DISPATCH_TABLE = record
CreateLogonSession: Pointer;
DeleteLogonSession: Pointer;
AddCredential: Pointer;
GetCredentials: Pointer;
DeleteCredential: Pointer;
AllocateLsaHeap: Pointer;
FreeLsaHeap: Pointer;
AllocateClientBuffer: Pointer;
FreeClientBuffer: Pointer;
CopyToClientBuffer: Pointer;
CopyFromClientBuffer: Pointer;
end;const LSA_DISPATCH_TABLE = extern struct {
CreateLogonSession: ?*anyopaque,
DeleteLogonSession: ?*anyopaque,
AddCredential: ?*anyopaque,
GetCredentials: ?*anyopaque,
DeleteCredential: ?*anyopaque,
AllocateLsaHeap: ?*anyopaque,
FreeLsaHeap: ?*anyopaque,
AllocateClientBuffer: ?*anyopaque,
FreeClientBuffer: ?*anyopaque,
CopyToClientBuffer: ?*anyopaque,
CopyFromClientBuffer: ?*anyopaque,
};type
LSA_DISPATCH_TABLE {.bycopy.} = object
CreateLogonSession: pointer
DeleteLogonSession: pointer
AddCredential: pointer
GetCredentials: pointer
DeleteCredential: pointer
AllocateLsaHeap: pointer
FreeLsaHeap: pointer
AllocateClientBuffer: pointer
FreeClientBuffer: pointer
CopyToClientBuffer: pointer
CopyFromClientBuffer: pointerstruct LSA_DISPATCH_TABLE
{
void* CreateLogonSession;
void* DeleteLogonSession;
void* AddCredential;
void* GetCredentials;
void* DeleteCredential;
void* AllocateLsaHeap;
void* FreeLsaHeap;
void* AllocateClientBuffer;
void* FreeClientBuffer;
void* CopyToClientBuffer;
void* CopyFromClientBuffer;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; LSA_DISPATCH_TABLE サイズ: 44 バイト(x86)
dim st, 11 ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; CreateLogonSession : PLSA_CREATE_LOGON_SESSION (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; DeleteLogonSession : PLSA_DELETE_LOGON_SESSION (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; AddCredential : PLSA_ADD_CREDENTIAL (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; GetCredentials : PLSA_GET_CREDENTIALS (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; DeleteCredential : PLSA_DELETE_CREDENTIAL (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; AllocateLsaHeap : PLSA_ALLOCATE_LSA_HEAP (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; FreeLsaHeap : PLSA_FREE_LSA_HEAP (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; AllocateClientBuffer : PLSA_ALLOCATE_CLIENT_BUFFER (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; FreeClientBuffer : PLSA_FREE_CLIENT_BUFFER (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; CopyToClientBuffer : PLSA_COPY_TO_CLIENT_BUFFER (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; CopyFromClientBuffer : PLSA_COPY_FROM_CLIENT_BUFFER (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; LSA_DISPATCH_TABLE サイズ: 88 バイト(x64)
dim st, 22 ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; CreateLogonSession : PLSA_CREATE_LOGON_SESSION (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; DeleteLogonSession : PLSA_DELETE_LOGON_SESSION (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; AddCredential : PLSA_ADD_CREDENTIAL (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; GetCredentials : PLSA_GET_CREDENTIALS (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; DeleteCredential : PLSA_DELETE_CREDENTIAL (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; AllocateLsaHeap : PLSA_ALLOCATE_LSA_HEAP (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; FreeLsaHeap : PLSA_FREE_LSA_HEAP (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; AllocateClientBuffer : PLSA_ALLOCATE_CLIENT_BUFFER (+56, 8byte) qpoke st,56,値 / qpeek(st,56) ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; FreeClientBuffer : PLSA_FREE_CLIENT_BUFFER (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; CopyToClientBuffer : PLSA_COPY_TO_CLIENT_BUFFER (+72, 8byte) qpoke st,72,値 / qpeek(st,72) ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; CopyFromClientBuffer : PLSA_COPY_FROM_CLIENT_BUFFER (+80, 8byte) qpoke st,80,値 / qpeek(st,80) ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global LSA_DISPATCH_TABLE
#field intptr CreateLogonSession
#field intptr DeleteLogonSession
#field intptr AddCredential
#field intptr GetCredentials
#field intptr DeleteCredential
#field intptr AllocateLsaHeap
#field intptr FreeLsaHeap
#field intptr AllocateClientBuffer
#field intptr FreeClientBuffer
#field intptr CopyToClientBuffer
#field intptr CopyFromClientBuffer
#endstruct
stdim st, LSA_DISPATCH_TABLE ; NSTRUCT 変数を確保