Everytime I see a driver tutorial I see they use visual studio, I was just wondering if it is absolutely required to install it in order to develop windows drivers?
Say for example I would like to compile the following driver: (source)
NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
{
DbgPrint("Hello World\n");
return STATUS_SUCCESS;
}
How would I be able to compile/link it without visual studio? I have searched all over the place.
The linked tutorials are based on older WDK builds. You can get the old WDK and follow the tutorial, but I don't really recommend it.
Recently, the common way to develop Windows drivers is to use Visual Studio, but there is also a similar approach to the tutorial, which is developed from the command line environment.
https://learn.microsoft.com/en-us/windows-hardware/drivers/develop/using-the-enterprise-wdk
Of course, you don't have to install Visual Studio as using EWDK.
If you would like to use a different IDE then you must use the Enterprise Windows Driver Kit (EWDK) https://learn.microsoft.com/en-us/windows-hardware/drivers/develop/using-the-enterprise-wdk
After downloading and unzipping the archive you will need to launch LaunchBuildEnv.cmd and then run MsBuild.
Example:
Msbuild my_driver_project.vcxproj /p:configuration=debug /p:platform=x64
This assumes that you will write your own vcxproj file. Details about the file format here: https://learn.microsoft.com/en-us/cpp/build/reference/vcxproj-file-structure?view=vs-2019 and you could look at some driver samples from Microsoft here: https://github.com/microsoft/Windows-driver-samples
If you are just starting out with Windows Drivers I would say that using Visual Studio and WDK is a good idea because you can concentrate more on core Driver Development concepts and after you have something working you can write your own vcxproj file and use the eWDK. Having some examples of vcxproj files is useful.
If you do go down the Visual Studio route you can use Visual Studio Community edition which is free for non-commercial use.
It is important to install Visual Studio prior to WDK because the WDK is essentially a plugin to Visual Studio.
Additional instructions and download links for Visual Studio and WDK https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk
Related
So, I wanted to develop a little Filesystem Mini-Filter driver for windows.
I have installed Visual Studio 2019 and 2022 community edition with the following list of packages:
WDK
SDK
Python Development
Desktop development with C++
Universal Windows Platform development
Linux and embedded development with C++
Optional Packages:
C++ CMake tools for Linux
IntelliCode
Embedded and IoT tools
Legacy Embedded and IoT tools
With those installed I still don't have FileSystem Mini-Filter project type available. I also tried to search for it under Individual Components but it do not exist.
I came across this question: https://learn.microsoft.com/en-us/answers/questions/720582/filesystem-mini-filter-template-won39t-appear-in-v.html
Which seem to have worked for the guy, but a re-install did not work for me.
Is there anything I am missing here?
I am taking C course and was required to work on VS community 2017. I've been trying to install it on my mac, and the process seem to go ok but I can't find an option to write in C, or to open a project with "Visual C".
It appears that Visual Studio for Mac does not support C or C++. Your options seem to be either Visual Studio Code or running Windows in a virtual machine on your Mac. You can check this post for details: https://social.msdn.microsoft.com/Forums/en-US/ef99e9f5-2a48-423b-b6c0-fa5617d7c63d/how-do-i-get-c-to-work-on-visual-studio-for-mac?forum=visualstudiogeneral
I have a hard time trying to do something I think is really simple (I must not be the first one to want to do that). I use Visual Studio 2017 on Windows 7 to do some C code, and I need inflate/deflate for zip.
I search a little, and I found zlib. It seem to be exactly what I search: free, cool copyright, no patent and extensively used and tested in other project.
So, I start to download the latest version (zip of 1.2.11) and here I go, trying to "simply" get the DLL.
However, the documentation state that in order to compile "zlib1.dll", I have to use "./contrib/vstudio/vc..", with ".." the right Visual Studio. But I have Visual Studio 2017 and there are only "vc9" to "vc14", "vc14" being Visual Studio 2015.
The doc say that I have to use Microsoft Visual C++ 2015, and indeed, when I force open with vs2017, I have integrity error.
So I try to install MVC++ 2015, but then it say that I can't install it because I already have something (VS2017) installed.
Is there really no way to achieve something so basic, or there is knowledge that I don't know?
Open source projects can be a challenge to build as their support tends to lag well behind the latest versions of Visual Studio. This is one reason why Visual Studio now supports cmake directly.
That said, the easiest way to build zlib for Windows is just use a NuGet package. I personally use zlib-msvc14-x86 or zlib-msvc14-x64 which are binary compatible with VS 2015 Update 3, VS 2017, and VS 2019. They also provide a static library instead of a DLL.
I am trying to build Mozilla on Windows 7 64bit
I tried to run this start-shell-msvc2015.bat but got this error.
MozillaBuild Install Directory: C:\mozilla-build\
Visual C++ 2015 Directory: C:\Program Files (x86)\Microsoft Visual Studio 14.0\V
C\
Windows SDK Directory: C:\Program Files (x86)\Windows Kits\8.1\
Unable to call a suitable vcvars script. Exiting.
Press any key to continue . . .
I did everything according to their instructions
When in doubt, search Google for the error message. From the first result:
Hallvord R. M. Steen:
To anybody else who might have this problem: it's caused by choices made during installation, and the installer options were somewhat confusing. I don't remember the exact details, but I think the "Default" installation no longer gives you the required scripts - the "Default vs custom" section on https://msdn.microsoft.com/en-us/library/e2h7fzkw%28v=vs.140%29.aspx seems to confirm that you need to choose "Custom" during install and enable Visual C++ tools specifically.
Andrew Overholt: You're right, Hallvord. I went back to my VS2015 installation .exe download, clicked "Modify [the existing installation]" and picked "Common Tools for Visual C++ 2015" under "Programming Languages" > "Visual C++".
Also you'll need at least update 3 if you're using the VS2015 Community Edition. From that Mozilla dev docs page:
Once you’re up to date, download and install Visual Studio Community 2015 Update 3 from Microsoft. If you have an earlier version of Visual Studio, you'll need to upgrade; Firefox relies on C++ features that aren't supported in older versions of Visual Studio. Do not accept the default configuration. Instead, select **Programming Languages > Visual C++ > Common Tools for Visual C++ 2015.*
See also this question on Super User.
Furthermore, the MDN docs actually were updated with this info after that report, and indeed the current build instructions contain, in bold:
Be sure to install the "Common Tools for Visual C++ 2015", which requires a customized installation in Visual Studio 2015.
In the prerequisites section.
Also you'll need at least update 3 if you're using the VS2015 Community Edition. From that Mozilla dev docs page:
Once you’re up to date, download and install Visual Studio Community 2015 Update 3 from Microsoft. If you have an earlier version of Visual Studio, you'll need to upgrade; Firefox relies on C++ features that aren't supported in older versions of Visual Studio. Do not accept the default configuration. Instead, select Programming Languages > Visual C++ > Common Tools for Visual C++ 2015.
When I deploy my application in VS2010, I see two options: InstallShield LE and Visual Studio Installer. Why are there two options? What is the advantage of using InstallShield LE over Visual Studio Installer?
To update this a little, Microsoft seems to have thrown in the towel on their own installer project type. It is not included in the Visual Studio 11 developer preview, and there are forum/blog posts that indicate this is no longer a supported product. If you are searching for what to use for new projects, I would steer clear of the Visual Studio Installer. Hopefully when VS11 finally is released, there will be a free version of InstallShield included.
These are just default tools that can help you create simple installers for your applications. Most difference are UI related, there's not much functionality in either of them.
If you want to choose a setup authoring tool, take a look at these threads:
https://stackoverflow.com/questions/4621478/what-is-the-best-windows-installer
How to create an installer using Java?
What is the best installer?
There are lots of threads like this which mention free and commercial setup authoring tools.
Basically, if you want a simple installer, you can use Visual Studio setup or InstallShield LE. If you want more advanced features, you need to find a different setup authoring tool that fits your needs.