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

ShowSecurityInfo

関数
セキュリティ情報をダイアログとして表示する。
DLLWININET.dll呼出規約winapi

シグネチャ

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

DWORD ShowSecurityInfo(
    HWND hWndParent,
    INTERNET_SECURITY_INFO* pSecurityInfo
);

パラメーター

名前方向説明
hWndParentHWNDinセキュリティ情報ダイアログの親ウィンドウのハンドル。
pSecurityInfoINTERNET_SECURITY_INFO*in表示するセキュリティ情報を保持するINTERNET_SECURITY_INFO構造体へのポインター。

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD ShowSecurityInfo(
    HWND hWndParent,
    INTERNET_SECURITY_INFO* pSecurityInfo
);
[DllImport("WININET.dll", ExactSpelling = true)]
static extern uint ShowSecurityInfo(
    IntPtr hWndParent,   // HWND
    IntPtr pSecurityInfo   // INTERNET_SECURITY_INFO*
);
<DllImport("WININET.dll", ExactSpelling:=True)>
Public Shared Function ShowSecurityInfo(
    hWndParent As IntPtr,   ' HWND
    pSecurityInfo As IntPtr   ' INTERNET_SECURITY_INFO*
) As UInteger
End Function
' hWndParent : HWND
' pSecurityInfo : INTERNET_SECURITY_INFO*
Declare PtrSafe Function ShowSecurityInfo Lib "wininet" ( _
    ByVal hWndParent As LongPtr, _
    ByVal pSecurityInfo As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ShowSecurityInfo = ctypes.windll.wininet.ShowSecurityInfo
ShowSecurityInfo.restype = wintypes.DWORD
ShowSecurityInfo.argtypes = [
    wintypes.HANDLE,  # hWndParent : HWND
    ctypes.c_void_p,  # pSecurityInfo : INTERNET_SECURITY_INFO*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	wininet = windows.NewLazySystemDLL("WININET.dll")
	procShowSecurityInfo = wininet.NewProc("ShowSecurityInfo")
)

// hWndParent (HWND), pSecurityInfo (INTERNET_SECURITY_INFO*)
r1, _, err := procShowSecurityInfo.Call(
	uintptr(hWndParent),
	uintptr(pSecurityInfo),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function ShowSecurityInfo(
  hWndParent: THandle;   // HWND
  pSecurityInfo: Pointer   // INTERNET_SECURITY_INFO*
): DWORD; stdcall;
  external 'WININET.dll' name 'ShowSecurityInfo';
result := DllCall("WININET\ShowSecurityInfo"
    , "Ptr", hWndParent   ; HWND
    , "Ptr", pSecurityInfo   ; INTERNET_SECURITY_INFO*
    , "UInt")   ; return: DWORD
●ShowSecurityInfo(hWndParent, pSecurityInfo) = DLL("WININET.dll", "dword ShowSecurityInfo(void*, void*)")
# 呼び出し: ShowSecurityInfo(hWndParent, pSecurityInfo)
# hWndParent : HWND -> "void*"
# pSecurityInfo : INTERNET_SECURITY_INFO* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "wininet" fn ShowSecurityInfo(
    hWndParent: ?*anyopaque, // HWND
    pSecurityInfo: [*c]INTERNET_SECURITY_INFO // INTERNET_SECURITY_INFO*
) callconv(std.os.windows.WINAPI) u32;
proc ShowSecurityInfo(
    hWndParent: pointer,  # HWND
    pSecurityInfo: ptr INTERNET_SECURITY_INFO  # INTERNET_SECURITY_INFO*
): uint32 {.importc: "ShowSecurityInfo", stdcall, dynlib: "WININET.dll".}
pragma(lib, "wininet");
extern(Windows)
uint ShowSecurityInfo(
    void* hWndParent,   // HWND
    INTERNET_SECURITY_INFO* pSecurityInfo   // INTERNET_SECURITY_INFO*
);
ccall((:ShowSecurityInfo, "WININET.dll"), stdcall, UInt32,
      (Ptr{Cvoid}, Ptr{INTERNET_SECURITY_INFO}),
      hWndParent, pSecurityInfo)
# hWndParent : HWND -> Ptr{Cvoid}
# pSecurityInfo : INTERNET_SECURITY_INFO* -> Ptr{INTERNET_SECURITY_INFO}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
uint32_t ShowSecurityInfo(
    void* hWndParent,
    void* pSecurityInfo);
]]
local wininet = ffi.load("wininet")
-- wininet.ShowSecurityInfo(hWndParent, pSecurityInfo)
-- hWndParent : HWND
-- pSecurityInfo : INTERNET_SECURITY_INFO*
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('WININET.dll');
const ShowSecurityInfo = lib.func('__stdcall', 'ShowSecurityInfo', 'uint32_t', ['void *', 'void *']);
// ShowSecurityInfo(hWndParent, pSecurityInfo)
// hWndParent : HWND -> 'void *'
// pSecurityInfo : INTERNET_SECURITY_INFO* -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("WININET.dll", {
  ShowSecurityInfo: { parameters: ["pointer", "pointer"], result: "u32" },
});
// lib.symbols.ShowSecurityInfo(hWndParent, pSecurityInfo)
// hWndParent : HWND -> "pointer"
// pSecurityInfo : INTERNET_SECURITY_INFO* -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
uint32_t ShowSecurityInfo(
    void* hWndParent,
    void* pSecurityInfo);
