Shoutbox

ReadInterfacePtr() - Crashes Windows Live Messenger - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: ReadInterfacePtr() - Crashes Windows Live Messenger (/showthread.php?tid=86616)

ReadInterfacePtr() - Crashes Windows Live Messenger by matty on 10-12-2008 at 07:48 PM

Patchou,

It is time we are told how this works so that we cannot keep crashing WLM with it :)

jscript code:
var hWnd = Interop.Call('user32', 'FindWindowExW', Messenger.ContactListWndHandle, 0, 'Main Window Class', '');
hWnd = Interop.Call('user32', 'FindWindowExW', hWnd, 0, 'DirectUIHWND', '');

if (hWnd === 0) return;

var IID_IAccessible = Interop.Allocate(16);
with (IID_IAccessible) { WriteDWORD(0, 0x618736E0); WriteWORD(4, 0x3C3D); WriteWORD(6, 0x11CF); SetAt(8, 0x81); SetAt(9, 0xc); SetAt(10, 0x0); SetAt(11, 0xaa); SetAt(12, 0x0); SetAt(13, 0x38); SetAt(14, 0x9b); SetAt(15, 0x71); }

var IAccessible = Interop.Allocate(4);

Debug.Trace(Interop.Call('oleacc', 'AccessibleObjectFromWindow', hWnd, 0xFFFFFFFC /* OBJID_CLIENT */, IID_IAccessible, IAccessible));

IAccessible.ReadInterfacePtr(0); // crash occurs here!

This requires the main contact list window to be opened.

The last line should provide access to the IAccessible interface but instead it crashes WLM.

I also emailed this to you but I know you aren't really concerned about it with the beta currently going on however I wonder if there is a bug in Plus! causing this to crash and not work corectly.
RE: ReadInterfacePtr() - Crashes Windows Live Messenger by Eljay on 10-15-2008 at 04:58 PM

*bump* :P

I would like to know how to use this as well, if it even has any use..


RE: ReadInterfacePtr() - Crashes Windows Live Messenger by mynetx on 10-17-2008 at 12:07 PM

I am also interested in that because I assume it something that matty is investigating for my advantage :P


RE: ReadInterfacePtr() - Crashes Windows Live Messenger by Patchou on 10-19-2008 at 06:08 PM

I apologize for the lack of answers I gave you regarding this matter in the past. Proof that I should have done so before: it was a bug that prevented you from using this function properly. Your code is correct, the bug was fixed in build 341. Have fun with IAccessible :).

jscript code:
    var pAccessibleData = Interop.Allocate(4);
    if(Interop.Call('oleacc', 'AccessibleObjectFromWindow', hWnd, 0xFFFFFFFC /* OBJID_CLIENT */, IID_IAccessible, pAccessibleData) == 0)
    {
        var iAccessible = pAccessibleData.ReadInterfacePtr(0);
        if(iAccessible)
        {
            iAccessible.accHitTest(0, 0);
        }
    }

RE: ReadInterfacePtr() - Crashes Windows Live Messenger by matty on 10-19-2008 at 06:12 PM

Good stuff!

So when do we get the beta? lol