Index: src/OFWindowsRegistryKey.h ================================================================== --- src/OFWindowsRegistryKey.h +++ src/OFWindowsRegistryKey.h @@ -107,13 +107,15 @@ * @brief Returns the string for the specified value at the specified path. * * @param value The name of the value to return * @param subKeyPath The path of the key from which to retrieve the value * @param flags Extra flags for `RegGetValue()`. Usually 0. + * @param type A pointer to store the type of the value, or NULL * @return The string for the specified value */ - (nullable OFString *)stringForValue: (nullable OFString *)value subKeyPath: (nullable OFString *)subKeyPath - flags: (DWORD)flags; + flags: (DWORD)flags + type: (nullable LPDWORD)type; @end OF_ASSUME_NONNULL_END Index: src/OFWindowsRegistryKey.m ================================================================== --- src/OFWindowsRegistryKey.m +++ src/OFWindowsRegistryKey.m @@ -145,20 +145,21 @@ } - (OFString *)stringForValue: (OFString *)value subKeyPath: (OFString *)subKeyPath flags: (DWORD)flags + type: (LPDWORD)type { void *pool = objc_autoreleasePoolPush(); of_char16_t stackBuffer[256], *buffer = stackBuffer; DWORD length = sizeof(stackBuffer); LSTATUS status; OFString *ret; if ((status = RegGetValueW(_hKey, [subKeyPath UTF16String], [value UTF16String], flags | RRF_RT_REG_SZ | RRF_RT_REG_EXPAND_SZ, - NULL, buffer, &length)) != ERROR_SUCCESS) { + type, buffer, &length)) != ERROR_SUCCESS) { OFObject *tmp; if (status == ERROR_FILE_NOT_FOUND) { objc_autoreleasePoolPop(pool); return nil;