Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Unified Diff: chrome_elf/breakpad.cc

Issue 1841573002: [Chrome ELF] New NT registry API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up OverrideRegistry function. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome_elf/breakpad.cc
diff --git a/chrome_elf/breakpad.cc b/chrome_elf/breakpad.cc
index d67b5dceb31e9869b657feb0454ec77f522c8a74..3f85e3c07f06ec96426f5234a7734af99ff474c7 100644
--- a/chrome_elf/breakpad.cc
+++ b/chrome_elf/breakpad.cc
@@ -7,11 +7,10 @@
#include "chrome_elf/breakpad.h"
-#include <sddl.h>
-
#include "base/macros.h"
#include "breakpad/src/client/windows/handler/exception_handler.h"
#include "chrome/common/chrome_version.h"
+#include "chrome_elf/chrome_elf_reg.h"
#include "chrome_elf/chrome_elf_util.h"
google_breakpad::ExceptionHandler* g_elf_breakpad = NULL;
@@ -64,29 +63,6 @@ google_breakpad::CustomClientInfo* GetCustomInfo() {
return &custom_info;
}
-base::string16 GetUserSidString() {
- // Get the current token.
- HANDLE token = NULL;
- base::string16 user_sid;
- if (!::OpenProcessToken(::GetCurrentProcess(), TOKEN_QUERY, &token))
- return user_sid;
-
- DWORD size = sizeof(TOKEN_USER) + SECURITY_MAX_SID_SIZE;
- BYTE user_bytes[sizeof(TOKEN_USER) + SECURITY_MAX_SID_SIZE] = {};
- TOKEN_USER* user = reinterpret_cast<TOKEN_USER*>(user_bytes);
-
- wchar_t* sid_string = NULL;
- if (::GetTokenInformation(token, TokenUser, user, size, &size) &&
- user->User.Sid &&
- ::ConvertSidToStringSid(user->User.Sid, &sid_string)) {
- user_sid = sid_string;
- ::LocalFree(sid_string);
- }
-
- CloseHandle(token);
- return user_sid;
-}
-
bool IsHeadless() {
DWORD ret = ::GetEnvironmentVariable(L"CHROME_HEADLESS", NULL, 0);
if (ret != 0)
@@ -158,8 +134,9 @@ void InitializeCrashReporting() {
// 32-bit user: \\.\pipe\GoogleCrashServices\<user SID>
// 64-bit system: \\.\pipe\GoogleCrashServices\S-1-5-18-x64
// 64-bit user: \\.\pipe\GoogleCrashServices\<user SID>-x64
- base::string16 user_sid = IsSystemInstall(exe_path) ? kSystemPrincipalSid :
- GetUserSidString();
+ base::string16 user_sid = IsSystemInstall(exe_path)
+ ? kSystemPrincipalSid
+ : nt::GetCurrentUserSidString();
if (user_sid.empty())
return;

Powered by Google App Engine
This is Rietveld 408576698