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

Unified Diff: chrome/installer/mini_installer/regkey.cc

Issue 2663003003: Fix -full fallback for diff updates (M56). (Closed)
Patch Set: Created 3 years, 11 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/installer/mini_installer/regkey.cc
diff --git a/chrome/installer/mini_installer/regkey.cc b/chrome/installer/mini_installer/regkey.cc
index 44bdb5d9c80e0450626edb722b32d7774e63c7e9..ca95507b171caf2132afa4305d5da3979488af58 100644
--- a/chrome/installer/mini_installer/regkey.cc
+++ b/chrome/installer/mini_installer/regkey.cc
@@ -72,7 +72,6 @@ void RegKey::Close() {
}
}
-
// static
bool RegKey::ReadSZValue(HKEY root_key, const wchar_t *sub_key,
const wchar_t *value_name, wchar_t *value,
@@ -82,17 +81,34 @@ bool RegKey::ReadSZValue(HKEY root_key, const wchar_t *sub_key,
key.ReadSZValue(value_name, value, size) == ERROR_SUCCESS);
}
-// Opens the Google Update ClientState key for a product. This finds only
-// registry entries for Chrome; it does not support the Chromium registry
-// layout.
-bool OpenClientStateKey(HKEY root_key, const wchar_t* app_guid,
- REGSAM access, RegKey* key) {
+// Opens the Google Update Clients key for a product.
+LONG OpenClientsKey(HKEY root_key,
+ const wchar_t* app_guid,
+ REGSAM access,
+ RegKey* key) {
+ StackString<MAX_PATH> clients_key;
+ if (!clients_key.assign(kClientsKeyBase))
+ return ERROR_BUFFER_OVERFLOW;
+#if defined(GOOGLE_CHROME_BUILD)
+ if (!clients_key.append(app_guid))
+ return ERROR_BUFFER_OVERFLOW;
+#endif
+ return key->Open(root_key, clients_key.get(), access | KEY_WOW64_32KEY);
+}
+
+// Opens the Google Update ClientState key for a product.
+LONG OpenClientStateKey(HKEY root_key,
+ const wchar_t* app_guid,
+ REGSAM access,
+ RegKey* key) {
StackString<MAX_PATH> client_state_key;
- return client_state_key.assign(kClientStateKeyBase) &&
- client_state_key.append(app_guid) &&
- (key->Open(root_key,
- client_state_key.get(),
- access | KEY_WOW64_32KEY) == ERROR_SUCCESS);
+ if (!client_state_key.assign(kClientStateKeyBase))
+ return ERROR_BUFFER_OVERFLOW;
+#if defined(GOOGLE_CHROME_BUILD)
+ if (!client_state_key.append(app_guid))
+ return ERROR_BUFFER_OVERFLOW;
+#endif
+ return key->Open(root_key, client_state_key.get(), access | KEY_WOW64_32KEY);
}
} // namespace mini_installer
« chrome/installer/mini_installer/regkey.h ('K') | « chrome/installer/mini_installer/regkey.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698