Windows Restart Manager's RmGetList returns ERROR_ACCESS_DENIED, why?

600 views Asked by At

I have code that starts a Restart Manager session, then calls RmRegisterResources with a few files, and when it calls RmGetList, ERROR_ACCESS_DENIED (5) is returned... But if I add a Sleep for 50ms and then try again... It works... How come? Any idea? Is there anything else than sleep that could be done to successfully call RmGetList.

2

There are 2 answers

0
mark keli On

I have a inno setup installer, having a native call "rstrtmgr.dll". Fails every time installation but succeeds once or twice. phenomenon of access deny is similar as my case. So I suggest my customer to reinstall everything in the slow computer.

0
Andreas Vergison On

What do you exactly mean by "it works"? I tried on a file with an "access denied". The first call to RmGetList returned 5, arguments unchanged. Even without sleep in between the second call returned 0, while setting pnProcInfoNeeded, pnProcInfo and lpdwRebootReasons to zero. So you don't seem to get interesting info...

That looks like bug, or at least an undocumented feature.