emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/w32fns.c,v [EMACS_22_BASE]


From: Jason Rumney
Subject: [Emacs-diffs] Changes to emacs/src/w32fns.c,v [EMACS_22_BASE]
Date: Wed, 11 Jul 2007 14:42:22 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Branch:         EMACS_22_BASE
Changes by:     Jason Rumney <jasonr>   07/07/11 14:42:22

Index: w32fns.c
===================================================================
RCS file: /sources/emacs/emacs/src/w32fns.c,v
retrieving revision 1.288.2.1
retrieving revision 1.288.2.2
diff -u -b -r1.288.2.1 -r1.288.2.2
--- w32fns.c    10 Jun 2007 23:28:55 -0000      1.288.2.1
+++ w32fns.c    11 Jul 2007 14:42:21 -0000      1.288.2.2
@@ -52,6 +52,7 @@
 #include <shellapi.h>
 #include <ctype.h>
 #include <winspool.h>
+#include <objbase.h>
 
 #include <dlgs.h>
 #define FILE_NAME_TEXT_FIELD edt1
@@ -2514,6 +2515,13 @@
              /* Produced by complete_deferred_msg; just ignore.  */
              break;
            case WM_EMACS_CREATEWINDOW:
+              /* Initialize COM for this window. Even though we don't use it,
+                 some third party shell extensions can cause it to be used in
+                 system dialogs, which causes a crash if it is not initialized.
+                 This is a known bug in Windows, which was fixed long ago, but
+                 the patch for XP is not publically available until XP SP3,
+                 and older versions will never be patched.  */
+              CoInitialize (NULL);
              w32_createwindow ((struct frame *) msg.wParam);
              if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0))
                abort ();
@@ -3660,6 +3668,10 @@
       my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
       goto dflt;
 
+    case WM_DESTROY:
+      CoUninitialize ();
+      return 0;
+
     case WM_CLOSE:
       wmsg.dwModifiers = w32_get_modifiers ();
       my_post_msg (&wmsg, hwnd, msg, wParam, lParam);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]