From d180bc6df297422f189ffd08a0dd558bfbeba1ca Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 15 Jan 2023 19:17:29 -0600 Subject: Add netfx:DotNetCoreSdkFeatureBandSearch. 7058 --- src/ext/NetFx/be/detectnetcore.cpp | 91 ++------------------ src/ext/NetFx/be/detectnetcoresdk.cpp | 99 +++------------------- src/ext/NetFx/be/detectnetcoresdkfeatureband.cpp | 55 ++++++++++++ src/ext/NetFx/be/detectnetcoresdkfeatureband.h | 9 ++ src/ext/NetFx/be/netfxbe.vcxproj | 4 + src/ext/NetFx/be/netfxsearch.cpp | 32 ++++++- src/ext/NetFx/be/netfxsearch.h | 10 ++- src/ext/NetFx/be/precomp.h | 2 + src/ext/NetFx/be/runnetcoresearch.cpp | 102 +++++++++++++++++++++++ src/ext/NetFx/be/runnetcoresearch.h | 9 ++ 10 files changed, 238 insertions(+), 175 deletions(-) create mode 100644 src/ext/NetFx/be/detectnetcoresdkfeatureband.cpp create mode 100644 src/ext/NetFx/be/detectnetcoresdkfeatureband.h create mode 100644 src/ext/NetFx/be/runnetcoresearch.cpp create mode 100644 src/ext/NetFx/be/runnetcoresearch.h (limited to 'src/ext/NetFx/be') diff --git a/src/ext/NetFx/be/detectnetcore.cpp b/src/ext/NetFx/be/detectnetcore.cpp index aeb04203..3ed26549 100644 --- a/src/ext/NetFx/be/detectnetcore.cpp +++ b/src/ext/NetFx/be/detectnetcore.cpp @@ -12,18 +12,7 @@ HRESULT DetectNetCore( { HRESULT hr = S_OK; LPCWSTR wzRuntimeType = NULL; - LPCWSTR wzPlatformName = NULL; - LPWSTR sczExePath = NULL; - LPWSTR sczCommandLine = NULL; - HANDLE hProcess = NULL; - HANDLE hStdOutErr = INVALID_HANDLE_VALUE; - BYTE* rgbOutput = NULL; - DWORD cbOutput = 0; - DWORD cbTotalRead = 0; - DWORD cbRead = 0; - DWORD dwExitCode = 0; - - ReleaseNullStr(*psczLatestVersion); + LPWSTR sczArguments = NULL; switch (runtimeType) { @@ -41,80 +30,14 @@ HRESULT DetectNetCore( break; } - switch (platform) - { - case NETFX_NET_CORE_PLATFORM_ARM64: - wzPlatformName = L"arm64"; - break; - case NETFX_NET_CORE_PLATFORM_X64: - wzPlatformName = L"x64"; - break; - case NETFX_NET_CORE_PLATFORM_X86: - wzPlatformName = L"x86"; - break; - default: - BextExitWithRootFailure(hr, E_INVALIDARG, "Unknown platform: %u", platform); - break; - } - - hr = StrAllocFormatted(&sczExePath, L"%ls%ls\\netcoresearch.exe", wzBaseDirectory, wzPlatformName); - BextExitOnFailure(hr, "Failed to build netcoresearch.exe path."); - - hr = StrAllocFormatted(&sczCommandLine, L"\"%ls\" runtime %ls %ls", sczExePath, wzMajorVersion, wzRuntimeType); - BextExitOnFailure(hr, "Failed to build netcoresearch.exe command line."); - - hr = ProcExecute(sczExePath, sczCommandLine, &hProcess, NULL, &hStdOutErr); - if (HRESULT_FROM_WIN32(ERROR_EXE_MACHINE_TYPE_MISMATCH) == hr) - { - ExitFunction1(hr = S_FALSE); - } - BextExitOnFailure(hr, "Failed to run: %ls", sczCommandLine); - - cbOutput = 64; + hr = StrAllocFormatted(&sczArguments, L"runtime %ls %ls", wzMajorVersion, wzRuntimeType); + BextExitOnFailure(hr, "Failed to build runtime netcoresearch.exe arguments."); - rgbOutput = reinterpret_cast(MemAlloc(cbOutput, TRUE)); - BextExitOnNull(rgbOutput, hr, E_OUTOFMEMORY, "Failed to alloc output string."); - - while (::ReadFile(hStdOutErr, rgbOutput + cbTotalRead, cbOutput - cbTotalRead, &cbRead, NULL)) - { - cbTotalRead += cbRead; - - if (cbTotalRead == cbOutput) - { - cbOutput *= 2; - - LPVOID pvNew = MemReAlloc(rgbOutput, cbOutput, TRUE); - BextExitOnNull(pvNew, hr, E_OUTOFMEMORY, "Failed to realloc output string."); - - rgbOutput = reinterpret_cast(pvNew); - } - } - - if (ERROR_BROKEN_PIPE != ::GetLastError()) - { - BextExitWithLastError(hr, "Failed to read netcoresearch.exe output."); - } - - hr = ProcWaitForCompletion(hProcess, INFINITE, &dwExitCode); - BextExitOnFailure(hr, "Failed to wait for netcoresearch.exe to exit."); - - if (0 != dwExitCode) - { - BextExitWithRootFailure(hr, E_UNEXPECTED, "netcoresearch.exe failed with exit code: 0x%x\r\nOutput:\r\n%hs", dwExitCode, rgbOutput); - } - - if (*rgbOutput) - { - hr = StrAllocStringAnsi(psczLatestVersion, reinterpret_cast(rgbOutput), 0, CP_UTF8); - BextExitOnFailure(hr, "Failed to widen output string: %hs", rgbOutput); - } + hr = RunNetCoreSearch(platform, wzBaseDirectory, sczArguments, psczLatestVersion); + BextExitOnFailure(hr, "Failed to run netcoresearch.exe for runtime."); LExit: - ReleaseFileHandle(hStdOutErr); - ReleaseHandle(hProcess); - ReleaseMem(rgbOutput); - ReleaseStr(sczCommandLine); - ReleaseStr(sczExePath); + ReleaseStr(sczArguments); return hr; } @@ -136,5 +59,7 @@ HRESULT NetfxPerformDetectNetCore( BextExitOnFailure(hr, "Failed to set variable '%ls' to '%ls'", wzVariable, sczLatestVersion); LExit: + ReleaseStr(sczLatestVersion); + return hr; } diff --git a/src/ext/NetFx/be/detectnetcoresdk.cpp b/src/ext/NetFx/be/detectnetcoresdk.cpp index 08b18334..332d8712 100644 --- a/src/ext/NetFx/be/detectnetcoresdk.cpp +++ b/src/ext/NetFx/be/detectnetcoresdk.cpp @@ -4,99 +4,22 @@ HRESULT DetectNetCoreSdk( __in NETFX_NET_CORE_PLATFORM platform, - __in LPCWSTR wzVersion, + __in LPCWSTR wzMajorVersion, __in LPCWSTR wzBaseDirectory, __inout LPWSTR* psczLatestVersion ) { HRESULT hr = S_OK; - LPCWSTR wzPlatformName = NULL; - LPWSTR sczExePath = NULL; - LPWSTR sczCommandLine = NULL; - HANDLE hProcess = NULL; - HANDLE hStdOutErr = INVALID_HANDLE_VALUE; - BYTE* rgbOutput = NULL; - DWORD cbOutput = 0; - DWORD cbTotalRead = 0; - DWORD cbRead = 0; - DWORD dwExitCode = 0; + LPWSTR sczArguments = NULL; - ReleaseNullStr(*psczLatestVersion); + hr = StrAllocFormatted(&sczArguments, L"sdk %ls", wzMajorVersion); + BextExitOnFailure(hr, "Failed to build sdk netcoresearch.exe arguments."); - switch (platform) - { - case NETFX_NET_CORE_PLATFORM_ARM64: - wzPlatformName = L"arm64"; - break; - case NETFX_NET_CORE_PLATFORM_X64: - wzPlatformName = L"x64"; - break; - case NETFX_NET_CORE_PLATFORM_X86: - wzPlatformName = L"x86"; - break; - default: - BextExitWithRootFailure(hr, E_INVALIDARG, "Unknown platform: %u", platform); - break; - } - - hr = StrAllocFormatted(&sczExePath, L"%ls%ls\\netcoresearch.exe", wzBaseDirectory, wzPlatformName); - BextExitOnFailure(hr, "Failed to build netcoresearch.exe path."); - - hr = StrAllocFormatted(&sczCommandLine, L"\"%ls\" sdk %ls", sczExePath, wzVersion); - BextExitOnFailure(hr, "Failed to build netcoresearch.exe command line."); - - hr = ProcExecute(sczExePath, sczCommandLine, &hProcess, NULL, &hStdOutErr); - if (HRESULT_FROM_WIN32(ERROR_EXE_MACHINE_TYPE_MISMATCH) == hr) - { - ExitFunction1(hr = S_FALSE); - } - BextExitOnFailure(hr, "Failed to run: %ls", sczCommandLine); - - cbOutput = 64; - - rgbOutput = static_cast(MemAlloc(cbOutput, TRUE)); - BextExitOnNull(rgbOutput, hr, E_OUTOFMEMORY, "Failed to alloc output string."); - - while (::ReadFile(hStdOutErr, rgbOutput + cbTotalRead, cbOutput - cbTotalRead, &cbRead, NULL)) - { - cbTotalRead += cbRead; - - if (cbTotalRead == cbOutput) - { - cbOutput *= 2; - - const LPVOID pvNew = MemReAlloc(rgbOutput, cbOutput, TRUE); - BextExitOnNull(pvNew, hr, E_OUTOFMEMORY, "Failed to realloc output string."); - - rgbOutput = static_cast(pvNew); - } - } - - if (ERROR_BROKEN_PIPE != ::GetLastError()) - { - BextExitWithLastError(hr, "Failed to read netcoresearch.exe output."); - } - - hr = ProcWaitForCompletion(hProcess, INFINITE, &dwExitCode); - BextExitOnFailure(hr, "Failed to wait for netcoresearch.exe to exit."); - - if (0 != dwExitCode) - { - BextExitWithRootFailure(hr, E_UNEXPECTED, "netcoresearch.exe failed with exit code: 0x%x\r\nOutput:\r\n%hs", dwExitCode, rgbOutput); - } - - if (*rgbOutput) - { - hr = StrAllocStringAnsi(psczLatestVersion, reinterpret_cast(rgbOutput), 0, CP_UTF8); - BextExitOnFailure(hr, "Failed to widen output string: %hs", rgbOutput); - } + hr = RunNetCoreSearch(platform, wzBaseDirectory, sczArguments, psczLatestVersion); + BextExitOnFailure(hr, "Failed to run netcoresearch.exe for sdk."); LExit: - ReleaseFileHandle(hStdOutErr); - ReleaseHandle(hProcess); - ReleaseMem(rgbOutput); - ReleaseStr(sczCommandLine); - ReleaseStr(sczExePath); + ReleaseStr(sczArguments); return hr; } @@ -109,14 +32,16 @@ HRESULT NetfxPerformDetectNetCoreSdk( ) { HRESULT hr = S_OK; - LPWSTR sczLatestVersion = nullptr; - const auto& searchParams = pSearch->NetCoreSdkSearch; - hr = DetectNetCoreSdk(searchParams.platform, searchParams.sczVersion, wzBaseDirectory, &sczLatestVersion); + LPWSTR sczLatestVersion = NULL; + + hr = DetectNetCoreSdk(pSearch->NetCoreSdkSearch.platform, pSearch->NetCoreSdkSearch.sczMajorVersion, wzBaseDirectory, &sczLatestVersion); BextExitOnFailure(hr, "DetectNetCoreSdk failed."); hr = pEngine->SetVariableVersion(wzVariable, sczLatestVersion); BextExitOnFailure(hr, "Failed to set variable '%ls' to '%ls'", wzVariable, sczLatestVersion); LExit: + ReleaseStr(sczLatestVersion); + return hr; } diff --git a/src/ext/NetFx/be/detectnetcoresdkfeatureband.cpp b/src/ext/NetFx/be/detectnetcoresdkfeatureband.cpp new file mode 100644 index 00000000..d48c7a85 --- /dev/null +++ b/src/ext/NetFx/be/detectnetcoresdkfeatureband.cpp @@ -0,0 +1,55 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +#include "precomp.h" + +HRESULT DetectNetCoreSdkFeatureBand( + __in NETFX_NET_CORE_PLATFORM platform, + __in LPCWSTR wzMajorVersion, + __in LPCWSTR wzMinorVersion, + __in LPCWSTR wzPatchVersion, + __in LPCWSTR wzBaseDirectory, + __inout LPWSTR* psczLatestVersion + ) +{ + HRESULT hr = S_OK; + LPWSTR sczArguments = NULL; + + hr = StrAllocFormatted(&sczArguments, L"sdkfeatureband %ls %ls %ls", wzMajorVersion, wzMinorVersion, wzPatchVersion); + BextExitOnFailure(hr, "Failed to build sdkfeatureband netcoresearch.exe arguments."); + + hr = RunNetCoreSearch(platform, wzBaseDirectory, sczArguments, psczLatestVersion); + BextExitOnFailure(hr, "Failed to run netcoresearch.exe for sdkfeatureband."); + +LExit: + ReleaseStr(sczArguments); + + return hr; +} + +HRESULT NetfxPerformDetectNetCoreSdkFeatureBand( + __in LPCWSTR wzVariable, + __in NETFX_SEARCH* pSearch, + __in IBundleExtensionEngine* pEngine, + __in LPCWSTR wzBaseDirectory + ) +{ + HRESULT hr = S_OK; + LPWSTR sczLatestVersion = NULL; + + hr = DetectNetCoreSdkFeatureBand( + pSearch->NetCoreSdkFeatureBandSearch.platform, + pSearch->NetCoreSdkFeatureBandSearch.sczMajorVersion, + pSearch->NetCoreSdkFeatureBandSearch.sczMinorVersion, + pSearch->NetCoreSdkFeatureBandSearch.sczPatchVersion, + wzBaseDirectory, + &sczLatestVersion); + BextExitOnFailure(hr, "DetectNetCoreSdkFeatureBand failed."); + + hr = pEngine->SetVariableVersion(wzVariable, sczLatestVersion); + BextExitOnFailure(hr, "Failed to set variable '%ls' to '%ls'", wzVariable, sczLatestVersion); + +LExit: + ReleaseStr(sczLatestVersion); + + return hr; +} diff --git a/src/ext/NetFx/be/detectnetcoresdkfeatureband.h b/src/ext/NetFx/be/detectnetcoresdkfeatureband.h new file mode 100644 index 00000000..1f92cd58 --- /dev/null +++ b/src/ext/NetFx/be/detectnetcoresdkfeatureband.h @@ -0,0 +1,9 @@ +#pragma once +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +HRESULT NetfxPerformDetectNetCoreSdkFeatureBand( + __in LPCWSTR wzVariable, + __in NETFX_SEARCH* pSearch, + __in IBundleExtensionEngine* pEngine, + __in LPCWSTR wzBaseDirectory + ); diff --git a/src/ext/NetFx/be/netfxbe.vcxproj b/src/ext/NetFx/be/netfxbe.vcxproj index 0408da72..94026960 100644 --- a/src/ext/NetFx/be/netfxbe.vcxproj +++ b/src/ext/NetFx/be/netfxbe.vcxproj @@ -48,20 +48,24 @@ + Create + + + diff --git a/src/ext/NetFx/be/netfxsearch.cpp b/src/ext/NetFx/be/netfxsearch.cpp index 671e7546..ffbf6ee0 100644 --- a/src/ext/NetFx/be/netfxsearch.cpp +++ b/src/ext/NetFx/be/netfxsearch.cpp @@ -15,7 +15,7 @@ STDMETHODIMP NetfxSearchParseFromXml( BSTR bstrNodeName = NULL; // Select Netfx search nodes. - hr = XmlSelectNodes(pixnBundleExtension, L"NetFxNetCoreSearch|NetFxNetCoreSdkSearch", &pixnNodes); + hr = XmlSelectNodes(pixnBundleExtension, L"NetFxNetCoreSearch|NetFxNetCoreSdkSearch|NetFxNetCoreSdkFeatureBandSearch", &pixnNodes); BextExitOnFailure(hr, "Failed to select Netfx search nodes."); // Get Netfx search node count. @@ -72,9 +72,30 @@ STDMETHODIMP NetfxSearchParseFromXml( hr = XmlGetAttributeUInt32(pixnNode, L"Platform", reinterpret_cast(&netCoreSdkSearch.platform)); BextExitOnFailure(hr, "Failed to get @Platform."); - // @Version - hr = XmlGetAttributeEx(pixnNode, L"Version", &netCoreSdkSearch.sczVersion); - BextExitOnFailure(hr, "Failed to get @Version."); + // @MajorVersion + hr = XmlGetAttributeEx(pixnNode, L"MajorVersion", &netCoreSdkSearch.sczMajorVersion); + BextExitOnFailure(hr, "Failed to get @MajorVersion."); + } + else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, bstrNodeName, -1, L"NetFxNetCoreSdkFeatureBandSearch", -1)) + { + pSearch->Type = NETFX_SEARCH_TYPE_NET_CORE_SDK_FEATURE_BAND_SEARCH; + + auto& netCoreSdkSearch = pSearch->NetCoreSdkFeatureBandSearch; + // @Platform + hr = XmlGetAttributeUInt32(pixnNode, L"Platform", reinterpret_cast(&netCoreSdkSearch.platform)); + BextExitOnFailure(hr, "Failed to get @Platform."); + + // @MajorVersion + hr = XmlGetAttributeEx(pixnNode, L"MajorVersion", &netCoreSdkSearch.sczMajorVersion); + BextExitOnFailure(hr, "Failed to get @MajorVersion."); + + // @MinorVersion + hr = XmlGetAttributeEx(pixnNode, L"MinorVersion", &netCoreSdkSearch.sczMinorVersion); + BextExitOnFailure(hr, "Failed to get @MinorVersion."); + + // @PatchVersion + hr = XmlGetAttributeEx(pixnNode, L"PatchVersion", &netCoreSdkSearch.sczPatchVersion); + BextExitOnFailure(hr, "Failed to get @PatchVersion."); } else { @@ -132,6 +153,9 @@ STDMETHODIMP NetfxSearchExecute( case NETFX_SEARCH_TYPE_NET_CORE_SDK_SEARCH: hr = NetfxPerformDetectNetCoreSdk(wzVariable, pSearch, pEngine, wzBaseDirectory); break; + case NETFX_SEARCH_TYPE_NET_CORE_SDK_FEATURE_BAND_SEARCH: + hr = NetfxPerformDetectNetCoreSdkFeatureBand(wzVariable, pSearch, pEngine, wzBaseDirectory); + break; default: hr = E_UNEXPECTED; } diff --git a/src/ext/NetFx/be/netfxsearch.h b/src/ext/NetFx/be/netfxsearch.h index f4e4db01..5793dd55 100644 --- a/src/ext/NetFx/be/netfxsearch.h +++ b/src/ext/NetFx/be/netfxsearch.h @@ -9,6 +9,7 @@ enum NETFX_SEARCH_TYPE NETFX_SEARCH_TYPE_NONE, NETFX_SEARCH_TYPE_NET_CORE_SEARCH, NETFX_SEARCH_TYPE_NET_CORE_SDK_SEARCH, + NETFX_SEARCH_TYPE_NET_CORE_SDK_FEATURE_BAND_SEARCH, }; enum NETFX_NET_CORE_RUNTIME_TYPE @@ -44,8 +45,15 @@ typedef struct _NETFX_SEARCH struct { NETFX_NET_CORE_PLATFORM platform; - LPWSTR sczVersion; + LPWSTR sczMajorVersion; } NetCoreSdkSearch; + struct + { + NETFX_NET_CORE_PLATFORM platform; + LPWSTR sczMajorVersion; + LPWSTR sczMinorVersion; + LPWSTR sczPatchVersion; + } NetCoreSdkFeatureBandSearch; }; } NETFX_SEARCH; diff --git a/src/ext/NetFx/be/precomp.h b/src/ext/NetFx/be/precomp.h index 4a774200..c164834d 100644 --- a/src/ext/NetFx/be/precomp.h +++ b/src/ext/NetFx/be/precomp.h @@ -31,4 +31,6 @@ #include "netfxsearch.h" #include "detectnetcore.h" #include "detectnetcoresdk.h" +#include "detectnetcoresdkfeatureband.h" #include "NetfxBundleExtension.h" +#include "runnetcoresearch.h" diff --git a/src/ext/NetFx/be/runnetcoresearch.cpp b/src/ext/NetFx/be/runnetcoresearch.cpp new file mode 100644 index 00000000..8f38e0d2 --- /dev/null +++ b/src/ext/NetFx/be/runnetcoresearch.cpp @@ -0,0 +1,102 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +#include "precomp.h" + +HRESULT RunNetCoreSearch( + __in NETFX_NET_CORE_PLATFORM platform, + __in LPCWSTR wzBaseDirectory, + __in LPCWSTR wzArguments, + __inout LPWSTR* psczLatestVersion + ) +{ + HRESULT hr = S_OK; + LPCWSTR wzPlatformName = NULL; + LPWSTR sczExePath = NULL; + LPWSTR sczCommandLine = NULL; + HANDLE hProcess = NULL; + HANDLE hStdOutErr = INVALID_HANDLE_VALUE; + BYTE* rgbOutput = NULL; + DWORD cbOutput = 0; + DWORD cbTotalRead = 0; + DWORD cbRead = 0; + DWORD dwExitCode = 0; + + ReleaseNullStr(*psczLatestVersion); + + switch (platform) + { + case NETFX_NET_CORE_PLATFORM_ARM64: + wzPlatformName = L"arm64"; + break; + case NETFX_NET_CORE_PLATFORM_X64: + wzPlatformName = L"x64"; + break; + case NETFX_NET_CORE_PLATFORM_X86: + wzPlatformName = L"x86"; + break; + default: + BextExitWithRootFailure(hr, E_INVALIDARG, "Unknown platform: %u", platform); + break; + } + + hr = StrAllocFormatted(&sczExePath, L"%ls%ls\\netcoresearch.exe", wzBaseDirectory, wzPlatformName); + BextExitOnFailure(hr, "Failed to build netcoresearch.exe path."); + + hr = StrAllocFormatted(&sczCommandLine, L"\"%ls\" %ls", sczExePath, wzArguments); + BextExitOnFailure(hr, "Failed to build netcoresearch.exe command line."); + + hr = ProcExecute(sczExePath, sczCommandLine, &hProcess, NULL, &hStdOutErr); + if (HRESULT_FROM_WIN32(ERROR_EXE_MACHINE_TYPE_MISMATCH) == hr) + { + ExitFunction1(hr = S_FALSE); + } + BextExitOnFailure(hr, "Failed to run: %ls", sczCommandLine); + + cbOutput = 64; + + rgbOutput = reinterpret_cast(MemAlloc(cbOutput, TRUE)); + BextExitOnNull(rgbOutput, hr, E_OUTOFMEMORY, "Failed to alloc output string."); + + while (::ReadFile(hStdOutErr, rgbOutput + cbTotalRead, cbOutput - cbTotalRead, &cbRead, NULL)) + { + cbTotalRead += cbRead; + + if (cbTotalRead == cbOutput) + { + cbOutput *= 2; + + LPVOID pvNew = MemReAlloc(rgbOutput, cbOutput, TRUE); + BextExitOnNull(pvNew, hr, E_OUTOFMEMORY, "Failed to realloc output string."); + + rgbOutput = reinterpret_cast(pvNew); + } + } + + if (ERROR_BROKEN_PIPE != ::GetLastError()) + { + BextExitWithLastError(hr, "Failed to read netcoresearch.exe output."); + } + + hr = ProcWaitForCompletion(hProcess, INFINITE, &dwExitCode); + BextExitOnFailure(hr, "Failed to wait for netcoresearch.exe to exit."); + + if (0 != dwExitCode) + { + BextExitWithRootFailure(hr, E_UNEXPECTED, "netcoresearch.exe failed with exit code: 0x%x\r\nOutput:\r\n%hs", dwExitCode, rgbOutput); + } + + if (*rgbOutput) + { + hr = StrAllocStringAnsi(psczLatestVersion, reinterpret_cast(rgbOutput), 0, CP_UTF8); + BextExitOnFailure(hr, "Failed to widen output string: %hs", rgbOutput); + } + +LExit: + ReleaseFileHandle(hStdOutErr); + ReleaseHandle(hProcess); + ReleaseMem(rgbOutput); + ReleaseStr(sczCommandLine); + ReleaseStr(sczExePath); + + return hr; +} diff --git a/src/ext/NetFx/be/runnetcoresearch.h b/src/ext/NetFx/be/runnetcoresearch.h new file mode 100644 index 00000000..78e6b24a --- /dev/null +++ b/src/ext/NetFx/be/runnetcoresearch.h @@ -0,0 +1,9 @@ +#pragma once +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +HRESULT RunNetCoreSearch( + __in NETFX_NET_CORE_PLATFORM platform, + __in LPCWSTR wzBaseDirectory, + __in LPCWSTR wzArguments, + __inout LPWSTR* psczLatestVersion + ); -- cgit v1.2.3-55-g6feb