diff options
author | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
---|---|---|
committer | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
commit | e611b132f9b8abe35b362e5870b74bce94a1e58e (patch) | |
tree | a5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/unimodem/modemui/dll.h | |
download | NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2 NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip |
Diffstat (limited to 'private/unimodem/modemui/dll.h')
-rw-r--r-- | private/unimodem/modemui/dll.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/private/unimodem/modemui/dll.h b/private/unimodem/modemui/dll.h new file mode 100644 index 000000000..132abe43e --- /dev/null +++ b/private/unimodem/modemui/dll.h @@ -0,0 +1,48 @@ +// +// dll.h +// + +#ifndef __DLL_H__ +#define __DLL_H__ + +extern HINSTANCE g_hinst; + +#ifdef WIN32 + +// Notes: +// 1. Never "return" from the critical section. +// 2. Never "SendMessage" or "Yield" from the critical section. +// 3. Never call USER API which may yield. +// 4. Always make the critical section as small as possible. +// 5. Critical sections in Win95 block across processes. In NT +// they are per-process only, so use mutexes instead. +// + +#define WIN32_CODE(x) x + +void PUBLIC Dll_EnterExclusive(void); +void PUBLIC Dll_LeaveExclusive(void); + +#ifdef WIN95 +#define USER_IS_ADMIN() TRUE +#else // !WIN95 +extern BOOL g_bAdminUser; +#define USER_IS_ADMIN() (g_bAdminUser) +#endif // !WIN95 + +#define ENTER_X() Dll_EnterExclusive(); +#define LEAVE_X() Dll_LeaveExclusive(); +#define ASSERT_X() ASSERT(g_bExclusive) + +#else // WIN32 + +#define WIN32_CODE(x) + +#define ENTER_X() +#define LEAVE_X() +#define ASSERT_X() + +#endif // WIN32 + +#endif //!__DLL_H__ + |