Stub implementation of LHashValOfNameSysA.
Don't crash if we encounter a BSTR with length <= 0. Fix typos in ITypeLib::GetDocumentation.
This commit is contained in:
parent
4fb5ab4765
commit
2cbda2ef92
@ -139,7 +139,7 @@ import ole32.dll
|
|||||||
163 stdcall RegisterTypeLib(ptr str str) RegisterTypeLib
|
163 stdcall RegisterTypeLib(ptr str str) RegisterTypeLib
|
||||||
164 stdcall QueryPathOfRegTypeLib(ptr long long long ptr) QueryPathOfRegTypeLib
|
164 stdcall QueryPathOfRegTypeLib(ptr long long long ptr) QueryPathOfRegTypeLib
|
||||||
165 stub LHashValOfNameSys
|
165 stub LHashValOfNameSys
|
||||||
166 stub LHashValOfNameSysA
|
166 stdcall LHashValOfNameSysA(long long str) LHashValOfNameSysA
|
||||||
170 stdcall OaBuildVersion() OaBuildVersion
|
170 stdcall OaBuildVersion() OaBuildVersion
|
||||||
171 stub ClearCustData
|
171 stub ClearCustData
|
||||||
180 stub CreateTypeLib2
|
180 stub CreateTypeLib2
|
||||||
@ -293,3 +293,4 @@ import ole32.dll
|
|||||||
422 stub OleLoadPictureFile
|
422 stub OleLoadPictureFile
|
||||||
423 stub OleSavePictureFile
|
423 stub OleSavePictureFile
|
||||||
424 stub OleLoadPicturePath
|
424 stub OleLoadPicturePath
|
||||||
|
425 stub OleLoadPictureEx
|
||||||
|
@ -184,7 +184,7 @@ HRESULT WINAPI LoadTypeLibEx(
|
|||||||
{
|
{
|
||||||
LPSTR p;
|
LPSTR p;
|
||||||
HRESULT res;
|
HRESULT res;
|
||||||
TRACE("('%s',%d,%p)\n",debugstr_w(szFile), regkind, pptLib);
|
TRACE("(%s,%d,%p)\n",debugstr_w(szFile), regkind, pptLib);
|
||||||
|
|
||||||
p=HEAP_strdupWtoA(GetProcessHeap(),0,szFile);
|
p=HEAP_strdupWtoA(GetProcessHeap(),0,szFile);
|
||||||
|
|
||||||
@ -192,9 +192,8 @@ HRESULT WINAPI LoadTypeLibEx(
|
|||||||
FIXME ("registration of typelibs not supported yet!\n");
|
FIXME ("registration of typelibs not supported yet!\n");
|
||||||
|
|
||||||
res= TLB_ReadTypeLib(p, pptLib);
|
res= TLB_ReadTypeLib(p, pptLib);
|
||||||
/* XXX need to free p ?? */
|
HeapFree(GetProcessHeap(),0,p);
|
||||||
|
TRACE(" returns %08lx\n",res);
|
||||||
TRACE(" returns %ld\n",res);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -296,6 +295,15 @@ DWORD WINAPI OaBuildVersion16(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/********************************************************************
|
||||||
|
* LHashValOfNameSysA [OLEAUT32]
|
||||||
|
*/
|
||||||
|
HRESULT WINAPI LHashValOfNameSysA(SYSKIND sys, LCID lcid, LPSTR name)
|
||||||
|
{
|
||||||
|
FIXME("%s\n", name);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* for better debugging info leave the static out for the time being */
|
/* for better debugging info leave the static out for the time being */
|
||||||
#define static
|
#define static
|
||||||
|
|
||||||
@ -636,6 +644,7 @@ static void TLB_ReadValue( VARIANT * pVar, int offset, TLBContext *pcx )
|
|||||||
}
|
}
|
||||||
TLB_Read(&(pVar->vt), sizeof(VARTYPE), pcx,
|
TLB_Read(&(pVar->vt), sizeof(VARTYPE), pcx,
|
||||||
pcx->pTblDir->pCustData.offset + offset );
|
pcx->pTblDir->pCustData.offset + offset );
|
||||||
|
TRACE("Vartype = %x\n", pVar->vt);
|
||||||
switch(pVar->vt){
|
switch(pVar->vt){
|
||||||
case VT_EMPTY: /* FIXME: is this right? */
|
case VT_EMPTY: /* FIXME: is this right? */
|
||||||
case VT_NULL: /* FIXME: is this right? */
|
case VT_NULL: /* FIXME: is this right? */
|
||||||
@ -665,6 +674,9 @@ static void TLB_ReadValue( VARIANT * pVar, int offset, TLBContext *pcx )
|
|||||||
case VT_BSTR :{
|
case VT_BSTR :{
|
||||||
char * ptr;
|
char * ptr;
|
||||||
TLB_Read(&size, sizeof(INT), pcx, DO_NOT_SEEK );
|
TLB_Read(&size, sizeof(INT), pcx, DO_NOT_SEEK );
|
||||||
|
if(size <= 0) {
|
||||||
|
FIXME("BSTR length = %d?\n", size);
|
||||||
|
} else {
|
||||||
ptr=TLB_Alloc(size);/* allocate temp buffer */
|
ptr=TLB_Alloc(size);/* allocate temp buffer */
|
||||||
TLB_Read(ptr, size, pcx, DO_NOT_SEEK); /* read string (ANSI) */
|
TLB_Read(ptr, size, pcx, DO_NOT_SEEK); /* read string (ANSI) */
|
||||||
V_UNION(pVar, bstrVal)=SysAllocStringLen(NULL,size);
|
V_UNION(pVar, bstrVal)=SysAllocStringLen(NULL,size);
|
||||||
@ -673,6 +685,7 @@ static void TLB_ReadValue( VARIANT * pVar, int offset, TLBContext *pcx )
|
|||||||
while(size--) V_UNION(pVar, bstrVal[size])=ptr[size];
|
while(size--) V_UNION(pVar, bstrVal[size])=ptr[size];
|
||||||
TLB_Free(ptr);
|
TLB_Free(ptr);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
size=-4; break;
|
size=-4; break;
|
||||||
/* FIXME: this will not work AT ALL when the variant contains a pointer */
|
/* FIXME: this will not work AT ALL when the variant contains a pointer */
|
||||||
case VT_DISPATCH :
|
case VT_DISPATCH :
|
||||||
@ -1078,7 +1091,7 @@ int TLB_ReadTypeLib(LPSTR pszFileName, ITypeLib **ppTypeLib)
|
|||||||
hinstDLL = LoadLibraryExA(pszFileName, 0, DONT_RESOLVE_DLL_REFERENCES|LOAD_LIBRARY_AS_DATAFILE|LOAD_WITH_ALTERED_SEARCH_PATH);
|
hinstDLL = LoadLibraryExA(pszFileName, 0, DONT_RESOLVE_DLL_REFERENCES|LOAD_LIBRARY_AS_DATAFILE|LOAD_WITH_ALTERED_SEARCH_PATH);
|
||||||
if (!hinstDLL)
|
if (!hinstDLL)
|
||||||
{
|
{
|
||||||
ERR("error: couldn't load the DLL");
|
ERR("error: couldn't load the DLL %s\n", pszFileName);
|
||||||
goto err1;
|
goto err1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1516,11 +1529,11 @@ static HRESULT WINAPI ITypeLib2_fnGetDocumentation(
|
|||||||
if(pBstrName)
|
if(pBstrName)
|
||||||
*pBstrName=TLB_DupAtoBstr(This->Name);
|
*pBstrName=TLB_DupAtoBstr(This->Name);
|
||||||
if(pBstrDocString)
|
if(pBstrDocString)
|
||||||
*pBstrName=TLB_DupAtoBstr(This->DocString);
|
*pBstrDocString=TLB_DupAtoBstr(This->DocString);
|
||||||
if(pdwHelpContext)
|
if(pdwHelpContext)
|
||||||
*pdwHelpContext=This->dwHelpContext;
|
*pdwHelpContext=This->dwHelpContext;
|
||||||
if(pBstrHelpFile)
|
if(pBstrHelpFile)
|
||||||
*pBstrName=TLB_DupAtoBstr(This->HelpFile);
|
*pBstrHelpFile=TLB_DupAtoBstr(This->HelpFile);
|
||||||
}else {/* for a typeinfo */
|
}else {/* for a typeinfo */
|
||||||
result=ITypeLib2_fnGetTypeInfo(iface, index, &pTInfo);
|
result=ITypeLib2_fnGetTypeInfo(iface, index, &pTInfo);
|
||||||
if(SUCCEEDED(result)){
|
if(SUCCEEDED(result)){
|
||||||
@ -1553,7 +1566,8 @@ static HRESULT WINAPI ITypeLib2_fnIsName(
|
|||||||
int i;
|
int i;
|
||||||
PCHAR astr= HEAP_strdupWtoA( GetProcessHeap(), 0, szNameBuf );
|
PCHAR astr= HEAP_strdupWtoA( GetProcessHeap(), 0, szNameBuf );
|
||||||
|
|
||||||
TRACE("\n");
|
TRACE("(%p)->(%s,%08lx,%p)\n", This, debugstr_w(szNameBuf), lHashVal,
|
||||||
|
pfName);
|
||||||
|
|
||||||
*pfName=TRUE;
|
*pfName=TRUE;
|
||||||
if(!strcmp(astr,This->Name)) goto ITypeLib2_fnIsName_exit;
|
if(!strcmp(astr,This->Name)) goto ITypeLib2_fnIsName_exit;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user