I took a look at that code (which is in a third-party library). They are throwing an exception if RegOpenKeyEx returns an error; the (generic) exception handler then calls GetLastError(). For 21.0.40, I just changed that to pass the error returned from RegOpenKeyEx. (Though to be fair to the original developer, the MS docs never say which of the Windows APIs do not support GetLastError().)No, the key does not exist. Are you calling GetLastError() after a function that doesn't SetLastError()?