Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e2779a4c
Commit
e2779a4c
authored
Sep 02, 2014
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Sep 01, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm: Don't call the custom MMIOM_SEEK handler while opening.
parent
d5345e64
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
mmio.c
dlls/winmm/mmio.c
+14
-4
mmio.c
dlls/winmm/tests/mmio.c
+2
-2
No files found.
dlls/winmm/mmio.c
View file @
e2779a4c
...
@@ -667,7 +667,7 @@ static HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, DWORD dwOpenFlags,
...
@@ -667,7 +667,7 @@ static HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, DWORD dwOpenFlags,
(
LPARAM
)
szFileName
,
0
,
FALSE
);
(
LPARAM
)
szFileName
,
0
,
FALSE
);
/* update offsets and grab file size, when possible */
/* update offsets and grab file size, when possible */
if
(
wm
->
info
.
fccIOProc
!=
FOURCC_MEM
&&
(
send_message
(
wm
->
ioProc
,
&
wm
->
info
,
MMIOM_SEEK
,
0
,
SEEK_CUR
,
FALSE
))
!=
-
1
)
{
if
(
wm
->
info
.
fccIOProc
==
FOURCC_DOS
&&
(
send_message
(
wm
->
ioProc
,
&
wm
->
info
,
MMIOM_SEEK
,
0
,
SEEK_CUR
,
FALSE
))
!=
-
1
)
{
pos
=
wm
->
info
.
lBufOffset
=
wm
->
info
.
lDiskOffset
;
pos
=
wm
->
info
.
lBufOffset
=
wm
->
info
.
lDiskOffset
;
send_message
(
wm
->
ioProc
,
&
wm
->
info
,
MMIOM_SEEK
,
0
,
SEEK_END
,
FALSE
);
send_message
(
wm
->
ioProc
,
&
wm
->
info
,
MMIOM_SEEK
,
0
,
SEEK_END
,
FALSE
);
wm
->
dwFileSize
=
wm
->
info
.
lDiskOffset
;
wm
->
dwFileSize
=
wm
->
info
.
lDiskOffset
;
...
@@ -885,7 +885,17 @@ LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, INT iOrigin)
...
@@ -885,7 +885,17 @@ LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, INT iOrigin)
offset
=
wm
->
info
.
lBufOffset
+
(
wm
->
info
.
pchNext
-
wm
->
info
.
pchBuffer
)
+
lOffset
;
offset
=
wm
->
info
.
lBufOffset
+
(
wm
->
info
.
pchNext
-
wm
->
info
.
pchBuffer
)
+
lOffset
;
break
;
break
;
case
SEEK_END
:
case
SEEK_END
:
offset
=
((
wm
->
info
.
fccIOProc
==
FOURCC_MEM
)
?
wm
->
info
.
cchBuffer
:
wm
->
dwFileSize
)
-
lOffset
;
switch
(
wm
->
info
.
fccIOProc
)
{
case
FOURCC_MEM
:
offset
=
wm
->
info
.
cchBuffer
-
lOffset
;
break
;
case
FOURCC_DOS
:
offset
=
wm
->
dwFileSize
-
lOffset
;
break
;
default:
offset
=
send_message
(
wm
->
ioProc
,
&
wm
->
info
,
MMIOM_SEEK
,
lOffset
,
SEEK_END
,
FALSE
);
break
;
}
break
;
break
;
default:
default:
return
-
1
;
return
-
1
;
...
@@ -896,7 +906,7 @@ LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, INT iOrigin)
...
@@ -896,7 +906,7 @@ LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, INT iOrigin)
if
((
wm
->
info
.
cchBuffer
>
0
)
&&
if
((
wm
->
info
.
cchBuffer
>
0
)
&&
((
offset
<
wm
->
info
.
lBufOffset
)
||
((
offset
<
wm
->
info
.
lBufOffset
)
||
(
offset
>
wm
->
info
.
lBufOffset
+
wm
->
info
.
cchBuffer
)
||
(
offset
>
wm
->
info
.
lBufOffset
+
wm
->
info
.
cchBuffer
)
||
(
offset
>
wm
->
dwFileSize
&&
wm
->
info
.
fccIOProc
!=
FOURCC_MEM
)
||
(
offset
>
wm
->
dwFileSize
&&
wm
->
info
.
fccIOProc
==
FOURCC_DOS
)
||
!
wm
->
bBufferLoaded
))
{
!
wm
->
bBufferLoaded
))
{
/* condition to change buffer */
/* condition to change buffer */
...
@@ -1023,7 +1033,7 @@ MMRESULT WINAPI mmioAdvance(HMMIO hmmio, MMIOINFO* lpmmioinfo, UINT uFlags)
...
@@ -1023,7 +1033,7 @@ MMRESULT WINAPI mmioAdvance(HMMIO hmmio, MMIOINFO* lpmmioinfo, UINT uFlags)
if
(
MMIO_Flush
(
wm
,
0
)
!=
MMSYSERR_NOERROR
)
if
(
MMIO_Flush
(
wm
,
0
)
!=
MMSYSERR_NOERROR
)
return
MMIOERR_CANNOTWRITE
;
return
MMIOERR_CANNOTWRITE
;
if
(
lpmmioinfo
)
{
if
(
lpmmioinfo
&&
lpmmioinfo
->
fccIOProc
==
FOURCC_DOS
)
{
wm
->
dwFileSize
=
max
(
wm
->
dwFileSize
,
lpmmioinfo
->
lBufOffset
+
wm
->
dwFileSize
=
max
(
wm
->
dwFileSize
,
lpmmioinfo
->
lBufOffset
+
(
lpmmioinfo
->
pchNext
-
lpmmioinfo
->
pchBuffer
));
(
lpmmioinfo
->
pchNext
-
lpmmioinfo
->
pchBuffer
));
}
}
...
...
dlls/winmm/tests/mmio.c
View file @
e2779a4c
...
@@ -636,9 +636,9 @@ static void test_mmioOpen_fourcc(void)
...
@@ -636,9 +636,9 @@ static void test_mmioOpen_fourcc(void)
mmioGetInfo
(
hmmio
,
&
mmio
,
0
);
mmioGetInfo
(
hmmio
,
&
mmio
,
0
);
ok
(
hmmio
&&
mmio
.
fccIOProc
==
FOURCC_XYZ
,
"mmioOpenA error %u, got %4.4s
\n
"
,
ok
(
hmmio
&&
mmio
.
fccIOProc
==
FOURCC_XYZ
,
"mmioOpenA error %u, got %4.4s
\n
"
,
mmio
.
wErrorRet
,
(
LPCSTR
)
&
mmio
.
fccIOProc
);
mmio
.
wErrorRet
,
(
LPCSTR
)
&
mmio
.
fccIOProc
);
todo_wine
ok
(
mmio
.
adwInfo
[
1
]
==
0
,
"mmioOpenA sent MMIOM_SEEK, got %d
\n
"
,
ok
(
mmio
.
adwInfo
[
1
]
==
0
,
"mmioOpenA sent MMIOM_SEEK, got %d
\n
"
,
mmio
.
adwInfo
[
1
]);
mmio
.
adwInfo
[
1
]);
todo_wine
ok
(
mmio
.
lDiskOffset
==
0
,
"mmioOpenA updated lDiskOffset, got %d
\n
"
,
ok
(
mmio
.
lDiskOffset
==
0
,
"mmioOpenA updated lDiskOffset, got %d
\n
"
,
mmio
.
lDiskOffset
);
mmio
.
lDiskOffset
);
mmioClose
(
hmmio
,
0
);
mmioClose
(
hmmio
,
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment