SE_ACCESS_REPLY
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Size | DWORD | 4 | +0 | +0 | この構造体のバイト数。 |
| ResultListCount | DWORD | 4 | +4 | +4 | 各結果配列の要素数。 |
| GrantedAccess | DWORD* | 8/4 | +8 | +8 | オブジェクトごとに付与されたアクセス権マスク配列へのポインタ。 |
| AccessStatus | DWORD* | 8/4 | +16 | +12 | オブジェクトごとのアクセス判定状態コード配列へのポインタ。 |
| AccessReason | ACCESS_REASONS* | 8/4 | +24 | +16 | オブジェクトごとのアクセス理由配列へのポインタ。 |
| Privileges | PRIVILEGE_SET** | 8/4 | +32 | +20 | 使用された特権集合へのポインタの配列。 |
各言語での定義
#include <windows.h>
// SE_ACCESS_REPLY (x64 40 / x86 24 バイト)
typedef struct SE_ACCESS_REPLY {
DWORD Size;
DWORD ResultListCount;
DWORD* GrantedAccess;
DWORD* AccessStatus;
ACCESS_REASONS* AccessReason;
PRIVILEGE_SET** Privileges;
} SE_ACCESS_REPLY;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SE_ACCESS_REPLY
{
public uint Size;
public uint ResultListCount;
public IntPtr GrantedAccess;
public IntPtr AccessStatus;
public IntPtr AccessReason;
public IntPtr Privileges;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SE_ACCESS_REPLY
Public Size As UInteger
Public ResultListCount As UInteger
Public GrantedAccess As IntPtr
Public AccessStatus As IntPtr
Public AccessReason As IntPtr
Public Privileges As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class SE_ACCESS_REPLY(ctypes.Structure):
_fields_ = [
("Size", wintypes.DWORD),
("ResultListCount", wintypes.DWORD),
("GrantedAccess", ctypes.c_void_p),
("AccessStatus", ctypes.c_void_p),
("AccessReason", ctypes.c_void_p),
("Privileges", ctypes.c_void_p),
]#[repr(C)]
pub struct SE_ACCESS_REPLY {
pub Size: u32,
pub ResultListCount: u32,
pub GrantedAccess: *mut core::ffi::c_void,
pub AccessStatus: *mut core::ffi::c_void,
pub AccessReason: *mut core::ffi::c_void,
pub Privileges: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type SE_ACCESS_REPLY struct {
Size uint32
ResultListCount uint32
GrantedAccess uintptr
AccessStatus uintptr
AccessReason uintptr
Privileges uintptr
}type
SE_ACCESS_REPLY = record
Size: DWORD;
ResultListCount: DWORD;
GrantedAccess: Pointer;
AccessStatus: Pointer;
AccessReason: Pointer;
Privileges: Pointer;
end;const SE_ACCESS_REPLY = extern struct {
Size: u32,
ResultListCount: u32,
GrantedAccess: ?*anyopaque,
AccessStatus: ?*anyopaque,
AccessReason: ?*anyopaque,
Privileges: ?*anyopaque,
};type
SE_ACCESS_REPLY {.bycopy.} = object
Size: uint32
ResultListCount: uint32
GrantedAccess: pointer
AccessStatus: pointer
AccessReason: pointer
Privileges: pointerstruct SE_ACCESS_REPLY
{
uint Size;
uint ResultListCount;
void* GrantedAccess;
void* AccessStatus;
void* AccessReason;
void* Privileges;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SE_ACCESS_REPLY サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; Size : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; ResultListCount : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; GrantedAccess : DWORD* (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; AccessStatus : DWORD* (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; AccessReason : ACCESS_REASONS* (+16, 4byte) varptr(st)+16 を基点に操作(4byte:入れ子/配列)
; Privileges : PRIVILEGE_SET** (+20, 4byte) varptr(st)+20 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SE_ACCESS_REPLY サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; Size : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; ResultListCount : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; GrantedAccess : DWORD* (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; AccessStatus : DWORD* (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; AccessReason : ACCESS_REASONS* (+24, 8byte) varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; Privileges : PRIVILEGE_SET** (+32, 8byte) varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SE_ACCESS_REPLY
#field int Size
#field int ResultListCount
#field intptr GrantedAccess
#field intptr AccessStatus
#field intptr AccessReason
#field intptr Privileges
#endstruct
stdim st, SE_ACCESS_REPLY ; NSTRUCT 変数を確保
st->Size = 100
mes "Size=" + st->Size