c++winapi

`LoadUserProfileW` failing with error codes, where to find the list of error codes


This is a follow up to this question

I am trying to debug why LoadUserProfileW function has been failing. These are the error codes I am seeing:

0x80070490
0x80070020

Where can I find what these Hex values mean? There is no documentation for possible error codes of LoadUserProfileW in MSFT doc website.


Solution

  • Error Codes obtained by GetLastError() can be found at Debug system error codes at Microsoft Learn (formerly MSDN).

    However, 0x80070490 does not look like such an error code. It looks more like an HRESULT. Unfortunately, HRESULTs do not map back to Error codes 1:1. In case of a system error code, just take the last 4 hex digits, which translate to ERROR_NOT_FOUND (0x490) and ERROR_SHARING_VIOLATION (0x20) in your case.