Win32 API 日本語リファレンス
ホームNetworkManagement.QoS › SIPAEVENT_VSM_IDK_INFO_PAYLOAD

SIPAEVENT_VSM_IDK_INFO_PAYLOAD

構造体
サイズx64: 17 バイト / x86: 17 バイトパッキング1

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

フィールド

フィールドサイズx64x86説明
KeyAlgIDDWORD4+0+0鍵アルゴリズムを示すID。
Anonymous_Anonymous_e__Union13+4+4アルゴリズムに応じた鍵情報を保持する共用体。

共用体: _Anonymous_e__Union x64 13B / x86 13B

フィールドサイズx64x86
RsaKeyInfoSIPAEVENT_VSM_IDK_RSA_INFO13+0+0

各言語での定義

#include <windows.h>

// SIPAEVENT_VSM_IDK_INFO_PAYLOAD  (x64 17 / x86 17 バイト)
#pragma pack(push, 1)
typedef struct SIPAEVENT_VSM_IDK_INFO_PAYLOAD {
    DWORD KeyAlgID;
    _Anonymous_e__Union Anonymous;
} SIPAEVENT_VSM_IDK_INFO_PAYLOAD;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct SIPAEVENT_VSM_IDK_INFO_PAYLOAD
{
    public uint KeyAlgID;
    public _Anonymous_e__Union Anonymous;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure SIPAEVENT_VSM_IDK_INFO_PAYLOAD
    Public KeyAlgID As UInteger
    Public Anonymous As _Anonymous_e__Union
End Structure
import ctypes
from ctypes import wintypes

class SIPAEVENT_VSM_IDK_INFO_PAYLOAD(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("KeyAlgID", wintypes.DWORD),
        ("Anonymous", _Anonymous_e__Union),
    ]
#[repr(C, packed(1))]
pub struct SIPAEVENT_VSM_IDK_INFO_PAYLOAD {
    pub KeyAlgID: u32,
    pub Anonymous: _Anonymous_e__Union,
}
import "golang.org/x/sys/windows"

type SIPAEVENT_VSM_IDK_INFO_PAYLOAD struct {
	KeyAlgID uint32
	Anonymous _Anonymous_e__Union
}
type
  SIPAEVENT_VSM_IDK_INFO_PAYLOAD = packed record
    KeyAlgID: DWORD;
    Anonymous: _Anonymous_e__Union;
  end;
const SIPAEVENT_VSM_IDK_INFO_PAYLOAD = extern struct {
    KeyAlgID: u32,
    Anonymous: _Anonymous_e__Union,
};
type
  SIPAEVENT_VSM_IDK_INFO_PAYLOAD {.packed.} = object
    KeyAlgID: uint32
    Anonymous: _Anonymous_e__Union
align(1)
struct SIPAEVENT_VSM_IDK_INFO_PAYLOAD
{
    uint KeyAlgID;
    _Anonymous_e__Union Anonymous;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SIPAEVENT_VSM_IDK_INFO_PAYLOAD サイズ: 17 バイト(x64)
dim st, 5    ; 4byte整数×5(構造体サイズ 17 / 4 切り上げ)
; KeyAlgID : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+4, 13byte)  varptr(st)+4 を基点に操作(13byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SIPAEVENT_VSM_IDK_INFO_PAYLOAD, pack=1
    #field int KeyAlgID
    #field byte Anonymous 13
#endstruct

stdim st, SIPAEVENT_VSM_IDK_INFO_PAYLOAD        ; NSTRUCT 変数を確保
st->KeyAlgID = 100
mes "KeyAlgID=" + st->KeyAlgID
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。