ホーム › System.GroupPolicy › GPOBROWSEINFO
GPOBROWSEINFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwSize | DWORD | 4 | +0 | +0 | 本構造体のバイトサイズ。使用前に設定が必要。 |
| dwFlags | DWORD | 4 | +4 | +4 | ブラウザダイアログの動作フラグ。 |
| hwndOwner | HWND | 8/4 | +8 | +8 | ダイアログの親ウィンドウハンドル。NULL可。 |
| lpTitle | LPWSTR | 8/4 | +16 | +12 | ダイアログのタイトル文字列(ワイド)。NULL可。 |
| lpInitialOU | LPWSTR | 8/4 | +24 | +16 | 初期表示する組織単位のパス(ワイド文字列)。 |
| lpDSPath | LPWSTR | 8/4 | +32 | +20 | 選択されたGPOのDSパスを受け取るバッファ(ワイド)。 |
| dwDSPathSize | DWORD | 4 | +40 | +24 | lpDSPathバッファの文字数。 |
| lpName | LPWSTR | 8/4 | +48 | +28 | 選択されたGPO名を受け取るバッファ(ワイド)。 |
| dwNameSize | DWORD | 4 | +56 | +32 | lpNameバッファの文字数。 |
| gpoType | GROUP_POLICY_OBJECT_TYPE | 4 | +60 | +36 | 対象とするGPOの種類(GROUP_POLICY_OBJECT_TYPE)。 |
| gpoHint | GROUP_POLICY_HINT_TYPE | 4 | +64 | +40 | GPOの所在に関するヒント(GROUP_POLICY_HINT_TYPE)。 |
各言語での定義
#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