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

ApplicationRecoveryInProgress

関数
回復処理の進行中であることを通知し中断要求を確認する。
DLLKERNEL32.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

HRESULT ApplicationRecoveryInProgress(
    BOOL* pbCancelled
);

パラメーター

名前方向
pbCancelledBOOL*out

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT ApplicationRecoveryInProgress(
    BOOL* pbCancelled
);
[DllImport("KERNEL32.dll", ExactSpelling = true)]
static extern int ApplicationRecoveryInProgress(
    out int pbCancelled   // BOOL* out
);
<DllImport("KERNEL32.dll", ExactSpelling:=True)>
Public Shared Function ApplicationRecoveryInProgress(
    <Out> ByRef pbCancelled As Integer   ' BOOL* out
) As Integer
End Function
' pbCancelled : BOOL* out
Declare PtrSafe Function ApplicationRecoveryInProgress Lib "kernel32" ( _
    ByRef pbCancelled As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ApplicationRecoveryInProgress = ctypes.windll.kernel32.ApplicationRecoveryInProgress
ApplicationRecoveryInProgress.restype = ctypes.c_int
ApplicationRecoveryInProgress.argtypes = [
    ctypes.c_void_p,  # pbCancelled : BOOL* out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
	procApplicationRecoveryInProgress = kernel32.NewProc("ApplicationRecoveryInProgress")
)

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