summaryrefslogtreecommitdiffstats
path: root/private/ntos/raw/cleanup.c
diff options
context:
space:
mode:
authorAdam <you@example.com>2020-05-17 05:51:50 +0200
committerAdam <you@example.com>2020-05-17 05:51:50 +0200
commite611b132f9b8abe35b362e5870b74bce94a1e58e (patch)
treea5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/ntos/raw/cleanup.c
downloadNT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip
Diffstat (limited to 'private/ntos/raw/cleanup.c')
-rw-r--r--private/ntos/raw/cleanup.c80
1 files changed, 80 insertions, 0 deletions
diff --git a/private/ntos/raw/cleanup.c b/private/ntos/raw/cleanup.c
new file mode 100644
index 000000000..191beb48d
--- /dev/null
+++ b/private/ntos/raw/cleanup.c
@@ -0,0 +1,80 @@
+/*++
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ Cleanup.c
+
+Abstract:
+
+ This module implements the File Cleanup routine for Raw called by the
+ dispatch driver.
+
+Author:
+
+ David Goebel [DavidGoe] 18-Mar-91
+
+Revision History:
+
+--*/
+
+#include "RawProcs.h"
+
+#ifdef ALLOC_PRAGMA
+#pragma alloc_text(PAGE, RawCleanup)
+#endif
+
+
+NTSTATUS
+RawCleanup (
+ IN PVCB Vcb,
+ IN PIRP Irp,
+ IN PIO_STACK_LOCATION IrpSp
+ )
+
+/*++
+
+Routine Description:
+
+ This is the routine for cleaning up a handle.
+
+Arguments:
+
+ Vcb - Supplies the volume being queried.
+
+ Irp - Supplies the Irp being processed.
+
+ IrpSp - Supplies parameters describing the read
+
+Return Value:
+
+ NTSTATUS - The return status for the operation
+
+--*/
+
+{
+ NTSTATUS Status;
+
+ PAGED_CODE();
+
+ //
+ // This is a Cleanup operation. All we have to do is deal with
+ // share access.
+ //
+
+ Status = KeWaitForSingleObject( &Vcb->Mutex,
+ Executive,
+ KernelMode,
+ FALSE,
+ (PLARGE_INTEGER) NULL );
+ ASSERT( NT_SUCCESS( Status ) );
+
+ IoRemoveShareAccess( IrpSp->FileObject, &Vcb->ShareAccess );
+
+ (VOID)KeReleaseMutex( &Vcb->Mutex, FALSE );
+
+ RawCompleteRequest( Irp, STATUS_SUCCESS );
+
+ return STATUS_SUCCESS;
+}