* zero out resource info record

git-svn-id: trunk@1252 -
This commit is contained in:
florian 2005-10-02 09:46:43 +00:00
parent cba3aad3ba
commit 6bf8d76140

View File

@ -81,14 +81,17 @@ begin
If (ResInfoCount<>0) then If (ResInfoCount<>0) then
begin begin
FPCRuntimeResourceInfoArray:=GetMem(SizeOf(TFPCRuntimeResourceInfo)*ResInfoCount); FPCRuntimeResourceInfoArray:=GetMem(SizeOf(TFPCRuntimeResourceInfo)*ResInfoCount);
{ we must zero out this because name is an ansistring }
fillchar(FPCRuntimeResourceInfoArray,0,SizeOf(TFPCRuntimeResourceInfo)*ResInfoCount);
for i:=0 to ResInfoCount-1 do for i:=0 to ResInfoCount-1 do
begin begin
CurrentResource:=pFPCResourceInfo(pointer(FPCResourceSectionLocation^.reshash.ptr+i*sizeof(TFPCResourceInfo))); CurrentResource:=pFPCResourceInfo(pointer(FPCResourceSectionLocation^.reshash.ptr+i*sizeof(TFPCResourceInfo)));
FPCRuntimeResourceInfoArray[i].reshash:=CurrentResource^.reshash; FPCRuntimeResourceInfoArray[i].reshash:=CurrentResource^.reshash;
FPCRuntimeResourceInfoArray[i].restype:=CurrentResource^.restype; FPCRuntimeResourceInfoArray[i].restype:=CurrentResource^.restype;
FPCRuntimeResourceInfoArray[i].ptr:=pointer(CurrentResource^.ptr)+PtrInt(FPCResourceSectionLocation^.resdata.ptr); FPCRuntimeResourceInfoArray[i].ptr:=pointer(CurrentResource^.ptr)+PtrInt(FPCResourceSectionLocation^.resdata.ptr);
FPCRuntimeResourceInfoArray[i].name:=pchar(CurrentResource^.name)+PtrInt(FPCResourceSectionLocation^.ressym.ptr); FPCRuntimeResourceInfoArray[i].name:=pchar(CurrentResource^.name)+PtrInt(FPCResourceSectionLocation^.ressym.ptr);
FPCRuntimeResourceInfoArray[i].size:=CurrentResource^.size; FPCRuntimeResourceInfoArray[i].size:=CurrentResource^.size;
end; end;
end; end;
InitRes:=true; InitRes:=true;