RICHED20: EM_SETCHARFORMAT must return 0, not assert, on invalid struct size (try 2)

a_villacis at palosanto.com a_villacis at palosanto.com
Wed Sep 26 12:38:34 CDT 2007


> a_villacis at palosanto.com writes:
>
>> Changelog:
>> * EM_SETCHARFORMAT must not assert on invalid structure size. Instead,
>> it
>> should just fail and return 0.
>
> It would be better to do that in ME_ToCF2W since it already has to
> check the size, simply make it return NULL on error or something like
> that.

I considered doing this at first, but ME_ToCF2W is used in three other
places beside handling EM_SETCHARFORMAT (all in style.c), and those places
might get a null-pointer exception instead of an assert if something went
wrong.

What do you think about this version? This one adds a few asserts in some
places that would otherwise change behavior with the change, possibly
making future debugging harder.

Changelog:
* EM_SETCHARFORMAT must not assert on invalid structure size. Instead,
  it should just fail and return 0.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wine-riched20-EM_SETCHARFORMAT-no-assert-try2.patch
Type: text/x-patch
Size: 5169 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20070926/c645e7fb/attachment.bin 


More information about the wine-patches mailing list