Bug 913953 - Part x: Remove unused GetUserSidString function; r=ehsan

This commit is contained in:
Ms2ger 2013-09-10 09:03:36 +02:00
parent d476eebff5
commit 98911170b0
2 changed files with 0 additions and 31 deletions

View File

@ -163,34 +163,6 @@ bool AddAccessToKernelObject(HANDLE handle, WELL_KNOWN_SID_TYPE known_sid,
return true; return true;
} }
bool GetUserSidString(std::wstring* user_sid) {
// Get the current token.
HANDLE token = NULL;
if (!::OpenProcessToken(::GetCurrentProcess(), TOKEN_QUERY, &token))
return false;
ScopedHandle token_scoped(token);
DWORD size = sizeof(TOKEN_USER) + SECURITY_MAX_SID_SIZE;
scoped_ptr<TOKEN_USER> user(reinterpret_cast<TOKEN_USER*>(new BYTE[size]));
if (!::GetTokenInformation(token, TokenUser, user.get(), size, &size))
return false;
if (!user->User.Sid)
return false;
// Convert the data to a string.
wchar_t* sid_string;
if (!::ConvertSidToStringSid(user->User.Sid, &sid_string))
return false;
*user_sid = sid_string;
::LocalFree(sid_string);
return true;
}
bool IsShiftPressed() { bool IsShiftPressed() {
return (::GetKeyState(VK_SHIFT) & 0x80) == 0x80; return (::GetKeyState(VK_SHIFT) & 0x80) == 0x80;
} }

View File

@ -42,9 +42,6 @@ void GetServicePackLevel(int* major, int* minor);
bool AddAccessToKernelObject(HANDLE handle, WELL_KNOWN_SID_TYPE known_sid, bool AddAccessToKernelObject(HANDLE handle, WELL_KNOWN_SID_TYPE known_sid,
ACCESS_MASK access); ACCESS_MASK access);
// Returns the string representing the current user sid.
bool GetUserSidString(std::wstring* user_sid);
// Returns true if the shift key is currently pressed. // Returns true if the shift key is currently pressed.
bool IsShiftPressed(); bool IsShiftPressed();