Major refactoring: testing

This commit is contained in:
Bill Zissimopoulos 2015-12-23 21:40:38 -08:00
parent c330eaec54
commit c7742cf05b
3 changed files with 6 additions and 6 deletions

View File

@ -59,7 +59,6 @@ NTSTATUS FspVolumeCreate(
WCHAR VolumeNameBuf[FSP_DEVICE_VOLUME_NAME_LENMAX / sizeof(WCHAR)];
PDEVICE_OBJECT FsvolDeviceObject;
PDEVICE_OBJECT FsvrtDeviceObject;
HANDLE MupHandle = 0;
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension;
/* check parameters */
@ -96,9 +95,9 @@ NTSTATUS FspVolumeCreate(
if (FILE_DEVICE_NETWORK_FILE_SYSTEM == FsctlDeviceObject->DeviceType)
{
VolumeParams.Prefix[sizeof VolumeParams.Prefix / 2 - 1] = L'\0';
while (L'\0' != VolumeParams.Prefix[PrefixLength++])
for (; L'\0' != VolumeParams.Prefix[PrefixLength]; PrefixLength++)
;
while (0 < PrefixLength && L'\\' == VolumeParams.Prefix[--PrefixLength])
for (; 0 < PrefixLength && L'\\' == VolumeParams.Prefix[PrefixLength - 1]; PrefixLength--)
;
VolumeParams.Prefix[PrefixLength] = L'\0';
if (0 == PrefixLength)
@ -156,13 +155,13 @@ NTSTATUS FspVolumeCreate(
/* do we need to register with MUP? */
if (0 == FsvrtDeviceObject)
{
Result = FsRtlRegisterUncProviderEx(&MupHandle, &VolumeName, FsvolDeviceObject, 0);
Result = FsRtlRegisterUncProviderEx(&FsvolDeviceExtension->MupHandle,
&FsvolDeviceExtension->VolumeName, FsvolDeviceObject, 0);
if (!NT_SUCCESS(Result))
{
FspDeviceRelease(FsvolDeviceObject);
return Result;
}
FsvolDeviceExtension->MupHandle = MupHandle;
}
/* associate the new volume device with our file object */

View File

@ -55,6 +55,7 @@ void mount_create_volume_dotest(PWSTR DeviceName)
VolumeParams.SectorSize = 16384;
VolumeParams.SerialNumber = 0x12345678;
wcscpy_s(VolumeParams.Prefix, sizeof VolumeParams.Prefix / sizeof(WCHAR), L"\\\\winfsp-tests");
Result = FspFsctlCreateVolume(DeviceName, &VolumeParams,
VolumePath, sizeof VolumePath, &VolumeHandle);
ASSERT(STATUS_SUCCESS == Result);

View File

@ -1,7 +1,7 @@
#include <tlib/testsuite.h>
int WinFspDiskTests = 1;
int WinFspNetTests = 0;
int WinFspNetTests = 1;
int main(int argc, char *argv[])
{