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

Unified Diff: src/shared/Utils.cpp

Issue 5792731695677440: Fix named pipe security on Windows 7 (Closed)
Patch Set: Created May 13, 2014, 12:21 p.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
« src/shared/Communication.cpp ('K') | « src/shared/Utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/shared/Utils.cpp
===================================================================
--- a/src/shared/Utils.cpp
+++ b/src/shared/Utils.cpp
@@ -25,27 +25,13 @@
return osvi.dwMajorVersion >= 6;
}
-bool IsAppContainersSupported()
+bool IsWindows8OrLater()
Eric 2014/06/25 16:13:00 How about combining the duplicated code to get the
{
- //Try to allocate SID of AppContainer and see if it's succesful
- PSID allAppContainersSid = 0;
- SID_IDENTIFIER_AUTHORITY applicationAuthority = SECURITY_APP_PACKAGE_AUTHORITY;
- BOOL res = AllocateAndInitializeSid(&applicationAuthority,
- SECURITY_BUILTIN_APP_PACKAGE_RID_COUNT,
- SECURITY_APP_PACKAGE_BASE_RID,
- SECURITY_BUILTIN_PACKAGE_ANY_PACKAGE,
- 0, 0, 0, 0, 0, 0,
- &allAppContainersSid);
-
- if (res == FALSE)
- {
- return false;
- }
- else
- {
- FreeSid(allAppContainersSid);
- return true;
- }
+ OSVERSIONINFOEX osvi;
+ ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
+ GetVersionEx(reinterpret_cast<LPOSVERSIONINFO>(&osvi));
+ return osvi.dwMajorVersion >= 6 && osvi.dwMinorVersion >= 2;
Wladimir Palant 2014/05/15 07:36:18 So if dwMajorVersion is 7 and dwMinorVersion is 0
}
std::string ToUtf8String(const std::wstring& str)
« src/shared/Communication.cpp ('K') | « src/shared/Utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld