From 2ac13afefc439a7bc1cfa13e44027113fbf8f96a Mon Sep 17 00:00:00 2001 From: He Yang <1160386205@qq.com> Date: Fri, 17 Apr 2020 12:27:16 -0500 Subject: [PATCH] [RAPPS] Use _beginthreadex instead of CreateThread (#2552) --- base/applications/rapps/loaddlg.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/base/applications/rapps/loaddlg.cpp b/base/applications/rapps/loaddlg.cpp index 213e4afb3ab..4ee4cb518fb 100644 --- a/base/applications/rapps/loaddlg.cpp +++ b/base/applications/rapps/loaddlg.cpp @@ -41,6 +41,7 @@ #include #include +#include #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;