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.

236 lines
4.7 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. nec98kbd.h
  5. Abstract:
  6. This module contains the common private declarations for the NEC98 layout keyboard driver.
  7. Author:
  8. Hideki Miura(NEC)
  9. Environment:
  10. kernel mode only
  11. Notes:
  12. Revision History:
  13. --*/
  14. #ifndef NECKBADD_H
  15. #define NECKBADD_H
  16. #include "ntddk.h"
  17. #include <ntddkbd.h>
  18. #include "kbdmou.h"
  19. #define NECKBADD_POOL_TAG (ULONG) 'dabK'
  20. #undef ExAllocatePool
  21. #define ExAllocatePool(type, size) \
  22. ExAllocatePoolWithTag (type, size, NECKBADD_POOL_TAG)
  23. //#pragma warning(error:4100) // Unreferenced formal parameter
  24. //#pragma warning(error:4705) // Statement has no effect
  25. #define MIN(_A_,_B_) (((_A_) < (_B_)) ? (_A_) : (_B_))
  26. #if DBG
  27. BOOLEAN DebugFlags = 1;
  28. #define Print(_X_) \
  29. if (DebugFlags) { \
  30. DbgPrint _X_; \
  31. }
  32. #define CLASSSERVICE_CALLBACK(_X_, _Y_) \
  33. (*(PSERVICE_CALLBACK_ROUTINE) devExt->UpperConnectData.ClassService)( \
  34. devExt->UpperConnectData.ClassDeviceObject, \
  35. _X_, \
  36. _Y_, \
  37. InputDataConsumed);
  38. // Print(("NecKbdServiceCallback: flushing %8x - %8x\n", _X_, _Y_));
  39. #else
  40. #define Print(_X_)
  41. #define CLASSSERVICE_CALLBACK(_X_, _Y_) \
  42. (*(PSERVICE_CALLBACK_ROUTINE) devExt->UpperConnectData.ClassService)( \
  43. devExt->UpperConnectData.ClassDeviceObject, \
  44. _X_, \
  45. _Y_, \
  46. InputDataConsumed);
  47. #endif
  48. typedef struct _DEVICE_EXTENSION
  49. {
  50. //
  51. // A backpointer to the device object for which this is the extension
  52. //
  53. PDEVICE_OBJECT Self;
  54. //
  55. // "THE PDO" (ejected by the root bus or ACPI)
  56. //
  57. PDEVICE_OBJECT PDO;
  58. //
  59. // The top of the stack before this filter was added. AKA the location
  60. // to which all IRPS should be directed.
  61. //
  62. PDEVICE_OBJECT TopOfStack;
  63. //
  64. // Number of creates sent down
  65. //
  66. LONG EnableCount;
  67. //
  68. // The real connect data that this driver reports to
  69. //
  70. CONNECT_DATA UpperConnectData;
  71. //
  72. // current power state of the device
  73. //
  74. DEVICE_POWER_STATE DeviceState;
  75. BOOLEAN Started;
  76. BOOLEAN Removed;
  77. //
  78. //
  79. //
  80. ULONG KeyStatusFlags;
  81. //
  82. //
  83. //
  84. KEYBOARD_INPUT_DATA CachedInputData;
  85. } DEVICE_EXTENSION, *PDEVICE_EXTENSION;
  86. //
  87. // define the scancodes
  88. //
  89. #define CTRL_KEY 0x1d
  90. #define HANKAKU_ZENKAKU_KEY 0x29
  91. #define SHIFT_KEY 0x2a
  92. #define CAPS_KEY 0x3a
  93. #define COPY_KEY 0x37
  94. #define PRINT_SCREEN_KEY 0x37
  95. #define PAUSE_KEY 0x45
  96. #define NUMLOCK_KEY 0x45 // +E0
  97. #define STOP_KEY 0x46 // +E0
  98. #define SCROLL_LOCK_KEY 0x46
  99. #define VF3_KEY 0x5D
  100. #define VF4_KEY 0x5E
  101. #define VF5_KEY 0x5F
  102. #define KANA_KEY 0x70
  103. //
  104. //
  105. //
  106. #define CAPS_PRESSING 0x00000001
  107. #define KANA_PRESSING 0x00000002
  108. #define STOP_PREFIX 0x00000004
  109. #define STOP_PRESSING 0x00000008
  110. #define COPY_PREFIX 0x00000010
  111. #define COPY_PRESSING 0x00000020
  112. //
  113. // Some strings by the driver
  114. //
  115. const PWSTR pwParameters = L"\\Parameters";
  116. const PWSTR pwVfKeyEmulation = L"VfKeyEmulation";
  117. //
  118. // Variables
  119. //
  120. //
  121. // VfKey Emulation Flag
  122. // if FALSE(emulation off), vf3 -> F13, vf4 -> F14, vf5 -> F15
  123. // if TRUE(emulation on), vf3 -> NumLock, vf4 -> ScrollLock, vf5 -> Hankaku/Zenkaku
  124. //
  125. BOOLEAN VfKeyEmulation;
  126. //
  127. // Prototypes
  128. //
  129. NTSTATUS
  130. DriverEntry (
  131. IN PDRIVER_OBJECT DriverObject,
  132. IN PUNICODE_STRING RegistryPath
  133. );
  134. NTSTATUS
  135. NecKbdAddDevice(
  136. IN PDRIVER_OBJECT DriverObject,
  137. IN PDEVICE_OBJECT BusDeviceObject
  138. );
  139. NTSTATUS
  140. NecKbdComplete(
  141. IN PDEVICE_OBJECT DeviceObject,
  142. IN PIRP Irp,
  143. IN PVOID Context
  144. );
  145. NTSTATUS
  146. NecKbdCreateClose (
  147. IN PDEVICE_OBJECT DeviceObject,
  148. IN PIRP Irp
  149. );
  150. NTSTATUS
  151. NecKbdDispatchPassThrough(
  152. IN PDEVICE_OBJECT DeviceObject,
  153. IN PIRP Irp
  154. );
  155. NTSTATUS
  156. NecKbdInternIoCtl (
  157. IN PDEVICE_OBJECT DeviceObject,
  158. IN PIRP Irp
  159. );
  160. NTSTATUS
  161. NecKbdPnP (
  162. IN PDEVICE_OBJECT DeviceObject,
  163. IN PIRP Irp
  164. );
  165. NTSTATUS
  166. NecKbdPower (
  167. IN PDEVICE_OBJECT DeviceObject,
  168. IN PIRP Irp
  169. );
  170. VOID
  171. NecKbdServiceCallback(
  172. IN PDEVICE_OBJECT DeviceObject,
  173. IN PKEYBOARD_INPUT_DATA InputDataStart,
  174. IN PKEYBOARD_INPUT_DATA InputDataEnd,
  175. IN OUT PULONG InputDataConsumed
  176. );
  177. VOID
  178. NecKbdUnload (
  179. IN PDRIVER_OBJECT DriverObject
  180. );
  181. VOID
  182. NecKbdServiceParameters(
  183. IN PUNICODE_STRING RegistryPath
  184. );
  185. #endif // NECKBADD_H