Skip to content

Commit 7a70382

Browse files
authored
Merge pull request #43 from LTRData/master
Newer VS/SDK/DDK compatibility
2 parents e5acade + 6a9c283 commit 7a70382

11 files changed

+136
-21
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ Debug/
33
Release/
44
*.vcxproj.user
55
Ext2Fsd-setup.exe
6+
*/cab/

Ext2Mgr/Ext2Mgr.vcxproj

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,35 +22,35 @@
2222
<VCProjectVersion>15.0</VCProjectVersion>
2323
<ProjectGuid>{E1AF85D7-0179-4CF0-B0D1-21AE72B6DC2E}</ProjectGuid>
2424
<RootNamespace>Ext2Mgr</RootNamespace>
25-
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
25+
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
2626
</PropertyGroup>
2727
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2828
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
2929
<ConfigurationType>Application</ConfigurationType>
3030
<UseDebugLibraries>true</UseDebugLibraries>
31-
<PlatformToolset>v143</PlatformToolset>
31+
<PlatformToolset>v142</PlatformToolset>
3232
<CharacterSet>MultiByte</CharacterSet>
3333
<UseOfMfc>Dynamic</UseOfMfc>
3434
</PropertyGroup>
3535
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
3636
<ConfigurationType>Application</ConfigurationType>
3737
<UseDebugLibraries>false</UseDebugLibraries>
38-
<PlatformToolset>v143</PlatformToolset>
38+
<PlatformToolset>v142</PlatformToolset>
3939
<WholeProgramOptimization>true</WholeProgramOptimization>
4040
<CharacterSet>MultiByte</CharacterSet>
4141
<UseOfMfc>Dynamic</UseOfMfc>
4242
</PropertyGroup>
4343
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
4444
<ConfigurationType>Application</ConfigurationType>
4545
<UseDebugLibraries>true</UseDebugLibraries>
46-
<PlatformToolset>v143</PlatformToolset>
46+
<PlatformToolset>v142</PlatformToolset>
4747
<CharacterSet>MultiByte</CharacterSet>
4848
<UseOfMfc>Dynamic</UseOfMfc>
4949
</PropertyGroup>
5050
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
5151
<ConfigurationType>Application</ConfigurationType>
5252
<UseDebugLibraries>false</UseDebugLibraries>
53-
<PlatformToolset>v143</PlatformToolset>
53+
<PlatformToolset>v142</PlatformToolset>
5454
<WholeProgramOptimization>true</WholeProgramOptimization>
5555
<CharacterSet>MultiByte</CharacterSet>
5656
<UseOfMfc>Dynamic</UseOfMfc>

Ext2Srv/Ext2Srv.vcxproj

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,32 @@
2222
<VCProjectVersion>15.0</VCProjectVersion>
2323
<ProjectGuid>{6A5A0B13-7E05-4CA9-9A2B-FADF76DBAC20}</ProjectGuid>
2424
<RootNamespace>Ext2Srv</RootNamespace>
25-
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
25+
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
2626
</PropertyGroup>
2727
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2828
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
2929
<ConfigurationType>Application</ConfigurationType>
3030
<UseDebugLibraries>true</UseDebugLibraries>
31-
<PlatformToolset>v143</PlatformToolset>
31+
<PlatformToolset>v142</PlatformToolset>
3232
<CharacterSet>MultiByte</CharacterSet>
3333
</PropertyGroup>
3434
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
3535
<ConfigurationType>Application</ConfigurationType>
3636
<UseDebugLibraries>false</UseDebugLibraries>
37-
<PlatformToolset>v143</PlatformToolset>
37+
<PlatformToolset>v142</PlatformToolset>
3838
<WholeProgramOptimization>true</WholeProgramOptimization>
3939
<CharacterSet>MultiByte</CharacterSet>
4040
</PropertyGroup>
4141
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
4242
<ConfigurationType>Application</ConfigurationType>
4343
<UseDebugLibraries>true</UseDebugLibraries>
44-
<PlatformToolset>v143</PlatformToolset>
44+
<PlatformToolset>v142</PlatformToolset>
4545
<CharacterSet>MultiByte</CharacterSet>
4646
</PropertyGroup>
4747
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
4848
<ConfigurationType>Application</ConfigurationType>
4949
<UseDebugLibraries>false</UseDebugLibraries>
50-
<PlatformToolset>v143</PlatformToolset>
50+
<PlatformToolset>v142</PlatformToolset>
5151
<WholeProgramOptimization>true</WholeProgramOptimization>
5252
<CharacterSet>MultiByte</CharacterSet>
5353
</PropertyGroup>

