In the MiniprotHalt routine, I have to cancel timer queue
which I have set with NdisSetTimer and NdisInitializeTimer
at Miniport InitializeHandler. When I called *NdisMCancelTimer*,
I got an assertion failed.

*** Assertion failed: ((Timer)->Header.Type == TimerNotificationObject)
|| ((Timer)->Header.Type == TimerSynchronizationObject)
*** Source File: D:\nt\private\ntos\ke\timerobj.c, line 186

The code
VOID MPHalt(
IN NDIS_HANDLE MiniportAdapterContext)
{
PMP_ADAPTER Adapter = (PMP_ADAPTER) MiniportAdapterContext;
...
// Cancel pending timers
NdisMCancelTimer(&Adapter->Timer, &Cancelled);
...
}

Could you give me any suggestions or clues, thank in advance.

Re: NDIS test failed on MiniportHalt by Alireza

Alireza
Fri Feb 27 16:17:43 CST 2004

Could it be that you freed you adapter structure too early in your halt
routine?

By the way, you should have the storage for your timers to be of the type
NDIS_MINIPORT_TIMER and use NdisMInitializeTimer to initialize them and
NdisMSetTimer to set them (even though NdisMSetTimer is a macro that is
resolved to NdisSetTimer).

-ali


--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Paul Simon" <paochen_paul@hotmail.com> wrote in message
news:4d62e692.0402270157.533edcb3@posting.google.com...
> In the MiniprotHalt routine, I have to cancel timer queue
> which I have set with NdisSetTimer and NdisInitializeTimer
> at Miniport InitializeHandler. When I called *NdisMCancelTimer*,
> I got an assertion failed.
>
> *** Assertion failed: ((Timer)->Header.Type == TimerNotificationObject)
> || ((Timer)->Header.Type == TimerSynchronizationObject)
> *** Source File: D:\nt\private\ntos\ke\timerobj.c, line 186
>
> The code
> VOID MPHalt(
> IN NDIS_HANDLE MiniportAdapterContext)
> {
> PMP_ADAPTER Adapter = (PMP_ADAPTER) MiniportAdapterContext;
> ...
> // Cancel pending timers
> NdisMCancelTimer(&Adapter->Timer, &Cancelled);
> ...
> }
>
> Could you give me any suggestions or clues, thank in advance.



Re: NDIS test failed on MiniportHalt by paochen_paul

paochen_paul
Mon Mar 01 06:32:05 CST 2004

I do free adapter structure after *Cancel* all of the timers.
So I am sure the storage of the timers didn't be freed!!
but the curious problem is when the NdisMCancelTimer be call on testing
the ndis LoadUnload, then system crashed!
I try many times! Windbg 6.3.5.1 shows:

*** Assertion failed: ((Timer)->Header.Type == TimerNotificationObject)
|| ((Timer)->Header.Type == TimerSynchronizationObject)
*** Source File: D:\nt\private\ntos\ke\timerobj.c, line 186

or

....
Nbt.NbtSetSmbBindingInfo: PnPOpCode=<1>, Bindings=<5>, BindMask=[2:0]==>[3:0]
Nbt.NbtSetSmbBindingInfo: PnPOpCode=<2>, Bindings=<5>, BindMask=[3:0]==>[3:0]
Flushing all ates 81970008
Nbt.NbtDestroyDevice: *** Destroying Device ***
\Device\NetBT_Tcpip_{6513E0B5-96DD-455A-9D34-640303895E18}
EXWORKER: exception in worker routine 805D5F9E(819B7228)
exception record at EC44B4C4
MM:***PAGE FAULT AT IRQL > 1 Va 00000038, IRQL 1c
MM:***PAGE FAULT AT IRQL > 1 Va 00000033, IRQL 1c
MM:***PAGE FAULT AT IRQL > 1 Va 00000033, IRQL 1c


