Exemplo n.º 1
0
        public RDP()
        {
            if (winsock == -1)
            {
                winsock = Tcp.WSAStartup();
            }

            handle = freerdp_new();

            iUpdate          = null;
            iPrimaryUpdate   = null;
            iSecondaryUpdate = null;
            iAltSecUpdate    = null;

            hContextNew  = new pContextNew(ContextNew);
            hContextFree = new pContextFree(ContextFree);

            handle->ContextNew  = Marshal.GetFunctionPointerForDelegate(hContextNew);
            handle->ContextFree = Marshal.GetFunctionPointerForDelegate(hContextFree);

            hAuthenticate      = new pAuthenticate(Authenticate);
            hVerifyCertificate = new pVerifyCertificate(VerifyCertificate);

            handle->Authenticate      = Marshal.GetFunctionPointerForDelegate(hAuthenticate);
            handle->VerifyCertificate = Marshal.GetFunctionPointerForDelegate(hVerifyCertificate);

            freerdp_context_new(handle);
        }
Exemplo n.º 2
0
        public void RegisterInterface(IAltSecUpdate iAltSec)
        {
            CreateOffscreenBitmap = new CreateOffscreenBitmapDelegate(iAltSec.CreateOffscreenBitmap);
            SwitchSurface         = new SwitchSurfaceDelegate(iAltSec.SwitchSurface);
            CreateNineGridBitmap  = new CreateNineGridBitmapDelegate(iAltSec.CreateNineGridBitmap);
            FrameMarker           = new FrameMarkerDelegate(iAltSec.FrameMarker);
            StreamBitmapFirst     = new StreamBitmapFirstDelegate(iAltSec.StreamBitmapFirst);
            StreamBitmapNext      = new StreamBitmapNextDelegate(iAltSec.StreamBitmapNext);
            DrawGdiPlusFirst      = new DrawGdiPlusFirstDelegate(iAltSec.DrawGdiPlusFirst);
            DrawGdiPlusNext       = new DrawGdiPlusNextDelegate(iAltSec.DrawGdiPlusNext);
            DrawGdiPlusEnd        = new DrawGdiPlusEndDelegate(iAltSec.DrawGdiPlusEnd);
            DrawGdiPlusCacheFirst = new DrawGdiPlusCacheFirstDelegate(iAltSec.DrawGdiPlusCacheFirst);
            DrawGdiPlusCacheNext  = new DrawGdiPlusCacheNextDelegate(iAltSec.DrawGdiPlusCacheNext);
            DrawGdiPlusCacheEnd   = new DrawGdiPlusCacheEndDelegate(iAltSec.DrawGdiPlusCacheEnd);

            altsec->CreateOffscreenBitmap = Marshal.GetFunctionPointerForDelegate(CreateOffscreenBitmap);
            altsec->SwitchSurface         = Marshal.GetFunctionPointerForDelegate(SwitchSurface);
            altsec->CreateNineGridBitmap  = Marshal.GetFunctionPointerForDelegate(CreateNineGridBitmap);
            altsec->FrameMarker           = Marshal.GetFunctionPointerForDelegate(FrameMarker);
            altsec->StreamBitmapFirst     = Marshal.GetFunctionPointerForDelegate(StreamBitmapFirst);
            altsec->StreamBitmapNext      = Marshal.GetFunctionPointerForDelegate(StreamBitmapNext);
            altsec->DrawGdiPlusFirst      = Marshal.GetFunctionPointerForDelegate(DrawGdiPlusFirst);
            altsec->DrawGdiPlusNext       = Marshal.GetFunctionPointerForDelegate(DrawGdiPlusNext);
            altsec->DrawGdiPlusEnd        = Marshal.GetFunctionPointerForDelegate(DrawGdiPlusEnd);
            altsec->DrawGdiPlusCacheFirst = Marshal.GetFunctionPointerForDelegate(DrawGdiPlusCacheFirst);
            altsec->DrawGdiPlusCacheNext  = Marshal.GetFunctionPointerForDelegate(DrawGdiPlusCacheNext);
            altsec->DrawGdiPlusCacheEnd   = Marshal.GetFunctionPointerForDelegate(DrawGdiPlusCacheEnd);
        }
