mirror of
https://github.com/EnderIce2/rpc-bridge.git
synced 2025-06-03 10:18:00 +00:00
Compare commits
No commits in common. "56168a6d3dcea153c97c7fde6893b5d24803e033" and "cba4fa1e2b894874c3403823c6cd6cccc943161f" have entirely different histories.
56168a6d3d
...
cba4fa1e2b
8
bridge.c
8
bridge.c
@ -10,9 +10,6 @@
|
|||||||
#define __NR_close 6
|
#define __NR_close 6
|
||||||
#define __NR_socketcall 102
|
#define __NR_socketcall 102
|
||||||
|
|
||||||
#define SYS_SOCKET 1
|
|
||||||
#define SYS_CONNECT 3
|
|
||||||
|
|
||||||
#define O_RDONLY 00
|
#define O_RDONLY 00
|
||||||
|
|
||||||
#define likely(expr) (__builtin_expect(!!(expr), 1))
|
#define likely(expr) (__builtin_expect(!!(expr), 1))
|
||||||
@ -139,7 +136,6 @@ void ConnectToSocket(int fd)
|
|||||||
|
|
||||||
print("XDG_RUNTIME_DIR: %s\n", runtime);
|
print("XDG_RUNTIME_DIR: %s\n", runtime);
|
||||||
|
|
||||||
/* TODO: check for multiple discord instances and create a pipe for each */
|
|
||||||
const char *discordUnixPipes[] = {
|
const char *discordUnixPipes[] = {
|
||||||
"/discord-ipc-0",
|
"/discord-ipc-0",
|
||||||
"/snap.discord/discord-ipc-0",
|
"/snap.discord/discord-ipc-0",
|
||||||
@ -165,7 +161,7 @@ void ConnectToSocket(int fd)
|
|||||||
(unsigned long)&socketAddr,
|
(unsigned long)&socketAddr,
|
||||||
sizeof(socketAddr)};
|
sizeof(socketAddr)};
|
||||||
|
|
||||||
sockRet = sys_socketcall(SYS_CONNECT, socketArgs);
|
sockRet = sys_socketcall(3, socketArgs);
|
||||||
|
|
||||||
free(pipePath);
|
free(pipePath);
|
||||||
if (sockRet >= 0)
|
if (sockRet >= 0)
|
||||||
@ -376,7 +372,7 @@ NewConnection:
|
|||||||
(unsigned long)SOCK_STREAM,
|
(unsigned long)SOCK_STREAM,
|
||||||
0};
|
0};
|
||||||
|
|
||||||
int fd = sys_socketcall(SYS_SOCKET, socketArgs);
|
int fd = sys_socketcall(1, socketArgs);
|
||||||
|
|
||||||
print("Socket %d created\n", fd);
|
print("Socket %d created\n", fd);
|
||||||
|
|
||||||
|
17
main.c
17
main.c
@ -52,23 +52,6 @@ void DetectWine()
|
|||||||
GetErrorMessage(), MB_OK | MB_ICONINFORMATION);
|
GetErrorMessage(), MB_OK | MB_ICONINFORMATION);
|
||||||
ExitProcess(1);
|
ExitProcess(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void(CDECL * wine_get_host_version)(const char **sysname, const char **release);
|
|
||||||
wine_get_host_version = (void *)GetProcAddress(hNTdll, "wine_get_host_version");
|
|
||||||
|
|
||||||
assert(wine_get_host_version);
|
|
||||||
const char *__sysname;
|
|
||||||
const char *__release;
|
|
||||||
wine_get_host_version(&__sysname, &__release);
|
|
||||||
if (strcmp(__sysname, "Linux") != 0)
|
|
||||||
{
|
|
||||||
int result = MessageBox(NULL, "This program is designed for Linux only!\nDo you want to proceed?",
|
|
||||||
NULL, MB_YESNO | MB_ICONQUESTION);
|
|
||||||
if (result == IDYES)
|
|
||||||
return;
|
|
||||||
else if (result == IDNO)
|
|
||||||
ExitProcess(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void print(char const *fmt, ...)
|
void print(char const *fmt, ...)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user