From: Stefan Ginsberg Date: Sat, 22 Aug 2009 14:40:56 +0000 (+0000) Subject: - combotst: Fix uninitialized variable usage spotted by MSVC X-Git-Tag: ReactOS-0.3.11~1039 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=3a85cbb4dadb982c8397adce4c43dd43ac81403f - combotst: Fix uninitialized variable usage spotted by MSVC - tmrqueue: Don't use empty structures, MSVC doe - w32knapi: Implement IntSyscall in MSVC assembly, be compatible with C89 variable initialization and use '%' instead of '\%' to avoid a msvc warning. svn path=/trunk/; revision=42845 --- diff --git a/rostests/apitests/w32knapi/ntuser/NtUserToUnicodeEx.c b/rostests/apitests/w32knapi/ntuser/NtUserToUnicodeEx.c index fd129dc61c2..921b660752e 100644 --- a/rostests/apitests/w32knapi/ntuser/NtUserToUnicodeEx.c +++ b/rostests/apitests/w32knapi/ntuser/NtUserToUnicodeEx.c @@ -139,7 +139,7 @@ Test_NtUserToUnicodeEx(PTESTINFO pti) TEST(NtUserToUnicodeEx(52, 5, KeyState, Buffer, 10, 0, hkl) == 1); TEST(Buffer[0] == '$'); TEST(NtUserToUnicodeEx(53, 6, KeyState, Buffer, 10, 0, hkl) == 1); - TEST(Buffer[0] == '\%'); + TEST(Buffer[0] == '%'); TEST(NtUserToUnicodeEx(54, 7, KeyState, Buffer, 10, 0, hkl) == 1); TEST(Buffer[0] == '^'); TEST(NtUserToUnicodeEx(55, 8, KeyState, Buffer, 10, 0, hkl) == 1); diff --git a/rostests/apitests/w32knapi/w32knapi.c b/rostests/apitests/w32knapi/w32knapi.c index 1835c830aea..28240e210bb 100644 --- a/rostests/apitests/w32knapi/w32knapi.c +++ b/rostests/apitests/w32knapi/w32knapi.c @@ -49,8 +49,9 @@ GetHandleUserData(HGDIOBJ hobj) static DWORD WINAPI IntSyscall(FARPROC proc, UINT cParams, PVOID pFirstParam) { - DWORD ret; + DWORD retval; +#ifdef __GNUC__ asm volatile ( "pushfl;" // Save flags @@ -62,21 +63,37 @@ IntSyscall(FARPROC proc, UINT cParams, PVOID pFirstParam) "rep movsd;" // Copy params to the stack "call *%%edx;" // Call function "popfl;" // Restore flags - : "=a" (ret) + : "=a" (retval) : "S" (pFirstParam), "c" (cParams), "d"(proc) : "%edi" ); - - return ret; +#else + __asm + { + pushf + mov eax, cParams + shl eax, 2 + sub esp, eax + mov edi, esp + cld + rep movsd + call proc + mov retval, eax + popf + }; +#endif + + return retval; } DWORD Syscall(LPWSTR pszFunction, int cParams, void* pParams) { char szFunctionName[MAX_PATH]; + FARPROC proc; sprintf(szFunctionName, "%ls", pszFunction); - FARPROC proc = (FARPROC)GetProcAddress(g_hModule, szFunctionName); + proc = (FARPROC)GetProcAddress(g_hModule, szFunctionName); if (!proc) { printf("Couldn't find proc: %s\n", szFunctionName); diff --git a/rostests/tests/combotst/combotst.c b/rostests/tests/combotst/combotst.c index db6effa3cfc..561218d7176 100644 --- a/rostests/tests/combotst/combotst.c +++ b/rostests/tests/combotst/combotst.c @@ -115,7 +115,7 @@ static VOID HandlePrintRect(HWND handle,DWORD Msg,WPARAM wParam,LPARAM lParam) { - RECT rect; + RECT rect = *(RECT*)lParam; TextBuffer[8] = (char)(BUFFERLEN - 8); /* Setting the max size to put chars in first byte */ SendMessage(handle,Msg,wParam,lParam); diff --git a/rostests/tests/tmrqueue/tmrqueue.c b/rostests/tests/tmrqueue/tmrqueue.c index d7c4f4b59e1..0e58393bc03 100644 --- a/rostests/tests/tmrqueue/tmrqueue.c +++ b/rostests/tests/tmrqueue/tmrqueue.c @@ -102,7 +102,7 @@ typedef struct _TESTINFO { struct { - /* nothing */ + HANDLE Dummy; } Test1; struct {