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.

143 lines
3.8 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. vrmslot.h
  5. Abstract:
  6. Prototypes, definitions and structures for VdmRedir mailslot handlers
  7. Author:
  8. Richard L Firth (rfirth) 16-Sep-1991
  9. Revision History:
  10. 16-Sep-1991 rfirth
  11. Created
  12. --*/
  13. //
  14. // VDM Mailslot support routines. Prototypes
  15. //
  16. VOID
  17. VrDeleteMailslot(
  18. VOID
  19. );
  20. VOID
  21. VrGetMailslotInfo(
  22. VOID
  23. );
  24. VOID
  25. VrMakeMailslot(
  26. VOID
  27. );
  28. VOID
  29. VrPeekMailslot(
  30. VOID
  31. );
  32. VOID
  33. VrReadMailslot(
  34. VOID
  35. );
  36. VOID
  37. VrWriteMailslot(
  38. VOID
  39. );
  40. VOID
  41. VrTerminateMailslots(
  42. IN WORD DosPdb
  43. );
  44. //
  45. // typedefs
  46. //
  47. //
  48. // SELECTOR - in the absence of a standard SELECTOR type, 16-bit selector,
  49. // doubles as SEGMENT (as in ADDRESS16)
  50. //
  51. typedef unsigned short SELECTOR;
  52. //
  53. // ADDRESS16 - an Intel architecture-specific 16:16 address, consisting of a
  54. // 16-bit offset in the low word and a 16-bit segment (real mode) or selector
  55. // (protect mode) in the high word. Both elements are little-endian
  56. // Again, this exists in absence of Intel-specific DWORD structure which has
  57. // correct endian-ness and views address as composed of two parts
  58. //
  59. typedef struct {
  60. unsigned short Offset;
  61. SELECTOR Selector;
  62. } ADDRESS16;
  63. //
  64. // structures
  65. //
  66. //
  67. // VR_MAILSLOT_INFO - the Dos mailslot subsystem needs some info which we do
  68. // not keep, so we put it in this structure. The structure is linked into a
  69. // list of active mailslot structures for every successful CreateMailslot
  70. // call. The extra info we need is:
  71. //
  72. // DosPdb - the PDB (or PSP) of the Dos application. Used for
  73. // consistency checks and removing mailslots when the
  74. // app dies
  75. // Handle16 - the handle returned to the Dos app. We have to invent
  76. // this
  77. // BufferAddress - the Dos app tells us where its buffer is then wants
  78. // us to confirm the address in a DosMailslotInfo call
  79. // Selector - the Dos app needs a protect mode selector when
  80. // running under Windows 3.0 enhanced mode
  81. // MessageSize - maximum message size which can be read. Not the same
  82. // thing as mailslot size
  83. //
  84. // We also need some information for our own internal wrangling:
  85. //
  86. // NameLength - the length of the significant part of the mailslot
  87. // name (after \MAILSLOT\). We compare this before
  88. // doing a strcmp() on names
  89. // Name - the significant part of the mailslot name. When a
  90. // mailslot is opened, we store the name after \MAILSLOT\
  91. // because DosMailslotWrite uses the symbolic name, even
  92. // when writing locally; we need a handle, so we have
  93. // to map the name to open mailslot handle.
  94. //
  95. // This structure is allocated from the heap and the Name field will actually
  96. // be large enough to hold the entire string. I put Name[2] because the Mips
  97. // compiler doesn't know about Name[] (Microsoft C compiler extension). 2 at
  98. // least keeps things even. Maybe it should be 4. Maybe it doesn't matter
  99. //
  100. typedef struct _VR_MAILSLOT_INFO *PVR_MAILSLOT_INFO;
  101. typedef struct _VR_MAILSLOT_INFO {
  102. PVR_MAILSLOT_INFO Next; // linked list
  103. WORD DosPdb; // for consistency etc
  104. WORD Handle16; // Dos handle
  105. HANDLE Handle32; // Win32 handle (proper)
  106. ADDRESS16 BufferAddress; // Dos app's message buffer
  107. SELECTOR Selector; // Win 3's buffer selector
  108. DWORD MessageSize; // max. message size
  109. DWORD NameLength; // length of name following:
  110. CHAR Name[2]; // of mailslot, (after \\.\MAILSLOT\)
  111. } VR_MAILSLOT_INFO;