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.

167 lines
5.9 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. ntddpar.h
  5. Abstract:
  6. This is the include file that defines all constants and types for
  7. accessing the Parallel device.
  8. Author:
  9. Steve Wood (stevewo) 27-May-1990
  10. Revision History:
  11. --*/
  12. //
  13. // Interface GUID
  14. //
  15. //
  16. // need these GUIDs outside conditional includes so that user can
  17. // #include <ntddpar.h> in precompiled header
  18. // #include <initguid.h> in a single source file
  19. // #include <ntddpar.h> in that source file a second time to instantiate the GUIDs
  20. //
  21. // #ifdef WANT_WDM
  22. #ifndef FAR
  23. #define FAR
  24. #endif
  25. #ifdef DEFINE_GUID
  26. DEFINE_GUID(GUID_DEVINTERFACE_PARALLEL, 0x97F76EF0, 0xF883, 0x11D0, 0xAF, 0x1F, 0x00, 0x00, 0xF8, 0x00, 0x84, 0x5C);
  27. DEFINE_GUID(GUID_DEVINTERFACE_PARCLASS, 0x811FC6A5, 0xF728, 0x11D0, 0xA5, 0x37, 0x00, 0x00, 0xF8, 0x75, 0x3E, 0xD1);
  28. //
  29. // Obsolete device interface class GUID names.
  30. // (use of above GUID_DEVINTERFACE_* names is recommended).
  31. //
  32. #define GUID_PARALLEL_DEVICE GUID_DEVINTERFACE_PARALLEL
  33. #define GUID_PARCLASS_DEVICE GUID_DEVINTERFACE_PARCLASS
  34. #endif
  35. // #endif
  36. #ifndef _NTDDPAR_
  37. #define _NTDDPAR_
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif
  41. //
  42. // NtDeviceIoControlFile IoControlCode values for this device.
  43. //
  44. // Warning: Remember that the low two bits of the code specify how the
  45. // buffers are passed to the driver!
  46. //
  47. #define IOCTL_PAR_BASE FILE_DEVICE_PARALLEL_PORT
  48. #define IOCTL_PAR_QUERY_INFORMATION CTL_CODE(FILE_DEVICE_PARALLEL_PORT,1,METHOD_BUFFERED,FILE_ANY_ACCESS)
  49. #define IOCTL_PAR_SET_INFORMATION CTL_CODE(FILE_DEVICE_PARALLEL_PORT,2,METHOD_BUFFERED,FILE_ANY_ACCESS)
  50. //
  51. // Returns NULL terminated device ID string
  52. //
  53. #define IOCTL_PAR_QUERY_DEVICE_ID CTL_CODE(FILE_DEVICE_PARALLEL_PORT,3,METHOD_BUFFERED,FILE_ANY_ACCESS)
  54. //
  55. // Returns buffer size required for a call to IOCTL_PAR_QUERY_DEVICE_ID
  56. // to succeed. This includes device ID size plus space for terminating NULL.
  57. //
  58. #define IOCTL_PAR_QUERY_DEVICE_ID_SIZE CTL_CODE(FILE_DEVICE_PARALLEL_PORT,4,METHOD_BUFFERED,FILE_ANY_ACCESS)
  59. #define IOCTL_IEEE1284_GET_MODE CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 5, METHOD_BUFFERED, FILE_ANY_ACCESS)
  60. #define IOCTL_IEEE1284_NEGOTIATE CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
  61. #define IOCTL_PAR_SET_WRITE_ADDRESS CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
  62. #define IOCTL_PAR_SET_READ_ADDRESS CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
  63. #define IOCTL_PAR_GET_DEVICE_CAPS CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 9, METHOD_BUFFERED, FILE_ANY_ACCESS)
  64. #define IOCTL_PAR_GET_DEFAULT_MODES CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 10, METHOD_BUFFERED, FILE_ANY_ACCESS)
  65. #define IOCTL_PAR_PING CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 11, METHOD_BUFFERED, FILE_ANY_ACCESS)
  66. //
  67. // Similar to IOCTL_PAR_QUERY_DEVICE_ID above, but includes (i.e., does
  68. // not discard) the two byte size prefix returned by the device.
  69. //
  70. #define IOCTL_PAR_QUERY_RAW_DEVICE_ID CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
  71. #define IOCTL_PAR_ECP_HOST_RECOVERY CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 13, METHOD_BUFFERED, FILE_ANY_ACCESS)
  72. #define IOCTL_PAR_GET_READ_ADDRESS CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 14, METHOD_BUFFERED, FILE_ANY_ACCESS)
  73. #define IOCTL_PAR_GET_WRITE_ADDRESS CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
  74. #define IOCTL_PAR_TEST CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 20, METHOD_BUFFERED, FILE_ANY_ACCESS)
  75. #define IOCTL_PAR_IS_PORT_FREE CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 21, METHOD_BUFFERED, FILE_ANY_ACCESS)
  76. // returns Location of the port - generally of the form: LPTx or LPTx.y or LPTx.y-z
  77. #define IOCTL_PAR_QUERY_LOCATION CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 22, METHOD_BUFFERED, FILE_ANY_ACCESS)
  78. //
  79. // NtDeviceIoControlFile InputBuffer/OutputBuffer record structures for
  80. // this device.
  81. //
  82. typedef struct _PAR_QUERY_INFORMATION{
  83. UCHAR Status;
  84. } PAR_QUERY_INFORMATION, *PPAR_QUERY_INFORMATION;
  85. typedef struct _PAR_SET_INFORMATION{
  86. UCHAR Init;
  87. } PAR_SET_INFORMATION, *PPAR_SET_INFORMATION;
  88. #define PARALLEL_INIT 0x1
  89. #define PARALLEL_AUTOFEED 0x2
  90. #define PARALLEL_PAPER_EMPTY 0x4
  91. #define PARALLEL_OFF_LINE 0x8
  92. #define PARALLEL_POWER_OFF 0x10
  93. #define PARALLEL_NOT_CONNECTED 0x20
  94. #define PARALLEL_BUSY 0x40
  95. #define PARALLEL_SELECTED 0x80
  96. //
  97. // This is the structure returned by IOCTL_PAR_QUERY_DEVICE_ID_SIZE.
  98. //
  99. typedef struct _PAR_DEVICE_ID_SIZE_INFORMATION {
  100. ULONG DeviceIdSize;
  101. } PAR_DEVICE_ID_SIZE_INFORMATION, *PPAR_DEVICE_ID_SIZE_INFORMATION;
  102. //
  103. // These constants are used for usReadMask and usWriteMask components of the
  104. // PARCLASS_NEGOTIATION_MASK structure that is used for:
  105. //
  106. // IOCTL_IEEE1284_NEGOTIATE,
  107. // IOCTL_IEEE1284_GET_MODE, and
  108. // IOCTL_PAR_GET_DEFAULT_MODES.
  109. //
  110. typedef struct _PARCLASS_NEGOTIATION_MASK {
  111. USHORT usReadMask;
  112. USHORT usWriteMask;
  113. } PARCLASS_NEGOTIATION_MASK, *PPARCLASS_NEGOTIATION_MASK;
  114. #define NONE 0x0000
  115. #define CENTRONICS 0x0001 /* Write Only */
  116. #define IEEE_COMPATIBILITY 0x0002 /* Write Only */
  117. #define NIBBLE 0x0004 /* Read Only */
  118. #define CHANNEL_NIBBLE 0x0008 /* Read Only */
  119. #define BYTE_BIDIR 0x0010 /* Read Only */
  120. #define EPP_HW 0x0020
  121. #define EPP_SW 0x0040
  122. #define EPP_ANY 0x0060
  123. #define BOUNDED_ECP 0x0080
  124. #define ECP_HW_NOIRQ 0x0100 /* HWECP PIO */
  125. #define ECP_HW_IRQ 0x0200 /* HWECP with IRQ */
  126. #define ECP_SW 0x0400
  127. #define ECP_ANY 0x0780
  128. #ifdef __cplusplus
  129. }
  130. #endif
  131. #endif // _NTDDPAR_