UMDF And Visual Studio

Hi All,

I am using WDK build 6000 for my user mode driver
development. I compiled and loaded a UMDF driver using
the DDK Build environment. Now I am trying to debug
the same using visual studio ( Not looking for WinDbg
now).

So, I am creating a build setup in visual studio and
later attach the UMDF process for debugging. But I am
un able to build my driver using VC. I used the
DDKBUILD batch program.

  1. Can anyone point out what option I have to use in
    DDKBUILD batch file while using WDK build 6000. I used
    ddkbuild -WLHXP chk . -cZ -WDF. Can any one point out
    the exact option and Base directory

2)Is there any other way to debug the driver using VC.
I found one article in WPD team Blog, which tells to
use the “File/New/Project from Existing Code…” menu.
I tried that, and no luck. Can anyone point out the
exact options I need to use while creating the project
in this case?.

Any help is appreciated !!!

Thanks
Suja.


No need to miss a message. Get email on-the-go
with Yahoo! Mail for Mobile. Get started.
http://mobile.yahoo.com/mail

Hi All,

I managed to make it working !!!T hanks to all…

Regards
Suja.

— SUJA JAMES wrote:

> Hi All,
>
> I am using WDK build 6000 for my user mode driver
> development. I compiled and loaded a UMDF driver
> using
> the DDK Build environment. Now I am trying to debug
> the same using visual studio ( Not looking for
> WinDbg
> now).
>
> So, I am creating a build setup in visual studio and
> later attach the UMDF process for debugging. But I
> am
> un able to build my driver using VC. I used the
> DDKBUILD batch program.
>
> 1) Can anyone point out what option I have to use in
> DDKBUILD batch file while using WDK build 6000. I
> used
> ddkbuild -WLHXP chk . -cZ -WDF. Can any one point
> out
> the exact option and Base directory
>
> 2)Is there any other way to debug the driver using
> VC.
> I found one article in WPD team Blog, which tells to
> use the “File/New/Project from Existing CodeE
> menu.
> I tried that, and no luck. Can anyone point out the
> exact options I need to use while creating the
> project
> in this case?.
>
> Any help is appreciated !!!
>
> Thanks
> Suja.
>
>
>
>

> No need to miss a message. Get email on-the-go
> with Yahoo! Mail for Mobile. Get started.
> http://mobile.yahoo.com/mail
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR
> Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


Don’t get soaked. Take a quick peek at the forecast
with the Yahoo! Search weather shortcut.
http://tools.search.yahoo.com/shortcuts/#loc_weather

OH, how did you achieve that ??

i also want to know how to debug driver using VC , can you give me
your methods ?

2007/3/26, SUJA JAMES :
> Hi All,
>
> I managed to make it working !!!T hanks to all…
>
> Regards
> Suja.
>
> — SUJA JAMES wrote:
>
> > Hi All,
> >
> > I am using WDK build 6000 for my user mode driver
> > development. I compiled and loaded a UMDF driver
> > using
> > the DDK Build environment. Now I am trying to debug
> > the same using visual studio ( Not looking for
> > WinDbg
> > now).
> >
> > So, I am creating a build setup in visual studio and
> > later attach the UMDF process for debugging. But I
> > am
> > un able to build my driver using VC. I used the
> > DDKBUILD batch program.
> >
> > 1) Can anyone point out what option I have to use in
> > DDKBUILD batch file while using WDK build 6000. I
> > used
> > ddkbuild -WLHXP chk . -cZ -WDF. Can any one point
> > out
> > the exact option and Base directory
> >
> > 2)Is there any other way to debug the driver using
> > VC.
> > I found one article in WPD team Blog, which tells to
> > use the "File/New/Project from Existing Code?E
> > menu.
> > I tried that, and no luck. Can anyone point out the
> > exact options I need to use while creating the
> > project
> > in this case?.
> >
> > Any help is appreciated !!!
> >
> > Thanks
> > Suja.
> >
> >
> >
> >
>
> > No need to miss a message. Get email on-the-go
> > with Yahoo! Mail for Mobile. Get started.
> > http://mobile.yahoo.com/mail
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > To unsubscribe, visit the List Server section of OSR
> > Online at
> > http://www.osronline.com/page.cfm?name=ListServer
> >
>
>
>
>
>

> Don’t get soaked. Take a quick peek at the forecast
> with the Yahoo! Search weather shortcut.
> http://tools.search.yahoo.com/shortcuts/#loc_weather
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>

Hi,

Please find the steps

