# Include our extra modules
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/)
+if((CMAKE_SYSTEM_NAME MATCHES "WindowsStore") AND (CMAKE_SYSTEM_VERSION MATCHES "10.0"))
+ set(UWP 1)
+ add_definitions("-D_UWP")
+ set(CMAKE_WINDOWS_VERSION "WIN10")
+endif()
+
# Check for cmake compatibility (enable/disable features)
include(CheckCmakeCompat)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUNICODE -D_UNICODE")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWIN32_LEAN_AND_MEAN")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_WINSOCK_DEPRECATED_NO_WARNINGS")
set(CMAKE_USE_RELATIVE_PATH ON)
if (${CMAKE_GENERATOR} MATCHES "NMake Makefile*")
elseif(CMAKE_WINDOWS_VERSION STREQUAL "WIN8")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWINVER=0x0602 -D_WIN32_WINNT=0x0602")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWINVER=0x0602 -D_WIN32_WINNT=0x0602")
+ elseif(CMAKE_WINDOWS_VERSION STREQUAL "WIN10")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWINVER=0x0A00 -D_WIN32_WINNT=0x0A00")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWINVER=0x0A00 -D_WIN32_WINNT=0x0A00")
endif()
if (FREERDP_EXTERNAL_SSL_PATH)
* allows rewinddir() to function correctly when the current working
* directory is changed between opendir() and rewinddir().
*/
- if (GetFullPathNameA (dirname, MAX_PATH, dirp->patt, NULL)) {
+ if (GetFullPathNameA(dirname, MAX_PATH, dirp->patt, NULL)) {
char *p;
/* append the search pattern "\\*\0" to the directory name */
*p = '\0';
/* open directory stream and retrieve the first entry */
- dirp->search_handle = FindFirstFileA (dirp->patt, &dirp->find_data);
+ dirp->search_handle = FindFirstFileA(dirp->patt, &dirp->find_data);
if (dirp->search_handle != INVALID_HANDLE_VALUE) {
/* a directory entry is now waiting in memory */
dirp->cached = 1;
#include <sys/stat.h>
#include <winpr/crt.h>
+#include <winpr/path.h>
#include <winpr/file.h>
#include <winpr/stream.h>
#include <string.h>
#include <winpr/crt.h>
+#include <winpr/path.h>
#include <winpr/string.h>
#include <winpr/synch.h>
#include <winpr/thread.h>
#include <winpr/stream.h>
+#include <winpr/environment.h>
#include <winpr/interlocked.h>
#include <winpr/collections.h>
/* Special case: path[0] == '%' -> user home dir */
if (strcmp(drive->Path, "%") == 0)
{
- sprintf_s(buf, sizeof(buf), "%s\\", getenv("USERPROFILE"));
+ GetEnvironmentVariableA("USERPROFILE", buf, sizeof(buf));
+ PathCchAddBackslashA(buf, sizeof(buf));
+
free(drive->Path);
drive->Path = _strdup(buf);
if (!drive->Path)
add_definitions(-DWITH_CUPS)
endif()
-if(WIN32)
+if(WIN32 AND NOT UWP)
set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS}
printer_win.c
printer_win.h)
return rdpdr_send(rdpdr, s);
}
-#ifdef _WIN32
+#ifdef _UWP
+
+void first_hotplug(rdpdrPlugin *rdpdr)
+{
+
+}
+
+static void* drive_hotplug_thread_func(void* arg)
+{
+ return NULL;
+}
+
+static UINT drive_hotplug_thread_terminate(rdpdrPlugin* rdpdr)
+{
+ return CHANNEL_RC_OK;
+}
+
+#elif _WIN32
BOOL check_path(char* path)
{
add_subdirectory(common)
if(FREERDP_VENDOR AND WITH_CLIENT)
- if(WIN32)
- add_subdirectory(Windows)
+ if(WIN32 AND NOT UWP)
+ add_subdirectory(Windows)
else()
if(WITH_SAMPLE)
add_subdirectory(Sample)
if(NOT WIN32)
option(WITH_VALGRIND_MEMCHECK "Compile with valgrind helpers." OFF)
else()
- option(WITH_MEDIA_FOUNDATION "Enable H264 media foundation decoder." ON)
+ if(NOT UWP)
+ option(WITH_MEDIA_FOUNDATION "Enable H264 media foundation decoder." ON)
+ endif()
endif()
-if(MSVC)
+if(WIN32 AND NOT UWP)
option(WITH_NATIVE_SSPI "Use native SSPI modules" ON)
option(WITH_WINMM "Use Windows Multimedia" ON)
option(WITH_WIN8 "Use Windows 8 libraries" OFF)
#include <winpr/crt.h>
#include <winpr/print.h>
+#include <winpr/library.h>
#include <winpr/bitstream.h>
#include <freerdp/primitives.h>
#include <string.h>
#include <winpr/crt.h>
+#include <winpr/environment.h>
#include "liblocale.h"
BOOL freerdp_get_system_language_and_country_codes(char* language, char* country)
{
int dot;
+ DWORD nSize;
int underscore;
- char* env_lang;
+ char* env_lang = NULL;
/* LANG = <language>_<country>.<encoding> */
- env_lang = getenv("LANG"); /* Get locale from environment variable LANG */
+ nSize = GetEnvironmentVariableA("LANG", NULL, 0);
- if (env_lang == NULL)
+ if (!nSize)
return FALSE; /* LANG environment variable was not set */
+ env_lang = (char*) malloc(nSize);
+
+ if (!env_lang)
+ return FALSE;
+
+ GetEnvironmentVariableA("LANG", env_lang, nSize); /* Get locale from environment variable LANG */
+
underscore = strcspn(env_lang, "_");
if (underscore > 3)
{
+ free(env_lang);
return FALSE; /* The language name should not be more than 3 letters long */
}
else
}
else
{
+ free(env_lang);
return FALSE; /* Invalid locale */
}
+ free(env_lang);
return TRUE;
}
#ifndef WINPR_DSPARSE_H
#define WINPR_DSPARSE_H
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(_UWP)
#include <winpr/windows.h>
#include <winpr/rpc.h>
#endif /* _WIN32 */
+#ifdef _UWP
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WINPR_API HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData);
+WINPR_API HANDLE FindFirstFileW(LPCWSTR lpFileName, LPWIN32_FIND_DATAW lpFindFileData);
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifdef UNICODE
+#define FindFirstFile FindFirstFileW
+#else
+#define FindFirstFile FindFirstFileA
+#endif
+
+#endif
+
#define WILDCARD_STAR 0x00000001
#define WILDCARD_QM 0x00000002
#define WILDCARD_DOS 0x00000100
#endif
+#ifdef _UWP
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WINPR_API BOOL GetOverlappedResult(HANDLE hFile, LPOVERLAPPED lpOverlapped, LPDWORD lpNumberOfBytesTransferred, BOOL bWait);
+
+WINPR_API BOOL DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize,
+ LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped);
+
+WINPR_API HANDLE CreateIoCompletionPort(HANDLE FileHandle, HANDLE ExistingCompletionPort, ULONG_PTR CompletionKey, DWORD NumberOfConcurrentThreads);
+
+WINPR_API BOOL GetQueuedCompletionStatus(HANDLE CompletionPort, LPDWORD lpNumberOfBytesTransferred,
+ PULONG_PTR lpCompletionKey, LPOVERLAPPED* lpOverlapped, DWORD dwMilliseconds);
+
+WINPR_API BOOL GetQueuedCompletionStatusEx(HANDLE CompletionPort, LPOVERLAPPED_ENTRY lpCompletionPortEntries,
+ ULONG ulCount, PULONG ulNumEntriesRemoved, DWORD dwMilliseconds, BOOL fAlertable);
+
+WINPR_API BOOL PostQueuedCompletionStatus(HANDLE CompletionPort, DWORD dwNumberOfBytesTransferred, ULONG_PTR dwCompletionKey, LPOVERLAPPED lpOverlapped);
+
+WINPR_API BOOL CancelIo(HANDLE hFile);
+
+WINPR_API BOOL CancelSynchronousIo(HANDLE hThread);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
/**
* Extended API
*/
/* Defined in wincred.h, do not redefine */
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(_UWP)
#include <wincred.h>
{
union
{
+#ifdef _WIN32
+ NTSTATUS Status;
+#else
NTSTATUS status;
+#endif
PVOID Pointer;
};
ULONG_PTR Information;
#include <winpr/windows.h>
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(_UWP)
#include <winreg.h>
#include <winpr/io.h>
#include <winpr/error.h>
+#ifndef _WIN32
+
#define OWNER_SECURITY_INFORMATION 0x00000001
#define GROUP_SECURITY_INFORMATION 0x00000002
#define DACL_SECURITY_INFORMATION 0x00000004
typedef HANDLE HKEY;
typedef HANDLE* PHKEY;
+#endif
+
typedef ACCESS_MASK REGSAM;
#define HKEY_CLASSES_ROOT ((HKEY) (LONG_PTR) (LONG) 0x80000000)
typedef PCONTEXT_HANDLE PCHANNEL_CONTEXT_HANDLE_NOSERIALIZE;
typedef PCONTEXT_HANDLE PCHANNEL_CONTEXT_HANDLE_SERIALIZE;
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(_UWP)
#include <rpc.h>
typedef long RPC_STATUS;
+#ifndef _WIN32
typedef CHAR* RPC_CSTR;
typedef WCHAR* RPC_WSTR;
+#endif
typedef void* I_RPC_HANDLE;
typedef I_RPC_HANDLE RPC_BINDING_HANDLE;
RPC_IF_ID *IfId[1];
} RPC_IF_ID_VECTOR;
+#ifndef _WIN32
+
typedef void *RPC_AUTH_IDENTITY_HANDLE;
typedef void *RPC_AUTHZ_HANDLE;
#define RPC_C_AUTHZ_DCE 2
#define RPC_C_AUTHZ_DEFAULT 0xFFFFFFFF
+#endif
+
typedef void (*RPC_AUTH_KEY_RETRIEVAL_FN)(void* Arg, unsigned short* ServerPrincName, unsigned long KeyVer, void** Key, RPC_STATUS* pStatus);
#define DCE_C_ERROR_STRING_LEN 256
#include <winpr/sspi.h>
#include <winpr/crypto.h>
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(_UWP)
#include <schannel.h>
#endif
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(_UWP)
#ifndef SEC_ENTRY
#define SEC_ENTRY
typedef SECURITY_INTEGER TimeStamp;
typedef SECURITY_INTEGER* PTimeStamp;
-typedef UINT32 SECURITY_STATUS;
+#ifndef __SECSTATUS_DEFINED__
+typedef LONG SECURITY_STATUS;
+#define __SECSTATUS_DEFINED__
+#endif
struct _SecPkgInfoA
{
#define SECPKG_ATTR_NEGO_STATUS 32
#define SECPKG_ATTR_CONTEXT_DELETED 33
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(_UWP)
struct _SecPkgContext_AccessToken
{
#define SEC_WINNT_AUTH_IDENTITY_ANSI 0x1
#define SEC_WINNT_AUTH_IDENTITY_UNICODE 0x2
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(_UWP)
+
+#ifndef _AUTH_IDENTITY_DEFINED
+#define _AUTH_IDENTITY_DEFINED
typedef struct _SEC_WINNT_AUTH_IDENTITY_W
{
};
typedef struct _SEC_WINNT_AUTH_IDENTITY SEC_WINNT_AUTH_IDENTITY;
+#endif /* _AUTH_IDENTITY_DEFINED */
+
struct _SecHandle
{
ULONG_PTR dwLower;
#define SECBUFFER_READONLY_WITH_CHECKSUM 0x10000000
#define SECBUFFER_RESERVED 0x60000000
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(_UWP)
struct _SecBuffer
{
WORD wProcessorRevision;
} SYSTEM_INFO, *LPSYSTEM_INFO;
-#define MAX_COMPUTERNAME_LENGTH 31
-
WINPR_API void GetSystemInfo(LPSYSTEM_INFO lpSystemInfo);
WINPR_API void GetNativeSystemInfo(LPSYSTEM_INFO lpSystemInfo);
#define VER_NT_SERVER 0x0000003
#define VER_NT_WORKSTATION 0x0000001
-WINPR_API BOOL GetVersionExA(LPOSVERSIONINFOA lpVersionInformation);
-WINPR_API BOOL GetVersionExW(LPOSVERSIONINFOW lpVersionInformation);
-
-#ifdef UNICODE
-#define GetVersionEx GetVersionExW
-#else
-#define GetVersionEx GetVersionExA
-#endif
-
WINPR_API void GetSystemTime(LPSYSTEMTIME lpSystemTime);
WINPR_API BOOL SetSystemTime(CONST SYSTEMTIME* lpSystemTime);
WINPR_API VOID GetLocalTime(LPSYSTEMTIME lpSystemTime);
#if !defined(_WIN32) || defined(_UWP)
+WINPR_API BOOL GetVersionExA(LPOSVERSIONINFOA lpVersionInformation);
+WINPR_API BOOL GetVersionExW(LPOSVERSIONINFOW lpVersionInformation);
+
+#ifdef UNICODE
+#define GetVersionEx GetVersionExW
+#else
+#define GetVersionEx GetVersionExA
+#endif
+
+#endif
+
+#if !defined(_WIN32) || defined(_UWP)
+
WINPR_API DWORD GetTickCount(void);
typedef enum _COMPUTER_NAME_FORMAT
ComputerNameMax
} COMPUTER_NAME_FORMAT;
+#define MAX_COMPUTERNAME_LENGTH 31
+
WINPR_API BOOL GetComputerNameExA(COMPUTER_NAME_FORMAT NameType, LPSTR lpBuffer, LPDWORD lpnSize);
WINPR_API BOOL GetComputerNameExW(COMPUTER_NAME_FORMAT NameType, LPWSTR lpBuffer, LPDWORD lpnSize);
#include <winpr/wtypes.h>
#include <winpr/winsock.h>
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(_UWP)
#include <winhttp.h>
#endif
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(_UWP)
#include <pchannel.h>
* DsUnquoteRdnValueW
*/
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(_UWP)
DWORD DsCrackSpnW(LPCWSTR pszSpn, DWORD* pcServiceClass, LPWSTR ServiceClass, DWORD* pcServiceName,
LPWSTR ServiceName, DWORD* pcInstanceName, LPWSTR InstanceName, USHORT* pInstancePort)
if ((*pcSpnLength != 0) && (pszSpn == NULL))
return ERROR_INVALID_PARAMETER;
- ServiceClassLength = strlen(ServiceClass);
- ServiceNameLength = strlen(ServiceName);
+ ServiceClassLength = (DWORD) strlen(ServiceClass);
+ ServiceNameLength = (DWORD) strlen(ServiceName);
SpnLength = ServiceClassLength + 1 + ServiceNameLength + 1;
#endif /* _WIN32 */
+#ifdef _UWP
+
+HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData)
+{
+ return FindFirstFileExA(lpFileName, FindExInfoStandard, lpFindFileData, FindExSearchNameMatch, NULL, 0);
+}
+
+HANDLE FindFirstFileW(LPCWSTR lpFileName, LPWIN32_FIND_DATAW lpFindFileData)
+{
+ return FindFirstFileExW(lpFileName, FindExInfoStandard, lpFindFileData, FindExSearchNameMatch, NULL, 0);
+}
+
+#endif
+
/* Extended API */
#ifdef _WIN32
}
#endif
+
+#ifdef _UWP
+
+BOOL GetOverlappedResult(HANDLE hFile, LPOVERLAPPED lpOverlapped, LPDWORD lpNumberOfBytesTransferred, BOOL bWait)
+{
+ return GetOverlappedResultEx(hFile, lpOverlapped, lpNumberOfBytesTransferred, bWait ? INFINITE : 0, TRUE);
+}
+
+BOOL DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize,
+ LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped)
+{
+ return TRUE;
+}
+
+HANDLE CreateIoCompletionPort(HANDLE FileHandle, HANDLE ExistingCompletionPort, ULONG_PTR CompletionKey, DWORD NumberOfConcurrentThreads)
+{
+ return NULL;
+}
+
+BOOL GetQueuedCompletionStatus(HANDLE CompletionPort, LPDWORD lpNumberOfBytesTransferred,
+ PULONG_PTR lpCompletionKey, LPOVERLAPPED* lpOverlapped, DWORD dwMilliseconds)
+{
+ return TRUE;
+}
+
+BOOL GetQueuedCompletionStatusEx(HANDLE CompletionPort, LPOVERLAPPED_ENTRY lpCompletionPortEntries,
+ ULONG ulCount, PULONG ulNumEntriesRemoved, DWORD dwMilliseconds, BOOL fAlertable)
+{
+ return TRUE;
+}
+
+BOOL PostQueuedCompletionStatus(HANDLE CompletionPort, DWORD dwNumberOfBytesTransferred, ULONG_PTR dwCompletionKey, LPOVERLAPPED lpOverlapped)
+{
+ return TRUE;
+}
+
+BOOL CancelIo(HANDLE hFile)
+{
+ return CancelIoEx(hFile, NULL);
+}
+
+BOOL CancelSynchronousIo(HANDLE hThread)
+{
+ return TRUE;
+}
+
+#endif
* Functions: http://msdn.microsoft.com/en-us/library/windows/desktop/ms724875/
*/
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(_UWP)
#include <stdio.h>
#include <stdlib.h>
{
if (_stricmp(pKey->subname, lpSubKey) == 0)
{
- *phkResult = pKey;
+ *phkResult = (HKEY) pKey;
return ERROR_SUCCESS;
}
int length;
char* pData = (char*) lpData;
- length = strlen(pValue->data.string);
+ length = (int) strlen(pValue->data.string);
if (pData != NULL)
{
#include <winpr/rpc.h>
#include <winpr/crypto.h>
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(_UWP)
#include "../log.h"
#define TAG WINPR_TAG("rpc")
return 1;
}
- context->ServicePrincipalName.Length = _wcslen(ServicePrincipalName) * 2;
+ context->ServicePrincipalName.Length = (USHORT) (_wcslen(ServicePrincipalName) * 2);
context->ServicePrincipalName.Buffer = (PWSTR) malloc(context->ServicePrincipalName.Length + 2);
if (!context->ServicePrincipalName.Buffer)
GetSystemInfo(lpSystemInfo);
}
-/* OSVERSIONINFOEX Structure:
- * http://msdn.microsoft.com/en-us/library/windows/desktop/ms724833
- */
-
-BOOL GetVersionExA(LPOSVERSIONINFOA lpVersionInformation)
-{
- /* Windows 7 SP1 Version Info */
- if ((lpVersionInformation->dwOSVersionInfoSize == sizeof(OSVERSIONINFOA)) ||
- (lpVersionInformation->dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXA)))
- {
- lpVersionInformation->dwMajorVersion = 6;
- lpVersionInformation->dwMinorVersion = 1;
- lpVersionInformation->dwBuildNumber = 7601;
- lpVersionInformation->dwPlatformId = VER_PLATFORM_WIN32_NT;
- ZeroMemory(lpVersionInformation->szCSDVersion, sizeof(lpVersionInformation->szCSDVersion));
-
- if (lpVersionInformation->dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXA))
- {
- LPOSVERSIONINFOEXA lpVersionInformationEx = (LPOSVERSIONINFOEXA) lpVersionInformation;
- lpVersionInformationEx->wServicePackMajor = 1;
- lpVersionInformationEx->wServicePackMinor = 0;
- lpVersionInformationEx->wSuiteMask = 0;
- lpVersionInformationEx->wProductType = VER_NT_WORKSTATION;
- lpVersionInformationEx->wReserved = 0;
- }
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-BOOL GetVersionExW(LPOSVERSIONINFOW lpVersionInformation)
-{
- WLog_ERR(TAG, "GetVersionExW unimplemented");
- return TRUE;
-}
-
void GetSystemTime(LPSYSTEMTIME lpSystemTime)
{
time_t ct = 0;
#if !defined(_WIN32) || defined(_UWP)
+/* OSVERSIONINFOEX Structure:
+* http://msdn.microsoft.com/en-us/library/windows/desktop/ms724833
+*/
+
+BOOL GetVersionExA(LPOSVERSIONINFOA lpVersionInformation)
+{
+#ifdef _UWP
+ /* Windows 10 Version Info */
+ if ((lpVersionInformation->dwOSVersionInfoSize == sizeof(OSVERSIONINFOA)) ||
+ (lpVersionInformation->dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXA)))
+ {
+ lpVersionInformation->dwMajorVersion = 10;
+ lpVersionInformation->dwMinorVersion = 0;
+ lpVersionInformation->dwBuildNumber = 0;
+ lpVersionInformation->dwPlatformId = VER_PLATFORM_WIN32_NT;
+ ZeroMemory(lpVersionInformation->szCSDVersion, sizeof(lpVersionInformation->szCSDVersion));
+
+ if (lpVersionInformation->dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXA))
+ {
+ LPOSVERSIONINFOEXA lpVersionInformationEx = (LPOSVERSIONINFOEXA)lpVersionInformation;
+ lpVersionInformationEx->wServicePackMajor = 0;
+ lpVersionInformationEx->wServicePackMinor = 0;
+ lpVersionInformationEx->wSuiteMask = 0;
+ lpVersionInformationEx->wProductType = VER_NT_WORKSTATION;
+ lpVersionInformationEx->wReserved = 0;
+ }
+
+ return TRUE;
+ }
+#else
+ /* Windows 7 SP1 Version Info */
+ if ((lpVersionInformation->dwOSVersionInfoSize == sizeof(OSVERSIONINFOA)) ||
+ (lpVersionInformation->dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXA)))
+ {
+ lpVersionInformation->dwMajorVersion = 6;
+ lpVersionInformation->dwMinorVersion = 1;
+ lpVersionInformation->dwBuildNumber = 7601;
+ lpVersionInformation->dwPlatformId = VER_PLATFORM_WIN32_NT;
+ ZeroMemory(lpVersionInformation->szCSDVersion, sizeof(lpVersionInformation->szCSDVersion));
+
+ if (lpVersionInformation->dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXA))
+ {
+ LPOSVERSIONINFOEXA lpVersionInformationEx = (LPOSVERSIONINFOEXA)lpVersionInformation;
+ lpVersionInformationEx->wServicePackMajor = 1;
+ lpVersionInformationEx->wServicePackMinor = 0;
+ lpVersionInformationEx->wSuiteMask = 0;
+ lpVersionInformationEx->wProductType = VER_NT_WORKSTATION;
+ lpVersionInformationEx->wReserved = 0;
+ }
+
+ return TRUE;
+ }
+#endif
+
+ return FALSE;
+}
+
+BOOL GetVersionExW(LPOSVERSIONINFOW lpVersionInformation)
+{
+ ZeroMemory(lpVersionInformation->szCSDVersion, sizeof(lpVersionInformation->szCSDVersion));
+ return GetVersionExA((LPOSVERSIONINFOA) lpVersionInformation);
+}
+
+#endif
+
+#if !defined(_WIN32) || defined(_UWP)
+
BOOL GetComputerNameA(LPSTR lpBuffer, LPDWORD lpnSize)
{
char* dot;
else if (WtsVirtualClass == WTSVirtualFileHandle)
{
*pBytesReturned = sizeof(HANDLE);
- *ppBuffer = LocalAlloc(LMEM_ZEROINIT, *pBytesReturned);
+ *ppBuffer = calloc(1, *pBytesReturned);
if (*ppBuffer == NULL)
{
else if (WtsVirtualClass == WTSVirtualEventHandle)
{
*pBytesReturned = sizeof(HANDLE);
- *ppBuffer = LocalAlloc(LMEM_ZEROINIT, *pBytesReturned);
+ *ppBuffer = calloc(1, *pBytesReturned);
if (*ppBuffer == NULL)
{
VOID WINAPI Win32_WTSFreeMemory(PVOID pMemory)
{
- LocalFree(pMemory);
+ free(pMemory);
}
BOOL WINAPI Win32_WTSFreeMemoryExW(WTS_TYPE_CLASS WTSTypeClass, PVOID pMemory, ULONG NumberOfEntries)