Ext4Fsd/Ext4Fsd.vcxproj

+35-6
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,28 @@
4242
<Configuration>Debug</Configuration>
4343
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
4444
<RootNamespace>Ext4Fsd</RootNamespace>
45-
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
45+
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
4646
</PropertyGroup>
4747
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
4848
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
4949
<TargetVersion>Windows10</TargetVersion>
5050
<UseDebugLibraries>true</UseDebugLibraries>
5151
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
52-
<ConfigurationType>Driver</ConfigurationType>
5352
<DriverType>WDM</DriverType>
5453
<ALLOW_DATE_TIME>1</ALLOW_DATE_TIME>
5554
<Driver_SpectreMitigation>false</Driver_SpectreMitigation>
55+
<ConfigurationType>Driver</ConfigurationType>
56+
<DriverTargetPlatform>Windows Driver</DriverTargetPlatform>
5657
</PropertyGroup>
5758
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
5859
<TargetVersion>Windows10</TargetVersion>
5960
<UseDebugLibraries>false</UseDebugLibraries>
6061
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
61-
<ConfigurationType>Driver</ConfigurationType>
6262
<DriverType>WDM</DriverType>
6363
<ALLOW_DATE_TIME>1</ALLOW_DATE_TIME>
6464
<Driver_SpectreMitigation>false</Driver_SpectreMitigation>
65+
<ConfigurationType>Driver</ConfigurationType>
66+
<DriverTargetPlatform>Windows Driver</DriverTargetPlatform>
6567
</PropertyGroup>
6668
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
6769
<TargetVersion>Windows10</TargetVersion>
@@ -71,6 +73,7 @@
7173
<DriverType>WDM</DriverType>
7274
<ALLOW_DATE_TIME>1</ALLOW_DATE_TIME>
7375
<Driver_SpectreMitigation>false</Driver_SpectreMitigation>
76+
<DriverTargetPlatform>Windows Driver</DriverTargetPlatform>
7477
</PropertyGroup>
7578
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
7679
<TargetVersion>Windows10</TargetVersion>
@@ -80,6 +83,7 @@
8083
<DriverType>WDM</DriverType>
8184
<ALLOW_DATE_TIME>1</ALLOW_DATE_TIME>
8285
<Driver_SpectreMitigation>false</Driver_SpectreMitigation>
86+
<DriverTargetPlatform>Windows Driver</DriverTargetPlatform>
8387
</PropertyGroup>
8488
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
8589
<TargetVersion>Windows10</TargetVersion>
@@ -88,6 +92,7 @@
8892
<ConfigurationType>Driver</ConfigurationType>
8993
<DriverType>WDM</DriverType>
9094
<ALLOW_DATE_TIME>1</ALLOW_DATE_TIME>
95+
<DriverTargetPlatform>Windows Driver</DriverTargetPlatform>
9196
</PropertyGroup>
9297
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
9398
<TargetVersion>Windows10</TargetVersion>
@@ -96,6 +101,7 @@
96101
<ConfigurationType>Driver</ConfigurationType>
97102
<DriverType>WDM</DriverType>
98103
<ALLOW_DATE_TIME>1</ALLOW_DATE_TIME>
104+
<DriverTargetPlatform>Windows Driver</DriverTargetPlatform>
99105
</PropertyGroup>
100106
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
101107
<TargetVersion>Windows10</TargetVersion>
@@ -104,6 +110,7 @@
104110
<ConfigurationType>Driver</ConfigurationType>
105111
<DriverType>WDM</DriverType>
106112
<ALLOW_DATE_TIME>1</ALLOW_DATE_TIME>
113+
<DriverTargetPlatform>Windows Driver</DriverTargetPlatform>
107114
</PropertyGroup>
108115
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
109116
<TargetVersion>Windows10</TargetVersion>
@@ -112,13 +119,38 @@
112119
<ConfigurationType>Driver</ConfigurationType>
113120
<DriverType>WDM</DriverType>
114121
<ALLOW_DATE_TIME>1</ALLOW_DATE_TIME>
122+
<DriverTargetPlatform>Windows Driver</DriverTargetPlatform>
115123
</PropertyGroup>
116124
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
117125
<ImportGroup Label="ExtensionSettings">
118126
</ImportGroup>
119127
<ImportGroup Label="PropertySheets">
120128
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
121129
</ImportGroup>
130+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
131+
<Import Project="PropertySheet.props" />
132+
</ImportGroup>
133+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
134+
<Import Project="PropertySheet.props" />
135+
</ImportGroup>
136+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
137+
<Import Project="PropertySheet.props" />
138+
</ImportGroup>
139+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
140+
<Import Project="PropertySheet.props" />
141+
</ImportGroup>
142+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
143+
<Import Project="PropertySheet.props" />
144+
</ImportGroup>
145+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
146+
<Import Project="PropertySheet.props" />
147+
</ImportGroup>
148+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
149+
<Import Project="PropertySheet.props" />
150+
</ImportGroup>
151+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
152+
<Import Project="PropertySheet.props" />
153+
</ImportGroup>
122154
<PropertyGroup Label="UserMacros" />
123155
<PropertyGroup />
124156
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
@@ -359,9 +391,6 @@
359391
<ItemGroup>
360392
<ResourceCompile Include="Ext4Fsd.rc" />
361393
</ItemGroup>
362-
<ItemGroup>
363-
<Inf Include="Ext2Fsd.inf" />
364-
</ItemGroup>
365394
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
366395
<ImportGroup Label="ExtensionTargets">
367396
</ImportGroup>

