ホーム › Security.Authentication.Identity › SCH_CRED
SCH_CRED
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwVersion | DWORD | 4 | +0 | +0 | この構造体のバージョン番号を示す。 |
| cCreds | DWORD | 4 | +4 | +4 | 資格情報配列内の要素数を示す。 |
| paSecret | void** | 8/4 | +8 | +8 | 秘密鍵(資格情報)へのポインタ配列。 |
| paPublic | void** | 8/4 | +16 | +12 | 公開証明書へのポインタ配列。 |
| cMappers | DWORD | 4 | +24 | +16 | aphMappers配列のマッパー個数を示す。 |
| aphMappers | _HMAPPER** | 8/4 | +32 | +20 | 資格情報マッパーの配列へのポインタ。 |
各言語での定義
#include <windows.h>
// SCH_CRED (x64 40 / x86 24 バイト)
typedef struct SCH_CRED {
DWORD dwVersion;
DWORD cCreds;
void** paSecret;
void** paPublic;
DWORD cMappers;
_HMAPPER** aphMappers;
} SCH_CRED;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SCH_CRED
{
public uint dwVersion;
public uint cCreds;
public IntPtr paSecret;
public IntPtr paPublic;
public uint cMappers;
public IntPtr aphMappers;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SCH_CRED
Public dwVersion As UInteger
Public cCreds As UInteger
Public paSecret As IntPtr
Public paPublic As IntPtr
Public cMappers As UInteger
Public aphMappers As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class SCH_CRED(ctypes.Structure):
_fields_ = [
("dwVersion", wintypes.DWORD),
("cCreds", wintypes.DWORD),
("paSecret", ctypes.c_void_p),
("paPublic", ctypes.c_void_p),
("cMappers", wintypes.DWORD),
("aphMappers", ctypes.c_void_p),
]#[repr(C)]
pub struct SCH_CRED {
pub dwVersion: u32,
pub cCreds: u32,
pub paSecret: *mut core::ffi::c_void,
pub paPublic: *mut core::ffi::c_void,
pub cMappers: u32,
pub aphMappers: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type SCH_CRED struct {
dwVersion uint32
cCreds uint32
paSecret uintptr
paPublic uintptr
cMappers uint32
aphMappers uintptr
}type
SCH_CRED = record
dwVersion: DWORD;
cCreds: DWORD;
paSecret: Pointer;
paPublic: Pointer;
cMappers: DWORD;
aphMappers: Pointer;
end;const SCH_CRED = extern struct {
dwVersion: u32,
cCreds: u32,
paSecret: ?*anyopaque,
paPublic: ?*anyopaque,
cMappers: u32,
aphMappers: ?*anyopaque,
};type
SCH_CRED {.bycopy.} = object
dwVersion: uint32
cCreds: uint32
paSecret: pointer
paPublic: pointer
cMappers: uint32
aphMappers: pointerstruct SCH_CRED
{
uint dwVersion;
uint cCreds;
void* paSecret;
void* paPublic;
uint cMappers;
void* aphMappers;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SCH_CRED サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; dwVersion : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; cCreds : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; paSecret : void** (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; paPublic : void** (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; cMappers : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; aphMappers : _HMAPPER** (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SCH_CRED サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; dwVersion : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; cCreds : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; paSecret : void** (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; paPublic : void** (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; cMappers : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; aphMappers : _HMAPPER** (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SCH_CRED
#field int dwVersion
#field int cCreds
#field intptr paSecret
#field intptr paPublic
#field int cMappers
#field intptr aphMappers
#endstruct
stdim st, SCH_CRED ; NSTRUCT 変数を確保
st->dwVersion = 100
mes "dwVersion=" + st->dwVersion