{"id":55,"date":"2006-11-16T12:15:36","date_gmt":"2006-11-16T12:15:36","guid":{"rendered":"https:\/\/driverentry.com.br\/en\/2006\/11\/16\/kernel-visual-studio-2005\/"},"modified":"2026-07-24T18:46:58","modified_gmt":"2026-07-24T18:46:58","slug":"kernel-visual-studio-2005","status":"publish","type":"post","link":"https:\/\/driverentry.com.br\/en\/2006\/11\/16\/kernel-visual-studio-2005\/","title":{"rendered":"Kernel + Visual Studio 2005"},"content":{"rendered":"<div style=\"text-align: right;\"><a href=\"https:\/\/driverentry.com.br\/2006\/11\/16\/kernel-visual-studio-2005\/\"><img loading=\"lazy\" decoding=\"async\" title=\"Em Portugu\u00eas\" src=\"https:\/\/driverentry.com.br\/en\/wp-content\/uploads\/2026\/07\/br.gif\" alt=\"\" width=\"21\" height=\"19\" \/><\/a><\/div>\n<p>Driver or low-level software developer is used to build their projects on the command line, use text editors like Notepad or Norton Editor to code their drivers.\u00a0It&#8217;s like my friend <a href=\"http:\/\/code-behind.blogspot.com\/\">Thiago<\/a> says: <em>&#8220;Knife in the teeth and blood in the eyes&#8221;<\/em>. Using the command <strong>TYPE | MORE<\/strong> to see the compilation\u00a0error files shows how superior human beings we are, technology dominants who don&#8217;t under-utilize our brains, don&#8217;t need those superfluous\u00a0tools like graphical interface with syntax coloring, IntelliSence\u00a0or even auto-complete. We are at the top of the food chain.<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/driverentry.com.br\/en\/wp-content\/uploads\/2026\/07\/build.png\" alt=\"\" \/><\/p>\n<p>If you really believe that, then it is better\u00a0you leave this post right here.\u00a0Today I going to defend the use of tools that help, and much, when a driver is coded and it is needed to deal with functions with large number of parameters and endless structures.<\/p>\n<p>Using or not using the Visual Studio to generate drivers is a kind of discussion that tends to be infinite, such as the use of C++ for Kernel Mode\u00a0development.\u00a0On the one hand, there are those ones who argue that the environment is almost never perfectly configured to compile drivers.\u00a0I&#8217;ve read posts from real authorities on the subject by talking about how many days were needed to find a bug that was generated by a compiler optimization or even a bad <em>define<\/em> that was generated by the Wizard.\u00a0Those who say that use Visual Studio as development environment requires a minimum knowledge of each parameter used in the call to <strong>cl.exe<\/strong>; that the ideal is to use the good old <strong>Build<\/strong> that parse files <strong>SOURCES<\/strong>, <strong>DIR<\/strong> and <strong>MAKEFILE<\/strong> and be quite sure about the environment set by the DDK\u00a0shortcuts is correct.\u00a0On the other hand, there are those ones who do not give up the convenience of having an integrated environment, the facility just about pressing a key to see the detected error file\u00a0line , the use of syntax coloring, IntelliSence, auto-complete and many other advantages\u00a0that Visual Studio offers.<\/p>\n<p>I have been doing this for some time and I remember when the DDK started to bring the compiler embedded\u00a0into the Windows XP\u00a0kit.\u00a0The main purpose of this change in the DDK was a trial to separate the driver development environment from application development environment.\u00a0This link has already created many problems.\u00a0The Windows NT 4.0\u00a0DDK was based on VC 4.2, but with the arrival of VC 5.0 and later VC 6.0, the symbol table format has been changed and WinDbg stopped working.\u00a0At that time, I used to utilize\u00a0<a href=\"http:\/\/en.wikipedia.org\/wiki\/Softice\">SoftIce<\/a> much\u00a0more than\u00a0<a href=\"http:\/\/www.microsoft.com\/whdc\/devtools\/debugging\/default.mspx\">WinDbg<\/a> to debug drivers. I continued using the Visual Studio without even noticing this problem.\u00a0I only had symbol problems when Visual Studio came on version 7.0.\u00a0The VToolsD does not support the new symbol format\u00a0yet.\u00a0Conclusion, I still use VC 6.0 to compile VXDs.\u00a0Actually, it&#8217;s not impossible to use VC 7.0 for this, but we won&#8217;t able to debug it.<\/p>\n<p><img decoding=\"async\" style=\"float: left; margin: 0px 10px 10px 0px;\" src=\"https:\/\/driverentry.com.br\/en\/wp-content\/uploads\/2026\/07\/newenvvar.png\" alt=\"\" border=\"0\" \/><\/p>\n<p>Later, when we did the upgrade from VS2003 to VS2005, the <a href=\"http:\/\/caloni.com.br\/blog\/2006\/05\/o-que-muda-em-c-no-visual-studio-2005.html\">most drastic changes<\/a> have turned my life become a little bluer.\u00a0Since this time, I started using the best of both worlds, that is, the assurance\u00a0of having a properly configured environment and all the tools\u00a0convenience that the VS2005 editor could offer.<\/p>\n<p>How can we do it?\u00a0OK, let&#8217;s use the project created in post <a href=\"https:\/\/driverentry.com.br\/en\/2006\/09\/11\/getting-started\/\">Getting Started<\/a> as a starting point.\u00a0Initially we will need to download the file <strong>DDKBUILD.CMD<\/strong> from <a href=\"http:\/\/www.osronline.com\/article.cfm?article=43\">OSR Online<\/a> and save it in a directory that would be in your machine\u00a0<strong>PATH<\/strong>.\u00a0That CMD will need the <strong>WNETBASE<\/strong> environment variable configured to the DDK installation\u00a0base directory.\u00a0This file is a way to make an external <em>build<\/em> with Visual Studio.\u00a0To do this, create a <em>Makefile<\/em> project in Visual Studio as shown below.<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/driverentry.com.br\/en\/wp-content\/uploads\/2026\/07\/newmakefileproject.png\" alt=\"\" \/><\/p>\n<p>After entering in your new project\u00a0name folder, where it will be created, just click on &#8220;OK&#8221;. Even without setting up anything, click &#8220;Finish&#8221; at the next window. After creating the project, add the files in Solution Explorer.\u00a0Then edit the project properties as it is shown below.\u00a0Note that in the &#8220;Include Search Path&#8221; I&#8217;m assuming that DDK installation was performed in the C:\\WinDDK\\3790.\u00a0This field has no influence over the compilation process; it just tells IntelliSence which directories should be used to serve as sources for its database.<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/driverentry.com.br\/en\/wp-content\/uploads\/2026\/07\/propertypages.png\" alt=\"\" \/><\/p>\n<p>From this point, we can build the project like a User Mode\u00a0project.\u00a0The images below do not require comments.\u00a0I suppose it&#8217;s not necessary saying that drivers cannot be debugged using the Visual Studio environment.\u00a0Remember that Kernel debugging requires special debuggers\u00a0for that purpose as I mentioned in my <a href=\"https:\/\/driverentry.com.br\/en\/2006\/10\/24\/serial-killers\/\">last post<\/a>.<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/driverentry.com.br\/en\/wp-content\/uploads\/2026\/07\/buildoutput.png\" alt=\"\" \/><\/p>\n<div>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/driverentry.com.br\/en\/wp-content\/uploads\/2026\/07\/vsbook.png\" alt=\"\" \/><\/p>\n<\/div>\n<p>One particularly interesting window that has been added to Visual Studio 2005 is the &#8220;Code Definition Window&#8221;, displaying where symbols have been defined as you write them in the code window.\u00a0See the example when I write a call to IoSetCompletionRoutine.<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/driverentry.com.br\/en\/wp-content\/uploads\/2026\/07\/codedefinition.png\" alt=\"\" \/><\/p>\n<p>At last, take a look at the options offered by DDKBUILD.\u00a0You can list your choices by simply opening a command prompt window and running DDKBUILD without any parameter.\u00a0Note that we can compile drivers also using the <a href=\"http:\/\/www.microsoft.com\/whdc\/devtools\/tools\/PREfast.mspx\">PRE<\/a><em><a href=\"http:\/\/www.microsoft.com\/whdc\/devtools\/tools\/PREfast.mspx\">f<\/a><\/em><a href=\"http:\/\/www.microsoft.com\/whdc\/devtools\/tools\/PREfast.mspx\">ast<\/a>.<\/p>\n<p>That&#8217;s it&#8230; Have fun! \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Driver or low-level software developer is used to build their projects on the command line, use text editors like Notepad or Norton Editor to code their drivers.\u00a0It&#8217;s like my friend Thiago says: &#8220;Knife in the teeth and blood in the eyes&#8221;. Using the command TYPE | MORE to see the compilation\u00a0error files shows how superior [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-55","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/driverentry.com.br\/en\/wp-json\/wp\/v2\/posts\/55","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/driverentry.com.br\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/driverentry.com.br\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/driverentry.com.br\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/driverentry.com.br\/en\/wp-json\/wp\/v2\/comments?post=55"}],"version-history":[{"count":2,"href":"https:\/\/driverentry.com.br\/en\/wp-json\/wp\/v2\/posts\/55\/revisions"}],"predecessor-version":[{"id":57,"href":"https:\/\/driverentry.com.br\/en\/wp-json\/wp\/v2\/posts\/55\/revisions\/57"}],"wp:attachment":[{"href":"https:\/\/driverentry.com.br\/en\/wp-json\/wp\/v2\/media?parent=55"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/driverentry.com.br\/en\/wp-json\/wp\/v2\/categories?post=55"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/driverentry.com.br\/en\/wp-json\/wp\/v2\/tags?post=55"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}