Files
libreoffice/registry/source/regkey.cxx

701 lines
18 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2012-07-02 17:12:00 +01:00
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
2000-09-18 14:18:43 +00:00
#include "regkey.hxx"
#include <registry/registry.hxx>
#include <rtl/alloc.h>
#include <osl/diagnose.h>
#include "regimpl.hxx"
#include "keyimpl.hxx"
2000-09-18 14:18:43 +00:00
2000-09-18 14:18:43 +00:00
// acquireKey
2000-09-18 14:18:43 +00:00
void REGISTRY_CALLTYPE acquireKey(RegKeyHandle hKey)
{
ORegKey* pKey = static_cast< ORegKey* >(hKey);
if (pKey != nullptr)
{
ORegistry* pReg = pKey->getRegistry();
(void) pReg->acquireKey(pKey);
}
2000-09-18 14:18:43 +00:00
}
2000-09-18 14:18:43 +00:00
// releaseKey
2000-09-18 14:18:43 +00:00
void REGISTRY_CALLTYPE releaseKey(RegKeyHandle hKey)
{
ORegKey* pKey = static_cast< ORegKey* >(hKey);
if (pKey != nullptr)
2000-09-18 14:18:43 +00:00
{
ORegistry* pReg = pKey->getRegistry();
(void) pReg->releaseKey(pKey);
2000-09-18 14:18:43 +00:00
}
}
2000-09-18 14:18:43 +00:00
// isKeyReadOnly
2000-09-18 14:18:43 +00:00
sal_Bool REGISTRY_CALLTYPE isKeyReadOnly(RegKeyHandle hKey)
{
ORegKey* pKey = static_cast< ORegKey* >(hKey);
return pKey != nullptr && pKey->isReadOnly();
2000-09-18 14:18:43 +00:00
}
2000-09-18 14:18:43 +00:00
// getKeyName
2000-09-18 14:18:43 +00:00
RegError REGISTRY_CALLTYPE getKeyName(RegKeyHandle hKey, rtl_uString** pKeyName)
{
ORegKey* pKey = static_cast< ORegKey* >(hKey);
if (pKey)
2000-09-18 14:18:43 +00:00
{
rtl_uString_assign( pKeyName, pKey->getName().pData );
return RegError::NO_ERROR;
2000-09-18 14:18:43 +00:00
} else
{
rtl_uString_new(pKeyName);
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
}
}
2000-09-18 14:18:43 +00:00
// createKey
2000-09-18 14:18:43 +00:00
RegError REGISTRY_CALLTYPE createKey(RegKeyHandle hKey,
rtl_uString* keyName,
RegKeyHandle* phNewKey)
{
*phNewKey = nullptr;
2000-09-18 14:18:43 +00:00
ORegKey* pKey = static_cast< ORegKey* >(hKey);
if (!pKey)
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
if (pKey->isDeleted())
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
if (pKey->isReadOnly())
return RegError::REGISTRY_READONLY;
2000-09-18 14:18:43 +00:00
return pKey->createKey(keyName, phNewKey);
}
2000-09-18 14:18:43 +00:00
// openKey
2000-09-18 14:18:43 +00:00
RegError REGISTRY_CALLTYPE openKey(RegKeyHandle hKey,
rtl_uString* keyName,
RegKeyHandle* phOpenKey)
{
*phOpenKey = nullptr;
2000-09-18 14:18:43 +00:00
ORegKey* pKey = static_cast< ORegKey* >(hKey);
if (!pKey)
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
if (pKey->isDeleted())
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
return pKey->openKey(keyName, phOpenKey);
}
2000-09-18 14:18:43 +00:00
// openSubKeys
2000-09-18 14:18:43 +00:00
RegError REGISTRY_CALLTYPE openSubKeys(RegKeyHandle hKey,
rtl_uString* keyName,
RegKeyHandle** pphSubKeys,
sal_uInt32* pnSubKeys)
{
*pphSubKeys = nullptr;
*pnSubKeys = 0;
2000-09-18 14:18:43 +00:00
ORegKey* pKey = static_cast< ORegKey* >(hKey);
if (!pKey)
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
if (pKey->isDeleted())
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
return pKey->openSubKeys(keyName, pphSubKeys, pnSubKeys);
}
2000-09-18 14:18:43 +00:00
// closeSubKeys
2000-09-18 14:18:43 +00:00
RegError REGISTRY_CALLTYPE closeSubKeys(RegKeyHandle* phSubKeys,
sal_uInt32 nSubKeys)
{
if (phSubKeys == nullptr || nSubKeys == 0)
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
ORegistry* pReg = static_cast<ORegKey*>(phSubKeys[0])->getRegistry();
for (sal_uInt32 i = 0; i < nSubKeys; i++)
2000-09-18 14:18:43 +00:00
{
(void) pReg->closeKey(phSubKeys[i]);
2000-09-18 14:18:43 +00:00
}
rtl_freeMemory(phSubKeys);
2000-09-18 14:18:43 +00:00
return RegError::NO_ERROR;
2000-09-18 14:18:43 +00:00
}
2000-09-18 14:18:43 +00:00
// deleteKey
2000-09-18 14:18:43 +00:00
RegError REGISTRY_CALLTYPE deleteKey(RegKeyHandle hKey,
rtl_uString* keyName)
{
ORegKey* pKey = static_cast< ORegKey* >(hKey);
if (!pKey)
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
if (pKey->isDeleted())
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
if (pKey->isReadOnly())
return RegError::REGISTRY_READONLY;
2000-09-18 14:18:43 +00:00
return pKey->deleteKey(keyName);
}
2000-09-18 14:18:43 +00:00
// closeKey
2000-09-18 14:18:43 +00:00
RegError REGISTRY_CALLTYPE closeKey(RegKeyHandle hKey)
{
ORegKey* pKey = static_cast< ORegKey* >(hKey);
if (!pKey)
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
return pKey->closeKey(hKey);
2000-09-18 14:18:43 +00:00
}
2000-09-18 14:18:43 +00:00
// setValue
2000-09-18 14:18:43 +00:00
RegError REGISTRY_CALLTYPE setValue(RegKeyHandle hKey,
rtl_uString* keyName,
RegValueType valueType,
RegValue pData,
sal_uInt32 valueSize)
{
ORegKey* pKey = static_cast< ORegKey* >(hKey);
if (!pKey)
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
if (pKey->isDeleted())
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
if (pKey->isReadOnly())
return RegError::REGISTRY_READONLY;
2000-09-18 14:18:43 +00:00
OUString valueName("value");
2000-09-18 14:18:43 +00:00
if (keyName->length)
{
ORegKey* pSubKey = nullptr;
RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey));
if (_ret1 != RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
return _ret1;
_ret1 = pSubKey->setValue(valueName, valueType, pData, valueSize);
if (_ret1 != RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
{
RegError _ret2 = pKey->closeKey(pSubKey);
if (_ret2 != RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
return _ret2;
else
return _ret1;
}
return pKey->closeKey(pSubKey);
2000-09-18 14:18:43 +00:00
}
return pKey->setValue(valueName, valueType, pData, valueSize);
}
2000-09-18 14:18:43 +00:00
// setLongValueList
2000-09-18 14:18:43 +00:00
RegError REGISTRY_CALLTYPE setLongListValue(RegKeyHandle hKey,
rtl_uString* keyName,
sal_Int32* pValueList,
sal_uInt32 len)
{
ORegKey* pKey = static_cast< ORegKey* >(hKey);
if (!pKey)
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
if (pKey->isDeleted())
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
if (pKey->isReadOnly())
return RegError::REGISTRY_READONLY;
2000-09-18 14:18:43 +00:00
OUString valueName("value");
2000-09-18 14:18:43 +00:00
if (keyName->length)
{
ORegKey* pSubKey = nullptr;
RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey));
if (_ret1 != RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
return _ret1;
_ret1 = pSubKey->setLongListValue(valueName, pValueList, len);
if (_ret1 != RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
{
RegError _ret2 = pKey->closeKey(pSubKey);
if (_ret2 != RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
return _ret2;
else
return _ret1;
}
return pKey->closeKey(pSubKey);
2000-09-18 14:18:43 +00:00
}
return pKey->setLongListValue(valueName, pValueList, len);
}
2000-09-18 14:18:43 +00:00
// setStringValueList
2000-09-18 14:18:43 +00:00
RegError REGISTRY_CALLTYPE setStringListValue(RegKeyHandle hKey,
rtl_uString* keyName,
sal_Char** pValueList,
sal_uInt32 len)
{
ORegKey* pKey = static_cast< ORegKey* >(hKey);
if (!pKey)
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
if (pKey->isDeleted())
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
if (pKey->isReadOnly())
return RegError::REGISTRY_READONLY;
2000-09-18 14:18:43 +00:00
OUString valueName("value");
2000-09-18 14:18:43 +00:00
if (keyName->length)
{
ORegKey* pSubKey = nullptr;
RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey));
if (_ret1 != RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
return _ret1;
_ret1 = pSubKey->setStringListValue(valueName, pValueList, len);
if (_ret1 != RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
{
RegError _ret2 = pKey->closeKey(pSubKey);
if (_ret2 != RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
return _ret2;
else
return _ret1;
}
return pKey->closeKey(pSubKey);
2000-09-18 14:18:43 +00:00
}
return pKey->setStringListValue(valueName, pValueList, len);
}
2000-09-18 14:18:43 +00:00
// setUnicodeValueList
2000-09-18 14:18:43 +00:00
RegError REGISTRY_CALLTYPE setUnicodeListValue(RegKeyHandle hKey,
rtl_uString* keyName,
sal_Unicode** pValueList,
sal_uInt32 len)
{
ORegKey* pKey = static_cast< ORegKey* >(hKey);
if (!pKey)
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
if (pKey->isDeleted())
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
if (pKey->isReadOnly())
return RegError::REGISTRY_READONLY;
2000-09-18 14:18:43 +00:00
OUString valueName("value");
2000-09-18 14:18:43 +00:00
if (keyName->length)
{
ORegKey* pSubKey = nullptr;
RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey));
if (_ret1 != RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
return _ret1;
_ret1 = pSubKey->setUnicodeListValue(valueName, pValueList, len);
if (_ret1 != RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
{
RegError _ret2 = pKey->closeKey(pSubKey);
if (_ret2 != RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
return _ret2;
else
return _ret1;
}
return pKey->closeKey(pSubKey);
2000-09-18 14:18:43 +00:00
}
return pKey->setUnicodeListValue(valueName, pValueList, len);
}
2000-09-18 14:18:43 +00:00
// getValueInfo
2000-09-18 14:18:43 +00:00
RegError REGISTRY_CALLTYPE getValueInfo(RegKeyHandle hKey,
rtl_uString* keyName,
RegValueType* pValueType,
sal_uInt32* pValueSize)
{
*pValueType = RegValueType::NOT_DEFINED;
2000-09-18 14:18:43 +00:00
*pValueSize = 0;
ORegKey* pKey = static_cast< ORegKey* >(hKey);
if (!pKey)
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
if (pKey->isDeleted())
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
RegValueType valueType;
sal_uInt32 valueSize;
OUString valueName("value");
2000-09-18 14:18:43 +00:00
if (keyName->length)
{
ORegKey* pSubKey = nullptr;
RegError _ret = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey));
if (_ret != RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
return _ret;
if (pSubKey->getValueInfo(valueName, &valueType, &valueSize) != RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
{
(void) pKey->releaseKey(pSubKey);
return RegError::INVALID_VALUE;
2000-09-18 14:18:43 +00:00
}
*pValueType = valueType;
*pValueSize = valueSize;
return pKey->releaseKey(pSubKey);
2000-09-18 14:18:43 +00:00
}
if (pKey->getValueInfo(valueName, &valueType, &valueSize) != RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
{
return RegError::INVALID_VALUE;
2000-09-18 14:18:43 +00:00
}
*pValueType = valueType;
*pValueSize = valueSize;
return RegError::NO_ERROR;
2000-09-18 14:18:43 +00:00
}
2000-09-18 14:18:43 +00:00
// getValueInfo
2000-09-18 14:18:43 +00:00
RegError REGISTRY_CALLTYPE getValue(RegKeyHandle hKey,
rtl_uString* keyName,
RegValue pValue)
{
ORegKey* pKey = static_cast< ORegKey* >(hKey);
if (!pKey)
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
if (pKey->isDeleted())
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
OUString valueName("value");
2000-09-18 14:18:43 +00:00
if (keyName->length)
{
ORegKey* pSubKey = nullptr;
RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey));
if (_ret1 != RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
return _ret1;
_ret1 = pSubKey->getValue(valueName, pValue);
if (_ret1 != RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
{
(void) pKey->releaseKey(pSubKey);
return _ret1;
2000-09-18 14:18:43 +00:00
}
return pKey->releaseKey(pSubKey);
2000-09-18 14:18:43 +00:00
}
return pKey->getValue(valueName, pValue);
}
2000-09-18 14:18:43 +00:00
// getLongValueList
2000-09-18 14:18:43 +00:00
RegError REGISTRY_CALLTYPE getLongListValue(RegKeyHandle hKey,
rtl_uString* keyName,
sal_Int32** pValueList,
sal_uInt32* pLen)
{
assert((pValueList != nullptr) && (pLen != nullptr) && "registry::getLongListValue(): invalid parameter");
*pValueList = nullptr, *pLen = 0;
2000-09-18 14:18:43 +00:00
ORegKey* pKey = static_cast< ORegKey* >(hKey);
if (!pKey)
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
if (pKey->isDeleted())
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
OUString valueName("value");
2000-09-18 14:18:43 +00:00
if (keyName->length)
{
ORegKey* pSubKey = nullptr;
RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey));
if (_ret1 != RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
return _ret1;
_ret1 = pSubKey->getLongListValue(valueName, pValueList, pLen);
if (_ret1 != RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
{
(void) pKey->releaseKey(pSubKey);
return _ret1;
2000-09-18 14:18:43 +00:00
}
return pKey->releaseKey(pSubKey);
2000-09-18 14:18:43 +00:00
}
return pKey->getLongListValue(valueName, pValueList, pLen);
}
2000-09-18 14:18:43 +00:00
// getStringValueList
2000-09-18 14:18:43 +00:00
RegError REGISTRY_CALLTYPE getStringListValue(RegKeyHandle hKey,
rtl_uString* keyName,
sal_Char*** pValueList,
sal_uInt32* pLen)
{
OSL_PRECOND((pValueList != nullptr) && (pLen != nullptr), "registry::getStringListValue(): invalid parameter");
*pValueList = nullptr, *pLen = 0;
2000-09-18 14:18:43 +00:00
ORegKey* pKey = static_cast< ORegKey* >(hKey);
if (!pKey)
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
if (pKey->isDeleted())
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
OUString valueName("value");
2000-09-18 14:18:43 +00:00
if (keyName->length)
{
ORegKey* pSubKey = nullptr;
RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey));
if (_ret1 != RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
return _ret1;
_ret1 = pSubKey->getStringListValue(valueName, pValueList, pLen);
if (_ret1 != RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
{
(void) pKey->releaseKey(pSubKey);
return _ret1;
2000-09-18 14:18:43 +00:00
}
return pKey->releaseKey(pSubKey);
2000-09-18 14:18:43 +00:00
}
return pKey->getStringListValue(valueName, pValueList, pLen);
}
// getUnicodeListValue
RegError REGISTRY_CALLTYPE getUnicodeListValue(RegKeyHandle hKey,
rtl_uString* keyName,
sal_Unicode*** pValueList,
sal_uInt32* pLen)
{
assert((pValueList != nullptr) && (pLen != nullptr) && "registry::getUnicodeListValue(): invalid parameter");
*pValueList = nullptr, *pLen = 0;
2000-09-18 14:18:43 +00:00
ORegKey* pKey = static_cast< ORegKey* >(hKey);
if (!pKey)
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
if (pKey->isDeleted())
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
OUString valueName("value");
2000-09-18 14:18:43 +00:00
if (keyName->length)
{
ORegKey* pSubKey = nullptr;
RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey));
if (_ret1 != RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
return _ret1;
_ret1 = pSubKey->getUnicodeListValue(valueName, pValueList, pLen);
if (_ret1 != RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
{
(void) pKey->releaseKey(pSubKey);
return _ret1;
2000-09-18 14:18:43 +00:00
}
return pKey->releaseKey(pSubKey);
2000-09-18 14:18:43 +00:00
}
return pKey->getUnicodeListValue(valueName, pValueList, pLen);
}
2000-09-18 14:18:43 +00:00
// freeValueList
2000-09-18 14:18:43 +00:00
RegError REGISTRY_CALLTYPE freeValueList(RegValueType valueType,
RegValue pValueList,
sal_uInt32 len)
{
switch (valueType)
{
case RegValueType::LONGLIST:
2000-09-18 14:18:43 +00:00
{
rtl_freeMemory(pValueList);
}
break;
case RegValueType::STRINGLIST:
2000-09-18 14:18:43 +00:00
{
sal_Char** pVList = static_cast<sal_Char**>(pValueList);
2001-01-10 09:15:54 +00:00
for (sal_uInt32 i=0; i < len; i++)
2000-09-18 14:18:43 +00:00
{
rtl_freeMemory(pVList[i]);
}
rtl_freeMemory(pVList);
}
break;
case RegValueType::UNICODELIST:
2000-09-18 14:18:43 +00:00
{
sal_Unicode** pVList = static_cast<sal_Unicode**>(pValueList);
2001-01-10 09:15:54 +00:00
for (sal_uInt32 i=0; i < len; i++)
2000-09-18 14:18:43 +00:00
{
rtl_freeMemory(pVList[i]);
}
rtl_freeMemory(pVList);
}
break;
default:
return RegError::INVALID_VALUE;
2000-09-18 14:18:43 +00:00
}
pValueList = nullptr;
return RegError::NO_ERROR;
2000-09-18 14:18:43 +00:00
}
2000-09-18 14:18:43 +00:00
// getName
2000-09-18 14:18:43 +00:00
RegError REGISTRY_CALLTYPE getResolvedKeyName(RegKeyHandle hKey,
rtl_uString* keyName,
SAL_UNUSED_PARAMETER sal_Bool,
2000-09-18 14:18:43 +00:00
rtl_uString** pResolvedName)
{
ORegKey* pKey = static_cast< ORegKey* >(hKey);
if (!pKey)
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
if (pKey->isDeleted())
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
OUString resolvedName;
RegError _ret = pKey->getResolvedKeyName(keyName, resolvedName);
if (_ret == RegError::NO_ERROR)
2000-09-18 14:18:43 +00:00
rtl_uString_assign(pResolvedName, resolvedName.pData);
return _ret;
}
2000-09-18 14:18:43 +00:00
// getKeyNames
2000-09-18 14:18:43 +00:00
RegError REGISTRY_CALLTYPE getKeyNames(RegKeyHandle hKey,
rtl_uString* keyName,
rtl_uString*** pSubKeyNames,
sal_uInt32* pnSubKeys)
{
ORegKey* pKey = static_cast< ORegKey* >(hKey);
if (!pKey)
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
if (pKey->isDeleted())
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
return pKey->getKeyNames(keyName, pSubKeyNames, pnSubKeys);
}
2000-09-18 14:18:43 +00:00
// freeKeyNames
2000-09-18 14:18:43 +00:00
RegError REGISTRY_CALLTYPE freeKeyNames(rtl_uString** pKeyNames,
sal_uInt32 nKeys)
{
2001-01-10 09:15:54 +00:00
for (sal_uInt32 i=0; i < nKeys; i++)
2000-09-18 14:18:43 +00:00
{
rtl_uString_release(pKeyNames[i]);
}
rtl_freeMemory(pKeyNames);
return RegError::NO_ERROR;
2000-09-18 14:18:43 +00:00
}
2000-09-18 14:18:43 +00:00
// C API
2000-09-18 14:18:43 +00:00
// reg_openKey
2000-09-18 14:18:43 +00:00
RegError REGISTRY_CALLTYPE reg_openKey(RegKeyHandle hKey,
rtl_uString* keyName,
RegKeyHandle* phOpenKey)
{
if (!hKey)
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
return openKey(hKey, keyName, phOpenKey);
}
2000-09-18 14:18:43 +00:00
// reg_closeKey
2000-09-18 14:18:43 +00:00
RegError REGISTRY_CALLTYPE reg_closeKey(RegKeyHandle hKey)
{
if (!hKey)
return RegError::INVALID_KEY;
2000-09-18 14:18:43 +00:00
return closeKey(hKey);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */