OpenCBM
cleanup.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version
5  * 2 of the License, or (at your option) any later version.
6  *
7  * Copyright 2004 Spiro Trikaliotis
8  *
9  */
10 
19 #include <wdm.h>
20 #include "cbm_driver.h"
21 #include "iec.h"
22 
43 NTSTATUS
44 cbm_cleanup(IN PDEVICE_OBJECT Fdo, IN PIRP Irp)
45 {
46  PIO_STACK_LOCATION irpSp;
47  PDEVICE_EXTENSION pdx;
48  NTSTATUS ntStatus;
49 
50  FUNC_ENTER();
51 
52  pdx = Fdo->DeviceExtension;
53  irpSp = IoGetCurrentIrpStackLocation(Irp);
54 
55  /* Let the QUEUE itself perform all relevant steps */
56  QueueCleanup(&pdx->IrpQueue, irpSp->FileObject);
57 
58  /* We're done, complete the IRP */
59  ntStatus = QueueCompleteIrp(NULL, Irp, STATUS_SUCCESS, 0);
60 
61  FUNC_LEAVE_NTSTATUS(ntStatus);
62 }
NTSTATUS cbm_cleanup(IN PDEVICE_OBJECT Fdo, IN PIRP Irp)
Services IRPs containing the IRP_MJ_CLEANUP I/O function code.
Definition: cleanup.c:44
Definitions for the libiec library.
#define FUNC_ENTER()
Definition: debug.h:347
Definitions for the opencbm driver.
NTSTATUS QueueCompleteIrp(PQUEUE Queue, PIRP Irp, NTSTATUS StatusCode, ULONG_PTR Information)
Complete an IRP which is on a QUEUE.
Definition: queue.c:756
NTSTATUS QueueCleanup(PQUEUE Queue, PFILE_OBJECT FileObject)
Process an IRP_MJ_CLEANUP on the QUEUE.
Definition: queue.c:998