https://blog.csdn.net/Leo_whj/article/details/109736449
https://github.com/microsoft/onnxruntime/issues/15025 @skottmckay @fdwr "Windows builds are not compatible with Windows 8.x in this release. Please use v1.11 for now." great news, I looked dependency walker with onnxruntime.dll v1.11.1, it seems it doesn't depends on api-ms-win-core-heap-l2-1-0.dll.
https://github.com/microsoft/onnxruntime/pull/10796
静态编译 ONNX RUNTIME https://github.com/csukuangfj/onnxruntime-libs
onnxruntime 兼容 win7 https://blog.csdn.net/weixin_40196536/article/details/134668960 HLOCAL __stdcall LocalAlloc(IN UINT uFlags, SIZE_T uBytes); // 17 LPVOID __stdcall LocalLock(IN HLOCAL hMem); // 18 HLOCAL __stdcall LocalFree(IN HLOCAL hMem);
// Imports from api-ms-win-core-heap-l2-1-0.dll
// ; Exported entry 17. LocalAlloc
// LocalAlloc db 'kernel32.LocalAlloc',0
// ; Exported entry 18. LocalFree
// LocalFree db 'kernel32.LocalFree',0
HLOCAL __stdcall LocalFree(HLOCAL hMem)
{
return __imp_LocalFree(hMem);
}
#include <Windows.h>
HLOCAL WINAPI MyLocalFree(HLOCAL hMem) {
if (hMem == NULL) {
return NULL; // 如果指针为空,直接返回
}
// 使用 Windows 的 HeapFree 函数来释放内存
HANDLE hHeap = GetProcessHeap(); // 获取默认的进程堆
if (!HeapFree(hHeap, 0, hMem)) {
SetLastError(ERROR_INVALID_HANDLE); // 设置错误码
return hMem; // 返回非 NULL 表示释放失败
}
return NULL; // 返回 NULL 表示释放成功
}
从这里下载的:https://github.com/microsoft/onnxruntime/issues/15025 api-ms-win-core-heap-l2-1-0.dll