Hi, my driver is using PnP custom notification to signal the app.
Unfortunately, IoReportTargetDeviceChangeAsynchronous is returning
STATUS_PENDING and the app never receives any of the messages. I'm fairly
certain that my registration calls are correct with the same GUID messages.
Any suggestions on what's happening, where to look, and a good way to debug
(e.g., tools, etc. Spy isn't reporting anything (I may be using it
incorrectly))?

Thanks

Phil Garofalo
Chicago, IL

Re: IoReportTargetDeviceChangeAsynchronous returns STATUS_PENDING by Doron

Doron
Thu Dec 09 10:39:07 CST 2004

did you zero out the memory before sending it to this api? specifically,
was FileObject NULL as documented? are you sure your application not only
registered for device arrival notifications on the GUID, but also registered
for *file* handle notifications once it opened up your device? the only way
the app gets the custom device change notifications is on a file handle
notification, not a device interface notification.

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.


"Philip F. Garofalo" <pgarofalo@mcsinc.net> wrote in message
news:OLoOWpb3EHA.4064@tk2msftngp13.phx.gbl...
> Hi, my driver is using PnP custom notification to signal the app.
> Unfortunately, IoReportTargetDeviceChangeAsynchronous is returning
> STATUS_PENDING and the app never receives any of the messages. I'm fairly
> certain that my registration calls are correct with the same GUID
> messages.
> Any suggestions on what's happening, where to look, and a good way to
> debug
> (e.g., tools, etc. Spy isn't reporting anything (I may be using it
> incorrectly))?
>
> Thanks
>
> Phil Garofalo
> Chicago, IL
>
>



Re: IoReportTargetDeviceChangeAsynchronous returns STATUS_PENDING by Philip

Philip
Thu Dec 09 15:56:09 CST 2004

Thanks d,

I was following the example at
http://www.microsoft.com/whdc/driver/tips/km-basics.mspx#ECAA and it's
wrong. I discovered that the correct way of doing it is in the document at
http://www.microsoft.com/whdc/driver/kernel/KM-UMGuide.mspx. The example is
so similar to the one on the first web page that I missed the crucial
differences on first scan. Arrgh!

Phil


"Doron Holan [MS]" <doronh@nospam.microsoft.com> wrote in message
news:uHYNd2g3EHA.3596@TK2MSFTNGP12.phx.gbl...
> did you zero out the memory before sending it to this api? specifically,
> was FileObject NULL as documented? are you sure your application not only
> registered for device arrival notifications on the GUID, but also
registered
> for *file* handle notifications once it opened up your device? the only
way
> the app gets the custom device change notifications is on a file handle
> notification, not a device interface notification.
>
> 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.
>
>
> "Philip F. Garofalo" <pgarofalo@mcsinc.net> wrote in message
> news:OLoOWpb3EHA.4064@tk2msftngp13.phx.gbl...
> > Hi, my driver is using PnP custom notification to signal the app.
> > Unfortunately, IoReportTargetDeviceChangeAsynchronous is returning
> > STATUS_PENDING and the app never receives any of the messages. I'm
fairly
> > certain that my registration calls are correct with the same GUID
> > messages.
> > Any suggestions on what's happening, where to look, and a good way to
> > debug
> > (e.g., tools, etc. Spy isn't reporting anything (I may be using it
> > incorrectly))?
> >
> > Thanks
> >
> > Phil Garofalo
> > Chicago, IL
> >
> >
>
>



Re: IoReportTargetDeviceChangeAsynchronous returns STATUS_PENDING by Philip

Philip
Thu Dec 09 18:33:42 CST 2004

I am now getting notifications on WM_DEVICECHANGE (I'm not sure what
messages you're referring to by *file* handle notifications, please explain)
but now I'm experiencing a related problem. The custom data field contents
isn't making it over to the app. It's set to zeros.

The other fields, like the GUID event and name string offset, are properly
making it over to the app in their respective DEV_BROADCAST_HANDLE fields.
I've defined the TARGET_DEVICE_CUSTOM_NOTIFICATION buffer as a local (on the
stack frame) in my DPC. Is this the problem? Should it be declared
differently, say non-paged memory? Does
IoReportTargetDeviceChangeAsynchronous allocate space and copy the data into
its own buffer?

Should my handler routine be mapped to file handle notifications instead of
WM_DEVICECHANGE?

Thanks again,

Phil


"Doron Holan [MS]" <doronh@nospam.microsoft.com> wrote in message
news:uHYNd2g3EHA.3596@TK2MSFTNGP12.phx.gbl...
> did you zero out the memory before sending it to this api? specifically,
> was FileObject NULL as documented? are you sure your application not only
> registered for device arrival notifications on the GUID, but also
registered
> for *file* handle notifications once it opened up your device? the only
way
> the app gets the custom device change notifications is on a file handle
> notification, not a device interface notification.
>
> 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.
>
>
> "Philip F. Garofalo" <pgarofalo@mcsinc.net> wrote in message
> news:OLoOWpb3EHA.4064@tk2msftngp13.phx.gbl...
> > Hi, my driver is using PnP custom notification to signal the app.
> > Unfortunately, IoReportTargetDeviceChangeAsynchronous is returning
> > STATUS_PENDING and the app never receives any of the messages. I'm
fairly
> > certain that my registration calls are correct with the same GUID
> > messages.
> > Any suggestions on what's happening, where to look, and a good way to
> > debug
> > (e.g., tools, etc. Spy isn't reporting anything (I may be using it
> > incorrectly))?
> >
> > Thanks
> >
> > Phil Garofalo
> > Chicago, IL
> >
> >
>
>



Re: IoReportTargetDeviceChangeAsynchronous returns STATUS_PENDING by Philip

Philip
Thu Dec 09 18:59:47 CST 2004

One other question: in the examples on the WHDC site, the first field of the
custom buffer is the count field value from the device extension. Is this
required for it to work or just an arbitrary choice for the example? (Sorry,
I'm asking before actually trying it--I'm working on all fronts.)

"Doron Holan [MS]" <doronh@nospam.microsoft.com> wrote in message
news:uHYNd2g3EHA.3596@TK2MSFTNGP12.phx.gbl...
> did you zero out the memory before sending it to this api? specifically,
> was FileObject NULL as documented? are you sure your application not only
> registered for device arrival notifications on the GUID, but also
registered
> for *file* handle notifications once it opened up your device? the only
way
> the app gets the custom device change notifications is on a file handle
> notification, not a device interface notification.
>
> 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.
>
>
> "Philip F. Garofalo" <pgarofalo@mcsinc.net> wrote in message
> news:OLoOWpb3EHA.4064@tk2msftngp13.phx.gbl...
> > Hi, my driver is using PnP custom notification to signal the app.
> > Unfortunately, IoReportTargetDeviceChangeAsynchronous is returning
> > STATUS_PENDING and the app never receives any of the messages. I'm
fairly
> > certain that my registration calls are correct with the same GUID
> > messages.
> > Any suggestions on what's happening, where to look, and a good way to
> > debug
> > (e.g., tools, etc. Spy isn't reporting anything (I may be using it
> > incorrectly))?
> >
> > Thanks
> >
> > Phil Garofalo
> > Chicago, IL
> >
> >
>
>



Re: IoReportTargetDeviceChangeAsynchronous returns STATUS_PENDING by Doron

Doron
Fri Dec 10 21:21:20 CST 2004

completely arbitrary

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.


"Philip F. Garofalo" <pgarofalo@mcsinc.net> wrote in message
news:%23XjbFMl3EHA.3000@TK2MSFTNGP15.phx.gbl...
> One other question: in the examples on the WHDC site, the first field of
> the
> custom buffer is the count field value from the device extension. Is this
> required for it to work or just an arbitrary choice for the example?
> (Sorry,
> I'm asking before actually trying it--I'm working on all fronts.)
>
> "Doron Holan [MS]" <doronh@nospam.microsoft.com> wrote in message
> news:uHYNd2g3EHA.3596@TK2MSFTNGP12.phx.gbl...
>> did you zero out the memory before sending it to this api? specifically,
>> was FileObject NULL as documented? are you sure your application not
>> only
>> registered for device arrival notifications on the GUID, but also
> registered
>> for *file* handle notifications once it opened up your device? the only
> way
>> the app gets the custom device change notifications is on a file handle
>> notification, not a device interface notification.
>>
>> 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.
>>
>>
>> "Philip F. Garofalo" <pgarofalo@mcsinc.net> wrote in message
>> news:OLoOWpb3EHA.4064@tk2msftngp13.phx.gbl...
>> > Hi, my driver is using PnP custom notification to signal the app.
>> > Unfortunately, IoReportTargetDeviceChangeAsynchronous is returning
>> > STATUS_PENDING and the app never receives any of the messages. I'm
> fairly
>> > certain that my registration calls are correct with the same GUID
>> > messages.
>> > Any suggestions on what's happening, where to look, and a good way to
>> > debug
>> > (e.g., tools, etc. Spy isn't reporting anything (I may be using it
>> > incorrectly))?
>> >
>> > Thanks
>> >
>> > Phil Garofalo
>> > Chicago, IL
>> >
>> >
>>
>>
>
>



Re: IoReportTargetDeviceChangeAsynchronous returns STATUS_PENDING by Doron

Doron
Fri Dec 10 21:21:56 CST 2004

what's wrong with the example on WDHC? I helped write it, so if there are
errors, i can get them fixed.

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.


