ホーム › NetworkManagement.QoS › SIPAEVENT_SI_POLICY_CERTIFICATE_PAYLOAD
SIPAEVENT_SI_POLICY_CERTIFICATE_PAYLOAD
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| PublisherCommonNameLength | WORD | 2 | +0 | +0 | 発行元コモンネームの文字数(長さ)。 |
| IssuerCommonNameLength | WORD | 2 | +2 | +2 | 発行者コモンネームの文字数(長さ)。 |
| HashAlgID | DWORD | 4 | +4 | +4 | ダイジェストのハッシュアルゴリズムIDを示す値。 |
| DigestLength | WORD | 2 | +8 | +8 | ダイジェストのバイト長。 |
| VarLengthData | BYTE | 1 | +10 | +10 | 各コモンネームとダイジェストを含む可変長データの先頭バイト。 |
各言語での定義
#include <windows.h>
// SIPAEVENT_SI_POLICY_CERTIFICATE_PAYLOAD (x64 11 / x86 11 バイト)
#pragma pack(push, 1)
typedef struct SIPAEVENT_SI_POLICY_CERTIFICATE_PAYLOAD {
WORD PublisherCommonNameLength;
WORD IssuerCommonNameLength;
DWORD HashAlgID;
WORD DigestLength;
BYTE VarLengthData[1];
} SIPAEVENT_SI_POLICY_CERTIFICATE_PAYLOAD;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct SIPAEVENT_SI_POLICY_CERTIFICATE_PAYLOAD
{
public ushort PublisherCommonNameLength;
public ushort IssuerCommonNameLength;
public uint HashAlgID;
public ushort DigestLength;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public byte[] VarLengthData;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure SIPAEVENT_SI_POLICY_CERTIFICATE_PAYLOAD
Public PublisherCommonNameLength As UShort
Public IssuerCommonNameLength As UShort
Public HashAlgID As UInteger
Public DigestLength As UShort
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public VarLengthData() As Byte
End Structureimport ctypes
from ctypes import wintypes
class SIPAEVENT_SI_POLICY_CERTIFICATE_PAYLOAD(ctypes.Structure):
_pack_ = 1
_fields_ = [
("PublisherCommonNameLength", ctypes.c_ushort),
("IssuerCommonNameLength", ctypes.c_ushort),
("HashAlgID", wintypes.DWORD),
("DigestLength", ctypes.c_ushort),
("VarLengthData", ctypes.c_ubyte * 1),
]#[repr(C, packed(1))]
pub struct SIPAEVENT_SI_POLICY_CERTIFICATE_PAYLOAD {
pub PublisherCommonNameLength: u16,
pub IssuerCommonNameLength: u16,
pub HashAlgID: u32,
pub DigestLength: u16,
pub VarLengthData: [u8; 1],
}import "golang.org/x/sys/windows"
type SIPAEVENT_SI_POLICY_CERTIFICATE_PAYLOAD struct {
PublisherCommonNameLength uint16
IssuerCommonNameLength uint16
HashAlgID uint32
DigestLength uint16
VarLengthData [1]byte
}type
SIPAEVENT_SI_POLICY_CERTIFICATE_PAYLOAD = packed record
PublisherCommonNameLength: Word;
IssuerCommonNameLength: Word;
HashAlgID: DWORD;
DigestLength: Word;
VarLengthData: array[0..0] of Byte;
end;const SIPAEVENT_SI_POLICY_CERTIFICATE_PAYLOAD = extern struct {
PublisherCommonNameLength: u16,
IssuerCommonNameLength: u16,
HashAlgID: u32,
DigestLength: u16,
VarLengthData: [1]u8,
};type
SIPAEVENT_SI_POLICY_CERTIFICATE_PAYLOAD {.packed.} = object
PublisherCommonNameLength: uint16
IssuerCommonNameLength: uint16
HashAlgID: uint32
DigestLength: uint16
VarLengthData: array[1, uint8]align(1)
struct SIPAEVENT_SI_POLICY_CERTIFICATE_PAYLOAD
{
ushort PublisherCommonNameLength;
ushort IssuerCommonNameLength;
uint HashAlgID;
ushort DigestLength;
ubyte[1] VarLengthData;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SIPAEVENT_SI_POLICY_CERTIFICATE_PAYLOAD サイズ: 11 バイト(x64)
dim st, 3 ; 4byte整数×3(構造体サイズ 11 / 4 切り上げ)
; PublisherCommonNameLength : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; IssuerCommonNameLength : WORD (+2, 2byte) wpoke st,2,値 / 値 = wpeek(st,2)
; HashAlgID : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; DigestLength : WORD (+8, 2byte) wpoke st,8,値 / 値 = wpeek(st,8)
; VarLengthData : BYTE (+10, 1byte) varptr(st)+10 を基点に操作(1byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SIPAEVENT_SI_POLICY_CERTIFICATE_PAYLOAD, pack=1
#field short PublisherCommonNameLength
#field short IssuerCommonNameLength
#field int HashAlgID
#field short DigestLength
#field byte VarLengthData 1
#endstruct
stdim st, SIPAEVENT_SI_POLICY_CERTIFICATE_PAYLOAD ; NSTRUCT 変数を確保
st->PublisherCommonNameLength = 100
mes "PublisherCommonNameLength=" + st->PublisherCommonNameLength