Esempio n. 1
0
        private static unsafe int DoPrepareForConnection(IntPtr aPtr, uint aVersion, char *aRemoteProtocolInfo, char *aPeerConnectionManager, int aPeerConnectionID, char *aDirection, int *aConnectionID, int *aAVTransportID, int *aRcsID)
        {
            GCHandle gch = GCHandle.FromIntPtr(aPtr);
            DvServiceUpnpOrgConnectionManager2 self = (DvServiceUpnpOrgConnectionManager2)gch.Target;
            string remoteProtocolInfo    = Marshal.PtrToStringAnsi((IntPtr)aRemoteProtocolInfo);
            string peerConnectionManager = Marshal.PtrToStringAnsi((IntPtr)aPeerConnectionManager);
            string direction             = Marshal.PtrToStringAnsi((IntPtr)aDirection);
            int    connectionID;
            int    aVTransportID;
            int    rcsID;

            self.PrepareForConnection(aVersion, remoteProtocolInfo, peerConnectionManager, aPeerConnectionID, direction, out connectionID, out aVTransportID, out rcsID);
            *aConnectionID  = connectionID;
            *aAVTransportID = aVTransportID;
            *aRcsID         = rcsID;
            return(0);
        }
Esempio n. 2
0
        private static unsafe int DoGetCurrentConnectionInfo(IntPtr aPtr, uint aVersion, int aConnectionID, int *aRcsID, int *aAVTransportID, char **aProtocolInfo, char **aPeerConnectionManager, int *aPeerConnectionID, char **aDirection, char **aStatus)
        {
            GCHandle gch = GCHandle.FromIntPtr(aPtr);
            DvServiceUpnpOrgConnectionManager2 self = (DvServiceUpnpOrgConnectionManager2)gch.Target;
            int    rcsID;
            int    aVTransportID;
            string protocolInfo;
            string peerConnectionManager;
            int    peerConnectionID;
            string direction;
            string status;

            self.GetCurrentConnectionInfo(aVersion, aConnectionID, out rcsID, out aVTransportID, out protocolInfo, out peerConnectionManager, out peerConnectionID, out direction, out status);
            *aRcsID                 = rcsID;
            *aAVTransportID         = aVTransportID;
            *aProtocolInfo          = (char *)Marshal.StringToHGlobalAnsi(protocolInfo).ToPointer();
            *aPeerConnectionManager = (char *)Marshal.StringToHGlobalAnsi(peerConnectionManager).ToPointer();
            *aPeerConnectionID      = peerConnectionID;
            *aDirection             = (char *)Marshal.StringToHGlobalAnsi(direction).ToPointer();
            *aStatus                = (char *)Marshal.StringToHGlobalAnsi(status).ToPointer();
            return(0);
        }