Skip to content

Commit 2d3c529

Browse files
committed
Work in progress -- checkpoint commit.
1 parent 5a0ae0a commit 2d3c529

26 files changed

+757
-405
lines changed

DriverMinimumRules.ruleset

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RuleSet Name="Microsoft Driver Minimum Rules" Description="This rule set contains rules recommended for drivers." ToolsVersion="10.0">
3+
<Include Path="NativeMinimumRules.ruleset" Action="Default" />
4+
<Rules AnalyzerId="Microsoft.Analyzers.NativeCodeAnalysis" RuleNamespace="Microsoft.Rules.Native">
5+
<Rule Id="C28101" Action="Warning" />
6+
<Rule Id="C28110" Action="Warning" />
7+
<Rule Id="C28111" Action="Warning" />
8+
<Rule Id="C28114" Action="Warning" />
9+
<Rule Id="C28120" Action="Warning" />
10+
<Rule Id="C28121" Action="Warning" />
11+
<Rule Id="C28122" Action="Warning" />
12+
<Rule Id="C28123" Action="Warning" />
13+
<Rule Id="C28124" Action="Warning" />
14+
<Rule Id="C28126" Action="Warning" />
15+
<Rule Id="C28127" Action="Warning" />
16+
<Rule Id="C28128" Action="Warning" />
17+
<Rule Id="C28129" Action="Warning" />
18+
<Rule Id="C28131" Action="Warning" />
19+
<Rule Id="C28132" Action="Warning" />
20+
<Rule Id="C28133" Action="Warning" />
21+
<Rule Id="C28134" Action="Warning" />
22+
<Rule Id="C28135" Action="Warning" />
23+
<Rule Id="C28139" Action="Warning" />
24+
<Rule Id="C28141" Action="Warning" />
25+
<Rule Id="C28143" Action="Warning" />
26+
<Rule Id="C28144" Action="Warning" />
27+
<Rule Id="C28145" Action="Warning" />
28+
<Rule Id="C28146" Action="Warning" />
29+
<Rule Id="C28147" Action="Warning" />
30+
<Rule Id="C28150" Action="Warning" />
31+
<Rule Id="C28151" Action="Warning" />
32+
<Rule Id="C28152" Action="Warning" />
33+
<Rule Id="C28153" Action="Warning" />
34+
<Rule Id="C28156" Action="Warning" />
35+
<Rule Id="C28157" Action="Warning" />
36+
<Rule Id="C28158" Action="Warning" />
37+
<Rule Id="C28161" Action="Warning" />
38+
<Rule Id="C28162" Action="Warning" />
39+
<Rule Id="C28165" Action="Warning" />
40+
<Rule Id="C28166" Action="Warning" />
41+
<Rule Id="C28167" Action="Warning" />
42+
<Rule Id="C28168" Action="Warning" />
43+
<Rule Id="C28169" Action="Warning" />
44+
<Rule Id="C28170" Action="Warning" />
45+
<Rule Id="C28171" Action="Warning" />
46+
<Rule Id="C28172" Action="Warning" />
47+
<Rule Id="C28175" Action="Warning" />
48+
<Rule Id="C28176" Action="Warning" />
49+
<Rule Id="C28177" Action="Warning" />
50+
<Rule Id="C28208" Action="Warning" />
51+
<Rule Id="C28260" Action="Warning" />
52+
<Rule Id="C28266" Action="Warning" />
53+
<Rule Id="C28268" Action="Warning" />
54+
<Rule Id="C28601" Action="Warning" />
55+
<Rule Id="C28602" Action="Warning" />
56+
<Rule Id="C28604" Action="Warning" />
57+
<Rule Id="C28615" Action="Warning" />
58+
<Rule Id="C28616" Action="Warning" />
59+
<Rule Id="C28617" Action="Warning" />
60+
<Rule Id="C28623" Action="Warning" />
61+
<Rule Id="C28624" Action="Warning" />
62+
<Rule Id="C28625" Action="Warning" />
63+
<Rule Id="C28636" Action="Warning" />
64+
<Rule Id="C28637" Action="Warning" />
65+
<Rule Id="C28638" Action="Warning" />
66+
<Rule Id="C28639" Action="Warning" />
67+
<Rule Id="C28640" Action="Warning" />
68+
<Rule Id="C28645" Action="Warning" />
69+
<Rule Id="C28648" Action="Warning" />
70+
<Rule Id="C28650" Action="Warning" />
71+
<Rule Id="C28714" Action="Warning" />
72+
<Rule Id="C28715" Action="Warning" />
73+
<Rule Id="C28716" Action="Warning" />
74+
<Rule Id="C28717" Action="Warning" />
75+
<Rule Id="C28719" Action="Warning" />
76+
<Rule Id="C28720" Action="Warning" />
77+
<Rule Id="C28721" Action="Warning" />
78+
<Rule Id="C28726" Action="Warning" />
79+
<Rule Id="C28727" Action="Warning" />
80+
<Rule Id="C28730" Action="Warning" />
81+
<Rule Id="C28735" Action="Warning" />
82+
<Rule Id="C28736" Action="Warning" />
83+
<Rule Id="C28750" Action="Warning" />
84+
<Rule Id="C28751" Action="Warning" />
85+
</Rules>
86+
</RuleSet>

