The process returned by PsGetCurrentProcess may differ from the process whose ID is returned by PsGetCurrentProcessId. Use PsGetCurrentProcessId to get the process ID of the process that created the current thread. Use PsGetProcessId(PsGetCurrentProcess()) to get the process ID of the process that the thread is currently attached to.