Skip to content
This repository was archived by the owner on Jan 27, 2022. It is now read-only.

Commit 2c030a8

Browse files
authored
Added visual studio project for compiling the dll
1 parent 35b89d0 commit 2c030a8

File tree

17 files changed

+1837
-0
lines changed

17 files changed

+1837
-0
lines changed

dll/blade_dll/blade_dll.cpp

Lines changed: 402 additions & 0 deletions
Large diffs are not rendered by default.

dll/blade_dll/blade_dll.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// The following ifdef block is the standard way of creating macros which make exporting
2+
// from a DLL simpler. All files within this DLL are compiled with the BLADEDLL_EXPORTS
3+
// symbol defined on the command line. This symbol should not be defined on any project
4+
// that uses this DLL. This way any other project whose source files include this file see
5+
// BLADEDLL_API functions as being imported from a DLL, whereas this DLL sees symbols
6+
// defined with this macro as being exported.
7+
#ifdef BLADEDLL_EXPORTS
8+
#define BLADEDLL_API __declspec(dllexport)
9+
#else
10+
#define BLADEDLL_API __declspec(dllimport)
11+
#endif
12+
13+
extern "C" {
14+
BLADEDLL_API void init_blade_dll(UINT16, UINT16);
15+
BLADEDLL_API void set_keyboard_color(UINT8, UINT8, UINT8);
16+
BLADEDLL_API void set_keyboard_brightness(UINT8);
17+
BLADEDLL_API void set_keyboard_mode(UINT8);
18+
BLADEDLL_API void set_effect_speed(UINT8);
19+
}
20+

