📄 setupapidll.h
字号:
/************************************************************************
*
* Module: SetupApiDll.h
* Long name: CSetupApiDll class
* Description: handling of the setupapi.dll
*
* Runtime Env.: Win32
* Author(s): Guenter Hildebrandt, Udo Eberhardt
* Company: Thesycon GmbH, Ilmenau
************************************************************************/
#ifndef _SetupApiDll_h_
#define _SetupApiDll_h_
// get setup API functions (only available in Win98 and later systems)
#include <setupapi.h>
//
// CSetupApiDll
//
class CSetupApiDll
{
public:
// standard constructor
CSetupApiDll();
// destructor
~CSetupApiDll();
// load setupapi.dll
// returns TRUE if successful, FALSE otherwise
BOOL Load();
// release setupapi.dll
void Release();
// implementation
protected:
// init function pointers
void InitPointers();
// We have to repeat some prototypes from setupapi.h.
// Unfortunately, the .h file does not define types for the functions.
typedef
WINSETUPAPI
HDEVINFO
WINAPI
F_SetupDiGetClassDevsA(
CONST GUID * ClassGuid,
PCSTR *Enumerator,
HWND hwndParent,
DWORD Flags
);
typedef
WINSETUPAPI
BOOL
WINAPI
F_SetupDiDestroyDeviceInfoList(
HDEVINFO DeviceInfoSet
);
typedef
WINSETUPAPI
BOOL
WINAPI
F_SetupDiEnumDeviceInterfaces(
HDEVINFO DeviceInfoSet,
PSP_DEVINFO_DATA DeviceInfoData,
CONST GUID * InterfaceClassGuid,
DWORD MemberIndex,
PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData
);
typedef
WINSETUPAPI
BOOL
WINAPI
F_SetupDiGetDeviceInterfaceDetailA(
HDEVINFO DeviceInfoSet,
PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData,
PSP_DEVICE_INTERFACE_DETAIL_DATA_A DeviceInterfaceDetailData,
DWORD DeviceInterfaceDetailDataSize,
PDWORD RequiredSize,
PSP_DEVINFO_DATA DeviceInfoData
);
// handle for DLL
HMODULE mDllHandle;
// function pointers
// We make the pointers public to simplify access by external code.
public:
F_SetupDiGetClassDevsA* SetupDiGetClassDevs;
F_SetupDiDestroyDeviceInfoList* SetupDiDestroyDeviceInfoList;
F_SetupDiEnumDeviceInterfaces* SetupDiEnumDeviceInterfaces;
F_SetupDiGetDeviceInterfaceDetailA* SetupDiGetDeviceInterfaceDetail;
}; // class CSetupApiDll
#endif // _SetupApiDll_h_
/*************************** EOF **************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -