demiller9
20th August 2007 07:02 UTC
GetCurrentProcessId gives 'error'
Can someone please tell me why I get an error from this?
System::Call "Kernel32::GetCurrentProcessID() i .r4"
${If} $4 == "error"
System::Call kernel32::GetLastError()i.r5
${EndIf}
$4 = 'error' and $5 = 126, which means "ERROR_MOD_NOT_FOUND"??
Thanks,
Don
Afrow UK
20th August 2007 13:18 UTC
You need a v inside the ().
Stu
Anders
20th August 2007 14:42 UTC
System::Call "kernel32::GetCurrentProcessId()i.r4" (Id not ID)
BTW, the system plugin can call GetLastError for you in the same call, check out the system readme. Calling it the way you are doing is probably not a good idea, you don't know if System::Call does something to change the error state
demiller9
20th August 2007 14:46 UTC
I added the v in both places and the result is the same.
EDIT: Corrected the name from ID to Id and of course it works. The v was not necessary after all. I'll re-read the docs about letting it call GetLastError. Thanks, Anders.
Don
Afrow UK
20th August 2007 23:29 UTC
I probably fixed it by accident when I tried it lol
Stu