NT.props

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup Label="Configuration">
4+
<Platform Condition="'$(Platform)' == ''">x64</Platform>
5+
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
6+
</PropertyGroup>
7+
</Project>

Python/Python.vcxproj

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -43,56 +43,6 @@
4343
<PropertyGroup Label="Configuration">
4444
<ConfigurationType>DynamicLibrary</ConfigurationType>
4545
</PropertyGroup>
46-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
47-
<PlatformToolset>v140</PlatformToolset>
48-
</PropertyGroup>
49-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
50-
<PlatformToolset>v140</PlatformToolset>
51-
</PropertyGroup>
52-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
53-
<PlatformToolset>v140</PlatformToolset>
54-
</PropertyGroup>
55-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
56-
<PlatformToolset>v140</PlatformToolset>
57-
</PropertyGroup>
58-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGUpdate|x64'">
59-
<PlatformToolset>v140</PlatformToolset>
60-
</PropertyGroup>
61-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGUpdate|Win32'">
62-
<PlatformToolset>v140</PlatformToolset>
63-
</PropertyGroup>
64-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGInstrument|x64'">
65-
<PlatformToolset>v140</PlatformToolset>
66-
</PropertyGroup>
67-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'">
68-
<PlatformToolset>v140</PlatformToolset>
69-
</PropertyGroup>
70-
<!--
71-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
72-
<PlatformToolset>v120</PlatformToolset>
73-
</PropertyGroup>
74-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
75-
<PlatformToolset>v120</PlatformToolset>
76-
</PropertyGroup>
77-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
78-
<PlatformToolset>v120</PlatformToolset>
79-
</PropertyGroup>
80-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
81-
<PlatformToolset>v120</PlatformToolset>
82-
</PropertyGroup>
83-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGUpdate|x64'">
84-
<PlatformToolset>v120</PlatformToolset>
85-
</PropertyGroup>
86-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGUpdate|Win32'">
87-
<PlatformToolset>v120</PlatformToolset>
88-
</PropertyGroup>
89-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGInstrument|x64'">
90-
<PlatformToolset>v120</PlatformToolset>
91-
</PropertyGroup>
92-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'">
93-
<PlatformToolset>v120</PlatformToolset>
94-
</PropertyGroup>
95-
-->
9646
<Import Project="..\Tracer.props" />
9747
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
9848
<ImportGroup Label="ExtensionSettings">
@@ -106,22 +56,6 @@
10656
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
10757
</ImportGroup>
10858
<PropertyGroup Label="UserMacros" />
109-
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
110-
<ClCompile>
111-
<BrowseInformation>true</BrowseInformation>
112-
</ClCompile>
113-
<Bscmake>
114-
<PreserveSbr>true</PreserveSbr>
115-
</Bscmake>
116-
<Link>
117-
<Profile>true</Profile>
118-
</Link>
119-
</ItemDefinitionGroup>
120-
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
121-
<Link>
122-
<Profile>true</Profile>
123-
</Link>
124-
</ItemDefinitionGroup>
12559
<ItemGroup>
12660
<ClInclude Include="stdafx.h" />
12761
<ClInclude Include="targetver.h" />
@@ -137,6 +71,4 @@
13771
<ClCompile Include="Python.c" />
13872
</ItemGroup>
13973
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
140-
<ImportGroup Label="ExtensionTargets">
141-
</ImportGroup>
14274
</Project>

