Closed Bug 535120 Opened 12 years ago Closed 12 years ago

[OOPP] Calling NPN_GetValue for NPNVToolkit in NP_Initialize fails

Categories

(Core :: Plug-ins, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: sparky, Assigned: benjamin)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.3a1pre) Gecko/20091215 Minefield/3.7a1pre Firefox/3.7
Build Identifier: 

I have a plugin that I've written, which tests for XEmbed support in NP_Initialize ( as suggested in https://developer.mozilla.org/en/XEmbed_Extension_for_Mozilla_Plugins )

PRBool supportsXEmbed = PR_FALSE;
NPError err1 = NPN_GetValue(NULL, NPNVSupportsXEmbedBool, (void*)&supportsXEmbed);

NPNToolkitType toolkit = NPNVGtk12;
NPError err2 = NPN_GetValue(NULL, NPNVToolkit, (void*)&toolkit);

if(err1 != NPERR_NO_ERROR || err2 != NPERR_NO_ERROR)
{
	NP_DEBUG("Unable to determine XEmbed support");
	return NPERR_INCOMPATIBLE_VERSION_ERROR;
}

if(!supportsXEmbed || toolkit != NPNVGtk2)
{
	NP_DEBUG("XEmbed not supported");
	return NPERR_INCOMPATIBLE_VERSION_ERROR;
}

With OOPP disabled, this succeeds without error. However if I enable OOPP, it fails with "Unable to determine XEmbed support".

I added some debug printouts to check the NPError values and I found that the NPNVToolkit call returned 2 (NPERR_INVALID_INSTANCE_ERROR)

Is this intentional?

Reproducible: Always
No, we apparently missed a case where you're allowed to call NPN_GetValue with a null npp.
Blocks: OOPP
Status: UNCONFIRMED → NEW
Component: IPC → Plug-ins
Ever confirmed: true
QA Contact: ipc → plugins
Summary: Calling NPN_GetValue for NPNVToolkit in NP_Initialize fails → [OOPP] Calling NPN_GetValue for NPNVToolkit in NP_Initialize fails
Assignee: nobody → benjamin
Status: NEW → ASSIGNED
Attachment #425044 - Flags: review?(bent.mozilla)
Attachment #425044 - Flags: review?(bent.mozilla) → review+
http://hg.mozilla.org/mozilla-central/rev/1be234301318
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.