Author: akhaldi
Date: Thu Aug 18 10:13:31 2016
New Revision: 72285
URL:
http://svn.reactos.org/svn/reactos?rev=72285&view=rev
Log:
[MCICDA] Sync with Wine Staging 1.9.16. CORE-11866
Modified:
trunk/reactos/dll/win32/mcicda/mcicda.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/mcicda/mcicda.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mcicda/mcicda.c?…
==============================================================================
--- trunk/reactos/dll/win32/mcicda/mcicda.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mcicda/mcicda.c [iso-8859-1] Thu Aug 18 10:13:31 2016
@@ -252,6 +252,18 @@
HANDLE old = InterlockedExchangePointer(&wmcda->hCallback, NULL);
if (old) mciDriverNotify(old, wDevID, MCI_NOTIFY_SUPERSEDED);
mciDriverNotify(HWND_32(LOWORD(hWndCallBack)), wDevID, wStatus);
+}
+
+/**************************************************************************
+ * MCICDA_ReadTOC [internal]
+ */
+static BOOL MCICDA_ReadTOC(WINE_MCICDAUDIO* wmcda, CDROM_TOC *toc, DWORD *br)
+{
+ if (!device_io(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, toc, sizeof(*toc),
br, NULL)) {
+ WARN("error reading TOC !\n");
+ return FALSE;
+ }
+ return TRUE;
}
/**************************************************************************
@@ -724,11 +736,9 @@
TRACE("CURRENT_TRACK=%lu\n", lpParms->dwReturn);
break;
case MCI_STATUS_LENGTH:
- if (!device_io(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0,
- &toc, sizeof(toc), &br, NULL)) {
- WARN("error reading TOC !\n");
+ if (!MCICDA_ReadTOC(wmcda, &toc, &br))
return MCICDA_GetError(wmcda);
- }
+
if (dwFlags & MCI_TRACK) {
TRACE("MCI_TRACK #%u LENGTH=??? !\n", lpParms->dwTrack);
if (lpParms->dwTrack < toc.FirstTrack || lpParms->dwTrack > toc.LastTrack)
@@ -766,11 +776,9 @@
ret = MCI_RESOURCE_RETURNED;
break;
case MCI_STATUS_NUMBER_OF_TRACKS:
- if (!device_io(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0,
- &toc, sizeof(toc), &br, NULL)) {
- WARN("error reading TOC !\n");
+ if (!MCICDA_ReadTOC(wmcda, &toc, &br))
return MCICDA_GetError(wmcda);
- }
+
lpParms->dwReturn = toc.LastTrack - toc.FirstTrack + 1;
TRACE("MCI_STATUS_NUMBER_OF_TRACKS = %lu\n",
lpParms->dwReturn);
if (lpParms->dwReturn == (WORD)-1)
@@ -779,20 +787,16 @@
case MCI_STATUS_POSITION:
switch (dwFlags & (MCI_STATUS_START | MCI_TRACK)) {
case MCI_STATUS_START:
- if (!device_io(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0,
- &toc, sizeof(toc), &br, NULL)) {
- WARN("error reading TOC !\n");
+ if (!MCICDA_ReadTOC(wmcda, &toc, &br))
return MCICDA_GetError(wmcda);
- }
+
lpParms->dwReturn = FRAME_OF_TOC(toc, toc.FirstTrack);
TRACE("get MCI_STATUS_START !\n");
break;
case MCI_TRACK:
- if (!device_io(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0,
- &toc, sizeof(toc), &br, NULL)) {
- WARN("error reading TOC !\n");
+ if (!MCICDA_ReadTOC(wmcda, &toc, &br))
return MCICDA_GetError(wmcda);
- }
+
if (lpParms->dwTrack < toc.FirstTrack || lpParms->dwTrack > toc.LastTrack)
return MCIERR_OUTOFRANGE;
lpParms->dwReturn = FRAME_OF_TOC(toc, lpParms->dwTrack);
@@ -837,11 +841,9 @@
if (!(dwFlags & MCI_TRACK))
ret = MCIERR_MISSING_PARAMETER;
else {
- if (!device_io(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0,
- &toc, sizeof(toc), &br, NULL)) {
- WARN("error reading TOC !\n");
+ if (!MCICDA_ReadTOC(wmcda, &toc, &br))
return MCICDA_GetError(wmcda);
- }
+
if (lpParms->dwTrack < toc.FirstTrack || lpParms->dwTrack > toc.LastTrack)
ret = MCIERR_OUTOFRANGE;
else
@@ -869,11 +871,9 @@
int i;
DWORD br;
CDROM_TOC toc;
- if (!device_io(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0,
- &toc, sizeof(toc), &br, NULL)) {
- WARN("error reading TOC !\n");
+ if (!MCICDA_ReadTOC(wmcda, &toc, &br))
return MCICDA_GetError(wmcda);
- }
+
if (*frame < FRAME_OF_TOC(toc,toc.FirstTrack) ||
*frame >= FRAME_OF_TOC(toc,toc.LastTrack+1)) /* lead-out */
return MCIERR_OUTOFRANGE;
@@ -916,11 +916,8 @@
if (wmcda == NULL)
return MCIERR_INVALID_DEVICE_ID;
- if (!device_io(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0,
- &toc, sizeof(toc), &br, NULL)) {
- WARN("error reading TOC !\n");
+ if (!MCICDA_ReadTOC(wmcda, &toc, &br))
return MCICDA_GetError(wmcda);
- }
if (dwFlags & MCI_FROM) {
start = MCICDA_CalcFrame(wmcda, lpParms->dwFrom);
@@ -1200,11 +1197,9 @@
* then only checks the position flags, then stops and seeks. */
MCICDA_Stop(wDevID, MCI_WAIT, 0);
- if (!device_io(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0,
- &toc, sizeof(toc), &br, NULL)) {
- WARN("error reading TOC !\n");
+ if (!MCICDA_ReadTOC(wmcda, &toc, &br))
return MCICDA_GetError(wmcda);
- }
+
switch (position) {
case MCI_SEEK_TO_START:
TRACE("Seeking to start\n");
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Thu Aug 18 10:13:31 2016
@@ -93,7 +93,7 @@
reactos/dll/win32/lz32 # Synced to WineStaging-1.9.11
reactos/dll/win32/mapi32 # Synced to WineStaging-1.9.11
reactos/dll/win32/mciavi32 # Synced to WineStaging-1.9.16
-reactos/dll/win32/mcicda # Synced to WineStaging-1.9.11
+reactos/dll/win32/mcicda # Synced to WineStaging-1.9.16
reactos/dll/win32/mciqtz32 # Synced to WineStaging-1.9.11
reactos/dll/win32/mciseq # Synced to WineStaging-1.9.11
reactos/dll/win32/mciwave # Synced to WineStaging-1.9.11