Re: how to send IOCTL in a driver to a filter driver

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Doron Holan [MS] (doronh_at_nospam.microsoft.com)
Date: 03/09/05


Date: Tue, 8 Mar 2005 23:17:38 -0800

2 questions
1) what is the bugcheck code and callstack (make sure symbols are correct)?
2) at what IRQL are you making the call to IoGetDeviceObjectPointer? you
must call this function at PASSIVE_LEVEL

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.
"robert" <robert@discussions.microsoft.com> wrote in message 
news:62CF029A-A798-49A7-82FD-6E06B97A5B2D@microsoft.com...
> Hi Ray,
>    here is the code
> UNICODE_STRING deviceName;
> wchar_t devicename[64];
> ULONG DevicePTPD = 0;
> ULONG ulCount = 0;
> PFILE_OBJECT fileObj = NULL;
> PDEVICE_OBJECT deviceObj = NULL;
> swprintf( devicename, L"\\??\\PTPDDevice%d", DevicePTPD);
> RtlInitUnicodeString( &deviceName, devicename);
> DbgPrint(("GetPTPDDeviceObj %ws\n", devicename));
> status = IoGetDeviceObjectPointer(&deviceName, FILE_ALL_ACCESS, &fileObj,
> &deviceObj);
>
> thanks
> Robert
>
>
> "Ray Trent" wrote:
>
>> Hmmm. A bluescreen is an odd result. I assume your deviceName is a
>> properly initialized Unicode string, right? And that fileObj is a
>> PFILE_OBJECT (as opposed to a FILE_OBJECT), and that deviceObj is a
>> PDEVICE_OBJECT?
>>
>> As you can see, it's somewhat more helpful to post a code snippet
>> showing the relevant context, because I'm shooting in the dark.
>>
>> As a side note, it's fairly unusual to need FILE_ALL_ACCESS. Usually you
>> want FILE_READ_DATA.
>>
>> robert wrote:
>> > Hi,
>> >     I have a filter driver with some IOCTLs. I have a kernel driver, 
>> > which
>> > need to send IOCTLs to the filter driver to quiry some state 
>> > information in
>> > the filter driver.
>> > I used IoGetDeviceObjectPointer(&deviceName, FILE_ALL_ACCESS, &fileObj,
>> > &deviceObj) to try to get the filter device object. However, this call 
>> > causes
>> > bluescreen. after I get the device object, I can use
>> > IoBuildDeviceIoControlRequest to build a IOCTL request and send it to 
>> > the
>> > filter driver.
>> > Is this the right way? or there is something I missed in the
>> > IoGetDeviceObjectPointer APi?
>> >
>> > Thansk
>> >
>>
>> -- 
>> .../ray\..
>>