ホーム › NetworkManagement.NetManagement › NETLOGON_INFO_2
NETLOGON_INFO_2
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| netlog2_flags | DWORD | 4 | +0 | +0 | Netlogonサービスの状態フラグ。NETLOGON_*ビットの組み合わせを表す。 |
| netlog2_pdc_connection_status | DWORD | 4 | +4 | +4 | プライマリドメインコントローラーへの接続状態を示すステータスコード。 |
| netlog2_trusted_dc_name | LPWSTR | 8/4 | +8 | +8 | 信頼関係の検証に使用したドメインコントローラー名を示すUnicode文字列。 |
| netlog2_tc_connection_status | DWORD | 4 | +16 | +12 | 信頼チャネル(セキュアチャネル)の接続状態を示すステータスコード。 |
各言語での定義
#include <windows.h>
// NETLOGON_INFO_2 (x64 24 / x86 16 バイト)
typedef struct NETLOGON_INFO_2 {
DWORD netlog2_flags;
DWORD netlog2_pdc_connection_status;
LPWSTR netlog2_trusted_dc_name;
DWORD netlog2_tc_connection_status;
} NETLOGON_INFO_2;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NETLOGON_INFO_2
{
public uint netlog2_flags;
public uint netlog2_pdc_connection_status;
public IntPtr netlog2_trusted_dc_name;
public uint netlog2_tc_connection_status;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NETLOGON_INFO_2
Public netlog2_flags As UInteger
Public netlog2_pdc_connection_status As UInteger
Public netlog2_trusted_dc_name As IntPtr
Public netlog2_tc_connection_status As UInteger
End Structureimport ctypes
from ctypes import wintypes
class NETLOGON_INFO_2(ctypes.Structure):
_fields_ = [
("netlog2_flags", wintypes.DWORD),
("netlog2_pdc_connection_status", wintypes.DWORD),
("netlog2_trusted_dc_name", ctypes.c_void_p),
("netlog2_tc_connection_status", wintypes.DWORD),
]#[repr(C)]
pub struct NETLOGON_INFO_2 {
pub netlog2_flags: u32,
pub netlog2_pdc_connection_status: u32,
pub netlog2_trusted_dc_name: *mut core::ffi::c_void,
pub netlog2_tc_connection_status: u32,
}import "golang.org/x/sys/windows"
type NETLOGON_INFO_2 struct {
netlog2_flags uint32
netlog2_pdc_connection_status uint32
netlog2_trusted_dc_name uintptr
netlog2_tc_connection_status uint32
}type
NETLOGON_INFO_2 = record
netlog2_flags: DWORD;
netlog2_pdc_connection_status: DWORD;
netlog2_trusted_dc_name: Pointer;
netlog2_tc_connection_status: DWORD;
end;const NETLOGON_INFO_2 = extern struct {
netlog2_flags: u32,
netlog2_pdc_connection_status: u32,
netlog2_trusted_dc_name: ?*anyopaque,
netlog2_tc_connection_status: u32,
};type
NETLOGON_INFO_2 {.bycopy.} = object
netlog2_flags: uint32
netlog2_pdc_connection_status: uint32
netlog2_trusted_dc_name: pointer
netlog2_tc_connection_status: uint32struct NETLOGON_INFO_2
{
uint netlog2_flags;
uint netlog2_pdc_connection_status;
void* netlog2_trusted_dc_name;
uint netlog2_tc_connection_status;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; NETLOGON_INFO_2 サイズ: 16 バイト(x86)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; netlog2_flags : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; netlog2_pdc_connection_status : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; netlog2_trusted_dc_name : LPWSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; netlog2_tc_connection_status : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; NETLOGON_INFO_2 サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; netlog2_flags : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; netlog2_pdc_connection_status : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; netlog2_trusted_dc_name : LPWSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; netlog2_tc_connection_status : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global NETLOGON_INFO_2
#field int netlog2_flags
#field int netlog2_pdc_connection_status
#field intptr netlog2_trusted_dc_name
#field int netlog2_tc_connection_status
#endstruct
stdim st, NETLOGON_INFO_2 ; NSTRUCT 変数を確保
st->netlog2_flags = 100
mes "netlog2_flags=" + st->netlog2_flags