Author: fireball
Date: Sat Apr 10 22:29:37 2010
New Revision: 46827
URL:
http://svn.reactos.org/svn/reactos?rev=46827&view=rev
Log:
- A user server inside the win32k should have its own error state and must not change
thread's last error! Implement this by using a global_error variable, having in mind
that handling a server request is an atomic operation.
- Number of winetest failures is dramatically reduced.
Modified:
branches/arwinss/reactos/subsystems/win32/win32k/include/winesup.h
branches/arwinss/reactos/subsystems/win32/win32k/wine/main.c
branches/arwinss/reactos/subsystems/win32/win32k/wine/winesup.c
Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/winesup.h
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/include/winesup.h [iso-8859-1]
(original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/include/winesup.h [iso-8859-1] Sat
Apr 10 22:29:37 2010
@@ -46,7 +46,6 @@
#define snprintfW _snwprintf
#define vsnprintfW _vsnwprintf
-#define set_win32_error(x) SetLastWin32Error(x)
#define assert ASSERT
/* HACK */
@@ -64,6 +63,7 @@
void set_error( unsigned int err );
unsigned int get_error(void);
static inline void clear_error(void) { set_error(0); }
+static inline void set_win32_error( unsigned int err ) { set_error( 0xc0010000 | err );
}
struct window_class* get_window_class( user_handle_t window );
/* gets the discretionary access control list from a security descriptor */
Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/main.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/wine/main.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/wine/main.c [iso-8859-1] Sat Apr 10
22:29:37 2010
@@ -85,8 +85,8 @@
/* Acquire lock */
UserEnterExclusive();
- /* Clear error status */
- set_error(0);
+ /* Clear internal error status */
+ clear_error();
if (reqinfo->data_count > 1)
{
Modified: branches/arwinss/reactos/subsystems/win32/win32k/wine/winesup.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/wine/winesup.c [iso-8859-1]
(original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/wine/winesup.c [iso-8859-1] Sat Apr
10 22:29:37 2010
@@ -18,16 +18,18 @@
timeout_t current_time = 0ULL;
int debug_level = 0;
+unsigned int global_error;
+
/* PRIVATE FUNCTIONS *********************************************************/
void set_error( unsigned int err )
{
- SetLastNtError(err);
+ global_error = err;
}
unsigned int get_error(void)
{
- return GetLastNtError();
+ return global_error;
}
const SID *token_get_user( void *token )