//
// Device Instance Handle data type
//
typedef DEVNODE, DEVINST;
typedef DEVNODE *PDEVNODE, *PDEVINST;
//
// Device Instance Identifier data type
// The device instance ID specifies the registry path, relative to the
// Enum key , for a device instance. For example: \Root\*PNP0500\0000.
//
typedef CHAR *DEVNODEID_A, *DEVINSTID_A; // Device ID ANSI name.
typedef WCHAR *DEVNODEID_W, *DEVINSTID_W; // Device ID Unicode name.
#ifdef UNICODE
typedef DEVNODEID_W DEVNODEID;
typedef DEVINSTID_W DEVINSTID;
#else
typedef DEVNODEID_A DEVNODEID;
typedef DEVINSTID_A DEVINSTID;
#endif
//
// Logical Configuration Handle data type
//
typedef HANDLE HMACHINE;
typedef HMACHINE *PHMACHINE;
//
//
#define CM_LOCATE_DEVNODE_NORMAL 0x00000000
//
#define CR_SUCCESS (0x00000000)
CMAPI
CONFIGRET
WINAPI
CM_Locate_DevNodeA(
OUT PDEVINST pdnDevInst,
IN DEVINSTID_A pDeviceID, OPTIONAL
IN ULONG ulFlags
);
CMAPI
CONFIGRET
WINAPI
CM_Locate_DevNodeW(
OUT PDEVINST pdnDevInst,
IN DEVINSTID_W pDeviceID, OPTIONAL
IN ULONG ulFlags
);
CMAPI
CONFIGRET
WINAPI
CM_Reenumerate_DevNode(
IN DEVINST dnDevInst,
IN ULONG ulFlags
);
CMAPI
CONFIGRET
WINAPI
CM_Reenumerate_DevNode_Ex(
IN DEVINST dnDevInst,
IN ULONG ulFlags,
IN HMACHINE hMachine
);
#endif
VOID ShowForHardWare()
{
DEVINST devInst;
CONFIGRET status;
//得到设备管理树的根结点
status = CM_Locate_DevNode(&devInst,NULL,CM_LOCATE_DEVNODE_NORMAL);
This section describes the Plug and Play (PnP) Configuration Manager functions that are used by class installers, co-installers, or device installation applications.
复制代码
class installer, co-installer, device installation applications都不是kernel driver.