- 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
This commit is contained in:
Stefan Ginsberg 2009-08-22 14:40:56 +00:00
parent e85cc27f88
commit 3a85cbb4da
4 changed files with 24 additions and 7 deletions

View file

@ -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);

View file

@ -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"
);
#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 ret;
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);

View file

@ -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);

View file

@ -102,7 +102,7 @@ typedef struct _TESTINFO
{
struct
{
/* nothing */
HANDLE Dummy;
} Test1;
struct
{