diff options
Diffstat (limited to 'win/rfb_win32')
-rw-r--r-- | win/rfb_win32/CleanDesktop.cxx | 16 | ||||
-rw-r--r-- | win/rfb_win32/Clipboard.cxx | 22 | ||||
-rw-r--r-- | win/rfb_win32/CurrentUser.cxx | 10 | ||||
-rw-r--r-- | win/rfb_win32/DIBSectionBuffer.cxx | 6 | ||||
-rw-r--r-- | win/rfb_win32/DeviceContext.cxx | 2 | ||||
-rw-r--r-- | win/rfb_win32/DeviceFrameBuffer.cxx | 2 | ||||
-rw-r--r-- | win/rfb_win32/Dialog.cxx | 2 | ||||
-rw-r--r-- | win/rfb_win32/MonitorInfo.cxx | 6 | ||||
-rw-r--r-- | win/rfb_win32/MsgWindow.cxx | 10 | ||||
-rw-r--r-- | win/rfb_win32/RegConfig.cxx | 4 | ||||
-rw-r--r-- | win/rfb_win32/Registry.cxx | 4 | ||||
-rw-r--r-- | win/rfb_win32/SDisplay.cxx | 30 | ||||
-rw-r--r-- | win/rfb_win32/SInput.cxx | 14 | ||||
-rw-r--r-- | win/rfb_win32/Service.cxx | 78 | ||||
-rw-r--r-- | win/rfb_win32/SocketManager.cxx | 8 | ||||
-rw-r--r-- | win/rfb_win32/TrayIcon.h | 2 | ||||
-rw-r--r-- | win/rfb_win32/WMHooks.cxx | 20 |
17 files changed, 118 insertions, 118 deletions
diff --git a/win/rfb_win32/CleanDesktop.cxx b/win/rfb_win32/CleanDesktop.cxx index 02fdd374..710c10f5 100644 --- a/win/rfb_win32/CleanDesktop.cxx +++ b/win/rfb_win32/CleanDesktop.cxx @@ -61,7 +61,7 @@ struct ActiveDesktop { HRESULT hr = handle->GetDesktopItem(i, &item, 0); if (hr != S_OK) { - vlog.error("unable to GetDesktopItem %d: %ld", i, hr); + vlog.error("Unable to GetDesktopItem %d: %ld", i, hr); return false; } item.fChecked = enable_; @@ -105,7 +105,7 @@ struct ActiveDesktop { if (hr == S_OK) modifyComponents = (adOptions.fActiveDesktop==0) != (enable_==false); if (hr != S_OK) { - vlog.error("failed to get/set Active Desktop options: %ld", hr); + vlog.error("Failed to get/set Active Desktop options: %ld", hr); return false; } @@ -122,7 +122,7 @@ struct ActiveDesktop { int itemCount = 0; hr = handle->GetDesktopItemCount(&itemCount, 0); if (hr != S_OK) { - vlog.error("failed to get desktop item count: %ld", hr); + vlog.error("Failed to get desktop item count: %ld", hr); return false; } for (int i=0; i<itemCount; i++) { @@ -166,7 +166,7 @@ void CleanDesktop::disableWallpaper() { try { ImpersonateCurrentUser icu; - vlog.debug("disable desktop wallpaper/Active Desktop"); + vlog.debug("Disable desktop wallpaper/Active Desktop"); // -=- First attempt to remove the wallpaper using Active Desktop try { @@ -191,7 +191,7 @@ void CleanDesktop::enableWallpaper() { ImpersonateCurrentUser icu; if (restoreActiveDesktop) { - vlog.debug("restore Active Desktop"); + vlog.debug("Restore Active Desktop"); // -=- First attempt to re-enable Active Desktop try { @@ -204,7 +204,7 @@ void CleanDesktop::enableWallpaper() { } if (restoreWallpaper) { - vlog.debug("restore desktop wallpaper"); + vlog.debug("Restore desktop wallpaper"); // -=- Then restore the standard wallpaper if required SysParamsInfo(SPI_SETDESKWALLPAPER, 0, nullptr, SPIF_SENDCHANGE); @@ -221,7 +221,7 @@ void CleanDesktop::disableEffects() { try { ImpersonateCurrentUser icu; - vlog.debug("disable desktop effects"); + vlog.debug("Disable desktop effects"); SysParamsInfo(SPI_SETFONTSMOOTHING, FALSE, nullptr, SPIF_SENDCHANGE); if (SysParamsInfo(SPI_GETUIEFFECTS, 0, &uiEffects, 0) == ERROR_CALL_NOT_IMPLEMENTED) { @@ -253,7 +253,7 @@ void CleanDesktop::enableEffects() { if (restoreEffects) { ImpersonateCurrentUser icu; - vlog.debug("restore desktop effects"); + vlog.debug("Restore desktop effects"); RegKey desktopCfg; desktopCfg.openKey(HKEY_CURRENT_USER, "Control Panel\\Desktop"); diff --git a/win/rfb_win32/Clipboard.cxx b/win/rfb_win32/Clipboard.cxx index 8577df46..2a2be1d5 100644 --- a/win/rfb_win32/Clipboard.cxx +++ b/win/rfb_win32/Clipboard.cxx @@ -43,11 +43,11 @@ static LogWriter vlog("Clipboard"); Clipboard::Clipboard() : MsgWindow("Clipboard"), notifier(nullptr), next_window(nullptr) { next_window = SetClipboardViewer(getHandle()); - vlog.debug("registered clipboard handler"); + vlog.debug("Registered clipboard handler"); } Clipboard::~Clipboard() { - vlog.debug("removing %p from chain (next is %p)", getHandle(), next_window); + vlog.debug("Removing %p from chain (next is %p)", getHandle(), next_window); ChangeClipboardChain(getHandle(), next_window); } @@ -56,26 +56,26 @@ Clipboard::processMessage(UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { case WM_CHANGECBCHAIN: - vlog.debug("change clipboard chain (%I64x, %I64x)", + vlog.debug("Change clipboard chain (%I64x, %I64x)", (long long)wParam, (long long)lParam); if ((HWND) wParam == next_window) next_window = (HWND) lParam; else if (next_window != nullptr) SendMessage(next_window, msg, wParam, lParam); else - vlog.error("bad clipboard chain change!"); + vlog.error("Bad clipboard chain change!"); break; case WM_DRAWCLIPBOARD: { HWND owner = GetClipboardOwner(); if (owner == getHandle()) { - vlog.debug("local clipboard changed by me"); + vlog.debug("Local clipboard changed by me"); } else { - vlog.debug("local clipboard changed by %p", owner); + vlog.debug("Local clipboard changed by %p", owner); if (notifier == nullptr) - vlog.debug("no clipboard notifier registered"); + vlog.debug("No clipboard notifier registered"); else notifier->notifyClipboardChanged(IsClipboardFormatAvailable(CF_UNICODETEXT)); } @@ -151,18 +151,18 @@ Clipboard::setClipText(const char* text) { throw rdr::win32_error("unable to set Win32 clipboard", GetLastError()); clip_handle = nullptr; - vlog.debug("set clipboard"); + vlog.debug("Set clipboard"); } catch (std::exception& e) { vlog.debug("%s", e.what()); } // - Close the clipboard if (!CloseClipboard()) - vlog.debug("unable to close Win32 clipboard: %lu", GetLastError()); + vlog.debug("Unable to close Win32 clipboard: %lu", GetLastError()); else - vlog.debug("closed clipboard"); + vlog.debug("Closed clipboard"); if (clip_handle) { - vlog.debug("freeing clipboard handle"); + vlog.debug("Freeing clipboard handle"); GlobalFree(clip_handle); } } diff --git a/win/rfb_win32/CurrentUser.cxx b/win/rfb_win32/CurrentUser.cxx index be363682..a9404c94 100644 --- a/win/rfb_win32/CurrentUser.cxx +++ b/win/rfb_win32/CurrentUser.cxx @@ -41,7 +41,7 @@ BOOL CALLBACK enumWindows(HWND hwnd, LPARAM lParam) { char className[16]; if (GetClassName(hwnd, className, sizeof(className)) && (strcmp(className, shellIconClass) == 0)) { - vlog.debug("located tray icon window (%s)", className); + vlog.debug("Located tray icon window (%s)", className); DWORD processId = 0; GetWindowThreadProcessId(hwnd, &processId); if (!processId) @@ -51,7 +51,7 @@ BOOL CALLBACK enumWindows(HWND hwnd, LPARAM lParam) { return TRUE; if (!OpenProcessToken(process, MAXIMUM_ALLOWED, (HANDLE*)lParam)) return TRUE; - vlog.debug("obtained user token"); + vlog.debug("Obtained user token"); return FALSE; } return TRUE; @@ -59,14 +59,14 @@ BOOL CALLBACK enumWindows(HWND hwnd, LPARAM lParam) { BOOL CALLBACK enumDesktops(LPTSTR lpszDesktop, LPARAM lParam) { HDESK desktop = OpenDesktop(lpszDesktop, 0, FALSE, DESKTOP_ENUMERATE); - vlog.debug("opening \"%s\"", lpszDesktop); + vlog.debug("Opening \"%s\"", lpszDesktop); if (!desktop) { - vlog.info("desktop \"%s\" inaccessible", lpszDesktop); + vlog.info("Desktop \"%s\" inaccessible", lpszDesktop); return TRUE; } BOOL result = EnumDesktopWindows(desktop, enumWindows, lParam); if (!CloseDesktop(desktop)) - vlog.info("unable to close desktop: %ld", GetLastError()); + vlog.info("Unable to close desktop: %ld", GetLastError()); return result; } diff --git a/win/rfb_win32/DIBSectionBuffer.cxx b/win/rfb_win32/DIBSectionBuffer.cxx index 440fe6b1..e2cb15c1 100644 --- a/win/rfb_win32/DIBSectionBuffer.cxx +++ b/win/rfb_win32/DIBSectionBuffer.cxx @@ -92,11 +92,11 @@ void DIBSectionBuffer::initBuffer(const PixelFormat& pf, int w, int h) { vlog.debug("recreateBuffer()"); } else { - vlog.debug("one of area or format not set"); + vlog.debug("One of area or format not set"); } if (new_bitmap && bitmap) { - vlog.debug("preserving bitmap contents"); + vlog.debug("Preserving bitmap contents"); // Copy the contents across if (device) { @@ -139,7 +139,7 @@ void DIBSectionBuffer::initBuffer(const PixelFormat& pf, int w, int h) { if (bytesPerRow % 4) { bytesPerRow += 4 - (bytesPerRow % 4); new_stride = (bytesPerRow * 8) / format.bpp; - vlog.info("adjusting DIB stride: %d to %d", w, new_stride); + vlog.info("Adjusting DIB stride: %d to %d", w, new_stride); } setBuffer(w, h, new_data, new_stride); diff --git a/win/rfb_win32/DeviceContext.cxx b/win/rfb_win32/DeviceContext.cxx index 1c64e1f5..353ee716 100644 --- a/win/rfb_win32/DeviceContext.cxx +++ b/win/rfb_win32/DeviceContext.cxx @@ -86,7 +86,7 @@ PixelFormat DeviceContext::getPF(HDC dc) { bMask = 0x0000ff; break; default: - vlog.error("bits per pixel %u not supported", bi.bmiHeader.biBitCount); + vlog.error("Bits per pixel %u not supported", bi.bmiHeader.biBitCount); throw std::invalid_argument("unknown bits per pixel specified"); }; break; diff --git a/win/rfb_win32/DeviceFrameBuffer.cxx b/win/rfb_win32/DeviceFrameBuffer.cxx index 1c3e9575..6e38d6a8 100644 --- a/win/rfb_win32/DeviceFrameBuffer.cxx +++ b/win/rfb_win32/DeviceFrameBuffer.cxx @@ -256,7 +256,7 @@ void DeviceFrameBuffer::setCursor(HCURSOR hCursor, VNCServer* server) } if (doOutline) { - vlog.debug("drawing cursor outline!"); + vlog.debug("Drawing cursor outline!"); // The buffer needs to be slightly larger to make sure there // is room for the outline pixels diff --git a/win/rfb_win32/Dialog.cxx b/win/rfb_win32/Dialog.cxx index e8af0846..f147df45 100644 --- a/win/rfb_win32/Dialog.cxx +++ b/win/rfb_win32/Dialog.cxx @@ -306,7 +306,7 @@ bool PropSheet::showPropSheet(HWND owner_, bool showApply, bool showCtxtHelp, bo } char filename[256]; sprintf(filename, "%s\\%s.bmp", tmpdir, title); - vlog.debug("writing to %s", filename); + vlog.debug("Writing to %s", filename); saveBMP(filename, &fb); i++; } diff --git a/win/rfb_win32/MonitorInfo.cxx b/win/rfb_win32/MonitorInfo.cxx index 84a8d501..9f7c2daf 100644 --- a/win/rfb_win32/MonitorInfo.cxx +++ b/win/rfb_win32/MonitorInfo.cxx @@ -45,9 +45,9 @@ static void fillMonitorInfo(HMONITOR monitor, MONITORINFOEXA* mi) { mi->cbSize = sizeof(MONITORINFOEXA); if (!GetMonitorInfo(monitor, mi)) throw rdr::win32_error("failed to GetMonitorInfo", GetLastError()); - vlog.debug("monitor is %ld,%ld-%ld,%ld", mi->rcMonitor.left, mi->rcMonitor.top, mi->rcMonitor.right, mi->rcMonitor.bottom); - vlog.debug("work area is %ld,%ld-%ld,%ld", mi->rcWork.left, mi->rcWork.top, mi->rcWork.right, mi->rcWork.bottom); - vlog.debug("device is \"%s\"", mi->szDevice); + vlog.debug("Monitor is %ld,%ld-%ld,%ld", mi->rcMonitor.left, mi->rcMonitor.top, mi->rcMonitor.right, mi->rcMonitor.bottom); + vlog.debug("Work area is %ld,%ld-%ld,%ld", mi->rcWork.left, mi->rcWork.top, mi->rcWork.right, mi->rcWork.bottom); + vlog.debug("Device is \"%s\"", mi->szDevice); } diff --git a/win/rfb_win32/MsgWindow.cxx b/win/rfb_win32/MsgWindow.cxx index 4908126e..bd35ca0f 100644 --- a/win/rfb_win32/MsgWindow.cxx +++ b/win/rfb_win32/MsgWindow.cxx @@ -55,14 +55,14 @@ LRESULT CALLBACK MsgWindowProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam) SetWindowLongPtr(wnd, GWLP_USERDATA, 0); MsgWindow* _this = (MsgWindow*) GetWindowLongPtr(wnd, GWLP_USERDATA); if (!_this) { - vlog.info("null _this in %p, message %x", wnd, msg); + vlog.info("Null _this in %p, message %x", wnd, msg); return SafeDefWindowProc(wnd, msg, wParam, lParam); } try { result = _this->processMessage(msg, wParam, lParam); } catch (std::exception& e) { - vlog.error("untrapped: %s", e.what()); + vlog.error("Untrapped: %s", e.what()); } return result; @@ -99,20 +99,20 @@ static MsgWindowClass baseClass; // MsgWindow::MsgWindow(const char* name_) : name(name_), handle(nullptr) { - vlog.debug("creating window \"%s\"", name.c_str()); + vlog.debug("Creating window \"%s\"", name.c_str()); handle = CreateWindow((const char*)(intptr_t)baseClass.classAtom, name.c_str(), WS_OVERLAPPED, 0, 0, 10, 10, nullptr, nullptr, baseClass.instance, this); if (!handle) { throw rdr::win32_error("unable to create WMNotifier window instance", GetLastError()); } - vlog.debug("created window \"%s\" (%p)", name.c_str(), handle); + vlog.debug("Created window \"%s\" (%p)", name.c_str(), handle); } MsgWindow::~MsgWindow() { if (handle) DestroyWindow(handle); - vlog.debug("destroyed window \"%s\" (%p)", name.c_str(), handle); + vlog.debug("Destroyed window \"%s\" (%p)", name.c_str(), handle); } LRESULT diff --git a/win/rfb_win32/RegConfig.cxx b/win/rfb_win32/RegConfig.cxx index 211570ca..d9835201 100644 --- a/win/rfb_win32/RegConfig.cxx +++ b/win/rfb_win32/RegConfig.cxx @@ -67,7 +67,7 @@ void RegConfig::loadRegistryConfig(RegKey& key) { if (!name) break; std::string value = key.getRepresentation(name); if (!Configuration::setParam(name, value.c_str())) - vlog.info("unable to process %s", name); + vlog.info("Unable to process %s", name); } } catch (rdr::win32_error& e) { if (e.err != ERROR_INVALID_HANDLE) @@ -76,7 +76,7 @@ void RegConfig::loadRegistryConfig(RegKey& key) { } void RegConfig::processEvent(HANDLE /*event*/) { - vlog.info("registry changed"); + vlog.info("Registry changed"); // Reinstate the registry change notifications ResetEvent(event); diff --git a/win/rfb_win32/Registry.cxx b/win/rfb_win32/Registry.cxx index 47756950..27e55a2e 100644 --- a/win/rfb_win32/Registry.cxx +++ b/win/rfb_win32/Registry.cxx @@ -55,7 +55,7 @@ RegKey::RegKey(const HKEY k) : key(nullptr), freeKey(false), valueName(nullptr), LONG result = RegOpenKeyEx(k, nullptr, 0, KEY_ALL_ACCESS, &key); if (result != ERROR_SUCCESS) throw rdr::win32_error("RegOpenKeyEx(HKEY)", result); - vlog.debug("duplicated %p to %p", k, key); + vlog.debug("Duplicated %p to %p", k, key); freeKey = true; } @@ -63,7 +63,7 @@ RegKey::RegKey(const RegKey& k) : key(nullptr), freeKey(false), valueName(nullpt LONG result = RegOpenKeyEx(k.key, nullptr, 0, KEY_ALL_ACCESS, &key); if (result != ERROR_SUCCESS) throw rdr::win32_error("RegOpenKeyEx(RegKey&)", result); - vlog.debug("duplicated %p to %p", k.key, key); + vlog.debug("Duplicated %p to %p", k.key, key); freeKey = true; } diff --git a/win/rfb_win32/SDisplay.cxx b/win/rfb_win32/SDisplay.cxx index 33f2d6c9..ee339649 100644 --- a/win/rfb_win32/SDisplay.cxx +++ b/win/rfb_win32/SDisplay.cxx @@ -102,7 +102,7 @@ void SDisplay::init(VNCServer* vs) void SDisplay::start() { - vlog.debug("starting"); + vlog.debug("Starting"); // Try to make session zero the console session if (!inConsoleSession()) @@ -111,26 +111,26 @@ void SDisplay::start() // Start the SDisplay core startCore(); - vlog.debug("started"); + vlog.debug("Started"); if (statusLocation) *statusLocation = true; } void SDisplay::stop() { - vlog.debug("stopping"); + vlog.debug("Stopping"); // If we successfully start()ed then perform the DisconnectAction if (core) { CurrentUserToken cut; if (stricmp(disconnectAction, "Logoff") == 0) { if (!cut.h) - vlog.info("ignoring DisconnectAction=Logoff - no current user"); + vlog.info("Ignoring DisconnectAction=Logoff - no current user"); else ExitWindowsEx(EWX_LOGOFF, 0); } else if (stricmp(disconnectAction, "Lock") == 0) { if (!cut.h) { - vlog.info("ignoring DisconnectAction=Lock - no current user"); + vlog.info("Ignoring DisconnectAction=Lock - no current user"); } else { LockWorkStation(); } @@ -141,7 +141,7 @@ void SDisplay::stop() server->setPixelBuffer(nullptr); stopCore(); - vlog.debug("stopped"); + vlog.debug("Stopped"); if (statusLocation) *statusLocation = false; } @@ -278,14 +278,14 @@ bool SDisplay::isRestartRequired() { void SDisplay::restartCore() { - vlog.info("restarting"); + vlog.info("Restarting"); // Stop the existing Core related resources stopCore(); try { // Start a new Core if possible startCore(); - vlog.info("restarted"); + vlog.info("Restarted"); } catch (std::exception& e) { // If startCore() fails then we MUST disconnect all clients, // to cause the server to stop() the desktop. @@ -351,7 +351,7 @@ bool SDisplay::checkLedState() { void SDisplay::notifyClipboardChanged(bool available) { - vlog.debug("clipboard text changed"); + vlog.debug("Clipboard text changed"); if (server) server->announceClipboard(available); } @@ -361,15 +361,15 @@ void SDisplay::notifyDisplayEvent(WMMonitor::Notifier::DisplayEventType evt) { switch (evt) { case WMMonitor::Notifier::DisplaySizeChanged: - vlog.debug("desktop size changed"); + vlog.debug("Desktop size changed"); recreatePixelBuffer(); break; case WMMonitor::Notifier::DisplayPixelFormatChanged: - vlog.debug("desktop format changed"); + vlog.debug("Desktop format changed"); recreatePixelBuffer(); break; default: - vlog.error("unknown display event received"); + vlog.error("Unknown display event received"); } } @@ -381,7 +381,7 @@ SDisplay::processEvent(HANDLE event) { // - If the SDisplay isn't even started then quit now if (!core) { - vlog.error("not start()ed"); + vlog.error("Not start()ed"); return; } @@ -479,14 +479,14 @@ SDisplay::recreatePixelBuffer(bool force) { flushChangeTracker(); // Delete the old pixelbuffer and device context - vlog.debug("deleting old pixel buffer & device"); + vlog.debug("Deleting old pixel buffer & device"); if (pb) delete pb; if (device) delete device; // Create a DeviceFrameBuffer attached to the new device - vlog.debug("creating pixel buffer"); + vlog.debug("Creating pixel buffer"); DeviceFrameBuffer* new_buffer = new DeviceFrameBuffer(*new_device); // Replace the old PixelBuffer diff --git a/win/rfb_win32/SInput.cxx b/win/rfb_win32/SInput.cxx index af5aeb06..13ac9f26 100644 --- a/win/rfb_win32/SInput.cxx +++ b/win/rfb_win32/SInput.cxx @@ -91,7 +91,7 @@ win32::SPointer::pointerEvent(const Point& pos, uint16_t buttonmask) if (buttonmask & (1<<i)) { flags |= buttonDownMapping[i]; if (buttonDataMapping[i]) { - if (data) vlog.info("warning - two buttons set mouse_event data field"); + if (data) vlog.info("Warning: Two buttons set mouse_event data field"); data = buttonDataMapping[i]; } } else { @@ -412,7 +412,7 @@ void win32::SKeyboard::keyEvent(uint32_t keysym, uint32_t keycode, bool down) SHORT dc = VkKeyScan(keysym); if (dc != -1) { if (down) { - vlog.info("latin-1 dead key: 0x%x vkCode 0x%x mod 0x%x " + vlog.info("Latin-1 dead key: 0x%x vkCode 0x%x mod 0x%x " "followed by space", keysym, LOBYTE(dc), HIBYTE(dc)); doKeyEventWithModifiers(LOBYTE(dc), HIBYTE(dc), true); doKeyEventWithModifiers(LOBYTE(dc), HIBYTE(dc), false); @@ -438,7 +438,7 @@ void win32::SKeyboard::keyEvent(uint32_t keysym, uint32_t keycode, bool down) SHORT dc = VkKeyScan(latin1ToDeadChars[j].deadChar); SHORT bc = VkKeyScan(latin1ToDeadChars[j].baseChar); if (dc != -1 && bc != -1) { - vlog.info("latin-1 key: 0x%x dead key vkCode 0x%x mod 0x%x " + vlog.info("Latin-1 key: 0x%x dead key vkCode 0x%x mod 0x%x " "followed by vkCode 0x%x mod 0x%x", keysym, LOBYTE(dc), HIBYTE(dc), LOBYTE(bc), HIBYTE(bc)); @@ -454,14 +454,14 @@ void win32::SKeyboard::keyEvent(uint32_t keysym, uint32_t keycode, bool down) break; } } - vlog.info("ignoring unrecognised Latin-1 keysym 0x%x",keysym); + vlog.info("Ignoring unrecognised Latin-1 keysym 0x%x",keysym); } return; } BYTE vkCode = LOBYTE(s); BYTE modifierState = HIBYTE(s); - vlog.debug("latin-1 key: 0x%x vkCode 0x%x mod 0x%x down %d", + vlog.debug("Latin-1 key: 0x%x vkCode 0x%x mod 0x%x down %d", keysym, vkCode, modifierState, down); doKeyEventWithModifiers(vkCode, modifierState, down); @@ -470,7 +470,7 @@ void win32::SKeyboard::keyEvent(uint32_t keysym, uint32_t keycode, bool down) // see if it's a recognised keyboard key, otherwise ignore it if (vkMap.find(keysym) == vkMap.end()) { - vlog.info("ignoring unknown keysym 0x%x",keysym); + vlog.info("Ignoring unknown keysym 0x%x",keysym); return; } BYTE vkCode = vkMap[keysym]; @@ -478,7 +478,7 @@ void win32::SKeyboard::keyEvent(uint32_t keysym, uint32_t keycode, bool down) if (extendedMap[keysym]) flags |= KEYEVENTF_EXTENDEDKEY; if (!down) flags |= KEYEVENTF_KEYUP; - vlog.debug("keyboard key: keysym 0x%x vkCode 0x%x ext %d down %d", + vlog.debug("Keyboard key: keysym 0x%x vkCode 0x%x ext %d down %d", keysym, vkCode, extendedMap[keysym], down); if (down && (vkCode == VK_DELETE) && ((GetAsyncKeyState(VK_CONTROL) & 0x8000) != 0) && diff --git a/win/rfb_win32/Service.cxx b/win/rfb_win32/Service.cxx index 907e3214..bc9875e5 100644 --- a/win/rfb_win32/Service.cxx +++ b/win/rfb_win32/Service.cxx @@ -48,43 +48,43 @@ bool runAsService = false; VOID WINAPI serviceHandler(DWORD control) { switch (control) { case SERVICE_CONTROL_INTERROGATE: - vlog.info("cmd: report status"); + vlog.info("CMD: Report status"); service->setStatus(); return; case SERVICE_CONTROL_PARAMCHANGE: - vlog.info("cmd: param change"); + vlog.info("CMD: Param change"); service->readParams(); return; case SERVICE_CONTROL_SHUTDOWN: - vlog.info("cmd: OS shutdown"); + vlog.info("CMD: OS shutdown"); service->osShuttingDown(); return; case SERVICE_CONTROL_STOP: - vlog.info("cmd: stop"); + vlog.info("CMD: Stop"); service->setStatus(SERVICE_STOP_PENDING); service->stop(); return; }; - vlog.debug("cmd: unknown %lu", control); + vlog.debug("CMD: Unknown %lu", control); } // -=- Service main procedure VOID WINAPI serviceProc(DWORD dwArgc, LPTSTR* lpszArgv) { - vlog.debug("entering %s serviceProc", service->getName()); - vlog.info("registering handler..."); + vlog.debug("Entering %s serviceProc", service->getName()); + vlog.info("Registering handler..."); service->status_handle = RegisterServiceCtrlHandler(service->getName(), serviceHandler); if (!service->status_handle) { DWORD err = GetLastError(); - vlog.error("failed to register handler: %lu", err); + vlog.error("Failed to register handler: %lu", err); ExitProcess(err); } - vlog.debug("registered handler (%p)", service->status_handle); + vlog.debug("Registered handler (%p)", service->status_handle); service->setStatus(SERVICE_START_PENDING); - vlog.debug("entering %s serviceMain", service->getName()); + vlog.debug("Entering %s serviceMain", service->getName()); service->status.dwWin32ExitCode = service->serviceMain(dwArgc, lpszArgv); - vlog.debug("leaving %s serviceMain", service->getName()); + vlog.debug("Leaving %s serviceMain", service->getName()); service->setStatus(SERVICE_STOPPED); } @@ -110,12 +110,12 @@ Service::start() { entry[0].lpServiceProc = serviceProc; entry[1].lpServiceName = nullptr; entry[1].lpServiceProc = nullptr; - vlog.debug("entering dispatcher"); + vlog.debug("Entering dispatcher"); if (!SetProcessShutdownParameters(0x100, 0)) - vlog.error("unable to set shutdown parameters: %lu", GetLastError()); + vlog.error("Unable to set shutdown parameters: %lu", GetLastError()); service = this; if (!StartServiceCtrlDispatcher(entry)) - throw win32_error("unable to start service", GetLastError()); + throw win32_error("Unable to start service", GetLastError()); } void @@ -126,7 +126,7 @@ Service::setStatus() { void Service::setStatus(DWORD state) { if (status_handle == nullptr) { - vlog.debug("warning - cannot setStatus"); + vlog.debug("Warning: Cannot setStatus"); return; } status.dwCurrentState = state; @@ -134,9 +134,9 @@ Service::setStatus(DWORD state) { if (!SetServiceStatus(status_handle, &status)) { status.dwCurrentState = SERVICE_STOPPED; status.dwWin32ExitCode = GetLastError(); - vlog.error("unable to set service status:%lu", status.dwWin32ExitCode); + vlog.error("Unable to set service status:%lu", status.dwWin32ExitCode); } - vlog.debug("set status to %lu(%lu)", state, status.dwCheckPoint); + vlog.debug("Set status to %lu(%lu)", state, status.dwCheckPoint); } Service::~Service() { @@ -162,7 +162,7 @@ switchToDesktop(HDESK desktop) { return false; } if (!CloseDesktop(old_desktop)) - vlog.debug("unable to close old desktop:%lu", GetLastError()); + vlog.debug("Unable to close old desktop:%lu", GetLastError()); return true; } @@ -176,7 +176,7 @@ inputDesktopSelected() { DESKTOP_WRITEOBJECTS | DESKTOP_READOBJECTS | DESKTOP_SWITCHDESKTOP | GENERIC_WRITE); if (!input) { - vlog.debug("unable to OpenInputDesktop(1):%lu", GetLastError()); + vlog.debug("Unable to OpenInputDesktop(1):%lu", GetLastError()); return false; } @@ -185,17 +185,17 @@ inputDesktopSelected() { char inputname[256]; if (!GetUserObjectInformation(current, UOI_NAME, currentname, 256, &size)) { - vlog.debug("unable to GetUserObjectInformation(1):%lu", GetLastError()); + vlog.debug("Unable to GetUserObjectInformation(1):%lu", GetLastError()); CloseDesktop(input); return false; } if (!GetUserObjectInformation(input, UOI_NAME, inputname, 256, &size)) { - vlog.debug("unable to GetUserObjectInformation(2):%lu", GetLastError()); + vlog.debug("Unable to GetUserObjectInformation(2):%lu", GetLastError()); CloseDesktop(input); return false; } if (!CloseDesktop(input)) - vlog.debug("unable to close input desktop:%lu", GetLastError()); + vlog.debug("Unable to close input desktop:%lu", GetLastError()); // *** vlog.debug("current=%s, input=%s", currentname, inputname); bool result = strcmp(currentname, inputname) == 0; @@ -212,7 +212,7 @@ selectInputDesktop() { DESKTOP_WRITEOBJECTS | DESKTOP_READOBJECTS | DESKTOP_SWITCHDESKTOP | GENERIC_WRITE); if (!desktop) { - vlog.debug("unable to OpenInputDesktop(2):%lu", GetLastError()); + vlog.debug("Unable to OpenInputDesktop(2):%lu", GetLastError()); return false; } @@ -226,11 +226,11 @@ selectInputDesktop() { DWORD size = 256; char currentname[256]; if (GetUserObjectInformation(desktop, UOI_NAME, currentname, 256, &size)) { - vlog.debug("switched to %s", currentname); + vlog.debug("Switched to %s", currentname); } // *** - vlog.debug("switched to input desktop"); + vlog.debug("Switched to input desktop"); return true; } @@ -335,7 +335,7 @@ bool rfb::win32::registerService(const char* name, // - Open the SCM ServiceHandle scm = OpenSCManager(nullptr, nullptr, SC_MANAGER_CREATE_SERVICE); if (!scm) - throw rdr::win32_error("unable to open Service Control Manager", GetLastError()); + throw rdr::win32_error("Unable to open Service Control Manager", GetLastError()); // - Add the service ServiceHandle handle = CreateService(scm, @@ -344,7 +344,7 @@ bool rfb::win32::registerService(const char* name, SERVICE_AUTO_START, SERVICE_ERROR_IGNORE, cmdline.c_str(), nullptr, nullptr, nullptr, nullptr, nullptr); if (!handle) - throw rdr::win32_error("unable to create service", GetLastError()); + throw rdr::win32_error("Unable to create service", GetLastError()); // - Set a description SERVICE_DESCRIPTION sdesc = {(LPTSTR)desc}; @@ -380,14 +380,14 @@ bool rfb::win32::unregisterService(const char* name) { // - Open the SCM ServiceHandle scm = OpenSCManager(nullptr, nullptr, SC_MANAGER_CREATE_SERVICE); if (!scm) - throw rdr::win32_error("unable to open Service Control Manager", GetLastError()); + throw rdr::win32_error("Unable to open Service Control Manager", GetLastError()); // - Create the service ServiceHandle handle = OpenService(scm, name, SC_MANAGER_ALL_ACCESS); if (!handle) - throw rdr::win32_error("unable to locate the service", GetLastError()); + throw rdr::win32_error("Unable to locate the service", GetLastError()); if (!DeleteService(handle)) - throw rdr::win32_error("unable to remove the service", GetLastError()); + throw rdr::win32_error("Unable to remove the service", GetLastError()); // - Register the event log source RegKey hk; @@ -407,16 +407,16 @@ bool rfb::win32::startService(const char* name) { // - Open the SCM ServiceHandle scm = OpenSCManager(nullptr, nullptr, SC_MANAGER_CONNECT); if (!scm) - throw rdr::win32_error("unable to open Service Control Manager", GetLastError()); + throw rdr::win32_error("Unable to open Service Control Manager", GetLastError()); // - Locate the service ServiceHandle handle = OpenService(scm, name, SERVICE_START); if (!handle) - throw rdr::win32_error("unable to open the service", GetLastError()); + throw rdr::win32_error("Unable to open the service", GetLastError()); // - Start the service if (!StartService(handle, 0, nullptr)) - throw rdr::win32_error("unable to start the service", GetLastError()); + throw rdr::win32_error("Unable to start the service", GetLastError()); Sleep(500); @@ -427,17 +427,17 @@ bool rfb::win32::stopService(const char* name) { // - Open the SCM ServiceHandle scm = OpenSCManager(nullptr, nullptr, SC_MANAGER_CONNECT); if (!scm) - throw rdr::win32_error("unable to open Service Control Manager", GetLastError()); + throw rdr::win32_error("Unable to open Service Control Manager", GetLastError()); // - Locate the service ServiceHandle handle = OpenService(scm, name, SERVICE_STOP); if (!handle) - throw rdr::win32_error("unable to open the service", GetLastError()); + throw rdr::win32_error("Unable to open the service", GetLastError()); // - Start the service SERVICE_STATUS status; if (!ControlService(handle, SERVICE_CONTROL_STOP, &status)) - throw rdr::win32_error("unable to stop the service", GetLastError()); + throw rdr::win32_error("Unable to stop the service", GetLastError()); Sleep(500); @@ -448,17 +448,17 @@ DWORD rfb::win32::getServiceState(const char* name) { // - Open the SCM ServiceHandle scm = OpenSCManager(nullptr, nullptr, SC_MANAGER_CONNECT); if (!scm) - throw rdr::win32_error("unable to open Service Control Manager", GetLastError()); + throw rdr::win32_error("Unable to open Service Control Manager", GetLastError()); // - Locate the service ServiceHandle handle = OpenService(scm, name, SERVICE_INTERROGATE); if (!handle) - throw rdr::win32_error("unable to open the service", GetLastError()); + throw rdr::win32_error("Unable to open the service", GetLastError()); // - Get the service status SERVICE_STATUS status; if (!ControlService(handle, SERVICE_CONTROL_INTERROGATE, (SERVICE_STATUS*)&status)) - throw rdr::win32_error("unable to query the service", GetLastError()); + throw rdr::win32_error("Unable to query the service", GetLastError()); return status.dwCurrentState; } diff --git a/win/rfb_win32/SocketManager.cxx b/win/rfb_win32/SocketManager.cxx index b42c66cb..7f6d1773 100644 --- a/win/rfb_win32/SocketManager.cxx +++ b/win/rfb_win32/SocketManager.cxx @@ -203,7 +203,7 @@ void SocketManager::processEvent(HANDLE event) { ListenInfo li = listeners[event]; // Accept an incoming connection - vlog.debug("accepting incoming connection"); + vlog.debug("Accepting incoming connection"); // What kind of event is this? WSANETWORKEVENTS network_events; @@ -217,13 +217,13 @@ void SocketManager::processEvent(HANDLE event) { if (new_sock) addSocket(new_sock, li.server, false); } else if (network_events.lNetworkEvents & FD_CLOSE) { - vlog.info("deleting listening socket"); + vlog.info("Deleting listening socket"); remListener(li.sock); } else if (network_events.lNetworkEvents & FD_ADDRESS_LIST_CHANGE) { li.notifier->processAddressChange(); requestAddressChangeEvents(li.sock); } else { - vlog.error("unknown listener event: %lx", network_events.lNetworkEvents); + vlog.error("Unknown listener event: %lx", network_events.lNetworkEvents); } } else if (connections.count(event)) { ConnInfo ci = connections[event]; @@ -236,7 +236,7 @@ void SocketManager::processEvent(HANDLE event) { // Fetch why this event notification triggered if (WSAEnumNetworkEvents(ci.sock->getFd(), event, &network_events) == SOCKET_ERROR) - throw rdr::socket_error("unable to get WSAEnumNetworkEvents:%u", WSAGetLastError()); + throw rdr::socket_error("Unable to get WSAEnumNetworkEvents:%u", WSAGetLastError()); // Cancel event notification for this socket if (WSAEventSelect(ci.sock->getFd(), event, 0) == SOCKET_ERROR) diff --git a/win/rfb_win32/TrayIcon.h b/win/rfb_win32/TrayIcon.h index 61d2c9ac..b4e75ea5 100644 --- a/win/rfb_win32/TrayIcon.h +++ b/win/rfb_win32/TrayIcon.h @@ -18,7 +18,7 @@ // -=- CView.h -// An instance of the CView class is created for each VNC Viewer connection. +// An instance of the CView class is created for each VNC viewer connection. #ifndef __RFB_WIN32_TRAY_ICON_H__ #define __RFB_WIN32_TRAY_ICON_H__ diff --git a/win/rfb_win32/WMHooks.cxx b/win/rfb_win32/WMHooks.cxx index cb2e0275..e1840eef 100644 --- a/win/rfb_win32/WMHooks.cxx +++ b/win/rfb_win32/WMHooks.cxx @@ -136,14 +136,14 @@ static bool StartHookThread() { return true; if (hooksLibrary == nullptr) return false; - vlog.debug("creating thread"); + vlog.debug("Creating thread"); hook_mgr = new WMHooksThread(); hook_mgr->start(); while (hook_mgr->getThreadId() == (DWORD)-1) Sleep(0); - vlog.debug("installing hooks"); + vlog.debug("Installing hooks"); if (!WM_Hooks_Install(hook_mgr->getThreadId(), 0)) { - vlog.error("failed to initialise hooks"); + vlog.error("Failed to initialise hooks"); hook_mgr->stop(); delete hook_mgr; hook_mgr = nullptr; @@ -157,7 +157,7 @@ static void StopHookThread() { return; if (!hooks.empty()) return; - vlog.debug("closing thread"); + vlog.debug("Closing thread"); hook_mgr->stop(); delete hook_mgr; hook_mgr = nullptr; @@ -165,7 +165,7 @@ static void StopHookThread() { static bool AddHook(WMHooks* hook) { - vlog.debug("adding hook"); + vlog.debug("Adding hook"); os::AutoMutex a(&hook_mgr_lock); if (!StartHookThread()) return false; @@ -175,7 +175,7 @@ static bool AddHook(WMHooks* hook) { static bool RemHook(WMHooks* hook) { { - vlog.debug("removing hook"); + vlog.debug("Removing hook"); os::AutoMutex a(&hook_mgr_lock); hooks.remove(hook); } @@ -216,7 +216,7 @@ WMHooksThread::worker() { Region updates[2]; int activeRgn = 0; - vlog.debug("starting hook thread"); + vlog.debug("Starting hook thread"); thread_id = GetCurrentThreadId(); @@ -291,16 +291,16 @@ WMHooksThread::worker() { } } - vlog.debug("stopping hook thread - processed %d events", count); + vlog.debug("Stopping hook thread - processed %d events", count); WM_Hooks_Remove(getThreadId()); } void WMHooksThread::stop() { - vlog.debug("stopping WMHooks thread"); + vlog.debug("Stopping WMHooks thread"); active = false; PostThreadMessage(thread_id, WM_QUIT, 0, 0); - vlog.debug("waiting for WMHooks thread"); + vlog.debug("Waiting for WMHooks thread"); wait(); } |