I am very new to driver development and am trying to use DDKbuild.bat from the downloads section with Visual Studio 2008 so I can build drivers right in VS. I copied the .bat file to the same directory as the WDK and set up the VC++ Directories to include this path by adding the line “C:\C:\WinDDK\7600.16385.1”. When I try to use the build line “ddkbuild -W7 fre .” it gives me an error:
Error result 6 returned from ‘C:\Windows\SysWow64\cmd.exe’.
I tried looking for another post to get help with setting this up but couldn’t seem to find anything. Could someone point me in the right direction with this?
I used DDKBuild a while back and got pretty frustrated with it myself, and just resorted to command line with TextPad.
Recently a friend of mine recommended VisualDDK, which integrates really nicely into VS2010, and also supports 2005 and 2008. You might try that instead. I was pretty surprised that even basic breakpoint debugging worked easily as well. The best part is getting the intellisense though.
> I copied the .bat file to the same directory as the WDK and set up the VC++ Directories to include this path by adding the line “C:\C:\WinDDK\7600.16385.1”.
Perhaps better is not to touch VC++ directories; instead
create a small helper .bat file in your project directory, like this:
: wdkhelper.bat
set W7BASE=C:\WinDDK\7600.16385.1
call %W7BASE%\ddkbuild.bat -WIN7%1 %2 . %3
And invoke it as:
wdkhelper.bat XP FRE
Add WDK include directories in the project settings, for intellisense.
(I have a VC property sheet that does all this at once: http://pastie.org/2102829
where wdkwrap is a small helper script like above, but it accepts VC project configuration names as parameter)
Also, DDKBUILD is trying to set ERRORLEVEL in one place. Unfortunately, it screws up the command processor. ERRORLEVEL is a special internal name. If an explicit variable with that name is set, ERRORLEVEL ceases to work properly.
Following is a diff to fix this problem in DDKBUILD.CMD file (V7.4/r60
(2009-11-28)):
664c664,667
< set ERRORLEVEL=0
::do not use "set ERRORLEVEL=0" as this "disables" ERRORLEVEL
::use "verify >nul " to reset ERRORLEVEL
verify >nul
668c671
< if not "%ERRORLEVEL%" == "0" call :ShowErrorMsg 9 "%ERR_SetEnvFailed%"
& goto :USAGE
if %ERRORLEVEL% neq 0 call :ShowErrorMsg 9 "%ERR_SetEnvFailed%" & goto
:USAGE
672c675,676
< if %ERRORLEVEL% neq 0 ( call :ShowErrorMsg 254 "BUILD not found or not
executable!" & goto :END )
::ERRORLEVEL will be 9009 if command could not be executed
if %ERRORLEVEL% equ 9009 ( call :ShowErrorMsg 254 "BUILD not found or
not executable!" & goto :END )
780c784
< if %ERRORLEVEL% neq 0 ( popd & call :ShowErrorMsg 254 "PREfast not
found or not executable!" & goto :END )
if %ERRORLEVEL% equ 9009 ( popd & call :ShowErrorMsg 254 "PREfast not
found or not executable!" & goto :END )
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-460688- xxxxx@lists.osr.com] On Behalf Of xxxxx@broadcom.com
Sent: Wednesday, June 22, 2011 2:09 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Using DDKBuild with Visual Studio
Also, DDKBUILD is trying to set ERRORLEVEL in one place.
Unfortunately, it
screws up the command processor. ERRORLEVEL is a special internal
name. If
an explicit variable with that name is set, ERRORLEVEL ceases to work
properly.
Remove that line from DDKBUILD.BAT.
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit: OSR Seminars – OSR
To unsubscribe, visit the List Server section of OSR Online at ListServer/Forum
Also, DDKBUILD is trying to set ERRORLEVEL in one place. Unfortunately, it screws up the command processor. ERRORLEVEL is a special internal name. If an explicit variable with that name is set, ERRORLEVEL ceases to work properly.
That’s not entirely accurate: %ERRORLEVEL% stops working, but ERRORLEVEL
continues to work. To test the error level, you should use something like:
IF ERRORLEVEL 1 (
command_failed_statements
) ELSE (
command_succeeded_statements
)
“IF ERRORLEVEL 1” checks if ERRORLEVEL is 1 or more.
“IF ERRORLEVEL 1” checks if ERRORLEVEL is 1 or more.
I should also add that this works for applications that return negative
values too, because the return value gets converted into a level between
0 and 255 (e.g. -5 gets returned as 250).
Is this Hollistech or OsrOnline DDKBUILD, or both?
Gary G. Little
C 952-454-4629
H 952-223-1349
On Jun 22, 2011, at 5:32, Bruce Cran wrote:
> On 22/06/2011 09:52, Bruce Cran wrote: >> “IF ERRORLEVEL 1” checks if ERRORLEVEL is 1 or more. > > I should also add that this works for applications that return negative values too, because the return value gets converted into a level between 0 and 255 (e.g. -5 gets returned as 250). > > – > Bruce Cran > > — > NTDEV is sponsored by OSR > > For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars > > To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
> Where would I invoke the wdkhelper.bat XP FRE from?
When you create a new makefile project and add the property sheet to it, the commands from the property sheet will automagically appear in the NMAKE section of the project properties.
You can edit the commands there or directly in the property sheet.
You can put there any environment variable or VC macro such as $(ConfigurationName) $(PlatformName) and so on.