[SOLVED] TProcess — ppRealTime priority does not work lazarus / 34-Windows ---------------------------------------------------------------------- flowCRANE · 2021-01-21 17:44 I have a strange problem. My program uses one TProcess instance to run an external program (here: the FCEUX emulator). In addition to specifying the application path and the ROM file to open in the emulator, it also sets the priority to the highest possible, i.e. ppRealTime (it is required): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure ]"]>Blockedlator.InitProcess();begin  FProcess := TProcess.Create(nil);   {$IFDEF REGION_PAL}  FProcess.Executable := 'emulator\pal\fceux64.exe';  FProcess.Parameters.Add('emulator\pal\games\Tetris (Europe).nes');  {$ELSE}  FProcess.Executable := 'emulator\ntsc\fceux64.exe';  FProcess.Parameters.Add('emulator\ntsc\games\Tetris (USA).nes');  {$ENDIF}   FProcess.Priority := ppRealTime;  FProcess.Execute();end; The emulator boots up correctly, but its process priority is set to High instead of Realtime (see attachment). My program (the one running the emulator) works with basic permissions, so does the emulator. System info and Lazarus version in signature. Does anyone know why this is happening and how to fix it? ---------------------------------------------------------------------- ASerge · 2021-01-21 18:25 By default, the SeIncreaseBasePriorityPrivilege privilege, which is required to set the realtime priority for processes, is disabled even for admins. It must be requested explicitly. ---------------------------------------------------------------------- flowCRANE · 2021-01-23 12:05 Ok, thank you very much for the information. I changed the execution level from asInvoker to requireAdministrator in the project settings window, and it now works fine. But the problem is that now I'm not able to run my application in debug mode (using IDE) — every time the debugger just crash. The solution is to run Lazarus as administrator, so I have to remember this. ---------------------------------------------------------------------- ASBzone · 2021-01-26 04:02 You should be very careful with the RealTime priority. https://devblogs.microsoft.com/oldnewthing/20100610-00/?p=13753