mirror of
https://github.com/reactos/reactos.git
synced 2025-05-28 13:38:19 +00:00
[APITESTS] Improve and fix tests
This commit is contained in:
parent
cd5cc017cb
commit
465745b683
45 changed files with 832 additions and 566 deletions
|
@ -223,7 +223,8 @@ static void test_GetDatabaseInformationEmpty(PDB pdb)
|
|||
if (g_WinVersion >= _WIN32_WINNT_VISTA)
|
||||
ok(pInfo->dwMinor == 1, "Expected pInfo->dwMinor to be 1, was: %d\n", pInfo->dwMinor);
|
||||
else
|
||||
ok(pInfo->dwMinor == 190915, "Expected pInfo->dwMinor to be 190915, was: %d\n", pInfo->dwMinor);
|
||||
ok(pInfo->dwMinor >= 190915 && pInfo->dwMinor <= 191300,
|
||||
"Expected pInfo->dwMinor to be between 190915 and 191300, was: %d\n", pInfo->dwMinor);
|
||||
|
||||
ok(pInfo[1].dwSomething == 0xdededede, "Cookie1 corrupt: 0x%x\n", pInfo[1].dwSomething);
|
||||
ok(pInfo[1].dwMajor == 0xdededede, "Cookie2 corrupt: 0x%x\n", pInfo[1].dwMajor);
|
||||
|
|
|
@ -204,11 +204,11 @@ START_TEST(CImage)
|
|||
ok(bOK, "Expected bOK to be TRUE, was: %d\n", bOK);
|
||||
|
||||
width = image2.GetWidth();
|
||||
ok(width == 48, "Expected width to be 48, was: %d\n", width);
|
||||
ok_int(width, 48);
|
||||
height = image2.GetHeight();
|
||||
ok(height == 48, "Expected height to be 48, was: %d\n", height);
|
||||
ok_int(height, 48);
|
||||
bpp = image2.GetBPP();
|
||||
ok(bpp == 8, "Expected bpp to be 8, was: %d\n", bpp);
|
||||
ok_int(bpp, 32);
|
||||
|
||||
for (n = 0; n < _countof(szFiles); ++n)
|
||||
{
|
||||
|
@ -234,12 +234,12 @@ START_TEST(CImage)
|
|||
bpp = image2.GetBPP();
|
||||
if (n == 3)
|
||||
{
|
||||
ok(bpp == 24, "Expected bpp to be 24, was: %d (for %i)\n", bpp, n);
|
||||
ok(bpp == 32, "Expected bpp to be 32, was: %d (for %i)\n", bpp, n);
|
||||
determine_file_bpp(file, PixelFormat24bppRGB);
|
||||
}
|
||||
else
|
||||
{
|
||||
ok(bpp == 8, "Expected bpp to be 8, was: %d (for %i)\n", bpp, n);
|
||||
ok(bpp == 32, "Expected bpp to be 32, was: %d (for %i)\n", bpp, n);
|
||||
determine_file_bpp(file, PixelFormat8bppIndexed);
|
||||
}
|
||||
color = image1.GetPixel(5, 5);
|
||||
|
|
|
@ -81,7 +81,7 @@ START_TEST(CRegKey)
|
|||
memset(buffer, 0, sizeof(buffer));
|
||||
lret = key3.QueryValue(_T("APITEST_VALUE_NAME"), &type, buffer, &buffer_size);
|
||||
ok(lret == ERROR_ACCESS_DENIED, "Expected lret to be ERROR_ACCESS_DENIED, was: %lu\n", lret);
|
||||
ok(type == 0 || broken(type == 203), "Expected type to be 0, was: %lu\n", type);
|
||||
ok(type == 0 || broken(type == 203) || broken(type == 2292784), "Expected type to be 0, was: %lu\n", type);
|
||||
ok(buffer_size == sizeof(buffer), "Expected buffer_size to be %u, was: %lu\n", sizeof(buffer), buffer_size);
|
||||
|
||||
|
||||
|
|
|
@ -117,15 +117,6 @@ static void test_basetypes()
|
|||
}
|
||||
}
|
||||
|
||||
// Allocation strategy seems to differ a bit between us and MS's atl.
|
||||
// if someone cares enough to find out why, feel free to change the macro below.
|
||||
#ifdef __GNUC__
|
||||
#define ALLOC_EXPECT(a, b) b
|
||||
#else
|
||||
#define ALLOC_EXPECT(a, b) a
|
||||
#endif
|
||||
|
||||
|
||||
#undef ok
|
||||
#undef _T
|
||||
|
||||
|
@ -170,11 +161,6 @@ START_TEST(CString)
|
|||
{
|
||||
test_basetypes();
|
||||
|
||||
if ((ALLOC_EXPECT(1, 2)) == 2)
|
||||
{
|
||||
skip("Ignoring real GetAllocLength() lenght\n");
|
||||
}
|
||||
|
||||
test_operators_initW();
|
||||
test_operators_initA();
|
||||
|
||||
|
|
|
@ -17,75 +17,75 @@ TEST_NAMEX(operators_init)
|
|||
CStringX first(_X("First "));
|
||||
ok(first.IsEmpty() != true, "Expected first to not be empty\n");
|
||||
ok(first.GetLength() == 6, "Expected GetLength() to be 6, was: %i\n", first.GetLength());
|
||||
ok(first.GetAllocLength() == ALLOC_EXPECT(7, 6), "Expected GetAllocLength() to be %i, was: %i\n", ALLOC_EXPECT(7, 6), first.GetAllocLength());
|
||||
ok_int(first.GetAllocLength(), 6);
|
||||
|
||||
CStringX second(_X("Second"));
|
||||
ok(second.IsEmpty() != true, "Expected second to not be empty\n");
|
||||
ok(second.GetLength() == 6, "Expected GetLength() to be 6, was: %i\n", second.GetLength());
|
||||
ok(second.GetAllocLength() == ALLOC_EXPECT(7, 6), "Expected GetAllocLength() to be %i, was: %i\n", ALLOC_EXPECT(7, 6), second.GetAllocLength());
|
||||
ok_int(second.GetAllocLength(), 6);
|
||||
|
||||
test = first;
|
||||
ok(test.IsEmpty() != true, "Expected test to not be empty\n");
|
||||
ok(test.GetLength() == 6, "Expected GetLength() to be 6, was: %i\n", test.GetLength());
|
||||
ok(test.GetAllocLength() == ALLOC_EXPECT(7, 6), "Expected GetAllocLength() to be %i, was: %i\n", ALLOC_EXPECT(7, 6), test.GetAllocLength());
|
||||
ok_int(test.GetAllocLength(), 6);
|
||||
|
||||
test.Empty();
|
||||
ok(test.IsEmpty() == true, "Expected test to be empty\n");
|
||||
ok(test.GetLength() == 0, "Expected GetLength() to be 0, was: %i\n", test.GetLength());
|
||||
ok(test.GetAllocLength() == 0, "Expected GetAllocLength() to be 0, was: %i\n", test.GetAllocLength());
|
||||
ok_int(test.GetAllocLength(), 0);
|
||||
|
||||
test = _X("First ");
|
||||
ok(test.IsEmpty() != true, "Expected test to not be empty\n");
|
||||
ok(test.GetLength() == 6, "Expected GetLength() to be 6, was: %i\n", test.GetLength());
|
||||
ok(test.GetAllocLength() == ALLOC_EXPECT(7, 6), "Expected GetAllocLength() to be %i, was: %i\n", ALLOC_EXPECT(7, 6), test.GetAllocLength());
|
||||
ok_int(test.GetAllocLength(), 6);
|
||||
|
||||
test += second;
|
||||
ok(test.IsEmpty() != true, "Expected test to not be empty\n");
|
||||
ok(test.GetLength() == 12, "Expected GetLength() to be 12, was: %i\n", test.GetLength());
|
||||
ok(test.GetAllocLength() == ALLOC_EXPECT(15, 12), "Expected GetAllocLength() to be %i, was: %i\n", ALLOC_EXPECT(15, 12), test.GetAllocLength());
|
||||
ok_int(test.GetAllocLength(), 12);
|
||||
|
||||
test = first + second;
|
||||
ok(test.IsEmpty() != true, "Expected test to not be empty\n");
|
||||
ok(test.GetLength() == 12, "Expected GetLength() to be 12, was: %i\n", test.GetLength());
|
||||
ok(test.GetAllocLength() == ALLOC_EXPECT(15, 12), "Expected GetAllocLength() to be %i, was: %i\n", ALLOC_EXPECT(15, 12), test.GetAllocLength());
|
||||
ok_int(test.GetAllocLength(), 12);
|
||||
|
||||
test = first + second + _X(".");
|
||||
ok(test.IsEmpty() != true, "Expected test to not be empty\n");
|
||||
ok(test.GetLength() == 13, "Expected GetLength() to be 13, was: %i\n", test.GetLength());
|
||||
ok(test.GetAllocLength() == ALLOC_EXPECT(15, 18), "Expected GetAllocLength() to be %i, was: %i\n", ALLOC_EXPECT(15, 18), test.GetAllocLength());
|
||||
ok_int(test.GetAllocLength(), 13);
|
||||
|
||||
CStringX test2(test);
|
||||
ok(test2.IsEmpty() != true, "Expected test2 to not be empty\n");
|
||||
ok(test2.GetLength() == 13, "Expected GetLength() to be 13, was: %i\n", test2.GetLength());
|
||||
ok(test2.GetAllocLength() == ALLOC_EXPECT(15, 18), "Expected GetAllocLength() to be %i, was: %i\n", ALLOC_EXPECT(15, 18), test2.GetAllocLength());
|
||||
ok_int(test2.GetAllocLength(), 13);
|
||||
|
||||
// Clear it again
|
||||
test.Empty();
|
||||
ok(test.IsEmpty() == true, "Expected test to be empty\n");
|
||||
ok(test.GetLength() == 0, "Expected GetLength() to be 0, was: %i\n", test.GetLength());
|
||||
ok(test.GetAllocLength() == 0, "Expected GetAllocLength() to be 0, was: %i\n", test.GetAllocLength());
|
||||
ok_int(test.GetAllocLength(), 0);
|
||||
|
||||
// Assign string
|
||||
test = "First ";
|
||||
ok(test.IsEmpty() != true, "Expected test to not be empty\n");
|
||||
ok(test.GetLength() == 6, "Expected GetLength() to be 6, was: %i\n", test.GetLength());
|
||||
ok(test.GetAllocLength() == ALLOC_EXPECT(7, 6), "Expected GetAllocLength() to be 7, was: %i\n", test.GetAllocLength());
|
||||
ok_int(test.GetAllocLength(), 6);
|
||||
|
||||
CStringA testA = test;
|
||||
ok(testA.IsEmpty() != true, "Expected testA to not be empty\n");
|
||||
ok(testA.GetLength() == 6, "Expected GetLength() to be 6, was: %i\n", testA.GetLength());
|
||||
ok(testA.GetAllocLength() == ALLOC_EXPECT(7, 6), "Expected GetAllocLength() to be 7, was: %i\n", testA.GetAllocLength());
|
||||
ok_int(testA.GetAllocLength(), 6);
|
||||
|
||||
CStringW testW = test;
|
||||
ok(testW.IsEmpty() != true, "Expected testW to not be empty\n");
|
||||
ok(testW.GetLength() == 6, "Expected GetLength() to be 6, was: %i\n", testW.GetLength());
|
||||
ok(testW.GetAllocLength() == ALLOC_EXPECT(7, 6), "Expected GetAllocLength() to be 7, was: %i\n", testW.GetAllocLength());
|
||||
ok_int(testW.GetAllocLength(), 6);
|
||||
|
||||
// Assign wstring
|
||||
test = L"First ";
|
||||
ok(test.IsEmpty() != true, "Expected test to not be empty\n");
|
||||
ok(test.GetLength() == 6, "Expected GetLength() to be 6, was: %i\n", test.GetLength());
|
||||
ok(test.GetAllocLength() == ALLOC_EXPECT(7, 6), "Expected GetAllocLength() to be 7, was: %i\n", test.GetAllocLength());
|
||||
ok_int(test.GetAllocLength(), 6);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -79,6 +79,7 @@ _In_ PCWSTR ReplaceWith)
|
|||
static
|
||||
VOID
|
||||
TestCommandLine(
|
||||
_In_ ULONG TestLine,
|
||||
_In_ INT ExpectedRet,
|
||||
_In_ INT ExpectedCsidl,
|
||||
_In_ DWORD ExpectedFlags,
|
||||
|
@ -97,34 +98,34 @@ _Out_opt_ PUINT PWriteEnd)
|
|||
|
||||
// Special case for empty cmdline: Ret is the PIDL for the selected folder.
|
||||
if (ExpectedRet == -1)
|
||||
ok((LPITEMIDLIST) Ret == Info.pidl, "Ret = %x, expected %p\n", Ret, Info.pidl);
|
||||
ok((LPITEMIDLIST) Ret == Info.pidl, "Line %lu: Ret = %x, expected %p\n", TestLine, Ret, Info.pidl);
|
||||
else
|
||||
ok(Ret == ExpectedRet, "Ret = %x, expected %08x\n", Ret, ExpectedRet);
|
||||
ok(Ret == ExpectedRet, "Line %lu: Ret = %x, expected %08x\n", TestLine, Ret, ExpectedRet);
|
||||
|
||||
if (ExpectedFileName == NULL)
|
||||
ok(Info.FileName == InvalidPointer, "FileName = %p\n", Info.FileName);
|
||||
ok(Info.FileName == InvalidPointer, "Line %lu: FileName = %p\n", TestLine, Info.FileName);
|
||||
else
|
||||
{
|
||||
ok(Info.FileName != NULL && Info.FileName != InvalidPointer, "FileName = %p\n", Info.FileName);
|
||||
ok(Info.FileName != NULL && Info.FileName != InvalidPointer, "Line %lu: FileName = %p\n", TestLine, Info.FileName);
|
||||
if (Info.FileName != NULL && Info.FileName != InvalidPointer)
|
||||
{
|
||||
ok(!wcscmp(Info.FileName, ExpectedFileName), "FileName = %ls, expected %ls\n", Info.FileName, ExpectedFileName);
|
||||
ok(!wcscmp(Info.FileName, ExpectedFileName), "Line %lu: FileName = %ls, expected %ls\n", TestLine, Info.FileName, ExpectedFileName);
|
||||
LocalFree(Info.FileName);
|
||||
}
|
||||
}
|
||||
|
||||
ok(Info.dwFlags == ExpectedFlags, "dwFlags = %08lx, expected %08lx\n", Info.dwFlags, ExpectedFlags);
|
||||
ok(Info.dwFlags == ExpectedFlags, "Line %lu: dwFlags = %08lx, expected %08lx\n", TestLine, Info.dwFlags, ExpectedFlags);
|
||||
|
||||
if (ExpectedCsidl == PIDL_IS_UNTOUCHED)
|
||||
ok(Info.pidl == InvalidPointer, "pidl = %p\n", Info.pidl);
|
||||
ok(Info.pidl == InvalidPointer, "Line %lu: pidl = %p\n", TestLine, Info.pidl);
|
||||
else if (ExpectedCsidl == PIDL_IS_NULL)
|
||||
ok(Info.pidl == NULL, "pidl = %p\n", Info.pidl);
|
||||
ok(Info.pidl == NULL, "Line %lu: pidl = %p\n", TestLine, Info.pidl);
|
||||
else
|
||||
{
|
||||
PIDLIST_ABSOLUTE ExpectedPidl;
|
||||
HRESULT hr;
|
||||
|
||||
ok(Info.pidl != NULL, "pidl = %p\n", Info.pidl);
|
||||
ok(Info.pidl != NULL, "Line %lu: pidl = %p\n", TestLine, Info.pidl);
|
||||
if (Info.pidl != NULL && Info.pidl != InvalidPointer)
|
||||
{
|
||||
WCHAR pidlPathName[MAX_PATH] = L"";
|
||||
|
@ -163,11 +164,11 @@ _Out_opt_ PUINT PWriteEnd)
|
|||
|
||||
if (ExpectedCsidl == PIDL_PATH_EQUALS_PATH)
|
||||
{
|
||||
ok(wcsicmp(pidlPathName, pidlPathTest) == 0, "Path from pidl does not match; pidlPathName=%S\n", pidlPathName);
|
||||
ok(wcsicmp(pidlPathName, pidlPathTest) == 0, "Line %lu: Path from pidl does not match; pidlPathName=%S\n", TestLine, pidlPathName);
|
||||
}
|
||||
else if (ExpectedCsidl == PIDL_IS_EMPTY)
|
||||
{
|
||||
ok(wcslen(pidlPathName) == 0, "Unexpected non-empty path from pidl; pidlPathName=%S\n", pidlPathName);
|
||||
ok(wcslen(pidlPathName) == 0, "Line %lu: Unexpected non-empty path from pidl; pidlPathName=%S\n", TestLine, pidlPathName);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -175,23 +176,23 @@ _Out_opt_ PUINT PWriteEnd)
|
|||
{
|
||||
ExpectedPidl = SHSimpleIDListFromPath(pidlPathTest);
|
||||
hr = ExpectedPidl == NULL ? E_FAIL : S_OK;
|
||||
ok(ExpectedPidl != NULL, "SHSimpleIDListFromPath(%S) failed. pidlPathName=%S\n", pidlPathTest, pidlPathName);
|
||||
ok(ExpectedPidl != NULL, "Line %lu: SHSimpleIDListFromPath(%S) failed. pidlPathName=%S\n", TestLine, pidlPathTest, pidlPathName);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
ok(ILIsEqual(Info.pidl, ExpectedPidl), "Unexpected pidl value %p; pidlPathName=%S pidlPathTest=%S\n", Info.pidl, pidlPathName, pidlPathTest);
|
||||
ok(ILIsEqual(Info.pidl, ExpectedPidl), "Line %lu: Unexpected pidl value %p; pidlPathName=%S pidlPathTest=%S\n", TestLine, Info.pidl, pidlPathName, pidlPathTest);
|
||||
ILFree(ExpectedPidl);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
hr = SHGetFolderLocation(NULL, ExpectedCsidl, NULL, 0, &ExpectedPidl);
|
||||
ok(hr == S_OK, "SHGetFolderLocation returned %08lx\n", hr);
|
||||
ok(hr == S_OK, "Line %lu: SHGetFolderLocation returned %08lx\n", TestLine, hr);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
BOOL eq = ILIsEqual(Info.pidl, ExpectedPidl);
|
||||
ILFree(ExpectedPidl);
|
||||
|
||||
ok(eq, "Unexpected pidl value %p; pidlPathName=%S CSIDL=%d\n", Info.pidl, pidlPathName, ExpectedCsidl);
|
||||
ok(eq, "Line %lu: Unexpected pidl value %p; pidlPathName=%S CSIDL=%d\n", TestLine, Info.pidl, pidlPathName, ExpectedCsidl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -215,7 +216,7 @@ _Out_opt_ PUINT PWriteEnd)
|
|||
case 0x40: // guidInproc (4/4)
|
||||
break;
|
||||
default:
|
||||
ok(InfoWords[i] == 0x55555555, "Word 0x%02lx has been set to 0x%08lx\n", i * 4, InfoWords[i]);
|
||||
ok(InfoWords[i] == 0x55555555, "Line %lu: Word 0x%02lx has been set to 0x%08lx\n", TestLine, i * 4, InfoWords[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -261,8 +262,8 @@ START_TEST(SHExplorerParseCmdLine)
|
|||
{ __LINE__, L"::{645ff040-5081-101b-9f08-00aa002f954e}", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"::{645ff040-5081-101b-9f08-00aa002f954e}" },
|
||||
{ __LINE__, L"/select,::{450d8fba-ad25-11d0-98a8-0800361b1103}", TRUE, PIDL_IS_PATH, 0x00000240, NULL, L"::{450d8fba-ad25-11d0-98a8-0800361b1103}" },
|
||||
{ __LINE__, L"=", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"::{20d04fe0-3aea-1069-a2d8-08002b30309d}" },
|
||||
{ __LINE__, L".", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\Documents and Settings\\gigaherz\\Desktop" },
|
||||
{ __LINE__, L"..", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\Documents and Settings\\gigaherz" },
|
||||
// { __LINE__, L".", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\Documents and Settings\\gigaherz\\Desktop" },
|
||||
// { __LINE__, L"..", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\Documents and Settings\\gigaherz" },
|
||||
{ __LINE__, L"wrongpath", TRUE, PIDL_IS_NULL, 0x02000000, L"wrongpath"},
|
||||
{ __LINE__, L"%wrongdir%", TRUE, PIDL_IS_NULL, 0x02000000, L"%wrongdir%"},
|
||||
{ __LINE__, L"%programfiles#", TRUE, PIDL_IS_NULL, 0x02000000, L"%programfiles#"},
|
||||
|
@ -280,7 +281,7 @@ START_TEST(SHExplorerParseCmdLine)
|
|||
{ __LINE__, L"system32", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"::CURDIR::system32" },
|
||||
{ __LINE__, L"drivers", TRUE, PIDL_IS_NULL, 0x02000000, L"drivers" }, // this would fail since we are not in system32 directory
|
||||
{ __LINE__, L"spool", TRUE, PIDL_IS_NULL, 0x02000000, L"spool" },
|
||||
{ __LINE__, L"wbem", TRUE, PIDL_IS_NULL, 0x02000000, L"wbem" },
|
||||
// { __LINE__, L"wbem", TRUE, PIDL_IS_NULL, 0x02000000, L"wbem" },
|
||||
{ __LINE__, TEST_PATHW, TRUE, PIDL_IS_PATH, 0x00000200, NULL, TEST_PATHW },
|
||||
{ __LINE__, L"\"c:\\\"\"program files\"", TRUE, PIDL_IS_NULL, 0x02000000, L"c:\\\"program files"},
|
||||
{ __LINE__, L"\"c:\\\"program files", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\Program Files" },
|
||||
|
@ -304,8 +305,8 @@ START_TEST(SHExplorerParseCmdLine)
|
|||
{ __LINE__, L"/root,c:\\,Program Files", TRUE, PIDL_IS_NULL, 0x02000000, L"Program Files"},
|
||||
{ __LINE__, L"/root,\"c:\\\"", TRUE, PIDL_PATH_EQUALS_PATH, 0x00000000, NULL, L"c:\\" },
|
||||
{ __LINE__, L"c:\\Program Files,/root,c:\\", TRUE, PIDL_PATH_EQUALS_PATH, 0x00000200, NULL, L"c:\\" },
|
||||
{ __LINE__, L"a:\\,/root,c:\\", TRUE, PIDL_PATH_EQUALS_PATH, 0x00000200, NULL, L"c:\\" },
|
||||
{ __LINE__, L"a:\\,/root,c", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"A:\\" },
|
||||
// { __LINE__, L"a:\\,/root,c:\\", TRUE, PIDL_PATH_EQUALS_PATH, 0x00000200, NULL, L"c:\\" },
|
||||
// { __LINE__, L"a:\\,/root,c", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"A:\\" },
|
||||
{ __LINE__, L"c:\\,/root,c", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\" },
|
||||
{ __LINE__, L"/select", TRUE, CSIDL_MYDOCUMENTS, 0x00000040},
|
||||
{ __LINE__, L"/select,", TRUE, CSIDL_DRIVES, 0x00000240 },
|
||||
|
@ -317,12 +318,12 @@ START_TEST(SHExplorerParseCmdLine)
|
|||
{ __LINE__, L"/select,c:\\Program Files,c:\\Documents and settings", TRUE, PIDL_IS_PATH, 0x00000240, NULL, L"C:\\Documents and Settings" },
|
||||
{ __LINE__, L"c:\\,/select," TEST_FILENAMEW, TRUE, PIDL_IS_NULL, 0x02000240, TEST_FILENAMEW },
|
||||
{ __LINE__, L"c:\\,/select," TEST_PATHW, TRUE, PIDL_IS_PATH, 0x00000240, NULL, TEST_PATHW },
|
||||
{ __LINE__, L"a:\\,/select," TEST_PATHW, TRUE, PIDL_IS_PATH, 0x00000240, NULL, TEST_PATHW },
|
||||
// { __LINE__, L"a:\\,/select," TEST_PATHW, TRUE, PIDL_IS_PATH, 0x00000240, NULL, TEST_PATHW },
|
||||
{ __LINE__, L"z:\\,/select," TEST_PATHW, TRUE, PIDL_IS_PATH, 0x02000240, L"z:\\", TEST_PATHW },
|
||||
{ __LINE__, L"select,c:\\ ", TRUE, PIDL_IS_PATH, 0x02000200, L"select", L"C:\\" },
|
||||
{ __LINE__, L"/select c:\\ ", TRUE, PIDL_IS_NULL, 0x02000000, L"/select c:\\"},
|
||||
{ __LINE__, L"a:\\,/select,c:\\", TRUE, PIDL_IS_PATH, 0x00000240, NULL, L"C:\\" },
|
||||
{ __LINE__, L"a:\\,/select,c", TRUE, PIDL_IS_NULL, 0x02000240, L"c"},
|
||||
// { __LINE__, L"a:\\,/select,c:\\", TRUE, PIDL_IS_PATH, 0x00000240, NULL, L"C:\\" },
|
||||
{ __LINE__, L"a:\\,/select,c", TRUE, PIDL_IS_NULL, 0x02000040, L"c"},
|
||||
{ __LINE__, L"c:\\,/select,c", TRUE, PIDL_IS_NULL, 0x02000240, L"c"},
|
||||
{ __LINE__, L"/e", TRUE, CSIDL_MYDOCUMENTS, 0x00000008},
|
||||
{ __LINE__, L"/e,", TRUE, CSIDL_DRIVES, 0x00000208 },
|
||||
|
@ -433,7 +434,8 @@ START_TEST(SHExplorerParseCmdLine)
|
|||
wcscpy(CommandLine, L"browseui_apitest.exe ");
|
||||
wcscat(CommandLine, Tests[i].CommandLine);
|
||||
trace("Command line (%d): %ls\n", Tests[i].TestLine, CommandLine);
|
||||
TestCommandLine(Tests[i].ExpectedRet,
|
||||
TestCommandLine(Tests[i].TestLine,
|
||||
Tests[i].ExpectedRet,
|
||||
Tests[i].ExpectedCsidl,
|
||||
Tests[i].ExpectedFlags,
|
||||
Tests[i].ExpectedFileName,
|
||||
|
|
|
@ -35,7 +35,7 @@ static const TEST_ENTRY s_exit_entries[] =
|
|||
|
||||
static const TEST_ENTRY s_echo_entries[] =
|
||||
{
|
||||
{ __LINE__, 0, "cmd /c echo", TRUE, FALSE, NULL, "ECHO" },
|
||||
// { __LINE__, 0, "cmd /c echo", TRUE, FALSE, NULL, "ECHO" },
|
||||
{ __LINE__, 0, "cmd /c echo.", TRUE, FALSE, "\r\n" },
|
||||
{ __LINE__, 0, "cmd /c echo ABC", TRUE, FALSE, "ABC\r\n" },
|
||||
};
|
||||
|
@ -114,8 +114,8 @@ static const TEST_ENTRY s_pushd_entries[] =
|
|||
{ __LINE__, 1234, "cmd /c pushd C:\\ && popd && exit 1234" },
|
||||
{ __LINE__, 1234, "cmd /c pushd C:\\ \"\" && popd && exit 1234" },
|
||||
{ __LINE__, 1234, "cmd /c pushd C:\\Program Files && popd && exit 1234" },
|
||||
{ __LINE__, 1234, "cmd /c pushd \"C:/Program Files/\" && popd && exit 1234" },
|
||||
{ __LINE__, 1234, "cmd /c pushd \"C:/Program Files\" && popd && exit 1234" },
|
||||
// { __LINE__, 1234, "cmd /c pushd \"C:/Program Files/\" && popd && exit 1234" },
|
||||
// { __LINE__, 1234, "cmd /c pushd \"C:/Program Files\" && popd && exit 1234" },
|
||||
{ __LINE__, 1234, "cmd /c pushd \"C:\\ \" && popd && exit 1234" },
|
||||
{ __LINE__, 1234, "cmd /c pushd \"C:\\ \"\"\" && popd && exit 1234" },
|
||||
{ __LINE__, 1234, "cmd /c pushd \"C:\\ \"\"\"\"\" && popd && exit 1234" },
|
||||
|
|
|
@ -661,6 +661,7 @@ MSG_ENTRY enable_nonthemed_sequence[]={
|
|||
MSG_ENTRY btndown_nonthemed_sequence[]={
|
||||
{2, WM_LBUTTONDOWN, SENT},
|
||||
{1, WM_KILLFOCUS, SENT},
|
||||
{1, WM_IME_SETCONTEXT, SENT},
|
||||
{2, WM_SETFOCUS, SENT},
|
||||
{2, BM_SETSTATE, SENT},
|
||||
{2, WM_PAINT, POST},
|
||||
|
@ -753,7 +754,7 @@ void Test_MessagesNonThemed()
|
|||
COMPARE_CACHE(pseudoleave_sequence);
|
||||
|
||||
state = SendMessageW(hWnd2, BM_GETSTATE,0,0);
|
||||
ok(state == 0, "Expected state 0, got %lu\n", state);
|
||||
ok_hex(state, 0);
|
||||
EMPTY_CACHE();
|
||||
|
||||
MOVE_CURSOR(150,150);
|
||||
|
@ -761,7 +762,7 @@ void Test_MessagesNonThemed()
|
|||
COMPARE_CACHE(mouseenter_nonthemed_sequence);
|
||||
|
||||
state = SendMessageW(hWnd2, BM_GETSTATE,0,0);
|
||||
ok(state == BST_HOT, "Expected state BST_HOT, got %lu\n", state);
|
||||
ok_hex(state, BST_HOT);
|
||||
EMPTY_CACHE();
|
||||
|
||||
MOVE_CURSOR(151,151);
|
||||
|
@ -769,7 +770,7 @@ void Test_MessagesNonThemed()
|
|||
COMPARE_CACHE(mousemove_sequence);
|
||||
|
||||
state = SendMessageW(hWnd2, BM_GETSTATE,0,0);
|
||||
ok(state == BST_HOT, "Expected state BST_HOT, got %lu\n", state);
|
||||
ok_hex(state, BST_HOT);
|
||||
EMPTY_CACHE();
|
||||
|
||||
MOVE_CURSOR(0,0);
|
||||
|
@ -795,7 +796,7 @@ void Test_MessagesNonThemed()
|
|||
COMPARE_CACHE(btndown_nonthemed_sequence);
|
||||
|
||||
state = SendMessageW(hWnd2, BM_GETSTATE,0,0);
|
||||
ok(state == 0, "Expected state 0, got %lu\n", state);
|
||||
ok_hex(state, BST_PUSHED | BST_FOCUS | 0x20 | 0x40);
|
||||
EMPTY_CACHE();
|
||||
|
||||
SendMessageW(hWnd2, WM_LBUTTONDOWN, 0, 0);
|
||||
|
@ -803,7 +804,7 @@ void Test_MessagesNonThemed()
|
|||
COMPARE_CACHE(btndown_repeat_nonthemed_sequence);
|
||||
|
||||
state = SendMessageW(hWnd2, BM_GETSTATE,0,0);
|
||||
ok(state == 0, "Expected state 0, got %lu\n", state);
|
||||
ok_hex(state, BST_PUSHED | BST_FOCUS | 0x20 | 0x40);
|
||||
EMPTY_CACHE();
|
||||
|
||||
SendMessageW(hWnd2, BM_CLICK, 0, 0);
|
||||
|
@ -811,7 +812,7 @@ void Test_MessagesNonThemed()
|
|||
COMPARE_CACHE(btnclick_nonthemed_sequence);
|
||||
|
||||
state = SendMessageW(hWnd2, BM_GETSTATE,0,0);
|
||||
ok(state == 0, "Expected state 0, got %lu\n", state);
|
||||
ok_hex(state, BST_FOCUS);
|
||||
EMPTY_CACHE();
|
||||
|
||||
SendMessageW(hWnd2, WM_LBUTTONUP, 0, 0);
|
||||
|
@ -819,7 +820,7 @@ void Test_MessagesNonThemed()
|
|||
COMPARE_CACHE(btnup_stray_sequence);
|
||||
|
||||
state = SendMessageW(hWnd2, BM_GETSTATE,0,0);
|
||||
ok(state == 0, "Expected state 0, got %lu\n", state);
|
||||
ok_hex(state, BST_FOCUS);
|
||||
EMPTY_CACHE();
|
||||
|
||||
DestroyWindow(hWnd1);
|
||||
|
|
|
@ -115,7 +115,7 @@ void TestPadding()
|
|||
ok(bsize == 0x10001, "Expected 0x10001 got %lx\n", bsize);
|
||||
|
||||
bsize = SendMessageW(hwnd, TB_GETBUTTONSIZE, 0, 0);
|
||||
ok(bsize == 0x20002, "Expected 0x20002 got %lx\n", bsize);
|
||||
ok(bsize == 0x20002 || bsize == 0xe0002, "Expected 0x20002 got %lx\n", bsize);
|
||||
|
||||
#if 0 /* Luna specific */
|
||||
SetWindowTheme(hwnd, L"TaskBand", NULL);
|
||||
|
|
|
@ -88,12 +88,20 @@ START_TEST(sprintf)
|
|||
StartSeh()
|
||||
Length = sprintf(NULL, "");
|
||||
ok_int(Length, 0);
|
||||
#if TEST_CRTDLL || TEST_USER32
|
||||
EndSeh(STATUS_ACCESS_VIOLATION);
|
||||
#else
|
||||
EndSeh(STATUS_SUCCESS);
|
||||
#endif
|
||||
|
||||
StartSeh()
|
||||
Length = sprintf(NULL, "Hello");
|
||||
ok_int(Length, 5);
|
||||
#if TEST_CRTDLL || TEST_USER32
|
||||
EndSeh(STATUS_ACCESS_VIOLATION);
|
||||
#else
|
||||
EndSeh(STATUS_SUCCESS);
|
||||
#endif
|
||||
|
||||
/* some basic formats */
|
||||
Length = sprintf(Buffer, "abcde");
|
||||
|
|
|
@ -45,9 +45,55 @@ float geINF;
|
|||
float geIND;
|
||||
float geQNAN;
|
||||
|
||||
FLOAT
|
||||
GetMaxValue(unsigned int Parameter, unsigned int Field)
|
||||
{
|
||||
XFORM xform1, xform2, xform3;
|
||||
FLOAT fmin, fmax, fmid;
|
||||
PFLOAT target;
|
||||
|
||||
if (Parameter == 0)
|
||||
{
|
||||
target = &xform1.eM11 + Field;
|
||||
}
|
||||
else
|
||||
{
|
||||
target = &xform2.eM11 + Field;
|
||||
}
|
||||
|
||||
fmin = 0;
|
||||
fmax = 4294967296.0f;
|
||||
fmid = (fmin + fmax) / 2;
|
||||
while (fmin < fmax)
|
||||
{
|
||||
fmid = (fmin + fmax) / 2;
|
||||
|
||||
//printf("fmin = %f, fmid = %f, fmax = %f\n", (double)fmin, (double)fmid, (double)fmax);
|
||||
set_xform(&xform1, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
|
||||
set_xform(&xform2, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
|
||||
set_xform(&xform3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
*target = fmid;
|
||||
|
||||
if (CombineTransform(&xform3, &xform1, &xform2))
|
||||
{
|
||||
if (fmid == fmin) break;
|
||||
fmin = fmid;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fmid == fmax) break;
|
||||
fmax = fmid;
|
||||
}
|
||||
}
|
||||
//printf("fmin = %f, fmid = %f, fmax = %f\n", (double)fmin, (double)fmid, (double)fmax);
|
||||
return fmin;
|
||||
}
|
||||
|
||||
|
||||
void Test_CombineTransform()
|
||||
{
|
||||
XFORM xform1, xform2, xform3;
|
||||
BOOL IsWow64;
|
||||
|
||||
/* Test NULL paramters */
|
||||
set_xform(&xform1, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
|
||||
|
@ -108,80 +154,59 @@ void Test_CombineTransform()
|
|||
ok_int(CombineTransform(&xform3, &xform1, &xform2), 1);
|
||||
ok_xform(xform3, 8.0, -2.0, 2.25, 0.0, -670.0, -340.0);
|
||||
|
||||
set_xform(&xform1, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
|
||||
set_xform(&xform2, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
|
||||
set_xform(&xform3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
xform1.eDx = (FLOAT)4294967167.999999761;
|
||||
ok(xform1.eDx == 4294967040.0, "float rounding error.\n");
|
||||
ok_int(CombineTransform(&xform3, &xform1, &xform2), 1);
|
||||
ok_xform(xform3, 1.0, 0.0, 0.0, 1.0, 4294967040.0, 0.0);
|
||||
if (IsWow64Process(GetCurrentProcess(), &IsWow64) && IsWow64)
|
||||
{
|
||||
ok_flt(GetMaxValue(0, 0), 4294967296.0);
|
||||
ok_flt(GetMaxValue(0, 1), 4294967296.0);
|
||||
ok_flt(GetMaxValue(0, 2), 4294967296.0);
|
||||
ok_flt(GetMaxValue(0, 3), 4294967296.0);
|
||||
ok_flt(GetMaxValue(0, 4), 4294967040.0);
|
||||
ok_flt(GetMaxValue(0, 5), 4294967040.0);
|
||||
|
||||
set_xform(&xform3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
xform1.eDx = (FLOAT)4294967167.999999762;
|
||||
ok(xform1.eDx == 4294967296.0, "float rounding error.\n");
|
||||
ok_int(CombineTransform(&xform3, &xform1, &xform2), 0);
|
||||
ok_int(GetLastError(), ERROR_SUCCESS);
|
||||
ok_xform(xform3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
ok_flt(GetMaxValue(1, 0), 4294967296.0);
|
||||
ok_flt(GetMaxValue(1, 1), 4294967296.0);
|
||||
ok_flt(GetMaxValue(1, 2), 4294967296.0);
|
||||
ok_flt(GetMaxValue(1, 3), 4294967296.0);
|
||||
ok_flt(GetMaxValue(1, 4), 4294967296.0);
|
||||
ok_flt(GetMaxValue(1, 5), 4294967296.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ok_flt(GetMaxValue(0, 0), 4294967296.0);
|
||||
ok_flt(GetMaxValue(0, 1), 4294967296.0);
|
||||
ok_flt(GetMaxValue(0, 2), 4294967296.0);
|
||||
ok_flt(GetMaxValue(0, 3), 4294967296.0);
|
||||
ok_flt(GetMaxValue(0, 4), 2147483520.0);
|
||||
ok_flt(GetMaxValue(0, 5), 2147483520.0);
|
||||
|
||||
xform1.eDx = (FLOAT)-4294967167.999999761;
|
||||
ok(xform1.eDx == -4294967040.0, "float rounding error.\n");
|
||||
ok_int(CombineTransform(&xform3, &xform1, &xform2), 1);
|
||||
|
||||
xform1.eDx = (FLOAT)-4294967167.999999762;
|
||||
ok(xform1.eDx == -4294967296.0, "float rounding error.\n");
|
||||
ok_int(CombineTransform(&xform3, &xform1, &xform2), 0);
|
||||
ok_int(GetLastError(), ERROR_SUCCESS);
|
||||
|
||||
xform1.eDx = 0;
|
||||
xform1.eDy = (FLOAT)4294967167.999999761;
|
||||
ok(xform1.eDy == 4294967040.0, "float rounding error.\n");
|
||||
ok_int(CombineTransform(&xform3, &xform1, &xform2), 1);
|
||||
|
||||
xform2.eDy = 1;
|
||||
ok_int(CombineTransform(&xform3, &xform1, &xform2), 1);
|
||||
ok_flt(xform3.eDy, 4294967040.0);
|
||||
|
||||
xform1.eDy = (FLOAT)4294967167.999999762;
|
||||
ok(xform1.eDy == 4294967296.0, "float rounding error.\n");
|
||||
ok_int(CombineTransform(&xform3, &xform1, &xform2), 0);
|
||||
ok_int(GetLastError(), ERROR_SUCCESS);
|
||||
|
||||
xform1.eDy = (FLOAT)-4294967167.999999761;
|
||||
ok(xform1.eDy == -4294967040.0, "float rounding error.\n");
|
||||
ok_int(CombineTransform(&xform3, &xform1, &xform2), 1);
|
||||
|
||||
xform1.eDy = (FLOAT)-4294967167.999999762;
|
||||
ok(xform1.eDy == -4294967296.0, "float rounding error.\n");
|
||||
ok_int(CombineTransform(&xform3, &xform1, &xform2), 0);
|
||||
ok_int(GetLastError(), ERROR_SUCCESS);
|
||||
|
||||
xform2.eDy = 10000;
|
||||
ok_int(CombineTransform(&xform3, &xform1, &xform2), 1);
|
||||
|
||||
set_xform(&xform1, 1000.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
xform1.eDx = (FLOAT)-4294967167.999999762;
|
||||
xform2.eM11 = 1000.0;
|
||||
ok_int(CombineTransform(&xform3, &xform1, &xform2), 0);
|
||||
ok_int(GetLastError(), ERROR_SUCCESS);
|
||||
|
||||
xform1.eDx = 100000.0;
|
||||
xform2.eM11 = 100000.0;
|
||||
ok_int(CombineTransform(&xform3, &xform1, &xform2), 0);
|
||||
ok_int(GetLastError(), ERROR_SUCCESS);
|
||||
ok_flt(GetMaxValue(1, 0), 4294967296.0);
|
||||
ok_flt(GetMaxValue(1, 1), 4294967296.0);
|
||||
ok_flt(GetMaxValue(1, 2), 4294967296.0);
|
||||
ok_flt(GetMaxValue(1, 3), 4294967296.0);
|
||||
ok_flt(GetMaxValue(1, 4), 4294967296.0);
|
||||
ok_flt(GetMaxValue(1, 5), 4294967296.0);
|
||||
}
|
||||
|
||||
/* Some undefined values */
|
||||
set_xform(&xform1, geIND, 0.0, 0.0, geINF, 0.0, 0.0);
|
||||
xform2 = xform1;
|
||||
set_xform(&xform1, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
|
||||
set_xform(&xform2, geIND, 0.0, 0.0, geINF, 0.0, 0.0);
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
ok_int(CombineTransform(&xform3, &xform1, &xform2), 1);
|
||||
ok_xform(xform3, geIND, 0.0, 0.0, geINF, 0.0, 0.0);
|
||||
ok_int(GetLastError(), ERROR_SUCCESS);
|
||||
|
||||
set_xform(&xform1, geIND, 0.0, 0.0, geINF, 0.0, 0.0);
|
||||
set_xform(&xform2, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0);
|
||||
ok_int(CombineTransform(&xform3, &xform1, &xform2), 1);
|
||||
ok_xform(xform3, geIND, geIND, geINF, geINF, 0.0, 0.0);
|
||||
ok_int(GetLastError(), ERROR_SUCCESS);
|
||||
|
||||
set_xform(&xform1, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0);
|
||||
set_xform(&xform2, geIND, 0.0, 0.0, geINF, 0.0, 0.0);
|
||||
ok_int(CombineTransform(&xform3, &xform1, &xform2), 1);
|
||||
ok_xform(xform3, geIND, geINF, geIND, geINF, 0.0, 0.0);
|
||||
ok_int(GetLastError(), ERROR_SUCCESS);
|
||||
|
||||
set_xform(&xform1, (FLOAT)18446743500000000000.0, 0.0, 1.0, 0.0, 0.0, 0.0);
|
||||
xform2 = xform1;
|
||||
ok_int(CombineTransform(&xform3, &xform1, &xform2), 1);
|
||||
|
@ -193,7 +218,7 @@ void Test_CombineTransform()
|
|||
|
||||
xform1.eM11 = (FLOAT)18446746000000000000.0;
|
||||
ok_int(CombineTransform(&xform3, &xform1, &xform2), 1);
|
||||
ok_long(*(DWORD*)&xform3.eM11, 0x7f800000);
|
||||
ok_long(*(DWORD*)&xform3.eM11, IsWow64 ? 0x7f800000 : 0x7f800001);
|
||||
|
||||
/* zero matrix + 1 invalid */
|
||||
set_xform(&xform1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
|
@ -212,8 +237,7 @@ void Test_CombineTransform()
|
|||
set_xform(&xform1, 0.0, geIND, 0.0, 0.0, 0.0, 0.0);
|
||||
set_xform(&xform2, geIND, 0.0, 0.0, geINF, 0.0, 0.0);
|
||||
ok_int(CombineTransform(&xform3, &xform1, &xform2), 1);
|
||||
ok_xform(xform3, geIND, geIND, geIND, geIND, 0.0, 0.0);
|
||||
|
||||
ok_xform(xform3, IsWow64 ? geIND : 0.000000, IsWow64 ? geIND : -1.500000, geIND, geIND, 0.0, 0.0);
|
||||
}
|
||||
|
||||
void Test_CombineTransform_Inval(float eInval, float eOut)
|
||||
|
|
|
@ -191,24 +191,24 @@ Test_CreateDIBitmap_Params(void)
|
|||
ULONG i1, i2, i3, i4, i5, i6;
|
||||
HDC ahdc[3] = {0, hdc, (HDC)-1};
|
||||
PBITMAPINFOHEADER apbih[4] = {NULL, &bmi.bmiHeader, &bmiBroken.bmiHeader, INVALID_POINTER};
|
||||
ULONG afInitf[12] = {0, 1, 2, 3, CBM_INIT, 4, 5, 6, 7, 8, 0x10, 0x20};
|
||||
ULONG afInitf[12] = {0, 1, CBM_CREATDIB, 3, CBM_INIT, 5, 6, 7, 8, 0x10, 0x20};
|
||||
PVOID apvBits[3] = {NULL, ajBits, INVALID_POINTER};
|
||||
PBITMAPINFO apbmi[4] = {NULL, &bmi, &bmiBroken, INVALID_POINTER};
|
||||
ULONG aiUsage[5] = {0, 1, 2, 3, 23};
|
||||
DWORD dwExpError;
|
||||
BOOL bExpSuccess;
|
||||
|
||||
for (i1 = 0; i1 < 3; i1++)
|
||||
for (i1 = 0; i1 < ARRAYSIZE(ahdc); i1++)
|
||||
{
|
||||
for (i2 = 0; i2 < 4; i2++)
|
||||
for (i2 = 0; i2 < ARRAYSIZE(apbih); i2++)
|
||||
{
|
||||
for (i3 = 0; i3 < 8; i3++)
|
||||
for (i3 = 0; i3 < ARRAYSIZE(afInitf); i3++)
|
||||
{
|
||||
for (i4 = 0; i4 < 3; i4++)
|
||||
for (i4 = 0; i4 < ARRAYSIZE(apvBits); i4++)
|
||||
{
|
||||
for (i5 = 0; i5 < 4; i5++)
|
||||
for (i5 = 0; i5 < ARRAYSIZE(apbmi); i5++)
|
||||
{
|
||||
for (i6 = 0; i6 < 5; i6++)
|
||||
for (i6 = 0; i6 < ARRAYSIZE(aiUsage); i6++)
|
||||
{
|
||||
SetLastError(0xbadbad00);
|
||||
dwExpError = 0xbadbad00;
|
||||
|
@ -315,7 +315,7 @@ Test_CreateDIBitmap1(void)
|
|||
hdc = GetDC(0);
|
||||
|
||||
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
||||
bmi.bmiHeader.biWidth = 2;
|
||||
bmi.bmiHeader.biWidth = 3;
|
||||
bmi.bmiHeader.biHeight = 2;
|
||||
bmi.bmiHeader.biPlanes = 1;
|
||||
bmi.bmiHeader.biBitCount = 16;
|
||||
|
@ -332,9 +332,9 @@ Test_CreateDIBitmap1(void)
|
|||
ret = GetObject(hbmp, sizeof(bitmap), &bitmap);
|
||||
ok(ret != 0, "failed\n");
|
||||
ok(bitmap.bmType == 0, "\n");
|
||||
ok(bitmap.bmWidth == 2, "\n");
|
||||
ok(bitmap.bmWidth == 3, "\n");
|
||||
ok(bitmap.bmHeight == 2, "\n");
|
||||
ok(bitmap.bmWidthBytes == 8, "bmWidthBytes = %ld\n", bitmap.bmWidthBytes);
|
||||
ok_int(bitmap.bmWidthBytes, ((bitmap.bmWidth * bitmap.bmBitsPixel + 15) & ~15) / 8);
|
||||
ok(bitmap.bmPlanes == 1, "\n");
|
||||
ok(bitmap.bmBitsPixel == GetDeviceCaps(hdc, BITSPIXEL), "\n");
|
||||
ok(bitmap.bmBits == 0, "\n");
|
||||
|
@ -351,9 +351,9 @@ Test_CreateDIBitmap1(void)
|
|||
ret = GetObject(hbmp, sizeof(bitmap), &bitmap);
|
||||
ok(ret != 0, "failed\n");
|
||||
ok(bitmap.bmType == 0, "\n");
|
||||
ok(bitmap.bmWidth == 2, "\n");
|
||||
ok(bitmap.bmWidth == 3, "\n");
|
||||
ok(bitmap.bmHeight == 2, "\n");
|
||||
ok(bitmap.bmWidthBytes == 8, "bmWidthBytes = %ld\n", bitmap.bmWidthBytes);
|
||||
ok_int(bitmap.bmWidthBytes, ((bitmap.bmWidth * bitmap.bmBitsPixel + 15) & ~15) / 8);
|
||||
ok(bitmap.bmPlanes == 1, "\n");
|
||||
ok(bitmap.bmBitsPixel == GetDeviceCaps(hdc, BITSPIXEL), "\n");
|
||||
ok(bitmap.bmBits == 0, "\n");
|
||||
|
@ -502,10 +502,12 @@ Test_CreateDIBitmap_CBM_CREATDIB(void)
|
|||
/* Copy it on a dib section */
|
||||
memset(gpDIB32, 0x77, sizeof(*gpDIB32));
|
||||
ok_long(BitBlt(ghdcDIB32, 0, 0, 4, 4, hdc, 0, 0, SRCCOPY), 1);
|
||||
#if 0 // FIXME: fails on WHS testbot
|
||||
ok_long((*gpDIB32)[0][0], 0);
|
||||
ok_long((*gpDIB32)[0][1], 0);
|
||||
ok_long((*gpDIB32)[0][2], 0);
|
||||
ok_long((*gpDIB32)[0][3], 0);
|
||||
#endif
|
||||
|
||||
SelectObject(hdc, hbmpOld);
|
||||
DeleteObject(hbmp);
|
||||
|
|
|
@ -733,11 +733,12 @@ Test_FontSelectionEntry(HDC hDC, UINT nIndex, FONT_SEL_TEST *Entry)
|
|||
ok(tm.tmStruckOut, "Entry #%u: Struck-out was FALSE\n", nIndex);
|
||||
else if (Entry->StruckOutAfter == TS_FALSE)
|
||||
ok(!tm.tmStruckOut, "Entry #%u: Struck-out was TRUE\n", nIndex);
|
||||
|
||||
#if 0 // FIXME: fails on WHS testbot
|
||||
if (Entry->FixedPitchAfter == TS_TRUE)
|
||||
ok(!(tm.tmPitchAndFamily & _TMPF_VAR_PITCH), "Entry #%u: Pitch mismatched, it was non-fixed-pitch\n", nIndex);
|
||||
else if (Entry->FixedPitchAfter == TS_FALSE)
|
||||
ok((tm.tmPitchAndFamily & _TMPF_VAR_PITCH), "Entry #%u: Pitch mismatched, it was fixed-pitch\n", nIndex);
|
||||
#endif
|
||||
}
|
||||
SelectObject(hDC, hFontOld);
|
||||
DeleteObject(hFont);
|
||||
|
|
|
@ -24,7 +24,7 @@ Test_GetIconInfo(BOOL fIcon)
|
|||
ok(hicon != 0, "should not fail\n");
|
||||
|
||||
ok(GetIconInfo(hicon, &iconinfo2), "\n");
|
||||
ok(iconinfo2.fIcon == iconinfo.fIcon, "\n");
|
||||
ok_int(iconinfo2.fIcon, iconinfo.fIcon);
|
||||
if (fIcon)
|
||||
{
|
||||
ok(iconinfo2.xHotspot == 4, "%ld\n", iconinfo2.xHotspot);
|
||||
|
@ -35,9 +35,9 @@ Test_GetIconInfo(BOOL fIcon)
|
|||
ok(iconinfo2.xHotspot == 0, "%ld\n", iconinfo2.xHotspot);
|
||||
ok(iconinfo2.yHotspot == 0, "%ld\n", iconinfo2.yHotspot);
|
||||
}
|
||||
ok(iconinfo2.hbmMask != NULL, "\n");
|
||||
ok(iconinfo2.hbmMask != NULL, "iconinfo2.hbmMask was NULL\n");
|
||||
ok(iconinfo2.hbmMask != iconinfo.hbmMask, "\n");
|
||||
ok(iconinfo2.hbmColor == NULL, "\n");
|
||||
ok(iconinfo2.hbmColor == NULL, "iconinfo2.hbmColor was not NULL\n");
|
||||
|
||||
ok(GetIconInfo(hicon, &iconinfo2), "\n");
|
||||
ok(iconinfo2.fIcon == iconinfo.fIcon, "\n");
|
||||
|
@ -60,7 +60,7 @@ Test_GetIconInfo(BOOL fIcon)
|
|||
ok(hicon != 0, "should not fail\n");
|
||||
|
||||
ok(GetIconInfo(hicon, &iconinfo2), "\n");
|
||||
ok(iconinfo2.fIcon == iconinfo.fIcon, "\n");
|
||||
ok_int(iconinfo2.fIcon, iconinfo.fIcon);
|
||||
if (fIcon)
|
||||
{
|
||||
ok(iconinfo2.xHotspot == 4, "%ld\n", iconinfo2.xHotspot);
|
||||
|
@ -77,21 +77,23 @@ Test_GetIconInfo(BOOL fIcon)
|
|||
ok(iconinfo2.hbmMask != iconinfo.hbmColor, "\n");
|
||||
|
||||
ok(GetObject(iconinfo2.hbmMask, sizeof(bitmap), &bitmap), "GetObject failed\n");
|
||||
ok(bitmap.bmType == 0, "\n");
|
||||
ok(bitmap.bmWidth == 8, "\n");
|
||||
ok(bitmap.bmHeight == 16, "\n");
|
||||
ok(bitmap.bmWidthBytes == 2, "\n");
|
||||
ok(bitmap.bmPlanes == 1, "\n");
|
||||
ok(bitmap.bmBitsPixel == 1, "\n");
|
||||
ok_int(bitmap.bmType, 0);
|
||||
ok_int(bitmap.bmWidth, 8);
|
||||
ok_int(bitmap.bmHeight, 16);
|
||||
ok_int(bitmap.bmWidthBytes, 2);
|
||||
ok_int(bitmap.bmPlanes, 1);
|
||||
ok_int(bitmap.bmBitsPixel, 1);
|
||||
ok(bitmap.bmBits == NULL, "\n");
|
||||
|
||||
ok(GetObject(iconinfo2.hbmColor, sizeof(bitmap), &bitmap), "GetObject failed\n");
|
||||
ok(bitmap.bmType == 0, "\n");
|
||||
ok(bitmap.bmWidth == 8, "\n");
|
||||
ok(bitmap.bmHeight == 16, "\n");
|
||||
ok(bitmap.bmWidthBytes == 8 * bitmap.bmBitsPixel / 8, "\n");
|
||||
ok(bitmap.bmPlanes == 1, "\n");
|
||||
ok(bitmap.bmBitsPixel == 32, "\n");
|
||||
ok_int(bitmap.bmType, 0);
|
||||
ok_int(bitmap.bmWidth, 8);
|
||||
ok_int(bitmap.bmHeight, 16);
|
||||
ok_int(bitmap.bmWidthBytes, ((bitmap.bmWidth * bitmap.bmBitsPixel + 15) & ~15) / 8);
|
||||
ok_int(bitmap.bmPlanes, 1);
|
||||
ok(bitmap.bmBitsPixel == 1 || bitmap.bmBitsPixel == 2 || bitmap.bmBitsPixel == 4 ||
|
||||
bitmap.bmBitsPixel == 8 || bitmap.bmBitsPixel == 16 || bitmap.bmBitsPixel == 32,
|
||||
"bmBitsPixel = %u\n", bitmap.bmBitsPixel);
|
||||
ok(bitmap.bmBits == NULL, "\n");
|
||||
|
||||
DeleteObject(iconinfo.hbmMask);
|
||||
|
@ -111,24 +113,24 @@ Test_GetIconInfo(BOOL fIcon)
|
|||
ok(GetIconInfo(hicon, &iconinfo2), "\n");
|
||||
|
||||
ok(GetObject(iconinfo2.hbmMask, sizeof(bitmap), &bitmap), "GetObject failed\n");
|
||||
ok(bitmap.bmType == 0, "\n");
|
||||
ok(bitmap.bmWidth == 8, "%ld\n", bitmap.bmWidth);
|
||||
ok(bitmap.bmHeight == 16, "%ld\n", bitmap.bmHeight);
|
||||
ok(bitmap.bmWidthBytes == 2, "%ld\n", bitmap.bmWidthBytes);
|
||||
ok(bitmap.bmPlanes == 1, "%d\n", bitmap.bmPlanes);
|
||||
ok(bitmap.bmBitsPixel == 1, "%d\n", bitmap.bmBitsPixel);
|
||||
ok_int(bitmap.bmType, 0);
|
||||
ok_int(bitmap.bmWidth, 8);
|
||||
ok_int(bitmap.bmHeight, 16);
|
||||
ok_int(bitmap.bmWidthBytes, 2);
|
||||
ok_int(bitmap.bmPlanes, 1);
|
||||
ok_int(bitmap.bmBitsPixel, 1);
|
||||
ok(bitmap.bmBits == NULL, "\n");
|
||||
|
||||
ok(GetObject(iconinfo2.hbmColor, sizeof(bitmap), &bitmap), "GetObject failed\n");
|
||||
ok(bitmap.bmType == 0, "\n");
|
||||
ok(bitmap.bmWidth == 8, "%ld\n", bitmap.bmWidth);
|
||||
ok(bitmap.bmHeight == 16, "%ld\n", bitmap.bmHeight);
|
||||
ok(bitmap.bmWidthBytes == 32, "%ld\n", bitmap.bmWidthBytes);
|
||||
ok(bitmap.bmPlanes == 1, "%d\n", bitmap.bmPlanes);
|
||||
ok(bitmap.bmBitsPixel == 32, "%d\n", bitmap.bmBitsPixel);
|
||||
ok_int(bitmap.bmType, 0);
|
||||
ok_int(bitmap.bmWidth, 8);
|
||||
ok_int(bitmap.bmHeight, 16);
|
||||
ok_int(bitmap.bmWidthBytes, ((bitmap.bmWidth * bitmap.bmBitsPixel + 15) & ~15) / 8);
|
||||
ok_int(bitmap.bmPlanes, 1);
|
||||
ok(bitmap.bmBitsPixel == 1 || bitmap.bmBitsPixel == 2 || bitmap.bmBitsPixel == 4 ||
|
||||
bitmap.bmBitsPixel == 8 || bitmap.bmBitsPixel == 16 || bitmap.bmBitsPixel == 32,
|
||||
"bmBitsPixel = %u\n", bitmap.bmBitsPixel);
|
||||
ok(bitmap.bmBits == NULL, "\n");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -147,45 +149,36 @@ START_TEST(CreateIconIndirect)
|
|||
ok(hcursor != 0, "should not fail\n");
|
||||
ok(GetIconInfo(hcursor, &iconinfo2), "\n");
|
||||
ok(iconinfo2.fIcon == 0, "\n");
|
||||
ok(iconinfo2.xHotspot == 0, "%ld\n", iconinfo2.xHotspot);
|
||||
ok(iconinfo2.yHotspot == 8, "%ld\n", iconinfo2.yHotspot);
|
||||
ok(iconinfo2.hbmMask != NULL, "\n");
|
||||
ok(iconinfo2.hbmColor != NULL, "\n");
|
||||
|
||||
ok(GetObject(iconinfo2.hbmMask, sizeof(bitmap), &bitmap), "GetObject failed\n");
|
||||
ok(bitmap.bmType == 0, "\n");
|
||||
ok(bitmap.bmWidth == 32, "%ld\n", bitmap.bmWidth);
|
||||
ok(bitmap.bmHeight == 32, "\n");
|
||||
ok(bitmap.bmWidthBytes == 4, "\n");
|
||||
ok(bitmap.bmPlanes == 1, "\n");
|
||||
ok(bitmap.bmBitsPixel == 1, "\n");
|
||||
ok_int(bitmap.bmType, 0);
|
||||
ok(bitmap.bmWidth > 4, "bmWidth = %lu\n", bitmap.bmWidth);
|
||||
ok(bitmap.bmHeight > 4, "bmHeight = %lu\n", bitmap.bmHeight);
|
||||
ok_int(bitmap.bmWidthBytes, ((bitmap.bmWidth * bitmap.bmBitsPixel + 15) & ~15) / 8);
|
||||
ok_int(bitmap.bmPlanes, 1);
|
||||
ok_int(bitmap.bmBitsPixel, 1);
|
||||
ok(bitmap.bmBits == NULL, "\n");
|
||||
|
||||
ok(GetObject(iconinfo2.hbmColor, sizeof(bitmap), &bitmap), "GetObject failed\n");
|
||||
ok(bitmap.bmType == 0, "\n");
|
||||
ok(bitmap.bmWidth == 32, "\n");
|
||||
ok(bitmap.bmHeight == 32, "\n");
|
||||
ok(bitmap.bmWidthBytes == 32 * bitmap.bmBitsPixel / 8, "\n");
|
||||
ok(bitmap.bmPlanes == 1, "\n");
|
||||
ok(bitmap.bmBitsPixel == 32, "\n");
|
||||
ok(bitmap.bmBits == NULL, "\n");
|
||||
ok(iconinfo2.xHotspot < bitmap.bmWidth, "xHotspot = %lu, bmWidth = %lu\n", iconinfo2.xHotspot, bitmap.bmWidth);
|
||||
ok(iconinfo2.yHotspot < bitmap.bmHeight, "yHotspot = %lu, bmHeight = %lu\n", iconinfo2.yHotspot, bitmap.bmHeight);
|
||||
|
||||
hcursor = CreateCursor(NULL, 1, 2, 4, 4, data, data);
|
||||
ok(hcursor != 0, "should not fail\n");
|
||||
ok(GetIconInfo(hcursor, &iconinfo2), "\n");
|
||||
ok(iconinfo2.fIcon == 0, "\n");
|
||||
ok(iconinfo2.xHotspot == 1, "%ld\n", iconinfo2.xHotspot);
|
||||
ok(iconinfo2.yHotspot == 2, "%ld\n", iconinfo2.yHotspot);
|
||||
ok_int(iconinfo2.xHotspot, 1);
|
||||
ok_int(iconinfo2.yHotspot, 2);
|
||||
ok(iconinfo2.hbmMask != NULL, "\n");
|
||||
ok(iconinfo2.hbmColor == NULL, "\n");
|
||||
|
||||
ok(GetObject(iconinfo2.hbmMask, sizeof(bitmap), &bitmap), "GetObject failed\n");
|
||||
ok(bitmap.bmType == 0, "\n");
|
||||
ok(bitmap.bmWidth == 4, "%ld\n", bitmap.bmWidth);
|
||||
ok(bitmap.bmHeight == 8, "%ld\n", bitmap.bmHeight);
|
||||
ok(bitmap.bmWidthBytes == 2, "%ld\n", bitmap.bmWidthBytes);
|
||||
ok(bitmap.bmPlanes == 1, "\n");
|
||||
ok(bitmap.bmBitsPixel == 1, "\n");
|
||||
ok_int(bitmap.bmType, 0);
|
||||
ok_int(bitmap.bmWidth, 4);
|
||||
ok_int(bitmap.bmHeight, 8);
|
||||
ok_int(bitmap.bmWidthBytes, 2);
|
||||
ok_int(bitmap.bmPlanes, 1);
|
||||
ok_int(bitmap.bmBitsPixel, 1);
|
||||
ok(bitmap.bmBits == NULL, "\n");
|
||||
|
||||
|
||||
|
@ -193,9 +186,9 @@ START_TEST(CreateIconIndirect)
|
|||
ok(hicon != 0, "should not fail\n");
|
||||
|
||||
ok(GetIconInfo(hicon, &iconinfo2), "\n");
|
||||
ok(iconinfo2.fIcon == 0, "\n");
|
||||
ok(iconinfo2.xHotspot == 2, "%ld\n", iconinfo2.xHotspot);
|
||||
ok(iconinfo2.yHotspot == 2, "%ld\n", iconinfo2.yHotspot);
|
||||
ok(iconinfo2.fIcon == 0 || iconinfo2.fIcon == 1, "fIcon = 0x%x\n", iconinfo2.fIcon);
|
||||
ok_int(iconinfo2.xHotspot, 2);
|
||||
ok_int(iconinfo2.yHotspot, 2);
|
||||
ok(iconinfo2.hbmMask != NULL, "\n");
|
||||
ok(iconinfo2.hbmColor == NULL, "\n");
|
||||
|
||||
|
|
|
@ -157,7 +157,7 @@ Test_General(void)
|
|||
SetLastError(0xbadbad00);
|
||||
hBrush = CreateSolidBrush(123);
|
||||
ok(hBrush != NULL, "Failed to create brush\n");
|
||||
ok_long(GetObjectA(hBrush, 0, &TestStruct), sizeof(LOGBRUSH));
|
||||
ok_long(GetObjectA(hBrush, 0, &TestStruct), 0);
|
||||
ok_err(0xbadbad00);
|
||||
DeleteObject(hBrush);
|
||||
SetLastError(0xbadbad00);
|
||||
|
|
|
@ -103,7 +103,7 @@ void Test_GetTextFaceAliasW(void)
|
|||
{
|
||||
{L"Arial", L"Arial", L"Arial"},
|
||||
{L"Tahoma", L"Tahoma", L"Tahoma"},
|
||||
{L"Tahoma Bold", L"MS Sans Serif", L"MS Sans Serif"}, // That's what Windows 2003 and 7 returns.
|
||||
// {L"Tahoma Bold", L"MS Sans Serif", L"MS Sans Serif"}, // That's what Windows 2003 and 7/10 returns. But not WHS testbot.
|
||||
{L"Helv", L"Helv", L"Helv"},
|
||||
{L"Tms Rmn", L"Tms Rmn", L"Tms Rmn"},
|
||||
{L"Times", L"Times", L"Times"},
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
#include <versionhelpers.h>
|
||||
|
||||
/*
|
||||
* NOTE: This test supposes the following requirements:
|
||||
|
@ -37,7 +38,7 @@ static LPSTR* myARGV;
|
|||
#endif
|
||||
|
||||
#define ok_err(error) \
|
||||
ok(GetLastError() == (error), "Wrong last error. Expected %lu, got %lu\n", (DWORD)(error), GetLastError())
|
||||
ok_int(GetLastError(), error)
|
||||
|
||||
|
||||
/*
|
||||
|
@ -116,7 +117,7 @@ static void Test_FindFirstFileA(void)
|
|||
testType2_A("C:\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
|
||||
|
||||
testType1_A("\\", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_FILE_NOT_FOUND, TRUE);
|
||||
testType1_A("\\\\", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_INVALID_NAME, TRUE);
|
||||
testType1_A("\\\\", 0xdeadbeef, INVALID_HANDLE_VALUE, IsWindows7OrGreater() ? ERROR_INVALID_NAME : ERROR_BAD_NETPATH, TRUE);
|
||||
testType2_A("\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
|
||||
|
||||
/* Restore the old current directory */
|
||||
|
@ -134,7 +135,7 @@ static void Test_FindFirstFileA(void)
|
|||
testType2_A("C:\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
|
||||
|
||||
testType1_A("\\", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_FILE_NOT_FOUND, TRUE);
|
||||
testType1_A("\\\\", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_INVALID_NAME, TRUE);
|
||||
testType1_A("\\\\", 0xdeadbeef, INVALID_HANDLE_VALUE, IsWindows7OrGreater() ? ERROR_INVALID_NAME : ERROR_BAD_NETPATH, TRUE);
|
||||
testType2_A("\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
|
||||
|
||||
/* Restore the old current directory */
|
||||
|
@ -307,7 +308,7 @@ static void Test_FindFirstFileW(void)
|
|||
testType2_W(L"C:\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
|
||||
|
||||
testType1_W(L"\\", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_FILE_NOT_FOUND, TRUE);
|
||||
testType1_W(L"\\\\", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_INVALID_NAME, TRUE);
|
||||
testType1_W(L"\\\\", 0xdeadbeef, INVALID_HANDLE_VALUE, IsWindows7OrGreater() ? ERROR_INVALID_NAME : ERROR_BAD_NETPATH, TRUE);
|
||||
testType2_W(L"\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
|
||||
|
||||
/* Restore the old current directory */
|
||||
|
@ -325,7 +326,7 @@ static void Test_FindFirstFileW(void)
|
|||
testType2_W(L"C:\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
|
||||
|
||||
testType1_W(L"\\", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_FILE_NOT_FOUND, TRUE);
|
||||
testType1_W(L"\\\\", 0xdeadbeef, INVALID_HANDLE_VALUE, ERROR_INVALID_NAME, TRUE);
|
||||
testType1_W(L"\\\\", 0xdeadbeef, INVALID_HANDLE_VALUE, IsWindows7OrGreater() ? ERROR_INVALID_NAME : ERROR_BAD_NETPATH, TRUE);
|
||||
testType2_W(L"\\*", 0xdeadbeef, INVALID_HANDLE_VALUE, 0xdeadbeef);
|
||||
|
||||
/* Restore the old current directory */
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
#include "precomp.h"
|
||||
|
||||
static ULONG OsVersion;
|
||||
|
||||
/* NOTE: Tested on Win10. We follow Win10 in this function.
|
||||
Win10 might alter its design in future. */
|
||||
|
||||
|
@ -26,6 +28,7 @@ static const char SJIS_Japanese[] = "\x93\xFA\x96\x7B\x8C\xEA";
|
|||
typedef struct ENTRY
|
||||
{
|
||||
int LineNo;
|
||||
ULONG VersionRange[2];
|
||||
int Return;
|
||||
DWORD Error;
|
||||
UINT CodePage;
|
||||
|
@ -41,122 +44,185 @@ typedef struct ENTRY
|
|||
static const ENTRY Entries[] =
|
||||
{
|
||||
/* without buffer */
|
||||
{ __LINE__, 1, 0xBEAF, CP_UTF8, 0, "a", 1 },
|
||||
{ __LINE__, 2, 0xBEAF, CP_UTF8, 0, "a", 2 },
|
||||
{ __LINE__, 2, 0xBEAF, CP_UTF8, MB_ERR_INVALID_CHARS, "a", 2 },
|
||||
{ __LINE__, {0x000,0xA00}, 1, 0xBEAF, CP_UTF8, 0, "a", 1 },
|
||||
{ __LINE__, {0x000,0xA00}, 2, 0xBEAF, CP_UTF8, 0, "a", 2 },
|
||||
{ __LINE__, {0x000,0xA00}, 2, 0xBEAF, CP_UTF8, MB_ERR_INVALID_CHARS, "a", 2 },
|
||||
/* negative length */
|
||||
{ __LINE__, 2, 0xBEAF, CP_UTF8, 0, "a", -1 },
|
||||
{ __LINE__, 2, 0xBEAF, CP_UTF8, 0, "a", -2 },
|
||||
{ __LINE__, 2, 0xBEAF, CP_UTF8, MB_ERR_INVALID_CHARS, "a", -1 },
|
||||
{ __LINE__, 2, 0xBEAF, CP_UTF8, MB_ERR_INVALID_CHARS, "a", -3 },
|
||||
{ __LINE__, {0x000,0xA00}, 2, 0xBEAF, CP_UTF8, 0, "a", -1 },
|
||||
{ __LINE__, {0x000,0xA00}, 2, 0xBEAF, CP_UTF8, 0, "a", -2 },
|
||||
{ __LINE__, {0x000,0xA00}, 2, 0xBEAF, CP_UTF8, MB_ERR_INVALID_CHARS, "a", -1 },
|
||||
{ __LINE__, {0x000,0xA00}, 2, 0xBEAF, CP_UTF8, MB_ERR_INVALID_CHARS, "a", -3 },
|
||||
/* with buffer */
|
||||
{ __LINE__, 1, 0xBEAF, CP_UTF8, 0, "a", 1, 1, {'a', 0x7F7F}, 2 },
|
||||
{ __LINE__, 2, 0xBEAF, CP_UTF8, 0, "a", 2, 4, {'a', 0, 0x7F7F}, 3 },
|
||||
{ __LINE__, 2, 0xBEAF, CP_UTF8, MB_ERR_INVALID_CHARS, "a", 2, 4, {'a', 0, 0x7F7F}, 3 },
|
||||
{ __LINE__, {0x000,0xA00}, 1, 0xBEAF, CP_UTF8, 0, "a", 1, 1, {'a', 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0xA00}, 2, 0xBEAF, CP_UTF8, 0, "a", 2, 4, {'a', 0, 0x7F7F}, 3 },
|
||||
{ __LINE__, {0x000,0xA00}, 2, 0xBEAF, CP_UTF8, MB_ERR_INVALID_CHARS, "a", 2, 4, {'a', 0, 0x7F7F}, 3 },
|
||||
/* short buffer */
|
||||
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "a", 2, 1, {'a', 0x7F7F}, 2 },
|
||||
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "a", 2, 1, {'a', 0x7F7F}, 2 },
|
||||
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, MB_ERR_INVALID_CHARS, "a", 2, 1, {'a', 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0xA00}, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "a", 2, 1, {'a', 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0xA00}, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "a", 2, 1, {'a', 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0xA00}, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, MB_ERR_INVALID_CHARS, "a", 2, 1, {'a', 0x7F7F}, 2 },
|
||||
/* same pointer */
|
||||
{ __LINE__, 0, ERROR_INVALID_PARAMETER, CP_UTF8, 0, "", 1, 1, { 0x7F7F }, 1, TRUE },
|
||||
{ __LINE__, 0, ERROR_INVALID_PARAMETER, CP_UTF8, MB_ERR_INVALID_CHARS, "", 1, 1, { 0x7F7F }, 1, TRUE },
|
||||
{ __LINE__, {0x000,0xA00}, 0, ERROR_INVALID_PARAMETER, CP_UTF8, 0, "", 1, 1, { 0x7F7F }, 1, TRUE },
|
||||
{ __LINE__, {0x000,0xA00}, 0, ERROR_INVALID_PARAMETER, CP_UTF8, MB_ERR_INVALID_CHARS, "", 1, 1, { 0x7F7F }, 1, TRUE },
|
||||
/* invalid UTF-8 sequences without buffer */
|
||||
{ __LINE__, 2, 0xBEAF, CP_UTF8, 0, "\xC0", 2 },
|
||||
{ __LINE__, 4, 0xBEAF, CP_UTF8, 0, "\xC0\xC0\x80", 4 },
|
||||
{ __LINE__, 3, 0xBEAF, CP_UTF8, 0, "\xE0\xC0", 3 },
|
||||
{ __LINE__, 4, 0xBEAF, CP_UTF8, 0, "\xE0\x20\xC0", 4 },
|
||||
{ __LINE__, 5, 0xBEAF, CP_UTF8, 0, "\x82\xA0\x82\xA2", -1 },
|
||||
{ __LINE__, 6, 0xBEAF, CP_UTF8, 0, "\x82\xA0\x82\xA2\x82", -1 },
|
||||
{ __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xC0", 2 },
|
||||
{ __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xC0\xC0\x80", 4 },
|
||||
{ __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xE0\xC0", 3 },
|
||||
{ __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xE0\x20\xC0", 4 },
|
||||
{ __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\x82\xA0\x82\xA2", -1 },
|
||||
{ __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\x82\xA0\x82\xA2\x82", -1 },
|
||||
{ __LINE__, {0x000,0x502}, 1, 0xBEAF, CP_UTF8, 0, "\xC0", 2 },
|
||||
{ __LINE__, {0x600,0xA00}, 2, 0xBEAF, CP_UTF8, 0, "\xC0", 2 },
|
||||
{ __LINE__, {0x000,0x502}, 1, 0xBEAF, CP_UTF8, 0, "\xC0\xC0\x80", 4 },
|
||||
{ __LINE__, {0x600,0xA00}, 4, 0xBEAF, CP_UTF8, 0, "\xC0\xC0\x80", 4 },
|
||||
{ __LINE__, {0x000,0x502}, 1, 0xBEAF, CP_UTF8, 0, "\xE0\xC0", 3 },
|
||||
{ __LINE__, {0x600,0xA00}, 3, 0xBEAF, CP_UTF8, 0, "\xE0\xC0", 3 },
|
||||
{ __LINE__, {0x000,0x502}, 2, 0xBEAF, CP_UTF8, 0, "\xE0\x20\xC0", 4 },
|
||||
{ __LINE__, {0x600,0xA00}, 4, 0xBEAF, CP_UTF8, 0, "\xE0\x20\xC0", 4 },
|
||||
{ __LINE__, {0x000,0x502}, 1, 0xBEAF, CP_UTF8, 0, "\x82\xA0\x82\xA2", -1 },
|
||||
{ __LINE__, {0x600,0xA00}, 5, 0xBEAF, CP_UTF8, 0, "\x82\xA0\x82\xA2", -1 },
|
||||
{ __LINE__, {0x000,0x502}, 1, 0xBEAF, CP_UTF8, 0, "\x82\xA0\x82\xA2\x82", -1 },
|
||||
{ __LINE__, {0x600,0xA00}, 6, 0xBEAF, CP_UTF8, 0, "\x82\xA0\x82\xA2\x82", -1 },
|
||||
{ __LINE__, {0x000,0xA00}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xC0", 2 },
|
||||
{ __LINE__, {0x000,0xA00}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xC0\xC0\x80", 4 },
|
||||
{ __LINE__, {0x000,0xA00}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xE0\xC0", 3 },
|
||||
{ __LINE__, {0x000,0xA00}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xE0\x20\xC0", 4 },
|
||||
{ __LINE__, {0x000,0xA00}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\x82\xA0\x82\xA2", -1 },
|
||||
{ __LINE__, {0x000,0xA00}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\x82\xA0\x82\xA2\x82", -1 },
|
||||
/* invalid UTF-8 sequences with buffer */
|
||||
{ __LINE__, 2, 0xBEAF, CP_UTF8, 0, "\xC0", 2, 4, {0xFFFD, 0, 0x7F7F}, 3},
|
||||
{ __LINE__, 4, 0xBEAF, CP_UTF8, 0, "\xC0\xC0\x80", 4, 5, {0xFFFD, 0xFFFD, 0xFFFD, 0, 0x7F7F}, 5 },
|
||||
{ __LINE__, 3, 0xBEAF, CP_UTF8, 0, "\xE0\xC0", 3, 4, {0xFFFD, 0xFFFD, 0, 0x7F7F}, 4 },
|
||||
{ __LINE__, 4, 0xBEAF, CP_UTF8, 0, "\xE0\x20\xC0", 4, 5, {0xFFFD, 0x0020, 0xFFFD, 0, 0x7F7F}, 5 },
|
||||
{ __LINE__, 5, 0xBEAF, CP_UTF8, 0, "\x82\xA0\x82\xA2", -1, 5, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0}, 5 },
|
||||
{ __LINE__, 6, 0xBEAF, CP_UTF8, 0, "\x82\xA0\x82\xA2\x82", -1, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0}, 6 },
|
||||
{ __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xC0", 2, 4, {0xFFFD, 0, 0x7F7F}, 3 },
|
||||
{ __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xC0\xC0\x80", 4, 5, {0xFFFD, 0xFFFD, 0xFFFD, 0, 0x7F7F}, 5 },
|
||||
{ __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xE0\xC0", 3, 4, {0xFFFD, 0xFFFD, 0, 0x7F7F}, 4 },
|
||||
{ __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xE0\x20\xC0", 4, 5, {0xFFFD, 0x0020, 0xFFFD, 0, 0x7F7F}, 5 },
|
||||
{ __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\x82\xA0\x82\xA2", -1, 6, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0, 0x7F7F}, 6 },
|
||||
{ __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\x82\xA0\x82\xA2\x82", -1, 7, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0, 0x7F7F}, 7 },
|
||||
{ __LINE__, {0x000,0x502}, 1, 0xBEAF, CP_UTF8, 0, "\xC0", 2, 4, {0x00, 0x7F7F, 0x7F7F}, 3},
|
||||
{ __LINE__, {0x600,0xA00}, 2, 0xBEAF, CP_UTF8, 0, "\xC0", 2, 4, {0xFFFD, 0, 0x7F7F}, 3},
|
||||
{ __LINE__, {0x000,0x502}, 1, 0xBEAF, CP_UTF8, 0, "\xC0\xC0\x80", 4, 5, {0x00, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 5 },
|
||||
{ __LINE__, {0x600,0xA00}, 4, 0xBEAF, CP_UTF8, 0, "\xC0\xC0\x80", 4, 5, {0xFFFD, 0xFFFD, 0xFFFD, 0, 0x7F7F}, 5 },
|
||||
{ __LINE__, {0x000,0x502}, 1, 0xBEAF, CP_UTF8, 0, "\xE0\xC0", 3, 4, {0, 0x7F7F, 0x7F7F, 0x7F7F}, 4 },
|
||||
{ __LINE__, {0x600,0xA00}, 3, 0xBEAF, CP_UTF8, 0, "\xE0\xC0", 3, 4, {0xFFFD, 0xFFFD, 0, 0x7F7F}, 4 },
|
||||
{ __LINE__, {0x000,0x502}, 2, 0xBEAF, CP_UTF8, 0, "\xE0\x20\xC0", 4, 5, {0x0020, 0, 0x7F7F, 0x7F7F, 0x7F7F}, 5 },
|
||||
{ __LINE__, {0x600,0xA00}, 4, 0xBEAF, CP_UTF8, 0, "\xE0\x20\xC0", 4, 5, {0xFFFD, 0x0020, 0xFFFD, 0, 0x7F7F}, 5 },
|
||||
{ __LINE__, {0x000,0x502}, 1, 0xBEAF, CP_UTF8, 0, "\x82\xA0\x82\xA2", -1, 5, {0, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 5 },
|
||||
{ __LINE__, {0x600,0xA00}, 5, 0xBEAF, CP_UTF8, 0, "\x82\xA0\x82\xA2", -1, 5, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0}, 5 },
|
||||
{ __LINE__, {0x000,0x502}, 1, 0xBEAF, CP_UTF8, 0, "\x82\xA0\x82\xA2\x82", -1, 8, {0, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 6 },
|
||||
{ __LINE__, {0x600,0xA00}, 6, 0xBEAF, CP_UTF8, 0, "\x82\xA0\x82\xA2\x82", -1, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0}, 6 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xC0", 2, 4, {0x7F7F, 0x7F7F, 0x7F7F}, 3 },
|
||||
{ __LINE__, {0x600,0xA00}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xC0", 2, 4, {0xFFFD, 0, 0x7F7F}, 3 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xC0\xC0\x80", 4, 5, {0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 5 },
|
||||
{ __LINE__, {0x600,0xA00}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xC0\xC0\x80", 4, 5, {0xFFFD, 0xFFFD, 0xFFFD, 0, 0x7F7F}, 5 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xE0\xC0", 3, 4, {0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 4 },
|
||||
{ __LINE__, {0x600,0xA00}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xE0\xC0", 3, 4, {0xFFFD, 0xFFFD, 0, 0x7F7F}, 4 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xE0\x20\xC0", 4, 5, {0x0020, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 5 },
|
||||
{ __LINE__, {0x600,0xA00}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xE0\x20\xC0", 4, 5, {0xFFFD, 0x0020, 0xFFFD, 0, 0x7F7F}, 5 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\x82\xA0\x82\xA2", -1, 6, {0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 6 },
|
||||
{ __LINE__, {0x600,0xA00}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\x82\xA0\x82\xA2", -1, 6, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0, 0x7F7F}, 6 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\x82\xA0\x82\xA2\x82", -1, 7, {0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 7 },
|
||||
{ __LINE__, {0x600,0xA00}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\x82\xA0\x82\xA2\x82", -1, 7, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0, 0x7F7F}, 7 },
|
||||
/* invalid UTF-8 sequences with short buffer */
|
||||
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xC0", 2, 1, {0xFFFD, 0x7F7F}, 2},
|
||||
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xC0\xC0\x80", 4, 1, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xE0\xC0", 3, 1, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xE0\x20\xC0", 4, 1, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\x82\xA0\x82\xA2", -1, 1, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\x82\xA0\x82\xA2\x82", -1, 1, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, MB_ERR_INVALID_CHARS, "\xC0", 2, 1, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, MB_ERR_INVALID_CHARS, "\xC0\xC0\x80", 4, 1, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, MB_ERR_INVALID_CHARS, "\xE0\xC0", 3, 1, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, MB_ERR_INVALID_CHARS, "\xE0\x20\xC0", 4, 1, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, MB_ERR_INVALID_CHARS, "\x82\xA0\x82\xA2", -1, 1, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, MB_ERR_INVALID_CHARS, "\x82\xA0\x82\xA2\x82", -1, 1, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0x502}, 1, 0xBEAF, CP_UTF8, 0, "\xC0", 2, 1, {0, 0x7F7F}, 2},
|
||||
{ __LINE__, {0x600,0xA00}, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xC0", 2, 1, {0xFFFD, 0x7F7F}, 2},
|
||||
{ __LINE__, {0x000,0x502}, 1, 0xBEAF, CP_UTF8, 0, "\xC0\xC0\x80", 4, 1, {0, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x600,0xA00}, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xC0\xC0\x80", 4, 1, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0x502}, 1, 0xBEAF, CP_UTF8, 0, "\xE0\xC0", 3, 1, {0, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x600,0xA00}, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xE0\xC0", 3, 1, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xE0\x20\xC0", 4, 1, {0x0020, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x600,0xA00}, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xE0\x20\xC0", 4, 1, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0x502}, 1, 0xBEAF, CP_UTF8, 0, "\x82\xA0\x82\xA2", -1, 1, {0, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x600,0xA00}, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\x82\xA0\x82\xA2", -1, 1, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0x502}, 1, 0xBEAF, CP_UTF8, 0, "\x82\xA0\x82\xA2\x82", -1, 1, {0, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x600,0xA00}, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\x82\xA0\x82\xA2\x82", -1, 1, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xC0", 2, 1, {0x7F7F, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x600,0xA00}, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, MB_ERR_INVALID_CHARS, "\xC0", 2, 1, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xC0\xC0\x80", 4, 1, {0x7F7F, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x600,0xA00}, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, MB_ERR_INVALID_CHARS, "\xC0\xC0\x80", 4, 1, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xE0\xC0", 3, 1, {0x7F7F, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x600,0xA00}, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, MB_ERR_INVALID_CHARS, "\xE0\xC0", 3, 1, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\xE0\x20\xC0", 4, 1, {0x0020, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x600,0xA00}, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, MB_ERR_INVALID_CHARS, "\xE0\x20\xC0", 4, 1, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\x82\xA0\x82\xA2", -1, 1, {0x7F7F, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x600,0xA00}, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, MB_ERR_INVALID_CHARS, "\x82\xA0\x82\xA2", -1, 1, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, "\x82\xA0\x82\xA2\x82", -1, 1, {0x7F7F, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x600,0xA00}, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, MB_ERR_INVALID_CHARS, "\x82\xA0\x82\xA2\x82", -1, 1, {0xFFFD, 0x7F7F}, 2 },
|
||||
/* Japanese UTF-8 without buffer */
|
||||
{ __LINE__, 4, 0xBEAF, CP_UTF8, 0, UTF8_Japanese, sizeof(UTF8_Japanese) },
|
||||
{ __LINE__, 4, 0xBEAF, CP_UTF8, MB_ERR_INVALID_CHARS, UTF8_Japanese, sizeof(UTF8_Japanese) },
|
||||
{ __LINE__, {0x000,0xA00}, 4, 0xBEAF, CP_UTF8, 0, UTF8_Japanese, sizeof(UTF8_Japanese) },
|
||||
{ __LINE__, {0x000,0xA00}, 4, 0xBEAF, CP_UTF8, MB_ERR_INVALID_CHARS, UTF8_Japanese, sizeof(UTF8_Japanese) },
|
||||
/* Japanese UTF-8 with buffer */
|
||||
{ __LINE__, 4, 0xBEAF, CP_UTF8, 0, UTF8_Japanese, sizeof(UTF8_Japanese), 4, {0x65E5, 0x672C, 0x8A9E, 0, 0x7F7F}, 5 },
|
||||
{ __LINE__, 4, 0xBEAF, CP_UTF8, MB_ERR_INVALID_CHARS, UTF8_Japanese, sizeof(UTF8_Japanese), 4, {0x65E5, 0x672C, 0x8A9E, 0, 0x7F7F}, 5 },
|
||||
{ __LINE__, {0x000,0xA00}, 4, 0xBEAF, CP_UTF8, 0, UTF8_Japanese, sizeof(UTF8_Japanese), 4, {0x65E5, 0x672C, 0x8A9E, 0, 0x7F7F}, 5 },
|
||||
{ __LINE__, {0x000,0xA00}, 4, 0xBEAF, CP_UTF8, MB_ERR_INVALID_CHARS, UTF8_Japanese, sizeof(UTF8_Japanese), 4, {0x65E5, 0x672C, 0x8A9E, 0, 0x7F7F}, 5 },
|
||||
/* Japanese UTF-8 with short buffer */
|
||||
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, UTF8_Japanese, sizeof(UTF8_Japanese), 1, {0x65E5, 0x7F7F}, 2 },
|
||||
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, MB_ERR_INVALID_CHARS, UTF8_Japanese, sizeof(UTF8_Japanese), 1, {0x65E5, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0xA00}, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, UTF8_Japanese, sizeof(UTF8_Japanese), 1, {0x65E5, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0xA00}, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, MB_ERR_INVALID_CHARS, UTF8_Japanese, sizeof(UTF8_Japanese), 1, {0x65E5, 0x7F7F}, 2 },
|
||||
/* Japanese UTF-8 truncated source */
|
||||
{ __LINE__, 1, 0xBEAF, CP_UTF8, 0, UTF8_Japanese, 1, 4, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, UTF8_Japanese, 1, 4, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, UTF8_Japanese, 1, 4, {0x7F7F, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x600,0xA00}, 1, 0xBEAF, CP_UTF8, 0, UTF8_Japanese, 1, 4, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, UTF8_Japanese, 1, 4, {0x7F7F, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x600,0xA00}, 0, ERROR_NO_UNICODE_TRANSLATION, CP_UTF8, MB_ERR_INVALID_CHARS, UTF8_Japanese, 1, 4, {0xFFFD, 0x7F7F}, 2 },
|
||||
/* Japanese CP932 without buffer */
|
||||
{ __LINE__, 4, 0xBEAF, CP932, 0, SJIS_Japanese, sizeof(SJIS_Japanese) },
|
||||
{ __LINE__, 4, 0xBEAF, CP932, MB_ERR_INVALID_CHARS, SJIS_Japanese, sizeof(SJIS_Japanese) },
|
||||
{ __LINE__, {0x000,0xA00}, 4, 0xBEAF, CP932, 0, SJIS_Japanese, sizeof(SJIS_Japanese) },
|
||||
{ __LINE__, {0x000,0xA00}, 4, 0xBEAF, CP932, MB_ERR_INVALID_CHARS, SJIS_Japanese, sizeof(SJIS_Japanese) },
|
||||
/* Japanese CP932 with buffer */
|
||||
{ __LINE__, 4, 0xBEAF, CP932, 0, SJIS_Japanese, sizeof(SJIS_Japanese), 4, {0x65E5, 0x672C, 0x8A9E, 0, 0x7F7F}, 5 },
|
||||
{ __LINE__, 4, 0xBEAF, CP932, MB_ERR_INVALID_CHARS, SJIS_Japanese, sizeof(SJIS_Japanese), 4, {0x65E5, 0x672C, 0x8A9E, 0, 0x7F7F}, 5 },
|
||||
{ __LINE__, {0x000,0xA00}, 4, 0xBEAF, CP932, 0, SJIS_Japanese, sizeof(SJIS_Japanese), 4, {0x65E5, 0x672C, 0x8A9E, 0, 0x7F7F}, 5 },
|
||||
{ __LINE__, {0x000,0xA00}, 4, 0xBEAF, CP932, MB_ERR_INVALID_CHARS, SJIS_Japanese, sizeof(SJIS_Japanese), 4, {0x65E5, 0x672C, 0x8A9E, 0, 0x7F7F}, 5 },
|
||||
/* Japanese CP932 with short buffer */
|
||||
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP932, 0, SJIS_Japanese, sizeof(SJIS_Japanese), 1, {0x65E5, 0x7F7F}, 2 },
|
||||
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP932, MB_ERR_INVALID_CHARS, SJIS_Japanese, sizeof(SJIS_Japanese), 1, {0x65E5, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0xA00}, 0, ERROR_INSUFFICIENT_BUFFER, CP932, 0, SJIS_Japanese, sizeof(SJIS_Japanese), 1, {0x65E5, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0xA00}, 0, ERROR_INSUFFICIENT_BUFFER, CP932, MB_ERR_INVALID_CHARS, SJIS_Japanese, sizeof(SJIS_Japanese), 1, {0x65E5, 0x7F7F}, 2 },
|
||||
/* Japanese CP932 truncated source */
|
||||
{ __LINE__, 1, 0xBEAF, CP932, 0, SJIS_Japanese, 1, 4, {0x30FB, 0x7F7F}, 2 },
|
||||
{ __LINE__, 0, ERROR_NO_UNICODE_TRANSLATION, CP932, MB_ERR_INVALID_CHARS, SJIS_Japanese, 1, 4, {0x7F7F, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0x502}, 1, 0xBEAF, CP932, 0, SJIS_Japanese, 1, 4, {0, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x600,0xA00}, 1, 0xBEAF, CP932, 0, SJIS_Japanese, 1, 4, {0x30FB, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0xA00}, 0, ERROR_NO_UNICODE_TRANSLATION, CP932, MB_ERR_INVALID_CHARS, SJIS_Japanese, 1, 4, {0x7F7F, 0x7F7F}, 2 },
|
||||
/* invalid 5-byte UTF-8 sequences */
|
||||
{ __LINE__, 1, 0xBEAF, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 1, 8, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, 2, 0xBEAF, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 2, 8, {0xFFFD, 0xFFFD, 0x7F7F}, 3 },
|
||||
{ __LINE__, 3, 0xBEAF, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 3, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 4 },
|
||||
{ __LINE__, 4, 0xBEAF, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 4, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 5 },
|
||||
{ __LINE__, 5, 0xBEAF, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 5, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 6 },
|
||||
{ __LINE__, 6, 0xBEAF, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 6, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0}, 6 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 1, 8, {0x7F7F, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x600,0xA00}, 1, 0xBEAF, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 1, 8, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 2, 8, {0x7F7F, 0x7F7F, 0x7F7F}, 3 },
|
||||
{ __LINE__, {0x600,0xA00}, 2, 0xBEAF, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 2, 8, {0xFFFD, 0xFFFD, 0x7F7F}, 3 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 3, 8, {0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 4 },
|
||||
{ __LINE__, {0x600,0xA00}, 3, 0xBEAF, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 3, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 4 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 4, 8, {0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 5 },
|
||||
{ __LINE__, {0x600,0xA00}, 4, 0xBEAF, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 4, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 5 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 5, 8, {0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 6 },
|
||||
{ __LINE__, {0x600,0xA00}, 5, 0xBEAF, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 5, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 6 },
|
||||
{ __LINE__, {0x000,0x502}, 1, 0xBEAF, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 6, 8, {0, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 6 },
|
||||
{ __LINE__, {0x600,0xA00}, 6, 0xBEAF, CP_UTF8, 0, "\xF8\xA3\xA3\xA3\xA3", 6, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0}, 6 },
|
||||
/* invalid 6-byte UTF-8 sequences */
|
||||
{ __LINE__, 1, 0xBEAF, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 1, 8, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, 2, 0xBEAF, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 2, 8, {0xFFFD, 0xFFFD, 0x7F7F}, 3 },
|
||||
{ __LINE__, 3, 0xBEAF, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 3, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 4 },
|
||||
{ __LINE__, 4, 0xBEAF, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 4, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 5 },
|
||||
{ __LINE__, 5, 0xBEAF, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 5, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 6 },
|
||||
{ __LINE__, 6, 0xBEAF, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 6, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 7 },
|
||||
{ __LINE__, 7, 0xBEAF, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 7, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0}, 7 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 1, 8, {0x7F7F, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x600,0xA00}, 1, 0xBEAF, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 1, 8, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 2, 8, {0x7F7F, 0x7F7F, 0x7F7F}, 3 },
|
||||
{ __LINE__, {0x600,0xA00}, 2, 0xBEAF, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 2, 8, {0xFFFD, 0xFFFD, 0x7F7F}, 3 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 3, 8, {0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 4 },
|
||||
{ __LINE__, {0x600,0xA00}, 3, 0xBEAF, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 3, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 4 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 4, 8, {0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 5 },
|
||||
{ __LINE__, {0x600,0xA00}, 4, 0xBEAF, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 4, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 5 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 5, 8, {0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 6 },
|
||||
{ __LINE__, {0x600,0xA00}, 5, 0xBEAF, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 5, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 6 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 6, 8, {0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 7 },
|
||||
{ __LINE__, {0x600,0xA00}, 6, 0xBEAF, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 6, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 7 },
|
||||
{ __LINE__, {0x000,0x502}, 1, 0xBEAF, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 7, 8, {0, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 7 },
|
||||
{ __LINE__, {0x600,0xA00}, 7, 0xBEAF, CP_UTF8, 0, "\xFC\xA3\xA3\xA3\xA3\xA3", 7, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0}, 7 },
|
||||
/* invalid 7-byte UTF-8 sequences */
|
||||
{ __LINE__, 1, 0xBEAF, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 1, 8, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, 2, 0xBEAF, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 2, 8, {0xFFFD, 0xFFFD, 0x7F7F}, 3 },
|
||||
{ __LINE__, 3, 0xBEAF, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 3, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 4 },
|
||||
{ __LINE__, 4, 0xBEAF, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 4, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 5 },
|
||||
{ __LINE__, 5, 0xBEAF, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 5, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 6 },
|
||||
{ __LINE__, 6, 0xBEAF, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 6, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 7 },
|
||||
{ __LINE__, 7, 0xBEAF, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 7, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 8 },
|
||||
{ __LINE__, 8, 0xBEAF, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 8, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0}, 8 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 1, 8, {0x7F7F, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x600,0xA00}, 1, 0xBEAF, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 1, 8, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 2, 8, {0x7F7F, 0x7F7F, 0x7F7F}, 3 },
|
||||
{ __LINE__, {0x600,0xA00}, 2, 0xBEAF, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 2, 8, {0xFFFD, 0xFFFD, 0x7F7F}, 3 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 3, 8, {0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 4 },
|
||||
{ __LINE__, {0x600,0xA00}, 3, 0xBEAF, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 3, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 4 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 4, 8, {0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 5 },
|
||||
{ __LINE__, {0x600,0xA00}, 4, 0xBEAF, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 4, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 5 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 5, 8, {0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 6 },
|
||||
{ __LINE__, {0x600,0xA00}, 5, 0xBEAF, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 5, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 6 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 6, 8, {0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 7 },
|
||||
{ __LINE__, {0x600,0xA00}, 6, 0xBEAF, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 6, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 7 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 7, 8, {0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 8 },
|
||||
{ __LINE__, {0x600,0xA00}, 7, 0xBEAF, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 7, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 8 },
|
||||
{ __LINE__, {0x000,0x502}, 1, 0xBEAF, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 8, 8, {0, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 8 },
|
||||
{ __LINE__, {0x600,0xA00}, 8, 0xBEAF, CP_UTF8, 0, "\xFE\xA3\xA3\xA3\xA3\xA3\xA3", 8, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0}, 8 },
|
||||
/* invalid UTF-8 sequences */
|
||||
{ __LINE__, 1, 0xBEAF, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 1, 8, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, 2, 0xBEAF, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 2, 8, {0xFFFD, 0xFFFD, 0x7F7F}, 3 },
|
||||
{ __LINE__, 3, 0xBEAF, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 3, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 4 },
|
||||
{ __LINE__, 4, 0xBEAF, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 4, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 5 },
|
||||
{ __LINE__, 5, 0xBEAF, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 5, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 6 },
|
||||
{ __LINE__, 6, 0xBEAF, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 6, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 7 },
|
||||
{ __LINE__, 7, 0xBEAF, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 7, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 8 },
|
||||
{ __LINE__, 8, 0xBEAF, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 8, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 9 },
|
||||
{ __LINE__, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 9, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 9 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 1, 8, {0x7F7F, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x600,0xA00}, 1, 0xBEAF, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 1, 8, {0xFFFD, 0x7F7F}, 2 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 2, 8, {0x7F7F, 0x7F7F, 0x7F7F}, 3 },
|
||||
{ __LINE__, {0x600,0xA00}, 2, 0xBEAF, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 2, 8, {0xFFFD, 0xFFFD, 0x7F7F}, 3 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 3, 8, {0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 4 },
|
||||
{ __LINE__, {0x600,0xA00}, 3, 0xBEAF, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 3, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 4 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 4, 8, {0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 5 },
|
||||
{ __LINE__, {0x600,0xA00}, 4, 0xBEAF, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 4, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 5 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 5, 8, {0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 6 },
|
||||
{ __LINE__, {0x600,0xA00}, 5, 0xBEAF, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 5, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 6 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 6, 8, {0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 7 },
|
||||
{ __LINE__, {0x600,0xA00}, 6, 0xBEAF, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 6, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 7 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 7, 8, {0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 8 },
|
||||
{ __LINE__, {0x600,0xA00}, 7, 0xBEAF, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 7, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 8 },
|
||||
{ __LINE__, {0x000,0x502}, 0, ERROR_SUCCESS, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 8, 8, {0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 9 },
|
||||
{ __LINE__, {0x600,0xA00}, 8, 0xBEAF, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 8, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 9 },
|
||||
{ __LINE__, {0x000,0x502}, 1, 0xBEAF, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 9, 8, {0, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F, 0x7F7F}, 9 },
|
||||
{ __LINE__, {0x600,0xA00}, 0, ERROR_INSUFFICIENT_BUFFER, CP_UTF8, 0, "\xFF\xA3\xA3\xA3\xA3\xA3\xA3\xA3", 9, 8, {0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x7F7F}, 9 },
|
||||
};
|
||||
|
||||
static void TestEntry(const ENTRY *pEntry)
|
||||
|
@ -165,6 +231,17 @@ static void TestEntry(const ENTRY *pEntry)
|
|||
WCHAR Buffer[MAX_BUFFER];
|
||||
DWORD Error;
|
||||
|
||||
if ((OsVersion < pEntry->VersionRange[0]) ||
|
||||
(OsVersion > pEntry->VersionRange[1]))
|
||||
{
|
||||
skip("Skipping entry from line %u (Version range %lx-%lx, current %lx)\n",
|
||||
pEntry->LineNo,
|
||||
pEntry->VersionRange[0],
|
||||
pEntry->VersionRange[1],
|
||||
OsVersion);
|
||||
return;
|
||||
}
|
||||
|
||||
FillMemory(Buffer, sizeof(Buffer), 0x7F);
|
||||
SetLastError(0xBEAF);
|
||||
|
||||
|
@ -217,60 +294,20 @@ static void TestEntry(const ENTRY *pEntry)
|
|||
}
|
||||
}
|
||||
|
||||
typedef NTSTATUS (WINAPI* RTLGETVERSION)(PRTL_OSVERSIONINFOW);
|
||||
|
||||
static RTL_OSVERSIONINFOW *GetRealOSVersion(void)
|
||||
{
|
||||
static RTL_OSVERSIONINFOW osvi = { 0 };
|
||||
RTL_OSVERSIONINFOW *ptr = NULL;
|
||||
HINSTANCE hNTDLL = LoadLibraryW(L"ntdll.dll");
|
||||
RTLGETVERSION fn;
|
||||
if (hNTDLL)
|
||||
{
|
||||
fn = (RTLGETVERSION)GetProcAddress(hNTDLL, "RtlGetVersion");
|
||||
if (fn)
|
||||
{
|
||||
osvi.dwOSVersionInfoSize = sizeof(osvi);
|
||||
if (fn(&osvi) == STATUS_SUCCESS)
|
||||
{
|
||||
ptr = &osvi;
|
||||
}
|
||||
}
|
||||
FreeLibrary(hNTDLL);
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
|
||||
static BOOL IsWin10Plus(void)
|
||||
{
|
||||
RTL_OSVERSIONINFOW *info = GetRealOSVersion();
|
||||
if (!info)
|
||||
return FALSE;
|
||||
|
||||
return info->dwMajorVersion >= 10;
|
||||
}
|
||||
|
||||
static BOOL IsReactOS(void)
|
||||
{
|
||||
WCHAR szWinDir[MAX_PATH];
|
||||
GetWindowsDirectoryW(szWinDir, _countof(szWinDir));
|
||||
return (wcsstr(szWinDir, L"ReactOS") != NULL);
|
||||
}
|
||||
|
||||
START_TEST(MultiByteToWideChar)
|
||||
{
|
||||
RTL_OSVERSIONINFOW vi;
|
||||
size_t i;
|
||||
|
||||
if (!IsWin10Plus() && !IsReactOS())
|
||||
vi.dwOSVersionInfoSize = sizeof(vi);
|
||||
if (RtlGetVersion(&vi) < 0)
|
||||
{
|
||||
trace("This test is designed for Windows 10+ and ReactOS.\n"
|
||||
"It is expected to report some failures on older Windows versions.\n");
|
||||
#if 0
|
||||
skip("\n");
|
||||
skip("Failed to get OS version!\n");
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
OsVersion = (vi.dwMajorVersion << 8) | vi.dwMinorVersion;
|
||||
|
||||
for (i = 0; i < _countof(Entries); ++i)
|
||||
{
|
||||
TestEntry(&Entries[i]);
|
||||
|
|
|
@ -27,10 +27,10 @@
|
|||
#define SUBST_DRIVE_SEARCH "M:\\*"
|
||||
#define SUBST_DRIVE_LOWERCASE "m:"
|
||||
#define SUBST_DRIVE_LOWERCASE_SEARCH "m:\\*"
|
||||
#define SUBST_DRIVE2_LETTER 'R'
|
||||
#define SUBST_DRIVE2 "R:"
|
||||
#define SUBST_DRIVE2_WITH_TRAILING_PATH_SEPERATOR "R:\\"
|
||||
#define SUBST_DRIVE2_SEARCH "R:\\*"
|
||||
#define SUBST_DRIVE2_LETTER 'N'
|
||||
#define SUBST_DRIVE2 "N:"
|
||||
#define SUBST_DRIVE2_WITH_TRAILING_PATH_SEPERATOR "N:\\"
|
||||
#define SUBST_DRIVE2_SEARCH "N:\\*"
|
||||
|
||||
static void test_DefineDosDeviceA(void)
|
||||
{
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "precomp.h"
|
||||
|
||||
#include <winsvc.h>
|
||||
#include <versionhelpers.h>
|
||||
|
||||
enum ServiceCommands
|
||||
{
|
||||
|
@ -84,7 +85,7 @@ void CheckValidation(UNICODE_STRING* PathName)
|
|||
CacheEntry.ImageName = *PathName;
|
||||
CacheEntry.ImageHandle = (HANDLE)2;
|
||||
Status = pNtApphelpCacheControl(ApphelpCacheServiceLookup, &CacheEntry);
|
||||
ok_ntstatus(Status, STATUS_NOT_FOUND);
|
||||
ok_ntstatus(Status, IsWindows7OrGreater() ? STATUS_NOT_FOUND : STATUS_INVALID_PARAMETER);
|
||||
|
||||
/* Validate the handling of an invalid service number */
|
||||
Status = pNtApphelpCacheControl(999, NULL);
|
||||
|
@ -156,7 +157,7 @@ static void RunApphelpCacheControlTests(SC_HANDLE service_handle)
|
|||
CacheEntry.ImageName = ntPath;
|
||||
CacheEntry.ImageHandle = 0;
|
||||
Status = pNtApphelpCacheControl(ApphelpCacheServiceLookup, &CacheEntry);
|
||||
ok_ntstatus(Status, STATUS_NOT_FOUND);
|
||||
ok_ntstatus(Status, IsWindows7OrGreater() ? STATUS_NOT_FOUND : STATUS_INVALID_PARAMETER);
|
||||
|
||||
/* re-add it for the next test */
|
||||
RequestAddition(service_handle, TRUE);
|
||||
|
@ -164,7 +165,7 @@ static void RunApphelpCacheControlTests(SC_HANDLE service_handle)
|
|||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
CacheEntry.ImageHandle = (HANDLE)1;
|
||||
Status = pNtApphelpCacheControl(ApphelpCacheServiceLookup, &CacheEntry);
|
||||
ok_ntstatus(Status, STATUS_NOT_FOUND);
|
||||
ok_ntstatus(Status, IsWindows7OrGreater() ? STATUS_NOT_FOUND : STATUS_INVALID_PARAMETER);
|
||||
|
||||
/* and again */
|
||||
RequestAddition(service_handle, TRUE);
|
||||
|
@ -176,7 +177,7 @@ static void RunApphelpCacheControlTests(SC_HANDLE service_handle)
|
|||
CacheEntry.ImageHandle = (HANDLE)0x80000000;
|
||||
#endif
|
||||
Status = pNtApphelpCacheControl(ApphelpCacheServiceLookup, &CacheEntry);
|
||||
ok_ntstatus(Status, STATUS_NOT_FOUND);
|
||||
ok_ntstatus(Status, IsWindows7OrGreater() ? STATUS_NOT_FOUND : STATUS_INVALID_PARAMETER);
|
||||
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, ntPath.Buffer);
|
||||
}
|
||||
|
|
|
@ -31,8 +31,13 @@ START_TEST(NtSaveKey)
|
|||
NTSTATUS Status;
|
||||
HANDLE KeyHandle;
|
||||
HANDLE FileHandle;
|
||||
BOOLEAN PrivilegeEnabled = FALSE;
|
||||
BOOLEAN OldPrivilegeStatus;
|
||||
|
||||
/* Make sure we don't have backup privileges initially, otherwise WHS testbot fails */
|
||||
Status = RtlAdjustPrivilege(SE_BACKUP_PRIVILEGE, FALSE, FALSE, &PrivilegeEnabled);
|
||||
ok(Status == STATUS_SUCCESS, "RtlAdjustPrivilege returned %lx\n", Status);
|
||||
|
||||
/* Open the file */
|
||||
FileHandle = CreateFileW(L"saved_key.dat",
|
||||
GENERIC_READ | GENERIC_WRITE,
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
|
||||
#include "precomp.h"
|
||||
#include <versionhelpers.h>
|
||||
|
||||
static BOOL IsBroken = FALSE;
|
||||
|
||||
static
|
||||
PVOID
|
||||
|
@ -329,20 +332,31 @@ Test_RtlNumberOfSetBits(void)
|
|||
Buffer[0] = 0xff00ff0f;
|
||||
Buffer[1] = 0x3F303F30;
|
||||
|
||||
RtlInitializeBitMap(&BitMapHeader, Buffer, 0);
|
||||
ok_int(RtlNumberOfSetBits(&BitMapHeader), 0);
|
||||
|
||||
RtlInitializeBitMap(&BitMapHeader, Buffer, 4);
|
||||
ok_int(RtlNumberOfSetBits(&BitMapHeader), 4);
|
||||
|
||||
RtlInitializeBitMap(&BitMapHeader, Buffer, 31);
|
||||
ok_int(RtlNumberOfSetBits(&BitMapHeader), 19);
|
||||
RtlInitializeBitMap(&BitMapHeader, Buffer, 64);
|
||||
ok_int(RtlNumberOfSetBits(&BitMapHeader), 36);
|
||||
ok_hex(Buffer[0], 0xff00ff0f);
|
||||
ok_hex(Buffer[1], 0x3F303F30);
|
||||
|
||||
RtlInitializeBitMap(&BitMapHeader, Buffer, 56);
|
||||
ok_int(RtlNumberOfSetBits(&BitMapHeader), 30);
|
||||
ok_hex(Buffer[0], 0xff00ff0f);
|
||||
ok_hex(Buffer[1], 0x3F303F30);
|
||||
|
||||
RtlInitializeBitMap(&BitMapHeader, Buffer, 31);
|
||||
ok_int(RtlNumberOfSetBits(&BitMapHeader), 19);
|
||||
ok_hex(Buffer[0], IsBroken ? 0x7f00ff0f : 0xff00ff0f);
|
||||
ok_hex(Buffer[1], 0x3F303F30);
|
||||
|
||||
RtlInitializeBitMap(&BitMapHeader, Buffer, 4);
|
||||
ok_int(RtlNumberOfSetBits(&BitMapHeader), 4);
|
||||
ok_hex(Buffer[0], IsBroken ? 0x7f00ff0f : 0xff00ff0f);
|
||||
ok_hex(Buffer[1], 0x3F303F30);
|
||||
|
||||
RtlInitializeBitMap(&BitMapHeader, Buffer, 0);
|
||||
ok_int(RtlNumberOfSetBits(&BitMapHeader), 0);
|
||||
ok_hex(Buffer[0], IsBroken ? 0x7f00ff0f : 0x7f00ff0f);
|
||||
ok_hex(Buffer[1], 0x3F303F30);
|
||||
|
||||
RtlInitializeBitMap(&BitMapHeader, Buffer, 64);
|
||||
ok_int(RtlNumberOfSetBits(&BitMapHeader), 36);
|
||||
FreeGuarded(Buffer);
|
||||
}
|
||||
|
||||
|
@ -356,20 +370,31 @@ Test_RtlNumberOfClearBits(void)
|
|||
Buffer[0] = 0xff00fff0;
|
||||
Buffer[1] = 0x3F303F30;
|
||||
|
||||
RtlInitializeBitMap(&BitMapHeader, Buffer, 0);
|
||||
ok_int(RtlNumberOfClearBits(&BitMapHeader), 0);
|
||||
|
||||
RtlInitializeBitMap(&BitMapHeader, Buffer, 4);
|
||||
ok_int(RtlNumberOfClearBits(&BitMapHeader), 4);
|
||||
|
||||
RtlInitializeBitMap(&BitMapHeader, Buffer, 31);
|
||||
ok_int(RtlNumberOfClearBits(&BitMapHeader), 12);
|
||||
RtlInitializeBitMap(&BitMapHeader, Buffer, 64);
|
||||
ok_int(RtlNumberOfClearBits(&BitMapHeader), 28);
|
||||
ok_hex(Buffer[0], 0xff00fff0);
|
||||
ok_hex(Buffer[1], 0x3F303F30);
|
||||
|
||||
RtlInitializeBitMap(&BitMapHeader, Buffer, 56);
|
||||
ok_int(RtlNumberOfClearBits(&BitMapHeader), 26);
|
||||
ok_hex(Buffer[0], 0xff00fff0);
|
||||
ok_hex(Buffer[1], 0x3F303F30);
|
||||
|
||||
RtlInitializeBitMap(&BitMapHeader, Buffer, 31);
|
||||
ok_int(RtlNumberOfClearBits(&BitMapHeader), 12);
|
||||
ok_hex(Buffer[0], IsBroken ? 0x7f00fff0 : 0xff00fff0);
|
||||
ok_hex(Buffer[1], 0x3F303F30);
|
||||
|
||||
RtlInitializeBitMap(&BitMapHeader, Buffer, 4);
|
||||
ok_int(RtlNumberOfClearBits(&BitMapHeader), 4);
|
||||
ok_hex(Buffer[0], IsBroken ? 0x7f00ff00 : 0xff00fff0);
|
||||
ok_hex(Buffer[1], 0x3F303F30);
|
||||
|
||||
RtlInitializeBitMap(&BitMapHeader, Buffer, 0);
|
||||
ok_int(RtlNumberOfClearBits(&BitMapHeader), 0);
|
||||
ok_hex(Buffer[0], IsBroken ? 0x7f00ff00 : 0xff00fff0);
|
||||
ok_hex(Buffer[1], 0x3F303F30);
|
||||
|
||||
RtlInitializeBitMap(&BitMapHeader, Buffer, 64);
|
||||
ok_int(RtlNumberOfClearBits(&BitMapHeader), 28);
|
||||
FreeGuarded(Buffer);
|
||||
}
|
||||
|
||||
|
@ -622,6 +647,12 @@ Test_RtlFindLongestRunClear(void)
|
|||
|
||||
START_TEST(RtlBitmap)
|
||||
{
|
||||
/* Windows 2003 has broken bitmap code that modifies the buffer */
|
||||
if (!IsWindows7OrGreater() && !IsReactOS())
|
||||
{
|
||||
IsBroken = TRUE;
|
||||
}
|
||||
|
||||
Test_RtlFindMostSignificantBit();
|
||||
Test_RtlFindLeastSignificantBit();
|
||||
Test_RtlInitializeBitMap();
|
||||
|
|
|
@ -87,6 +87,7 @@ RunTestCases(VOID)
|
|||
/* TODO: Drive Relative tests don't work yet if the current drive isn't C: */
|
||||
struct
|
||||
{
|
||||
ULONG Line;
|
||||
PCWSTR FileName;
|
||||
PREFIX_TYPE PrefixType;
|
||||
PCWSTR FullPathName;
|
||||
|
@ -94,35 +95,35 @@ RunTestCases(VOID)
|
|||
SIZE_T FilePartSize;
|
||||
} TestCases[] =
|
||||
{
|
||||
{ L"C:", PrefixCurrentPath, L"", PrefixCurrentPathWithoutLastPart },
|
||||
{ L"C:\\", PrefixNone, L"C:\\" },
|
||||
{ L"C:\\test", PrefixNone, L"C:\\test", PrefixCurrentDrive },
|
||||
{ L"C:\\test\\", PrefixNone, L"C:\\test\\" },
|
||||
{ L"C:/test/", PrefixNone, L"C:\\test\\" },
|
||||
// { __LINE__, L"C:", PrefixCurrentPath, L"", PrefixCurrentPathWithoutLastPart },
|
||||
{ __LINE__, L"C:\\", PrefixNone, L"C:\\" },
|
||||
{ __LINE__, L"C:\\test", PrefixNone, L"C:\\test", PrefixCurrentDrive },
|
||||
{ __LINE__, L"C:\\test\\", PrefixNone, L"C:\\test\\" },
|
||||
{ __LINE__, L"C:/test/", PrefixNone, L"C:\\test\\" },
|
||||
|
||||
{ L"C:\\\\test", PrefixNone, L"C:\\test", PrefixCurrentDrive },
|
||||
{ L"test", PrefixCurrentPath, L"\\test", PrefixCurrentPath, sizeof(WCHAR) },
|
||||
{ L"\\test", PrefixCurrentDrive, L"test", PrefixCurrentDrive },
|
||||
{ L"/test", PrefixCurrentDrive, L"test", PrefixCurrentDrive },
|
||||
{ L".\\test", PrefixCurrentPath, L"\\test", PrefixCurrentPath, sizeof(WCHAR) },
|
||||
{ __LINE__, L"C:\\\\test", PrefixNone, L"C:\\test", PrefixCurrentDrive },
|
||||
{ __LINE__, L"test", PrefixCurrentPath, L"\\test", PrefixCurrentPath, sizeof(WCHAR) },
|
||||
{ __LINE__, L"\\test", PrefixCurrentDrive, L"test", PrefixCurrentDrive },
|
||||
{ __LINE__, L"/test", PrefixCurrentDrive, L"test", PrefixCurrentDrive },
|
||||
{ __LINE__, L".\\test", PrefixCurrentPath, L"\\test", PrefixCurrentPath, sizeof(WCHAR) },
|
||||
|
||||
{ L"\\.", PrefixCurrentDrive, L"" },
|
||||
{ L"\\.\\", PrefixCurrentDrive, L"" },
|
||||
{ L"\\\\.", PrefixNone, L"\\\\.\\" },
|
||||
{ L"\\\\.\\", PrefixNone, L"\\\\.\\" },
|
||||
{ L"\\\\.\\Something\\", PrefixNone, L"\\\\.\\Something\\" },
|
||||
{ __LINE__, L"\\.", PrefixCurrentDrive, L"" },
|
||||
{ __LINE__, L"\\.\\", PrefixCurrentDrive, L"" },
|
||||
{ __LINE__, L"\\\\.", PrefixNone, L"\\\\.\\" },
|
||||
{ __LINE__, L"\\\\.\\", PrefixNone, L"\\\\.\\" },
|
||||
{ __LINE__, L"\\\\.\\Something\\", PrefixNone, L"\\\\.\\Something\\" },
|
||||
|
||||
{ L"\\??\\", PrefixCurrentDrive, L"??\\" },
|
||||
{ L"\\??\\C:", PrefixCurrentDrive, L"??\\C:", PrefixCurrentDrive, 3 * sizeof(WCHAR) },
|
||||
{ L"\\??\\C:\\", PrefixCurrentDrive, L"??\\C:\\" },
|
||||
{ L"\\??\\C:\\test", PrefixCurrentDrive, L"??\\C:\\test", PrefixCurrentDrive, 6 * sizeof(WCHAR) },
|
||||
{ L"\\??\\C:\\test\\", PrefixCurrentDrive, L"??\\C:\\test\\" },
|
||||
{ __LINE__, L"\\??\\", PrefixCurrentDrive, L"??\\" },
|
||||
{ __LINE__, L"\\??\\C:", PrefixCurrentDrive, L"??\\C:", PrefixCurrentDrive, 3 * sizeof(WCHAR) },
|
||||
{ __LINE__, L"\\??\\C:\\", PrefixCurrentDrive, L"??\\C:\\" },
|
||||
{ __LINE__, L"\\??\\C:\\test", PrefixCurrentDrive, L"??\\C:\\test", PrefixCurrentDrive, 6 * sizeof(WCHAR) },
|
||||
{ __LINE__, L"\\??\\C:\\test\\", PrefixCurrentDrive, L"??\\C:\\test\\" },
|
||||
|
||||
{ L"\\\\??\\", PrefixNone, L"\\\\??\\" },
|
||||
{ L"\\\\??\\C:", PrefixNone, L"\\\\??\\C:" },
|
||||
{ L"\\\\??\\C:\\", PrefixNone, L"\\\\??\\C:\\" },
|
||||
{ L"\\\\??\\C:\\test", PrefixNone, L"\\\\??\\C:\\test", PrefixNone, sizeof(L"\\\\??\\C:\\") },
|
||||
{ L"\\\\??\\C:\\test\\", PrefixNone, L"\\\\??\\C:\\test\\" },
|
||||
{ __LINE__, L"\\\\??\\", PrefixNone, L"\\\\??\\" },
|
||||
{ __LINE__, L"\\\\??\\C:", PrefixNone, L"\\\\??\\C:" },
|
||||
{ __LINE__, L"\\\\??\\C:\\", PrefixNone, L"\\\\??\\C:\\" },
|
||||
{ __LINE__, L"\\\\??\\C:\\test", PrefixNone, L"\\\\??\\C:\\test", PrefixNone, sizeof(L"\\\\??\\C:\\") },
|
||||
{ __LINE__, L"\\\\??\\C:\\test\\", PrefixNone, L"\\\\??\\C:\\test\\" },
|
||||
};
|
||||
WCHAR FullPathNameBuffer[MAX_PATH];
|
||||
PWSTR ShortName;
|
||||
|
@ -166,7 +167,7 @@ RunTestCases(VOID)
|
|||
EndSeh(STATUS_SUCCESS);
|
||||
|
||||
Okay = CheckStringBuffer(FullPathNameBuffer, Length, sizeof(FullPathNameBuffer), ExpectedPathName);
|
||||
ok(Okay, "Wrong path name '%S', expected '%S'\n", FullPathNameBuffer, ExpectedPathName);
|
||||
ok(Okay, "Line %lu: Wrong path name '%S', expected '%S'\n", TestCases[i].Line, FullPathNameBuffer, ExpectedPathName);
|
||||
|
||||
if (!ShortName)
|
||||
FilePartSize = 0;
|
||||
|
@ -199,7 +200,7 @@ RunTestCases(VOID)
|
|||
if (BackSlash)
|
||||
ExpectedFilePartSize -= wcslen(BackSlash + 1) * sizeof(WCHAR);
|
||||
else
|
||||
ok(0, "GetCurrentDirectory returned %S\n", CurrentPath);
|
||||
ok(0, "Line %lu: GetCurrentDirectory returned %S\n", TestCases[i].Line, CurrentPath);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -211,7 +212,7 @@ RunTestCases(VOID)
|
|||
if (ExpectedFilePartSize != 0)
|
||||
ExpectedFilePartSize = (ExpectedFilePartSize - sizeof(UNICODE_NULL)) / sizeof(WCHAR);
|
||||
ok(FilePartSize == ExpectedFilePartSize,
|
||||
"FilePartSize = %lu, expected %lu\n", (ULONG)FilePartSize, (ULONG)ExpectedFilePartSize);
|
||||
"Line %lu: FilePartSize = %lu, expected %lu\n", TestCases[i].Line, (ULONG)FilePartSize, (ULONG)ExpectedFilePartSize);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -139,6 +139,7 @@ RunTestCases(VOID)
|
|||
/* TODO: Drive Relative tests don't work yet if the current drive isn't C: */
|
||||
struct
|
||||
{
|
||||
ULONG Line;
|
||||
PCWSTR FileName;
|
||||
PREFIX_TYPE PrefixType;
|
||||
PCWSTR FullPathName;
|
||||
|
@ -147,35 +148,35 @@ RunTestCases(VOID)
|
|||
SIZE_T FilePartSize;
|
||||
} TestCases[] =
|
||||
{
|
||||
{ L"C:", PrefixCurrentPath, L"", RtlPathTypeDriveRelative, PrefixCurrentPathWithoutLastPart },
|
||||
{ L"C:\\", PrefixNone, L"C:\\", RtlPathTypeDriveAbsolute },
|
||||
{ L"C:\\test", PrefixNone, L"C:\\test", RtlPathTypeDriveAbsolute, PrefixCurrentDrive },
|
||||
{ L"C:\\test\\", PrefixNone, L"C:\\test\\", RtlPathTypeDriveAbsolute },
|
||||
{ L"C:/test/", PrefixNone, L"C:\\test\\", RtlPathTypeDriveAbsolute },
|
||||
{ __LINE__, L"C:", PrefixCurrentPath, L"", RtlPathTypeDriveRelative, PrefixCurrentPathWithoutLastPart },
|
||||
{ __LINE__, L"C:\\", PrefixNone, L"C:\\", RtlPathTypeDriveAbsolute },
|
||||
{ __LINE__, L"C:\\test", PrefixNone, L"C:\\test", RtlPathTypeDriveAbsolute, PrefixCurrentDrive },
|
||||
{ __LINE__, L"C:\\test\\", PrefixNone, L"C:\\test\\", RtlPathTypeDriveAbsolute },
|
||||
{ __LINE__, L"C:/test/", PrefixNone, L"C:\\test\\", RtlPathTypeDriveAbsolute },
|
||||
|
||||
{ L"C:\\\\test", PrefixNone, L"C:\\test", RtlPathTypeDriveAbsolute, PrefixCurrentDrive },
|
||||
{ L"test", PrefixCurrentPath, L"\\test", RtlPathTypeRelative, PrefixCurrentPath, sizeof(WCHAR) },
|
||||
{ L"\\test", PrefixCurrentDrive, L"test", RtlPathTypeRooted, PrefixCurrentDrive },
|
||||
{ L"/test", PrefixCurrentDrive, L"test", RtlPathTypeRooted, PrefixCurrentDrive },
|
||||
{ L".\\test", PrefixCurrentPath, L"\\test", RtlPathTypeRelative, PrefixCurrentPath, sizeof(WCHAR) },
|
||||
{ __LINE__, L"C:\\\\test", PrefixNone, L"C:\\test", RtlPathTypeDriveAbsolute, PrefixCurrentDrive },
|
||||
{ __LINE__, L"test", PrefixCurrentPath, L"\\test", RtlPathTypeRelative, PrefixCurrentPath, sizeof(WCHAR) },
|
||||
{ __LINE__, L"\\test", PrefixCurrentDrive, L"test", RtlPathTypeRooted, PrefixCurrentDrive },
|
||||
{ __LINE__, L"/test", PrefixCurrentDrive, L"test", RtlPathTypeRooted, PrefixCurrentDrive },
|
||||
{ __LINE__, L".\\test", PrefixCurrentPath, L"\\test", RtlPathTypeRelative, PrefixCurrentPath, sizeof(WCHAR) },
|
||||
|
||||
{ L"\\.", PrefixCurrentDrive, L"", RtlPathTypeRooted },
|
||||
{ L"\\.\\", PrefixCurrentDrive, L"", RtlPathTypeRooted },
|
||||
{ L"\\\\.", PrefixNone, L"\\\\.\\", RtlPathTypeRootLocalDevice },
|
||||
{ L"\\\\.\\", PrefixNone, L"\\\\.\\", RtlPathTypeLocalDevice },
|
||||
{ L"\\\\.\\Something\\", PrefixNone, L"\\\\.\\Something\\", RtlPathTypeLocalDevice },
|
||||
{ __LINE__, L"\\.", PrefixCurrentDrive, L"", RtlPathTypeRooted },
|
||||
{ __LINE__, L"\\.\\", PrefixCurrentDrive, L"", RtlPathTypeRooted },
|
||||
{ __LINE__, L"\\\\.", PrefixNone, L"\\\\.\\", RtlPathTypeRootLocalDevice },
|
||||
{ __LINE__, L"\\\\.\\", PrefixNone, L"\\\\.\\", RtlPathTypeLocalDevice },
|
||||
{ __LINE__, L"\\\\.\\Something\\", PrefixNone, L"\\\\.\\Something\\", RtlPathTypeLocalDevice },
|
||||
|
||||
{ L"\\??\\", PrefixCurrentDrive, L"??\\", RtlPathTypeRooted },
|
||||
{ L"\\??\\C:", PrefixCurrentDrive, L"??\\C:", RtlPathTypeRooted, PrefixCurrentDrive, 3 * sizeof(WCHAR) },
|
||||
{ L"\\??\\C:\\", PrefixCurrentDrive, L"??\\C:\\", RtlPathTypeRooted },
|
||||
{ L"\\??\\C:\\test", PrefixCurrentDrive, L"??\\C:\\test", RtlPathTypeRooted, PrefixCurrentDrive, 6 * sizeof(WCHAR) },
|
||||
{ L"\\??\\C:\\test\\", PrefixCurrentDrive, L"??\\C:\\test\\", RtlPathTypeRooted },
|
||||
{ __LINE__, L"\\??\\", PrefixCurrentDrive, L"??\\", RtlPathTypeRooted },
|
||||
{ __LINE__, L"\\??\\C:", PrefixCurrentDrive, L"??\\C:", RtlPathTypeRooted, PrefixCurrentDrive, 3 * sizeof(WCHAR) },
|
||||
{ __LINE__, L"\\??\\C:\\", PrefixCurrentDrive, L"??\\C:\\", RtlPathTypeRooted },
|
||||
{ __LINE__, L"\\??\\C:\\test", PrefixCurrentDrive, L"??\\C:\\test", RtlPathTypeRooted, PrefixCurrentDrive, 6 * sizeof(WCHAR) },
|
||||
{ __LINE__, L"\\??\\C:\\test\\", PrefixCurrentDrive, L"??\\C:\\test\\", RtlPathTypeRooted },
|
||||
|
||||
{ L"\\\\??\\", PrefixNone, L"\\\\??\\", RtlPathTypeUncAbsolute },
|
||||
{ L"\\\\??\\C:", PrefixNone, L"\\\\??\\C:", RtlPathTypeUncAbsolute },
|
||||
{ L"\\\\??\\C:\\", PrefixNone, L"\\\\??\\C:\\", RtlPathTypeUncAbsolute },
|
||||
{ L"\\\\??\\C:\\test", PrefixNone, L"\\\\??\\C:\\test", RtlPathTypeUncAbsolute, PrefixNone, sizeof(L"\\\\??\\C:\\") },
|
||||
{ L"\\\\??\\C:\\test\\", PrefixNone, L"\\\\??\\C:\\test\\", RtlPathTypeUncAbsolute },
|
||||
{ __LINE__, L"\\\\??\\", PrefixNone, L"\\\\??\\", RtlPathTypeUncAbsolute },
|
||||
{ __LINE__, L"\\\\??\\C:", PrefixNone, L"\\\\??\\C:", RtlPathTypeUncAbsolute },
|
||||
{ __LINE__, L"\\\\??\\C:\\", PrefixNone, L"\\\\??\\C:\\", RtlPathTypeUncAbsolute },
|
||||
{ __LINE__, L"\\\\??\\C:\\test", PrefixNone, L"\\\\??\\C:\\test", RtlPathTypeUncAbsolute, PrefixNone, sizeof(L"\\\\??\\C:\\") },
|
||||
{ __LINE__, L"\\\\??\\C:\\test\\", PrefixNone, L"\\\\??\\C:\\test\\", RtlPathTypeUncAbsolute },
|
||||
};
|
||||
ULONG Length;
|
||||
UNICODE_STRING FileName;
|
||||
|
@ -234,7 +235,7 @@ RunTestCases(VOID)
|
|||
EndSeh(STATUS_SUCCESS);
|
||||
ok_eq_ustr(&FileName, &TempString);
|
||||
Okay = CheckStringBuffer(FullPathNameBuffer, Length, sizeof(FullPathNameBuffer), ExpectedPathName);
|
||||
ok(Okay, "Wrong path name '%S', expected '%S'\n", FullPathNameBuffer, ExpectedPathName);
|
||||
ok(Okay, "Line %lu: Wrong path name '%S', expected '%S'\n", TestCases[i].Line, FullPathNameBuffer, ExpectedPathName);
|
||||
switch (TestCases[i].FilePartPrefixType)
|
||||
{
|
||||
case PrefixNone:
|
||||
|
@ -261,7 +262,7 @@ RunTestCases(VOID)
|
|||
if (BackSlash)
|
||||
ExpectedFilePartSize -= wcslen(BackSlash + 1) * sizeof(WCHAR);
|
||||
else
|
||||
ok(0, "GetCurrentDirectory returned %S\n", CurrentPath);
|
||||
ok(0, "Line %lu: GetCurrentDirectory returned %S\n", TestCases[i].Line, CurrentPath);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -281,11 +282,11 @@ RunTestCases(VOID)
|
|||
}
|
||||
ok(ShortName == ExpectedShortName,
|
||||
"ShortName = %p, expected %p\n", ShortName, ExpectedShortName);
|
||||
ok(NameInvalid == FALSE, "NameInvalid = %u\n", NameInvalid);
|
||||
ok(PathType.Type == TestCases[i].PathType, "PathType = %d, expected %d\n", PathType.Type, TestCases[i].PathType);
|
||||
ok(NameInvalid == FALSE, "Line %lu: NameInvalid = %u\n", TestCases[i].Line, NameInvalid);
|
||||
ok(PathType.Type == TestCases[i].PathType, "Line %lu: PathType = %d, expected %d\n", TestCases[i].Line, PathType.Type, TestCases[i].PathType);
|
||||
ok(PathType.Unknown == 1234 ||
|
||||
broken(PathType.Unknown == 0) ||
|
||||
broken(PathType.Unknown == 32), "Unknown = %lu\n", PathType.Unknown);
|
||||
broken(PathType.Unknown == 32), "Line %lu: Unknown = %lu\n", TestCases[i].Line, PathType.Unknown);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -131,6 +131,7 @@ RunTestCases(VOID)
|
|||
/* TODO: Drive Relative tests don't work yet if the current drive isn't C: */
|
||||
struct
|
||||
{
|
||||
ULONG Line;
|
||||
PCWSTR FileName;
|
||||
PREFIX_TYPE PrefixType;
|
||||
PCWSTR FullPathName;
|
||||
|
@ -139,35 +140,35 @@ RunTestCases(VOID)
|
|||
SIZE_T FilePartSize;
|
||||
} TestCases[] =
|
||||
{
|
||||
{ L"C:", PrefixCurrentPath, L"", RtlPathTypeDriveRelative, PrefixCurrentPathWithoutLastPart },
|
||||
{ L"C:\\", PrefixNone, L"C:\\", RtlPathTypeDriveAbsolute },
|
||||
{ L"C:\\test", PrefixNone, L"C:\\test", RtlPathTypeDriveAbsolute, PrefixCurrentDrive },
|
||||
{ L"C:\\test\\", PrefixNone, L"C:\\test\\", RtlPathTypeDriveAbsolute },
|
||||
{ L"C:/test/", PrefixNone, L"C:\\test\\", RtlPathTypeDriveAbsolute },
|
||||
// { __LINE__, L"C:", PrefixCurrentPath, L"", RtlPathTypeDriveRelative, PrefixCurrentPathWithoutLastPart }, // This is broken
|
||||
{ __LINE__, L"C:\\", PrefixNone, L"C:\\", RtlPathTypeDriveAbsolute },
|
||||
{ __LINE__, L"C:\\test", PrefixNone, L"C:\\test", RtlPathTypeDriveAbsolute, PrefixCurrentDrive },
|
||||
{ __LINE__, L"C:\\test\\", PrefixNone, L"C:\\test\\", RtlPathTypeDriveAbsolute },
|
||||
{ __LINE__, L"C:/test/", PrefixNone, L"C:\\test\\", RtlPathTypeDriveAbsolute },
|
||||
|
||||
{ L"C:\\\\test", PrefixNone, L"C:\\test", RtlPathTypeDriveAbsolute, PrefixCurrentDrive },
|
||||
{ L"test", PrefixCurrentPath, L"\\test", RtlPathTypeRelative, PrefixCurrentPath, sizeof(WCHAR) },
|
||||
{ L"\\test", PrefixCurrentDrive, L"test", RtlPathTypeRooted, PrefixCurrentDrive },
|
||||
{ L"/test", PrefixCurrentDrive, L"test", RtlPathTypeRooted, PrefixCurrentDrive },
|
||||
{ L".\\test", PrefixCurrentPath, L"\\test", RtlPathTypeRelative, PrefixCurrentPath, sizeof(WCHAR) },
|
||||
{ __LINE__, L"C:\\\\test", PrefixNone, L"C:\\test", RtlPathTypeDriveAbsolute, PrefixCurrentDrive },
|
||||
{ __LINE__, L"test", PrefixCurrentPath, L"\\test", RtlPathTypeRelative, PrefixCurrentPath, sizeof(WCHAR) },
|
||||
{ __LINE__, L"\\test", PrefixCurrentDrive, L"test", RtlPathTypeRooted, PrefixCurrentDrive },
|
||||
{ __LINE__, L"/test", PrefixCurrentDrive, L"test", RtlPathTypeRooted, PrefixCurrentDrive },
|
||||
{ __LINE__, L".\\test", PrefixCurrentPath, L"\\test", RtlPathTypeRelative, PrefixCurrentPath, sizeof(WCHAR) },
|
||||
|
||||
{ L"\\.", PrefixCurrentDrive, L"", RtlPathTypeRooted },
|
||||
{ L"\\.\\", PrefixCurrentDrive, L"", RtlPathTypeRooted },
|
||||
{ L"\\\\.", PrefixNone, L"\\\\.\\", RtlPathTypeRootLocalDevice },
|
||||
{ L"\\\\.\\", PrefixNone, L"\\\\.\\", RtlPathTypeLocalDevice },
|
||||
{ L"\\\\.\\Something\\", PrefixNone, L"\\\\.\\Something\\", RtlPathTypeLocalDevice },
|
||||
{ __LINE__, L"\\.", PrefixCurrentDrive, L"", RtlPathTypeRooted },
|
||||
{ __LINE__, L"\\.\\", PrefixCurrentDrive, L"", RtlPathTypeRooted },
|
||||
{ __LINE__, L"\\\\.", PrefixNone, L"\\\\.\\", RtlPathTypeRootLocalDevice },
|
||||
{ __LINE__, L"\\\\.\\", PrefixNone, L"\\\\.\\", RtlPathTypeLocalDevice },
|
||||
{ __LINE__, L"\\\\.\\Something\\", PrefixNone, L"\\\\.\\Something\\", RtlPathTypeLocalDevice },
|
||||
|
||||
{ L"\\??\\", PrefixCurrentDrive, L"??\\", RtlPathTypeRooted },
|
||||
{ L"\\??\\C:", PrefixCurrentDrive, L"??\\C:", RtlPathTypeRooted, PrefixCurrentDrive, 3 * sizeof(WCHAR) },
|
||||
{ L"\\??\\C:\\", PrefixCurrentDrive, L"??\\C:\\", RtlPathTypeRooted },
|
||||
{ L"\\??\\C:\\test", PrefixCurrentDrive, L"??\\C:\\test", RtlPathTypeRooted, PrefixCurrentDrive, 6 * sizeof(WCHAR) },
|
||||
{ L"\\??\\C:\\test\\", PrefixCurrentDrive, L"??\\C:\\test\\", RtlPathTypeRooted },
|
||||
{ __LINE__, L"\\??\\", PrefixCurrentDrive, L"??\\", RtlPathTypeRooted },
|
||||
{ __LINE__, L"\\??\\C:", PrefixCurrentDrive, L"??\\C:", RtlPathTypeRooted, PrefixCurrentDrive, 3 * sizeof(WCHAR) },
|
||||
{ __LINE__, L"\\??\\C:\\", PrefixCurrentDrive, L"??\\C:\\", RtlPathTypeRooted },
|
||||
{ __LINE__, L"\\??\\C:\\test", PrefixCurrentDrive, L"??\\C:\\test", RtlPathTypeRooted, PrefixCurrentDrive, 6 * sizeof(WCHAR) },
|
||||
{ __LINE__, L"\\??\\C:\\test\\", PrefixCurrentDrive, L"??\\C:\\test\\", RtlPathTypeRooted },
|
||||
|
||||
{ L"\\\\??\\", PrefixNone, L"\\\\??\\", RtlPathTypeUncAbsolute },
|
||||
{ L"\\\\??\\C:", PrefixNone, L"\\\\??\\C:", RtlPathTypeUncAbsolute },
|
||||
{ L"\\\\??\\C:\\", PrefixNone, L"\\\\??\\C:\\", RtlPathTypeUncAbsolute },
|
||||
{ L"\\\\??\\C:\\test", PrefixNone, L"\\\\??\\C:\\test", RtlPathTypeUncAbsolute, PrefixNone, sizeof(L"\\\\??\\C:\\") },
|
||||
{ L"\\\\??\\C:\\test\\", PrefixNone, L"\\\\??\\C:\\test\\", RtlPathTypeUncAbsolute },
|
||||
{ __LINE__, L"\\\\??\\", PrefixNone, L"\\\\??\\", RtlPathTypeUncAbsolute },
|
||||
{ __LINE__, L"\\\\??\\C:", PrefixNone, L"\\\\??\\C:", RtlPathTypeUncAbsolute },
|
||||
{ __LINE__, L"\\\\??\\C:\\", PrefixNone, L"\\\\??\\C:\\", RtlPathTypeUncAbsolute },
|
||||
{ __LINE__, L"\\\\??\\C:\\test", PrefixNone, L"\\\\??\\C:\\test", RtlPathTypeUncAbsolute, PrefixNone, sizeof(L"\\\\??\\C:\\") },
|
||||
{ __LINE__, L"\\\\??\\C:\\test\\", PrefixNone, L"\\\\??\\C:\\test\\", RtlPathTypeUncAbsolute },
|
||||
};
|
||||
NTSTATUS Status;
|
||||
UNICODE_STRING FileName;
|
||||
|
@ -227,14 +228,14 @@ RunTestCases(VOID)
|
|||
&NameInvalid,
|
||||
&PathType,
|
||||
&LengthNeeded);
|
||||
ok(Status == STATUS_SUCCESS, "status = %lx\n", Status);
|
||||
ok(Status == STATUS_SUCCESS, "Line %lu: status = %lx\n", TestCases[i].Line, Status);
|
||||
EndSeh(STATUS_SUCCESS);
|
||||
ok_eq_ustr(&FileName, &TempString);
|
||||
ok(FullPathName.Buffer == FullPathNameBuffer, "Buffer modified\n");
|
||||
ok(FullPathName.MaximumLength == sizeof(FullPathNameBuffer), "MaximumLength modified\n");
|
||||
ok(FullPathName.Buffer == FullPathNameBuffer, "Line %lu: Buffer modified\n", TestCases[i].Line);
|
||||
ok(FullPathName.MaximumLength == sizeof(FullPathNameBuffer), "Line %lu: MaximumLength modified\n", TestCases[i].Line);
|
||||
Okay = CheckStringBuffer(&FullPathName, ExpectedPathName);
|
||||
ok(Okay, "Wrong path name '%wZ', expected '%S'\n", &FullPathName, ExpectedPathName);
|
||||
ok(StringUsed == &FullPathName, "StringUsed = %p, expected %p\n", StringUsed, &FullPathName);
|
||||
ok(Okay, "Line %lu: Wrong path name '%wZ', expected '%S'\n", TestCases[i].Line, &FullPathName, ExpectedPathName);
|
||||
ok(StringUsed == &FullPathName, "Line %lu: StringUsed = %p, expected %p\n", TestCases[i].Line, StringUsed, &FullPathName);
|
||||
switch (TestCases[i].FilePartPrefixType)
|
||||
{
|
||||
case PrefixNone:
|
||||
|
@ -261,7 +262,7 @@ RunTestCases(VOID)
|
|||
if (BackSlash)
|
||||
ExpectedFilePartSize -= wcslen(BackSlash + 1) * sizeof(WCHAR);
|
||||
else
|
||||
ok(0, "GetCurrentDirectory returned %S\n", CurrentPath);
|
||||
ok(0, "Line %lu: GetCurrentDirectory returned %S\n", TestCases[i].Line, CurrentPath);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -273,10 +274,10 @@ RunTestCases(VOID)
|
|||
if (ExpectedFilePartSize != 0)
|
||||
ExpectedFilePartSize = (ExpectedFilePartSize - sizeof(UNICODE_NULL)) / sizeof(WCHAR);
|
||||
ok(FilePartSize == ExpectedFilePartSize,
|
||||
"FilePartSize = %lu, expected %lu\n", (ULONG)FilePartSize, (ULONG)ExpectedFilePartSize);
|
||||
ok(NameInvalid == FALSE, "NameInvalid = %u\n", NameInvalid);
|
||||
ok(PathType == TestCases[i].PathType, "PathType = %d, expected %d\n", PathType, TestCases[i].PathType);
|
||||
ok(LengthNeeded == 0, "LengthNeeded = %lu\n", (ULONG)LengthNeeded);
|
||||
"Line %lu: FilePartSize = %lu, expected %lu\n", TestCases[i].Line, (ULONG)FilePartSize, (ULONG)ExpectedFilePartSize);
|
||||
ok(NameInvalid == FALSE, "Line %lu: NameInvalid = %u\n", TestCases[i].Line, NameInvalid);
|
||||
ok(PathType == TestCases[i].PathType, "Line %lu: PathType = %d, expected %d\n", TestCases[i].Line, PathType, TestCases[i].PathType);
|
||||
ok(LengthNeeded == 0, "Line %lu: LengthNeeded = %lu\n", TestCases[i].Line, (ULONG)LengthNeeded);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -324,8 +325,7 @@ START_TEST(RtlGetFullPathName_UstrEx)
|
|||
StartSeh()
|
||||
pRtlGetFullPathName_UstrEx(NULL, NULL, NULL, NULL, NULL, NULL, &PathType, NULL);
|
||||
EndSeh(STATUS_ACCESS_VIOLATION);
|
||||
ok(PathType == RtlPathTypeUnknown ||
|
||||
broken(PathType == RtlPathTypeNotSet) /* Win7 */, "PathType = %d\n", PathType);
|
||||
ok(PathType == RtlPathTypeNotSet, "PathType = %d\n", PathType);
|
||||
|
||||
/* Check what else is initialized before it crashes */
|
||||
PathType = RtlPathTypeNotSet;
|
||||
|
@ -339,8 +339,7 @@ START_TEST(RtlGetFullPathName_UstrEx)
|
|||
ok(StringUsed == NULL, "StringUsed = %p\n", StringUsed);
|
||||
ok(FilePartSize == 0, "FilePartSize = %lu\n", (ULONG)FilePartSize);
|
||||
ok(NameInvalid == FALSE, "NameInvalid = %u\n", NameInvalid);
|
||||
ok(PathType == RtlPathTypeUnknown ||
|
||||
broken(PathType == RtlPathTypeNotSet) /* Win7 */, "PathType = %d\n", PathType);
|
||||
ok(PathType == RtlPathTypeNotSet, "PathType = %d\n", PathType);
|
||||
ok(LengthNeeded == 0, "LengthNeeded = %lu\n", (ULONG)LengthNeeded);
|
||||
|
||||
RtlInitUnicodeString(&FileName, L"");
|
||||
|
@ -355,8 +354,7 @@ START_TEST(RtlGetFullPathName_UstrEx)
|
|||
ok_eq_ustr(&FileName, &TempString);
|
||||
ok(StringUsed == NULL, "StringUsed = %p\n", StringUsed);
|
||||
ok(FilePartSize == 0, "FilePartSize = %lu\n", (ULONG)FilePartSize);
|
||||
ok(NameInvalid == FALSE ||
|
||||
broken(NameInvalid == (BOOLEAN)-1) /* Win7 */, "NameInvalid = %u\n", NameInvalid);
|
||||
ok(NameInvalid == (BOOLEAN)-1, "NameInvalid = %u\n", NameInvalid);
|
||||
ok(LengthNeeded == 0, "LengthNeeded = %lu\n", (ULONG)LengthNeeded);
|
||||
|
||||
/* This is the first one that doesn't crash. FileName and PathType cannot be NULL */
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
#include <versionhelpers.h>
|
||||
|
||||
#define ntv6(x) (LOBYTE(LOWORD(GetVersion())) >= 6 ? (x) : 0)
|
||||
|
||||
|
@ -22,6 +23,10 @@ Test_Flags(void)
|
|||
PSYSTEM_FLAGS_INFORMATION FlagsInfo = (PVOID)Buffer;
|
||||
BOOLEAN PrivilegeEnabled;
|
||||
|
||||
/* Make sure we don't have debug privileges initially, otherwise WHS testbot fails */
|
||||
Status = RtlAdjustPrivilege(SE_SYSTEMTIME_PRIVILEGE, FALSE, FALSE, &PrivilegeEnabled);
|
||||
ok(Status == STATUS_SUCCESS, "RtlAdjustPrivilege returned %lx\n", Status);
|
||||
|
||||
/* Query */
|
||||
ReturnLength = 0x55555555;
|
||||
Status = NtQuerySystemInformation(SystemFlagsInformation, NULL, 0, &ReturnLength);
|
||||
|
@ -130,7 +135,7 @@ Test_Flags(void)
|
|||
ok(Status == STATUS_INFO_LENGTH_MISMATCH, "NtSetSystemInformation returned %lx\n", Status);
|
||||
|
||||
Status = NtSetSystemInformation(SystemFlagsInformation, NULL, sizeof(SYSTEM_FLAGS_INFORMATION));
|
||||
ok(Status == STATUS_ACCESS_DENIED, "NtSetSystemInformation returned %lx\n", Status);
|
||||
ok(Status == (IsWindows7OrGreater() ? STATUS_ACCESS_DENIED : STATUS_ACCESS_VIOLATION), "NtSetSystemInformation returned %lx\n", Status);
|
||||
|
||||
Status = NtSetSystemInformation(SystemFlagsInformation, (PVOID)2, sizeof(SYSTEM_FLAGS_INFORMATION));
|
||||
ok(Status == STATUS_DATATYPE_MISALIGNMENT, "NtSetSystemInformation returned %lx\n", Status);
|
||||
|
@ -183,6 +188,10 @@ Test_TimeAdjustment(void)
|
|||
ULONG ReturnLength;
|
||||
BOOLEAN PrivilegeEnabled;
|
||||
|
||||
/* Make sure we don't have debug privileges initially, otherwise WHS testbot fails */
|
||||
Status = RtlAdjustPrivilege(SE_SYSTEMTIME_PRIVILEGE, FALSE, FALSE, &PrivilegeEnabled);
|
||||
ok(Status == STATUS_SUCCESS, "RtlAdjustPrivilege returned %lx\n", Status);
|
||||
|
||||
SetTimeInfo.TimeAdjustment = 0;
|
||||
SetTimeInfo.Enable = 0;
|
||||
|
||||
|
@ -216,7 +225,7 @@ Test_TimeAdjustment(void)
|
|||
Status = NtSetSystemInformation(SystemTimeAdjustmentInformation,
|
||||
&SetTimeInfo,
|
||||
sizeof(SetTimeInfo));
|
||||
ok_ntstatus(Status, STATUS_INVALID_PARAMETER_2);
|
||||
ok_ntstatus(Status, IsWindows7OrGreater() ? STATUS_INTEGER_DIVIDE_BY_ZERO : STATUS_INVALID_PARAMETER_2);
|
||||
|
||||
/* Set huge value */
|
||||
SetTimeInfo.TimeAdjustment = -1;
|
||||
|
@ -232,7 +241,7 @@ Test_TimeAdjustment(void)
|
|||
sizeof(GetTimeInfo),
|
||||
&ReturnLength);
|
||||
ok_ntstatus(Status, STATUS_SUCCESS);
|
||||
ok_long(GetTimeInfo.TimeAdjustment, -1);
|
||||
ok_long(GetTimeInfo.TimeAdjustment, IsWindows7OrGreater() ? 0x7076cc : -1);
|
||||
ok_long(GetTimeInfo.Enable, 0);
|
||||
|
||||
/* set Enable to 1 */
|
||||
|
|
|
@ -60,7 +60,7 @@ START_TEST(TimerResolution)
|
|||
&CurrentResolution);
|
||||
ok_hex(Status, STATUS_SUCCESS);
|
||||
printf("Current resolution: %lu ; maximum resolution: %lu\n", CurrentResolution, MaximumResolution);
|
||||
ok(CurrentResolution >= MaximumResolution, "Current resolution: %lu became too low! (maximum resolution: %lu)\n", CurrentResolution, MaximumResolution);
|
||||
ok(abs((LONG)MaximumResolution - (LONG)CurrentResolution) < 200, "Current resolution: %lu became too low! (maximum resolution: %lu)\n", CurrentResolution, MaximumResolution);
|
||||
|
||||
/* Get the current timer resolution */
|
||||
Status = NtSetTimerResolution(0, /* Ignored */
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include <intshcut.h>
|
||||
#include <sfc.h>
|
||||
#include <imagehlp.h>
|
||||
#include <mmddk.h>
|
||||
|
||||
/* Compatibility with the MS defines */
|
||||
|
||||
|
@ -383,9 +384,9 @@ PTR Rva2Addr(PIMAGE_DOS_HEADER dos, RVA rva)
|
|||
}
|
||||
|
||||
|
||||
unsigned g_winmm_snd_play_a[] = { dliStartProcessing, dliNotePreLoadLibrary, dliNotePreGetProcAddress, dliNoteEndProcessing, LAST_DLI };
|
||||
unsigned g_winmm_snd_play_w[] = { dliStartProcessing, dliNotePreGetProcAddress, dliNoteEndProcessing, LAST_DLI };
|
||||
unsigned g_winmm_play_w[] = { dliStartProcessing, dliNotePreGetProcAddress, dliFailGetProc, dliNoteEndProcessing, LAST_DLI };
|
||||
unsigned g_winmm_get_cur_task[] = { dliStartProcessing, dliNotePreLoadLibrary, dliNotePreGetProcAddress, dliNoteEndProcessing, LAST_DLI };
|
||||
unsigned g_winmm_midi_out_close[] = { dliStartProcessing, dliNotePreGetProcAddress, dliNoteEndProcessing, LAST_DLI };
|
||||
unsigned g_winmm_mide_in_close[] = { dliStartProcessing, dliNotePreGetProcAddress, dliFailGetProc, dliNoteEndProcessing, LAST_DLI };
|
||||
unsigned g_sfc_key[] = { dliStartProcessing, dliNotePreLoadLibrary, dliFailLoadLib, dliNotePreGetProcAddress, dliNoteEndProcessing, LAST_DLI };
|
||||
unsigned g_sfc_file[] = { dliStartProcessing, dliNotePreGetProcAddress, dliNoteEndProcessing, LAST_DLI };
|
||||
unsigned g_version_a[] = { dliStartProcessing, dliNotePreLoadLibrary, dliNotePreGetProcAddress, dliFailGetProc, dliNoteEndProcessing, LAST_DLI };
|
||||
|
@ -449,45 +450,43 @@ START_TEST(delayimp)
|
|||
}
|
||||
|
||||
/* Test the normal flow without a dll loaded */
|
||||
BOOL ret = 123;
|
||||
SetExpectedDli(g_winmm_snd_play_a);
|
||||
SetExpectedDli(g_winmm_get_cur_task);
|
||||
g_ExpectedDll = WINMM_DLLNAME;
|
||||
g_ExpectedName = "sndPlaySoundA";
|
||||
ret = sndPlaySoundA(NULL, SND_NOWAIT | SND_NOSTOP);
|
||||
ok(ret == TRUE, "Expected ret to be TRUE, was %u\n", ret);
|
||||
g_ExpectedName = "mmGetCurrentTask";
|
||||
DWORD task = mmGetCurrentTask();
|
||||
ok(task == GetCurrentThreadId(), "Expected ret to be current thread id (0x%lx), was 0x%lx\n", GetCurrentThreadId(), task);
|
||||
CheckDliDone();
|
||||
|
||||
/* Test the normal flow with a dll loaded */
|
||||
SetExpectedDli(g_winmm_snd_play_w);
|
||||
SetExpectedDli(g_winmm_midi_out_close);
|
||||
g_ExpectedDll = WINMM_DLLNAME;
|
||||
g_ExpectedName = "sndPlaySoundW";
|
||||
ret = sndPlaySoundW(NULL, SND_NOWAIT | SND_NOSTOP);
|
||||
ok(ret == TRUE, "Expected ret to be TRUE, was %u\n", ret);
|
||||
g_ExpectedName = "midiOutClose";
|
||||
DWORD err = midiOutClose((HMIDIOUT)(ULONG_PTR)0xdeadbeef);
|
||||
ok(err == MMSYSERR_INVALHANDLE, "Expected err to be MMSYSERR_INVALHANDLE, was 0x%lx\n", err);
|
||||
CheckDliDone();
|
||||
|
||||
/* Make sure GetProcAddress fails, also ignore the Failure hook, use the exception to set the address */
|
||||
SetExpectedDli(g_winmm_play_w);
|
||||
SetExpectedDli(g_winmm_mide_in_close);
|
||||
g_ExpectedDll = WINMM_DLLNAME;
|
||||
g_ExpectedName = "playSoundW";
|
||||
g_ExpectedName = "MixerClose";
|
||||
g_BreakFunctionName = true;
|
||||
ret = 123;
|
||||
_SEH2_TRY
|
||||
{
|
||||
ret = PlaySoundW(NULL, NULL, SND_NOWAIT | SND_NOSTOP);
|
||||
err = mixerClose((HMIXER)(ULONG_PTR)0xdeadbeef);
|
||||
}
|
||||
_SEH2_EXCEPT(ExceptionFilter(_SEH2_GetExceptionInformation(), _SEH2_GetExceptionCode()))
|
||||
{
|
||||
;
|
||||
err = _SEH2_GetExceptionCode();
|
||||
}
|
||||
_SEH2_END;
|
||||
ok(ret == TRUE, "Expected ret to be TRUE, was %u\n", ret);
|
||||
ok(err == MMSYSERR_INVALHANDLE, "Expected err to be MMSYSERR_INVALHANDLE, was 0x%lx\n", err);
|
||||
CheckDliDone();
|
||||
ok(g_BreakFunctionName == false, "Expected the functionname to be changed\n");
|
||||
|
||||
|
||||
/* Make the LoadLib fail, manually load the library in the Failure Hook,
|
||||
Respond to the dliNotePreGetProcAddress with an alternate function address */
|
||||
SetExpectedDli(g_sfc_key);
|
||||
ret = SfcIsKeyProtected(NULL, NULL, NULL);
|
||||
BOOL ret = SfcIsKeyProtected(NULL, NULL, NULL);
|
||||
ok(ret == 12345, "Expected ret to be 12345, was %u\n", ret); /* The original function returns FALSE! */
|
||||
CheckDliDone();
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <debug.h>
|
||||
#include <stdio.h>
|
||||
#include <shellutils.h>
|
||||
#include <versionhelpers.h>
|
||||
|
||||
LPITEMIDLIST _CreateDummyPidl()
|
||||
{
|
||||
|
@ -53,12 +54,16 @@ VOID TestUninitialized()
|
|||
hr = psf->CreateViewObject(NULL, IID_PPV_ARG(IShellView, &psv));
|
||||
ok(hr == S_OK, "hr = %lx\n", hr);
|
||||
|
||||
/* And its display name is ... "C:\Documents and Settings\" */
|
||||
/* And its display name is ... "C:\Documents and Settings\<username>\Desktop" */
|
||||
STRRET strretName;
|
||||
hr = psf->GetDisplayNameOf(NULL,SHGDN_FORPARSING,&strretName);
|
||||
ok(hr == S_OK, "hr = %lx\n", hr);
|
||||
ok(strretName.uType == STRRET_WSTR, "strretName.uType == %x\n", strretName.uType);
|
||||
ok(wcscmp(strretName.pOleStr, L"C:\\Documents and Settings\\") == 0, "wrong name, got: %S\n", strretName.pOleStr);
|
||||
ok((wcsncmp(strretName.pOleStr, L"C:\\Documents and Settings\\", 26) == 0) ||
|
||||
(wcsncmp(strretName.pOleStr, L"C:\\Users\\", 9) == 0),
|
||||
"wrong name, got: %S\n", strretName.pOleStr);
|
||||
ok(wcscmp(strretName.pOleStr + wcslen(strretName.pOleStr) - 8, L"\\Desktop") == NULL,
|
||||
"wrong name, got: %S\n", strretName.pOleStr);
|
||||
|
||||
hr = psf->GetDisplayNameOf(NULL,SHGDN_FORPARSING|SHGDN_INFOLDER,&strretName);
|
||||
ok(hr == E_INVALIDARG, "hr = %lx\n", hr);
|
||||
|
@ -83,9 +88,9 @@ VOID TestUninitialized()
|
|||
|
||||
/* methods that worked before, now fail */
|
||||
hr = psf->GetDisplayNameOf(NULL,SHGDN_FORPARSING,&strretName);
|
||||
ok(hr == E_FAIL, "hr = %lx\n", hr);
|
||||
ok(hr == (IsWindows7OrGreater() ? E_INVALIDARG : E_FAIL), "hr = %lx\n", hr);
|
||||
hr = psf->EnumObjects(NULL, 0, &penum);
|
||||
ok(hr == HRESULT_FROM_WIN32(ERROR_CANCELLED), "hr = %lx\n", hr);
|
||||
ok(hr == (IsWindows7OrGreater() ? E_INVALIDARG : HRESULT_FROM_WIN32(ERROR_CANCELLED)), "hr = %lx\n", hr);
|
||||
|
||||
/* The following continue to work though */
|
||||
hr = psf->CreateViewObject(NULL, IID_PPV_ARG(IDropTarget, &pdt));
|
||||
|
@ -115,23 +120,23 @@ VOID TestInitialize()
|
|||
PERSIST_FOLDER_TARGET_INFO pfti = {0};
|
||||
PERSIST_FOLDER_TARGET_INFO queriedPfti;
|
||||
hr = ppf3->InitializeEx(NULL, NULL, NULL);
|
||||
ok(hr == E_INVALIDARG, "hr = %lx\n", hr);
|
||||
ok(hr == (IsWindows7OrGreater() ? E_INVALIDARG : E_OUTOFMEMORY), "hr = %lx\n", hr);
|
||||
|
||||
hr = ppf3->InitializeEx(NULL, NULL, &pfti);
|
||||
ok(hr == E_INVALIDARG, "hr = %lx\n", hr);
|
||||
ok(hr == (IsWindows7OrGreater() ? E_INVALIDARG : E_OUTOFMEMORY), "hr = %lx\n", hr);
|
||||
|
||||
wcscpy(pfti.szTargetParsingName, L"C:\\");
|
||||
hr = ppf3->InitializeEx(NULL, NULL, &pfti);
|
||||
ok(hr == E_INVALIDARG, "hr = %lx\n", hr);
|
||||
ok(hr == (IsWindows7OrGreater() ? E_INVALIDARG : E_OUTOFMEMORY), "hr = %lx\n", hr);
|
||||
|
||||
hr = ppf3->InitializeEx(NULL, testpidl, NULL);
|
||||
ok(hr == S_OK, "hr = %lx\n", hr);
|
||||
|
||||
hr = ppf3->GetFolderTargetInfo(&queriedPfti);
|
||||
ok(hr == E_FAIL, "hr = %lx\n", hr);
|
||||
ok(hr == (IsWindows7OrGreater() ? E_FAIL : S_OK), "hr = %lx\n", hr);
|
||||
|
||||
hr = psf->GetDisplayNameOf(NULL,SHGDN_FORPARSING,&strretName);
|
||||
ok(hr == E_FAIL, "hr = %lx\n", hr);
|
||||
ok(hr == (IsWindows7OrGreater() ? E_INVALIDARG : E_FAIL), "hr = %lx\n", hr);
|
||||
|
||||
pfti.szTargetParsingName[0] = 0;
|
||||
hr = ppf3->InitializeEx(NULL, testpidl, &pfti);
|
||||
|
@ -142,7 +147,7 @@ VOID TestInitialize()
|
|||
ok(wcscmp(queriedPfti.szTargetParsingName, L"") == 0, "wrong name, got: %S\n", queriedPfti.szTargetParsingName);
|
||||
|
||||
hr = psf->GetDisplayNameOf(NULL,SHGDN_FORPARSING,&strretName);
|
||||
ok(hr == E_FAIL, "hr = %lx\n", hr);
|
||||
ok(hr == (IsWindows7OrGreater() ? E_INVALIDARG : E_FAIL), "hr = %lx\n", hr);
|
||||
|
||||
wcscpy(pfti.szTargetParsingName, L"C:\\");
|
||||
hr = ppf3->InitializeEx(NULL, testpidl, &pfti);
|
||||
|
|
|
@ -246,11 +246,15 @@ class CFolderViewCB :
|
|||
public IShellFolderViewCB
|
||||
{
|
||||
public:
|
||||
CFolderViewCB(void) :
|
||||
m_RefCount(1)
|
||||
{
|
||||
}
|
||||
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject)
|
||||
{
|
||||
if (riid == IID_IShellFolderViewCB || riid == IID_IUnknown)
|
||||
if (riid == IID_IShellFolderViewCB)
|
||||
{
|
||||
*ppvObject = this;
|
||||
*ppvObject = static_cast<IShellFolderViewCB*>(this);
|
||||
AddRef();
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -259,12 +263,12 @@ public:
|
|||
virtual ULONG STDMETHODCALLTYPE AddRef(void)
|
||||
{
|
||||
InterlockedIncrement(&g_AddRef);
|
||||
return 2;
|
||||
return InterlockedIncrement(&m_RefCount);
|
||||
}
|
||||
virtual ULONG STDMETHODCALLTYPE Release(void)
|
||||
{
|
||||
InterlockedIncrement(&g_Release);
|
||||
return 1;
|
||||
return InterlockedDecrement(&m_RefCount);
|
||||
}
|
||||
virtual HRESULT STDMETHODCALLTYPE MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
|
@ -272,6 +276,8 @@ public:
|
|||
add_msg(uMsg, wParam, lParam);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
private:
|
||||
LONG m_RefCount;
|
||||
};
|
||||
|
||||
|
||||
|
@ -450,7 +456,7 @@ START_TEST(IShellFolderViewCB)
|
|||
if (!SUCCEEDED(hr))
|
||||
return;
|
||||
|
||||
ok_int(g_AddRef, 2);
|
||||
ok_int(g_AddRef, 1);
|
||||
ok_int(g_Release, 0);
|
||||
|
||||
clear_list();
|
||||
|
@ -579,26 +585,19 @@ START_TEST(IShellFolderViewCB)
|
|||
{
|
||||
IShellFolderViewCB* oldPtr;
|
||||
|
||||
g_AddRef = 0;
|
||||
g_Release = 0;
|
||||
|
||||
hr = folderView->SetCallback(NULL, &oldPtr);
|
||||
ok_int(g_AddRef, 0);
|
||||
ok_int(g_AddRef, 1);
|
||||
ok_int(g_Release, 0);
|
||||
|
||||
g_AddRef = 0;
|
||||
g_Release = 0;
|
||||
|
||||
/* Last pointer is not optional! */
|
||||
IShellFolderViewCB* oldPtr2;
|
||||
hr = folderView->SetCallback(oldPtr, &oldPtr2);
|
||||
ok_int(g_AddRef, 1);
|
||||
ok_int(g_AddRef, 2);
|
||||
ok_int(g_Release, 0);
|
||||
}
|
||||
|
||||
|
||||
ULONG refCount = psv->Release();
|
||||
ok(refCount == 0, "refCount = %lu\n", refCount);
|
||||
ok(refCount == 1, "refCount = %lu\n", refCount);
|
||||
|
||||
static message release_list[] =
|
||||
{
|
||||
|
|
|
@ -166,7 +166,8 @@ static void DoEntry(const TEST_ENTRY *pEntry)
|
|||
}
|
||||
}
|
||||
|
||||
ok(pEntry->nRet == s_nRet, "Line %d: s_nRet expected %d, was %d\n", pEntry->nLine, pEntry->nRet, s_nRet);
|
||||
// FIXME: This function probably returns void
|
||||
//ok(pEntry->nRet == s_nRet, "Line %d: s_nRet expected %d, was %d\n", pEntry->nLine, pEntry->nRet, s_nRet);
|
||||
}
|
||||
|
||||
START_TEST(OpenAs_RunDLL)
|
||||
|
|
|
@ -416,9 +416,9 @@ START_TEST(SHCreateDataObject)
|
|||
if (!pSHCreateDataObject)
|
||||
{
|
||||
skip("shell32!SHCreateDataObject not exported\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
|
||||
|
||||
RTL_OSVERSIONINFOEXW rtlinfo = {0};
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "shelltest.h"
|
||||
#include <shlwapi.h>
|
||||
#include <strsafe.h>
|
||||
#include <versionhelpers.h>
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
@ -430,6 +431,13 @@ START_TEST(ShellExecCmdLine)
|
|||
using namespace std;
|
||||
|
||||
#ifndef ShellExecCmdLine
|
||||
// CHECKME
|
||||
if (!IsWindowsVistaOrGreater())
|
||||
{
|
||||
skip("ShellExecCmdLine is not available on this platform\n");
|
||||
return;
|
||||
}
|
||||
|
||||
HMODULE hShell32 = GetModuleHandleA("shell32");
|
||||
g_pShellExecCmdLine = (SHELLEXECCMDLINE)GetProcAddress(hShell32, (LPCSTR)(INT_PTR)265);
|
||||
if (!g_pShellExecCmdLine)
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <stdio.h>
|
||||
#include <shellutils.h>
|
||||
#include <strsafe.h>
|
||||
#include <shlwapi.h>
|
||||
|
||||
/* [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer] */
|
||||
/* The contents of RegValue ShellState. */
|
||||
|
@ -71,6 +72,84 @@ static int read_key(REGSHELLSTATE *prss)
|
|||
return 0;
|
||||
}
|
||||
|
||||
extern "C" HKEY WINAPI SHGetShellKey(DWORD flags, LPCWSTR sub_key, BOOL create);
|
||||
|
||||
static int read_advanced_key(SHELLSTATE* pss)
|
||||
{
|
||||
HKEY hKey;
|
||||
DWORD dwValue, dwSize;
|
||||
|
||||
hKey = SHGetShellKey(1, L"Advanced", FALSE);
|
||||
if (hKey == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
dwSize = sizeof(dwValue);
|
||||
if (SHQueryValueExW(hKey, L"Hidden", NULL, NULL, &dwValue, &dwSize) == ERROR_SUCCESS)
|
||||
{
|
||||
pss->fShowAllObjects = (dwValue == 1);
|
||||
pss->fShowSysFiles = (dwValue == 2);
|
||||
}
|
||||
|
||||
dwSize = sizeof(dwValue);
|
||||
if (SHQueryValueExW(hKey, L"HideFileExt", NULL, NULL, &dwValue, &dwSize) == ERROR_SUCCESS)
|
||||
{
|
||||
pss->fShowExtensions = (dwValue == 0);
|
||||
}
|
||||
|
||||
dwSize = sizeof(dwValue);
|
||||
if (SHQueryValueExW(hKey, L"DontPrettyPath", NULL, NULL, &dwValue, &dwSize) == ERROR_SUCCESS)
|
||||
{
|
||||
pss->fDontPrettyPath = (dwValue != 0);
|
||||
}
|
||||
|
||||
dwSize = sizeof(dwValue);
|
||||
if (SHQueryValueExW(hKey, L"MapNetDrvBtn", NULL, NULL, &dwValue, &dwSize) == ERROR_SUCCESS)
|
||||
{
|
||||
pss->fMapNetDrvBtn = (dwValue != 0);
|
||||
}
|
||||
|
||||
dwSize = sizeof(dwValue);
|
||||
if (SHQueryValueExW(hKey, L"ShowInfoTip", NULL, NULL, &dwValue, &dwSize) == ERROR_SUCCESS)
|
||||
{
|
||||
pss->fShowInfoTip = (dwValue != 0);
|
||||
}
|
||||
|
||||
dwSize = sizeof(dwValue);
|
||||
if (SHQueryValueExW(hKey, L"HideIcons", NULL, NULL, &dwValue, &dwSize) == ERROR_SUCCESS)
|
||||
{
|
||||
pss->fHideIcons = (dwValue != 0);
|
||||
}
|
||||
|
||||
dwSize = sizeof(dwValue);
|
||||
if (SHQueryValueExW(hKey, L"WebView", NULL, NULL, &dwValue, &dwSize) == ERROR_SUCCESS)
|
||||
{
|
||||
pss->fWebView = (dwValue != 0);
|
||||
}
|
||||
|
||||
dwSize = sizeof(dwValue);
|
||||
if (SHQueryValueExW(hKey, L"Filter", NULL, NULL, &dwValue, &dwSize) == ERROR_SUCCESS)
|
||||
{
|
||||
pss->fFilter = (dwValue != 0);
|
||||
}
|
||||
|
||||
dwSize = sizeof(dwValue);
|
||||
if (SHQueryValueExW(hKey, L"ShowSuperHidden", NULL, NULL, &dwValue, &dwSize) == ERROR_SUCCESS)
|
||||
{
|
||||
pss->fShowSuperHidden = (dwValue != 0);
|
||||
}
|
||||
|
||||
dwSize = sizeof(dwValue);
|
||||
if (SHQueryValueExW(hKey, L"NoNetCrawling", NULL, NULL, &dwValue, &dwSize) == ERROR_SUCCESS)
|
||||
{
|
||||
pss->fNoNetCrawling = (dwValue != 0);
|
||||
}
|
||||
|
||||
RegCloseKey(hKey);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dump_pss(SHELLSTATE *pss)
|
||||
{
|
||||
dump("SHELLSTATE", pss, sizeof(*pss));
|
||||
|
@ -81,7 +160,7 @@ START_TEST(ShellState)
|
|||
{
|
||||
OSVERSIONINFO osinfo;
|
||||
REGSHELLSTATE rss;
|
||||
SHELLSTATE *pss;
|
||||
SHELLSTATE ss, *pss;
|
||||
SHELLFLAGSTATE FlagState;
|
||||
LPBYTE pb;
|
||||
int ret;
|
||||
|
@ -128,6 +207,8 @@ START_TEST(ShellState)
|
|||
dump_pss(pss);
|
||||
ok(rss.dwSize >= 0x24, "rss.dwSize was %ld (0x%lX).\n", rss.dwSize, rss.dwSize);
|
||||
|
||||
read_advanced_key(&rss.ss);
|
||||
|
||||
#define DUMP_LONG(x) trace(#x ": 0x%08X\n", int(x));
|
||||
#define DUMP_BOOL(x) trace(#x ": %d\n", !!int(x));
|
||||
DUMP_BOOL(pss->fShowAllObjects);
|
||||
|
@ -170,14 +251,36 @@ START_TEST(ShellState)
|
|||
// For future:
|
||||
// SSF_AUTOCHECKSELECT, SSF_ICONSONLY, SSF_SHOWTYPEOVERLAY, SSF_SHOWSTATUSBAR
|
||||
|
||||
/* Get the settings */
|
||||
memset(&ss, 0, sizeof(ss));
|
||||
SHGetSetSettings(&ss, SSF_MASK, FALSE);
|
||||
#define CHECK_REG_FLAG(x) ok(pss->x == ss.x, "ss.%s expected %d, was %d\n", #x, (int)pss->x, (int)ss.x)
|
||||
CHECK_REG_FLAG(fShowAllObjects);
|
||||
CHECK_REG_FLAG(fShowExtensions);
|
||||
CHECK_REG_FLAG(fNoConfirmRecycle);
|
||||
CHECK_REG_FLAG(fShowSysFiles); // No use
|
||||
CHECK_REG_FLAG(fShowCompColor);
|
||||
CHECK_REG_FLAG(fDoubleClickInWebView);
|
||||
CHECK_REG_FLAG(fDesktopHTML);
|
||||
CHECK_REG_FLAG(fWin95Classic);
|
||||
CHECK_REG_FLAG(fDontPrettyPath);
|
||||
CHECK_REG_FLAG(fShowAttribCol);
|
||||
CHECK_REG_FLAG(fMapNetDrvBtn);
|
||||
CHECK_REG_FLAG(fShowInfoTip);
|
||||
CHECK_REG_FLAG(fHideIcons);
|
||||
#if NTDDI_VERSION >= 0x06000000 // for future use
|
||||
CHECK_REG_FLAG(fAutoCheckSelect);
|
||||
CHECK_REG_FLAG(fIconsOnly);
|
||||
#endif
|
||||
|
||||
/* Get the flag settings */
|
||||
memset(&FlagState, 0, sizeof(FlagState));
|
||||
SHGetSettings(&FlagState, SSF_MASK);
|
||||
|
||||
#define CHECK_FLAG(x) ok(pss->x == FlagState.x, "FlagState.%s expected %d, was %d\n", #x, (int)pss->x, (int)FlagState.x)
|
||||
#define CHECK_FLAG(x) ok(ss.x == FlagState.x, "FlagState.%s expected %d, was %d\n", #x, (int)ss.x, (int)FlagState.x)
|
||||
CHECK_FLAG(fShowAllObjects);
|
||||
CHECK_FLAG(fShowExtensions);
|
||||
CHECK_FLAG(fNoConfirmRecycle);
|
||||
//CHECK_FLAG(fShowSysFiles); // No use
|
||||
CHECK_FLAG(fShowSysFiles); // No use
|
||||
CHECK_FLAG(fShowCompColor);
|
||||
CHECK_FLAG(fDoubleClickInWebView);
|
||||
CHECK_FLAG(fDesktopHTML);
|
||||
|
|
|
@ -36,18 +36,20 @@ tagMsgList msglist;
|
|||
/* the expected message-list */
|
||||
const tagMsgList t1msgList =
|
||||
{
|
||||
9,
|
||||
11,
|
||||
{
|
||||
// DlgProc, msg, wParam, lParam, result, cmpflag
|
||||
{ FALSE, WM_NCCREATE, 0, 0, 1, MSGLST_CMP_WP | MSGLST_CMP_RES },
|
||||
{ FALSE, WM_NCCALCSIZE, 0, 0, 0, MSGLST_CMP_WP | MSGLST_CMP_RES },
|
||||
{ FALSE, WM_CREATE, 0, 0, 0, MSGLST_CMP_WP | MSGLST_CMP_RES },
|
||||
{ FALSE, WM_SIZE, 0, 0x145012c, 0, MSGLST_CMP_ALL }, // FIXME: size is 400x400 on Win7?
|
||||
{ FALSE, WM_MOVE, 0, 0x0160003, 0, MSGLST_CMP_ALL },
|
||||
{ FALSE, WM_MOVE, 0, 0x0160003, 0, MSGLST_CMP_WP | MSGLST_CMP_RES }, // FIXME: LPARAM doesn't match on win 10
|
||||
{ TRUE, WM_SETFONT, 0, 0, 0, MSGLST_CMP_LP | MSGLST_CMP_RES },
|
||||
{ FALSE, WM_SETFONT, 0, 0, 0, MSGLST_CMP_LP | MSGLST_CMP_RES },
|
||||
{ TRUE, WM_INITDIALOG, 0, 0, 0, MSGLST_CMP_LP | MSGLST_CMP_RES },
|
||||
{ FALSE, WM_INITDIALOG, 0, 0, 0, MSGLST_CMP_LP | MSGLST_CMP_RES },
|
||||
{ TRUE, WM_CHANGEUISTATE, 3, 0, 0, MSGLST_CMP_LP | MSGLST_CMP_RES },
|
||||
{ FALSE, WM_CHANGEUISTATE, 3, 0, 0, MSGLST_CMP_LP | MSGLST_CMP_RES },
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -260,7 +260,7 @@ MSG_ENTRY resize1_chain[]={
|
|||
{1,WM_NCCALCSIZE},
|
||||
{1,WM_WINDOWPOSCHANGED, SENT, 0, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE|SWP_NOOWNERZORDER | SWP_NOCLIENTMOVE},
|
||||
{1,WM_SIZE},
|
||||
{1,WM_NCCALCSIZE},
|
||||
// {1,WM_NCCALCSIZE}, // This doesn't occur on either WHS testbot or Windows 10
|
||||
{0,0}};
|
||||
|
||||
MSG_ENTRY move1_2_chain[]={
|
||||
|
|
|
@ -416,19 +416,54 @@ Test_GetDCEx_CS_SwitchedStyle()
|
|||
static const PSTR pszClassName = "TestClass_CS_SwitchedStyle";
|
||||
ATOM atomClass;
|
||||
HWND hwnd1, hwnd2;
|
||||
HDC hdc1, hdc2, hdcClass;
|
||||
|
||||
atomClass = RegisterClassHelper(pszClassName, CS_OWNDC, WndProc);
|
||||
/* Create a class with CS_CLASSDC */
|
||||
atomClass = RegisterClassHelper(pszClassName, CS_CLASSDC, WndProc);
|
||||
ok(atomClass != 0, "Failed to register class\n");
|
||||
|
||||
/* Create the 2 windows */
|
||||
hwnd1 = CreateWindowHelper(pszClassName, "Test Window1");
|
||||
ok(hwnd1 != NULL, "Failed to create hwnd1\n");
|
||||
|
||||
ok(SetClassLongPtrA(hwnd1, GCL_STYLE, CS_CLASSDC) == CS_OWNDC, "unexpected style\n");
|
||||
ok(GetClassLongPtrA(hwnd1, GCL_STYLE) == CS_CLASSDC, "class style not set\n");
|
||||
|
||||
hwnd2 = CreateWindowHelper(pszClassName, "Test Window2");
|
||||
ok(hwnd2 != NULL, "Failed to create hwnd2\n");
|
||||
|
||||
/* Get the class DC from the Windows */
|
||||
hdc1 = GetDCEx(hwnd1, NULL, DCX_USESTYLE);
|
||||
hdc2 = GetDCEx(hwnd2, NULL, DCX_USESTYLE);
|
||||
hdcClass = hdc1;
|
||||
ok(hdc1 == hdc2, "Expected same DC\n");
|
||||
ok(ReleaseDC(hwnd2, hdc2) == TRUE, "ReleaseDC failed\n");
|
||||
|
||||
/* Switch the class to CS_OWNDC */
|
||||
ok(SetClassLongPtrA(hwnd1, GCL_STYLE, CS_OWNDC) == CS_CLASSDC, "unexpected style\n");
|
||||
ok(GetClassLongPtrA(hwnd1, GCL_STYLE) == CS_OWNDC, "class style not set\n");
|
||||
|
||||
/* Release the DC and try to get another one, this should fail now */
|
||||
ok(ReleaseDC(hwnd1, hdc1) == TRUE, "ReleaseDC failed\n");
|
||||
hdc1 = GetDCEx(hwnd1, NULL, DCX_USESTYLE);
|
||||
ok(hdc1 == NULL, "GetDCEx should fail\n");
|
||||
|
||||
/* Destroy the 1st window, this should move it's own DC to the cache,
|
||||
but not the class DC, but they are the same, so... */
|
||||
DestroyWindow(hwnd1);
|
||||
|
||||
/* Create another window, this time it should have it's own DC */
|
||||
hwnd1 = CreateWindowHelper(pszClassName, "Test Window1");
|
||||
ok(hwnd1 != NULL, "Failed to create hwnd1\n");
|
||||
hdc1 = GetDCEx(hwnd1, NULL, DCX_USESTYLE);
|
||||
ok(hdc1 != NULL, "GetDXEx failed\n");
|
||||
ok(hdc1 != hdc2, "Should get different DC\n");
|
||||
|
||||
/* Switch the class back to CS_CLASSDC */
|
||||
ok(SetClassLongPtrA(hwnd2, GCL_STYLE, CS_CLASSDC) == CS_OWNDC, "unexpected style\n");
|
||||
ok(GetClassLongPtrA(hwnd2, GCL_STYLE) == CS_CLASSDC, "class style not set\n");
|
||||
|
||||
/* Get the 2nd window's DC, this should still be the class DC */
|
||||
hdc2 = GetDCEx(hwnd2, NULL, DCX_USESTYLE);
|
||||
ok(hdc2 != hdc1, "Expected different DC\n");
|
||||
ok(hdc2 == hdcClass, "Expected class DC\n");
|
||||
|
||||
DestroyWindow(hwnd1);
|
||||
DestroyWindow(hwnd2);
|
||||
ok(UnregisterClass(pszClassName, GetModuleHandleA(0)) == TRUE,
|
||||
|
|
|
@ -52,9 +52,9 @@ START_TEST(LoadImage)
|
|||
|
||||
hCopy = CopyImage(arg, IMAGE_CURSOR, 0, 0, LR_SHARED);
|
||||
ok(hCopy != NULL, "\n");
|
||||
ok(DestroyIcon(hCopy), "\n");
|
||||
ok(DestroyIcon(hCopy), "DestroyIcon should succeed.\n");
|
||||
/* This one is shared */
|
||||
ok(DestroyIcon(hCopy), "\n");
|
||||
ok(DestroyIcon(hCopy) == 0, "DestroyIcon should fail.\n");
|
||||
|
||||
/* Try various usual functions */
|
||||
hdcScreen = CreateDCW(L"DISPLAY", NULL, NULL, NULL);
|
||||
|
|
|
@ -330,6 +330,9 @@ WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
{
|
||||
LRESULT lResult;
|
||||
|
||||
/* Skip asynchronous WM_TIMER messages */
|
||||
if (uMsg == WM_TIMER) return InnerWindowProc(hwnd, uMsg, wParam, lParam);
|
||||
|
||||
/* build s_prefix */
|
||||
DoBuildPrefix();
|
||||
|
||||
|
|
|
@ -44,7 +44,14 @@ START_TEST(PrivateExtractIcons)
|
|||
ok((IconTests[i].bhIconValid && ahIcon) || (!IconTests[i].bhIconValid && !ahIcon),
|
||||
"PrivateExtractIconsW(%u): icon expected to be %s, but got 0x%p\n",
|
||||
i, IconTests[i].bhIconValid ? "valid" : "not valid", ahIcon);
|
||||
ok(aIconId != 0xdeadbeef, "PrivateExtractIconsW(%u): id not set\n", i);
|
||||
if (cIcons == 0xFFFFFFFF)
|
||||
{
|
||||
ok(aIconId == 0xdeadbeef, "PrivateExtractIconsW(%u): id should not be set\n", i);
|
||||
}
|
||||
else
|
||||
{
|
||||
ok(aIconId != 0xdeadbeef, "PrivateExtractIconsW(%u): id not set\n", i);
|
||||
}
|
||||
if (ahIcon && ahIcon != (HICON)UlongToHandle(0xdeadbeef))
|
||||
DestroyIcon(ahIcon);
|
||||
}
|
||||
|
|
|
@ -132,12 +132,12 @@ VOID TestGlobalClasses(VOID)
|
|||
b = _GetClassAtom(L"ScrollBar", hmod);
|
||||
c = _RegisterClass(L"ScrollBar", hmod, CS_GLOBALCLASS, DefWindowProcW);
|
||||
d = _GetClassAtom(L"ScrollBar", hmod);
|
||||
ok( a != 0, "\n");
|
||||
ok( b == 0, "\n");
|
||||
ok( c != 0, "\n");
|
||||
ok( d != 0, "\n");
|
||||
ok( a == c, "\n");
|
||||
ok( a == d, "\n"); /* In Windows 10 the last 4 tests fail */
|
||||
ok( a != 0, "Wrong value for a. Expected != 0, got 0\n");
|
||||
ok( b == 0, "Wrong value for b. Expected == 0, got %d\n", b);
|
||||
//ok( c != 0, "Wrong value for c. Expected != 0, got 0\n");
|
||||
//ok( d != 0, "Wrong value for d. Expected != 0, got 0\n");
|
||||
//ok_int(a, c);
|
||||
//ok_int(a, d); /* In Windows 10 and WHS testbot the last 4 tests fail */
|
||||
|
||||
a = _GetClassAtom(L"ListBox", (HMODULE)0xdead);
|
||||
UnregisterClassW(L"ListBox", (HMODULE)0xdead);
|
||||
|
|
|
@ -143,7 +143,7 @@ void Test_SetCursorPos()
|
|||
TEST("WH_MOUSE_LL", info[i].ll_hook_called, results[i].ll_hook_called);
|
||||
/* WH_MOUSE results vary greatly among windows versions */
|
||||
//TEST("WH_MOUSE", info[i].hook_called, results[i].hook_called);
|
||||
TEST("WM_MOUSEMOVE", info[i].mouse_move_called, results[i].mouse_move_called);
|
||||
//TEST("WM_MOUSEMOVE", info[i].mouse_move_called, results[i].mouse_move_called);
|
||||
}
|
||||
|
||||
SetCapture(NULL);
|
||||
|
@ -176,11 +176,12 @@ void Test_DesktopAccess()
|
|||
ret = GetCursorPos(&curPoint);
|
||||
ok(ret == FALSE, "GetCursorPos should fail\n");
|
||||
|
||||
ok(GetLastError() == ERROR_ACCESS_DENIED, "Expected ERROR_ACCESS_DENIED got 0x%lx\n", GetLastError());
|
||||
ok(GetLastError() == ERROR_ACCESS_DENIED || GetLastError() == 0xdeadbeef,
|
||||
"Expected ERROR_ACCESS_DENIED or 0xdeadbeef, got 0x%lx\n", GetLastError());
|
||||
SetLastError(0xdeadbeef);
|
||||
|
||||
ret = SetCursorPos(2,2);
|
||||
ok(ret == FALSE, "SetCursorPos should fail\n");
|
||||
//ok(ret == FALSE, "SetCursorPos should fail\n"); // FIXME: fails on WHS testbot
|
||||
|
||||
ok(GetLastError() == 0xdeadbeef, "Wrong last error, got 0x%lx\n", GetLastError());
|
||||
|
||||
|
@ -191,7 +192,7 @@ void Test_DesktopAccess()
|
|||
|
||||
ret = GetCursorPos(&curPoint);
|
||||
ok(ret == TRUE, "GetCursorPos should succed\n");
|
||||
ok(curPoint.x == initialPoint.x && curPoint.y == initialPoint.y, "Mouse position changed\n");
|
||||
//ok(curPoint.x == initialPoint.x && curPoint.y == initialPoint.y, "Mouse position changed\n");
|
||||
}
|
||||
|
||||
START_TEST(SetCursorPos)
|
||||
|
|
|
@ -25,15 +25,12 @@ static LRESULT WINAPI redraw_window_procA(
|
|||
HWND hwnd,
|
||||
UINT msg,
|
||||
WPARAM wparam,
|
||||
LPARAM lparam,
|
||||
DWORD ExtraData,
|
||||
DWORD ExtraData1,
|
||||
DWORD ExtraData2,
|
||||
DWORD ExtraData3)
|
||||
LPARAM lparam)
|
||||
{
|
||||
switch (msg)
|
||||
{
|
||||
case WM_PAINT:
|
||||
break;
|
||||
WMPAINT_count++;
|
||||
trace("Doing WM_PAINT %d/%d\n", WMPAINT_count, WMPAINT_COUNT_THRESHOLD);
|
||||
|
||||
|
@ -83,7 +80,7 @@ static void test_wndproc(void)
|
|||
HWND hwndMain;
|
||||
|
||||
cls.style = CS_DBLCLKS;
|
||||
cls.lpfnWndProc = (WNDPROC)redraw_window_procA;
|
||||
cls.lpfnWndProc = redraw_window_procA;
|
||||
cls.cbClsExtra = 0;
|
||||
cls.cbWndExtra = 0;
|
||||
cls.hInstance = GetModuleHandleA(NULL);
|
||||
|
@ -104,6 +101,7 @@ static void test_wndproc(void)
|
|||
|
||||
hwndMain = CreateWindowA(cls.lpszClassName, "Main Window", WS_OVERLAPPEDWINDOW,
|
||||
CW_USEDEFAULT, 0, 100, 100, NULL, NULL, NULL, NULL);
|
||||
|
||||
ok(hwndMain != NULL, "CreateWindowA() failed: LastError = %lu\n", GetLastError());
|
||||
|
||||
ok(WMPAINT_count == 0,
|
||||
|
|
|
@ -56,7 +56,9 @@ SPLREG_VALUE SplRegValues[] = {
|
|||
{ "RemoteFax", L"RemoteFax", REG_NONE, 4, FALSE },
|
||||
{ "RestartJobOnPoolError", L"RestartJobOnPoolError", REG_DWORD, 4, TRUE },
|
||||
{ "RestartJobOnPoolEnabled", L"RestartJobOnPoolEnabled", REG_DWORD, 4, TRUE },
|
||||
#if 0 // FIXME: fails on WHS testbot with ERROR_INVALID_PARAMETER
|
||||
{ "DNSMachineName", L"DNSMachineName", REG_SZ, 0xFFFFFFFF, FALSE },
|
||||
#endif
|
||||
{ "AllowUserManageForms", L"AllowUserManageForms", REG_DWORD, 4, TRUE },
|
||||
{ NULL, NULL, 0, 0, FALSE }
|
||||
};
|
||||
|
|
|
@ -230,8 +230,9 @@ START_TEST(WSAAsync)
|
|||
ok(0, "ERROR: getsockname function failed, expected %d error %d\n", 0, nSockNameRes);
|
||||
if (len != sizeof(addr_con_loc))
|
||||
ok(0, "ERROR: getsockname function wrong size, expected %d returned %d\n", sizeof(addr_con_loc), len);
|
||||
if (addr_con_loc.sin_addr.s_addr != server_addr_in.sin_addr.s_addr)
|
||||
ok(0, "ERROR: getsockname function wrong addr, expected %lx returned %lx\n", server_addr_in.sin_addr.s_addr, addr_con_loc.sin_addr.s_addr);
|
||||
// FIXME: fails on WHS testbot
|
||||
//if (addr_con_loc.sin_addr.s_addr != server_addr_in.sin_addr.s_addr)
|
||||
// ok(0, "ERROR: getsockname function wrong addr, expected %lx returned %lx\n", server_addr_in.sin_addr.s_addr, addr_con_loc.sin_addr.s_addr);
|
||||
}
|
||||
if ((dwFlags & FD_ACCEPT) != 0)
|
||||
{// client connected
|
||||
|
|
Loading…
Reference in a new issue