?
Solved

NDIS driver - packet communication

Posted on 1998-01-20
5
Medium Priority
?
636 Views
Last Modified: 2013-12-03
I have an NDIS driver that I have written that also has an intermediate(?) level driver that functions like the "packet" driver in the DDK.

I now need to send on IOCTL from this driver to the NDIS driver (to perform a control function). I have tried just calling IoBuildDeviceIoControlRequest and then calling IoCall Driver. I get a blue screen after the IoCall Driver.
The error points to a reference to address 0x10 at IRQL 2.

I am assuming that there is something else that I must do when setting up the IRP.

Can anyone point me in the right direction ?

I am unclear about the handling of stack locations in an IRP - is there something there that I should be doing.

BTW I am expecting the NDIS driver to handle this IOCTL as an "OID", is that correct.

All help appreciated - Mike Wright

0
Comment
Question by:mwright012397
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 

Author Comment

by:mwright012397
ID: 1410181
Adjusted points to 190
0
 
LVL 4

Accepted Solution

by:
tflai earned 190 total points
ID: 1410182
It seems to me that you are calling IoBuildDeviceIoControlRequest in IRQL higher than PASSIVE_LEVEL.  By default, NDIS will call almost all of your driver's dispatch functions (xxxSend, xxxTransferData, xxxRequest, ...) in IRQL DISPATCH_LEVEL.  Only DriverEntry and xxxUnload runs in IRQL PASSIVE_LEVEL.  What you need is to create worker threads in DriverEntry to do those tasks for you.  Using PsCreateSystemThread, you can create threads that runs in PASSIVE_LEVEL.
Also, before you sends the IRP to the lower driver with an IoCallDriver, make sure that you set the completion routine if you want one, and IoGetNextStackLocation to fill out the next I/O stack location structure.
Most of all, look carefully at DDK's help file and sample codes, and you should be able to find more helps.  And good luck debugging...
0
 

Author Comment

by:mwright012397
ID: 1410183
It is the bit about IoGetNextStackLocation that I am unsure about. Can you point me at a good description of what I need to do with the stack location. How do I set up the stack so that the lower level driver sees the request as an OID ?

Or must I set this up as a DEVICE_CONTROL type and add the handler to my lower level driver ?
0
 

Author Comment

by:mwright012397
ID: 1410184
SOmeone else (on UseNet) suggested that I use NdisRequest instead. I seem to be getting further using that approach at the moment.


0
 
LVL 4

Expert Comment

by:tflai
ID: 1410185
Oh!  If only passing OIDs is needed, use NdisRequest instead.  The other way is pretty complicated, you should do that if there are no other way to interface the lower driver.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question