Commit 7be2251c authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

oleaut32: Always set LIBFLAG_FHASDISKIMAGE when loading from file.

parent 8f200ea9
...@@ -2662,7 +2662,6 @@ static void test_CreateTypeLib(SYSKIND sys) { ...@@ -2662,7 +2662,6 @@ static void test_CreateTypeLib(SYSKIND sys) {
ok(libattr->syskind == sys, "syskind = %d\n", libattr->syskind); ok(libattr->syskind == sys, "syskind = %d\n", libattr->syskind);
ok(libattr->wMajorVerNum == 0, "wMajorVer = %d\n", libattr->wMajorVerNum); ok(libattr->wMajorVerNum == 0, "wMajorVer = %d\n", libattr->wMajorVerNum);
ok(libattr->wMinorVerNum == 0, "wMinorVerNum = %d\n", libattr->wMinorVerNum); ok(libattr->wMinorVerNum == 0, "wMinorVerNum = %d\n", libattr->wMinorVerNum);
todo_wine
ok(libattr->wLibFlags == LIBFLAG_FHASDISKIMAGE, "wLibFlags = %d\n", libattr->wLibFlags); ok(libattr->wLibFlags == LIBFLAG_FHASDISKIMAGE, "wLibFlags = %d\n", libattr->wLibFlags);
ITypeLib_ReleaseTLibAttr(tl, libattr); ITypeLib_ReleaseTLibAttr(tl, libattr);
...@@ -3965,7 +3964,9 @@ static void test_create_typelib_lcid(LCID lcid) ...@@ -3965,7 +3964,9 @@ static void test_create_typelib_lcid(LCID lcid)
HRESULT hr; HRESULT hr;
ICreateTypeLib2 *tl; ICreateTypeLib2 *tl;
HANDLE file; HANDLE file;
DWORD msft_header[7]; DWORD msft_header[8];
ITypeLib *typelib;
TLIBATTR *attr;
DWORD read; DWORD read;
GetTempFileNameA( ".", "tlb", 0, filename ); GetTempFileNameA( ".", "tlb", 0, filename );
...@@ -3974,6 +3975,14 @@ static void test_create_typelib_lcid(LCID lcid) ...@@ -3974,6 +3975,14 @@ static void test_create_typelib_lcid(LCID lcid)
hr = CreateTypeLib2(SYS_WIN32, name, &tl); hr = CreateTypeLib2(SYS_WIN32, name, &tl);
ok(hr == S_OK, "got %08x\n", hr); ok(hr == S_OK, "got %08x\n", hr);
hr = ICreateTypeLib2_QueryInterface(tl, &IID_ITypeLib, (void**)&typelib);
ok(hr == S_OK, "got %08x\n", hr);
hr = ITypeLib_GetLibAttr(typelib, &attr);
ok(hr == S_OK, "got %08x\n", hr);
ok(attr->wLibFlags == 0, "flags 0x%x\n", attr->wLibFlags);
ITypeLib_ReleaseTLibAttr(typelib, attr);
hr = ICreateTypeLib2_SetLcid(tl, lcid); hr = ICreateTypeLib2_SetLcid(tl, lcid);
ok(hr == S_OK, "got %08x\n", hr); ok(hr == S_OK, "got %08x\n", hr);
...@@ -3983,6 +3992,12 @@ static void test_create_typelib_lcid(LCID lcid) ...@@ -3983,6 +3992,12 @@ static void test_create_typelib_lcid(LCID lcid)
hr = ICreateTypeLib2_SaveAllChanges(tl); hr = ICreateTypeLib2_SaveAllChanges(tl);
ok(hr == S_OK, "got %08x\n", hr); ok(hr == S_OK, "got %08x\n", hr);
hr = ITypeLib_GetLibAttr(typelib, &attr);
ok(hr == S_OK, "got %08x\n", hr);
ok(attr->wLibFlags == 0, "flags 0x%x\n", attr->wLibFlags);
ITypeLib_ReleaseTLibAttr(typelib, attr);
ITypeLib_Release(typelib);
ICreateTypeLib2_Release(tl); ICreateTypeLib2_Release(tl);
file = CreateFileA( filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0 ); file = CreateFileA( filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0 );
...@@ -3998,6 +4013,17 @@ static void test_create_typelib_lcid(LCID lcid) ...@@ -3998,6 +4013,17 @@ static void test_create_typelib_lcid(LCID lcid)
ok(msft_header[3] == (lcid ? lcid : 0x409), "got %08x (lcid %08x)\n", msft_header[3], lcid); ok(msft_header[3] == (lcid ? lcid : 0x409), "got %08x (lcid %08x)\n", msft_header[3], lcid);
ok(msft_header[4] == lcid, "got %08x (lcid %08x)\n", msft_header[4], lcid); ok(msft_header[4] == lcid, "got %08x (lcid %08x)\n", msft_header[4], lcid);
ok(msft_header[6] == 0x00040003, "got %08x\n", msft_header[6]); ok(msft_header[6] == 0x00040003, "got %08x\n", msft_header[6]);
ok(msft_header[7] == 0, "got %08x\n", msft_header[7]);
/* check flags after loading */
hr = LoadTypeLib(name, &typelib);
ok(hr == S_OK, "got %08x\n", hr);
hr = ITypeLib_GetLibAttr(typelib, &attr);
ok(hr == S_OK, "got %08x\n", hr);
ok(attr->wLibFlags == LIBFLAG_FHASDISKIMAGE, "flags 0x%x\n", attr->wLibFlags);
ITypeLib_ReleaseTLibAttr(typelib, attr);
ITypeLib_Release(typelib);
DeleteFileA(filename); DeleteFileA(filename);
} }
...@@ -4770,7 +4796,6 @@ static void test_LoadRegTypeLib(void) ...@@ -4770,7 +4796,6 @@ static void test_LoadRegTypeLib(void)
ok(attr->lcid == 0, "got %x\n", attr->lcid); ok(attr->lcid == 0, "got %x\n", attr->lcid);
ok(attr->wMajorVerNum == 2, "got %d\n", attr->wMajorVerNum); ok(attr->wMajorVerNum == 2, "got %d\n", attr->wMajorVerNum);
ok(attr->wMinorVerNum == 5, "got %d\n", attr->wMinorVerNum); ok(attr->wMinorVerNum == 5, "got %d\n", attr->wMinorVerNum);
todo_wine
ok(attr->wLibFlags == LIBFLAG_FHASDISKIMAGE, "got %x\n", attr->wLibFlags); ok(attr->wLibFlags == LIBFLAG_FHASDISKIMAGE, "got %x\n", attr->wLibFlags);
ITypeLib_ReleaseTLibAttr(tl, attr); ITypeLib_ReleaseTLibAttr(tl, attr);
......
...@@ -3585,7 +3585,7 @@ static ITypeLib2* ITypeLib2_Constructor_MSFT(LPVOID pLib, DWORD dwTLBLength) ...@@ -3585,7 +3585,7 @@ static ITypeLib2* ITypeLib2_Constructor_MSFT(LPVOID pLib, DWORD dwTLBLength)
pTypeLibImpl->ptr_size = get_ptr_size(pTypeLibImpl->syskind); pTypeLibImpl->ptr_size = get_ptr_size(pTypeLibImpl->syskind);
pTypeLibImpl->ver_major = LOWORD(tlbHeader.version); pTypeLibImpl->ver_major = LOWORD(tlbHeader.version);
pTypeLibImpl->ver_minor = HIWORD(tlbHeader.version); pTypeLibImpl->ver_minor = HIWORD(tlbHeader.version);
pTypeLibImpl->libflags = (WORD) tlbHeader.flags & 0xffff;/* check mask */ pTypeLibImpl->libflags = ((WORD) tlbHeader.flags & 0xffff) /* check mask */ | LIBFLAG_FHASDISKIMAGE;
pTypeLibImpl->set_lcid = tlbHeader.lcid2; pTypeLibImpl->set_lcid = tlbHeader.lcid2;
pTypeLibImpl->lcid = tlbHeader.lcid; pTypeLibImpl->lcid = tlbHeader.lcid;
......
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