On Feb 10, 2012, at 1:30 PM, Dan Kegel wrote:
dlls/ntdll/cdrom.c | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/dlls/ntdll/cdrom.c b/dlls/ntdll/cdrom.c index 802782b..6b64203c 100644 --- a/dlls/ntdll/cdrom.c +++ b/dlls/ntdll/cdrom.c @@ -144,6 +144,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(cdrom); # define CD_FRAMES 75 /* frames per second */ #endif
+#ifdef WORDS_BIGENDIAN +#define GET_BE_DWORD(x) (x) +#else +#define GET_BE_DWORD(x) RtlUlongByteSwap(x) +#endif
static const struct iocodexs { DWORD code; @@ -2568,9 +2574,9 @@ static NTSTATUS DVD_ReadStructure(int dev, const DVD_READ_STRUCTURE *structure, p->Reserved1 = 0; p->TrackDensity = l->track_density; p->LinearDensity = l->linear_density;
p->StartingDataSector = l->start_sector;
p->EndDataSector = l->end_sector;
p->EndLayerZeroSector = l->end_sector_l0;
p->StartingDataSector = GET_BE_DWORD(l->start_sector);
p->EndDataSector = GET_BE_DWORD(l->end_sector);
p->EndLayerZeroSector = GET_BE_DWORD(l->end_sector_l0);
I don't know about this. To make your original patch work right on Mac, one of the things I had to do was get rid of the OSReadBigInt32() calls that swapped the endianness of the sector fields from big to host.
Chip
p->Reserved5 = 0; p->BCAFlag = l->bca; p->Reserved6 = 0;
-- 1.7.9
On Fri, Feb 10, 2012 at 2:00 PM, Charles Davis cdavis@mymail.mines.edu wrote:
- p->StartingDataSector = l->start_sector;
- p->EndDataSector = l->end_sector;
- p->EndLayerZeroSector = l->end_sector_l0;
- p->StartingDataSector = GET_BE_DWORD(l->start_sector);
- p->EndDataSector = GET_BE_DWORD(l->end_sector);
- p->EndLayerZeroSector = GET_BE_DWORD(l->end_sector_l0);
I don't know about this. To make your original patch work right on Mac, one of the things I had to do was get rid of the OSReadBigInt32() calls that swapped the endianness of the sector fields from big to host.
This was needed for Dragon Age Origins able to detect its disc, see http://bugs.winehq.org/show_bug.cgi?id=29667 That's our source of truth, I guess. Do you have a copy of Dragon Age handy to test with? - Dan
On Feb 10, 2012, at 4:24 PM, Dan Kegel wrote:
On Fri, Feb 10, 2012 at 2:00 PM, Charles Davis cdavis@mymail.mines.edu wrote:
p->StartingDataSector = l->start_sector;
p->EndDataSector = l->end_sector;
p->EndLayerZeroSector = l->end_sector_l0;
p->StartingDataSector = GET_BE_DWORD(l->start_sector);
p->EndDataSector = GET_BE_DWORD(l->end_sector);
p->EndLayerZeroSector = GET_BE_DWORD(l->end_sector_l0);
I don't know about this. To make your original patch work right on Mac, one of the things I had to do was get rid of the OSReadBigInt32() calls that swapped the endianness of the sector fields from big to host.
This was needed for Dragon Age Origins able to detect its disc, see http://bugs.winehq.org/show_bug.cgi?id=29667 That's our source of truth, I guess.
Huh. I guess then that's a problem with your test program, which fails because the descriptor returned from SCSI pass-through (at least, on Mac) has those fields in big-endian order, but the descriptor returned from the IOCTL has them in host order, and the test program compares them directly without swapping one or the other.
Do you have a copy of Dragon Age handy to test with?
No, not for Windows, anyway. I have plenty of other DVD games, though.
Chip
I sent a new patchset to Charles for testing, will post it once we've converged.