From 98911170b04fe6510e4296299a38b3d24e155577 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Tue, 10 Sep 2013 09:03:36 +0200 Subject: [PATCH] Bug 913953 - Part x: Remove unused GetUserSidString function; r=ehsan --- ipc/chromium/src/base/win_util.cc | 28 ---------------------------- ipc/chromium/src/base/win_util.h | 3 --- 2 files changed, 31 deletions(-) diff --git a/ipc/chromium/src/base/win_util.cc b/ipc/chromium/src/base/win_util.cc index 27b71630c41b..5adde21f65e0 100644 --- a/ipc/chromium/src/base/win_util.cc +++ b/ipc/chromium/src/base/win_util.cc @@ -163,34 +163,6 @@ bool AddAccessToKernelObject(HANDLE handle, WELL_KNOWN_SID_TYPE known_sid, 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 user(reinterpret_cast(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() { return (::GetKeyState(VK_SHIFT) & 0x80) == 0x80; } diff --git a/ipc/chromium/src/base/win_util.h b/ipc/chromium/src/base/win_util.h index 9949aacfbc19..a771bd249406 100644 --- a/ipc/chromium/src/base/win_util.h +++ b/ipc/chromium/src/base/win_util.h @@ -42,9 +42,6 @@ void GetServicePackLevel(int* major, int* minor); bool AddAccessToKernelObject(HANDLE handle, WELL_KNOWN_SID_TYPE known_sid, 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. bool IsShiftPressed();