"Philip F. Garofalo" <pgarofalo@mcsinc.net> wrote in message
news:uwoPalj3EHA.1188@tk2msftngp13.phx.gbl...
> Thanks d,
>
> I was following the example at
> http://www.microsoft.com/whdc/driver/tips/km-basics.mspx#ECAA and it's
> wrong. I discovered that the correct way of doing it is in the document at
> http://www.microsoft.com/whdc/driver/kernel/KM-UMGuide.mspx. The example
> is
> so similar to the one on the first web page that I missed the crucial
> differences on first scan. Arrgh!
>
> Phil
>
>
> "Doron Holan [MS]" <doronh@nospam.microsoft.com> wrote in message
> news:uHYNd2g3EHA.3596@TK2MSFTNGP12.phx.gbl...
>> did you zero out the memory before sending it to this api? specifically,
>> was FileObject NULL as documented? are you sure your application not
>> only
>> registered for device arrival notifications on the GUID, but also
> registered
>> for *file* handle notifications once it opened up your device? the only
> way
>> the app gets the custom device change notifications is on a file handle
>> notification, not a device interface notification.
>>
>> 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.
>>
>>
>> "Philip F. Garofalo" <pgarofalo@mcsinc.net> wrote in message
>> news:OLoOWpb3EHA.4064@tk2msftngp13.phx.gbl...
>> > Hi, my driver is using PnP custom notification to signal the app.
>> > Unfortunately, IoReportTargetDeviceChangeAsynchronous is returning
>> > STATUS_PENDING and the app never receives any of the messages. I'm
> fairly
>> > certain that my registration calls are correct with the same GUID
>> > messages.
>> > Any suggestions on what's happening, where to look, and a good way to
>> > debug
>> > (e.g., tools, etc. Spy isn't reporting anything (I may be using it
>> > incorrectly))?
>> >
>> > Thanks
>> >
>> > Phil Garofalo
>> > Chicago, IL
>> >
>> >
>>
>>
>
>



Re: IoReportTargetDeviceChangeAsynchronous returns STATUS_PENDING by Doron

Doron
Fri Dec 10 21:22:22 CST 2004

the API makes its own copy, so the buffer you pass in can reside on the
stack

--
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.


"Philip F. Garofalo" <pgarofalo@mcsinc.net> wrote in message
news:eDtvg9k3EHA.3416@TK2MSFTNGP09.phx.gbl...
>I am now getting notifications on WM_DEVICECHANGE (I'm not sure what
> messages you're referring to by *file* handle notifications, please
> explain)
> but now I'm experiencing a related problem. The custom data field contents
> isn't making it over to the app. It's set to zeros.
>
> The other fields, like the GUID event and name string offset, are properly
> making it over to the app in their respective DEV_BROADCAST_HANDLE fields.
> I've defined the TARGET_DEVICE_CUSTOM_NOTIFICATION buffer as a local (on
> the
> stack frame) in my DPC. Is this the problem? Should it be declared
> differently, say non-paged memory? Does
> IoReportTargetDeviceChangeAsynchronous allocate space and copy the data
> into
> its own buffer?
>
> Should my handler routine be mapped to file handle notifications instead
> of
> WM_DEVICECHANGE?
>
> Thanks again,
>
> Phil
>
>
> "Doron Holan [MS]" <doronh@nospam.microsoft.com> wrote in message
> news:uHYNd2g3EHA.3596@TK2MSFTNGP12.phx.gbl...
>> did you zero out the memory before sending it to this api? specifically,
>> was FileObject NULL as documented? are you sure your application not
>> only
>> registered for device arrival notifications on the GUID, but also
> registered
>> for *file* handle notifications once it opened up your device? the only
> way
>> the app gets the custom device change notifications is on a file handle
>> notification, not a device interface notification.
>>
>> 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.
>>
>>
>> "Philip F. Garofalo" <pgarofalo@mcsinc.net> wrote in message
>> news:OLoOWpb3EHA.4064@tk2msftngp13.phx.gbl...
>> > Hi, my driver is using PnP custom notification to signal the app.
>> > Unfortunately, IoReportTargetDeviceChangeAsynchronous is returning
>> > STATUS_PENDING and the app never receives any of the messages. I'm
> fairly
>> > certain that my registration calls are correct with the same GUID
>> > messages.
>> > Any suggestions on what's happening, where to look, and a good way to
>> > debug
>> > (e.g., tools, etc. Spy isn't reporting anything (I may be using it
>> > incorrectly))?
>> >
>> > Thanks
>> >
>> > Phil Garofalo
>> > Chicago, IL
>> >
>> >
>>
>>
>
>



Re: IoReportTargetDeviceChangeAsynchronous returns STATUS_PENDIN by cch

cch
Thu Dec 23 19:56:12 CST 2004

HEre are some things that needs to be made clearer with this article
http://www.microsoft.com/whdc/driver/tips/km-basics.mspx#ECAA

1)IoReportTargetDeviceChangeAsynchronous returns STATUS_PENDING when
successful even though the doc
says STATUS_SUCCESS. I spent a better half of a day
debugging what was correct.

2)NotificationFilter.dbcc_devicetype in
BOOL DoRegisterDeviceInterface(
GUID InterfaceClassGuid,
HDEVNOTIFY *hDevNotify)
should be DBT_DEVTYP_HANDLE and *not*
DBT_DEVTYP_DEVICEINTERFACE. THe latter doesn't work for me.

3)pNotify->NameBufferOffset in example 1 should not be -1 but the
actual size of the text str.