locked
C++ DLL and Device drivers. What is the difference?

    Question

  • Hi, I'm kinda new about drivers but does anyone know what is the difference between a normal DLL and a driver? Seems like a driver is also a DLL but is there something different about it's compilation or anything like that which separates it from normal DLLs?
    Wednesday, April 08, 2009 2:51 AM

Answers

  • A driver runs in ring 0. A DLL does not have limit on where it runs. Search in a Driver Developer Community for previous discussions about DLL and drivers.
    MSMVP VC++
    • Marked as answer by Wesley Yao Tuesday, April 14, 2009 2:20 AM
    Wednesday, April 08, 2009 3:44 AM
  • A driver is a completely different animal.  You'd use a very different set of tools to build and debug one.  Get started on driver development by reading any of Walter Oney's books.  Well, all of them.
    Hans Passant.
    • Marked as answer by Wesley Yao Tuesday, April 14, 2009 2:20 AM
    Wednesday, April 08, 2009 3:11 PM

All replies

  • A driver runs in ring 0. A DLL does not have limit on where it runs. Search in a Driver Developer Community for previous discussions about DLL and drivers.
    MSMVP VC++
    • Marked as answer by Wesley Yao Tuesday, April 14, 2009 2:20 AM
    Wednesday, April 08, 2009 3:44 AM
  • A driver is a completely different animal.  You'd use a very different set of tools to build and debug one.  Get started on driver development by reading any of Walter Oney's books.  Well, all of them.
    Hans Passant.
    • Marked as answer by Wesley Yao Tuesday, April 14, 2009 2:20 AM
    Wednesday, April 08, 2009 3:11 PM
  • But in terms of VC++, can I actually build them there using it's own built in compiler? Can I change some of the settings in VC++ to actually build a driver without WDK?
    Thursday, April 16, 2009 6:14 AM
  • Yes, the compiler and linker you got are fine, assuming you are talking about Windows drivers and not mobile devices.  You can't use Visual Studio for anything else than editing files, so Express is fine too.
    Hans Passant.
    Thursday, April 16, 2009 7:26 AM
  • Do you know if there is a reference on how to go around to doing this? Developing drivers without the WDK build utility and just using VC++ express?

    Oh thanks for the replies, all very much appreciated.
    Thursday, April 16, 2009 8:31 AM
  • I already mentioned Walter Oney.  I'd recommend you first learn how to develop drivers using the Known To Work way.  An IDE like Express does nothing to make that easier.  If all of this is starting to sound like you might be in over your head, you are probably correct.
    Hans Passant.
    Thursday, April 16, 2009 8:59 AM
  • Thing is, I already have a virtual driver that I made based from the bitmap sample in the WDK. What I am trying now is to separate that driver code with some of the headers and .libs that that virtual driver needs and then just compile and make the driver with little or no modifications on the code with just using VC++ express.

    What I need to find out is how to change the settings in the VC++ project properties to just compile it. I've been using Steve's walkthrough (http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.development.device.drivers&tid=bc9f9078-775c-4e11-b080-9f8807229a3b&cat=en_US_d02fc761-3f6b-402c-82f6-ba1a8875c1a7&lang=en&cr=&sloc=en-us&m=1&p=1) but it seems that it's missing something. It creates a DLL file alright, just not something I can install.

    I've been also experimenting on DDKBuild but it seems that it still uses the native build utility in the WDK, which isn't what I'm looking for.

    Any suggestions?
    Thursday, April 16, 2009 9:44 AM
  • Also ring security shouldn't be applicable since printer driver should be in user-mode in XP and above. Ring 0 is for kernel mode drivers. I'm developing for XP and above.
    Friday, April 17, 2009 5:48 AM
  • Is there any way to develop device drivers in Visual Studio 2008 Pro?

    Wednesday, August 19, 2009 11:56 PM