I have never actually used it, so there may be some bugs. And looks like I forgot to make eventSetContextVar() calls to pass data's address.
Here's my eventSetContextVar implementation, I probably forgot to include it into the patch before reverting the changes:
Code: Select all
// Set a global variable value for a context
BOOL eventSetContextVar(SCRIPT_CONTEXT *psContext, UDWORD index, INTERP_VAL *data)
{
INTERP_VAL *psVal;
if (!eventGetContextVal(psContext, index, &psVal))
{
return FALSE;
}
if (psVal->type != data->type)
{
ASSERT( FALSE, "eventSetContextVar: Variable type mismatch (%d/%d)", psVal->type, data->type);
return FALSE;
}
// Store the data
memcpy(psVal, data, sizeof(INTERP_VAL));
return TRUE;
}
