Index: src/shared/Utils.cpp |
=================================================================== |
--- a/src/shared/Utils.cpp |
+++ b/src/shared/Utils.cpp |
@@ -25,13 +25,27 @@ |
return osvi.dwMajorVersion >= 6; |
} |
-bool IsWindows8() |
+bool IsAppContainersSupported() |
{ |
- OSVERSIONINFOEX osvi; |
- ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); |
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); |
- GetVersionEx(reinterpret_cast<LPOSVERSIONINFO>(&osvi)); |
- return osvi.dwMajorVersion == 6 & osvi.dwMinorVersion >= 2; |
+ //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) |
Felix Dahlke
2014/06/24 15:30:39
I'd prefer !res here, but may just be me.
|
+ { |
+ return false; |
+ } |
+ else |
Felix Dahlke
2014/06/24 15:30:39
From the Mozilla coding style which ours is based
|
+ { |
+ FreeSid(allAppContainersSid); |
+ return true; |
+ } |
} |
std::string ToUtf8String(const std::wstring& str) |