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.

137 lines
2.3 KiB

  1. //
  2. // Template driver
  3. // Copyright (c) Microsoft Corporation, 1999.
  4. //
  5. // Header: tdriver.h
  6. // Author: Silviu Calinoiu (SilviuC)
  7. // Created: 4/20/1999 3:04pm
  8. //
  9. #ifndef _TDRIVER_H_INCLUDED_
  10. #define _TDRIVER_H_INCLUDED_
  11. //
  12. // Structure received from user-mode with the
  13. // bugcheck number and parameters
  14. //
  15. typedef struct _tag_BUGCHECK_PARAMS
  16. {
  17. ULONG BugCheckCode;
  18. ULONG_PTR BugCheckParameters[ 4 ];
  19. } BUGCHECK_PARAMS, *PBUGCHECK_PARAMS;
  20. //
  21. // Structure receoved from user mode with the parameters
  22. // for a "read" operation in TdReservedMappingDoRead
  23. //
  24. typedef struct _tag_USER_READ_BUFFER
  25. {
  26. PVOID UserBuffer;
  27. SIZE_T UserBufferSize;
  28. } USER_READ_BUFFER, *PUSER_READ_BUFFER;
  29. //
  30. // Device name. This should end in the of the driver.
  31. //
  32. #define TD_NT_DEVICE_NAME L"\\Device\\buggy"
  33. #define TD_DOS_DEVICE_NAME L"\\DosDevices\\buggy"
  34. #define TD_POOL_TAG '_guB' // Bug_
  35. //
  36. // Constants used in the user-mode driver controller.
  37. //
  38. #define TD_DRIVER_NAME TEXT("buggydriver")
  39. //
  40. // Array length macro
  41. //
  42. #ifndef ARRAY_LENGTH
  43. #define ARRAY_LENGTH( array ) ( sizeof( array ) / sizeof( array[ 0 ] ) )
  44. #endif //#ifndef ARRAY_LENGTH
  45. //
  46. //
  47. //
  48. #ifndef SESSION_POOL_MASK
  49. #define SESSION_POOL_MASK 32
  50. #endif //#ifndef SESSION_POOL_MASK
  51. //
  52. // Local function used inside the driver. They are enclosed
  53. // in #ifdef _NTDDK_ so that user mode program including the header
  54. // are not affected by this.
  55. //
  56. #ifdef _NTDDK_
  57. NTSTATUS
  58. TdDeviceCreate (
  59. PDEVICE_OBJECT DeviceObject,
  60. PIRP Irp);
  61. NTSTATUS
  62. TdDeviceClose (
  63. PDEVICE_OBJECT DeviceObject,
  64. PIRP Irp);
  65. NTSTATUS
  66. TdDeviceCleanup (
  67. PDEVICE_OBJECT DeviceObject,
  68. PIRP Irp);
  69. NTSTATUS
  70. TdDeviceControl (
  71. IN PDEVICE_OBJECT DeviceObject,
  72. IN PIRP Irp);
  73. VOID
  74. TdDeviceUnload (
  75. IN PDRIVER_OBJECT DriverObject);
  76. NTSTATUS
  77. TdInvalidDeviceRequest(
  78. IN PDEVICE_OBJECT DeviceObject,
  79. IN PIRP Irp
  80. );
  81. #endif // #ifdef _NTDDK_
  82. //
  83. // Type:
  84. //
  85. // TD_DRIVER_INFO
  86. //
  87. // Description:
  88. //
  89. // This is the driver device extension structure.
  90. //
  91. typedef struct {
  92. ULONG Dummy;
  93. } TD_DRIVER_INFO, * PTD_DRIVER_INFO;
  94. #endif // #ifndef _TDRIVER_H_INCLUDED_
  95. //
  96. // End of file
  97. //