Skip to content

Commit 4b44b02

Browse files
authored
DriverLoader
1 parent 8cf455e commit 4b44b02

23 files changed

+816
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 11.00
3+
# Visual Studio 2010
4+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DriverLoader", "DriverLoader\DriverLoader.vcxproj", "{40354AA5-CA42-4D84-B2A6-12DF6BA1E25F}"
5+
EndProject
6+
Global
7+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8+
Debug|Win32 = Debug|Win32
9+
Release|Win32 = Release|Win32
10+
EndGlobalSection
11+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
12+
{40354AA5-CA42-4D84-B2A6-12DF6BA1E25F}.Debug|Win32.ActiveCfg = Debug|Win32
13+
{40354AA5-CA42-4D84-B2A6-12DF6BA1E25F}.Debug|Win32.Build.0 = Debug|Win32
14+
{40354AA5-CA42-4D84-B2A6-12DF6BA1E25F}.Release|Win32.ActiveCfg = Release|Win32
15+
{40354AA5-CA42-4D84-B2A6-12DF6BA1E25F}.Release|Win32.Build.0 = Release|Win32
16+
EndGlobalSection
17+
GlobalSection(SolutionProperties) = preSolution
18+
HideSolutionNode = FALSE
19+
EndGlobalSection
20+
EndGlobal
Binary file not shown.
Binary file not shown.
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
2+
// DriverLoader.cpp : 定义应用程序的类行为。
3+
//
4+
5+
#include "stdafx.h"
6+
#include "DriverLoader.h"
7+
#include "DriverLoaderDlg.h"
8+
9+
#ifdef _DEBUG
10+
#define new DEBUG_NEW
11+
#endif
12+
13+
14+
// CDriverLoaderApp
15+
16+
BEGIN_MESSAGE_MAP(CDriverLoaderApp, CWinApp)
17+
ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
18+
END_MESSAGE_MAP()
19+
20+
21+
// CDriverLoaderApp 构造
22+
23+
CDriverLoaderApp::CDriverLoaderApp()
24+
{
25+
// 支持重新启动管理器
26+
m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;
27+
28+
// TODO: 在此处添加构造代码,
29+
// 将所有重要的初始化放置在 InitInstance 中
30+
}
31+
32+
33+
// 唯一的一个 CDriverLoaderApp 对象
34+
35+
CDriverLoaderApp theApp;
36+
37+
38+
// CDriverLoaderApp 初始化
39+
40+
BOOL CDriverLoaderApp::InitInstance()
41+
{
42+
// 如果一个运行在 Windows XP 上的应用程序清单指定要
43+
// 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式,
44+
//则需要 InitCommonControlsEx()。否则,将无法创建窗口。
45+
INITCOMMONCONTROLSEX InitCtrls;
46+
InitCtrls.dwSize = sizeof(InitCtrls);
47+
// 将它设置为包括所有要在应用程序中使用的
48+
// 公共控件类。
49+
InitCtrls.dwICC = ICC_WIN95_CLASSES;
50+
InitCommonControlsEx(&InitCtrls);
51+
52+
CWinApp::InitInstance();
53+
54+
55+
AfxEnableControlContainer();
56+
57+
// 创建 shell 管理器,以防对话框包含
58+
// 任何 shell 树视图控件或 shell 列表视图控件。
59+
CShellManager *pShellManager = new CShellManager;
60+
61+
// 标准初始化
62+
// 如果未使用这些功能并希望减小
63+
// 最终可执行文件的大小,则应移除下列
64+
// 不需要的特定初始化例程
65+
// 更改用于存储设置的注册表项
66+
// TODO: 应适当修改该字符串,
67+
// 例如修改为公司或组织名
68+
SetRegistryKey(_T("应用程序向导生成的本地应用程序"));
69+
70+
CDriverLoaderDlg dlg;
71+
m_pMainWnd = &dlg;
72+
INT_PTR nResponse = dlg.DoModal();
73+
if (nResponse == IDOK)
74+
{
75+
// TODO: 在此放置处理何时用
76+
// “确定”来关闭对话框的代码
77+
}
78+
else if (nResponse == IDCANCEL)
79+
{
80+
// TODO: 在此放置处理何时用
81+
// “取消”来关闭对话框的代码
82+
}
83+
84+
// 删除上面创建的 shell 管理器。
85+
if (pShellManager != NULL)
86+
{
87+
delete pShellManager;
88+
}
89+
90+
// 由于对话框已关闭,所以将返回 FALSE 以便退出应用程序,
91+
// 而不是启动应用程序的消息泵。
92+
return FALSE;
93+
}
94+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
// DriverLoader.h : PROJECT_NAME 应用程序的主头文件
3+
//
4+
5+
#pragma once
6+
7+
#ifndef __AFXWIN_H__
8+
#error "在包含此文件之前包含“stdafx.h”以生成 PCH 文件"
9+
#endif
10+
11+
#include "resource.h" // 主符号
12+
13+
14+
// CDriverLoaderApp:
15+
// 有关此类的实现,请参阅 DriverLoader.cpp
16+
//
17+
18+
class CDriverLoaderApp : public CWinApp
19+
{
20+
public:
21+
CDriverLoaderApp();
22+
23+
// 重写
24+
public:
25+
virtual BOOL InitInstance();
26+
27+
// 实现
28+
29+
DECLARE_MESSAGE_MAP()
30+
};
31+
32+
extern CDriverLoaderApp theApp;
Binary file not shown.
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" 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+
</ItemGroup>
13+
<PropertyGroup Label="Globals">
14+
<ProjectGuid>{40354AA5-CA42-4D84-B2A6-12DF6BA1E25F}</ProjectGuid>
15+
<RootNamespace>DriverLoader</RootNamespace>
16+
<Keyword>MFCProj</Keyword>
17+
</PropertyGroup>
18+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
19+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
20+
<ConfigurationType>Application</ConfigurationType>
21+
<UseDebugLibraries>true</UseDebugLibraries>
22+
<CharacterSet>Unicode</CharacterSet>
23+
<UseOfMfc>Static</UseOfMfc>
24+
</PropertyGroup>
25+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
26+
<ConfigurationType>Application</ConfigurationType>
27+
<UseDebugLibraries>false</UseDebugLibraries>
28+
<WholeProgramOptimization>true</WholeProgramOptimization>
29+
<CharacterSet>Unicode</CharacterSet>
30+
<UseOfMfc>Static</UseOfMfc>
31+
</PropertyGroup>
32+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
33+
<ImportGroup Label="ExtensionSettings">
34+
</ImportGroup>
35+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
36+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
37+
</ImportGroup>
38+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
39+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
40+
</ImportGroup>
41+
<PropertyGroup Label="UserMacros" />
42+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
43+
<LinkIncremental>true</LinkIncremental>
44+
</PropertyGroup>
45+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
46+
<LinkIncremental>false</LinkIncremental>
47+
</PropertyGroup>
48+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
49+
<ClCompile>
50+
<PrecompiledHeader>Use</PrecompiledHeader>
51+
<WarningLevel>Level3</WarningLevel>
52+
<Optimization>Disabled</Optimization>
53+
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
54+
</ClCompile>
55+
<Link>
56+
<SubSystem>Windows</SubSystem>
57+
<GenerateDebugInformation>true</GenerateDebugInformation>
58+
</Link>
59+
<Midl>
60+
<MkTypLibCompatible>false</MkTypLibCompatible>
61+
<ValidateAllParameters>true</ValidateAllParameters>
62+
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
63+
</Midl>
64+
<ResourceCompile>
65+
<Culture>0x0804</Culture>
66+
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
67+
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
68+
</ResourceCompile>
69+
</ItemDefinitionGroup>
70+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
71+
<ClCompile>
72+
<WarningLevel>Level3</WarningLevel>
73+
<PrecompiledHeader>Use</PrecompiledHeader>
74+
<Optimization>MaxSpeed</Optimization>
75+
<FunctionLevelLinking>true</FunctionLevelLinking>
76+
<IntrinsicFunctions>true</IntrinsicFunctions>
77+
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
78+
</ClCompile>
79+
<Link>
80+
<SubSystem>Windows</SubSystem>
81+
<GenerateDebugInformation>true</GenerateDebugInformation>
82+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
83+
<OptimizeReferences>true</OptimizeReferences>
84+
</Link>
85+
<Midl>
86+
<MkTypLibCompatible>false</MkTypLibCompatible>
87+
<ValidateAllParameters>true</ValidateAllParameters>
88+
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
89+
</Midl>
90+
<ResourceCompile>
91+
<Culture>0x0804</Culture>
92+
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
93+
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
94+
</ResourceCompile>
95+
</ItemDefinitionGroup>
96+
<ItemGroup>
97+
<None Include="ReadMe.txt" />
98+
<None Include="res\DriverLoader.ico" />
99+
<None Include="res\DriverLoader.rc2" />
100+
</ItemGroup>
101+
<ItemGroup>
102+
<ClInclude Include="DriverLoader.h" />
103+
<ClInclude Include="DriverLoaderDlg.h" />
104+
<ClInclude Include="Resource.h" />
105+
<ClInclude Include="stdafx.h" />
106+
<ClInclude Include="targetver.h" />
107+
</ItemGroup>
108+
<ItemGroup>
109+
<ClCompile Include="DriverLoader.cpp" />
110+
<ClCompile Include="DriverLoaderDlg.cpp" />
111+
<ClCompile Include="stdafx.cpp">
112+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
113+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
114+
</ClCompile>
115+
</ItemGroup>
116+
<ItemGroup>
117+
<ResourceCompile Include="DriverLoader.rc" />
118+
</ItemGroup>
119+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
120+
<ImportGroup Label="ExtensionTargets">
121+
</ImportGroup>
122+
<ProjectExtensions>
123+
<VisualStudio>
124+
<UserProperties RESOURCE_FILE="DriverLoader.rc" />
125+
</VisualStudio>
126+
</ProjectExtensions>
127+
</Project>
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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="源文件">
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="头文件">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
11+
</Filter>
12+
<Filter Include="资源文件">
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="ReadMe.txt" />
19+
<None Include="res\DriverLoader.rc2">
20+
<Filter>资源文件</Filter>
21+
</None>
22+
<None Include="res\DriverLoader.ico">
23+
<Filter>资源文件</Filter>
24+
</None>
25+
</ItemGroup>
26+
<ItemGroup>
27+
<ClInclude Include="DriverLoader.h">
28+
<Filter>头文件</Filter>
29+
</ClInclude>
30+
<ClInclude Include="DriverLoaderDlg.h">
31+
<Filter>头文件</Filter>
32+
</ClInclude>
33+
<ClInclude Include="stdafx.h">
34+
<Filter>头文件</Filter>
35+
</ClInclude>
36+
<ClInclude Include="targetver.h">
37+
<Filter>头文件</Filter>
38+
</ClInclude>
39+
<ClInclude Include="Resource.h">
40+
<Filter>头文件</Filter>
41+
</ClInclude>
42+
</ItemGroup>
43+
<ItemGroup>
44+
<ClCompile Include="DriverLoader.cpp">
45+
<Filter>源文件</Filter>
46+
</ClCompile>
47+
<ClCompile Include="DriverLoaderDlg.cpp">
48+
<Filter>源文件</Filter>
49+
</ClCompile>
50+
<ClCompile Include="stdafx.cpp">
51+
<Filter>源文件</Filter>
52+
</ClCompile>
53+
</ItemGroup>
54+
<ItemGroup>
55+
<ResourceCompile Include="DriverLoader.rc">
56+
<Filter>资源文件</Filter>
57+
</ResourceCompile>
58+
</ItemGroup>
59+
</Project>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
</Project>

0 commit comments

Comments
 (0)