From: Michael Stefaniuc mstefani@winehq.org
Not documented in the official headers but multiple pre-DX8 games have the DMUS_IO_STYLEPART without the dwFlags.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58493 --- dlls/dmstyle/style.c | 9 ++++++++- include/dmusicf.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/dlls/dmstyle/style.c b/dlls/dmstyle/style.c index c64e7e3d525..baf2cb22e7c 100644 --- a/dlls/dmstyle/style.c +++ b/dlls/dmstyle/style.c @@ -482,7 +482,14 @@ static HRESULT parse_part_list(struct style *This, IStream *stream, struct chunk switch (MAKE_IDTYPE(chunk.id, chunk.type)) { case DMUS_FOURCC_PART_CHUNK: - hr = stream_chunk_get_data(stream, &chunk, &part->header, sizeof(part->header)); + if (chunk.size != sizeof(part->header) && + chunk.size != ((offsetof(DMUS_IO_STYLEPART, bPad) + 1 ) & ~1)) /* DX7 */ + { + WARN("Invalid size of %s\n", debugstr_chunk(&chunk)); + hr = E_FAIL; + break; + } + hr = stream_chunk_get_data(stream, &chunk, &part->header, chunk.size); break;
case MAKE_IDTYPE(FOURCC_LIST, DMUS_FOURCC_UNFO_LIST): diff --git a/include/dmusicf.h b/include/dmusicf.h index da8363c4b04..24b8c585bfe 100644 --- a/include/dmusicf.h +++ b/include/dmusicf.h @@ -516,6 +516,7 @@ struct _DMUS_IO_STYLEPART { BYTE bPlayModeFlags; BYTE bInvertUpper; BYTE bInvertLower; + /* DX8 */ BYTE bPad[3]; DWORD dwFlags; };