From - Wed Sep 24 08:06:24 1997 Path: news.mitre.org!blanket.mitre.org!agate!howland.erols.net!news-peer.sprintlink.net!news-sea-19.sprintlink.net!news-in-west.sprintlink.net!news.sprintlink.net!Sprint!209.90.0.8!alpha.sky.net!newshub.cts.com!newsfeed.cts.com!cmkrnl!jeh From: jeh@cmkrnl.com (Jamie Hanrahan) Newsgroups: comp.os.ms-windows.programmer.nt.kernel-mode Subject: Re: ISR can't access User buffer HELP!!!!! Message-ID: <1997Sep23.183801.8219@cmkrnl> Date: 23 Sep 97 18:38:01 PST References: <34283caf.349039037@news.connectnet.com> Organization: Kernel Mode Systems, San Diego, CA Lines: 25 In article <34283caf.349039037@news.connectnet.com>, jvasquez@getntds.com writes: > The device was created using the flag DO_DIRECT_IO when IoCreateDevice > was called. > > Doing the processing of the IRP_MJ_WRITE, I get the user's buffer > address from the Irp->MdlAddress. and store it in the device > extension. Irp->MdlAddress is not the user's buffer address. It is the address of an intermediate structure (an MDL) that describes the physical memory location(s) of the user's buffer. To get an address that is usable in arbitrary thread context, you must call MmGetSystemAddressForMdl(Irp->MdlAddress). You must do this in the context of the requesting thread (ie in the dispatch routine that handles the IRP). You can then use the returned value from MmGetSystemAddressForMdl at any time until you call IoCompleteRequest on the IRP. --- Jamie Hanrahan, Kernel Mode Systems, San Diego CA Internet: jeh@cmkrnl.com (JH645) CompuServe: 74140,2055 drivers, internals, networks, applications, and training for VMS and Windows NT NT driver FAQ, links, and other information: http://www.cmkrnl.com/ If you post a reply in news, please don't e-mail it too.