kbdmou.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * kbdmou.h
  3. *
  4. * Structures and definitions for Keyboard/Mouse class and port drivers.
  5. *
  6. * This file is part of the w32api package.
  7. *
  8. * Contributors:
  9. * Created by Filip Navara <xnavara@volny.cz>
  10. *
  11. * THIS SOFTWARE IS NOT COPYRIGHTED
  12. *
  13. * This source code is offered for use in the public domain. You may
  14. * use, modify or distribute it freely.
  15. *
  16. * This code is distributed in the hope that it will be useful but
  17. * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
  18. * DISCLAIMED. This includes but is not limited to warranties of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  20. *
  21. */
  22. #pragma once
  23. #define _KBDMOU_
  24. #include <ntddkbd.h>
  25. #include <ntddmou.h>
  26. #define DD_KEYBOARD_PORT_DEVICE_NAME "\\Device\\KeyboardPort"
  27. #define DD_KEYBOARD_PORT_DEVICE_NAME_U L"\\Device\\KeyboardPort"
  28. #define DD_KEYBOARD_PORT_BASE_NAME_U L"KeyboardPort"
  29. #define DD_POINTER_PORT_DEVICE_NAME "\\Device\\PointerPort"
  30. #define DD_POINTER_PORT_DEVICE_NAME_U L"\\Device\\PointerPort"
  31. #define DD_POINTER_PORT_BASE_NAME_U L"PointerPort"
  32. #define DD_KEYBOARD_CLASS_BASE_NAME_U L"KeyboardClass"
  33. #define DD_POINTER_CLASS_BASE_NAME_U L"PointerClass"
  34. #define DD_KEYBOARD_RESOURCE_CLASS_NAME_U L"Keyboard"
  35. #define DD_POINTER_RESOURCE_CLASS_NAME_U L"Pointer"
  36. #define DD_KEYBOARD_MOUSE_COMBO_RESOURCE_CLASS_NAME_U L"Keyboard/Pointer"
  37. #define POINTER_PORTS_MAXIMUM 8
  38. #define KEYBOARD_PORTS_MAXIMUM 8
  39. #define KBDMOU_COULD_NOT_SEND_COMMAND 0x0000
  40. #define KBDMOU_COULD_NOT_SEND_PARAM 0x0001
  41. #define KBDMOU_NO_RESPONSE 0x0002
  42. #define KBDMOU_INCORRECT_RESPONSE 0x0004
  43. #define I8042_ERROR_VALUE_BASE 1000
  44. #define INPORT_ERROR_VALUE_BASE 2000
  45. #define SERIAL_MOUSE_ERROR_VALUE_BASE 3000
  46. #define IOCTL_INTERNAL_KEYBOARD_CONNECT \
  47. CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0080, METHOD_NEITHER, FILE_ANY_ACCESS)
  48. #define IOCTL_INTERNAL_KEYBOARD_DISCONNECT \
  49. CTL_CODE(FILE_DEVICE_KEYBOARD,0x0100, METHOD_NEITHER, FILE_ANY_ACCESS)
  50. #define IOCTL_INTERNAL_KEYBOARD_ENABLE \
  51. CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0200, METHOD_NEITHER, FILE_ANY_ACCESS)
  52. #define IOCTL_INTERNAL_KEYBOARD_DISABLE \
  53. CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0400, METHOD_NEITHER, FILE_ANY_ACCESS)
  54. #define IOCTL_INTERNAL_MOUSE_CONNECT \
  55. CTL_CODE(FILE_DEVICE_MOUSE, 0x0080, METHOD_NEITHER, FILE_ANY_ACCESS)
  56. #define IOCTL_INTERNAL_MOUSE_DISCONNECT \
  57. CTL_CODE(FILE_DEVICE_MOUSE, 0x0100, METHOD_NEITHER, FILE_ANY_ACCESS)
  58. #define IOCTL_INTERNAL_MOUSE_ENABLE \
  59. CTL_CODE(FILE_DEVICE_MOUSE, 0x0200, METHOD_NEITHER, FILE_ANY_ACCESS)
  60. #define IOCTL_INTERNAL_MOUSE_DISABLE \
  61. CTL_CODE(FILE_DEVICE_MOUSE, 0x0400, METHOD_NEITHER, FILE_ANY_ACCESS)
  62. typedef struct _CONNECT_DATA {
  63. PDEVICE_OBJECT ClassDeviceObject;
  64. PVOID ClassService;
  65. } CONNECT_DATA, *PCONNECT_DATA;
  66. typedef VOID
  67. (STDAPICALLTYPE *PSERVICE_CALLBACK_ROUTINE)(
  68. IN PVOID NormalContext,
  69. IN PVOID SystemArgument1,
  70. IN PVOID SystemArgument2,
  71. IN OUT PVOID SystemArgument3);
  72. #include <wmidata.h>