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.

99 lines
1.6 KiB

  1. /*++
  2. Microsoft Windows NT RPC Name Service
  3. Copyright (C) Microsoft Corporation, 1995 - 1999
  4. Module Name:
  5. mailslot.cxx
  6. Abstract:
  7. This file contains the definitions of classes WRITE_MAIL_SLOT and READ_MAIL_SLOT,
  8. which are classes used for wrapping NT mailslot functionality.
  9. Author:
  10. Satish Thatte (SatishT) 10/1/95 Created all the code below except where
  11. otherwise indicated.
  12. --*/
  13. #ifndef __MAIL__
  14. #define __MAIL__
  15. #define MAILNAME(s) TEXT("\\MailSlot\\RpcLoc_")
  16. #define PMAILNAME(s) (STRING_T) (MAILNAME(s))
  17. #define PMAILNAME_S TEXT("\\MailSlot\\RpcLoc_s")
  18. #define PMAILNAME_C TEXT("\\MailSlot\\RpcLoc_c")
  19. #define RESPONDERMSLOT_S TEXT("\\MailSlot\\Resp_s")
  20. #define RESPONDERMSLOT_C TEXT("\\MailSlot\\Resp_c")
  21. /*++
  22. Class Definition:
  23. WRITE_MAIL_SLOT
  24. Abstract:
  25. A class that wraps NT system mailslots expected to be used for writing.
  26. --*/
  27. class WRITE_MAIL_SLOT {
  28. private:
  29. HANDLE hWriteHandle;
  30. public:
  31. WRITE_MAIL_SLOT(
  32. IN STRING_T Target,
  33. IN STRING_T MailSlot
  34. );
  35. ~WRITE_MAIL_SLOT();
  36. DWORD Write(char * Buffer, DWORD Size);
  37. };
  38. /*++
  39. Class Definition:
  40. READ_MAIL_SLOT
  41. Abstract:
  42. A class that wraps NT system mailslots expected to be used for reading.
  43. --*/
  44. class READ_MAIL_SLOT {
  45. private:
  46. HANDLE hReadHandle;
  47. DWORD Size;
  48. CPrivateCriticalSection SerializeReaders;
  49. public:
  50. READ_MAIL_SLOT(STRING_T MailSlot, DWORD Size);
  51. ~READ_MAIL_SLOT();
  52. DWORD Read(
  53. IN OUT char * Buffer,
  54. IN DWORD dwBufferSize,
  55. IN DWORD TimeOut = NET_REPLY_INITIAL_TIMEOUT
  56. );
  57. };
  58. #endif // __MAIL__