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

Unified Diff: sandbox/win/src/restricted_token_utils.cc

Issue 1337223002: Fixes to possible GetLastError bugs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed some sandbox changes Created 5 years, 3 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 | « sandbox/win/src/restricted_token.cc ('k') | sandbox/win/tools/launcher/launcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/restricted_token_utils.cc
diff --git a/sandbox/win/src/restricted_token_utils.cc b/sandbox/win/src/restricted_token_utils.cc
index 7f70e88e8fd6e2ffa13b3547a4de2305b2d39ac5..4a3d05c639bcd5acbfff79ce2a96df946fc56ce7 100644
--- a/sandbox/win/src/restricted_token_utils.cc
+++ b/sandbox/win/src/restricted_token_utils.cc
@@ -218,9 +218,10 @@ DWORD SetTokenIntegrityLevel(HANDLE token, IntegrityLevel integrity_level) {
DWORD size = sizeof(TOKEN_MANDATORY_LABEL) + ::GetLengthSid(integrity_sid);
BOOL result = ::SetTokenInformation(token, TokenIntegrityLevel, &label,
size);
+ auto last_error = ::GetLastError();
::LocalFree(integrity_sid);
- return result ? ERROR_SUCCESS : ::GetLastError();
+ return result ? ERROR_SUCCESS : last_error;
}
DWORD SetProcessIntegrityLevel(IntegrityLevel integrity_level) {
« no previous file with comments | « sandbox/win/src/restricted_token.cc ('k') | sandbox/win/tools/launcher/launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698