Hello,

I am developing a miniport driver for Windows XP and want to set a the
packet filter. But my machine crashes, if I set the packet filter via
NdisRequest. I debuged my driver and detected that the error occures in
"ndis!MSyncSetInformation". I think that MSyncSetInformation is a ndis
function. Unfortunately, I don't know this ndis function and my driver
doesn't call it. Have anyone an idea, why this fuction is called by my
system? Why crashs my machine?

Thank you in advance...

Stefan Lankes

RE: Cann't set the packet filter... by bburgin

bburgin
Sat Jul 17 14:53:05 CDT 2004

------=_NextPart_0001_5F01C720
Content-Type: text/plain
Content-Transfer-Encoding: 7bit


I assume that you mean that you're trying to set your packet filter as the
result of a protocol calling NdisRequest and NDIS calling your set handler.

I did not find ndis!MSyncSetInformation, and didn't expect to - but I also
looked for ndis!ndisMSyncSetInformation. Can you provide more information,
like the output of !analyze and a stack trace?

Generally, protocols send query and set requests to miniports via
NdisRequest. But in the case of setting the packet filter, NDIS intercepts
this call. This is because each protocol might (and probably) set
different filters. So, NDIS records the packet filter of each protocol and
then passes a request to the miniport that includes the union of all the
individual filters. But, still, once you get the request, you should
either just store it away or pass it to your hardware, etc, according to
your needs.

Bryan S. Burgin
bburgin@microsoft.com

This posting is provided "AS IS" with no warranties, and confers no rights.
------=_NextPart_0001_5F01C720
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs20
\par I assume that you mean that you're trying to set your packet filter as the result of a protocol calling NdisRequest and NDIS calling your set handler.
\par
\par I did not find ndis!MSyncSetInformation, and didn't expect to - but I also looked for ndis!ndisMSyncSetInformation. Can you provide more information, like the output of !analyze and a stack trace?
\par
\par Generally, protocols send query and set requests to miniports via NdisRequest. But in the case of setting the packet filter, NDIS intercepts this call. This is because each protocol might (and probably) set different filters. So, NDIS records the packet filter of each protocol and then passes a request to the miniport that includes the union of all the individual filters. But, still, once you get the request, you should either just store it away or pass it to your hardware, etc, according to your needs.
\par
\par Bryan S. Burgin
\par bburgin@microsoft.com
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par }
------=_NextPart_0001_5F01C720--


Re: Cann't set the packet filter... by Stefan

Stefan
Sat Jul 17 15:18:35 CDT 2004


""Bryan S. Burgin [MSFT]"" <bburgin@online.microsoft.com> schrieb im
Newsbeitrag news:Vo0l8eDbEHA.3120@cpmsftngxa06.phx.gbl...
>
> I assume that you mean that you're trying to set your packet filter as the
> result of a protocol calling NdisRequest and NDIS calling your set
handler.

Yes, my code looks like this:
// Global variables
ULONG ulFilter;
NDIS_REQUEST nrBuffer;

NDIS_STATUS SetPacketFilter( NDIS_HANDLE nhMiniportHandle )
{
NDIS_STATUS nsRet;
ulFilter = ... // filter type nrBuffer.RequestType =
NdisRequestSetInformation;
nrBuffer.DATA.SET_INFORMATION.Oid = OID_GEN_CURRENT_PACKET_FILTER;
nrBuffer.DATA.SET_INFORMATION.InformationBuffer = &ulFilter;
nrBuffer.DATA.SET_INFORMATION.InformationBufferLength =
sizeof( ulFilter );

NdisRequest( &nsRet, nhMiniportHandle, &nrBuffer );

return nsRet;
}
> I did not find ndis!MSyncSetInformation, and didn't expect to - but I also
> looked for ndis!ndisMSyncSetInformation. Can you provide more
information,
> like the output of !analyze and a stack trace?

No problem... Here is my call stack:

nt!RtlpBreakWithStatusInstruction
nt!KiBugCheckDebugBreak+0x19
nt!KeBugCheck2+0x46d
nt!KeBugCheckEx+0x19
nt!KiTrap0E+0x2ad
WARNING: Frame IP not in any known module. Following frames may be wrong.
0x4
NDIS!ndisMSyncSetInformationComplete+0xf2
NDIS!ndisMDoRequests+0x3e2
NDIS!ndisMRequest+0xfa
NDIS!ndisMRundownRequests+0x30
NDIS!ndisWorkerThread+0x73
nt!PspSystemThreadStartup+0x34
nt!KiThreadStartup+0x16





Re: Cann't set the packet filter... by bburgin

bburgin
Sat Jul 17 15:39:17 CDT 2004

------=_NextPart_0001_5F2C0D25
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

If you're writing a miniport driver, per your original post, why are you
calling NdisRequest?

Bryan S. Burgin
bburgin@microsoft.com

This posting is provided "AS IS" with no warranties, and confers no rights.
------=_NextPart_0001_5F2C0D25
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs20 If you're writing a miniport driver, per your original post, why are you calling NdisRequest?
\par
\par Bryan S. Burgin
\par bburgin@microsoft.com
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par
\par }
------=_NextPart_0001_5F2C0D25--


Re: Cann't set the packet filter... by Stefan

