GPOBROWSEINFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwSize | DWORD | 4 | +0 | +0 | 構造体のサイズをバイト単位で指定します。 |
| dwFlags | DWORD | 4 | +4 | +4 | ダイアログ ボックスのオプションを指定します。このメンバーには、以下の値の 1 つ以上を指定できます。 GPO_BROWSE_DISABLE_NEWAll タブ以外のタブで新しい GPO を作成する機能を無効にします。 GPO_BROWSE_NOCOMPUTERSComputers タブを削除します。 GPO_BROWSE_NODSGPOSDomain/OU タブと Sites タブを削除します。 GPO_BROWSE_OPENBUTTONOK ボタンを Open に変更します。 GPO_BROWSE_INITTOALLAll タブにフォーカスを置いた状態でダイアログ ボックスを初期化します。 |
| hwndOwner | HWND | 8/4 | +8 | +8 | 親ウィンドウのハンドルを指定します。このメンバーが NULL の場合、ダイアログ ボックスには所有者がありません。 |
| lpTitle | LPWSTR | 8/4 | +16 | +12 | タイトル バーのテキストを指定します。このメンバーが NULL の場合、タイトル バーのテキストは Browse for a Group Policy Object になります。 |
| lpInitialOU | LPWSTR | 8/4 | +24 | +16 | 初期表示するドメインまたは組織単位を指定します。 |
| lpDSPath | LPWSTR | 8/4 | +32 | +20 | GPO の Active Directory パスを受け取るバッファーへのポインター。 |
| dwDSPathSize | DWORD | 4 | +40 | +24 | lpDSPath バッファーのサイズを文字数単位で指定します。 |
| lpName | LPWSTR | 8/4 | +48 | +28 | コンピューター名または GPO のフレンドリ名(表示名)のいずれかを受け取るバッファーへのポインター。ユーザーが Computers タブで GPO を開くか作成した場合、このメンバーにはコンピューター名が格納されます。ユーザーが Active Directory 内で GPO を開くか作成した場合、このメンバーにはフレンドリ名が格納されます。GPO の種類を判別するには、gpoType メンバーの説明を参照してください。 このメンバーは NULL にすることができます。 |
| dwNameSize | DWORD | 4 | +56 | +32 | lpName バッファーのサイズを文字数単位で指定します。 |
| gpoType | GROUP_POLICY_OBJECT_TYPE | 4 | +60 | +36 | GPO の種類を受け取ります。このメンバーには、以下のいずれかの値が入ります。 GPOTypeLocalローカル GPOTypeRemoteリモート GPOTypeDSActive Directory |
| gpoHint | GROUP_POLICY_HINT_TYPE | 4 | +64 | +40 | GPO がリンクされている可能性のある Active Directory コンテナーに関するヒントを受け取ります。このメンバーには、以下のいずれかの値が入ります。 GPHintUnknownリンク情報はありません。 GPHintMachineオブジェクトはコンピューター(ローカルまたはリモート)にリンクされている可能性があります。 GPHintSiteオブジェクトはサイトにリンクされている可能性があります。 GPHintDomainオブジェクトはドメインにリンクされている可能性があります。 GPHintOrganizationalUnitオブジェクトは組織単位にリンクされている可能性があります。 |
公式ドキュメント
GPOBROWSEINFO 構造体には、 BrowseForGPO 関数が GPO ブラウザー ダイアログ ボックスを初期化するために使用する情報が含まれます。ユーザーがダイアログ ボックスを閉じた後、システムはユーザーの操作に関する情報をこの構造体に返します。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// GPOBROWSEINFO (x64 72 / x86 44 バイト)
typedef struct GPOBROWSEINFO {
DWORD dwSize;
DWORD dwFlags;
HWND hwndOwner;
LPWSTR lpTitle;
LPWSTR lpInitialOU;
LPWSTR lpDSPath;
DWORD dwDSPathSize;
LPWSTR lpName;
DWORD dwNameSize;
GROUP_POLICY_OBJECT_TYPE gpoType;
GROUP_POLICY_HINT_TYPE gpoHint;
} GPOBROWSEINFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GPOBROWSEINFO
{
public uint dwSize;
public uint dwFlags;
public IntPtr hwndOwner;
public IntPtr lpTitle;
public IntPtr lpInitialOU;
public IntPtr lpDSPath;
public uint dwDSPathSize;
public IntPtr lpName;
public uint dwNameSize;
public int gpoType;
public int gpoHint;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GPOBROWSEINFO
Public dwSize As UInteger
Public dwFlags As UInteger
Public hwndOwner As IntPtr
Public lpTitle As IntPtr
Public lpInitialOU As IntPtr
Public lpDSPath As IntPtr
Public dwDSPathSize As UInteger
Public lpName As IntPtr
Public dwNameSize As UInteger
Public gpoType As Integer
Public gpoHint As Integer
End Structureimport ctypes
from ctypes import wintypes
class GPOBROWSEINFO(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("dwFlags", wintypes.DWORD),
("hwndOwner", ctypes.c_void_p),
("lpTitle", ctypes.c_void_p),
("lpInitialOU", ctypes.c_void_p),
("lpDSPath", ctypes.c_void_p),
("dwDSPathSize", wintypes.DWORD),
("lpName", ctypes.c_void_p),
("dwNameSize", wintypes.DWORD),
("gpoType", ctypes.c_int),
("gpoHint", ctypes.c_int),
]#[repr(C)]
pub struct GPOBROWSEINFO {
pub dwSize: u32,
pub dwFlags: u32,
pub hwndOwner: *mut core::ffi::c_void,
pub lpTitle: *mut core::ffi::c_void,
pub lpInitialOU: *mut core::ffi::c_void,
pub lpDSPath: *mut core::ffi::c_void,
pub dwDSPathSize: u32,
pub lpName: *mut core::ffi::c_void,
pub dwNameSize: u32,
pub gpoType: i32,
pub gpoHint: i32,
}import "golang.org/x/sys/windows"
type GPOBROWSEINFO struct {
dwSize uint32
dwFlags uint32
hwndOwner uintptr
lpTitle uintptr
lpInitialOU uintptr
lpDSPath uintptr
dwDSPathSize uint32
lpName uintptr
dwNameSize uint32
gpoType int32
gpoHint int32
}type
GPOBROWSEINFO = record
dwSize: DWORD;
dwFlags: DWORD;
hwndOwner: Pointer;
lpTitle: Pointer;
lpInitialOU: Pointer;
lpDSPath: Pointer;
dwDSPathSize: DWORD;
lpName: Pointer;
dwNameSize: DWORD;
gpoType: Integer;
gpoHint: Integer;
end;const GPOBROWSEINFO = extern struct {
dwSize: u32,
dwFlags: u32,
hwndOwner: ?*anyopaque,
lpTitle: ?*anyopaque,
lpInitialOU: ?*anyopaque,
lpDSPath: ?*anyopaque,
dwDSPathSize: u32,
lpName: ?*anyopaque,
dwNameSize: u32,
gpoType: i32,
gpoHint: i32,
};type
GPOBROWSEINFO {.bycopy.} = object
dwSize: uint32
dwFlags: uint32
hwndOwner: pointer
lpTitle: pointer
lpInitialOU: pointer
lpDSPath: pointer
dwDSPathSize: uint32
lpName: pointer
dwNameSize: uint32
gpoType: int32
gpoHint: int32struct GPOBROWSEINFO
{
uint dwSize;
uint dwFlags;
void* hwndOwner;
void* lpTitle;
void* lpInitialOU;
void* lpDSPath;
uint dwDSPathSize;
void* lpName;
uint dwNameSize;
int gpoType;
int gpoHint;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; GPOBROWSEINFO サイズ: 44 バイト(x86)
dim st, 11 ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; hwndOwner : HWND (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; lpTitle : LPWSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; lpInitialOU : LPWSTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; lpDSPath : LPWSTR (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; dwDSPathSize : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; lpName : LPWSTR (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; dwNameSize : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; gpoType : GROUP_POLICY_OBJECT_TYPE (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; gpoHint : GROUP_POLICY_HINT_TYPE (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GPOBROWSEINFO サイズ: 72 バイト(x64)
dim st, 18 ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; hwndOwner : HWND (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; lpTitle : LPWSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; lpInitialOU : LPWSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; lpDSPath : LPWSTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; dwDSPathSize : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; lpName : LPWSTR (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; dwNameSize : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; gpoType : GROUP_POLICY_OBJECT_TYPE (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; gpoHint : GROUP_POLICY_HINT_TYPE (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GPOBROWSEINFO
#field int dwSize
#field int dwFlags
#field intptr hwndOwner
#field intptr lpTitle
#field intptr lpInitialOU
#field intptr lpDSPath
#field int dwDSPathSize
#field intptr lpName
#field int dwNameSize
#field int gpoType
#field int gpoHint
#endstruct
stdim st, GPOBROWSEINFO ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize