Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GetCurrentProcessID could not be found in kernel32

Tags:

winapi

delphi

I have this code here

program Project1;

{$APPTYPE CONSOLE}

function GetCurrentProcessID : Cardinal; stdcall; external 'kernel32.dll';

begin
  writeln (GetCurrentProcessID);
  readln;
end.

and it shows me that the entrypoint of GetCurrentProcessID could not be found. Any idea why?

I even tried

function GetCurrentProcessID : Cardinal; stdcall; external 'kernel32.dll'; name 'GetCurrentProcessID';

with no luck either...

like image 848
Ben Avatar asked Dec 15 '22 06:12

Ben


1 Answers

The name of the function in kernel32 is GetCurrentProcessId, note the lower case 'd'.

like image 67
Sertac Akyuz Avatar answered Jan 02 '23 10:01

Sertac Akyuz