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

WEBAUTHN_PLUGIN_CREDENTIAL_DETAILS

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

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

フィールド

フィールドサイズx64x86説明
cbCredentialIdDWORD4+0+0資格情報IDのバイト数を示す。
pbCredentialIdBYTE*8/4+8+4資格情報を識別するバイナリIDへのポインタ。
pwszRpIdLPWSTR8/4+16+8信頼当事者(RP)IDへのポインタ。
pwszRpNameLPWSTR8/4+24+12RPの表示名へのポインタ。
cbUserIdDWORD4+32+16ユーザーIDのバイト数を示す。
pbUserIdBYTE*8/4+40+20ユーザーハンドル(ユーザーID)へのポインタ。
pwszUserNameLPWSTR8/4+48+24ユーザーのアカウント名へのポインタ。
pwszUserDisplayNameLPWSTR8/4+56+28ユーザーの表示名へのポインタ。

各言語での定義

#include <windows.h>

// WEBAUTHN_PLUGIN_CREDENTIAL_DETAILS  (x64 64 / x86 32 バイト)
typedef struct WEBAUTHN_PLUGIN_CREDENTIAL_DETAILS {
    DWORD cbCredentialId;
    BYTE* pbCredentialId;
    LPWSTR pwszRpId;
    LPWSTR pwszRpName;
    DWORD cbUserId;
    BYTE* pbUserId;
    LPWSTR pwszUserName;
    LPWSTR pwszUserDisplayName;
} WEBAUTHN_PLUGIN_CREDENTIAL_DETAILS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WEBAUTHN_PLUGIN_CREDENTIAL_DETAILS
{
    public uint cbCredentialId;
    public IntPtr pbCredentialId;
    public IntPtr pwszRpId;
    public IntPtr pwszRpName;
    public uint cbUserId;
    public IntPtr pbUserId;
    public IntPtr pwszUserName;
    public IntPtr pwszUserDisplayName;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WEBAUTHN_PLUGIN_CREDENTIAL_DETAILS
    Public cbCredentialId As UInteger
    Public pbCredentialId As IntPtr
    Public pwszRpId As IntPtr
    Public pwszRpName As IntPtr
    Public cbUserId As UInteger
    Public pbUserId As IntPtr
    Public pwszUserName As IntPtr
    Public pwszUserDisplayName As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class WEBAUTHN_PLUGIN_CREDENTIAL_DETAILS(ctypes.Structure):
    _fields_ = [
        ("cbCredentialId", wintypes.DWORD),
        ("pbCredentialId", ctypes.c_void_p),
        ("pwszRpId", ctypes.c_void_p),
        ("pwszRpName", ctypes.c_void_p),
        ("cbUserId", wintypes.DWORD),
        ("pbUserId", ctypes.c_void_p),
        ("pwszUserName", ctypes.c_void_p),
        ("pwszUserDisplayName", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct WEBAUTHN_PLUGIN_CREDENTIAL_DETAILS {
    pub cbCredentialId: u32,
    pub pbCredentialId: *mut core::ffi::c_void,
    pub pwszRpId: *mut core::ffi::c_void,
    pub pwszRpName: *mut core::ffi::c_void,
    pub cbUserId: u32,
    pub pbUserId: *mut core::ffi::c_void,
    pub pwszUserName: *mut core::ffi::c_void,
    pub pwszUserDisplayName: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type WEBAUTHN_PLUGIN_CREDENTIAL_DETAILS struct {
	cbCredentialId uint32
	pbCredentialId uintptr
	pwszRpId uintptr
	pwszRpName uintptr
	cbUserId uint32
	pbUserId uintptr
	pwszUserName uintptr
	pwszUserDisplayName uintptr
}
type
  WEBAUTHN_PLUGIN_CREDENTIAL_DETAILS = record
    cbCredentialId: DWORD;
    pbCredentialId: Pointer;
    pwszRpId: Pointer;
    pwszRpName: Pointer;
    cbUserId: DWORD;
    pbUserId: Pointer;
    pwszUserName: Pointer;
    pwszUserDisplayName: Pointer;
  end;
const WEBAUTHN_PLUGIN_CREDENTIAL_DETAILS = extern struct {
    cbCredentialId: u32,
    pbCredentialId: ?*anyopaque,
    pwszRpId: ?*anyopaque,
    pwszRpName: ?*anyopaque,
    cbUserId: u32,
    pbUserId: ?*anyopaque,
    pwszUserName: ?*anyopaque,
    pwszUserDisplayName: ?*anyopaque,
};
type
  WEBAUTHN_PLUGIN_CREDENTIAL_DETAILS {.bycopy.} = object
    cbCredentialId: uint32
    pbCredentialId: pointer
    pwszRpId: pointer
    pwszRpName: pointer
    cbUserId: uint32
    pbUserId: pointer
    pwszUserName: pointer
    pwszUserDisplayName: pointer
struct WEBAUTHN_PLUGIN_CREDENTIAL_DETAILS
{
    uint cbCredentialId;
    void* pbCredentialId;
    void* pwszRpId;
    void* pwszRpName;
    uint cbUserId;
    void* pbUserId;
    void* pwszUserName;
    void* pwszUserDisplayName;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; WEBAUTHN_PLUGIN_CREDENTIAL_DETAILS サイズ: 32 バイト(x86)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; cbCredentialId : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; pbCredentialId : BYTE* (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; pwszRpId : LPWSTR (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; pwszRpName : LPWSTR (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; cbUserId : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; pbUserId : BYTE* (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; pwszUserName : LPWSTR (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; pwszUserDisplayName : LPWSTR (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WEBAUTHN_PLUGIN_CREDENTIAL_DETAILS サイズ: 64 バイト(x64)
dim st, 16    ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; cbCredentialId : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; pbCredentialId : BYTE* (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pwszRpId : LPWSTR (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; pwszRpName : LPWSTR (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; cbUserId : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; pbUserId : BYTE* (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; pwszUserName : LPWSTR (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; pwszUserDisplayName : LPWSTR (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WEBAUTHN_PLUGIN_CREDENTIAL_DETAILS
    #field int cbCredentialId
    #field intptr pbCredentialId
    #field intptr pwszRpId
    #field intptr pwszRpName
    #field int cbUserId
    #field intptr pbUserId
    #field intptr pwszUserName
    #field intptr pwszUserDisplayName
#endstruct

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