急急急,在线求助!!
1)原型
WINSETUPAPI
BOOL
WINAPI
SetupDiSetClassInstallParamsA(
IN HDEVINFO DeviceInfoSet,
IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
IN PSP_CLASSINSTALL_HEADER ClassInstallParams, OPTIONAL
IN DWORD ClassInstallParamsSize
);
[DllImport( "setupapi.dll ", SetLastError = true, CharSet = CharSet.Auto)]static extern bool SetupDiSetClassInstallParams(IntPtr DeviceInfoSet, ref SP_DEVINFO_DATA DeviceInfoData, ref SP_CLASSINSTALL_HEADER ClassInstallParams, int ClassInstallParamsSize);
2)typedef struct _SP_CLASSINSTALL_HEADER {
DWORD cbSize;
DI_FUNCTION InstallFunction;
} SP_CLASSINSTALL_HEADER, *PSP_CLASSINSTALL_HEADER;
[StructLayout(LayoutKind.Sequential)]
public struct SP_CLASSINSTALL_HEADER
{
public UInt32 cbSize;
public uint InstallFunction;
}
3)typedef struct _SP_PROPCHANGE_PARAMS {
SP_CLASSINSTALL_HEADER ClassInstallHeader;
DWORD StateChange;
DWORD Scope;
DWORD HwProfile;
} SP_PROPCHANGE_PARAMS, *PSP_PROPCHANGE_PARAMS;
[StructLayout(LayoutKind.Sequential)]
public struct SP_PROPCHANGE_PARAMS
{
public SP_CLASSINSTALL_HEADER ClassInstallHeader;
public UInt32 StateChange;
public UInt32 Scope;
public UInt32 HwProfile;
}
问题:
1)这几个写法是否有问题?
2)
SP_PROPCHANGE_PARAMS spPropChangeParam = new SP_PROPCHANGE_PARAMS();