krnl386: Add a simple wrapper for CommonUnimpStub instead of saving/restoring all registers.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2017-07-24 11:19:32 +02:00
parent 92d5ce3c76
commit f91b4bd410
3 changed files with 28 additions and 13 deletions

View File

@ -24,7 +24,7 @@
14 stdcall -noname -i386 -private k32LoadStringA(long long ptr long) krnl386.exe16.k32LoadStringA
15 varargs -noname -i386 -private k32wsprintfA(str str) krnl386.exe16.k32wsprintfA
16 stdcall -noname -i386 -private k32wvsprintfA(ptr str ptr) krnl386.exe16.k32wvsprintfA
17 stdcall -noname -i386 -private -register CommonUnimpStub() krnl386.exe16.CommonUnimpStub
17 stdcall -noname -i386 -private -norelay CommonUnimpStub() krnl386.exe16.CommonUnimpStub
18 stdcall -noname -i386 -private GetProcessDword(long long) krnl386.exe16.GetProcessDword
19 stub -noname -i386 ThunkTheTemplateHandle
20 stdcall -noname -i386 -private DosFileHandleToWin32Handle(long) krnl386.exe16.DosFileHandleToWin32Handle

View File

@ -565,7 +565,7 @@
@ stdcall -arch=win32 k32LoadStringA(long long ptr long)
@ varargs -arch=win32 k32wsprintfA(str str)
@ stdcall -arch=win32 k32wvsprintfA(ptr str ptr)
@ stdcall -arch=win32 -register CommonUnimpStub()
@ stdcall -arch=win32 -norelay CommonUnimpStub()
@ stdcall -arch=win32 GetProcessDword(long long)
@ stdcall -arch=win32 DosFileHandleToWin32Handle(long)
@ stdcall -arch=win32 Win32HandleToDosFileHandle(long)

View File

@ -2123,22 +2123,37 @@ LPVOID WINAPI GetPK16SysVar(void)
/**********************************************************************
* CommonUnimpStub (KERNEL32.17)
*/
void WINAPI __regs_CommonUnimpStub( CONTEXT *context )
int WINAPI __regs_CommonUnimpStub( const char *name, int type )
{
FIXME("generic stub: %s\n", ((LPSTR)context->Eax ? (LPSTR)context->Eax : "?"));
FIXME("generic stub %s\n", debugstr_a(name));
switch ((context->Ecx >> 4) & 0x0f)
switch (type)
{
case 15: context->Eax = -1; break;
case 14: context->Eax = 0x78; break;
case 13: context->Eax = 0x32; break;
case 1: context->Eax = 1; break;
default: context->Eax = 0; break;
case 15: return -1;
case 14: return ERROR_CALL_NOT_IMPLEMENTED;
case 13: return ERROR_NOT_SUPPORTED;
case 1: return 1;
default: return 0;
}
context->Esp += (context->Ecx & 0x0f) * 4;
}
DEFINE_REGS_ENTRYPOINT( CommonUnimpStub, 0 )
__ASM_STDCALL_FUNC( CommonUnimpStub, 0,
"pushl %ecx\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
"shrl $4,%ecx\n\t"
"andl $0xf,%ecx\n\t"
"pushl %ecx\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
"pushl %eax\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
"call " __ASM_NAME("__regs_CommonUnimpStub") __ASM_STDCALL(8) "\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset -8\n\t")
"popl %ecx\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset -4\n\t")
"andl $0xf,%ecx\n\t"
"movl (%esp),%edx\n\t"
"leal (%esp,%ecx,4),%esp\n\t"
"movl %edx,(%esp)\n\t"
"ret" )
/**********************************************************************
* HouseCleanLogicallyDeadHandles (KERNEL32.33)