Merge branch 'master' of github.com:FreeRDP/FreeRDP
@ -263,6 +263,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWINPR_EXPORTS -DFREERDP_EXPORTS")
|
||||
if(NOT IOS)
|
||||
check_include_files(fcntl.h HAVE_FCNTL_H)
|
||||
check_include_files(unistd.h HAVE_UNISTD_H)
|
||||
check_include_files(execinfo.h HAVE_EXECINFO_H)
|
||||
check_include_files(stdint.h HAVE_STDINT_H)
|
||||
check_include_files(inttypes.h HAVE_INTTYPES_H)
|
||||
check_include_files(sys/modem.h HAVE_SYS_MODEM_H)
|
||||
|
@ -52,6 +52,11 @@
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma comment(lib, "Shlwapi.lib")
|
||||
#include <Shlwapi.h>
|
||||
#endif
|
||||
|
||||
#include "drive_file.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
@ -425,6 +430,29 @@ BOOL drive_file_query_information(DRIVE_FILE* file, UINT32 FsInformationClass, w
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int dir_empty(const char *path)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return PathIsDirectoryEmptyA(path);
|
||||
#else
|
||||
struct dirent *dp;
|
||||
int empty = 1;
|
||||
|
||||
DIR *dir = opendir(path);
|
||||
if (dir == NULL) //Not a directory or doesn't exist
|
||||
return 1;
|
||||
|
||||
while ((dp = readdir(dir)) != NULL) {
|
||||
if (strcmp(dp->d_name, ".") == 0 || strcmp(dp->d_name, "..") == 0)
|
||||
continue; /* Skip . and .. */
|
||||
|
||||
empty = 0;
|
||||
break;
|
||||
}
|
||||
closedir(dir);
|
||||
return empty;
|
||||
#endif
|
||||
}
|
||||
BOOL drive_file_set_information(DRIVE_FILE* file, UINT32 FsInformationClass, UINT32 Length, wStream* input)
|
||||
{
|
||||
char* s = NULL;
|
||||
@ -433,7 +461,11 @@ BOOL drive_file_set_information(DRIVE_FILE* file, UINT32 FsInformationClass, UIN
|
||||
int status;
|
||||
char* fullpath;
|
||||
struct STAT st;
|
||||
#if defined(__linux__) && !defined(ANDROID)
|
||||
struct timespec tv[2];
|
||||
#else
|
||||
struct timeval tv[2];
|
||||
#endif
|
||||
UINT64 LastWriteTime;
|
||||
UINT32 FileAttributes;
|
||||
UINT32 FileNameLength;
|
||||
@ -454,14 +486,20 @@ BOOL drive_file_set_information(DRIVE_FILE* file, UINT32 FsInformationClass, UIN
|
||||
return FALSE;
|
||||
|
||||
tv[0].tv_sec = st.st_atime;
|
||||
tv[0].tv_usec = 0;
|
||||
tv[1].tv_sec = (LastWriteTime > 0 ? FILE_TIME_RDP_TO_SYSTEM(LastWriteTime) : st.st_mtime);
|
||||
tv[1].tv_usec = 0;
|
||||
#ifndef WIN32
|
||||
/* TODO on win32 */
|
||||
#ifdef ANDROID
|
||||
tv[0].tv_usec = 0;
|
||||
tv[1].tv_usec = 0;
|
||||
utimes(file->fullpath, tv);
|
||||
#elif defined (__linux__)
|
||||
tv[0].tv_nsec = 0;
|
||||
tv[1].tv_nsec = 0;
|
||||
futimens(file->fd, tv);
|
||||
#else
|
||||
tv[0].tv_usec = 0;
|
||||
tv[1].tv_usec = 0;
|
||||
futimes(file->fd, tv);
|
||||
#endif
|
||||
|
||||
@ -492,6 +530,9 @@ BOOL drive_file_set_information(DRIVE_FILE* file, UINT32 FsInformationClass, UIN
|
||||
case FileDispositionInformation:
|
||||
/* http://msdn.microsoft.com/en-us/library/cc232098.aspx */
|
||||
/* http://msdn.microsoft.com/en-us/library/cc241371.aspx */
|
||||
if (file->is_dir && !dir_empty(file->fullpath))
|
||||
break;
|
||||
|
||||
if (Length)
|
||||
Stream_Read_UINT8(input, file->delete_pending);
|
||||
else
|
||||
|
@ -117,6 +117,7 @@ BOOL drive_file_query_information(DRIVE_FILE* file, UINT32 FsInformationClass, w
|
||||
BOOL drive_file_set_information(DRIVE_FILE* file, UINT32 FsInformationClass, UINT32 Length, wStream* input);
|
||||
BOOL drive_file_query_directory(DRIVE_FILE* file, UINT32 FsInformationClass, BYTE InitialQuery,
|
||||
const char* path, wStream* output);
|
||||
int dir_empty(const char *path);
|
||||
|
||||
extern UINT sys_code_page;
|
||||
|
||||
|
@ -346,6 +346,9 @@ static void drive_process_irp_set_information(DRIVE_DEVICE* drive, IRP* irp)
|
||||
|
||||
}
|
||||
|
||||
if (file->is_dir && !dir_empty(file->fullpath))
|
||||
irp->IoStatus = STATUS_DIRECTORY_NOT_EMPTY;
|
||||
|
||||
Stream_Write_UINT32(irp->output, Length);
|
||||
|
||||
irp->Complete(irp);
|
||||
|
@ -141,6 +141,7 @@ BOOL android_pre_connect(freerdp* instance)
|
||||
|
||||
static BOOL android_post_connect(freerdp* instance)
|
||||
{
|
||||
UINT32 gdi_flags;
|
||||
rdpSettings *settings = instance->settings;
|
||||
|
||||
DEBUG_ANDROID("android_post_connect");
|
||||
@ -154,9 +155,12 @@ static BOOL android_post_connect(freerdp* instance)
|
||||
|
||||
instance->context->cache = cache_new(settings);
|
||||
|
||||
gdi_init(instance, CLRCONV_ALPHA | CLRCONV_INVERT |
|
||||
((instance->settings->ColorDepth > 16) ? CLRBUF_32BPP : CLRBUF_16BPP),
|
||||
NULL);
|
||||
if (instance->settings->ColorDepth > 16)
|
||||
gdi_flags = CLRBUF_32BPP | CLRCONV_ALPHA | CLRCONV_INVERT;
|
||||
else
|
||||
gdi_flags = CLRBUF_16BPP;
|
||||
|
||||
gdi_init(instance, gdi_flags, NULL);
|
||||
|
||||
instance->update->BeginPaint = android_begin_paint;
|
||||
instance->update->EndPaint = android_end_paint;
|
||||
@ -270,40 +274,6 @@ static void android_process_channel_event(rdpChannels* channels, freerdp* instan
|
||||
}
|
||||
}
|
||||
|
||||
static void *jni_update_thread(void *arg)
|
||||
{
|
||||
int status;
|
||||
wMessage message;
|
||||
wMessageQueue* queue;
|
||||
freerdp* instance = (freerdp*) arg;
|
||||
|
||||
assert( NULL != instance);
|
||||
|
||||
DEBUG_ANDROID("Start.");
|
||||
|
||||
status = 1;
|
||||
queue = freerdp_get_message_queue(instance, FREERDP_UPDATE_MESSAGE_QUEUE);
|
||||
|
||||
while (MessageQueue_Wait(queue))
|
||||
{
|
||||
while (MessageQueue_Peek(queue, &message, TRUE))
|
||||
{
|
||||
status = freerdp_message_queue_process_message(instance, FREERDP_UPDATE_MESSAGE_QUEUE, &message);
|
||||
|
||||
if (!status)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!status)
|
||||
break;
|
||||
}
|
||||
|
||||
DEBUG_ANDROID("Quit.");
|
||||
|
||||
ExitThread(0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void* jni_input_thread(void* arg)
|
||||
{
|
||||
HANDLE event[3];
|
||||
@ -394,11 +364,9 @@ static int android_freerdp_run(freerdp* instance)
|
||||
|
||||
const rdpSettings* settings = instance->context->settings;
|
||||
|
||||
HANDLE update_thread;
|
||||
HANDLE input_thread;
|
||||
HANDLE channels_thread;
|
||||
|
||||
BOOL async_update = settings->AsyncUpdate;
|
||||
BOOL async_input = settings->AsyncInput;
|
||||
BOOL async_channels = settings->AsyncChannels;
|
||||
BOOL async_transport = settings->AsyncTransport;
|
||||
@ -417,12 +385,6 @@ static int android_freerdp_run(freerdp* instance)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (async_update)
|
||||
{
|
||||
update_thread = CreateThread(NULL, 0,
|
||||
(LPTHREAD_START_ROUTINE) jni_update_thread, instance, 0, NULL);
|
||||
}
|
||||
|
||||
if (async_input)
|
||||
{
|
||||
input_thread = CreateThread(NULL, 0,
|
||||
@ -571,15 +533,7 @@ static int android_freerdp_run(freerdp* instance)
|
||||
WaitForSingleObject(channels_thread, INFINITE);
|
||||
CloseHandle(channels_thread);
|
||||
}
|
||||
|
||||
if (async_update)
|
||||
{
|
||||
wMessageQueue* update_queue = freerdp_get_message_queue(instance, FREERDP_UPDATE_MESSAGE_QUEUE);
|
||||
MessageQueue_PostQuit(update_queue, 0);
|
||||
WaitForSingleObject(update_thread, INFINITE);
|
||||
CloseHandle(update_thread);
|
||||
}
|
||||
|
||||
|
||||
if (async_input)
|
||||
{
|
||||
wMessageQueue* input_queue = freerdp_get_message_queue(instance, FREERDP_INPUT_MESSAGE_QUEUE);
|
||||
@ -836,44 +790,15 @@ JNIEXPORT void JNICALL jni_freerdp_set_performance_flags(
|
||||
}
|
||||
|
||||
/* store performance settings */
|
||||
if (disableWallpaper == JNI_TRUE)
|
||||
settings->DisableWallpaper = TRUE;
|
||||
|
||||
if (disableFullWindowDrag == JNI_TRUE)
|
||||
settings->DisableFullWindowDrag = TRUE;
|
||||
|
||||
if (disableMenuAnimations == JNI_TRUE)
|
||||
settings->DisableMenuAnims = TRUE;
|
||||
|
||||
if (disableTheming == JNI_TRUE)
|
||||
settings->DisableThemes = TRUE;
|
||||
|
||||
if (enableFontSmoothing == JNI_TRUE)
|
||||
settings->AllowFontSmoothing = TRUE;
|
||||
|
||||
if(enableDesktopComposition == JNI_TRUE)
|
||||
settings->AllowDesktopComposition = TRUE;
|
||||
|
||||
settings->DisableWallpaper = (disableWallpaper == JNI_TRUE) ? TRUE : FALSE;
|
||||
settings->DisableFullWindowDrag = (disableFullWindowDrag == JNI_TRUE) ? TRUE : FALSE;
|
||||
settings->DisableMenuAnims = (disableMenuAnimations == JNI_TRUE) ? TRUE : FALSE;
|
||||
settings->DisableThemes = (disableTheming == JNI_TRUE) ? TRUE : FALSE;
|
||||
settings->AllowFontSmoothing = (enableFontSmoothing == JNI_TRUE) ? TRUE : FALSE;
|
||||
settings->AllowDesktopComposition = (enableDesktopComposition == JNI_TRUE) ? TRUE : FALSE;
|
||||
|
||||
/* Create performance flags from settings */
|
||||
settings->PerformanceFlags = PERF_FLAG_NONE;
|
||||
if (settings->AllowFontSmoothing)
|
||||
settings->PerformanceFlags |= PERF_ENABLE_FONT_SMOOTHING;
|
||||
|
||||
if (settings->AllowDesktopComposition)
|
||||
settings->PerformanceFlags |= PERF_ENABLE_DESKTOP_COMPOSITION;
|
||||
|
||||
if (settings->DisableWallpaper)
|
||||
settings->PerformanceFlags |= PERF_DISABLE_WALLPAPER;
|
||||
|
||||
if (settings->DisableFullWindowDrag)
|
||||
settings->PerformanceFlags |= PERF_DISABLE_FULLWINDOWDRAG;
|
||||
|
||||
if (settings->DisableMenuAnims)
|
||||
settings->PerformanceFlags |= PERF_DISABLE_MENUANIMATIONS;
|
||||
|
||||
if (settings->DisableThemes)
|
||||
settings->PerformanceFlags |= PERF_DISABLE_THEMING;
|
||||
freerdp_performance_flags_make(settings);
|
||||
|
||||
DEBUG_ANDROID("performance_flags: %04X", settings->PerformanceFlags);
|
||||
}
|
||||
@ -1014,7 +939,7 @@ JNIEXPORT void JNICALL jni_freerdp_set_gateway_info(JNIEnv *env, jclass cls, jin
|
||||
|
||||
static void copy_pixel_buffer(UINT8* dstBuf, UINT8* srcBuf, int x, int y, int width, int height, int wBuf, int hBuf, int bpp)
|
||||
{
|
||||
int i, j;
|
||||
int i;
|
||||
int length;
|
||||
int scanline;
|
||||
UINT8 *dstp, *srcp;
|
||||
@ -1025,31 +950,11 @@ static void copy_pixel_buffer(UINT8* dstBuf, UINT8* srcBuf, int x, int y, int wi
|
||||
srcp = (UINT8*) &srcBuf[(scanline * y) + (x * bpp)];
|
||||
dstp = (UINT8*) &dstBuf[(scanline * y) + (x * bpp)];
|
||||
|
||||
if (bpp == 4)
|
||||
for (i = 0; i < height; i++)
|
||||
{
|
||||
for (i = 0; i < height; i++)
|
||||
{
|
||||
for (j = 0; j < width * 4; j += 4)
|
||||
{
|
||||
// ARGB <-> ABGR
|
||||
dstp[j + 0] = srcp[j + 2];
|
||||
dstp[j + 1] = srcp[j + 1];
|
||||
dstp[j + 2] = srcp[j + 0];
|
||||
dstp[j + 3] = srcp[j + 3];
|
||||
}
|
||||
|
||||
srcp += scanline;
|
||||
dstp += scanline;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < height; i++)
|
||||
{
|
||||
memcpy(dstp, srcp, length);
|
||||
srcp += scanline;
|
||||
dstp += scanline;
|
||||
}
|
||||
memcpy(dstp, srcp, length);
|
||||
srcp += scanline;
|
||||
dstp += scanline;
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 374 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 301 B After Width: | Height: | Size: 238 B |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1002 B |
Before Width: | Height: | Size: 838 B After Width: | Height: | Size: 636 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 720 B |
Before Width: | Height: | Size: 707 B After Width: | Height: | Size: 466 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 783 B |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 768 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 771 B After Width: | Height: | Size: 551 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 932 B |
Before Width: | Height: | Size: 237 B After Width: | Height: | Size: 182 B |
Before Width: | Height: | Size: 892 B After Width: | Height: | Size: 670 B |
Before Width: | Height: | Size: 704 B After Width: | Height: | Size: 445 B |
Before Width: | Height: | Size: 506 B After Width: | Height: | Size: 267 B |
Before Width: | Height: | Size: 572 B After Width: | Height: | Size: 330 B |
Before Width: | Height: | Size: 930 B After Width: | Height: | Size: 717 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 374 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 926 B |
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 993 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 293 B After Width: | Height: | Size: 214 B |
Before Width: | Height: | Size: 829 B After Width: | Height: | Size: 615 B |
Before Width: | Height: | Size: 374 B After Width: | Height: | Size: 267 B |
Before Width: | Height: | Size: 381 B After Width: | Height: | Size: 230 B |
Before Width: | Height: | Size: 866 B After Width: | Height: | Size: 631 B |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 827 B After Width: | Height: | Size: 605 B |
Before Width: | Height: | Size: 810 B After Width: | Height: | Size: 567 B |
Before Width: | Height: | Size: 492 B After Width: | Height: | Size: 321 B |
Before Width: | Height: | Size: 488 B After Width: | Height: | Size: 312 B |
Before Width: | Height: | Size: 473 B After Width: | Height: | Size: 317 B |
Before Width: | Height: | Size: 456 B After Width: | Height: | Size: 306 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 951 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 492 B After Width: | Height: | Size: 327 B |
Before Width: | Height: | Size: 474 B After Width: | Height: | Size: 302 B |
Before Width: | Height: | Size: 504 B After Width: | Height: | Size: 331 B |
Before Width: | Height: | Size: 493 B After Width: | Height: | Size: 322 B |
Before Width: | Height: | Size: 937 B After Width: | Height: | Size: 701 B |
Before Width: | Height: | Size: 917 B After Width: | Height: | Size: 668 B |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 9.1 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 9.4 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 9.4 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 74 B |
Before Width: | Height: | Size: 140 KiB After Width: | Height: | Size: 115 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 74 B |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 2.2 KiB |