ホーム › Devices.DeviceAndDriverInstallation › CM_Query_Arbitrator_Free_Data_Ex
CM_Query_Arbitrator_Free_Data_Ex
関数リモートマシンで空きリソースデータを照会する。
シグネチャ
// CFGMGR32.dll
#include <windows.h>
CONFIGRET CM_Query_Arbitrator_Free_Data_Ex(
void* pData,
DWORD DataLen,
DWORD dnDevInst,
DWORD ResourceID,
DWORD ulFlags,
INT_PTR hMachine // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pData | void* | out |
| DataLen | DWORD | in |
| dnDevInst | DWORD | in |
| ResourceID | DWORD | in |
| ulFlags | DWORD | in |
| hMachine | INT_PTR | inoptional |
戻り値の型: CONFIGRET
各言語での呼び出し定義
// CFGMGR32.dll
#include <windows.h>
CONFIGRET CM_Query_Arbitrator_Free_Data_Ex(
void* pData,
DWORD DataLen,
DWORD dnDevInst,
DWORD ResourceID,
DWORD ulFlags,
INT_PTR hMachine // optional
);[DllImport("CFGMGR32.dll", ExactSpelling = true)]
static extern uint CM_Query_Arbitrator_Free_Data_Ex(
IntPtr pData, // void* out
uint DataLen, // DWORD
uint dnDevInst, // DWORD
uint ResourceID, // DWORD
uint ulFlags, // DWORD
IntPtr hMachine // INT_PTR optional
);<DllImport("CFGMGR32.dll", ExactSpelling:=True)>
Public Shared Function CM_Query_Arbitrator_Free_Data_Ex(
pData As IntPtr, ' void* out
DataLen As UInteger, ' DWORD
dnDevInst As UInteger, ' DWORD
ResourceID As UInteger, ' DWORD
ulFlags As UInteger, ' DWORD
hMachine As IntPtr ' INT_PTR optional
) As UInteger
End Function' pData : void* out
' DataLen : DWORD
' dnDevInst : DWORD
' ResourceID : DWORD
' ulFlags : DWORD
' hMachine : INT_PTR optional
Declare PtrSafe Function CM_Query_Arbitrator_Free_Data_Ex Lib "cfgmgr32" ( _
ByVal pData As LongPtr, _
ByVal DataLen As Long, _
ByVal dnDevInst As Long, _
ByVal ResourceID As Long, _
ByVal ulFlags As Long, _
ByVal hMachine As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
CM_Query_Arbitrator_Free_Data_Ex = ctypes.windll.cfgmgr32.CM_Query_Arbitrator_Free_Data_Ex
CM_Query_Arbitrator_Free_Data_Ex.restype = wintypes.DWORD
CM_Query_Arbitrator_Free_Data_Ex.argtypes = [
ctypes.POINTER(None), # pData : void* out
wintypes.DWORD, # DataLen : DWORD
wintypes.DWORD, # dnDevInst : DWORD
wintypes.DWORD, # ResourceID : DWORD
wintypes.DWORD, # ulFlags : DWORD
ctypes.c_ssize_t, # hMachine : INT_PTR optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('CFGMGR32.dll')
CM_Query_Arbitrator_Free_Data_Ex = Fiddle::Function.new(
lib['CM_Query_Arbitrator_Free_Data_Ex'],
[
Fiddle::TYPE_VOIDP, # pData : void* out
-Fiddle::TYPE_INT, # DataLen : DWORD
-Fiddle::TYPE_INT, # dnDevInst : DWORD
-Fiddle::TYPE_INT, # ResourceID : DWORD
-Fiddle::TYPE_INT, # ulFlags : DWORD
Fiddle::TYPE_INTPTR_T, # hMachine : INT_PTR optional
],
-Fiddle::TYPE_INT)#[link(name = "cfgmgr32")]
extern "system" {
fn CM_Query_Arbitrator_Free_Data_Ex(
pData: *mut (), // void* out
DataLen: u32, // DWORD
dnDevInst: u32, // DWORD
ResourceID: u32, // DWORD
ulFlags: u32, // DWORD
hMachine: isize // INT_PTR optional
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("CFGMGR32.dll")]
public static extern uint CM_Query_Arbitrator_Free_Data_Ex(IntPtr pData, uint DataLen, uint dnDevInst, uint ResourceID, uint ulFlags, IntPtr hMachine);
"@
$api = Add-Type -MemberDefinition $sig -Name 'CFGMGR32_CM_Query_Arbitrator_Free_Data_Ex' -Namespace Win32 -PassThru
# $api::CM_Query_Arbitrator_Free_Data_Ex(pData, DataLen, dnDevInst, ResourceID, ulFlags, hMachine)#uselib "CFGMGR32.dll"
#func global CM_Query_Arbitrator_Free_Data_Ex "CM_Query_Arbitrator_Free_Data_Ex" sptr, sptr, sptr, sptr, sptr, sptr
; CM_Query_Arbitrator_Free_Data_Ex pData, DataLen, dnDevInst, ResourceID, ulFlags, hMachine ; 戻り値は stat
; pData : void* out -> "sptr"
; DataLen : DWORD -> "sptr"
; dnDevInst : DWORD -> "sptr"
; ResourceID : DWORD -> "sptr"
; ulFlags : DWORD -> "sptr"
; hMachine : INT_PTR optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "CFGMGR32.dll"
#cfunc global CM_Query_Arbitrator_Free_Data_Ex "CM_Query_Arbitrator_Free_Data_Ex" sptr, int, int, int, int, sptr
; res = CM_Query_Arbitrator_Free_Data_Ex(pData, DataLen, dnDevInst, ResourceID, ulFlags, hMachine)
; pData : void* out -> "sptr"
; DataLen : DWORD -> "int"
; dnDevInst : DWORD -> "int"
; ResourceID : DWORD -> "int"
; ulFlags : DWORD -> "int"
; hMachine : INT_PTR optional -> "sptr"; CONFIGRET CM_Query_Arbitrator_Free_Data_Ex(void* pData, DWORD DataLen, DWORD dnDevInst, DWORD ResourceID, DWORD ulFlags, INT_PTR hMachine)
#uselib "CFGMGR32.dll"
#cfunc global CM_Query_Arbitrator_Free_Data_Ex "CM_Query_Arbitrator_Free_Data_Ex" intptr, int, int, int, int, intptr
; res = CM_Query_Arbitrator_Free_Data_Ex(pData, DataLen, dnDevInst, ResourceID, ulFlags, hMachine)
; pData : void* out -> "intptr"
; DataLen : DWORD -> "int"
; dnDevInst : DWORD -> "int"
; ResourceID : DWORD -> "int"
; ulFlags : DWORD -> "int"
; hMachine : INT_PTR optional -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
cfgmgr32 = windows.NewLazySystemDLL("CFGMGR32.dll")
procCM_Query_Arbitrator_Free_Data_Ex = cfgmgr32.NewProc("CM_Query_Arbitrator_Free_Data_Ex")
)
// pData (void* out), DataLen (DWORD), dnDevInst (DWORD), ResourceID (DWORD), ulFlags (DWORD), hMachine (INT_PTR optional)
r1, _, err := procCM_Query_Arbitrator_Free_Data_Ex.Call(
uintptr(pData),
uintptr(DataLen),
uintptr(dnDevInst),
uintptr(ResourceID),
uintptr(ulFlags),
uintptr(hMachine),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // CONFIGRETfunction CM_Query_Arbitrator_Free_Data_Ex(
pData: Pointer; // void* out
DataLen: DWORD; // DWORD
dnDevInst: DWORD; // DWORD
ResourceID: DWORD; // DWORD
ulFlags: DWORD; // DWORD
hMachine: NativeInt // INT_PTR optional
): DWORD; stdcall;
external 'CFGMGR32.dll' name 'CM_Query_Arbitrator_Free_Data_Ex';result := DllCall("CFGMGR32\CM_Query_Arbitrator_Free_Data_Ex"
, "Ptr", pData ; void* out
, "UInt", DataLen ; DWORD
, "UInt", dnDevInst ; DWORD
, "UInt", ResourceID ; DWORD
, "UInt", ulFlags ; DWORD
, "Ptr", hMachine ; INT_PTR optional
, "UInt") ; return: CONFIGRET●CM_Query_Arbitrator_Free_Data_Ex(pData, DataLen, dnDevInst, ResourceID, ulFlags, hMachine) = DLL("CFGMGR32.dll", "dword CM_Query_Arbitrator_Free_Data_Ex(void*, dword, dword, dword, dword, int)")
# 呼び出し: CM_Query_Arbitrator_Free_Data_Ex(pData, DataLen, dnDevInst, ResourceID, ulFlags, hMachine)
# pData : void* out -> "void*"
# DataLen : DWORD -> "dword"
# dnDevInst : DWORD -> "dword"
# ResourceID : DWORD -> "dword"
# ulFlags : DWORD -> "dword"
# hMachine : INT_PTR optional -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。