Re: how can I get a vista device handle? by Doron
Doron
Wed Jan 30 14:43:18 CST 2008
first, WDF object handles, regardless of type, are only valid within the
driver which created them. as another driver talking to a WDF driver you do
not get access to these handles. WDF object handles cannot be casted from a
WDM structure. why do you want the other driver's WDFDEVICE?
d
--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Wllee" <Wllee@discussions.microsoft.com> wrote in message
news:53AB380D-3203-4244-A71A-A487FC9D90EB@microsoft.com...
> maybe it is easy when you run the function in a wdf device driver. but I
> have
> a wdm driver, want to talk to wdf driver. how can I do that?
>
> IoGetDeviceObjectPointer( &unicodeName, FILE_READ_ATTRIBUTES, &pFile,
> &pDevice );
> wdfFile = *((WDFFILEOBJECT *)pFile);
> wdfDevice = WdfFileObjectGetDevice(wdfFile);
>
> it can get the fileobject and device object when I know the wdf device
> name-"unicodeName", and later I force the pointer to WDFFILEOBJCT, it
> tell
> me access memory error.