What are the differences between Run as Administrator and a manifest with requireAdministrator?

I wrote a program with a manifest that includes requireAdministrator. On Windows 7 systems with UAC enabled, Windows displays a dialog box asking for permission, as it should be. It works great.

If a user launches my program by right-clicking it and selecting "Run as administrator", Windows 7 also displays a dialog box asking for permission. However, there are some minor differences in how my program works in some of the more esoteric parts of my program.

So what are the differences between Run as Administrator and the manifest with requireAdministrator? Any documentation links describing the differences would be appreciated.

Edit : this is with UAC enabled.

Change . As mentioned below, this is a complete explanation of the difference that I see.

I am using the EasyHook library to insert a DLL into another process. When my application starts with "Run as administrator", the process is injected, and EasyHook returns the error "Unknown error in the assembler code entered." None of the code in my DLL has the ability to execute; accident occurs before that. (Moreover, a crash occurs even if I delete the DLL to zero)

If I run my program in normal mode (i.e., it raises using the requireAdministrator), everything works fine.

. , , - , .

+3
4

.

"requireAdministrator" , , , (. (UAC) ).

, " " .

. , . " " , ShellExecute, . . Windows Vista - 4 - :

ShellExecute CreateProcess, . CreateProcess , , .. , , , CreateProcess ERROR_ELEVATION_REQUIRED. ShellExecute , , , . CreateProcessAsUser .

, , , , "runas" ShellExecute. , , . runas Windows Vista. Windows XP Windows 2003 . . :

::ShellExecute(0, // owner window
           L"runas",
           L"C:\\Windows\\Notepad.exe",
           0, // params
           0, // directory
           SW_SHOWNORMAL);

, , " " , ShellExecute , .. .

Kenny Kerr OpenProcessToken. , , , .

, , , .

: , requireAdministrator, highAvailable?

+3

// uiAccess. , uiAccess = false uiAccess = true, , , , -run-as-admin?

+1

EasyHook RemoteHooking IsAdministrator :

- UAC Windows Vista , . , UAC requireAdministrator.

, , (, , !), , , .., , .., . requireAdministrator / . , .

+1

, . , :

" " (Q-Dir), , requireAdministrator, . DLL, . , 100% , , ( , , C: ) .

, , , (, , 7 ...)

0
source

All Articles