Merge branch 'master' of github.com:awakecoding/FreeRDP

This commit is contained in:
Marc-André Moreau 2013-02-24 22:33:27 -05:00
commit b6e46e4511
25 changed files with 2737 additions and 2597 deletions

1
.gitignore vendored
View File

@ -41,6 +41,7 @@ client/X11/xfreerdp.1
# Mac OS X
.DS_Store
*.xcodeproj/
DerivedData/
# Windows
*.vcxproj

View File

@ -27,6 +27,6 @@ set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "")
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
MONOLITHIC ${MONOLITHIC_BUILD}
MODULE freerdp
MODULES freerdp-utils)
MODULES freerdp-codec freerdp-utils)
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Server")

View File

@ -284,7 +284,8 @@ static void* audin_server_thread_func(void* arg)
/* Wait for the client to confirm that the Audio Input dynamic channel is ready */
while (1)
{
freerdp_thread_wait(thread);
if (freerdp_thread_wait(thread) < 0)
break;
if (freerdp_thread_is_stopped(thread))
break;
@ -309,7 +310,8 @@ static void* audin_server_thread_func(void* arg)
while (ready)
{
freerdp_thread_wait(thread);
if (freerdp_thread_wait(thread) < 0)
break;
if (freerdp_thread_is_stopped(thread))
break;

View File

@ -268,7 +268,8 @@ static void* parallel_thread_func(void* arg)
while (1)
{
freerdp_thread_wait(parallel->thread);
if (freerdp_thread_wait(parallel->thread) < 0)
break;
if (freerdp_thread_is_stopped(parallel->thread))
break;

View File

@ -184,7 +184,8 @@ static void* rdpsnd_server_thread_func(void* arg)
while (1)
{
freerdp_thread_wait(thread);
if (freerdp_thread_wait(thread) < 0)
break;
if (freerdp_thread_is_stopped(thread))
break;

View File

@ -341,7 +341,8 @@ static void* serial_thread_func(void* arg)
while (1)
{
freerdp_thread_wait_timeout(serial->thread, 500);
if (freerdp_thread_wait_timeout(serial->thread, 500) < 0)
break;
serial->nfds = 1;
FD_ZERO(&serial->read_fds);

View File

@ -35,7 +35,7 @@ set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVER
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
MONOLITHIC ${MONOLITHIC_BUILD}
MODULE freerdp
MODULES freerdp-utils)
MODULES freerdp-codec freerdp-utils)
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
MONOLITHIC ${MONOLITHIC_BUILD}

View File

@ -1,10 +1,21 @@
//
// AppDelegate.h
// MacFreeRDP
//
// Created by Thomas Goddard on 5/8/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* MacFreeRDP
*
* Copyright 2012 Thomas Goddard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <Cocoa/Cocoa.h>
#import "MRDPView.h"
@ -14,6 +25,5 @@
@property (assign) IBOutlet MRDPView *mrdpView;
@property (assign) IBOutlet NSWindow *window;
int rdp_connect(void);
@end

View File

@ -1,10 +1,21 @@
//
// AppDelegate.m
// MacFreeRDP
//
// Created by Thomas Goddard on 5/8/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* MacFreeRDP
*
* Copyright 2012 Thomas Goddard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import "AppDelegate.h"
@ -14,14 +25,14 @@
@synthesize mrdpView;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
- (void)applicationDidFinishLaunching:(NSNotification*)aNotification
{
rdp_connect();
}
- (void) applicationWillTerminate:(NSNotification *)notification
- (void) applicationWillTerminate:(NSNotification*)notification
{
//[mrdpView releaseResources];
//[mrdpView releaseResources];
}
@end

View File

@ -1,10 +1,21 @@
//
// MRDPCursor.h
// MacFreeRDP
//
// Created by Laxmikant Rashinkar
// Copyright (c) 2012 FreeRDP.org All rights reserved.
//
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* MacFreeRDP
*
* Copyright 2012 Thomas Goddard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <Cocoa/Cocoa.h>
@ -13,11 +24,11 @@
@interface MRDPCursor : NSObject
{
@public
rdpPointer *pointer;
BYTE *cursor_data; // bitmapped pixel data
NSBitmapImageRep *bmiRep;
NSCursor *nsCursor;
NSImage *nsImage;
rdpPointer *pointer;
BYTE *cursor_data; // bitmapped pixel data
NSBitmapImageRep *bmiRep;
NSCursor *nsCursor;
NSImage *nsImage;
}
@end

View File

@ -1,10 +1,21 @@
//
// MRDPCursor.m
// MacFreeRDP
//
// Created by Laxmikant Rashinkar
// Copyright (c) 2012 FreeRDP.org All rights reserved.
//
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* MacFreeRDP
*
* Copyright 2012 Thomas Goddard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import "MRDPCursor.h"

View File

@ -1,3 +1,22 @@
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* MacFreeRDP
*
* Copyright 2012 Thomas Goddard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <Cocoa/Cocoa.h>
#import "freerdp/gdi/gdi.h"
@ -7,35 +26,34 @@
@interface MRDPRailView : NSView
{
freerdp* rdp_instance;
rdpContext* context;
NSBitmapImageRep* bmiRep;
NSPoint savedDragLocation;
char* pixelData;
BOOL mouseInClientArea;
BOOL titleBarClicked;
BOOL gestureEventInProgress;
int width;
int height;
int savedWindowId;
int scrollWheelCount;
/* store state info for some keys */
int kdlshift;
int kdrshift;
int kdlctrl;
int kdrctrl;
int kdlalt;
int kdralt;
int kdlmeta;
int kdrmeta;
int kdcapslock;
@public
BOOL isMoveSizeInProgress;
BOOL saveInitialDragLoc;
BOOL skipMoveWindowOnce;
int localMoveType;
freerdp* rdp_instance;
rdpContext* context;
NSBitmapImageRep* bmiRep;
NSPoint savedDragLocation;
char* pixelData;
BOOL mouseInClientArea;
BOOL titleBarClicked;
BOOL gestureEventInProgress;
int width;
int height;
int savedWindowId;
int scrollWheelCount;
int kdlshift;
int kdrshift;
int kdlctrl;
int kdrctrl;
int kdlalt;
int kdralt;
int kdlmeta;
int kdrmeta;
int kdcapslock;
@public
BOOL isMoveSizeInProgress;
BOOL saveInitialDragLoc;
BOOL skipMoveWindowOnce;
int localMoveType;
}
@property (assign) MRDPRailWindow* mrdpRailWindow;

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,21 @@
//
// MRDPRailWindow.h
// Mac
//
// Created by Laxmikant Rashinkar
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* MacFreeRDP
*
* Copyright 2012 Thomas Goddard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <Cocoa/Cocoa.h>

View File

@ -1,10 +1,21 @@
//
// MRDPRailWindow.m
// Mac
//
// Created by Laxmikant Rashinkar
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* MacFreeRDP
*
* Copyright 2012 Thomas Goddard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import "MRDPRailWindow.h"
@ -12,7 +23,7 @@
- (BOOL) canBecomeKeyWindow
{
return YES;
return YES;
}
@end

View File

@ -1,10 +1,21 @@
//
// MRDPView.h
// MacFreeRDP
//
// Created by Laxmikant Rashinkar
// Copyright (c) 2012 FreeRDP.org All rights reserved.
//
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* MacFreeRDP
*
* Copyright 2012 Thomas Goddard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <Cocoa/Cocoa.h>
@ -24,52 +35,52 @@
@interface MRDPView : NSView
{
CFRunLoopSourceRef run_loop_src;
CFRunLoopSourceRef run_loop_src_channels;
NSBitmapImageRep *bmiRep;
NSMutableArray *cursors;
NSMutableArray *windows;
NSTimer *pasteboard_timer;
NSRect rect;
NSRect prevWinPosition;
freerdp *rdp_instance;
rdpContext *rdp_context;
char *pixel_data;
int width;
int height;
int argc;
int titleBarHeight;
char **argv;
// RAIL stuff
MRDPWindow *currentWindow;
NSPoint savedDragLocation;
BOOL mouseInClientArea;
BOOL isRemoteApp;
BOOL firstCreateWindow;
BOOL isMoveSizeInProgress;
BOOL skipResizeOnce;
BOOL saveInitialDragLoc;
BOOL skipMoveWindowOnce;
// store state info for some keys
int kdlshift;
int kdrshift;
int kdlctrl;
int kdrctrl;
int kdlalt;
int kdralt;
int kdlmeta;
int kdrmeta;
int kdcapslock;
CFRunLoopSourceRef run_loop_src;
CFRunLoopSourceRef run_loop_src_channels;
NSBitmapImageRep* bmiRep;
NSMutableArray* cursors;
NSMutableArray* windows;
NSTimer* pasteboard_timer;
NSRect rect;
NSRect prevWinPosition;
int titleBarHeight;
freerdp* rdp_instance;
rdpContext* rdp_context;
char* pixel_data;
int width;
int height;
int argc;
char** argv;
// RAIL stuff
MRDPWindow* currentWindow;
NSPoint savedDragLocation;
BOOL mouseInClientArea;
BOOL isRemoteApp;
BOOL firstCreateWindow;
BOOL isMoveSizeInProgress;
BOOL skipResizeOnce;
BOOL saveInitialDragLoc;
BOOL skipMoveWindowOnce;
// store state info for some keys
int kdlshift;
int kdrshift;
int kdlctrl;
int kdrctrl;
int kdlalt;
int kdralt;
int kdlmeta;
int kdrmeta;
int kdcapslock;
@public
NSWindow *ourMainWindow;
NSPasteboard *pasteboard_rd; // for reading from clipboard
NSPasteboard *pasteboard_wr; // for writing to clipboard
int pasteboard_changecount;
int pasteboard_format;
int is_connected; // true when connected to RDP server
NSWindow* ourMainWindow;
NSPasteboard* pasteboard_rd; // for reading from clipboard
NSPasteboard* pasteboard_wr; // for writing to clipboard
int pasteboard_changecount;
int pasteboard_format;
int is_connected; // true when connected to RDP server
}
- (void) rdpConnectError;
@ -100,77 +111,77 @@ void pointer_set(rdpContext* context, rdpPointer* pointer);
void pointer_setNull(rdpContext* context);
void pointer_setDefault(rdpContext* context);
int rdp_connect(void);
BOOL mac_pre_connect(freerdp *inst);
BOOL mac_post_connect(freerdp *inst);
void mac_context_new(freerdp *inst, rdpContext *context);
void mac_context_free(freerdp *inst, rdpContext *context);
void mac_set_bounds(rdpContext *context, rdpBounds *bounds);
void mac_bitmap_update(rdpContext *context, BITMAP_UPDATE *bitmap);
void mac_begin_paint(rdpContext *context);
BOOL mac_pre_connect(freerdp* instance);
BOOL mac_post_connect(freerdp* instance);
void mac_context_new(freerdp* instance, rdpContext* context);
void mac_context_free(freerdp* instance, rdpContext* context);
void mac_set_bounds(rdpContext* context, rdpBounds* bounds);
void mac_bitmap_update(rdpContext* context, BITMAP_UPDATE* bitmap);
void mac_begin_paint(rdpContext* context);
void mac_end_paint(rdpContext* context);
void mac_save_state_info(freerdp *inst, rdpContext *context);
void skt_activity_cb(CFSocketRef s, CFSocketCallBackType callbackType, CFDataRef address, const void *data, void *info);
void channel_activity_cb(CFSocketRef s, CFSocketCallBackType callbackType, CFDataRef address, const void *data, void *info);
int register_fds(int *fds, int count, void *inst);
int invoke_draw_rect(rdpContext *context);
void mac_save_state_info(freerdp* instance, rdpContext* context);
void skt_activity_cb(CFSocketRef s, CFSocketCallBackType callbackType, CFDataRef address, const void* data, void* info);
void channel_activity_cb(CFSocketRef s, CFSocketCallBackType callbackType, CFDataRef address, const void* data, void* info);
int register_fds(int* fds, int count, void* instance);
int invoke_draw_rect(rdpContext* context);
int process_plugin_args(rdpSettings* settings, const char* name, RDP_PLUGIN_DATA* plugin_data, void* user_data);
int receive_channel_data(freerdp *inst, int chan_id, BYTE *data, int size, int flags, int total_size);
void process_cliprdr_event(freerdp *inst, RDP_EVENT *event);
void cliprdr_process_cb_format_list_event(freerdp *inst, RDP_CB_FORMAT_LIST_EVENT* event);
void cliprdr_send_data_request(freerdp *inst, UINT32 format);
int receive_channel_data(freerdp* instance, int chan_id, BYTE* data, int size, int flags, int total_size);
void process_cliprdr_event(freerdp* instance, RDP_EVENT* event);
void cliprdr_process_cb_format_list_event(freerdp* instance, RDP_CB_FORMAT_LIST_EVENT* event);
void cliprdr_send_data_request(freerdp* instance, UINT32 format);
void cliprdr_process_cb_monitor_ready_event(freerdp* inst);
void cliprdr_process_cb_data_response_event(freerdp *inst, RDP_CB_DATA_RESPONSE_EVENT *event);
void cliprdr_process_text(freerdp *inst, BYTE *data, int len);
void cliprdr_send_supported_format_list(freerdp *inst);
int register_channel_fds(int *fds, int count, void *inst);
void cliprdr_process_cb_data_response_event(freerdp* instance, RDP_CB_DATA_RESPONSE_EVENT* event);
void cliprdr_process_text(freerdp* instance, BYTE* data, int len);
void cliprdr_send_supported_format_list(freerdp* instance);
int register_channel_fds(int* fds, int count, void* instance);
void mac_process_rail_event(freerdp *inst, RDP_EVENT *event);
void mac_rail_register_callbacks(freerdp *inst, rdpRail *rail);
void mac_rail_CreateWindow(rdpRail *rail, rdpWindow *window);
void mac_rail_MoveWindow(rdpRail *rail, rdpWindow *window);
void mac_rail_ShowWindow(rdpRail *rail, rdpWindow *window, BYTE state);
void mac_rail_SetWindowText(rdpRail *rail, rdpWindow *window);
void mac_rail_SetWindowIcon(rdpRail *rail, rdpWindow *window, rdpIcon *icon);
void mac_rail_SetWindowRects(rdpRail *rail, rdpWindow *window);
void mac_rail_SetWindowVisibilityRects(rdpRail *rail, rdpWindow *window);
void mac_rail_DestroyWindow(rdpRail *rail, rdpWindow *window);
void mac_process_rail_get_sysparams_event(rdpChannels *channels, RDP_EVENT *event);
void mac_send_rail_client_event(rdpChannels *channels, UINT16 event_type, void *param);
void mac_process_rail_event(freerdp* instance, RDP_EVENT* event);
void mac_rail_register_callbacks(freerdp* instance, rdpRail* rail);
void mac_rail_CreateWindow(rdpRail* rail, rdpWindow* window);
void mac_rail_MoveWindow(rdpRail* rail, rdpWindow* window);
void mac_rail_ShowWindow(rdpRail* rail, rdpWindow* window, BYTE state);
void mac_rail_SetWindowText(rdpRail* rail, rdpWindow* window);
void mac_rail_SetWindowIcon(rdpRail* rail, rdpWindow* window, rdpIcon* icon);
void mac_rail_SetWindowRects(rdpRail* rail, rdpWindow* window);
void mac_rail_SetWindowVisibilityRects(rdpRail* rail, rdpWindow* window);
void mac_rail_DestroyWindow(rdpRail* rail, rdpWindow* window);
void mac_process_rail_get_sysparams_event(rdpChannels* channels, RDP_EVENT* event);
void mac_send_rail_client_event(rdpChannels* channels, UINT16 event_type, void* param);
void mac_on_free_rail_client_event(RDP_EVENT* event);
void mac_process_rail_server_sysparam_event(rdpChannels* channels, RDP_EVENT* event);
void mac_process_rail_exec_result_event(rdpChannels* channels, RDP_EVENT* event);
void mac_rail_enable_remoteapp_mode(void);
void mac_process_rail_server_minmaxinfo_event(rdpChannels* channels, RDP_EVENT* event);
void mac_process_rail_server_localmovesize_event(freerdp *inst, RDP_EVENT *event);
void apple_center_window(NSRect * r);
void apple_to_windowMove(NSRect * r, RAIL_WINDOW_MOVE_ORDER * windowMove);
void mac_process_rail_server_localmovesize_event(freerdp* instance, RDP_EVENT* event);
void apple_center_window(NSRect* r);
void apple_to_windowMove(NSRect* r, RAIL_WINDOW_MOVE_ORDER * windowMove);
struct mac_context
{
// *must* have this - do not delete
rdpContext _p;
// *must* have this - do not delete
rdpContext _p;
};
struct cursor
{
rdpPointer *pointer;
BYTE *cursor_data; // bitmapped pixel data
void *bmiRep; // NSBitmapImageRep
void *nsCursor; // NSCursor
void *nsImage; // NSImage
rdpPointer* pointer;
BYTE* cursor_data; // bitmapped pixel data
void* bmiRep; // NSBitmapImageRep
void* nsCursor; // NSCursor
void* nsImage; // NSImage
};
struct rgba_data
{
char red;
char green;
char blue;
char alpha;
char red;
char green;
char blue;
char alpha;
};
struct kkey
{
int key_code;
int flags;
int key_code;
int flags;
};

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,21 @@
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* MacFreeRDP
*
* Copyright 2012 Thomas Goddard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <Foundation/Foundation.h>
#import "MRDPRailView.h"
@ -8,8 +26,8 @@
}
@property (assign) int windowID;
@property (retain) MRDPRailWindow * window;
@property (retain) MRDPRailView * view;
@property (retain) MRDPRailWindow* window;
@property (retain) MRDPRailView* view;
@end

View File

@ -1,3 +1,21 @@
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* MacFreeRDP
*
* Copyright 2012 Thomas Goddard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "MRDPWindow.h"

View File

@ -1,10 +1,21 @@
//
// main.m
// MacFreeRDP
//
// Created by Thomas Goddard on 5/8/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* MacFreeRDP
*
* Copyright 2012 Thomas Goddard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <Cocoa/Cocoa.h>

View File

@ -27,6 +27,8 @@
#include <stdlib.h>
#include <string.h>
#include <winpr/crt.h>
#include <freerdp/utils/file.h>
#include <freerdp/locale/vkcodes.h>
#include <freerdp/locale/keyboard.h>
@ -128,7 +130,7 @@ int freerdp_keyboard_load_map(UINT32 keycode_to_vkcode[256], char* name)
keycode = atoi(keycode_string);
/* Make sure it is a valid keycode */
if (keycode < 0 || keycode > 255)
if (keycode > 255)
break;
/* Load this key mapping in the keyboard mapping */
@ -185,7 +187,7 @@ void freerdp_keyboard_load_maps(UINT32 keycode_to_vkcode[256], char* names)
char* names_end;
int keymap_loaded = 0;
memset(keycode_to_vkcode, 0, sizeof(keycode_to_vkcode));
ZeroMemory(keycode_to_vkcode, sizeof(UINT32) * 256);
kbd = names;
names_end = names + strlen(names);

View File

@ -481,7 +481,7 @@ UINT32 freerdp_keyboard_init_x11(UINT32 keyboardLayoutId, RDP_SCANCODE x11_keyco
UINT32 keycode_to_vkcode[256];
ZeroMemory(keycode_to_vkcode, sizeof(keycode_to_vkcode));
ZeroMemory(x11_keycode_to_rdp_scancode, sizeof(x11_keycode_to_rdp_scancode));
ZeroMemory(x11_keycode_to_rdp_scancode, sizeof(RDP_SCANCODE) * 256);
#ifdef __APPLE__
/* Apple X11 breaks XKB detection */

View File

@ -62,7 +62,7 @@ endif()
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
MONOLITHIC ${MONOLITHIC_BUILD}
MODULE winpr
MODULES winpr-crt winpr-synch winpr-thread)
MODULES winpr-crt winpr-synch winpr-thread winpr-utils)
if(MONOLITHIC_BUILD)
set(FREERDP_LIBS ${FREERDP_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE)

View File

@ -31,7 +31,7 @@ add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT"
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib")
if(NOT WIN32)
if((NOT WIN32) AND (NOT APPLE))
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} rt)
endif()

View File

@ -116,13 +116,10 @@ BOOL CountdownEvent_Signal(wCountdownEvent* countdown, DWORD signalCount)
if (WaitForSingleObject(countdown->event, 0) == WAIT_OBJECT_0)
oldStatus = TRUE;
countdown->count -= signalCount;
if (countdown->count < 0)
{
printf("CountdownEvent_Signal warning: count is less than zero\n");
if (signalCount <= countdown->count)
countdown->count -= signalCount;
else
countdown->count = 0;
}
if (countdown->count == 0)
newStatus = TRUE;