kernel32/tests: Add some more tests for FILE_ATTRIBUTE_REPARSE_POINT.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-12-08 10:20:01 -06:00 committed by Alexandre Julliard
parent c84fd7cd86
commit ea5249feae
1 changed files with 31 additions and 0 deletions

View File

@ -1268,6 +1268,33 @@ static void test_mounted_folder(void)
HANDLE file;
DWORD size;
file = CreateFileA( "C:\\", 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, NULL );
ok(file != INVALID_HANDLE_VALUE, "got error %u\n", GetLastError());
status = NtQueryInformationFile( file, &io, &info, sizeof(info), FileAttributeTagInformation );
ok(!status, "got status %#x\n", status);
ok(!(info.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
&& (info.FileAttributes & FILE_ATTRIBUTE_DIRECTORY), "got attributes %#x\n", info.FileAttributes);
ok(!info.ReparseTag, "got reparse tag %#x\n", info.ReparseTag);
CloseHandle( file );
file = CreateFileA( "C:\\", 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL );
ok(file != INVALID_HANDLE_VALUE, "got error %u\n", GetLastError());
status = NtQueryInformationFile( file, &io, &info, sizeof(info), FileAttributeTagInformation );
ok(!status, "got status %#x\n", status);
ok(!(info.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
&& (info.FileAttributes & FILE_ATTRIBUTE_DIRECTORY), "got attributes %#x\n", info.FileAttributes);
ok(!info.ReparseTag, "got reparse tag %#x\n", info.ReparseTag);
CloseHandle( file );
ret = GetFileAttributesA( "C:\\" );
ok(!(ret & FILE_ATTRIBUTE_REPARSE_POINT) && (ret & FILE_ATTRIBUTE_DIRECTORY), "got attributes %#x\n", ret);
ret = CreateDirectoryA("C:\\winetest_mnt", NULL);
if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
{
@ -1324,6 +1351,10 @@ static void test_mounted_folder(void)
CloseHandle( file );
ret = GetFileAttributesA( "C:\\winetest_mnt" );
ok(ret != INVALID_FILE_ATTRIBUTES, "got error %u\n", GetLastError());
ok((ret & FILE_ATTRIBUTE_REPARSE_POINT) && (ret & FILE_ATTRIBUTE_DIRECTORY), "got attributes %#x\n", ret);
file = CreateFileA( "C:\\winetest_mnt\\windows", 0, FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL );
ok(file != INVALID_HANDLE_VALUE, "got error %u\n", GetLastError());