@@ -91,86 +91,67 @@ [super dealloc]; } - (OFWindowsRegistryKey *)openSubkeyAtPath: (OFString *)path - securityAndAccessRights: (REGSAM)securityAndAccessRights -{ - return [self openSubkeyAtPath: path - options: 0 - securityAndAccessRights: securityAndAccessRights]; -} - -- (OFWindowsRegistryKey *)openSubkeyAtPath: (OFString *)path + accessRights: (REGSAM)accessRights options: (DWORD)options - securityAndAccessRights: (REGSAM)securityAndAccessRights { void *pool = objc_autoreleasePoolPush(); LSTATUS status; HKEY subKey; if ([OFSystemInfo isWindowsNT]) status = RegOpenKeyExW(_hKey, path.UTF16String, options, - securityAndAccessRights, &subKey); + accessRights, &subKey); else status = RegOpenKeyExA(_hKey, [path cStringWithEncoding: [OFLocale encoding]], options, - securityAndAccessRights, &subKey); + accessRights, &subKey); if (status != ERROR_SUCCESS) @throw [OFOpenWindowsRegistryKeyFailedException exceptionWithRegistryKey: self path: path + accessRights: accessRights options: options - securityAndAccessRights: securityAndAccessRights status: status]; objc_autoreleasePoolPop(pool); return [[[OFWindowsRegistryKey alloc] of_initWithHKey: subKey close: true] autorelease]; } -- (OFWindowsRegistryKey *)createSubkeyAtPath: (OFString *)path - securityAndAccessRights: (REGSAM)securityAndAccessRights -{ - return [self createSubkeyAtPath: path - options: 0 - securityAndAccessRights: securityAndAccessRights - securityAttributes: NULL - disposition: NULL]; -} - - (OFWindowsRegistryKey *) - createSubkeyAtPath: (OFString *)path - options: (DWORD)options - securityAndAccessRights: (REGSAM)securityAndAccessRights - securityAttributes: (LPSECURITY_ATTRIBUTES)securityAttributes - disposition: (DWORD *)disposition + createSubkeyAtPath: (OFString *)path + accessRights: (REGSAM)accessRights + securityAttributes: (LPSECURITY_ATTRIBUTES)securityAttributes + options: (DWORD)options + disposition: (DWORD *)disposition { void *pool = objc_autoreleasePoolPush(); LSTATUS status; HKEY subKey; if ([OFSystemInfo isWindowsNT]) status = RegCreateKeyExW(_hKey, path.UTF16String, 0, - NULL, options, securityAndAccessRights, securityAttributes, - &subKey, NULL); + NULL, options, accessRights, securityAttributes, &subKey, + NULL); else status = RegCreateKeyExA(_hKey, [path cStringWithEncoding: [OFLocale encoding]], 0, NULL, - options, securityAndAccessRights, securityAttributes, - &subKey, NULL); + options, accessRights, securityAttributes, &subKey, NULL); if (status != ERROR_SUCCESS) @throw [OFCreateWindowsRegistryKeyFailedException exceptionWithRegistryKey: self path: path - options: options - securityAndAccessRights: securityAndAccessRights + accessRights: accessRights securityAttributes: securityAttributes + options: options status: status]; objc_autoreleasePoolPop(pool); return [[[OFWindowsRegistryKey alloc] of_initWithHKey: subKey