MAD
MAD

Reputation: 1659

Windows Restart Manager's RmGetList returns ERROR_ACCESS_DENIED, why?

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.

Upvotes: 5

Views: 709

Answers (2)

mark keli
mark keli

Reputation: 39

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.

Upvotes: 0

Andreas Vergison
Andreas Vergison

Reputation: 115

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.

Upvotes: 2

Related Questions