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

CM_Request_Eject_PC

関数
PCのドッキング解除を要求する。
DLLCFGMGR32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

CONFIGRET CM_Request_Eject_PC(void);

パラメーターなし。戻り値: CONFIGRET

各言語での呼び出し定義

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

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

CM_Request_Eject_PC = ctypes.windll.cfgmgr32.CM_Request_Eject_PC
CM_Request_Eject_PC.restype = wintypes.DWORD
CM_Request_Eject_PC.argtypes = []
require 'fiddle'
require 'fiddle/import'

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

var (
	cfgmgr32 = windows.NewLazySystemDLL("CFGMGR32.dll")
	procCM_Request_Eject_PC = cfgmgr32.NewProc("CM_Request_Eject_PC")
)

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