Win32 API 日本語リファレンス
ホームSecurity.Cryptography › NCRYPT_UI_POLICY_BLOB

NCRYPT_UI_POLICY_BLOB

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

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

フィールド

フィールドサイズx64x86説明
dwVersionDWORD4+0+0UIポリシーBLOBのバージョン番号。
dwFlagsDWORD4+4+4鍵保護UIの動作を制御するフラグ。
cbCreationTitleDWORD4+8+8作成タイトル文字列のバイト長。
cbFriendlyNameDWORD4+12+12フレンドリ名文字列のバイト長。
cbDescriptionDWORD4+16+16説明文字列のバイト長。

各言語での定義

#include <windows.h>

// NCRYPT_UI_POLICY_BLOB  (x64 20 / x86 20 バイト)
typedef struct NCRYPT_UI_POLICY_BLOB {
    DWORD dwVersion;
    DWORD dwFlags;
    DWORD cbCreationTitle;
    DWORD cbFriendlyName;
    DWORD cbDescription;
} NCRYPT_UI_POLICY_BLOB;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NCRYPT_UI_POLICY_BLOB
{
    public uint dwVersion;
    public uint dwFlags;
    public uint cbCreationTitle;
    public uint cbFriendlyName;
    public uint cbDescription;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NCRYPT_UI_POLICY_BLOB
    Public dwVersion As UInteger
    Public dwFlags As UInteger
    Public cbCreationTitle As UInteger
    Public cbFriendlyName As UInteger
    Public cbDescription As UInteger
End Structure
import ctypes
from ctypes import wintypes

class NCRYPT_UI_POLICY_BLOB(ctypes.Structure):
    _fields_ = [
        ("dwVersion", wintypes.DWORD),
        ("dwFlags", wintypes.DWORD),
        ("cbCreationTitle", wintypes.DWORD),
        ("cbFriendlyName", wintypes.DWORD),
        ("cbDescription", wintypes.DWORD),
    ]
#[repr(C)]
pub struct NCRYPT_UI_POLICY_BLOB {
    pub dwVersion: u32,
    pub dwFlags: u32,
    pub cbCreationTitle: u32,
    pub cbFriendlyName: u32,
    pub cbDescription: u32,
}
import "golang.org/x/sys/windows"

type NCRYPT_UI_POLICY_BLOB struct {
	dwVersion uint32
	dwFlags uint32
	cbCreationTitle uint32
	cbFriendlyName uint32
	cbDescription uint32
}
type
  NCRYPT_UI_POLICY_BLOB = record
    dwVersion: DWORD;
    dwFlags: DWORD;
    cbCreationTitle: DWORD;
    cbFriendlyName: DWORD;
    cbDescription: DWORD;
  end;
const NCRYPT_UI_POLICY_BLOB = extern struct {
    dwVersion: u32,
    dwFlags: u32,
    cbCreationTitle: u32,
    cbFriendlyName: u32,
    cbDescription: u32,
};
type
  NCRYPT_UI_POLICY_BLOB {.bycopy.} = object
    dwVersion: uint32
    dwFlags: uint32
    cbCreationTitle: uint32
    cbFriendlyName: uint32
    cbDescription: uint32
struct NCRYPT_UI_POLICY_BLOB
{
    uint dwVersion;
    uint dwFlags;
    uint cbCreationTitle;
    uint cbFriendlyName;
    uint cbDescription;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; NCRYPT_UI_POLICY_BLOB サイズ: 20 バイト(x64)
dim st, 5    ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; dwVersion : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; cbCreationTitle : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; cbFriendlyName : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; cbDescription : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global NCRYPT_UI_POLICY_BLOB
    #field int dwVersion
    #field int dwFlags
    #field int cbCreationTitle
    #field int cbFriendlyName
    #field int cbDescription
#endstruct

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