How to build workspace from DDK examples?
Asked Answered
S

4

5

I am new to win32 programming and also to driver programming. I have installed Windows DDK on my system and have got some examples with the DDK but those examples don't have dsw file.

I wanted to know how can I create .dsw file so that I can open that workspace in VC6.

Sthenic answered 16/6, 2009 at 4:2 Comment(0)
G
5

Most people who build DDK/WDK projects in Visual Studio do so using a 'makefile' project that invokes the DDK's build.exe utility. This works quite well- you get the code navigation capabilities of Visual Studio while building your DDK project using the standard, supported DDK tools.

Note that the DDK comes with it's own set of compilers, and those compilers should be used to build DDK projects.

OSR has a little set of .cmd scripts that is supposed to make this easier (it's been years since I've done anything with those; I really can't remember how well they work):

Another similar tool is available from Hollis Technology:

As far as debugging goes, unfortunately the VS debugger won't work for kernel mode driver debugging. For that, get the Debugging Tools for Windows package which has a great set of debuggers. The GUI debugger, WinDbg, is quite nice even if it's not quite up to the usability of Visual Studio's. And the documentation with the Debugging Tools is outstanding - you can learn a lot about Windows internals just by reading the WinDbg docs.

Georganngeorge answered 16/6, 2009 at 4:34 Comment(3)
"own set of compilers" -- Really? I thought it used the same (commandline-driven) compiler as the IDE.Souvenir
They are usually slightly different version in the minor version number area - I'm not saying you'll run into a bunch of problems, but the DDK team will definitely not support other compilers. Also, when a new version of Windows is coming out, there is often new stuff in the DDK compiler that's not in the released version of VC.Georganngeorge
@Souvenir update after many years. The whole principle was abandoned after the WDK for Windows 7. Since the Windows 8 WDK the WDK integrates into a pre-existing VS installation (unless you use the Enterprise WDK) and uses the compiler and overall toolchain from VS again. This used to be the case prior to the Windows XP DDK, too ... when VS6 or similar was required as toolchain.Waers
S
2

The last time I looked (which was years ago), you don't build device drivers using the Visual Studio IDE: the DDK has its own build.exe utility (similar idea but not the same as makefiles); and apparently this is still true as of early 2008, see for http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/4382c9b66f8611e9?pli=1

I expect that "how to build" is described in the DDK documentation.

NB: the above statements were true between the XP DDK and Windows 7 WDK inclusive. It is no longer true since the Windows 8 WDK, which integrates with Visual Studio and uses its toolchain. Similarly, prior to the XP DDK, Visual Studio was required to build with the DDKs.

Souvenir answered 16/6, 2009 at 4:10 Comment(4)
Hi ChrisW, thanks for that info. this means that there is no way debug through DDK examples? I wanted to execute line by line and understand flow. How can this be done for DDK examples awaiting for ur responseSthenic
Well, the build can generate symbolic debug information files, so debugging is possible. I don't think you can use the Visual Studio IDE debugger though (though that may depend on what sort of device driver it is anyway: is it a user-mode or a kernel mode driver that you're interested in?). Not using the VS IDE debugger doesn't mean you can't debug: it means you use a different kind of debugger (when I was doing it, years ago, the principal kernel-mode debuggers were called WinDbg and/or Softice).Souvenir
You should still be able to use a debugger, although probably the Visual Studio debugger is out of the question for driver developmentTiffaneytiffani
This may not sound like good news, but once you've learned how to build the sample, to debug, and to read the DDK documentation, the rest of the job is more-or-less ordinary.Souvenir
U
0

ChrisW is correct, you can't use Visual Studio (unless there is a way to set it).

Anyway, for start debugging you can use DebugView to print simple messages with DbgPrint.

Unapproachable answered 16/6, 2009 at 4:37 Comment(1)
You always could, simply by cheating with the PATH variable, but it never was a supported way as far as drivers are concerned.Waers
L
0

I think better you integrate with Visual Studio 2005, 2008 or 2010 with this tool:

http://visualddk.sysprogs.org/versions/1.5.6

Largehearted answered 27/12, 2011 at 17:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.