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.

75 lines
1.9 KiB

  1. /***************************************************************************\
  2. *
  3. * File: MsgTable.h
  4. *
  5. * Description:
  6. * MsgTable.h defines the "Message Table" object that provide a
  7. * dynamically generated v-table for messages.
  8. *
  9. *
  10. * History:
  11. * 8/05/2000: JStall: Created
  12. *
  13. * Copyright (C) 2000 by Microsoft Corporation. All rights reserved.
  14. *
  15. \***************************************************************************/
  16. #if !defined(MSG__MsgTable_h__INCLUDED)
  17. #define MSG__MsgTable_h__INCLUDED
  18. #pragma once
  19. //
  20. // NOTE: MsgSlot NEEDS to have data packed on 8-byte boundaries since it will
  21. // be directly accessed on Win64.
  22. //
  23. struct MsgSlot
  24. {
  25. void * pfn; // Implementation function
  26. int cbThisOffset; // "this" offset in arpThis
  27. ATOM atomNameID; // Unique ID for message
  28. };
  29. class MsgClass;
  30. class MsgTable
  31. {
  32. // Construction
  33. public:
  34. inline MsgTable();
  35. inline ~MsgTable();
  36. static HRESULT Build(const DUser::MessageClassGuts * pmc, const MsgClass * pmcPeer, MsgTable ** ppmt);
  37. inline void Destroy();
  38. // Operations
  39. public:
  40. inline int GetCount() const;
  41. inline int GetDepth() const;
  42. inline const MsgClass *
  43. GetClass() const;
  44. inline const MsgSlot *
  45. GetMsgSlot(int nMsg) const;
  46. const MsgSlot *
  47. Find(ATOM atomNameID) const;
  48. int FindIndex(ATOM atomNameID) const;
  49. // Implementation
  50. protected:
  51. inline MsgSlot * GetSlots();
  52. inline const MsgSlot *
  53. GetSlots() const;
  54. // Data
  55. protected:
  56. const MsgTable *
  57. m_pmtSuper;
  58. const MsgClass *
  59. m_pmcPeer;
  60. int m_cMsgs;
  61. };
  62. #include "MsgTable.inl"
  63. #endif // MSG__MsgTable_h__INCLUDED