Leaked source code of windows server 2003
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.

108 lines
2.7 KiB

  1. //***************************************************************************
  2. //
  3. // Copyright (c) 2000-2001 Microsoft Corporation, All Rights Reserved
  4. //
  5. // USBHub.h
  6. //
  7. // Purpose: USB Hub property set provider
  8. //
  9. //***************************************************************************
  10. // Property set identification
  11. //============================
  12. #ifndef _USBHUB_H
  13. #define _USBHUB_H
  14. #define USBHUB_ALL_PROPS 0xFFFFFFFF
  15. #define USBHUB_KEY_ONLY 0x00000010
  16. #define USBHUB_PROP_ConfigManagerErrorCode 0x00000001
  17. #define USBHUB_PROP_ConfigManagerUserConfig 0x00000002
  18. #define USBHUB_PROP_Status 0x00000004
  19. #define USBHUB_PROP_PNPDeviceID 0x00000008
  20. #define USBHUB_PROP_DeviceID 0x00000010
  21. #define USBHUB_PROP_SystemCreationClassName 0x00000020
  22. #define USBHUB_PROP_SystemName 0x00000040
  23. #define USBHUB_PROP_Description 0x00000080
  24. #define USBHUB_PROP_Caption 0x00000100
  25. #define USBHUB_PROP_Name 0x00000200
  26. #define USBHUB_PROP_CreationClassName 0x00000400
  27. #define PROPSET_NAME_USBHUB L"Win32_USBHub"
  28. class CWin32USBHub : virtual public Provider
  29. {
  30. private:
  31. CHPtrArray m_ptrProperties;
  32. protected:
  33. virtual bool IsOneOfMe
  34. (
  35. void *a_pv
  36. );
  37. virtual HRESULT LoadPropertyValues
  38. (
  39. void *a_pv
  40. );
  41. virtual bool ShouldBaseCommit
  42. (
  43. void *a_pvData
  44. );
  45. HRESULT Enumerate
  46. (
  47. MethodContext *a_pMethodContext,
  48. long a_lFlags,
  49. DWORD a_dwReqProps = USBHUB_ALL_PROPS
  50. );
  51. public:
  52. // Constructor/destructor
  53. //=======================
  54. CWin32USBHub
  55. (
  56. const CHString &a_strName,
  57. LPCWSTR a_pszNamespace
  58. );
  59. ~CWin32USBHub();
  60. // Functions provide properties with current values
  61. //=================================================
  62. virtual HRESULT GetObject
  63. (
  64. CInstance *a_pInst,
  65. long a_lFlags,
  66. CFrameworkQuery& pQuery
  67. );
  68. virtual HRESULT ExecQuery
  69. (
  70. MethodContext *a_pMethodContext,
  71. CFrameworkQuery &a_pQuery,
  72. long a_Flags = 0L
  73. );
  74. virtual HRESULT EnumerateInstances
  75. (
  76. MethodContext *a_pMethodContext,
  77. long a_lFlags = 0L
  78. );
  79. } ;
  80. // This is the base; it should always commit in the base.
  81. inline bool CWin32USBHub::ShouldBaseCommit
  82. (
  83. void *a_pvData
  84. )
  85. {
  86. return true;
  87. }
  88. #endif