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.

95 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 1997, 1998 Microsoft Corporation
  3. Module Name:
  4. siclose.c
  5. Abstract:
  6. Close routines for the single instance store
  7. Authors:
  8. Bill Bolosky, Summer, 1997
  9. Environment:
  10. Kernel mode
  11. Revision History:
  12. --*/
  13. #include "sip.h"
  14. NTSTATUS
  15. SiClose(
  16. IN PDEVICE_OBJECT DeviceObject,
  17. IN PIRP Irp
  18. )
  19. /*++
  20. Routine Description:
  21. This routine is invoked upon file close operations. If it's a SIS file,
  22. remove our filter context and clean up after ourselves. In any case,
  23. let the close go down to NTFS.
  24. Arguments:
  25. DeviceObject - Pointer to this driver's device object.
  26. Irp - Pointer to the close irp
  27. Return Value:
  28. The status from the NTFS close
  29. --*/
  30. {
  31. PIO_STACK_LOCATION irpSp = IoGetCurrentIrpStackLocation(Irp);
  32. PFILE_OBJECT fileObject = irpSp->FileObject;
  33. PSIS_PER_FILE_OBJECT perFO;
  34. PSIS_SCB scb;
  35. PDEVICE_EXTENSION deviceExtension = DeviceObject->DeviceExtension;
  36. //
  37. // The control device object can not be opened
  38. //
  39. ASSERT(!IS_MY_CONTROL_DEVICE_OBJECT( DeviceObject ));
  40. ASSERT(IS_MY_DEVICE_OBJECT( DeviceObject ));
  41. #if DBG
  42. if (BJBDebug & 0x1) {
  43. DbgPrint("SIS: SiClose: fileObject %p, %0.*ws\n",
  44. fileObject,fileObject->FileName.Length / sizeof(WCHAR),fileObject->FileName.Buffer);
  45. }
  46. #endif // DBG
  47. if (!SipIsFileObjectSIS(fileObject,DeviceObject,FindAny,&perFO,&scb)) {
  48. SipDirectPassThroughAndReturn(DeviceObject, Irp);
  49. }
  50. SIS_MARK_POINT_ULONG(perFO);
  51. //
  52. // Get rid of the perFO for this file object. If this was the last file object,
  53. // then the filter context will get removed by NTFS, and deallocated by the appropriate
  54. // callback routine.
  55. //
  56. SipDeallocatePerFO(perFO,DeviceObject);
  57. //
  58. // We don't need to do any further processing on this SIS file object, so pass it
  59. // through.
  60. //
  61. SipDirectPassThroughAndReturn(DeviceObject, Irp); // NB: This was a SIS file object!!!!
  62. }