Win32 API 日本語リファレンス
ホームSecurity.Cryptography.Sip › CryptSIPVerifyIndirectData

CryptSIPVerifyIndirectData

関数
件名の内容を間接データと照合して検証する。
DLLWINTRUST.dll呼出規約winapiSetLastErrorあり対応OSWindows XP 以降

シグネチャ

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

BOOL CryptSIPVerifyIndirectData(
    SIP_SUBJECTINFO* pSubjectInfo,
    SIP_INDIRECT_DATA* pIndirectData
);

パラメーター

名前方向
pSubjectInfoSIP_SUBJECTINFO*inout
pIndirectDataSIP_INDIRECT_DATA*inout

戻り値の型: BOOL

各言語での呼び出し定義

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

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

CryptSIPVerifyIndirectData = ctypes.windll.wintrust.CryptSIPVerifyIndirectData
CryptSIPVerifyIndirectData.restype = wintypes.BOOL
CryptSIPVerifyIndirectData.argtypes = [
    ctypes.c_void_p,  # pSubjectInfo : SIP_SUBJECTINFO* in/out
    ctypes.c_void_p,  # pIndirectData : SIP_INDIRECT_DATA* in/out
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))
require 'fiddle'
require 'fiddle/import'

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

var (
	wintrust = windows.NewLazySystemDLL("WINTRUST.dll")
	procCryptSIPVerifyIndirectData = wintrust.NewProc("CryptSIPVerifyIndirectData")
)

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