Source code of Windows XP (NT5)
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.

56 lines
2.3 KiB

  1. // --------------------------------------------------------------------------
  2. // Module Name: PortMessage.h
  3. //
  4. // Copyright (c) 1999-2000, Microsoft Corporation
  5. //
  6. // A class to wrap a PORT_MESSAGE struct within an object. It contains space
  7. // for PORT_MAXIMUM_MESSAGE_LENGTH bytes of data. Subclass this class to
  8. // write typed functions that access this data. Otherwise use
  9. // CPortMessage::GetData and type case the pointer returned.
  10. //
  11. // History: 1999-11-07 vtan created
  12. // 2000-08-25 vtan moved from Neptune to Whistler
  13. // --------------------------------------------------------------------------
  14. #ifndef _PortMessage_
  15. #define _PortMessage_
  16. // --------------------------------------------------------------------------
  17. // CPortMessage
  18. //
  19. // Purpose: This class wraps a PORT_MESSAGE structure. Subclass it to
  20. // write functions that access the internal data.
  21. //
  22. // History: 1999-11-07 vtan created
  23. // 2000-08-25 vtan moved from Neptune to Whistler
  24. // --------------------------------------------------------------------------
  25. class CPortMessage
  26. {
  27. public:
  28. CPortMessage (void);
  29. CPortMessage (const CPortMessage& portMessage);
  30. virtual ~CPortMessage (void);
  31. public:
  32. const PORT_MESSAGE* GetPortMessage (void) const;
  33. PORT_MESSAGE* GetPortMessage (void);
  34. const char* GetData (void) const;
  35. char* GetData (void);
  36. CSHORT GetDataLength (void) const;
  37. CSHORT GetType (void) const;
  38. HANDLE GetUniqueProcess (void) const;
  39. HANDLE GetUniqueThread (void) const;
  40. void SetReturnCode (NTSTATUS status);
  41. void SetData (const void *pData, CSHORT sDataSize);
  42. void SetDataLength (CSHORT sDataSize);
  43. NTSTATUS OpenClientToken (HANDLE& hToken) const;
  44. protected:
  45. PORT_MESSAGE _portMessage;
  46. char _data[PORT_MAXIMUM_MESSAGE_LENGTH];
  47. };
  48. #endif /* _PortMessage_ */