* changed resource handle parameters from THandle to TFPResourceHMODULE so

they don't truncate the handle data on 64 bit platforms (patch by
    Anton Kavalenka, mantis #21721)

git-svn-id: trunk@22392 -
This commit is contained in:
Jonas Maebe 2012-09-14 15:05:08 +00:00
parent 6f47ed44a0
commit 404e1a34a4
2 changed files with 12 additions and 12 deletions

View File

@ -1015,10 +1015,10 @@ type
private private
Res: TFPResourceHandle; Res: TFPResourceHandle;
Handle: TFPResourceHGLOBAL; Handle: TFPResourceHGLOBAL;
procedure Initialize(Instance: THandle; Name, ResType: PWideChar; NameIsID: Boolean); procedure Initialize(Instance: TFPResourceHMODULE; Name, ResType: PWideChar; NameIsID: Boolean);
public public
constructor Create(Instance: THandle; const ResName: WideString; ResType: PWideChar); constructor Create(Instance: TFPResourceHMODULE; const ResName: WideString; ResType: PWideChar);
constructor CreateFromID(Instance: THandle; ResID: Integer; ResType: PWideChar); constructor CreateFromID(Instance: TFPResourceHMODULE; ResID: Integer; ResType: PWideChar);
destructor Destroy; override; destructor Destroy; override;
end; end;
{$else} {$else}
@ -1026,10 +1026,10 @@ type
private private
Res: TFPResourceHandle; Res: TFPResourceHandle;
Handle: TFPResourceHGLOBAL; Handle: TFPResourceHGLOBAL;
procedure Initialize(Instance: THandle; Name, ResType: PChar; NameIsID: Boolean); procedure Initialize(Instance: TFPResourceHMODULE; Name, ResType: PChar; NameIsID: Boolean);
public public
constructor Create(Instance: THandle; const ResName: string; ResType: PChar); constructor Create(Instance: TFPResourceHMODULE; const ResName: string; ResType: PChar);
constructor CreateFromID(Instance: THandle; ResID: Integer; ResType: PChar); constructor CreateFromID(Instance: TFPResourceHMODULE; ResID: Integer; ResType: PChar);
destructor Destroy; override; destructor Destroy; override;
end; end;
{$endif UNICODE} {$endif UNICODE}

View File

@ -872,7 +872,7 @@ end;
{****************************************************************************} {****************************************************************************}
{$ifdef UNICODE} {$ifdef UNICODE}
procedure TResourceStream.Initialize(Instance: THandle; Name, ResType: PWideChar; NameIsID: Boolean); procedure TResourceStream.Initialize(Instance: TFPResourceHMODULE; Name, ResType: PWideChar; NameIsID: Boolean);
begin begin
Res:=FindResource(Instance, Name, ResType); Res:=FindResource(Instance, Name, ResType);
if Res=0 then if Res=0 then
@ -889,19 +889,19 @@ procedure TResourceStream.Initialize(Instance: THandle; Name, ResType: PWideChar
SetPointer(LockResource(Handle),SizeOfResource(Instance,Res)); SetPointer(LockResource(Handle),SizeOfResource(Instance,Res));
end; end;
constructor TResourceStream.Create(Instance: THandle; const ResName: WideString; ResType: PWideChar); constructor TResourceStream.Create(Instance: TFPResourceHMODULE; const ResName: WideString; ResType: PWideChar);
begin begin
inherited create; inherited create;
Initialize(Instance,PWideChar(ResName),ResType,False); Initialize(Instance,PWideChar(ResName),ResType,False);
end; end;
constructor TResourceStream.CreateFromID(Instance: THandle; ResID: Integer; ResType: PWideChar); constructor TResourceStream.CreateFromID(Instance: TFPResourceHMODULE; ResID: Integer; ResType: PWideChar);
begin begin
inherited create; inherited create;
Initialize(Instance,PWideChar(ResID),ResType,True); Initialize(Instance,PWideChar(ResID),ResType,True);
end; end;
{$else UNICODE} {$else UNICODE}
procedure TResourceStream.Initialize(Instance: THandle; Name, ResType: PChar; NameIsID: Boolean); procedure TResourceStream.Initialize(Instance: TFPResourceHMODULE; Name, ResType: PChar; NameIsID: Boolean);
begin begin
Res:=FindResource(Instance, Name, ResType); Res:=FindResource(Instance, Name, ResType);
if Res=0 then if Res=0 then
@ -918,12 +918,12 @@ procedure TResourceStream.Initialize(Instance: THandle; Name, ResType: PChar; Na
SetPointer(LockResource(Handle),SizeOfResource(Instance,Res)); SetPointer(LockResource(Handle),SizeOfResource(Instance,Res));
end; end;
constructor TResourceStream.Create(Instance: THandle; const ResName: string; ResType: PChar); constructor TResourceStream.Create(Instance: TFPResourceHMODULE; const ResName: string; ResType: PChar);
begin begin
inherited create; inherited create;
Initialize(Instance,pchar(ResName),ResType,False); Initialize(Instance,pchar(ResName),ResType,False);
end; end;
constructor TResourceStream.CreateFromID(Instance: THandle; ResID: Integer; ResType: PChar); constructor TResourceStream.CreateFromID(Instance: TFPResourceHMODULE; ResID: Integer; ResType: PChar);
begin begin
inherited create; inherited create;
Initialize(Instance,pchar(PtrInt(ResID)),ResType,True); Initialize(Instance,pchar(PtrInt(ResID)),ResType,True);