Re: Writing to a file
From: Stephan Wolf (stewo68_at_hotmail.com)
Date: 03/30/04
- Next message: mozart: "Re: WRITE_REGISTER_BUFFER_UCHAR..."
- Previous message: Isajanyan: "Re: What's the analog of DbgPrint for Win98-Me?"
- In reply to: Ram Nayak: "Re: Writing to a file"
- Messages sorted by: [ date ] [ thread ]
Date: 30 Mar 2004 01:00:43 -0800
There is no "NDIS way" for an NDIS driver to (directly) write to a
file. The NdisOpenFile() etc. is only there for read-only purposes.
One should usually use NdisWriteErrorLogEntry() to write log entries.
The 'ErrorCode' does *not* need to be an actual error code, i.e. it
can also be a warning or an informational entry. More, although tbe
docs say about the 'ErrorCode' that it "Specifies the NDIS_STATUS_XXX
code describing the I/O error", it does not actually need to be an
NDIS_STATUS_XXX code. Instead, you can define your own codes. Then you
can add a message file to your driver (compiled with MC - the message
compiler), which contains messages for each code that you define. That
will enable the Event Viewer to display your codes along with a
meaningful message.
For more information see "Logging Errors" in the DDK docs:
http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/other_92jr.asp
-> "Defining Custom Error Types"
Note that I have never used NdisWriteEventLogEntry() ("event"), which
may also be an option for you.
Stephan
--- "Ram Nayak" <spam@spam.com> wrote in message news:<#tHEZbdFEHA.2416@TK2MSFTNGP12.phx.gbl>... > I am trying to create a log file from the driver. > > I will need to log to a file from the send/receive functions. > > ..Ram > > "Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message > news:elxiPZdFEHA.3084@TK2MSFTNGP09.phx.gbl... > > From what path? Bind/unbind? or send? or receive? > > > > -- > > Maxim Shatskih, Windows DDK MVP > > StorageCraft Corporation > > maxim@storagecraft.com > > http://www.storagecraft.com > > > > > > "Ram Nayak" <spam@spam.com> wrote in message > > news:O0jECWdFEHA.4008@TK2MSFTNGP10.phx.gbl... > > > How can I open a file on the disk and write to it from a NDIS miniport > > > driver? > > > > > > Thanks, > > > > > > ..Ram > > > > > > > > > >
- Next message: mozart: "Re: WRITE_REGISTER_BUFFER_UCHAR..."
- Previous message: Isajanyan: "Re: What's the analog of DbgPrint for Win98-Me?"
- In reply to: Ram Nayak: "Re: Writing to a file"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|