ホーム › Security.Authentication.Identity › SECPKG_SERIALIZED_OID
SECPKG_SERIALIZED_OID
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| OidLength | DWORD | 4 | +0 | +0 | OidValueが保持するOIDデータの長さ(バイト数)。 |
| OidAttributes | DWORD | 4 | +4 | +4 | OIDに付随する属性を示すビットフラグ。 |
| OidValue | BYTE | 32 | +8 | +8 | シリアライズされたOID値を保持する可変長バイト配列の先頭要素。 |
各言語での定義
#include <windows.h>
// SECPKG_SERIALIZED_OID (x64 40 / x86 40 バイト)
typedef struct SECPKG_SERIALIZED_OID {
DWORD OidLength;
DWORD OidAttributes;
BYTE OidValue[32];
} SECPKG_SERIALIZED_OID;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SECPKG_SERIALIZED_OID
{
public uint OidLength;
public uint OidAttributes;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public byte[] OidValue;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SECPKG_SERIALIZED_OID
Public OidLength As UInteger
Public OidAttributes As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=32)> Public OidValue() As Byte
End Structureimport ctypes
from ctypes import wintypes
class SECPKG_SERIALIZED_OID(ctypes.Structure):
_fields_ = [
("OidLength", wintypes.DWORD),
("OidAttributes", wintypes.DWORD),
("OidValue", ctypes.c_ubyte * 32),
]#[repr(C)]
pub struct SECPKG_SERIALIZED_OID {
pub OidLength: u32,
pub OidAttributes: u32,
pub OidValue: [u8; 32],
}import "golang.org/x/sys/windows"
type SECPKG_SERIALIZED_OID struct {
OidLength uint32
OidAttributes uint32
OidValue [32]byte
}type
SECPKG_SERIALIZED_OID = record
OidLength: DWORD;
OidAttributes: DWORD;
OidValue: array[0..31] of Byte;
end;const SECPKG_SERIALIZED_OID = extern struct {
OidLength: u32,
OidAttributes: u32,
OidValue: [32]u8,
};type
SECPKG_SERIALIZED_OID {.bycopy.} = object
OidLength: uint32
OidAttributes: uint32
OidValue: array[32, uint8]struct SECPKG_SERIALIZED_OID
{
uint OidLength;
uint OidAttributes;
ubyte[32] OidValue;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SECPKG_SERIALIZED_OID サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; OidLength : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; OidAttributes : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; OidValue : BYTE (+8, 32byte) varptr(st)+8 を基点に操作(32byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SECPKG_SERIALIZED_OID
#field int OidLength
#field int OidAttributes
#field byte OidValue 32
#endstruct
stdim st, SECPKG_SERIALIZED_OID ; NSTRUCT 変数を確保
st->OidLength = 100
mes "OidLength=" + st->OidLength