wdk

prepend the “\\?\” string to the path - DriverPackageUninstall

笑着哭i 提交于 2020-01-03 02:28:18
问题 I used DriverPackageUninstall , to uninstall my driver. For this API I need to give "Inf Path" as the input. And I need to give this path as UNICODE string. To do this, I took the following statement from MSDN as reference. For a Unicode string, the maximum length is 32,767 characters. If you use the Unicode version, prepend the "\?\" string to the path. For general information about the format of file path strings, see Naming a File in the MSDN Library. But when I try the same in my code its

Silently use Microsoft XPS Document Writer printer to create XPS

陌路散爱 提交于 2019-12-31 03:23:06
问题 For some days now I've been battling with printing XPS to file without the dialog. I've read posts on the matter in CodeGuru and by Feng Yuan (MSDN), along with many discussion topics here and I am still lost. Specifically my scenario is that I have a 3rd party API that I must use, and it prints to the default printer (say Microsoft XPS Document Writer). I want to be able to "apply" a filename prior to the printing procedure, and of course not to have dialog. I've tried working with WinDDK -

XP系统安装WDK

空扰寡人 提交于 2019-12-31 02:21:38
XP系统安装WDK 在XP系统安装WDK7.1.0,装的脑袋疼;最后还是得慢慢的找提示错误日志;效率高 官网下载的文件,解压后安装,在编译后依然出现错误,根据网上进行重新下载后,还是不能够进行解决;最后还是自己搞吧; 具体安装过程如下: 还是在官网下载WDK安装包;解压安装、安装完成后肯定是不成功的,修改方法有以下:,如果以下方法不能解决,可能是安装包不是在官网下载的,重新从官网进行下载; 选择WDK版本为7.1.0;安装完成后,检测是否安装成功: To verify that the WDK Build Environments installed successfully Click Start. Point to All Programs > Windows Driver Kits > WDK build# > Build Environments > Windows XP. Click x86 Checked Build Environment. At the command prompt, type build -cZ. 编译完成后显示warning,error:修改如下: 1.在根目录下会有编译的日志文件、warning文件、error文件,通过写字板打开文件,修改文件保存格式; 根据warning文件中的提示修改相关文件为unicode 格式编码保存; (C:

Windows Kernel Mode Driver Project Template doesn't appear in Visual Studio Project Template menu after downloading WDK

烈酒焚心 提交于 2019-12-25 12:57:09
问题 Recently I've menaged to develop Windows Kernel Mode Driver so I started reading about that. I've read I need to download WDK. I use Visual Studio 2017 Community so I've downloaded WDK (for Windows 10) version 1709 (in default folder if it matters). When I try to create new project there should appear new templates for developing drivers but they don't. (From what I've read I've deduced I only need to download the WDK and it's enough, am I right? It's described like that on MSDN) So my

Visual Studio WDK integration Issue

為{幸葍}努か 提交于 2019-12-24 22:20:11
问题 Recently I installed Visual Studio 2017 Enterprise along with WDK 10 for 1709 My workloads contained C++ workload. . My machine is a Windows 8.1 Pro with net framework 4.6.1. After installing the WDK I expected the templates to come in the Legacy section of Visual C++ but no legacy option is present in it. I don't understand what is the problem. Please help me. Thanks in advance 回答1: I resolved the issue. It was due to a missing windows 10 SDK. Reinstallating the WDK with appropriate SDK

Passing preprocessor variable to nmake build environment

爱⌒轻易说出口 提交于 2019-12-23 14:49:48
问题 I am having issues with building driver using nmake on Win7 x64 build environment. I am defining a preprocessor variable and passing it over the command line using - build /nmake "USER_C_FLAGS=/DMyVersion=3" And the build log is - ... /DMyVersion=3 /typedil- /wd4603 /wd4627 .... So, I clearly see the variable as part of the compiler options. Now in a header fie, I do #define otherVersion 10 #ifdef MyVersion #undef otherVersion #define otherVersion MyVersion #endif #define FileVersion

Macro redefinition warnings

随声附和 提交于 2019-12-23 04:42:40
问题 I am migrating a windows driver project from VS 2005 to VS 2012 . Many macro redefinition warnings are generated on VS 2012 like - .... 1>C:\WINDDK\7600.16385.1\inc\api\sal.h(707): warning C4005: '__format_string' : macro redefinition 1> c:\program files (x86)\microsoft visual studio 11.0\vc\include\sal.h(2860) : see previous definition of '__format_string' ..... It was compiling fine with sal.h shipped with VS 2005 because it doesn't have the macro __format_string and others. However, the

NDIS and miniport driver

早过忘川 提交于 2019-12-22 19:59:14
问题 I am trying to modify a ethernet driver using WDK tools provided in Visual Studio 2012. The samples provided in the WDK are 'miniport adapter' and 'NDIS Light Weight Filter' among others. I am still at the very beginning of driver writing and hence finding it tough to navigate through the code. I was able to install the miniport adapter after building it in Visual Studio 2012 [Shows up as 'Microsoft Virtual Miniport Adapter' in my network adapters list.] I am able to assign it a IP address

How to trap file access attempts with a filter driver (kernel) and offer dialog to allow/deny (user)?

不羁岁月 提交于 2019-12-20 10:55:43
问题 I've been looking at Windows's File System Filter Drivers. I started with this "FsFilter" example: http://www.codeproject.com/Articles/43586/File-System-Filter-Driver-Tutorial With effort, I managed to get it built and signed in versions that work on everything from 64-bit Win8 to 32-bit WinXP. (Well, as long as I run Bcdedit.exe -set TESTSIGNING ON to allow it to accept my test certificate, since I didn't pay Microsoft $250 to sign my .SYS file. :-/) Now I want to modify FsFilter. I'd like

Cannot open include file: 'ntddk.h'

 ̄綄美尐妖づ 提交于 2019-12-19 05:16:34
问题 I'm been trying to get into driver development (queue the "don't do that") I have been looking at this msdn page and after installing the WDK (Windows Driver Kit) 10 I am still unable to compile the example that they use on that page. I have looked at other SO questions but I am unable to find the installed directory of the WDK. When I attempt to run the setup I am greeted by this: How can I solve this? 回答1: You need to add WDK headers path to your vcxproj include directories: vcxproj