Sign in to follow this  
Followers 0
petrojelly

Need some help with OpenProcess DllCall

3 posts in this topic

Hello, i am trying to get a process handle by using the OpenProcess API, but it is always equal to 260 regardless of the different process ID that i use. Is there something wrong with this code ?

$PROCESS_ALL_ACCESS = 0x1F0FFF

$PID = ProcessExists("Icq.exe")

$PHandle = DllCall("Kernel32.dll", "long", "OpenProcess", "int", PROCESS_ALL_ACCESS, "int", 0, "int", $PID)

can someone tell me why $PHandle[0] is always equal to 260 ?

Share this post


Link to post
Share on other sites



Hello, i am trying to get a process handle by using the OpenProcess API, but it is always equal to 260 regardless of the different process ID that i use. Is there something wrong with this code ?

  $PROCESS_ALL_ACCESS = 0x1F0FFF

  $PID = ProcessExists("Icq.exe")

  $PHandle = DllCall("Kernel32.dll", "long", "OpenProcess", "int", PROCESS_ALL_ACCESS, "int", 0, "int", $PID)

can someone tell me why $PHandle[0] is always equal to 260 ?

<{POST_SNAPBACK}>

Maybe a typo with PROCESS_ALL_ACCESS in DLLCALL shouldn't it be $PROCESS_ALL_ACCESS ?

$PHandle = DllCall("Kernel32.dll", "long", "OpenProcess", "int", $PROCESS_ALL_ACCESS, "int", 0, "int", $PID)

Share this post


Link to post
Share on other sites

Thx Larry you were right. The PHandle doesnt have to be different for different pID, it just have to be unique.

To bshoenhair, thanks for pointing that out, it's a typo i made in the post.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0