diff --git a/gpii/node_modules/windowMessages/src/windowMessages.js b/gpii/node_modules/windowMessages/src/windowMessages.js index bbfb08c1b..4d65801db 100644 --- a/gpii/node_modules/windowMessages/src/windowMessages.js +++ b/gpii/node_modules/windowMessages/src/windowMessages.js @@ -17,7 +17,7 @@ "use strict"; -var fluid = require("infusion"), +var fluid = require("gpii-universal"), ffi = require("ffi"); var gpii = fluid.registerNamespace("gpii"); @@ -149,13 +149,13 @@ gpii.windows.messages.messagePump = function (that) { var loop = function () { // sizeof(MSG) = 48 on 64-bit, 28 on 32-bit. - var msg = new Buffer(process.arch === "x64" ? 48 : 28); + var msg = Buffer.alloc(process.arch === "x64" ? 48 : 28); // Unable to use GetMessage because it blocks, and can't call via .async because it needs to be in the same // thread as the window. - while (gpii.windows.user32.PeekMessageW(msg.ref(), 0, 0, 0, 1)) { - gpii.windows.user32.TranslateMessage(msg.ref()); - gpii.windows.user32.DispatchMessageW(msg.ref()); + while (gpii.windows.user32.PeekMessageW(msg, 0, 0, 0, 1)) { + gpii.windows.user32.TranslateMessage(msg); + gpii.windows.user32.DispatchMessageW(msg); } if (that.messageWindow) {