Win32 API 日本語リファレンス
ホームNetworkManagement.WindowsFilteringPlatform › IKEEXT_CIPHER_ALGORITHM0

IKEEXT_CIPHER_ALGORITHM0

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

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

フィールド

フィールドサイズx64x86説明
algoIdentifierIKEEXT_CIPHER_TYPE4+0+0暗号アルゴリズムの識別子(DES/3DES/AES等)を示す列挙値。
keyLenDWORD4+4+4鍵長(ビット単位)。アルゴリズムによっては無視される。
roundsDWORD4+8+8ラウンド数。アルゴリズムによっては無視される。

各言語での定義

#include <windows.h>

// IKEEXT_CIPHER_ALGORITHM0  (x64 12 / x86 12 バイト)
typedef struct IKEEXT_CIPHER_ALGORITHM0 {
    IKEEXT_CIPHER_TYPE algoIdentifier;
    DWORD keyLen;
    DWORD rounds;
} IKEEXT_CIPHER_ALGORITHM0;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IKEEXT_CIPHER_ALGORITHM0
{
    public int algoIdentifier;
    public uint keyLen;
    public uint rounds;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IKEEXT_CIPHER_ALGORITHM0
    Public algoIdentifier As Integer
    Public keyLen As UInteger
    Public rounds As UInteger
End Structure
import ctypes
from ctypes import wintypes

class IKEEXT_CIPHER_ALGORITHM0(ctypes.Structure):
    _fields_ = [
        ("algoIdentifier", ctypes.c_int),
        ("keyLen", wintypes.DWORD),
        ("rounds", wintypes.DWORD),
    ]
#[repr(C)]
pub struct IKEEXT_CIPHER_ALGORITHM0 {
    pub algoIdentifier: i32,
    pub keyLen: u32,
    pub rounds: u32,
}
import "golang.org/x/sys/windows"

type IKEEXT_CIPHER_ALGORITHM0 struct {
	algoIdentifier int32
	keyLen uint32
	rounds uint32
}
type
  IKEEXT_CIPHER_ALGORITHM0 = record
    algoIdentifier: Integer;
    keyLen: DWORD;
    rounds: DWORD;
  end;
const IKEEXT_CIPHER_ALGORITHM0 = extern struct {
    algoIdentifier: i32,
    keyLen: u32,
    rounds: u32,
};
type
  IKEEXT_CIPHER_ALGORITHM0 {.bycopy.} = object
    algoIdentifier: int32
    keyLen: uint32
    rounds: uint32
struct IKEEXT_CIPHER_ALGORITHM0
{
    int algoIdentifier;
    uint keyLen;
    uint rounds;
}

HSP用 定義

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

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

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