From a0ca51b5683b464d759c6398c1a72211e4976871 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Thu, 19 Sep 2019 20:24:09 +0200 Subject: added TestDLL suitable for manual mapping and integration test skeleton --- IntegrationTest/IntegrationTest.cpp | 21 +++ IntegrationTest/IntegrationTest.vcxproj | 172 ++++++++++++++++++++++++ IntegrationTest/IntegrationTest.vcxproj.filters | 30 +++++ IntegrationTest/pch.cpp | 5 + IntegrationTest/pch.h | 14 ++ KMemDriver.sln | 20 +++ TestDLL/TestDLL.cpp | 6 + TestDLL/TestDLL.vcxproj | 171 +++++++++++++++++++++++ TestDLL/TestDLL.vcxproj.filters | 36 +++++ TestDLL/dllmain.cpp | 23 ++++ TestDLL/stdafx.cpp | 1 + TestDLL/stdafx.h | 16 +++ TestDLL/targetver.h | 8 ++ 13 files changed, 523 insertions(+) create mode 100644 IntegrationTest/IntegrationTest.cpp create mode 100644 IntegrationTest/IntegrationTest.vcxproj create mode 100644 IntegrationTest/IntegrationTest.vcxproj.filters create mode 100644 IntegrationTest/pch.cpp create mode 100644 IntegrationTest/pch.h create mode 100644 TestDLL/TestDLL.cpp create mode 100644 TestDLL/TestDLL.vcxproj create mode 100644 TestDLL/TestDLL.vcxproj.filters create mode 100644 TestDLL/dllmain.cpp create mode 100644 TestDLL/stdafx.cpp create mode 100644 TestDLL/stdafx.h create mode 100644 TestDLL/targetver.h diff --git a/IntegrationTest/IntegrationTest.cpp b/IntegrationTest/IntegrationTest.cpp new file mode 100644 index 0000000..bbec9da --- /dev/null +++ b/IntegrationTest/IntegrationTest.cpp @@ -0,0 +1,21 @@ +// IntegrationTest.cpp : This file contains the 'main' function. Program execution begins and ends there. +// + +#include "pch.h" +#include + +int main() +{ + std::cout << "Hello World!\n"; +} + +// Run program: Ctrl + F5 or Debug > Start Without Debugging menu +// Debug program: F5 or Debug > Start Debugging menu + +// Tips for Getting Started: +// 1. Use the Solution Explorer window to add/manage files +// 2. Use the Team Explorer window to connect to source control +// 3. Use the Output window to see build output and other messages +// 4. Use the Error List window to view errors +// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project +// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file diff --git a/IntegrationTest/IntegrationTest.vcxproj b/IntegrationTest/IntegrationTest.vcxproj new file mode 100644 index 0000000..ef706b2 --- /dev/null +++ b/IntegrationTest/IntegrationTest.vcxproj @@ -0,0 +1,172 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {AD4E6887-32BA-4CC9-924C-18F0ECAFB576} + Win32Proj + IntegrationTest + 10.0.17763.0 + + + + Application + true + v141 + Unicode + + + Application + false + v141 + true + Unicode + + + Application + true + v141 + Unicode + false + + + Application + false + v141 + true + Unicode + false + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + Use + Level3 + Disabled + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h + + + Console + true + $(VCToolsInstallDir)lib\x64;$(OutputPath);%(AdditionalLibraryDirectories) + + + + + Use + Level3 + Disabled + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h + + + Console + true + + + + + Use + Level3 + MaxSpeed + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h + + + Console + true + true + true + + + + + Use + Level3 + MaxSpeed + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h + + + Console + true + true + true + $(VCToolsInstallDir)lib\x64;$(OutputPath);%(AdditionalLibraryDirectories) + + + + + + + + + Create + Create + Create + Create + + + + + + \ No newline at end of file diff --git a/IntegrationTest/IntegrationTest.vcxproj.filters b/IntegrationTest/IntegrationTest.vcxproj.filters new file mode 100644 index 0000000..a983fc3 --- /dev/null +++ b/IntegrationTest/IntegrationTest.vcxproj.filters @@ -0,0 +1,30 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/IntegrationTest/pch.cpp b/IntegrationTest/pch.cpp new file mode 100644 index 0000000..3a3d12b --- /dev/null +++ b/IntegrationTest/pch.cpp @@ -0,0 +1,5 @@ +// pch.cpp: source file corresponding to pre-compiled header; necessary for compilation to succeed + +#include "pch.h" + +// In general, ignore this file, but keep it around if you are using pre-compiled headers. diff --git a/IntegrationTest/pch.h b/IntegrationTest/pch.h new file mode 100644 index 0000000..b04e71e --- /dev/null +++ b/IntegrationTest/pch.h @@ -0,0 +1,14 @@ +// Tips for Getting Started: +// 1. Use the Solution Explorer window to add/manage files +// 2. Use the Team Explorer window to connect to source control +// 3. Use the Output window to see build output and other messages +// 4. Use the Error List window to view errors +// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project +// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file + +#ifndef PCH_H +#define PCH_H + +// TODO: add headers that you want to pre-compile here + +#endif //PCH_H diff --git a/KMemDriver.sln b/KMemDriver.sln index 576ad4f..64a9036 100644 --- a/KMemDriver.sln +++ b/KMemDriver.sln @@ -18,6 +18,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CSGO", "CSGO\CSGO.vcxproj", EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CMD", "CMD\CMD.vcxproj", "{231929F8-2FBF-45D9-91B8-AD835ED166A6}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestDLL", "TestDLL\TestDLL.vcxproj", "{E27E6F2C-154E-46AF-BED4-78D50C751565}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IntegrationTest", "IntegrationTest\IntegrationTest.vcxproj", "{AD4E6887-32BA-4CC9-924C-18F0ECAFB576}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -78,6 +82,22 @@ Global {231929F8-2FBF-45D9-91B8-AD835ED166A6}.Release|x64.Build.0 = Release|x64 {231929F8-2FBF-45D9-91B8-AD835ED166A6}.Release|x86.ActiveCfg = Release|Win32 {231929F8-2FBF-45D9-91B8-AD835ED166A6}.Release|x86.Build.0 = Release|Win32 + {E27E6F2C-154E-46AF-BED4-78D50C751565}.Debug|x64.ActiveCfg = Debug|x64 + {E27E6F2C-154E-46AF-BED4-78D50C751565}.Debug|x64.Build.0 = Debug|x64 + {E27E6F2C-154E-46AF-BED4-78D50C751565}.Debug|x86.ActiveCfg = Debug|Win32 + {E27E6F2C-154E-46AF-BED4-78D50C751565}.Debug|x86.Build.0 = Debug|Win32 + {E27E6F2C-154E-46AF-BED4-78D50C751565}.Release|x64.ActiveCfg = Release|x64 + {E27E6F2C-154E-46AF-BED4-78D50C751565}.Release|x64.Build.0 = Release|x64 + {E27E6F2C-154E-46AF-BED4-78D50C751565}.Release|x86.ActiveCfg = Release|Win32 + {E27E6F2C-154E-46AF-BED4-78D50C751565}.Release|x86.Build.0 = Release|Win32 + {AD4E6887-32BA-4CC9-924C-18F0ECAFB576}.Debug|x64.ActiveCfg = Debug|x64 + {AD4E6887-32BA-4CC9-924C-18F0ECAFB576}.Debug|x64.Build.0 = Debug|x64 + {AD4E6887-32BA-4CC9-924C-18F0ECAFB576}.Debug|x86.ActiveCfg = Debug|Win32 + {AD4E6887-32BA-4CC9-924C-18F0ECAFB576}.Debug|x86.Build.0 = Debug|Win32 + {AD4E6887-32BA-4CC9-924C-18F0ECAFB576}.Release|x64.ActiveCfg = Release|x64 + {AD4E6887-32BA-4CC9-924C-18F0ECAFB576}.Release|x64.Build.0 = Release|x64 + {AD4E6887-32BA-4CC9-924C-18F0ECAFB576}.Release|x86.ActiveCfg = Release|Win32 + {AD4E6887-32BA-4CC9-924C-18F0ECAFB576}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/TestDLL/TestDLL.cpp b/TestDLL/TestDLL.cpp new file mode 100644 index 0000000..a3aa76f --- /dev/null +++ b/TestDLL/TestDLL.cpp @@ -0,0 +1,6 @@ +// TestDLL.cpp : Defines the exported functions for the DLL application. +// + +#include "stdafx.h" + + diff --git a/TestDLL/TestDLL.vcxproj b/TestDLL/TestDLL.vcxproj new file mode 100644 index 0000000..0dc46b5 --- /dev/null +++ b/TestDLL/TestDLL.vcxproj @@ -0,0 +1,171 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {E27E6F2C-154E-46AF-BED4-78D50C751565} + Win32Proj + TestDLL + 10.0.17763.0 + + + + DynamicLibrary + true + v141 + Unicode + + + DynamicLibrary + false + v141 + true + Unicode + + + DynamicLibrary + true + v141 + Unicode + false + + + DynamicLibrary + false + v141 + true + Unicode + false + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + Use + Level3 + Disabled + true + _DEBUG;TESTDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + MultiThreadedDLL + + + Windows + true + $(VCToolsInstallDir)lib\x64;$(OutputPath);%(AdditionalLibraryDirectories) + + + + + Use + Level3 + Disabled + true + WIN32;_DEBUG;TESTDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + Use + Level3 + MaxSpeed + true + true + true + WIN32;NDEBUG;TESTDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + Use + Level3 + MaxSpeed + true + true + true + NDEBUG;TESTDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + $(VCToolsInstallDir)lib\x64;$(OutputPath);%(AdditionalLibraryDirectories) + + + + + + + + + + Create + Create + Create + Create + + + + + + + \ No newline at end of file diff --git a/TestDLL/TestDLL.vcxproj.filters b/TestDLL/TestDLL.vcxproj.filters new file mode 100644 index 0000000..a11e11a --- /dev/null +++ b/TestDLL/TestDLL.vcxproj.filters @@ -0,0 +1,36 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/TestDLL/dllmain.cpp b/TestDLL/dllmain.cpp new file mode 100644 index 0000000..6d84f90 --- /dev/null +++ b/TestDLL/dllmain.cpp @@ -0,0 +1,23 @@ +// dllmain.cpp : Defines the entry point for the DLL application. +#include "stdafx.h" + +BOOL APIENTRY DllMain(HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved +) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + + return MessageBoxA(NULL, + "DllMain from TestDLL", + "TestDLL Notification", + MB_OK | MB_ICONINFORMATION) == IDOK ? TRUE : FALSE; +} + diff --git a/TestDLL/stdafx.cpp b/TestDLL/stdafx.cpp new file mode 100644 index 0000000..fd4f341 --- /dev/null +++ b/TestDLL/stdafx.cpp @@ -0,0 +1 @@ +#include "stdafx.h" diff --git a/TestDLL/stdafx.h b/TestDLL/stdafx.h new file mode 100644 index 0000000..f380517 --- /dev/null +++ b/TestDLL/stdafx.h @@ -0,0 +1,16 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files +#include + + + +// reference additional headers your program requires here diff --git a/TestDLL/targetver.h b/TestDLL/targetver.h new file mode 100644 index 0000000..87c0086 --- /dev/null +++ b/TestDLL/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +#include -- cgit v1.2.3