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.

94 lines
2.7 KiB

  1. /***************************************************************************
  2. *
  3. * Copyright (C) 2001 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: spcallbackobj.h
  6. *
  7. * Content: Header for DP8SIM callback interface object class.
  8. *
  9. * History:
  10. * Date By Reason
  11. * ======== ======== =========
  12. * 04/23/01 VanceO Created.
  13. *
  14. ***************************************************************************/
  15. //=============================================================================
  16. // Macros
  17. //=============================================================================
  18. #define ENUMQUERYEVENTWRAPPER_FROM_SPIEQUERY(p) (CONTAINING_OBJECT(p, ENUMQUERYDATAWRAPPER, QueryForUser))
  19. //=============================================================================
  20. // Structures
  21. //=============================================================================
  22. typedef struct _ENUMQUERYEVENTWRAPPER
  23. {
  24. BYTE m_Sig[4]; // debugging signature ('EQEW')
  25. SPIE_QUERY QueryForUser; // new event indication structure to be passed up to user
  26. SPIE_QUERY * pOriginalQuery; // pointer to real SP's original event indication structure
  27. } ENUMQUERYDATAWRAPPER, * PENUMQUERYDATAWRAPPER;
  28. //=============================================================================
  29. // Callback interface object class
  30. //=============================================================================
  31. class CDP8SimCB : public IDP8SPCallback
  32. {
  33. public:
  34. CDP8SimCB(CDP8SimSP * pOwningDP8SimSP, IDP8SPCallback * pDP8SPCB); // constructor
  35. ~CDP8SimCB(void); // destructor
  36. STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  37. STDMETHODIMP_(ULONG) AddRef(void);
  38. STDMETHODIMP_(ULONG) Release(void);
  39. STDMETHODIMP IndicateEvent(SP_EVENT_TYPE EventType, PVOID pvMessage);
  40. STDMETHODIMP CommandComplete(HANDLE hCommand, HRESULT hrResult, PVOID pvContext);
  41. HRESULT InitializeObject(void);
  42. void UninitializeObject(void);
  43. inline IDP8SPCallback * GetRealCallbackInterface(void) { return this->m_pDP8SPCB; };
  44. private:
  45. BYTE m_Sig[4]; // debugging signature ('SPCB')
  46. LONG m_lRefCount; // reference count for this object
  47. DNCRITICAL_SECTION m_csLock; // lock preventing simultaneous usage of globals
  48. CDP8SimSP * m_pOwningDP8SimSP; // pointer to owing DP8SimSP object
  49. IDP8SPCallback * m_pDP8SPCB; // pointer to real DPlay callback interface
  50. inline BOOL IsValidObject(void)
  51. {
  52. if ((this == NULL) || (IsBadWritePtr(this, sizeof(CDP8SimCB))))
  53. {
  54. return FALSE;
  55. }
  56. if (*((DWORD*) (&this->m_Sig)) != 0x42435053) // 0x42 0x43 0x50 0x53 = 'BCPS' = 'SPCB' in Intel order
  57. {
  58. return FALSE;
  59. }
  60. return TRUE;
  61. };
  62. };