Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/apps/mplayerc/WinVersionCheck.cpp')
-rw-r--r--src/apps/mplayerc/WinVersionCheck.cpp77
1 files changed, 77 insertions, 0 deletions
diff --git a/src/apps/mplayerc/WinVersionCheck.cpp b/src/apps/mplayerc/WinVersionCheck.cpp
new file mode 100644
index 000000000..c6465e1f8
--- /dev/null
+++ b/src/apps/mplayerc/WinVersionCheck.cpp
@@ -0,0 +1,77 @@
+/*
+ * $Id$
+ *
+ * (C) 2011 see AUTHORS
+ *
+ * This file is part of mpc-hc.
+ *
+ * Mplayerc is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Mplayerc is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "stdafx.h"
+
+#include "WinVersionCheck.h"
+
+BOOL IsWinXPOrLater()
+{
+ OSVERSIONINFOEX osvi = {0};
+ DWORDLONG dwlConditionMask = 0;
+
+ // Initialize the OSVERSIONINFOEX structure.
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
+ osvi.dwMajorVersion = 5;
+ osvi.dwMinorVersion = 1;
+
+ // Initialize the condition mask.
+ VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL);
+ VER_SET_CONDITION(dwlConditionMask, VER_MINORVERSION, VER_GREATER_EQUAL);
+
+ // Perform the test.
+
+ return VerifyVersionInfo(&osvi, VER_MAJORVERSION|VER_MINORVERSION, dwlConditionMask);
+}
+
+BOOL IsWinVistaOrLater()
+{
+ OSVERSIONINFOEX osvi = {0};
+ DWORDLONG dwlConditionMask = 0;
+
+ // Initialize the OSVERSIONINFOEX structure.
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
+ osvi.dwMajorVersion = 6;
+
+ // Initialize the condition mask.
+ VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL);
+
+ // Perform the test.
+ return VerifyVersionInfo(&osvi, VER_MAJORVERSION, dwlConditionMask);
+}
+
+BOOL IsWinSeven()
+{
+ OSVERSIONINFOEX osvi = {0};
+ DWORDLONG dwlConditionMask = 0;
+
+ // Initialize the OSVERSIONINFOEX structure.
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
+ osvi.dwMajorVersion = 6;
+ osvi.dwMinorVersion = 1;
+
+ // Initialize the condition mask.
+ VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION|VER_MINORVERSION, VER_EQUAL);
+
+ // Perform the test.
+ return VerifyVersionInfo(&osvi, VER_MAJORVERSION|VER_MINORVERSION, dwlConditionMask);
+} \ No newline at end of file