Jump to content

Recommended Posts

Posted

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 ?

Posted

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)
Posted

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.

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
×
×
  • Create New...