選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

OSVersion.cxx 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* Copyright (C) 2002-2003 RealVNC Ltd. All Rights Reserved.
  2. *
  3. * This is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation; either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This software is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this software; if not, write to the Free Software
  15. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  16. * USA.
  17. */
  18. // -=- OSVersion.cxx
  19. #include <rfb_win32/OSVersion.h>
  20. #include <rdr/Exception.h>
  21. #include <tchar.h>
  22. using namespace rfb;
  23. using namespace win32;
  24. OSVersionInfo::OSVersionInfo() {
  25. // Get OS Version Info
  26. ZeroMemory(static_cast<OSVERSIONINFO*>(this), sizeof(this));
  27. dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  28. if (!GetVersionEx(this))
  29. throw rdr::SystemException("unable to get system version info", GetLastError());
  30. // Set the special extra flags
  31. isPlatformNT = dwPlatformId == VER_PLATFORM_WIN32_NT;
  32. isPlatformWindows = dwPlatformId == VER_PLATFORM_WIN32_WINDOWS;
  33. cannotSwitchDesktop = isPlatformNT && (dwMajorVersion==4) &&
  34. ((_tcscmp(szCSDVersion, _T("")) == 0) ||
  35. (_tcscmp(szCSDVersion, _T("Service Pack 1")) == 0) ||
  36. (_tcscmp(szCSDVersion, _T("Service Pack 2")) == 0));
  37. }
  38. OSVersionInfo rfb::win32::osVersion;