VMK API, vmk_RWSemaCreate()->0bad0120,模块没有可从中分配的堆

VMK API, vmk_RWSemaCreate()->0bad0120, Module has no heap to allocate from

您好! 尝试使用 VMKAPI ...

...

if ( VMK_OK != (rs = vmk_ModuleRegister(&g_module_id, VMKAPI_REVISION)) )
        return  $LOG(VMK_LOG_URGENCY_ALERT, rs, "vmk_ModuleRegister()->%08x, %s", rs, vmk_StatusToString(rs));

...
    props.module    = g_module_id;
    props.type  = VMK_HEAP_TYPE_SIMPLE;
    props.initial   = g_mem_heap_min;
    props.max   = g_mem_heap_max;
    props.creationTimeoutMS = VMK_TIMEOUT_UNLIMITED_MS;


    if ( VMK_OK != (rs = vmk_HeapCreate(&props, &g_mem_heap_id)) )
        return  $LOG(VMK_LOG_URGENCY_ALERT, rs, "vmk_HeapCreate(%s)->%08x, %s", g_mem_heap_name, rs, vmk_StatusToString(rs));

...

    {
    vmk_SemaphoreRW semarw = {0};

    if ( VMK_OK != (rs = vmk_RWSemaCreate(&semarw, g_module_id, "BMF$SEMARW")) )
        return  $LOG(VMK_LOG_URGENCY_ALERT, rs, "vmk_RWSemaCreate()->%08x, %s", rs, vmk_StatusToString(rs));

    vmk_RWSemaReadLock(&semarw);

    vmk_RWSemaReadUnlock(&semarw);

    vmk_RWSemaDestroy(&semarw);
    }

出现错误:vmk_RWSemaCreate()->0bad0120,模块没有可分配的堆。 有什么想法吗?

解决者 vmk_ModuleSetHeapID(模块,堆);