mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 00:43:00 -05:00
Major refactoring: testing
This commit is contained in:
parent
c330eaec54
commit
c7742cf05b
@ -59,7 +59,6 @@ NTSTATUS FspVolumeCreate(
|
|||||||
WCHAR VolumeNameBuf[FSP_DEVICE_VOLUME_NAME_LENMAX / sizeof(WCHAR)];
|
WCHAR VolumeNameBuf[FSP_DEVICE_VOLUME_NAME_LENMAX / sizeof(WCHAR)];
|
||||||
PDEVICE_OBJECT FsvolDeviceObject;
|
PDEVICE_OBJECT FsvolDeviceObject;
|
||||||
PDEVICE_OBJECT FsvrtDeviceObject;
|
PDEVICE_OBJECT FsvrtDeviceObject;
|
||||||
HANDLE MupHandle = 0;
|
|
||||||
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension;
|
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension;
|
||||||
|
|
||||||
/* check parameters */
|
/* check parameters */
|
||||||
@ -96,9 +95,9 @@ NTSTATUS FspVolumeCreate(
|
|||||||
if (FILE_DEVICE_NETWORK_FILE_SYSTEM == FsctlDeviceObject->DeviceType)
|
if (FILE_DEVICE_NETWORK_FILE_SYSTEM == FsctlDeviceObject->DeviceType)
|
||||||
{
|
{
|
||||||
VolumeParams.Prefix[sizeof VolumeParams.Prefix / 2 - 1] = L'\0';
|
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';
|
VolumeParams.Prefix[PrefixLength] = L'\0';
|
||||||
if (0 == PrefixLength)
|
if (0 == PrefixLength)
|
||||||
@ -156,13 +155,13 @@ NTSTATUS FspVolumeCreate(
|
|||||||
/* do we need to register with MUP? */
|
/* do we need to register with MUP? */
|
||||||
if (0 == FsvrtDeviceObject)
|
if (0 == FsvrtDeviceObject)
|
||||||
{
|
{
|
||||||
Result = FsRtlRegisterUncProviderEx(&MupHandle, &VolumeName, FsvolDeviceObject, 0);
|
Result = FsRtlRegisterUncProviderEx(&FsvolDeviceExtension->MupHandle,
|
||||||
|
&FsvolDeviceExtension->VolumeName, FsvolDeviceObject, 0);
|
||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
{
|
{
|
||||||
FspDeviceRelease(FsvolDeviceObject);
|
FspDeviceRelease(FsvolDeviceObject);
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
FsvolDeviceExtension->MupHandle = MupHandle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* associate the new volume device with our file object */
|
/* associate the new volume device with our file object */
|
||||||
|
@ -55,6 +55,7 @@ void mount_create_volume_dotest(PWSTR DeviceName)
|
|||||||
|
|
||||||
VolumeParams.SectorSize = 16384;
|
VolumeParams.SectorSize = 16384;
|
||||||
VolumeParams.SerialNumber = 0x12345678;
|
VolumeParams.SerialNumber = 0x12345678;
|
||||||
|
wcscpy_s(VolumeParams.Prefix, sizeof VolumeParams.Prefix / sizeof(WCHAR), L"\\\\winfsp-tests");
|
||||||
Result = FspFsctlCreateVolume(DeviceName, &VolumeParams,
|
Result = FspFsctlCreateVolume(DeviceName, &VolumeParams,
|
||||||
VolumePath, sizeof VolumePath, &VolumeHandle);
|
VolumePath, sizeof VolumePath, &VolumeHandle);
|
||||||
ASSERT(STATUS_SUCCESS == Result);
|
ASSERT(STATUS_SUCCESS == Result);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include <tlib/testsuite.h>
|
#include <tlib/testsuite.h>
|
||||||
|
|
||||||
int WinFspDiskTests = 1;
|
int WinFspDiskTests = 1;
|
||||||
int WinFspNetTests = 0;
|
int WinFspNetTests = 1;
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user