I hope you solve it. If this is not the case, I just discovered that the example (I assume this is a damn "npruntime pattern") was corrupted.
strdup , NP_something.
, NPAPI , , , strdup malloc, NPN_MemAlloc.
, malloc , NPAPI.
npruntime 452:
STRINGZ_TO_NPVARIANT(strdup("foo return val"), *result);
466:
STRINGZ_TO_NPVARIANT(strdup("default method return val"), *result);
:
char* src = "foo return val";
char* out = (char *)NPN_MemAlloc(strlen(src) + 1);
strcpy(out, src);
STRINGZ_TO_NPVARIANT(out, *result);
.
, mozilla SDK.