dll/blade_dll/blade_dll.vcxproj

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|Win32">
9+
<Configuration>Release</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Debug|x64">
13+
<Configuration>Debug</Configuration>
14+
<Platform>x64</Platform>
15+
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|x64">
17+
<Configuration>Release</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
20+
</ItemGroup>
21+
<PropertyGroup Label="Globals">
22+
<VCProjectVersion>16.0</VCProjectVersion>
23+
<ProjectGuid>{A260166E-BD29-44E3-AD94-6D95C1458612}</ProjectGuid>
24+
<Keyword>Win32Proj</Keyword>
25+
<RootNamespace>bladedll</RootNamespace>
26+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
27+
</PropertyGroup>
28+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
29+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
30+
<ConfigurationType>DynamicLibrary</ConfigurationType>
31+
<UseDebugLibraries>true</UseDebugLibraries>
32+
<PlatformToolset>v142</PlatformToolset>
33+
<CharacterSet>NotSet</CharacterSet>
34+
</PropertyGroup>
35+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
36+
<ConfigurationType>DynamicLibrary</ConfigurationType>
37+
<UseDebugLibraries>false</UseDebugLibraries>
38+
<PlatformToolset>v142</PlatformToolset>
39+
<WholeProgramOptimization>true</WholeProgramOptimization>
40+
<CharacterSet>NotSet</CharacterSet>
41+
</PropertyGroup>
42+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
43+
<ConfigurationType>DynamicLibrary</ConfigurationType>
44+
<UseDebugLibraries>true</UseDebugLibraries>
45+
<PlatformToolset>v142</PlatformToolset>
46+
<CharacterSet>Unicode</CharacterSet>
47+
</PropertyGroup>
48+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
49+
<ConfigurationType>DynamicLibrary</ConfigurationType>
50+
<UseDebugLibraries>false</UseDebugLibraries>
51+
<PlatformToolset>v142</PlatformToolset>
52+
<WholeProgramOptimization>true</WholeProgramOptimization>
53+
<CharacterSet>Unicode</CharacterSet>
54+
</PropertyGroup>
55+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
56+
<ImportGroup Label="ExtensionSettings">
57+
</ImportGroup>
58+
<ImportGroup Label="Shared">
59+
</ImportGroup>
60+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
61+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
62+
</ImportGroup>
63+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
64+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
65+
</ImportGroup>
66+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
67+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
68+
</ImportGroup>
69+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
70+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
71+
</ImportGroup>
72+
<PropertyGroup Label="UserMacros" />
73+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
74+
<TargetName>BLADEDLL</TargetName>
75+
<LinkIncremental>true</LinkIncremental>
76+
</PropertyGroup>
77+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
78+
<TargetName>BLADEDLL</TargetName>
79+
<LinkIncremental>true</LinkIncremental>
80+
</PropertyGroup>
81+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
82+
<TargetName>BLADEDLL</TargetName>
83+
<LinkIncremental>false</LinkIncremental>
84+
</PropertyGroup>
85+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
86+
<TargetName>BLADEDLL</TargetName>
87+
<LinkIncremental>false</LinkIncremental>
88+
</PropertyGroup>
89+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
90+
<ClCompile>
91+
<PrecompiledHeader>Use</PrecompiledHeader>
92+
<WarningLevel>Level3</WarningLevel>
93+
<Optimization>Disabled</Optimization>
94+
<SDLCheck>true</SDLCheck>
95+
<PreprocessorDefinitions>WIN32;_DEBUG;BLADEDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
96+
<ConformanceMode>false</ConformanceMode>
97+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
98+
</ClCompile>
99+
<Link>
100+
<SubSystem>Windows</SubSystem>
101+
<GenerateDebugInformation>true</GenerateDebugInformation>
102+
<EnableUAC>false</EnableUAC>
103+
</Link>
104+
</ItemDefinitionGroup>
105+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
106+
<ClCompile>
107+
<PrecompiledHeader>Use</PrecompiledHeader>
108+
<WarningLevel>Level3</WarningLevel>
109+
<Optimization>Disabled</Optimization>
110+
<SDLCheck>true</SDLCheck>
111+
<PreprocessorDefinitions>_DEBUG;BLADEDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
112+
<ConformanceMode>true</ConformanceMode>
113+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
114+
</ClCompile>
115+
<Link>
116+
<SubSystem>Windows</SubSystem>
117+
<GenerateDebugInformation>true</GenerateDebugInformation>
118+
<EnableUAC>false</EnableUAC>
119+
</Link>
120+
</ItemDefinitionGroup>
121+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
122+
<ClCompile>
123+
<PrecompiledHeader>Use</PrecompiledHeader>
124+
<WarningLevel>Level3</WarningLevel>
125+
<Optimization>MaxSpeed</Optimization>
126+
<FunctionLevelLinking>true</FunctionLevelLinking>
127+
<IntrinsicFunctions>true</IntrinsicFunctions>
128+
<SDLCheck>true</SDLCheck>
129+
<PreprocessorDefinitions>WIN32;NDEBUG;BLADEDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
130+
<ConformanceMode>false</ConformanceMode>
131+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
132+
</ClCompile>
133+
<Link>
134+
<SubSystem>Windows</SubSystem>
135+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
136+
<OptimizeReferences>true</OptimizeReferences>
137+
<GenerateDebugInformation>true</GenerateDebugInformation>
138+
<EnableUAC>false</EnableUAC>
139+
</Link>
140+
</ItemDefinitionGroup>
141+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
142+
<ClCompile>
143+
<PrecompiledHeader>Use</PrecompiledHeader>
144+
<WarningLevel>Level3</WarningLevel>
145+
<Optimization>MaxSpeed</Optimization>
146+
<FunctionLevelLinking>true</FunctionLevelLinking>
147+
<IntrinsicFunctions>true</IntrinsicFunctions>
148+
<SDLCheck>true</SDLCheck>
149+
<PreprocessorDefinitions>NDEBUG;BLADEDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
150+
<ConformanceMode>true</ConformanceMode>
151+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
152+
</ClCompile>
153+
<Link>
154+
<SubSystem>Windows</SubSystem>
155+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
156+
<OptimizeReferences>true</OptimizeReferences>
157+
<GenerateDebugInformation>true</GenerateDebugInformation>
158+
<EnableUAC>false</EnableUAC>
159+
</Link>
160+
</ItemDefinitionGroup>
161+
<ItemGroup>
162+
<None Include="cpp.hint" />
163+
</ItemGroup>
164+
<ItemGroup>
165+
<ClInclude Include="blade_dll.h" />
166+
<ClInclude Include="framework.h" />
167+
<ClInclude Include="pch.h" />
168+
</ItemGroup>
169+
<ItemGroup>
170+
<ClCompile Include="blade_dll.cpp" />
171+
<ClCompile Include="dllmain.cpp" />
172+
<ClCompile Include="pch.cpp">
173+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
174+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
175+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
176+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
177+
</ClCompile>
178+
</ItemGroup>
179+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
180+
<ImportGroup Label="ExtensionTargets">
181+
</ImportGroup>
182+
</Project>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="Source Files">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="Header Files">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
11+
</Filter>
12+
<Filter Include="Resource Files">
13+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15+
</Filter>
16+
</ItemGroup>
17+
<ItemGroup>
18+
<None Include="cpp.hint" />
19+
</ItemGroup>
20+
<ItemGroup>
21+
<ClInclude Include="framework.h">
22+
<Filter>Header Files</Filter>
23+
</ClInclude>
24+
<ClInclude Include="blade_dll.h">
25+
<Filter>Header Files</Filter>
26+
</ClInclude>
27+
<ClInclude Include="pch.h">
28+
<Filter>Header Files</Filter>
29+
</ClInclude>
30+
</ItemGroup>
31+
<ItemGroup>
32+
<ClCompile Include="blade_dll.cpp">
33+
<Filter>Source Files</Filter>
34+
</ClCompile>
35+
<ClCompile Include="dllmain.cpp">
36+
<Filter>Source Files</Filter>
37+
</ClCompile>
38+
<ClCompile Include="pch.cpp">
39+
<Filter>Source Files</Filter>
40+
</ClCompile>
41+
</ItemGroup>
42+
</Project>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup />
4+
</Project>

