[Bug 2338] DVD Shrink cannot Open Disc

Wine Bugs wine-bugs at winehq.org
Sun Jul 25 02:40:21 CDT 2004


http://bugs.winehq.org/show_bug.cgi?id=2338





------- Additional Comments From jonathan at ernstfamily.ch  2004-25-07 02:40 -------
Here is the answer form the author; I splitted his answr in two part and put the
other part in bug 2339.

To see the original answer with correct indentation, please read here:
http://forum.digital-digest.com/showthread.php?s=&postid=183082#post183082

--------------------
SC_GET_DISK_INFO is sent once for each device during ASPI initialization, while
searching for the CDROM device which matches the drive specified.

I attached some code snippets, if you need more information, feel free to
contact me directly: dvdshrink "at" dvdshrink.info


uint32 CDvdCSS::ScanASPIDevices(int ndrive, int nadapters)
{
	ASSERT(m_haspi);
	ASSERT(m_psend);

	// scan each device adapter and lun until we find the one for our
	// drive...

	for (int i = 0; i < nadapters; i++)
	{
		for (int j = 0; j < 15; j++)
		{
			struct SRB_GetDiskInfo srbdisk = {0};
			srbdisk.SRB_Cmd = SC_GET_DISK_INFO;
			srbdisk.SRB_HaId = (uchar) i;
			srbdisk.SRB_Target = (uchar) j;
			m_psend((SRB_ExecSCSICmd *) &srbdisk);

			// make sure we have a cdrom device!

			if (srbdisk.SRB_Status == SS_COMP &&
				srbdisk.SRB_Int13HDriveInfo == ndrive)
			{
				struct SRB_GetDEVBlock srbdev = {0};
				srbdev.SRB_Cmd = SC_GET_DEV_TYPE;
				srbdev.SRB_HaId = (uchar) i;
				srbdev.SRB_Target = (uchar) j;
				m_psend((SRB_ExecSCSICmd *) &srbdev);

				if (srbdev.SRB_Status == SS_COMP &&
					srbdev.SRB_DeviceType == DTYPE_CDROM)
				{
					return MAKEWORD(i, j);
				}
			}
		}
	}

	// oops!

	ASSERT(0);
	throw new CError(ERROR_ASPI_FAILED);
}

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the wine-bugs mailing list