1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-08 03:23:27 +00:00

1. Fixed bug with windows message pump where if a primitive is returned, an exception is thrown on 64 bit systems.

2. Fixed bug in windows message pump dispatching where uncaught exceptions prevented DefWindowProc from getting called.
This commit is contained in:
Bryan Roe
2022-02-11 15:39:43 -08:00
parent c6ce7c1293
commit b668b2543e
2 changed files with 21 additions and 5 deletions

View File

@@ -102,9 +102,18 @@ function WindowsMessagePump(options)
// This is for us
processed = true;
var d = this.StartDispatcher();
this.mp.emit('message', { message: xmsg.Val, wparam: wparam.Val, lparam: lparam.Val, lparam_hex: lparam.pointerBuffer().toString('hex'), lparam_raw: lparam, hwnd: xhwnd, dispatcher: d });
var msgRet = null;
try
{
this.mp.emit('message', { message: xmsg.Val, wparam: wparam.Val, lparam: lparam.Val, lparam_hex: lparam.pointerBuffer().toString('hex'), lparam_raw: lparam, hwnd: xhwnd, dispatcher: d });
msgRet = this.mp.emit_returnValue('message');
}
catch(zz)
{
console.info1(zz);
}
var msgRet = this.mp.emit_returnValue('message');
if (msgRet == null)
{
// We need to call DefWindowProcA, becuase this message was not handled
@@ -124,7 +133,7 @@ function WindowsMessagePump(options)
}
else
{
var r = GM.CreatePointer();
var r = GM.CreateVariable(4);
r.Val = msgRet;
this.EndDispatcher(r);
}
@@ -137,7 +146,14 @@ function WindowsMessagePump(options)
var d = this.StartDispatcher();
this.mp.emit('message', { message: xmsg.Val, wparam: wparam.Val, lparam: lparam.Val, lparam_hex: lparam.pointerBuffer().toString('hex'), hwnd: xhwnd, dispatcher: d });
try
{
this.mp.emit('message', { message: xmsg.Val, wparam: wparam.Val, lparam: lparam.Val, lparam_hex: lparam.pointerBuffer().toString('hex'), hwnd: xhwnd, dispatcher: d });
}
catch(zz)
{
console.info1(zz);
}
var msgRet = this.mp.emit_returnValue('message');
if (msgRet == null)