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.

189 lines
3.6 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. moufiltr.h
  5. Abstract:
  6. This module contains the common private declarations for the mouse
  7. packet filter
  8. Environment:
  9. kernel mode only
  10. Notes:
  11. Revision History:
  12. --*/
  13. #ifndef MOUFILTER_H
  14. #define MOUFILTER_H
  15. #include "ntddk.h"
  16. #include "kbdmou.h"
  17. #include <ntddmou.h>
  18. #include <ntdd8042.h>
  19. #define MOUFILTER_POOL_TAG (ULONG) 'tlFM'
  20. #undef ExAllocatePool
  21. #define ExAllocatePool(type, size) \
  22. ExAllocatePoolWithTag (type, size, MOUFILTER_POOL_TAG)
  23. #if DBG
  24. #define TRAP() DbgBreakPoint()
  25. #define DbgRaiseIrql(_x_,_y_) KeRaiseIrql(_x_,_y_)
  26. #define DbgLowerIrql(_x_) KeLowerIrql(_x_)
  27. #else // DBG
  28. #define TRAP()
  29. #define DbgRaiseIrql(_x_,_y_)
  30. #define DbgLowerIrql(_x_)
  31. #endif
  32. typedef struct _DEVICE_EXTENSION
  33. {
  34. //
  35. // A backpointer to the device object for which this is the extension
  36. //
  37. PDEVICE_OBJECT Self;
  38. //
  39. // "THE PDO" (ejected by the bus)
  40. //
  41. PDEVICE_OBJECT PDO;
  42. //
  43. // The top of the stack before this filter was added. AKA the location
  44. // to which all IRPS should be directed.
  45. //
  46. PDEVICE_OBJECT TopOfStack;
  47. //
  48. // Number of creates sent down
  49. //
  50. LONG EnableCount;
  51. //
  52. // Previous hook routine and context
  53. //
  54. PVOID UpperContext;
  55. PI8042_MOUSE_ISR UpperIsrHook;
  56. //
  57. // Write to the mouse in the context of MouFilter_IsrHook
  58. //
  59. IN PI8042_ISR_WRITE_PORT IsrWritePort;
  60. //
  61. // Context for IsrWritePort, QueueMousePacket
  62. //
  63. IN PVOID CallContext;
  64. //
  65. // Queue the current packet (ie the one passed into MouFilter_IsrHook)
  66. // to be reported to the class driver
  67. //
  68. IN PI8042_QUEUE_PACKET QueueMousePacket;
  69. //
  70. // The real connect data that this driver reports to
  71. //
  72. CONNECT_DATA UpperConnectData;
  73. //
  74. // current power state of the device
  75. //
  76. DEVICE_POWER_STATE DeviceState;
  77. //
  78. // State of the stack and this device object
  79. //
  80. BOOLEAN Started;
  81. BOOLEAN SurpriseRemoved;
  82. BOOLEAN Removed;
  83. } DEVICE_EXTENSION, *PDEVICE_EXTENSION;
  84. //
  85. // Prototypes
  86. //
  87. NTSTATUS
  88. MouFilter_AddDevice(
  89. IN PDRIVER_OBJECT DriverObject,
  90. IN PDEVICE_OBJECT BusDeviceObject
  91. );
  92. NTSTATUS
  93. MouFilter_CreateClose (
  94. IN PDEVICE_OBJECT DeviceObject,
  95. IN PIRP Irp
  96. );
  97. NTSTATUS
  98. MouFilter_DispatchPassThrough(
  99. IN PDEVICE_OBJECT DeviceObject,
  100. IN PIRP Irp
  101. );
  102. NTSTATUS
  103. MouFilter_InternIoCtl (
  104. IN PDEVICE_OBJECT DeviceObject,
  105. IN PIRP Irp
  106. );
  107. NTSTATUS
  108. MouFilter_IoCtl (
  109. IN PDEVICE_OBJECT DeviceObject,
  110. IN PIRP Irp
  111. );
  112. NTSTATUS
  113. MouFilter_PnP (
  114. IN PDEVICE_OBJECT DeviceObject,
  115. IN PIRP Irp
  116. );
  117. NTSTATUS
  118. MouFilter_Power (
  119. IN PDEVICE_OBJECT DeviceObject,
  120. IN PIRP Irp
  121. );
  122. BOOLEAN
  123. MouFilter_IsrHook (
  124. PDEVICE_OBJECT DeviceObject,
  125. PMOUSE_INPUT_DATA CurrentInput,
  126. POUTPUT_PACKET CurrentOutput,
  127. UCHAR StatusByte,
  128. PUCHAR DataByte,
  129. PBOOLEAN ContinueProcessing,
  130. PMOUSE_STATE MouseState,
  131. PMOUSE_RESET_SUBSTATE ResetSubState
  132. );
  133. VOID
  134. MouFilter_ServiceCallback(
  135. IN PDEVICE_OBJECT DeviceObject,
  136. IN PMOUSE_INPUT_DATA InputDataStart,
  137. IN PMOUSE_INPUT_DATA InputDataEnd,
  138. IN OUT PULONG InputDataConsumed
  139. );
  140. VOID
  141. MouFilter_Unload (
  142. IN PDRIVER_OBJECT DriverObject
  143. );
  144. #endif // MOUFILTER_H