ホーム › 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 | DHCP オプションまたはサブオプションに基づく条件について、一意なオプション識別子を指定する DHCP_OPTION_ID 値です。 |
| SubOptionID | DWORD | 4 | +12 | +12 | 一意なサブオプション識別子を指定する DHCP_OPTION_ID 値です。 |
| VendorName | LPWSTR | 8/4 | +16 | +16 | ベンダー名を表す、null で終わる Unicode 文字列へのポインターです。 |
| Operator | DHCP_POL_COMPARATOR | 4 | +24 | +20 | この条件の比較演算子を指定する DHCP_POL_COMPARATOR 列挙型です。 |
| Value | BYTE* | 8/4 | +32 | +24 | 比較に使用する値を格納するバイト配列へのポインターです。 |
| ValueLength | DWORD | 4 | +40 | +28 | Value の長さを指定する整数です。 |
公式ドキュメント
DHCP_POL_COND 構造体は、DHCP サーバーのポリシー条件を定義します。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#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