Skip to content

Commit

Permalink
Build: Migrate to VS 2015 and add Win10 configurations
Browse files Browse the repository at this point in the history
This commit migrates from VS 2013 to VS 2015. Beside the auto conversion
which was performed by VS this commit includes the following fixes
which enabled the builld to work:

Win (7, 8, 8.1, 10):
* Set the KMDF Version Major to 1.
* Set the KMDF Version Minor to 11.

Win XP:
* Add _When_ define.
* Add empty implementation to guard functions which else would cause an
  unresolved symbols.
* Add path to WinDDK's wdfinstaller.h in UsbDkHelper project.
* Add "GetDriverProjectAttributes" and "GetPackageFiles" targets to
  UsbDkController, UsbDkHelper and UsbDkInstHelper project files.

Signed-off-by: Sameeh Jubran <[email protected]>
Signed-off-by: Dmitry Fleytman <[email protected]>
  • Loading branch information
Sameeh Jubran authored and Dmitry Fleytman committed Apr 3, 2017
1 parent 2b41acd commit 2cd4aa5
Show file tree
Hide file tree
Showing 13 changed files with 5,930 additions and 4,658 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Win*Debug
Win*Release
*.opensdf
*.ipch
*.vcxproj.user
build*.log
resource.h
Resource.aps
Expand Down
4 changes: 2 additions & 2 deletions Tools/vs_cmdline.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ Dim strCmdLine, strTemp
Set WshShell = Wscript.CreateObject("Wscript.Shell")

On Error Resume Next
strCmdLine = WshShell.RegRead("HKLM\SOFTWARE\Microsoft\VisualStudio\12.0\InstallDir")
strCmdLine = WshShell.RegRead("HKLM\SOFTWARE\Microsoft\VisualStudio\14.0\InstallDir")
' In case of error assume WoW64 case
If Err <> 0 Then
On Error Goto 0
strCmdLine = WshShell.RegRead("HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0\InstallDir")
strCmdLine = WshShell.RegRead("HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\InstallDir")
End If

On Error Goto 0
Expand Down
1,999 changes: 1,119 additions & 880 deletions UsbDk Package/UsbDk Package.vcxproj

Large diffs are not rendered by default.

796 changes: 427 additions & 369 deletions UsbDk.sln

Large diffs are not rendered by default.

2,220 changes: 1,256 additions & 964 deletions UsbDk/UsbDk.vcxproj

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions UsbDk/UsbDk.vcxproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win10 Release|x64'">
<SignMode>Off</SignMode>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win10 Release|Win32'">
<SignMode>Off</SignMode>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Release|x64'">
<SignMode>Off</SignMode>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Release|Win32'">
<SignMode>Off</SignMode>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Release|x64'">
<SignMode>Off</SignMode>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Release|Win32'">
<SignMode>Off</SignMode>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8.1 Release|x64'">
<SignMode>Off</SignMode>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8.1 Release|Win32'">
<SignMode>Off</SignMode>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='XP Release|x64'">
<SignMode>Off</SignMode>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='XP Release|Win32'">
<SignMode>Off</SignMode>
</PropertyGroup>
</Project>
21 changes: 21 additions & 0 deletions UsbDk/UsbDkCompat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,25 @@ NTSTATUS WdfUsbTargetDeviceCreateIsochUrb(WDFUSBDEVICE UsbDevice, PWDF_OBJECT_AT

return status;
}

extern "C"
{

#ifdef _WIN64
NTSTATUS __guard_check_icall_fptr(...)
{
return STATUS_SUCCESS;
}

NTSTATUS __guard_dispatch_icall_fptr(...)
{
return STATUS_SUCCESS;
}
#else
NTSTATUS _cdecl __guard_check_icall_fptr(...)
{
return STATUS_SUCCESS;
}
#endif
}
#endif
2 changes: 2 additions & 0 deletions UsbDk/UsbDkCompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ typedef struct _WDF_USB_DEVICE_CREATE_CONFIG
NTSTATUS WdfUsbTargetDeviceCreateIsochUrb(WDFUSBDEVICE UsbDevice, PWDF_OBJECT_ATTRIBUTES Attributes, ULONG NumberOfIsochPackets,
WDFMEMORY* UrbMemory, PURB *Urb);

#define _When_(expr, annotes) __allowed(on_parameter_or_return)

#endif
1,589 changes: 887 additions & 702 deletions UsbDkController/UsbDkController.vcxproj

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions UsbDkHelper/Installer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "Installer.h"
#include "Public.h"
#include "DeviceMgr.h"
#include <iterator>


#define SYSTEM32_DRIVERS TEXT("\\System32\\Drivers\\")
Expand Down
2,331 changes: 1,294 additions & 1,037 deletions UsbDkHelper/UsbDkHelper.vcxproj

Large diffs are not rendered by default.

1,589 changes: 887 additions & 702 deletions UsbDkInstHelper/UsbDkInstHelper.vcxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion buildAll.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if [%1] EQU [MSIONLY] goto BUILD_MSI

del *.log

for %%x in (Win7, Win8, Win8.1, XP) do (
for %%x in (Win7, Win8, Win8.1, Win10, XP) do (
for %%y in (Debug, Release) do (
for %%z in (win32, x64) do (
call tools\vs_run.bat UsbDk.sln /Rebuild "%%x %%y|%%z" /Out build%%y_%%x_%%z.log
Expand Down

0 comments on commit 2cd4aa5

Please sign in to comment.