winapihresult

Win32: What is HRESULT 0x80070002?


I can't find the definition of HRESULT: 0x80070002

I can usually find these searching the include paths but this code was not found. Does anyone have the explanation of what it is? I think it is coming from the shell.

Thanks.


Solution

  • 0x80070002 is the Win32 error code 2 (ERROR_FILE_NOT_FOUND) in HRESULT format, as returned by the HRESULT_FROM_WIN32() macro.

    When in doubt, you can use the HRESULT_FACILITY() and HRESULT_CODE() macros to help you figure out what an HRESULT stands for.

    In this case, 0x80070002 has a facility of 7 (FACILITY_WIN32), meaning the code (2) is a Win32 error code (ERROR_FILE_NOT_FOUND).