mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +00:00
- 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:
parent
e85cc27f88
commit
3a85cbb4da
4 changed files with 24 additions and 7 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ typedef struct _TESTINFO
|
|||
{
|
||||
struct
|
||||
{
|
||||
/* nothing */
|
||||
HANDLE Dummy;
|
||||
} Test1;
|
||||
struct
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue