mirror of
				https://github.com/winfsp/winfsp.git
				synced 2025-10-30 19:48:38 -05:00 
			
		
		
		
	sys: IRP_MJ_SET_VOLUME_INFORMATION/FileFsLabelInformation
This commit is contained in:
		| @@ -47,6 +47,7 @@ FSP_API NTSTATUS FspFileSystemCreate(PWSTR DevicePath, | ||||
|     FileSystem->Operations[FspFsctlTransactQueryInformationKind] = FspFileSystemOpQueryInformation; | ||||
|     FileSystem->Operations[FspFsctlTransactSetInformationKind] = FspFileSystemOpSetInformation; | ||||
|     FileSystem->Operations[FspFsctlTransactQueryVolumeInformationKind] = FspFileSystemOpQueryVolumeInformation; | ||||
|     FileSystem->Operations[FspFsctlTransactSetVolumeInformationKind] = FspFileSystemOpSetVolumeInformation; | ||||
|     // !!!: ... | ||||
|     FileSystem->Interface = Interface; | ||||
|  | ||||
|   | ||||
| @@ -23,3 +23,27 @@ FSP_API NTSTATUS FspFileSystemOpQueryVolumeInformation(FSP_FILE_SYSTEM *FileSyst | ||||
|     memcpy(&Response->Rsp.QueryVolumeInformation.VolumeInfo, &VolumeInfo, sizeof VolumeInfo); | ||||
|     return STATUS_SUCCESS; | ||||
| } | ||||
|  | ||||
| FSP_API NTSTATUS FspFileSystemOpSetVolumeInformation(FSP_FILE_SYSTEM *FileSystem, | ||||
|     FSP_FSCTL_TRANSACT_REQ *Request, FSP_FSCTL_TRANSACT_RSP *Response) | ||||
| { | ||||
|     NTSTATUS Result; | ||||
|     FSP_FSCTL_VOLUME_INFO VolumeInfo; | ||||
|  | ||||
|     Result = STATUS_INVALID_DEVICE_REQUEST; | ||||
|     memset(&VolumeInfo, 0, sizeof VolumeInfo); | ||||
|     switch (Request->Req.SetVolumeInformation.FsInformationClass) | ||||
|     { | ||||
|     case 2/*FileFsLabelInformation*/: | ||||
|         if (0 != FileSystem->Interface->SetVolumeLabel) | ||||
|             Result = FileSystem->Interface->SetVolumeLabel(FileSystem, Request, | ||||
|                 (PWSTR)Request->Buffer, | ||||
|                 &VolumeInfo); | ||||
|     } | ||||
|  | ||||
|     if (!NT_SUCCESS(Result)) | ||||
|         return Result; | ||||
|  | ||||
|     memcpy(&Response->Rsp.SetVolumeInformation.VolumeInfo, &VolumeInfo, sizeof VolumeInfo); | ||||
|     return STATUS_SUCCESS; | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user