Browse Source

Remove custompatch_msi-add-dummyactionthreads.patch

master
Pekka Helenius 5 years ago
parent
commit
f2b62b1521
2 changed files with 0 additions and 84 deletions
  1. +0
    -4
      Readme.md
  2. +0
    -80
      wine-playonlinux/custompatch_msi-add-dummyactionthreads.patch

+ 0
- 4
Readme.md View File

@ -406,10 +406,6 @@ For more information, check [this](https://forum.winehq.org/viewtopic.php?f=8&t=
- `custompatch_glsl_shader.patch` = GLSL shaders patch for Wine.
- `custompatch_msi-add-dummyactionthreads.patch` = Add MSI dummy actions since Wine lacks a proper implementation of MSI custom action server. See details [here](https://bugs.winehq.org/show_bug.cgi?id=18070)
Basically, this patch helps you installing many useful programs on Wine which would otherwise be impossible.
- `custompatch_photoshop_getticks_input.c.patch` = Photoshop brush patch for Wine. Details [here](https://bugs.winehq.org/show_bug.cgi?id=29871)
- `custompatch_photoshop_keepfocus_message.c.patch` = Patch for keeping window focus while using Camera Raw plugin.


+ 0
- 80
wine-playonlinux/custompatch_msi-add-dummyactionthreads.patch View File

@ -1,80 +0,0 @@
--- a/dlls/msi/action.c
+++ a/dlls/msi/action.c
@@ -7862,6 +7862,59 @@ static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq)
return rc;
}
+/* Dummy thread just to initialize an MTA for the benefit of custom action DLLs */
+static HANDLE dummy_thread_sync_event = NULL;
+static HANDLE dummy_thread_stop_event = NULL;
+static HANDLE dummy_thread_handle = NULL;
+
+DWORD WINAPI dummy_thread_proc(void *arg)
+{
+ HRESULT hr;
+ DWORD dwWaitResult;
+
+ hr = CoInitializeEx(0, COINIT_MULTITHREADED);
+ if (FAILED(hr))
+ WARN("CoInitializeEx failed %u\n", hr);
+
+ SetEvent(dummy_thread_sync_event);
+ dwWaitResult = WaitForSingleObject(dummy_thread_stop_event, INFINITE);
+
+ if (dwWaitResult != WAIT_OBJECT_0)
+ ERR("WaitForSingleObject failed?\n");
+
+ CoUninitialize();
+ return 0;
+}
+
+static void start_dummy_thread(void)
+{
+ if (dummy_thread_handle) return;
+
+ dummy_thread_sync_event = CreateEventA(NULL, TRUE, FALSE, "DummyThreadUpAndRunning");
+ if (dummy_thread_sync_event == NULL)
+ ERR("Can't create dummy thread sync event\n");
+ dummy_thread_stop_event = CreateEventA(NULL, TRUE, FALSE, "DummyThreadStop");
+ if (dummy_thread_stop_event == NULL)
+ ERR("Can't create dummy thread stop event\n");
+ dummy_thread_handle = CreateThread(NULL, 0, dummy_thread_proc, NULL, 0, NULL);
+ if (dummy_thread_handle == NULL)
+ ERR("Can't create dummy thread\n");
+
+ WaitForSingleObject(dummy_thread_sync_event, INFINITE);
+}
+
+static void end_dummy_thread(void)
+{
+ SetEvent(dummy_thread_stop_event);
+ WaitForSingleObject(dummy_thread_handle, INFINITE);
+
+ CloseHandle(dummy_thread_sync_event);
+ CloseHandle(dummy_thread_stop_event);
+ CloseHandle(dummy_thread_handle);
+
+ dummy_thread_handle = NULL;
+}
+
/****************************************************
* TOP level entry points
*****************************************************/
@@ -7938,6 +7991,8 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
msi_adjust_privilege_properties( package );
msi_set_context( package );
+ start_dummy_thread();
+
productcode = msi_dup_property( package->db, szProductCode );
if (strcmpiW( productcode, package->ProductCode ))
{
@@ -7985,6 +8040,8 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
/* finish up running custom actions */
ACTION_FinishCustomActions(package);
+
+ end_dummy_thread();
if (package->need_rollback && !reinstall)
{

Loading…
Cancel
Save