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.

128 lines
2.0 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. // Local function used inside the driver. They are enclosed
  47. // in #ifdef _NTDDK_ so that user mode program including the header
  48. // are not affected by this.
  49. //
  50. #ifdef _NTDDK_
  51. NTSTATUS
  52. TdDeviceCreate (
  53. PDEVICE_OBJECT DeviceObject,
  54. PIRP Irp);
  55. NTSTATUS
  56. TdDeviceClose (
  57. PDEVICE_OBJECT DeviceObject,
  58. PIRP Irp);
  59. NTSTATUS
  60. TdDeviceCleanup (
  61. PDEVICE_OBJECT DeviceObject,
  62. PIRP Irp);
  63. NTSTATUS
  64. TdDeviceControl (
  65. IN PDEVICE_OBJECT DeviceObject,
  66. IN PIRP Irp);
  67. VOID
  68. TdDeviceUnload (
  69. IN PDRIVER_OBJECT DriverObject);
  70. NTSTATUS
  71. TdInvalidDeviceRequest(
  72. IN PDEVICE_OBJECT DeviceObject,
  73. IN PIRP Irp
  74. );
  75. #endif // #ifdef _NTDDK_
  76. //
  77. // Type:
  78. //
  79. // TD_DRIVER_INFO
  80. //
  81. // Description:
  82. //
  83. // This is the driver device extension structure.
  84. //
  85. typedef struct {
  86. ULONG Dummy;
  87. } TD_DRIVER_INFO, * PTD_DRIVER_INFO;
  88. #endif // #ifndef _TDRIVER_H_INCLUDED_
  89. //
  90. // End of file
  91. //