Old to WDF conversion

Going from an old (but complex) NT4 monolithic non-PNP driver to the latest
WDF is going to give me the most problems in what areas other than
converting the outer layers like DriverEntry, etc. to the new model?

  • INTR srvc <> DPC?
  • DMA issues?
  • IRP processing?
  • other?

Can a lot of the older mechanisms (DMA comes to mind) remain in place (pls
say yes) or must they mostly all change?

Bill Casey

For all of the items you list there are KMDF functions for them. You
definitely want to replace the IRP processing with KMDF request handling
otherwise you lose the primary value of KMDF. The interrupt service /
DPC routine handling of KMDF is easy to translate to from an older
model. I personally have not used KMDF DMA, but again I would stick
with the KMDF approach and not try to hack your old code into the new
driver.

KMDF is a big change, but it add so many nice features you should be
looking at the complete migration.

Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

-----Original Message-----
From: Bill Casey [mailto:xxxxx@virtualscsi.com]
Posted At: Wednesday, May 19, 2010 2:41 PM
Posted To: ntdev
Conversation: Old to WDF conversion
Subject: Old to WDF conversion

Going from an old (but complex) NT4 monolithic non-PNP driver to the
latest
WDF is going to give me the most problems in what areas other than
converting
the outer layers like DriverEntry, etc. to the new model?

  • INTR srvc <> DPC?
  • DMA issues?
  • IRP processing?
  • other?

Can a lot of the older mechanisms (DMA comes to mind) remain in place
(pls say
yes) or must they mostly all change?

Bill Casey

__________ Information from ESET Smart Security, version of virus
signature
database 5129 (20100519) __________

The message was checked by ESET Smart Security.

http://www.eset.com

OK Don, thank you for the tips. A colleague did say that the new DMA was
much easier to work with than what I have in this old driver.

Bill Casey

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-411748-
xxxxx@lists.osr.com] On Behalf Of Don Burn
Sent: Wednesday, May 19, 2010 2:16 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Old to WDF conversion

For all of the items you list there are KMDF functions for them. You
definitely want to replace the IRP processing with KMDF request
handling
otherwise you lose the primary value of KMDF. The interrupt service /
DPC routine handling of KMDF is easy to translate to from an older
model. I personally have not used KMDF DMA, but again I would stick
with the KMDF approach and not try to hack your old code into the new
driver.

KMDF is a big change, but it add so many nice features you should be
looking at the complete migration.

Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

> -----Original Message-----
> From: Bill Casey [mailto:xxxxx@virtualscsi.com]
> Posted At: Wednesday, May 19, 2010 2:41 PM
> Posted To: ntdev
> Conversation: Old to WDF conversion
> Subject: Old to WDF conversion
>
> Going from an old (but complex) NT4 monolithic non-PNP driver to the
latest
> WDF is going to give me the most problems in what areas other than
converting
> the outer layers like DriverEntry, etc. to the new model?
>
> - INTR srvc <> DPC?
> - DMA issues?
> - IRP processing?
> - other?
>
> Can a lot of the older mechanisms (DMA comes to mind) remain in place
(pls say
> yes) or must they mostly all change?
>
> Bill Casey
>
>
>
> __________ Information from ESET Smart Security, version of virus
signature
> database 5129 (20100519) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>


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

I converted a non-PnP PCI driver that was updated to Win2k years ago, but not touched since, to a KMDF driver. No DMA, but just about everything else. I had no problems converting the IRPs and ISR functions. The only area that required more work was changing it to PnP and how the harware is discovered but WDF makes that fairly easy.

Larry C

Usually in KMDF there is no need to handle IPRs manually, the framework does this job for you. For PnP and power management IRPs, you usually get calls for EvtDeviceD0Entry/EvtDeviceD0Exit funcs (or EvtDevicePrepareHardware/EvtDeviceReleaseHardware for IRP_MN_START/IRP_MN_STOP).

For I/O, you WDF creates WDFREQUESTs for you. Read the articles below for more info, they are pretty short and very helpful to dive to KMDF:
http://www.microsoft.com/whdc/driver/wdf/wdf-arch.mspx
http://www.microsoft.com/whdc/driver/wdf/KMDF-arch.mspx
http://www.microsoft.com/whdc/driver/wdf/ioreq_flow.mspx
http://www.microsoft.com/whdc/driver/wdf/WDF_Port.mspx
http://www.microsoft.com/whdc/driver/wdf/WDF_pnpPower.mspx

Good Luck,
S.