dll: fsctl: testing

This commit is contained in:
Bill Zissimopoulos
2015-11-30 17:43:14 -08:00
parent 6f3f87e21e
commit f910f0bacc
3 changed files with 7 additions and 3 deletions

View File

@ -86,13 +86,14 @@ FSP_API NTSTATUS FspFsctlCreateVolume(PWSTR DevicePath,
Result = FspNtStatusFromWin32(GetLastError());
goto exit;
}
ParamsBuf = malloc(sizeof *ParamsBuf + SecurityDescriptorSize);
ParamsBuf = malloc(FSP_FSCTL_VOLUME_PARAMS_SIZE + SecurityDescriptorSize);
if (0 == ParamsBuf)
{
Result = STATUS_INSUFFICIENT_RESOURCES;
goto exit;
}
SecurityDescriptorBuf = (PVOID)(ParamsBuf + 1);
memset(ParamsBuf, 0, FSP_FSCTL_VOLUME_PARAMS_SIZE);
SecurityDescriptorBuf = (PVOID)((PUINT8)ParamsBuf + FSP_FSCTL_VOLUME_PARAMS_SIZE);
if (!MakeSelfRelativeSD(SecurityDescriptor, SecurityDescriptorBuf, &SecurityDescriptorSize))
{
Result = FspNtStatusFromWin32(GetLastError());

View File

@ -107,7 +107,7 @@ static NTSTATUS FspFsctlCreateVolume(
ULONG OutputBufferLength = IrpSp->Parameters.FileSystemControl.OutputBufferLength;
PVOID SystemBuffer = Irp->AssociatedIrp.SystemBuffer;
const FSP_FSCTL_VOLUME_PARAMS *Params = SystemBuffer;
PSECURITY_DESCRIPTOR SecurityDescriptor = (PVOID)(Params + 1);
PSECURITY_DESCRIPTOR SecurityDescriptor = (PVOID)((PUINT8)Params + FSP_FSCTL_VOLUME_PARAMS_SIZE);
DWORD SecurityDescriptorSize = InputBufferLength - sizeof *Params;
if (sizeof *Params >= InputBufferLength || 0 == SystemBuffer ||
!FspValidRelativeSecurityDescriptor(SecurityDescriptor, SecurityDescriptorSize,