WASM - SimConnect_EnumerateSimObjectsAndLiveries

Version: SU_XX (MSFS 2024 – 1.6.19.0)

Frequency: Consistently

Severity: Blocker

Context: WASM module loaded from Community folder

Bug description:

  1. Module type: Custom WASM (standalone module)
  2. Loaded from: Community
  3. Tested both in main menu and in flight
  4. Function triggered via fsCommBusRegister from a JavaScript UI
  5. Purpose: Retrieve list of available aircraft and liveries

When calling:
SimConnect_EnumerateSimObjectsAndLiveries(g_hSimConnect, REQUEST_ENUMERATE, SIMCONNECT_SIMOBJECT_TYPE_AIRCRAFT);

from a WASM module, the call fails and triggers:

SimConnect Exception 44 (Cannot find any matching simobject category)

even though valid aircraft are available in the sim.

This same code works perfectly when run from a standalone SimConnect client (native EXE), so the issue might be specific to the WASM sandbox environment — or perhaps I am doing something incorrectly in the WASM setup.

I’m not sure if this is an SDK/WASM limitation or a bug, but I’d appreciate any confirmation or clarification.
**
Repro steps:
**
Build and load the minimal WASM module below.

  1. Start MSFS 2024 and load any flight.
  2. Watch the WASM console or SimConnect Inspector.

Minimal Repro Code:

#include <stdio.h>
#include <MSFS/MSFS.h>
#include <MSFS/MSFS_WindowsTypes.h>
#include <MSFS/MSFS_CommBus.h>
#include <SimConnect.h>

static HANDLE g_hSimConnect = 0;

enum REQUEST_ID { REQUEST_ENUMERATE = 1 };

void CALLBACK SimConnectDispatchProc(SIMCONNECT_RECV* pData, DWORD cbData, void* pContext) {
    switch (pData->dwID) {
    case SIMCONNECT_RECV_ID_ENUMERATE_SIMOBJECT_AND_LIVERY_LIST: {
        auto* pEnum = (SIMCONNECT_RECV_ENUMERATE_SIMOBJECT_AND_LIVERY_LIST*)pData;
        printf("RequestID=%lu, page %lu/%lu with %lu entries\n",
            (unsigned long)pEnum->dwRequestID,
            (unsigned long)(pEnum->dwEntryNumber + 1),
            (unsigned long)pEnum->dwOutOf,
            (unsigned long)pEnum->dwArraySize);
        break;
    }
    }
}

static void EnumerateSimObjectsFromJS(const char* args, unsigned int size, void* ctx) {
    if (g_hSimConnect == 0)
        SimConnect_Open(&g_hSimConnect, "EnumTest", (HWND)0, 0, 0, 0);

    SimConnect_EnumerateSimObjectsAndLiveries(
        g_hSimConnect,
        REQUEST_ENUMERATE,
        SIMCONNECT_SIMOBJECT_TYPE_AIRCRAFT
    );
}

extern "C" MSFS_CALLBACK void module_init(void) {
    fsCommBusRegister("EnumerateSimObjects", EnumerateSimObjectsFromJS, nullptr);
}

extern "C" MSFS_CALLBACK void Update_StandAlone(float dTime) {
    if (g_hSimConnect != 0)
        SimConnect_CallDispatch(g_hSimConnect, SimConnectDispatchProc, nullptr);
}

extern "C" MSFS_CALLBACK void module_deinit(void) {
    if (g_hSimConnect != 0)
        SimConnect_Close(g_hSimConnect);
}

Console Output:

[WASM_SpawnWorldObject.wasm] [SpawnModule] Starting SimObjects enumeration...
[WASM_SpawnWorldObject.wasm] [SpawnModule] Enumeration request sent with RequestID=1
[WASM_SpawnWorldObject.wasm] [SpawnModule] Dispatch received: dwID=1, dwSize=24
[WASM_SpawnWorldObject.wasm] [SpawnModule] SimConnect Exception: 44 (SendID: 2)

SimConnect Inspector:

EnumerateSimObjectsAndLiveries: ID = 1 Type=-1750743312 EXCEPTION Cannot find any matching simobject category

Works fine from an external SimConnect EXE.

  1. Always fails from WASM.
  2. Possibly due to a sandbox or context limitation.
  3. Might also be a usage mistake on my side — I’d appreciate any insight or confirmation from the SDK team.
1 Like

Hello and thank you for the details,

A fix is in the making.
I will let you know when I have more news to share.

Regards,
Boris

2 Likes

Hello @DeelLav ,
This should be fixed in the last SU4 flighting 1.6.25.0
Can you confirm ?

Regards,
Boris

I just tested it and it works fine, it returns the list via WASM.
Thank you very much.

1 Like

Thank you for the feedback :slight_smile:

Regards,
Boris