ホーム › Security.WinTrust › OpenPersonalTrustDBDialogEx
OpenPersonalTrustDBDialogEx
関数個人用信頼データベース管理ダイアログを拡張表示する。
シグネチャ
// WINTRUST.dll
#include <windows.h>
BOOL OpenPersonalTrustDBDialogEx(
HWND hwndParent, // optional
DWORD dwFlags,
void** pvReserved // optional
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| hwndParent | HWND | inoptional | 信頼DBダイアログの親ウィンドウハンドル。NULL可。 |
| dwFlags | DWORD | in | ダイアログの表示動作を制御するフラグ。WTD_UI_*等の動作指定に用いる。 |
| pvReserved | void** | inoutoptional | 予約パラメータへのポインタ。将来用で通常NULLを指定する。 |
戻り値の型: 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 <MarshalAs(UnmanagedType.Bool)> 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 // BOOLfunction 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)。const std = @import("std");
extern "wintrust" fn OpenPersonalTrustDBDialogEx(
hwndParent: ?*anyopaque, // HWND optional
dwFlags: u32, // DWORD
pvReserved: ?*anyopaque // void** optional, in/out
) callconv(std.os.windows.WINAPI) i32;proc OpenPersonalTrustDBDialogEx(
hwndParent: pointer, # HWND optional
dwFlags: uint32, # DWORD
pvReserved: pointer # void** optional, in/out
): int32 {.importc: "OpenPersonalTrustDBDialogEx", stdcall, dynlib: "WINTRUST.dll".}pragma(lib, "wintrust");
extern(Windows)
int OpenPersonalTrustDBDialogEx(
void* hwndParent, // HWND optional
uint dwFlags, // DWORD
void** pvReserved // void** optional, in/out
);ccall((:OpenPersonalTrustDBDialogEx, "WINTRUST.dll"), stdcall, Int32,
(Ptr{Cvoid}, UInt32, Ptr{Cvoid}),
hwndParent, dwFlags, pvReserved)
# hwndParent : HWND optional -> Ptr{Cvoid}
# dwFlags : DWORD -> UInt32
# pvReserved : void** optional, in/out -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t OpenPersonalTrustDBDialogEx(
void* hwndParent,
uint32_t dwFlags,
void** pvReserved);
]]
local wintrust = ffi.load("wintrust")
-- wintrust.OpenPersonalTrustDBDialogEx(hwndParent, dwFlags, pvReserved)
-- hwndParent : HWND optional
-- dwFlags : DWORD
-- pvReserved : void** optional, in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('WINTRUST.dll');
const OpenPersonalTrustDBDialogEx = lib.func('__stdcall', 'OpenPersonalTrustDBDialogEx', 'int32_t', ['void *', 'uint32_t', 'void *']);
// OpenPersonalTrustDBDialogEx(hwndParent, dwFlags, pvReserved)
// hwndParent : HWND optional -> 'void *'
// dwFlags : DWORD -> 'uint32_t'
// pvReserved : void** optional, in/out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("WINTRUST.dll", {
OpenPersonalTrustDBDialogEx: { parameters: ["pointer", "u32", "pointer"], result: "i32" },
});
// lib.symbols.OpenPersonalTrustDBDialogEx(hwndParent, dwFlags, pvReserved)
// hwndParent : HWND optional -> "pointer"
// dwFlags : DWORD -> "u32"
// pvReserved : void** optional, in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t OpenPersonalTrustDBDialogEx(
void* hwndParent,
uint32_t dwFlags,
void** pvReserved);
C, "WINTRUST.dll");
// $ffi->OpenPersonalTrustDBDialogEx(hwndParent, dwFlags, pvReserved);
// hwndParent : HWND optional
// dwFlags : DWORD
// pvReserved : void** optional, 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 Wintrust extends StdCallLibrary {
Wintrust INSTANCE = Native.load("wintrust", Wintrust.class);
boolean OpenPersonalTrustDBDialogEx(
Pointer hwndParent, // HWND optional
int dwFlags, // DWORD
Pointer pvReserved // void** optional, in/out
);
}@[Link("wintrust")]
lib LibWINTRUST
fun OpenPersonalTrustDBDialogEx = OpenPersonalTrustDBDialogEx(
hwndParent : Void*, # HWND optional
dwFlags : UInt32, # DWORD
pvReserved : Void** # void** optional, 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 OpenPersonalTrustDBDialogExNative = Int32 Function(Pointer<Void>, Uint32, Pointer<Void>);
typedef OpenPersonalTrustDBDialogExDart = int Function(Pointer<Void>, int, Pointer<Void>);
final OpenPersonalTrustDBDialogEx = DynamicLibrary.open('WINTRUST.dll')
.lookupFunction<OpenPersonalTrustDBDialogExNative, OpenPersonalTrustDBDialogExDart>('OpenPersonalTrustDBDialogEx');
// hwndParent : HWND optional -> Pointer<Void>
// dwFlags : DWORD -> Uint32
// pvReserved : void** optional, in/out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function OpenPersonalTrustDBDialogEx(
hwndParent: THandle; // HWND optional
dwFlags: DWORD; // DWORD
pvReserved: Pointer // void** optional, in/out
): BOOL; stdcall;
external 'WINTRUST.dll' name 'OpenPersonalTrustDBDialogEx';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "OpenPersonalTrustDBDialogEx"
c_OpenPersonalTrustDBDialogEx :: Ptr () -> Word32 -> Ptr () -> IO CInt
-- hwndParent : HWND optional -> Ptr ()
-- dwFlags : DWORD -> Word32
-- pvReserved : void** optional, in/out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let openpersonaltrustdbdialogex =
foreign "OpenPersonalTrustDBDialogEx"
((ptr void) @-> uint32_t @-> (ptr void) @-> returning int32_t)
(* hwndParent : HWND optional -> (ptr void) *)
(* dwFlags : DWORD -> uint32_t *)
(* pvReserved : void** optional, in/out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library wintrust (t "WINTRUST.dll"))
(cffi:use-foreign-library wintrust)
(cffi:defcfun ("OpenPersonalTrustDBDialogEx" open-personal-trust-dbdialog-ex :convention :stdcall) :int32
(hwnd-parent :pointer) ; HWND optional
(dw-flags :uint32) ; DWORD
(pv-reserved :pointer)) ; void** optional, in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $OpenPersonalTrustDBDialogEx = Win32::API::More->new('WINTRUST',
'BOOL OpenPersonalTrustDBDialogEx(HANDLE hwndParent, DWORD dwFlags, LPVOID pvReserved)');
# my $ret = $OpenPersonalTrustDBDialogEx->Call($hwndParent, $dwFlags, $pvReserved);
# hwndParent : HWND optional -> HANDLE
# dwFlags : DWORD -> DWORD
# pvReserved : void** optional, in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
類似 API
- f OpenPersonalTrustDBDialog — 個人用信頼データベース管理ダイアログを表示する。