Exemplo n.º 1
0
        /// <summary>
        /// Retrieves the specified mode page from the device (via MODE_SENSE10)
        /// </summary>
        /// <param name="requestedModePage">
        /// Mode page to retrieve.
        /// For possible values, see the ModePageType enumeration type.
        /// </param>
        /// <param name="requestType">
        /// Type of mode page data to retrieve, for example, the current settings or
        /// the settings that are write enabled. For possible values, see the ModePageRequestType
        /// enumeration type.
        /// </param>
        /// <returns>
        /// Data buffer that contains the mode page.
        /// For details of the contents of the data buffer, see the MODE SENSE (10) command in the latest revision
        /// of the MMC specification at ftp://ftp.t10.org/t10/drafts/mmc5/.
        /// This method removes header information and other non-page data before returning the buffer.
        /// </returns>
        Byte[] IDiscRecorder2X.GetModePage(ModePageType requestedModePage, ModePageRequestType requestType)
        {
            uint   byteSize = 0;
            IntPtr modePageDataPtr;

            IDiscRecorder2Ex recorderEx = (IDiscRecorder2Ex)this;

            recorderEx.GetModePage(requestedModePage, requestType, out modePageDataPtr, ref byteSize);

            Byte[] modePageData = new Byte[byteSize];

            Marshal.Copy(modePageDataPtr, modePageData, 0, (int)byteSize);
            Marshal.FreeCoTaskMem(modePageDataPtr);

            return(modePageData);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Retrieves the specified mode page from the device (via MODE_SENSE10)
        /// </summary>
        /// <param name="requestedModePage">
        /// Mode page to retrieve. 
        /// For possible values, see the ModePageType enumeration type.
        /// </param>
        /// <param name="requestType">
        /// Type of mode page data to retrieve, for example, the current settings or 
        /// the settings that are write enabled. For possible values, see the ModePageRequestType 
        /// enumeration type.
        /// </param>
        /// <returns>
        /// Data buffer that contains the mode page. 
        /// For details of the contents of the data buffer, see the MODE SENSE (10) command in the latest revision 
        /// of the MMC specification at ftp://ftp.t10.org/t10/drafts/mmc5/. 
        /// This method removes header information and other non-page data before returning the buffer. 
        /// </returns>
        Byte[] IDiscRecorder2X.GetModePage(ModePageType requestedModePage, ModePageRequestType requestType)
        {
            uint byteSize = 0;
            IntPtr modePageDataPtr;

            IDiscRecorder2Ex recorderEx = (IDiscRecorder2Ex)this;

            recorderEx.GetModePage(requestedModePage, requestType, out modePageDataPtr, ref byteSize);

            Byte[] modePageData = new Byte[byteSize];

            Marshal.Copy(modePageDataPtr, modePageData, 0, (int)byteSize);
            Marshal.FreeCoTaskMem(modePageDataPtr);

            return modePageData;
        }