steam_helper: Clean up backgroundservice.ini for EA Desktop.
CW-Bug-Id: #23434
This commit is contained in:
parent
76369eb526
commit
061231e29c
1 changed files with 24 additions and 0 deletions
|
@ -35,6 +35,7 @@
|
||||||
#include "ntstatus.h"
|
#include "ntstatus.h"
|
||||||
#define WIN32_NO_STATUS
|
#define WIN32_NO_STATUS
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <winsvc.h>
|
||||||
#include <winternl.h>
|
#include <winternl.h>
|
||||||
#include <shellapi.h>
|
#include <shellapi.h>
|
||||||
#include <shlwapi.h>
|
#include <shlwapi.h>
|
||||||
|
@ -1226,8 +1227,11 @@ run:
|
||||||
{
|
{
|
||||||
HDESK desktop = GetThreadDesktop(GetCurrentThreadId());
|
HDESK desktop = GetThreadDesktop(GetCurrentThreadId());
|
||||||
DWORD is_unavailable, type, size;
|
DWORD is_unavailable, type, size;
|
||||||
|
SC_HANDLE manager, service;
|
||||||
|
SERVICE_STATUS status;
|
||||||
DWORD timeout = 3000;
|
DWORD timeout = 3000;
|
||||||
HKEY eakey;
|
HKEY eakey;
|
||||||
|
BOOL ret;
|
||||||
|
|
||||||
link2ea = TRUE;
|
link2ea = TRUE;
|
||||||
if (!SetUserObjectInformationA(desktop, 1000, &timeout, sizeof(timeout)))
|
if (!SetUserObjectInformationA(desktop, 1000, &timeout, sizeof(timeout)))
|
||||||
|
@ -1245,6 +1249,26 @@ run:
|
||||||
}
|
}
|
||||||
RegCloseKey(eakey);
|
RegCloseKey(eakey);
|
||||||
}
|
}
|
||||||
|
if ((manager = OpenSCManagerA(NULL, SERVICES_ACTIVE_DATABASEA, SERVICE_QUERY_STATUS)))
|
||||||
|
{
|
||||||
|
if ((service = OpenServiceA(manager, "EABackgroundService", SERVICE_QUERY_STATUS)))
|
||||||
|
{
|
||||||
|
if (QueryServiceStatus(service, &status))
|
||||||
|
{
|
||||||
|
TRACE("dwCurrentState %#x.\n", status.dwCurrentState);
|
||||||
|
if (status.dwCurrentState == SERVICE_STOP_PENDING || status.dwCurrentState == SERVICE_STOPPED)
|
||||||
|
{
|
||||||
|
ret = DeleteFileA("C:\\ProgramData\\EA Desktop\\backgroundservice.ini");
|
||||||
|
WARN("Tried to delete backgroundservice.ini, ret %d, error %u.\n", ret, GetLastError());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else ERR("Could not query service status, error %u.\n", GetLastError());
|
||||||
|
CloseServiceHandle(service);
|
||||||
|
}
|
||||||
|
else TRACE("Could not open EABackgroundService, error %u.\n", GetLastError());
|
||||||
|
CloseServiceHandle(manager);
|
||||||
|
}
|
||||||
|
else ERR("Could not open service manager, error %u.\n", GetLastError());
|
||||||
}
|
}
|
||||||
hide_window = env_nonzero("PROTON_HIDE_PROCESS_WINDOW");
|
hide_window = env_nonzero("PROTON_HIDE_PROCESS_WINDOW");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue