Article 12624 of comp.os.ms-windows.programmer.nt.kernel-mode: Rick Jones wrote: > > How does one get the Process ID and Thread ID in a driver? I know you can > get the current Process, and Thread structure (PsGetCurrentProcess, and > PsGetCurrentThread), but the structure returned is not defined in the DDK > includes. > What is the offset to the ID's? > > - Rick - The undocumented function you are looking for is: PsGetCurrentProcessId(). Add this definition to a header file: NTSYSAPI ULONG NTAPI PsGetCurrentProcessId(); There is also a PsGetCurrentThreadId(). Mark