Strange VC++ Debugger behavior
-
Hi : D. I'm running XP SP2 and Visual C++ 6 SP 6. I'm very curious about why this behavior occurs. If I call this function while I'm debugging, it works! ExitWindowsEx(EWX_POWEROFF, 0); But if I run the debug-built or even release-built executables from my hard disk, it does't work! Why!? This is very strange. From the debbuger, the computer starts shut down procedure, but otherwise, no way. Thank you...
-= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^
-
Hi : D. I'm running XP SP2 and Visual C++ 6 SP 6. I'm very curious about why this behavior occurs. If I call this function while I'm debugging, it works! ExitWindowsEx(EWX_POWEROFF, 0); But if I run the debug-built or even release-built executables from my hard disk, it does't work! Why!? This is very strange. From the debbuger, the computer starts shut down procedure, but otherwise, no way. Thank you...
-= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^
Hm. Found my own answer in the meantime. Apparently, the VC++ IDE has administrator privileges. If you're a little program like me, check this out: http://msdn2.microsoft.com/en-us/library/aa376868.aspx (see SE_SHUTDOWN_NAME) http://msdn2.microsoft.com/en-us/library/aa375202.aspx ...and for a nice example... http://msdn2.microsoft.com/en-us/library/aa376871.aspx
-= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^
-
Hi : D. I'm running XP SP2 and Visual C++ 6 SP 6. I'm very curious about why this behavior occurs. If I call this function while I'm debugging, it works! ExitWindowsEx(EWX_POWEROFF, 0); But if I run the debug-built or even release-built executables from my hard disk, it does't work! Why!? This is very strange. From the debbuger, the computer starts shut down procedure, but otherwise, no way. Thank you...
-= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^
Privileges, mon ami, privileges (I suppose...)! :-D MSDN [^] states To shut down or restart the system, the calling process must use the
AdjustTokenPrivileges
function to enable theSE_SHUTDOWN_NAME
privilege. For more information, see Running with Special Privileges. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
-
Privileges, mon ami, privileges (I suppose...)! :-D MSDN [^] states To shut down or restart the system, the calling process must use the
AdjustTokenPrivileges
function to enable theSE_SHUTDOWN_NAME
privilege. For more information, see Running with Special Privileges. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
We replied in the same time : D. Thank you anyway! Appreciated.
-= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^
-
We replied in the same time : D. Thank you anyway! Appreciated.
-= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^