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.

164 lines
5.8 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 to construct the mask for the negotiation IOCTL.
  104. // These need to be moved to ntddpar.h so that they are available to User Mode...
  105. // IOCTL_INTERNAL_IEEE1284_NEGOTIATE.
  106. //
  107. typedef struct _PARCLASS_NEGOTIATION_MASK {
  108. USHORT usReadMask;
  109. USHORT usWriteMask;
  110. } PARCLASS_NEGOTIATION_MASK, *PPARCLASS_NEGOTIATION_MASK;
  111. #define NONE 0x0000
  112. #define CENTRONICS 0x0001 /* Write Only */
  113. #define IEEE_COMPATIBILITY 0x0002 /* Write Only */
  114. #define NIBBLE 0x0004 /* Read Only */
  115. #define CHANNEL_NIBBLE 0x0008 /* Read Only */
  116. #define BYTE_BIDIR 0x0010 /* Read Only */
  117. #define EPP_HW 0x0020
  118. #define EPP_SW 0x0040
  119. #define EPP_ANY 0x0060
  120. #define BOUNDED_ECP 0x0080
  121. #define ECP_HW_NOIRQ 0x0100 /* HWECP PIO */
  122. #define ECP_HW_IRQ 0x0200 /* HWECP with IRQ */
  123. #define ECP_SW 0x0400
  124. #define ECP_ANY 0x0780
  125. #ifdef __cplusplus
  126. }
  127. #endif
  128. #endif // _NTDDPAR_