https://bugs.winehq.org/show_bug.cgi?id=53868
Bug ID: 53868 Summary: vbscript fails to return TypeName for VT_DISPATCH Product: Wine Version: 7.20 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: vbscript Assignee: wine-bugs@winehq.org Reporter: jsm174@gmail.com Distribution: ---
I ran into some vbscript where it was trying to get the TypeName of an object:
Private Sub RemoveBall(aBall) dim x : for x = 0 to uBound(balls) if TypeName(balls(x) ) = "IBall" then if aBall.ID = Balls(x).ID Then balls(x) = Empty Balldata(x).Reset End If End If Next End Sub
I was able to work around this by added a VT_DISPATCH case to Global_TypeName and fetching it from ITypeInfo_GetDocumentation:
case VT_DISPATCH: { ITypeInfo* typeinfo; HRESULT hres = IDispatch_GetTypeInfo(V_DISPATCH(arg), 0, 0, &typeinfo); if(FAILED(hres)) { return E_FAIL; } BSTR name; hres = ITypeInfo_GetDocumentation(typeinfo, MEMBERID_NIL, &name, NULL, NULL, NULL); if(FAILED(hres)) { return E_FAIL; } hres = return_string(res, name); SysFreeString(name); return hres; }
https://bugs.winehq.org/show_bug.cgi?id=53868
--- Comment #1 from Nikolay Sivov bunglehead@gmail.com --- This make sense, but this should handle a case when there a no documentation strings, in the typelib or in some custom ITypeInfo implementation. I suspect it still has to return generic "Object" for such cases.
Are you planning on working on this further, and sending a fix?
https://bugs.winehq.org/show_bug.cgi?id=53868
--- Comment #2 from Nikolay Sivov bunglehead@gmail.com --- Created attachment 73461 --> https://bugs.winehq.org/attachment.cgi?id=73461 patch
Hi, Jason.
See attached patch, feel free to send it.
https://bugs.winehq.org/show_bug.cgi?id=53868
--- Comment #3 from Jason Millard jsm174@gmail.com --- Fantastic! Thank you again!
See attached patch, feel free to send it.
You mean put together a merge request?
https://bugs.winehq.org/show_bug.cgi?id=53868
--- Comment #4 from Nikolay Sivov bunglehead@gmail.com --- Sure, the patch mostly does what you've posted in a comment before.
https://bugs.winehq.org/show_bug.cgi?id=53868
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Fixed by SHA1| |0eff79ec7814763e93e4b9d62aa | |db96d99e84fad Status|UNCONFIRMED |RESOLVED
--- Comment #5 from Nikolay Sivov bunglehead@gmail.com --- This is now fixed, 0eff79ec7814763e93e4b9d62aadb96d99e84fad.
https://bugs.winehq.org/show_bug.cgi?id=53868
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 7.22.
https://bugs.winehq.org/show_bug.cgi?id=53868
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |7.0.x
https://bugs.winehq.org/show_bug.cgi?id=53868
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|7.0.x |---
--- Comment #7 from Michael Stefaniuc mstefani@winehq.org --- Drop 7.0.x target milestone from bugs that didn't make it.