ホーム › NetworkManagement.IpHelper › DNS_INTERFACE_SETTINGS_EX
DNS_INTERFACE_SETTINGS_EX
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| SettingsV1 | DNS_INTERFACE_SETTINGS | 64/48 | +0 | +0 | 基本のインタフェースDNS設定(DNS_INTERFACE_SETTINGS)である。 |
| DisableUnconstrainedQueries | DWORD | 4 | +64 | +48 | 制約なしクエリを無効にするかどうかを示す(0/非0)。 |
| SupplementalSearchList | LPWSTR | 8/4 | +72 | +52 | 補助的なDNS検索リストを指すワイド文字列ポインタである。 |
各言語での定義
#include <windows.h>
// DNS_INTERFACE_SETTINGS (x64 64 / x86 48 バイト)
typedef struct DNS_INTERFACE_SETTINGS {
DWORD Version;
ULONGLONG Flags;
LPWSTR Domain;
LPWSTR NameServer;
LPWSTR SearchList;
DWORD RegistrationEnabled;
DWORD RegisterAdapterName;
DWORD EnableLLMNR;
DWORD QueryAdapterName;
LPWSTR ProfileNameServer;
} DNS_INTERFACE_SETTINGS;
// DNS_INTERFACE_SETTINGS_EX (x64 80 / x86 56 バイト)
typedef struct DNS_INTERFACE_SETTINGS_EX {
DNS_INTERFACE_SETTINGS SettingsV1;
DWORD DisableUnconstrainedQueries;
LPWSTR SupplementalSearchList;
} DNS_INTERFACE_SETTINGS_EX;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DNS_INTERFACE_SETTINGS
{
public uint Version;
public ulong Flags;
public IntPtr Domain;
public IntPtr NameServer;
public IntPtr SearchList;
public uint RegistrationEnabled;
public uint RegisterAdapterName;
public uint EnableLLMNR;
public uint QueryAdapterName;
public IntPtr ProfileNameServer;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DNS_INTERFACE_SETTINGS_EX
{
public DNS_INTERFACE_SETTINGS SettingsV1;
public uint DisableUnconstrainedQueries;
public IntPtr SupplementalSearchList;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DNS_INTERFACE_SETTINGS
Public Version As UInteger
Public Flags As ULong
Public Domain As IntPtr
Public NameServer As IntPtr
Public SearchList As IntPtr
Public RegistrationEnabled As UInteger
Public RegisterAdapterName As UInteger
Public EnableLLMNR As UInteger
Public QueryAdapterName As UInteger
Public ProfileNameServer As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DNS_INTERFACE_SETTINGS_EX
Public SettingsV1 As DNS_INTERFACE_SETTINGS
Public DisableUnconstrainedQueries As UInteger
Public SupplementalSearchList As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class DNS_INTERFACE_SETTINGS(ctypes.Structure):
_fields_ = [
("Version", wintypes.DWORD),
("Flags", ctypes.c_ulonglong),
("Domain", ctypes.c_void_p),
("NameServer", ctypes.c_void_p),
("SearchList", ctypes.c_void_p),
("RegistrationEnabled", wintypes.DWORD),
("RegisterAdapterName", wintypes.DWORD),
("EnableLLMNR", wintypes.DWORD),
("QueryAdapterName", wintypes.DWORD),
("ProfileNameServer", ctypes.c_void_p),
]
class DNS_INTERFACE_SETTINGS_EX(ctypes.Structure):
_fields_ = [
("SettingsV1", DNS_INTERFACE_SETTINGS),
("DisableUnconstrainedQueries", wintypes.DWORD),
("SupplementalSearchList", ctypes.c_void_p),
]#[repr(C)]
pub struct DNS_INTERFACE_SETTINGS {
pub Version: u32,
pub Flags: u64,
pub Domain: *mut core::ffi::c_void,
pub NameServer: *mut core::ffi::c_void,
pub SearchList: *mut core::ffi::c_void,
pub RegistrationEnabled: u32,
pub RegisterAdapterName: u32,
pub EnableLLMNR: u32,
pub QueryAdapterName: u32,
pub ProfileNameServer: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct DNS_INTERFACE_SETTINGS_EX {
pub SettingsV1: DNS_INTERFACE_SETTINGS,
pub DisableUnconstrainedQueries: u32,
pub SupplementalSearchList: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type DNS_INTERFACE_SETTINGS struct {
Version uint32
Flags uint64
Domain uintptr
NameServer uintptr
SearchList uintptr
RegistrationEnabled uint32
RegisterAdapterName uint32
EnableLLMNR uint32
QueryAdapterName uint32
ProfileNameServer uintptr
}
type DNS_INTERFACE_SETTINGS_EX struct {
SettingsV1 DNS_INTERFACE_SETTINGS
DisableUnconstrainedQueries uint32
SupplementalSearchList uintptr
}type
DNS_INTERFACE_SETTINGS = record
Version: DWORD;
Flags: UInt64;
Domain: Pointer;
NameServer: Pointer;
SearchList: Pointer;
RegistrationEnabled: DWORD;
RegisterAdapterName: DWORD;
EnableLLMNR: DWORD;
QueryAdapterName: DWORD;
ProfileNameServer: Pointer;
end;
DNS_INTERFACE_SETTINGS_EX = record
SettingsV1: DNS_INTERFACE_SETTINGS;
DisableUnconstrainedQueries: DWORD;
SupplementalSearchList: Pointer;
end;const DNS_INTERFACE_SETTINGS = extern struct {
Version: u32,
Flags: u64,
Domain: ?*anyopaque,
NameServer: ?*anyopaque,
SearchList: ?*anyopaque,
RegistrationEnabled: u32,
RegisterAdapterName: u32,
EnableLLMNR: u32,
QueryAdapterName: u32,
ProfileNameServer: ?*anyopaque,
};
const DNS_INTERFACE_SETTINGS_EX = extern struct {
SettingsV1: DNS_INTERFACE_SETTINGS,
DisableUnconstrainedQueries: u32,
SupplementalSearchList: ?*anyopaque,
};type
DNS_INTERFACE_SETTINGS {.bycopy.} = object
Version: uint32
Flags: uint64
Domain: pointer
NameServer: pointer
SearchList: pointer
RegistrationEnabled: uint32
RegisterAdapterName: uint32
EnableLLMNR: uint32
QueryAdapterName: uint32
ProfileNameServer: pointer
DNS_INTERFACE_SETTINGS_EX {.bycopy.} = object
SettingsV1: DNS_INTERFACE_SETTINGS
DisableUnconstrainedQueries: uint32
SupplementalSearchList: pointerstruct DNS_INTERFACE_SETTINGS
{
uint Version;
ulong Flags;
void* Domain;
void* NameServer;
void* SearchList;
uint RegistrationEnabled;
uint RegisterAdapterName;
uint EnableLLMNR;
uint QueryAdapterName;
void* ProfileNameServer;
}
struct DNS_INTERFACE_SETTINGS_EX
{
DNS_INTERFACE_SETTINGS SettingsV1;
uint DisableUnconstrainedQueries;
void* SupplementalSearchList;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DNS_INTERFACE_SETTINGS_EX サイズ: 56 バイト(x86)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; SettingsV1 : DNS_INTERFACE_SETTINGS (+0, 48byte) varptr(st)+0 を基点に操作(48byte:入れ子/配列)
; DisableUnconstrainedQueries : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; SupplementalSearchList : LPWSTR (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DNS_INTERFACE_SETTINGS_EX サイズ: 80 バイト(x64)
dim st, 20 ; 4byte整数×20(構造体サイズ 80 / 4 切り上げ)
; SettingsV1 : DNS_INTERFACE_SETTINGS (+0, 64byte) varptr(st)+0 を基点に操作(64byte:入れ子/配列)
; DisableUnconstrainedQueries : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; SupplementalSearchList : LPWSTR (+72, 8byte) qpoke st,72,値 / qpeek(st,72) ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global DNS_INTERFACE_SETTINGS
#field int Version
#field int64 Flags
#field intptr Domain
#field intptr NameServer
#field intptr SearchList
#field int RegistrationEnabled
#field int RegisterAdapterName
#field int EnableLLMNR
#field int QueryAdapterName
#field intptr ProfileNameServer
#endstruct
#defstruct global DNS_INTERFACE_SETTINGS_EX
#field DNS_INTERFACE_SETTINGS SettingsV1
#field int DisableUnconstrainedQueries
#field intptr SupplementalSearchList
#endstruct
stdim st, DNS_INTERFACE_SETTINGS_EX ; NSTRUCT 変数を確保
st->DisableUnconstrainedQueries = 100
mes "DisableUnconstrainedQueries=" + st->DisableUnconstrainedQueries