CoGetCurrentProcess

[DllImport("ole32.dll", SetLastError = true)]
public static extern int CoGetCurrentProcess(
   out IntPtr lpdwProcessId
);

Microsoft documentation: Link

Last updated