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.

790 lines
21 KiB

  1. /*--
  2. Copyright (c) 1998, 1999 Microsoft Corporation
  3. Module Name:
  4. moufiltr.c
  5. Abstract:
  6. Environment:
  7. Kernel mode only.
  8. Notes:
  9. --*/
  10. #include "moufiltr.h"
  11. NTSTATUS DriverEntry (PDRIVER_OBJECT, PUNICODE_STRING);
  12. #ifdef ALLOC_PRAGMA
  13. #pragma alloc_text (INIT, DriverEntry)
  14. #pragma alloc_text (PAGE, MouFilter_AddDevice)
  15. #pragma alloc_text (PAGE, MouFilter_CreateClose)
  16. #pragma alloc_text (PAGE, MouFilter_IoCtl)
  17. #pragma alloc_text (PAGE, MouFilter_InternIoCtl)
  18. #pragma alloc_text (PAGE, MouFilter_PnP)
  19. #pragma alloc_text (PAGE, MouFilter_Power)
  20. #pragma alloc_text (PAGE, MouFilter_Unload)
  21. #endif
  22. NTSTATUS
  23. DriverEntry (
  24. IN PDRIVER_OBJECT DriverObject,
  25. IN PUNICODE_STRING RegistryPath
  26. )
  27. /*++
  28. Routine Description:
  29. Initialize the entry points of the driver.
  30. --*/
  31. {
  32. ULONG i;
  33. UNREFERENCED_PARAMETER (RegistryPath);
  34. //
  35. // Fill in all the dispatch entry points with the pass through function
  36. // and the explicitly fill in the functions we are going to intercept
  37. //
  38. for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++) {
  39. DriverObject->MajorFunction[i] = MouFilter_DispatchPassThrough;
  40. }
  41. DriverObject->MajorFunction [IRP_MJ_CREATE] =
  42. DriverObject->MajorFunction [IRP_MJ_CLOSE] = MouFilter_CreateClose;
  43. DriverObject->MajorFunction [IRP_MJ_PNP] = MouFilter_PnP;
  44. DriverObject->MajorFunction [IRP_MJ_POWER] = MouFilter_Power;
  45. DriverObject->MajorFunction [IRP_MJ_INTERNAL_DEVICE_CONTROL] =
  46. MouFilter_InternIoCtl;
  47. //
  48. // If you are planning on using this function, you must create another
  49. // device object to send the requests to. Please see the considerations
  50. // comments for MouFilter_DispatchPassThrough for implementation details.
  51. //
  52. // DriverObject->MajorFunction [IRP_MJ_DEVICE_CONTROL] = MouFilter_IoCtl;
  53. DriverObject->DriverUnload = MouFilter_Unload;
  54. DriverObject->DriverExtension->AddDevice = MouFilter_AddDevice;
  55. return STATUS_SUCCESS;
  56. }
  57. NTSTATUS
  58. MouFilter_AddDevice(
  59. IN PDRIVER_OBJECT Driver,
  60. IN PDEVICE_OBJECT PDO
  61. )
  62. {
  63. PDEVICE_EXTENSION devExt;
  64. IO_ERROR_LOG_PACKET errorLogEntry;
  65. PDEVICE_OBJECT device;
  66. NTSTATUS status = STATUS_SUCCESS;
  67. PAGED_CODE();
  68. status = IoCreateDevice(Driver,
  69. sizeof(DEVICE_EXTENSION),
  70. NULL,
  71. FILE_DEVICE_MOUSE,
  72. 0,
  73. FALSE,
  74. &device
  75. );
  76. if (!NT_SUCCESS(status)) {
  77. return (status);
  78. }
  79. RtlZeroMemory(device->DeviceExtension, sizeof(DEVICE_EXTENSION));
  80. devExt = (PDEVICE_EXTENSION) device->DeviceExtension;
  81. devExt->TopOfStack = IoAttachDeviceToDeviceStack(device, PDO);
  82. if (devExt->TopOfStack == NULL) {
  83. IoDeleteDevice(device);
  84. return STATUS_DEVICE_NOT_CONNECTED;
  85. }
  86. ASSERT(devExt->TopOfStack);
  87. devExt->Self = device;
  88. devExt->PDO = PDO;
  89. devExt->DeviceState = PowerDeviceD0;
  90. devExt->SurpriseRemoved = FALSE;
  91. devExt->Removed = FALSE;
  92. devExt->Started = FALSE;
  93. device->Flags |= (DO_BUFFERED_IO | DO_POWER_PAGABLE);
  94. device->Flags &= ~DO_DEVICE_INITIALIZING;
  95. return status;
  96. }
  97. NTSTATUS
  98. MouFilter_Complete(
  99. IN PDEVICE_OBJECT DeviceObject,
  100. IN PIRP Irp,
  101. IN PVOID Context
  102. )
  103. /*++
  104. Routine Description:
  105. Generic completion routine that allows the driver to send the irp down the
  106. stack, catch it on the way up, and do more processing at the original IRQL.
  107. --*/
  108. {
  109. PKEVENT event;
  110. event = (PKEVENT) Context;
  111. UNREFERENCED_PARAMETER(DeviceObject);
  112. UNREFERENCED_PARAMETER(Irp);
  113. //
  114. // We could switch on the major and minor functions of the IRP to perform
  115. // different functions, but we know that Context is an event that needs
  116. // to be set.
  117. //
  118. KeSetEvent(event, 0, FALSE);
  119. //
  120. // Allows the caller to use the IRP after it is completed
  121. //
  122. return STATUS_MORE_PROCESSING_REQUIRED;
  123. }
  124. NTSTATUS
  125. MouFilter_CreateClose (
  126. IN PDEVICE_OBJECT DeviceObject,
  127. IN PIRP Irp
  128. )
  129. /*++
  130. Routine Description:
  131. Maintain a simple count of the creates and closes sent against this device
  132. --*/
  133. {
  134. PIO_STACK_LOCATION irpStack;
  135. NTSTATUS status;
  136. PDEVICE_EXTENSION devExt;
  137. PAGED_CODE();
  138. irpStack = IoGetCurrentIrpStackLocation(Irp);
  139. devExt = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;
  140. status = Irp->IoStatus.Status;
  141. switch (irpStack->MajorFunction) {
  142. case IRP_MJ_CREATE:
  143. if (NULL == devExt->UpperConnectData.ClassService) {
  144. //
  145. // No Connection yet. How can we be enabled?
  146. //
  147. status = STATUS_INVALID_DEVICE_STATE;
  148. }
  149. else if ( 1 >= InterlockedIncrement(&devExt->EnableCount)) {
  150. //
  151. // First time enable here
  152. //
  153. }
  154. else {
  155. //
  156. // More than one create was sent down
  157. //
  158. }
  159. break;
  160. case IRP_MJ_CLOSE:
  161. ASSERT(0 < devExt->EnableCount);
  162. if (0 >= InterlockedDecrement(&devExt->EnableCount)) {
  163. //
  164. // successfully closed the device, do any appropriate work here
  165. //
  166. }
  167. break;
  168. }
  169. Irp->IoStatus.Status = status;
  170. //
  171. // Pass on the create and the close
  172. //
  173. return MouFilter_DispatchPassThrough(DeviceObject, Irp);
  174. }
  175. NTSTATUS
  176. MouFilter_DispatchPassThrough(
  177. IN PDEVICE_OBJECT DeviceObject,
  178. IN PIRP Irp
  179. )
  180. /*++
  181. Routine Description:
  182. Passes a request on to the lower driver.
  183. Considerations:
  184. If you are creating another device object (to communicate with user mode
  185. via IOCTLs), then this function must act differently based on the intended
  186. device object. If the IRP is being sent to the solitary device object, then
  187. this function should just complete the IRP (becuase there is no more stack
  188. locations below it). If the IRP is being sent to the PnP built stack, then
  189. the IRP should be passed down the stack.
  190. These changes must also be propagated to all the other IRP_MJ dispatch
  191. functions (such as create, close, cleanup, etc.) as well!
  192. --*/
  193. {
  194. PIO_STACK_LOCATION irpStack = IoGetCurrentIrpStackLocation(Irp);
  195. //
  196. // Pass the IRP to the target
  197. //
  198. IoSkipCurrentIrpStackLocation(Irp);
  199. return IoCallDriver(((PDEVICE_EXTENSION) DeviceObject->DeviceExtension)->TopOfStack, Irp);
  200. }
  201. NTSTATUS
  202. MouFilter_InternIoCtl(
  203. IN PDEVICE_OBJECT DeviceObject,
  204. IN PIRP Irp
  205. )
  206. /*++
  207. Routine Description:
  208. This routine is the dispatch routine for internal device control requests.
  209. There are two specific control codes that are of interest:
  210. IOCTL_INTERNAL_MOUSE_CONNECT:
  211. Store the old context and function pointer and replace it with our own.
  212. This makes life much simpler than intercepting IRPs sent by the RIT and
  213. modifying them on the way back up.
  214. IOCTL_INTERNAL_I8042_HOOK_MOUSE:
  215. Add in the necessary function pointers and context values so that we can
  216. alter how the ps/2 mouse is initialized.
  217. NOTE: Handling IOCTL_INTERNAL_I8042_HOOK_MOUSE is *NOT* necessary if
  218. all you want to do is filter MOUSE_INPUT_DATAs. You can remove
  219. the handling code and all related device extension fields and
  220. functions to conserve space.
  221. Arguments:
  222. DeviceObject - Pointer to the device object.
  223. Irp - Pointer to the request packet.
  224. Return Value:
  225. Status is returned.
  226. --*/
  227. {
  228. PIO_STACK_LOCATION irpStack;
  229. PDEVICE_EXTENSION devExt;
  230. KEVENT event;
  231. PCONNECT_DATA connectData;
  232. PINTERNAL_I8042_HOOK_MOUSE hookMouse;
  233. NTSTATUS status = STATUS_SUCCESS;
  234. devExt = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;
  235. Irp->IoStatus.Information = 0;
  236. irpStack = IoGetCurrentIrpStackLocation(Irp);
  237. switch (irpStack->Parameters.DeviceIoControl.IoControlCode) {
  238. //
  239. // Connect a mouse class device driver to the port driver.
  240. //
  241. case IOCTL_INTERNAL_MOUSE_CONNECT:
  242. //
  243. // Only allow one connection.
  244. //
  245. if (devExt->UpperConnectData.ClassService != NULL) {
  246. status = STATUS_SHARING_VIOLATION;
  247. break;
  248. }
  249. else if (irpStack->Parameters.DeviceIoControl.InputBufferLength <
  250. sizeof(CONNECT_DATA)) {
  251. //
  252. // invalid buffer
  253. //
  254. status = STATUS_INVALID_PARAMETER;
  255. break;
  256. }
  257. //
  258. // Copy the connection parameters to the device extension.
  259. //
  260. connectData = ((PCONNECT_DATA)
  261. (irpStack->Parameters.DeviceIoControl.Type3InputBuffer));
  262. devExt->UpperConnectData = *connectData;
  263. //
  264. // Hook into the report chain. Everytime a mouse packet is reported to
  265. // the system, MouFilter_ServiceCallback will be called
  266. //
  267. connectData->ClassDeviceObject = devExt->Self;
  268. connectData->ClassService = MouFilter_ServiceCallback;
  269. break;
  270. //
  271. // Disconnect a mouse class device driver from the port driver.
  272. //
  273. case IOCTL_INTERNAL_MOUSE_DISCONNECT:
  274. //
  275. // Clear the connection parameters in the device extension.
  276. //
  277. // devExt->UpperConnectData.ClassDeviceObject = NULL;
  278. // devExt->UpperConnectData.ClassService = NULL;
  279. status = STATUS_NOT_IMPLEMENTED;
  280. break;
  281. //
  282. // Attach this driver to the initialization and byte processing of the
  283. // i8042 (ie PS/2) mouse. This is only necessary if you want to do PS/2
  284. // specific functions, otherwise hooking the CONNECT_DATA is sufficient
  285. //
  286. case IOCTL_INTERNAL_I8042_HOOK_MOUSE:
  287. if (irpStack->Parameters.DeviceIoControl.InputBufferLength <
  288. sizeof(INTERNAL_I8042_HOOK_MOUSE)) {
  289. //
  290. // invalid buffer
  291. //
  292. status = STATUS_INVALID_PARAMETER;
  293. break;
  294. }
  295. //
  296. // Copy the connection parameters to the device extension.
  297. //
  298. hookMouse = (PINTERNAL_I8042_HOOK_MOUSE)
  299. (irpStack->Parameters.DeviceIoControl.Type3InputBuffer);
  300. //
  301. // Set isr routine and context and record any values from above this driver
  302. //
  303. devExt->UpperContext = hookMouse->Context;
  304. hookMouse->Context = (PVOID) DeviceObject;
  305. if (hookMouse->IsrRoutine) {
  306. devExt->UpperIsrHook = hookMouse->IsrRoutine;
  307. }
  308. hookMouse->IsrRoutine = (PI8042_MOUSE_ISR) MouFilter_IsrHook;
  309. //
  310. // Store all of the other functions we might need in the future
  311. //
  312. devExt->IsrWritePort = hookMouse->IsrWritePort;
  313. devExt->CallContext = hookMouse->CallContext;
  314. devExt->QueueMousePacket = hookMouse->QueueMousePacket;
  315. break;
  316. //
  317. // These internal ioctls are not supported by the new PnP model.
  318. //
  319. #if 0 // obsolete
  320. case IOCTL_INTERNAL_MOUSE_ENABLE:
  321. case IOCTL_INTERNAL_MOUSE_DISABLE:
  322. status = STATUS_NOT_SUPPORTED;
  323. break;
  324. #endif // obsolete
  325. //
  326. // Might want to capture this in the future. For now, then pass it down
  327. // the stack. These queries must be successful for the RIT to communicate
  328. // with the mouse.
  329. //
  330. case IOCTL_MOUSE_QUERY_ATTRIBUTES:
  331. default:
  332. break;
  333. }
  334. if (!NT_SUCCESS(status)) {
  335. Irp->IoStatus.Status = status;
  336. Irp->IoStatus.Information = 0;
  337. IoCompleteRequest(Irp, IO_NO_INCREMENT);
  338. return status;
  339. }
  340. return MouFilter_DispatchPassThrough(DeviceObject, Irp);
  341. }
  342. NTSTATUS
  343. MouFilter_PnP(
  344. IN PDEVICE_OBJECT DeviceObject,
  345. IN PIRP Irp
  346. )
  347. /*++
  348. Routine Description:
  349. This routine is the dispatch routine for plug and play irps
  350. Arguments:
  351. DeviceObject - Pointer to the device object.
  352. Irp - Pointer to the request packet.
  353. Return Value:
  354. Status is returned.
  355. --*/
  356. {
  357. PDEVICE_EXTENSION devExt;
  358. PIO_STACK_LOCATION irpStack;
  359. NTSTATUS status = STATUS_SUCCESS;
  360. KIRQL oldIrql;
  361. KEVENT event;
  362. PAGED_CODE();
  363. devExt = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;
  364. irpStack = IoGetCurrentIrpStackLocation(Irp);
  365. switch (irpStack->MinorFunction) {
  366. case IRP_MN_START_DEVICE: {
  367. //
  368. // The device is starting.
  369. //
  370. // We cannot touch the device (send it any non pnp irps) until a
  371. // start device has been passed down to the lower drivers.
  372. //
  373. IoCopyCurrentIrpStackLocationToNext(Irp);
  374. KeInitializeEvent(&event,
  375. NotificationEvent,
  376. FALSE
  377. );
  378. IoSetCompletionRoutine(Irp,
  379. (PIO_COMPLETION_ROUTINE) MouFilter_Complete,
  380. &event,
  381. TRUE,
  382. TRUE,
  383. TRUE); // No need for Cancel
  384. status = IoCallDriver(devExt->TopOfStack, Irp);
  385. if (STATUS_PENDING == status) {
  386. KeWaitForSingleObject(
  387. &event,
  388. Executive, // Waiting for reason of a driver
  389. KernelMode, // Waiting in kernel mode
  390. FALSE, // No allert
  391. NULL); // No timeout
  392. }
  393. if (NT_SUCCESS(status) && NT_SUCCESS(Irp->IoStatus.Status)) {
  394. //
  395. // As we are successfully now back from our start device
  396. // we can do work.
  397. //
  398. devExt->Started = TRUE;
  399. devExt->Removed = FALSE;
  400. devExt->SurpriseRemoved = FALSE;
  401. }
  402. //
  403. // We must now complete the IRP, since we stopped it in the
  404. // completetion routine with MORE_PROCESSING_REQUIRED.
  405. //
  406. Irp->IoStatus.Status = status;
  407. Irp->IoStatus.Information = 0;
  408. IoCompleteRequest(Irp, IO_NO_INCREMENT);
  409. break;
  410. }
  411. case IRP_MN_SURPRISE_REMOVAL:
  412. //
  413. // Same as a remove device, but don't call IoDetach or IoDeleteDevice
  414. //
  415. devExt->SurpriseRemoved = TRUE;
  416. // Remove code here
  417. IoSkipCurrentIrpStackLocation(Irp);
  418. status = IoCallDriver(devExt->TopOfStack, Irp);
  419. break;
  420. case IRP_MN_REMOVE_DEVICE:
  421. devExt->Removed = TRUE;
  422. // remove code here
  423. Irp->IoStatus.Status = STATUS_SUCCESS;
  424. IoSkipCurrentIrpStackLocation(Irp);
  425. status = IoCallDriver(devExt->TopOfStack, Irp);
  426. IoDetachDevice(devExt->TopOfStack);
  427. IoDeleteDevice(DeviceObject);
  428. break;
  429. case IRP_MN_QUERY_REMOVE_DEVICE:
  430. case IRP_MN_QUERY_STOP_DEVICE:
  431. case IRP_MN_CANCEL_REMOVE_DEVICE:
  432. case IRP_MN_CANCEL_STOP_DEVICE:
  433. case IRP_MN_FILTER_RESOURCE_REQUIREMENTS:
  434. case IRP_MN_STOP_DEVICE:
  435. case IRP_MN_QUERY_DEVICE_RELATIONS:
  436. case IRP_MN_QUERY_INTERFACE:
  437. case IRP_MN_QUERY_CAPABILITIES:
  438. case IRP_MN_QUERY_DEVICE_TEXT:
  439. case IRP_MN_QUERY_RESOURCES:
  440. case IRP_MN_QUERY_RESOURCE_REQUIREMENTS:
  441. case IRP_MN_READ_CONFIG:
  442. case IRP_MN_WRITE_CONFIG:
  443. case IRP_MN_EJECT:
  444. case IRP_MN_SET_LOCK:
  445. case IRP_MN_QUERY_ID:
  446. case IRP_MN_QUERY_PNP_DEVICE_STATE:
  447. default:
  448. //
  449. // Here the filter driver might modify the behavior of these IRPS
  450. // Please see PlugPlay documentation for use of these IRPs.
  451. //
  452. IoSkipCurrentIrpStackLocation(Irp);
  453. status = IoCallDriver(devExt->TopOfStack, Irp);
  454. break;
  455. }
  456. return status;
  457. }
  458. NTSTATUS
  459. MouFilter_Power(
  460. IN PDEVICE_OBJECT DeviceObject,
  461. IN PIRP Irp
  462. )
  463. /*++
  464. Routine Description:
  465. This routine is the dispatch routine for power irps Does nothing except
  466. record the state of the device.
  467. Arguments:
  468. DeviceObject - Pointer to the device object.
  469. Irp - Pointer to the request packet.
  470. Return Value:
  471. Status is returned.
  472. --*/
  473. {
  474. PIO_STACK_LOCATION irpStack;
  475. PDEVICE_EXTENSION devExt;
  476. POWER_STATE powerState;
  477. POWER_STATE_TYPE powerType;
  478. PAGED_CODE();
  479. devExt = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;
  480. irpStack = IoGetCurrentIrpStackLocation(Irp);
  481. powerType = irpStack->Parameters.Power.Type;
  482. powerState = irpStack->Parameters.Power.State;
  483. switch (irpStack->MinorFunction) {
  484. case IRP_MN_SET_POWER:
  485. if (powerType == DevicePowerState) {
  486. devExt->DeviceState = powerState.DeviceState;
  487. }
  488. case IRP_MN_QUERY_POWER:
  489. case IRP_MN_WAIT_WAKE:
  490. case IRP_MN_POWER_SEQUENCE:
  491. default:
  492. break;
  493. }
  494. PoStartNextPowerIrp(Irp);
  495. IoSkipCurrentIrpStackLocation(Irp);
  496. return PoCallDriver(devExt->TopOfStack, Irp);
  497. }
  498. BOOLEAN
  499. MouFilter_IsrHook (
  500. PDEVICE_OBJECT DeviceObject,
  501. PMOUSE_INPUT_DATA CurrentInput,
  502. POUTPUT_PACKET CurrentOutput,
  503. UCHAR StatusByte,
  504. PUCHAR DataByte,
  505. PBOOLEAN ContinueProcessing,
  506. PMOUSE_STATE MouseState,
  507. PMOUSE_RESET_SUBSTATE ResetSubState
  508. )
  509. /*++
  510. Remarks:
  511. i8042prt specific code, if you are writing a packet only filter driver, you
  512. can remove this function
  513. Arguments:
  514. DeviceObject - Our context passed during IOCTL_INTERNAL_I8042_HOOK_MOUSE
  515. CurrentInput - Current input packet being formulated by processing all the
  516. interrupts
  517. CurrentOutput - Current list of bytes being written to the mouse or the
  518. i8042 port.
  519. StatusByte - Byte read from I/O port 60 when the interrupt occurred
  520. DataByte - Byte read from I/O port 64 when the interrupt occurred.
  521. This value can be modified and i8042prt will use this value
  522. if ContinueProcessing is TRUE
  523. ContinueProcessing - If TRUE, i8042prt will proceed with normal processing of
  524. the interrupt. If FALSE, i8042prt will return from the
  525. interrupt after this function returns. Also, if FALSE,
  526. it is this functions responsibilityt to report the input
  527. packet via the function provided in the hook IOCTL or via
  528. queueing a DPC within this driver and calling the
  529. service callback function acquired from the connect IOCTL
  530. Return Value:
  531. Status is returned.
  532. --+*/
  533. {
  534. PDEVICE_EXTENSION devExt;
  535. BOOLEAN retVal = TRUE;
  536. devExt = DeviceObject->DeviceExtension;
  537. if (devExt->UpperIsrHook) {
  538. retVal = (*devExt->UpperIsrHook) (
  539. devExt->UpperContext,
  540. CurrentInput,
  541. CurrentOutput,
  542. StatusByte,
  543. DataByte,
  544. ContinueProcessing,
  545. MouseState,
  546. ResetSubState
  547. );
  548. if (!retVal || !(*ContinueProcessing)) {
  549. return retVal;
  550. }
  551. }
  552. *ContinueProcessing = TRUE;
  553. return retVal;
  554. }
  555. VOID
  556. MouFilter_ServiceCallback(
  557. IN PDEVICE_OBJECT DeviceObject,
  558. IN PMOUSE_INPUT_DATA InputDataStart,
  559. IN PMOUSE_INPUT_DATA InputDataEnd,
  560. IN OUT PULONG InputDataConsumed
  561. )
  562. /*++
  563. Routine Description:
  564. Called when there are mouse packets to report to the RIT. You can do
  565. anything you like to the packets. For instance:
  566. o Drop a packet altogether
  567. o Mutate the contents of a packet
  568. o Insert packets into the stream
  569. Arguments:
  570. DeviceObject - Context passed during the connect IOCTL
  571. InputDataStart - First packet to be reported
  572. InputDataEnd - One past the last packet to be reported. Total number of
  573. packets is equal to InputDataEnd - InputDataStart
  574. InputDataConsumed - Set to the total number of packets consumed by the RIT
  575. (via the function pointer we replaced in the connect
  576. IOCTL)
  577. Return Value:
  578. Status is returned.
  579. --*/
  580. {
  581. PDEVICE_EXTENSION devExt;
  582. devExt = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;
  583. //
  584. // UpperConnectData must be called at DISPATCH
  585. //
  586. (*(PSERVICE_CALLBACK_ROUTINE) devExt->UpperConnectData.ClassService)(
  587. devExt->UpperConnectData.ClassDeviceObject,
  588. InputDataStart,
  589. InputDataEnd,
  590. InputDataConsumed
  591. );
  592. }
  593. VOID
  594. MouFilter_Unload(
  595. IN PDRIVER_OBJECT Driver
  596. )
  597. /*++
  598. Routine Description:
  599. Free all the allocated resources associated with this driver.
  600. Arguments:
  601. DriverObject - Pointer to the driver object.
  602. Return Value:
  603. None.
  604. --*/
  605. {
  606. PAGED_CODE();
  607. UNREFERENCED_PARAMETER(Driver);
  608. ASSERT(NULL == Driver->DeviceObject);
  609. }