NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("NPN_NewStream: npp=%p, type=%s, window=%s\n", (void*)npp, (const char *)type, window));
_newstream(NPP npp, NPMIMEType type, const char* window, NPStream* *result){    #ifdef NS_DEBUG  printf("\nNewStream called \n\n");#endif	if(!npp)		return NPERR_INVALID_INSTANCE_ERROR;    nsIPluginInstance *inst = (nsIPluginInstance *) npp->ndata;    NS_ASSERTION(inst != NULL, "null instance");    if (inst == NULL)        return NPERR_INVALID_INSTANCE_ERROR;    nsIOutputStream* stream;    nsIPluginInstancePeer *peer;    if (NS_OK == inst->GetPeer(&peer))    {      if (peer->NewStream((const char*) type, window, &stream) != NS_OK)      {        NS_RELEASE(peer);        return NPERR_GENERIC_ERROR;      }      ns4xStreamWrapper* wrapper = new ns4xStreamWrapper(stream);      if (wrapper == NULL)      {        NS_RELEASE(peer);        NS_RELEASE(stream);        return NPERR_OUT_OF_MEMORY_ERROR;      }      (*result) = wrapper->GetNPStream();      NS_RELEASE(peer);      return NPERR_NO_ERROR;    }    else      return NPERR_GENERIC_ERROR;}