modules/gdextensions/settings/storage/_winreg.cpp
static HKEY create_or_open_key(HKEY parentHandle, REGSAM perms, const String &sub_key, REGSAM access = 0) {
	// try to open it
	HKEY resultHandle = open_key(parentHandle, perms, sub_key, access);
	if (resultHandle != 0) {
		return resultHandle;
	}
	// try to create it
	LONG res = RegCreateKeyEx(parentHandle, sub_key.c_str(), 0, 0, REG_OPTION_NON_VOLATILE, perms | access, 0, &resultHandle, 0);
	if (res == ERROR_SUCCESS) {
		return resultHandle;
	}
	return 0;
}
// Open a key with the specified "perms", create it if it does not exist.
// "access" is to explicitly use the 32- or 64-bit branch.
Open a key with the specified "perms", create it if it does not exist.
"access" is to explicitly use the 32- or 64-bit branch.
Open a key with the specified " perms " create it if it does not exist . " access " is to explicitly use the 32 - or 64 - bit branch .
static HKEY create_or_open_key(HKEY parentHandle, REGSAM perms, const String &sub_key, REGSAM access = 0) {
	HKEY resultHandle = open_key(parentHandle, perms, sub_key, access);
	if (resultHandle != 0) {
		return resultHandle;
	}
	LONG res = RegCreateKeyEx(parentHandle, sub_key.c_str(), 0, 0, REG_OPTION_NON_VOLATILE, perms | access, 0, &resultHandle, 0);
	if (res == ERROR_SUCCESS) {
		return resultHandle;
	}
	return 0;
}
static HKEY create_or_open_key ( HKEY parentHandle , REGSAM perms , const String & sub_key , REGSAM access = 0 ) { HKEY resultHandle = open_key ( parentHandle , perms , sub_key , access ) ; if ( resultHandle != 0 ) { return resultHandle ; } LONG res = RegCreateKeyEx ( parentHandle , sub_key . c_str ( ) , 0 , 0 , REG_OPTION_NON_VOLATILE , perms | access , 0 , & resultHandle , 0 ) ; if ( res == ERROR_SUCCESS ) { return resultHandle ; } return 0 ; }
Open a key with the specified "perms", create it if it does not exist.
Open a key with the specified " perms " create it if it does not exist .
// try to open it // try to create it