Merge branch 'ports'
authorEmmanuel Ledoux <eledoux@hp.com>
Mon, 30 Jun 2014 15:22:15 +0000 (17:22 +0200)
committerEmmanuel Ledoux <emmanuel.ledoux@hp.com>
Mon, 30 Jun 2014 15:22:15 +0000 (17:22 +0200)
Conflicts:
channels/serial/client/serial_tty.c

1  2 
.gitignore
channels/serial/client/serial_main.c
client/common/cmdline.c
include/freerdp/settings.h
libfreerdp/common/settings.c
winpr/include/winpr/file.h
winpr/libwinpr/file/file.c
winpr/libwinpr/handle/handle.c
winpr/libwinpr/handle/handle.h

diff --cc .gitignore
Simple merge
  #include <unistd.h>
  #endif
  
- #include "serial_tty.h"
- #include "serial_constants.h"
+ #include <winpr/collections.h>
+ #include <winpr/comm.h>
  #include <winpr/crt.h>
- #include <winpr/wlog.h>
+ #include <winpr/stream.h>
  #include <winpr/synch.h>
  #include <winpr/thread.h>
- #include <winpr/stream.h>
- #include <winpr/collections.h>
+ /* #include <winpr/wlog.h> */
  
  #include <freerdp/freerdp.h>
 -#include <freerdp/utils/list.h>
  #include <freerdp/channels/rdpdr.h>
 -#include <freerdp/utils/svc_plugin.h>
  
+ #define MAX_IRP_THREADS       5
  typedef struct _SERIAL_DEVICE SERIAL_DEVICE;
  
  struct _SERIAL_DEVICE
@@@ -276,8 -439,8 +437,7 @@@ static void serial_process_irp(SERIAL_D
                        break;
  
                default:
 -                      DEBUG_WARN("MajorFunction 0x%X not supported", irp->MajorFunction);
                        irp->IoStatus = STATUS_NOT_SUPPORTED;
-                       irp->Complete(irp);
                        break;
        }
  }
@@@ -400,7 -385,11 +400,10 @@@ int freerdp_client_add_device_channel(r
                if (count > 2)
                        serial->Path = _strdup(params[2]);
  
+               if (count > 3)
+                       serial->Driver = _strdup(params[3]);
                freerdp_device_collection_add(settings, (RDPDR_DEVICE*) serial);
 -              settings->DeviceRedirection = TRUE;
  
                return 1;
        }
Simple merge
Simple merge
@@@ -331,6 -344,6 +344,7 @@@ WINPR_API LPSTR FilePatternFindNextWild
  
  WINPR_API int UnixChangeFileMode(const char* filename, int flags);
  
++WINPR_API BOOL IsNamedPipeFileNameA(LPCSTR lpName);
  WINPR_API char* GetNamedPipeNameWithoutPrefixA(LPCSTR lpName);
  WINPR_API char* GetNamedPipeUnixDomainSocketBaseFilePathA(void);
  WINPR_API char* GetNamedPipeUnixDomainSocketFilePathA(LPCSTR lpName);
Simple merge
  #include <unistd.h>
  #endif
  
 +#include <assert.h>
 +
  #include "../handle/handle.h"
  
+ /* _HandleCreators is a NULL-terminated array with a maximun of HANDLE_CREATOR_MAX HANDLE_CREATOR */
+ #define HANDLE_CLOSE_CB_MAX 128
+ static HANDLE_CLOSE_CB **_HandleCloseCbs = NULL;
+ static pthread_once_t _HandleCloseCbsInitialized = PTHREAD_ONCE_INIT;
+ static void _HandleCloseCbsInit()
+ {
+       /* NB: error management to be done outside of this function */
+       assert(_HandleCloseCbs == NULL);
+       _HandleCloseCbs = (HANDLE_CLOSE_CB**)calloc(HANDLE_CLOSE_CB_MAX+1, sizeof(HANDLE_CLOSE_CB*));
+       assert(_HandleCloseCbs != NULL);
+ }
+ /**
+  * Returns TRUE on success, FALSE otherwise.
+  */
+ BOOL RegisterHandleCloseCb(HANDLE_CLOSE_CB *pHandleCloseCb)
+ {
+       int i;
+       if (pthread_once(&_HandleCloseCbsInitialized, _HandleCloseCbsInit) != 0)
+       {
+               return FALSE;
+       }
+       if (_HandleCloseCbs == NULL)
+       {
+               return FALSE;
+       }
+       for (i=0; i<HANDLE_CLOSE_CB_MAX; i++)
+       {
+               if (_HandleCloseCbs[i] == NULL)
+               {
+                       _HandleCloseCbs[i] = pHandleCloseCb;
+                       return TRUE;
+               }
+       }
+       return FALSE;
+ }
  BOOL CloseHandle(HANDLE hObject)
  {
+       int i;
        ULONG Type;
        PVOID Object;
  
Simple merge