Closed Bug 310097 Opened 19 years ago Closed 19 years ago

XPCDispConvert will not convert SAFEARRAY of VARIANT

Categories

(Core :: XPConnect, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: gdavis, Assigned: dbradley)

References

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7 (ax)
Build Identifier: 

When SAFEARRAY parameters are passed into JavaScript from the Microsoft COM
world, XPCDispConvert will handle all SAFEARRAY types other than VARIANT.  An
application developer who wishes to integrate their Mozilla application with an
existing COM application will find (has found) this limiting.

Reproducible: Always

Steps to Reproduce:
1. Create a JavaScript object with one method on it (say "Fire")
2. Create a JavaScript wrapped ActiveX object using GeckoActiveXObject.
3. Pass this JavaScript to the ActiveX object as a parameter to a method that
accepts an IDispatch. This will create an IDispatch tearoff object that wraps
the JavaScript object.
4. Call the "Fire" method on the tearoff object using IDispatch::Invoke passing
a SAFEARRAY of VARIANT as one of the parameters.
5. The call will always fail with an HRESULT of 0x80040005.

Actual Results:  
Call into tearoff object always fails when one parameter is a SAFEARRAY of VARIANT.

Expected Results:  
Call into tearoff object should succeed if SAFEARRAY contains valid VARIANT data.
I cannot test this on the trunk because the COM-to-JS bridge (not XPCOM) is
broken right now.  I tested this with a 1.8a5 build where COM
(GeckoActiveXObject) was working.
Garret, you need to make a diff file of your patch (usually something like `cvs
diff -p -u -8` works fine) and then request review from someone on your patch.
(dbradley@gmail.com would be the appropriate reviewer in this case.)
This is the diff version of the previous patch.

Thanks again Garret.
Attachment #197465 - Attachment is obsolete: true
Attachment #198995 - Flags: superreview?(jst)
Attachment #198995 - Flags: review?(dbradley)
Comment on attachment 198995 [details] [diff] [review]
Diff version of  previous patch

r=dbradley

I was expecting array of variants to be returned in the same fashion as other
types, using byref.
Attachment #198995 - Flags: review?(dbradley) → review+
Oh, also Garret, apply the patch in bug 311775 to a trunk build and test this
and report back. I'll try and get these checked in all together.
Status: UNCONFIRMED → ASSIGNED
Depends on: 311775
Ever confirmed: true
(In reply to comment #5)
> Oh, also Garret, apply the patch in bug 311775 to a trunk build and test this
> and report back. I'll try and get these checked in all together.

I have tested this bug along with 311775 and have verified that both bugs are
indeed fixed. Does anyone need to create a test case for these bugs? If so, let
me know how I can help.
Comment on attachment 198995 [details] [diff] [review]
Diff version of  previous patch

sr=jst
Attachment #198995 - Flags: superreview?(jst) → superreview+
(In reply to comment #5)
> Oh, also Garret, apply the patch in bug 311775 to a trunk build and test this
> and report back. I'll try and get these checked in all together.

Could you land this on the trunk please David? I'd like to start getting this incorporated into my builds without having to apply the patch all the time.

Thanks
I just landed this on the trunk. FIXED.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Attachment #198995 - Flags: approval1.8.0.2?
Comment on attachment 198995 [details] [diff] [review]
Diff version of  previous patch

Maybe for 1.8 branch (Firefox 2), not 1.8.0.x
Attachment #198995 - Flags: approval1.8.0.2?
Attachment #198995 - Flags: approval1.8.0.2-
Attachment #198995 - Flags: approval-branch-1.8.1?(jst)
Attachment #198995 - Flags: approval-branch-1.8.1?(jst) → approval-branch-1.8.1+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: