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

CoDisableCallCancellation

関数
現在のスレッドで同期呼び出しのキャンセルを無効化する。
DLLOLE32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

HRESULT CoDisableCallCancellation(
    void* pReserved   // optional
);

パラメーター

名前方向
pReservedvoid*inoptional

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT CoDisableCallCancellation(
    void* pReserved   // optional
);
[DllImport("OLE32.dll", ExactSpelling = true)]
static extern int CoDisableCallCancellation(
    IntPtr pReserved   // void* optional
);
<DllImport("OLE32.dll", ExactSpelling:=True)>
Public Shared Function CoDisableCallCancellation(
    pReserved As IntPtr   ' void* optional
) As Integer
End Function
' pReserved : void* optional
Declare PtrSafe Function CoDisableCallCancellation Lib "ole32" ( _
    ByVal pReserved As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

CoDisableCallCancellation = ctypes.windll.ole32.CoDisableCallCancellation
CoDisableCallCancellation.restype = ctypes.c_int
CoDisableCallCancellation.argtypes = [
    ctypes.POINTER(None),  # pReserved : void* optional
]
require 'fiddle'
require 'fiddle/import'

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

var (
	ole32 = windows.NewLazySystemDLL("OLE32.dll")
	procCoDisableCallCancellation = ole32.NewProc("CoDisableCallCancellation")
)

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