Hello,

- I have two drivers, with one I create a device with IoCreateDevice
and I can see my device created in devicetree and in WinObj applications.

- With the other driver I used IoGetDeviceObjectPointer to handle the
device object pointer from the first driver.

When I call IoGetDeviceObjectPointer I have an error. It returning
STATUS_INVALID_DEVICE_REQUEST all the time.

I check and re-check with devicetree, my device exist. But with WinObj
I can see my device but when I double-click on it I have an error, I can't
access to the properties. Maybe it is a right access problem.

Do you have an idea to resolve this problem ?




Regards,

RE: STATUS_INVALID_DEVICE_REQUEST with IoGetDeviceObjectPointer by AntonBassov

AntonBassov
Sun Jul 08 06:12:03 CDT 2007

It is hard to say anything without actually seeing your code....

Anton Bassov

"janemba" wrote:

> Hello,
>
> - I have two drivers, with one I create a device with IoCreateDevice
> and I can see my device created in devicetree and in WinObj applications.
>
> - With the other driver I used IoGetDeviceObjectPointer to handle the
> device object pointer from the first driver.
>
> When I call IoGetDeviceObjectPointer I have an error. It returning
> STATUS_INVALID_DEVICE_REQUEST all the time.
>
> I check and re-check with devicetree, my device exist. But with WinObj
> I can see my device but when I double-click on it I have an error, I can't
> access to the properties. Maybe it is a right access problem.
>
> Do you have an idea to resolve this problem ?
>
>
>
>
> Regards,
>

RE: STATUS_INVALID_DEVICE_REQUEST with IoGetDeviceObjectPointer by janemba

janemba
Sun Jul 08 09:40:26 CDT 2007

On Sun, 08 Jul 2007 04:12:03 -0700, Anton Bassov wrote:

> It is hard to say anything without actually seeing your code....
>

- In the first driver I only create a device like this :
---
RtlInitUnicodeString(&uName, L"\\Device\\MyDevice");
IoCreateDevice(pDriveObject,
sizeof(DEVICE_EXTENSION),
&uName,
FILE_DEVICE_UNKNOWN,
0,
TRUE,
&pDeviceObject);
---

- In the second driver I only try to handle the device object pointer
from the first driver.
---
RtlInitUnicodeString(&deviceName, L"\\Device\\MyDevice");
IoGetDeviceObjectPointer(&deviceName,
FILE_ANY_ACCESS,
&fileObject,
&deviceObject);
---



> Anton Bassov
>
> "janemba" wrote:
>
>> Hello,
>>
>> - I have two drivers, with one I create a device with IoCreateDevice
>> and I can see my device created in devicetree and in WinObj applications.
>>
>> - With the other driver I used IoGetDeviceObjectPointer to handle the
>> device object pointer from the first driver.
>>
>> When I call IoGetDeviceObjectPointer I have an error. It returning
>> STATUS_INVALID_DEVICE_REQUEST all the time.
>>
>> I check and re-check with devicetree, my device exist. But with WinObj
>> I can see my device but when I double-click on it I have an error, I can't
>> access to the properties. Maybe it is a right access problem.
>>
>> Do you have an idea to resolve this problem ?
>>
>>
>>
>>
>> Regards,
>>


Re: STATUS_INVALID_DEVICE_REQUEST with IoGetDeviceObjectPointer by Eliyas

Eliyas
Sun Jul 08 10:06:25 CDT 2007

http://www.microsoft.com/whdc/driver/tips/DevInit.mspx

-Eliyas

