windows-afsd-priority-class-20090401

LICENSE MIT

Change the default priority class for afsd_service.exe to High.
This matches the priority class assigned to other system processes
that generate requests to afsd_service.exe.

Permit the ..\TransarcAFSDaemon\Parameters "PriorityClass"
registry value to be used to change the default.
This commit is contained in:
Jeffrey Altman 2009-04-01 18:29:15 +00:00
parent d7749751df
commit 37f582326c

View File

@ -617,6 +617,7 @@ int afsd_InitCM(char **reasonP)
int cm_SubnetMask[CM_MAXINTERFACE_ADDR];/* client's subnet mask in host order*/
int cm_NetMtu[CM_MAXINTERFACE_ADDR]; /* client's MTU sizes */
int cm_NetFlags[CM_MAXINTERFACE_ADDR]; /* network flags */
DWORD dwPriority;
WSAStartup(0x0101, &WSAjunk);
@ -666,6 +667,16 @@ int afsd_InitCM(char **reasonP)
osi_panic(buf, __FILE__, __LINE__);
}
dummyLen = sizeof(dwPriority);
code = RegQueryValueEx(parmKey, "PriorityClass", NULL, NULL,
(BYTE *) &dwPriority, &dummyLen);
if (code != ERROR_SUCCESS || dwPriority == 0) {
dwPriority = HIGH_PRIORITY_CLASS;
}
if (dwPriority != GetPriorityClass(GetCurrentProcess()))
SetPriorityClass(GetCurrentProcess(), dwPriority);
afsi_log("PriorityClass 0x%x", GetPriorityClass(GetCurrentProcess()));
dummyLen = sizeof(lockOrderValidation);
code = RegQueryValueEx(parmKey, "LockOrderValidation", NULL, NULL,
(BYTE *) &lockOrderValidation, &dummyLen);