Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
9e73f55a
Commit
9e73f55a
authored
Nov 25, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store the last error code at the TEB offset used by NT instead of the
Win9x one.
parent
ff036529
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
thread.c
dlls/kernel/thread.c
+4
-4
heap.c
dlls/ntdll/heap.c
+1
-1
thread.h
include/thread.h
+1
-1
winbase.h
include/winbase.h
+2
-2
No files found.
dlls/kernel/thread.c
View file @
9e73f55a
...
...
@@ -623,7 +623,7 @@ HANDLE WINAPI GetCurrentThread(void)
__ASM_GLOBAL_FUNC
(
SetLastError
,
"movl 4(%esp),%eax
\n\t
"
".byte 0x64
\n\t
"
"movl %eax,0x
60
\n\t
"
"movl %eax,0x
34
\n\t
"
"ret $4"
);
/***********************************************************************
...
...
@@ -631,7 +631,7 @@ __ASM_GLOBAL_FUNC( SetLastError,
* GetLastError (KERNEL32.@)
*/
/* DWORD WINAPI GetLastError(void); */
__ASM_GLOBAL_FUNC
(
GetLastError
,
".byte 0x64
\n\t
movl 0x
60
,%eax
\n\t
ret"
);
__ASM_GLOBAL_FUNC
(
GetLastError
,
".byte 0x64
\n\t
movl 0x
34
,%eax
\n\t
ret"
);
/***********************************************************************
* 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 */
{
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
)
{
return
NtCurrentTeb
()
->
last_error
;
return
NtCurrentTeb
()
->
LastErrorValue
;
}
/***********************************************************************
...
...
dlls/ntdll/heap.c
View file @
9e73f55a
...
...
@@ -135,7 +135,7 @@ static BOOL HEAP_IsRealArena( HEAP *heapPtr, DWORD flags, LPCVOID block, BOOL qu
/* SetLastError for ntdll */
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 */
...
...
include/thread.h
View file @
9e73f55a
...
...
@@ -68,7 +68,7 @@ typedef struct _TEB
WORD
pad1
;
/* --n 2a */
PVOID
ThreadLocalStoragePointer
;
/* 1-- 2c Pointer to TLS array */
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 */
WORD
teb_sel
;
/* 1-- 3c Selector to TEB */
WORD
emu_sel
;
/* 1-n 3e 80387 emulator selector */
...
...
include/winbase.h
View file @
9e73f55a
...
...
@@ -1903,7 +1903,7 @@ extern inline DWORD WINAPI GetLastError(void);
extern
inline
DWORD
WINAPI
GetLastError
(
void
)
{
DWORD
ret
;
__asm__
__volatile__
(
".byte 0x64
\n\t
movl 0x
60
,%0"
:
"=r"
(
ret
)
);
__asm__
__volatile__
(
".byte 0x64
\n\t
movl 0x
34
,%0"
:
"=r"
(
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
)
{
__asm__
__volatile__
(
".byte 0x64
\n\t
movl %0,0x
60
"
:
:
"r"
(
err
)
:
"memory"
);
__asm__
__volatile__
(
".byte 0x64
\n\t
movl %0,0x
34
"
:
:
"r"
(
err
)
:
"memory"
);
}
extern
inline
HANDLE
WINAPI
GetProcessHeap
(
void
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment