mirror of
https://github.com/reactos/wine.git
synced 2025-04-09 19:41:24 +00:00
Store the last error code at the TEB offset used by NT instead of the
Win9x one.
This commit is contained in:
parent
ff0365290b
commit
9e73f55af3
@ -623,7 +623,7 @@ HANDLE WINAPI GetCurrentThread(void)
|
|||||||
__ASM_GLOBAL_FUNC( SetLastError,
|
__ASM_GLOBAL_FUNC( SetLastError,
|
||||||
"movl 4(%esp),%eax\n\t"
|
"movl 4(%esp),%eax\n\t"
|
||||||
".byte 0x64\n\t"
|
".byte 0x64\n\t"
|
||||||
"movl %eax,0x60\n\t"
|
"movl %eax,0x34\n\t"
|
||||||
"ret $4" );
|
"ret $4" );
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
@ -631,7 +631,7 @@ __ASM_GLOBAL_FUNC( SetLastError,
|
|||||||
* GetLastError (KERNEL32.@)
|
* GetLastError (KERNEL32.@)
|
||||||
*/
|
*/
|
||||||
/* DWORD WINAPI GetLastError(void); */
|
/* DWORD WINAPI GetLastError(void); */
|
||||||
__ASM_GLOBAL_FUNC( GetLastError, ".byte 0x64\n\tmovl 0x60,%eax\n\tret" );
|
__ASM_GLOBAL_FUNC( GetLastError, ".byte 0x64\n\tmovl 0x34,%eax\n\tret" );
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* GetCurrentProcessId (KERNEL.471)
|
* GetCurrentProcessId (KERNEL.471)
|
||||||
@ -657,7 +657,7 @@ __ASM_GLOBAL_FUNC( GetCurrentThreadId, ".byte 0x64\n\tmovl 0x24,%eax\n\tret" );
|
|||||||
*/
|
*/
|
||||||
void WINAPI SetLastError( DWORD error ) /* [in] Per-thread error code */
|
void WINAPI SetLastError( DWORD error ) /* [in] Per-thread error code */
|
||||||
{
|
{
|
||||||
NtCurrentTeb()->last_error = error;
|
NtCurrentTeb()->LastErrorValue = error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
@ -668,7 +668,7 @@ void WINAPI SetLastError( DWORD error ) /* [in] Per-thread error code */
|
|||||||
*/
|
*/
|
||||||
DWORD WINAPI GetLastError(void)
|
DWORD WINAPI GetLastError(void)
|
||||||
{
|
{
|
||||||
return NtCurrentTeb()->last_error;
|
return NtCurrentTeb()->LastErrorValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -135,7 +135,7 @@ static BOOL HEAP_IsRealArena( HEAP *heapPtr, DWORD flags, LPCVOID block, BOOL qu
|
|||||||
/* SetLastError for ntdll */
|
/* SetLastError for ntdll */
|
||||||
inline static void set_status( NTSTATUS status )
|
inline static void set_status( NTSTATUS status )
|
||||||
{
|
{
|
||||||
NtCurrentTeb()->last_error = RtlNtStatusToDosError( status );
|
NtCurrentTeb()->LastErrorValue = RtlNtStatusToDosError( status );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* mark a block of memory as free for debugging purposes */
|
/* mark a block of memory as free for debugging purposes */
|
||||||
|
@ -68,7 +68,7 @@ typedef struct _TEB
|
|||||||
WORD pad1; /* --n 2a */
|
WORD pad1; /* --n 2a */
|
||||||
PVOID ThreadLocalStoragePointer; /* 1-- 2c Pointer to TLS array */
|
PVOID ThreadLocalStoragePointer; /* 1-- 2c Pointer to TLS array */
|
||||||
PEB *Peb; /* 12- 30 owning process PEB */
|
PEB *Peb; /* 12- 30 owning process PEB */
|
||||||
DWORD flags; /* 1-n 34 */
|
DWORD LastErrorValue; /* -2- 34 Last error code */
|
||||||
DWORD exit_code; /* 1-- 38 Termination status */
|
DWORD exit_code; /* 1-- 38 Termination status */
|
||||||
WORD teb_sel; /* 1-- 3c Selector to TEB */
|
WORD teb_sel; /* 1-- 3c Selector to TEB */
|
||||||
WORD emu_sel; /* 1-n 3e 80387 emulator selector */
|
WORD emu_sel; /* 1-n 3e 80387 emulator selector */
|
||||||
|
@ -1903,7 +1903,7 @@ extern inline DWORD WINAPI GetLastError(void);
|
|||||||
extern inline DWORD WINAPI GetLastError(void)
|
extern inline DWORD WINAPI GetLastError(void)
|
||||||
{
|
{
|
||||||
DWORD ret;
|
DWORD ret;
|
||||||
__asm__ __volatile__( ".byte 0x64\n\tmovl 0x60,%0" : "=r" (ret) );
|
__asm__ __volatile__( ".byte 0x64\n\tmovl 0x34,%0" : "=r" (ret) );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1926,7 +1926,7 @@ extern inline DWORD WINAPI GetCurrentThreadId(void)
|
|||||||
extern inline void WINAPI SetLastError( DWORD err );
|
extern inline void WINAPI SetLastError( DWORD err );
|
||||||
extern inline void WINAPI SetLastError( DWORD err )
|
extern inline void WINAPI SetLastError( DWORD err )
|
||||||
{
|
{
|
||||||
__asm__ __volatile__( ".byte 0x64\n\tmovl %0,0x60" : : "r" (err) : "memory" );
|
__asm__ __volatile__( ".byte 0x64\n\tmovl %0,0x34" : : "r" (err) : "memory" );
|
||||||
}
|
}
|
||||||
|
|
||||||
extern inline HANDLE WINAPI GetProcessHeap(void);
|
extern inline HANDLE WINAPI GetProcessHeap(void);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user