Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions winml/test/api/raw/winml_microsoft.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ inline HRESULT GetActivationFactory(
{
// Fallback to OS binary if the redistributable is not present!
auto library = LoadLibraryExW(MachineLearningDll, nullptr, 0);
if (library == nullptr)
{
return HRESULT_FROM_WIN32(GetLastError());
}

using DllGetActivationFactory = HRESULT __stdcall(HSTRING, void** factory);
auto call = reinterpret_cast<DllGetActivationFactory*>(GetProcAddress(library, "DllGetActivationFactory"));
Expand Down
3 changes: 3 additions & 0 deletions winml/test/scenario/cppwinrt/CustomOperatorProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "NoisyReluCpu.h"
#include "ReluCpu.h"
#include <winnt.h>

struct CustomOperatorProvider :
winrt::implements<
Expand All @@ -26,6 +27,8 @@ struct CustomOperatorProvider :
#elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PC_APP)
m_library = LoadPackagedLibrary(winml_dll_name.c_str(), 0 /*Reserved*/);
#endif
WINML_EXPECT_TRUE(m_library != 0);

using create_registry_delegate = HRESULT WINAPI (_COM_Outptr_ IMLOperatorRegistry** registry);
auto create_registry = reinterpret_cast<create_registry_delegate*>(GetProcAddress(m_library, "MLCreateOperatorRegistry"));
if (FAILED(create_registry(m_registry.put())))
Expand Down