Commit 177d7aac authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

oleaut32: Added ITypeLib2_GetLibAttr implementation.

parent 522a00e6
...@@ -992,6 +992,7 @@ static void test_CreateTypeLib(void) { ...@@ -992,6 +992,7 @@ static void test_CreateTypeLib(void) {
PARAMDESCEX paramdescex; PARAMDESCEX paramdescex;
TYPEDESC typedesc1, typedesc2; TYPEDESC typedesc1, typedesc2;
TYPEATTR *typeattr; TYPEATTR *typeattr;
TLIBATTR *libattr;
HREFTYPE hreftype; HREFTYPE hreftype;
int impltypeflags; int impltypeflags;
HRESULT hres; HRESULT hres;
...@@ -1010,6 +1011,21 @@ static void test_CreateTypeLib(void) { ...@@ -1010,6 +1011,21 @@ static void test_CreateTypeLib(void) {
hres = CreateTypeLib2(SYS_WIN32, filenameW, &createtl); hres = CreateTypeLib2(SYS_WIN32, filenameW, &createtl);
ok(hres == S_OK, "got %08x\n", hres); ok(hres == S_OK, "got %08x\n", hres);
hres = ICreateTypeLib_QueryInterface(createtl, &IID_ITypeLib, (void**)&tl);
ok(hres == S_OK, "got %08x\n", hres);
hres = ITypeLib_GetLibAttr(tl, &libattr);
ok(hres == S_OK, "got %08x\n", hres);
ok(libattr->syskind == SYS_WIN32, "syskind = %d\n", libattr->syskind);
ok(libattr->wMajorVerNum == 0, "wMajorVer = %d\n", libattr->wMajorVerNum);
ok(libattr->wMinorVerNum == 0, "wMinorVerNum = %d\n", libattr->wMinorVerNum);
ok(libattr->wLibFlags == 0, "wLibFlags = %d\n", libattr->wLibFlags);
ITypeLib_ReleaseTLibAttr(tl, libattr);
ITypeLib_Release(tl);
hres = ICreateTypeLib_CreateTypeInfo(createtl, interface1W, TKIND_INTERFACE, &createti); hres = ICreateTypeLib_CreateTypeInfo(createtl, interface1W, TKIND_INTERFACE, &createti);
ok(hres == S_OK, "got %08x\n", hres); ok(hres == S_OK, "got %08x\n", hres);
......
...@@ -4260,9 +4260,28 @@ static HRESULT WINAPI ITypeLib2_fnGetLibAttr( ...@@ -4260,9 +4260,28 @@ static HRESULT WINAPI ITypeLib2_fnGetLibAttr(
{ {
ICreateTypeLib2Impl *This = impl_from_ITypeLib2(iface); ICreateTypeLib2Impl *This = impl_from_ITypeLib2(iface);
FIXME("(%p,%p), stub!\n", This, ppTLibAttr); TRACE("(%p,%p)\n", This, ppTLibAttr);
if(!ppTLibAttr)
return E_INVALIDARG;
*ppTLibAttr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(TLIBATTR));
if(!*ppTLibAttr)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
if(This->typelib_header.posguid != -1) {
MSFT_GuidEntry *guid;
guid = (MSFT_GuidEntry*)&This->typelib_segment_data[MSFT_SEG_GUID][This->typelib_header.posguid];
(*ppTLibAttr)->guid = guid->guid;
}
(*ppTLibAttr)->lcid = This->typelib_header.lcid;
(*ppTLibAttr)->syskind = This->typelib_header.varflags&0x3;
(*ppTLibAttr)->wMajorVerNum = This->typelib_header.version&0xffff;
(*ppTLibAttr)->wMinorVerNum = This->typelib_header.version>>16;
(*ppTLibAttr)->wLibFlags = This->typelib_header.flags;
return S_OK;
} }
/****************************************************************************** /******************************************************************************
...@@ -4366,9 +4385,9 @@ static void WINAPI ITypeLib2_fnReleaseTLibAttr( ...@@ -4366,9 +4385,9 @@ static void WINAPI ITypeLib2_fnReleaseTLibAttr(
ITypeLib2 * iface, ITypeLib2 * iface,
TLIBATTR* pTLibAttr) TLIBATTR* pTLibAttr)
{ {
ICreateTypeLib2Impl *This = impl_from_ITypeLib2(iface); TRACE("(%p,%p)\n", iface, pTLibAttr);
FIXME("(%p,%p), stub!\n", This, pTLibAttr); HeapFree(GetProcessHeap(), 0, pTLibAttr);
} }
/****************************************************************************** /******************************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment