windowsadmin-rights

Using Lock pages in memory without being Administrator on Windows Vista and 2008 Server


The following question answers how to get large memory pages on Windows :
"how do i run my app with large pages in windows".

The problem I'm trying to solve is how do I configure it on Vista and 2008 Server.

Normally you just allow a specific user to lock pages in memory and you are done. However on Vista and 2008 this only works if you are using an Administrator account. It doesn't help if the user is actually part of the Administrators group. All other users always get a 1300 error code stating that some rights are missing.

Anyone have a clue as to what else needs to be configured?

Thanks, Staffan


Solution

  • On Vista and Windows 2008, you're getting bitten by UAC. People in the Administrators group have a restricted token, which doesn't contain all of their privileges. The UAC elevation prompt is used to turn on the extra privileges.

    I'm assuming that the "lock pages in memory" privilege is one of the extras.

    The real "Administrator" account isn't subject to UAC.

    You need to run your program elevated, which means running it from an elevated command prompt, or setting it up with a manifest that states "requireAdministrator".