http://bugs.winehq.org/show_bug.cgi?id=59504 --- Comment #2 from Robert-Gerigk@online.de --- The list_empty check alone would not be sufficient. On native Windows, GetScriptDispatch("") returns the global dispatch even when named items are registered in the list. So if a host calls AddNamedItem("myobj", ...) first and then GetScriptDispatch(""), the list is non-empty, lookup_named_item runs, tries to find "", fails, and returns E_INVALIDARG. Verified on native Windows 11 (64-bit process): GetScriptDispatch(null): OK (dispatch=valid) GetScriptDispatch(""): OK (dispatch=valid) GetScriptDispatch("nonexistent"): FAILED (expected: 0x80070057) Windows treats GetScriptDispatch("") identically to GetScriptDispatch(null) — both return the global script dispatch object. Only a truly non-existent named item returns E_INVALIDARG. The minimal correct fix matching Windows behavior: if(pstrItemName && *pstrItemName) This treats empty string the same as NULL in all cases, regardless of whether named items exist. The same fix applies to dlls/vbscript/vbscript.c which has identical logic. The test program is attached to the initial bug report (TestGetScriptDispatch.cs). -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.