From: SMTP%"hewett@vireo.com" 17-SEP-1997 17:50:47.73 To: ntfsd@atria.com CC: Subj: Re: thread/process id from a filter driver Return-Path: owner-ntfsd@atria.com Received: by arisia.gce.com (UCX V4.1-12C, OpenVMS V7.1 VAX); Wed, 17 Sep 1997 17:44:43 -0400 Received: from gw.atria.com (gw.atria.com [192.88.237.2]) by bort.mv.net (8.8.5/mem-951016) with SMTP id TAA15631 for ; Tue, 16 Sep 1997 19:11:56 -0400 (EDT) Received: by gw.atria.com id Tue, 16 Sep 1997 14:59:02 -0400 Received: from chmls01.highway1.com by gw.atria.com id Tue, 16 Sep 1997 14:58:57 -0400 Received: from SWIFT ([24.128.63.24]) by chmls01.highway1.com (Netscape Mail Server v2.0) with ESMTP id AAA23657 for ; Tue, 16 Sep 1997 14:58:46 -0400 Message-ID: <341ED6D2.1C907448@vireo.com> Date: Tue, 16 Sep 1997 14:58:26 -0400 From: Fred Hewett Organization: Vireo Software, Inc. X-Mailer: Mozilla 4.01 [en]C-MOENE (WinNT; I) MIME-Version: 1.0 To: ntfsd@atria.com Subject: Re: thread/process id from a filter driver X-Priority: 3 (Normal) References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-ntfsd@atria.com Precedence: bulk Tadman, Mark J wrote: > I'm developing a filter driver that, among other things, needs to obtain > the thread id and process id of the caller. This same question was answered here a while back by Mark Russinovich. Fortunately for you, I saved it: 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(). -- Fred Hewett mailto:hewett@vireo.com Vireo Software http://www.vireo.com