I am reading data directly from a network interface using a modified
NDISPROT protocol driver. When somebody pulls the network cable the
ProtocolStatus routine triggers within the driver. From the user level
I can actively poll the miniport using OID_GEN_MEDIA_CONNECT_STATUS,
but is there a way to get notified asynchronously? If not, is checking
the miniport via the OID the best way or should I implement an
IoControl in NDISPROT instead?

Thanks for your help!

Re: how to detect media connect/disconnect asynchronously at NDIS level by Maxim

Maxim
Thu Feb 10 09:31:37 CST 2005

> NDISPROT protocol driver. When somebody pulls the network cable the
> ProtocolStatus routine triggers within the driver.

Correct, and this is the notification you wants.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com



Re: how to detect media connect/disconnect asynchronously at NDIS level by Arkady

Arkady
Thu Feb 10 15:03:20 CST 2005

You can use WMI in user mode to be notified for status changes
Arkady

"Arne Ludwig" <arne@citde.net> wrote in message
news:84bdcc66.0502100520.6c9f7587@posting.google.com...
> I am reading data directly from a network interface using a modified
> NDISPROT protocol driver. When somebody pulls the network cable the
> ProtocolStatus routine triggers within the driver. From the user level
> I can actively poll the miniport using OID_GEN_MEDIA_CONNECT_STATUS,
> but is there a way to get notified asynchronously? If not, is checking
> the miniport via the OID the best way or should I implement an
> IoControl in NDISPROT instead?
>
> Thanks for your help!



Re: how to detect media connect/disconnect asynchronously at NDIS level by arne

arne
Fri Feb 11 04:50:10 CST 2005

Errr... WMI... yes. Actually all I wanted is stick a $2 smoke detector
on the ceiling, not rewire the whole house and buy $50000 worth of
electronic equipment just so I can wire my own buzzer to pin 235
(SMKDET) of the Home Monitoring and Security Infrastructure connector.

RegisterDeviceNotification/IoReportTargetDeviceChangeAsynchronous
seemed like a more likely method, but I do not have a window handle
and I am not sure I understand what a "service status handle" might
be. I probably do not want a separately running service either.

I thought of something simple like have the ProtocolStatus routine
send a signal and the user mode app have a signal handler that gets
called.

Only I am not sure that Windows has such a concept as "Unix signals",
or does it?

Thanks again.


"Arkady Frenkel" <arkadyf@hotmailxdotxcom> wrote in message news:<#u57yO7DFHA.3368@TK2MSFTNGP10.phx.gbl>...
> You can use WMI in user mode to be notified for status changes
> Arkady
>
> "Arne Ludwig" <arne@citde.net> wrote in message
> news:84bdcc66.0502100520.6c9f7587@posting.google.com...
> > I am reading data directly from a network interface using a modified
> > NDISPROT protocol driver. When somebody pulls the network cable the
> > ProtocolStatus routine triggers within the driver. From the user level
> > I can actively poll the miniport using OID_GEN_MEDIA_CONNECT_STATUS,
> > but is there a way to get notified asynchronously? If not, is checking
> > the miniport via the OID the best way or should I implement an
> > IoControl in NDISPROT instead?
> >
> > Thanks for your help!

Re: how to detect media connect/disconnect asynchronously at NDIS level by Arkady

Arkady
Fri Feb 11 05:58:31 CST 2005

That exactly what WMI do for you and it cost nothing :)
look at http://www.pcausa-corp.com/faq/QA01050301/
BTW in XP you can simply check that using GetIfEntry() of adapter
Arkady


"Arne Ludwig" <arne@citde.net> wrote in message
news:84bdcc66.0502110250.73c796b5@posting.google.com...
> Errr... WMI... yes. Actually all I wanted is stick a $2 smoke detector
> on the ceiling, not rewire the whole house and buy $50000 worth of
> electronic equipment just so I can wire my own buzzer to pin 235
> (SMKDET) of the Home Monitoring and Security Infrastructure connector.
>
> RegisterDeviceNotification/IoReportTargetDeviceChangeAsynchronous
> seemed like a more likely method, but I do not have a window handle
> and I am not sure I understand what a "service status handle" might
> be. I probably do not want a separately running service either.
>
> I thought of something simple like have the ProtocolStatus routine
> send a signal and the user mode app have a signal handler that gets
> called.
>
> Only I am not sure that Windows has such a concept as "Unix signals",
> or does it?
>
> Thanks again.
>
>
> "Arkady Frenkel" <arkadyf@hotmailxdotxcom> wrote in message
news:<#u57yO7DFHA.3368@TK2MSFTNGP10.phx.gbl>...
> > You can use WMI in user mode to be notified for status changes
> > Arkady
> >
> > "Arne Ludwig" <arne@citde.net> wrote in message
> > news:84bdcc66.0502100520.6c9f7587@posting.google.com...
> > > I am reading data directly from a network interface using a modified
> > > NDISPROT protocol driver. When somebody pulls the network cable the
> > > ProtocolStatus routine triggers within the driver. From the user level
> > > I can actively poll the miniport using OID_GEN_MEDIA_CONNECT_STATUS,
> > > but is there a way to get notified asynchronously? If not, is checking
> > > the miniport via the OID the best way or should I implement an
> > > IoControl in NDISPROT instead?
> > >
> > > Thanks for your help!



Re: how to detect media connect/disconnect asynchronously at NDIS level by Maxim

Maxim
Fri Feb 11 06:59:47 CST 2005

> Only I am not sure that Windows has such a concept as "Unix signals",
> or does it?

It has exceptions, user APCs and and async IO completion instead.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com



Re: how to detect media connect/disconnect asynchronously at NDIS level by arne

arne
Mon Feb 14 05:54:04 CST 2005

"Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message news:<uUA0GmDEFHA.3504@TK2MSFTNGP12.phx.gbl>...
> > Only I am not sure that Windows has such a concept as "Unix signals",
> > or does it?
>
> It has exceptions, user APCs and and async IO completion instead.

None of which appear to be workable in this situation: ExRaiseStatus
should only be used on highest level drivers, QueueUserAPC cannot be
called from kernel level on NT4/5, async IO does not apply at all.

The only option that I can see is: create an event on user level, pass
it down using IoControl, wait on user level in separate thread using
WaitForSingleObject, signal event using NdisSetEvent.