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.

174 lines
3.7 KiB

  1. /*++
  2. Copyright (c) 1991 - 2001 Microsoft Corporation
  3. Module Name:
  4. ## ## ##### ## ## ##### ### ##### #### ##### #####
  5. ## ## ## ## ## ## ## ### ## ## ## # ## ## ## ##
  6. #### ## #### ## ## ## ## ## ## ## ## ## ## ##
  7. ### ##### #### ## ## ## ## ## ## ## ## ## ## ##
  8. #### ## ## ##### ####### ## ## ## ##### #####
  9. ## ## ## ## ## ## ## ## ## ## ## # ## ##
  10. ## ## ##### ## ## ## ## ##### ## #### ## ##
  11. Abstract:
  12. This module contains functions specfic to the
  13. keypad device. The logic in this module is not
  14. hardware specific, but is logic that is common
  15. to all hardware implementations.
  16. Author:
  17. Wesley Witt (wesw) 1-Oct-2001
  18. Environment:
  19. Kernel mode only.
  20. Notes:
  21. --*/
  22. #include "internal.h"
  23. NTSTATUS
  24. SaKeypadDeviceInitialization(
  25. IN PSAPORT_DRIVER_EXTENSION DriverExtension
  26. )
  27. /*++
  28. Routine Description:
  29. This is the keypad specific code for driver initialization.
  30. This function is called by SaPortInitialize, which is called by
  31. the keypad driver's DriverEntry function.
  32. Arguments:
  33. DriverExtension - Driver extension structure
  34. Return Value:
  35. NT status code.
  36. --*/
  37. {
  38. UNREFERENCED_PARAMETER(DriverExtension);
  39. return STATUS_SUCCESS;
  40. }
  41. NTSTATUS
  42. SaKeypadIoValidation(
  43. IN PKEYPAD_DEVICE_EXTENSION DeviceExtension,
  44. IN PIRP Irp,
  45. PIO_STACK_LOCATION IrpSp
  46. )
  47. /*++
  48. Routine Description:
  49. This is the keypad specific code for processing all I/O validation for reads and writes.
  50. Arguments:
  51. DeviceExtension - Display device extension
  52. Irp - Pointer to an IRP structure that describes the requested I/O operation.
  53. IrpSp - Irp stack pointer
  54. Return Value:
  55. NT status code.
  56. --*/
  57. {
  58. ULONG Length;
  59. UNREFERENCED_PARAMETER(DeviceExtension);
  60. UNREFERENCED_PARAMETER(Irp);
  61. if (IrpSp->MajorFunction == IRP_MJ_READ) {
  62. Length = (ULONG)IrpSp->Parameters.Read.Length;
  63. } else if (IrpSp->MajorFunction == IRP_MJ_WRITE) {
  64. Length = (ULONG)IrpSp->Parameters.Write.Length;
  65. } else {
  66. REPORT_ERROR( DeviceExtension->DeviceType, "Invalid I/O request", STATUS_INVALID_PARAMETER_1 );
  67. return STATUS_INVALID_PARAMETER_1;
  68. }
  69. if (Length < sizeof(UCHAR)) {
  70. REPORT_ERROR( DeviceExtension->DeviceType, "I/O length != sizeof(UCHAR)", STATUS_INVALID_PARAMETER_2 );
  71. return STATUS_INVALID_PARAMETER_2;
  72. }
  73. return STATUS_SUCCESS;
  74. }
  75. NTSTATUS
  76. SaKeypadShutdownNotification(
  77. IN PKEYPAD_DEVICE_EXTENSION DeviceExtension,
  78. IN PIRP Irp,
  79. PIO_STACK_LOCATION IrpSp
  80. )
  81. /*++
  82. Routine Description:
  83. This is the keypad specific code for processing the system shutdown notification.
  84. Arguments:
  85. DeviceExtension - Display device extension
  86. Irp - Pointer to an IRP structure that describes the requested I/O operation.
  87. IrpSp - Irp stack pointer
  88. Return Value:
  89. NT status code.
  90. --*/
  91. {
  92. UNREFERENCED_PARAMETER(DeviceExtension);
  93. UNREFERENCED_PARAMETER(Irp);
  94. UNREFERENCED_PARAMETER(IrpSp);
  95. return STATUS_SUCCESS;
  96. }
  97. NTSTATUS
  98. SaKeypadStartDevice(
  99. IN PKEYPAD_DEVICE_EXTENSION DeviceExtension
  100. )
  101. /*++
  102. Routine Description:
  103. This is the keypad specific code for processing the PNP start device request.
  104. Arguments:
  105. DeviceExtension - Keypad device extension
  106. Return Value:
  107. NT status code.
  108. --*/
  109. {
  110. UNREFERENCED_PARAMETER(DeviceExtension);
  111. return STATUS_SUCCESS;
  112. }