"Alireza Dabagh [MS]" <alid@online.microsoft.com> wrote in message news:<uG8QG#X$DHA.2804@tk2msftngp13.phx.gbl>...
> Could it be that you freed you adapter structure too early in your halt
> routine?
>
> By the way, you should have the storage for your timers to be of the type
> NDIS_MINIPORT_TIMER and use NdisMInitializeTimer to initialize them and
> NdisMSetTimer to set them (even though NdisMSetTimer is a macro that is
> resolved to NdisSetTimer).
>
> -ali
>
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Paul Simon" <paochen_paul@hotmail.com> wrote in message
> news:4d62e692.0402270157.533edcb3@posting.google.com...
> > In the MiniprotHalt routine, I have to cancel timer queue
> > which I have set with NdisSetTimer and NdisInitializeTimer
> > at Miniport InitializeHandler. When I called *NdisMCancelTimer*,
> > I got an assertion failed.
> >
> > *** Assertion failed: ((Timer)->Header.Type == TimerNotificationObject)
> > || ((Timer)->Header.Type == TimerSynchronizationObject)
> > *** Source File: D:\nt\private\ntos\ke\timerobj.c, line 186
> >
> > The code
> > VOID MPHalt(
> > IN NDIS_HANDLE MiniportAdapterContext)
> > {
> > PMP_ADAPTER Adapter = (PMP_ADAPTER) MiniportAdapterContext;
> > ...
> > // Cancel pending timers
> > NdisMCancelTimer(&Adapter->Timer, &Cancelled);
> > ...
> > }
> >
> > Could you give me any suggestions or clues, thank in advance.

Re: NDIS test failed on MiniportHalt by Alireza

Alireza
Wed Mar 03 02:01:45 CST 2004

Are sure you do not corrupt your timer structure is any way and you are
passing the right pointer to NdisMCancelTimer?
Did you follow my other comments regarding using the right APIs?

Could you please dump your timer structure and post the results?

-thanks, ali

--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Paul Simon" <paochen_paul@hotmail.com> wrote in message
news:4d62e692.0403010432.2cfa6810@posting.google.com...
> I do free adapter structure after *Cancel* all of the timers.
> So I am sure the storage of the timers didn't be freed!!
> but the curious problem is when the NdisMCancelTimer be call on testing
> the ndis LoadUnload, then system crashed!
> I try many times! Windbg 6.3.5.1 shows:
>
> *** Assertion failed: ((Timer)->Header.Type == TimerNotificationObject)
> || ((Timer)->Header.Type == TimerSynchronizationObject)
> *** Source File: D:\nt\private\ntos\ke\timerobj.c, line 186
>
> or
>
> ....
> Nbt.NbtSetSmbBindingInfo: PnPOpCode=<1>, Bindings=<5>,
BindMask=[2:0]==>[3:0]
> Nbt.NbtSetSmbBindingInfo: PnPOpCode=<2>, Bindings=<5>,
BindMask=[3:0]==>[3:0]
> Flushing all ates 81970008
> Nbt.NbtDestroyDevice: *** Destroying Device ***
> \Device\NetBT_Tcpip_{6513E0B5-96DD-455A-9D34-640303895E18}
> EXWORKER: exception in worker routine 805D5F9E(819B7228)
> exception record at EC44B4C4
> MM:***PAGE FAULT AT IRQL > 1 Va 00000038, IRQL 1c
> MM:***PAGE FAULT AT IRQL > 1 Va 00000033, IRQL 1c
> MM:***PAGE FAULT AT IRQL > 1 Va 00000033, IRQL 1c
>
>
> "Alireza Dabagh [MS]" <alid@online.microsoft.com> wrote in message
news:<uG8QG#X$DHA.2804@tk2msftngp13.phx.gbl>...
> > Could it be that you freed you adapter structure too early in your halt
> > routine?
> >
> > By the way, you should have the storage for your timers to be of the
type
> > NDIS_MINIPORT_TIMER and use NdisMInitializeTimer to initialize them and
> > NdisMSetTimer to set them (even though NdisMSetTimer is a macro that is
> > resolved to NdisSetTimer).
> >
> > -ali
> >
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no
rights.
> >
> > "Paul Simon" <paochen_paul@hotmail.com> wrote in message
> > news:4d62e692.0402270157.533edcb3@posting.google.com...
> > > In the MiniprotHalt routine, I have to cancel timer queue
> > > which I have set with NdisSetTimer and NdisInitializeTimer
> > > at Miniport InitializeHandler. When I called *NdisMCancelTimer*,
> > > I got an assertion failed.
> > >
> > > *** Assertion failed: ((Timer)->Header.Type ==
TimerNotificationObject)
> > > || ((Timer)->Header.Type == TimerSynchronizationObject)
> > > *** Source File: D:\nt\private\ntos\ke\timerobj.c, line 186
> > >
> > > The code
> > > VOID MPHalt(
> > > IN NDIS_HANDLE MiniportAdapterContext)
> > > {
> > > PMP_ADAPTER Adapter = (PMP_ADAPTER) MiniportAdapterContext;
> > > ...
> > > // Cancel pending timers
> > > NdisMCancelTimer(&Adapter->Timer, &Cancelled);
> > > ...
> > > }
> > >
> > > Could you give me any suggestions or clues, thank in advance.



