<commit_before>self.onmessage = function(msg) {
  self.postMessage('hello ' + msg.data);
};

self.onerror = function(msg) {
  self.postMessage('error: ' + msg);
};

var user32 = ctypes.open("user32.dll");
var msgBox = user32.declare("MessageBoxW",
                         ctypes.winapi_abi,
                         ctypes.int32_t,
                         ctypes.int32_t,
                         ctypes.jschar.ptr,
                         ctypes.jschar.ptr,
                         ctypes.int32_t);


var MB_OK = 0;
var ret = msgBox(0, "Hello world", "title", MB_OK);

user32.close();<commit_msg>try to call but crashes firefox<commit_after>self.onerror = function(msg) {
  self.postMessage('error: ' + msg);
};

self.onmessage = function(msg) {
  self.postMessage('hello ' + msg.data);
};

self.postMessage('importing...');
importScripts("resource://gre/modules/workers/require.js");
importScripts("resource://somnus/data/ostypes/ostypes_win.jsm");
self.postMessage('imported');
var MB_OK = 0;

var ret = ostypes.API('MessageBox')(ostypes.TYPE.HWND(0), "Hello world", "title", MB_OK);

function jsCallback(lpParameter, TimerOrWaitFired) {
  self.postMessage('lpParameter: ' + lpParameter);
  self.PostMessage('TimerOrWaitFired: ' + TimerOrWaitFired);
  return undefined;
}
cCallback = ostypes.TYPE.WAITORTIMERCALLBACK.ptr(jsCallback);
var mynumber = ctypes.uint32_t(7);
var hNewTimer = ostypes.TYPE.HANDLE(0);
ret = ostypes.API('CreateTimerQueueTimer')(
  hNewTimer.address(),
  null,
  cCallback,
  null,
  5000,
  0,
  0x00000000
);
{'fraction_non_alphanumeric': 0.15, 'fraction_numerical': 0.023376623376623377, 'mean_word_length': 3.2924791086350975, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1248963', 'n_tokens_mistral': 553, 'n_tokens_neox': 524, 'n_words': 83}