PythonExe/PythonExe.vcxproj

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -44,30 +44,6 @@
4444
<PropertyGroup Label="Configuration">
4545
<ConfigurationType>Application</ConfigurationType>
4646
</PropertyGroup>
47-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
48-
<PlatformToolset>v140</PlatformToolset>
49-
</PropertyGroup>
50-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
51-
<PlatformToolset>v140</PlatformToolset>
52-
</PropertyGroup>
53-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
54-
<PlatformToolset>v140</PlatformToolset>
55-
</PropertyGroup>
56-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
57-
<PlatformToolset>v140</PlatformToolset>
58-
</PropertyGroup>
59-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGUpdate|x64'">
60-
<PlatformToolset>v140</PlatformToolset>
61-
</PropertyGroup>
62-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGUpdate|Win32'">
63-
<PlatformToolset>v140</PlatformToolset>
64-
</PropertyGroup>
65-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGInstrument|x64'">
66-
<PlatformToolset>v140</PlatformToolset>
67-
</PropertyGroup>
68-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'">
69-
<PlatformToolset>v140</PlatformToolset>
70-
</PropertyGroup>
7147
<Import Project="..\Tracer.props" />
7248
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
7349
<ImportGroup Label="ExtensionSettings">

PythonTracer/PythonTracer.vcxproj

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -43,51 +43,15 @@
4343
<PropertyGroup Label="Configuration">
4444
<ConfigurationType>DynamicLibrary</ConfigurationType>
4545
</PropertyGroup>
46-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
47-
<PlatformToolset>v140</PlatformToolset>
48-
</PropertyGroup>
49-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
50-
<PlatformToolset>v140</PlatformToolset>
51-
</PropertyGroup>
52-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
53-
<PlatformToolset>v140</PlatformToolset>
54-
</PropertyGroup>
55-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
56-
<PlatformToolset>v140</PlatformToolset>
57-
</PropertyGroup>
58-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGUpdate|x64'">
59-
<PlatformToolset>v140</PlatformToolset>
60-
</PropertyGroup>
61-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGUpdate|Win32'">
62-
<PlatformToolset>v140</PlatformToolset>
63-
</PropertyGroup>
64-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGInstrument|x64'">
65-
<PlatformToolset>v140</PlatformToolset>
66-
</PropertyGroup>
67-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'">
68-
<PlatformToolset>v140</PlatformToolset>
69-
</PropertyGroup>
7046
<Import Project="..\Tracer.props" />
7147
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
72-
<ImportGroup Label="ExtensionSettings">
73-
</ImportGroup>
74-
<ImportGroup Label="Shared">
75-
</ImportGroup>
7648
<ImportGroup Label="PropertySheets" Condition="'$(Platform)'=='Win32'">
7749
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
7850
</ImportGroup>
7951
<ImportGroup Label="PropertySheets" Condition="'$(Platform)'=='x64'">
8052
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
8153
</ImportGroup>
8254
<PropertyGroup Label="UserMacros" />
83-
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
84-
<ClCompile>
85-
<BrowseInformation>true</BrowseInformation>
86-
</ClCompile>
87-
<Bscmake>
88-
<PreserveSbr>true</PreserveSbr>
89-
</Bscmake>
90-
</ItemDefinitionGroup>
9155
<ItemGroup>
9256
<ClInclude Include="stdafx.h" />
9357
<ClInclude Include="targetver.h" />
@@ -103,6 +67,4 @@
10367
<ClCompile Include="PythonTracer.c" />
10468
</ItemGroup>
10569
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
106-
<ImportGroup Label="ExtensionTargets">
107-
</ImportGroup>
10870
</Project>

Rtl/Rtl.h

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,6 +1099,26 @@ typedef ULONG (NTAPI *PRTL_FIND_LAST_BACKWARD_RUN_CLEAR)(
10991099
_Out_ PULONG StartingRunIndex
11001100
);
11011101

