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

ADsPropGetInitInfo

関数
プロパティページの初期化情報を通知オブジェクトから取得する。
DLLdsprop.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

// dsprop.dll
#include <windows.h>

BOOL ADsPropGetInitInfo(
    HWND hNotifyObj,
    ADSPROPINITPARAMS* pInitParams
);

パラメーター

名前方向説明
hNotifyObjHWNDin通知オブジェクトのウィンドウハンドル。
pInitParamsADSPROPINITPARAMS*inout初期化情報を受け取るADSPROPINITPARAMS構造体へのポインタ。

戻り値の型: BOOL

各言語での呼び出し定義

// dsprop.dll
#include <windows.h>

BOOL ADsPropGetInitInfo(
    HWND hNotifyObj,
    ADSPROPINITPARAMS* pInitParams
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("dsprop.dll", ExactSpelling = true)]
static extern bool ADsPropGetInitInfo(
    IntPtr hNotifyObj,   // HWND
    IntPtr pInitParams   // ADSPROPINITPARAMS* in/out
);
<DllImport("dsprop.dll", ExactSpelling:=True)>
Public Shared Function ADsPropGetInitInfo(
    hNotifyObj As IntPtr,   ' HWND
    pInitParams As IntPtr   ' ADSPROPINITPARAMS* in/out
) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
' hNotifyObj : HWND
' pInitParams : ADSPROPINITPARAMS* in/out
Declare PtrSafe Function ADsPropGetInitInfo Lib "dsprop" ( _
    ByVal hNotifyObj As LongPtr, _
    ByVal pInitParams As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ADsPropGetInitInfo = ctypes.windll.dsprop.ADsPropGetInitInfo
ADsPropGetInitInfo.restype = wintypes.BOOL
ADsPropGetInitInfo.argtypes = [
    wintypes.HANDLE,  # hNotifyObj : HWND
    ctypes.c_void_p,  # pInitParams : ADSPROPINITPARAMS* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('dsprop.dll')
ADsPropGetInitInfo = Fiddle::Function.new(
  lib['ADsPropGetInitInfo'],
  [
    Fiddle::TYPE_VOIDP,  # hNotifyObj : HWND
    Fiddle::TYPE_VOIDP,  # pInitParams : ADSPROPINITPARAMS* in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "dsprop")]
extern "system" {
    fn ADsPropGetInitInfo(
        hNotifyObj: *mut core::ffi::c_void,  // HWND
        pInitParams: *mut ADSPROPINITPARAMS  // ADSPROPINITPARAMS* in/out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("dsprop.dll")]
public static extern bool ADsPropGetInitInfo(IntPtr hNotifyObj, IntPtr pInitParams);
"@
$api = Add-Type -MemberDefinition $sig -Name 'dsprop_ADsPropGetInitInfo' -Namespace Win32 -PassThru
# $api::ADsPropGetInitInfo(hNotifyObj, pInitParams)
#uselib "dsprop.dll"
#func global ADsPropGetInitInfo "ADsPropGetInitInfo" sptr, sptr
; ADsPropGetInitInfo hNotifyObj, varptr(pInitParams)   ; 戻り値は stat
; hNotifyObj : HWND -> "sptr"
; pInitParams : ADSPROPINITPARAMS* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "dsprop.dll"
#cfunc global ADsPropGetInitInfo "ADsPropGetInitInfo" sptr, var
; res = ADsPropGetInitInfo(hNotifyObj, pInitParams)
; hNotifyObj : HWND -> "sptr"
; pInitParams : ADSPROPINITPARAMS* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; BOOL ADsPropGetInitInfo(HWND hNotifyObj, ADSPROPINITPARAMS* pInitParams)
#uselib "dsprop.dll"
#cfunc global ADsPropGetInitInfo "ADsPropGetInitInfo" intptr, var
; res = ADsPropGetInitInfo(hNotifyObj, pInitParams)
; hNotifyObj : HWND -> "intptr"
; pInitParams : ADSPROPINITPARAMS* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	dsprop = windows.NewLazySystemDLL("dsprop.dll")
	procADsPropGetInitInfo = dsprop.NewProc("ADsPropGetInitInfo")
)

// hNotifyObj (HWND), pInitParams (ADSPROPINITPARAMS* in/out)
r1, _, err := procADsPropGetInitInfo.Call(
	uintptr(hNotifyObj),
	uintptr(pInitParams),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function ADsPropGetInitInfo(
  hNotifyObj: THandle;   // HWND
  pInitParams: Pointer   // ADSPROPINITPARAMS* in/out
): BOOL; stdcall;
  external 'dsprop.dll' name 'ADsPropGetInitInfo';
result := DllCall("dsprop\ADsPropGetInitInfo"
    , "Ptr", hNotifyObj   ; HWND
    , "Ptr", pInitParams   ; ADSPROPINITPARAMS* in/out
    , "Int")   ; return: BOOL
●ADsPropGetInitInfo(hNotifyObj, pInitParams) = DLL("dsprop.dll", "bool ADsPropGetInitInfo(void*, void*)")
# 呼び出し: ADsPropGetInitInfo(hNotifyObj, pInitParams)
# hNotifyObj : HWND -> "void*"
# pInitParams : ADSPROPINITPARAMS* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "dsprop" fn ADsPropGetInitInfo(
    hNotifyObj: ?*anyopaque, // HWND
    pInitParams: [*c]ADSPROPINITPARAMS // ADSPROPINITPARAMS* in/out
) callconv(std.os.windows.WINAPI) i32;
proc ADsPropGetInitInfo(
    hNotifyObj: pointer,  # HWND
    pInitParams: ptr ADSPROPINITPARAMS  # ADSPROPINITPARAMS* in/out
): int32 {.importc: "ADsPropGetInitInfo", stdcall, dynlib: "dsprop.dll".}
pragma(lib, "dsprop");
extern(Windows)
int ADsPropGetInitInfo(
    void* hNotifyObj,   // HWND
    ADSPROPINITPARAMS* pInitParams   // ADSPROPINITPARAMS* in/out
);
ccall((:ADsPropGetInitInfo, "dsprop.dll"), stdcall, Int32,
      (Ptr{Cvoid}, Ptr{ADSPROPINITPARAMS}),
      hNotifyObj, pInitParams)
# hNotifyObj : HWND -> Ptr{Cvoid}
# pInitParams : ADSPROPINITPARAMS* in/out -> Ptr{ADSPROPINITPARAMS}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t ADsPropGetInitInfo(
    void* hNotifyObj,
    void* pInitParams);
]]
local dsprop = ffi.load("dsprop")
-- dsprop.ADsPropGetInitInfo(hNotifyObj, pInitParams)
-- hNotifyObj : HWND
-- pInitParams : ADSPROPINITPARAMS* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('dsprop.dll');
const ADsPropGetInitInfo = lib.func('__stdcall', 'ADsPropGetInitInfo', 'int32_t', ['void *', 'void *']);
// ADsPropGetInitInfo(hNotifyObj, pInitParams)
// hNotifyObj : HWND -> 'void *'
// pInitParams : ADSPROPINITPARAMS* in/out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("dsprop.dll", {
  ADsPropGetInitInfo: { parameters: ["pointer", "pointer"], result: "i32" },
});
// lib.symbols.ADsPropGetInitInfo(hNotifyObj, pInitParams)
// hNotifyObj : HWND -> "pointer"
// pInitParams : ADSPROPINITPARAMS* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t ADsPropGetInitInfo(
    void* hNotifyObj,
    void* pInitParams);
