Calling GetLastError() will not return the error code for the Windows registry APIs, since they return a LSTATUS value which already is the error code. This also fixes the RegistryTablesTest.test_registry_non_existing_key test case which was incorrectly expecting success when querying for a non-existent registry key.