Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.6 KiB

  1. #ifndef _HWDEV_H
  2. #define _HWDEV_H
  3. #include "namellst.h"
  4. #include "cmmn.h"
  5. #include "misc.h"
  6. ///////////////////////////////////////////////////////////////////////////////
  7. //
  8. // This will enumerate all the Device that we're interested in and create
  9. // additionnal objects to do specialized work
  10. //
  11. ///////////////////////////////////////////////////////////////////////////////
  12. class CHWDeviceInst //: public CDeviceElem
  13. {
  14. public:
  15. // CHWDeviceInst
  16. HRESULT Init(DEVINST devinst);
  17. HRESULT InitInterfaceGUID(const GUID* pguidInterface);
  18. HRESULT GetPnpID(LPWSTR pszPnpID, DWORD cchPnpID);
  19. HRESULT GetDeviceInstance(DEVINST* pdevinst);
  20. HRESULT GetPnpInstID(LPWSTR pszPnpInstID, DWORD cchPnpInstID);
  21. HRESULT GetInterfaceGUID(GUID* pguidInterface);
  22. HRESULT IsRemovableDevice(BOOL* pfRemovable);
  23. HRESULT ShouldAutoplayOnSpecialInterface(const GUID* pguidInterface,
  24. BOOL* pfShouldAutoplay);
  25. public:
  26. CHWDeviceInst();
  27. ~CHWDeviceInst();
  28. private:
  29. HRESULT _GetPnpIDRecurs(DEVINST devinst, LPWSTR pszPnpID,
  30. DWORD cchPnpID);
  31. HRESULT _InitFriendlyName();
  32. HRESULT _InitPnpInfo();
  33. HRESULT _InitPnpIDAndPnpInstID();
  34. private:
  35. DEVINST _devinst;
  36. // For now MAX_SURPRISEREMOVALFN
  37. WCHAR _szFriendlyName[MAX_SURPRISEREMOVALFN];
  38. WCHAR _szPnpID[MAX_PNPID];
  39. WCHAR _szPnpInstID[MAX_PNPINSTID];
  40. GUID _guidInterface;
  41. BOOL _fFriendlyNameInited;
  42. };
  43. #endif //_HWDEV_H