Win32 API 日本語リファレンス
ホームSystem.Ioctl › ENCRYPTION_KEY_CTRL_INPUT

ENCRYPTION_KEY_CTRL_INPUT

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

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

フィールド

フィールドサイズx64x86説明
HeaderSizeDWORD4+0+0この構造体のヘッダ部のサイズ(バイト)。
StructureSizeDWORD4+4+4構造体全体のサイズ(バイト)。
KeyOffsetWORD2+8+8鍵データへのオフセット(バイト)。
KeySizeWORD2+10+10鍵データのサイズ(バイト)。
DplLockDWORD4+12+12Data Protection underLock(DPL)のロック操作を示す値。
DplUserIdULONGLONG8+16+16DPLに関連付けるユーザーID。
DplCredentialIdULONGLONG8+24+24DPLに関連付ける資格情報ID。

各言語での定義

#include <windows.h>

// ENCRYPTION_KEY_CTRL_INPUT  (x64 32 / x86 32 バイト)
typedef struct ENCRYPTION_KEY_CTRL_INPUT {
    DWORD HeaderSize;
    DWORD StructureSize;
    WORD KeyOffset;
    WORD KeySize;
    DWORD DplLock;
    ULONGLONG DplUserId;
    ULONGLONG DplCredentialId;
} ENCRYPTION_KEY_CTRL_INPUT;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ENCRYPTION_KEY_CTRL_INPUT
{
    public uint HeaderSize;
    public uint StructureSize;
    public ushort KeyOffset;
    public ushort KeySize;
    public uint DplLock;
    public ulong DplUserId;
    public ulong DplCredentialId;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure ENCRYPTION_KEY_CTRL_INPUT
    Public HeaderSize As UInteger
    Public StructureSize As UInteger
    Public KeyOffset As UShort
    Public KeySize As UShort
    Public DplLock As UInteger
    Public DplUserId As ULong
    Public DplCredentialId As ULong
End Structure
import ctypes
from ctypes import wintypes

class ENCRYPTION_KEY_CTRL_INPUT(ctypes.Structure):
    _fields_ = [
        ("HeaderSize", wintypes.DWORD),
        ("StructureSize", wintypes.DWORD),
        ("KeyOffset", ctypes.c_ushort),
        ("KeySize", ctypes.c_ushort),
        ("DplLock", wintypes.DWORD),
        ("DplUserId", ctypes.c_ulonglong),
        ("DplCredentialId", ctypes.c_ulonglong),
    ]
#[repr(C)]
pub struct ENCRYPTION_KEY_CTRL_INPUT {
    pub HeaderSize: u32,
    pub StructureSize: u32,
    pub KeyOffset: u16,
    pub KeySize: u16,
    pub DplLock: u32,
    pub DplUserId: u64,
    pub DplCredentialId: u64,
}
import "golang.org/x/sys/windows"

type ENCRYPTION_KEY_CTRL_INPUT struct {
	HeaderSize uint32
	StructureSize uint32
	KeyOffset uint16
	KeySize uint16
	DplLock uint32
	DplUserId uint64
	DplCredentialId uint64
}
type
  ENCRYPTION_KEY_CTRL_INPUT = record
    HeaderSize: DWORD;
    StructureSize: DWORD;
    KeyOffset: Word;
    KeySize: Word;
    DplLock: DWORD;
    DplUserId: UInt64;
    DplCredentialId: UInt64;
  end;
const ENCRYPTION_KEY_CTRL_INPUT = extern struct {
    HeaderSize: u32,
    StructureSize: u32,
    KeyOffset: u16,
    KeySize: u16,
    DplLock: u32,
    DplUserId: u64,
    DplCredentialId: u64,
};
type
  ENCRYPTION_KEY_CTRL_INPUT {.bycopy.} = object
    HeaderSize: uint32
    StructureSize: uint32
    KeyOffset: uint16
    KeySize: uint16
    DplLock: uint32
    DplUserId: uint64
    DplCredentialId: uint64
struct ENCRYPTION_KEY_CTRL_INPUT
{
    uint HeaderSize;
    uint StructureSize;
    ushort KeyOffset;
    ushort KeySize;
    uint DplLock;
    ulong DplUserId;
    ulong DplCredentialId;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; ENCRYPTION_KEY_CTRL_INPUT サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; HeaderSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; StructureSize : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; KeyOffset : WORD (+8, 2byte)  wpoke st,8,値  /  値 = wpeek(st,8)
; KeySize : WORD (+10, 2byte)  wpoke st,10,値  /  値 = wpeek(st,10)
; DplLock : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; DplUserId : ULONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; DplCredentialId : ULONGLONG (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global ENCRYPTION_KEY_CTRL_INPUT
    #field int HeaderSize
    #field int StructureSize
    #field short KeyOffset
    #field short KeySize
    #field int DplLock
    #field int64 DplUserId
    #field int64 DplCredentialId
#endstruct

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