aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Rumney2007-07-11 14:43:07 +0000
committerJason Rumney2007-07-11 14:43:07 +0000
commitd5781bb682510e348cf86ba0073cffa75c50a073 (patch)
tree68c17d157eeadf4872fad57a34ff8cf892ea8617 /src
parentc1c5c06dc3dec634ff0dbda889f357f9e5b582e7 (diff)
downloademacs-d5781bb682510e348cf86ba0073cffa75c50a073.tar.gz
emacs-d5781bb682510e348cf86ba0073cffa75c50a073.zip
(w32_msg_pump) <WM_EMACS_CREATEWINDOW>: Initialize COM.
(w32_msg_pump) <WM_DESTROY>: Uninitialize COM.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/w32fns.c12
2 files changed, 19 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 190d6fb0e36..d112f7297bf 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12007-07-11 Jason Rumney <jasonr@gnu.org>
2
3 * makefile.w32-in (LIBS): Include OLE32.
4
5 * w32fns.c (w32_msg_pump) <WM_EMACS_CREATEWINDOW>: Initialize COM.
6 (w32_msg_pump) <WM_DESTROY>: Uninitialize COM.
7
12007-06-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 82007-06-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2 9
3 * macterm.c [USE_MAC_TSM] (mac_handle_text_input_event): 10 * macterm.c [USE_MAC_TSM] (mac_handle_text_input_event):
diff --git a/src/w32fns.c b/src/w32fns.c
index fd8df29affa..47ca9157623 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -52,6 +52,7 @@ Boston, MA 02110-1301, USA. */
52#include <shellapi.h> 52#include <shellapi.h>
53#include <ctype.h> 53#include <ctype.h>
54#include <winspool.h> 54#include <winspool.h>
55#include <objbase.h>
55 56
56#include <dlgs.h> 57#include <dlgs.h>
57#define FILE_NAME_TEXT_FIELD edt1 58#define FILE_NAME_TEXT_FIELD edt1
@@ -2514,6 +2515,13 @@ w32_msg_pump (deferred_msg * msg_buf)
2514 /* Produced by complete_deferred_msg; just ignore. */ 2515 /* Produced by complete_deferred_msg; just ignore. */
2515 break; 2516 break;
2516 case WM_EMACS_CREATEWINDOW: 2517 case WM_EMACS_CREATEWINDOW:
2518 /* Initialize COM for this window. Even though we don't use it,
2519 some third party shell extensions can cause it to be used in
2520 system dialogs, which causes a crash if it is not initialized.
2521 This is a known bug in Windows, which was fixed long ago, but
2522 the patch for XP is not publically available until XP SP3,
2523 and older versions will never be patched. */
2524 CoInitialize (NULL);
2517 w32_createwindow ((struct frame *) msg.wParam); 2525 w32_createwindow ((struct frame *) msg.wParam);
2518 if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0)) 2526 if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0))
2519 abort (); 2527 abort ();
@@ -3660,6 +3668,10 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
3660 my_post_msg (&wmsg, hwnd, msg, wParam, lParam); 3668 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
3661 goto dflt; 3669 goto dflt;
3662 3670
3671 case WM_DESTROY:
3672 CoUninitialize ();
3673 return 0;
3674
3663 case WM_CLOSE: 3675 case WM_CLOSE:
3664 wmsg.dwModifiers = w32_get_modifiers (); 3676 wmsg.dwModifiers = w32_get_modifiers ();
3665 my_post_msg (&wmsg, hwnd, msg, wParam, lParam); 3677 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);