Closed
Bug 193782
Opened 22 years ago
Closed 22 years ago
[AxPlugin] Property bag implementation in plugin/control is wrong
Categories
(Core Graveyard :: Embedding: APIs, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: adamlock, Assigned: adamlock)
References
Details
Attachments
(1 file, 2 obsolete files)
1.43 KB,
patch
|
dbradley
:
review+
adamlock
:
superreview+
asa
:
approval1.3+
|
Details | Diff | Splinter Review |
The implementation of IPropertyBag::Read in PropertyBag.cpp is incorrect. It
should be treating the VARIANT param as [in,out], not just [out].
This added correctness might break badly behaved controls which are not
supplying a valid [in] value so I might have to add some pointer tests to ensure
the method ignores this value if it is filled with garbage. Possibly I will also
have to remove the smart code in LegacyPlugin.cpp that coerces the params
supplied in the content into VT_I4, VT_BOOL etc. types and just leave them as
VT_BSTR for the control to deal with when it reads them.
This patch fixes IPropertyBag::Read implementation. It grabs the vt specified
by the [in] variant, VariantInit's the variant and then attempts to copy into
it the named value with the type specified in vt. I also changed the return
code which should be E_FAIL according to the docs.
This patch fixes IPropertyBag::Read implementation. It grabs the vt specified
by the [in] variant, VariantInit's the variant and then attempts to copy into
it the named value with the type specified in vt. I also changed the return
code which should be E_FAIL according to the docs.
Comment on attachment 114799 [details] [diff] [review]
Patch
Duped attachment
Attachment #114799 -
Attachment is obsolete: true
Comment on attachment 114800 [details] [diff] [review]
Patch
David & Chris, can I have an r/sr on this patch please? Thanks.
Attachment #114800 -
Flags: superreview?(blizzard)
Attachment #114800 -
Flags: review?(dbradley)
Comment 5•22 years ago
|
||
Comment on attachment 114800 [details] [diff] [review]
Patch
Why not use CComVariant methods? this would clean up some of the casts.
+ if (vt == VT_EMPTY)
+ {
+ hr = vNew.Copy(m_PropertyList.GetValueOf(i));
+ }
+ else
+ {
+ hr = vNew.ChangeType(vt, m_PropertyList.GetValueOf(i));
+ }
...
// Copy the new value
- VariantCopy(pVar, const_cast<VARIANT
*>(m_PropertyList.GetValueOf(i)));
+ vNew.Detach(pVar);
return S_OK;
Comment 6•22 years ago
|
||
Comment on attachment 114800 [details] [diff] [review]
Patch
sr=blizzard
Attachment #114800 -
Flags: superreview?(blizzard) → superreview+
David, new patch addresses your issues. Can you take a look? Thanks
Attachment #114800 -
Attachment is obsolete: true
Comment 8•22 years ago
|
||
Comment on attachment 114903 [details] [diff] [review]
Updated patch
r=dbradley
Do you really need the const cast in the assignment to pvSrc. From what I can
tell all uses of it take a const VARIANT pointer.
Attachment #114903 -
Flags: review+
Comment on attachment 114903 [details] [diff] [review]
Updated patch
Requesting approval for 1.3 checkin.
Risk is low, confined to ActiveX and fixes crash issues with some controls.
Attachment #114903 -
Flags: superreview+
Attachment #114903 -
Flags: approval1.3?
Assignee | ||
Comment 10•22 years ago
|
||
Nice catch, I'll remove the const_cast for checkin.
It was originally necessary to remove the const for calls to the
VariantCopy/VariantChangeType functions, but the CComVariant equivalents seem to
do the right thing.
Updated•22 years ago
|
QA Contact: carosendahl → ashishbhatt
Comment 11•22 years ago
|
||
Comment on attachment 114903 [details] [diff] [review]
Updated patch
a=asa (on behalf of drivers) for checkin to 1.3
Attachment #114903 -
Flags: approval1.3? → approval1.3+
Updated•22 years ago
|
Attachment #114800 -
Flags: review?(dbradley)
Assignee | ||
Comment 12•22 years ago
|
||
Fix is checked in
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•