private static unsafe int DoConnectionComplete(IntPtr aPtr, uint aVersion, int aConnectionID)
        {
            GCHandle gch = GCHandle.FromIntPtr(aPtr);
            DvServiceUpnpOrgConnectionManager1 self = (DvServiceUpnpOrgConnectionManager1)gch.Target;

            self.ConnectionComplete(aVersion, aConnectionID);
            return(0);
        }
        private static unsafe int DoGetCurrentConnectionIDs(IntPtr aPtr, uint aVersion, char **aConnectionIDs)
        {
            GCHandle gch = GCHandle.FromIntPtr(aPtr);
            DvServiceUpnpOrgConnectionManager1 self = (DvServiceUpnpOrgConnectionManager1)gch.Target;
            string connectionIDs;

            self.GetCurrentConnectionIDs(aVersion, out connectionIDs);
            *aConnectionIDs = (char *)Marshal.StringToHGlobalAnsi(connectionIDs).ToPointer();
            return(0);
        }
        private static unsafe int DoGetProtocolInfo(IntPtr aPtr, uint aVersion, char **aSource, char **aSink)
        {
            GCHandle gch = GCHandle.FromIntPtr(aPtr);
            DvServiceUpnpOrgConnectionManager1 self = (DvServiceUpnpOrgConnectionManager1)gch.Target;
            string source;
            string sink;

            self.GetProtocolInfo(aVersion, out source, out sink);
            *aSource = (char *)Marshal.StringToHGlobalAnsi(source).ToPointer();
            *aSink   = (char *)Marshal.StringToHGlobalAnsi(sink).ToPointer();
            return(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);
            DvServiceUpnpOrgConnectionManager1 self = (DvServiceUpnpOrgConnectionManager1)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);
        }
        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);
            DvServiceUpnpOrgConnectionManager1 self = (DvServiceUpnpOrgConnectionManager1)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);
        }