Win32 API 日本語リファレンス
ホームDevices.DeviceAndDriverInstallation › CMP_WaitNoPendingInstallEvents

CMP_WaitNoPendingInstallEvents

関数
保留中のデバイスインストール完了を待機する。
DLLCFGMGR32.dll呼出規約winapi

シグネチャ

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

DWORD CMP_WaitNoPendingInstallEvents(
    DWORD dwTimeout
);

パラメーター

名前方向
dwTimeoutDWORDin

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD CMP_WaitNoPendingInstallEvents(
    DWORD dwTimeout
);
[DllImport("CFGMGR32.dll", ExactSpelling = true)]
static extern uint CMP_WaitNoPendingInstallEvents(
    uint dwTimeout   // DWORD
);
<DllImport("CFGMGR32.dll", ExactSpelling:=True)>
Public Shared Function CMP_WaitNoPendingInstallEvents(
    dwTimeout As UInteger   ' DWORD
) As UInteger
End Function
' dwTimeout : DWORD
Declare PtrSafe Function CMP_WaitNoPendingInstallEvents Lib "cfgmgr32" ( _
    ByVal dwTimeout As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

CMP_WaitNoPendingInstallEvents = ctypes.windll.cfgmgr32.CMP_WaitNoPendingInstallEvents
CMP_WaitNoPendingInstallEvents.restype = wintypes.DWORD
CMP_WaitNoPendingInstallEvents.argtypes = [
    wintypes.DWORD,  # dwTimeout : DWORD
]
require 'fiddle'
require 'fiddle/import'

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

var (
	cfgmgr32 = windows.NewLazySystemDLL("CFGMGR32.dll")
	procCMP_WaitNoPendingInstallEvents = cfgmgr32.NewProc("CMP_WaitNoPendingInstallEvents")
)

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