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.

62 lines
1.7 KiB

  1. //#---------------------------------------------------------------
  2. // File: pxpacket.h
  3. //
  4. // Synopsis: This file contains the structure definations for
  5. // the CProxyPacket class.
  6. //
  7. // Copyright (C) 1995 Microsoft Corporation
  8. // All rights reserved.
  9. //
  10. // Authors: t-alexwe
  11. //----------------------------------------------------------------
  12. #ifndef __PXPACKET_H__
  13. #define __PXPACKET_H__
  14. #include "cliproto.h"
  15. //
  16. // The CProxyPacket class is a just a wrapper for the PROXYPACKET structure.
  17. // it has no data members except those that it inherits from PROXYPACKET
  18. // and is used to manipulate messages found in a packet.
  19. //
  20. class CProxyPacket : public PROXYPACKET {
  21. public:
  22. CProxyPacket();
  23. ~CProxyPacket();
  24. //
  25. // reset a packet to have no messages or data
  26. //
  27. void clear() { cLength = PACKETHDRSIZE; cMessages = 0; }
  28. //
  29. // Get the next available data area in the packet. Once
  30. // data has been written here it must be registered with
  31. // AddMessage()
  32. //
  33. PVOID getNextDataPointer(void)
  34. { return &pData[cLength - PACKETHDRSIZE]; }
  35. //
  36. // get the number of bytes of available space in the data area
  37. //
  38. WORD getAvailableSpace(void)
  39. { return sizeof(PROXYPACKET) - cLength - PACKETHDRSIZE; }
  40. //
  41. // add a message to a packet
  42. //
  43. void addMessage(WORD wCommand, WORD cData);
  44. //
  45. // gets the length of the entire packet
  46. //
  47. WORD getSize(void) { return cLength; }
  48. //
  49. // Gets the number of messages in a packet
  50. //
  51. WORD getMessageCount(void) { return cMessages; }
  52. //
  53. // retrieves a pointer to the message data for a particular
  54. // message.
  55. //
  56. PVOID getMessage(WORD wIndex, PWORD pwCommand, PWORD pcData);
  57. };
  58. #endif