pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS


Mount-DiskImage experiments
Posted by Anonymous on Thu 31st Jul 2025 12:22
raw | new post
view followups (newest first): Mount-DiskImage experiments by Anonymous

  1. # ---- snip ----
  2. # $ powershell -Command 'Mount-DiskImage -ImagePath "\\10.49.202.230@2049\nfs4\xfstestfs001\test2\vhdtest\v2.img"'
  3. # Mount-DiskImage : Die Anforderung wird nicht unterstützt.
  4. # In Zeile:1 Zeichen:1
  5. # + Mount-DiskImage -ImagePath "\\10.49.202.230@2049\nfs4\xfstestfs001\te ...
  6. # + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7. #     + CategoryInfo          : InvalidOperation: (MSFT_DiskImage:ROOT/Microsoft/.../MSFT_DiskImage) [Mount-DiskImage], CimException
  8. #     + FullyQualifiedErrorId : HRESULT 0x80070032,Mount-DiskImage
  9. # ---- snip ----
  10.  
  11. diff --git a/daemon/nfs41_superblock.c b/daemon/nfs41_superblock.c
  12. index 977a4c1..8812eb4 100644
  13. --- a/daemon/nfs41_superblock.c
  14. +++ b/daemon/nfs41_superblock.c
  15. @@ -194,6 +194,7 @@ void nfs41_superblock_fs_attributes(
  16.      FsAttrs->FileSystemAttributes |= FILE_SUPPORTS_SPARSE_FILES;
  17.      /* NFSv4 protocol uses Unicode by default */
  18.      FsAttrs->FileSystemAttributes |= FILE_UNICODE_ON_DISK;
  19. +    FsAttrs->FileSystemAttributes |= FILE_SUPPORTS_OBJECT_IDS;
  20.  
  21.      if (superblock->link_support)
  22.          FsAttrs->FileSystemAttributes |= FILE_SUPPORTS_HARD_LINKS;
  23. diff --git a/sys/nfs41sys_fileinfo.c b/sys/nfs41sys_fileinfo.c
  24. index d7dc5e7..70f211a 100644
  25. --- a/sys/nfs41sys_fileinfo.c
  26. +++ b/sys/nfs41sys_fileinfo.c
  27. @@ -374,13 +374,13 @@ NTSTATUS nfs41_QueryFileInformation(
  28.      case FileInternalInformation:
  29.      case FileAttributeTagInformation:
  30.      case FileNetworkOpenInformation:
  31. -    case FileRemoteProtocolInformation:
  32.      case FileIdInformation:
  33.  #ifdef NFS41_DRIVER_WSL_SUPPORT
  34.      case FileStatInformation:
  35.      case FileStatLxInformation:
  36.  #endif /* NFS41_DRIVER_WSL_SUPPORT */
  37.          break;
  38. +    case FileRemoteProtocolInformation:
  39.      default:
  40.          print_error("nfs41_QueryFileInformation: unhandled class %d\n", InfoClass);
  41.          status = STATUS_NOT_SUPPORTED;
  42. diff --git a/sys/nfs41sys_fsctl.c b/sys/nfs41sys_fsctl.c
  43. index c1a3f2b..972792c 100644
  44. --- a/sys/nfs41sys_fsctl.c
  45. +++ b/sys/nfs41sys_fsctl.c
  46. @@ -895,6 +895,24 @@ NTSTATUS nfs41_FsCtl(
  47.      case FSCTL_DUPLICATE_EXTENTS_TO_FILE:
  48.          status = nfs41_DuplicateData(RxContext);
  49.          break;
  50. +    case FSCTL_CREATE_OR_GET_OBJECT_ID:
  51. +    case FSCTL_GET_OBJECT_ID:
  52. +        __notnull XXCTL_LOWIO_COMPONENT *FsCtl =
  53. +            &RxContext->LowIoContext.ParamsFor.FsCtl;
  54. +        __notnull PNFS41_FCB nfs41_fcb = NFS41GetFcbExtension(RxContext->pFcb);
  55. +        __notnull PFILE_OBJECTID_BUFFER objidbuf =
  56. +            (PFILE_OBJECTID_BUFFER)FsCtl->pOutputBuffer;
  57. +        if (objidbuf) {
  58. +            ULONGLONG xor_fsid = nfs41_fcb->fsid_major ^ nfs41_fcb->fsid_minor;
  59. +            (void)memset(objidbuf, 0, sizeof(FILE_OBJECTID_BUFFER));
  60. +            (void)memcpy(&objidbuf->ObjectId[0], &nfs41_fcb->fileid, sizeof(ULONGLONG));
  61. +            (void)memcpy(&objidbuf->ObjectId[8], &xor_fsid, sizeof(ULONGLONG));
  62. +            status = STATUS_SUCCESS;
  63. +        }
  64. +        else {
  65. +            status = STATUS_INVALID_USER_BUFFER;
  66. +        }
  67. +        break;
  68.      default:
  69.          break;
  70.      }
  71. diff --git a/sys/nfs41sys_volinfo.c b/sys/nfs41sys_volinfo.c
  72. index e663d0b..1824c6c 100644
  73. --- a/sys/nfs41sys_volinfo.c
  74. +++ b/sys/nfs41sys_volinfo.c
  75. @@ -177,11 +177,31 @@ NTSTATUS nfs41_QueryVolumeInformation(
  76.              goto out;
  77.          }
  78.          pDevInfo->DeviceType = RxContext->pFcb->pNetRoot->DeviceType;
  79. -        pDevInfo->Characteristics = FILE_REMOTE_DEVICE | FILE_DEVICE_IS_MOUNTED;
  80. +        pDevInfo->Characteristics = /*FILE_REMOTE_DEVICE |*/ FILE_DEVICE_IS_MOUNTED;
  81.          RxContext->Info.LengthRemaining -= SizeUsed;
  82.          status = STATUS_SUCCESS;
  83.          goto out;
  84.      }
  85. +    case FileFsObjectIdInformation:
  86. +    {
  87. +        PFILE_FS_OBJECTID_INFORMATION pObjIdInfo = RxContext->Info.Buffer;
  88. +
  89. +        SizeUsed = sizeof(FILE_FS_OBJECTID_INFORMATION);
  90. +        if (RemainingLength < SizeUsed) {
  91. +            status = STATUS_BUFFER_TOO_SMALL;
  92. +            RxContext->InformationToReturn = SizeUsed;
  93. +            goto out;
  94. +        }
  95. +
  96. +        (void)memset(pObjIdInfo, 0, sizeof(FILE_FS_OBJECTID_INFORMATION));
  97. +        const ULONGLONG nfs41GUID = 0xDEADBEEF;
  98. +        (void)memcpy(&pObjIdInfo->ObjectId[0], &nfs41GUID, sizeof(ULONGLONG));
  99. +
  100. +        RxContext->Info.LengthRemaining -= SizeUsed;
  101. +        status = STATUS_SUCCESS;
  102. +        goto out;
  103. +    }
  104. +
  105.  
  106.      case FileFsAttributeInformation:
  107.      case FileFsSizeInformation:

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at