"janemba" <janemba@wanadoo.fr> wrote in message
news:pan.2007.07.08.14.40.10.191463@wanadoo.fr...
> On Sun, 08 Jul 2007 04:12:03 -0700, Anton Bassov wrote:
>
>> It is hard to say anything without actually seeing your code....
>>
>
> - In the first driver I only create a device like this :
> ---
> RtlInitUnicodeString(&uName, L"\\Device\\MyDevice");
> IoCreateDevice(pDriveObject,
> sizeof(DEVICE_EXTENSION),
> &uName,
> FILE_DEVICE_UNKNOWN,
> 0,
> TRUE,
> &pDeviceObject);
> ---
>
> - In the second driver I only try to handle the device object pointer
> from the first driver.
> ---
> RtlInitUnicodeString(&deviceName, L"\\Device\\MyDevice");
> IoGetDeviceObjectPointer(&deviceName,
> FILE_ANY_ACCESS,
> &fileObject,
> &deviceObject);
> ---
>
>
>
>> Anton Bassov
>>
>> "janemba" wrote:
>>
>>> Hello,
>>>
>>> - I have two drivers, with one I create a device with IoCreateDevice
>>> and I can see my device created in devicetree and in WinObj
>>> applications.
>>>
>>> - With the other driver I used IoGetDeviceObjectPointer to handle the
>>> device object pointer from the first driver.
>>>
>>> When I call IoGetDeviceObjectPointer I have an error. It returning
>>> STATUS_INVALID_DEVICE_REQUEST all the time.
>>>
>>> I check and re-check with devicetree, my device exist. But with WinObj
>>> I can see my device but when I double-click on it I have an error, I
>>> can't
>>> access to the properties. Maybe it is a right access problem.
>>>
>>> Do you have an idea to resolve this problem ?
>>>
>>>
>>>
>>>
>>> Regards,
>>>
>



Re: STATUS_INVALID_DEVICE_REQUEST with IoGetDeviceObjectPointer by Alexander

Alexander
Sun Jul 08 14:59:36 CDT 2007

Do you have IRP_MJ_CREATE and IRP_MJ_CLOSE handlers?

"janemba" <janemba@wanadoo.fr> wrote in message
news:pan.2007.07.08.11.47.17.245796@wanadoo.fr...
> Hello,
>
> - I have two drivers, with one I create a device with IoCreateDevice
> and I can see my device created in devicetree and in WinObj applications.
>
> - With the other driver I used IoGetDeviceObjectPointer to handle the
> device object pointer from the first driver.
>
> When I call IoGetDeviceObjectPointer I have an error. It returning
> STATUS_INVALID_DEVICE_REQUEST all the time.
>
> I check and re-check with devicetree, my device exist. But with WinObj
> I can see my device but when I double-click on it I have an error, I can't
> access to the properties. Maybe it is a right access problem.
>
> Do you have an idea to resolve this problem ?
>
>
>
>
> Regards,



Re: STATUS_INVALID_DEVICE_REQUEST with IoGetDeviceObjectPointer by janemba

janemba
Mon Jul 09 15:51:16 CDT 2007

On Sun, 08 Jul 2007 08:06:25 -0700, Eliyas Yakub [MSFT] wrote:

> http://www.microsoft.com/whdc/driver/tips/DevInit.mspx
>
> -Eliyas
>
> "janemba" <janemba@wanadoo.fr> wrote in message
> news:pan.2007.07.08.14.40.10.191463@wanadoo.fr...
>> On Sun, 08 Jul 2007 04:12:03 -0700, Anton Bassov wrote:
>>
>>> It is hard to say anything without actually seeing your code....
>>>
>>
>> - In the first driver I only create a device like this :
>> ---
>> RtlInitUnicodeString(&uName, L"\\Device\\MyDevice");
>> IoCreateDevice(pDriveObject,
>> sizeof(DEVICE_EXTENSION),
>> &uName,
>> FILE_DEVICE_UNKNOWN,
>> 0,
>> TRUE,
>> &pDeviceObject);
>> ---
>>
>> - In the second driver I only try to handle the device object pointer
>> from the first driver.
>> ---
>> RtlInitUnicodeString(&deviceName, L"\\Device\\MyDevice");
>> IoGetDeviceObjectPointer(&deviceName,
>> FILE_ANY_ACCESS,
>> &fileObject,
>> &deviceObject);
>> ---
>>
>>
>>
>>> Anton Bassov
>>>
>>> "janemba" wrote:
>>>
>>>> Hello,
>>>>
>>>> - I have two drivers, with one I create a device with IoCreateDevice
>>>> and I can see my device created in devicetree and in WinObj
>>>> applications.
>>>>
>>>> - With the other driver I used IoGetDeviceObjectPointer to handle the
>>>> device object pointer from the first driver.
>>>>
>>>> When I call IoGetDeviceObjectPointer I have an error. It returning
>>>> STATUS_INVALID_DEVICE_REQUEST all the time.
>>>>
>>>> I check and re-check with devicetree, my device exist. But with WinObj
>>>> I can see my device but when I double-click on it I have an error, I
>>>> can't
>>>> access to the properties. Maybe it is a right access problem.
>>>>
>>>> Do you have an idea to resolve this problem ?
>>>>
>>>>
>>>>
>>>>

THANKS guy !!!!

Regards,