How to build a Windows driver development kit 7 on 10 - driver

I am trying to build a Windows driver for a piece of hardware I am using. The build notes seem dated as they specify using DDK for Win7. I have Windows kit version 10. Are these the same thing just later version? The instructions then state to open a DDK command window environment then use "build -ceZ" in the dir where the files are located. Does v10 have this console and if so where can I find it? Thanks

https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/wdk-and-visual-studio-build-environment
"The Windows Driver Kit (WDK) 8.1 and WDK 8 introduced a major change
to the environment that you use to build a driver. The WDK no longer
uses Build.exe. The WDK build environment for drivers uses MSBuild.exe
and is fully integrated with the Visual Studio development
environment. This means that source files, makefile.inc, makefile.new
and other related build files present in the previous version of the
WDK are no longer used. The WDK now enables you to create, edit,
build, test, and deploy a driver through Visual Studio. The purpose of
this document is to provide information to help users familiar with
previous WDKs in getting started with the WDK 8.1 and WDK 8."
If you want to build the driver as is then you will need to install the Windows 7.1 DDK and build it using its tools.
https://en.wikipedia.org/wiki/Windows_Driver_Kit
https://www.microsoft.com/en-gb/download/details.aspx?id=11800
You are allowed to install different versions of the DDK on the same machine.
You might find it tricky to install DDK 7.1 on Windows 10 though, try and use this to get around any problem install.
https://stackoverflow.com/questions/32091593/cannot-install-windows-sdk-7-1-on-windows-10#:~:text=If%20you%20continue%20with%20Setup,187668%20and%20then%20rerun%20Setup.
Then it's just a case of "choosing the 7.1 ddk environment (32bit or 64bit)" so that it's tools are accessible/used when "building" your driver.
Look in your startmenu at "StartMenu -> Windows Driver Kits -> WDK XXXX -> Build Environments" to find a command prompt to open.
If you can't/don't want to install the DDK 7.1 and a WDK8+ version of your driver project isn't available then it may be possible to convert the driver from using the older "makefile" into new msbuild way of building, but might be fiddly.
https://community.osr.com/discussion/289475/build-exe-to-msbuild-exe-migration-advice
"If you go into VS you should be able to create a WDK driver project.
It will give you a solution with (I think) one C file filled with
everything necessary to make a driver which does nothing. But, most
importantly, it will generate an XML file that MSBuild will accept.
The XML format is not documented. After you have this XML file you
should be able to figure out how to add your files to it by hand, but
you could move the existing driver files to the project using the GUI.
That may be easiest."

Related

TEdgeBrowser Canary requirement

