Bug 913953 - Part s: Remove unused UserAccountControlIsEnabled function; r=ehsan

This commit is contained in:
Ms2ger 2013-09-10 09:03:36 +02:00
parent b964864401
commit 900116ed13
2 changed files with 0 additions and 19 deletions

View File

@ -322,17 +322,6 @@ bool IsAltPressed() {
return (::GetKeyState(VK_MENU) & 0x80) == 0x80;
}
bool UserAccountControlIsEnabled() {
RegKey key(HKEY_LOCAL_MACHINE,
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System");
DWORD uac_enabled;
if (!key.ReadValueDW(L"EnableLUA", &uac_enabled))
return true;
// Users can set the EnableLUA value to something arbitrary, like 2, which
// Vista will treat as UAC enabled, so we make sure it is not set to 0.
return (uac_enabled != 0);
}
std::wstring FormatMessage(unsigned messageid) {
wchar_t* string_buffer = NULL;
unsigned string_length = ::FormatMessage(

View File

@ -87,14 +87,6 @@ bool IsCtrlPressed();
// Returns true if the alt key is currently pressed.
bool IsAltPressed();
// Returns false if user account control (UAC) has been disabled with the
// EnableLUA registry flag. Returns true if user account control is enabled.
// NOTE: The EnableLUA registry flag, which is ignored on Windows XP
// machines, might still exist and be set to 0 (UAC disabled), in which case
// this function will return false. You should therefore check this flag only
// if the OS is Vista.
bool UserAccountControlIsEnabled();
// Use the Win32 API FormatMessage() function to generate a string, using
// Windows's default Message Compiled resources; ignoring the inserts.
std::wstring FormatMessage(unsigned messageid);