[PATCH 1/2] ntoskrnl.exe: Implement IoGetCurrentProcess and KeGetCurrentThread.

Dmitry Timoshkov dmitry at baikal.ru
Thu Oct 4 00:25:13 CDT 2012

Christian Costa <titan.costa at gmail.com> wrote:

>  PEPROCESS WINAPI IoGetCurrentProcess(void)
>  {
> -    FIXME("() stub\n");
> -    return NULL;
> +    TRACE("()\n");
> +
> +    /* Return current process id since PEPROCESS is opaque and drivers should not access the struct directly */
> +    return (PEPROCESS)PsGetCurrentProcessId();
>  }

The returned pointer is supposed to be passed to various other ntoskrnl APIs,
and it's needs to be a valid pointer to the kernel object. Besides many not
trivial kernel drivers (if not all) really dig into internal kernel structures.

Same for KeGetCurrentThread.


More information about the wine-devel mailing list