Stefan
Sun Jul 18 05:41:26 CDT 2004

My driver based on the passthru example of the DDK and I send the requests
down to the underlying miniport driver. Is this wrong?

""Bryan S. Burgin [MSFT]"" <bburgin@online.microsoft.com> schrieb im
Newsbeitrag news:HpPAw4DbEHA.2924@cpmsftngxa06.phx.gbl...
> If you're writing a miniport driver, per your original post, why are you
> calling NdisRequest?
>
> Bryan S. Burgin
> bburgin@microsoft.com
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.



Re: Cann't set the packet filter... by Stefan

Stefan
Sun Jul 18 06:44:37 CDT 2004


> My driver based on the passthru example of the DDK and I send the requests
> down to the underlying miniport driver. Is this wrong?
>

I think that this posting describes the same problem:
http://groups.google.de/groups?q=passthru+ndis+OID_GEN_CURRENT_PACKET_FILTER&hl=de&lr=&ie=UTF-8&selm=92a9066.0210241120.1f1b8525%40posting.google.com&rnum=2

Unfortunately, I found no solution of my problem...

:-(

Stefan Lankes



Re: Cann't set the packet filter... by bburgin

bburgin
Sun Jul 18 16:54:59 CDT 2004

------=_NextPart_0001_6497E589
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Calling NdisRequest from the protocol edge of an IM driver is okay (for the
purpose of passing down a request that you received on your miniport edge",
it's just not what you initially reported: "I am developing a miniport
driver".

There are OIDs that are passed down as part of the initialization process.
Can you supply the output of !analyze in addition to the stack trace?

Bryan S. Burgin
bburgin@microsoft.com

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

------=_NextPart_0001_6497E589
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs20 Calling NdisRequest from the protocol edge of an IM driver is okay (for the purpose of passing down a request that you received on your miniport edge", it's just not what you initially reported: "I am developing a miniport driver".
\par
\par There are OIDs that are passed down as part of the initialization process. Can you supply the output of !analyze in addition to the stack trace?
\par
\par Bryan S. Burgin
\par bburgin@microsoft.com
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par
\par
\par }
------=_NextPart_0001_6497E589--


Re: Cann't set the packet filter... by Alireza

Alireza
Mon Jul 19 01:01:08 CDT 2004

I think your mistake is that instead of passing the Binding handle you got
by calling NdisOpenAdapter on underlying adapter, you are using the miniport
handle you got in the call to your MiniportInitialize.

The handle that your protocol edge should use for any call to NDIS (such as
issuing a request or Send) is the one obtained by calling NdisOpenAdapter.
The handle that your miniport edge uses for any call to NDIS (such as
"completing" a pended request or Send, or status and receive indications) is
the one you got when your MiniportInitialize was called.

I am also assuming you handle the case where the returned status is pending.
But one step at a time..

-ali

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

"Stefan Lankes" <stefan.lankes@web.de> wrote in message
news:cddk4i$hgf$02$1@news.t-online.com...
> My driver based on the passthru example of the DDK and I send the requests
> down to the underlying miniport driver. Is this wrong?
>
> ""Bryan S. Burgin [MSFT]"" <bburgin@online.microsoft.com> schrieb im
> Newsbeitrag news:HpPAw4DbEHA.2924@cpmsftngxa06.phx.gbl...
> > If you're writing a miniport driver, per your original post, why are you
> > calling NdisRequest?
> >
> > Bryan S. Burgin
> > bburgin@microsoft.com
> >
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>



Re: Cann't set the packet filter... by Stefan

Stefan
Mon Jul 19 05:50:15 CDT 2004

Ups, I used the wrong handle. Now, my driver works correctly.

Stefan


"Alireza Dabagh [MS]" <alid@online.microsoft.com> schrieb im Newsbeitrag
news:%23JOwMXVbEHA.3996@TK2MSFTNGP12.phx.gbl...
> I think your mistake is that instead of passing the Binding handle you got
> by calling NdisOpenAdapter on underlying adapter, you are using the
miniport
> handle you got in the call to your MiniportInitialize.
>
> The handle that your protocol edge should use for any call to NDIS (such
as
> issuing a request or Send) is the one obtained by calling NdisOpenAdapter.
> The handle that your miniport edge uses for any call to NDIS (such as
> "completing" a pended request or Send, or status and receive indications)
is
> the one you got when your MiniportInitialize was called.
>
> I am also assuming you handle the case where the returned status is
pending.
> But one step at a time..
>
> -ali
>
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "Stefan Lankes" <stefan.lankes@web.de> wrote in message
> news:cddk4i$hgf$02$1@news.t-online.com...
> > My driver based on the passthru example of the DDK and I send the
requests
> > down to the underlying miniport driver. Is this wrong?
> >
> > ""Bryan S. Burgin [MSFT]"" <bburgin@online.microsoft.com> schrieb im
> > Newsbeitrag news:HpPAw4DbEHA.2924@cpmsftngxa06.phx.gbl...
> > > If you're writing a miniport driver, per your original post, why are
you
> > > calling NdisRequest?
> > >
> > > Bryan S. Burgin
> > > bburgin@microsoft.com
> > >
> > > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> >
> >
>
>