I tested TEdgeBrowser in RAD Studio 10.4.2 Sydney. Dropping the component onto a Form in C++Builder and then calling:
EdgeBrowser1->Navigate("https://www.stackoverflow.com/");
This results in an error on my development machine:
Failed to find an installed WebView2 runtime or non-stable Microsoft Edge installation.
I have placed WebView2Loader.dll (from C:\Program Files (x86)\Embarcadero\Studio\21.0\Redist\win32\) into the project's executable folder, so that could not have been the cause of the error.
After that, I installed Edge Canary, and then it started working without errors.
However, if I compile the same project in Release configuration, and then run on another system which only has a stable installation of the Microsoft Edge browser and doesn't have Edge Canary installed, it all works.
But, if I run the same Release build on my build system, it fails to load (probably because of the same reason as the Debug build - it can't find the Canary installation).
I tested TMS's TAdvWebBrowser component, which doesn't have this requirement, and it works on both systems without installing Edge Canary. But I'd prefer to use TEdgeBrowser instead, to avoid an unnecessary dependency on a third party component.
What is the reason for this odd behavior for TEdgeBrowser, and does the same happen in RAD Studio 11 Alexandria? Can this be avoided so it works with a stable Edge installation on both systems?
EDIT: I later discovered that there is this property:
EdgeBrowser1->BrowserExecutableFolder = "C:\\Program Files (x86)\\Microsoft\\EdgeCore\\101.0.1210.53";
With that, all works. But, according to the documentation (Using TEdgeBrowser Component and Changes to the TWebBrowser Component), it should automatically locate the current version of the WebView2 control on the system. It does this on one system, but not on the development system.
TEdgeBrowser requires WebView2 Runtime in order to operate. More details on MS Edge Documentation website.
WebView2Loader.dll should be loadable by your application, in the same folder, known path or registered in path environment variable. Latest version is available on NuGet. Nupkg is a zip archive. Look in build\native\ folder.
TEdgeBrowser.BrowserExecutableFolder should point to WebView2 runtime folder in case of fixed version.
Fixed version distribution, placed inside your application folder seems the preferred way on your scenario.
MS claims that evergreen version will be distributed by default in next Windows versions.

Cordova Plugin Add/Remove for windows on a Mac

I am developing an app in Cordova that runs on iOS, Android, Windows and OSX. Everything is fine until you have to add or remove plugins. I develop the iOS, Android and OS X on a mac, and the Windows UWP on a windows machine.
When you try to add or remove a plugin you are stuck because on the mac I get the following error: "The platform "windows" does not appear to be a valid cordova platform." and fails.
When you try to add or remove a plugin on windows I get the following error: "The platform "android (or ios or osx)" does not appear to be a valid cordova platform." and fails.
Currently I remove windows from the platforms on the Windows computer, check the project in to github, check it out on my mac and and edit plugins for android/ios/osx then check it back in. After that I pull on my Windows and re-add the platform. The problem with this is cordova does not remember any images, app store associations, nuget packets etc making it a painstaking process that leads to many bugs.
Is there a way to ONLY add/remove a plugin on windows on the windows computer, and only for ios/android/osx on the mac and somehow make it all go together?
I would suspect this is happening because the platforms are not being successfully installed / removed. If you look in the platforms/ folder, check to see that the platforms that are acting up actually have valid folder structure and contents. If this is the case you need to manually remove the platforms.
Instead of removing the windows platform and committing to git, you should consider using the --nosave option: cordova platform remove windows --nosave. This way the changes are not saved to your package.json or configuration.xml. This would allow you to make changes on OSX without having to constantly check in the removed windows platform.
Something that may help is using the cordova repository management tool that I have created: https://www.npmjs.com/package/cordova-clean. This will help making sure all of the changes being made to the configuration are reflected in your current working directory across your machines / branches.

Z3-OPT binary files for the windows 64 bit machine

I am trying to get Z3-OPT (optimization) binary files for the windows 64-bit machine. To make these files, I already tried to compile the code from the unstable branch. However, I could not compile them as my Visual Studio Community edition does not contain "nmake" command. I tried to follow instructions on the following page:
https://github.com/Z3Prover/z3
Can anyone share with me the latest Z3-OPT binary files?
Z3-opt is now the same as Z3, so you can just use the main links for downloading Z3.
The releases are in: https://github.com/Z3Prover/bin/tree/master/releases
There is also a folder with nightly builds.
You have to enable C++ features in VS before you get the command line build tools. This involves updating the installation of VS itself, something you can do from "Apps and Features" (in Windows 10) or similar place in previous versions of Windows. There is already some online discussions about this question. For example, https://developercommunity.visualstudio.com/content/problem/39632/adding-nmake-to-vs2017.html.

WinObjC: Could not acquire lock file for module 'UIKit'

When trying to port the Calculator sample from the official Windows Bridge for iOS blog, I always get the following error after converting the project and trying to compile it:
could not acquire lock file for module 'UIKit' Calculator (Calculator\Calculator) W:\Source\Bridgetest\Calculator\Calculator\ViewController.h 9
I am using the latest version of the bridge 0.1 Preview (April 29, 2016).
Oh, and I am using Parallels for my Windows VM.
Any ideas?
I believe your question has been answered on Github, but I'll answer it here as well in case it's useful to anyone who finds this:
The problem here was the project and the WinObjC SDK were both located on a network share, which is how Windows identifies folders that Parallels shares between Windows and OS X. This causes problems for both vsimporter and Visual Studio.
Normally, vsimporter writes an absolute path to the WinObjC SDK in any imported projects. If you invoke vsimporter with the -relativepath option it will write a relative path instead. In either case, you also have the option to define WINOBJC_SDK_ROOT as an environment variable, which will take precedence over the path hard-coded in the project file.
If you would like to keep your code on a shared directory that is accessible from both OS X and Windows (so you can develop in Xcode and Visual Studio simultaneously from the same code base), you can do so. However, by default, Visual Studio will not register an app with the system if its files are on a network drive, so you'll have to change a few settings to get Visual Studio to build and run. Instructions for doing so can be found in our FAQ on Github.

How do I test the WDK 8.1 scanner file system minifilter driver sample?

I downloaded the WDK 8.1 and samples and using Win 7 Debug Win32 build configuration while building with Visual Studio 2013 for the "Scanner File System Minifilter Driver" sample solution. It successfully built the solution.
The build output 3 files of interest to me:
1) scanner.sys (the scanner file system minifilter driver)
2) scanuser.exe (the user-land executable that talked to the driver)
3) scanner.inf (driver installation file)
I copied the files over to my VMware virtual machine (XP 32-bit, in this case) and installed the driver using the .inf file which put the appropriate registry keys in the registry and put a copy of the .sys file into C:\Windows\System32\drivers. Then I ran "net start scanner" which started the driver successfully.
So far, this all worked fine. However ...
When I ran the scanuser.exe file it says it's not a valid Win32 application.
How do I go about testing this if I can't run the executable?
Are there build options I have to set in order for this to work?
Out of the box, Visual Studio 2013 will not produce executable that will run on Windows XP.
You must change the platform toolset:
In the Property Pages dialog box for the project, under Configuration Properties, General, set the Platform Toolset property to the desired Windows XP toolset. For example, choose Visual Studio 2012 – Windows XP (v110_xp) to create code that is binary compatible with the Microsoft Visual C++ 2012 Redistributable libraries.
In a similar project, I used the Visual Studio 2010 toolset.

Resources