1102+
//
1103+
// Quad-word Bitmaps. (Work in progress.)
1104+
//
1105+
1106+
typedef struct _RTL_BITMAP_EX {
1107+
ULONGLONG SizeOfBitMap; // Number of bits.
1108+
PULONGLONG Buffer;
1109+
} RTL_BITMAP_EX, *PRTL_BITMAP_EX, **PPRTL_BITMAP_EX;
1110+
1111+
typedef VOID (NTAPI *PRTL_INITIALIZE_BITMAP_EX)(
1112+
_Out_ PRTL_BITMAP_EX BitMapHeader,
1113+
_In_opt_ __drv_aliasesMem PULONGLONG BitMapBuffer,
1114+
_In_opt_ ULONGLONG SizeOfBitMap
1115+
);
1116+
1117+
typedef VOID (NTAPI *PRTL_CLEAR_BIT_EX)(
1118+
_In_ PRTL_BITMAP_EX BitMapHeader,
1119+
_In_range_(<, BitMapHeader->SizeOfBitMap) ULONGLONG BitNumber
1120+
);
1121+
11021122
//
11031123
// CRC32 and CRC64
11041124
//
@@ -1538,7 +1558,10 @@ typedef VOID (FREE_ROUTINE)(
15381558

15391559
typedef FREE_ROUTINE *PFREE_ROUTINE;
15401560

1541-
typedef BOOL (FILES_EXISTW)(
1561+
typedef
1562+
_Check_return_
1563+
_Success_(return != 0)
1564+
BOOL (FILES_EXISTW)(
15421565
_In_ PRTL Rtl,
15431566
_In_ PUNICODE_STRING Directory,
15441567
_In_ USHORT NumberOfFilenames,
@@ -1550,7 +1573,11 @@ typedef BOOL (FILES_EXISTW)(
15501573

15511574
typedef FILES_EXISTW *PFILES_EXISTW;
15521575

1553-
typedef BOOL (FILES_EXISTA)(
1576+
typedef
1577+
_Check_return_
1578+
_Success_(return != 0)
1579+
BOOL
1580+
(FILES_EXISTA)(
15541581
_In_ PRTL Rtl,
15551582
_In_ PSTRING Directory,
15561583
_In_ USHORT NumberOfFilenames,

Rtl/Rtl.vcxproj

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -43,60 +43,15 @@
4343
<PropertyGroup Label="Configuration">
4444
<ConfigurationType>DynamicLibrary</ConfigurationType>
4545
</PropertyGroup>
46-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
47-
<PlatformToolset>v140</PlatformToolset>
48-
</PropertyGroup>
49-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
50-
<PlatformToolset>v140</PlatformToolset>
51-
</PropertyGroup>
52-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
53-
<PlatformToolset>v140</PlatformToolset>
54-
</PropertyGroup>
55-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
56-
<PlatformToolset>v140</PlatformToolset>
57-
</PropertyGroup>
58-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGUpdate|x64'">
59-
<PlatformToolset>v140</PlatformToolset>
60-
</PropertyGroup>
61-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGUpdate|Win32'">
62-
<PlatformToolset>v140</PlatformToolset>
63-
</PropertyGroup>
64-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGInstrument|x64'">
65-
<PlatformToolset>v140</PlatformToolset>
66-
</PropertyGroup>
67-
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'">
68-
<PlatformToolset>v140</PlatformToolset>
69-
</PropertyGroup>
7046
<Import Project="..\Tracer.props" />
7147
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
72-
<ImportGroup Label="ExtensionSettings">
73-
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
74-
</ImportGroup>
75-
<ImportGroup Label="Shared">
76-
</ImportGroup>
7748
<ImportGroup Label="PropertySheets" Condition="'$(Platform)'=='Win32'">
7849
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
7950
</ImportGroup>
8051
<ImportGroup Label="PropertySheets" Condition="'$(Platform)'=='x64'">
8152
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
8253
</ImportGroup>
8354
<PropertyGroup Label="UserMacros" />
84-
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
85-
<ClCompile>
86-
<BrowseInformation>true</BrowseInformation>
87-
</ClCompile>
88-
<Bscmake>
89-
<PreserveSbr>true</PreserveSbr>
90-
</Bscmake>
91-
<Link>
92-
<Profile>true</Profile>
93-
</Link>
94-
</ItemDefinitionGroup>
95-
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
96-
<Link>
97-
<Profile>true</Profile>
98-
</Link>
99-
</ItemDefinitionGroup>
10055
<ItemGroup>
10156
<ClInclude Include="stdafx.h" />
10257
<ClInclude Include="targetver.h" />

Rtl/Rtl.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,8 @@
4040
<MASM Include="Rtlx64.asm" Condition="'$(Platform)' == 'x64'">
4141
<Filter>Source Files</Filter>
4242
</MASM>
43+
<MASM Include="Rtlx64.asm">
44+
<Filter>Source Files</Filter>
45+
</MASM>
4346
</ItemGroup>
4447
</Project>

0 commit comments

Comments
 (0)