mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-12 10:28:08 +00:00
[idd] helper: use separate log for child process
This commit is contained in:
@@ -34,9 +34,6 @@ static void Launch();
|
|||||||
|
|
||||||
int WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nShowCmd)
|
int WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nShowCmd)
|
||||||
{
|
{
|
||||||
g_debug.Init("looking-glass-iddhelper");
|
|
||||||
DEBUG_INFO("Looking Glass IDD Helper (" LG_VERSION_STR ")");
|
|
||||||
|
|
||||||
wchar_t buffer[MAX_PATH];
|
wchar_t buffer[MAX_PATH];
|
||||||
DWORD result = GetModuleFileName(NULL, buffer, MAX_PATH);
|
DWORD result = GetModuleFileName(NULL, buffer, MAX_PATH);
|
||||||
if (result == 0)
|
if (result == 0)
|
||||||
@@ -56,18 +53,19 @@ int WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _
|
|||||||
|
|
||||||
if (argc == 1)
|
if (argc == 1)
|
||||||
{
|
{
|
||||||
|
g_debug.Init("looking-glass-idd-service");
|
||||||
|
DEBUG_INFO("Looking Glass IDD Helper Service (" LG_VERSION_STR ")");
|
||||||
if (!HandleService())
|
if (!HandleService())
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// child process
|
|
||||||
if (argc != 2)
|
if (argc != 2)
|
||||||
{
|
|
||||||
// the one and only value we should see is the exit event name
|
|
||||||
DEBUG_ERROR("Invalid invocation");
|
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
|
||||||
|
// child process
|
||||||
|
g_debug.Init("looking-glass-idd-helper");
|
||||||
|
DEBUG_INFO("Looking Glass IDD Helper Process (" LG_VERSION_STR ")");
|
||||||
|
|
||||||
l_exitEvent.Attach(OpenEvent(SYNCHRONIZE, FALSE, args[1].c_str()));
|
l_exitEvent.Attach(OpenEvent(SYNCHRONIZE, FALSE, args[1].c_str()));
|
||||||
if (!l_exitEvent.IsValid())
|
if (!l_exitEvent.IsValid())
|
||||||
@@ -117,7 +115,8 @@ int WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _
|
|||||||
|
|
||||||
case WAIT_FAILED:
|
case WAIT_FAILED:
|
||||||
DEBUG_ERROR_HR(GetLastError(), "MsgWaitForMultipleObjects Failed");
|
DEBUG_ERROR_HR(GetLastError(), "MsgWaitForMultipleObjects Failed");
|
||||||
goto exit;
|
g_pipe.DeInit();
|
||||||
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user