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.

80 lines
1.3 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. Cleanup.c
  5. Abstract:
  6. This module implements the File Cleanup routine for Raw called by the
  7. dispatch driver.
  8. Author:
  9. David Goebel [DavidGoe] 18-Mar-91
  10. Revision History:
  11. --*/
  12. #include "RawProcs.h"
  13. #ifdef ALLOC_PRAGMA
  14. #pragma alloc_text(PAGE, RawCleanup)
  15. #endif
  16. NTSTATUS
  17. RawCleanup (
  18. IN PVCB Vcb,
  19. IN PIRP Irp,
  20. IN PIO_STACK_LOCATION IrpSp
  21. )
  22. /*++
  23. Routine Description:
  24. This is the routine for cleaning up a handle.
  25. Arguments:
  26. Vcb - Supplies the volume being queried.
  27. Irp - Supplies the Irp being processed.
  28. IrpSp - Supplies parameters describing the read
  29. Return Value:
  30. NTSTATUS - The return status for the operation
  31. --*/
  32. {
  33. NTSTATUS Status;
  34. PAGED_CODE();
  35. //
  36. // This is a Cleanup operation. All we have to do is deal with
  37. // share access.
  38. //
  39. Status = KeWaitForSingleObject( &Vcb->Mutex,
  40. Executive,
  41. KernelMode,
  42. FALSE,
  43. (PLARGE_INTEGER) NULL );
  44. ASSERT( NT_SUCCESS( Status ) );
  45. IoRemoveShareAccess( IrpSp->FileObject, &Vcb->ShareAccess );
  46. (VOID)KeReleaseMutex( &Vcb->Mutex, FALSE );
  47. RawCompleteRequest( Irp, STATUS_SUCCESS );
  48. return STATUS_SUCCESS;
  49. }