ホーム › NetworkManagement.Dns › DNS_TKEY_DATAW
DNS_TKEY_DATAW
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| pNameAlgorithm | LPWSTR | 8/4 | +0 | +0 | 鍵交換に用いるアルゴリズム名を表すワイド文字列ポインタ。 |
| pAlgorithmPacket | BYTE* | 8/4 | +8 | +4 | ワイヤ形式のアルゴリズム名パケットを指すバイトポインタ。 |
| pKey | BYTE* | 8/4 | +16 | +8 | 鍵交換データのバイト列を指すポインタ。 |
| pOtherData | BYTE* | 8/4 | +24 | +12 | その他データのバイト列を指すポインタ。 |
| dwCreateTime | DWORD | 4 | +32 | +16 | 鍵の作成時刻をUNIX時刻(秒)で保持する。 |
| dwExpireTime | DWORD | 4 | +36 | +20 | 鍵の有効期限をUNIX時刻(秒)で保持する。 |
| wMode | WORD | 2 | +40 | +24 | 鍵交換のモードを示す。サーバ割当やDH等を表す。 |
| wError | WORD | 2 | +42 | +26 | TKEY処理の拡張エラーコードを示す。 |
| wKeyLength | WORD | 2 | +44 | +28 | pKeyが指す鍵データのバイト長を示す。 |
| wOtherLength | WORD | 2 | +46 | +30 | pOtherDataが指すその他データのバイト長を示す。 |
| cAlgNameLength | BYTE | 1 | +48 | +32 | pAlgorithmPacketが指すアルゴリズム名パケットの長さを示す。 |
| bPacketPointers | BOOL | 4 | +52 | +36 | ポインタがワイヤ形式パケットを指すか否かを示す真偽値。 |
各言語での定義
#include <windows.h>
// DNS_TKEY_DATAW (x64 56 / x86 40 バイト)
typedef struct DNS_TKEY_DATAW {
LPWSTR pNameAlgorithm;
BYTE* pAlgorithmPacket;
BYTE* pKey;
BYTE* pOtherData;
DWORD dwCreateTime;
DWORD dwExpireTime;
WORD wMode;
WORD wError;
WORD wKeyLength;
WORD wOtherLength;
BYTE cAlgNameLength;
BOOL bPacketPointers;
} DNS_TKEY_DATAW;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DNS_TKEY_DATAW
{
public IntPtr pNameAlgorithm;
public IntPtr pAlgorithmPacket;
public IntPtr pKey;
public IntPtr pOtherData;
public uint dwCreateTime;
public uint dwExpireTime;
public ushort wMode;
public ushort wError;
public ushort wKeyLength;
public ushort wOtherLength;
public byte cAlgNameLength;
[MarshalAs(UnmanagedType.Bool)] public bool bPacketPointers;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DNS_TKEY_DATAW
Public pNameAlgorithm As IntPtr
Public pAlgorithmPacket As IntPtr
Public pKey As IntPtr
Public pOtherData As IntPtr
Public dwCreateTime As UInteger
Public dwExpireTime As UInteger
Public wMode As UShort
Public wError As UShort
Public wKeyLength As UShort
Public wOtherLength As UShort
Public cAlgNameLength As Byte
<MarshalAs(UnmanagedType.Bool)> Public bPacketPointers As Boolean
End Structureimport ctypes
from ctypes import wintypes
class DNS_TKEY_DATAW(ctypes.Structure):
_fields_ = [
("pNameAlgorithm", ctypes.c_void_p),
("pAlgorithmPacket", ctypes.c_void_p),
("pKey", ctypes.c_void_p),
("pOtherData", ctypes.c_void_p),
("dwCreateTime", wintypes.DWORD),
("dwExpireTime", wintypes.DWORD),
("wMode", ctypes.c_ushort),
("wError", ctypes.c_ushort),
("wKeyLength", ctypes.c_ushort),
("wOtherLength", ctypes.c_ushort),
("cAlgNameLength", ctypes.c_ubyte),
("bPacketPointers", wintypes.BOOL),
]#[repr(C)]
pub struct DNS_TKEY_DATAW {
pub pNameAlgorithm: *mut core::ffi::c_void,
pub pAlgorithmPacket: *mut core::ffi::c_void,
pub pKey: *mut core::ffi::c_void,
pub pOtherData: *mut core::ffi::c_void,
pub dwCreateTime: u32,
pub dwExpireTime: u32,
pub wMode: u16,
pub wError: u16,
pub wKeyLength: u16,
pub wOtherLength: u16,
pub cAlgNameLength: u8,
pub bPacketPointers: i32,
}import "golang.org/x/sys/windows"
type DNS_TKEY_DATAW struct {
pNameAlgorithm uintptr
pAlgorithmPacket uintptr
pKey uintptr
pOtherData uintptr
dwCreateTime uint32
dwExpireTime uint32
wMode uint16
wError uint16
wKeyLength uint16
wOtherLength uint16
cAlgNameLength byte
bPacketPointers int32
}type
DNS_TKEY_DATAW = record
pNameAlgorithm: Pointer;
pAlgorithmPacket: Pointer;
pKey: Pointer;
pOtherData: Pointer;
dwCreateTime: DWORD;
dwExpireTime: DWORD;
wMode: Word;
wError: Word;
wKeyLength: Word;
wOtherLength: Word;
cAlgNameLength: Byte;
bPacketPointers: BOOL;
end;const DNS_TKEY_DATAW = extern struct {
pNameAlgorithm: ?*anyopaque,
pAlgorithmPacket: ?*anyopaque,
pKey: ?*anyopaque,
pOtherData: ?*anyopaque,
dwCreateTime: u32,
dwExpireTime: u32,
wMode: u16,
wError: u16,
wKeyLength: u16,
wOtherLength: u16,
cAlgNameLength: u8,
bPacketPointers: i32,
};type
DNS_TKEY_DATAW {.bycopy.} = object
pNameAlgorithm: pointer
pAlgorithmPacket: pointer
pKey: pointer
pOtherData: pointer
dwCreateTime: uint32
dwExpireTime: uint32
wMode: uint16
wError: uint16
wKeyLength: uint16
wOtherLength: uint16
cAlgNameLength: uint8
bPacketPointers: int32struct DNS_TKEY_DATAW
{
void* pNameAlgorithm;
void* pAlgorithmPacket;
void* pKey;
void* pOtherData;
uint dwCreateTime;
uint dwExpireTime;
ushort wMode;
ushort wError;
ushort wKeyLength;
ushort wOtherLength;
ubyte cAlgNameLength;
int bPacketPointers;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DNS_TKEY_DATAW サイズ: 40 バイト(x86)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; pNameAlgorithm : LPWSTR (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pAlgorithmPacket : BYTE* (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pKey : BYTE* (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; pOtherData : BYTE* (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwCreateTime : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwExpireTime : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; wMode : WORD (+24, 2byte) wpoke st,24,値 / 値 = wpeek(st,24)
; wError : WORD (+26, 2byte) wpoke st,26,値 / 値 = wpeek(st,26)
; wKeyLength : WORD (+28, 2byte) wpoke st,28,値 / 値 = wpeek(st,28)
; wOtherLength : WORD (+30, 2byte) wpoke st,30,値 / 値 = wpeek(st,30)
; cAlgNameLength : BYTE (+32, 1byte) poke st,32,値 / 値 = peek(st,32)
; bPacketPointers : BOOL (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DNS_TKEY_DATAW サイズ: 56 バイト(x64)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; pNameAlgorithm : LPWSTR (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; pAlgorithmPacket : BYTE* (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pKey : BYTE* (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; pOtherData : BYTE* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; dwCreateTime : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; dwExpireTime : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; wMode : WORD (+40, 2byte) wpoke st,40,値 / 値 = wpeek(st,40)
; wError : WORD (+42, 2byte) wpoke st,42,値 / 値 = wpeek(st,42)
; wKeyLength : WORD (+44, 2byte) wpoke st,44,値 / 値 = wpeek(st,44)
; wOtherLength : WORD (+46, 2byte) wpoke st,46,値 / 値 = wpeek(st,46)
; cAlgNameLength : BYTE (+48, 1byte) poke st,48,値 / 値 = peek(st,48)
; bPacketPointers : BOOL (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DNS_TKEY_DATAW
#field intptr pNameAlgorithm
#field intptr pAlgorithmPacket
#field intptr pKey
#field intptr pOtherData
#field int dwCreateTime
#field int dwExpireTime
#field short wMode
#field short wError
#field short wKeyLength
#field short wOtherLength
#field byte cAlgNameLength
#field bool bPacketPointers
#endstruct
stdim st, DNS_TKEY_DATAW ; NSTRUCT 変数を確保
st->dwCreateTime = 100
mes "dwCreateTime=" + st->dwCreateTime