Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae2647f36e | ||
|
|
8e40ef80bd | ||
|
|
16bb727b99 | ||
|
|
9194b8e22b | ||
|
|
2805464e86 | ||
|
|
20e7374480 | ||
|
|
0fdbee831b | ||
|
|
b37b99e9c3 | ||
|
|
29bbdc5319 |
+1
-1
Submodule GS-IPv6-Forwarder updated: c1d7dbe846...60ec35a3c0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
-3
@@ -47,9 +47,7 @@
|
|||||||
Account="NT AUTHORITY\LocalService"
|
Account="NT AUTHORITY\LocalService"
|
||||||
ErrorControl="ignore"
|
ErrorControl="ignore"
|
||||||
Interactive="no">
|
Interactive="no">
|
||||||
<ServiceConfig DelayedAutoStart="no" OnInstall="yes" OnReinstall="yes" ServiceSid="restricted">
|
<ServiceConfig DelayedAutoStart="no" OnInstall="yes" OnReinstall="yes" ServiceSid="unrestricted"/>
|
||||||
<RequiredPrivilege>SeChangeNotifyPrivilege</RequiredPrivilege>
|
|
||||||
</ServiceConfig>
|
|
||||||
</ServiceInstall>
|
</ServiceInstall>
|
||||||
<ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="MISS" Wait="yes" />
|
<ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="MISS" Wait="yes" />
|
||||||
</Component>
|
</Component>
|
||||||
|
|||||||
@@ -386,15 +386,6 @@ bool NATPMPMapPort(natpmp_t* natpmp, int proto, int port, bool enable, bool inde
|
|||||||
else if (response.pnu.newportmapping.mappedpublicport != port) {
|
else if (response.pnu.newportmapping.mappedpublicport != port) {
|
||||||
printf("CONFLICT" NL);
|
printf("CONFLICT" NL);
|
||||||
|
|
||||||
// Some buggy routers (Untangle) will change the *internal* port when
|
|
||||||
// adjusting a port mapping request that collides. This is why we also
|
|
||||||
// pass privateport back from the response and not from the port we originally
|
|
||||||
// asked for. Warn in this case.
|
|
||||||
if (response.pnu.newportmapping.privateport != port) {
|
|
||||||
printf("Buggy router changed the internal port when handling NAT-PMP conflict! (%d -> %d)" NL,
|
|
||||||
port, response.pnu.newportmapping.privateport);
|
|
||||||
}
|
|
||||||
|
|
||||||
// It couldn't assign us the external port we requested and gave us an alternate external port.
|
// It couldn't assign us the external port we requested and gave us an alternate external port.
|
||||||
// We can't use this alternate mapping, so immediately release it.
|
// We can't use this alternate mapping, so immediately release it.
|
||||||
printf("Deleting unwanted NAT-PMP mapping for %s %d...", proto == IPPROTO_TCP ? "TCP" : "UDP", response.pnu.newportmapping.mappedpublicport);
|
printf("Deleting unwanted NAT-PMP mapping for %s %d...", proto == IPPROTO_TCP ? "TCP" : "UDP", response.pnu.newportmapping.mappedpublicport);
|
||||||
|
|||||||
+125
-1
@@ -178,6 +178,56 @@ void DisplayMessage(const char* message, const char* helpUrl = nullptr, MessageP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ExecuteCommand(PCSTR command, PCHAR outputBuffer, DWORD outputBufferLength)
|
||||||
|
{
|
||||||
|
SECURITY_ATTRIBUTES attribs;
|
||||||
|
STARTUPINFO si;
|
||||||
|
PROCESS_INFORMATION pi;
|
||||||
|
HANDLE outReadHandle;
|
||||||
|
DWORD bytesRead = 0;
|
||||||
|
|
||||||
|
ZeroMemory(&si, sizeof(si));
|
||||||
|
si.cb = sizeof(si);
|
||||||
|
si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
|
||||||
|
si.wShowWindow = SW_HIDE;
|
||||||
|
|
||||||
|
ZeroMemory(&attribs, sizeof(attribs));
|
||||||
|
attribs.nLength = sizeof(attribs);
|
||||||
|
attribs.bInheritHandle = TRUE;
|
||||||
|
|
||||||
|
if (!CreatePipe(&outReadHandle, &si.hStdOutput, &attribs, 0))
|
||||||
|
{
|
||||||
|
fprintf(LOG_OUT, "CreatePipe() failed: %d\n", GetLastError());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
si.hStdError = si.hStdOutput;
|
||||||
|
|
||||||
|
if (!CreateProcess(NULL, (LPSTR)command, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi))
|
||||||
|
{
|
||||||
|
fprintf(LOG_OUT, "CreateProcess() failed: %d\n", GetLastError());
|
||||||
|
CloseHandle(si.hStdOutput);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
WaitForSingleObject(pi.hProcess, INFINITE);
|
||||||
|
|
||||||
|
CloseHandle(si.hStdOutput);
|
||||||
|
CloseHandle(pi.hProcess);
|
||||||
|
CloseHandle(pi.hThread);
|
||||||
|
|
||||||
|
if (!ReadFile(outReadHandle, outputBuffer, outputBufferLength, &bytesRead, NULL))
|
||||||
|
{
|
||||||
|
fprintf(LOG_OUT, "ReadFile() failed: %d\n", GetLastError());
|
||||||
|
CloseHandle(outReadHandle);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
outputBuffer[bytesRead] = 0;
|
||||||
|
CloseHandle(outReadHandle);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool IsGameStreamEnabled()
|
bool IsGameStreamEnabled()
|
||||||
{
|
{
|
||||||
DWORD error;
|
DWORD error;
|
||||||
@@ -590,7 +640,7 @@ bool FindZeroTierInterfaceAddress(PSOCKADDR_STORAGE addr)
|
|||||||
&addresses,
|
&addresses,
|
||||||
&length);
|
&length);
|
||||||
if (error != ERROR_SUCCESS) {
|
if (error != ERROR_SUCCESS) {
|
||||||
fprintf(LOG_OUT, "GetAdaptersAddresses() failed: %d\n", WSAGetLastError());
|
fprintf(LOG_OUT, "GetAdaptersAddresses() failed: %d\n", error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -616,6 +666,57 @@ bool FindZeroTierInterfaceAddress(PSOCKADDR_STORAGE addr)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FindDuplicateDefaultInterfaces(void)
|
||||||
|
{
|
||||||
|
union {
|
||||||
|
IP_ADAPTER_ADDRESSES addresses;
|
||||||
|
char buffer[8192];
|
||||||
|
};
|
||||||
|
ULONG error;
|
||||||
|
ULONG length;
|
||||||
|
MIB_IPFORWARDROW defaultRoute;
|
||||||
|
PIP_ADAPTER_ADDRESSES currentAdapter;
|
||||||
|
DWORD matchingInterfaces = 0;
|
||||||
|
|
||||||
|
error = GetBestRoute(0, 0, &defaultRoute);
|
||||||
|
if (error != NO_ERROR) {
|
||||||
|
fprintf(LOG_OUT, "GetBestRoute() failed: %d\n", error);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get all IPv4 interfaces
|
||||||
|
length = sizeof(buffer);
|
||||||
|
error = GetAdaptersAddresses(AF_INET,
|
||||||
|
GAA_FLAG_SKIP_UNICAST |
|
||||||
|
GAA_FLAG_SKIP_ANYCAST |
|
||||||
|
GAA_FLAG_SKIP_MULTICAST |
|
||||||
|
GAA_FLAG_SKIP_DNS_SERVER |
|
||||||
|
GAA_FLAG_INCLUDE_GATEWAYS |
|
||||||
|
GAA_FLAG_SKIP_FRIENDLY_NAME,
|
||||||
|
NULL,
|
||||||
|
&addresses,
|
||||||
|
&length);
|
||||||
|
if (error != ERROR_SUCCESS) {
|
||||||
|
fprintf(LOG_OUT, "GetAdaptersAddresses() failed: %d\n", error);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
currentAdapter = &addresses;
|
||||||
|
while (currentAdapter != NULL) {
|
||||||
|
if (currentAdapter->OperStatus == IfOperStatusUp &&
|
||||||
|
currentAdapter->FirstGatewayAddress != NULL &&
|
||||||
|
currentAdapter->FirstGatewayAddress->Address.iSockaddrLength == sizeof(SOCKADDR_IN)) {
|
||||||
|
if (((PSOCKADDR_IN)currentAdapter->FirstGatewayAddress->Address.lpSockaddr)->sin_addr.S_un.S_addr == defaultRoute.dwForwardNextHop) {
|
||||||
|
matchingInterfaces++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
currentAdapter = currentAdapter->Next;
|
||||||
|
}
|
||||||
|
|
||||||
|
return matchingInterfaces > 1;
|
||||||
|
}
|
||||||
|
|
||||||
enum UPnPPortStatus {
|
enum UPnPPortStatus {
|
||||||
NOT_FOUND,
|
NOT_FOUND,
|
||||||
OK,
|
OK,
|
||||||
@@ -885,6 +986,29 @@ int main(int argc, char* argv[])
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fprintf(CONSOLE_OUT, "Checking for anti-virus and firewall software...\n");
|
||||||
|
|
||||||
|
char wmicBuf[8192];
|
||||||
|
if (ExecuteCommand("WMIC /Node:localhost /Namespace:\\\\root\\SecurityCenter2 Path AntiVirusProduct Get displayName", wmicBuf, sizeof(wmicBuf))) {
|
||||||
|
fprintf(LOG_OUT, "AV products:\n%s", wmicBuf);
|
||||||
|
}
|
||||||
|
if (ExecuteCommand("WMIC /Node:localhost /Namespace:\\\\root\\SecurityCenter2 Path FirewallProduct Get displayName", wmicBuf, sizeof(wmicBuf))) {
|
||||||
|
fprintf(LOG_OUT, "Firewall products:\n%s", wmicBuf);
|
||||||
|
if (!strstr(wmicBuf, "No Instance(s) Available.") && !strstr(wmicBuf, "Invalid namespace")) {
|
||||||
|
DisplayMessage("Detected anti-virus and/or firewall software installed on this system. This software may interfere with NVIDIA GameStream.\n\n"
|
||||||
|
"Please try temporarily disabling your anti-virus or firewall software if you experience connection issues with Moonlight.",
|
||||||
|
"https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting", MpInfo, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf(CONSOLE_OUT, "Checking network connections...\n");
|
||||||
|
|
||||||
|
if (FindDuplicateDefaultInterfaces()) {
|
||||||
|
DisplayMessage("This computer appears to have more than one connection to the same network (like both WiFi and Ethernet, for example).\n\n"
|
||||||
|
"Please disconnect the extra connection(s) to ensure hosting works reliably over the Internet. If you are connected via WiFi and Ethernet, try disabling your WiFi connection.",
|
||||||
|
"https://github.com/moonlight-stream/moonlight-docs/wiki/Internet-Streaming-Errors#multiple-connections-error", MpWarn, false);
|
||||||
|
}
|
||||||
|
|
||||||
union {
|
union {
|
||||||
SOCKADDR_STORAGE ss;
|
SOCKADDR_STORAGE ss;
|
||||||
SOCKADDR_IN sin;
|
SOCKADDR_IN sin;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define VER_VERSION 4,2,0,0
|
#define VER_VERSION 4,3,0,0
|
||||||
#define VER_VERSION_STR "4.2.0.0"
|
#define VER_VERSION_STR "4.3.0.0"
|
||||||
|
|
||||||
#define VER_COMPANYNAME_STR "Moonlight Game Streaming Project"
|
#define VER_COMPANYNAME_STR "Moonlight Game Streaming Project"
|
||||||
#define VER_PRODUCTNAME_STR "Moonlight Internet Hosting Tool"
|
#define VER_PRODUCTNAME_STR "Moonlight Internet Hosting Tool"
|
||||||
|
|||||||
Reference in New Issue
Block a user