What's the different between HRESULT E_FAIL error of 0x80004005 and 0x80000008?

1

i'm a bit confused, i've checked WinError.h and saw 2 E_FAIL declerations:

//
// MessageId: E_FAIL
//
// MessageText:
//
// Unspecified error
//
#define E_FAIL                           _HRESULT_TYPEDEF_(0x80000008L)

//
// MessageId: E_FAIL
//
// MessageText:
//
// Unspecified error
//
#define E_FAIL                           _HRESULT_TYPEDEF_(0x80004005L)

One issue that I've encountered, is that i'm implementing namespace extensions, and when opening a file that doesnt exist, i get the following:

when returning 0x80000008 - i get "Unspecified error"

when returning 0x80004005 - i get the desired behavior "The file name is not valid."

So what should i use? what's the difference? thanks

c++
shell-extensions
hresult
asked on Stack Overflow Jul 15, 2015 by ArielB

1 Answer

2

These are defined in a conditional block.

The second is defined when:

#if defined(_WIN32) && !defined(_MAC)

and the first when:

#else

Does that answer your question?


User contributions licensed under CC BY-SA 3.0