]> granicus.if.org Git - php/commit
Fix #79242: COM error constants don't match com_exception codes
authorChristoph M. Becker <cmbecker69@gmx.de>
Fri, 7 Feb 2020 17:04:14 +0000 (18:04 +0100)
committerChristoph M. Becker <cmbecker69@gmx.de>
Fri, 7 Feb 2020 17:04:14 +0000 (18:04 +0100)
commitb9738f5802d15ba5d593ae09a6e63e49f9d7880f
tree587885d6aa30d4d9ab0daf202cc0149bc2dfe033
parent5e2ea00b1539d6003548f7698ece1f737c14fb51
Fix #79242: COM error constants don't match com_exception codes

Because a `HRESULT` is a `LONG`[1], no special treatment is required on
x86 platforms to get appropriate values.  On x64 platforms we prefer
positive values, what we could accomplish by casting the `HRESULT`
value to `ULONG` and then to `zend_long`, but since the current
behavior is correct and the performance improvement is negligible, we
defer that to master.

[1] <https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types#hresult>
NEWS
ext/com_dotnet/com_extension.c
ext/com_dotnet/tests/bug79242.phpt [new file with mode: 0644]