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.

201 lines
3.5 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. neckbrep.h
  5. Abstract:
  6. This module contains the common private declarations for the auto-key-repeat
  7. driver.
  8. Author:
  9. Hideki Miura
  10. Environment:
  11. kernel mode only
  12. Notes:
  13. Revision History:
  14. --*/
  15. #ifndef NECKBREP_H
  16. #define NECKBREP_H
  17. #include "ntddk.h"
  18. #include <ntddkbd.h>
  19. #include "kbdmou.h"
  20. #define KBSTUFF_POOL_TAG (ULONG) 'prKN'
  21. #undef ExAllocatePool
  22. #define ExAllocatePool(type, size) \
  23. ExAllocatePoolWithTag (type, size, KBSTUFF_POOL_TAG)
  24. //#pragma warning(error:4100) // Unreferenced formal parameter
  25. //#pragma warning(error:4705) // Statement has no effect
  26. #if DBG
  27. #define TRAP() DbgBreakPoint()
  28. #define DbgRaiseIrql(_x_,_y_) KeRaiseIrql(_x_,_y_)
  29. #define DbgLowerIrql(_x_) KeLowerIrql(_x_)
  30. #define Print(_x_) DbgPrint _x_;
  31. #else // DBG
  32. #define TRAP()
  33. #define DbgRaiseIrql(_x_,_y_)
  34. #define DbgLowerIrql(_x_)
  35. #define Print(_x_)
  36. #endif
  37. #define MIN(_A_,_B_) (((_A_) < (_B_)) ? (_A_) : (_B_))
  38. typedef struct _DEVICE_EXTENSION
  39. {
  40. //
  41. // A backpointer to the device object for which this is the extension
  42. //
  43. PDEVICE_OBJECT Self;
  44. //
  45. // "THE PDO" (ejected by the root bus or ACPI)
  46. //
  47. PDEVICE_OBJECT PDO;
  48. //
  49. // The top of the stack before this filter was added. AKA the location
  50. // to which all IRPS should be directed.
  51. //
  52. PDEVICE_OBJECT TopOfStack;
  53. //
  54. // Number of creates sent down
  55. //
  56. LONG EnableCount;
  57. //
  58. // The real connect data that this driver reports to
  59. //
  60. CONNECT_DATA UpperConnectData;
  61. //
  62. // current power state of the device
  63. //
  64. DEVICE_POWER_STATE DeviceState;
  65. BOOLEAN Started;
  66. BOOLEAN Removed;
  67. //
  68. // A input data to do the autorepeat.
  69. //
  70. KEYBOARD_INPUT_DATA KbRepeatInput;
  71. //
  72. // A timer DPC to do the autorepeat.
  73. //
  74. KDPC KbRepeatDPC;
  75. KTIMER KbRepeatTimer;
  76. LARGE_INTEGER KbRepeatDelay;
  77. LONG KbRepeatRate;
  78. } DEVICE_EXTENSION, *PDEVICE_EXTENSION;
  79. //
  80. // Default Typematic Parameters.
  81. //
  82. #define KEYBOARD_TYPEMATIC_RATE_DEFAULT 30
  83. #define KEYBOARD_TYPEMATIC_DELAY_DEFAULT 250
  84. //
  85. // Prototypes
  86. //
  87. NTSTATUS
  88. DriverEntry (
  89. IN PDRIVER_OBJECT DriverObject,
  90. IN PUNICODE_STRING RegistryPath
  91. );
  92. NTSTATUS
  93. KbRepeatAddDevice(
  94. IN PDRIVER_OBJECT DriverObject,
  95. IN PDEVICE_OBJECT BusDeviceObject
  96. );
  97. NTSTATUS
  98. KbRepeatComplete(
  99. IN PDEVICE_OBJECT DeviceObject,
  100. IN PIRP Irp,
  101. IN PVOID Context
  102. );
  103. NTSTATUS
  104. KbRepeatCreateClose (
  105. IN PDEVICE_OBJECT DeviceObject,
  106. IN PIRP Irp
  107. );
  108. NTSTATUS
  109. KbRepeatDispatchPassThrough(
  110. IN PDEVICE_OBJECT DeviceObject,
  111. IN PIRP Irp
  112. );
  113. NTSTATUS
  114. KbRepeatInternIoCtl (
  115. IN PDEVICE_OBJECT DeviceObject,
  116. IN PIRP Irp
  117. );
  118. NTSTATUS
  119. KbRepeatPnP (
  120. IN PDEVICE_OBJECT DeviceObject,
  121. IN PIRP Irp
  122. );
  123. NTSTATUS
  124. KbRepeatPower (
  125. IN PDEVICE_OBJECT DeviceObject,
  126. IN PIRP Irp
  127. );
  128. VOID
  129. KbRepeatServiceCallback(
  130. IN PDEVICE_OBJECT DeviceObject,
  131. IN PKEYBOARD_INPUT_DATA InputDataStart,
  132. IN PKEYBOARD_INPUT_DATA InputDataEnd,
  133. IN OUT PULONG InputDataConsumed
  134. );
  135. VOID
  136. KbRepeatUnload (
  137. IN PDRIVER_OBJECT DriverObject
  138. );
  139. VOID
  140. KbRepeatDpc(
  141. IN PKDPC DPC,
  142. IN PVOID DeferredContext,
  143. IN PVOID SystemArgument1,
  144. IN PVOID SystemArgument2
  145. );
  146. VOID
  147. KbdInitializeTypematic(
  148. IN PDEVICE_EXTENSION devExt
  149. );
  150. #endif // NECKBREP_H