def GetRootKey(self):
root_registry_key = virtual.VirtualWinRegistryKey('<STR_LIT>')<EOL>for mapped_key in self._MAPPED_KEYS:<EOL><INDENT>key_path_segments = key_paths.SplitKeyPath(mapped_key)<EOL>if not key_path_segments:<EOL><INDENT>continue<EOL><DEDENT>registry_key = root_registry_key<EOL>for name in key_path_segments[:-<NUM_LIT:1>]:<EOL><INDENT>sub_registry_key = registry_key.GetSubkeyByName(name)<EOL>if not sub_registry_key:<EOL><INDENT>sub_registry_key = virtual.VirtualWinRegistryKey(name)<EOL>registry_key.AddSubkey(sub_registry_key)<EOL><DEDENT>registry_key = sub_registry_key<EOL><DEDENT>sub_registry_key = registry_key.GetSubkeyByName(key_path_segments[-<NUM_LIT:1>])<EOL>if (not sub_registry_key and<EOL>isinstance(registry_key, virtual.VirtualWinRegistryKey)):<EOL><INDENT>sub_registry_key = virtual.VirtualWinRegistryKey(<EOL>key_path_segments[-<NUM_LIT:1>], registry=self)<EOL>registry_key.AddSubkey(sub_registry_key)<EOL><DEDENT><DEDENT>return root_registry_key<EOL>
Retrieves the Windows Registry root key.

        Returns:
          WinRegistryKey: Windows Registry root key.

        Raises:
          RuntimeError: if there are multiple matching mappings and
              the correct mapping cannot be resolved.