mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 02:19:33 +02:00
* zero out resource info record
git-svn-id: trunk@1252 -
This commit is contained in:
parent
cba3aad3ba
commit
6bf8d76140
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user