message: Add more specific errors if DLL injection fails
diff: @@ -279,8 +279,9 @@ void InjectDLL(HANDLE hProcess, std::wstring libName)
  VirtualAllocEx(hProcess, NULL, sizeof(dllPath), MEM_COMMIT, PAGE_EXECUTE_READWRITE);
  if(remoteMem)
  {
  - WriteProcessMemory(hProcess, remoteMem, (void *)dllPath, sizeof(dllPath), NULL);
  -
  + BOOL success = WriteProcessMemory(hProcess, remoteMem, (void *)dllPath, sizeof(dllPath), NULL);
  + if(success)
  + {
  HANDLE hThread = CreateRemoteThread(
  hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)GetProcAddress(kernel32, "LoadLibraryW"),
  remoteMem, 0, NULL);
  @@ -289,11 +290,22 @@ void InjectDLL(HANDLE hProcess, std::wstring libName)
  WaitForSingleObject(hThread, INFINITE);
  CloseHandle(hThread);
  }
  + else
  + {
  + RDCERR("Couldn't create remote thread for LoadLibraryW: %u", GetLastError());
  + }
  + }
  + else
  + {
  + RDCERR("Couldn't write remote memory %p with dllPath '%ls': %u", remoteMem, dllPath,
  + GetLastError());
  + }
  +
  VirtualFreeEx(hProcess, remoteMem, 0, MEM_RELEASE);
  }
  else
  {
  - RDCERR("Couldn't allocate remote memory for DLL '%ls'", libName.c_str());
  + RDCERR("Couldn't allocate remote memory for DLL '%ls': %u", libName.c_str(), GetLastError());
  }
  }
  