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

SECURITY_PACKAGE_OPTIONS

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

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

フィールド

フィールドサイズx64x86説明
SizeDWORD4+0+0本構造体のサイズ(バイト数)。
TypeSECURITY_PACKAGE_OPTIONS_TYPE4+4+4追加するセキュリティパッケージの種別を示すSECURITY_PACKAGE_OPTIONS_TYPE値。
FlagsDWORD4+8+8パッケージ追加動作を制御するビットフラグ。
SignatureSizeDWORD4+12+12Signatureが指す署名データのサイズ(バイト数)。
Signaturevoid*8/4+16+16パッケージモジュールの署名データを指すポインタ。NULL可。

各言語での定義

#include <windows.h>

// SECURITY_PACKAGE_OPTIONS  (x64 24 / x86 20 バイト)
typedef struct SECURITY_PACKAGE_OPTIONS {
    DWORD Size;
    SECURITY_PACKAGE_OPTIONS_TYPE Type;
    DWORD Flags;
    DWORD SignatureSize;
    void* Signature;
} SECURITY_PACKAGE_OPTIONS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SECURITY_PACKAGE_OPTIONS
{
    public uint Size;
    public uint Type;
    public uint Flags;
    public uint SignatureSize;
    public IntPtr Signature;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SECURITY_PACKAGE_OPTIONS
    Public Size As UInteger
    Public Type As UInteger
    Public Flags As UInteger
    Public SignatureSize As UInteger
    Public Signature As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class SECURITY_PACKAGE_OPTIONS(ctypes.Structure):
    _fields_ = [
        ("Size", wintypes.DWORD),
        ("Type", wintypes.DWORD),
        ("Flags", wintypes.DWORD),
        ("SignatureSize", wintypes.DWORD),
        ("Signature", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct SECURITY_PACKAGE_OPTIONS {
    pub Size: u32,
    pub Type: u32,
    pub Flags: u32,
    pub SignatureSize: u32,
    pub Signature: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type SECURITY_PACKAGE_OPTIONS struct {
	Size uint32
	Type uint32
	Flags uint32
	SignatureSize uint32
	Signature uintptr
}
type
  SECURITY_PACKAGE_OPTIONS = record
    Size: DWORD;
    Type: DWORD;
    Flags: DWORD;
    SignatureSize: DWORD;
    Signature: Pointer;
  end;
const SECURITY_PACKAGE_OPTIONS = extern struct {
    Size: u32,
    Type: u32,
    Flags: u32,
    SignatureSize: u32,
    Signature: ?*anyopaque,
};
type
  SECURITY_PACKAGE_OPTIONS {.bycopy.} = object
    Size: uint32
    Type: uint32
    Flags: uint32
    SignatureSize: uint32
    Signature: pointer
struct SECURITY_PACKAGE_OPTIONS
{
    uint Size;
    uint Type;
    uint Flags;
    uint SignatureSize;
    void* Signature;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SECURITY_PACKAGE_OPTIONS サイズ: 20 バイト(x86)
dim st, 5    ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; Size : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Type : SECURITY_PACKAGE_OPTIONS_TYPE (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; Flags : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; SignatureSize : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; Signature : void* (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SECURITY_PACKAGE_OPTIONS サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; Size : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Type : SECURITY_PACKAGE_OPTIONS_TYPE (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; Flags : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; SignatureSize : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; Signature : void* (+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 SECURITY_PACKAGE_OPTIONS
    #field int Size
    #field int Type
    #field int Flags
    #field int SignatureSize
    #field intptr Signature
#endstruct

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