Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/plugin/AdblockPlusClient.cpp

Issue 6308231068516352: Fix issues with security tokens (Enhanced Protected Mode, Protected Mode etc) (Closed)
Patch Set: Slaying the comments Created March 4, 2014, 10:38 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/shared/Communication.cpp » ('j') | src/shared/Communication.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/AdblockPlusClient.cpp
===================================================================
--- a/src/plugin/AdblockPlusClient.cpp
+++ b/src/plugin/AdblockPlusClient.cpp
@@ -55,20 +55,19 @@
HANDLE newToken;
DuplicateTokenEx(token, 0, 0, SecurityImpersonation, TokenPrimary, &newToken);
- PSID pIntegritySid = 0;
- BOOL res = ConvertStringSidToSid(L"S-1-16-4096", &pIntegritySid);
- std::tr1::shared_ptr<SID> sharedIntegritySid(static_cast<SID*>(pIntegritySid), FreeSid); // Just to simplify cleanup
+ PSID integritySid = 0;
+ ConvertStringSidToSid(L"S-1-16-4096", &integritySid);
+ std::tr1::shared_ptr<SID> sharedIntegritySid(static_cast<SID*>(integritySid), FreeSid); // Just to simplify cleanup
- TOKEN_MANDATORY_LABEL tml = {0};
+ TOKEN_MANDATORY_LABEL tml = {};
tml.Label.Attributes = SE_GROUP_INTEGRITY;
- tml.Label.Sid = pIntegritySid;
+ tml.Label.Sid = integritySid;
// Set the process integrity level
- res = SetTokenInformation(newToken, TokenIntegrityLevel, &tml, sizeof(TOKEN_MANDATORY_LABEL) + GetLengthSid(pIntegritySid));
+ SetTokenInformation(newToken, TokenIntegrityLevel, &tml, sizeof(TOKEN_MANDATORY_LABEL) + GetLengthSid(integritySid));
STARTUPINFO startupInfo = {};
PROCESS_INFORMATION processInformation = {};
- BOOL createProcRes = 0;
createProcRes = CreateProcessAsUserW(newToken, engineExecutablePath.c_str(), params.GetBuffer(params.GetLength() + 1),
0, 0, false, 0, 0, 0, (STARTUPINFOW*)&startupInfo, &processInformation);
« no previous file with comments | « no previous file | src/shared/Communication.cpp » ('j') | src/shared/Communication.cpp » ('J')

Powered by Google App Engine
This is Rietveld