ホーム › Security.Authentication.Identity › SecPkgContext_KeyingMaterial_Inproc
SecPkgContext_KeyingMaterial_Inproc
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbLabel | WORD | 2 | +0 | +0 | 鍵素材導出に使うラベルのバイト数を示す。 |
| pszLabel | LPSTR | 8/4 | +8 | +4 | 鍵素材エクスポータのラベル文字列へのポインタ。 |
| cbContextValue | WORD | 2 | +16 | +8 | コンテキスト値のバイト数を示す。 |
| pbContextValue | BYTE* | 8/4 | +24 | +12 | 鍵導出に用いるコンテキスト値へのポインタ。 |
| cbKeyingMaterial | DWORD | 4 | +32 | +16 | 導出された鍵素材のバイト数を示す。 |
| pbKeyingMaterial | BYTE* | 8/4 | +40 | +20 | 導出された鍵素材のデータへのポインタ。 |
各言語での定義
#include <windows.h>
// SecPkgContext_KeyingMaterial_Inproc (x64 48 / x86 24 バイト)
typedef struct SecPkgContext_KeyingMaterial_Inproc {
WORD cbLabel;
LPSTR pszLabel;
WORD cbContextValue;
BYTE* pbContextValue;
DWORD cbKeyingMaterial;
BYTE* pbKeyingMaterial;
} SecPkgContext_KeyingMaterial_Inproc;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SecPkgContext_KeyingMaterial_Inproc
{
public ushort cbLabel;
public IntPtr pszLabel;
public ushort cbContextValue;
public IntPtr pbContextValue;
public uint cbKeyingMaterial;
public IntPtr pbKeyingMaterial;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SecPkgContext_KeyingMaterial_Inproc
Public cbLabel As UShort
Public pszLabel As IntPtr
Public cbContextValue As UShort
Public pbContextValue As IntPtr
Public cbKeyingMaterial As UInteger
Public pbKeyingMaterial As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class SecPkgContext_KeyingMaterial_Inproc(ctypes.Structure):
_fields_ = [
("cbLabel", ctypes.c_ushort),
("pszLabel", ctypes.c_void_p),
("cbContextValue", ctypes.c_ushort),
("pbContextValue", ctypes.c_void_p),
("cbKeyingMaterial", wintypes.DWORD),
("pbKeyingMaterial", ctypes.c_void_p),
]#[repr(C)]
pub struct SecPkgContext_KeyingMaterial_Inproc {
pub cbLabel: u16,
pub pszLabel: *mut core::ffi::c_void,
pub cbContextValue: u16,
pub pbContextValue: *mut core::ffi::c_void,
pub cbKeyingMaterial: u32,
pub pbKeyingMaterial: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type SecPkgContext_KeyingMaterial_Inproc struct {
cbLabel uint16
pszLabel uintptr
cbContextValue uint16
pbContextValue uintptr
cbKeyingMaterial uint32
pbKeyingMaterial uintptr
}type
SecPkgContext_KeyingMaterial_Inproc = record
cbLabel: Word;
pszLabel: Pointer;
cbContextValue: Word;
pbContextValue: Pointer;
cbKeyingMaterial: DWORD;
pbKeyingMaterial: Pointer;
end;const SecPkgContext_KeyingMaterial_Inproc = extern struct {
cbLabel: u16,
pszLabel: ?*anyopaque,
cbContextValue: u16,
pbContextValue: ?*anyopaque,
cbKeyingMaterial: u32,
pbKeyingMaterial: ?*anyopaque,
};type
SecPkgContext_KeyingMaterial_Inproc {.bycopy.} = object
cbLabel: uint16
pszLabel: pointer
cbContextValue: uint16
pbContextValue: pointer
cbKeyingMaterial: uint32
pbKeyingMaterial: pointerstruct SecPkgContext_KeyingMaterial_Inproc
{
ushort cbLabel;
void* pszLabel;
ushort cbContextValue;
void* pbContextValue;
uint cbKeyingMaterial;
void* pbKeyingMaterial;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SecPkgContext_KeyingMaterial_Inproc サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; cbLabel : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; pszLabel : LPSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; cbContextValue : WORD (+8, 2byte) wpoke st,8,値 / 値 = wpeek(st,8)
; pbContextValue : BYTE* (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; cbKeyingMaterial : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; pbKeyingMaterial : BYTE* (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SecPkgContext_KeyingMaterial_Inproc サイズ: 48 バイト(x64)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; cbLabel : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; pszLabel : LPSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; cbContextValue : WORD (+16, 2byte) wpoke st,16,値 / 値 = wpeek(st,16)
; pbContextValue : BYTE* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; cbKeyingMaterial : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; pbKeyingMaterial : BYTE* (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SecPkgContext_KeyingMaterial_Inproc
#field short cbLabel
#field intptr pszLabel
#field short cbContextValue
#field intptr pbContextValue
#field int cbKeyingMaterial
#field intptr pbKeyingMaterial
#endstruct
stdim st, SecPkgContext_KeyingMaterial_Inproc ; NSTRUCT 変数を確保
st->cbLabel = 100
mes "cbLabel=" + st->cbLabel