Ok, I was going to stay out of this mess, but I’ve reached my limit here.
Debugging: use windbg. You need two systems, a test system and a development
system. DbgView is a very nice program, but new developers should start out
with the correct tool sets. They are confused enough, why prolong the
confusion?
IrpView: nice tool, not for his problem. The OP has no clue how to write a
driver, as his code sample and comments clearly show, and as I think he
would freely admit. Viewing IRP traces is not likely to help. You might as
well suggest that he learn sanskrit.
Hylton needs to get a good book on WDM drivers, Walter Oney’s “Programming
the Windows Driver Model”, Microsoft Press, would be a good start. Then he
needs to read the book, and maybe work through a couple of the examples.
Then he needs to go read the ddk and study the source code samples there. If
possible he should consider attending one of the seminars offered by the
various training companies.
Finally, I have no idea where Hylton got his source code model from, but he
should throw that crap out and use the samples in the DDK as a starting
point.
=====================
Mark Roddy
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bohannon, Ivan
Sent: Thursday, January 06, 2005 11:16 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Debugging Code - new to windbg
An IRP viewer might have helped debug this problem, I think the download
page on OSR has an IRP viewer util, I haven’t used it tho.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Hylton Tregenza
Sent: Thursday, January 06, 2005 11:04 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Debugging Code - new to windbg
And yep you did.
Where do I find out more about this stuff. I would never have known that
that member existed, never mind what it was there for.
Thanks to all who did supply this answer.
Any takers on the second part of the question How do get the debugger to
show these messages (then I would have known that the driver was getting the
call) when working on a single machine.
This is a “got to tell someone moment”. My first ever response from a driver
with ioctl (never mind my own driver).
Very grateful
Hylton
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bohannon, Ivan
Sent: 06 January 2005 05:15 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Debugging Code - new to windbg
Ooh I can fix this one…
For returning information back from your driver to user mode you need to set
your Irp->IoStatus.Information to the number of bytes being returned.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Hylton Tregenza
Sent: Thursday, January 06, 2005 10:03 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Debugging Code - new to windbg
Hi all
Still busy with my first foray into driver depths. Could someone please
supply an answer (or location to the answer) of the following question.
This
has to do with debugging.
I am trying to communicate with a test driver that I have created. I am
using a consol app and sending
DeviceIoControl(DriverHandle,IOCTL_IMPACKETCOUNTER_GETPACKETS, (LPVOID)
szBuffer, sizeof(szBuffer), (LPVOID) szBuffer, sizeof(szBuffer), &Returned,
NULL )) to the driver. (I coppied the CTL_CODE marco from the DDK to ensure
the same number was generated)
In the driver code I have the following
DBGPRINT((“==>Pt Dispatch\n”));
irpStack = IoGetCurrentIrpStackLocation(Irp);
switch (irpStack->MajorFunction)
{
case IRP_MJ_CREATE:
break;
case IRP_MJ_CLEANUP:
break;
case IRP_MJ_CLOSE:
break;
case IRP_MJ_DEVICE_CONTROL:
DBGPRINT((“DrvFltIp.SYS: IRP_MJ_DEVICE_CONTROL\n”));
ioControlCode =
irpStack->Parameters.DeviceIoControl.IoControlCode;
switch (ioControlCode)
{
case IOCTL_IMPACKETCOUNTER_GETPACKETS:
{
memcpy(Irp->AssociatedIrp.SystemBuffer, “Hello There”, sizeof(“Hello
There”));
}
break;
}
break;
default:
break;
}
I am not sure what is happening with this call. The return code from
DeviceIoControl is O (OK).
The buffer is not populated with the result.
I have the disadvantage of only working on one machine at the moment (other
one is being built).
How do I get the debugger (never used it before ) to show the dbgmessages
while working local. I think I need to select a process or something but the
driver does not appear anywhere.
Apologies if I have supplies surplus information. As this driver fog slowly
lifts, I am sure I will be able to ask more sensible questions.
Hylton
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@nsisoftware.com To
unsubscribe send a blank email to xxxxx@lists.osr.com
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@nsisoftware.com To
unsubscribe send a blank email to xxxxx@lists.osr.com
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com