@@ -114,23 +114,17 @@ else status = RegOpenKeyExA(_hKey, [path cStringWithEncoding: [OFLocale encoding]], options, securityAndAccessRights, &subKey); - if (status != ERROR_SUCCESS) { - if (status == ERROR_FILE_NOT_FOUND) { - objc_autoreleasePoolPop(pool); - return nil; - } - + if (status != ERROR_SUCCESS) @throw [OFOpenWindowsRegistryKeyFailedException exceptionWithRegistryKey: self path: path options: options securityAndAccessRights: securityAndAccessRights status: status]; - } objc_autoreleasePoolPop(pool); return [[[OFWindowsRegistryKey alloc] of_initWithHKey: subKey close: true] @@ -371,11 +365,10 @@ void *pool = objc_autoreleasePoolPush(); DWORD type, ret; OFData *data = [self dataForValueNamed: name type: &type]; if (data == nil) - /* TODO: This exception is not ideal. */ @throw [OFUndefinedKeyException exceptionWithObject: self key: name value: nil]; if (type != REG_DWORD) @@ -405,11 +398,10 @@ DWORD type; uint64_t ret; OFData *data = [self dataForValueNamed: name type: &type]; if (data == nil) - /* TODO: This exception is not ideal. */ @throw [OFUndefinedKeyException exceptionWithObject: self key: name value: nil]; if (type != REG_QWORD)