mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 09:03:25 +00:00
[RAPPS] Protect database update with a mutex (#7006)
This commit is contained in:
parent
e5a6b0f8e5
commit
3ff8adc553
5 changed files with 45 additions and 2 deletions
|
@ -338,6 +338,7 @@ ParseCmdAndExecute(LPWSTR lpCmdLine, BOOL bIsFirstLaunch, int nCmdShow)
|
|||
BOOL bAppwizMode = (argc > 1 && MatchCmdOption(argv[1], CMD_KEY_APPWIZ));
|
||||
if (!bAppwizMode)
|
||||
{
|
||||
CUpdateDatabaseMutex lock;
|
||||
if (SettingsInfo.bUpdateAtStart || bIsFirstLaunch)
|
||||
db.RemoveCached();
|
||||
|
||||
|
@ -350,7 +351,7 @@ ParseCmdAndExecute(LPWSTR lpCmdLine, BOOL bIsFirstLaunch, int nCmdShow)
|
|||
{
|
||||
// Check whether the RAPPS MainWindow is already launched in another process
|
||||
CStringW szWindowText(MAKEINTRESOURCEW(bAppwizMode ? IDS_APPWIZ_TITLE : IDS_APPTITLE));
|
||||
LPCWSTR pszMutex = bAppwizMode ? L"RAPPWIZ" : szWindowClass;
|
||||
LPCWSTR pszMutex = bAppwizMode ? L"RAPPWIZ" : MAINWINDOWMUTEX;
|
||||
|
||||
HANDLE hMutex = CreateMutexW(NULL, FALSE, pszMutex);
|
||||
if ((!hMutex) || (GetLastError() == ERROR_ALREADY_EXISTS))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue