oleaut32: Fix GetLibAttr for null argument, plus error handling.
This commit is contained in:
parent
c395ae563e
commit
6408679e44
|
@ -518,6 +518,9 @@ static void test_TypeInfo(void)
|
|||
hr = ITypeLib_GetTypeInfo(pTypeLib, 0, NULL);
|
||||
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
|
||||
|
||||
hr = ITypeLib_GetLibAttr(pTypeLib, NULL);
|
||||
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
|
||||
|
||||
hr = ITypeLib_GetTypeInfoType(pTypeLib, count, &kind);
|
||||
ok(hr == TYPE_E_ELEMENTNOTFOUND, "got 0x%08x\n", hr);
|
||||
|
||||
|
@ -1362,6 +1365,9 @@ static void test_CreateTypeLib(void) {
|
|||
hres = ITypeLib_GetTypeInfoType(tl, 0, NULL);
|
||||
ok(hres == E_INVALIDARG, "got 0x%08x\n", hres);
|
||||
|
||||
hres = ITypeLib_GetLibAttr(tl, NULL);
|
||||
ok(hres == E_INVALIDARG, "got %08x\n", hres);
|
||||
|
||||
hres = ITypeLib_GetLibAttr(tl, &libattr);
|
||||
ok(hres == S_OK, "got %08x\n", hres);
|
||||
|
||||
|
|
|
@ -4351,12 +4351,18 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfoOfGuid(
|
|||
*/
|
||||
static HRESULT WINAPI ITypeLib2_fnGetLibAttr(
|
||||
ITypeLib2 *iface,
|
||||
LPTLIBATTR *ppTLibAttr)
|
||||
LPTLIBATTR *attr)
|
||||
{
|
||||
ITypeLibImpl *This = (ITypeLibImpl *)iface;
|
||||
TRACE("(%p)\n",This);
|
||||
*ppTLibAttr = HeapAlloc(GetProcessHeap(), 0, sizeof(**ppTLibAttr));
|
||||
**ppTLibAttr = This->LibAttr;
|
||||
|
||||
TRACE("(%p, %p)\n", This, attr);
|
||||
|
||||
if (!attr) return E_INVALIDARG;
|
||||
|
||||
*attr = HeapAlloc(GetProcessHeap(), 0, sizeof(**attr));
|
||||
if (!*attr) return E_OUTOFMEMORY;
|
||||
|
||||
**attr = This->LibAttr;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue