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.

154 lines
5.4 KiB

  1. /*++ BUILD Version: 0004 // Increment this if a change has global effects
  2. Copyright (c) 1992-1999 Microsoft Corporation
  3. Module Name:
  4. devioctl.h
  5. Abstract:
  6. This module contains
  7. Author:
  8. Andre Vachon (andreva) 21-Feb-1992
  9. Revision History:
  10. --*/
  11. // begin_winioctl
  12. #ifndef _DEVIOCTL_
  13. #define _DEVIOCTL_
  14. // begin_ntddk begin_wdm begin_nthal begin_ntifs
  15. //
  16. // Define the various device type values. Note that values used by Microsoft
  17. // Corporation are in the range 0-32767, and 32768-65535 are reserved for use
  18. // by customers.
  19. //
  20. #define DEVICE_TYPE ULONG
  21. #define FILE_DEVICE_BEEP 0x00000001
  22. #define FILE_DEVICE_CD_ROM 0x00000002
  23. #define FILE_DEVICE_CD_ROM_FILE_SYSTEM 0x00000003
  24. #define FILE_DEVICE_CONTROLLER 0x00000004
  25. #define FILE_DEVICE_DATALINK 0x00000005
  26. #define FILE_DEVICE_DFS 0x00000006
  27. #define FILE_DEVICE_DISK 0x00000007
  28. #define FILE_DEVICE_DISK_FILE_SYSTEM 0x00000008
  29. #define FILE_DEVICE_FILE_SYSTEM 0x00000009
  30. #define FILE_DEVICE_INPORT_PORT 0x0000000a
  31. #define FILE_DEVICE_KEYBOARD 0x0000000b
  32. #define FILE_DEVICE_MAILSLOT 0x0000000c
  33. #define FILE_DEVICE_MIDI_IN 0x0000000d
  34. #define FILE_DEVICE_MIDI_OUT 0x0000000e
  35. #define FILE_DEVICE_MOUSE 0x0000000f
  36. #define FILE_DEVICE_MULTI_UNC_PROVIDER 0x00000010
  37. #define FILE_DEVICE_NAMED_PIPE 0x00000011
  38. #define FILE_DEVICE_NETWORK 0x00000012
  39. #define FILE_DEVICE_NETWORK_BROWSER 0x00000013
  40. #define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014
  41. #define FILE_DEVICE_NULL 0x00000015
  42. #define FILE_DEVICE_PARALLEL_PORT 0x00000016
  43. #define FILE_DEVICE_PHYSICAL_NETCARD 0x00000017
  44. #define FILE_DEVICE_PRINTER 0x00000018
  45. #define FILE_DEVICE_SCANNER 0x00000019
  46. #define FILE_DEVICE_SERIAL_MOUSE_PORT 0x0000001a
  47. #define FILE_DEVICE_SERIAL_PORT 0x0000001b
  48. #define FILE_DEVICE_SCREEN 0x0000001c
  49. #define FILE_DEVICE_SOUND 0x0000001d
  50. #define FILE_DEVICE_STREAMS 0x0000001e
  51. #define FILE_DEVICE_TAPE 0x0000001f
  52. #define FILE_DEVICE_TAPE_FILE_SYSTEM 0x00000020
  53. #define FILE_DEVICE_TRANSPORT 0x00000021
  54. #define FILE_DEVICE_UNKNOWN 0x00000022
  55. #define FILE_DEVICE_VIDEO 0x00000023
  56. #define FILE_DEVICE_VIRTUAL_DISK 0x00000024
  57. #define FILE_DEVICE_WAVE_IN 0x00000025
  58. #define FILE_DEVICE_WAVE_OUT 0x00000026
  59. #define FILE_DEVICE_8042_PORT 0x00000027
  60. #define FILE_DEVICE_NETWORK_REDIRECTOR 0x00000028
  61. #define FILE_DEVICE_BATTERY 0x00000029
  62. #define FILE_DEVICE_BUS_EXTENDER 0x0000002a
  63. #define FILE_DEVICE_MODEM 0x0000002b
  64. #define FILE_DEVICE_VDM 0x0000002c
  65. #define FILE_DEVICE_MASS_STORAGE 0x0000002d
  66. #define FILE_DEVICE_SMB 0x0000002e
  67. #define FILE_DEVICE_KS 0x0000002f
  68. #define FILE_DEVICE_CHANGER 0x00000030
  69. #define FILE_DEVICE_SMARTCARD 0x00000031
  70. #define FILE_DEVICE_ACPI 0x00000032
  71. #define FILE_DEVICE_DVD 0x00000033
  72. #define FILE_DEVICE_FULLSCREEN_VIDEO 0x00000034
  73. #define FILE_DEVICE_DFS_FILE_SYSTEM 0x00000035
  74. #define FILE_DEVICE_DFS_VOLUME 0x00000036
  75. #define FILE_DEVICE_SERENUM 0x00000037
  76. #define FILE_DEVICE_TERMSRV 0x00000038
  77. #define FILE_DEVICE_KSEC 0x00000039
  78. #define FILE_DEVICE_FIPS 0x0000003A
  79. #define FILE_DEVICE_INFINIBAND 0x0000003B
  80. //
  81. // Macro definition for defining IOCTL and FSCTL function control codes. Note
  82. // that function codes 0-2047 are reserved for Microsoft Corporation, and
  83. // 2048-4095 are reserved for customers.
  84. //
  85. #define CTL_CODE( DeviceType, Function, Method, Access ) ( \
  86. ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
  87. )
  88. //
  89. // Macro to extract device type out of the device io control code
  90. //
  91. #define DEVICE_TYPE_FROM_CTL_CODE(ctrlCode) (((ULONG)(ctrlCode & 0xffff0000)) >> 16)
  92. //
  93. // Define the method codes for how buffers are passed for I/O and FS controls
  94. //
  95. #define METHOD_BUFFERED 0
  96. #define METHOD_IN_DIRECT 1
  97. #define METHOD_OUT_DIRECT 2
  98. #define METHOD_NEITHER 3
  99. //
  100. // Define some easier to comprehend aliases:
  101. // METHOD_DIRECT_TO_HARDWARE (writes, aka METHOD_IN_DIRECT)
  102. // METHOD_DIRECT_FROM_HARDWARE (reads, aka METHOD_OUT_DIRECT)
  103. //
  104. #define METHOD_DIRECT_TO_HARDWARE METHOD_IN_DIRECT
  105. #define METHOD_DIRECT_FROM_HARDWARE METHOD_OUT_DIRECT
  106. //
  107. // Define the access check value for any access
  108. //
  109. //
  110. // The FILE_READ_ACCESS and FILE_WRITE_ACCESS constants are also defined in
  111. // ntioapi.h as FILE_READ_DATA and FILE_WRITE_DATA. The values for these
  112. // constants *MUST* always be in sync.
  113. //
  114. //
  115. // FILE_SPECIAL_ACCESS is checked by the NT I/O system the same as FILE_ANY_ACCESS.
  116. // The file systems, however, may add additional access checks for I/O and FS controls
  117. // that use this value.
  118. //
  119. #define FILE_ANY_ACCESS 0
  120. #define FILE_SPECIAL_ACCESS (FILE_ANY_ACCESS)
  121. #define FILE_READ_ACCESS ( 0x0001 ) // file & pipe
  122. #define FILE_WRITE_ACCESS ( 0x0002 ) // file & pipe
  123. // end_ntddk end_wdm end_nthal end_ntifs
  124. #endif // _DEVIOCTL_
  125. // end_winioctl