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.

107 lines
3.9 KiB

  1. /*****************************************************************************
  2. * (C) COPYRIGHT MICROSOFT CORPORATION, 2002
  3. *
  4. * AUTHOR: ByronC
  5. *
  6. * DATE: 3/24/2002
  7. *
  8. * @doc INTERNAL
  9. *
  10. * @module EventRegistrationInfo.h - Definitions for <c EventRegistrationInfo> |
  11. *
  12. * This file contains the class definition for <c EventRegistrationInfo>.
  13. *
  14. *****************************************************************************/
  15. #define WILDCARD_DEVICEID_STR L"*"
  16. /*****************************************************************************
  17. *
  18. * @doc INTERNAL
  19. *
  20. * @class EventRegistrationInfo | Holds the event info relating to a specific
  21. * registration.
  22. *
  23. * @comm
  24. * Instances of this class hold information relating to a client's run-time
  25. * event registration. When an event occurs, this information is used to
  26. * determine whether the event matches a given registration.
  27. *
  28. * A list of all a client's registrations is stored by instances
  29. * of <c WiaEventClient>.
  30. *****************************************************************************/
  31. class EventRegistrationInfo
  32. {
  33. //@access Public members
  34. public:
  35. // @cmember Constructor
  36. EventRegistrationInfo(DWORD dwFlags, GUID guidEvent, WCHAR *wszDeviceID, ULONG_PTR Callback = 0);
  37. // @cmember Destructor
  38. virtual ~EventRegistrationInfo();
  39. // @cmember Increment reference count
  40. virtual ULONG __stdcall AddRef();
  41. // @cmember Decrement reference count
  42. virtual ULONG __stdcall Release();
  43. // @cmember Accessor method for the flags
  44. DWORD getFlags();
  45. // @cmember Accessor method for the EventGuid
  46. GUID getEventGuid();
  47. // @cmember Accessor method for the device id
  48. BSTR getDeviceID();
  49. // @cmember Accessor method for the event callback
  50. ULONG_PTR getCallback();
  51. // @cmember Returns true if this registration matches the device event
  52. BOOL MatchesDeviceEvent(BSTR bstrDevice, GUID guidEvent);
  53. // @cmember Returns true if this registration is semantically equivalent
  54. BOOL Equals(EventRegistrationInfo *pEventRegistrationInfo);
  55. // @cmember Dumps the fields of this class.
  56. VOID Dump();
  57. //@access Protected members
  58. protected:
  59. // @cmember Ref count
  60. ULONG m_cRef;
  61. // @cmember The flags used when registering
  62. DWORD m_dwFlags;
  63. // @cmember The event this registration is for
  64. GUID m_guidEvent;
  65. // @cmember The WIA DeviceID whose events we're interested in
  66. BSTR m_bstrDeviceID;
  67. // @cmember The callback part of this registration
  68. ULONG_PTR m_Callback;
  69. //
  70. // Comments for member variables
  71. //
  72. // @mdata ULONG | EventRegistrationInfo | m_cRef |
  73. // The reference count for this class. Used for lifetime
  74. // management.
  75. //
  76. // @mdata DWORD | EventRegistrationInfo | m_dwFlags |
  77. // The flags used when registering.
  78. //
  79. // @mdata GUID | EventRegistrationInfo | m_guidEvent |
  80. // The event this registration is for.
  81. //
  82. // @mdata BSTR | EventRegistrationInfo | m_bstrDeviceID |
  83. // The WIA DeviceID whose events we're interested in. If this is
  84. // "*", it means we're interested in all devices.
  85. //
  86. // @mdata ULONG_PTR | EventRegistrationInfo | m_Callback |
  87. // When a client registers for a WIA event notification, it specifies
  88. // a callback on which to receive the notification. Since we do not use
  89. // COM to do the registration on the server-side, this callback pointer
  90. // cannot be used there. It does however help to uniquely identify
  91. // a certain registration (e.g. Registration for event X on Device Foo for Interface I
  92. // is different to registration for event X on Device Foo for Interface J).
  93. // On the client-side, it is used to store the client callback pointer since
  94. // it has meaning in the client address space.
  95. //
  96. };