| Index: remoting/host/host_service_win.cc
|
| diff --git a/remoting/host/host_service_win.cc b/remoting/host/host_service_win.cc
|
| index c96c6e07081d254210a2e04afa50190232367563..77d8cc7bba4d30f5a83bf3cc2edccda1c104e4da 100644
|
| --- a/remoting/host/host_service_win.cc
|
| +++ b/remoting/host/host_service_win.cc
|
| @@ -19,7 +19,6 @@
|
| #include "base/logging.h"
|
| #include "base/message_loop.h"
|
| #include "base/path_service.h"
|
| -#include "base/process_util.h"
|
| #include "base/stringize_macros.h"
|
| #include "base/stringprintf.h"
|
| #include "base/threading/thread.h"
|
| @@ -255,26 +254,24 @@ int HostService::RunInConsole() {
|
| }
|
|
|
| // Create a window for receiving session change notifications.
|
| - LPCWSTR atom = NULL;
|
| HWND window = NULL;
|
| - WNDPROC window_proc =
|
| - base::win::WrappedWindowProc<SessionChangeNotificationProc>;
|
| - HINSTANCE instance = base::GetModuleFromAddress(window_proc);
|
| -
|
| - WNDCLASSEX wc = {0};
|
| - wc.cbSize = sizeof(wc);
|
| - wc.lpfnWndProc = window_proc;
|
| - wc.hInstance = instance;
|
| - wc.lpszClassName = kSessionNotificationWindowClass;
|
| - atom = reinterpret_cast<LPCWSTR>(RegisterClassExW(&wc));
|
| - if (atom == NULL) {
|
| + WNDCLASSEX window_class;
|
| + base::win::InitializeWindowClass(
|
| + kSessionNotificationWindowClass,
|
| + &base::win::WrappedWindowProc<SessionChangeNotificationProc>,
|
| + 0, 0, 0, NULL, NULL, NULL, NULL, NULL,
|
| + &window_class);
|
| + HINSTANCE instance = window_class.hInstance;
|
| + ATOM atom = RegisterClassExW(&window_class);
|
| + if (atom == 0) {
|
| LOG_GETLASTERROR(ERROR)
|
| << "Failed to register the window class '"
|
| << kSessionNotificationWindowClass << "'";
|
| goto cleanup;
|
| }
|
|
|
| - window = CreateWindowW(atom, 0, 0, 0, 0, 0, 0, HWND_MESSAGE, 0, instance, 0);
|
| + window = CreateWindowW(MAKEINTATOM(atom), 0, 0, 0, 0, 0, 0, HWND_MESSAGE, 0,
|
| + instance, 0);
|
| if (window == NULL) {
|
| LOG_GETLASTERROR(ERROR)
|
| << "Failed to creat the session notificationwindow";
|
| @@ -302,7 +299,7 @@ cleanup:
|
| }
|
|
|
| if (atom != 0) {
|
| - UnregisterClass(atom, instance);
|
| + UnregisterClass(MAKEINTATOM(atom), instance);
|
| }
|
|
|
| // Unsubscribe from console events. Ignore the exit code. There is nothing
|
|
|