Ext4Fsd/Ext4Fsd.vcxproj.filters

-5
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,4 @@
291291
<Filter>Resource Files</Filter>
292292
</ResourceCompile>
293293
</ItemGroup>
294-
<ItemGroup>
295-
<Inf Include="Ext2Fsd.inf">
296-
<Filter>Driver Files</Filter>
297-
</Inf>
298-
</ItemGroup>
299294
</Project>

Ext4Fsd/PropertySheet.props

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ImportGroup Label="PropertySheets" />
4+
<PropertyGroup Label="UserMacros" />
5+
<PropertyGroup />
6+
<ItemDefinitionGroup>
7+
<ClCompile>
8+
<DisableSpecificWarnings>4996;4064;4627;4627;4366;%(DisableSpecificWarnings)</DisableSpecificWarnings>
9+
</ClCompile>
10+
</ItemDefinitionGroup>
11+
<ItemGroup />
12+
</Project>

Ext4Fsd/debug.c

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include "stdarg.h"
1313
#include "ext2fs.h"
1414

15+
#include <wdm.h>
16+
1517
/* GLOBALS ***************************************************************/
1618

1719
#if EXT2_DEBUG

Ext4Fsd/ext2fsd_dummy.inf

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
2+
; DUMMY.INF
3+
; Dummy inf file.
4+
5+
[Version]
6+
signature = "$Windows NT$"
7+
Class = SCSIAdapter
8+
ClassGUID = {4D36E97B-E325-11CE-BFC1-08002BE10318}
9+
Provider = "LTR Data"
10+
DriverVer = 02/22/2024,12.51.57.866
11+
CatalogFile = ext2fsd_dummy.cat
12+
13+
14+
[SourceDisksNames]
15+
1 = "EXT4 File System Driver"
16+
17+
18+
[SourceDisksFiles.x86]
19+
ext2fsd.sys = 1, x86
20+
21+
[SourceDisksFiles.amd64]
22+
ext2fsd.sys = 1, x64
23+
24+
[SourceDisksFiles.arm]
25+
ext2fsd.sys = 1, arm
26+
27+
[SourceDisksFiles.arm64]
28+
ext2fsd.sys = 1, arm64
29+
30+
[DestinationDirs]
31+
ext2fsdSysFiles = 12
32+
33+
34+
[DefaultInstall.ntx86]
35+
CopyFiles = ext2fsdSysFiles
36+
37+
38+
[ext2fsdSysFiles]
39+
ext2fsd.sys
40+
41+
[DefaultInstall.ntx86.Services]
42+
AddService = ext2fsd, , ext2fsdDrv
43+
44+
45+
[ext2fsdDrv]
46+
DisplayName = "EXT4 File System Driver"
47+
StartType = 1
48+
ServiceType = 2
49+
ErrorControl = 0
50+
ServiceBinary = %12%\ext2fsd.sys

