oleaut32: Fix RegisterTypeLib prototype.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
stable
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 * Success: S_OK
* Failure: Status * Failure: Status
*/ */
HRESULT WINAPI RegisterTypeLib( HRESULT WINAPI RegisterTypeLib(ITypeLib *ptlib, const WCHAR *szFullPath, const WCHAR *szHelpDir)
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 res; HRESULT res;
TLIBATTR *attr; TLIBATTR *attr;
@ -725,19 +721,18 @@ HRESULT WINAPI RegisterTypeLib(
if (res == S_OK && RegCreateKeyExW(key, HELPDIRW, 0, NULL, 0, if (res == S_OK && RegCreateKeyExW(key, HELPDIRW, 0, NULL, 0,
KEY_WRITE, NULL, &subKey, &disposition) == ERROR_SUCCESS) KEY_WRITE, NULL, &subKey, &disposition) == ERROR_SUCCESS)
{ {
BOOL freeHelpDir = FALSE; BSTR freeHelpDir = NULL;
OLECHAR* pIndexStr; OLECHAR* pIndexStr;
/* if we created a new key, and helpDir was null, set the helpdir /* if we created a new key, and helpDir was null, set the helpdir
to the directory which contains the typelib. However, to the directory which contains the typelib. However,
if we just opened an existing key, we leave the helpdir alone */ if we just opened an existing key, we leave the helpdir alone */
if ((disposition == REG_CREATED_NEW_KEY) && (szHelpDir == NULL)) { if ((disposition == REG_CREATED_NEW_KEY) && (szHelpDir == NULL)) {
szHelpDir = SysAllocString(szFullPath); szHelpDir = freeHelpDir = SysAllocString(szFullPath);
pIndexStr = wcsrchr(szHelpDir, '\\'); pIndexStr = wcsrchr(szHelpDir, '\\');
if (pIndexStr) { if (pIndexStr) {
*pIndexStr = 0; *pIndexStr = 0;
} }
freeHelpDir = TRUE;
} }
/* if we have an szHelpDir, set it! */ /* if we have an szHelpDir, set it! */
@ -748,10 +743,8 @@ HRESULT WINAPI RegisterTypeLib(
} }
} }
/* tidy up */ SysFreeString(freeHelpDir);
if (freeHelpDir) SysFreeString(szHelpDir);
RegCloseKey(subKey); RegCloseKey(subKey);
} else { } else {
res = E_FAIL; 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 LoadTypeLib(const OLECHAR*,ITypeLib**);
HRESULT WINAPI LoadTypeLibEx(LPCOLESTR,REGKIND,ITypeLib**); HRESULT WINAPI LoadTypeLibEx(LPCOLESTR,REGKIND,ITypeLib**);
HRESULT WINAPI QueryPathOfRegTypeLib(REFGUID,WORD,WORD,LCID,LPBSTR); 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 UnRegisterTypeLib(REFGUID,WORD,WORD,LCID,SYSKIND);
HRESULT WINAPI RegisterTypeLibForUser(ITypeLib*,OLECHAR*,OLECHAR*); HRESULT WINAPI RegisterTypeLibForUser(ITypeLib*,OLECHAR*,OLECHAR*);
HRESULT WINAPI UnRegisterTypeLibForUser(REFGUID,WORD,WORD,LCID,SYSKIND); HRESULT WINAPI UnRegisterTypeLibForUser(REFGUID,WORD,WORD,LCID,SYSKIND);