C3/Src/NodeRelayDll/NodeRelayDll.cpp

34 lines
816 B
C++
Raw Normal View History

2019-09-02 10:28:14 +00:00
#include "StdAfx.h"
/// Entry point of the the library.
BOOL WINAPI DllMain(HINSTANCE, DWORD, LPVOID)
{
// Indicate successful load of the library.
return TRUE;
}
/// Starts a NodeRelay.
/// @param leaveImmediately if false then waits for Relay to be shut down internally by a C3 API Command.
extern "C" __declspec(dllexport) void StartNodeRelay()
2019-09-02 10:28:14 +00:00
{
2020-03-05 15:30:50 +00:00
FSecure::WinTools::StructuredExceptionHandling::SehWrapper(
[]()
2019-09-02 10:28:14 +00:00
{
try
{
2020-03-05 15:30:50 +00:00
auto relay = FSecure::C3::Utils::CreateNodeRelayFromImagePatch(
2020-03-06 14:23:57 +00:00
[](FSecure::C3::LogMessage const&, std::string_view) {},
2020-03-05 15:30:50 +00:00
FSecure::C3::InterfaceFactory::Instance(),
2019-09-02 10:28:14 +00:00
EmbeddedData::Instance()[0],
EmbeddedData::Instance()[1],
EmbeddedData::Instance()[2],
EmbeddedData::Instance().FindMatching(3));
relay->Join();
2019-09-02 10:28:14 +00:00
}
catch (...)
{
}
}, []() {});
}