We should not assert that the registry key open'ing was successful: the key may have been removed in the meantime between keys enumeration and when opening the key or, more likely, we may not have the required access rights to open the key, in which case RegOpenKeyExW fails and returns ERROR_ACCESS_DENIED.