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.

110 lines
4.2 KiB

  1. /*****************************************************************************
  2. * (C) COPYRIGHT MICROSOFT CORPORATION, 2002
  3. *
  4. * AUTHOR: ByronC
  5. *
  6. * DATE: 4/1/2002
  7. *
  8. * @doc INTERNAL
  9. *
  10. * @module RegistrationCookie.h - Definitions for <c RegistrationCookie> |
  11. *
  12. * This file contains the class definition for <c RegistrationCookie>.
  13. *
  14. *****************************************************************************/
  15. //
  16. // Defines
  17. //
  18. #define RegistrationCookie_UNINIT_SIG 0x55436552
  19. #define RegistrationCookie_INIT_SIG 0x49436552
  20. #define RegistrationCookie_TERM_SIG 0x54436552
  21. #define RegistrationCookie_DEL_SIG 0x44436552
  22. /*****************************************************************************
  23. *
  24. * @doc INTERNAL
  25. *
  26. * @class RegistrationCookie | This class is handed back during WIA Event Registration
  27. *
  28. * @comm
  29. * The semantics of this class are very similar to the idea of a cookie i.e.
  30. * the client makes a WIA runtime event registration, and gets a pointer to this
  31. * class back as its cookie. This class is associated with that registration.
  32. *
  33. * Releasing this cookie causes unregistration.
  34. *
  35. *****************************************************************************/
  36. class WiaEventReceiver;
  37. class RegistrationCookie : public IUnknown
  38. {
  39. //@access Public members
  40. public:
  41. // @cmember Constructor
  42. RegistrationCookie(WiaEventReceiver *pWiaEventReceiver, ClientEventRegistrationInfo *pClientEventRegistration);
  43. // @cmember Destructor
  44. virtual ~RegistrationCookie();
  45. // @cmember Query Interface
  46. HRESULT _stdcall QueryInterface(const IID &iid,void**ppv);
  47. // @cmember Increment reference count
  48. virtual ULONG __stdcall AddRef();
  49. // @cmember Decrement reference count
  50. virtual ULONG __stdcall Release();
  51. //@access Private members
  52. private:
  53. // @cmember Signature of class
  54. ULONG m_ulSig;
  55. // @cmember Ref count
  56. ULONG m_cRef;
  57. // @cmember Pointer to client's <c WiaEventReceiver>
  58. WiaEventReceiver *m_pWiaEventReceiver;
  59. // @cmember Pointer to client's <c ClientEventRegistrationInfo>
  60. ClientEventRegistrationInfo *m_pClientEventRegistration;
  61. //
  62. // Comments for member variables
  63. //
  64. // @mdata ULONG | RegistrationCookie | m_ulSig |
  65. // The signature for this class, used for debugging purposes.
  66. // Doing a <nl>"db [addr_of_class]"<nl> would yield one of the following
  67. // signatures for this class:
  68. // @flag RegistrationCookie_UNINIT_SIG | 'ReCU' - Object has not been successfully
  69. // initialized
  70. // @flag RegistrationCookie_INIT_SIG | 'ReCI' - Object has been successfully
  71. // initialized
  72. // @flag RegistrationCookie_TERM_SIG | 'ReCT' - Object is in the process of
  73. // terminating.
  74. // @flag RegistrationCookie_INIT_SIG | 'ReCD' - Object has been deleted
  75. // (destructor was called)
  76. //
  77. //
  78. // @mdata ULONG | RegistrationCookie | m_cRef |
  79. // The reference count for this class. Used for lifetime
  80. // management.
  81. //
  82. // @mdata WiaEventReceiver* | RegistrationCookie | m_pWiaEventReceiver |
  83. // Pointer to client's <c WiaEventReceiver>. Notice that we do no ref counting
  84. // on this pointer. This is because the client's global <c WiaEventReceiver> object
  85. // lifetime is considered to be that of the client. It will only be freed
  86. // when the STI.DLL is unloaded. Technically, we could just directly
  87. // access the g_WiaEventReceiver object, but keeping a member variable gives us more
  88. // flexibility (e.g. if instead of a statically allocated class, we moved to
  89. // dynamic singleton instatiation, this class would not change except to add relevant
  90. // AddRef/Release calls).
  91. //
  92. // @mdata ClientEventRegistrationInfo* | RegistrationCookie | m_pClientEventRegistration |
  93. // Pointer to client's <c ClientEventRegistrationInfo>. Releasing this class will
  94. // result in an Unregistration call on <md RegistrationCookie::m_pWiaEventReceiver> for this
  95. // registration.
  96. // We hold a ref count on this registration class.
  97. //
  98. };