C, "dsprop.dll");
// $ffi->ADsPropGetInitInfo(hNotifyObj, pInitParams);
// hNotifyObj : HWND
// pInitParams : ADSPROPINITPARAMS* in/out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Dsprop extends StdCallLibrary {
    Dsprop INSTANCE = Native.load("dsprop", Dsprop.class);
    boolean ADsPropGetInitInfo(
        Pointer hNotifyObj,   // HWND
        Pointer pInitParams   // ADSPROPINITPARAMS* in/out
    );
}
@[Link("dsprop")]
lib Libdsprop
  fun ADsPropGetInitInfo = ADsPropGetInitInfo(
    hNotifyObj : Void*,   # HWND
    pInitParams : ADSPROPINITPARAMS*   # ADSPROPINITPARAMS* in/out
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef ADsPropGetInitInfoNative = Int32 Function(Pointer<Void>, Pointer<Void>);
typedef ADsPropGetInitInfoDart = int Function(Pointer<Void>, Pointer<Void>);
final ADsPropGetInitInfo = DynamicLibrary.open('dsprop.dll')
    .lookupFunction<ADsPropGetInitInfoNative, ADsPropGetInitInfoDart>('ADsPropGetInitInfo');
// hNotifyObj : HWND -> Pointer<Void>
// pInitParams : ADSPROPINITPARAMS* in/out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function ADsPropGetInitInfo(
  hNotifyObj: THandle;   // HWND
  pInitParams: Pointer   // ADSPROPINITPARAMS* in/out
): BOOL; stdcall;
  external 'dsprop.dll' name 'ADsPropGetInitInfo';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "ADsPropGetInitInfo"
  c_ADsPropGetInitInfo :: Ptr () -> Ptr () -> IO CInt
-- hNotifyObj : HWND -> Ptr ()
-- pInitParams : ADSPROPINITPARAMS* in/out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let adspropgetinitinfo =
  foreign "ADsPropGetInitInfo"
    ((ptr void) @-> (ptr void) @-> returning int32_t)
(* hNotifyObj : HWND -> (ptr void) *)
(* pInitParams : ADSPROPINITPARAMS* in/out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library dsprop (t "dsprop.dll"))
(cffi:use-foreign-library dsprop)

(cffi:defcfun ("ADsPropGetInitInfo" ads-prop-get-init-info :convention :stdcall) :int32
  (h-notify-obj :pointer)   ; HWND
  (p-init-params :pointer))   ; ADSPROPINITPARAMS* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $ADsPropGetInitInfo = Win32::API::More->new('dsprop',
    'BOOL ADsPropGetInitInfo(HANDLE hNotifyObj, LPVOID pInitParams)');
# my $ret = $ADsPropGetInitInfo->Call($hNotifyObj, $pInitParams);
# hNotifyObj : HWND -> HANDLE
# pInitParams : ADSPROPINITPARAMS* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型