1.Compiling using VS

  1. Copy the DDKBuild.bat file to a standard location
    or add file location to the PATH environment variable.
    Better to copy in folder.

    2. Set the environment variable “WLHBASE” to the DDK
    home directory. (This depends on the DDK/WDK used for
    development.). This document assumes that the user is
    using WDK. Please refer the DDKBUILD.BAT help for all
    options and DDK version support.

    3. Start Visual Studio and choose “New Blank Solution”

    4. Choose “Visual C++ Project” and a “Makefile
    Project” Template

    5. Click OK and create the new project, This will
    pop-up the “Application Settings” wizard

    6. Set Build command line as “ddkbuild -WLH chk .
    –WDF”

    7. Set Rebuild command line as “ddkbuild -WLH chk .
    -cZ -WDF”

    8. Click Finish and complete the project creation
    steps.

    9. Copy the driver source code and conventional
    makefile, sources file to the project location

    10. Now from visual studio, you should be able to
    build driver

    11. Add the driver source code to the project manually

    2. Debugging using VS

    1. For the UMDF host process to break on debugger, the
    registry values “HostProcessDbgBreakOnDriverLoad”
    and”HostProcessDbgBreakOnStart” needs to be set. These
    keys are located under
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
    NT\CurrentVersion\WUDF\Services<br>{193a1820-d9ac-4997-8c55-be817523f6aa}. Set the value
    to 0x000004.

    2. Before starting any debugging, we need to load the
    correct symbols. The WDK generates symbol information
    in .PDB file.

    3. In VS, On the Tools menu, choose Options.

    4. In the Options dialog box, click the Debugging node
    to open it.

    5. Under Debugging, select the Symbols category.

    6. Add a new entry which points to your driver’s .PDB
    file location.

    7. Now, choose Debug->Attach Process and select
    “WUDFHost.exe”. This will start the debugging process.
    ( This is User Mode driver host process from MS)

    8. You could see that visual studio is looking for
    symbol files for several standard components. At the
    end, you could see your driver symbols are loaded.

    9. If your driver symbols are not loaded, you can do
    it manually. Right-click in the Modules window and
    choose Find Symbols on the shortcut menu.

    10. Once the symbols are loaded, you can set
    breakpoints and start debugging.

    — Ó÷Ç¿ wrote:

    > OH, how did you achieve that ??
    >
    > i also want to know how to debug driver using VC ,
    > can you give me
    > your methods ?
    >
    > 2007/3/26, SUJA JAMES :
    > > Hi All,
    > >
    > > I managed to make it working !!!T hanks to all…
    > >
    > > Regards
    > > Suja.
    > >
    > > — SUJA JAMES wrote:
    > >
    > > > Hi All,
    > > >
    > > > I am using WDK build 6000 for my user mode
    > driver
    > > > development. I compiled and loaded a UMDF driver
    > > > using
    > > > the DDK Build environment. Now I am trying to
    > debug
    > > > the same using visual studio ( Not looking for
    > > > WinDbg
    > > > now).
    > > >
    > > > So, I am creating a build setup in visual studio
    > and
    > > > later attach the UMDF process for debugging. But
    > I
    > > > am
    > > > un able to build my driver using VC. I used the
    > > > DDKBUILD batch program.
    > > >
    > > > 1) Can anyone point out what option I have to
    > use in
    > > > DDKBUILD batch file while using WDK build 6000.
    > I
    > > > used
    > > > ddkbuild -WLHXP chk . -cZ -WDF. Can any one
    > point
    > > > out
    > > > the exact option and Base directory
    > > >
    > > > 2)Is there any other way to debug the driver
    > using
    > > > VC.
    > > > I found one article in WPD team Blog, which
    > tells to
    > > > use the "File/New/Project from Existing CodeE
    > > > menu.
    > > > I tried that, and no luck. Can anyone point out
    > the
    > > > exact options I need to use while creating the
    > > > project
    > > > in this case?.
    > > >
    > > > Any help is appreciated !!!
    > > >
    > > > Thanks
    > > > Suja.
    > > >
    > > >
    > > >
    > > >
    > >
    >

    > > > No need to miss a message. Get email on-the-go
    > > > with Yahoo! Mail for Mobile. Get started.
    > > > http://mobile.yahoo.com/mail
    > > >
    > > > —
    > > > Questions? First check the Kernel Driver FAQ at
    > > > http://www.osronline.com/article.cfm?id=256
    > > >
    > > > To unsubscribe, visit the List Server section of
    > OSR
    > > > Online at
    > > >
    > http://www.osronline.com/page.cfm?name=ListServer
    > > >
    > >
    > >
    > >
    > >
    > >
    >

    > > Don’t get soaked. Take a quick peek at the
    > forecast
    > > with the Yahoo! Search weather shortcut.
    > >
    > http://tools.search.yahoo.com/shortcuts/#loc_weather
    > >
    > > —
    > > Questions? First check the Kernel Driver FAQ at
    > http://www.osronline.com/article.cfm?id=256
    > >
    > > To unsubscribe, visit the List Server section of
    > OSR Online at
    > http://www.osronline.com/page.cfm?name=ListServer
    > >
    >
    > —
    > Questions? First check the Kernel Driver FAQ at
    > http://www.osronline.com/article.cfm?id=256
    >
    > To unsubscribe, visit the List Server section of OSR
    > Online at
    > http://www.osronline.com/page.cfm?name=ListServer
    >

    ____________________________________________________________________________________
    Now that’s room service! Choose from over 150,000 hotels
    in 45,000 destinations on Yahoo! Travel to find your fit.
    http://farechase.yahoo.com/promo-generic-14795097