From: SMTP%"roman@softwinter.com" 7-NOV-1997 16:52:28.26 To: "'jstanton@lancache.com'" , "'perotin@esker.fr'" CC: "'NTFSD Developer List'" Subj: RE: [ntfsd] RE: NtXxx calls Return-Path: owner-ntfsd@atria.com Received: by arisia.gce.com (UCX V4.1-12C, OpenVMS V7.1 VAX); Fri, 7 Nov 1997 16:43:37 -0500 Received: from gw.atria.com (gw.atria.com [192.88.237.2]) by mercury.mv.net (8.8.8/mem-971025) with SMTP id AAA07794 for ; Fri, 7 Nov 1997 00:05:09 -0500 (EST) Received: by gw.atria.com id Thu, 6 Nov 1997 21:35:21 -0500 Received: from noodle.mentasoftware.com by gw.atria.com id Thu, 6 Nov 1997 21:35:17 -0500 Received: from test_pc ([207.232.21.21]) by noodle.mentasoftware.com (Netscape Messaging Server 3.01) with SMTP id 94; Fri, 7 Nov 1997 04:33:39 +0200 Received: by localhost with Microsoft MAPI; Fri, 7 Nov 1997 04:35:52 +0200 Message-ID: <01BCEB36.A13F41D0.roman@softwinter.com> From: "Roman Rutman (sw)" Reply-To: "roman@softwinter.com" To: "'jstanton@lancache.com'" , "'perotin@esker.fr'" Cc: "'NTFSD Developer List'" Subject: RE: [ntfsd] RE: NtXxx calls Date: Fri, 7 Nov 1997 04:35:51 +0200 Organization: Soft Winter X-Mailer: Microsoft Internet E-mail/MAPI - 8.0.0.4211 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: owner-ntfsd@atria.com Precedence: bulk On Thursday, November 06, 1997 9:00 PM, Jim Stanton [SMTP:jstanton@lancache.com] wrote: > > I'm trying to retrieve the Authentication ID from the current > > process in a fs > > driver. > > The NtOpenProcessToken() function always returns > > STATUS_ACCESS_VIOLATION. This code 100% working... NTSTATUS GetTokenFromProccesID(HANDLE *h, DWORD ProcessId) { HANDLE hToken=0; HANDLE CurrentProcess; NTSTATUS ntStatus; CurrentProcess = MyOpenProcess(PROCESS_ALL_ACCESS, FALSE, ProcessId); if (CurrentProcess) { ntStatus = ZwOpenProcessToken(CurrentProcess, TOKEN_ALL_ACCESS, &hToken); if(NT_SUCCESS(ntStatus)) *h=hToken; else *h=0; ZwClose(CurrentProcess); } return ntStatus; } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [ To unsubscribe, send email to ntfsd-request@atria.com with body UNSUBSCRIBE (the subject is ignored). ]