From a31895869c617646bf1f09effc6d669ae6a3baab Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 2 Oct 2005 17:19:08 +0000 Subject: [PATCH] Merged revisions 1248-1250,1252-1253,1257 via svnmerge from http://svn.freepascal.org/svn/fpc/trunk r1248 (florian) + overriding of inithandlers r1249 (florian) + loading of components from resources r1250 (florian) * resources aren't case sensitive * fixed installing of default component loading handler r1252 (florian) * zero out resource info record r1253 (florian) * we should zero out the data instead of the pointer r1257 (florian) * fixed fillchar parameters git-svn-id: branches/fixes_2_0@1258 - --- rtl/inc/elfres32.inc | 22 +++++++++++++--------- rtl/inc/resh.inc | 26 +++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/rtl/inc/elfres32.inc b/rtl/inc/elfres32.inc index 49194db9bf..d71a8ddbb7 100644 --- a/rtl/inc/elfres32.inc +++ b/rtl/inc/elfres32.inc @@ -81,14 +81,17 @@ begin If (ResInfoCount<>0) then begin FPCRuntimeResourceInfoArray:=GetMem(SizeOf(TFPCRuntimeResourceInfo)*ResInfoCount); + { we must zero out this because name is an ansistring } + fillchar(FPCRuntimeResourceInfoArray^,SizeOf(TFPCRuntimeResourceInfo)*ResInfoCount,0); + for i:=0 to ResInfoCount-1 do begin - CurrentResource:=pFPCResourceInfo(pointer(FPCResourceSectionLocation^.reshash.ptr+i*sizeof(TFPCResourceInfo))); - FPCRuntimeResourceInfoArray[i].reshash:=CurrentResource^.reshash; - FPCRuntimeResourceInfoArray[i].restype:=CurrentResource^.restype; - FPCRuntimeResourceInfoArray[i].ptr:=pointer(CurrentResource^.ptr)+PtrInt(FPCResourceSectionLocation^.resdata.ptr); - FPCRuntimeResourceInfoArray[i].name:=pchar(CurrentResource^.name)+PtrInt(FPCResourceSectionLocation^.ressym.ptr); - FPCRuntimeResourceInfoArray[i].size:=CurrentResource^.size; + CurrentResource:=pFPCResourceInfo(pointer(FPCResourceSectionLocation^.reshash.ptr+i*sizeof(TFPCResourceInfo))); + FPCRuntimeResourceInfoArray[i].reshash:=CurrentResource^.reshash; + FPCRuntimeResourceInfoArray[i].restype:=CurrentResource^.restype; + FPCRuntimeResourceInfoArray[i].ptr:=pointer(CurrentResource^.ptr)+PtrInt(FPCResourceSectionLocation^.resdata.ptr); + FPCRuntimeResourceInfoArray[i].name:=pchar(CurrentResource^.name)+PtrInt(FPCResourceSectionLocation^.ressym.ptr); + FPCRuntimeResourceInfoArray[i].size:=CurrentResource^.size; end; end; InitRes:=true; @@ -113,12 +116,13 @@ begin Exit; If Not InitRes then InitializeResources; - searchhash:=HashELF(ResourceName); - n:=strpas(resourcename); + { resources aren't case sensitive } + n:=upcase(strpas(resourcename)); + searchhash:=HashELF(n); I:=0; While (Result=0) and (I