mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-07-01 15:25:43 +00:00
UWP Changes (#85)
This commit is contained in:
parent
298f356acb
commit
7f99bebc72
@ -55,6 +55,13 @@
|
||||
// Windows doesn't have strtok_r() but it has the same
|
||||
// function named strtok_s().
|
||||
#define strtok_r strtok_s
|
||||
|
||||
# if defined(WINAPI_FAMILY) && WINAPI_FAMILY==WINAPI_FAMILY_APP
|
||||
# define LC_UWP
|
||||
# else
|
||||
# define LC_WINDOWS_DESKTOP
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -21,11 +21,13 @@
|
||||
static HMODULE WlanApiLibraryHandle;
|
||||
static HANDLE WlanHandle;
|
||||
|
||||
#if defined(LC_WINDOWS_DESKTOP)
|
||||
DWORD (WINAPI *pfnWlanOpenHandle)(DWORD dwClientVersion, PVOID pReserved, PDWORD pdwNegotiatedVersion, PHANDLE phClientHandle);
|
||||
DWORD (WINAPI *pfnWlanCloseHandle)(HANDLE hClientHandle, PVOID pReserved);
|
||||
DWORD (WINAPI *pfnWlanEnumInterfaces)(HANDLE hClientHandle, PVOID pReserved, PWLAN_INTERFACE_INFO_LIST *ppInterfaceList);
|
||||
VOID (WINAPI *pfnWlanFreeMemory)(PVOID pMemory);
|
||||
DWORD (WINAPI *pfnWlanSetInterface)(HANDLE hClientHandle, CONST GUID *pInterfaceGuid, WLAN_INTF_OPCODE OpCode, DWORD dwDataSize, CONST PVOID pData, PVOID pReserved);
|
||||
#endif
|
||||
|
||||
#ifndef WLAN_API_MAKE_VERSION
|
||||
#define WLAN_API_MAKE_VERSION(_major, _minor) (((DWORD)(_minor)) << 16 | (_major))
|
||||
@ -618,7 +620,7 @@ bool isPrivateNetworkAddress(struct sockaddr_storage* address) {
|
||||
|
||||
// Enable platform-specific low latency options (best-effort)
|
||||
void enterLowLatencyMode(void) {
|
||||
#if defined(LC_WINDOWS)
|
||||
#if defined(LC_WINDOWS_DESKTOP)
|
||||
DWORD negotiatedVersion;
|
||||
PWLAN_INTERFACE_INFO_LIST wlanInterfaceList;
|
||||
DWORD i;
|
||||
@ -692,7 +694,7 @@ void enterLowLatencyMode(void) {
|
||||
}
|
||||
|
||||
void exitLowLatencyMode(void) {
|
||||
#if defined(LC_WINDOWS)
|
||||
#if defined(LC_WINDOWS_DESKTOP)
|
||||
// Closing our WLAN client handle will undo our optimizations
|
||||
if (WlanHandle != NULL) {
|
||||
pfnWlanCloseHandle(WlanHandle, NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user