client: fix set_client_priority()

This commit is contained in:
David Anderson 2015-09-29 13:44:49 -07:00
parent f2cb4bd7a6
commit 3d6e1e559a
1 changed files with 3 additions and 0 deletions

View File

@ -379,7 +379,10 @@ bool CLIENT_STATE::is_new_client() {
#ifdef _WIN32
typedef DWORD (WINAPI *SPC)(HANDLE, DWORD);
#endif
static void set_client_priority() {
#ifdef _WIN32
SPC spc = (SPC) GetProcAddress(GetModuleHandle(_T("kernel32.dll")), "SetPriorityClass");
if (!spc) return;
if (spc(GetCurrentProcess(), PROCESS_MODE_BACKGROUND_BEGIN)) {