Win32 API 日本語リファレンス
ホームDevices.BiometricFramework › WINBIO_ACCOUNT_POLICY

WINBIO_ACCOUNT_POLICY

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

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

フィールド

フィールドサイズx64x86説明
IdentityWINBIO_IDENTITY40/36+0+0ポリシ対象アカウントの識別情報(WINBIO_IDENTITY)。
AntiSpoofBehaviorWINBIO_ANTI_SPOOF_POLICY_ACTION4+40+36そのアカウントに適用するなりすまし対策動作を示す列挙値。

各言語での定義

#include <windows.h>

// WINBIO_IDENTITY  (x64 40 / x86 36 バイト)
typedef struct WINBIO_IDENTITY {
    DWORD Type;
    _Value_e__Union Value;
} WINBIO_IDENTITY;

// WINBIO_ACCOUNT_POLICY  (x64 48 / x86 40 バイト)
typedef struct WINBIO_ACCOUNT_POLICY {
    WINBIO_IDENTITY Identity;
    WINBIO_ANTI_SPOOF_POLICY_ACTION AntiSpoofBehavior;
} WINBIO_ACCOUNT_POLICY;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WINBIO_IDENTITY
{
    public uint Type;
    public _Value_e__Union Value;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WINBIO_ACCOUNT_POLICY
{
    public WINBIO_IDENTITY Identity;
    public int AntiSpoofBehavior;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WINBIO_IDENTITY
    Public Type As UInteger
    Public Value As _Value_e__Union
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WINBIO_ACCOUNT_POLICY
    Public Identity As WINBIO_IDENTITY
    Public AntiSpoofBehavior As Integer
End Structure
import ctypes
from ctypes import wintypes

class WINBIO_IDENTITY(ctypes.Structure):
    _fields_ = [
        ("Type", wintypes.DWORD),
        ("Value", _Value_e__Union),
    ]

class WINBIO_ACCOUNT_POLICY(ctypes.Structure):
    _fields_ = [
        ("Identity", WINBIO_IDENTITY),
        ("AntiSpoofBehavior", ctypes.c_int),
    ]
#[repr(C)]
pub struct WINBIO_IDENTITY {
    pub Type: u32,
    pub Value: _Value_e__Union,
}

#[repr(C)]
pub struct WINBIO_ACCOUNT_POLICY {
    pub Identity: WINBIO_IDENTITY,
    pub AntiSpoofBehavior: i32,
}
import "golang.org/x/sys/windows"

type WINBIO_IDENTITY struct {
	Type uint32
	Value _Value_e__Union
}

type WINBIO_ACCOUNT_POLICY struct {
	Identity WINBIO_IDENTITY
	AntiSpoofBehavior int32
}
type
  WINBIO_IDENTITY = record
    Type: DWORD;
    Value: _Value_e__Union;
  end;

  WINBIO_ACCOUNT_POLICY = record
    Identity: WINBIO_IDENTITY;
    AntiSpoofBehavior: Integer;
  end;
const WINBIO_IDENTITY = extern struct {
    Type: u32,
    Value: _Value_e__Union,
};

const WINBIO_ACCOUNT_POLICY = extern struct {
    Identity: WINBIO_IDENTITY,
    AntiSpoofBehavior: i32,
};
type
  WINBIO_IDENTITY {.bycopy.} = object
    Type: uint32
    Value: _Value_e__Union

  WINBIO_ACCOUNT_POLICY {.bycopy.} = object
    Identity: WINBIO_IDENTITY
    AntiSpoofBehavior: int32
struct WINBIO_IDENTITY
{
    uint Type;
    _Value_e__Union Value;
}

struct WINBIO_ACCOUNT_POLICY
{
    WINBIO_IDENTITY Identity;
    int AntiSpoofBehavior;
}

HSP用 定義

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

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

#defstruct global WINBIO_ACCOUNT_POLICY
    #field WINBIO_IDENTITY Identity
    #field int AntiSpoofBehavior
#endstruct

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