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

SECPKG_EXTRA_OIDS

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

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

フィールド

フィールドサイズx64x86説明
OidCountDWORD4+0+0Oidsが保持する追加OIDの要素数。
OidsSECPKG_SERIALIZED_OID40+4+4シリアライズ済みOIDを並べたSECPKG_SERIALIZED_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;

// SECPKG_EXTRA_OIDS  (x64 44 / x86 44 バイト)
typedef struct SECPKG_EXTRA_OIDS {
    DWORD OidCount;
    SECPKG_SERIALIZED_OID Oids[1];
} SECPKG_EXTRA_OIDS;
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;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SECPKG_EXTRA_OIDS
{
    public uint OidCount;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public SECPKG_SERIALIZED_OID[] Oids;
}
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

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SECPKG_EXTRA_OIDS
    Public OidCount As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public Oids() As SECPKG_SERIALIZED_OID
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),
    ]

class SECPKG_EXTRA_OIDS(ctypes.Structure):
    _fields_ = [
        ("OidCount", wintypes.DWORD),
        ("Oids", SECPKG_SERIALIZED_OID * 1),
    ]
#[repr(C)]
pub struct SECPKG_SERIALIZED_OID {
    pub OidLength: u32,
    pub OidAttributes: u32,
    pub OidValue: [u8; 32],
}

#[repr(C)]
pub struct SECPKG_EXTRA_OIDS {
    pub OidCount: u32,
    pub Oids: [SECPKG_SERIALIZED_OID; 1],
}
import "golang.org/x/sys/windows"

type SECPKG_SERIALIZED_OID struct {
	OidLength uint32
	OidAttributes uint32
	OidValue [32]byte
}

type SECPKG_EXTRA_OIDS struct {
	OidCount uint32
	Oids [1]SECPKG_SERIALIZED_OID
}
type
  SECPKG_SERIALIZED_OID = record
    OidLength: DWORD;
    OidAttributes: DWORD;
    OidValue: array[0..31] of Byte;
  end;

  SECPKG_EXTRA_OIDS = record
    OidCount: DWORD;
    Oids: array[0..0] of SECPKG_SERIALIZED_OID;
  end;
const SECPKG_SERIALIZED_OID = extern struct {
    OidLength: u32,
    OidAttributes: u32,
    OidValue: [32]u8,
};

const SECPKG_EXTRA_OIDS = extern struct {
    OidCount: u32,
    Oids: [1]SECPKG_SERIALIZED_OID,
};
type
  SECPKG_SERIALIZED_OID {.bycopy.} = object
    OidLength: uint32
    OidAttributes: uint32
    OidValue: array[32, uint8]

  SECPKG_EXTRA_OIDS {.bycopy.} = object
    OidCount: uint32
    Oids: array[1, SECPKG_SERIALIZED_OID]
struct SECPKG_SERIALIZED_OID
{
    uint OidLength;
    uint OidAttributes;
    ubyte[32] OidValue;
}

struct SECPKG_EXTRA_OIDS
{
    uint OidCount;
    SECPKG_SERIALIZED_OID[1] Oids;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SECPKG_EXTRA_OIDS サイズ: 44 バイト(x64)
dim st, 11    ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; OidCount : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Oids : SECPKG_SERIALIZED_OID (+4, 40byte)  varptr(st)+4 を基点に操作(40byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global SECPKG_SERIALIZED_OID
    #field int OidLength
    #field int OidAttributes
    #field byte OidValue 32
#endstruct

#defstruct global SECPKG_EXTRA_OIDS
    #field int OidCount
    #field SECPKG_SERIALIZED_OID Oids 1
#endstruct

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