From e8d117f5a1a03788367f674d4c1367084b76e387 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Wed, 24 Feb 2010 14:25:55 +0100 Subject: [PATCH] oleaut32: Fix importfile searching in ctl2_alloc_importinfo. --- dlls/oleaut32/typelib2.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/dlls/oleaut32/typelib2.c b/dlls/oleaut32/typelib2.c index 5c1c7029f9..7ccb400303 100644 --- a/dlls/oleaut32/typelib2.c +++ b/dlls/oleaut32/typelib2.c @@ -692,19 +692,20 @@ static int ctl2_alloc_string( * Failure: -1 (this is invariably an out of memory condition). */ static int ctl2_alloc_importinfo( - ICreateTypeLib2Impl *This, /* [I] The type library to allocate in. */ - MSFT_ImpInfo *impinfo) /* [I] The import information to store. */ + ICreateTypeLib2Impl *This, /* [I] The type library to allocate in. */ + MSFT_ImpInfo *impinfo) /* [I] The import information to store. */ { int offset; MSFT_ImpInfo *impinfo_space; - for (offset = 0; - offset < This->typelib_segdir[MSFT_SEG_IMPORTINFO].length; - offset += sizeof(MSFT_ImpInfo)) { - if (!memcmp(&(This->typelib_segment_data[MSFT_SEG_IMPORTINFO][offset]), - impinfo, sizeof(MSFT_ImpInfo))) { - return offset; - } + impinfo_space = (MSFT_ImpInfo*)&This->typelib_segment_data[MSFT_SEG_IMPORTINFO][0]; + for (offset=0; offsettypelib_segdir[MSFT_SEG_IMPORTINFO].length; + offset+=sizeof(MSFT_ImpInfo)) { + if(impinfo_space->oImpFile == impinfo->oImpFile + && impinfo_space->oGuid == impinfo->oGuid) + return offset; + + impinfo_space += 1; } impinfo->flags |= This->typelib_header.nimpinfos++; -- 2.32.0.93.g670b81a890