I guess this is expected behavior. NtOpenProcess expects user mode allocated
buffer and hence none of Nt calls would work in kernel mode. Though there is
workaround for it. You can allocate user mode memory in kernel mode and make
use of all Nt calls,
-----Original Message-----
From: Ken Galipeau [mailto:xxxxx@legato.com]
Sent: Friday, January 17, 2003 2:56 PM
To: File Systems Developers
Subject: [ntfsd] RE: Process Pointer from Process Id
I was getting process id confused with process handle and thought they were
the same.
It is interesting that ZwOpenProcess works but NtOpenProcess (Someone else
suggested it) does NOT. It always returns STATUS_ACCESS_VIOLATION.
Thanks,
Ken
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Nicholas Ryan
Sent: Friday, January 17, 2003 2:17 PM
To: File Systems Developers
Subject: [ntfsd] RE: Process Pointer from Process Id
Hmm no, it DOES take a process ID as input:
NTSYSAPI
NTSTATUS
NTAPI
ZwOpenProcess(
OUT PHANDLE ProcessHandle,
IN ACCESS_MASK DesiredAccess,
IN POBJECT_ATTRIBUTES ObjectAttributes,
IN PCLIENT_ID ClientId OPTIONAL
);
The ClientId parameter is a structure (defined in ntifs.h) that allows you
to specify a process ID to open. Once the function succeeds, call
ObReferenceObjectByHandle on the returned ProcessHandle to get at the
PEPROCESS.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ken Galipeau
Sent: Friday, January 17, 2003 7:48 AM
To: File Systems Developers
Subject: [ntfsd] RE: Process Pointer from Process Id
Thanks, but ZwOpenProcess returns a Process Id (Handle), it does not take
one as input.
Given that I already have a Process Id how can I get the PEPROCESS for it?
Ken
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Nicholas Ryan
Sent: Thursday, January 16, 2003 6:17 PM
To: File Systems Developers
Subject: [ntfsd] RE: Process Pointer from Process Id
ZwOpenProcess (undocumented). See the Native API Reference book by Gary
Nebbett.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ken Galipeau
Sent: Thursday, January 16, 2003 2:04 PM
To: File Systems Developers
Subject: [ntfsd] Process Pointer from Process Id
How can I get the PEPROCESS from a Process Id?
I tried using ObReferenceObjectByHandle (which works on a Thread Id(Handle)
to get the thread context, but does not for the process id).
Thanks,
Ken
You are currently subscribed to ntfsd as: xxxxx@nryan.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
You are currently subscribed to ntfsd as: xxxxx@legato.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
You are currently subscribed to ntfsd as: xxxxx@nryan.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
You are currently subscribed to ntfsd as: xxxxx@legato.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
You are currently subscribed to ntfsd as: xxxxx@legato.com
To unsubscribe send a blank email to xxxxx@lists.osr.com