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.

152 lines
3.0 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1994 - 1999
  6. //
  7. // File: np.h
  8. //
  9. //--------------------------------------------------------------------------
  10. /////////////////////////////////////////////////////////////////////////
  11. //
  12. // Filename: np.h
  13. //
  14. // Description: This file contains definitions for Named Pipe routines
  15. // for use with IPC raw network performance tests.
  16. //
  17. // Authors: Scott Holden (Translator from NT API to win32 API)
  18. // Mahesh Keni (Mahesh wrote this application using mostly
  19. // NT native API calls)
  20. //
  21. /////////////////////////////////////////////////////////////////////////
  22. #define PERF_PIPE "\\\\.\\pipe\\perftest"
  23. #define RM_PERF_PIPE_PRFX "\\\\."
  24. #define RM_PERF_PIPE_SUFX "\\pipe\\perftest"
  25. #define PERF_EVENT "\\prfEvent"
  26. #define PIPE_LEN 2048
  27. /************************************************************************/
  28. // Local function prototypes
  29. /************************************************************************/
  30. NTSTATUS
  31. CreateNamedPipeInstance(
  32. IN USHORT Nindex
  33. );
  34. /*
  35. NTSTATUS
  36. NamedPipe_FsControl(
  37. IN HANDLE lhandle,
  38. IN ULONG FsControlCode,
  39. IN PVOID pInBuffer,
  40. IN ULONG InBufLen,
  41. OUT PVOID pOutBuffer,
  42. IN ULONG OutBufLen
  43. );
  44. */
  45. NTSTATUS
  46. ReadNamedPipe(
  47. IN HANDLE rhandle,
  48. IN ULONG rlength,
  49. IN OUT PVOID rpbuffer,
  50. IN OUT PULONG rpdatalen
  51. );
  52. NTSTATUS
  53. WriteNamedPipe(
  54. IN HANDLE whandle,
  55. IN ULONG wlength,
  56. IN OUT PVOID wpbuffer,
  57. IN OUT PULONG wpdatalen
  58. );
  59. NTSTATUS
  60. NMP_Initialize(
  61. IN USHORT NClients,
  62. IN PCHAR ServerName,
  63. IN USHORT SrvCli
  64. );
  65. NTSTATUS
  66. NMP_PerClientInit(
  67. IN USHORT CIndex,
  68. IN USHORT SrvCli
  69. );
  70. NTSTATUS
  71. NMP_Allocate_Memory(
  72. IN USHORT CIndex
  73. );
  74. NTSTATUS
  75. NMP_Deallocate_Memory(
  76. IN USHORT CIndex
  77. );
  78. NTSTATUS
  79. NMP_DoHandshake(
  80. IN USHORT CIndex,
  81. IN USHORT SrvCli
  82. );
  83. NTSTATUS
  84. NMP_Cleanup(
  85. VOID
  86. );
  87. NTSTATUS
  88. NMP_Wait_For_Client(
  89. IN USHORT CIndex
  90. );
  91. NTSTATUS
  92. NMP_Disconnect_Client(
  93. IN USHORT CIndex
  94. );
  95. NTSTATUS
  96. NMP_ReadFromIPC(
  97. IN USHORT CIndex,
  98. IN OUT PULONG pReadDone,
  99. IN USHORT SrvCli
  100. );
  101. NTSTATUS
  102. NMP_WriteToIPC(
  103. IN USHORT CIndex,
  104. IN OUT PULONG pWriteDone,
  105. IN USHORT SrvCli
  106. );
  107. NTSTATUS
  108. NMP_XactIO(
  109. IN USHORT CIndex,
  110. IN OUT PULONG pReadDone,
  111. IN OUT PULONG pWriteDone,
  112. IN USHORT SrvCli,
  113. IN BOOLEAN FirstIter
  114. );
  115. NTSTATUS
  116. NMP_ThreadCleanUp(
  117. IN USHORT CIndex
  118. );
  119. /************************************************************************/
  120. // External function prototypes
  121. /************************************************************************/
  122. extern LPCSTR pipeName;
  123. extern ULONG Quotas;
  124. extern ULONG PipeType;
  125. extern ULONG PipeMode;
  126. extern ULONG BlockorNot;
  127. extern struct client Clients[MAXCLIENTS]; // all the client data
  128. extern USHORT NClients;
  129.