Code:
PLUGIN_API int WINAPI gir_event(PFTreeNode Node, CRITICAL_SECTION *cs, PEventElement Event, char * status, int statuslen)
{
MessageBox(NULL, "Test", "Message", MB_OK);
bool success = false;
PCommand Command;
MessageBox(NULL, "Test2", "Message", MB_OK);
GirderLogMessageEx(DEVICE_NAME, "Hello World!", GLM_GOOD_ICON);
EnterCriticalSection(cs);
Command = (PCommand)Node->Data;
MessageBox(NULL, "Test3", "Message", MB_OK);
PCHAR s = ParseString(Command->Action.sValue1);
PCHAR e = NULL;
MessageBox(NULL, "Test4", "Message", MB_OK);
if (Event->EventString != NULL) // <------------------ HARD LOCK :(
{
e = ParseString(Event->EventString); // <--------- HARD LOCK :( :( :(
}
MessageBox(NULL, "Test5", "Message", MB_OK);
StringCbPrintf(msg,
sizeof(msg),
"Device Number: Command: %s EventString: %s",
s,
e);
MessageBox(NULL, "Test6", "Message", MB_OK);
SafeFree(s);
SafeFree(e);
MessageBox(NULL, "Test7", "Message", MB_OK);
GirderLogMessageEx(DEVICE_NAME, msg, GLM_GOOD_ICON);
if ( Command->ActionSubType == DEVICE_NUMBER )
{
// success = pClient->doAction(CGirderCommand(Command, Event->Payload, Event->PayloadSize));
}
LeaveCriticalSection(cs);
MessageBox(NULL, msg, "Message", MB_OK);
StringCbPrintf( status, statuslen, "SonyCLient command[%s]", (success)? "ok":"failed");
return retContinue;
}
I tested "EventString"s using predefined and Girder Events that were typed in by hand.