ホーム › Networking.ActiveDirectory › ADS_REPLICAPOINTER
ADS_REPLICAPOINTER
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ServerName | LPWSTR | 8/4 | +0 | +0 | レプリカを保持するサーバ名の文字列。 |
| ReplicaType | DWORD | 4 | +8 | +4 | レプリカの種類を示す値。 |
| ReplicaNumber | DWORD | 4 | +12 | +8 | レプリカの番号。 |
| Count | DWORD | 4 | +16 | +12 | ReplicaAddressHintsに含まれるアドレスヒントの数。 |
| ReplicaAddressHints | ADS_NETADDRESS* | 8/4 | +24 | +16 | レプリカのネットワークアドレスヒント配列へのポインタ。 |
各言語での定義
#include <windows.h>
// ADS_REPLICAPOINTER (x64 32 / x86 20 バイト)
typedef struct ADS_REPLICAPOINTER {
LPWSTR ServerName;
DWORD ReplicaType;
DWORD ReplicaNumber;
DWORD Count;
ADS_NETADDRESS* ReplicaAddressHints;
} ADS_REPLICAPOINTER;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ADS_REPLICAPOINTER
{
public IntPtr ServerName;
public uint ReplicaType;
public uint ReplicaNumber;
public uint Count;
public IntPtr ReplicaAddressHints;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure ADS_REPLICAPOINTER
Public ServerName As IntPtr
Public ReplicaType As UInteger
Public ReplicaNumber As UInteger
Public Count As UInteger
Public ReplicaAddressHints As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class ADS_REPLICAPOINTER(ctypes.Structure):
_fields_ = [
("ServerName", ctypes.c_void_p),
("ReplicaType", wintypes.DWORD),
("ReplicaNumber", wintypes.DWORD),
("Count", wintypes.DWORD),
("ReplicaAddressHints", ctypes.c_void_p),
]#[repr(C)]
pub struct ADS_REPLICAPOINTER {
pub ServerName: *mut core::ffi::c_void,
pub ReplicaType: u32,
pub ReplicaNumber: u32,
pub Count: u32,
pub ReplicaAddressHints: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type ADS_REPLICAPOINTER struct {
ServerName uintptr
ReplicaType uint32
ReplicaNumber uint32
Count uint32
ReplicaAddressHints uintptr
}type
ADS_REPLICAPOINTER = record
ServerName: Pointer;
ReplicaType: DWORD;
ReplicaNumber: DWORD;
Count: DWORD;
ReplicaAddressHints: Pointer;
end;const ADS_REPLICAPOINTER = extern struct {
ServerName: ?*anyopaque,
ReplicaType: u32,
ReplicaNumber: u32,
Count: u32,
ReplicaAddressHints: ?*anyopaque,
};type
ADS_REPLICAPOINTER {.bycopy.} = object
ServerName: pointer
ReplicaType: uint32
ReplicaNumber: uint32
Count: uint32
ReplicaAddressHints: pointerstruct ADS_REPLICAPOINTER
{
void* ServerName;
uint ReplicaType;
uint ReplicaNumber;
uint Count;
void* ReplicaAddressHints;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; ADS_REPLICAPOINTER サイズ: 20 バイト(x86)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; ServerName : LPWSTR (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; ReplicaType : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; ReplicaNumber : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Count : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ReplicaAddressHints : ADS_NETADDRESS* (+16, 4byte) varptr(st)+16 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; ADS_REPLICAPOINTER サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; ServerName : LPWSTR (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; ReplicaType : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ReplicaNumber : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; Count : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ReplicaAddressHints : ADS_NETADDRESS* (+24, 8byte) varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global ADS_REPLICAPOINTER
#field intptr ServerName
#field int ReplicaType
#field int ReplicaNumber
#field int Count
#field intptr ReplicaAddressHints
#endstruct
stdim st, ADS_REPLICAPOINTER ; NSTRUCT 変数を確保
st->ReplicaType = 100
mes "ReplicaType=" + st->ReplicaType