ホーム › System.Ioctl › ENCRYPTION_BUFFER
ENCRYPTION_BUFFER
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| EncryptionOperation | DWORD | 4 | +0 | +0 | 実行する暗号化操作の種別。FILE_SET_ENCRYPTION等の操作コードを指定する。 |
| Private | BYTE | 1 | +4 | +4 | 操作に伴う非公開データの先頭バイト。可変長である。 |
各言語での定義
#include <windows.h>
// ENCRYPTION_BUFFER (x64 8 / x86 8 バイト)
typedef struct ENCRYPTION_BUFFER {
DWORD EncryptionOperation;
BYTE Private[1];
} ENCRYPTION_BUFFER;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ENCRYPTION_BUFFER
{
public uint EncryptionOperation;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public byte[] Private;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure ENCRYPTION_BUFFER
Public EncryptionOperation As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public Private() As Byte
End Structureimport ctypes
from ctypes import wintypes
class ENCRYPTION_BUFFER(ctypes.Structure):
_fields_ = [
("EncryptionOperation", wintypes.DWORD),
("Private", ctypes.c_ubyte * 1),
]#[repr(C)]
pub struct ENCRYPTION_BUFFER {
pub EncryptionOperation: u32,
pub Private: [u8; 1],
}import "golang.org/x/sys/windows"
type ENCRYPTION_BUFFER struct {
EncryptionOperation uint32
Private [1]byte
}type
ENCRYPTION_BUFFER = record
EncryptionOperation: DWORD;
Private: array[0..0] of Byte;
end;const ENCRYPTION_BUFFER = extern struct {
EncryptionOperation: u32,
Private: [1]u8,
};type
ENCRYPTION_BUFFER {.bycopy.} = object
EncryptionOperation: uint32
Private: array[1, uint8]struct ENCRYPTION_BUFFER
{
uint EncryptionOperation;
ubyte[1] Private;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; ENCRYPTION_BUFFER サイズ: 8 バイト(x64)
dim st, 2 ; 4byte整数×2(構造体サイズ 8 / 4 切り上げ)
; EncryptionOperation : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Private : BYTE (+4, 1byte) varptr(st)+4 を基点に操作(1byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global ENCRYPTION_BUFFER
#field int EncryptionOperation
#field byte Private 1
#endstruct
stdim st, ENCRYPTION_BUFFER ; NSTRUCT 変数を確保
st->EncryptionOperation = 100
mes "EncryptionOperation=" + st->EncryptionOperation