CLAIM_SECURITY_ATTRIBUTES_INFORMATION
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Version | WORD | 2 | +0 | +0 | この構造体のバージョン番号。通常はV1を示す。 |
| Reserved | WORD | 2 | +2 | +2 | 予約フィールド。0を設定する。 |
| AttributeCount | DWORD | 4 | +4 | +4 | Attribute内のクレーム属性の数。 |
| Attribute | _Attribute_e__Union | 8/4 | +8 | +8 | クレーム属性配列を保持する無名共用体。 |
共用体: _Attribute_e__Union x64 8B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| pAttributeV1 | CLAIM_SECURITY_ATTRIBUTE_V1* | 8/4 | +0 | +0 |
各言語での定義
#include <windows.h>
// CLAIM_SECURITY_ATTRIBUTES_INFORMATION (x64 16 / x86 12 バイト)
typedef struct CLAIM_SECURITY_ATTRIBUTES_INFORMATION {
WORD Version;
WORD Reserved;
DWORD AttributeCount;
_Attribute_e__Union Attribute;
} CLAIM_SECURITY_ATTRIBUTES_INFORMATION;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CLAIM_SECURITY_ATTRIBUTES_INFORMATION
{
public ushort Version;
public ushort Reserved;
public uint AttributeCount;
public _Attribute_e__Union Attribute;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CLAIM_SECURITY_ATTRIBUTES_INFORMATION
Public Version As UShort
Public Reserved As UShort
Public AttributeCount As UInteger
Public Attribute As _Attribute_e__Union
End Structureimport ctypes
from ctypes import wintypes
class CLAIM_SECURITY_ATTRIBUTES_INFORMATION(ctypes.Structure):
_fields_ = [
("Version", ctypes.c_ushort),
("Reserved", ctypes.c_ushort),
("AttributeCount", wintypes.DWORD),
("Attribute", _Attribute_e__Union),
]#[repr(C)]
pub struct CLAIM_SECURITY_ATTRIBUTES_INFORMATION {
pub Version: u16,
pub Reserved: u16,
pub AttributeCount: u32,
pub Attribute: _Attribute_e__Union,
}import "golang.org/x/sys/windows"
type CLAIM_SECURITY_ATTRIBUTES_INFORMATION struct {
Version uint16
Reserved uint16
AttributeCount uint32
Attribute _Attribute_e__Union
}type
CLAIM_SECURITY_ATTRIBUTES_INFORMATION = record
Version: Word;
Reserved: Word;
AttributeCount: DWORD;
Attribute: _Attribute_e__Union;
end;const CLAIM_SECURITY_ATTRIBUTES_INFORMATION = extern struct {
Version: u16,
Reserved: u16,
AttributeCount: u32,
Attribute: _Attribute_e__Union,
};type
CLAIM_SECURITY_ATTRIBUTES_INFORMATION {.bycopy.} = object
Version: uint16
Reserved: uint16
AttributeCount: uint32
Attribute: _Attribute_e__Unionstruct CLAIM_SECURITY_ATTRIBUTES_INFORMATION
{
ushort Version;
ushort Reserved;
uint AttributeCount;
_Attribute_e__Union Attribute;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; CLAIM_SECURITY_ATTRIBUTES_INFORMATION サイズ: 12 バイト(x86)
dim st, 3 ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; Version : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; Reserved : WORD (+2, 2byte) wpoke st,2,値 / 値 = wpeek(st,2)
; AttributeCount : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Attribute : _Attribute_e__Union (+8, 4byte) varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CLAIM_SECURITY_ATTRIBUTES_INFORMATION サイズ: 16 バイト(x64)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; Version : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; Reserved : WORD (+2, 2byte) wpoke st,2,値 / 値 = wpeek(st,2)
; AttributeCount : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Attribute : _Attribute_e__Union (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CLAIM_SECURITY_ATTRIBUTES_INFORMATION
#field short Version
#field short Reserved
#field int AttributeCount
#field byte Attribute 8
#endstruct
stdim st, CLAIM_SECURITY_ATTRIBUTES_INFORMATION ; NSTRUCT 変数を確保
st->Version = 100
mes "Version=" + st->Version
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。