Exemplo n.º 1
0
            public static void GetCdTextInfo(UnixFileDescriptor fd, out MMC.CDTextDescriptor cdtext)
            {
                var cmd = MMC.CDB.ReadTocPmaAtip.CDText();

                try { NativeApi.SendSCSIRequest(fd, ref cmd, out cdtext); }
                catch (Exception e) { throw new IOException("Failed to retrieve CD-TEXT information.", e); }
                cdtext.FixUp();
            }
Exemplo n.º 2
0
            public static void GetCdTextInfo(SafeFileHandle hDevice, out MMC.CDTextDescriptor cdtext)
            {
                var req       = new NativeApi.TOCRequest(MMC.TOCRequestFormat.CDText);
                var reqlen    = Util.SizeOfStructure <TOCRequest>();
                var cdtextlen = Util.SizeOfStructure <MMC.CDTextDescriptor>();
                var ok        = NativeApi.DeviceIoControl(hDevice, IOCTL.CDROM_READ_TOC_EX, ref req, reqlen, out cdtext, cdtextlen, out int _, IntPtr.Zero);

                if (!ok)
                {
                    throw new IOException("Failed to retrieve CD-TEXT information.", new Win32Exception(Marshal.GetLastWin32Error()));
                }
                cdtext.FixUp();
            }
Exemplo n.º 3
0
 private static extern bool DeviceIoControl(SafeFileHandle hDevice, IOCTL command, ref TOCRequest request, int nInBufferSize, out MMC.CDTextDescriptor data, int dataSize, out int pBytesReturned, IntPtr overlapped);