ホーム › NetworkManagement.NetManagement › NETSETUP_PROVISIONING_PARAMS
NETSETUP_PROVISIONING_PARAMS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwVersion | DWORD | 4 | +0 | +0 | この構造体のバージョン番号を示す。互換性判定に用いる。 |
| lpDomain | LPWSTR | 8/4 | +8 | +4 | デバイスを参加させるドメイン名を表す文字列へのポインタ。 |
| lpHostName | LPWSTR | 8/4 | +16 | +8 | プロビジョニングするコンピューターのホスト名を表す文字列。NULL可。 |
| lpMachineAccountOU | LPWSTR | 8/4 | +24 | +12 | コンピューターアカウントを作成する組織単位(OU)パスを表す文字列。NULL可。 |
| lpDcName | LPWSTR | 8/4 | +32 | +16 | 使用するドメインコントローラー名を表す文字列へのポインタ。NULL可。 |
| dwProvisionOptions | NETSETUP_PROVISION | 4 | +40 | +20 | プロビジョニング動作を制御するオプションフラグを示す。 |
| aCertTemplateNames | LPWSTR* | 8/4 | +48 | +24 | 適用する証明書テンプレート名の配列へのポインタ。 |
| cCertTemplateNames | DWORD | 4 | +56 | +28 | aCertTemplateNames配列の要素数を示す。 |
| aMachinePolicyNames | LPWSTR* | 8/4 | +64 | +32 | 適用するマシンポリシー名の配列へのポインタ。 |
| cMachinePolicyNames | DWORD | 4 | +72 | +36 | aMachinePolicyNames配列の要素数を示す。 |
| aMachinePolicyPaths | LPWSTR* | 8/4 | +80 | +40 | 適用するマシンポリシーのパス配列へのポインタ。 |
| cMachinePolicyPaths | DWORD | 4 | +88 | +44 | aMachinePolicyPaths配列の要素数を示す。 |
| lpNetbiosName | LPWSTR | 8/4 | +96 | +48 | コンピューターのNetBIOS名を表す文字列へのポインタ。NULL可。 |
| lpSiteName | LPWSTR | 8/4 | +104 | +52 | デバイスを配置するADサイト名を表す文字列へのポインタ。NULL可。 |
| lpPrimaryDNSDomain | LPWSTR | 8/4 | +112 | +56 | プライマリDNSドメイン名を表す文字列へのポインタ。NULL可。 |
各言語での定義
#include <windows.h>
// NETSETUP_PROVISIONING_PARAMS (x64 120 / x86 60 バイト)
typedef struct NETSETUP_PROVISIONING_PARAMS {
DWORD dwVersion;
LPWSTR lpDomain;
LPWSTR lpHostName;
LPWSTR lpMachineAccountOU;
LPWSTR lpDcName;
NETSETUP_PROVISION dwProvisionOptions;
LPWSTR* aCertTemplateNames;
DWORD cCertTemplateNames;
LPWSTR* aMachinePolicyNames;
DWORD cMachinePolicyNames;
LPWSTR* aMachinePolicyPaths;
DWORD cMachinePolicyPaths;
LPWSTR lpNetbiosName;
LPWSTR lpSiteName;
LPWSTR lpPrimaryDNSDomain;
} NETSETUP_PROVISIONING_PARAMS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NETSETUP_PROVISIONING_PARAMS
{
public uint dwVersion;
public IntPtr lpDomain;
public IntPtr lpHostName;
public IntPtr lpMachineAccountOU;
public IntPtr lpDcName;
public uint dwProvisionOptions;
public IntPtr aCertTemplateNames;
public uint cCertTemplateNames;
public IntPtr aMachinePolicyNames;
public uint cMachinePolicyNames;
public IntPtr aMachinePolicyPaths;
public uint cMachinePolicyPaths;
public IntPtr lpNetbiosName;
public IntPtr lpSiteName;
public IntPtr lpPrimaryDNSDomain;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NETSETUP_PROVISIONING_PARAMS
Public dwVersion As UInteger
Public lpDomain As IntPtr
Public lpHostName As IntPtr
Public lpMachineAccountOU As IntPtr
Public lpDcName As IntPtr
Public dwProvisionOptions As UInteger
Public aCertTemplateNames As IntPtr
Public cCertTemplateNames As UInteger
Public aMachinePolicyNames As IntPtr
Public cMachinePolicyNames As UInteger
Public aMachinePolicyPaths As IntPtr
Public cMachinePolicyPaths As UInteger
Public lpNetbiosName As IntPtr
Public lpSiteName As IntPtr
Public lpPrimaryDNSDomain As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class NETSETUP_PROVISIONING_PARAMS(ctypes.Structure):
_fields_ = [
("dwVersion", wintypes.DWORD),
("lpDomain", ctypes.c_void_p),
("lpHostName", ctypes.c_void_p),
("lpMachineAccountOU", ctypes.c_void_p),
("lpDcName", ctypes.c_void_p),
("dwProvisionOptions", wintypes.DWORD),
("aCertTemplateNames", ctypes.c_void_p),
("cCertTemplateNames", wintypes.DWORD),
("aMachinePolicyNames", ctypes.c_void_p),
("cMachinePolicyNames", wintypes.DWORD),
("aMachinePolicyPaths", ctypes.c_void_p),
("cMachinePolicyPaths", wintypes.DWORD),
("lpNetbiosName", ctypes.c_void_p),
("lpSiteName", ctypes.c_void_p),
("lpPrimaryDNSDomain", ctypes.c_void_p),
]#[repr(C)]
pub struct NETSETUP_PROVISIONING_PARAMS {
pub dwVersion: u32,
pub lpDomain: *mut core::ffi::c_void,
pub lpHostName: *mut core::ffi::c_void,
pub lpMachineAccountOU: *mut core::ffi::c_void,
pub lpDcName: *mut core::ffi::c_void,
pub dwProvisionOptions: u32,
pub aCertTemplateNames: *mut core::ffi::c_void,
pub cCertTemplateNames: u32,
pub aMachinePolicyNames: *mut core::ffi::c_void,
pub cMachinePolicyNames: u32,
pub aMachinePolicyPaths: *mut core::ffi::c_void,
pub cMachinePolicyPaths: u32,
pub lpNetbiosName: *mut core::ffi::c_void,
pub lpSiteName: *mut core::ffi::c_void,
pub lpPrimaryDNSDomain: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type NETSETUP_PROVISIONING_PARAMS struct {
dwVersion uint32
lpDomain uintptr
lpHostName uintptr
lpMachineAccountOU uintptr
lpDcName uintptr
dwProvisionOptions uint32
aCertTemplateNames uintptr
cCertTemplateNames uint32
aMachinePolicyNames uintptr
cMachinePolicyNames uint32
aMachinePolicyPaths uintptr
cMachinePolicyPaths uint32
lpNetbiosName uintptr
lpSiteName uintptr
lpPrimaryDNSDomain uintptr
}type
NETSETUP_PROVISIONING_PARAMS = record
dwVersion: DWORD;
lpDomain: Pointer;
lpHostName: Pointer;
lpMachineAccountOU: Pointer;
lpDcName: Pointer;
dwProvisionOptions: DWORD;
aCertTemplateNames: Pointer;
cCertTemplateNames: DWORD;
aMachinePolicyNames: Pointer;
cMachinePolicyNames: DWORD;
aMachinePolicyPaths: Pointer;
cMachinePolicyPaths: DWORD;
lpNetbiosName: Pointer;
lpSiteName: Pointer;
lpPrimaryDNSDomain: Pointer;
end;const NETSETUP_PROVISIONING_PARAMS = extern struct {
dwVersion: u32,
lpDomain: ?*anyopaque,
lpHostName: ?*anyopaque,
lpMachineAccountOU: ?*anyopaque,
lpDcName: ?*anyopaque,
dwProvisionOptions: u32,
aCertTemplateNames: ?*anyopaque,
cCertTemplateNames: u32,
aMachinePolicyNames: ?*anyopaque,
cMachinePolicyNames: u32,
aMachinePolicyPaths: ?*anyopaque,
cMachinePolicyPaths: u32,
lpNetbiosName: ?*anyopaque,
lpSiteName: ?*anyopaque,
lpPrimaryDNSDomain: ?*anyopaque,
};type
NETSETUP_PROVISIONING_PARAMS {.bycopy.} = object
dwVersion: uint32
lpDomain: pointer
lpHostName: pointer
lpMachineAccountOU: pointer
lpDcName: pointer
dwProvisionOptions: uint32
aCertTemplateNames: pointer
cCertTemplateNames: uint32
aMachinePolicyNames: pointer
cMachinePolicyNames: uint32
aMachinePolicyPaths: pointer
cMachinePolicyPaths: uint32
lpNetbiosName: pointer
lpSiteName: pointer
lpPrimaryDNSDomain: pointerstruct NETSETUP_PROVISIONING_PARAMS
{
uint dwVersion;
void* lpDomain;
void* lpHostName;
void* lpMachineAccountOU;
void* lpDcName;
uint dwProvisionOptions;
void* aCertTemplateNames;
uint cCertTemplateNames;
void* aMachinePolicyNames;
uint cMachinePolicyNames;
void* aMachinePolicyPaths;
uint cMachinePolicyPaths;
void* lpNetbiosName;
void* lpSiteName;
void* lpPrimaryDNSDomain;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; NETSETUP_PROVISIONING_PARAMS サイズ: 60 バイト(x86)
dim st, 15 ; 4byte整数×15(構造体サイズ 60 / 4 切り上げ)
; dwVersion : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; lpDomain : LPWSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; lpHostName : LPWSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; lpMachineAccountOU : LPWSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; lpDcName : LPWSTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwProvisionOptions : NETSETUP_PROVISION (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; aCertTemplateNames : LPWSTR* (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; cCertTemplateNames : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; aMachinePolicyNames : LPWSTR* (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; cMachinePolicyNames : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; aMachinePolicyPaths : LPWSTR* (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; cMachinePolicyPaths : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; lpNetbiosName : LPWSTR (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; lpSiteName : LPWSTR (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; lpPrimaryDNSDomain : LPWSTR (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; NETSETUP_PROVISIONING_PARAMS サイズ: 120 バイト(x64)
dim st, 30 ; 4byte整数×30(構造体サイズ 120 / 4 切り上げ)
; dwVersion : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; lpDomain : LPWSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; lpHostName : LPWSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; lpMachineAccountOU : LPWSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; lpDcName : LPWSTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; dwProvisionOptions : NETSETUP_PROVISION (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; aCertTemplateNames : LPWSTR* (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; cCertTemplateNames : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; aMachinePolicyNames : LPWSTR* (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; cMachinePolicyNames : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; aMachinePolicyPaths : LPWSTR* (+80, 8byte) qpoke st,80,値 / qpeek(st,80) ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; cMachinePolicyPaths : DWORD (+88, 4byte) st.22 = 値 / 値 = st.22 (lpoke/lpeek も可)
; lpNetbiosName : LPWSTR (+96, 8byte) qpoke st,96,値 / qpeek(st,96) ※IronHSPのみ。3.7/3.8は lpoke st,96,下位 : lpoke st,100,上位
; lpSiteName : LPWSTR (+104, 8byte) qpoke st,104,値 / qpeek(st,104) ※IronHSPのみ。3.7/3.8は lpoke st,104,下位 : lpoke st,108,上位
; lpPrimaryDNSDomain : LPWSTR (+112, 8byte) qpoke st,112,値 / qpeek(st,112) ※IronHSPのみ。3.7/3.8は lpoke st,112,下位 : lpoke st,116,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global NETSETUP_PROVISIONING_PARAMS
#field int dwVersion
#field intptr lpDomain
#field intptr lpHostName
#field intptr lpMachineAccountOU
#field intptr lpDcName
#field int dwProvisionOptions
#field intptr aCertTemplateNames
#field int cCertTemplateNames
#field intptr aMachinePolicyNames
#field int cMachinePolicyNames
#field intptr aMachinePolicyPaths
#field int cMachinePolicyPaths
#field intptr lpNetbiosName
#field intptr lpSiteName
#field intptr lpPrimaryDNSDomain
#endstruct
stdim st, NETSETUP_PROVISIONING_PARAMS ; NSTRUCT 変数を確保
st->dwVersion = 100
mes "dwVersion=" + st->dwVersion