1994-07-07 18:23:58 +02:00
|
|
|
/*
|
2000-02-07 17:28:52 +01:00
|
|
|
* MCI driver for audio CD (MCICDA)
|
1994-07-07 18:23:58 +02:00
|
|
|
*
|
1999-02-02 16:25:16 +01:00
|
|
|
* Copyright 1994 Martin Ayotte
|
|
|
|
* Copyright 1998-99 Eric Pouech
|
2000-02-07 17:28:52 +01:00
|
|
|
* Copyright 2000 Andreas Mohr
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
Release 950620
Mon Jun 19 20:29:50 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
* [debugger/*.c]
Modified debugger to use segmented pointers everywhere.
* [if1632/shell.spec] [if1632/sound.spec] [if1632/user.spec]
Declared all functions that return only 16-bit as 'pascal16'.
* [include/ldt.h] [memory/ldt.c]
Export LDT_EntryToBytes (new) and LDT_BytesToEntry for DPMI.
Maintain a copy of the selector flags, removing the need to make a
system call to retrieve an LDT entry.
* [loader/module.c]
Fixed bug with module file handle cache.
* [loader/ne_resource.c]
Fixed file name bug in NE_AccessResource().
* [loader/resource.c]
Fixed bug in LoadIcon() that caused wrong colors to be used for
the icon mask.
* [loader/signal.c]
Moved instruction emulation to miscemu/instr.c.
* [misc/dos_fs.c] [miscemu/int21.c]
Lots of small fixes, thanks to Morten Welinder.
* [miscemu/dpmi.c]
More complete DPMI emulation.
* [miscemu/instr.c]
Added support for prefixes in instructions to emulate.
* [miscemu/int2f.c]
Use register macros instead of destroying the high part of 32-bit
registers.
* [objects/dc.c]
Fixed bug in GetDCState() that failed to clear the new DC.
* [rc/sysres.rc]
Removed dialogs 11 and 12 that were never used.
* [tools/build.c]
'pascal16' generated functions did not save %dx.
Removed use of %fs to access the stack.
%ds is no longer initialized before calling a 16-bit routine.
* [windows/defwnd.c]
Accept a NULL pointer as window title.
* [windows/mdi.c]
MDICascade: skip iconic windows.
Implemented CalcChildScroll().
* [windows/utility.c]
Fixed MulDiv() for illegal values.
* [windows/win.c]
Fixed X error in CreateWindowEx() when WM_NCCALCSIZE returned
a zero width or height.
Sun Jun 18 22:22:30 MET DST 1995 Fons Botman (botman@inter.nl.net)
* [controls/edit.c]
Fixed "uninitalized" message which -Wall couldnt see to be ok
in EDIT_WriteText.
* [include/debug.h]
Added define for extra checks in API definitions during debugging.
* [loader/ne_image.c]
Added newline in NE_FixupPrologs to avoid long lines.
* [misc/dos_fs.c]
Added extra safety check in DOS_ValidDrive.
* [misc/exec.c]
Fixed definition of ExitWindows.
Sun Jun 18 21:16:08 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Some fixes, mostly for memory management, but also for text selection
and tab postitions. General cleanup. Notepad.exe now works.
* [controls/combo.c]
Fix: the hwnd field of the DRAWITEMSTRUCT should always be that of
the combo box, not the ComboLBox that belongs to it.
* [controls/listbox.c]
Handle itemID field correctly throughout.
* [memory/local.c]
Implemented flag LMEM_ZEROINIT.
LocalReAlloc() could trash the heap. Fixed.
* [objects/font.c]
FONT_MatchFont(): don't get confused by negative widths.
Fixed a segfault in EnumFonts().
* [objects/text.c]
DrawText(): DT_CALCRECT implies DT_NOCLIP.
* [objects/dcvalues.c]
MAKELONG was used with bad parameters in DC_GET_X_Y.
* [windows/dialog.c]
Don't show the dialog if WS_VISIBLE isn't set in the template.
* [windows/utility.c]
UTILITY_convertArgs(): Never pass an expression containing ++ into a
macro...
* [windows/win.c]
SetParent() should unlink the window before changing the parent.
* [windows/message.c]
Don't call timer functions via CallWindowProc(), since it checks
whether hwnd==0 and does not call the function in that case.
* [miscemu/instr.c]
Ignore interrupt 0x3D, for VBRUN300.DLL.
* [misc/commdlg.c]
Don't rely on the itemData field of the DRAWITEMSTRUCT to contain a
pointer to the item text.
* [if1632/relay.c]
Disable OLE and DDEML DLLs by default, since they contain nothing but
stubs anyway. SHELL, COMMDLG and WIN87EM are left enabled, although
some programs may work better without them.
* [multimedia/*.c] [include/multimedia.h] [include/driver.h]
Begun cleaning things up a little. Replaced printfs with dprintf_
macros, made functions static where possible, and some other minor
changes.
Sun Jun 11 23:19:10 1995 Martin von Loewis <martin@informatik.hu-berlin.de>
* [debugger/dbg.y][debugger/dbg.l]
Removed special handling for FILE_IDENTIFER, because it caused
problems with x/<format> statements.
* [debugger/info.c]
Use SC_ESP instead of SC_EIP for stack dump.
* [misc/compobj.c][if1632/compobj.spec]
CoBuildVersion, CoInitialize, CoUninitialize: new functions
* [misc/ole2.c][if1632/ole2.spec][misc/Imakefile][include/ole2.h]
New files ole2.c, ole2.h
OleBuildVersion, OleInitialize, OleUninitialize: new functions
* [if1632/ole2disp.spec]
Added missing ordinals above 109
* [misc/ole2nls.c][if1632/ole2nls.spec][include/winnls.h]
New file winnls.h
GetLocaleInfoA: new function
* [if1632/shell.spec]
Added FindEnvironmentString as stub
* [misc/olecli.c][if1632/olecli.spec]
OleIsDcMeta: New function
* [objects/font][misc/gdi.spec]
GetKerningPairs: new function
* [misc/shell.c]
ShellExecute: Implemented support for starting programs
* [if1632/user.spec]
Inserted missing relay to GetClipCursor
Sun Jun 11 20:34:47 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Fix a problem with the local heap.
* [include/wintypes.h]
Fixed wrong declarations of CATCHBUF and LPCATCHBUF.
* [include/mdi.h] [windows/mdi.c]
This code still assumed segmented address==linear address. Fixed.
* [include/msdos.h] [misc/dos_fs.c]
The filemask field of the dosdirent structure could be overrun. Fixed.
If you had a file called foobar and a file called foo, trying to
FindFile(foo) could accidentally find file foobar instead. Fixed.
* [misc/file.c]
OpenFile(): Always return the full pathname in ofs->szPathName. This
also fixes GetModuleFilename().
Prevent _lclose() from closing stderr or stdout.
* [misc/profile.c]
Search for .ini files in the path of the current module as well.
(Needed by Lotus Organizer.)
* [loader/task.c] [loader/ne_image.c] [loader/module.c]
[memory/local.c]
Local heaps are now initialized by InitTask() for executables. DLLs
have to call LocalInit() themselves, LocalInit() has to put the
heap at the end of the segment when called with start==0. We no longer
allocate the DGROUP with 64k on startup, but grow the local heap
in LOCAL_GetBlock() when necessary.
* [loader/module.c]
LoadLibrary() should call LoadModule() in all cases, even if the
DLL is already loaded, to ensure that the reference count is correct.
* [loader/ne_image.c]
Some changes to function prolog fixup. Does anyone know exactly how
this is supposed to work? I am only guessing here.
In NE_InitializeDLLs(), initialize the DLLs a module refers to before
the module itself.
* [loader/task.c]
Initialize instance data at the beginning of the DGROUP in InitTask().
* [memory/local.c]
Some fixes for moveable blocks.
* [memory/selector.c]
All the IsBad*Pointer() functions returned exactly the wrong boolean
value in all cases!
* [objects/bitblt.c]
Fixed another null pointer dereference in debugging output.
* [objects/font.c]
Some more recovery possibilities for FONT_MatchFont() if a specified
font does not exist.
* [windows/win.c]
The dialog code may call CreateWindowEx with an integer in windowName.
This happens for static icon controls that expect a resource ID as
the window name. CreateWindowEx() used to crash. Fixed.
* [windows/class.c] [windows/win.c]
Window classes are owned by modules, not instances. Changed
RegisterClass(), UnregisterClass(), GetClassInfo() and CreateWindowEx()
accordingly.
Sat Jun 10 16:10:53 1995 Olaf Flebbe <o.flebbe@science-computing.uni-tuebingen.de>
* [miscemu/int21.c]
clock.exe was displaying incorrect year.
Fri Jun 9 20:36:56 1995 Victor Schneider <tailor@crl.com>
* [include/cursor.h] [windows/cursor.c]
Implemented CreateCursorIconIndirect().
1995-06-20 21:08:12 +02:00
|
|
|
*/
|
|
|
|
|
2000-02-10 20:03:02 +01:00
|
|
|
#include "config.h"
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
2000-02-10 23:15:21 +01:00
|
|
|
#include <stdio.h>
|
2001-01-26 21:43:40 +01:00
|
|
|
#include <string.h>
|
2000-12-19 05:53:20 +01:00
|
|
|
|
2005-11-28 17:32:54 +01:00
|
|
|
#define WIN32_NO_STATUS
|
2000-02-10 20:03:02 +01:00
|
|
|
#include "windef.h"
|
2000-12-19 05:53:20 +01:00
|
|
|
#include "winbase.h"
|
2000-02-10 20:03:02 +01:00
|
|
|
#include "wingdi.h"
|
1999-02-22 11:16:00 +01:00
|
|
|
#include "winuser.h"
|
2002-10-17 18:43:42 +02:00
|
|
|
#include "wownt32.h"
|
1999-09-05 18:44:38 +02:00
|
|
|
#include "mmddk.h"
|
2002-01-13 02:46:12 +01:00
|
|
|
#include "winioctl.h"
|
|
|
|
#include "ntddcdrm.h"
|
2005-11-28 17:32:54 +01:00
|
|
|
#include "winternl.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
2005-02-09 23:26:25 +01:00
|
|
|
#include "wine/unicode.h"
|
2009-02-26 17:46:49 +01:00
|
|
|
#include "dsound.h"
|
1994-07-07 18:23:58 +02:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(mcicda);
|
1999-04-19 16:56:29 +02:00
|
|
|
|
2002-01-13 02:46:12 +01:00
|
|
|
#define CDFRAMES_PERSEC 75
|
|
|
|
#define CDFRAMES_PERMIN (CDFRAMES_PERSEC * 60)
|
|
|
|
#define FRAME_OF_ADDR(a) ((a)[1] * CDFRAMES_PERMIN + (a)[2] * CDFRAMES_PERSEC + (a)[3])
|
|
|
|
#define FRAME_OF_TOC(toc, idx) FRAME_OF_ADDR((toc).TrackData[idx - (toc).FirstTrack].Address)
|
|
|
|
|
2009-02-26 17:46:49 +01:00
|
|
|
/* Defined by red-book standard; do not change! */
|
|
|
|
#define RAW_SECTOR_SIZE (2352)
|
|
|
|
|
|
|
|
/* Must be >= RAW_SECTOR_SIZE */
|
|
|
|
#define CDDA_FRAG_SIZE (32768)
|
|
|
|
/* Must be >= 2 */
|
|
|
|
#define CDDA_FRAG_COUNT (3)
|
|
|
|
|
1994-07-07 18:23:58 +02:00
|
|
|
typedef struct {
|
1999-09-05 18:44:38 +02:00
|
|
|
UINT wDevID;
|
1998-10-11 16:14:24 +02:00
|
|
|
int nUseCount; /* Incremented for each shared open */
|
1999-09-05 18:44:38 +02:00
|
|
|
BOOL fShareable; /* TRUE if first open was shareable */
|
1998-10-11 16:14:24 +02:00
|
|
|
WORD wNotifyDeviceID; /* MCI device ID with a pending notification */
|
1999-09-05 18:44:38 +02:00
|
|
|
HANDLE hCallback; /* Callback handle for pending notification */
|
1998-10-11 16:14:24 +02:00
|
|
|
DWORD dwTimeFormat;
|
2002-01-13 02:46:12 +01:00
|
|
|
HANDLE handle;
|
2009-02-26 17:46:49 +01:00
|
|
|
|
|
|
|
/* The following are used for digital playback only */
|
|
|
|
HANDLE hThread;
|
|
|
|
HANDLE stopEvent;
|
|
|
|
DWORD start, end;
|
|
|
|
|
|
|
|
IDirectSound *dsObj;
|
|
|
|
IDirectSoundBuffer *dsBuf;
|
|
|
|
|
|
|
|
CRITICAL_SECTION cs;
|
1999-02-02 16:25:16 +01:00
|
|
|
} WINE_MCICDAUDIO;
|
1994-07-07 18:23:58 +02:00
|
|
|
|
|
|
|
/*-----------------------------------------------------------------------*/
|
|
|
|
|
2009-02-26 17:46:49 +01:00
|
|
|
typedef HRESULT(WINAPI*LPDIRECTSOUNDCREATE)(LPCGUID,LPDIRECTSOUND*,LPUNKNOWN);
|
|
|
|
static LPDIRECTSOUNDCREATE pDirectSoundCreate;
|
|
|
|
|
|
|
|
static DWORD CALLBACK MCICDA_playLoop(void *ptr)
|
|
|
|
{
|
|
|
|
WINE_MCICDAUDIO *wmcda = (WINE_MCICDAUDIO*)ptr;
|
|
|
|
DWORD lastPos, curPos, endPos, br;
|
|
|
|
void *cdData;
|
|
|
|
DWORD lockLen, fragLen;
|
|
|
|
DSBCAPS caps;
|
|
|
|
RAW_READ_INFO rdInfo;
|
|
|
|
HRESULT hr = DS_OK;
|
|
|
|
|
|
|
|
memset(&caps, 0, sizeof(caps));
|
|
|
|
caps.dwSize = sizeof(caps);
|
|
|
|
hr = IDirectSoundBuffer_GetCaps(wmcda->dsBuf, &caps);
|
|
|
|
|
|
|
|
fragLen = caps.dwBufferBytes/CDDA_FRAG_COUNT;
|
|
|
|
curPos = lastPos = 0;
|
|
|
|
endPos = ~0u;
|
|
|
|
while (SUCCEEDED(hr) && endPos != lastPos &&
|
|
|
|
WaitForSingleObject(wmcda->stopEvent, 0) != WAIT_OBJECT_0) {
|
|
|
|
hr = IDirectSoundBuffer_GetCurrentPosition(wmcda->dsBuf, &curPos, NULL);
|
|
|
|
if ((curPos-lastPos+caps.dwBufferBytes)%caps.dwBufferBytes < fragLen) {
|
|
|
|
Sleep(1);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
EnterCriticalSection(&wmcda->cs);
|
|
|
|
rdInfo.DiskOffset.QuadPart = wmcda->start<<11;
|
|
|
|
rdInfo.SectorCount = min(fragLen/RAW_SECTOR_SIZE, wmcda->end-wmcda->start);
|
|
|
|
rdInfo.TrackMode = CDDA;
|
|
|
|
|
|
|
|
hr = IDirectSoundBuffer_Lock(wmcda->dsBuf, lastPos, fragLen, &cdData, &lockLen, NULL, NULL, 0);
|
|
|
|
if (hr == DSERR_BUFFERLOST) {
|
|
|
|
if(FAILED(IDirectSoundBuffer_Restore(wmcda->dsBuf)) ||
|
|
|
|
FAILED(IDirectSoundBuffer_Play(wmcda->dsBuf, 0, 0, DSBPLAY_LOOPING))) {
|
|
|
|
LeaveCriticalSection(&wmcda->cs);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
hr = IDirectSoundBuffer_Lock(wmcda->dsBuf, lastPos, fragLen, &cdData, &lockLen, NULL, NULL, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (SUCCEEDED(hr)) {
|
|
|
|
if (rdInfo.SectorCount > 0) {
|
|
|
|
if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_RAW_READ, &rdInfo, sizeof(rdInfo), cdData, lockLen, &br, NULL))
|
|
|
|
WARN("CD read failed at sector %d: 0x%x\n", wmcda->start, GetLastError());
|
|
|
|
}
|
|
|
|
if (rdInfo.SectorCount*RAW_SECTOR_SIZE < lockLen) {
|
|
|
|
if(endPos == ~0u) endPos = lastPos;
|
|
|
|
memset((BYTE*)cdData + rdInfo.SectorCount*RAW_SECTOR_SIZE, 0,
|
|
|
|
lockLen - rdInfo.SectorCount*RAW_SECTOR_SIZE);
|
|
|
|
}
|
|
|
|
hr = IDirectSoundBuffer_Unlock(wmcda->dsBuf, cdData, lockLen, NULL, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
lastPos += fragLen;
|
|
|
|
lastPos %= caps.dwBufferBytes;
|
|
|
|
wmcda->start += rdInfo.SectorCount;
|
|
|
|
|
|
|
|
LeaveCriticalSection(&wmcda->cs);
|
|
|
|
}
|
|
|
|
IDirectSoundBuffer_Stop(wmcda->dsBuf);
|
|
|
|
SetEvent(wmcda->stopEvent);
|
|
|
|
|
2009-02-26 17:49:42 +01:00
|
|
|
EnterCriticalSection(&wmcda->cs);
|
|
|
|
if (wmcda->hCallback) {
|
|
|
|
mciDriverNotify(wmcda->hCallback, wmcda->wNotifyDeviceID,
|
|
|
|
FAILED(hr) ? MCI_NOTIFY_FAILURE :
|
|
|
|
((endPos!=lastPos) ? MCI_NOTIFY_ABORTED :
|
|
|
|
MCI_NOTIFY_SUCCESSFUL));
|
|
|
|
wmcda->hCallback = NULL;
|
|
|
|
}
|
|
|
|
LeaveCriticalSection(&wmcda->cs);
|
|
|
|
|
2009-02-26 17:46:49 +01:00
|
|
|
ExitThread(0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1999-05-02 12:21:49 +02:00
|
|
|
/**************************************************************************
|
2002-06-01 01:06:46 +02:00
|
|
|
* MCICDA_drvOpen [internal]
|
1999-05-02 12:21:49 +02:00
|
|
|
*/
|
2005-02-09 23:26:25 +01:00
|
|
|
static DWORD MCICDA_drvOpen(LPCWSTR str, LPMCI_OPEN_DRIVER_PARMSW modp)
|
1999-05-02 12:21:49 +02:00
|
|
|
{
|
2009-02-26 17:46:49 +01:00
|
|
|
static HMODULE dsHandle;
|
2002-05-12 01:02:55 +02:00
|
|
|
WINE_MCICDAUDIO* wmcda;
|
|
|
|
|
|
|
|
if (!modp) return 0xFFFFFFFF;
|
|
|
|
|
2005-02-09 23:26:25 +01:00
|
|
|
wmcda = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WINE_MCICDAUDIO));
|
1999-07-15 16:43:13 +02:00
|
|
|
|
|
|
|
if (!wmcda)
|
|
|
|
return 0;
|
|
|
|
|
2009-02-26 17:46:49 +01:00
|
|
|
if (!dsHandle) {
|
|
|
|
dsHandle = LoadLibraryA("dsound.dll");
|
|
|
|
if(dsHandle)
|
|
|
|
pDirectSoundCreate = (LPDIRECTSOUNDCREATE)GetProcAddress(dsHandle, "DirectSoundCreate");
|
|
|
|
}
|
|
|
|
|
1999-07-15 16:43:13 +02:00
|
|
|
wmcda->wDevID = modp->wDeviceID;
|
2007-05-31 16:01:05 +02:00
|
|
|
mciSetDriverData(wmcda->wDevID, (DWORD_PTR)wmcda);
|
1999-07-24 12:45:24 +02:00
|
|
|
modp->wCustomCommandTable = MCI_NO_COMMAND_TABLE;
|
1999-09-22 18:41:32 +02:00
|
|
|
modp->wType = MCI_DEVTYPE_CD_AUDIO;
|
2009-02-26 17:46:49 +01:00
|
|
|
InitializeCriticalSection(&wmcda->cs);
|
1999-07-15 16:43:13 +02:00
|
|
|
return modp->wDeviceID;
|
1999-05-02 12:21:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
2002-06-01 01:06:46 +02:00
|
|
|
* MCICDA_drvClose [internal]
|
1999-05-02 12:21:49 +02:00
|
|
|
*/
|
2000-02-07 17:28:52 +01:00
|
|
|
static DWORD MCICDA_drvClose(DWORD dwDevID)
|
1999-05-02 12:21:49 +02:00
|
|
|
{
|
1999-07-15 16:43:13 +02:00
|
|
|
WINE_MCICDAUDIO* wmcda = (WINE_MCICDAUDIO*)mciGetDriverData(dwDevID);
|
1999-05-02 12:21:49 +02:00
|
|
|
|
|
|
|
if (wmcda) {
|
2009-02-26 17:46:49 +01:00
|
|
|
DeleteCriticalSection(&wmcda->cs);
|
1999-07-15 16:43:13 +02:00
|
|
|
HeapFree(GetProcessHeap(), 0, wmcda);
|
|
|
|
mciSetDriverData(dwDevID, 0);
|
1999-05-02 12:21:49 +02:00
|
|
|
}
|
2002-05-12 01:02:55 +02:00
|
|
|
return (dwDevID == 0xFFFFFFFF) ? 1 : 0;
|
1999-05-02 12:21:49 +02:00
|
|
|
}
|
|
|
|
|
1998-11-24 15:12:13 +01:00
|
|
|
/**************************************************************************
|
2002-06-01 01:06:46 +02:00
|
|
|
* MCICDA_GetOpenDrv [internal]
|
1998-11-24 15:12:13 +01:00
|
|
|
*/
|
2000-02-07 17:28:52 +01:00
|
|
|
static WINE_MCICDAUDIO* MCICDA_GetOpenDrv(UINT wDevID)
|
1998-11-24 15:12:13 +01:00
|
|
|
{
|
1999-07-15 16:43:13 +02:00
|
|
|
WINE_MCICDAUDIO* wmcda = (WINE_MCICDAUDIO*)mciGetDriverData(wDevID);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-10-23 02:40:23 +02:00
|
|
|
if (wmcda == NULL || wmcda->nUseCount == 0) {
|
1999-07-04 18:02:24 +02:00
|
|
|
WARN("Invalid wDevID=%u\n", wDevID);
|
1998-11-24 15:12:13 +01:00
|
|
|
return 0;
|
|
|
|
}
|
1999-05-02 12:21:49 +02:00
|
|
|
return wmcda;
|
1998-11-24 15:12:13 +01:00
|
|
|
}
|
1994-07-07 18:23:58 +02:00
|
|
|
|
Release 950620
Mon Jun 19 20:29:50 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
* [debugger/*.c]
Modified debugger to use segmented pointers everywhere.
* [if1632/shell.spec] [if1632/sound.spec] [if1632/user.spec]
Declared all functions that return only 16-bit as 'pascal16'.
* [include/ldt.h] [memory/ldt.c]
Export LDT_EntryToBytes (new) and LDT_BytesToEntry for DPMI.
Maintain a copy of the selector flags, removing the need to make a
system call to retrieve an LDT entry.
* [loader/module.c]
Fixed bug with module file handle cache.
* [loader/ne_resource.c]
Fixed file name bug in NE_AccessResource().
* [loader/resource.c]
Fixed bug in LoadIcon() that caused wrong colors to be used for
the icon mask.
* [loader/signal.c]
Moved instruction emulation to miscemu/instr.c.
* [misc/dos_fs.c] [miscemu/int21.c]
Lots of small fixes, thanks to Morten Welinder.
* [miscemu/dpmi.c]
More complete DPMI emulation.
* [miscemu/instr.c]
Added support for prefixes in instructions to emulate.
* [miscemu/int2f.c]
Use register macros instead of destroying the high part of 32-bit
registers.
* [objects/dc.c]
Fixed bug in GetDCState() that failed to clear the new DC.
* [rc/sysres.rc]
Removed dialogs 11 and 12 that were never used.
* [tools/build.c]
'pascal16' generated functions did not save %dx.
Removed use of %fs to access the stack.
%ds is no longer initialized before calling a 16-bit routine.
* [windows/defwnd.c]
Accept a NULL pointer as window title.
* [windows/mdi.c]
MDICascade: skip iconic windows.
Implemented CalcChildScroll().
* [windows/utility.c]
Fixed MulDiv() for illegal values.
* [windows/win.c]
Fixed X error in CreateWindowEx() when WM_NCCALCSIZE returned
a zero width or height.
Sun Jun 18 22:22:30 MET DST 1995 Fons Botman (botman@inter.nl.net)
* [controls/edit.c]
Fixed "uninitalized" message which -Wall couldnt see to be ok
in EDIT_WriteText.
* [include/debug.h]
Added define for extra checks in API definitions during debugging.
* [loader/ne_image.c]
Added newline in NE_FixupPrologs to avoid long lines.
* [misc/dos_fs.c]
Added extra safety check in DOS_ValidDrive.
* [misc/exec.c]
Fixed definition of ExitWindows.
Sun Jun 18 21:16:08 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Some fixes, mostly for memory management, but also for text selection
and tab postitions. General cleanup. Notepad.exe now works.
* [controls/combo.c]
Fix: the hwnd field of the DRAWITEMSTRUCT should always be that of
the combo box, not the ComboLBox that belongs to it.
* [controls/listbox.c]
Handle itemID field correctly throughout.
* [memory/local.c]
Implemented flag LMEM_ZEROINIT.
LocalReAlloc() could trash the heap. Fixed.
* [objects/font.c]
FONT_MatchFont(): don't get confused by negative widths.
Fixed a segfault in EnumFonts().
* [objects/text.c]
DrawText(): DT_CALCRECT implies DT_NOCLIP.
* [objects/dcvalues.c]
MAKELONG was used with bad parameters in DC_GET_X_Y.
* [windows/dialog.c]
Don't show the dialog if WS_VISIBLE isn't set in the template.
* [windows/utility.c]
UTILITY_convertArgs(): Never pass an expression containing ++ into a
macro...
* [windows/win.c]
SetParent() should unlink the window before changing the parent.
* [windows/message.c]
Don't call timer functions via CallWindowProc(), since it checks
whether hwnd==0 and does not call the function in that case.
* [miscemu/instr.c]
Ignore interrupt 0x3D, for VBRUN300.DLL.
* [misc/commdlg.c]
Don't rely on the itemData field of the DRAWITEMSTRUCT to contain a
pointer to the item text.
* [if1632/relay.c]
Disable OLE and DDEML DLLs by default, since they contain nothing but
stubs anyway. SHELL, COMMDLG and WIN87EM are left enabled, although
some programs may work better without them.
* [multimedia/*.c] [include/multimedia.h] [include/driver.h]
Begun cleaning things up a little. Replaced printfs with dprintf_
macros, made functions static where possible, and some other minor
changes.
Sun Jun 11 23:19:10 1995 Martin von Loewis <martin@informatik.hu-berlin.de>
* [debugger/dbg.y][debugger/dbg.l]
Removed special handling for FILE_IDENTIFER, because it caused
problems with x/<format> statements.
* [debugger/info.c]
Use SC_ESP instead of SC_EIP for stack dump.
* [misc/compobj.c][if1632/compobj.spec]
CoBuildVersion, CoInitialize, CoUninitialize: new functions
* [misc/ole2.c][if1632/ole2.spec][misc/Imakefile][include/ole2.h]
New files ole2.c, ole2.h
OleBuildVersion, OleInitialize, OleUninitialize: new functions
* [if1632/ole2disp.spec]
Added missing ordinals above 109
* [misc/ole2nls.c][if1632/ole2nls.spec][include/winnls.h]
New file winnls.h
GetLocaleInfoA: new function
* [if1632/shell.spec]
Added FindEnvironmentString as stub
* [misc/olecli.c][if1632/olecli.spec]
OleIsDcMeta: New function
* [objects/font][misc/gdi.spec]
GetKerningPairs: new function
* [misc/shell.c]
ShellExecute: Implemented support for starting programs
* [if1632/user.spec]
Inserted missing relay to GetClipCursor
Sun Jun 11 20:34:47 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Fix a problem with the local heap.
* [include/wintypes.h]
Fixed wrong declarations of CATCHBUF and LPCATCHBUF.
* [include/mdi.h] [windows/mdi.c]
This code still assumed segmented address==linear address. Fixed.
* [include/msdos.h] [misc/dos_fs.c]
The filemask field of the dosdirent structure could be overrun. Fixed.
If you had a file called foobar and a file called foo, trying to
FindFile(foo) could accidentally find file foobar instead. Fixed.
* [misc/file.c]
OpenFile(): Always return the full pathname in ofs->szPathName. This
also fixes GetModuleFilename().
Prevent _lclose() from closing stderr or stdout.
* [misc/profile.c]
Search for .ini files in the path of the current module as well.
(Needed by Lotus Organizer.)
* [loader/task.c] [loader/ne_image.c] [loader/module.c]
[memory/local.c]
Local heaps are now initialized by InitTask() for executables. DLLs
have to call LocalInit() themselves, LocalInit() has to put the
heap at the end of the segment when called with start==0. We no longer
allocate the DGROUP with 64k on startup, but grow the local heap
in LOCAL_GetBlock() when necessary.
* [loader/module.c]
LoadLibrary() should call LoadModule() in all cases, even if the
DLL is already loaded, to ensure that the reference count is correct.
* [loader/ne_image.c]
Some changes to function prolog fixup. Does anyone know exactly how
this is supposed to work? I am only guessing here.
In NE_InitializeDLLs(), initialize the DLLs a module refers to before
the module itself.
* [loader/task.c]
Initialize instance data at the beginning of the DGROUP in InitTask().
* [memory/local.c]
Some fixes for moveable blocks.
* [memory/selector.c]
All the IsBad*Pointer() functions returned exactly the wrong boolean
value in all cases!
* [objects/bitblt.c]
Fixed another null pointer dereference in debugging output.
* [objects/font.c]
Some more recovery possibilities for FONT_MatchFont() if a specified
font does not exist.
* [windows/win.c]
The dialog code may call CreateWindowEx with an integer in windowName.
This happens for static icon controls that expect a resource ID as
the window name. CreateWindowEx() used to crash. Fixed.
* [windows/class.c] [windows/win.c]
Window classes are owned by modules, not instances. Changed
RegisterClass(), UnregisterClass(), GetClassInfo() and CreateWindowEx()
accordingly.
Sat Jun 10 16:10:53 1995 Olaf Flebbe <o.flebbe@science-computing.uni-tuebingen.de>
* [miscemu/int21.c]
clock.exe was displaying incorrect year.
Fri Jun 9 20:36:56 1995 Victor Schneider <tailor@crl.com>
* [include/cursor.h] [windows/cursor.c]
Implemented CreateCursorIconIndirect().
1995-06-20 21:08:12 +02:00
|
|
|
/**************************************************************************
|
2002-01-13 02:46:12 +01:00
|
|
|
* MCICDA_GetStatus [internal]
|
1998-10-11 16:14:24 +02:00
|
|
|
*/
|
2002-01-13 02:46:12 +01:00
|
|
|
static DWORD MCICDA_GetStatus(WINE_MCICDAUDIO* wmcda)
|
Release 950620
Mon Jun 19 20:29:50 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
* [debugger/*.c]
Modified debugger to use segmented pointers everywhere.
* [if1632/shell.spec] [if1632/sound.spec] [if1632/user.spec]
Declared all functions that return only 16-bit as 'pascal16'.
* [include/ldt.h] [memory/ldt.c]
Export LDT_EntryToBytes (new) and LDT_BytesToEntry for DPMI.
Maintain a copy of the selector flags, removing the need to make a
system call to retrieve an LDT entry.
* [loader/module.c]
Fixed bug with module file handle cache.
* [loader/ne_resource.c]
Fixed file name bug in NE_AccessResource().
* [loader/resource.c]
Fixed bug in LoadIcon() that caused wrong colors to be used for
the icon mask.
* [loader/signal.c]
Moved instruction emulation to miscemu/instr.c.
* [misc/dos_fs.c] [miscemu/int21.c]
Lots of small fixes, thanks to Morten Welinder.
* [miscemu/dpmi.c]
More complete DPMI emulation.
* [miscemu/instr.c]
Added support for prefixes in instructions to emulate.
* [miscemu/int2f.c]
Use register macros instead of destroying the high part of 32-bit
registers.
* [objects/dc.c]
Fixed bug in GetDCState() that failed to clear the new DC.
* [rc/sysres.rc]
Removed dialogs 11 and 12 that were never used.
* [tools/build.c]
'pascal16' generated functions did not save %dx.
Removed use of %fs to access the stack.
%ds is no longer initialized before calling a 16-bit routine.
* [windows/defwnd.c]
Accept a NULL pointer as window title.
* [windows/mdi.c]
MDICascade: skip iconic windows.
Implemented CalcChildScroll().
* [windows/utility.c]
Fixed MulDiv() for illegal values.
* [windows/win.c]
Fixed X error in CreateWindowEx() when WM_NCCALCSIZE returned
a zero width or height.
Sun Jun 18 22:22:30 MET DST 1995 Fons Botman (botman@inter.nl.net)
* [controls/edit.c]
Fixed "uninitalized" message which -Wall couldnt see to be ok
in EDIT_WriteText.
* [include/debug.h]
Added define for extra checks in API definitions during debugging.
* [loader/ne_image.c]
Added newline in NE_FixupPrologs to avoid long lines.
* [misc/dos_fs.c]
Added extra safety check in DOS_ValidDrive.
* [misc/exec.c]
Fixed definition of ExitWindows.
Sun Jun 18 21:16:08 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Some fixes, mostly for memory management, but also for text selection
and tab postitions. General cleanup. Notepad.exe now works.
* [controls/combo.c]
Fix: the hwnd field of the DRAWITEMSTRUCT should always be that of
the combo box, not the ComboLBox that belongs to it.
* [controls/listbox.c]
Handle itemID field correctly throughout.
* [memory/local.c]
Implemented flag LMEM_ZEROINIT.
LocalReAlloc() could trash the heap. Fixed.
* [objects/font.c]
FONT_MatchFont(): don't get confused by negative widths.
Fixed a segfault in EnumFonts().
* [objects/text.c]
DrawText(): DT_CALCRECT implies DT_NOCLIP.
* [objects/dcvalues.c]
MAKELONG was used with bad parameters in DC_GET_X_Y.
* [windows/dialog.c]
Don't show the dialog if WS_VISIBLE isn't set in the template.
* [windows/utility.c]
UTILITY_convertArgs(): Never pass an expression containing ++ into a
macro...
* [windows/win.c]
SetParent() should unlink the window before changing the parent.
* [windows/message.c]
Don't call timer functions via CallWindowProc(), since it checks
whether hwnd==0 and does not call the function in that case.
* [miscemu/instr.c]
Ignore interrupt 0x3D, for VBRUN300.DLL.
* [misc/commdlg.c]
Don't rely on the itemData field of the DRAWITEMSTRUCT to contain a
pointer to the item text.
* [if1632/relay.c]
Disable OLE and DDEML DLLs by default, since they contain nothing but
stubs anyway. SHELL, COMMDLG and WIN87EM are left enabled, although
some programs may work better without them.
* [multimedia/*.c] [include/multimedia.h] [include/driver.h]
Begun cleaning things up a little. Replaced printfs with dprintf_
macros, made functions static where possible, and some other minor
changes.
Sun Jun 11 23:19:10 1995 Martin von Loewis <martin@informatik.hu-berlin.de>
* [debugger/dbg.y][debugger/dbg.l]
Removed special handling for FILE_IDENTIFER, because it caused
problems with x/<format> statements.
* [debugger/info.c]
Use SC_ESP instead of SC_EIP for stack dump.
* [misc/compobj.c][if1632/compobj.spec]
CoBuildVersion, CoInitialize, CoUninitialize: new functions
* [misc/ole2.c][if1632/ole2.spec][misc/Imakefile][include/ole2.h]
New files ole2.c, ole2.h
OleBuildVersion, OleInitialize, OleUninitialize: new functions
* [if1632/ole2disp.spec]
Added missing ordinals above 109
* [misc/ole2nls.c][if1632/ole2nls.spec][include/winnls.h]
New file winnls.h
GetLocaleInfoA: new function
* [if1632/shell.spec]
Added FindEnvironmentString as stub
* [misc/olecli.c][if1632/olecli.spec]
OleIsDcMeta: New function
* [objects/font][misc/gdi.spec]
GetKerningPairs: new function
* [misc/shell.c]
ShellExecute: Implemented support for starting programs
* [if1632/user.spec]
Inserted missing relay to GetClipCursor
Sun Jun 11 20:34:47 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Fix a problem with the local heap.
* [include/wintypes.h]
Fixed wrong declarations of CATCHBUF and LPCATCHBUF.
* [include/mdi.h] [windows/mdi.c]
This code still assumed segmented address==linear address. Fixed.
* [include/msdos.h] [misc/dos_fs.c]
The filemask field of the dosdirent structure could be overrun. Fixed.
If you had a file called foobar and a file called foo, trying to
FindFile(foo) could accidentally find file foobar instead. Fixed.
* [misc/file.c]
OpenFile(): Always return the full pathname in ofs->szPathName. This
also fixes GetModuleFilename().
Prevent _lclose() from closing stderr or stdout.
* [misc/profile.c]
Search for .ini files in the path of the current module as well.
(Needed by Lotus Organizer.)
* [loader/task.c] [loader/ne_image.c] [loader/module.c]
[memory/local.c]
Local heaps are now initialized by InitTask() for executables. DLLs
have to call LocalInit() themselves, LocalInit() has to put the
heap at the end of the segment when called with start==0. We no longer
allocate the DGROUP with 64k on startup, but grow the local heap
in LOCAL_GetBlock() when necessary.
* [loader/module.c]
LoadLibrary() should call LoadModule() in all cases, even if the
DLL is already loaded, to ensure that the reference count is correct.
* [loader/ne_image.c]
Some changes to function prolog fixup. Does anyone know exactly how
this is supposed to work? I am only guessing here.
In NE_InitializeDLLs(), initialize the DLLs a module refers to before
the module itself.
* [loader/task.c]
Initialize instance data at the beginning of the DGROUP in InitTask().
* [memory/local.c]
Some fixes for moveable blocks.
* [memory/selector.c]
All the IsBad*Pointer() functions returned exactly the wrong boolean
value in all cases!
* [objects/bitblt.c]
Fixed another null pointer dereference in debugging output.
* [objects/font.c]
Some more recovery possibilities for FONT_MatchFont() if a specified
font does not exist.
* [windows/win.c]
The dialog code may call CreateWindowEx with an integer in windowName.
This happens for static icon controls that expect a resource ID as
the window name. CreateWindowEx() used to crash. Fixed.
* [windows/class.c] [windows/win.c]
Window classes are owned by modules, not instances. Changed
RegisterClass(), UnregisterClass(), GetClassInfo() and CreateWindowEx()
accordingly.
Sat Jun 10 16:10:53 1995 Olaf Flebbe <o.flebbe@science-computing.uni-tuebingen.de>
* [miscemu/int21.c]
clock.exe was displaying incorrect year.
Fri Jun 9 20:36:56 1995 Victor Schneider <tailor@crl.com>
* [include/cursor.h] [windows/cursor.c]
Implemented CreateCursorIconIndirect().
1995-06-20 21:08:12 +02:00
|
|
|
{
|
2002-01-13 02:46:12 +01:00
|
|
|
CDROM_SUB_Q_DATA_FORMAT fmt;
|
|
|
|
SUB_Q_CHANNEL_DATA data;
|
|
|
|
DWORD br;
|
|
|
|
DWORD mode = MCI_MODE_NOT_READY;
|
|
|
|
|
|
|
|
fmt.Format = IOCTL_CDROM_CURRENT_POSITION;
|
2009-02-26 17:46:49 +01:00
|
|
|
if(wmcda->hThread != 0) {
|
|
|
|
DWORD status;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
hr = IDirectSoundBuffer_GetStatus(wmcda->dsBuf, &status);
|
|
|
|
if(SUCCEEDED(hr)) {
|
|
|
|
if(!(status&DSBSTATUS_PLAYING)) {
|
|
|
|
if(WaitForSingleObject(wmcda->stopEvent, 0) == WAIT_OBJECT_0)
|
|
|
|
mode = MCI_MODE_STOP;
|
|
|
|
else
|
|
|
|
mode = MCI_MODE_PAUSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
mode = MCI_MODE_PLAY;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_Q_CHANNEL, &fmt, sizeof(fmt),
|
|
|
|
&data, sizeof(data), &br, NULL)) {
|
2007-01-09 12:17:54 +01:00
|
|
|
if (GetLastError() == ERROR_NOT_READY) mode = MCI_MODE_OPEN;
|
2002-01-13 02:46:12 +01:00
|
|
|
} else {
|
|
|
|
switch (data.CurrentPosition.Header.AudioStatus)
|
|
|
|
{
|
|
|
|
case AUDIO_STATUS_IN_PROGRESS: mode = MCI_MODE_PLAY; break;
|
|
|
|
case AUDIO_STATUS_PAUSED: mode = MCI_MODE_PAUSE; break;
|
2002-05-12 01:02:55 +02:00
|
|
|
case AUDIO_STATUS_NO_STATUS:
|
2002-01-13 02:46:12 +01:00
|
|
|
case AUDIO_STATUS_PLAY_COMPLETE: mode = MCI_MODE_STOP; break;
|
|
|
|
case AUDIO_STATUS_PLAY_ERROR:
|
|
|
|
case AUDIO_STATUS_NOT_SUPPORTED:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
1998-10-11 16:14:24 +02:00
|
|
|
}
|
2002-01-13 02:46:12 +01:00
|
|
|
return mode;
|
Release 950620
Mon Jun 19 20:29:50 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
* [debugger/*.c]
Modified debugger to use segmented pointers everywhere.
* [if1632/shell.spec] [if1632/sound.spec] [if1632/user.spec]
Declared all functions that return only 16-bit as 'pascal16'.
* [include/ldt.h] [memory/ldt.c]
Export LDT_EntryToBytes (new) and LDT_BytesToEntry for DPMI.
Maintain a copy of the selector flags, removing the need to make a
system call to retrieve an LDT entry.
* [loader/module.c]
Fixed bug with module file handle cache.
* [loader/ne_resource.c]
Fixed file name bug in NE_AccessResource().
* [loader/resource.c]
Fixed bug in LoadIcon() that caused wrong colors to be used for
the icon mask.
* [loader/signal.c]
Moved instruction emulation to miscemu/instr.c.
* [misc/dos_fs.c] [miscemu/int21.c]
Lots of small fixes, thanks to Morten Welinder.
* [miscemu/dpmi.c]
More complete DPMI emulation.
* [miscemu/instr.c]
Added support for prefixes in instructions to emulate.
* [miscemu/int2f.c]
Use register macros instead of destroying the high part of 32-bit
registers.
* [objects/dc.c]
Fixed bug in GetDCState() that failed to clear the new DC.
* [rc/sysres.rc]
Removed dialogs 11 and 12 that were never used.
* [tools/build.c]
'pascal16' generated functions did not save %dx.
Removed use of %fs to access the stack.
%ds is no longer initialized before calling a 16-bit routine.
* [windows/defwnd.c]
Accept a NULL pointer as window title.
* [windows/mdi.c]
MDICascade: skip iconic windows.
Implemented CalcChildScroll().
* [windows/utility.c]
Fixed MulDiv() for illegal values.
* [windows/win.c]
Fixed X error in CreateWindowEx() when WM_NCCALCSIZE returned
a zero width or height.
Sun Jun 18 22:22:30 MET DST 1995 Fons Botman (botman@inter.nl.net)
* [controls/edit.c]
Fixed "uninitalized" message which -Wall couldnt see to be ok
in EDIT_WriteText.
* [include/debug.h]
Added define for extra checks in API definitions during debugging.
* [loader/ne_image.c]
Added newline in NE_FixupPrologs to avoid long lines.
* [misc/dos_fs.c]
Added extra safety check in DOS_ValidDrive.
* [misc/exec.c]
Fixed definition of ExitWindows.
Sun Jun 18 21:16:08 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Some fixes, mostly for memory management, but also for text selection
and tab postitions. General cleanup. Notepad.exe now works.
* [controls/combo.c]
Fix: the hwnd field of the DRAWITEMSTRUCT should always be that of
the combo box, not the ComboLBox that belongs to it.
* [controls/listbox.c]
Handle itemID field correctly throughout.
* [memory/local.c]
Implemented flag LMEM_ZEROINIT.
LocalReAlloc() could trash the heap. Fixed.
* [objects/font.c]
FONT_MatchFont(): don't get confused by negative widths.
Fixed a segfault in EnumFonts().
* [objects/text.c]
DrawText(): DT_CALCRECT implies DT_NOCLIP.
* [objects/dcvalues.c]
MAKELONG was used with bad parameters in DC_GET_X_Y.
* [windows/dialog.c]
Don't show the dialog if WS_VISIBLE isn't set in the template.
* [windows/utility.c]
UTILITY_convertArgs(): Never pass an expression containing ++ into a
macro...
* [windows/win.c]
SetParent() should unlink the window before changing the parent.
* [windows/message.c]
Don't call timer functions via CallWindowProc(), since it checks
whether hwnd==0 and does not call the function in that case.
* [miscemu/instr.c]
Ignore interrupt 0x3D, for VBRUN300.DLL.
* [misc/commdlg.c]
Don't rely on the itemData field of the DRAWITEMSTRUCT to contain a
pointer to the item text.
* [if1632/relay.c]
Disable OLE and DDEML DLLs by default, since they contain nothing but
stubs anyway. SHELL, COMMDLG and WIN87EM are left enabled, although
some programs may work better without them.
* [multimedia/*.c] [include/multimedia.h] [include/driver.h]
Begun cleaning things up a little. Replaced printfs with dprintf_
macros, made functions static where possible, and some other minor
changes.
Sun Jun 11 23:19:10 1995 Martin von Loewis <martin@informatik.hu-berlin.de>
* [debugger/dbg.y][debugger/dbg.l]
Removed special handling for FILE_IDENTIFER, because it caused
problems with x/<format> statements.
* [debugger/info.c]
Use SC_ESP instead of SC_EIP for stack dump.
* [misc/compobj.c][if1632/compobj.spec]
CoBuildVersion, CoInitialize, CoUninitialize: new functions
* [misc/ole2.c][if1632/ole2.spec][misc/Imakefile][include/ole2.h]
New files ole2.c, ole2.h
OleBuildVersion, OleInitialize, OleUninitialize: new functions
* [if1632/ole2disp.spec]
Added missing ordinals above 109
* [misc/ole2nls.c][if1632/ole2nls.spec][include/winnls.h]
New file winnls.h
GetLocaleInfoA: new function
* [if1632/shell.spec]
Added FindEnvironmentString as stub
* [misc/olecli.c][if1632/olecli.spec]
OleIsDcMeta: New function
* [objects/font][misc/gdi.spec]
GetKerningPairs: new function
* [misc/shell.c]
ShellExecute: Implemented support for starting programs
* [if1632/user.spec]
Inserted missing relay to GetClipCursor
Sun Jun 11 20:34:47 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Fix a problem with the local heap.
* [include/wintypes.h]
Fixed wrong declarations of CATCHBUF and LPCATCHBUF.
* [include/mdi.h] [windows/mdi.c]
This code still assumed segmented address==linear address. Fixed.
* [include/msdos.h] [misc/dos_fs.c]
The filemask field of the dosdirent structure could be overrun. Fixed.
If you had a file called foobar and a file called foo, trying to
FindFile(foo) could accidentally find file foobar instead. Fixed.
* [misc/file.c]
OpenFile(): Always return the full pathname in ofs->szPathName. This
also fixes GetModuleFilename().
Prevent _lclose() from closing stderr or stdout.
* [misc/profile.c]
Search for .ini files in the path of the current module as well.
(Needed by Lotus Organizer.)
* [loader/task.c] [loader/ne_image.c] [loader/module.c]
[memory/local.c]
Local heaps are now initialized by InitTask() for executables. DLLs
have to call LocalInit() themselves, LocalInit() has to put the
heap at the end of the segment when called with start==0. We no longer
allocate the DGROUP with 64k on startup, but grow the local heap
in LOCAL_GetBlock() when necessary.
* [loader/module.c]
LoadLibrary() should call LoadModule() in all cases, even if the
DLL is already loaded, to ensure that the reference count is correct.
* [loader/ne_image.c]
Some changes to function prolog fixup. Does anyone know exactly how
this is supposed to work? I am only guessing here.
In NE_InitializeDLLs(), initialize the DLLs a module refers to before
the module itself.
* [loader/task.c]
Initialize instance data at the beginning of the DGROUP in InitTask().
* [memory/local.c]
Some fixes for moveable blocks.
* [memory/selector.c]
All the IsBad*Pointer() functions returned exactly the wrong boolean
value in all cases!
* [objects/bitblt.c]
Fixed another null pointer dereference in debugging output.
* [objects/font.c]
Some more recovery possibilities for FONT_MatchFont() if a specified
font does not exist.
* [windows/win.c]
The dialog code may call CreateWindowEx with an integer in windowName.
This happens for static icon controls that expect a resource ID as
the window name. CreateWindowEx() used to crash. Fixed.
* [windows/class.c] [windows/win.c]
Window classes are owned by modules, not instances. Changed
RegisterClass(), UnregisterClass(), GetClassInfo() and CreateWindowEx()
accordingly.
Sat Jun 10 16:10:53 1995 Olaf Flebbe <o.flebbe@science-computing.uni-tuebingen.de>
* [miscemu/int21.c]
clock.exe was displaying incorrect year.
Fri Jun 9 20:36:56 1995 Victor Schneider <tailor@crl.com>
* [include/cursor.h] [windows/cursor.c]
Implemented CreateCursorIconIndirect().
1995-06-20 21:08:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
2000-02-07 17:28:52 +01:00
|
|
|
* MCICDA_GetError [internal]
|
1998-10-11 16:14:24 +02:00
|
|
|
*/
|
2000-02-07 17:28:52 +01:00
|
|
|
static int MCICDA_GetError(WINE_MCICDAUDIO* wmcda)
|
Release 950620
Mon Jun 19 20:29:50 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
* [debugger/*.c]
Modified debugger to use segmented pointers everywhere.
* [if1632/shell.spec] [if1632/sound.spec] [if1632/user.spec]
Declared all functions that return only 16-bit as 'pascal16'.
* [include/ldt.h] [memory/ldt.c]
Export LDT_EntryToBytes (new) and LDT_BytesToEntry for DPMI.
Maintain a copy of the selector flags, removing the need to make a
system call to retrieve an LDT entry.
* [loader/module.c]
Fixed bug with module file handle cache.
* [loader/ne_resource.c]
Fixed file name bug in NE_AccessResource().
* [loader/resource.c]
Fixed bug in LoadIcon() that caused wrong colors to be used for
the icon mask.
* [loader/signal.c]
Moved instruction emulation to miscemu/instr.c.
* [misc/dos_fs.c] [miscemu/int21.c]
Lots of small fixes, thanks to Morten Welinder.
* [miscemu/dpmi.c]
More complete DPMI emulation.
* [miscemu/instr.c]
Added support for prefixes in instructions to emulate.
* [miscemu/int2f.c]
Use register macros instead of destroying the high part of 32-bit
registers.
* [objects/dc.c]
Fixed bug in GetDCState() that failed to clear the new DC.
* [rc/sysres.rc]
Removed dialogs 11 and 12 that were never used.
* [tools/build.c]
'pascal16' generated functions did not save %dx.
Removed use of %fs to access the stack.
%ds is no longer initialized before calling a 16-bit routine.
* [windows/defwnd.c]
Accept a NULL pointer as window title.
* [windows/mdi.c]
MDICascade: skip iconic windows.
Implemented CalcChildScroll().
* [windows/utility.c]
Fixed MulDiv() for illegal values.
* [windows/win.c]
Fixed X error in CreateWindowEx() when WM_NCCALCSIZE returned
a zero width or height.
Sun Jun 18 22:22:30 MET DST 1995 Fons Botman (botman@inter.nl.net)
* [controls/edit.c]
Fixed "uninitalized" message which -Wall couldnt see to be ok
in EDIT_WriteText.
* [include/debug.h]
Added define for extra checks in API definitions during debugging.
* [loader/ne_image.c]
Added newline in NE_FixupPrologs to avoid long lines.
* [misc/dos_fs.c]
Added extra safety check in DOS_ValidDrive.
* [misc/exec.c]
Fixed definition of ExitWindows.
Sun Jun 18 21:16:08 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Some fixes, mostly for memory management, but also for text selection
and tab postitions. General cleanup. Notepad.exe now works.
* [controls/combo.c]
Fix: the hwnd field of the DRAWITEMSTRUCT should always be that of
the combo box, not the ComboLBox that belongs to it.
* [controls/listbox.c]
Handle itemID field correctly throughout.
* [memory/local.c]
Implemented flag LMEM_ZEROINIT.
LocalReAlloc() could trash the heap. Fixed.
* [objects/font.c]
FONT_MatchFont(): don't get confused by negative widths.
Fixed a segfault in EnumFonts().
* [objects/text.c]
DrawText(): DT_CALCRECT implies DT_NOCLIP.
* [objects/dcvalues.c]
MAKELONG was used with bad parameters in DC_GET_X_Y.
* [windows/dialog.c]
Don't show the dialog if WS_VISIBLE isn't set in the template.
* [windows/utility.c]
UTILITY_convertArgs(): Never pass an expression containing ++ into a
macro...
* [windows/win.c]
SetParent() should unlink the window before changing the parent.
* [windows/message.c]
Don't call timer functions via CallWindowProc(), since it checks
whether hwnd==0 and does not call the function in that case.
* [miscemu/instr.c]
Ignore interrupt 0x3D, for VBRUN300.DLL.
* [misc/commdlg.c]
Don't rely on the itemData field of the DRAWITEMSTRUCT to contain a
pointer to the item text.
* [if1632/relay.c]
Disable OLE and DDEML DLLs by default, since they contain nothing but
stubs anyway. SHELL, COMMDLG and WIN87EM are left enabled, although
some programs may work better without them.
* [multimedia/*.c] [include/multimedia.h] [include/driver.h]
Begun cleaning things up a little. Replaced printfs with dprintf_
macros, made functions static where possible, and some other minor
changes.
Sun Jun 11 23:19:10 1995 Martin von Loewis <martin@informatik.hu-berlin.de>
* [debugger/dbg.y][debugger/dbg.l]
Removed special handling for FILE_IDENTIFER, because it caused
problems with x/<format> statements.
* [debugger/info.c]
Use SC_ESP instead of SC_EIP for stack dump.
* [misc/compobj.c][if1632/compobj.spec]
CoBuildVersion, CoInitialize, CoUninitialize: new functions
* [misc/ole2.c][if1632/ole2.spec][misc/Imakefile][include/ole2.h]
New files ole2.c, ole2.h
OleBuildVersion, OleInitialize, OleUninitialize: new functions
* [if1632/ole2disp.spec]
Added missing ordinals above 109
* [misc/ole2nls.c][if1632/ole2nls.spec][include/winnls.h]
New file winnls.h
GetLocaleInfoA: new function
* [if1632/shell.spec]
Added FindEnvironmentString as stub
* [misc/olecli.c][if1632/olecli.spec]
OleIsDcMeta: New function
* [objects/font][misc/gdi.spec]
GetKerningPairs: new function
* [misc/shell.c]
ShellExecute: Implemented support for starting programs
* [if1632/user.spec]
Inserted missing relay to GetClipCursor
Sun Jun 11 20:34:47 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Fix a problem with the local heap.
* [include/wintypes.h]
Fixed wrong declarations of CATCHBUF and LPCATCHBUF.
* [include/mdi.h] [windows/mdi.c]
This code still assumed segmented address==linear address. Fixed.
* [include/msdos.h] [misc/dos_fs.c]
The filemask field of the dosdirent structure could be overrun. Fixed.
If you had a file called foobar and a file called foo, trying to
FindFile(foo) could accidentally find file foobar instead. Fixed.
* [misc/file.c]
OpenFile(): Always return the full pathname in ofs->szPathName. This
also fixes GetModuleFilename().
Prevent _lclose() from closing stderr or stdout.
* [misc/profile.c]
Search for .ini files in the path of the current module as well.
(Needed by Lotus Organizer.)
* [loader/task.c] [loader/ne_image.c] [loader/module.c]
[memory/local.c]
Local heaps are now initialized by InitTask() for executables. DLLs
have to call LocalInit() themselves, LocalInit() has to put the
heap at the end of the segment when called with start==0. We no longer
allocate the DGROUP with 64k on startup, but grow the local heap
in LOCAL_GetBlock() when necessary.
* [loader/module.c]
LoadLibrary() should call LoadModule() in all cases, even if the
DLL is already loaded, to ensure that the reference count is correct.
* [loader/ne_image.c]
Some changes to function prolog fixup. Does anyone know exactly how
this is supposed to work? I am only guessing here.
In NE_InitializeDLLs(), initialize the DLLs a module refers to before
the module itself.
* [loader/task.c]
Initialize instance data at the beginning of the DGROUP in InitTask().
* [memory/local.c]
Some fixes for moveable blocks.
* [memory/selector.c]
All the IsBad*Pointer() functions returned exactly the wrong boolean
value in all cases!
* [objects/bitblt.c]
Fixed another null pointer dereference in debugging output.
* [objects/font.c]
Some more recovery possibilities for FONT_MatchFont() if a specified
font does not exist.
* [windows/win.c]
The dialog code may call CreateWindowEx with an integer in windowName.
This happens for static icon controls that expect a resource ID as
the window name. CreateWindowEx() used to crash. Fixed.
* [windows/class.c] [windows/win.c]
Window classes are owned by modules, not instances. Changed
RegisterClass(), UnregisterClass(), GetClassInfo() and CreateWindowEx()
accordingly.
Sat Jun 10 16:10:53 1995 Olaf Flebbe <o.flebbe@science-computing.uni-tuebingen.de>
* [miscemu/int21.c]
clock.exe was displaying incorrect year.
Fri Jun 9 20:36:56 1995 Victor Schneider <tailor@crl.com>
* [include/cursor.h] [windows/cursor.c]
Implemented CreateCursorIconIndirect().
1995-06-20 21:08:12 +02:00
|
|
|
{
|
2002-01-13 02:46:12 +01:00
|
|
|
switch (GetLastError())
|
|
|
|
{
|
2007-01-09 12:17:54 +01:00
|
|
|
case ERROR_NOT_READY: return MCIERR_DEVICE_NOT_READY;
|
|
|
|
case ERROR_IO_DEVICE: return MCIERR_HARDWARE;
|
1999-02-02 16:25:16 +01:00
|
|
|
default:
|
2007-01-18 11:36:44 +01:00
|
|
|
FIXME("Unknown mode %u\n", GetLastError());
|
1998-10-11 16:14:24 +02:00
|
|
|
}
|
1999-02-02 16:25:16 +01:00
|
|
|
return MCIERR_DRIVER_INTERNAL;
|
Release 950620
Mon Jun 19 20:29:50 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
* [debugger/*.c]
Modified debugger to use segmented pointers everywhere.
* [if1632/shell.spec] [if1632/sound.spec] [if1632/user.spec]
Declared all functions that return only 16-bit as 'pascal16'.
* [include/ldt.h] [memory/ldt.c]
Export LDT_EntryToBytes (new) and LDT_BytesToEntry for DPMI.
Maintain a copy of the selector flags, removing the need to make a
system call to retrieve an LDT entry.
* [loader/module.c]
Fixed bug with module file handle cache.
* [loader/ne_resource.c]
Fixed file name bug in NE_AccessResource().
* [loader/resource.c]
Fixed bug in LoadIcon() that caused wrong colors to be used for
the icon mask.
* [loader/signal.c]
Moved instruction emulation to miscemu/instr.c.
* [misc/dos_fs.c] [miscemu/int21.c]
Lots of small fixes, thanks to Morten Welinder.
* [miscemu/dpmi.c]
More complete DPMI emulation.
* [miscemu/instr.c]
Added support for prefixes in instructions to emulate.
* [miscemu/int2f.c]
Use register macros instead of destroying the high part of 32-bit
registers.
* [objects/dc.c]
Fixed bug in GetDCState() that failed to clear the new DC.
* [rc/sysres.rc]
Removed dialogs 11 and 12 that were never used.
* [tools/build.c]
'pascal16' generated functions did not save %dx.
Removed use of %fs to access the stack.
%ds is no longer initialized before calling a 16-bit routine.
* [windows/defwnd.c]
Accept a NULL pointer as window title.
* [windows/mdi.c]
MDICascade: skip iconic windows.
Implemented CalcChildScroll().
* [windows/utility.c]
Fixed MulDiv() for illegal values.
* [windows/win.c]
Fixed X error in CreateWindowEx() when WM_NCCALCSIZE returned
a zero width or height.
Sun Jun 18 22:22:30 MET DST 1995 Fons Botman (botman@inter.nl.net)
* [controls/edit.c]
Fixed "uninitalized" message which -Wall couldnt see to be ok
in EDIT_WriteText.
* [include/debug.h]
Added define for extra checks in API definitions during debugging.
* [loader/ne_image.c]
Added newline in NE_FixupPrologs to avoid long lines.
* [misc/dos_fs.c]
Added extra safety check in DOS_ValidDrive.
* [misc/exec.c]
Fixed definition of ExitWindows.
Sun Jun 18 21:16:08 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Some fixes, mostly for memory management, but also for text selection
and tab postitions. General cleanup. Notepad.exe now works.
* [controls/combo.c]
Fix: the hwnd field of the DRAWITEMSTRUCT should always be that of
the combo box, not the ComboLBox that belongs to it.
* [controls/listbox.c]
Handle itemID field correctly throughout.
* [memory/local.c]
Implemented flag LMEM_ZEROINIT.
LocalReAlloc() could trash the heap. Fixed.
* [objects/font.c]
FONT_MatchFont(): don't get confused by negative widths.
Fixed a segfault in EnumFonts().
* [objects/text.c]
DrawText(): DT_CALCRECT implies DT_NOCLIP.
* [objects/dcvalues.c]
MAKELONG was used with bad parameters in DC_GET_X_Y.
* [windows/dialog.c]
Don't show the dialog if WS_VISIBLE isn't set in the template.
* [windows/utility.c]
UTILITY_convertArgs(): Never pass an expression containing ++ into a
macro...
* [windows/win.c]
SetParent() should unlink the window before changing the parent.
* [windows/message.c]
Don't call timer functions via CallWindowProc(), since it checks
whether hwnd==0 and does not call the function in that case.
* [miscemu/instr.c]
Ignore interrupt 0x3D, for VBRUN300.DLL.
* [misc/commdlg.c]
Don't rely on the itemData field of the DRAWITEMSTRUCT to contain a
pointer to the item text.
* [if1632/relay.c]
Disable OLE and DDEML DLLs by default, since they contain nothing but
stubs anyway. SHELL, COMMDLG and WIN87EM are left enabled, although
some programs may work better without them.
* [multimedia/*.c] [include/multimedia.h] [include/driver.h]
Begun cleaning things up a little. Replaced printfs with dprintf_
macros, made functions static where possible, and some other minor
changes.
Sun Jun 11 23:19:10 1995 Martin von Loewis <martin@informatik.hu-berlin.de>
* [debugger/dbg.y][debugger/dbg.l]
Removed special handling for FILE_IDENTIFER, because it caused
problems with x/<format> statements.
* [debugger/info.c]
Use SC_ESP instead of SC_EIP for stack dump.
* [misc/compobj.c][if1632/compobj.spec]
CoBuildVersion, CoInitialize, CoUninitialize: new functions
* [misc/ole2.c][if1632/ole2.spec][misc/Imakefile][include/ole2.h]
New files ole2.c, ole2.h
OleBuildVersion, OleInitialize, OleUninitialize: new functions
* [if1632/ole2disp.spec]
Added missing ordinals above 109
* [misc/ole2nls.c][if1632/ole2nls.spec][include/winnls.h]
New file winnls.h
GetLocaleInfoA: new function
* [if1632/shell.spec]
Added FindEnvironmentString as stub
* [misc/olecli.c][if1632/olecli.spec]
OleIsDcMeta: New function
* [objects/font][misc/gdi.spec]
GetKerningPairs: new function
* [misc/shell.c]
ShellExecute: Implemented support for starting programs
* [if1632/user.spec]
Inserted missing relay to GetClipCursor
Sun Jun 11 20:34:47 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Fix a problem with the local heap.
* [include/wintypes.h]
Fixed wrong declarations of CATCHBUF and LPCATCHBUF.
* [include/mdi.h] [windows/mdi.c]
This code still assumed segmented address==linear address. Fixed.
* [include/msdos.h] [misc/dos_fs.c]
The filemask field of the dosdirent structure could be overrun. Fixed.
If you had a file called foobar and a file called foo, trying to
FindFile(foo) could accidentally find file foobar instead. Fixed.
* [misc/file.c]
OpenFile(): Always return the full pathname in ofs->szPathName. This
also fixes GetModuleFilename().
Prevent _lclose() from closing stderr or stdout.
* [misc/profile.c]
Search for .ini files in the path of the current module as well.
(Needed by Lotus Organizer.)
* [loader/task.c] [loader/ne_image.c] [loader/module.c]
[memory/local.c]
Local heaps are now initialized by InitTask() for executables. DLLs
have to call LocalInit() themselves, LocalInit() has to put the
heap at the end of the segment when called with start==0. We no longer
allocate the DGROUP with 64k on startup, but grow the local heap
in LOCAL_GetBlock() when necessary.
* [loader/module.c]
LoadLibrary() should call LoadModule() in all cases, even if the
DLL is already loaded, to ensure that the reference count is correct.
* [loader/ne_image.c]
Some changes to function prolog fixup. Does anyone know exactly how
this is supposed to work? I am only guessing here.
In NE_InitializeDLLs(), initialize the DLLs a module refers to before
the module itself.
* [loader/task.c]
Initialize instance data at the beginning of the DGROUP in InitTask().
* [memory/local.c]
Some fixes for moveable blocks.
* [memory/selector.c]
All the IsBad*Pointer() functions returned exactly the wrong boolean
value in all cases!
* [objects/bitblt.c]
Fixed another null pointer dereference in debugging output.
* [objects/font.c]
Some more recovery possibilities for FONT_MatchFont() if a specified
font does not exist.
* [windows/win.c]
The dialog code may call CreateWindowEx with an integer in windowName.
This happens for static icon controls that expect a resource ID as
the window name. CreateWindowEx() used to crash. Fixed.
* [windows/class.c] [windows/win.c]
Window classes are owned by modules, not instances. Changed
RegisterClass(), UnregisterClass(), GetClassInfo() and CreateWindowEx()
accordingly.
Sat Jun 10 16:10:53 1995 Olaf Flebbe <o.flebbe@science-computing.uni-tuebingen.de>
* [miscemu/int21.c]
clock.exe was displaying incorrect year.
Fri Jun 9 20:36:56 1995 Victor Schneider <tailor@crl.com>
* [include/cursor.h] [windows/cursor.c]
Implemented CreateCursorIconIndirect().
1995-06-20 21:08:12 +02:00
|
|
|
}
|
|
|
|
|
1994-07-07 18:23:58 +02:00
|
|
|
/**************************************************************************
|
2000-02-07 17:28:52 +01:00
|
|
|
* MCICDA_CalcFrame [internal]
|
1998-10-11 16:14:24 +02:00
|
|
|
*/
|
2000-02-07 17:28:52 +01:00
|
|
|
static DWORD MCICDA_CalcFrame(WINE_MCICDAUDIO* wmcda, DWORD dwTime)
|
1994-07-07 18:23:58 +02:00
|
|
|
{
|
1998-10-11 16:14:24 +02:00
|
|
|
DWORD dwFrame = 0;
|
1999-09-05 18:44:38 +02:00
|
|
|
UINT wTrack;
|
2002-01-13 02:46:12 +01:00
|
|
|
CDROM_TOC toc;
|
|
|
|
DWORD br;
|
|
|
|
BYTE* addr;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("(%p, %08X, %u);\n", wmcda, wmcda->dwTimeFormat, dwTime);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-02-02 16:25:16 +01:00
|
|
|
switch (wmcda->dwTimeFormat) {
|
1998-10-11 16:14:24 +02:00
|
|
|
case MCI_FORMAT_MILLISECONDS:
|
1999-12-25 23:54:11 +01:00
|
|
|
dwFrame = ((dwTime - 1) * CDFRAMES_PERSEC + 500) / 1000;
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("MILLISECONDS %u\n", dwFrame);
|
1998-10-11 16:14:24 +02:00
|
|
|
break;
|
|
|
|
case MCI_FORMAT_MSF:
|
1999-07-04 18:02:24 +02:00
|
|
|
TRACE("MSF %02u:%02u:%02u\n",
|
1998-11-24 15:12:13 +01:00
|
|
|
MCI_MSF_MINUTE(dwTime), MCI_MSF_SECOND(dwTime), MCI_MSF_FRAME(dwTime));
|
1998-10-11 16:14:24 +02:00
|
|
|
dwFrame += CDFRAMES_PERMIN * MCI_MSF_MINUTE(dwTime);
|
|
|
|
dwFrame += CDFRAMES_PERSEC * MCI_MSF_SECOND(dwTime);
|
|
|
|
dwFrame += MCI_MSF_FRAME(dwTime);
|
|
|
|
break;
|
1998-11-24 15:12:13 +01:00
|
|
|
case MCI_FORMAT_TMSF:
|
1999-12-25 23:54:11 +01:00
|
|
|
default: /* unknown format ! force TMSF ! ... */
|
1998-10-11 16:14:24 +02:00
|
|
|
wTrack = MCI_TMSF_TRACK(dwTime);
|
2002-06-01 01:06:46 +02:00
|
|
|
if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0,
|
2002-01-13 02:46:12 +01:00
|
|
|
&toc, sizeof(toc), &br, NULL))
|
|
|
|
return 0;
|
|
|
|
if (wTrack < toc.FirstTrack || wTrack > toc.LastTrack)
|
|
|
|
return 0;
|
|
|
|
TRACE("MSF %02u-%02u:%02u:%02u\n",
|
2002-06-01 01:06:46 +02:00
|
|
|
MCI_TMSF_TRACK(dwTime), MCI_TMSF_MINUTE(dwTime),
|
2002-01-13 02:46:12 +01:00
|
|
|
MCI_TMSF_SECOND(dwTime), MCI_TMSF_FRAME(dwTime));
|
|
|
|
addr = toc.TrackData[wTrack - toc.FirstTrack].Address;
|
|
|
|
TRACE("TMSF trackpos[%u]=%d:%d:%d\n",
|
2003-02-19 23:08:03 +01:00
|
|
|
wTrack, addr[1], addr[2], addr[3]);
|
|
|
|
dwFrame = CDFRAMES_PERMIN * (addr[1] + MCI_TMSF_MINUTE(dwTime)) +
|
|
|
|
CDFRAMES_PERSEC * (addr[2] + MCI_TMSF_SECOND(dwTime)) +
|
|
|
|
addr[3] + MCI_TMSF_FRAME(dwTime);
|
1998-10-11 16:14:24 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return dwFrame;
|
1994-07-07 18:23:58 +02:00
|
|
|
}
|
|
|
|
|
Release 950620
Mon Jun 19 20:29:50 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
* [debugger/*.c]
Modified debugger to use segmented pointers everywhere.
* [if1632/shell.spec] [if1632/sound.spec] [if1632/user.spec]
Declared all functions that return only 16-bit as 'pascal16'.
* [include/ldt.h] [memory/ldt.c]
Export LDT_EntryToBytes (new) and LDT_BytesToEntry for DPMI.
Maintain a copy of the selector flags, removing the need to make a
system call to retrieve an LDT entry.
* [loader/module.c]
Fixed bug with module file handle cache.
* [loader/ne_resource.c]
Fixed file name bug in NE_AccessResource().
* [loader/resource.c]
Fixed bug in LoadIcon() that caused wrong colors to be used for
the icon mask.
* [loader/signal.c]
Moved instruction emulation to miscemu/instr.c.
* [misc/dos_fs.c] [miscemu/int21.c]
Lots of small fixes, thanks to Morten Welinder.
* [miscemu/dpmi.c]
More complete DPMI emulation.
* [miscemu/instr.c]
Added support for prefixes in instructions to emulate.
* [miscemu/int2f.c]
Use register macros instead of destroying the high part of 32-bit
registers.
* [objects/dc.c]
Fixed bug in GetDCState() that failed to clear the new DC.
* [rc/sysres.rc]
Removed dialogs 11 and 12 that were never used.
* [tools/build.c]
'pascal16' generated functions did not save %dx.
Removed use of %fs to access the stack.
%ds is no longer initialized before calling a 16-bit routine.
* [windows/defwnd.c]
Accept a NULL pointer as window title.
* [windows/mdi.c]
MDICascade: skip iconic windows.
Implemented CalcChildScroll().
* [windows/utility.c]
Fixed MulDiv() for illegal values.
* [windows/win.c]
Fixed X error in CreateWindowEx() when WM_NCCALCSIZE returned
a zero width or height.
Sun Jun 18 22:22:30 MET DST 1995 Fons Botman (botman@inter.nl.net)
* [controls/edit.c]
Fixed "uninitalized" message which -Wall couldnt see to be ok
in EDIT_WriteText.
* [include/debug.h]
Added define for extra checks in API definitions during debugging.
* [loader/ne_image.c]
Added newline in NE_FixupPrologs to avoid long lines.
* [misc/dos_fs.c]
Added extra safety check in DOS_ValidDrive.
* [misc/exec.c]
Fixed definition of ExitWindows.
Sun Jun 18 21:16:08 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Some fixes, mostly for memory management, but also for text selection
and tab postitions. General cleanup. Notepad.exe now works.
* [controls/combo.c]
Fix: the hwnd field of the DRAWITEMSTRUCT should always be that of
the combo box, not the ComboLBox that belongs to it.
* [controls/listbox.c]
Handle itemID field correctly throughout.
* [memory/local.c]
Implemented flag LMEM_ZEROINIT.
LocalReAlloc() could trash the heap. Fixed.
* [objects/font.c]
FONT_MatchFont(): don't get confused by negative widths.
Fixed a segfault in EnumFonts().
* [objects/text.c]
DrawText(): DT_CALCRECT implies DT_NOCLIP.
* [objects/dcvalues.c]
MAKELONG was used with bad parameters in DC_GET_X_Y.
* [windows/dialog.c]
Don't show the dialog if WS_VISIBLE isn't set in the template.
* [windows/utility.c]
UTILITY_convertArgs(): Never pass an expression containing ++ into a
macro...
* [windows/win.c]
SetParent() should unlink the window before changing the parent.
* [windows/message.c]
Don't call timer functions via CallWindowProc(), since it checks
whether hwnd==0 and does not call the function in that case.
* [miscemu/instr.c]
Ignore interrupt 0x3D, for VBRUN300.DLL.
* [misc/commdlg.c]
Don't rely on the itemData field of the DRAWITEMSTRUCT to contain a
pointer to the item text.
* [if1632/relay.c]
Disable OLE and DDEML DLLs by default, since they contain nothing but
stubs anyway. SHELL, COMMDLG and WIN87EM are left enabled, although
some programs may work better without them.
* [multimedia/*.c] [include/multimedia.h] [include/driver.h]
Begun cleaning things up a little. Replaced printfs with dprintf_
macros, made functions static where possible, and some other minor
changes.
Sun Jun 11 23:19:10 1995 Martin von Loewis <martin@informatik.hu-berlin.de>
* [debugger/dbg.y][debugger/dbg.l]
Removed special handling for FILE_IDENTIFER, because it caused
problems with x/<format> statements.
* [debugger/info.c]
Use SC_ESP instead of SC_EIP for stack dump.
* [misc/compobj.c][if1632/compobj.spec]
CoBuildVersion, CoInitialize, CoUninitialize: new functions
* [misc/ole2.c][if1632/ole2.spec][misc/Imakefile][include/ole2.h]
New files ole2.c, ole2.h
OleBuildVersion, OleInitialize, OleUninitialize: new functions
* [if1632/ole2disp.spec]
Added missing ordinals above 109
* [misc/ole2nls.c][if1632/ole2nls.spec][include/winnls.h]
New file winnls.h
GetLocaleInfoA: new function
* [if1632/shell.spec]
Added FindEnvironmentString as stub
* [misc/olecli.c][if1632/olecli.spec]
OleIsDcMeta: New function
* [objects/font][misc/gdi.spec]
GetKerningPairs: new function
* [misc/shell.c]
ShellExecute: Implemented support for starting programs
* [if1632/user.spec]
Inserted missing relay to GetClipCursor
Sun Jun 11 20:34:47 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Fix a problem with the local heap.
* [include/wintypes.h]
Fixed wrong declarations of CATCHBUF and LPCATCHBUF.
* [include/mdi.h] [windows/mdi.c]
This code still assumed segmented address==linear address. Fixed.
* [include/msdos.h] [misc/dos_fs.c]
The filemask field of the dosdirent structure could be overrun. Fixed.
If you had a file called foobar and a file called foo, trying to
FindFile(foo) could accidentally find file foobar instead. Fixed.
* [misc/file.c]
OpenFile(): Always return the full pathname in ofs->szPathName. This
also fixes GetModuleFilename().
Prevent _lclose() from closing stderr or stdout.
* [misc/profile.c]
Search for .ini files in the path of the current module as well.
(Needed by Lotus Organizer.)
* [loader/task.c] [loader/ne_image.c] [loader/module.c]
[memory/local.c]
Local heaps are now initialized by InitTask() for executables. DLLs
have to call LocalInit() themselves, LocalInit() has to put the
heap at the end of the segment when called with start==0. We no longer
allocate the DGROUP with 64k on startup, but grow the local heap
in LOCAL_GetBlock() when necessary.
* [loader/module.c]
LoadLibrary() should call LoadModule() in all cases, even if the
DLL is already loaded, to ensure that the reference count is correct.
* [loader/ne_image.c]
Some changes to function prolog fixup. Does anyone know exactly how
this is supposed to work? I am only guessing here.
In NE_InitializeDLLs(), initialize the DLLs a module refers to before
the module itself.
* [loader/task.c]
Initialize instance data at the beginning of the DGROUP in InitTask().
* [memory/local.c]
Some fixes for moveable blocks.
* [memory/selector.c]
All the IsBad*Pointer() functions returned exactly the wrong boolean
value in all cases!
* [objects/bitblt.c]
Fixed another null pointer dereference in debugging output.
* [objects/font.c]
Some more recovery possibilities for FONT_MatchFont() if a specified
font does not exist.
* [windows/win.c]
The dialog code may call CreateWindowEx with an integer in windowName.
This happens for static icon controls that expect a resource ID as
the window name. CreateWindowEx() used to crash. Fixed.
* [windows/class.c] [windows/win.c]
Window classes are owned by modules, not instances. Changed
RegisterClass(), UnregisterClass(), GetClassInfo() and CreateWindowEx()
accordingly.
Sat Jun 10 16:10:53 1995 Olaf Flebbe <o.flebbe@science-computing.uni-tuebingen.de>
* [miscemu/int21.c]
clock.exe was displaying incorrect year.
Fri Jun 9 20:36:56 1995 Victor Schneider <tailor@crl.com>
* [include/cursor.h] [windows/cursor.c]
Implemented CreateCursorIconIndirect().
1995-06-20 21:08:12 +02:00
|
|
|
/**************************************************************************
|
2000-02-07 17:28:52 +01:00
|
|
|
* MCICDA_CalcTime [internal]
|
1998-10-11 16:14:24 +02:00
|
|
|
*/
|
2002-01-13 02:46:12 +01:00
|
|
|
static DWORD MCICDA_CalcTime(WINE_MCICDAUDIO* wmcda, DWORD tf, DWORD dwFrame, LPDWORD lpRet)
|
Release 950620
Mon Jun 19 20:29:50 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
* [debugger/*.c]
Modified debugger to use segmented pointers everywhere.
* [if1632/shell.spec] [if1632/sound.spec] [if1632/user.spec]
Declared all functions that return only 16-bit as 'pascal16'.
* [include/ldt.h] [memory/ldt.c]
Export LDT_EntryToBytes (new) and LDT_BytesToEntry for DPMI.
Maintain a copy of the selector flags, removing the need to make a
system call to retrieve an LDT entry.
* [loader/module.c]
Fixed bug with module file handle cache.
* [loader/ne_resource.c]
Fixed file name bug in NE_AccessResource().
* [loader/resource.c]
Fixed bug in LoadIcon() that caused wrong colors to be used for
the icon mask.
* [loader/signal.c]
Moved instruction emulation to miscemu/instr.c.
* [misc/dos_fs.c] [miscemu/int21.c]
Lots of small fixes, thanks to Morten Welinder.
* [miscemu/dpmi.c]
More complete DPMI emulation.
* [miscemu/instr.c]
Added support for prefixes in instructions to emulate.
* [miscemu/int2f.c]
Use register macros instead of destroying the high part of 32-bit
registers.
* [objects/dc.c]
Fixed bug in GetDCState() that failed to clear the new DC.
* [rc/sysres.rc]
Removed dialogs 11 and 12 that were never used.
* [tools/build.c]
'pascal16' generated functions did not save %dx.
Removed use of %fs to access the stack.
%ds is no longer initialized before calling a 16-bit routine.
* [windows/defwnd.c]
Accept a NULL pointer as window title.
* [windows/mdi.c]
MDICascade: skip iconic windows.
Implemented CalcChildScroll().
* [windows/utility.c]
Fixed MulDiv() for illegal values.
* [windows/win.c]
Fixed X error in CreateWindowEx() when WM_NCCALCSIZE returned
a zero width or height.
Sun Jun 18 22:22:30 MET DST 1995 Fons Botman (botman@inter.nl.net)
* [controls/edit.c]
Fixed "uninitalized" message which -Wall couldnt see to be ok
in EDIT_WriteText.
* [include/debug.h]
Added define for extra checks in API definitions during debugging.
* [loader/ne_image.c]
Added newline in NE_FixupPrologs to avoid long lines.
* [misc/dos_fs.c]
Added extra safety check in DOS_ValidDrive.
* [misc/exec.c]
Fixed definition of ExitWindows.
Sun Jun 18 21:16:08 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Some fixes, mostly for memory management, but also for text selection
and tab postitions. General cleanup. Notepad.exe now works.
* [controls/combo.c]
Fix: the hwnd field of the DRAWITEMSTRUCT should always be that of
the combo box, not the ComboLBox that belongs to it.
* [controls/listbox.c]
Handle itemID field correctly throughout.
* [memory/local.c]
Implemented flag LMEM_ZEROINIT.
LocalReAlloc() could trash the heap. Fixed.
* [objects/font.c]
FONT_MatchFont(): don't get confused by negative widths.
Fixed a segfault in EnumFonts().
* [objects/text.c]
DrawText(): DT_CALCRECT implies DT_NOCLIP.
* [objects/dcvalues.c]
MAKELONG was used with bad parameters in DC_GET_X_Y.
* [windows/dialog.c]
Don't show the dialog if WS_VISIBLE isn't set in the template.
* [windows/utility.c]
UTILITY_convertArgs(): Never pass an expression containing ++ into a
macro...
* [windows/win.c]
SetParent() should unlink the window before changing the parent.
* [windows/message.c]
Don't call timer functions via CallWindowProc(), since it checks
whether hwnd==0 and does not call the function in that case.
* [miscemu/instr.c]
Ignore interrupt 0x3D, for VBRUN300.DLL.
* [misc/commdlg.c]
Don't rely on the itemData field of the DRAWITEMSTRUCT to contain a
pointer to the item text.
* [if1632/relay.c]
Disable OLE and DDEML DLLs by default, since they contain nothing but
stubs anyway. SHELL, COMMDLG and WIN87EM are left enabled, although
some programs may work better without them.
* [multimedia/*.c] [include/multimedia.h] [include/driver.h]
Begun cleaning things up a little. Replaced printfs with dprintf_
macros, made functions static where possible, and some other minor
changes.
Sun Jun 11 23:19:10 1995 Martin von Loewis <martin@informatik.hu-berlin.de>
* [debugger/dbg.y][debugger/dbg.l]
Removed special handling for FILE_IDENTIFER, because it caused
problems with x/<format> statements.
* [debugger/info.c]
Use SC_ESP instead of SC_EIP for stack dump.
* [misc/compobj.c][if1632/compobj.spec]
CoBuildVersion, CoInitialize, CoUninitialize: new functions
* [misc/ole2.c][if1632/ole2.spec][misc/Imakefile][include/ole2.h]
New files ole2.c, ole2.h
OleBuildVersion, OleInitialize, OleUninitialize: new functions
* [if1632/ole2disp.spec]
Added missing ordinals above 109
* [misc/ole2nls.c][if1632/ole2nls.spec][include/winnls.h]
New file winnls.h
GetLocaleInfoA: new function
* [if1632/shell.spec]
Added FindEnvironmentString as stub
* [misc/olecli.c][if1632/olecli.spec]
OleIsDcMeta: New function
* [objects/font][misc/gdi.spec]
GetKerningPairs: new function
* [misc/shell.c]
ShellExecute: Implemented support for starting programs
* [if1632/user.spec]
Inserted missing relay to GetClipCursor
Sun Jun 11 20:34:47 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Fix a problem with the local heap.
* [include/wintypes.h]
Fixed wrong declarations of CATCHBUF and LPCATCHBUF.
* [include/mdi.h] [windows/mdi.c]
This code still assumed segmented address==linear address. Fixed.
* [include/msdos.h] [misc/dos_fs.c]
The filemask field of the dosdirent structure could be overrun. Fixed.
If you had a file called foobar and a file called foo, trying to
FindFile(foo) could accidentally find file foobar instead. Fixed.
* [misc/file.c]
OpenFile(): Always return the full pathname in ofs->szPathName. This
also fixes GetModuleFilename().
Prevent _lclose() from closing stderr or stdout.
* [misc/profile.c]
Search for .ini files in the path of the current module as well.
(Needed by Lotus Organizer.)
* [loader/task.c] [loader/ne_image.c] [loader/module.c]
[memory/local.c]
Local heaps are now initialized by InitTask() for executables. DLLs
have to call LocalInit() themselves, LocalInit() has to put the
heap at the end of the segment when called with start==0. We no longer
allocate the DGROUP with 64k on startup, but grow the local heap
in LOCAL_GetBlock() when necessary.
* [loader/module.c]
LoadLibrary() should call LoadModule() in all cases, even if the
DLL is already loaded, to ensure that the reference count is correct.
* [loader/ne_image.c]
Some changes to function prolog fixup. Does anyone know exactly how
this is supposed to work? I am only guessing here.
In NE_InitializeDLLs(), initialize the DLLs a module refers to before
the module itself.
* [loader/task.c]
Initialize instance data at the beginning of the DGROUP in InitTask().
* [memory/local.c]
Some fixes for moveable blocks.
* [memory/selector.c]
All the IsBad*Pointer() functions returned exactly the wrong boolean
value in all cases!
* [objects/bitblt.c]
Fixed another null pointer dereference in debugging output.
* [objects/font.c]
Some more recovery possibilities for FONT_MatchFont() if a specified
font does not exist.
* [windows/win.c]
The dialog code may call CreateWindowEx with an integer in windowName.
This happens for static icon controls that expect a resource ID as
the window name. CreateWindowEx() used to crash. Fixed.
* [windows/class.c] [windows/win.c]
Window classes are owned by modules, not instances. Changed
RegisterClass(), UnregisterClass(), GetClassInfo() and CreateWindowEx()
accordingly.
Sat Jun 10 16:10:53 1995 Olaf Flebbe <o.flebbe@science-computing.uni-tuebingen.de>
* [miscemu/int21.c]
clock.exe was displaying incorrect year.
Fri Jun 9 20:36:56 1995 Victor Schneider <tailor@crl.com>
* [include/cursor.h] [windows/cursor.c]
Implemented CreateCursorIconIndirect().
1995-06-20 21:08:12 +02:00
|
|
|
{
|
1998-10-11 16:14:24 +02:00
|
|
|
DWORD dwTime = 0;
|
1999-09-05 18:44:38 +02:00
|
|
|
UINT wTrack;
|
|
|
|
UINT wMinutes;
|
|
|
|
UINT wSeconds;
|
|
|
|
UINT wFrames;
|
2002-01-13 02:46:12 +01:00
|
|
|
CDROM_TOC toc;
|
|
|
|
DWORD br;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("(%p, %08X, %u);\n", wmcda, tf, dwFrame);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-12-25 23:54:11 +01:00
|
|
|
switch (tf) {
|
1998-10-11 16:14:24 +02:00
|
|
|
case MCI_FORMAT_MILLISECONDS:
|
1999-12-25 23:54:11 +01:00
|
|
|
dwTime = (dwFrame * 1000) / CDFRAMES_PERSEC + 1;
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("MILLISECONDS %u\n", dwTime);
|
1999-07-24 12:45:24 +02:00
|
|
|
*lpRet = 0;
|
1998-10-11 16:14:24 +02:00
|
|
|
break;
|
|
|
|
case MCI_FORMAT_MSF:
|
|
|
|
wMinutes = dwFrame / CDFRAMES_PERMIN;
|
|
|
|
wSeconds = (dwFrame - CDFRAMES_PERMIN * wMinutes) / CDFRAMES_PERSEC;
|
1998-11-24 15:12:13 +01:00
|
|
|
wFrames = dwFrame - CDFRAMES_PERMIN * wMinutes - CDFRAMES_PERSEC * wSeconds;
|
1998-10-11 16:14:24 +02:00
|
|
|
dwTime = MCI_MAKE_MSF(wMinutes, wSeconds, wFrames);
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("MSF %02u:%02u:%02u -> dwTime=%u\n",
|
1999-07-15 16:43:13 +02:00
|
|
|
wMinutes, wSeconds, wFrames, dwTime);
|
1999-07-24 12:45:24 +02:00
|
|
|
*lpRet = MCI_COLONIZED3_RETURN;
|
1998-10-11 16:14:24 +02:00
|
|
|
break;
|
1998-11-24 15:12:13 +01:00
|
|
|
case MCI_FORMAT_TMSF:
|
1999-12-25 23:54:11 +01:00
|
|
|
default: /* unknown format ! force TMSF ! ... */
|
2002-06-01 01:06:46 +02:00
|
|
|
if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0,
|
2002-01-13 02:46:12 +01:00
|
|
|
&toc, sizeof(toc), &br, NULL))
|
|
|
|
return 0;
|
2002-06-01 01:06:46 +02:00
|
|
|
if (dwFrame < FRAME_OF_TOC(toc, toc.FirstTrack) ||
|
2002-01-13 02:46:12 +01:00
|
|
|
dwFrame > FRAME_OF_TOC(toc, toc.LastTrack + 1)) {
|
2006-10-09 21:22:38 +02:00
|
|
|
ERR("Out of range value %u [%u,%u]\n",
|
2002-06-01 01:06:46 +02:00
|
|
|
dwFrame, FRAME_OF_TOC(toc, toc.FirstTrack),
|
2002-01-13 02:46:12 +01:00
|
|
|
FRAME_OF_TOC(toc, toc.LastTrack + 1));
|
1999-12-25 23:54:11 +01:00
|
|
|
*lpRet = 0;
|
|
|
|
return 0;
|
|
|
|
}
|
2002-01-13 02:46:12 +01:00
|
|
|
for (wTrack = toc.FirstTrack; wTrack <= toc.LastTrack; wTrack++) {
|
|
|
|
if (FRAME_OF_TOC(toc, wTrack) > dwFrame)
|
1999-12-25 23:54:11 +01:00
|
|
|
break;
|
1998-10-11 16:14:24 +02:00
|
|
|
}
|
2002-01-13 02:46:12 +01:00
|
|
|
wTrack--;
|
|
|
|
dwFrame -= FRAME_OF_TOC(toc, wTrack);
|
1998-10-11 16:14:24 +02:00
|
|
|
wMinutes = dwFrame / CDFRAMES_PERMIN;
|
|
|
|
wSeconds = (dwFrame - CDFRAMES_PERMIN * wMinutes) / CDFRAMES_PERSEC;
|
1998-11-24 15:12:13 +01:00
|
|
|
wFrames = dwFrame - CDFRAMES_PERMIN * wMinutes - CDFRAMES_PERSEC * wSeconds;
|
1998-10-11 16:14:24 +02:00
|
|
|
dwTime = MCI_MAKE_TMSF(wTrack, wMinutes, wSeconds, wFrames);
|
1999-07-04 18:02:24 +02:00
|
|
|
TRACE("%02u-%02u:%02u:%02u\n", wTrack, wMinutes, wSeconds, wFrames);
|
1999-07-24 12:45:24 +02:00
|
|
|
*lpRet = MCI_COLONIZED4_RETURN;
|
1998-10-11 16:14:24 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return dwTime;
|
Release 950620
Mon Jun 19 20:29:50 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
* [debugger/*.c]
Modified debugger to use segmented pointers everywhere.
* [if1632/shell.spec] [if1632/sound.spec] [if1632/user.spec]
Declared all functions that return only 16-bit as 'pascal16'.
* [include/ldt.h] [memory/ldt.c]
Export LDT_EntryToBytes (new) and LDT_BytesToEntry for DPMI.
Maintain a copy of the selector flags, removing the need to make a
system call to retrieve an LDT entry.
* [loader/module.c]
Fixed bug with module file handle cache.
* [loader/ne_resource.c]
Fixed file name bug in NE_AccessResource().
* [loader/resource.c]
Fixed bug in LoadIcon() that caused wrong colors to be used for
the icon mask.
* [loader/signal.c]
Moved instruction emulation to miscemu/instr.c.
* [misc/dos_fs.c] [miscemu/int21.c]
Lots of small fixes, thanks to Morten Welinder.
* [miscemu/dpmi.c]
More complete DPMI emulation.
* [miscemu/instr.c]
Added support for prefixes in instructions to emulate.
* [miscemu/int2f.c]
Use register macros instead of destroying the high part of 32-bit
registers.
* [objects/dc.c]
Fixed bug in GetDCState() that failed to clear the new DC.
* [rc/sysres.rc]
Removed dialogs 11 and 12 that were never used.
* [tools/build.c]
'pascal16' generated functions did not save %dx.
Removed use of %fs to access the stack.
%ds is no longer initialized before calling a 16-bit routine.
* [windows/defwnd.c]
Accept a NULL pointer as window title.
* [windows/mdi.c]
MDICascade: skip iconic windows.
Implemented CalcChildScroll().
* [windows/utility.c]
Fixed MulDiv() for illegal values.
* [windows/win.c]
Fixed X error in CreateWindowEx() when WM_NCCALCSIZE returned
a zero width or height.
Sun Jun 18 22:22:30 MET DST 1995 Fons Botman (botman@inter.nl.net)
* [controls/edit.c]
Fixed "uninitalized" message which -Wall couldnt see to be ok
in EDIT_WriteText.
* [include/debug.h]
Added define for extra checks in API definitions during debugging.
* [loader/ne_image.c]
Added newline in NE_FixupPrologs to avoid long lines.
* [misc/dos_fs.c]
Added extra safety check in DOS_ValidDrive.
* [misc/exec.c]
Fixed definition of ExitWindows.
Sun Jun 18 21:16:08 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Some fixes, mostly for memory management, but also for text selection
and tab postitions. General cleanup. Notepad.exe now works.
* [controls/combo.c]
Fix: the hwnd field of the DRAWITEMSTRUCT should always be that of
the combo box, not the ComboLBox that belongs to it.
* [controls/listbox.c]
Handle itemID field correctly throughout.
* [memory/local.c]
Implemented flag LMEM_ZEROINIT.
LocalReAlloc() could trash the heap. Fixed.
* [objects/font.c]
FONT_MatchFont(): don't get confused by negative widths.
Fixed a segfault in EnumFonts().
* [objects/text.c]
DrawText(): DT_CALCRECT implies DT_NOCLIP.
* [objects/dcvalues.c]
MAKELONG was used with bad parameters in DC_GET_X_Y.
* [windows/dialog.c]
Don't show the dialog if WS_VISIBLE isn't set in the template.
* [windows/utility.c]
UTILITY_convertArgs(): Never pass an expression containing ++ into a
macro...
* [windows/win.c]
SetParent() should unlink the window before changing the parent.
* [windows/message.c]
Don't call timer functions via CallWindowProc(), since it checks
whether hwnd==0 and does not call the function in that case.
* [miscemu/instr.c]
Ignore interrupt 0x3D, for VBRUN300.DLL.
* [misc/commdlg.c]
Don't rely on the itemData field of the DRAWITEMSTRUCT to contain a
pointer to the item text.
* [if1632/relay.c]
Disable OLE and DDEML DLLs by default, since they contain nothing but
stubs anyway. SHELL, COMMDLG and WIN87EM are left enabled, although
some programs may work better without them.
* [multimedia/*.c] [include/multimedia.h] [include/driver.h]
Begun cleaning things up a little. Replaced printfs with dprintf_
macros, made functions static where possible, and some other minor
changes.
Sun Jun 11 23:19:10 1995 Martin von Loewis <martin@informatik.hu-berlin.de>
* [debugger/dbg.y][debugger/dbg.l]
Removed special handling for FILE_IDENTIFER, because it caused
problems with x/<format> statements.
* [debugger/info.c]
Use SC_ESP instead of SC_EIP for stack dump.
* [misc/compobj.c][if1632/compobj.spec]
CoBuildVersion, CoInitialize, CoUninitialize: new functions
* [misc/ole2.c][if1632/ole2.spec][misc/Imakefile][include/ole2.h]
New files ole2.c, ole2.h
OleBuildVersion, OleInitialize, OleUninitialize: new functions
* [if1632/ole2disp.spec]
Added missing ordinals above 109
* [misc/ole2nls.c][if1632/ole2nls.spec][include/winnls.h]
New file winnls.h
GetLocaleInfoA: new function
* [if1632/shell.spec]
Added FindEnvironmentString as stub
* [misc/olecli.c][if1632/olecli.spec]
OleIsDcMeta: New function
* [objects/font][misc/gdi.spec]
GetKerningPairs: new function
* [misc/shell.c]
ShellExecute: Implemented support for starting programs
* [if1632/user.spec]
Inserted missing relay to GetClipCursor
Sun Jun 11 20:34:47 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Fix a problem with the local heap.
* [include/wintypes.h]
Fixed wrong declarations of CATCHBUF and LPCATCHBUF.
* [include/mdi.h] [windows/mdi.c]
This code still assumed segmented address==linear address. Fixed.
* [include/msdos.h] [misc/dos_fs.c]
The filemask field of the dosdirent structure could be overrun. Fixed.
If you had a file called foobar and a file called foo, trying to
FindFile(foo) could accidentally find file foobar instead. Fixed.
* [misc/file.c]
OpenFile(): Always return the full pathname in ofs->szPathName. This
also fixes GetModuleFilename().
Prevent _lclose() from closing stderr or stdout.
* [misc/profile.c]
Search for .ini files in the path of the current module as well.
(Needed by Lotus Organizer.)
* [loader/task.c] [loader/ne_image.c] [loader/module.c]
[memory/local.c]
Local heaps are now initialized by InitTask() for executables. DLLs
have to call LocalInit() themselves, LocalInit() has to put the
heap at the end of the segment when called with start==0. We no longer
allocate the DGROUP with 64k on startup, but grow the local heap
in LOCAL_GetBlock() when necessary.
* [loader/module.c]
LoadLibrary() should call LoadModule() in all cases, even if the
DLL is already loaded, to ensure that the reference count is correct.
* [loader/ne_image.c]
Some changes to function prolog fixup. Does anyone know exactly how
this is supposed to work? I am only guessing here.
In NE_InitializeDLLs(), initialize the DLLs a module refers to before
the module itself.
* [loader/task.c]
Initialize instance data at the beginning of the DGROUP in InitTask().
* [memory/local.c]
Some fixes for moveable blocks.
* [memory/selector.c]
All the IsBad*Pointer() functions returned exactly the wrong boolean
value in all cases!
* [objects/bitblt.c]
Fixed another null pointer dereference in debugging output.
* [objects/font.c]
Some more recovery possibilities for FONT_MatchFont() if a specified
font does not exist.
* [windows/win.c]
The dialog code may call CreateWindowEx with an integer in windowName.
This happens for static icon controls that expect a resource ID as
the window name. CreateWindowEx() used to crash. Fixed.
* [windows/class.c] [windows/win.c]
Window classes are owned by modules, not instances. Changed
RegisterClass(), UnregisterClass(), GetClassInfo() and CreateWindowEx()
accordingly.
Sat Jun 10 16:10:53 1995 Olaf Flebbe <o.flebbe@science-computing.uni-tuebingen.de>
* [miscemu/int21.c]
clock.exe was displaying incorrect year.
Fri Jun 9 20:36:56 1995 Victor Schneider <tailor@crl.com>
* [include/cursor.h] [windows/cursor.c]
Implemented CreateCursorIconIndirect().
1995-06-20 21:08:12 +02:00
|
|
|
}
|
|
|
|
|
2000-02-07 17:28:52 +01:00
|
|
|
static DWORD MCICDA_Seek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms);
|
|
|
|
static DWORD MCICDA_Stop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms);
|
1998-12-18 16:05:25 +01:00
|
|
|
|
|
|
|
/**************************************************************************
|
2000-02-07 17:28:52 +01:00
|
|
|
* MCICDA_Open [internal]
|
1998-12-18 16:05:25 +01:00
|
|
|
*/
|
2005-02-09 23:26:25 +01:00
|
|
|
static DWORD MCICDA_Open(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSW lpOpenParms)
|
1998-12-18 16:05:25 +01:00
|
|
|
{
|
|
|
|
DWORD dwDeviceID;
|
2002-01-13 02:46:12 +01:00
|
|
|
DWORD ret = MCIERR_HARDWARE;
|
1999-07-15 16:43:13 +02:00
|
|
|
WINE_MCICDAUDIO* wmcda = (WINE_MCICDAUDIO*)mciGetDriverData(wDevID);
|
2005-02-09 23:26:25 +01:00
|
|
|
WCHAR root[7], drive = 0;
|
2008-10-16 13:46:57 +02:00
|
|
|
unsigned int count;
|
1998-12-18 16:05:25 +01:00
|
|
|
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("(%04X, %08X, %p);\n", wDevID, dwFlags, lpOpenParms);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1998-12-18 16:05:25 +01:00
|
|
|
if (lpOpenParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
|
1999-05-02 12:21:49 +02:00
|
|
|
if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID;
|
1998-12-18 16:05:25 +01:00
|
|
|
|
|
|
|
dwDeviceID = lpOpenParms->wDeviceID;
|
|
|
|
|
1999-02-02 16:25:16 +01:00
|
|
|
if (wmcda->nUseCount > 0) {
|
|
|
|
/* The driver is already open on this channel */
|
1998-12-18 16:05:25 +01:00
|
|
|
/* If the driver was opened shareable before and this open specifies */
|
|
|
|
/* shareable then increment the use count */
|
1999-02-02 16:25:16 +01:00
|
|
|
if (wmcda->fShareable && (dwFlags & MCI_OPEN_SHAREABLE))
|
|
|
|
++wmcda->nUseCount;
|
1998-12-18 16:05:25 +01:00
|
|
|
else
|
|
|
|
return MCIERR_MUST_USE_SHAREABLE;
|
|
|
|
} else {
|
1999-02-02 16:25:16 +01:00
|
|
|
wmcda->nUseCount = 1;
|
|
|
|
wmcda->fShareable = dwFlags & MCI_OPEN_SHAREABLE;
|
1998-12-18 16:05:25 +01:00
|
|
|
}
|
|
|
|
if (dwFlags & MCI_OPEN_ELEMENT) {
|
1999-11-14 20:44:02 +01:00
|
|
|
if (dwFlags & MCI_OPEN_ELEMENT_ID) {
|
2007-05-31 16:01:05 +02:00
|
|
|
WARN("MCI_OPEN_ELEMENT_ID %p! Abort\n", lpOpenParms->lpstrElementName);
|
2009-10-01 19:34:05 +02:00
|
|
|
ret = MCIERR_NO_ELEMENT_ALLOWED;
|
|
|
|
goto the_error;
|
1999-11-14 20:44:02 +01:00
|
|
|
}
|
2005-02-09 23:26:25 +01:00
|
|
|
TRACE("MCI_OPEN_ELEMENT element name: %s\n", debugstr_w(lpOpenParms->lpstrElementName));
|
2002-01-13 02:46:12 +01:00
|
|
|
if (!isalpha(lpOpenParms->lpstrElementName[0]) || lpOpenParms->lpstrElementName[1] != ':' ||
|
2004-08-20 21:27:15 +02:00
|
|
|
(lpOpenParms->lpstrElementName[2] && lpOpenParms->lpstrElementName[2] != '\\'))
|
2002-01-13 02:46:12 +01:00
|
|
|
{
|
2005-02-09 23:26:25 +01:00
|
|
|
WARN("MCI_OPEN_ELEMENT unsupported format: %s\n",
|
|
|
|
debugstr_w(lpOpenParms->lpstrElementName));
|
2002-06-01 01:06:46 +02:00
|
|
|
ret = MCIERR_NO_ELEMENT_ALLOWED;
|
2002-01-13 02:46:12 +01:00
|
|
|
goto the_error;
|
|
|
|
}
|
|
|
|
drive = toupper(lpOpenParms->lpstrElementName[0]);
|
2005-02-09 23:26:25 +01:00
|
|
|
root[0] = drive; root[1] = ':'; root[2] = '\\'; root[3] = '\0';
|
|
|
|
if (GetDriveTypeW(root) != DRIVE_CDROM)
|
2002-01-13 02:46:12 +01:00
|
|
|
{
|
|
|
|
ret = MCIERR_INVALID_DEVICE_NAME;
|
|
|
|
goto the_error;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* drive letter isn't passed... get the dwDeviceID'th cdrom in the system */
|
2005-02-09 23:26:25 +01:00
|
|
|
root[0] = 'A'; root[1] = ':'; root[2] = '\\'; root[3] = '\0';
|
2002-01-13 02:46:12 +01:00
|
|
|
for (count = 0; root[0] <= 'Z'; root[0]++)
|
|
|
|
{
|
2005-02-09 23:26:25 +01:00
|
|
|
if (GetDriveTypeW(root) == DRIVE_CDROM && ++count >= dwDeviceID)
|
2002-01-13 02:46:12 +01:00
|
|
|
{
|
|
|
|
drive = root[0];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!drive)
|
|
|
|
{
|
|
|
|
ret = MCIERR_INVALID_DEVICE_ID;
|
|
|
|
goto the_error;
|
|
|
|
}
|
1998-12-18 16:05:25 +01:00
|
|
|
}
|
|
|
|
|
1999-02-02 16:25:16 +01:00
|
|
|
wmcda->wNotifyDeviceID = dwDeviceID;
|
1999-12-25 23:54:11 +01:00
|
|
|
wmcda->dwTimeFormat = MCI_FORMAT_MSF;
|
1998-12-18 16:05:25 +01:00
|
|
|
|
2002-01-13 02:46:12 +01:00
|
|
|
/* now, open the handle */
|
2005-02-09 23:26:25 +01:00
|
|
|
root[0] = root[1] = '\\'; root[2] = '.'; root[3] = '\\'; root[4] = drive; root[5] = ':'; root[6] = '\0';
|
|
|
|
wmcda->handle = CreateFileW(root, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0);
|
2009-02-27 23:55:31 +01:00
|
|
|
if (wmcda->handle != INVALID_HANDLE_VALUE)
|
2002-01-13 02:46:12 +01:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
the_error:
|
|
|
|
--wmcda->nUseCount;
|
|
|
|
return ret;
|
1998-12-18 16:05:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
2000-02-07 17:28:52 +01:00
|
|
|
* MCICDA_Close [internal]
|
1998-12-18 16:05:25 +01:00
|
|
|
*/
|
2000-02-07 17:28:52 +01:00
|
|
|
static DWORD MCICDA_Close(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
|
1998-12-18 16:05:25 +01:00
|
|
|
{
|
2000-02-07 17:28:52 +01:00
|
|
|
WINE_MCICDAUDIO* wmcda = MCICDA_GetOpenDrv(wDevID);
|
1998-12-18 16:05:25 +01:00
|
|
|
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("(%04X, %08X, %p);\n", wDevID, dwParam, lpParms);
|
1998-12-18 16:05:25 +01:00
|
|
|
|
1999-02-02 16:25:16 +01:00
|
|
|
if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2002-01-13 02:46:12 +01:00
|
|
|
if (--wmcda->nUseCount == 0) {
|
|
|
|
CloseHandle(wmcda->handle);
|
1998-12-18 16:05:25 +01:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
2000-02-07 17:28:52 +01:00
|
|
|
* MCICDA_GetDevCaps [internal]
|
1998-12-18 16:05:25 +01:00
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
static DWORD MCICDA_GetDevCaps(UINT wDevID, DWORD dwFlags,
|
1998-12-18 16:05:25 +01:00
|
|
|
LPMCI_GETDEVCAPS_PARMS lpParms)
|
|
|
|
{
|
1999-07-24 12:45:24 +02:00
|
|
|
DWORD ret = 0;
|
|
|
|
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("(%04X, %08X, %p);\n", wDevID, dwFlags, lpParms);
|
1998-12-18 16:05:25 +01:00
|
|
|
|
|
|
|
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
|
|
|
|
|
|
|
|
if (dwFlags & MCI_GETDEVCAPS_ITEM) {
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("MCI_GETDEVCAPS_ITEM dwItem=%08X;\n", lpParms->dwItem);
|
1998-12-18 16:05:25 +01:00
|
|
|
|
1999-07-24 12:45:24 +02:00
|
|
|
switch (lpParms->dwItem) {
|
1998-12-18 16:05:25 +01:00
|
|
|
case MCI_GETDEVCAPS_CAN_RECORD:
|
1999-07-24 12:45:24 +02:00
|
|
|
lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE);
|
|
|
|
ret = MCI_RESOURCE_RETURNED;
|
1998-12-18 16:05:25 +01:00
|
|
|
break;
|
|
|
|
case MCI_GETDEVCAPS_HAS_AUDIO:
|
1999-07-24 12:45:24 +02:00
|
|
|
lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
|
|
|
|
ret = MCI_RESOURCE_RETURNED;
|
1998-12-18 16:05:25 +01:00
|
|
|
break;
|
|
|
|
case MCI_GETDEVCAPS_HAS_VIDEO:
|
1999-07-24 12:45:24 +02:00
|
|
|
lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE);
|
|
|
|
ret = MCI_RESOURCE_RETURNED;
|
1998-12-18 16:05:25 +01:00
|
|
|
break;
|
|
|
|
case MCI_GETDEVCAPS_DEVICE_TYPE:
|
1999-07-24 12:45:24 +02:00
|
|
|
lpParms->dwReturn = MAKEMCIRESOURCE(MCI_DEVTYPE_CD_AUDIO, MCI_DEVTYPE_CD_AUDIO);
|
|
|
|
ret = MCI_RESOURCE_RETURNED;
|
1998-12-18 16:05:25 +01:00
|
|
|
break;
|
|
|
|
case MCI_GETDEVCAPS_USES_FILES:
|
1999-07-24 12:45:24 +02:00
|
|
|
lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE);
|
|
|
|
ret = MCI_RESOURCE_RETURNED;
|
1998-12-18 16:05:25 +01:00
|
|
|
break;
|
|
|
|
case MCI_GETDEVCAPS_COMPOUND_DEVICE:
|
1999-07-24 12:45:24 +02:00
|
|
|
lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE);
|
|
|
|
ret = MCI_RESOURCE_RETURNED;
|
1998-12-18 16:05:25 +01:00
|
|
|
break;
|
|
|
|
case MCI_GETDEVCAPS_CAN_EJECT:
|
1999-07-24 12:45:24 +02:00
|
|
|
lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
|
|
|
|
ret = MCI_RESOURCE_RETURNED;
|
1998-12-18 16:05:25 +01:00
|
|
|
break;
|
|
|
|
case MCI_GETDEVCAPS_CAN_PLAY:
|
1999-07-24 12:45:24 +02:00
|
|
|
lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
|
|
|
|
ret = MCI_RESOURCE_RETURNED;
|
1998-12-18 16:05:25 +01:00
|
|
|
break;
|
|
|
|
case MCI_GETDEVCAPS_CAN_SAVE:
|
1999-07-24 12:45:24 +02:00
|
|
|
lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE);
|
|
|
|
ret = MCI_RESOURCE_RETURNED;
|
1998-12-18 16:05:25 +01:00
|
|
|
break;
|
|
|
|
default:
|
2006-10-09 21:22:38 +02:00
|
|
|
ERR("Unsupported %x devCaps item\n", lpParms->dwItem);
|
1998-12-18 16:05:25 +01:00
|
|
|
return MCIERR_UNRECOGNIZED_COMMAND;
|
|
|
|
}
|
1999-07-24 12:45:24 +02:00
|
|
|
} else {
|
|
|
|
TRACE("No GetDevCaps-Item !\n");
|
|
|
|
return MCIERR_UNRECOGNIZED_COMMAND;
|
1998-12-18 16:05:25 +01:00
|
|
|
}
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("lpParms->dwReturn=%08X;\n", lpParms->dwReturn);
|
1999-07-24 12:45:24 +02:00
|
|
|
return ret;
|
1998-12-18 16:05:25 +01:00
|
|
|
}
|
|
|
|
|
2002-01-13 02:46:12 +01:00
|
|
|
static DWORD CDROM_Audio_GetSerial(CDROM_TOC* toc)
|
|
|
|
{
|
|
|
|
unsigned long serial = 0;
|
|
|
|
int i;
|
|
|
|
WORD wMagic;
|
|
|
|
DWORD dwStart, dwEnd;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2002-01-13 02:46:12 +01:00
|
|
|
/*
|
|
|
|
* wMagic collects the wFrames from track 1
|
|
|
|
* dwStart, dwEnd collect the beginning and end of the disc respectively, in
|
|
|
|
* frames.
|
|
|
|
* There it is collected for correcting the serial when there are less than
|
|
|
|
* 3 tracks.
|
|
|
|
*/
|
|
|
|
wMagic = toc->TrackData[0].Address[3];
|
|
|
|
dwStart = FRAME_OF_TOC(*toc, toc->FirstTrack);
|
|
|
|
|
|
|
|
for (i = 0; i <= toc->LastTrack - toc->FirstTrack; i++) {
|
2002-06-01 01:06:46 +02:00
|
|
|
serial += (toc->TrackData[i].Address[1] << 16) |
|
2002-01-13 02:46:12 +01:00
|
|
|
(toc->TrackData[i].Address[2] << 8) | toc->TrackData[i].Address[3];
|
|
|
|
}
|
|
|
|
dwEnd = FRAME_OF_TOC(*toc, toc->LastTrack + 1);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2002-01-13 02:46:12 +01:00
|
|
|
if (toc->LastTrack - toc->FirstTrack + 1 < 3)
|
|
|
|
serial += wMagic + (dwEnd - dwStart);
|
|
|
|
|
|
|
|
return serial;
|
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2002-01-13 02:46:12 +01:00
|
|
|
|
1998-12-18 16:05:25 +01:00
|
|
|
/**************************************************************************
|
2000-02-07 17:28:52 +01:00
|
|
|
* MCICDA_Info [internal]
|
1998-12-18 16:05:25 +01:00
|
|
|
*/
|
2005-02-09 23:26:25 +01:00
|
|
|
static DWORD MCICDA_Info(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMSW lpParms)
|
1998-12-18 16:05:25 +01:00
|
|
|
{
|
2005-02-09 23:26:25 +01:00
|
|
|
LPCWSTR str = NULL;
|
2000-02-07 17:28:52 +01:00
|
|
|
WINE_MCICDAUDIO* wmcda = MCICDA_GetOpenDrv(wDevID);
|
1999-09-27 15:38:57 +02:00
|
|
|
DWORD ret = 0;
|
2005-02-09 23:26:25 +01:00
|
|
|
WCHAR buffer[16];
|
1999-09-27 15:38:57 +02:00
|
|
|
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("(%04X, %08X, %p);\n", wDevID, dwFlags, lpParms);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-07-24 12:45:24 +02:00
|
|
|
if (lpParms == NULL || lpParms->lpstrReturn == NULL)
|
|
|
|
return MCIERR_NULL_PARAMETER_BLOCK;
|
|
|
|
if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID;
|
|
|
|
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("buf=%p, len=%u\n", lpParms->lpstrReturn, lpParms->dwRetSize);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-12-25 23:54:11 +01:00
|
|
|
if (dwFlags & MCI_INFO_PRODUCT) {
|
2005-02-09 23:26:25 +01:00
|
|
|
static const WCHAR wszAudioCd[] = {'W','i','n','e','\'','s',' ','a','u','d','i','o',' ','C','D',0};
|
|
|
|
str = wszAudioCd;
|
1999-12-25 23:54:11 +01:00
|
|
|
} else if (dwFlags & MCI_INFO_MEDIA_UPC) {
|
|
|
|
ret = MCIERR_NO_IDENTITY;
|
|
|
|
} else if (dwFlags & MCI_INFO_MEDIA_IDENTITY) {
|
2002-01-13 02:46:12 +01:00
|
|
|
DWORD res = 0;
|
|
|
|
CDROM_TOC toc;
|
|
|
|
DWORD br;
|
2005-02-09 23:26:25 +01:00
|
|
|
static const WCHAR wszLu[] = {'%','l','u',0};
|
1999-12-25 23:54:11 +01:00
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0,
|
2002-01-13 02:46:12 +01:00
|
|
|
&toc, sizeof(toc), &br, NULL)) {
|
2000-02-07 17:28:52 +01:00
|
|
|
return MCICDA_GetError(wmcda);
|
1999-12-25 23:54:11 +01:00
|
|
|
}
|
2002-01-13 02:46:12 +01:00
|
|
|
|
|
|
|
res = CDROM_Audio_GetSerial(&toc);
|
2005-02-09 23:26:25 +01:00
|
|
|
sprintfW(buffer, wszLu, res);
|
1999-12-25 23:54:11 +01:00
|
|
|
str = buffer;
|
|
|
|
} else {
|
2006-10-09 21:22:38 +02:00
|
|
|
WARN("Don't know this info command (%u)\n", dwFlags);
|
1999-12-25 23:54:11 +01:00
|
|
|
ret = MCIERR_UNRECOGNIZED_COMMAND;
|
1999-07-24 12:45:24 +02:00
|
|
|
}
|
1999-09-27 15:38:57 +02:00
|
|
|
if (str) {
|
2005-02-09 23:26:25 +01:00
|
|
|
if (lpParms->dwRetSize <= strlenW(str)) {
|
|
|
|
lstrcpynW(lpParms->lpstrReturn, str, lpParms->dwRetSize - 1);
|
1999-09-27 15:38:57 +02:00
|
|
|
ret = MCIERR_PARAM_OVERFLOW;
|
|
|
|
} else {
|
2005-02-09 23:26:25 +01:00
|
|
|
strcpyW(lpParms->lpstrReturn, str);
|
2002-06-01 01:06:46 +02:00
|
|
|
}
|
1999-09-27 15:38:57 +02:00
|
|
|
} else {
|
|
|
|
*lpParms->lpstrReturn = 0;
|
|
|
|
}
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("=> %s (%d)\n", debugstr_w(lpParms->lpstrReturn), ret);
|
1999-09-27 15:38:57 +02:00
|
|
|
return ret;
|
1998-12-18 16:05:25 +01:00
|
|
|
}
|
Release 950620
Mon Jun 19 20:29:50 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
* [debugger/*.c]
Modified debugger to use segmented pointers everywhere.
* [if1632/shell.spec] [if1632/sound.spec] [if1632/user.spec]
Declared all functions that return only 16-bit as 'pascal16'.
* [include/ldt.h] [memory/ldt.c]
Export LDT_EntryToBytes (new) and LDT_BytesToEntry for DPMI.
Maintain a copy of the selector flags, removing the need to make a
system call to retrieve an LDT entry.
* [loader/module.c]
Fixed bug with module file handle cache.
* [loader/ne_resource.c]
Fixed file name bug in NE_AccessResource().
* [loader/resource.c]
Fixed bug in LoadIcon() that caused wrong colors to be used for
the icon mask.
* [loader/signal.c]
Moved instruction emulation to miscemu/instr.c.
* [misc/dos_fs.c] [miscemu/int21.c]
Lots of small fixes, thanks to Morten Welinder.
* [miscemu/dpmi.c]
More complete DPMI emulation.
* [miscemu/instr.c]
Added support for prefixes in instructions to emulate.
* [miscemu/int2f.c]
Use register macros instead of destroying the high part of 32-bit
registers.
* [objects/dc.c]
Fixed bug in GetDCState() that failed to clear the new DC.
* [rc/sysres.rc]
Removed dialogs 11 and 12 that were never used.
* [tools/build.c]
'pascal16' generated functions did not save %dx.
Removed use of %fs to access the stack.
%ds is no longer initialized before calling a 16-bit routine.
* [windows/defwnd.c]
Accept a NULL pointer as window title.
* [windows/mdi.c]
MDICascade: skip iconic windows.
Implemented CalcChildScroll().
* [windows/utility.c]
Fixed MulDiv() for illegal values.
* [windows/win.c]
Fixed X error in CreateWindowEx() when WM_NCCALCSIZE returned
a zero width or height.
Sun Jun 18 22:22:30 MET DST 1995 Fons Botman (botman@inter.nl.net)
* [controls/edit.c]
Fixed "uninitalized" message which -Wall couldnt see to be ok
in EDIT_WriteText.
* [include/debug.h]
Added define for extra checks in API definitions during debugging.
* [loader/ne_image.c]
Added newline in NE_FixupPrologs to avoid long lines.
* [misc/dos_fs.c]
Added extra safety check in DOS_ValidDrive.
* [misc/exec.c]
Fixed definition of ExitWindows.
Sun Jun 18 21:16:08 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Some fixes, mostly for memory management, but also for text selection
and tab postitions. General cleanup. Notepad.exe now works.
* [controls/combo.c]
Fix: the hwnd field of the DRAWITEMSTRUCT should always be that of
the combo box, not the ComboLBox that belongs to it.
* [controls/listbox.c]
Handle itemID field correctly throughout.
* [memory/local.c]
Implemented flag LMEM_ZEROINIT.
LocalReAlloc() could trash the heap. Fixed.
* [objects/font.c]
FONT_MatchFont(): don't get confused by negative widths.
Fixed a segfault in EnumFonts().
* [objects/text.c]
DrawText(): DT_CALCRECT implies DT_NOCLIP.
* [objects/dcvalues.c]
MAKELONG was used with bad parameters in DC_GET_X_Y.
* [windows/dialog.c]
Don't show the dialog if WS_VISIBLE isn't set in the template.
* [windows/utility.c]
UTILITY_convertArgs(): Never pass an expression containing ++ into a
macro...
* [windows/win.c]
SetParent() should unlink the window before changing the parent.
* [windows/message.c]
Don't call timer functions via CallWindowProc(), since it checks
whether hwnd==0 and does not call the function in that case.
* [miscemu/instr.c]
Ignore interrupt 0x3D, for VBRUN300.DLL.
* [misc/commdlg.c]
Don't rely on the itemData field of the DRAWITEMSTRUCT to contain a
pointer to the item text.
* [if1632/relay.c]
Disable OLE and DDEML DLLs by default, since they contain nothing but
stubs anyway. SHELL, COMMDLG and WIN87EM are left enabled, although
some programs may work better without them.
* [multimedia/*.c] [include/multimedia.h] [include/driver.h]
Begun cleaning things up a little. Replaced printfs with dprintf_
macros, made functions static where possible, and some other minor
changes.
Sun Jun 11 23:19:10 1995 Martin von Loewis <martin@informatik.hu-berlin.de>
* [debugger/dbg.y][debugger/dbg.l]
Removed special handling for FILE_IDENTIFER, because it caused
problems with x/<format> statements.
* [debugger/info.c]
Use SC_ESP instead of SC_EIP for stack dump.
* [misc/compobj.c][if1632/compobj.spec]
CoBuildVersion, CoInitialize, CoUninitialize: new functions
* [misc/ole2.c][if1632/ole2.spec][misc/Imakefile][include/ole2.h]
New files ole2.c, ole2.h
OleBuildVersion, OleInitialize, OleUninitialize: new functions
* [if1632/ole2disp.spec]
Added missing ordinals above 109
* [misc/ole2nls.c][if1632/ole2nls.spec][include/winnls.h]
New file winnls.h
GetLocaleInfoA: new function
* [if1632/shell.spec]
Added FindEnvironmentString as stub
* [misc/olecli.c][if1632/olecli.spec]
OleIsDcMeta: New function
* [objects/font][misc/gdi.spec]
GetKerningPairs: new function
* [misc/shell.c]
ShellExecute: Implemented support for starting programs
* [if1632/user.spec]
Inserted missing relay to GetClipCursor
Sun Jun 11 20:34:47 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Fix a problem with the local heap.
* [include/wintypes.h]
Fixed wrong declarations of CATCHBUF and LPCATCHBUF.
* [include/mdi.h] [windows/mdi.c]
This code still assumed segmented address==linear address. Fixed.
* [include/msdos.h] [misc/dos_fs.c]
The filemask field of the dosdirent structure could be overrun. Fixed.
If you had a file called foobar and a file called foo, trying to
FindFile(foo) could accidentally find file foobar instead. Fixed.
* [misc/file.c]
OpenFile(): Always return the full pathname in ofs->szPathName. This
also fixes GetModuleFilename().
Prevent _lclose() from closing stderr or stdout.
* [misc/profile.c]
Search for .ini files in the path of the current module as well.
(Needed by Lotus Organizer.)
* [loader/task.c] [loader/ne_image.c] [loader/module.c]
[memory/local.c]
Local heaps are now initialized by InitTask() for executables. DLLs
have to call LocalInit() themselves, LocalInit() has to put the
heap at the end of the segment when called with start==0. We no longer
allocate the DGROUP with 64k on startup, but grow the local heap
in LOCAL_GetBlock() when necessary.
* [loader/module.c]
LoadLibrary() should call LoadModule() in all cases, even if the
DLL is already loaded, to ensure that the reference count is correct.
* [loader/ne_image.c]
Some changes to function prolog fixup. Does anyone know exactly how
this is supposed to work? I am only guessing here.
In NE_InitializeDLLs(), initialize the DLLs a module refers to before
the module itself.
* [loader/task.c]
Initialize instance data at the beginning of the DGROUP in InitTask().
* [memory/local.c]
Some fixes for moveable blocks.
* [memory/selector.c]
All the IsBad*Pointer() functions returned exactly the wrong boolean
value in all cases!
* [objects/bitblt.c]
Fixed another null pointer dereference in debugging output.
* [objects/font.c]
Some more recovery possibilities for FONT_MatchFont() if a specified
font does not exist.
* [windows/win.c]
The dialog code may call CreateWindowEx with an integer in windowName.
This happens for static icon controls that expect a resource ID as
the window name. CreateWindowEx() used to crash. Fixed.
* [windows/class.c] [windows/win.c]
Window classes are owned by modules, not instances. Changed
RegisterClass(), UnregisterClass(), GetClassInfo() and CreateWindowEx()
accordingly.
Sat Jun 10 16:10:53 1995 Olaf Flebbe <o.flebbe@science-computing.uni-tuebingen.de>
* [miscemu/int21.c]
clock.exe was displaying incorrect year.
Fri Jun 9 20:36:56 1995 Victor Schneider <tailor@crl.com>
* [include/cursor.h] [windows/cursor.c]
Implemented CreateCursorIconIndirect().
1995-06-20 21:08:12 +02:00
|
|
|
|
|
|
|
/**************************************************************************
|
2000-02-07 17:28:52 +01:00
|
|
|
* MCICDA_Status [internal]
|
1998-10-11 16:14:24 +02:00
|
|
|
*/
|
2000-02-07 17:28:52 +01:00
|
|
|
static DWORD MCICDA_Status(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
|
Release 950620
Mon Jun 19 20:29:50 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
* [debugger/*.c]
Modified debugger to use segmented pointers everywhere.
* [if1632/shell.spec] [if1632/sound.spec] [if1632/user.spec]
Declared all functions that return only 16-bit as 'pascal16'.
* [include/ldt.h] [memory/ldt.c]
Export LDT_EntryToBytes (new) and LDT_BytesToEntry for DPMI.
Maintain a copy of the selector flags, removing the need to make a
system call to retrieve an LDT entry.
* [loader/module.c]
Fixed bug with module file handle cache.
* [loader/ne_resource.c]
Fixed file name bug in NE_AccessResource().
* [loader/resource.c]
Fixed bug in LoadIcon() that caused wrong colors to be used for
the icon mask.
* [loader/signal.c]
Moved instruction emulation to miscemu/instr.c.
* [misc/dos_fs.c] [miscemu/int21.c]
Lots of small fixes, thanks to Morten Welinder.
* [miscemu/dpmi.c]
More complete DPMI emulation.
* [miscemu/instr.c]
Added support for prefixes in instructions to emulate.
* [miscemu/int2f.c]
Use register macros instead of destroying the high part of 32-bit
registers.
* [objects/dc.c]
Fixed bug in GetDCState() that failed to clear the new DC.
* [rc/sysres.rc]
Removed dialogs 11 and 12 that were never used.
* [tools/build.c]
'pascal16' generated functions did not save %dx.
Removed use of %fs to access the stack.
%ds is no longer initialized before calling a 16-bit routine.
* [windows/defwnd.c]
Accept a NULL pointer as window title.
* [windows/mdi.c]
MDICascade: skip iconic windows.
Implemented CalcChildScroll().
* [windows/utility.c]
Fixed MulDiv() for illegal values.
* [windows/win.c]
Fixed X error in CreateWindowEx() when WM_NCCALCSIZE returned
a zero width or height.
Sun Jun 18 22:22:30 MET DST 1995 Fons Botman (botman@inter.nl.net)
* [controls/edit.c]
Fixed "uninitalized" message which -Wall couldnt see to be ok
in EDIT_WriteText.
* [include/debug.h]
Added define for extra checks in API definitions during debugging.
* [loader/ne_image.c]
Added newline in NE_FixupPrologs to avoid long lines.
* [misc/dos_fs.c]
Added extra safety check in DOS_ValidDrive.
* [misc/exec.c]
Fixed definition of ExitWindows.
Sun Jun 18 21:16:08 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Some fixes, mostly for memory management, but also for text selection
and tab postitions. General cleanup. Notepad.exe now works.
* [controls/combo.c]
Fix: the hwnd field of the DRAWITEMSTRUCT should always be that of
the combo box, not the ComboLBox that belongs to it.
* [controls/listbox.c]
Handle itemID field correctly throughout.
* [memory/local.c]
Implemented flag LMEM_ZEROINIT.
LocalReAlloc() could trash the heap. Fixed.
* [objects/font.c]
FONT_MatchFont(): don't get confused by negative widths.
Fixed a segfault in EnumFonts().
* [objects/text.c]
DrawText(): DT_CALCRECT implies DT_NOCLIP.
* [objects/dcvalues.c]
MAKELONG was used with bad parameters in DC_GET_X_Y.
* [windows/dialog.c]
Don't show the dialog if WS_VISIBLE isn't set in the template.
* [windows/utility.c]
UTILITY_convertArgs(): Never pass an expression containing ++ into a
macro...
* [windows/win.c]
SetParent() should unlink the window before changing the parent.
* [windows/message.c]
Don't call timer functions via CallWindowProc(), since it checks
whether hwnd==0 and does not call the function in that case.
* [miscemu/instr.c]
Ignore interrupt 0x3D, for VBRUN300.DLL.
* [misc/commdlg.c]
Don't rely on the itemData field of the DRAWITEMSTRUCT to contain a
pointer to the item text.
* [if1632/relay.c]
Disable OLE and DDEML DLLs by default, since they contain nothing but
stubs anyway. SHELL, COMMDLG and WIN87EM are left enabled, although
some programs may work better without them.
* [multimedia/*.c] [include/multimedia.h] [include/driver.h]
Begun cleaning things up a little. Replaced printfs with dprintf_
macros, made functions static where possible, and some other minor
changes.
Sun Jun 11 23:19:10 1995 Martin von Loewis <martin@informatik.hu-berlin.de>
* [debugger/dbg.y][debugger/dbg.l]
Removed special handling for FILE_IDENTIFER, because it caused
problems with x/<format> statements.
* [debugger/info.c]
Use SC_ESP instead of SC_EIP for stack dump.
* [misc/compobj.c][if1632/compobj.spec]
CoBuildVersion, CoInitialize, CoUninitialize: new functions
* [misc/ole2.c][if1632/ole2.spec][misc/Imakefile][include/ole2.h]
New files ole2.c, ole2.h
OleBuildVersion, OleInitialize, OleUninitialize: new functions
* [if1632/ole2disp.spec]
Added missing ordinals above 109
* [misc/ole2nls.c][if1632/ole2nls.spec][include/winnls.h]
New file winnls.h
GetLocaleInfoA: new function
* [if1632/shell.spec]
Added FindEnvironmentString as stub
* [misc/olecli.c][if1632/olecli.spec]
OleIsDcMeta: New function
* [objects/font][misc/gdi.spec]
GetKerningPairs: new function
* [misc/shell.c]
ShellExecute: Implemented support for starting programs
* [if1632/user.spec]
Inserted missing relay to GetClipCursor
Sun Jun 11 20:34:47 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Fix a problem with the local heap.
* [include/wintypes.h]
Fixed wrong declarations of CATCHBUF and LPCATCHBUF.
* [include/mdi.h] [windows/mdi.c]
This code still assumed segmented address==linear address. Fixed.
* [include/msdos.h] [misc/dos_fs.c]
The filemask field of the dosdirent structure could be overrun. Fixed.
If you had a file called foobar and a file called foo, trying to
FindFile(foo) could accidentally find file foobar instead. Fixed.
* [misc/file.c]
OpenFile(): Always return the full pathname in ofs->szPathName. This
also fixes GetModuleFilename().
Prevent _lclose() from closing stderr or stdout.
* [misc/profile.c]
Search for .ini files in the path of the current module as well.
(Needed by Lotus Organizer.)
* [loader/task.c] [loader/ne_image.c] [loader/module.c]
[memory/local.c]
Local heaps are now initialized by InitTask() for executables. DLLs
have to call LocalInit() themselves, LocalInit() has to put the
heap at the end of the segment when called with start==0. We no longer
allocate the DGROUP with 64k on startup, but grow the local heap
in LOCAL_GetBlock() when necessary.
* [loader/module.c]
LoadLibrary() should call LoadModule() in all cases, even if the
DLL is already loaded, to ensure that the reference count is correct.
* [loader/ne_image.c]
Some changes to function prolog fixup. Does anyone know exactly how
this is supposed to work? I am only guessing here.
In NE_InitializeDLLs(), initialize the DLLs a module refers to before
the module itself.
* [loader/task.c]
Initialize instance data at the beginning of the DGROUP in InitTask().
* [memory/local.c]
Some fixes for moveable blocks.
* [memory/selector.c]
All the IsBad*Pointer() functions returned exactly the wrong boolean
value in all cases!
* [objects/bitblt.c]
Fixed another null pointer dereference in debugging output.
* [objects/font.c]
Some more recovery possibilities for FONT_MatchFont() if a specified
font does not exist.
* [windows/win.c]
The dialog code may call CreateWindowEx with an integer in windowName.
This happens for static icon controls that expect a resource ID as
the window name. CreateWindowEx() used to crash. Fixed.
* [windows/class.c] [windows/win.c]
Window classes are owned by modules, not instances. Changed
RegisterClass(), UnregisterClass(), GetClassInfo() and CreateWindowEx()
accordingly.
Sat Jun 10 16:10:53 1995 Olaf Flebbe <o.flebbe@science-computing.uni-tuebingen.de>
* [miscemu/int21.c]
clock.exe was displaying incorrect year.
Fri Jun 9 20:36:56 1995 Victor Schneider <tailor@crl.com>
* [include/cursor.h] [windows/cursor.c]
Implemented CreateCursorIconIndirect().
1995-06-20 21:08:12 +02:00
|
|
|
{
|
2002-01-13 02:46:12 +01:00
|
|
|
WINE_MCICDAUDIO* wmcda = MCICDA_GetOpenDrv(wDevID);
|
|
|
|
DWORD ret = 0;
|
|
|
|
CDROM_SUB_Q_DATA_FORMAT fmt;
|
|
|
|
SUB_Q_CHANNEL_DATA data;
|
|
|
|
CDROM_TOC toc;
|
|
|
|
DWORD br;
|
1999-12-25 23:54:11 +01:00
|
|
|
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("(%04X, %08X, %p);\n", wDevID, dwFlags, lpParms);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-07-24 12:45:24 +02:00
|
|
|
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
|
|
|
|
if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID;
|
|
|
|
|
|
|
|
if (dwFlags & MCI_NOTIFY) {
|
|
|
|
TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
|
2002-09-06 21:41:17 +02:00
|
|
|
mciDriverNotify(HWND_32(LOWORD(lpParms->dwCallback)),
|
1999-09-05 18:44:38 +02:00
|
|
|
wmcda->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
1999-07-24 12:45:24 +02:00
|
|
|
}
|
|
|
|
if (dwFlags & MCI_STATUS_ITEM) {
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("dwItem = %x\n", lpParms->dwItem);
|
1999-07-24 12:45:24 +02:00
|
|
|
switch (lpParms->dwItem) {
|
|
|
|
case MCI_STATUS_CURRENT_TRACK:
|
2002-01-13 02:46:12 +01:00
|
|
|
fmt.Format = IOCTL_CDROM_CURRENT_POSITION;
|
2002-06-01 01:06:46 +02:00
|
|
|
if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_Q_CHANNEL, &fmt, sizeof(fmt),
|
2002-01-13 02:46:12 +01:00
|
|
|
&data, sizeof(data), &br, NULL))
|
|
|
|
{
|
2000-02-07 17:28:52 +01:00
|
|
|
return MCICDA_GetError(wmcda);
|
1999-07-24 12:45:24 +02:00
|
|
|
}
|
2002-01-13 02:46:12 +01:00
|
|
|
lpParms->dwReturn = data.CurrentPosition.TrackNumber;
|
2009-01-09 17:46:46 +01:00
|
|
|
TRACE("CURRENT_TRACK=%lu\n", lpParms->dwReturn);
|
1999-07-24 12:45:24 +02:00
|
|
|
break;
|
|
|
|
case MCI_STATUS_LENGTH:
|
2002-06-01 01:06:46 +02:00
|
|
|
if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0,
|
2002-01-13 02:46:12 +01:00
|
|
|
&toc, sizeof(toc), &br, NULL)) {
|
|
|
|
WARN("error reading TOC !\n");
|
|
|
|
return MCICDA_GetError(wmcda);
|
1999-07-24 12:45:24 +02:00
|
|
|
}
|
|
|
|
if (dwFlags & MCI_TRACK) {
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("MCI_TRACK #%u LENGTH=??? !\n", lpParms->dwTrack);
|
2002-01-13 02:46:12 +01:00
|
|
|
if (lpParms->dwTrack < toc.FirstTrack || lpParms->dwTrack > toc.LastTrack)
|
1999-02-02 16:25:16 +01:00
|
|
|
return MCIERR_OUTOFRANGE;
|
2002-06-01 01:06:46 +02:00
|
|
|
lpParms->dwReturn = FRAME_OF_TOC(toc, lpParms->dwTrack + 1) -
|
2002-01-13 02:46:12 +01:00
|
|
|
FRAME_OF_TOC(toc, lpParms->dwTrack);
|
2000-09-27 03:18:08 +02:00
|
|
|
/* Windows returns one frame less than the total track length for the
|
|
|
|
last track on the CD. See CDDB HOWTO. Verified on Win95OSR2. */
|
2002-01-13 02:46:12 +01:00
|
|
|
if (lpParms->dwTrack == toc.LastTrack)
|
2000-09-27 03:18:08 +02:00
|
|
|
lpParms->dwReturn--;
|
1999-07-24 12:45:24 +02:00
|
|
|
} else {
|
2000-09-27 03:18:08 +02:00
|
|
|
/* Sum of the lengths of all of the tracks. Inherits the
|
|
|
|
'off by one frame' behavior from the length of the last track.
|
|
|
|
See above comment. */
|
2002-01-13 02:46:12 +01:00
|
|
|
lpParms->dwReturn = FRAME_OF_TOC(toc, toc.LastTrack + 1) -
|
|
|
|
FRAME_OF_TOC(toc, toc.FirstTrack) - 1;
|
1999-07-24 12:45:24 +02:00
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
lpParms->dwReturn = MCICDA_CalcTime(wmcda,
|
|
|
|
(wmcda->dwTimeFormat == MCI_FORMAT_TMSF)
|
1999-12-25 23:54:11 +01:00
|
|
|
? MCI_FORMAT_MSF : wmcda->dwTimeFormat,
|
|
|
|
lpParms->dwReturn,
|
|
|
|
&ret);
|
2009-01-09 17:46:46 +01:00
|
|
|
TRACE("LENGTH=%lu\n", lpParms->dwReturn);
|
1999-07-24 12:45:24 +02:00
|
|
|
break;
|
|
|
|
case MCI_STATUS_MODE:
|
2002-01-13 02:46:12 +01:00
|
|
|
lpParms->dwReturn = MCICDA_GetStatus(wmcda);
|
2009-01-09 17:46:46 +01:00
|
|
|
TRACE("MCI_STATUS_MODE=%08lX\n", lpParms->dwReturn);
|
1999-07-24 12:45:24 +02:00
|
|
|
lpParms->dwReturn = MAKEMCIRESOURCE(lpParms->dwReturn, lpParms->dwReturn);
|
|
|
|
ret = MCI_RESOURCE_RETURNED;
|
|
|
|
break;
|
|
|
|
case MCI_STATUS_MEDIA_PRESENT:
|
2002-01-13 02:46:12 +01:00
|
|
|
lpParms->dwReturn = (MCICDA_GetStatus(wmcda) == MCI_MODE_OPEN) ?
|
1999-07-24 12:45:24 +02:00
|
|
|
MAKEMCIRESOURCE(FALSE, MCI_FALSE) : MAKEMCIRESOURCE(TRUE, MCI_TRUE);
|
1999-09-27 15:38:57 +02:00
|
|
|
TRACE("MCI_STATUS_MEDIA_PRESENT =%c!\n", LOWORD(lpParms->dwReturn) ? 'Y' : 'N');
|
1999-07-24 12:45:24 +02:00
|
|
|
ret = MCI_RESOURCE_RETURNED;
|
|
|
|
break;
|
|
|
|
case MCI_STATUS_NUMBER_OF_TRACKS:
|
2002-06-01 01:06:46 +02:00
|
|
|
if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0,
|
2002-01-13 02:46:12 +01:00
|
|
|
&toc, sizeof(toc), &br, NULL)) {
|
|
|
|
WARN("error reading TOC !\n");
|
|
|
|
return MCICDA_GetError(wmcda);
|
|
|
|
}
|
|
|
|
lpParms->dwReturn = toc.LastTrack - toc.FirstTrack + 1;
|
2009-01-09 17:46:46 +01:00
|
|
|
TRACE("MCI_STATUS_NUMBER_OF_TRACKS = %lu\n", lpParms->dwReturn);
|
2002-06-01 01:06:46 +02:00
|
|
|
if (lpParms->dwReturn == (WORD)-1)
|
2000-02-07 17:28:52 +01:00
|
|
|
return MCICDA_GetError(wmcda);
|
1999-07-24 12:45:24 +02:00
|
|
|
break;
|
|
|
|
case MCI_STATUS_POSITION:
|
|
|
|
if (dwFlags & MCI_STATUS_START) {
|
2002-06-01 01:06:46 +02:00
|
|
|
if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0,
|
2002-01-13 02:46:12 +01:00
|
|
|
&toc, sizeof(toc), &br, NULL)) {
|
|
|
|
WARN("error reading TOC !\n");
|
|
|
|
return MCICDA_GetError(wmcda);
|
|
|
|
}
|
|
|
|
lpParms->dwReturn = FRAME_OF_TOC(toc, toc.FirstTrack);
|
1999-07-24 12:45:24 +02:00
|
|
|
TRACE("get MCI_STATUS_START !\n");
|
2002-01-13 02:46:12 +01:00
|
|
|
} else if (dwFlags & MCI_TRACK) {
|
2002-06-01 01:06:46 +02:00
|
|
|
if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0,
|
2002-01-13 02:46:12 +01:00
|
|
|
&toc, sizeof(toc), &br, NULL)) {
|
|
|
|
WARN("error reading TOC !\n");
|
|
|
|
return MCICDA_GetError(wmcda);
|
|
|
|
}
|
|
|
|
if (lpParms->dwTrack < toc.FirstTrack || lpParms->dwTrack > toc.LastTrack)
|
1999-07-24 12:45:24 +02:00
|
|
|
return MCIERR_OUTOFRANGE;
|
2002-01-13 02:46:12 +01:00
|
|
|
lpParms->dwReturn = FRAME_OF_TOC(toc, lpParms->dwTrack);
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("get MCI_TRACK #%u !\n", lpParms->dwTrack);
|
2002-01-13 02:46:12 +01:00
|
|
|
} else {
|
|
|
|
fmt.Format = IOCTL_CDROM_CURRENT_POSITION;
|
2002-06-01 01:06:46 +02:00
|
|
|
if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_Q_CHANNEL, &fmt, sizeof(fmt),
|
2002-01-13 02:46:12 +01:00
|
|
|
&data, sizeof(data), &br, NULL)) {
|
|
|
|
return MCICDA_GetError(wmcda);
|
|
|
|
}
|
|
|
|
lpParms->dwReturn = FRAME_OF_ADDR(data.CurrentPosition.AbsoluteAddress);
|
|
|
|
}
|
2000-02-07 17:28:52 +01:00
|
|
|
lpParms->dwReturn = MCICDA_CalcTime(wmcda, wmcda->dwTimeFormat, lpParms->dwReturn, &ret);
|
2009-01-09 17:46:46 +01:00
|
|
|
TRACE("MCI_STATUS_POSITION=%08lX\n", lpParms->dwReturn);
|
1999-07-24 12:45:24 +02:00
|
|
|
break;
|
|
|
|
case MCI_STATUS_READY:
|
|
|
|
TRACE("MCI_STATUS_READY !\n");
|
2002-01-13 02:46:12 +01:00
|
|
|
switch (MCICDA_GetStatus(wmcda))
|
|
|
|
{
|
|
|
|
case MCI_MODE_NOT_READY:
|
|
|
|
case MCI_MODE_OPEN:
|
|
|
|
lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
|
|
|
|
break;
|
|
|
|
}
|
1999-07-24 12:45:24 +02:00
|
|
|
TRACE("MCI_STATUS_READY=%u!\n", LOWORD(lpParms->dwReturn));
|
|
|
|
ret = MCI_RESOURCE_RETURNED;
|
|
|
|
break;
|
|
|
|
case MCI_STATUS_TIME_FORMAT:
|
2004-01-08 01:42:02 +01:00
|
|
|
lpParms->dwReturn = MAKEMCIRESOURCE(wmcda->dwTimeFormat, MCI_FORMAT_RETURN_BASE + wmcda->dwTimeFormat);
|
1999-07-24 12:45:24 +02:00
|
|
|
TRACE("MCI_STATUS_TIME_FORMAT=%08x!\n", LOWORD(lpParms->dwReturn));
|
|
|
|
ret = MCI_RESOURCE_RETURNED;
|
|
|
|
break;
|
2000-08-30 01:56:20 +02:00
|
|
|
case 4001: /* FIXME: for bogus FullCD */
|
1999-07-24 12:45:24 +02:00
|
|
|
case MCI_CDA_STATUS_TYPE_TRACK:
|
2002-06-01 01:06:46 +02:00
|
|
|
if (!(dwFlags & MCI_TRACK))
|
1999-07-24 12:45:24 +02:00
|
|
|
ret = MCIERR_MISSING_PARAMETER;
|
2001-01-09 21:51:59 +01:00
|
|
|
else {
|
2002-06-01 01:06:46 +02:00
|
|
|
if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0,
|
2002-01-13 02:46:12 +01:00
|
|
|
&toc, sizeof(toc), &br, NULL)) {
|
|
|
|
WARN("error reading TOC !\n");
|
|
|
|
return MCICDA_GetError(wmcda);
|
|
|
|
}
|
|
|
|
if (lpParms->dwTrack < toc.FirstTrack || lpParms->dwTrack > toc.LastTrack)
|
2001-01-09 21:51:59 +01:00
|
|
|
ret = MCIERR_OUTOFRANGE;
|
|
|
|
else
|
2002-01-13 02:46:12 +01:00
|
|
|
lpParms->dwReturn = (toc.TrackData[lpParms->dwTrack - toc.FirstTrack].Control & 0x04) ?
|
|
|
|
MCI_CDA_TRACK_OTHER : MCI_CDA_TRACK_AUDIO;
|
2001-01-09 21:51:59 +01:00
|
|
|
}
|
2009-01-09 17:46:46 +01:00
|
|
|
TRACE("MCI_CDA_STATUS_TYPE_TRACK[%d]=%ld\n", lpParms->dwTrack, lpParms->dwReturn);
|
1999-07-24 12:45:24 +02:00
|
|
|
break;
|
|
|
|
default:
|
2006-10-09 21:22:38 +02:00
|
|
|
FIXME("unknown command %08X !\n", lpParms->dwItem);
|
1999-07-24 12:45:24 +02:00
|
|
|
return MCIERR_UNRECOGNIZED_COMMAND;
|
1998-10-11 16:14:24 +02:00
|
|
|
}
|
1999-07-24 12:45:24 +02:00
|
|
|
} else {
|
|
|
|
WARN("not MCI_STATUS_ITEM !\n");
|
1998-10-11 16:14:24 +02:00
|
|
|
}
|
1999-07-24 12:45:24 +02:00
|
|
|
return ret;
|
Release 950620
Mon Jun 19 20:29:50 1995 Alexandre Julliard (julliard@sunsite.unc.edu)
* [debugger/*.c]
Modified debugger to use segmented pointers everywhere.
* [if1632/shell.spec] [if1632/sound.spec] [if1632/user.spec]
Declared all functions that return only 16-bit as 'pascal16'.
* [include/ldt.h] [memory/ldt.c]
Export LDT_EntryToBytes (new) and LDT_BytesToEntry for DPMI.
Maintain a copy of the selector flags, removing the need to make a
system call to retrieve an LDT entry.
* [loader/module.c]
Fixed bug with module file handle cache.
* [loader/ne_resource.c]
Fixed file name bug in NE_AccessResource().
* [loader/resource.c]
Fixed bug in LoadIcon() that caused wrong colors to be used for
the icon mask.
* [loader/signal.c]
Moved instruction emulation to miscemu/instr.c.
* [misc/dos_fs.c] [miscemu/int21.c]
Lots of small fixes, thanks to Morten Welinder.
* [miscemu/dpmi.c]
More complete DPMI emulation.
* [miscemu/instr.c]
Added support for prefixes in instructions to emulate.
* [miscemu/int2f.c]
Use register macros instead of destroying the high part of 32-bit
registers.
* [objects/dc.c]
Fixed bug in GetDCState() that failed to clear the new DC.
* [rc/sysres.rc]
Removed dialogs 11 and 12 that were never used.
* [tools/build.c]
'pascal16' generated functions did not save %dx.
Removed use of %fs to access the stack.
%ds is no longer initialized before calling a 16-bit routine.
* [windows/defwnd.c]
Accept a NULL pointer as window title.
* [windows/mdi.c]
MDICascade: skip iconic windows.
Implemented CalcChildScroll().
* [windows/utility.c]
Fixed MulDiv() for illegal values.
* [windows/win.c]
Fixed X error in CreateWindowEx() when WM_NCCALCSIZE returned
a zero width or height.
Sun Jun 18 22:22:30 MET DST 1995 Fons Botman (botman@inter.nl.net)
* [controls/edit.c]
Fixed "uninitalized" message which -Wall couldnt see to be ok
in EDIT_WriteText.
* [include/debug.h]
Added define for extra checks in API definitions during debugging.
* [loader/ne_image.c]
Added newline in NE_FixupPrologs to avoid long lines.
* [misc/dos_fs.c]
Added extra safety check in DOS_ValidDrive.
* [misc/exec.c]
Fixed definition of ExitWindows.
Sun Jun 18 21:16:08 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Some fixes, mostly for memory management, but also for text selection
and tab postitions. General cleanup. Notepad.exe now works.
* [controls/combo.c]
Fix: the hwnd field of the DRAWITEMSTRUCT should always be that of
the combo box, not the ComboLBox that belongs to it.
* [controls/listbox.c]
Handle itemID field correctly throughout.
* [memory/local.c]
Implemented flag LMEM_ZEROINIT.
LocalReAlloc() could trash the heap. Fixed.
* [objects/font.c]
FONT_MatchFont(): don't get confused by negative widths.
Fixed a segfault in EnumFonts().
* [objects/text.c]
DrawText(): DT_CALCRECT implies DT_NOCLIP.
* [objects/dcvalues.c]
MAKELONG was used with bad parameters in DC_GET_X_Y.
* [windows/dialog.c]
Don't show the dialog if WS_VISIBLE isn't set in the template.
* [windows/utility.c]
UTILITY_convertArgs(): Never pass an expression containing ++ into a
macro...
* [windows/win.c]
SetParent() should unlink the window before changing the parent.
* [windows/message.c]
Don't call timer functions via CallWindowProc(), since it checks
whether hwnd==0 and does not call the function in that case.
* [miscemu/instr.c]
Ignore interrupt 0x3D, for VBRUN300.DLL.
* [misc/commdlg.c]
Don't rely on the itemData field of the DRAWITEMSTRUCT to contain a
pointer to the item text.
* [if1632/relay.c]
Disable OLE and DDEML DLLs by default, since they contain nothing but
stubs anyway. SHELL, COMMDLG and WIN87EM are left enabled, although
some programs may work better without them.
* [multimedia/*.c] [include/multimedia.h] [include/driver.h]
Begun cleaning things up a little. Replaced printfs with dprintf_
macros, made functions static where possible, and some other minor
changes.
Sun Jun 11 23:19:10 1995 Martin von Loewis <martin@informatik.hu-berlin.de>
* [debugger/dbg.y][debugger/dbg.l]
Removed special handling for FILE_IDENTIFER, because it caused
problems with x/<format> statements.
* [debugger/info.c]
Use SC_ESP instead of SC_EIP for stack dump.
* [misc/compobj.c][if1632/compobj.spec]
CoBuildVersion, CoInitialize, CoUninitialize: new functions
* [misc/ole2.c][if1632/ole2.spec][misc/Imakefile][include/ole2.h]
New files ole2.c, ole2.h
OleBuildVersion, OleInitialize, OleUninitialize: new functions
* [if1632/ole2disp.spec]
Added missing ordinals above 109
* [misc/ole2nls.c][if1632/ole2nls.spec][include/winnls.h]
New file winnls.h
GetLocaleInfoA: new function
* [if1632/shell.spec]
Added FindEnvironmentString as stub
* [misc/olecli.c][if1632/olecli.spec]
OleIsDcMeta: New function
* [objects/font][misc/gdi.spec]
GetKerningPairs: new function
* [misc/shell.c]
ShellExecute: Implemented support for starting programs
* [if1632/user.spec]
Inserted missing relay to GetClipCursor
Sun Jun 11 20:34:47 1995 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
* [controls/edit.c]
Fix a problem with the local heap.
* [include/wintypes.h]
Fixed wrong declarations of CATCHBUF and LPCATCHBUF.
* [include/mdi.h] [windows/mdi.c]
This code still assumed segmented address==linear address. Fixed.
* [include/msdos.h] [misc/dos_fs.c]
The filemask field of the dosdirent structure could be overrun. Fixed.
If you had a file called foobar and a file called foo, trying to
FindFile(foo) could accidentally find file foobar instead. Fixed.
* [misc/file.c]
OpenFile(): Always return the full pathname in ofs->szPathName. This
also fixes GetModuleFilename().
Prevent _lclose() from closing stderr or stdout.
* [misc/profile.c]
Search for .ini files in the path of the current module as well.
(Needed by Lotus Organizer.)
* [loader/task.c] [loader/ne_image.c] [loader/module.c]
[memory/local.c]
Local heaps are now initialized by InitTask() for executables. DLLs
have to call LocalInit() themselves, LocalInit() has to put the
heap at the end of the segment when called with start==0. We no longer
allocate the DGROUP with 64k on startup, but grow the local heap
in LOCAL_GetBlock() when necessary.
* [loader/module.c]
LoadLibrary() should call LoadModule() in all cases, even if the
DLL is already loaded, to ensure that the reference count is correct.
* [loader/ne_image.c]
Some changes to function prolog fixup. Does anyone know exactly how
this is supposed to work? I am only guessing here.
In NE_InitializeDLLs(), initialize the DLLs a module refers to before
the module itself.
* [loader/task.c]
Initialize instance data at the beginning of the DGROUP in InitTask().
* [memory/local.c]
Some fixes for moveable blocks.
* [memory/selector.c]
All the IsBad*Pointer() functions returned exactly the wrong boolean
value in all cases!
* [objects/bitblt.c]
Fixed another null pointer dereference in debugging output.
* [objects/font.c]
Some more recovery possibilities for FONT_MatchFont() if a specified
font does not exist.
* [windows/win.c]
The dialog code may call CreateWindowEx with an integer in windowName.
This happens for static icon controls that expect a resource ID as
the window name. CreateWindowEx() used to crash. Fixed.
* [windows/class.c] [windows/win.c]
Window classes are owned by modules, not instances. Changed
RegisterClass(), UnregisterClass(), GetClassInfo() and CreateWindowEx()
accordingly.
Sat Jun 10 16:10:53 1995 Olaf Flebbe <o.flebbe@science-computing.uni-tuebingen.de>
* [miscemu/int21.c]
clock.exe was displaying incorrect year.
Fri Jun 9 20:36:56 1995 Victor Schneider <tailor@crl.com>
* [include/cursor.h] [windows/cursor.c]
Implemented CreateCursorIconIndirect().
1995-06-20 21:08:12 +02:00
|
|
|
}
|
|
|
|
|
2003-02-19 23:08:03 +01:00
|
|
|
/**************************************************************************
|
|
|
|
* MCICDA_SkipDataTracks [internal]
|
|
|
|
*/
|
|
|
|
static DWORD MCICDA_SkipDataTracks(WINE_MCICDAUDIO* wmcda,DWORD *frame)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
DWORD br;
|
|
|
|
CDROM_TOC toc;
|
|
|
|
if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0,
|
|
|
|
&toc, sizeof(toc), &br, NULL)) {
|
|
|
|
WARN("error reading TOC !\n");
|
|
|
|
return MCICDA_GetError(wmcda);
|
|
|
|
}
|
|
|
|
/* Locate first track whose starting frame is bigger than frame */
|
|
|
|
for(i=toc.FirstTrack;i<=toc.LastTrack+1;i++)
|
|
|
|
if ( FRAME_OF_TOC(toc, i) > *frame ) break;
|
|
|
|
if (i <= toc.FirstTrack && i>toc.LastTrack+1) {
|
|
|
|
i = 0; /* requested address is out of range: go back to start */
|
|
|
|
*frame = FRAME_OF_TOC(toc,toc.FirstTrack);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
i--;
|
|
|
|
/* i points to last track whose start address is not greater than frame.
|
|
|
|
* Now skip non-audio tracks */
|
|
|
|
for(;i<=toc.LastTrack+1;i++)
|
|
|
|
if ( ! (toc.TrackData[i-toc.FirstTrack].Control & 4) )
|
|
|
|
break;
|
|
|
|
/* The frame will be an address in the next audio track or
|
|
|
|
* address of lead-out. */
|
|
|
|
if ( FRAME_OF_TOC(toc, i) > *frame )
|
|
|
|
*frame = FRAME_OF_TOC(toc, i);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1994-07-07 18:23:58 +02:00
|
|
|
/**************************************************************************
|
2000-02-07 17:28:52 +01:00
|
|
|
* MCICDA_Play [internal]
|
1998-10-11 16:14:24 +02:00
|
|
|
*/
|
2000-02-07 17:28:52 +01:00
|
|
|
static DWORD MCICDA_Play(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
|
1994-07-07 18:23:58 +02:00
|
|
|
{
|
2002-01-13 02:46:12 +01:00
|
|
|
WINE_MCICDAUDIO* wmcda = MCICDA_GetOpenDrv(wDevID);
|
|
|
|
DWORD ret = 0, start, end;
|
|
|
|
DWORD br;
|
|
|
|
CDROM_PLAY_AUDIO_MSF play;
|
|
|
|
CDROM_SUB_Q_DATA_FORMAT fmt;
|
|
|
|
SUB_Q_CHANNEL_DATA data;
|
2003-02-19 23:08:03 +01:00
|
|
|
CDROM_TOC toc;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("(%04X, %08X, %p);\n", wDevID, dwFlags, lpParms);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-10-23 02:40:23 +02:00
|
|
|
if (lpParms == NULL)
|
|
|
|
return MCIERR_NULL_PARAMETER_BLOCK;
|
|
|
|
|
|
|
|
if (wmcda == NULL)
|
|
|
|
return MCIERR_INVALID_DEVICE_ID;
|
|
|
|
|
2009-02-26 17:46:49 +01:00
|
|
|
if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0,
|
|
|
|
&toc, sizeof(toc), &br, NULL)) {
|
|
|
|
WARN("error reading TOC !\n");
|
|
|
|
return MCICDA_GetError(wmcda);
|
|
|
|
}
|
|
|
|
|
2000-10-23 02:40:23 +02:00
|
|
|
if (dwFlags & MCI_FROM) {
|
|
|
|
start = MCICDA_CalcFrame(wmcda, lpParms->dwFrom);
|
2003-02-19 23:08:03 +01:00
|
|
|
if ( (ret=MCICDA_SkipDataTracks(wmcda, &start)) )
|
|
|
|
return ret;
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("MCI_FROM=%08X -> %u\n", lpParms->dwFrom, start);
|
2000-10-23 02:40:23 +02:00
|
|
|
} else {
|
2002-01-13 02:46:12 +01:00
|
|
|
fmt.Format = IOCTL_CDROM_CURRENT_POSITION;
|
2002-06-01 01:06:46 +02:00
|
|
|
if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_Q_CHANNEL, &fmt, sizeof(fmt),
|
2002-01-13 02:46:12 +01:00
|
|
|
&data, sizeof(data), &br, NULL)) {
|
|
|
|
return MCICDA_GetError(wmcda);
|
|
|
|
}
|
|
|
|
start = FRAME_OF_ADDR(data.CurrentPosition.AbsoluteAddress);
|
2003-02-19 23:08:03 +01:00
|
|
|
if ( (ret=MCICDA_SkipDataTracks(wmcda, &start)) )
|
|
|
|
return ret;
|
2000-10-23 02:40:23 +02:00
|
|
|
}
|
|
|
|
if (dwFlags & MCI_TO) {
|
|
|
|
end = MCICDA_CalcFrame(wmcda, lpParms->dwTo);
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("MCI_TO=%08X -> %u\n", lpParms->dwTo, end);
|
2002-01-13 02:46:12 +01:00
|
|
|
} else {
|
|
|
|
end = FRAME_OF_TOC(toc, toc.LastTrack + 1) - 1;
|
2000-10-23 02:40:23 +02:00
|
|
|
}
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("Playing from %u to %u\n", start, end);
|
2009-02-26 17:46:49 +01:00
|
|
|
|
|
|
|
if (wmcda->hThread != 0) {
|
|
|
|
SetEvent(wmcda->stopEvent);
|
|
|
|
WaitForSingleObject(wmcda->hThread, INFINITE);
|
|
|
|
|
|
|
|
CloseHandle(wmcda->hThread);
|
|
|
|
wmcda->hThread = 0;
|
|
|
|
CloseHandle(wmcda->stopEvent);
|
|
|
|
wmcda->stopEvent = 0;
|
|
|
|
|
|
|
|
IDirectSoundBuffer_Stop(wmcda->dsBuf);
|
|
|
|
IDirectSoundBuffer_Release(wmcda->dsBuf);
|
|
|
|
wmcda->dsBuf = NULL;
|
|
|
|
IDirectSound_Release(wmcda->dsObj);
|
|
|
|
wmcda->dsObj = NULL;
|
|
|
|
}
|
2009-02-26 17:49:42 +01:00
|
|
|
else if(wmcda->hCallback) {
|
|
|
|
mciDriverNotify(wmcda->hCallback, wmcda->wNotifyDeviceID,
|
|
|
|
MCI_NOTIFY_ABORTED);
|
|
|
|
wmcda->hCallback = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((dwFlags&MCI_NOTIFY))
|
|
|
|
wmcda->hCallback = HWND_32(LOWORD(lpParms->dwCallback));
|
2009-02-26 17:46:49 +01:00
|
|
|
|
|
|
|
if (pDirectSoundCreate) {
|
|
|
|
WAVEFORMATEX format;
|
|
|
|
DSBUFFERDESC desc;
|
|
|
|
DWORD lockLen;
|
|
|
|
void *cdData;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
hr = pDirectSoundCreate(NULL, &wmcda->dsObj, NULL);
|
|
|
|
if (SUCCEEDED(hr)) {
|
|
|
|
IDirectSound_SetCooperativeLevel(wmcda->dsObj, GetDesktopWindow(), DSSCL_PRIORITY);
|
|
|
|
|
|
|
|
/* The "raw" frame is relative to the start of the first track */
|
|
|
|
wmcda->start = start - FRAME_OF_TOC(toc, toc.FirstTrack);
|
|
|
|
wmcda->end = end - FRAME_OF_TOC(toc, toc.FirstTrack);
|
|
|
|
|
|
|
|
memset(&format, 0, sizeof(format));
|
|
|
|
format.wFormatTag = WAVE_FORMAT_PCM;
|
|
|
|
format.nChannels = 2;
|
|
|
|
format.nSamplesPerSec = 44100;
|
|
|
|
format.wBitsPerSample = 16;
|
|
|
|
format.nBlockAlign = format.nChannels * format.wBitsPerSample / 8;
|
|
|
|
format.nAvgBytesPerSec = format.nSamplesPerSec * format.nBlockAlign;
|
|
|
|
format.cbSize = 0;
|
|
|
|
|
|
|
|
memset(&desc, 0, sizeof(desc));
|
|
|
|
desc.dwSize = sizeof(desc);
|
|
|
|
desc.dwFlags = DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_GLOBALFOCUS;
|
|
|
|
desc.dwBufferBytes = (CDDA_FRAG_SIZE - (CDDA_FRAG_SIZE%RAW_SECTOR_SIZE)) * CDDA_FRAG_COUNT;
|
|
|
|
desc.lpwfxFormat = &format;
|
|
|
|
|
|
|
|
hr = IDirectSound_CreateSoundBuffer(wmcda->dsObj, &desc, &wmcda->dsBuf, NULL);
|
|
|
|
}
|
|
|
|
if (SUCCEEDED(hr)) {
|
|
|
|
hr = IDirectSoundBuffer_Lock(wmcda->dsBuf, 0, 0, &cdData, &lockLen,
|
|
|
|
NULL, NULL, DSBLOCK_ENTIREBUFFER);
|
|
|
|
}
|
|
|
|
if (SUCCEEDED(hr)) {
|
|
|
|
RAW_READ_INFO rdInfo;
|
|
|
|
int readok;
|
|
|
|
|
|
|
|
rdInfo.DiskOffset.QuadPart = wmcda->start<<11;
|
|
|
|
rdInfo.SectorCount = min(desc.dwBufferBytes/RAW_SECTOR_SIZE,
|
|
|
|
wmcda->end-wmcda->start);
|
|
|
|
rdInfo.TrackMode = CDDA;
|
|
|
|
|
|
|
|
readok = DeviceIoControl(wmcda->handle, IOCTL_CDROM_RAW_READ,
|
|
|
|
&rdInfo, sizeof(rdInfo), cdData, lockLen,
|
|
|
|
&br, NULL);
|
|
|
|
IDirectSoundBuffer_Unlock(wmcda->dsBuf, cdData, lockLen, NULL, 0);
|
|
|
|
|
|
|
|
if (readok) {
|
|
|
|
wmcda->start += rdInfo.SectorCount;
|
|
|
|
wmcda->stopEvent = CreateEventA(NULL, TRUE, FALSE, NULL);
|
|
|
|
}
|
|
|
|
if (wmcda->stopEvent != 0)
|
|
|
|
wmcda->hThread = CreateThread(NULL, 0, MCICDA_playLoop, wmcda, 0, &br);
|
|
|
|
if (wmcda->hThread != 0) {
|
|
|
|
hr = IDirectSoundBuffer_Play(wmcda->dsBuf, 0, 0, DSBPLAY_LOOPING);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
SetEvent(wmcda->stopEvent);
|
|
|
|
WaitForSingleObject(wmcda->hThread, INFINITE);
|
|
|
|
CloseHandle(wmcda->hThread);
|
|
|
|
wmcda->hThread = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (wmcda->stopEvent != 0) {
|
|
|
|
CloseHandle(wmcda->stopEvent);
|
|
|
|
wmcda->stopEvent = 0;
|
|
|
|
}
|
|
|
|
if (wmcda->dsBuf) {
|
|
|
|
IDirectSoundBuffer_Release(wmcda->dsBuf);
|
|
|
|
wmcda->dsBuf = NULL;
|
|
|
|
}
|
|
|
|
if (wmcda->dsObj) {
|
|
|
|
IDirectSound_Release(wmcda->dsObj);
|
|
|
|
wmcda->dsObj = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-01-13 02:46:12 +01:00
|
|
|
play.StartingM = start / CDFRAMES_PERMIN;
|
|
|
|
play.StartingS = (start / CDFRAMES_PERSEC) % 60;
|
|
|
|
play.StartingF = start % CDFRAMES_PERSEC;
|
|
|
|
play.EndingM = end / CDFRAMES_PERMIN;
|
|
|
|
play.EndingS = (end / CDFRAMES_PERSEC) % 60;
|
|
|
|
play.EndingF = end % CDFRAMES_PERSEC;
|
2002-06-01 01:06:46 +02:00
|
|
|
if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_PLAY_AUDIO_MSF, &play, sizeof(play),
|
2002-01-13 02:46:12 +01:00
|
|
|
NULL, 0, &br, NULL)) {
|
2009-02-26 17:49:42 +01:00
|
|
|
wmcda->hCallback = NULL;
|
2002-01-13 02:46:12 +01:00
|
|
|
ret = MCIERR_HARDWARE;
|
|
|
|
} else if (dwFlags & MCI_NOTIFY) {
|
2000-10-23 02:40:23 +02:00
|
|
|
TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
|
|
|
|
/*
|
2002-09-06 21:41:17 +02:00
|
|
|
mciDriverNotify(HWND_32(LOWORD(lpParms->dwCallback)),
|
2000-10-23 02:40:23 +02:00
|
|
|
wmcda->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
|
|
|
*/
|
1998-11-24 15:12:13 +01:00
|
|
|
}
|
|
|
|
return ret;
|
1994-07-07 18:23:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
2000-02-07 17:28:52 +01:00
|
|
|
* MCICDA_Stop [internal]
|
1998-10-11 16:14:24 +02:00
|
|
|
*/
|
2000-02-07 17:28:52 +01:00
|
|
|
static DWORD MCICDA_Stop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
1994-07-07 18:23:58 +02:00
|
|
|
{
|
2000-02-07 17:28:52 +01:00
|
|
|
WINE_MCICDAUDIO* wmcda = MCICDA_GetOpenDrv(wDevID);
|
2002-01-13 02:46:12 +01:00
|
|
|
DWORD br;
|
|
|
|
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("(%04X, %08X, %p);\n", wDevID, dwFlags, lpParms);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-02-02 16:25:16 +01:00
|
|
|
if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2009-02-26 17:46:49 +01:00
|
|
|
if (wmcda->hThread != 0) {
|
|
|
|
SetEvent(wmcda->stopEvent);
|
|
|
|
WaitForSingleObject(wmcda->hThread, INFINITE);
|
|
|
|
|
|
|
|
CloseHandle(wmcda->hThread);
|
|
|
|
wmcda->hThread = 0;
|
|
|
|
CloseHandle(wmcda->stopEvent);
|
|
|
|
wmcda->stopEvent = 0;
|
|
|
|
|
|
|
|
IDirectSoundBuffer_Release(wmcda->dsBuf);
|
|
|
|
wmcda->dsBuf = NULL;
|
|
|
|
IDirectSound_Release(wmcda->dsObj);
|
|
|
|
wmcda->dsObj = NULL;
|
|
|
|
}
|
|
|
|
else if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_STOP_AUDIO, NULL, 0, NULL, 0, &br, NULL))
|
|
|
|
return MCIERR_HARDWARE;
|
1999-07-15 16:43:13 +02:00
|
|
|
|
2009-02-26 17:49:42 +01:00
|
|
|
if (wmcda->hCallback) {
|
|
|
|
mciDriverNotify(wmcda->hCallback, wmcda->wNotifyDeviceID, MCI_NOTIFY_ABORTED);
|
|
|
|
wmcda->hCallback = NULL;
|
|
|
|
}
|
|
|
|
|
1998-11-24 15:12:13 +01:00
|
|
|
if (lpParms && (dwFlags & MCI_NOTIFY)) {
|
1999-07-04 18:02:24 +02:00
|
|
|
TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
|
2002-09-06 21:41:17 +02:00
|
|
|
mciDriverNotify(HWND_32(LOWORD(lpParms->dwCallback)),
|
1999-09-05 18:44:38 +02:00
|
|
|
wmcda->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
1998-10-11 16:14:24 +02:00
|
|
|
}
|
|
|
|
return 0;
|
1994-07-07 18:23:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
2000-02-07 17:28:52 +01:00
|
|
|
* MCICDA_Pause [internal]
|
1998-10-11 16:14:24 +02:00
|
|
|
*/
|
2000-02-07 17:28:52 +01:00
|
|
|
static DWORD MCICDA_Pause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
1994-07-07 18:23:58 +02:00
|
|
|
{
|
2000-02-07 17:28:52 +01:00
|
|
|
WINE_MCICDAUDIO* wmcda = MCICDA_GetOpenDrv(wDevID);
|
2002-01-13 02:46:12 +01:00
|
|
|
DWORD br;
|
|
|
|
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("(%04X, %08X, %p);\n", wDevID, dwFlags, lpParms);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-02-02 16:25:16 +01:00
|
|
|
if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2009-02-26 17:46:49 +01:00
|
|
|
if (wmcda->hThread != 0) {
|
|
|
|
/* Don't bother calling stop if the playLoop thread has already stopped */
|
|
|
|
if(WaitForSingleObject(wmcda->stopEvent, 0) != WAIT_OBJECT_0 &&
|
|
|
|
FAILED(IDirectSoundBuffer_Stop(wmcda->dsBuf)))
|
|
|
|
return MCIERR_HARDWARE;
|
|
|
|
}
|
|
|
|
else if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_PAUSE_AUDIO, NULL, 0, NULL, 0, &br, NULL))
|
|
|
|
return MCIERR_HARDWARE;
|
2002-01-13 02:46:12 +01:00
|
|
|
|
2009-02-26 17:49:42 +01:00
|
|
|
EnterCriticalSection(&wmcda->cs);
|
|
|
|
if (wmcda->hCallback) {
|
|
|
|
mciDriverNotify(wmcda->hCallback, wmcda->wNotifyDeviceID, MCI_NOTIFY_SUPERSEDED);
|
|
|
|
wmcda->hCallback = NULL;
|
|
|
|
}
|
|
|
|
LeaveCriticalSection(&wmcda->cs);
|
|
|
|
|
1998-11-24 15:12:13 +01:00
|
|
|
if (lpParms && (dwFlags & MCI_NOTIFY)) {
|
1999-07-04 18:02:24 +02:00
|
|
|
TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
|
2002-09-06 21:41:17 +02:00
|
|
|
mciDriverNotify(HWND_32(LOWORD(lpParms->dwCallback)),
|
1999-09-05 18:44:38 +02:00
|
|
|
wmcda->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
1998-10-11 16:14:24 +02:00
|
|
|
}
|
|
|
|
return 0;
|
1994-07-07 18:23:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
2000-02-07 17:28:52 +01:00
|
|
|
* MCICDA_Resume [internal]
|
1998-10-11 16:14:24 +02:00
|
|
|
*/
|
2000-02-07 17:28:52 +01:00
|
|
|
static DWORD MCICDA_Resume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
|
1994-07-07 18:23:58 +02:00
|
|
|
{
|
2000-02-07 17:28:52 +01:00
|
|
|
WINE_MCICDAUDIO* wmcda = MCICDA_GetOpenDrv(wDevID);
|
2002-01-13 02:46:12 +01:00
|
|
|
DWORD br;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("(%04X, %08X, %p);\n", wDevID, dwFlags, lpParms);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-02-02 16:25:16 +01:00
|
|
|
if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2009-02-26 17:46:49 +01:00
|
|
|
if (wmcda->hThread != 0) {
|
|
|
|
/* Don't restart if the playLoop thread has already stopped */
|
|
|
|
if(WaitForSingleObject(wmcda->stopEvent, 0) != WAIT_OBJECT_0 &&
|
|
|
|
FAILED(IDirectSoundBuffer_Play(wmcda->dsBuf, 0, 0, DSBPLAY_LOOPING)))
|
|
|
|
return MCIERR_HARDWARE;
|
|
|
|
}
|
|
|
|
else if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_RESUME_AUDIO, NULL, 0, NULL, 0, &br, NULL))
|
|
|
|
return MCIERR_HARDWARE;
|
2002-01-13 02:46:12 +01:00
|
|
|
|
1998-11-24 15:12:13 +01:00
|
|
|
if (lpParms && (dwFlags & MCI_NOTIFY)) {
|
1999-07-04 18:02:24 +02:00
|
|
|
TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
|
2002-09-06 21:41:17 +02:00
|
|
|
mciDriverNotify(HWND_32(LOWORD(lpParms->dwCallback)),
|
1999-09-22 18:41:32 +02:00
|
|
|
wmcda->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
1998-10-11 16:14:24 +02:00
|
|
|
}
|
|
|
|
return 0;
|
1994-07-07 18:23:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
2000-02-07 17:28:52 +01:00
|
|
|
* MCICDA_Seek [internal]
|
1998-10-11 16:14:24 +02:00
|
|
|
*/
|
2000-02-07 17:28:52 +01:00
|
|
|
static DWORD MCICDA_Seek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms)
|
1994-07-07 18:23:58 +02:00
|
|
|
{
|
2002-01-13 02:46:12 +01:00
|
|
|
DWORD at;
|
|
|
|
WINE_MCICDAUDIO* wmcda = MCICDA_GetOpenDrv(wDevID);
|
|
|
|
CDROM_SEEK_AUDIO_MSF seek;
|
2003-02-19 23:08:03 +01:00
|
|
|
DWORD br, ret;
|
|
|
|
CDROM_TOC toc;
|
2002-01-13 02:46:12 +01:00
|
|
|
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("(%04X, %08X, %p);\n", wDevID, dwFlags, lpParms);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-02-02 16:25:16 +01:00
|
|
|
if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID;
|
1998-11-24 15:12:13 +01:00
|
|
|
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2003-02-19 23:08:03 +01:00
|
|
|
if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0,
|
|
|
|
&toc, sizeof(toc), &br, NULL)) {
|
|
|
|
WARN("error reading TOC !\n");
|
|
|
|
return MCICDA_GetError(wmcda);
|
|
|
|
}
|
1998-12-18 16:05:25 +01:00
|
|
|
switch (dwFlags & ~(MCI_NOTIFY|MCI_WAIT)) {
|
1998-10-11 16:14:24 +02:00
|
|
|
case MCI_SEEK_TO_START:
|
1999-07-04 18:02:24 +02:00
|
|
|
TRACE("Seeking to start\n");
|
2003-02-19 23:08:03 +01:00
|
|
|
at = FRAME_OF_TOC(toc,toc.FirstTrack);
|
|
|
|
if ( (ret=MCICDA_SkipDataTracks(wmcda, &at)) )
|
|
|
|
return ret;
|
1998-10-11 16:14:24 +02:00
|
|
|
break;
|
|
|
|
case MCI_SEEK_TO_END:
|
1999-07-04 18:02:24 +02:00
|
|
|
TRACE("Seeking to end\n");
|
2002-01-13 02:46:12 +01:00
|
|
|
at = FRAME_OF_TOC(toc, toc.LastTrack + 1) - 1;
|
2003-02-19 23:08:03 +01:00
|
|
|
if ( (ret=MCICDA_SkipDataTracks(wmcda, &at)) )
|
|
|
|
return ret;
|
1998-10-11 16:14:24 +02:00
|
|
|
break;
|
|
|
|
case MCI_TO:
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("Seeking to %u\n", lpParms->dwTo);
|
2003-02-19 23:08:03 +01:00
|
|
|
at = MCICDA_CalcFrame(wmcda, lpParms->dwTo);
|
|
|
|
if ( (ret=MCICDA_SkipDataTracks(wmcda, &at)) )
|
|
|
|
return ret;
|
1998-10-11 16:14:24 +02:00
|
|
|
break;
|
1998-12-18 16:05:25 +01:00
|
|
|
default:
|
2001-03-21 21:31:26 +01:00
|
|
|
TRACE("Unknown seek action %08lX\n",
|
|
|
|
(dwFlags & ~(MCI_NOTIFY|MCI_WAIT)));
|
1998-12-18 16:05:25 +01:00
|
|
|
return MCIERR_UNSUPPORTED_FUNCTION;
|
1998-10-11 16:14:24 +02:00
|
|
|
}
|
2009-02-26 17:46:49 +01:00
|
|
|
|
|
|
|
if (wmcda->hThread != 0) {
|
|
|
|
EnterCriticalSection(&wmcda->cs);
|
|
|
|
wmcda->start = at - FRAME_OF_TOC(toc, toc.FirstTrack);
|
|
|
|
/* Flush remaining data, or just let it play into the new data? */
|
|
|
|
LeaveCriticalSection(&wmcda->cs);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
seek.M = at / CDFRAMES_PERMIN;
|
|
|
|
seek.S = (at / CDFRAMES_PERSEC) % 60;
|
|
|
|
seek.F = at % CDFRAMES_PERSEC;
|
|
|
|
if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_SEEK_AUDIO_MSF, &seek, sizeof(seek),
|
|
|
|
NULL, 0, &br, NULL))
|
|
|
|
return MCIERR_HARDWARE;
|
|
|
|
}
|
2002-01-13 02:46:12 +01:00
|
|
|
|
1998-10-11 16:14:24 +02:00
|
|
|
if (dwFlags & MCI_NOTIFY) {
|
1999-07-04 18:02:24 +02:00
|
|
|
TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
|
2002-09-06 21:41:17 +02:00
|
|
|
mciDriverNotify(HWND_32(LOWORD(lpParms->dwCallback)),
|
1999-02-02 16:25:16 +01:00
|
|
|
wmcda->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
1998-10-11 16:14:24 +02:00
|
|
|
}
|
1999-03-15 16:15:29 +01:00
|
|
|
return 0;
|
1994-07-07 18:23:58 +02:00
|
|
|
}
|
|
|
|
|
1998-11-24 15:12:13 +01:00
|
|
|
/**************************************************************************
|
2000-02-07 17:28:52 +01:00
|
|
|
* MCICDA_SetDoor [internal]
|
1998-11-24 15:12:13 +01:00
|
|
|
*/
|
2002-01-13 02:46:12 +01:00
|
|
|
static DWORD MCICDA_SetDoor(UINT wDevID, BOOL open)
|
1998-11-24 15:12:13 +01:00
|
|
|
{
|
2000-02-07 17:28:52 +01:00
|
|
|
WINE_MCICDAUDIO* wmcda = MCICDA_GetOpenDrv(wDevID);
|
2002-01-13 02:46:12 +01:00
|
|
|
DWORD br;
|
|
|
|
|
1999-07-04 18:02:24 +02:00
|
|
|
TRACE("(%04x, %s) !\n", wDevID, (open) ? "OPEN" : "CLOSE");
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-02-02 16:25:16 +01:00
|
|
|
if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
|
|
|
if (!DeviceIoControl(wmcda->handle,
|
2002-01-13 02:46:12 +01:00
|
|
|
(open) ? IOCTL_STORAGE_EJECT_MEDIA : IOCTL_STORAGE_LOAD_MEDIA,
|
|
|
|
NULL, 0, NULL, 0, &br, NULL))
|
1999-02-02 16:25:16 +01:00
|
|
|
return MCIERR_HARDWARE;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1998-11-24 15:12:13 +01:00
|
|
|
return 0;
|
|
|
|
}
|
1994-07-07 18:23:58 +02:00
|
|
|
|
|
|
|
/**************************************************************************
|
2000-02-07 17:28:52 +01:00
|
|
|
* MCICDA_Set [internal]
|
1998-10-11 16:14:24 +02:00
|
|
|
*/
|
2000-02-07 17:28:52 +01:00
|
|
|
static DWORD MCICDA_Set(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
|
1994-07-07 18:23:58 +02:00
|
|
|
{
|
2000-02-07 17:28:52 +01:00
|
|
|
WINE_MCICDAUDIO* wmcda = MCICDA_GetOpenDrv(wDevID);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2006-10-09 21:22:38 +02:00
|
|
|
TRACE("(%04X, %08X, %p);\n", wDevID, dwFlags, lpParms);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-02-02 16:25:16 +01:00
|
|
|
if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID;
|
2000-10-12 22:40:56 +02:00
|
|
|
|
|
|
|
if (dwFlags & MCI_SET_DOOR_OPEN) {
|
|
|
|
MCICDA_SetDoor(wDevID, TRUE);
|
|
|
|
}
|
|
|
|
if (dwFlags & MCI_SET_DOOR_CLOSED) {
|
|
|
|
MCICDA_SetDoor(wDevID, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* only functions which require valid lpParms below this line ! */
|
2000-08-30 01:56:20 +02:00
|
|
|
if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
|
1998-10-11 16:14:24 +02:00
|
|
|
/*
|
1999-07-15 16:43:13 +02:00
|
|
|
TRACE("dwTimeFormat=%08lX\n", lpParms->dwTimeFormat);
|
|
|
|
TRACE("dwAudio=%08lX\n", lpParms->dwAudio);
|
1998-10-11 16:14:24 +02:00
|
|
|
*/
|
|
|
|
if (dwFlags & MCI_SET_TIME_FORMAT) {
|
|
|
|
switch (lpParms->dwTimeFormat) {
|
|
|
|
case MCI_FORMAT_MILLISECONDS:
|
1999-07-04 18:02:24 +02:00
|
|
|
TRACE("MCI_FORMAT_MILLISECONDS !\n");
|
1998-10-11 16:14:24 +02:00
|
|
|
break;
|
|
|
|
case MCI_FORMAT_MSF:
|
1999-07-04 18:02:24 +02:00
|
|
|
TRACE("MCI_FORMAT_MSF !\n");
|
1998-10-11 16:14:24 +02:00
|
|
|
break;
|
|
|
|
case MCI_FORMAT_TMSF:
|
1999-07-04 18:02:24 +02:00
|
|
|
TRACE("MCI_FORMAT_TMSF !\n");
|
1998-10-11 16:14:24 +02:00
|
|
|
break;
|
|
|
|
default:
|
1999-07-04 18:02:24 +02:00
|
|
|
WARN("bad time format !\n");
|
1998-10-11 16:14:24 +02:00
|
|
|
return MCIERR_BAD_TIME_FORMAT;
|
|
|
|
}
|
1999-02-02 16:25:16 +01:00
|
|
|
wmcda->dwTimeFormat = lpParms->dwTimeFormat;
|
1998-10-11 16:14:24 +02:00
|
|
|
}
|
|
|
|
if (dwFlags & MCI_SET_VIDEO) return MCIERR_UNSUPPORTED_FUNCTION;
|
|
|
|
if (dwFlags & MCI_SET_ON) return MCIERR_UNSUPPORTED_FUNCTION;
|
|
|
|
if (dwFlags & MCI_SET_OFF) return MCIERR_UNSUPPORTED_FUNCTION;
|
|
|
|
if (dwFlags & MCI_NOTIFY) {
|
2002-06-01 01:06:46 +02:00
|
|
|
TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n",
|
1998-10-11 16:14:24 +02:00
|
|
|
lpParms->dwCallback);
|
2002-09-06 21:41:17 +02:00
|
|
|
mciDriverNotify(HWND_32(LOWORD(lpParms->dwCallback)),
|
1999-09-22 18:41:32 +02:00
|
|
|
wmcda->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
|
1998-10-11 16:14:24 +02:00
|
|
|
}
|
|
|
|
return 0;
|
1994-07-07 18:23:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
2001-07-11 20:56:41 +02:00
|
|
|
* DriverProc (MCICDA.@)
|
1998-10-11 16:14:24 +02:00
|
|
|
*/
|
2005-11-28 20:53:22 +01:00
|
|
|
LRESULT CALLBACK MCICDA_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
|
|
|
|
LPARAM dwParam1, LPARAM dwParam2)
|
1998-10-11 16:14:24 +02:00
|
|
|
{
|
|
|
|
switch(wMsg) {
|
|
|
|
case DRV_LOAD: return 1;
|
|
|
|
case DRV_FREE: return 1;
|
2005-02-09 23:26:25 +01:00
|
|
|
case DRV_OPEN: return MCICDA_drvOpen((LPCWSTR)dwParam1, (LPMCI_OPEN_DRIVER_PARMSW)dwParam2);
|
2000-02-07 17:28:52 +01:00
|
|
|
case DRV_CLOSE: return MCICDA_drvClose(dwDevID);
|
2002-06-01 01:06:46 +02:00
|
|
|
case DRV_ENABLE: return 1;
|
1998-10-11 16:14:24 +02:00
|
|
|
case DRV_DISABLE: return 1;
|
|
|
|
case DRV_QUERYCONFIGURE: return 1;
|
2000-02-07 17:28:52 +01:00
|
|
|
case DRV_CONFIGURE: MessageBoxA(0, "MCI audio CD driver !", "Wine Driver", MB_OK); return 1;
|
1998-10-11 16:14:24 +02:00
|
|
|
case DRV_INSTALL: return DRVCNF_RESTART;
|
|
|
|
case DRV_REMOVE: return DRVCNF_RESTART;
|
2002-05-12 01:02:55 +02:00
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2002-05-12 01:02:55 +02:00
|
|
|
if (dwDevID == 0xFFFFFFFF) return MCIERR_UNSUPPORTED_FUNCTION;
|
|
|
|
|
|
|
|
switch (wMsg) {
|
2005-02-09 23:26:25 +01:00
|
|
|
case MCI_OPEN_DRIVER: return MCICDA_Open(dwDevID, dwParam1, (LPMCI_OPEN_PARMSW)dwParam2);
|
2000-02-07 17:28:52 +01:00
|
|
|
case MCI_CLOSE_DRIVER: return MCICDA_Close(dwDevID, dwParam1, (LPMCI_GENERIC_PARMS)dwParam2);
|
|
|
|
case MCI_GETDEVCAPS: return MCICDA_GetDevCaps(dwDevID, dwParam1, (LPMCI_GETDEVCAPS_PARMS)dwParam2);
|
2005-02-09 23:26:25 +01:00
|
|
|
case MCI_INFO: return MCICDA_Info(dwDevID, dwParam1, (LPMCI_INFO_PARMSW)dwParam2);
|
2000-02-07 17:28:52 +01:00
|
|
|
case MCI_STATUS: return MCICDA_Status(dwDevID, dwParam1, (LPMCI_STATUS_PARMS)dwParam2);
|
|
|
|
case MCI_SET: return MCICDA_Set(dwDevID, dwParam1, (LPMCI_SET_PARMS)dwParam2);
|
|
|
|
case MCI_PLAY: return MCICDA_Play(dwDevID, dwParam1, (LPMCI_PLAY_PARMS)dwParam2);
|
|
|
|
case MCI_STOP: return MCICDA_Stop(dwDevID, dwParam1, (LPMCI_GENERIC_PARMS)dwParam2);
|
|
|
|
case MCI_PAUSE: return MCICDA_Pause(dwDevID, dwParam1, (LPMCI_GENERIC_PARMS)dwParam2);
|
|
|
|
case MCI_RESUME: return MCICDA_Resume(dwDevID, dwParam1, (LPMCI_GENERIC_PARMS)dwParam2);
|
|
|
|
case MCI_SEEK: return MCICDA_Seek(dwDevID, dwParam1, (LPMCI_SEEK_PARMS)dwParam2);
|
2004-08-20 21:27:15 +02:00
|
|
|
/* commands that should report an error as they are not supported in
|
|
|
|
* the native version */
|
|
|
|
case MCI_SET_DOOR_CLOSED:
|
|
|
|
case MCI_SET_DOOR_OPEN:
|
2002-06-01 01:06:46 +02:00
|
|
|
case MCI_LOAD:
|
|
|
|
case MCI_SAVE:
|
|
|
|
case MCI_FREEZE:
|
|
|
|
case MCI_PUT:
|
|
|
|
case MCI_REALIZE:
|
|
|
|
case MCI_UNFREEZE:
|
|
|
|
case MCI_UPDATE:
|
|
|
|
case MCI_WHERE:
|
|
|
|
case MCI_STEP:
|
|
|
|
case MCI_SPIN:
|
|
|
|
case MCI_ESCAPE:
|
|
|
|
case MCI_COPY:
|
|
|
|
case MCI_CUT:
|
|
|
|
case MCI_DELETE:
|
|
|
|
case MCI_PASTE:
|
|
|
|
case MCI_WINDOW:
|
2005-11-28 20:53:22 +01:00
|
|
|
TRACE("Unsupported command [0x%x]\n", wMsg);
|
1998-11-24 15:12:13 +01:00
|
|
|
break;
|
|
|
|
case MCI_OPEN:
|
|
|
|
case MCI_CLOSE:
|
1999-07-24 12:45:24 +02:00
|
|
|
ERR("Shouldn't receive a MCI_OPEN or CLOSE message\n");
|
1998-11-24 15:12:13 +01:00
|
|
|
break;
|
1998-10-11 16:14:24 +02:00
|
|
|
default:
|
2005-11-28 20:53:22 +01:00
|
|
|
TRACE("Sending msg [0x%x] to default driver proc\n", wMsg);
|
1999-02-26 12:11:13 +01:00
|
|
|
return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
|
1998-10-11 16:14:24 +02:00
|
|
|
}
|
1998-11-24 15:12:13 +01:00
|
|
|
return MCIERR_UNRECOGNIZED_COMMAND;
|
1994-07-07 18:23:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*-----------------------------------------------------------------------*/
|