Sync with trunk r63174.
[reactos.git] / dll / win32 / urlmon / urlmon_ros.diff
1 diff -prudN e:\Wine\dlls\urlmon/bindprot.c e:\reactos\dll\win32\urlmon/bindprot.c
2 --- e:\Wine\dlls\urlmon/bindprot.c 2014-04-04 14:12:42.439519600 +0100
3 +++ e:\reactos\dll\win32\urlmon/bindprot.c 2014-04-11 16:18:48.958227500 +0100
4 @@ -83,36 +80,14 @@ static LRESULT WINAPI notif_wnd_proc(HWN
5 return DefWindowProcW(hwnd, msg, wParam, lParam);
6 }
7
8 -static const WCHAR wszURLMonikerNotificationWindow[] =
9 - {'U','R','L',' ','M','o','n','i','k','e','r',' ',
10 - 'N','o','t','i','f','i','c','a','t','i','o','n',' ','W','i','n','d','o','w',0};
11 -
12 -static ATOM notif_wnd_class;
13 -
14 -static BOOL WINAPI register_notif_wnd_class(INIT_ONCE *once, void *param, void **context)
15 -{
16 - static WNDCLASSEXW wndclass = {
17 - sizeof(wndclass), 0, notif_wnd_proc, 0, 0,
18 - NULL, NULL, NULL, NULL, NULL,
19 - wszURLMonikerNotificationWindow, NULL
20 - };
21 -
22 - wndclass.hInstance = hProxyDll;
23 - notif_wnd_class = RegisterClassExW(&wndclass);
24 - return TRUE;
25 -}
26 -
27 -void unregister_notif_wnd_class(void)
28 -{
29 - if(notif_wnd_class)
30 - UnregisterClassW(MAKEINTRESOURCEW(notif_wnd_class), hProxyDll);
31 -}
32 -
33 HWND get_notif_hwnd(void)
34 {
35 + static ATOM wnd_class = 0;
36 tls_data_t *tls_data;
37
38 - static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT;
39 + static const WCHAR wszURLMonikerNotificationWindow[] =
40 + {'U','R','L',' ','M','o','n','i','k','e','r',' ',
41 + 'N','o','t','i','f','i','c','a','t','i','o','n',' ','W','i','n','d','o','w',0};
42
43 tls_data = get_tls_data();
44 if(!tls_data)
45 @@ -123,11 +98,23 @@ HWND get_notif_hwnd(void)
46 return tls_data->notif_hwnd;
47 }
48
49 - InitOnceExecuteOnce(&init_once, register_notif_wnd_class, NULL, NULL);
50 - if(!notif_wnd_class)
51 - return NULL;
52 + if(!wnd_class) {
53 + static WNDCLASSEXW wndclass = {
54 + sizeof(wndclass), 0,
55 + notif_wnd_proc, 0, 0,
56 + NULL, NULL, NULL, NULL, NULL,
57 + wszURLMonikerNotificationWindow,
58 + NULL
59 + };
60
61 - tls_data->notif_hwnd = CreateWindowExW(0, MAKEINTRESOURCEW(notif_wnd_class),
62 + wndclass.hInstance = hProxyDll;
63 +
64 + wnd_class = RegisterClassExW(&wndclass);
65 + if (!wnd_class && GetLastError() == ERROR_CLASS_ALREADY_EXISTS)
66 + wnd_class = 1;
67 + }
68 +
69 + tls_data->notif_hwnd = CreateWindowExW(0, wszURLMonikerNotificationWindow,
70 wszURLMonikerNotificationWindow, 0, 0, 0, 0, 0, HWND_MESSAGE,
71 NULL, hProxyDll, NULL);
72 if(tls_data->notif_hwnd)
73
74 diff -prudN e:\Wine\dlls\urlmon/urlmon_main.c e:\reactos\dll\win32\urlmon/urlmon_main.c
75 --- e:\Wine\dlls\urlmon/urlmon_main.c 2014-04-04 14:12:42.460533100 +0100
76 +++ e:\reactos\dll\win32\urlmon/urlmon_main.c 2014-04-11 16:19:12.473179000 +0100
77 @@ -139,7 +127,6 @@ static void process_detach(void)
78
79 free_session();
80 free_tls_list();
81 - unregister_notif_wnd_class();
82 }
83
84 /***********************************************************************
85
86 diff -prudN e:\Wine\dlls\urlmon/urlmon_main.h e:\reactos\dll\win32\urlmon/urlmon_main.h
87 --- e:\Wine\dlls\urlmon/urlmon_main.h 2014-04-04 14:12:42.461533700 +0100
88 +++ e:\reactos\dll\win32\urlmon/urlmon_main.h 2014-04-11 16:19:21.822446700 +0100
89 @@ -225,7 +236,6 @@ typedef struct {
90
91 tls_data_t *get_tls_data(void) DECLSPEC_HIDDEN;
92
93 -void unregister_notif_wnd_class(void) DECLSPEC_HIDDEN;
94 HWND get_notif_hwnd(void) DECLSPEC_HIDDEN;
95 void release_notif_hwnd(HWND) DECLSPEC_HIDDEN;
96