Win32 API 日本語リファレンス
ホームSystem.Com.Urlmon › CoInternetGetSecurityUrlEx

CoInternetGetSecurityUrlEx

関数
指定URIからセキュリティ判定用のセキュリティURIを取得する。
DLLurlmon.dll呼出規約winapi

シグネチャ

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

HRESULT CoInternetGetSecurityUrlEx(
    IUri* pUri,
    IUri** ppSecUri,
    PSUACTION psuAction,
    UINT_PTR dwReserved   // optional
);

パラメーター

名前方向
pUriIUri*in
ppSecUriIUri**out
psuActionPSUACTIONin
dwReservedUINT_PTRoptional

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT CoInternetGetSecurityUrlEx(
    IUri* pUri,
    IUri** ppSecUri,
    PSUACTION psuAction,
    UINT_PTR dwReserved   // optional
);
[DllImport("urlmon.dll", ExactSpelling = true)]
static extern int CoInternetGetSecurityUrlEx(
    IntPtr pUri,   // IUri*
    IntPtr ppSecUri,   // IUri** out
    int psuAction,   // PSUACTION
    UIntPtr dwReserved   // UINT_PTR optional
);
<DllImport("urlmon.dll", ExactSpelling:=True)>
Public Shared Function CoInternetGetSecurityUrlEx(
    pUri As IntPtr,   ' IUri*
    ppSecUri As IntPtr,   ' IUri** out
    psuAction As Integer,   ' PSUACTION
    dwReserved As UIntPtr   ' UINT_PTR optional
) As Integer
End Function
' pUri : IUri*
' ppSecUri : IUri** out
' psuAction : PSUACTION
' dwReserved : UINT_PTR optional
Declare PtrSafe Function CoInternetGetSecurityUrlEx Lib "urlmon" ( _
    ByVal pUri As LongPtr, _
    ByVal ppSecUri As LongPtr, _
    ByVal psuAction As Long, _
    ByVal dwReserved As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

CoInternetGetSecurityUrlEx = ctypes.windll.urlmon.CoInternetGetSecurityUrlEx
CoInternetGetSecurityUrlEx.restype = ctypes.c_int
CoInternetGetSecurityUrlEx.argtypes = [
    ctypes.c_void_p,  # pUri : IUri*
    ctypes.c_void_p,  # ppSecUri : IUri** out
    ctypes.c_int,  # psuAction : PSUACTION
    ctypes.c_size_t,  # dwReserved : UINT_PTR optional
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('urlmon.dll')
CoInternetGetSecurityUrlEx = Fiddle::Function.new(
  lib['CoInternetGetSecurityUrlEx'],
  [
    Fiddle::TYPE_VOIDP,  # pUri : IUri*
    Fiddle::TYPE_VOIDP,  # ppSecUri : IUri** out
    Fiddle::TYPE_INT,  # psuAction : PSUACTION
    Fiddle::TYPE_UINTPTR_T,  # dwReserved : UINT_PTR optional
  ],
  Fiddle::TYPE_INT)
#[link(name = "urlmon")]
extern "system" {
    fn CoInternetGetSecurityUrlEx(
        pUri: *mut core::ffi::c_void,  // IUri*
        ppSecUri: *mut *mut core::ffi::c_void,  // IUri** out
        psuAction: i32,  // PSUACTION
        dwReserved: usize  // UINT_PTR optional
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("urlmon.dll")]
public static extern int CoInternetGetSecurityUrlEx(IntPtr pUri, IntPtr ppSecUri, int psuAction, UIntPtr dwReserved);
"@
$api = Add-Type -MemberDefinition $sig -Name 'urlmon_CoInternetGetSecurityUrlEx' -Namespace Win32 -PassThru
# $api::CoInternetGetSecurityUrlEx(pUri, ppSecUri, psuAction, dwReserved)
#uselib "urlmon.dll"
#func global CoInternetGetSecurityUrlEx "CoInternetGetSecurityUrlEx" sptr, sptr, sptr, sptr
; CoInternetGetSecurityUrlEx pUri, ppSecUri, psuAction, dwReserved   ; 戻り値は stat
; pUri : IUri* -> "sptr"
; ppSecUri : IUri** out -> "sptr"
; psuAction : PSUACTION -> "sptr"
; dwReserved : UINT_PTR optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "urlmon.dll"
#cfunc global CoInternetGetSecurityUrlEx "CoInternetGetSecurityUrlEx" sptr, sptr, int, sptr
; res = CoInternetGetSecurityUrlEx(pUri, ppSecUri, psuAction, dwReserved)
; pUri : IUri* -> "sptr"
; ppSecUri : IUri** out -> "sptr"
; psuAction : PSUACTION -> "int"
; dwReserved : UINT_PTR optional -> "sptr"
; HRESULT CoInternetGetSecurityUrlEx(IUri* pUri, IUri** ppSecUri, PSUACTION psuAction, UINT_PTR dwReserved)
#uselib "urlmon.dll"
#cfunc global CoInternetGetSecurityUrlEx "CoInternetGetSecurityUrlEx" intptr, intptr, int, intptr
; res = CoInternetGetSecurityUrlEx(pUri, ppSecUri, psuAction, dwReserved)
; pUri : IUri* -> "intptr"
; ppSecUri : IUri** out -> "intptr"
; psuAction : PSUACTION -> "int"
; dwReserved : UINT_PTR optional -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	urlmon = windows.NewLazySystemDLL("urlmon.dll")
	procCoInternetGetSecurityUrlEx = urlmon.NewProc("CoInternetGetSecurityUrlEx")
)

// pUri (IUri*), ppSecUri (IUri** out), psuAction (PSUACTION), dwReserved (UINT_PTR optional)
r1, _, err := procCoInternetGetSecurityUrlEx.Call(
	uintptr(pUri),
	uintptr(ppSecUri),
	uintptr(psuAction),
	uintptr(dwReserved),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function CoInternetGetSecurityUrlEx(
  pUri: Pointer;   // IUri*
  ppSecUri: Pointer;   // IUri** out
  psuAction: Integer;   // PSUACTION
  dwReserved: NativeUInt   // UINT_PTR optional
): Integer; stdcall;
  external 'urlmon.dll' name 'CoInternetGetSecurityUrlEx';
result := DllCall("urlmon\CoInternetGetSecurityUrlEx"
    , "Ptr", pUri   ; IUri*
    , "Ptr", ppSecUri   ; IUri** out
    , "Int", psuAction   ; PSUACTION
    , "UPtr", dwReserved   ; UINT_PTR optional
    , "Int")   ; return: HRESULT
●CoInternetGetSecurityUrlEx(pUri, ppSecUri, psuAction, dwReserved) = DLL("urlmon.dll", "int CoInternetGetSecurityUrlEx(void*, void*, int, int)")
# 呼び出し: CoInternetGetSecurityUrlEx(pUri, ppSecUri, psuAction, dwReserved)
# pUri : IUri* -> "void*"
# ppSecUri : IUri** out -> "void*"
# psuAction : PSUACTION -> "int"
# dwReserved : UINT_PTR optional -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。