blob: b13f0cf8d13ade9eb66c778a279fdd6d26cf2074 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
{ %norun }
{$mode delphi}
program gpabugtest;
TYPE TGetCurrentProcess = function : THandle; stdcall;
TGetProcAddress = function(const hModule : THandle; const lpProcName : PAnsiChar) : Pointer; stdcall;
function GetProcAddress(const hModule : THandle;const lpProcName : PAnsiChar) : Pointer; stdcall;
begin
result:=nil;
end;
function GetModuleHandle(const lpModuleName : PWideChar) : THandle; stdcall;
begin
result:=thandle(-1);
end;
var proc_GetCurrentProcess : TGetCurrentProcess;
proc_GetProcAddress : TGetProcAddress;
begin
{no error} proc_GetCurrentProcess:=GetProcAddress(GetModuleHandle('Kernel32'),'GetCurrentProcess');
{error ??} proc_GetProcAddress:= GetProcAddress(GetModuleHandle('Kernel32'),'GetProcAddress');
end.
|