Ext4Fsd/include/linux/module.h

+7
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,32 @@ extern "C" {
6161

6262
#else
6363

64+
#ifndef RtlUshortByteSwap
6465
USHORT
6566
FASTCALL
6667
RtlUshortByteSwap(
6768
IN USHORT Source
6869
);
70+
#endif
6971

72+
#ifndef RtlUlongByteSwap
7073
ULONG
7174
FASTCALL
7275
RtlUlongByteSwap(
7376
IN ULONG Source
7477
);
78+
#endif
7579

80+
#ifndef RtlUlonglongByteSwap
7681
ULONGLONG
7782
FASTCALL
7883
RtlUlonglongByteSwap(
7984
IN ULONGLONG Source
8085
);
8186
#endif
8287

88+
#endif
89+
8390
#define __swab16(x) RtlUshortByteSwap(x)
8491
#define __swab32(x) RtlUlongByteSwap(x)
8592
#define __swab64(x) RtlUlonglongByteSwap(x)

Ext4Fsd/linux.c

+4
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,8 @@ int _strnicmp(const char* str1, const char* str2, size_t count)
10061006
return (int)c1 - (int)c2;
10071007
}
10081008

1009+
#if !defined(_M_ARM64) && !defined(_M_ARM)
1010+
10091011
int strncmp(const char* str1, const char* str2, size_t count)
10101012
{
10111013
unsigned char c1, c2;
@@ -1037,6 +1039,8 @@ char* strncpy(char* dest, const char* src, size_t count)
10371039

10381040
#endif
10391041

1042+
#endif
1043+
10401044
//
10411045
// initialzer and destructor
10421046
//

Ext4Fsd/mkcab.cmd

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
copy /y ext2fsd_dummy.inf Release\
2+
3+
stampinf -d * -v * -f Release\ext2fsd_dummy.inf -a NTx86,NTamd64,NTia64,NTARM,NTARM64 || goto :eof
4+
5+
inf2cat /driver:Release /os:XP_X86,2000,XP_X64,Vista_X86,Vista_X64,7_X86,7_X64,Server2003_X86,Server2003_X64,Server2003_IA64,Server2008_X86,Server2008_X64,Server2008_IA64,Server2008R2_X64,Server2008R2_IA64,8_X86,8_X64,8_ARM,10_RS3_X86,10_RS3_X64,10_RS3_ARM64 || goto :eof
6+
7+
if exist cab\ext2fsd.cab del cab\ext2fsd.cab
8+
9+
if not exist cab mkdir cab
10+
11+
cabarc -p -r n cab\ext2fsd.cab Release\ext2fsd_dummy.inf Release\ext2fsd*.sys Release\ext2fsd*.pdb || goto :eof
12+
13+
if not exist cab\ext2fsd.cab goto :eof
14+
15+
signtool sign /a /as /v /sha1 a065b19d9f5a23bc67bb1cf6872283f504ba04b1 /fd sha256 /tr "http://sha256timestamp.ws.symantec.com/sha256/timestamp" cab\ext2fsd.cab || goto :eof

0 commit comments

Comments
 (0)