mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-12-18 22:14:20 +01:00
Notify adb missing
There are many user who encounters missing adb. To stop things happens again, we check it and show sexy response to user. Signed-off-by: yuchenlin <npes87184@gmail.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
#include "log.h"
|
||||
#include "str_util.h"
|
||||
|
||||
HANDLE cmd_execute(const char *path, const char *const argv[]) {
|
||||
int cmd_execute(const char *path, const char *const argv[], HANDLE *handle) {
|
||||
STARTUPINFO si;
|
||||
PROCESS_INFORMATION pi;
|
||||
memset(&si, 0, sizeof(si));
|
||||
@@ -18,7 +18,8 @@ HANDLE cmd_execute(const char *path, const char *const argv[]) {
|
||||
size_t ret = xstrjoin(cmd, argv, ' ', sizeof(cmd));
|
||||
if (ret >= sizeof(cmd)) {
|
||||
LOGE("Command too long (%" PRIsizet " chars)", sizeof(cmd) - 1);
|
||||
return NULL;
|
||||
*handle = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef WINDOWS_NOCONSOLE
|
||||
@@ -27,10 +28,12 @@ HANDLE cmd_execute(const char *path, const char *const argv[]) {
|
||||
int flags = 0;
|
||||
#endif
|
||||
if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, flags, NULL, NULL, &si, &pi)) {
|
||||
return NULL;
|
||||
*handle = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return pi.hProcess;
|
||||
*handle = pi.hProcess;
|
||||
return 0;
|
||||
}
|
||||
|
||||
SDL_bool cmd_terminate(HANDLE handle) {
|
||||
|
||||
Reference in New Issue
Block a user