ホーム › Security.Authentication.Identity › KSEC_LIST_ENTRY
KSEC_LIST_ENTRY
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| List | LIST_ENTRY | 16/8 | +0 | +0 | 双方向リンクリストの前後ポインタを保持するLIST_ENTRY構造。 |
| RefCount | INT | 4 | +16 | +8 | このエントリの参照カウントを保持する。 |
| Signature | DWORD | 4 | +20 | +12 | 構造体の整合性検証用のシグネチャ値を保持する。 |
| OwningList | void* | 8/4 | +24 | +16 | このエントリを所有するリストへのポインタ。 |
| Reserved | void* | 8/4 | +32 | +20 | 将来の拡張用に予約されたポインタ。 |
各言語での定義
#include <windows.h>
// LIST_ENTRY (x64 16 / x86 8 バイト)
typedef struct LIST_ENTRY {
LIST_ENTRY* Flink;
LIST_ENTRY* Blink;
} LIST_ENTRY;
// KSEC_LIST_ENTRY (x64 40 / x86 24 バイト)
typedef struct KSEC_LIST_ENTRY {
LIST_ENTRY List;
INT RefCount;
DWORD Signature;
void* OwningList;
void* Reserved;
} KSEC_LIST_ENTRY;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct LIST_ENTRY
{
public IntPtr Flink;
public IntPtr Blink;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSEC_LIST_ENTRY
{
public LIST_ENTRY List;
public int RefCount;
public uint Signature;
public IntPtr OwningList;
public IntPtr Reserved;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure LIST_ENTRY
Public Flink As IntPtr
Public Blink As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSEC_LIST_ENTRY
Public List As LIST_ENTRY
Public RefCount As Integer
Public Signature As UInteger
Public OwningList As IntPtr
Public Reserved As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class LIST_ENTRY(ctypes.Structure):
_fields_ = [
("Flink", ctypes.c_void_p),
("Blink", ctypes.c_void_p),
]
class KSEC_LIST_ENTRY(ctypes.Structure):
_fields_ = [
("List", LIST_ENTRY),
("RefCount", ctypes.c_int),
("Signature", wintypes.DWORD),
("OwningList", ctypes.c_void_p),
("Reserved", ctypes.c_void_p),
]#[repr(C)]
pub struct LIST_ENTRY {
pub Flink: *mut core::ffi::c_void,
pub Blink: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct KSEC_LIST_ENTRY {
pub List: LIST_ENTRY,
pub RefCount: i32,
pub Signature: u32,
pub OwningList: *mut core::ffi::c_void,
pub Reserved: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type LIST_ENTRY struct {
Flink uintptr
Blink uintptr
}
type KSEC_LIST_ENTRY struct {
List LIST_ENTRY
RefCount int32
Signature uint32
OwningList uintptr
Reserved uintptr
}type
LIST_ENTRY = record
Flink: Pointer;
Blink: Pointer;
end;
KSEC_LIST_ENTRY = record
List: LIST_ENTRY;
RefCount: Integer;
Signature: DWORD;
OwningList: Pointer;
Reserved: Pointer;
end;const LIST_ENTRY = extern struct {
Flink: ?*anyopaque,
Blink: ?*anyopaque,
};
const KSEC_LIST_ENTRY = extern struct {
List: LIST_ENTRY,
RefCount: i32,
Signature: u32,
OwningList: ?*anyopaque,
Reserved: ?*anyopaque,
};type
LIST_ENTRY {.bycopy.} = object
Flink: pointer
Blink: pointer
KSEC_LIST_ENTRY {.bycopy.} = object
List: LIST_ENTRY
RefCount: int32
Signature: uint32
OwningList: pointer
Reserved: pointerstruct LIST_ENTRY
{
void* Flink;
void* Blink;
}
struct KSEC_LIST_ENTRY
{
LIST_ENTRY List;
int RefCount;
uint Signature;
void* OwningList;
void* Reserved;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; KSEC_LIST_ENTRY サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; List : LIST_ENTRY (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; RefCount : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Signature : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; OwningList : void* (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; Reserved : void* (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; KSEC_LIST_ENTRY サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; List : LIST_ENTRY (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; RefCount : INT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; Signature : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; OwningList : void* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; Reserved : void* (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global LIST_ENTRY
#field intptr Flink
#field intptr Blink
#endstruct
#defstruct global KSEC_LIST_ENTRY
#field LIST_ENTRY List
#field int RefCount
#field int Signature
#field intptr OwningList
#field intptr Reserved
#endstruct
stdim st, KSEC_LIST_ENTRY ; NSTRUCT 変数を確保
st->RefCount = 100
mes "RefCount=" + st->RefCount