mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:12:57 +00:00
[KERNEL32]: Get rid of RestoreLastError, it's a forward.
[KERNEL32]: SetLastError should only set the error code if it's different from the one already set. This is not about optimization: it's compatibility with hardware data breakpoint behavior. svn path=/trunk/; revision=52816
This commit is contained in:
parent
a2ed7524c7
commit
3f6d71af42
1 changed files with 9 additions and 28 deletions
|
@ -660,20 +660,13 @@ IsBadStringPtrA(IN LPCSTR lpsz,
|
||||||
*/
|
*/
|
||||||
VOID
|
VOID
|
||||||
WINAPI
|
WINAPI
|
||||||
SetLastError(
|
SetLastError(IN DWORD dwErrCode)
|
||||||
IN DWORD dwErrCode)
|
|
||||||
{
|
{
|
||||||
if (g_dwLastErrorToBreakOn)
|
/* Break if a debugger requested checking for this error code */
|
||||||
{
|
if ((g_dwLastErrorToBreakOn) && (g_dwLastErrorToBreakOn == dwErrCode)) DbgBreakPoint();
|
||||||
/* If we have error to break on and if current matches, break */
|
|
||||||
if (g_dwLastErrorToBreakOn == dwErrCode)
|
|
||||||
{
|
|
||||||
DbgBreakPoint();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set last error */
|
/* Set last error if it's a new error */
|
||||||
NtCurrentTeb()->LastErrorValue = dwErrCode;
|
if (NtCurrentTeb()->LastErrorValue != dwErrCode) NtCurrentTeb()->LastErrorValue = dwErrCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -681,9 +674,9 @@ SetLastError(
|
||||||
*/
|
*/
|
||||||
VOID
|
VOID
|
||||||
WINAPI
|
WINAPI
|
||||||
BaseSetLastNTError(
|
BaseSetLastNTError(IN NTSTATUS Status)
|
||||||
IN NTSTATUS Status)
|
|
||||||
{
|
{
|
||||||
|
/* Convert from NT to Win32, then set */
|
||||||
SetLastError(RtlNtStatusToDosError(Status));
|
SetLastError(RtlNtStatusToDosError(Status));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -692,22 +685,10 @@ BaseSetLastNTError(
|
||||||
*/
|
*/
|
||||||
DWORD
|
DWORD
|
||||||
WINAPI
|
WINAPI
|
||||||
GetLastError()
|
GetLastError(VOID)
|
||||||
{
|
{
|
||||||
|
/* Return the current value */
|
||||||
return NtCurrentTeb()->LastErrorValue;
|
return NtCurrentTeb()->LastErrorValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
|
||||||
VOID
|
|
||||||
WINAPI
|
|
||||||
RestoreLastError(
|
|
||||||
DWORD dwErrCode
|
|
||||||
)
|
|
||||||
{
|
|
||||||
STUB;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue