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

Unified Diff: chrome_elf/blacklist/test/blacklist_test_main_dll.cc

Issue 2345913003: [chrome_elf] NTRegistry - added wow64 redirection support. (Closed)
Patch Set: Final nits. Created 4 years, 2 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
« no previous file with comments | « chrome_elf/blacklist/test/blacklist_test.cc ('k') | chrome_elf/chrome_elf_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_elf/blacklist/test/blacklist_test_main_dll.cc
diff --git a/chrome_elf/blacklist/test/blacklist_test_main_dll.cc b/chrome_elf/blacklist/test/blacklist_test_main_dll.cc
index 3b2c4d7deac0cdb6d6f362c63cead8bb2632a355..5f919f7165dc07a815c5f2bde69775cab228519b 100644
--- a/chrome_elf/blacklist/test/blacklist_test_main_dll.cc
+++ b/chrome_elf/blacklist/test/blacklist_test_main_dll.cc
@@ -14,22 +14,20 @@ namespace {
void GetIpcOverrides() {
DWORD buffer_size = ::GetEnvironmentVariableW(L"hkcu_override", nullptr, 0);
if (buffer_size > 0) {
- wchar_t* content = new wchar_t[buffer_size];
+ std::wstring content(buffer_size, L'\0');
buffer_size =
- ::GetEnvironmentVariableW(L"hkcu_override", content, buffer_size);
+ ::GetEnvironmentVariableW(L"hkcu_override", &content[0], buffer_size);
if (buffer_size)
- ::wcsncpy(nt::HKCU_override, content, nt::g_kRegMaxPathLen - 1);
- delete[] content;
+ nt::SetTestingOverride(nt::HKCU, content);
}
buffer_size = ::GetEnvironmentVariableW(L"hklm_override", nullptr, 0);
if (buffer_size > 0) {
- wchar_t* content = new wchar_t[buffer_size];
+ std::wstring content(buffer_size, L'\0');
buffer_size =
- ::GetEnvironmentVariableW(L"hklm_override", content, buffer_size);
+ ::GetEnvironmentVariableW(L"hklm_override", &content[0], buffer_size);
if (buffer_size)
- ::wcsncpy(nt::HKLM_override, content, nt::g_kRegMaxPathLen - 1);
- delete[] content;
+ nt::SetTestingOverride(nt::HKLM, content);
}
return;
« no previous file with comments | « chrome_elf/blacklist/test/blacklist_test.cc ('k') | chrome_elf/chrome_elf_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698