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.

209 lines
5.3 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. VolInfo.c
  5. Abstract:
  6. This module implements the volume information routines for Rx called by
  7. the dispatch driver.
  8. Author:
  9. Joe Linn [JoeLinn] 5-oct-94
  10. Revision History:
  11. --*/
  12. #include "precomp.h"
  13. #pragma hdrstop
  14. //
  15. // The local debug trace level
  16. //
  17. #define Dbg (DEBUG_TRACE_VOLINFO)
  18. #ifdef ALLOC_PRAGMA
  19. #pragma alloc_text(PAGE, RxCommonQueryVolumeInformation)
  20. #pragma alloc_text(PAGE, RxCommonSetVolumeInformation)
  21. #endif
  22. NTSTATUS
  23. RxCommonQueryVolumeInformation ( RXCOMMON_SIGNATURE )
  24. /*++
  25. Routine Description:
  26. This is the common routine for querying volume information called by both
  27. the fsd and fsp threads.
  28. Arguments:
  29. Irp - Supplies the Irp being processed
  30. Return Value:
  31. NTSTATUS - The return status for the operation
  32. --*/
  33. {
  34. NTSTATUS Status;
  35. RxCaptureRequestPacket;
  36. RxCaptureFcb;
  37. RxCaptureFobx;
  38. RxCaptureParamBlock;
  39. ULONG OriginalLength = capPARAMS->Parameters.QueryVolume.Length;
  40. FS_INFORMATION_CLASS FsInformationClass = capPARAMS->Parameters.QueryVolume.FsInformationClass;
  41. PVOID OriginalBuffer = capReqPacket->AssociatedIrp.SystemBuffer;
  42. PAGED_CODE();
  43. RxDbgTrace(+1, Dbg, ("RxCommonQueryVolumeInformation...IrpC %08lx, Fobx %08lx, Fcb %08lx\n",
  44. RxContext, capFobx, capFcb));
  45. RxDbgTrace( 0, Dbg, ("->Length = %08lx\n", OriginalLength));
  46. RxDbgTrace( 0, Dbg, ("->FsInformationClass = %08lx\n", FsInformationClass));
  47. RxDbgTrace( 0, Dbg, ("->Buffer = %08lx\n", OriginalBuffer));
  48. RxLog(("QueryVolInfo %lx %lx %lx\n",RxContext,capFcb,capFobx));
  49. RxWmiLog(LOG,
  50. RxCommonQueryVolumeInformation_1,
  51. LOGPTR(RxContext)
  52. LOGPTR(capFcb)
  53. LOGPTR(capFobx));
  54. RxLog((" alsoqvi %lx %lx %lx\n",
  55. OriginalLength,FsInformationClass,OriginalBuffer));
  56. RxWmiLog(LOG,
  57. RxCommonQueryVolumeInformation_2,
  58. LOGULONG(OriginalLength)
  59. LOGULONG(FsInformationClass)
  60. LOGPTR(OriginalBuffer));
  61. try {
  62. RxContext->Info.FsInformationClass = FsInformationClass;
  63. RxContext->Info.Buffer = OriginalBuffer;
  64. RxContext->Info.LengthRemaining = OriginalLength;
  65. MINIRDR_CALL(
  66. Status,
  67. RxContext,
  68. capFcb->MRxDispatch,
  69. MRxQueryVolumeInfo,
  70. (RxContext));
  71. if (RxContext->PostRequest) {
  72. try_return(Status = RxFsdPostRequest(RxContext));
  73. }
  74. capReqPacket->IoStatus.Information = OriginalLength - RxContext->Info.LengthRemaining;
  75. try_exit:
  76. NOTHING;
  77. } finally {
  78. DebugUnwind( RxCommonQueryVolumeInformation );
  79. }
  80. RxDbgTrace(-1, Dbg, ("RxCommonQueryVolumeInformation -> %08lx,%08lx\n", Status, capReqPacket->IoStatus.Information));
  81. return Status;
  82. }
  83. NTSTATUS
  84. RxCommonSetVolumeInformation ( RXCOMMON_SIGNATURE )
  85. /*++
  86. Routine Description:
  87. This is the common routine for setting Volume Information called by both
  88. the fsd and fsp threads.
  89. Arguments:
  90. Irp - Supplies the Irp being processed
  91. Return Value:
  92. RXSTATUS - The return status for the operation
  93. --*/
  94. {
  95. NTSTATUS Status = STATUS_NOT_IMPLEMENTED;
  96. RxCaptureRequestPacket;
  97. RxCaptureFcb;
  98. RxCaptureFobx;
  99. RxCaptureParamBlock;
  100. TYPE_OF_OPEN TypeOfOpen = NodeType(capFcb);
  101. ULONG Length;
  102. FS_INFORMATION_CLASS FsInformationClass;
  103. PVOID Buffer;
  104. PAGED_CODE();
  105. RxDbgTrace(+1, Dbg, ("RxCommonSetVolumeInformation...IrpC %08lx, Fobx %08lx, Fcb %08lx\n",
  106. RxContext, capFobx, capFcb));
  107. Length = capPARAMS->Parameters.SetVolume.Length;
  108. FsInformationClass = capPARAMS->Parameters.SetVolume.FsInformationClass;
  109. Buffer = capReqPacket->AssociatedIrp.SystemBuffer;
  110. RxDbgTrace( 0, Dbg, ("->Length = %08lx\n", Length));
  111. RxDbgTrace( 0, Dbg, ("->FsInformationClass = %08lx\n", FsInformationClass));
  112. RxDbgTrace( 0, Dbg, ("->Buffer = %08lx\n", Buffer));
  113. RxLog(("SetVolInfo %lx %lx %lx\n",RxContext,capFcb,capFobx));
  114. RxWmiLog(LOG,
  115. RxCommonSetVolumeInformation_1,
  116. LOGPTR(RxContext)
  117. LOGPTR(capFcb)
  118. LOGPTR(capFobx));
  119. RxLog((" alsosvi %lx %lx %lx\n",
  120. Length,FsInformationClass,Buffer));
  121. RxWmiLog(LOG,
  122. RxCommonSetVolumeInformation_2,
  123. LOGULONG(Length)
  124. LOGULONG(FsInformationClass)
  125. LOGPTR(Buffer));
  126. try {
  127. //
  128. // Based on the information class we'll do different actions. Each
  129. // of the procedures that we're calling performs the action if
  130. // possible and returns true if it successful and false if it couldn't
  131. // wait for any I/O to complete.
  132. //
  133. RxContext->Info.FsInformationClass = FsInformationClass;
  134. RxContext->Info.Buffer = Buffer;
  135. RxContext->Info.LengthRemaining = Length;
  136. MINIRDR_CALL(
  137. Status,
  138. RxContext,
  139. capFcb->MRxDispatch,
  140. MRxSetVolumeInfo,
  141. (RxContext));
  142. } finally {
  143. DebugUnwind( RxCommonSetVolumeInformation );
  144. RxDbgTrace(-1, Dbg, ("RxCommonSetVolumeInformation -> %08lx\n", Status));
  145. }
  146. return Status;
  147. }
  148.