Closed Bug 194227 Opened 22 years ago Closed 22 years ago

[AxPlugin] Events parameters are sent in the wrong order

Categories

(Core Graveyard :: Embedding: APIs, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: adamlock, Assigned: adamlock)

References

Details

Attachments

(1 file)

Events are fired with their parameters in the reverse order. The mistake crept
in during checkin of bug 178542.

http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&file=XPConnect.cpp&root=/cvsroot&subdir=mozilla/embedding/browser/activex/src/plugin&command=DIFF_FRAMESET&rev1=1.17&rev2=1.18

Patch follows to correct the issue
Attached patch PatchSplinter Review
Simple patch grabs disp args in reverse order.

Proper ordering got lost in the churn of the event sink rewrite. The old
version got it right, the new one didn't.
Where are actual arguments being reversed?

/be
In code like this:

<script for="someObject" event="FSCommand(command, args)">
</script>

Instead of (command, args) it is sent as (args, command) because the plugin code
that processes the args from the control is not putting them in the right order.

The reason is that IDispatch::Invoke sends its arguments in an array with the
args in reverse order, e.g.

pDispParams->rgvarg[0] = arg3;
pDispParams->rgvarg[1] = arg2;
pDispParams->rgvarg[2] = arg1;

The plugin used to have some code to put them in the proper order, but
unfortunately it was overlooked during a big code merge.

This small patch reinstates the correct behaviour.
Comment on attachment 115015 [details] [diff] [review]
Patch

r=dbradley
Attachment #115015 - Flags: review+
Comment on attachment 115015 [details] [diff] [review]
Patch

Brendan, can you give this an sr? Thanks
Attachment #115015 - Flags: superreview?(brendan)
Comment on attachment 115015 [details] [diff] [review]
Patch

I was thrown by the comment, cuz it seemed to leave open the possibility that
the bizarre reason was not by design of IDispatch.  Maybe clarify it to say
"arguments are listed backwards, intentionally, in rgvarg." 
sr=brendan@mozilla.org in any event.

/be
Attachment #115015 - Flags: superreview?(brendan) → superreview+
Thanks, I'll change the comment at checkin
Comment on attachment 115015 [details] [diff] [review]
Patch

Requesting 1.3 apporval. ActiveX specific, low risk, obvious fix for
regression.
Attachment #115015 - Flags: approval1.3?
Comment on attachment 115015 [details] [diff] [review]
Patch

a=asa (on behalf of drivers) for checkin to 1.3
Attachment #115015 - Flags: approval1.3? → approval1.3+
Fix is checked in
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
[AxPlugin] -> Ashish
QA Contact: carosendahl → ashishbhatt
Verified on 2003-02-21
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: