forgot a file:-| sry Added: trunk/reactos/subsys/win32k/include/ntuser.h _____
Added: trunk/reactos/subsys/win32k/include/ntuser.h --- trunk/reactos/subsys/win32k/include/ntuser.h 2005-09-06 06:44:34 UTC (rev 17691) +++ trunk/reactos/subsys/win32k/include/ntuser.h 2005-09-06 07:58:43 UTC (rev 17692) @@ -0,0 +1,60 @@
+#ifndef _WIN32K_NTUSER_H +#define _WIN32K_NTUSER_H + + +extern char* _file; +extern DWORD _line; +extern DWORD _locked; + +extern FAST_MUTEX UserLock; + +#define DECLARE_RETURN(type) type _ret_ +#define RETURN(value) { _ret_ = value; goto _cleanup_; } +#define CLEANUP /*unreachable*/ ASSERT(FALSE); _cleanup_ +#define END_CLEANUP return _ret_; + + +#define UserEnterCo() UserEnterExclusive() +#define UserLeaveCo() UserLeave() + +#define UserEnterShared() UserEnterExclusive() + +#define UserEnterExclusive() \ +{ \ + /* DPRINT1("try xlock, %s, %i (%i)\n",__FILE__,__LINE__, _locked);*/ \ + if (UserLock.Owner == KeGetCurrentThread()){ \ + DPRINT1("file %s, line %i\n",_file, _line); \ + ASSERT(FALSE); \ + } \ + UUserEnterExclusive(); \ + ASSERT(InterlockedIncrement(&_locked) == 1 /*> 0*/); \ + _file = __FILE__; _line = __LINE__; \ + /* DPRINT("got lock, %s, %i (%i)\n",__FILE__,__LINE__, _locked);*/ \ +} + +#define UserLeave() \ +{ \ + ASSERT(InterlockedDecrement(&_locked) == 0/*>= 0*/); \ + /*DPRINT("unlock, %s, %i (%i)\n",__FILE__,__LINE__, _locked);*/ \ + if (UserLock.Owner != KeGetCurrentThread()) { \ + DPRINT1("file %s, line %i\n",_file, _line); \ + ASSERT(FALSE); \ + } \ + _file = __FILE__; _line = __LINE__; \ + UUserLeave(); \ +} + + + +NTSTATUS FASTCALL InitUserImpl(VOID); +VOID FASTCALL UninitUser(VOID); +VOID FASTCALL UUserEnterShared(VOID); +VOID FASTCALL UUserEnterExclusive(VOID); +VOID FASTCALL UUserLeave(VOID); +BOOL FASTCALL UserIsEntered(); + + + +#endif /* _WIN32K_NTUSER_H */ + +/* EOF */