Major refactoring: WIP

This commit is contained in:
Bill Zissimopoulos 2015-12-22 18:19:58 -08:00
parent cd329ee361
commit 0cc2594efc
2 changed files with 25 additions and 4 deletions

View File

@ -85,6 +85,7 @@ typedef struct
UINT32 IrpTimeout; /* milliseconds; values between 1 min and 10 min */ UINT32 IrpTimeout; /* milliseconds; values between 1 min and 10 min */
UINT32 EaSupported:1; /* supports extended attributes (unimplemented; set to 0) */ UINT32 EaSupported:1; /* supports extended attributes (unimplemented; set to 0) */
UINT32 FileNameRequired:1; /* FileName required for all operations (not just Create) */ UINT32 FileNameRequired:1; /* FileName required for all operations (not just Create) */
WCHAR Prefix[64]; /* UNC prefix to recognize (\\server\path format, 0-term) */
} FSP_FSCTL_VOLUME_PARAMS; } FSP_FSCTL_VOLUME_PARAMS;
typedef struct typedef struct
{ {

View File

@ -351,11 +351,31 @@ NTSTATUS FspVolumeRedirQueryPathEx(
if (KernelMode != Irp->RequestorMode) if (KernelMode != Irp->RequestorMode)
return STATUS_ACCESS_DENIED; return STATUS_ACCESS_DENIED;
//NTSTATUS Result; /* check parameters */
//FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(FsvolDeviceObject); ULONG InputBufferLength = IrpSp->Parameters.FileSystemControl.InputBufferLength;
//FSP_FSCTL_TRANSACT_REQ *Request = IrpSp->Parameters.DeviceIoControl.Type3InputBuffer; ULONG OutputBufferLength = IrpSp->Parameters.FileSystemControl.OutputBufferLength;
QUERY_PATH_REQUEST_EX *QueryPathRequest = IrpSp->Parameters.DeviceIoControl.Type3InputBuffer;
QUERY_PATH_RESPONSE *QueryPathResponse = Irp->UserBuffer;
if (sizeof(QUERY_PATH_REQUEST_EX) > InputBufferLength ||
0 == QueryPathRequest || 0 == QueryPathResponse)
return STATUS_INVALID_PARAMETER;
if (sizeof(QUERY_PATH_RESPONSE) > OutputBufferLength)
return STATUS_BUFFER_TOO_SMALL;
return STATUS_INVALID_DEVICE_REQUEST; FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(FsvolDeviceObject);
UNICODE_STRING Prefix;
RtlInitUnicodeString(&Prefix, FsvolDeviceExtension->VolumeParams.Prefix);
if (Prefix.Length <= QueryPathRequest->PathName.Length &&
RtlEqualMemory(Prefix.Buffer, QueryPathRequest->PathName.Buffer, Prefix.Length))
{
QueryPathResponse->LengthAccepted = Prefix.Length;
Irp->IoStatus.Information = 0;
return STATUS_SUCCESS;
}
else
return STATUS_BAD_NETWORK_NAME;
} }
NTSTATUS FspVolumeGetName( NTSTATUS FspVolumeGetName(