Log("====>");
+ // If there is no executable, this thread can finish now.
+ if (Context->Executable == NULL)
+ goto done;
+
again:
ZeroMemory(&ProcessInfo, sizeof (ProcessInfo));
ZeroMemory(&StartupInfo, sizeof (StartupInfo));
//#undef WAIT_OBJECT_1
+done:
Log("<====");
return 0;
Success = GetExecutable(&Context->Executable);
if (!Success)
- goto fail7;
+ Context->Executable = NULL;
Context->Device = INVALID_HANDLE_VALUE;
&Interface,
DEVICE_NOTIFY_SERVICE_HANDLE);
if (Context->InterfaceNotification == NULL)
- goto fail8;
+ goto fail7;
// The device may already by present
SetEvent(Context->AddEvent);
return;
-fail8:
- Log("fail8");
-
- free(Context->Executable);
-
fail7:
Log("fail7");