From: Alex Henrie alexhenrie24@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47206 --- dlls/mscoree/mscoree.spec | 2 +- dlls/mscoree/mscoree_main.c | 6 ++++++ dlls/mscoree/tests/mscoree.c | 16 ++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/dlls/mscoree/mscoree.spec b/dlls/mscoree/mscoree.spec index 92e0f60b718..280a36275f2 100644 --- a/dlls/mscoree/mscoree.spec +++ b/dlls/mscoree/mscoree.spec @@ -57,7 +57,7 @@ @ stub GetMetaDataPublicInterfaceFromInternal @ stub GetPermissionRequests @ stub GetPrivateContextsPerfCounters -@ stub GetProcessExecutableHeap +@ stdcall GetProcessExecutableHeap() @ stdcall GetRealProcAddress(str ptr) @ stdcall GetRequestedRuntimeInfo(wstr wstr wstr long long ptr long ptr ptr long ptr) @ stdcall GetRequestedRuntimeVersion(wstr ptr long ptr) diff --git a/dlls/mscoree/mscoree_main.c b/dlls/mscoree/mscoree_main.c index a1bc8883787..a4355684596 100644 --- a/dlls/mscoree/mscoree_main.c +++ b/dlls/mscoree/mscoree_main.c @@ -436,6 +436,12 @@ HRESULT WINAPI GetRealProcAddress(LPCSTR procname, void **ppv) return CLR_E_SHIM_RUNTIMEEXPORT; }
+HANDLE WINAPI GetProcessExecutableHeap(void) +{ + FIXME("semi-stub\n"); + return GetProcessHeap(); +} + HRESULT WINAPI GetFileVersion(LPCWSTR szFilename, LPWSTR szBuffer, DWORD cchBuffer, DWORD *dwLength) { TRACE("(%s, %p, %ld, %p)\n", debugstr_w(szFilename), szBuffer, cchBuffer, dwLength); diff --git a/dlls/mscoree/tests/mscoree.c b/dlls/mscoree/tests/mscoree.c index 36594972866..53823eb62eb 100644 --- a/dlls/mscoree/tests/mscoree.c +++ b/dlls/mscoree/tests/mscoree.c @@ -48,6 +48,7 @@ static HRESULT (WINAPI *pLoadLibraryShim)(LPCWSTR, LPCWSTR, LPVOID, HMODULE*); static HRESULT (WINAPI *pCreateConfigStream)(LPCWSTR, IStream**); static HRESULT (WINAPI *pCreateInterface)(REFCLSID, REFIID, VOID**); static HRESULT (WINAPI *pCLRCreateInstance)(REFCLSID, REFIID, VOID**); +static HANDLE (WINAPI *pGetProcessExecutableHeap)(void);
static BOOL no_legacy_runtimes;
@@ -69,6 +70,7 @@ static BOOL init_functionpointers(void) pCreateConfigStream = (void *)GetProcAddress(hmscoree, "CreateConfigStream"); pCreateInterface = (void *)GetProcAddress(hmscoree, "CreateInterface"); pCLRCreateInstance = (void *)GetProcAddress(hmscoree, "CLRCreateInstance"); + pGetProcessExecutableHeap = (void *)GetProcAddress(hmscoree, "GetProcessExecutableHeap");
if (!pGetCORVersion || !pGetCORSystemDirectory || !pGetRequestedRuntimeInfo || !pLoadLibraryShim || !pCreateInterface || !pCLRCreateInstance || !pCorIsLatestSvc @@ -808,6 +810,19 @@ static void test_loadpaths(BOOL neutral) ok(ret, "DeleteFileW failed: %lu\n", GetLastError()); }
+static void test_getprocessexecutableheap(void) +{ + HANDLE heap; + void *buf; + + heap = pGetProcessExecutableHeap(); + ok(!!heap, "GetProcessExecutableHeap returned null\n"); + + buf = HeapAlloc(heap, 0, 4); + ok(!!buf, "HeapAlloc returned null\n"); + HeapFree(heap, 0, buf); +} + static void test_createdomain(void) { static const WCHAR test_name[] = {'t','e','s','t',0}; @@ -914,6 +929,7 @@ START_TEST(mscoree) test_loadlibraryshim(); test_createconfigstream(); test_createinstance(); + test_getprocessexecutableheap();
if (runtime_is_usable()) {
This should probably return `dll_fixup_heap`.
But also: this function isn't going to be worth much if it only comes up when .NET Framework is installed. Builtin mscoree isn't going to work with .NET Framework.
This merge request was closed by Esme Povirk.
Closing because there's no reason to believe a real application needs this. .NET Framework, including the dotnet9x port, should use builtin mscoree.