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

DSQUERYINITPARAMS

構造体
サイズx64: 48 バイト / x86: 28 バイト

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

フィールド

フィールドサイズx64x86説明
cbStructDWORD4+0+0本構造体のバイトサイズを示す。
dwFlagsDWORD4+4+4クエリ初期化の動作を制御するフラグ。
pDefaultScopeLPWSTR8/4+8+8既定の検索スコープを示すADsパス文字列。
pDefaultSaveLocationLPWSTR8/4+16+12クエリ保存の既定の場所を示す文字列。
pUserNameLPWSTR8/4+24+16認証に使用するユーザ名文字列。
pPasswordLPWSTR8/4+32+20認証に使用するパスワード文字列。
pServerLPWSTR8/4+40+24接続先サーバ名を示す文字列。

各言語での定義

#include <windows.h>

// DSQUERYINITPARAMS  (x64 48 / x86 28 バイト)
typedef struct DSQUERYINITPARAMS {
    DWORD cbStruct;
    DWORD dwFlags;
    LPWSTR pDefaultScope;
    LPWSTR pDefaultSaveLocation;
    LPWSTR pUserName;
    LPWSTR pPassword;
    LPWSTR pServer;
} DSQUERYINITPARAMS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DSQUERYINITPARAMS
{
    public uint cbStruct;
    public uint dwFlags;
    public IntPtr pDefaultScope;
    public IntPtr pDefaultSaveLocation;
    public IntPtr pUserName;
    public IntPtr pPassword;
    public IntPtr pServer;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DSQUERYINITPARAMS
    Public cbStruct As UInteger
    Public dwFlags As UInteger
    Public pDefaultScope As IntPtr
    Public pDefaultSaveLocation As IntPtr
    Public pUserName As IntPtr
    Public pPassword As IntPtr
    Public pServer As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class DSQUERYINITPARAMS(ctypes.Structure):
    _fields_ = [
        ("cbStruct", wintypes.DWORD),
        ("dwFlags", wintypes.DWORD),
        ("pDefaultScope", ctypes.c_void_p),
        ("pDefaultSaveLocation", ctypes.c_void_p),
        ("pUserName", ctypes.c_void_p),
        ("pPassword", ctypes.c_void_p),
        ("pServer", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct DSQUERYINITPARAMS {
    pub cbStruct: u32,
    pub dwFlags: u32,
    pub pDefaultScope: *mut core::ffi::c_void,
    pub pDefaultSaveLocation: *mut core::ffi::c_void,
    pub pUserName: *mut core::ffi::c_void,
    pub pPassword: *mut core::ffi::c_void,
    pub pServer: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type DSQUERYINITPARAMS struct {
	cbStruct uint32
	dwFlags uint32
	pDefaultScope uintptr
	pDefaultSaveLocation uintptr
	pUserName uintptr
	pPassword uintptr
	pServer uintptr
}
type
  DSQUERYINITPARAMS = record
    cbStruct: DWORD;
    dwFlags: DWORD;
    pDefaultScope: Pointer;
    pDefaultSaveLocation: Pointer;
    pUserName: Pointer;
    pPassword: Pointer;
    pServer: Pointer;
  end;
const DSQUERYINITPARAMS = extern struct {
    cbStruct: u32,
    dwFlags: u32,
    pDefaultScope: ?*anyopaque,
    pDefaultSaveLocation: ?*anyopaque,
    pUserName: ?*anyopaque,
    pPassword: ?*anyopaque,
    pServer: ?*anyopaque,
};
type
  DSQUERYINITPARAMS {.bycopy.} = object
    cbStruct: uint32
    dwFlags: uint32
    pDefaultScope: pointer
    pDefaultSaveLocation: pointer
    pUserName: pointer
    pPassword: pointer
    pServer: pointer
struct DSQUERYINITPARAMS
{
    uint cbStruct;
    uint dwFlags;
    void* pDefaultScope;
    void* pDefaultSaveLocation;
    void* pUserName;
    void* pPassword;
    void* pServer;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DSQUERYINITPARAMS サイズ: 28 バイト(x86)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; pDefaultScope : LPWSTR (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; pDefaultSaveLocation : LPWSTR (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; pUserName : LPWSTR (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; pPassword : LPWSTR (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; pServer : LPWSTR (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DSQUERYINITPARAMS サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; pDefaultScope : LPWSTR (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pDefaultSaveLocation : LPWSTR (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; pUserName : LPWSTR (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; pPassword : LPWSTR (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; pServer : LPWSTR (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DSQUERYINITPARAMS
    #field int cbStruct
    #field int dwFlags
    #field intptr pDefaultScope
    #field intptr pDefaultSaveLocation
    #field intptr pUserName
    #field intptr pPassword
    #field intptr pServer
#endstruct

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