ホーム › NetworkManagement.Dhcp › DHCP_POL_COND
DHCP_POL_COND
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ParentExpr | DWORD | 4 | +0 | +0 | この条件が属する親式のインデックスを示す。条件式ツリーの構築に用いる。 |
| Type | DHCP_POL_ATTR_TYPE | 4 | +4 | +4 | 条件の対象属性の種別を示すDHCP_POL_ATTR_TYPE列挙値。 |
| OptionID | DWORD | 4 | +8 | +8 | 条件で参照するオプションの番号を示す。 |
| SubOptionID | DWORD | 4 | +12 | +12 | 条件で参照するサブオプションの番号を示す。 |
| VendorName | LPWSTR | 8/4 | +16 | +16 | ベンダー固有条件の場合のベンダー名を示すワイド文字列。NULL可。 |
| Operator | DHCP_POL_COMPARATOR | 4 | +24 | +20 | 比較演算子を示すDHCP_POL_COMPARATOR列挙値。等しい/含む等。 |
| Value | BYTE* | 8/4 | +32 | +24 | 比較対象の値を保持するバイト列を指すポインタ。NULL可。 |
| ValueLength | DWORD | 4 | +40 | +28 | Valueのバイト数を示す。 |
各言語での定義
#include <windows.h>
// DHCP_POL_COND (x64 48 / x86 32 バイト)
typedef struct DHCP_POL_COND {
DWORD ParentExpr;
DHCP_POL_ATTR_TYPE Type;
DWORD OptionID;
DWORD SubOptionID;
LPWSTR VendorName;
DHCP_POL_COMPARATOR Operator;
BYTE* Value;
DWORD ValueLength;
} DHCP_POL_COND;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DHCP_POL_COND
{
public uint ParentExpr;
public int Type;
public uint OptionID;
public uint SubOptionID;
public IntPtr VendorName;
public int Operator;
public IntPtr Value;
public uint ValueLength;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DHCP_POL_COND
Public ParentExpr As UInteger
Public Type As Integer
Public OptionID As UInteger
Public SubOptionID As UInteger
Public VendorName As IntPtr
Public Operator As Integer
Public Value As IntPtr
Public ValueLength As UInteger
End Structureimport ctypes
from ctypes import wintypes
class DHCP_POL_COND(ctypes.Structure):
_fields_ = [
("ParentExpr", wintypes.DWORD),
("Type", ctypes.c_int),
("OptionID", wintypes.DWORD),
("SubOptionID", wintypes.DWORD),
("VendorName", ctypes.c_void_p),
("Operator", ctypes.c_int),
("Value", ctypes.c_void_p),
("ValueLength", wintypes.DWORD),
]#[repr(C)]
pub struct DHCP_POL_COND {
pub ParentExpr: u32,
pub Type: i32,
pub OptionID: u32,
pub SubOptionID: u32,
pub VendorName: *mut core::ffi::c_void,
pub Operator: i32,
pub Value: *mut core::ffi::c_void,
pub ValueLength: u32,
}import "golang.org/x/sys/windows"
type DHCP_POL_COND struct {
ParentExpr uint32
Type int32
OptionID uint32
SubOptionID uint32
VendorName uintptr
Operator int32
Value uintptr
ValueLength uint32
}type
DHCP_POL_COND = record
ParentExpr: DWORD;
Type: Integer;
OptionID: DWORD;
SubOptionID: DWORD;
VendorName: Pointer;
Operator: Integer;
Value: Pointer;
ValueLength: DWORD;
end;const DHCP_POL_COND = extern struct {
ParentExpr: u32,
Type: i32,
OptionID: u32,
SubOptionID: u32,
VendorName: ?*anyopaque,
Operator: i32,
Value: ?*anyopaque,
ValueLength: u32,
};type
DHCP_POL_COND {.bycopy.} = object
ParentExpr: uint32
Type: int32
OptionID: uint32
SubOptionID: uint32
VendorName: pointer
Operator: int32
Value: pointer
ValueLength: uint32struct DHCP_POL_COND
{
uint ParentExpr;
int Type;
uint OptionID;
uint SubOptionID;
void* VendorName;
int Operator;
void* Value;
uint ValueLength;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DHCP_POL_COND サイズ: 32 バイト(x86)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; ParentExpr : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Type : DHCP_POL_ATTR_TYPE (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; OptionID : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; SubOptionID : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; VendorName : LPWSTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; Operator : DHCP_POL_COMPARATOR (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; Value : BYTE* (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ValueLength : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DHCP_POL_COND サイズ: 48 バイト(x64)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; ParentExpr : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Type : DHCP_POL_ATTR_TYPE (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; OptionID : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; SubOptionID : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; VendorName : LPWSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; Operator : DHCP_POL_COMPARATOR (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; Value : BYTE* (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; ValueLength : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DHCP_POL_COND
#field int ParentExpr
#field int Type
#field int OptionID
#field int SubOptionID
#field intptr VendorName
#field int Operator
#field intptr Value
#field int ValueLength
#endstruct
stdim st, DHCP_POL_COND ; NSTRUCT 変数を確保
st->ParentExpr = 100
mes "ParentExpr=" + st->ParentExpr