ホーム › Networking.ActiveDirectory › DS_DOMAIN_CONTROLLER_INFO_3A
DS_DOMAIN_CONTROLLER_INFO_3A
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| NetbiosName | LPSTR | 8/4 | +0 | +0 | ドメインコントローラのNetBIOS名(ANSI)。 |
| DnsHostName | LPSTR | 8/4 | +8 | +4 | ドメインコントローラのDNSホスト名(ANSI)。 |
| SiteName | LPSTR | 8/4 | +16 | +8 | DCが属するサイトの名前(ANSI)。 |
| SiteObjectName | LPSTR | 8/4 | +24 | +12 | サイトオブジェクトのDN(ANSI)。 |
| ComputerObjectName | LPSTR | 8/4 | +32 | +16 | DCのコンピュータオブジェクトのDN(ANSI)。 |
| ServerObjectName | LPSTR | 8/4 | +40 | +20 | DCのサーバオブジェクトのDN(ANSI)。 |
| NtdsDsaObjectName | LPSTR | 8/4 | +48 | +24 | NTDS設定(DSA)オブジェクトのDN(ANSI)。 |
| fIsPdc | BOOL | 4 | +56 | +28 | TRUEならPDCエミュレータ役割を持つことを示す論理値。 |
| fDsEnabled | BOOL | 4 | +60 | +32 | TRUEならディレクトリサービスが有効であることを示す論理値。 |
| fIsGc | BOOL | 4 | +64 | +36 | TRUEならグローバルカタログサーバであることを示す論理値。 |
| fIsRodc | BOOL | 4 | +68 | +40 | TRUEなら読み取り専用ドメインコントローラ(RODC)であることを示す論理値。 |
| SiteObjectGuid | GUID | 16 | +72 | +44 | サイトオブジェクトのGUID。 |
| ComputerObjectGuid | GUID | 16 | +88 | +60 | コンピュータオブジェクトのGUID。 |
| ServerObjectGuid | GUID | 16 | +104 | +76 | サーバオブジェクトのGUID。 |
| NtdsDsaObjectGuid | GUID | 16 | +120 | +92 | NTDS設定(DSA)オブジェクトのGUID。 |
各言語での定義
#include <windows.h>
// DS_DOMAIN_CONTROLLER_INFO_3A (x64 136 / x86 108 バイト)
typedef struct DS_DOMAIN_CONTROLLER_INFO_3A {
LPSTR NetbiosName;
LPSTR DnsHostName;
LPSTR SiteName;
LPSTR SiteObjectName;
LPSTR ComputerObjectName;
LPSTR ServerObjectName;
LPSTR NtdsDsaObjectName;
BOOL fIsPdc;
BOOL fDsEnabled;
BOOL fIsGc;
BOOL fIsRodc;
GUID SiteObjectGuid;
GUID ComputerObjectGuid;
GUID ServerObjectGuid;
GUID NtdsDsaObjectGuid;
} DS_DOMAIN_CONTROLLER_INFO_3A;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DS_DOMAIN_CONTROLLER_INFO_3A
{
public IntPtr NetbiosName;
public IntPtr DnsHostName;
public IntPtr SiteName;
public IntPtr SiteObjectName;
public IntPtr ComputerObjectName;
public IntPtr ServerObjectName;
public IntPtr NtdsDsaObjectName;
[MarshalAs(UnmanagedType.Bool)] public bool fIsPdc;
[MarshalAs(UnmanagedType.Bool)] public bool fDsEnabled;
[MarshalAs(UnmanagedType.Bool)] public bool fIsGc;
[MarshalAs(UnmanagedType.Bool)] public bool fIsRodc;
public Guid SiteObjectGuid;
public Guid ComputerObjectGuid;
public Guid ServerObjectGuid;
public Guid NtdsDsaObjectGuid;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DS_DOMAIN_CONTROLLER_INFO_3A
Public NetbiosName As IntPtr
Public DnsHostName As IntPtr
Public SiteName As IntPtr
Public SiteObjectName As IntPtr
Public ComputerObjectName As IntPtr
Public ServerObjectName As IntPtr
Public NtdsDsaObjectName As IntPtr
<MarshalAs(UnmanagedType.Bool)> Public fIsPdc As Boolean
<MarshalAs(UnmanagedType.Bool)> Public fDsEnabled As Boolean
<MarshalAs(UnmanagedType.Bool)> Public fIsGc As Boolean
<MarshalAs(UnmanagedType.Bool)> Public fIsRodc As Boolean
Public SiteObjectGuid As Guid
Public ComputerObjectGuid As Guid
Public ServerObjectGuid As Guid
Public NtdsDsaObjectGuid As Guid
End Structureimport ctypes
from ctypes import wintypes
class DS_DOMAIN_CONTROLLER_INFO_3A(ctypes.Structure):
_fields_ = [
("NetbiosName", ctypes.c_void_p),
("DnsHostName", ctypes.c_void_p),
("SiteName", ctypes.c_void_p),
("SiteObjectName", ctypes.c_void_p),
("ComputerObjectName", ctypes.c_void_p),
("ServerObjectName", ctypes.c_void_p),
("NtdsDsaObjectName", ctypes.c_void_p),
("fIsPdc", wintypes.BOOL),
("fDsEnabled", wintypes.BOOL),
("fIsGc", wintypes.BOOL),
("fIsRodc", wintypes.BOOL),
("SiteObjectGuid", GUID),
("ComputerObjectGuid", GUID),
("ServerObjectGuid", GUID),
("NtdsDsaObjectGuid", GUID),
]#[repr(C)]
pub struct DS_DOMAIN_CONTROLLER_INFO_3A {
pub NetbiosName: *mut core::ffi::c_void,
pub DnsHostName: *mut core::ffi::c_void,
pub SiteName: *mut core::ffi::c_void,
pub SiteObjectName: *mut core::ffi::c_void,
pub ComputerObjectName: *mut core::ffi::c_void,
pub ServerObjectName: *mut core::ffi::c_void,
pub NtdsDsaObjectName: *mut core::ffi::c_void,
pub fIsPdc: i32,
pub fDsEnabled: i32,
pub fIsGc: i32,
pub fIsRodc: i32,
pub SiteObjectGuid: GUID,
pub ComputerObjectGuid: GUID,
pub ServerObjectGuid: GUID,
pub NtdsDsaObjectGuid: GUID,
}import "golang.org/x/sys/windows"
type DS_DOMAIN_CONTROLLER_INFO_3A struct {
NetbiosName uintptr
DnsHostName uintptr
SiteName uintptr
SiteObjectName uintptr
ComputerObjectName uintptr
ServerObjectName uintptr
NtdsDsaObjectName uintptr
fIsPdc int32
fDsEnabled int32
fIsGc int32
fIsRodc int32
SiteObjectGuid windows.GUID
ComputerObjectGuid windows.GUID
ServerObjectGuid windows.GUID
NtdsDsaObjectGuid windows.GUID
}type
DS_DOMAIN_CONTROLLER_INFO_3A = record
NetbiosName: Pointer;
DnsHostName: Pointer;
SiteName: Pointer;
SiteObjectName: Pointer;
ComputerObjectName: Pointer;
ServerObjectName: Pointer;
NtdsDsaObjectName: Pointer;
fIsPdc: BOOL;
fDsEnabled: BOOL;
fIsGc: BOOL;
fIsRodc: BOOL;
SiteObjectGuid: TGUID;
ComputerObjectGuid: TGUID;
ServerObjectGuid: TGUID;
NtdsDsaObjectGuid: TGUID;
end;const DS_DOMAIN_CONTROLLER_INFO_3A = extern struct {
NetbiosName: ?*anyopaque,
DnsHostName: ?*anyopaque,
SiteName: ?*anyopaque,
SiteObjectName: ?*anyopaque,
ComputerObjectName: ?*anyopaque,
ServerObjectName: ?*anyopaque,
NtdsDsaObjectName: ?*anyopaque,
fIsPdc: i32,
fDsEnabled: i32,
fIsGc: i32,
fIsRodc: i32,
SiteObjectGuid: GUID,
ComputerObjectGuid: GUID,
ServerObjectGuid: GUID,
NtdsDsaObjectGuid: GUID,
};type
DS_DOMAIN_CONTROLLER_INFO_3A {.bycopy.} = object
NetbiosName: pointer
DnsHostName: pointer
SiteName: pointer
SiteObjectName: pointer
ComputerObjectName: pointer
ServerObjectName: pointer
NtdsDsaObjectName: pointer
fIsPdc: int32
fDsEnabled: int32
fIsGc: int32
fIsRodc: int32
SiteObjectGuid: GUID
ComputerObjectGuid: GUID
ServerObjectGuid: GUID
NtdsDsaObjectGuid: GUIDstruct DS_DOMAIN_CONTROLLER_INFO_3A
{
void* NetbiosName;
void* DnsHostName;
void* SiteName;
void* SiteObjectName;
void* ComputerObjectName;
void* ServerObjectName;
void* NtdsDsaObjectName;
int fIsPdc;
int fDsEnabled;
int fIsGc;
int fIsRodc;
GUID SiteObjectGuid;
GUID ComputerObjectGuid;
GUID ServerObjectGuid;
GUID NtdsDsaObjectGuid;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DS_DOMAIN_CONTROLLER_INFO_3A サイズ: 108 バイト(x86)
dim st, 27 ; 4byte整数×27(構造体サイズ 108 / 4 切り上げ)
; NetbiosName : LPSTR (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; DnsHostName : LPSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; SiteName : LPSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; SiteObjectName : LPSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ComputerObjectName : LPSTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ServerObjectName : LPSTR (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; NtdsDsaObjectName : LPSTR (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; fIsPdc : BOOL (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; fDsEnabled : BOOL (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; fIsGc : BOOL (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; fIsRodc : BOOL (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; SiteObjectGuid : GUID (+44, 16byte) varptr(st)+44 を基点に操作(16byte:入れ子/配列)
; ComputerObjectGuid : GUID (+60, 16byte) varptr(st)+60 を基点に操作(16byte:入れ子/配列)
; ServerObjectGuid : GUID (+76, 16byte) varptr(st)+76 を基点に操作(16byte:入れ子/配列)
; NtdsDsaObjectGuid : GUID (+92, 16byte) varptr(st)+92 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DS_DOMAIN_CONTROLLER_INFO_3A サイズ: 136 バイト(x64)
dim st, 34 ; 4byte整数×34(構造体サイズ 136 / 4 切り上げ)
; NetbiosName : LPSTR (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; DnsHostName : LPSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; SiteName : LPSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; SiteObjectName : LPSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ComputerObjectName : LPSTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; ServerObjectName : LPSTR (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; NtdsDsaObjectName : LPSTR (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; fIsPdc : BOOL (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; fDsEnabled : BOOL (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; fIsGc : BOOL (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; fIsRodc : BOOL (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; SiteObjectGuid : GUID (+72, 16byte) varptr(st)+72 を基点に操作(16byte:入れ子/配列)
; ComputerObjectGuid : GUID (+88, 16byte) varptr(st)+88 を基点に操作(16byte:入れ子/配列)
; ServerObjectGuid : GUID (+104, 16byte) varptr(st)+104 を基点に操作(16byte:入れ子/配列)
; NtdsDsaObjectGuid : GUID (+120, 16byte) varptr(st)+120 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global DS_DOMAIN_CONTROLLER_INFO_3A
#field intptr NetbiosName
#field intptr DnsHostName
#field intptr SiteName
#field intptr SiteObjectName
#field intptr ComputerObjectName
#field intptr ServerObjectName
#field intptr NtdsDsaObjectName
#field bool fIsPdc
#field bool fDsEnabled
#field bool fIsGc
#field bool fIsRodc
#field GUID SiteObjectGuid
#field GUID ComputerObjectGuid
#field GUID ServerObjectGuid
#field GUID NtdsDsaObjectGuid
#endstruct
stdim st, DS_DOMAIN_CONTROLLER_INFO_3A ; NSTRUCT 変数を確保
st->fIsPdc = 100
mes "fIsPdc=" + st->fIsPdc