gdi32/tests: 64-bit GetFontFileInfo may fail with error ERROR_NOACCESS.

This commit is contained in:
Huw Davies 2015-08-20 10:50:24 +01:00 committed by Alexandre Julliard
parent acbb0bdfac
commit 5021e91940
1 changed files with 17 additions and 12 deletions

View File

@ -4116,7 +4116,7 @@ static void test_RealizationInfo(void)
{ {
HDC hdc; HDC hdc;
DWORD info[4], info2[10]; DWORD info[4], info2[10];
BOOL r; BOOL r, have_file = FALSE;
HFONT hfont, hfont_old; HFONT hfont, hfont_old;
LOGFONTA lf; LOGFONTA lf;
DWORD needed, read; DWORD needed, read;
@ -4199,8 +4199,10 @@ static void test_RealizationInfo(void)
/* Test GetFontFileInfo() */ /* Test GetFontFileInfo() */
r = pGetFontFileInfo(info2[3], 0, &file_info, sizeof(file_info), &needed); r = pGetFontFileInfo(info2[3], 0, &file_info, sizeof(file_info), &needed);
ok(r != 0, "ret 0 gle %d\n", GetLastError()); ok(r != 0 || GetLastError() == ERROR_NOACCESS, "ret %d gle %d\n", r, GetLastError());
if (r)
{
h = CreateFileW(file_info.path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); h = CreateFileW(file_info.path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
ok(h != INVALID_HANDLE_VALUE, "Unable to open file %d\n", GetLastError()); ok(h != INVALID_HANDLE_VALUE, "Unable to open file %d\n", GetLastError());
@ -4212,11 +4214,14 @@ static void test_RealizationInfo(void)
/* Read first 16 bytes from the file */ /* Read first 16 bytes from the file */
ReadFile(h, file, sizeof(file), &read, NULL); ReadFile(h, file, sizeof(file), &read, NULL);
CloseHandle(h); CloseHandle(h);
have_file = TRUE;
}
/* Get bytes 2 - 16 using GetFontFileData */ /* Get bytes 2 - 16 using GetFontFileData */
r = pGetFontFileData(info2[3], 0, 2, data, sizeof(data)); r = pGetFontFileData(info2[3], 0, 2, data, sizeof(data));
ok(r != 0, "ret 0 gle %d\n", GetLastError()); ok(r != 0, "ret 0 gle %d\n", GetLastError());
if (have_file)
ok(!memcmp(data, file + 2, sizeof(data)), "mismatch\n"); ok(!memcmp(data, file + 2, sizeof(data)), "mismatch\n");
} }