Re: NDIS test failed on MiniportHalt by stewo68

stewo68
Wed Mar 03 07:21:37 CST 2004

What about the 'Cancelled' boolean returned by NdisMCancelTimer()? Do
you check its value?

If it is FALSE, the timer could not be stopped, which leads to serious
problems if you do not take appropriate action (e.g. active wait
(loop) until your timer callback has terminated - actually a *real*
problem because there is no way to guarantee this from a driver, see
e.g. http://www.google.com/groups?selm=3c028392.511645%40news.t-online.de).

Stephan
---
paochen_paul@hotmail.com (Paul Simon) wrote in message news:<4d62e692.0402270157.533edcb3@posting.google.com>...
> In the MiniprotHalt routine, I have to cancel timer queue
> which I have set with NdisSetTimer and NdisInitializeTimer
> at Miniport InitializeHandler. When I called *NdisMCancelTimer*,
> I got an assertion failed.
>
> *** Assertion failed: ((Timer)->Header.Type == TimerNotificationObject)
> || ((Timer)->Header.Type == TimerSynchronizationObject)
> *** Source File: D:\nt\private\ntos\ke\timerobj.c, line 186
>
> The code
> VOID MPHalt(
> IN NDIS_HANDLE MiniportAdapterContext)
> {
> PMP_ADAPTER Adapter = (PMP_ADAPTER) MiniportAdapterContext;
> ...
> // Cancel pending timers
> NdisMCancelTimer(&Adapter->Timer, &Cancelled);
> ...
> }
>
> Could you give me any suggestions or clues, thank in advance.

Re: NDIS test failed on MiniportHalt by Alireza

Alireza
Wed Mar 03 13:20:27 CST 2004

> What about the 'Cancelled' boolean returned by NdisMCancelTimer()? Do
> you check its value?


Apparently he gets this ASSERT -in- the call to Cancel routine.

-ali


--
This posting is provided "AS IS" with no warranties, and confers no rights.


"Stephan Wolf" <stewo68@hotmail.com> wrote in message
news:6e8a2a95.0403030521.189d8ee0@posting.google.com...
> What about the 'Cancelled' boolean returned by NdisMCancelTimer()? Do
> you check its value?
>
> If it is FALSE, the timer could not be stopped, which leads to serious
> problems if you do not take appropriate action (e.g. active wait
> (loop) until your timer callback has terminated - actually a *real*
> problem because there is no way to guarantee this from a driver, see
> e.g.
http://www.google.com/groups?selm=3c028392.511645%40news.t-online.de).
>
> Stephan
> ---
> paochen_paul@hotmail.com (Paul Simon) wrote in message
news:<4d62e692.0402270157.533edcb3@posting.google.com>...
> > In the MiniprotHalt routine, I have to cancel timer queue
> > which I have set with NdisSetTimer and NdisInitializeTimer
> > at Miniport InitializeHandler. When I called *NdisMCancelTimer*,
> > I got an assertion failed.
> >
> > *** Assertion failed: ((Timer)->Header.Type == TimerNotificationObject)
> > || ((Timer)->Header.Type == TimerSynchronizationObject)
> > *** Source File: D:\nt\private\ntos\ke\timerobj.c, line 186
> >
> > The code
> > VOID MPHalt(
> > IN NDIS_HANDLE MiniportAdapterContext)
> > {
> > PMP_ADAPTER Adapter = (PMP_ADAPTER) MiniportAdapterContext;
> > ...
> > // Cancel pending timers
> > NdisMCancelTimer(&Adapter->Timer, &Cancelled);
> > ...
> > }
> >
> > Could you give me any suggestions or clues, thank in advance.



Re: NDIS test failed on MiniportHalt by Stephan

Stephan
Thu Mar 04 14:17:10 CST 2004

Hmm, maybe try and call NdisMSetTimer() right before the cancel call,
just to see if that crashes also?

If yes, there's good chance the timer structure has been corrupted
somehow.

Stephan
---
On Wed, 3 Mar 2004 11:20:27 -0800, "Alireza Dabagh [MS]"
<alid@online.microsoft.com> wrote:

>> What about the 'Cancelled' boolean returned by NdisMCancelTimer()? Do
>> you check its value?
>
>
>Apparently he gets this ASSERT -in- the call to Cancel routine.
>
>-ali