aboutsummaryrefslogtreecommitdiffstats
path: root/win/rfb_win32/WMHooks.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'win/rfb_win32/WMHooks.cxx')
-rw-r--r--win/rfb_win32/WMHooks.cxx40
1 files changed, 20 insertions, 20 deletions
diff --git a/win/rfb_win32/WMHooks.cxx b/win/rfb_win32/WMHooks.cxx
index 017972ba..cb2e0275 100644
--- a/win/rfb_win32/WMHooks.cxx
+++ b/win/rfb_win32/WMHooks.cxx
@@ -65,52 +65,52 @@ static WM_Hooks_EnableRealInputs_proto WM_Hooks_EnableRealInputs;
static void LoadHooks()
{
- if (hooksLibrary != NULL)
+ if (hooksLibrary != nullptr)
return;
hooksLibrary = LoadLibrary("wm_hooks.dll");
- if (hooksLibrary == NULL)
+ if (hooksLibrary == nullptr)
return;
WM_Hooks_WindowChanged = (WM_Hooks_WMVAL_proto)(void*)GetProcAddress(hooksLibrary, "WM_Hooks_WindowChanged");
- if (WM_Hooks_WindowChanged == NULL)
+ if (WM_Hooks_WindowChanged == nullptr)
goto error;
WM_Hooks_WindowBorderChanged = (WM_Hooks_WMVAL_proto)(void*)GetProcAddress(hooksLibrary, "WM_Hooks_WindowBorderChanged");
- if (WM_Hooks_WindowBorderChanged == NULL)
+ if (WM_Hooks_WindowBorderChanged == nullptr)
goto error;
WM_Hooks_WindowClientAreaChanged = (WM_Hooks_WMVAL_proto)(void*)GetProcAddress(hooksLibrary, "WM_Hooks_WindowClientAreaChanged");
- if (WM_Hooks_WindowClientAreaChanged == NULL)
+ if (WM_Hooks_WindowClientAreaChanged == nullptr)
goto error;
WM_Hooks_RectangleChanged = (WM_Hooks_WMVAL_proto)(void*)GetProcAddress(hooksLibrary, "WM_Hooks_RectangleChanged");
- if (WM_Hooks_RectangleChanged == NULL)
+ if (WM_Hooks_RectangleChanged == nullptr)
goto error;
#ifdef _DEBUG
WM_Hooks_Diagnostic = (WM_Hooks_WMVAL_proto)(void*)GetProcAddress(hooksLibrary, "WM_Hooks_Diagnostic");
- if (WM_Hooks_Diagnostic == NULL)
+ if (WM_Hooks_Diagnostic == nullptr)
goto error;
#endif
WM_Hooks_Install = (WM_Hooks_Install_proto)(void*)GetProcAddress(hooksLibrary, "WM_Hooks_Install");
- if (WM_Hooks_Install == NULL)
+ if (WM_Hooks_Install == nullptr)
goto error;
WM_Hooks_Remove = (WM_Hooks_Remove_proto)(void*)GetProcAddress(hooksLibrary, "WM_Hooks_Remove");
- if (WM_Hooks_Remove == NULL)
+ if (WM_Hooks_Remove == nullptr)
goto error;
#ifdef _DEBUG
WM_Hooks_SetDiagnosticRange = (WM_Hooks_SetDiagnosticRange_proto)(void*)GetProcAddress(hooksLibrary, "WM_Hooks_SetDiagnosticRange");
- if (WM_Hooks_SetDiagnosticRange == NULL)
+ if (WM_Hooks_SetDiagnosticRange == nullptr)
goto error;
#endif
WM_Hooks_EnableRealInputs = (WM_Hooks_EnableRealInputs_proto)(void*)GetProcAddress(hooksLibrary, "WM_Hooks_EnableRealInputs");
- if (WM_Hooks_EnableRealInputs == NULL)
+ if (WM_Hooks_EnableRealInputs == nullptr)
goto error;
return;
error:
FreeLibrary(hooksLibrary);
- hooksLibrary = NULL;
+ hooksLibrary = nullptr;
}
@@ -120,13 +120,13 @@ public:
void stop();
DWORD getThreadId() { return thread_id; }
protected:
- virtual void worker();
+ void worker() override;
protected:
bool active;
DWORD thread_id;
};
-static WMHooksThread* hook_mgr = 0;
+static WMHooksThread* hook_mgr = nullptr;
static std::list<WMHooks*> hooks;
static os::Mutex hook_mgr_lock;
@@ -134,7 +134,7 @@ static os::Mutex hook_mgr_lock;
static bool StartHookThread() {
if (hook_mgr)
return true;
- if (hooksLibrary == NULL)
+ if (hooksLibrary == nullptr)
return false;
vlog.debug("creating thread");
hook_mgr = new WMHooksThread();
@@ -146,7 +146,7 @@ static bool StartHookThread() {
vlog.error("failed to initialise hooks");
hook_mgr->stop();
delete hook_mgr;
- hook_mgr = 0;
+ hook_mgr = nullptr;
return false;
}
return true;
@@ -160,7 +160,7 @@ static void StopHookThread() {
vlog.debug("closing thread");
hook_mgr->stop();
delete hook_mgr;
- hook_mgr = 0;
+ hook_mgr = nullptr;
}
@@ -220,7 +220,7 @@ WMHooksThread::worker() {
thread_id = GetCurrentThreadId();
- while (active && GetMessage(&msg, NULL, 0, 0)) {
+ while (active && GetMessage(&msg, nullptr, 0, 0)) {
count++;
if (msg.message == WM_TIMER) {
@@ -306,7 +306,7 @@ WMHooksThread::stop() {
// -=- WMHooks class
-rfb::win32::WMHooks::WMHooks() : updateEvent(0) {
+rfb::win32::WMHooks::WMHooks() : updateEvent(nullptr) {
LoadHooks();
}
@@ -358,7 +358,7 @@ rfb::win32::WMBlockInput::~WMBlockInput() {
static bool blocking = false;
static bool blockRealInputs(bool block_) {
// NB: Requires blockMutex to be held!
- if (hooksLibrary == NULL)
+ if (hooksLibrary == nullptr)
return false;
if (block_) {
if (blocking)