Re: returning an HRESULT that represents a warning
- From: "Alexander Nickolov" <agnickolov@xxxxxxxx>
- Date: Mon, 20 Aug 2007 09:40:06 -0700
That's the convention for internal NT codes. For example,
0xC0000005 is Access Violation and is an error (highest
two bits are 1s). HRESULT doesn't use that scheme though.
Instead, it uses a single severity bit to distinguish between
errors and success (warnings and info results are considered
success).
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://vcfaq.mvps.org
=====================================
"Brian Muth" <bmuth@xxxxxxxx> wrote in message
news:%23YukgwS4HHA.1188@xxxxxxxxxxxxxxxxxxxxxxx
"John" <John@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DA0478E1-73D6-448D-B039-8FEE89872BEE@xxxxxxxxxxxxxxxx
Is it possible to return an HRESULT that represents a warning as opposed
to
an error?
I thought the severity code was the following;
00 - Success
01 - Informational
10 - Warning
11 - Error
I'm not sure where you got this information from. Can you provide a
reference?
But if you look at the HRESULT_SEVERITY macro
#define HRESULT_SEVERITY(hr) (((hr) >> 31) & 0x1)
This would indicate that an error and a warning are both errors.
HRESULT are either success (if non-negative) or fail (negative). There is
no "information" or "warning" level that I'm aware of.
Brian
.
- References:
- Re: returning an HRESULT that represents a warning
- From: Brian Muth
- Re: returning an HRESULT that represents a warning
- Prev by Date: Re: Where is the guid in code?
- Next by Date: Re: Dll in ActiveX Control
- Previous by thread: Re: returning an HRESULT that represents a warning
- Next by thread: Learning about monikers
- Index(es):
Relevant Pages
|