[RAPPS] Use _beginthreadex instead of CreateThread (#2552)
authorHe Yang <1160386205@qq.com>
Fri, 17 Apr 2020 17:27:16 +0000 (12:27 -0500)
committerGitHub <noreply@github.com>
Fri, 17 Apr 2020 17:27:16 +0000 (19:27 +0200)
base/applications/rapps/loaddlg.cpp

index 213e4af..4ee4cb5 100644 (file)
@@ -41,6 +41,7 @@
 
 #include <rosctrls.h>
 #include <windowsx.h>
+#include <process.h>
 #undef SubclassWindow
 
 #include "rosui.h"
@@ -355,7 +356,7 @@ public:
     static VOID Add(DownloadInfo info);
     static VOID Download(const DownloadInfo& DLInfo, BOOL bIsModal = FALSE);
     static INT_PTR CALLBACK DownloadDlgProc(HWND Dlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
-    static DWORD WINAPI ThreadFunc(LPVOID Context);
+    static unsigned int WINAPI ThreadFunc(LPVOID Context);
     static VOID LaunchDownloadDialog(BOOL);
 };
 
@@ -432,8 +433,8 @@ INT_PTR CALLBACK CDownloadManager::DownloadDlgProc(HWND Dlg, UINT uMsg, WPARAM w
 
         // Start download process
         DownloadParam *param = new DownloadParam(Dlg, AppsToInstallList, szCaption);
-        DWORD ThreadId;
-        HANDLE Thread = CreateThread(NULL, 0, ThreadFunc, (LPVOID) param, 0, &ThreadId);
+        unsigned int ThreadId;
+        HANDLE Thread = (HANDLE)_beginthreadex(NULL, 0, ThreadFunc, (void *) param, 0, &ThreadId);
 
         if (!Thread)
         {
@@ -507,7 +508,7 @@ VOID CDownloadManager::UpdateProgress(
     }
 }
 
-DWORD WINAPI CDownloadManager::ThreadFunc(LPVOID param)
+unsigned int WINAPI CDownloadManager::ThreadFunc(LPVOID param)
 {
     ATL::CStringW Path;
     PWSTR p, q;