/// <summary>
        /// Receives a DL* message plist from the device.
        /// This function is a wrapper around device_link_service_receive_message.
        /// </summary>
        /// <param name="client">
        /// The connected MobileBackup client to use.
        /// </param>
        /// <param name="msg_plist">
        /// Pointer to a plist that will be set to the contents of the
        /// message plist upon successful return.
        /// </param>
        /// <param name="dlmessage">
        /// A pointer that will be set to a newly allocated char*
        /// containing the DL* string from the given plist. It is up to the caller
        /// to free the allocated memory. If this parameter is NULL
        /// it will be ignored.
        /// </param>
        /// <returns>
        /// MOBILEBACKUP2_E_SUCCESS if a DL* message was received,
        /// MOBILEBACKUP2_E_INVALID_ARG if client or message is invalid,
        /// MOBILEBACKUP2_E_PLIST_ERROR if the received plist is invalid
        /// or is not a DL* message plist, or MOBILEBACKUP2_E_MUX_ERROR if
        /// receiving from the device failed.
        /// </returns>
        public virtual MobileBackup2Error mobilebackup2_receive_message(MobileBackup2ClientHandle client, out PlistHandle msgPlist, out string dlmessage)
        {
            MobileBackup2Error returnValue;

            returnValue  = MobileBackup2NativeMethods.mobilebackup2_receive_message(client, out msgPlist, out dlmessage);
            msgPlist.Api = this.Parent;
            return(returnValue);
        }
Beispiel #2
0
        public static MobileBackup2Error mobilebackup2_receive_message(MobileBackup2ClientHandle client, out PlistHandle msgPlist, out string dlmessage)
        {
            System.Runtime.InteropServices.ICustomMarshaler dlmessageMarshaler = NativeStringMarshaler.GetInstance(null);
            System.IntPtr      dlmessageNative = System.IntPtr.Zero;
            MobileBackup2Error returnValue     = MobileBackup2NativeMethods.mobilebackup2_receive_message(client, out msgPlist, out dlmessageNative);

            dlmessage = ((string)dlmessageMarshaler.MarshalNativeToManaged(dlmessageNative));
            dlmessageMarshaler.CleanUpNativeData(dlmessageNative);
            return(returnValue);
        }