mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 17:44:45 +00:00
forgot a file:-| sry
svn path=/trunk/; revision=17692
This commit is contained in:
parent
d1f19a8802
commit
65123629f5
1 changed files with 60 additions and 0 deletions
60
reactos/subsys/win32k/include/ntuser.h
Normal file
60
reactos/subsys/win32k/include/ntuser.h
Normal file
|
@ -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 */
|
Loading…
Reference in a new issue