SetErrorMode() in Kernel Mode...

Hi !

What function I can use in Kernel Mode for the equivalent SetErrorMode()
Win32 API ?

Thank you

I believe that IoSetThreadHardErrorMode will do what you want; I don’t know
enough about the Win32 API to tell you if it is equivalent, though…

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

-----Original Message-----
From: Marcos Velasco [mailto:xxxxx@uol.com.br]
Sent: Wednesday, February 12, 2003 8:32 AM
To: File Systems Developers
Subject: [ntfsd] SetErrorMode() in Kernel Mode…

Hi !

What function I can use in Kernel Mode for the equivalent SetErrorMode()
Win32 API ?

Thank you


You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Tony is correct. Just remember that you are disabling hard errors on
this thread - for all hard errors - not just the one you want to ignore.
You can - of course - turn if off and then back on if you are servicing
a synchronous call. As you can see, the return code tells you if they
were enable or disabled before the call - so you can set them back to
their previous state. /TomH

IoSetThreadHardErrorMode
IoSetThreadHardErrorMode enables or disables hard error reporting for
the current thread.

BOOLEAN
IoSetThreadHardErrorMode(
IN BOOLEAN EnableHardErrors
);
Parameters
EnableHardErrors
Specifies if hard error reporting to the user should be enabled or
disabled for this thread.
Return Value
IoSetThreadHardErrorMode returns TRUE if hard errors were enabled from
this thread before this routine completed execution.

Headers
Declared in ntddk.h. Include ntddk.h.

Comments
If hard errors are disabled for a given thread, calls to
IoRaiseHardError will not display a message to the user indicating that
a serious error has occurred. In addition, the IRP that is passed to
IoRaiseHardError is completed without any data being copied into user
buffers. Calling IoRaiseInformationalHardError after disabling hard
errors causes that routine to always return FALSE for this thread.

Callers of this routine must be running at IRQL <= DISPATCH_LEVEL.

-----Original Message-----
From: Tony Mason [mailto:xxxxx@osr.com]
Sent: Wednesday, February 12, 2003 7:49 AM
To: File Systems Developers
Subject: [ntfsd] RE: SetErrorMode() in Kernel Mode…

I believe that IoSetThreadHardErrorMode will do what you want; I don’t
know
enough about the Win32 API to tell you if it is equivalent, though…

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

-----Original Message-----
From: Marcos Velasco [mailto:xxxxx@uol.com.br]
Sent: Wednesday, February 12, 2003 8:32 AM
To: File Systems Developers
Subject: [ntfsd] SetErrorMode() in Kernel Mode…

Hi !

What function I can use in Kernel Mode for the equivalent SetErrorMode()
Win32 API ?

Thank you


You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@inflectionsystems.com
To unsubscribe send a blank email to xxxxx@lists.osr.com