mirror of
				https://github.com/winfsp/winfsp.git
				synced 2025-10-30 19:48:38 -05:00 
			
		
		
		
	tst: winfsp-tests: delete_standby_test
This commit is contained in:
		| @@ -683,59 +683,53 @@ static void delete_standby_dotest(ULONG Flags, PWSTR Prefix, ULONG FileInfoTimeo | |||||||
|     ASSERT(!Success); |     ASSERT(!Success); | ||||||
|     ASSERT(ERROR_FILE_NOT_FOUND == GetLastError()); |     ASSERT(ERROR_FILE_NOT_FOUND == GetLastError()); | ||||||
|  |  | ||||||
| #if 0 |     Success = CreateDirectoryW(Dir1Path, 0); | ||||||
|     /* disable test that fails with shares and passthrough file systems */ |     ASSERT(Success); | ||||||
|     if (!OptShareName) |  | ||||||
|     { |  | ||||||
|         Success = CreateDirectoryW(Dir1Path, 0); |  | ||||||
|         ASSERT(Success); |  | ||||||
|  |  | ||||||
|         srand(seed); |     srand(seed); | ||||||
|  |  | ||||||
|         Handle = CreateFileW(File0Path, |     Handle = CreateFileW(File0Path, | ||||||
|             GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, |         GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, | ||||||
|             CREATE_NEW, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE, 0); |         CREATE_NEW, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE, 0); | ||||||
|         ASSERT(INVALID_HANDLE_VALUE != Handle); |     ASSERT(INVALID_HANDLE_VALUE != Handle); | ||||||
|         Mapping0 = CreateFileMappingW(Handle, 0, PAGE_READWRITE, |     Mapping0 = CreateFileMappingW(Handle, 0, PAGE_READWRITE, | ||||||
|             0, 16 * SystemInfo.dwAllocationGranularity, 0); |         0, 16 * SystemInfo.dwAllocationGranularity, 0); | ||||||
|         ASSERT(0 != Mapping0); |     ASSERT(0 != Mapping0); | ||||||
|         Success = CloseHandle(Handle); |     MappedView0 = MapViewOfFile(Mapping0, FILE_MAP_ALL_ACCESS, 0, 0, 0); | ||||||
|         ASSERT(Success); |     ASSERT(0 != MappedView0); | ||||||
|         MappedView0 = MapViewOfFile(Mapping0, FILE_MAP_ALL_ACCESS, 0, 0, 0); |     for (PUINT8 P = MappedView0, EndP = P + 16 * SystemInfo.dwAllocationGranularity; EndP > P; P++) | ||||||
|         ASSERT(0 != MappedView0); |         *P = rand() & 0xff; | ||||||
|         for (PUINT8 P = MappedView0, EndP = P + 16 * SystemInfo.dwAllocationGranularity; EndP > P; P++) |     Success = UnmapViewOfFile(MappedView0); | ||||||
|             *P = rand() & 0xff; |     ASSERT(Success); | ||||||
|         Success = UnmapViewOfFile(MappedView0); |     Success = CloseHandle(Mapping0); | ||||||
|         ASSERT(Success); |     ASSERT(Success); | ||||||
|         Success = CloseHandle(Mapping0); |     Success = CloseHandle(Handle); | ||||||
|         ASSERT(Success); |     ASSERT(Success); | ||||||
|  |  | ||||||
|         Handle = CreateFileW(File1Path, |     Handle = CreateFileW(File1Path, | ||||||
|             GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, |         GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, | ||||||
|             CREATE_NEW, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE, 0); |         CREATE_NEW, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE, 0); | ||||||
|         ASSERT(INVALID_HANDLE_VALUE != Handle); |     ASSERT(INVALID_HANDLE_VALUE != Handle); | ||||||
|         Mapping1 = CreateFileMappingW(Handle, 0, PAGE_READWRITE, |     Mapping1 = CreateFileMappingW(Handle, 0, PAGE_READWRITE, | ||||||
|             0, 16 * SystemInfo.dwAllocationGranularity, 0); |         0, 16 * SystemInfo.dwAllocationGranularity, 0); | ||||||
|         ASSERT(0 != Mapping1); |     ASSERT(0 != Mapping1); | ||||||
|         Success = CloseHandle(Handle); |     MappedView1 = MapViewOfFile(Mapping1, FILE_MAP_ALL_ACCESS, 0, 0, 0); | ||||||
|         ASSERT(Success); |     ASSERT(0 != MappedView1); | ||||||
|         MappedView1 = MapViewOfFile(Mapping1, FILE_MAP_ALL_ACCESS, 0, 0, 0); |     for (PUINT8 P = MappedView1, EndP = P + 16 * SystemInfo.dwAllocationGranularity; EndP > P; P++) | ||||||
|         ASSERT(0 != MappedView1); |         *P = rand() & 0xff; | ||||||
|         for (PUINT8 P = MappedView1, EndP = P + 16 * SystemInfo.dwAllocationGranularity; EndP > P; P++) |     Success = UnmapViewOfFile(MappedView1); | ||||||
|             *P = rand() & 0xff; |     ASSERT(Success); | ||||||
|         Success = UnmapViewOfFile(MappedView1); |     Success = CloseHandle(Mapping1); | ||||||
|         ASSERT(Success); |     ASSERT(Success); | ||||||
|         Success = CloseHandle(Mapping1); |     Success = CloseHandle(Handle); | ||||||
|         ASSERT(Success); |     ASSERT(Success); | ||||||
|  |  | ||||||
|         Success = RemoveDirectoryW(Dir1Path); |     Success = RemoveDirectoryW(Dir1Path); | ||||||
|         ASSERT(Success); |     ASSERT(Success); | ||||||
|  |  | ||||||
|         Success = RemoveDirectoryW(Dir1Path); |     Success = RemoveDirectoryW(Dir1Path); | ||||||
|         ASSERT(!Success); |     ASSERT(!Success); | ||||||
|         ASSERT(ERROR_FILE_NOT_FOUND == GetLastError()); |     ASSERT(ERROR_FILE_NOT_FOUND == GetLastError()); | ||||||
|     } |  | ||||||
| #endif |  | ||||||
|  |  | ||||||
|     memfs_stop(memfs); |     memfs_stop(memfs); | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user