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

CryptSIPRemoveSignedDataMsg

関数
件名から指定の署名済みデータメッセージを削除する。
DLLWINTRUST.dll呼出規約winapiSetLastErrorあり対応OSWindows XP 以降

シグネチャ

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

BOOL CryptSIPRemoveSignedDataMsg(
    SIP_SUBJECTINFO* pSubjectInfo,
    DWORD dwIndex
);

パラメーター

名前方向
pSubjectInfoSIP_SUBJECTINFO*inout
dwIndexDWORDin

戻り値の型: BOOL

各言語での呼び出し定義

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

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

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

lib = Fiddle.dlopen('WINTRUST.dll')
CryptSIPRemoveSignedDataMsg = Fiddle::Function.new(
  lib['CryptSIPRemoveSignedDataMsg'],
  [
    Fiddle::TYPE_VOIDP,  # pSubjectInfo : SIP_SUBJECTINFO* in/out
    -Fiddle::TYPE_INT,  # dwIndex : DWORD
  ],
  Fiddle::TYPE_INT)
#[link(name = "wintrust")]
extern "system" {
    fn CryptSIPRemoveSignedDataMsg(
        pSubjectInfo: *mut SIP_SUBJECTINFO,  // SIP_SUBJECTINFO* in/out
        dwIndex: u32  // DWORD
    ) -> 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 CryptSIPRemoveSignedDataMsg(IntPtr pSubjectInfo, uint dwIndex);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WINTRUST_CryptSIPRemoveSignedDataMsg' -Namespace Win32 -PassThru
# $api::CryptSIPRemoveSignedDataMsg(pSubjectInfo, dwIndex)
#uselib "WINTRUST.dll"
#func global CryptSIPRemoveSignedDataMsg "CryptSIPRemoveSignedDataMsg" sptr, sptr
; CryptSIPRemoveSignedDataMsg varptr(pSubjectInfo), dwIndex   ; 戻り値は stat
; pSubjectInfo : SIP_SUBJECTINFO* in/out -> "sptr"
; dwIndex : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "WINTRUST.dll"
#cfunc global CryptSIPRemoveSignedDataMsg "CryptSIPRemoveSignedDataMsg" var, int
; res = CryptSIPRemoveSignedDataMsg(pSubjectInfo, dwIndex)
; pSubjectInfo : SIP_SUBJECTINFO* in/out -> "var"
; dwIndex : DWORD -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; BOOL CryptSIPRemoveSignedDataMsg(SIP_SUBJECTINFO* pSubjectInfo, DWORD dwIndex)
#uselib "WINTRUST.dll"
#cfunc global CryptSIPRemoveSignedDataMsg "CryptSIPRemoveSignedDataMsg" var, int
; res = CryptSIPRemoveSignedDataMsg(pSubjectInfo, dwIndex)
; pSubjectInfo : SIP_SUBJECTINFO* in/out -> "var"
; dwIndex : DWORD -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	wintrust = windows.NewLazySystemDLL("WINTRUST.dll")
	procCryptSIPRemoveSignedDataMsg = wintrust.NewProc("CryptSIPRemoveSignedDataMsg")
)

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