NPAPI:ErrorReporting: Difference between revisions

Line 38: Line 38:
* <code>NPERR_NO_ERROR</code>: If successful
* <code>NPERR_NO_ERROR</code>: If successful


If the API is called with same key that was registered earlier, then API call with succeed and call will override the old pointer and length values. The plugin can attempt to register multiple memory blocks.
The browser will not read a registered buffer upon registration, thus there is no need to re-register after changing the contents of a registered buffer. The buffer will only be read from a crash handler. Registering memory address <code>NULL</code> (zero) will not be allowed, to avoid the issue in which a plugin might register the result of a <code>malloc</code> call without a <code>NULL</code> check.
 
If the API is called with a key that has already been registered, the new registration will replace the old one. Plugins can attempt to register multiple buffers.


Calling <code>NPN_GetValue</code> with new key <code>NPNVmaxCrashMemoryBlockSize</code> can be used to get the maximum amount of memory available for a plugin's block registration. This is not a per-block or per-instance limit, it is a per-plugin limit.
Calling <code>NPN_GetValue</code> with new key <code>NPNVmaxCrashMemoryBlockSize</code> can be used to get the maximum amount of memory available for a plugin's block registration. This is not a per-block or per-instance limit, it is a per-plugin limit.
Confirmed users, Bureaucrats and Sysops emeriti
1,680

edits