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

CM_Get_Resource_Conflict_DetailsW

関数
指定インデックスのリソース競合の詳細を取得する。
DLLCFGMGR32.dll文字セットUnicode (-W)呼出規約winapi対応OSWindows 2000 以降

シグネチャ

// CFGMGR32.dll  (Unicode / -W)
#include <windows.h>

CONFIGRET CM_Get_Resource_Conflict_DetailsW(
    UINT_PTR clConflictList,
    DWORD ulIndex,
    CONFLICT_DETAILS_W* pConflictDetails
);

パラメーター

名前方向説明
clConflictListUINT_PTRin詳細を取得する対象の競合リストハンドル。
ulIndexDWORDin取得する競合エントリの0始まりインデックス。
pConflictDetailsCONFLICT_DETAILS_W*inout競合の詳細情報(CONFLICT_DETAILS_W)を受け取る構造体へのポインタ。

戻り値の型: CONFIGRET

各言語での呼び出し定義

// CFGMGR32.dll  (Unicode / -W)
#include <windows.h>

CONFIGRET CM_Get_Resource_Conflict_DetailsW(
    UINT_PTR clConflictList,
    DWORD ulIndex,
    CONFLICT_DETAILS_W* pConflictDetails
);
[DllImport("CFGMGR32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern uint CM_Get_Resource_Conflict_DetailsW(
    UIntPtr clConflictList,   // UINT_PTR
    uint ulIndex,   // DWORD
    IntPtr pConflictDetails   // CONFLICT_DETAILS_W* in/out
);
<DllImport("CFGMGR32.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function CM_Get_Resource_Conflict_DetailsW(
    clConflictList As UIntPtr,   ' UINT_PTR
    ulIndex As UInteger,   ' DWORD
    pConflictDetails As IntPtr   ' CONFLICT_DETAILS_W* in/out
) As UInteger
End Function
' clConflictList : UINT_PTR
' ulIndex : DWORD
' pConflictDetails : CONFLICT_DETAILS_W* in/out
Declare PtrSafe Function CM_Get_Resource_Conflict_DetailsW Lib "cfgmgr32" ( _
    ByVal clConflictList As LongPtr, _
    ByVal ulIndex As Long, _
    ByVal pConflictDetails As LongPtr) As Long
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

CM_Get_Resource_Conflict_DetailsW = ctypes.windll.cfgmgr32.CM_Get_Resource_Conflict_DetailsW
CM_Get_Resource_Conflict_DetailsW.restype = wintypes.DWORD
CM_Get_Resource_Conflict_DetailsW.argtypes = [
    ctypes.c_size_t,  # clConflictList : UINT_PTR
    wintypes.DWORD,  # ulIndex : DWORD
    ctypes.c_void_p,  # pConflictDetails : CONFLICT_DETAILS_W* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('CFGMGR32.dll')
CM_Get_Resource_Conflict_DetailsW = Fiddle::Function.new(
  lib['CM_Get_Resource_Conflict_DetailsW'],
  [
    Fiddle::TYPE_UINTPTR_T,  # clConflictList : UINT_PTR
    -Fiddle::TYPE_INT,  # ulIndex : DWORD
    Fiddle::TYPE_VOIDP,  # pConflictDetails : CONFLICT_DETAILS_W* in/out
  ],
  -Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"
#[link(name = "cfgmgr32")]
extern "system" {
    fn CM_Get_Resource_Conflict_DetailsW(
        clConflictList: usize,  // UINT_PTR
        ulIndex: u32,  // DWORD
        pConflictDetails: *mut CONFLICT_DETAILS_W  // CONFLICT_DETAILS_W* in/out
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("CFGMGR32.dll", CharSet = CharSet.Unicode)]
public static extern uint CM_Get_Resource_Conflict_DetailsW(UIntPtr clConflictList, uint ulIndex, IntPtr pConflictDetails);
"@
$api = Add-Type -MemberDefinition $sig -Name 'CFGMGR32_CM_Get_Resource_Conflict_DetailsW' -Namespace Win32 -PassThru
# $api::CM_Get_Resource_Conflict_DetailsW(clConflictList, ulIndex, pConflictDetails)
#uselib "CFGMGR32.dll"
#func global CM_Get_Resource_Conflict_DetailsW "CM_Get_Resource_Conflict_DetailsW" wptr, wptr, wptr
; CM_Get_Resource_Conflict_DetailsW clConflictList, ulIndex, varptr(pConflictDetails)   ; 戻り値は stat
; clConflictList : UINT_PTR -> "wptr"
; ulIndex : DWORD -> "wptr"
; pConflictDetails : CONFLICT_DETAILS_W* in/out -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "CFGMGR32.dll"
#cfunc global CM_Get_Resource_Conflict_DetailsW "CM_Get_Resource_Conflict_DetailsW" sptr, int, var
; res = CM_Get_Resource_Conflict_DetailsW(clConflictList, ulIndex, pConflictDetails)
; clConflictList : UINT_PTR -> "sptr"
; ulIndex : DWORD -> "int"
; pConflictDetails : CONFLICT_DETAILS_W* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; CONFIGRET CM_Get_Resource_Conflict_DetailsW(UINT_PTR clConflictList, DWORD ulIndex, CONFLICT_DETAILS_W* pConflictDetails)
#uselib "CFGMGR32.dll"
#cfunc global CM_Get_Resource_Conflict_DetailsW "CM_Get_Resource_Conflict_DetailsW" intptr, int, var
; res = CM_Get_Resource_Conflict_DetailsW(clConflictList, ulIndex, pConflictDetails)
; clConflictList : UINT_PTR -> "intptr"
; ulIndex : DWORD -> "int"
; pConflictDetails : CONFLICT_DETAILS_W* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	cfgmgr32 = windows.NewLazySystemDLL("CFGMGR32.dll")
	procCM_Get_Resource_Conflict_DetailsW = cfgmgr32.NewProc("CM_Get_Resource_Conflict_DetailsW")
)

// clConflictList (UINT_PTR), ulIndex (DWORD), pConflictDetails (CONFLICT_DETAILS_W* in/out)
r1, _, err := procCM_Get_Resource_Conflict_DetailsW.Call(
	uintptr(clConflictList),
	uintptr(ulIndex),
	uintptr(pConflictDetails),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // CONFIGRET
function CM_Get_Resource_Conflict_DetailsW(
  clConflictList: NativeUInt;   // UINT_PTR
  ulIndex: DWORD;   // DWORD
  pConflictDetails: Pointer   // CONFLICT_DETAILS_W* in/out
): DWORD; stdcall;
  external 'CFGMGR32.dll' name 'CM_Get_Resource_Conflict_DetailsW';
result := DllCall("CFGMGR32\CM_Get_Resource_Conflict_DetailsW"
    , "UPtr", clConflictList   ; UINT_PTR
    , "UInt", ulIndex   ; DWORD
    , "Ptr", pConflictDetails   ; CONFLICT_DETAILS_W* in/out
    , "UInt")   ; return: CONFIGRET
●CM_Get_Resource_Conflict_DetailsW(clConflictList, ulIndex, pConflictDetails) = DLL("CFGMGR32.dll", "dword CM_Get_Resource_Conflict_DetailsW(int, dword, void*)")
# 呼び出し: CM_Get_Resource_Conflict_DetailsW(clConflictList, ulIndex, pConflictDetails)
# clConflictList : UINT_PTR -> "int"
# ulIndex : DWORD -> "dword"
# pConflictDetails : CONFLICT_DETAILS_W* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。