Beispiel #1
0
NPError OSCALL NP_Initialize(NPNetscapeFuncs* aNPNFuncs)
{
	NPError rv = fillNetscapeFunctionTable(aNPNFuncs);
	if (rv != NPERR_NO_ERROR)
		return rv;

	return NS_PluginInitialize();
}
Beispiel #2
0
NPError
NP_Initialize(NPNetscapeFuncs* aNPNFuncs, NPPluginFuncs* aNPPFuncs)
{
    NPError rv = fillNetscapeFunctionTable(aNPNFuncs);
    if(rv != NPERR_NO_ERROR) {
        return rv;
    }

    rv = fillPluginFunctionTable(aNPPFuncs);
    if(rv != NPERR_NO_ERROR) {
        return rv;
    }

    return NS_PluginInitialize();
}
Beispiel #3
0
NPError OSCALL NP_Initialize(NPNetscapeFuncs* aNPNFuncs)
{
  /*
   * N.B.  On Firefox 2.0.0.12/WinXP, aNPNFuncs->size is 172 while
   * sizeof(NPNetscapeFuncs) is 184.  However, npgnash.dll continues to
   * work fine even though NPNFuncs isn't populated (!), and as a matter
   * of fact, Firefox seems to ignore the NPERR_INVALID_FUNCTABLE_ERROR
   * return from NP_Initialize and continues to load and execute
   * npgnash.dll, anyway.  Therefore, we should continue and execute
   * NS_PluginInitialize anyway, too.
   */

  NPError rv = fillNetscapeFunctionTable(aNPNFuncs);
#if 0
  if(rv != NPERR_NO_ERROR)
    return rv;
#endif
  NPError rv2 = NS_PluginInitialize();

  return rv2 != NPERR_NO_ERROR ? rv2 : rv;
}
Beispiel #4
0
NPError main(NPNetscapeFuncs* aNPNFuncs, NPPluginFuncs* aNPPFuncs, NPP_ShutdownUPP* aUnloadUpp)
{
	NPError rv = NPERR_NO_ERROR;

	if (!aUnloadUpp)
		rv = NPERR_INVALID_FUNCTABLE_ERROR;

	if (rv == NPERR_NO_ERROR)
		rv = fillNetscapeFunctionTable(aNPNFuncs);

	if (rv == NPERR_NO_ERROR) {
		// defer static constructors until the global functions are initialized.
		__InitCode__();
		rv = fillPluginFunctionTable(aNPPFuncs);
	}

	*aUnloadUpp = NewNPP_ShutdownProc(Private_Shutdown);
	gResFile = CurResFile();
	rv = Private_Initialize();

	return rv;
}