Commit 2509c06e authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

Added a test, specifically for NT/W2K/XP/W2K3.

parent 5bb8f968
...@@ -235,8 +235,57 @@ static void test_info(void) ...@@ -235,8 +235,57 @@ static void test_info(void)
#endif #endif
} }
static void test_unicode(void)
{
DWORD hdlA, retvalA;
DWORD hdlW, retvalW;
BOOL retA,retW;
PVOID pVersionInfoA = NULL;
PVOID pVersionInfoW = NULL;
char mypathA[MAX_PATH] = "";
WCHAR mypathW[MAX_PATH];
/* If we call GetFileVersionInfoA on a system that supports Unicode (NT/W2K/XP/W2K3 by default)
* then the versioninfo will contain Unicode strings.
* Wine however always converts a VersionInfo32 to VersionInfo16 when called through GetFileVersionInfoA
* regardless of Windows version
* The test is to call both the A and W versions, which should have the same Version Information,
* on systems that support both calls.
*/
/* First get the versioninfo via the W versions */
GetModuleFileNameW(NULL, mypathW, MAX_PATH);
if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
{
trace("GetModuleFileNameW not existing on this platform, skipping rest of test\n");
return;
}
retvalW = GetFileVersionInfoSizeW( mypathW, &hdlW);
pVersionInfoW = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, retvalW );
retW = GetFileVersionInfoW( mypathW, 0, retvalW, pVersionInfoW );
/* And now via the A versions */
GetModuleFileNameA(NULL, mypathA, MAX_PATH);
retvalA = GetFileVersionInfoSizeA( mypathA, &hdlA);
pVersionInfoA = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, retvalA );
retA = GetFileVersionInfoA( mypathA, 0, retvalA, pVersionInfoA );
ok( retvalA == retvalW, "The size of the struct should be the same for both A/W calls, it is (%ld) vs. (%ld)\n",
retvalA, retvalW);
todo_wine
{
ok( !memcmp(pVersionInfoA, pVersionInfoW, retvalA), "Both structs should be the same, they aren't\n");
}
HeapFree( GetProcessHeap(), 0, pVersionInfoA);
HeapFree( GetProcessHeap(), 0, pVersionInfoW);
}
START_TEST(info) START_TEST(info)
{ {
test_info_size(); test_info_size();
test_info(); test_info();
test_unicode();
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment