Win32 API 日本語リファレンス
ホームNetworking.ActiveDirectory › DSBROWSEINFOA

DSBROWSEINFOA

構造体
サイズx64: 112 バイト / x86: 60 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
cbStructDWORD4+0+0本構造体のバイトサイズ。呼び出し前に設定する。
hwndOwnerHWND8/4+8+4ブラウザダイアログの親ウィンドウハンドル。
pszCaptionLPSTR8/4+16+8ダイアログのキャプション文字列(ANSI)。
pszTitleLPSTR8/4+24+12ツリービュー上部のタイトル文字列(ANSI)。
pszRootLPWSTR8/4+32+16参照ツリーのルートとなるADsパス文字列。NULLで既定ルート。
pszPathLPWSTR8/4+40+20選択結果のパスを受け取るバッファ。初期選択にも使用する。
cchPathDWORD4+48+24pszPathバッファの文字数サイズを示す。
dwFlagsDWORD4+52+28ブラウザの表示と動作を制御するフラグ。
pfnCallbackBFFCALLBACK8/4+56+32ダイアログ初期化等を処理するコールバック関数。不要ならNULL。
lParamLPARAM8/4+64+36コールバックに渡されるアプリケーション定義値。
dwReturnFormatDWORD4+72+40返されるパスの形式(ADS_FORMAT_ENUM)を指定する。
pUserNameLPWSTR8/4+80+44認証に使用するユーザ名文字列。既定資格情報ならNULL。
pPasswordLPWSTR8/4+88+48認証に使用するパスワード文字列。既定資格情報ならNULL。
pszObjectClassLPWSTR8/4+96+52選択オブジェクトのクラス名を受け取るバッファ。
cchObjectClassDWORD4+104+56pszObjectClassバッファの文字数サイズを示す。

各言語での定義

#include <windows.h>

