Win32 API 日本語リファレンス
ホームSecurity.WinTrust › OpenPersonalTrustDBDialogEx

OpenPersonalTrustDBDialogEx

関数
個人用信頼データベース管理ダイアログを拡張表示する。
DLLWINTRUST.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

BOOL OpenPersonalTrustDBDialogEx(
    HWND hwndParent,   // optional
    DWORD dwFlags,
    void** pvReserved   // optional
);

パラメーター

名前方向
hwndParentHWNDinoptional
dwFlagsDWORDin
pvReservedvoid**inoutoptional

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL OpenPersonalTrustDBDialogEx(
    HWND hwndParent,   // optional
    DWORD dwFlags,
    void** pvReserved   // optional
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("WINTRUST.dll", ExactSpelling = true)]
static extern bool OpenPersonalTrustDBDialogEx(
    IntPtr hwndParent,   // HWND optional
    uint dwFlags,   // DWORD
    IntPtr pvReserved   // void** optional, in/out
);
<DllImport("WINTRUST.dll", ExactSpelling:=True)>
Public Shared Function OpenPersonalTrustDBDialogEx(
    hwndParent As IntPtr,   ' HWND optional
    dwFlags As UInteger,   ' DWORD
    pvReserved As IntPtr   ' void** optional, in/out
) As Boolean
End Function
' hwndParent : HWND optional
' dwFlags : DWORD
' pvReserved : void** optional, in/out
Declare PtrSafe Function OpenPersonalTrustDBDialogEx Lib "wintrust" ( _
    ByVal hwndParent As LongPtr, _
    ByVal dwFlags As Long, _
    ByVal pvReserved As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

OpenPersonalTrustDBDialogEx = ctypes.windll.wintrust.OpenPersonalTrustDBDialogEx
OpenPersonalTrustDBDialogEx.restype = wintypes.BOOL
OpenPersonalTrustDBDialogEx.argtypes = [
    wintypes.HANDLE,  # hwndParent : HWND optional
    wintypes.DWORD,  # dwFlags : DWORD
    ctypes.c_void_p,  # pvReserved : void** optional, in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('WINTRUST.dll')
OpenPersonalTrustDBDialogEx = Fiddle::Function.new(
  lib['OpenPersonalTrustDBDialogEx'],
  [
    Fiddle::TYPE_VOIDP,  # hwndParent : HWND optional
    -Fiddle::TYPE_INT,  # dwFlags : DWORD
    Fiddle::TYPE_VOIDP,  # pvReserved : void** optional, in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "wintrust")]
extern "system" {
    fn OpenPersonalTrustDBDialogEx(
        hwndParent: *mut core::ffi::c_void,  // HWND optional
        dwFlags: u32,  // DWORD
        pvReserved: *mut *mut ()  // void** optional, in/out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("WINTRUST.dll")]
public static extern bool OpenPersonalTrustDBDialogEx(IntPtr hwndParent, uint dwFlags, IntPtr pvReserved);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WINTRUST_OpenPersonalTrustDBDialogEx' -Namespace Win32 -PassThru
# $api::OpenPersonalTrustDBDialogEx(hwndParent, dwFlags, pvReserved)
#uselib "WINTRUST.dll"
#func global OpenPersonalTrustDBDialogEx "OpenPersonalTrustDBDialogEx" sptr, sptr, sptr
; OpenPersonalTrustDBDialogEx hwndParent, dwFlags, pvReserved   ; 戻り値は stat
; hwndParent : HWND optional -> "sptr"
; dwFlags : DWORD -> "sptr"
; pvReserved : void** optional, in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "WINTRUST.dll"
#cfunc global OpenPersonalTrustDBDialogEx "OpenPersonalTrustDBDialogEx" sptr, int, sptr
; res = OpenPersonalTrustDBDialogEx(hwndParent, dwFlags, pvReserved)
; hwndParent : HWND optional -> "sptr"
; dwFlags : DWORD -> "int"
; pvReserved : void** optional, in/out -> "sptr"
; BOOL OpenPersonalTrustDBDialogEx(HWND hwndParent, DWORD dwFlags, void** pvReserved)
#uselib "WINTRUST.dll"
#cfunc global OpenPersonalTrustDBDialogEx "OpenPersonalTrustDBDialogEx" intptr, int, intptr
; res = OpenPersonalTrustDBDialogEx(hwndParent, dwFlags, pvReserved)
; hwndParent : HWND optional -> "intptr"
; dwFlags : DWORD -> "int"
; pvReserved : void** optional, in/out -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	wintrust = windows.NewLazySystemDLL("WINTRUST.dll")
	procOpenPersonalTrustDBDialogEx = wintrust.NewProc("OpenPersonalTrustDBDialogEx")
)

// hwndParent (HWND optional), dwFlags (DWORD), pvReserved (void** optional, in/out)
r1, _, err := procOpenPersonalTrustDBDialogEx.Call(
	uintptr(hwndParent),
	uintptr(dwFlags),
	uintptr(pvReserved),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function OpenPersonalTrustDBDialogEx(
  hwndParent: THandle;   // HWND optional
  dwFlags: DWORD;   // DWORD
  pvReserved: Pointer   // void** optional, in/out
): BOOL; stdcall;
  external 'WINTRUST.dll' name 'OpenPersonalTrustDBDialogEx';
result := DllCall("WINTRUST\OpenPersonalTrustDBDialogEx"
    , "Ptr", hwndParent   ; HWND optional
    , "UInt", dwFlags   ; DWORD
    , "Ptr", pvReserved   ; void** optional, in/out
    , "Int")   ; return: BOOL
●OpenPersonalTrustDBDialogEx(hwndParent, dwFlags, pvReserved) = DLL("WINTRUST.dll", "bool OpenPersonalTrustDBDialogEx(void*, dword, void*)")
# 呼び出し: OpenPersonalTrustDBDialogEx(hwndParent, dwFlags, pvReserved)
# hwndParent : HWND optional -> "void*"
# dwFlags : DWORD -> "dword"
# pvReserved : void** optional, in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。