- const _TCHAR *str = i_path.c_str();\r
- const _TCHAR *b = _tcsrchr(str, _T('\\'));\r
- const _TCHAR *s = _tcsrchr(str, _T('/'));\r
- if (b && s)\r
- return tstring(str, MIN(b, s));\r
- if (b)\r
- return tstring(str, b);\r
- if (s)\r
- return tstring(str, s);\r
- if (const _TCHAR *c = _tcsrchr(str, _T(':')))\r
- return tstring(str, c + 1);\r
- return i_path;\r
+ const _TCHAR *str = i_path.c_str();\r
+ const _TCHAR *b = _tcsrchr(str, _T('\\'));\r
+ const _TCHAR *s = _tcsrchr(str, _T('/'));\r
+ if (b && s)\r
+ return tstring(str, MIN(b, s));\r
+ if (b)\r
+ return tstring(str, b);\r
+ if (s)\r
+ return tstring(str, s);\r
+ if (const _TCHAR *c = _tcsrchr(str, _T(':')))\r
+ return tstring(str, c + 1);\r
+ return i_path;\r
+}\r
+\r
+BOOL checkWindowsVersion(DWORD i_major, DWORD i_minor)\r
+{\r
+ DWORDLONG conditionMask = 0;\r
+ OSVERSIONINFOEX osvi;\r
+ memset(&osvi, 0, sizeof(OSVERSIONINFOEX));\r
+\r
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);\r
+ osvi.dwMajorVersion = i_major;\r
+ osvi.dwMinorVersion = i_minor;\r
+\r
+ VER_SET_CONDITION(conditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL);\r
+ VER_SET_CONDITION(conditionMask, VER_MINORVERSION, VER_GREATER_EQUAL);\r
+\r
+ // Perform the test.\r
+ return VerifyVersionInfo(&osvi, VER_MAJORVERSION | VER_MINORVERSION, conditionMask);\r