Archive: Using System::Call to call OpenEvent


Using System::Call to call OpenEvent
hi-

i want to replicate this system call for my nsis script:

===
const TCHAR* eventName = _T("Global\\MyEvent");
HANDLE lockHandle = ::OpenEvent(EVENT_MODIFY_STATE, FALSE, eventName);
if (lockHandle == NULL)
{
// do something
}
===

i have tried a variety of options

===
System::Call "kernel32::OpenEvent(i EVENT_MODIFY_STATE, i FALSE, t 'Global\\MyEvent') p .r0"
System::Call "kernel32::OpenEvent(i 2, i 0, t 'Global\\MyEvent') p .r0"
===

none seem to return a value at $0 when i'm expecting a non-null value for lockHandle.

any ideas?

thanks,
augusto.


Ignore the docs online as they are for the current unreleased NSIS. There is no 'p'; use i.r0 for the return value. Also you don't need a double backstroke.

Stu


great! your suggestions worked.