Exemplo n.º 3
0
        public RDP()
        {
            handle = freerdp_new();

            iUpdate = null;
            iPrimaryUpdate = null;
            iSecondaryUpdate = null;
            iAltSecUpdate = null;

            hContextNew = new pContextNew(ContextNew);
            hContextFree = new pContextFree(ContextFree);

            handle->ContextNew = Marshal.GetFunctionPointerForDelegate(hContextNew);
            handle->ContextFree = Marshal.GetFunctionPointerForDelegate(hContextFree);

            freerdp_context_new(handle);
        }
Exemplo n.º 4
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.º 5
0
        public RDP()
        {
            handle = freerdp_new();

            iUpdate = null;
            iPrimaryUpdate = null;
            iSecondaryUpdate = null;
            iAltSecUpdate = null;

            hContextNew = new pContextNew(ContextNew);
            hContextFree = new pContextFree(ContextFree);

            handle->ContextNew = Marshal.GetFunctionPointerForDelegate(hContextNew);
            handle->ContextFree = Marshal.GetFunctionPointerForDelegate(hContextFree);

            hAuthenticate = new pAuthenticate(Authenticate);
            hVerifyCertificate = new pVerifyCertificate(VerifyCertificate);

            handle->Authenticate = Marshal.GetFunctionPointerForDelegate(hAuthenticate);
            handle->VerifyCertificate = Marshal.GetFunctionPointerForDelegate(hVerifyCertificate);

            freerdp_context_new(handle);
        }
Exemplo n.º 6
0
		public void RegisterInterface(IAltSecUpdate iAltSec)
		{
			CreateOffscreenBitmap = new CreateOffscreenBitmapDelegate(iAltSec.CreateOffscreenBitmap);
			SwitchSurface = new SwitchSurfaceDelegate(iAltSec.SwitchSurface);
			CreateNineGridBitmap = new CreateNineGridBitmapDelegate(iAltSec.CreateNineGridBitmap);
			FrameMarker = new FrameMarkerDelegate(iAltSec.FrameMarker);
			StreamBitmapFirst = new StreamBitmapFirstDelegate(iAltSec.StreamBitmapFirst);
			StreamBitmapNext = new StreamBitmapNextDelegate(iAltSec.StreamBitmapNext);
			DrawGdiPlusFirst = new DrawGdiPlusFirstDelegate(iAltSec.DrawGdiPlusFirst);
			DrawGdiPlusNext = new DrawGdiPlusNextDelegate(iAltSec.DrawGdiPlusNext);
			DrawGdiPlusEnd = new DrawGdiPlusEndDelegate(iAltSec.DrawGdiPlusEnd);
			DrawGdiPlusCacheFirst = new DrawGdiPlusCacheFirstDelegate(iAltSec.DrawGdiPlusCacheFirst);
			DrawGdiPlusCacheNext = new DrawGdiPlusCacheNextDelegate(iAltSec.DrawGdiPlusCacheNext);
			DrawGdiPlusCacheEnd = new DrawGdiPlusCacheEndDelegate(iAltSec.DrawGdiPlusCacheEnd);
			
			altsec->CreateOffscreenBitmap = Marshal.GetFunctionPointerForDelegate(CreateOffscreenBitmap);
			altsec->SwitchSurface = Marshal.GetFunctionPointerForDelegate(SwitchSurface);
			altsec->CreateNineGridBitmap = Marshal.GetFunctionPointerForDelegate(CreateNineGridBitmap);
			altsec->FrameMarker = Marshal.GetFunctionPointerForDelegate(FrameMarker);
			altsec->StreamBitmapFirst = Marshal.GetFunctionPointerForDelegate(StreamBitmapFirst);
			altsec->StreamBitmapNext = Marshal.GetFunctionPointerForDelegate(StreamBitmapNext);
			altsec->DrawGdiPlusFirst = Marshal.GetFunctionPointerForDelegate(DrawGdiPlusFirst);
			altsec->DrawGdiPlusNext = Marshal.GetFunctionPointerForDelegate(DrawGdiPlusNext);
			altsec->DrawGdiPlusEnd = Marshal.GetFunctionPointerForDelegate(DrawGdiPlusEnd);
			altsec->DrawGdiPlusCacheFirst = Marshal.GetFunctionPointerForDelegate(DrawGdiPlusCacheFirst);
			altsec->DrawGdiPlusCacheNext = Marshal.GetFunctionPointerForDelegate(DrawGdiPlusCacheNext);
			altsec->DrawGdiPlusCacheEnd = Marshal.GetFunctionPointerForDelegate(DrawGdiPlusCacheEnd);
		}