ホーム › Devices.DeviceAndDriverInstallation › CONFLICT_DETAILS_W
CONFLICT_DETAILS_W
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| CD_ulSize | DWORD | 4 | +0 | +0 | この構造体のバイト単位サイズ。呼び出し前に設定する。 |
| CD_ulMask | CM_CDMASK | 4 | +4 | +4 | 取得する情報フィールドを指定するマスク(CM_CDMASK)。 |
| CD_dnDevInst | DWORD | 4 | +8 | +8 | 競合に関与するデバイスインスタンスハンドル。 |
| CD_rdResDes | UINT_PTR | 8/4 | +16 | +12 | 競合に関わるリソース記述子ハンドル。 |
| CD_ulFlags | CM_CDFLAGS | 4 | +24 | +16 | 競合詳細に関するフラグ群(CM_CDFLAGS)。 |
| CD_szDescription | WCHAR | 520 | +28 | +20 | 競合デバイスの説明文字列(Unicode)。固定長バッファ。 |
各言語での定義
#include <windows.h>
// CONFLICT_DETAILS_W (x64 552 / x86 540 バイト)
typedef struct CONFLICT_DETAILS_W {
DWORD CD_ulSize;
CM_CDMASK CD_ulMask;
DWORD CD_dnDevInst;
UINT_PTR CD_rdResDes;
CM_CDFLAGS CD_ulFlags;
WCHAR CD_szDescription[260];
} CONFLICT_DETAILS_W;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CONFLICT_DETAILS_W
{
public uint CD_ulSize;
public uint CD_ulMask;
public uint CD_dnDevInst;
public UIntPtr CD_rdResDes;
public uint CD_ulFlags;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] public string CD_szDescription;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CONFLICT_DETAILS_W
Public CD_ulSize As UInteger
Public CD_ulMask As UInteger
Public CD_dnDevInst As UInteger
Public CD_rdResDes As UIntPtr
Public CD_ulFlags As UInteger
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=260)> Public CD_szDescription As String
End Structureimport ctypes
from ctypes import wintypes
class CONFLICT_DETAILS_W(ctypes.Structure):
_fields_ = [
("CD_ulSize", wintypes.DWORD),
("CD_ulMask", wintypes.DWORD),
("CD_dnDevInst", wintypes.DWORD),
("CD_rdResDes", ctypes.c_size_t),
("CD_ulFlags", wintypes.DWORD),
("CD_szDescription", ctypes.c_wchar * 260),
]#[repr(C)]
pub struct CONFLICT_DETAILS_W {
pub CD_ulSize: u32,
pub CD_ulMask: u32,
pub CD_dnDevInst: u32,
pub CD_rdResDes: usize,
pub CD_ulFlags: u32,
pub CD_szDescription: [u16; 260],
}import "golang.org/x/sys/windows"
type CONFLICT_DETAILS_W struct {
CD_ulSize uint32
CD_ulMask uint32
CD_dnDevInst uint32
CD_rdResDes uintptr
CD_ulFlags uint32
CD_szDescription [260]uint16
}type
CONFLICT_DETAILS_W = record
CD_ulSize: DWORD;
CD_ulMask: DWORD;
CD_dnDevInst: DWORD;
CD_rdResDes: NativeUInt;
CD_ulFlags: DWORD;
CD_szDescription: array[0..259] of WideChar;
end;const CONFLICT_DETAILS_W = extern struct {
CD_ulSize: u32,
CD_ulMask: u32,
CD_dnDevInst: u32,
CD_rdResDes: usize,
CD_ulFlags: u32,
CD_szDescription: [260]u16,
};type
CONFLICT_DETAILS_W {.bycopy.} = object
CD_ulSize: uint32
CD_ulMask: uint32
CD_dnDevInst: uint32
CD_rdResDes: uint
CD_ulFlags: uint32
CD_szDescription: array[260, uint16]struct CONFLICT_DETAILS_W
{
uint CD_ulSize;
uint CD_ulMask;
uint CD_dnDevInst;
size_t CD_rdResDes;
uint CD_ulFlags;
wchar[260] CD_szDescription;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; CONFLICT_DETAILS_W サイズ: 540 バイト(x86)
dim st, 135 ; 4byte整数×135(構造体サイズ 540 / 4 切り上げ)
; CD_ulSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; CD_ulMask : CM_CDMASK (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; CD_dnDevInst : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; CD_rdResDes : UINT_PTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; CD_ulFlags : CM_CDFLAGS (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; CD_szDescription : WCHAR (+20, 520byte) varptr(st)+20 を基点に操作(520byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CONFLICT_DETAILS_W サイズ: 552 バイト(x64)
dim st, 138 ; 4byte整数×138(構造体サイズ 552 / 4 切り上げ)
; CD_ulSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; CD_ulMask : CM_CDMASK (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; CD_dnDevInst : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; CD_rdResDes : UINT_PTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; CD_ulFlags : CM_CDFLAGS (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; CD_szDescription : WCHAR (+28, 520byte) varptr(st)+28 を基点に操作(520byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CONFLICT_DETAILS_W
#field int CD_ulSize
#field int CD_ulMask
#field int CD_dnDevInst
#field intptr CD_rdResDes
#field int CD_ulFlags
#field wchar CD_szDescription 260
#endstruct
stdim st, CONFLICT_DETAILS_W ; NSTRUCT 変数を確保
st->CD_ulSize = 100
mes "CD_ulSize=" + st->CD_ulSize