add large cursor support, posix shm

This commit is contained in:
Jay Sorg
2022-07-14 01:46:38 -07:00
parent 544ead05e7
commit c250529e8e
14 changed files with 282 additions and 68 deletions
+4
View File
@@ -567,4 +567,8 @@
#define RDP_MPPC_FLUSH 0x80
#define RDP_MPPC_DICT_SIZE 8192 /* RDP 4.0 | MS-RDPBCGR 3.1.8 */
/* largePointerSupprtFlags (2.2.7.2.7) */
#define LARGE_POINTER_FLAG_96x96 0x00000001
#define LARGE_POINTER_FLAG_384x384 0x00000002
#endif /* MS_RDPBCGR_H */
+32
View File
@@ -56,6 +56,7 @@
#if defined(HAVE_SYS_PRCTL_H)
#include <sys/prctl.h>
#endif
#include <sys/mman.h>
#include <dlfcn.h>
#include <arpa/inet.h>
#include <netdb.h>
@@ -2353,6 +2354,37 @@ nomem:
return NULL;
}
/*****************************************************************************/
int
g_file_map(int fd, int aread, int awrite, size_t length, void **addr)
{
int prot = 0;
void *laddr;
if (aread)
{
prot |= PROT_READ;
}
if (awrite)
{
prot |= PROT_WRITE;
}
laddr = mmap(NULL, length, prot, MAP_SHARED, fd, 0);
if (laddr == MAP_FAILED)
{
return 1;
}
*addr = laddr;
return 0;
}
/*****************************************************************************/
int
g_munmap(void *addr, size_t length)
{
return munmap(addr, length);
}
/*****************************************************************************/
/* Converts a hex mask to a mode_t value */
#if !defined(_WIN32)
+4
View File
@@ -221,6 +221,10 @@ int g_file_read(int fd, char *ptr, int len);
int g_file_write(int fd, const char *ptr, int len);
int g_file_seek(int fd, int offset);
int g_file_lock(int fd, int start, int len);
int
g_file_map(int fd, int aread, int awrite, size_t length, void **addr);
int
g_munmap(void *addr, size_t length);
int g_file_duplicate_on(int fd, int target_fd);
int g_file_get_cloexec(int fd);
int g_file_set_cloexec(int fd, int status);
+4 -1
View File
@@ -213,9 +213,12 @@ struct xrdp_client_info
* data */
unsigned int session_physical_width; /* in mm */
unsigned int session_physical_height; /* in mm */
int large_pointer_support_flags;
};
/* yyyymmdd of last incompatible change to xrdp_client_info */
#define CLIENT_INFO_CURRENT_VERSION 20220428
/* also used for changes to all the xrdp installed headers */
#define CLIENT_INFO_CURRENT_VERSION 20230425
#endif