![]() |
Get PEPROCESS by PID! |
Post Reply
|
Page <12 |
| Author | |
Headium2006
Groupie
Joined: 25 July 2006 Location: China Online Status: Offline Posts: 79 |
Post Options
Quote Reply
Topic: Get PEPROCESS by PID!Posted: 12 August 2006 at 4:07am |
|
I try to use the function PsLookupProcessByProcessId like below: First, I declare the function in my own file like below and no error occurs during the compiling: NTKERNELAPI Then, I call this funcion like this: int * iPtr; PEPROCESS process; status = PsLookupProcessByProcessId( iPtr, &process ); But I always fail to get the PEPROCESS by my process PID.Why? Did I use the function of PsLookupProcesssByProcessId in a wrong way?
|
|
![]() |
|
EP_X0FF
Senior Member
Joined: 08 March 2006 Location: Russian Federation Online Status: Offline Posts: 4753 |
Post Options
Quote Reply
Posted: 11 August 2006 at 11:53pm |
|
pseudo code, ignore "nbsp" <- inserted by forum editor
|
|
|
Ring0 - the source of inspiration
|
|
![]() |
|
Headium2006
Groupie
Joined: 25 July 2006 Location: China Online Status: Offline Posts: 79 |
Post Options
Quote Reply
Posted: 11 August 2006 at 11:46pm |
|
Can I get the source of PsLookupProcessByProcessId?
|
|
![]() |
|
EP_X0FF
Senior Member
Joined: 08 March 2006 Location: Russian Federation Online Status: Offline Posts: 4753 |
Post Options
Quote Reply
Posted: 11 August 2006 at 11:42pm |
PsLookupProcessByProcessId is more easy solution. |
|
|
Ring0 - the source of inspiration
|
|
![]() |
|
Headium2006
Groupie
Joined: 25 July 2006 Location: China Online Status: Offline Posts: 79 |
Post Options
Quote Reply
Posted: 11 August 2006 at 10:54pm |
|
Thank U, EP_XOFF! By the way, how do U think about my idea about traversing the process linked-list to get the PEPROCESS of parent process? |
|
![]() |
|
Headium2006
Groupie
Joined: 25 July 2006 Location: China Online Status: Offline Posts: 79 |
Post Options
Quote Reply
Posted: 11 August 2006 at 10:48pm |
|
Or can I traverse all process to get the PEPROCESS via "LIST_ENTRY ActiveProcessLinks"? In fact, this way is OK, but one problem for me is that I know nothing about the struct LIST_ENTRY. So I can not traverse the process linked-lisk. By the way, is the head of the process linked-list stored in a gloval variable named PsActiveProcessHead? |
|
![]() |
|
EP_X0FF
Senior Member
Joined: 08 March 2006 Location: Russian Federation Online Status: Offline Posts: 4753 |
Post Options
Quote Reply
Posted: 11 August 2006 at 10:44pm |
|
Use our header ntoskrnl.h, located on rkunhooker.narod.ru
|
|
|
Ring0 - the source of inspiration
|
|
![]() |
|
Headium2006
Groupie
Joined: 25 July 2006 Location: China Online Status: Offline Posts: 79 |
Post Options
Quote Reply
Posted: 11 August 2006 at 10:41pm |
|
But I can not find info about this function call. I tried it yesterday, but failed! If I want to use this function, what header file shoud I include? |
|
![]() |
|
MP_ART
Senior Member
Joined: 08 March 2006 Location: Russian Federation Online Status: Offline Posts: 947 |
Post Options
Quote Reply
Posted: 11 August 2006 at 10:12pm |
|
Use PsLookupProcessByProcessId function
|
|
![]() |
|
Headium2006
Groupie
Joined: 25 July 2006 Location: China Online Status: Offline Posts: 79 |
Post Options
Quote Reply
Posted: 11 August 2006 at 10:10pm |
|
Hi! I want to get the PEPROCESS by a given PID. This is to say, I have get the PID of certain process, how can I get its PEPROCESS? What should I do? |
|
![]() |
|
Post Reply
|
Page <12 |
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |