[PATCH 1/3] winmm: Fix mciSendString command parsing on 64-bit.

Joerg-Cyril.Hoehle at t-systems.com Joerg-Cyril.Hoehle at t-systems.com
Fri Sep 3 08:33:33 CDT 2010


Octavian Voicu wrote:
>> b) Sysinfo cdaudio quantity open
The latest patches I've now submitted show how to modify parameters in
the parser. The key is to do it after the parsing.

> I'll focus on getting basic 64 bit support working first,
>while also looking at the big picture when possible.

Besides the points I previously mentioned there are 3 major ones.

1.The bummer:
    err = mciSendString("capability x can   save", buf, sizeof(buf), hwnd);
    todo_wine ok(!err,"capability can (space) save: %s\n", dbg_mcierr(err));
This test alone convinced me that the native parser is not based
on a strcmp() of the strings found in the resource file.
Something else is going on.

2. The chicken and egg problem:
open foo.mpg alias w buffer 5 type waveaudio
The "buffer" parameter proves that the command is parsed using the
waveaudio command table, not the core one.  How does the parser know
that "waveaudio" must be used? It does not depend on foo.mpg's file

Obviously the command line must be preparsed somehow to find the
"type" keyword.  But you can only parse correctly when you know the
right table...

Wine currently uses strstr(). It's easily fooled by input like
open foo.mpg alias "foo type sequencer bar.zot"
Native winmm is not fooled.

I already fixed some bugs in Wine's special-casing of the open
command.  Yet I know there's at least one more bug therein.

3. Incorrect parsing of "optional" ("\0") parameters:
I already mentioned "sound notify". MCI_SAVE is another example.
open new type waveaudio alias r
save r notify
mci.c:1376: command: save r notify
mci.c:1379: Test failed: mci save r notify error: 298(42 MCIERR_UNNAMED_RESOURCE)
save r notify grr.wav
mci.c:1376: command: save r notify grr.wav
mci.c:1355: Notification type 0001
The filename is not "notify".
info r file
mci.c:1376: command: info r file
mci.c:1381: Response: X:\...\grr.wav

The unnamed ("\0") "optional" parameter can appear out of order, like the named ones.

Understanding these points will undoubtfully lead to the big picture.

 Jörg Höhle.

More information about the wine-devel mailing list