Subversion Repositories f9daq

Rev

Rev 17 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. //-------------------------------------------------------------------------------------------
  2. // os_info.c - request the OS type and version
  3. //
  4. // (c) 1999-2004 ARW Elektronik, Germany
  5. //
  6. // this source code is published under GPL (Open Source). You can use, redistrubute and
  7. // modify it unless this header  is  not modified or deleted. No warranty is given that
  8. // this software will work like expected.
  9. // This product is not authorized for use as critical component in life support systems
  10. // wihout the express written approval of ARW Elektronik Germany.
  11. //
  12. // Please announce changes and hints to ARW Elektronik
  13. //
  14. //
  15. // $Log: os_info.c,v $
  16. // Revision 1.2  2004/07/24 07:47:00  klaus
  17. // Update copyright to 2004
  18. //
  19. // Revision 1.1.1.1  2003/11/14 23:17:18  klaus
  20. // First put into repository
  21. //
  22. // Revision 1.2  2002/10/27 17:05:33  klaus
  23. // CVS log added, file addressing bug > 2 Gbtye circumvent
  24. //
  25. // what                                                              who    when
  26. // first steps                                                       AR     07.11.1999
  27. // small change in OS version recognition                            AR         21.05.2002
  28. //
  29.  
  30. //-------------------------------------------------------------------------------------------
  31. // INCLUDES
  32. //
  33. #include <windows.h>
  34.  
  35. //-------------------------------------------------------------------------------------------
  36. // DEFINES
  37. //
  38.  
  39. //-------------------------------------------------------------------------------------------
  40. // TYPEDEFS
  41. //
  42.  
  43. //-------------------------------------------------------------------------------------------
  44. // LOCALS
  45. //
  46.  
  47. //-------------------------------------------------------------------------------------------
  48. // EXTERNALS
  49. //
  50.  
  51. //-------------------------------------------------------------------------------------------
  52. // GLOBALS
  53. //
  54.  
  55. //-------------------------------------------------------------------------------------------
  56. // FUNCTIONS
  57. //
  58. BOOLEAN IsWindowsNT(void)
  59. {
  60.         OSVERSIONINFO osvi;
  61.  
  62.         osvi.dwOSVersionInfoSize = sizeof(osvi);
  63.         if (!GetVersionEx(&osvi)) return FALSE;  // can't get info
  64.  
  65.         if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT)
  66.         {
  67.                 return TRUE;
  68.         }
  69.         else
  70.                 return FALSE;
  71. }
  72.  
  73. BOOLEAN IsWindows95(void)
  74. {
  75.         OSVERSIONINFO osvi;
  76.  
  77.         osvi.dwOSVersionInfoSize = sizeof(osvi);
  78.         if (!GetVersionEx(&osvi)) return FALSE;  // can't get info
  79.  
  80.         if (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
  81.         {
  82.                 if ((osvi.dwMajorVersion == 4) && (osvi.dwMinorVersion == 0))
  83.                   return TRUE;
  84.                 else
  85.                   return FALSE;
  86.         }
  87.         else
  88.                 return FALSE;
  89. }
  90.  
  91. BOOLEAN IsWindows98(void)
  92. {
  93.         OSVERSIONINFO osvi;
  94.  
  95.         osvi.dwOSVersionInfoSize = sizeof(osvi);
  96.         if (!GetVersionEx(&osvi)) return FALSE;  // can't get info
  97.  
  98.         if (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
  99.         {
  100.                 if ((osvi.dwMajorVersion > 4) ||
  101.                         ((osvi.dwMajorVersion == 4) && (osvi.dwMinorVersion > 0)))
  102.                   return TRUE;
  103.                 else
  104.                   return FALSE;
  105.         }
  106.         else
  107.                 return FALSE;
  108. }
  109.  
  110. /*
  111. BOOLEAN IsWindowsBlaBla(void)
  112. {
  113.  
  114. }
  115. */
  116.  
  117.