// DSBROWSEINFOA  (x64 112 / x86 60 バイト)
typedef struct DSBROWSEINFOA {
    DWORD cbStruct;
    HWND hwndOwner;
    LPSTR pszCaption;
    LPSTR pszTitle;
    LPWSTR pszRoot;
    LPWSTR pszPath;
    DWORD cchPath;
    DWORD dwFlags;
    BFFCALLBACK pfnCallback;
    LPARAM lParam;
    DWORD dwReturnFormat;
    LPWSTR pUserName;
    LPWSTR pPassword;
    LPWSTR pszObjectClass;
    DWORD cchObjectClass;
} DSBROWSEINFOA;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DSBROWSEINFOA
{
    public uint cbStruct;
    public IntPtr hwndOwner;
    public IntPtr pszCaption;
    public IntPtr pszTitle;
    public IntPtr pszRoot;
    public IntPtr pszPath;
    public uint cchPath;
    public uint dwFlags;
    public IntPtr pfnCallback;
    public IntPtr lParam;
    public uint dwReturnFormat;
    public IntPtr pUserName;
    public IntPtr pPassword;
    public IntPtr pszObjectClass;
    public uint cchObjectClass;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DSBROWSEINFOA
    Public cbStruct As UInteger
    Public hwndOwner As IntPtr
    Public pszCaption As IntPtr
    Public pszTitle As IntPtr
    Public pszRoot As IntPtr
    Public pszPath As IntPtr
    Public cchPath As UInteger
    Public dwFlags As UInteger
    Public pfnCallback As IntPtr
    Public lParam As IntPtr
    Public dwReturnFormat As UInteger
    Public pUserName As IntPtr
    Public pPassword As IntPtr
    Public pszObjectClass As IntPtr
    Public cchObjectClass As UInteger
End Structure
import ctypes
from ctypes import wintypes

class DSBROWSEINFOA(ctypes.Structure):
    _fields_ = [
        ("cbStruct", wintypes.DWORD),
        ("hwndOwner", ctypes.c_void_p),
        ("pszCaption", ctypes.c_void_p),
        ("pszTitle", ctypes.c_void_p),
        ("pszRoot", ctypes.c_void_p),
        ("pszPath", ctypes.c_void_p),
        ("cchPath", wintypes.DWORD),
        ("dwFlags", wintypes.DWORD),
        ("pfnCallback", ctypes.c_void_p),
        ("lParam", ctypes.c_ssize_t),
        ("dwReturnFormat", wintypes.DWORD),
        ("pUserName", ctypes.c_void_p),
        ("pPassword", ctypes.c_void_p),
        ("pszObjectClass", ctypes.c_void_p),
        ("cchObjectClass", wintypes.DWORD),
    ]
#[repr(C)]
pub struct DSBROWSEINFOA {
    pub cbStruct: u32,
    pub hwndOwner: *mut core::ffi::c_void,
    pub pszCaption: *mut core::ffi::c_void,
    pub pszTitle: *mut core::ffi::c_void,
    pub pszRoot: *mut core::ffi::c_void,
    pub pszPath: *mut core::ffi::c_void,
    pub cchPath: u32,
    pub dwFlags: u32,
    pub pfnCallback: *mut core::ffi::c_void,
    pub lParam: isize,
    pub dwReturnFormat: u32,
    pub pUserName: *mut core::ffi::c_void,
    pub pPassword: *mut core::ffi::c_void,
    pub pszObjectClass: *mut core::ffi::c_void,
    pub cchObjectClass: u32,
}
import "golang.org/x/sys/windows"

type DSBROWSEINFOA struct {
	cbStruct uint32
	hwndOwner uintptr
	pszCaption uintptr
	pszTitle uintptr
	pszRoot uintptr
	pszPath uintptr
	cchPath uint32
	dwFlags uint32
	pfnCallback uintptr
	lParam uintptr
	dwReturnFormat uint32
	pUserName uintptr
	pPassword uintptr
	pszObjectClass uintptr
	cchObjectClass uint32
}
type
  DSBROWSEINFOA = record
    cbStruct: DWORD;
    hwndOwner: Pointer;
    pszCaption: Pointer;
    pszTitle: Pointer;
    pszRoot: Pointer;
    pszPath: Pointer;
    cchPath: DWORD;
    dwFlags: DWORD;
    pfnCallback: Pointer;
    lParam: NativeInt;
    dwReturnFormat: DWORD;
    pUserName: Pointer;
    pPassword: Pointer;
    pszObjectClass: Pointer;
    cchObjectClass: DWORD;
  end;
const DSBROWSEINFOA = extern struct {
    cbStruct: u32,
    hwndOwner: ?*anyopaque,
    pszCaption: ?*anyopaque,
    pszTitle: ?*anyopaque,
    pszRoot: ?*anyopaque,
    pszPath: ?*anyopaque,
    cchPath: u32,
    dwFlags: u32,
    pfnCallback: ?*anyopaque,
    lParam: isize,
    dwReturnFormat: u32,
    pUserName: ?*anyopaque,
    pPassword: ?*anyopaque,
    pszObjectClass: ?*anyopaque,
    cchObjectClass: u32,
};
type
  DSBROWSEINFOA {.bycopy.} = object
    cbStruct: uint32
    hwndOwner: pointer
    pszCaption: pointer
    pszTitle: pointer
    pszRoot: pointer
    pszPath: pointer
    cchPath: uint32
    dwFlags: uint32
    pfnCallback: pointer
    lParam: int
    dwReturnFormat: uint32
    pUserName: pointer
    pPassword: pointer
    pszObjectClass: pointer
    cchObjectClass: uint32
struct DSBROWSEINFOA
{
    uint cbStruct;
    void* hwndOwner;
    void* pszCaption;
    void* pszTitle;
    void* pszRoot;
    void* pszPath;
    uint cchPath;
    uint dwFlags;
    void* pfnCallback;
    ptrdiff_t lParam;
    uint dwReturnFormat;
    void* pUserName;
    void* pPassword;
    void* pszObjectClass;
    uint cchObjectClass;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DSBROWSEINFOA サイズ: 60 バイト(x86)
dim st, 15    ; 4byte整数×15(構造体サイズ 60 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; hwndOwner : HWND (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; pszCaption : LPSTR (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; pszTitle : LPSTR (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; pszRoot : LPWSTR (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; pszPath : LPWSTR (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; cchPath : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; dwFlags : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; pfnCallback : BFFCALLBACK (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; lParam : LPARAM (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; dwReturnFormat : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; pUserName : LPWSTR (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; pPassword : LPWSTR (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; pszObjectClass : LPWSTR (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; cchObjectClass : DWORD (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DSBROWSEINFOA サイズ: 112 バイト(x64)
dim st, 28    ; 4byte整数×28(構造体サイズ 112 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; hwndOwner : HWND (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pszCaption : LPSTR (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; pszTitle : LPSTR (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; pszRoot : LPWSTR (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; pszPath : LPWSTR (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; cchPath : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; dwFlags : DWORD (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; pfnCallback : BFFCALLBACK (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; lParam : LPARAM (+64, 8byte)  qpoke st,64,値 / qpeek(st,64)  ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; dwReturnFormat : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; pUserName : LPWSTR (+80, 8byte)  qpoke st,80,値 / qpeek(st,80)  ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; pPassword : LPWSTR (+88, 8byte)  qpoke st,88,値 / qpeek(st,88)  ※IronHSPのみ。3.7/3.8は lpoke st,88,下位 : lpoke st,92,上位
; pszObjectClass : LPWSTR (+96, 8byte)  qpoke st,96,値 / qpeek(st,96)  ※IronHSPのみ。3.7/3.8は lpoke st,96,下位 : lpoke st,100,上位
; cchObjectClass : DWORD (+104, 4byte)  st.26 = 値  /  値 = st.26   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DSBROWSEINFOA
    #field int cbStruct
    #field intptr hwndOwner
    #field intptr pszCaption
    #field intptr pszTitle
    #field intptr pszRoot
    #field intptr pszPath
    #field int cchPath
    #field int dwFlags
    #field intptr pfnCallback
    #field intptr lParam
    #field int dwReturnFormat
    #field intptr pUserName
    #field intptr pPassword
    #field intptr pszObjectClass
    #field int cchObjectClass
#endstruct

stdim st, DSBROWSEINFOA        ; NSTRUCT 変数を確保
st->cbStruct = 100
mes "cbStruct=" + st->cbStruct