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.

148 lines
4.3 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) 1991-1999 Microsoft Corporation
  3. Module Name:
  4. ntddstrm.h
  5. Abstract:
  6. This header file defines constants and types for accessing the NT
  7. STREAMS environment.
  8. Include the STREAMS header file, <sys/stropts.h>, before this !!
  9. Author:
  10. Eric Chin (ericc) July 2, 1991
  11. Revision History:
  12. --*/
  13. #ifndef _NTDDSTRM_
  14. #define _NTDDSTRM_
  15. #if _MSC_VER > 1000
  16. #pragma once
  17. #endif
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. //
  22. // Device Name - this string is the name of the device. It is the name
  23. // that should be passed to NtOpenFile when accessing the device.
  24. //
  25. #define DD_STREAMS_DEVICE_NAME "\\Device\\Streams"
  26. //
  27. // EA to be used when opening a STREAMS driver for putmsg()/getmsg().
  28. //
  29. #define NormalStreamEA "NormalStream"
  30. #define NORMAL_STREAM_EA_LENGTH (sizeof(NormalStreamEA) - 1)
  31. //
  32. // NtDeviceIoControlFile IoControlCode values for this device.
  33. //
  34. #define _STRM_CTRL_CODE(function, method, access) \
  35. CTL_CODE(FILE_DEVICE_STREAMS, function, method, access)
  36. #define IOCTL_STREAMS_GETMSG _STRM_CTRL_CODE( 0, METHOD_BUFFERED, \
  37. FILE_READ_ACCESS)
  38. #define IOCTL_STREAMS_IOCTL _STRM_CTRL_CODE( 1, METHOD_BUFFERED, \
  39. FILE_ANY_ACCESS)
  40. #define IOCTL_STREAMS_POLL _STRM_CTRL_CODE( 2, METHOD_BUFFERED, \
  41. FILE_ANY_ACCESS)
  42. #define IOCTL_STREAMS_PUTMSG _STRM_CTRL_CODE( 3, METHOD_BUFFERED, \
  43. FILE_WRITE_ACCESS)
  44. #define IOCTL_STREAMS_TDI_TEST _STRM_CTRL_CODE(32, METHOD_BUFFERED, \
  45. FILE_ANY_ACCESS)
  46. struct queue; // forward declaration for ANSI C
  47. /*
  48. * General buffer structure (putmsg, getmsg, etc)
  49. */
  50. struct strbuf {
  51. int maxlen; /* no. of bytes in buffer */
  52. int len; /* no. of bytes returned */
  53. char *buf; /* pointer to data */
  54. };
  55. /*
  56. * General ioctl
  57. */
  58. struct strioctl {
  59. int ic_cmd; /* command */
  60. int ic_timout; /* timeout value */
  61. int ic_len; /* length of data */
  62. char *ic_dp; /* pointer to data */
  63. };
  64. //
  65. // NtDeviceIoControlFile InputBuffer/OutputBuffer Record Structures
  66. //
  67. //
  68. typedef struct _GETMSG_ARGS_INOUT_ { // getmsg()
  69. int a_retval; // return value
  70. long a_flags; // 0 or RS_HIPRI
  71. struct strbuf a_ctlbuf; // (required)
  72. struct strbuf a_databuf; // (required)
  73. char a_stuff[1]; // a_ctlbuf.buf (optional)
  74. // a_databuf.buf (optional)
  75. } GETMSG_ARGS_INOUT, *PGETMSG_ARGS_INOUT;
  76. typedef struct _ISTR_ARGS_INOUT { // ioctl(I_STR)
  77. int a_iocode; // I_STR, retval on return
  78. struct strioctl a_strio; // (required)
  79. int a_unused[2]; // (required)
  80. char a_stuff[1]; // (optional)
  81. } ISTR_ARGS_INOUT, *PISTR_ARGS_INOUT;
  82. typedef struct _PUTMSG_ARGS_IN_ { // ioctl(I_FDINSERT) and putmsg()
  83. int a_iocode; // I_FDINSERT or 0
  84. long a_flags; // 0 or RS_HIPRI
  85. struct strbuf a_ctlbuf; // (required)
  86. struct strbuf a_databuf; // (required)
  87. union { // used only for I_FDINSERT
  88. HANDLE i_fildes; // (optional)
  89. struct queue * i_targetq; // for Stream Head Driver use
  90. } a_insert;
  91. int a_offset; // (optional)
  92. char a_stuff[1]; // a_ctlbuf.buf (optional)
  93. // a_databuf.buf (optional)
  94. } PUTMSG_ARGS_IN, *PPUTMSG_ARGS_IN;
  95. typedef struct _STRM_ARGS_OUT_ { // generic return parameters
  96. int a_retval; // return value
  97. int a_errno; // errno if retval == -1
  98. } STRM_ARGS_OUT, *PSTRM_ARGS_OUT;
  99. #ifdef __cplusplus
  100. }
  101. #endif
  102. #endif // ifndef _NTDDSTRM_