C, "WININET.dll");
// $ffi->ShowSecurityInfo(hWndParent, pSecurityInfo);
// hWndParent : HWND
// pSecurityInfo : INTERNET_SECURITY_INFO*
// 構造体/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 Wininet extends StdCallLibrary {
    Wininet INSTANCE = Native.load("wininet", Wininet.class);
    int ShowSecurityInfo(
        Pointer hWndParent,   // HWND
        Pointer pSecurityInfo   // INTERNET_SECURITY_INFO*
    );
}
@[Link("wininet")]
lib LibWININET
  fun ShowSecurityInfo = ShowSecurityInfo(
    hWndParent : Void*,   # HWND
    pSecurityInfo : INTERNET_SECURITY_INFO*   # INTERNET_SECURITY_INFO*
  ) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef ShowSecurityInfoNative = Uint32 Function(Pointer<Void>, Pointer<Void>);
typedef ShowSecurityInfoDart = int Function(Pointer<Void>, Pointer<Void>);
final ShowSecurityInfo = DynamicLibrary.open('WININET.dll')
    .lookupFunction<ShowSecurityInfoNative, ShowSecurityInfoDart>('ShowSecurityInfo');
// hWndParent : HWND -> Pointer<Void>
// pSecurityInfo : INTERNET_SECURITY_INFO* -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function ShowSecurityInfo(
  hWndParent: THandle;   // HWND
  pSecurityInfo: Pointer   // INTERNET_SECURITY_INFO*
): DWORD; stdcall;
  external 'WININET.dll' name 'ShowSecurityInfo';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "ShowSecurityInfo"
  c_ShowSecurityInfo :: Ptr () -> Ptr () -> IO Word32
-- hWndParent : HWND -> Ptr ()
-- pSecurityInfo : INTERNET_SECURITY_INFO* -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let showsecurityinfo =
  foreign "ShowSecurityInfo"
    ((ptr void) @-> (ptr void) @-> returning uint32_t)
(* hWndParent : HWND -> (ptr void) *)
(* pSecurityInfo : INTERNET_SECURITY_INFO* -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library wininet (t "WININET.dll"))
(cffi:use-foreign-library wininet)

(cffi:defcfun ("ShowSecurityInfo" show-security-info :convention :stdcall) :uint32
  (h-wnd-parent :pointer)   ; HWND
  (p-security-info :pointer))   ; INTERNET_SECURITY_INFO*
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $ShowSecurityInfo = Win32::API::More->new('WININET',
    'DWORD ShowSecurityInfo(HANDLE hWndParent, LPVOID pSecurityInfo)');
# my $ret = $ShowSecurityInfo->Call($hWndParent, $pSecurityInfo);
# hWndParent : HWND -> HANDLE
# pSecurityInfo : INTERNET_SECURITY_INFO* -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型