dll/blade_dll/dllmain.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// dllmain.cpp : Defines the entry point for the DLL application.
2+
#include "pch.h"
3+
4+
5+
6+
BOOL APIENTRY DllMain( HMODULE hModule,
7+
DWORD ul_reason_for_call,
8+
LPVOID lpReserved
9+
)
10+
{
11+
switch (ul_reason_for_call)
12+
{
13+
case DLL_PROCESS_ATTACH:
14+
case DLL_THREAD_ATTACH:
15+
case DLL_THREAD_DETACH:
16+
case DLL_PROCESS_DETACH:
17+
break;
18+
}
19+
return TRUE;
20+
}
21+

dll/blade_dll/framework.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#pragma once
2+
3+
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
4+
// Windows Header Files
5+
#include <windows.h>

dll/blade_dll/pch.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// pch.cpp: source file corresponding to the pre-compiled header
2+
3+
#include "pch.h"
4+
5+
// When you are using pre-compiled headers, this source file is necessary for compilation to succeed.

dll/blade_dll/pch.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// pch.h: This is a precompiled header file.
2+
// Files listed below are compiled only once, improving build performance for future builds.
3+
// This also affects IntelliSense performance, including code completion and many code browsing features.
4+
// However, files listed here are ALL re-compiled if any one of them is updated between builds.
5+
// Do not add files here that you will be updating frequently as this negates the performance advantage.
6+
7+
#ifndef PCH_H
8+
#define PCH_H
9+
10+
// add headers that you want to pre-compile here
11+
#include "framework.h"
12+
13+
#endif //PCH_H

dll/lib/dmi.h

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#ifndef DMI_H_
2+
#define DMI_H_
3+
4+
enum dmi_field {
5+
DMI_NONE,
6+
DMI_BIOS_VENDOR,
7+
DMI_BIOS_VERSION,
8+
DMI_BIOS_DATE,
9+
DMI_SYS_VENDOR,
10+
DMI_PRODUCT_NAME,
11+
DMI_PRODUCT_VERSION,
12+
DMI_PRODUCT_SERIAL,
13+
DMI_PRODUCT_UUID,
14+
DMI_BOARD_VENDOR,
15+
DMI_BOARD_NAME,
16+
DMI_BOARD_VERSION,
17+
DMI_BOARD_SERIAL,
18+
DMI_BOARD_ASSET_TAG,
19+
DMI_CHASSIS_VENDOR,
20+
DMI_CHASSIS_TYPE,
21+
DMI_CHASSIS_VERSION,
22+
DMI_CHASSIS_SERIAL,
23+
DMI_CHASSIS_ASSET_TAG,
24+
DMI_STRING_MAX,
25+
};
26+
27+
static inline char* dmi_get_system_info(int x) {
28+
return "BLADESERIAL";
29+
}
30+
31+
#endif /* DMI_H_ */

0 commit comments

Comments
 (0)