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

SECPKG_SERIALIZED_OID

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

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

フィールド

フィールドサイズx64x86説明
OidLengthDWORD4+0+0OID の長さです。
OidAttributesDWORD4+4+4OID の属性です。
OidValueBYTE32+8+8OID の値です。SECPKG_MAX_OID_LENGTH の値は、現在 32 に設定されています。

公式ドキュメント

SECPKG_SERIALIZED_OID 構造体は、セキュリティ パッケージのオブジェクト識別子 (OID) を格納します。

この構造体は、 SpGetExtendedInformation 関数および SpSetExtendedInformation 関数で使用されます。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#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 Structure
import 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