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

CryptUninstallCancelRetrieval

関数
取得キャンセル用のコールバックを解除する。
DLLCRYPTNET.dll呼出規約winapi

シグネチャ

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

BOOL CryptUninstallCancelRetrieval(
    DWORD dwFlags,
    void* pvReserved   // optional
);

パラメーター

名前方向説明
dwFlagsDWORDin予約フラグ。通常は0を指定する。
pvReservedvoid*optional予約パラメーター。NULLを指定する。

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL CryptUninstallCancelRetrieval(
    DWORD dwFlags,
    void* pvReserved   // optional
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("CRYPTNET.dll", ExactSpelling = true)]
static extern bool CryptUninstallCancelRetrieval(
    uint dwFlags,   // DWORD
    IntPtr pvReserved   // void* optional
);
<DllImport("CRYPTNET.dll", ExactSpelling:=True)>
Public Shared Function CryptUninstallCancelRetrieval(
    dwFlags As UInteger,   ' DWORD
    pvReserved As IntPtr   ' void* optional
) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
' dwFlags : DWORD
' pvReserved : void* optional
Declare PtrSafe Function CryptUninstallCancelRetrieval Lib "cryptnet" ( _
    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

CryptUninstallCancelRetrieval = ctypes.windll.cryptnet.CryptUninstallCancelRetrieval
CryptUninstallCancelRetrieval.restype = wintypes.BOOL
CryptUninstallCancelRetrieval.argtypes = [
    wintypes.DWORD,  # dwFlags : DWORD
    ctypes.POINTER(None),  # pvReserved : void* optional
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('CRYPTNET.dll')
CryptUninstallCancelRetrieval = Fiddle::Function.new(
  lib['CryptUninstallCancelRetrieval'],
  [
    -Fiddle::TYPE_INT,  # dwFlags : DWORD
    Fiddle::TYPE_VOIDP,  # pvReserved : void* optional
  ],
  Fiddle::TYPE_INT)
#[link(name = "cryptnet")]
extern "system" {
    fn CryptUninstallCancelRetrieval(
        dwFlags: u32,  // DWORD
        pvReserved: *mut ()  // void* optional
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("CRYPTNET.dll")]
public static extern bool CryptUninstallCancelRetrieval(uint dwFlags, IntPtr pvReserved);
"@
$api = Add-Type -MemberDefinition $sig -Name 'CRYPTNET_CryptUninstallCancelRetrieval' -Namespace Win32 -PassThru
# $api::CryptUninstallCancelRetrieval(dwFlags, pvReserved)
#uselib "CRYPTNET.dll"
#func global CryptUninstallCancelRetrieval "CryptUninstallCancelRetrieval" sptr, sptr
; CryptUninstallCancelRetrieval dwFlags, pvReserved   ; 戻り値は stat
; dwFlags : DWORD -> "sptr"
; pvReserved : void* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "CRYPTNET.dll"
#cfunc global CryptUninstallCancelRetrieval "CryptUninstallCancelRetrieval" int, sptr
; res = CryptUninstallCancelRetrieval(dwFlags, pvReserved)
; dwFlags : DWORD -> "int"
; pvReserved : void* optional -> "sptr"
; BOOL CryptUninstallCancelRetrieval(DWORD dwFlags, void* pvReserved)
#uselib "CRYPTNET.dll"
#cfunc global CryptUninstallCancelRetrieval "CryptUninstallCancelRetrieval" int, intptr
; res = CryptUninstallCancelRetrieval(dwFlags, pvReserved)
; dwFlags : DWORD -> "int"
; pvReserved : void* optional -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	cryptnet = windows.NewLazySystemDLL("CRYPTNET.dll")
	procCryptUninstallCancelRetrieval = cryptnet.NewProc("CryptUninstallCancelRetrieval")
)

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

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

typedef CryptUninstallCancelRetrievalNative = Int32 Function(Uint32, Pointer<Void>);
typedef CryptUninstallCancelRetrievalDart = int Function(int, Pointer<Void>);
final CryptUninstallCancelRetrieval = DynamicLibrary.open('CRYPTNET.dll')
    .lookupFunction<CryptUninstallCancelRetrievalNative, CryptUninstallCancelRetrievalDart>('CryptUninstallCancelRetrieval');
// dwFlags : DWORD -> Uint32
// pvReserved : void* optional -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function CryptUninstallCancelRetrieval(
  dwFlags: DWORD;   // DWORD
  pvReserved: Pointer   // void* optional
): BOOL; stdcall;
  external 'CRYPTNET.dll' name 'CryptUninstallCancelRetrieval';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "CryptUninstallCancelRetrieval"
  c_CryptUninstallCancelRetrieval :: Word32 -> Ptr () -> IO CInt
-- dwFlags : DWORD -> Word32
-- pvReserved : void* optional -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let cryptuninstallcancelretrieval =
  foreign "CryptUninstallCancelRetrieval"
    (uint32_t @-> (ptr void) @-> returning int32_t)
(* dwFlags : DWORD -> uint32_t *)
(* pvReserved : void* optional -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library cryptnet (t "CRYPTNET.dll"))
(cffi:use-foreign-library cryptnet)

(cffi:defcfun ("CryptUninstallCancelRetrieval" crypt-uninstall-cancel-retrieval :convention :stdcall) :int32
  (dw-flags :uint32)   ; DWORD
  (pv-reserved :pointer))   ; void* optional
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $CryptUninstallCancelRetrieval = Win32::API::More->new('CRYPTNET',
    'BOOL CryptUninstallCancelRetrieval(DWORD dwFlags, LPVOID pvReserved)');
# my $ret = $CryptUninstallCancelRetrieval->Call($dwFlags, $pvReserved);
# dwFlags : DWORD -> DWORD
# pvReserved : void* optional -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。