mirror of
https://github.com/EnderIce2/rpc-bridge.git
synced 2025-07-07 13:29:14 +00:00
Compare commits
13 Commits
9f1a9de3d7
...
v1.3
Author | SHA1 | Date | |
---|---|---|---|
9bec33c358 | |||
3e6b5dbb43
|
|||
4c432a0e50
|
|||
65b5625a57
|
|||
9d2440f616 | |||
51cbb666f9 | |||
1deccc5a63 | |||
3412c3c011 | |||
c15c4df29e | |||
3a0b9ddb2a
|
|||
8786efd144
|
|||
2024de9408
|
|||
e8926edb41
|
31
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
31
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: EnderIce2
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Log File**
|
||||
Located in `/path/to/prefix/drive_c/windows/logs/bridge.log` or a screenshot with the terminal should suffice.
|
||||
|
||||
**System Info (please complete the following information):**
|
||||
- OS: [e.g. SteamOS 3.0, Ubuntu 22.04, macOS 15, or output from command `uname -srm`]
|
||||
- Wine: [e.g. 10.5]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: enhancement
|
||||
assignees: EnderIce2
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
2
.github/workflows/build-deploy.yml
vendored
2
.github/workflows/build-deploy.yml
vendored
@ -15,7 +15,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: dependencies
|
||||
run: sudo apt-get update && sudo apt-get install gcc-mingw-w64 make
|
||||
run: sudo apt update && sudo apt -y install gcc-mingw-w64 make
|
||||
- name: make
|
||||
run: make
|
||||
- name: artifact
|
||||
|
128
CODE_OF_CONDUCT.md
Normal file
128
CODE_OF_CONDUCT.md
Normal file
@ -0,0 +1,128 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, religion, or sexual identity
|
||||
and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the
|
||||
overall community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or
|
||||
advances of any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email
|
||||
address, without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
enderice2@protonmail.com.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series
|
||||
of actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or
|
||||
permanent ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within
|
||||
the community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.0, available at
|
||||
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||
|
||||
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
||||
enforcement ladder](https://github.com/mozilla/diversity).
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
https://www.contributor-covenant.org/faq. Translations are available at
|
||||
https://www.contributor-covenant.org/translations.
|
2
LICENSE
2
LICENSE
@ -1,4 +1,4 @@
|
||||
Copyright (c) 2024 EnderIce2
|
||||
Copyright (c) 2025 EnderIce2
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
2
Makefile
2
Makefile
@ -5,7 +5,7 @@ GIT_COMMIT = $(shell git rev-parse --short HEAD)
|
||||
GIT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
|
||||
|
||||
CFLAGS = -std=c17 -Wno-int-conversion -DGIT_COMMIT='"$(GIT_COMMIT)"' -DGIT_BRANCH='"$(GIT_BRANCH)"'
|
||||
LFLAGS = -lgdi32
|
||||
LFLAGS = -lgdi32 -lws2_32
|
||||
|
||||
# DBGFLAGS = -Wl,--export-all-symbols -g -O0 -ggdb3 -Wall
|
||||
|
||||
|
109
bridge.c
109
bridge.c
@ -195,11 +195,7 @@ char *native_getenv(const char *name)
|
||||
|
||||
/* I hope the 0x20000 is okay */
|
||||
if (environStr == NULL)
|
||||
{
|
||||
environStr = sys_mmap(0x20000, 4096, PROT_READ | PROT_WRITE,
|
||||
MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0);
|
||||
print("Allocated 4096 bytes at %#lx\n", environStr);
|
||||
}
|
||||
environStr = sys_mmap(0x20000, 0x1000, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0);
|
||||
|
||||
if ((uintptr_t)environStr > 0x7effffff)
|
||||
print("Warning: environStr %#lx is above 2GB\n", environStr);
|
||||
@ -209,18 +205,17 @@ char *native_getenv(const char *name)
|
||||
|
||||
int fd = sys_open(environStr, O_RDONLY, 0);
|
||||
|
||||
// sys_munmap(environStr, 4096);
|
||||
if (fd < 0)
|
||||
{
|
||||
print("Failed to open /proc/self/environ: %d\n", fd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char buffer[4096];
|
||||
char *buffer = sys_mmap(0x22000, 0x1000, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0);
|
||||
char *result = NULL;
|
||||
int bytesRead;
|
||||
|
||||
while ((bytesRead = sys_read(fd, buffer, sizeof(buffer) - 1)) > 0)
|
||||
while ((bytesRead = sys_read(fd, buffer, 0x1000 - 1)) > 0)
|
||||
{
|
||||
buffer[bytesRead] = '\0';
|
||||
char *env = buffer;
|
||||
@ -290,8 +285,8 @@ void ConnectToSocket(int fd)
|
||||
"%s/snap.discord-canary/discord-ipc-%d",
|
||||
};
|
||||
|
||||
struct sockaddr_un socketAddr;
|
||||
socketAddr.sun_family = AF_UNIX;
|
||||
struct sockaddr_un *socketAddr = sys_mmap(0x23000, 0x1000, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0);
|
||||
socketAddr->sun_family = AF_UNIX;
|
||||
|
||||
int sockRet = 0;
|
||||
for (int i = 0; i < sizeof(discordUnixSockets) / sizeof(discordUnixSockets[0]); i++)
|
||||
@ -302,15 +297,20 @@ void ConnectToSocket(int fd)
|
||||
for (int j = 0; j < 16; j++)
|
||||
{
|
||||
snprintf(pipePath, pipePathLen, discordUnixSockets[i], runtime, j);
|
||||
strcpy_s(socketAddr.sun_path, sizeof(socketAddr.sun_path), pipePath);
|
||||
strcpy_s(socketAddr->sun_path, sizeof(socketAddr->sun_path), pipePath);
|
||||
print("Probing %s\n", pipePath);
|
||||
|
||||
if (IsLinux)
|
||||
{
|
||||
unsigned long socketArgs[] = {
|
||||
(unsigned long)fd,
|
||||
(unsigned long)(intptr_t)&socketAddr,
|
||||
sizeof(socketAddr)};
|
||||
// unsigned long socketArgs[] = {
|
||||
// (unsigned long)fd,
|
||||
// (unsigned long)(intptr_t)&socketAddr,
|
||||
// sizeof(socketAddr)};
|
||||
unsigned long *socketArgs = sys_mmap(0x24000, 0x1000, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0);
|
||||
socketArgs[0] = (unsigned long)fd;
|
||||
socketArgs[1] = (unsigned long)(intptr_t)socketAddr;
|
||||
socketArgs[2] = sizeof(struct sockaddr_un);
|
||||
socketArgs[3] = 0;
|
||||
|
||||
sockRet = sys_socketcall(SYS_CONNECT, socketArgs);
|
||||
}
|
||||
@ -345,18 +345,17 @@ void ConnectToSocket(int fd)
|
||||
void PipeBufferInThread(LPVOID lpParam)
|
||||
{
|
||||
bridge_thread *bt = (bridge_thread *)lpParam;
|
||||
print("In thread started using fd %d and pipe %#x\n",
|
||||
bt->fd, bt->hPipe);
|
||||
print("In thread started using fd %d and pipe %#x\n", bt->fd, bt->hPipe);
|
||||
int EOFCount = 0;
|
||||
char *l_buffer = sys_mmap(0x25000, 0x1000, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0);
|
||||
while (TRUE)
|
||||
{
|
||||
char buffer[BUFFER_LENGTH];
|
||||
int read = sys_read(bt->fd, buffer, sizeof(buffer));
|
||||
int read = sys_read(bt->fd, l_buffer, BUFFER_LENGTH);
|
||||
|
||||
if (unlikely(read < 0))
|
||||
{
|
||||
print("Failed to read from unix pipe: %d\n",
|
||||
GetErrorMessage());
|
||||
print("Failed to read from unix pipe: %d\n", read);
|
||||
Sleep(1000);
|
||||
continue;
|
||||
}
|
||||
@ -378,14 +377,16 @@ void PipeBufferInThread(LPVOID lpParam)
|
||||
}
|
||||
EOFCount = 0;
|
||||
|
||||
memcpy(buffer, l_buffer, read);
|
||||
|
||||
print("Reading %d bytes from unix pipe: \"", read);
|
||||
for (int i = 0; i < read; i++)
|
||||
print("%c", buffer[i]);
|
||||
print("\"\n");
|
||||
|
||||
DWORD dwWritten;
|
||||
if (unlikely(!WriteFile(bt->hPipe, buffer, read,
|
||||
&dwWritten, NULL)))
|
||||
WINBOOL bResult = WriteFile(bt->hPipe, buffer, read, &dwWritten, NULL);
|
||||
if (unlikely(bResult == FALSE))
|
||||
{
|
||||
if (GetLastError() == ERROR_BROKEN_PIPE)
|
||||
{
|
||||
@ -394,16 +395,14 @@ void PipeBufferInThread(LPVOID lpParam)
|
||||
break;
|
||||
}
|
||||
|
||||
print("Failed to read from pipe: %d\n",
|
||||
GetErrorMessage());
|
||||
print("Failed to read from pipe: %s\n", GetErrorMessage());
|
||||
Sleep(1000);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (unlikely(dwWritten < 0))
|
||||
{
|
||||
print("Failed to write to pipe: %d\n",
|
||||
GetErrorMessage());
|
||||
print("Failed to write to pipe: %s\n", GetErrorMessage());
|
||||
Sleep(1000);
|
||||
continue;
|
||||
}
|
||||
@ -411,8 +410,8 @@ void PipeBufferInThread(LPVOID lpParam)
|
||||
while (dwWritten < read)
|
||||
{
|
||||
int last_written = dwWritten;
|
||||
if (unlikely(!WriteFile(bt->hPipe, buffer + dwWritten,
|
||||
read - dwWritten, &dwWritten, NULL)))
|
||||
WINBOOL bResult = WriteFile(bt->hPipe, buffer + dwWritten, read - dwWritten, &dwWritten, NULL);
|
||||
if (unlikely(bResult == FALSE))
|
||||
{
|
||||
if (GetLastError() == ERROR_BROKEN_PIPE)
|
||||
{
|
||||
@ -421,16 +420,14 @@ void PipeBufferInThread(LPVOID lpParam)
|
||||
break;
|
||||
}
|
||||
|
||||
print("Failed to read from pipe: %d\n",
|
||||
GetErrorMessage());
|
||||
print("Failed to read from pipe: %s\n", GetErrorMessage());
|
||||
Sleep(1000);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (unlikely(last_written == dwWritten))
|
||||
{
|
||||
print("Failed to write to pipe: %d\n",
|
||||
GetErrorMessage());
|
||||
print("Failed to write to pipe: %s\n", GetErrorMessage());
|
||||
Sleep(1000);
|
||||
continue;
|
||||
}
|
||||
@ -441,15 +438,14 @@ void PipeBufferInThread(LPVOID lpParam)
|
||||
void PipeBufferOutThread(LPVOID lpParam)
|
||||
{
|
||||
bridge_thread *bt = (bridge_thread *)lpParam;
|
||||
print("Out thread started using fd %d and pipe %#x\n",
|
||||
bt->fd, bt->hPipe);
|
||||
print("Out thread started using fd %d and pipe %#x\n", bt->fd, bt->hPipe);
|
||||
char *l_buffer = sys_mmap(0x25000, 0x1000, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0);
|
||||
while (TRUE)
|
||||
{
|
||||
char buffer[BUFFER_LENGTH];
|
||||
DWORD dwRead;
|
||||
|
||||
if (unlikely(!ReadFile(bt->hPipe, buffer, sizeof(buffer),
|
||||
&dwRead, NULL)))
|
||||
WINBOOL bResult = ReadFile(bt->hPipe, buffer, BUFFER_LENGTH, &dwRead, NULL);
|
||||
if (unlikely(bResult == FALSE))
|
||||
{
|
||||
if (GetLastError() == ERROR_BROKEN_PIPE)
|
||||
{
|
||||
@ -458,8 +454,7 @@ void PipeBufferOutThread(LPVOID lpParam)
|
||||
break;
|
||||
}
|
||||
|
||||
print("Failed to read from pipe: %d\n",
|
||||
GetErrorMessage());
|
||||
print("Failed to read from pipe: %s\n", GetErrorMessage());
|
||||
Sleep(1000);
|
||||
continue;
|
||||
}
|
||||
@ -469,11 +464,11 @@ void PipeBufferOutThread(LPVOID lpParam)
|
||||
print("%c", buffer[i]);
|
||||
print("\"\n");
|
||||
|
||||
int written = sys_write(bt->fd, buffer, dwRead);
|
||||
memcpy(l_buffer, buffer, dwRead);
|
||||
int written = sys_write(bt->fd, l_buffer, dwRead);
|
||||
if (unlikely(written < 0))
|
||||
{
|
||||
print("Failed to write to socket: %d\n",
|
||||
written);
|
||||
print("Failed to write to socket: %d\n", written);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -483,8 +478,7 @@ void PipeBufferOutThread(LPVOID lpParam)
|
||||
written += sys_write(bt->fd, buffer + written, dwRead - written);
|
||||
if (unlikely(last_written == written))
|
||||
{
|
||||
print("Failed to write to socket: %d\n",
|
||||
GetErrorMessage());
|
||||
print("Failed to write to socket: %s\n", GetErrorMessage());
|
||||
Sleep(1000);
|
||||
continue;
|
||||
}
|
||||
@ -547,16 +541,31 @@ NewConnection:
|
||||
int fd;
|
||||
if (IsLinux)
|
||||
{
|
||||
unsigned long socketArgs[] = {
|
||||
(unsigned long)AF_UNIX,
|
||||
(unsigned long)SOCK_STREAM,
|
||||
0};
|
||||
// unsigned long socketArgs[] = {
|
||||
// (unsigned long)AF_UNIX,
|
||||
// (unsigned long)SOCK_STREAM,
|
||||
// 0};
|
||||
unsigned long *socketArgs = sys_mmap(0x21000, 0x1000, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0);
|
||||
socketArgs[0] = (unsigned long)AF_UNIX;
|
||||
socketArgs[1] = (unsigned long)SOCK_STREAM;
|
||||
socketArgs[2] = 0;
|
||||
fd = sys_socketcall(SYS_SOCKET, socketArgs);
|
||||
|
||||
/* FIXME: WSAEAFNOSUPPORT: https://gitlab.winehq.org/wine/wine/-/merge_requests/2786 */
|
||||
// WSADATA wsaData;
|
||||
// int iResult = WSAStartup(MAKEWORD(2, 2), &wsaData);
|
||||
// if (iResult != 0)
|
||||
// printf("WSAStartup failed: %d\n", iResult);
|
||||
// fd = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
}
|
||||
else
|
||||
fd = sys_socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
|
||||
print("Socket %d created\n", fd);
|
||||
if (fd == INVALID_SOCKET)
|
||||
{
|
||||
print("invalid socket: %d %d\n", fd, WSAGetLastError());
|
||||
ExitProcess(1);
|
||||
}
|
||||
|
||||
if (fd < 0)
|
||||
{
|
||||
@ -567,6 +576,8 @@ NewConnection:
|
||||
ExitProcess(1);
|
||||
}
|
||||
|
||||
print("Socket %d created\n", fd);
|
||||
|
||||
ConnectToSocket(fd);
|
||||
print("Connected to Discord\n");
|
||||
|
||||
|
BIN
docs/assets/contentwarning.png
Normal file
BIN
docs/assets/contentwarning.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 MiB |
BIN
docs/assets/hades.png
Normal file
BIN
docs/assets/hades.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 MiB |
BIN
docs/assets/lethalcompany.png
Normal file
BIN
docs/assets/lethalcompany.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 551 KiB |
BIN
docs/assets/vividstasis.png
Normal file
BIN
docs/assets/vividstasis.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 945 KiB |
@ -20,11 +20,32 @@ For v1.0, see [the original README](https://github.com/EnderIce2/rpc-bridge/blob
|
||||
|
||||
---
|
||||
|
||||
## Known Issues
|
||||
|
||||
- If you use **Vesktop**
|
||||
Some games may not show up in Discord. This is because Vesktop uses arRPC, which it doesn't work with some games [#4](https://github.com/EnderIce2/rpc-bridge/issues/4#issuecomment-2143549407). This is not an issue with the bridge.
|
||||
|
||||
---
|
||||
|
||||
## Examples
|
||||
|
||||
{ width="600" }
|
||||
[**League Of Legends**](https://www.leagueoflegends.com/en-us/) running under Wine using Lutris
|
||||
{ width="600" }
|
||||
|
||||
{ width="600" }
|
||||
[**Among Us**](https://store.steampowered.com/app/945360/Among_Us/) on Steam
|
||||
{ width="600" }
|
||||
|
||||
[**Content Warning**](https://store.steampowered.com/app/2881650/Content_Warning/) on Steam
|
||||
{ width="600" }
|
||||
|
||||
[**Hades**](https://store.steampowered.com/app/1145360/Hades/) on Steam
|
||||
{ width="600" }
|
||||
|
||||
[**Lethal Company**](https://store.steampowered.com/app/1966720/Lethal_Company/) ([modded](https://thunderstore.io/c/lethal-company/p/mrov/LethalRichPresence/)) on Steam
|
||||
{ width="600" }
|
||||
|
||||
[**vivid/stasis**](https://store.steampowered.com/app/2093940/vividstasis/) on Steam
|
||||
{ width="600" }
|
||||
|
||||
## Credits
|
||||
|
||||
|
22
main.c
22
main.c
@ -59,7 +59,7 @@ void DetectWine()
|
||||
if (!GetProcAddress(hNTdll, "wine_get_version"))
|
||||
{
|
||||
MessageBox(NULL, "This program is only intended to run under Wine.",
|
||||
GetErrorMessage(), MB_OK | MB_ICONINFORMATION);
|
||||
"Error", MB_OK | MB_ICONINFORMATION);
|
||||
ExitProcess(1);
|
||||
}
|
||||
|
||||
@ -221,29 +221,27 @@ void HandleArguments(int argc, char *argv[])
|
||||
HeapFree(GetProcessHeap(), 0, asciiPath);
|
||||
}
|
||||
|
||||
print("(Steam) Starting service...\n");
|
||||
if (StartService(schService, 0, NULL) == FALSE)
|
||||
print("(Steam) Starting service and then exiting...\n");
|
||||
fclose(g_logFile);
|
||||
|
||||
if (StartService(schService, 0, NULL) != FALSE)
|
||||
{
|
||||
if (GetLastError() == ERROR_SERVICE_ALREADY_RUNNING)
|
||||
CloseServiceHandle(schService);
|
||||
CloseServiceHandle(hSCManager);
|
||||
ExitProcess(0);
|
||||
}
|
||||
else if (GetLastError() == ERROR_SERVICE_ALREADY_RUNNING)
|
||||
{
|
||||
print("(Steam) Service is already running\n");
|
||||
CloseServiceHandle(schService);
|
||||
CloseServiceHandle(hSCManager);
|
||||
ExitProcess(0);
|
||||
}
|
||||
|
||||
print("StartService: %s\n", GetErrorMessage());
|
||||
MessageBox(NULL, GetErrorMessage(),
|
||||
"StartService",
|
||||
MB_OK | MB_ICONSTOP);
|
||||
ExitProcess(1);
|
||||
}
|
||||
|
||||
print("(Steam) Service started successfully, exiting...\n");
|
||||
CloseServiceHandle(schService);
|
||||
CloseServiceHandle(hSCManager);
|
||||
ExitProcess(0);
|
||||
}
|
||||
else if (strcmp(argv[1], "--install") == 0)
|
||||
{
|
||||
char filename[MAX_PATH];
|
||||
|
Reference in New Issue
Block a user