Hello all,
In my service I have a few threads that each call the CreateProcess()
function to launch an external application. I would like to adjust thread (or process) priorities to normal or lower, depending on some other factors. The problem is that SetThreadPriority()
function fails with an error 6 (invalid handle?). I'm passing in a handle obtained from PROCESS_INFORMATION::hThread
(after calling the CreateProcess()
of course).
I've also tried setting the priority on the processes using the SetPriorityClass()
function, which also fails.
Is there something special that I need to do to set priorities in a service? The service is logged on as a local user.
Thanks in advance for your thoughts.