⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dtwinver.h

📁 DtWinVer is a C++ class which provides a comprehensive method to determine which OS the program that
💻 H
📖 第 1 页 / 共 2 页
字号:
  BOOL IsWebWindowsServer2003R2(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsWindowsServer2003R2(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsStandardWindowsServer2003R2(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsEnterpriseWindowsServer2003R2(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsDatacenterWindowsServer2003R2(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsDomainControllerWindowsServer2003R2(LPOS_VERSION_INFO lpVersionInformation);

  BOOL IsHomeBasicInstalled(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsHomeBasicPremium(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsBusinessInstalled(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsEnterpriseInstalled(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsUltimateInstalled(LPOS_VERSION_INFO lpVersionInformation);

  BOOL IsWebWindowsServer2008(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsWindowsServer2008(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsStandardWindowsServer2008(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsEnterpriseWindowsServer2008(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsDatacenterWindowsServer2008(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsDomainControllerWindowsServer2008(LPOS_VERSION_INFO lpVersionInformation);

  BOOL IsTerminalServicesInstalled(LPOS_VERSION_INFO lpVersionInformation);
  BOOL ISSmallBusinessServerInstalled(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsEmulated64Bit(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsUnderlying64Bit(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsEmbedded(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsTerminalServicesInRemoteAdminMode(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsMediaCenterInstalled(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsTabletPCInstalled(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsStarterEditionInstalled(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsComputeClusterServerEditionInstalled(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsHomeServerEditionInstalled(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsSecurityApplianceInstalled(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsBackOfficeInstalled(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsNEditionInstalled(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsHyperVInstalled(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsServerCoreInstalled(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsUniprocessorFree(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsUniprocessorChecked(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsMultiprocessorFree(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsMultiprocessorChecked(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsEssentialBusinessServerManagement(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsEssentialBusinessServerMessaging(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsEssentialBusinessServerSecurity(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsClusterServerInstalled(LPOS_VERSION_INFO lpVersionInformation);
  BOOL ISSmallBusinessServerPremiumInstalled(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsStorageServerInstalled(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsEnterpriseStorageServerInstalled(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsExpressStorageServerInstalled(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsStandardStorageServerInstalled(LPOS_VERSION_INFO lpVersionInformation);
  BOOL IsWorkgroupStorageServerInstalled(LPOS_VERSION_INFO lpVersionInformation);

protected:
//Defines / typedefs
#if (defined(_WINDOWS) || defined(_DOS)) && (!defined(_WIN32) && !defined(_WIN64))  
  #define CPEX_DEST_STDCALL        0x00000000L
  #define HKEY32                   DWORD                                                               
  #define HKEY_LOCAL_MACHINE       (( HKEY32 ) 0x80000002 )    
  #define TCHAR                    char
  #define _T
  #define _tcsicmp                 strcmpi
  #define _tcscpy                  strcpy
  #define _tcslen                  strlen
  #define _istdigit                isdigit
  #define _ttoi                    atoi
  #define _tcsupr                  strupr
  #define _tcsstr                  strstr
  #define LPCTSTR                  LPCSTR
  #define ERROR_CALL_NOT_IMPLEMENTED  120
  #define REG_DWORD                ( 4 )                                                               
  #define REG_MULTI_SZ             ( 7 )
  #define VER_PLATFORM_WIN32s             0
  #define VER_PLATFORM_WIN32_WINDOWS      1
  #define VER_PLATFORM_WIN32_NT           2
  #define VER_PLATFORM_WIN32_CE           3
#endif                      
                      
#if defined(_WINDOWS) && !defined(_WIN32) && !defined(_WIN64)  
//Defines / Macros
  #define LPTSTR LPSTR

  typedef struct OSVERSIONINFO
  { 
    DWORD dwOSVersionInfoSize; 
    DWORD dwMajorVersion; 
    DWORD dwMinorVersion; 
    DWORD dwBuildNumber; 
    DWORD dwPlatformId; 
    char szCSDVersion[128]; 
  } OSVERSIONINFO, *POSVERSIONINFO, FAR *LPOSVERSIONINFO; 

  typedef struct _SYSTEM_INFO 
  {
    union 
    {
      DWORD dwOemId;          // Obsolete field...do not use
      struct 
      {
        WORD wProcessorArchitecture;
        WORD wReserved;
      };
    };
    DWORD dwPageSize;
    LPVOID lpMinimumApplicationAddress;
    LPVOID lpMaximumApplicationAddress;
    DWORD dwActiveProcessorMask;
    DWORD dwNumberOfProcessors;
    DWORD dwProcessorType;
    DWORD dwAllocationGranularity;
    WORD wProcessorLevel;
    WORD wProcessorRevision;
  } SYSTEM_INFO, *LPSYSTEM_INFO;

  #define PROCESSOR_ARCHITECTURE_INTEL            0
  #define PROCESSOR_ARCHITECTURE_MIPS             1
  #define PROCESSOR_ARCHITECTURE_ALPHA            2
  #define PROCESSOR_ARCHITECTURE_PPC              3
  #define PROCESSOR_ARCHITECTURE_SHX              4
  #define PROCESSOR_ARCHITECTURE_ARM              5
  #define PROCESSOR_ARCHITECTURE_IA64             6
  #define PROCESSOR_ARCHITECTURE_ALPHA64          7
  #define PROCESSOR_ARCHITECTURE_MSIL             8
  #define PROCESSOR_ARCHITECTURE_AMD64            9
  #define PROCESSOR_ARCHITECTURE_IA32_ON_WIN64    10
  #define PROCESSOR_ARCHITECTURE_UNKNOWN          0xFFFF
  
//Methods
  DWORD GetVersion();
  BOOL GetVersionEx(LPOSVERSIONINFO lpVersionInfo);
  void GetProcessorType(LPOS_VERSION_INFO lpVersionInformation);
  LONG RegQueryValueEx(HKEY32 hKey, LPSTR  lpszValueName, LPDWORD lpdwReserved, LPDWORD lpdwType, LPBYTE  lpbData, LPDWORD lpcbData);
  static BOOL WFWLoaded();                                     

//Function Prototypes
  typedef DWORD (FAR PASCAL  *lpfnLoadLibraryEx32W) (LPCSTR, DWORD, DWORD);
  typedef BOOL  (FAR PASCAL  *lpfnFreeLibrary32W)   (DWORD);
  typedef DWORD (FAR PASCAL  *lpfnGetProcAddress32W)(DWORD, LPCSTR);
  typedef DWORD (FAR __cdecl *lpfnCallProcEx32W)    (DWORD, DWORD, DWORD, DWORD, ...);
  typedef WORD  (FAR PASCAL  *lpfnWNetGetCaps)      (WORD);
  typedef BOOL  (FAR PASCAL  *lpfnGetProductInfo)   (DWORD, DWORD, DWORD, DWORD, PDWORD);

//Member variables
  lpfnLoadLibraryEx32W  m_lpfnLoadLibraryEx32W;
  lpfnFreeLibrary32W    m_lpfnFreeLibrary32W;
  lpfnGetProcAddress32W m_lpfnGetProcAddress32W;
  lpfnCallProcEx32W     m_lpfnCallProcEx32W;
  DWORD                 m_hAdvApi32;    
  DWORD                 m_hKernel32;
  DWORD                 m_lpfnRegQueryValueExA;
  DWORD                 m_lpfnGetVersionExA;
  DWORD                 m_lpfnGetVersion;
  DWORD                 m_lpfnGetSystemInfo;
  DWORD                 m_lpfnGetNativeSystemInfo;
  DWORD                 m_lpfnGetProductInfo;
#endif //defined(_WINDOWS) && (!defined(_WIN32) && !defined(_WIN64))

#ifdef _WIN32
//Function Prototypes
  typedef BOOL (WINAPI *lpfnIsWow64Process)(HANDLE, PBOOL);  
  typedef void (WINAPI *lpfnGetNativeSystemInfo)(LPSYSTEM_INFO);
  typedef BOOL (WINAPI *lpfnGetProductInfo)(DWORD, DWORD, DWORD, DWORD, DWORD*);
#endif

#if defined(_WIN32) || defined(_WINDOWS)
//Defines / Macros
  typedef struct OSVERSIONINFOEX 
  {  
    DWORD dwOSVersionInfoSize;  
    DWORD dwMajorVersion;  
    DWORD dwMinorVersion;  
    DWORD dwBuildNumber;  
    DWORD dwPlatformId;  
    TCHAR szCSDVersion[128];  
    WORD wServicePackMajor;  
    WORD wServicePackMinor;  
    WORD wSuiteMask;  
    BYTE wProductType;  
    BYTE wReserved;
  } OSVERSIONINFOEX, *POSVERSIONINFOEX, *LPOSVERSIONINFOEX;
                  
//Function Prototypes                  
  typedef BOOL (WINAPI *lpfnGetVersionEx) (LPOSVERSIONINFO);  
#endif  

#ifndef _DOS         
//Methods
  void GetNTOSTypeFromRegistry(LPOS_VERSION_INFO lpVersionInformation, BOOL bOnlyUpdateDCDetails);
  void GetProductSuiteDetailsFromRegistry(LPOS_VERSION_INFO lpVersionInformation) ;
  void GetTerminalServicesRemoteAdminModeDetailsFromRegistry(LPOS_VERSION_INFO lpVersionInformation);
  void GetMediaCenterDetails(LPOS_VERSION_INFO lpVersionInformation);
  void GetProductInfo(LPOS_VERSION_INFO lpVersionInformation);
  void GetTabletPCDetails(LPOS_VERSION_INFO lpVersionInformation);
  void GetStarterEditionDetails(LPOS_VERSION_INFO lpVersionInformation);
  void GetR2Details(LPOS_VERSION_INFO lpVersionInformation);
  void GetNTSP6aDetailsFromRegistry(LPOS_VERSION_INFO lpVersionInformation, BOOL bUpdateEmulatedAlso);
  void GetXPSP1aDetailsFromRegistry(LPOS_VERSION_INFO lpVersionInformation, BOOL bUpdateEmulatedAlso);
  void GetNTHALDetailsFromRegistry(LPOS_VERSION_INFO lpVersionInformation);
#else
  BOOL GetInfoBySpawingWriteVer(COSVersion::LPOS_VERSION_INFO lpVersionInformation);
  void GetWinInfo();
#endif

#if defined(_WIN32) || defined(_WIN64)
  WORD GetNTServicePackFromRegistry();
#endif    
  WORD GetNTServicePackFromCSDString(LPCTSTR pszCSDVersion);
};

#endif //__DTWINVER_H__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -