[php-src] PR #25020: ext/com_dotnet: Fix GH-25008 event source typelib crash

From: Date: Wed, 28 Oct 2026 21:17:06 +0000
Subject: [php-src] PR #25020: ext/com_dotnet: Fix GH-25008 event source typelib crash
Groups: php.git-pulls 
Request: Send a blank email to git-pulls+get-40039@lists.php.net to get a copy of this message
Pull Request: https://github.com/php/php-src/pull/25020 Author: iliaal php_com_locate_typeinfo() stored the default source IID and called ITypeLib_GetTypeInfoOfGuid() with a NULL typelib. The object's IDispatch typeinfo already names that library through GetContainingTypeLib(), including when com.autoregister_typelib is off. The sink path now uses that library and leaves the typeinfo NULL when the GUID lookup fails. A source that is not a dispinterface still raises "Type kind must be dispatchable". php_com_process_typeinfo() returned true after that error, and com_event_sink() then walked an uninitialized name map. That path now releases the TYPEATTR and returns false, so the sink is not advised. WinHttp IWinHttpRequestEvents is a custom IUnknown interface, so the IDispatch sink does not implement it. com_print_typeinfo() with the sink flag prints that interface. The non-sink print path and objects without IProvideClassInfo2 are unchanged. Reproduced from GH-25008 on the PHP 8.4 x64 NTS CLI, Windows 11, with com.autoregister_typelib=0 and WinHttp.WinHttpRequest.5.1. Fixes #25008

« previous php.git-pulls (#40039) next »