Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

45 lines
947 B

#ifndef _TESTCONTROL_HPP
#define _TESTCONTROL_HPP
namespace Globals
{
extern BOOL ForceBilinear;
extern BOOL NoICM;
};
// an instance of this class should be constructed in all Text+ calls
// to protect our global structures and cache
class GlobalTextLock
{
public:
GlobalTextLock()
{
::EnterCriticalSection(&Globals::TextCriticalSection);
}
~GlobalTextLock()
{
::LeaveCriticalSection(&Globals::TextCriticalSection);
}
}; // GlobalTextLock
class GlobalTextLockConditional
{
public:
GlobalTextLockConditional(bool bDoLock)
{
_bDoLock = bDoLock;
if (_bDoLock)
::EnterCriticalSection(&Globals::TextCriticalSection);
}
~GlobalTextLockConditional()
{
if (_bDoLock)
::LeaveCriticalSection(&Globals::TextCriticalSection);
}
private:
bool _bDoLock;
}; // GlobalTextLockConditional
#endif