Exemplo n.º 1
0
 public static void SubscribeToErrorInfo(rdpContext *context, ErrorInfoEventHandlerDelegate handler)
 {
     if (NativeMethods.PubSub_Subscribe(context->pubSub, "ErrorInfo", Marshal.GetFunctionPointerForDelegate(handler)) != 0)
     {
         throw new FreeRdpException("Failed to subscribe to ErrorInfo event");
     }
 }
Exemplo n.º 2
0
        public RDP()
        {
            string assemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            if (_winsock == -1)
            {
                _winsock = Tcp.WSAStartup();
            }


            _freerdp = NativeMethods.freerdp_new();
            if (_freerdp == null)
            {
                throw new FreeRdpException("FreeRDP create failed");
            }

            _iUpdate          = null;
            _iPrimaryUpdate   = null;
            _iSecondaryUpdate = null;
            _iAltSecUpdate    = null;

            _terminateEventHandlerDelegate = new TerminateEventHandlerDelegate(TerminateEvent);
            _errorInfoEventHandlerDelegate = new ErrorInfoEventHandlerDelegate(ErrorInfoEvent);

            _hContextNew  = new pContextNew(ContextNew);
            _hContextFree = new pContextFree(ContextFree);

            _freerdp->ContextNew  = Marshal.GetFunctionPointerForDelegate(_hContextNew);
            _freerdp->ContextFree = Marshal.GetFunctionPointerForDelegate(_hContextFree);

            _hAuthenticate      = new pAuthenticate(Authenticate);
            _hVerifyCertificate = new pVerifyCertificate(VerifyCertificate);

            _freerdp->Authenticate      = Marshal.GetFunctionPointerForDelegate(_hAuthenticate);
            _freerdp->VerifyCertificate = Marshal.GetFunctionPointerForDelegate(_hVerifyCertificate);

            //NativeMethods.freerdp_context_new(_freerdp);

            //_settings = _freerdp->settings;
        }
Exemplo n.º 3
0
 public static void UnSubscribeToErrorInfo(rdpContext *context, ErrorInfoEventHandlerDelegate handler)
 {
     NativeMethods.PubSub_Unsubscribe(context->pubSub, "ErrorInfo", Marshal.GetFunctionPointerForDelegate(handler));
 }