mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[NTOSKRNL]
Fix KiConvertToGuiThread on MSVC builds, by using a raw assembly function instead of a (broken) inline asembly function MSVC built kernel boots further now. svn path=/trunk/; revision=52509
This commit is contained in:
parent
c1276124ac
commit
82562115f8
2 changed files with 26 additions and 13 deletions
|
@ -707,6 +707,7 @@ KiCheckForApcDelivery(IN PKTRAP_FRAME TrapFrame)
|
|||
//
|
||||
// Converts a base thread to a GUI thread
|
||||
//
|
||||
#ifdef __GNUC__
|
||||
NTSTATUS
|
||||
FORCEINLINE
|
||||
KiConvertToGuiThread(VOID)
|
||||
|
@ -730,7 +731,6 @@ KiConvertToGuiThread(VOID)
|
|||
* on its merry way.
|
||||
*
|
||||
*/
|
||||
#ifdef __GNUC__
|
||||
__asm__ __volatile__
|
||||
(
|
||||
"movl %%ebp, %1\n"
|
||||
|
@ -743,22 +743,15 @@ KiConvertToGuiThread(VOID)
|
|||
:
|
||||
: "%esp", "%ecx", "%edx", "memory"
|
||||
);
|
||||
return Result;
|
||||
}
|
||||
#elif defined(_MSC_VER)
|
||||
NTSTATUS NTAPI PsConvertToGuiThread(VOID);
|
||||
__asm
|
||||
{
|
||||
mov StackFrame, ebp
|
||||
sub StackFrame, esp
|
||||
call PsConvertToGuiThread
|
||||
add StackFrame, esp
|
||||
mov ebp, StackFrame
|
||||
mov Result, eax
|
||||
}
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
KiConvertToGuiThread(VOID);
|
||||
#else
|
||||
#error Unknown Compiler
|
||||
#endif
|
||||
return Result;
|
||||
}
|
||||
|
||||
//
|
||||
// Switches from boot loader to initial kernel stack
|
||||
|
|
|
@ -156,4 +156,24 @@ KiTrapExitStub KiEditedTrapReturn, (KI_RESTORE_VOLATILES OR KI_RESTORE_EF
|
|||
KiTrapExitStub KiTrapReturn, (KI_RESTORE_VOLATILES OR KI_RESTORE_SEGMENTS OR KI_EXIT_IRET)
|
||||
KiTrapExitStub KiTrapReturnNoSegments, (KI_RESTORE_VOLATILES OR KI_EXIT_IRET)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
EXTERN _PsConvertToGuiThread@0:PROC
|
||||
|
||||
PUBLIC _KiConvertToGuiThread@0
|
||||
_KiConvertToGuiThread@0:
|
||||
/* Calculate the stack frame offset in ebx */
|
||||
mov ebx, ebp
|
||||
sub ebx, esp
|
||||
|
||||
/* Call the worker function */
|
||||
call _PsConvertToGuiThread@0
|
||||
|
||||
/* Adjust ebp to the new stack */
|
||||
mov ebp, esp
|
||||
add ebp, ebx
|
||||
|
||||
/* return to the caller */
|
||||
ret
|
||||
#endif
|
||||
|
||||
END
|
||||
|
|
Loading…
Reference in a new issue