Re: SCSI miniport-Custom Log messages

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Here a sample (considering that the mc file is named msglog.mc)

1.) Make sure that you use the custom build step for your .mc file:
Command Line: "mc msglog.mc -c"
Outputs: "msglog.rc;msglog.h"

2.) Make sure that you really link agains the .res file (which is
autogenerated by "mc.exe"). Usually this step is forgotten, but it is
mandatory else, the "mc.exe" will make the resource file, but the
resourcelinker does not know about this, since it is not involved
automatically. So add also at "Resources"->"Resource File Name"
"directory\msglog.res"

3.) Also make the necessary entries in the registry by your inf file. Here a
sample inf file section

4.) At least you need to reboot your machine one time to to give the
eventlog system the chance to update its registry values, which you modified
by your inf file


[ClassInstall32.Services]
AddService="MyService",0x00000002,AddServiceCommonSection,EventLogCommonSection,System,"MyServiceDescription"

;--------- EventLog Section -----------------------------------------------
[EventLogCommonSection]
AddReg=AddRegCommonEventLogSection

[AddRegCommonEventLogSection]
HKR,,"EventMessageFile",0x00020000,"%SystemRoot%\System32\iologmsg.dll;%12%\MyDriver.sys"
HKR,,"TypesSupported",0x00010001,0x00000007


"Volodymyr M. Shcherbyna" wrote:

If you open your sys file in resource editor (for example, reshacker), and
goto message table, what id do you see there for your custom message?

--
Volodymyr, blog: http://www.shcherbyna.com/
(This posting is provided "AS IS" with no warranties, and confers no
rights)

"Indira" <Indira@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:29503D5E-AF48-491B-986F-D97A391D9424@xxxxxxxxxxxxxxxx
Hi,

Is it possible to generate custom error log messages for SCSI miniport
driver?
I tried the following but no luck:

1. Created a message (.mc) file, compiled and generated a corresponding
.rc
and .bin file, as per WDK and sample code.

2. Updated .inf file for event log as mentioned in the WDK and added .sys
file to look for messages.

3. Calling StorPortLogError() with this custom error ID.

After installing this driver, an event is getting logged in the event log,
however it complains that it's not able to find the description.

The following message is displayed in the description instead of my custom
error message.

"The description for Event ID ( 11 ) in Source (xyz) cannot be found. The
local computer may not have the necessary registry information or message
DLL
files to display messages from a remote computer. You may be able to use
the
/AUXSOURCE= flag to retrieve this description; see Help and Support for
details. The following information is part of the event:
\Device\RaidPort8.
"

Is it possible to have custom error messages in storport-miniport driver?
If
so could some one please point out the missing thing in the above steps?

Thanks,
Indira




.



Relevant Pages

  • Re: Problem with Event Log (long)
    ... I know that it can write to the custom event log but, unfortunately, this is ... ASP.NET process the right to read the Security account then everything ... doesn't have read permission for *all* of the event logs. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: BizTalk customized error logging
    ... I have used a custom pipeline component to provide "recovery" from Xml ... Alternatively, use BTS2006, where this functionality is standard. ... Now there is only event log entries about ... Very unlikely that BizTalk users must create second Flat File ...
    (microsoft.public.biztalk.general)
  • Re: Runtime error when connected to OWA 2007
    ... The current error page you are seeing can be replaced by a custom ... here is the error from the event log: ... An unhandled exception has occurred. ... Thread account name: NT AUTHORITY\SYSTEM ...
    (microsoft.public.exchange.admin)
  • Re: SCSI miniport-Custom Log messages
    ... If you open your sys file in resource editor, and ... Is it possible to generate custom error log messages for SCSI miniport ... Calling StorPortLogErrorwith this custom error ID. ... After installing this driver, an event is getting logged in the event log, ...
    (microsoft.public.development.device.drivers)
  • Re: SCSI miniport-Custom Log messages
    ... Use this API-Functions for error logging in eventlog instead of your ... Make sure that you use the custom build step for your .mc file: ... Also make the necessary entries in the registry by your inf file. ... After installing this driver, an event is getting logged in the event log, ...
    (microsoft.public.development.device.drivers)