oleaut32: Fix RegisterTypeLib prototype.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Kevin Puetz 2019-09-25 16:09:41 +02:00 committed by Alexandre Julliard
parent 8bbdfbceed
commit e10e59fa0e
2 changed files with 5 additions and 12 deletions

View File

@ -643,11 +643,7 @@ static void TLB_register_interface(TLIBATTR *libattr, LPOLESTR name, TYPEATTR *t
* Success: S_OK
* Failure: Status
*/
HRESULT WINAPI RegisterTypeLib(
ITypeLib * ptlib, /* [in] Pointer to the library*/
OLECHAR * szFullPath, /* [in] full Path of the library*/
OLECHAR * szHelpDir) /* [in] dir to the helpfile for the library,
may be NULL*/
HRESULT WINAPI RegisterTypeLib(ITypeLib *ptlib, const WCHAR *szFullPath, const WCHAR *szHelpDir)
{
HRESULT res;
TLIBATTR *attr;
@ -725,19 +721,18 @@ HRESULT WINAPI RegisterTypeLib(
if (res == S_OK && RegCreateKeyExW(key, HELPDIRW, 0, NULL, 0,
KEY_WRITE, NULL, &subKey, &disposition) == ERROR_SUCCESS)
{
BOOL freeHelpDir = FALSE;
BSTR freeHelpDir = NULL;
OLECHAR* pIndexStr;
/* if we created a new key, and helpDir was null, set the helpdir
to the directory which contains the typelib. However,
if we just opened an existing key, we leave the helpdir alone */
if ((disposition == REG_CREATED_NEW_KEY) && (szHelpDir == NULL)) {
szHelpDir = SysAllocString(szFullPath);
szHelpDir = freeHelpDir = SysAllocString(szFullPath);
pIndexStr = wcsrchr(szHelpDir, '\\');
if (pIndexStr) {
*pIndexStr = 0;
}
freeHelpDir = TRUE;
}
/* if we have an szHelpDir, set it! */
@ -748,10 +743,8 @@ HRESULT WINAPI RegisterTypeLib(
}
}
/* tidy up */
if (freeHelpDir) SysFreeString(szHelpDir);
SysFreeString(freeHelpDir);
RegCloseKey(subKey);
} else {
res = E_FAIL;
}

View File

@ -752,7 +752,7 @@ HRESULT WINAPI LoadRegTypeLib(REFGUID,WORD,WORD,LCID,ITypeLib**);
HRESULT WINAPI LoadTypeLib(const OLECHAR*,ITypeLib**);
HRESULT WINAPI LoadTypeLibEx(LPCOLESTR,REGKIND,ITypeLib**);
HRESULT WINAPI QueryPathOfRegTypeLib(REFGUID,WORD,WORD,LCID,LPBSTR);
HRESULT WINAPI RegisterTypeLib(ITypeLib*,OLECHAR*,OLECHAR*);
HRESULT WINAPI RegisterTypeLib(ITypeLib*,LPCOLESTR,LPCOLESTR);
HRESULT WINAPI UnRegisterTypeLib(REFGUID,WORD,WORD,LCID,SYSKIND);
HRESULT WINAPI RegisterTypeLibForUser(ITypeLib*,OLECHAR*,OLECHAR*);
HRESULT WINAPI UnRegisterTypeLibForUser(REFGUID,WORD,WORD,LCID,SYSKIND);