 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Thu Nov 20, 2008 12:44 am Post subject: |
|
|
Thanks for the idea. I require to deal only with user-AHK-process.
Meanwhile, I have updated my post with SetDebugPrivilege(). Please have a look.
Thanks for all the help.  |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Fri Nov 21, 2008 1:13 am Post subject: Re: GetCommandLine |
|
|
| Sean wrote: |
| Code: | | hProc := DllCall("OpenProcess", "Uint", 0x043A, "int", 0, "Uint", pid) |
|
Desired Access 0x43a :
PROCESS_QUERY_INFORMATION=0x400 + PROCESS_CREATE_THREAD=0x2 + PROCESS_VM_READ=0x10 + PROCESS_VM_OPERATION=0x8 + PROCESS_VM_WRITE=0x20
Since I want to call GetCommandLine() from a loop, I might want to pass the hProc instead of PID to this function.
Is there a way to ascertain whether the hProc has enough rights ? |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2462
|
Posted: Fri Nov 21, 2008 10:11 am Post subject: Re: GetCommandLine |
|
|
| SKAN wrote: | | Is there a way to ascertain whether the hProc has enough rights ? |
I don't know if there is any other API in the standard dlls, but NtQueryObject is the one. It used to be classified as undocumented one, but seems (partially) documented now:
http://msdn.microsoft.com/en-us/library/bb432383.aspx
| Code: | VarSetCapacity(bi,56,0)
DllCall("ntdll\NtQueryObject", "Uint", hProc, "Uint", 0, "Uint", &bi, "Uint", 56, "Uint", 0)
MsgBox % NumGet(bi,4)
|
|
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Fri Nov 21, 2008 10:30 am Post subject: |
|
|
Thank you Sean.
BTW, is following correct:
| Code: | If ! ( NumGet(bi,4) & 0x43a )
MsgBox, hProcess does not have enough rights |
|
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2462
|
Posted: Fri Nov 21, 2008 11:36 am Post subject: |
|
|
| SKAN wrote: | | BTW, is following correct: |
It Should be:
| Code: | If NumGet(bi,4) & 0x43A <> 0x43A
MsgBox, hProcess does not have enough rights
|
|
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Fri Nov 21, 2008 5:21 pm Post subject: |
|
|
Thank you Sean.  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|