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
7a222508
Commit
7a222508
authored
Apr 04, 2013
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Apr 04, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm: Inherit the seek position when using standard file handle.
parent
80f6197f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
mmio.c
dlls/winmm/mmio.c
+2
-2
mmio.c
dlls/winmm/tests/mmio.c
+20
-0
No files found.
dlls/winmm/mmio.c
View file @
7a222508
...
...
@@ -670,9 +670,9 @@ static HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, DWORD dwOpenFlags,
refmminfo
->
wErrorRet
=
send_message
(
wm
->
ioProc
,
&
wm
->
info
,
MMIOM_OPEN
,
(
LPARAM
)
szFileName
,
0
,
FALSE
);
/* 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
)
{
pos
=
wm
->
info
.
lDiskOffset
;
pos
=
wm
->
info
.
l
BufOffset
=
wm
->
info
.
l
DiskOffset
;
send_message
(
wm
->
ioProc
,
&
wm
->
info
,
MMIOM_SEEK
,
0
,
SEEK_END
,
FALSE
);
wm
->
dwFileSize
=
wm
->
info
.
lDiskOffset
;
send_message
(
wm
->
ioProc
,
&
wm
->
info
,
MMIOM_SEEK
,
pos
,
SEEK_SET
,
FALSE
);
...
...
dlls/winmm/tests/mmio.c
View file @
7a222508
...
...
@@ -704,6 +704,8 @@ static void test_mmioSeek(void)
const
LONG
size
=
sizeof
(
RIFF_buf
),
offset
=
16
;
char
test_file
[
MAX_PATH
];
MMRESULT
res
;
HFILE
hfile
;
OFSTRUCT
ofs
;
/* test memory file */
memset
(
&
mmio
,
0
,
sizeof
(
mmio
));
...
...
@@ -784,6 +786,24 @@ static void test_mmioSeek(void)
mmioClose
(
hmmio
,
0
);
}
/* test seek position inheritance from standard file handle */
hfile
=
OpenFile
(
test_file
,
&
ofs
,
OF_READ
);
ok
(
hfile
!=
HFILE_ERROR
,
"Failed to open the file, err %d
\n
"
,
GetLastError
());
if
(
hfile
!=
HFILE_ERROR
)
{
pos
=
_llseek
(
hfile
,
offset
,
SEEK_SET
);
ok
(
pos
!=
HFILE_ERROR
,
"Failed to seek, err %d
\n
"
,
GetLastError
());
memset
(
&
mmio
,
0
,
sizeof
(
mmio
));
mmio
.
fccIOProc
=
FOURCC_DOS
;
mmio
.
adwInfo
[
0
]
=
(
DWORD
)
hfile
;
hmmio
=
mmioOpen
(
NULL
,
&
mmio
,
MMIO_READ
|
MMIO_DENYWRITE
|
MMIO_ALLOCBUF
);
ok
(
hmmio
!=
NULL
,
"mmioOpen error %u
\n
"
,
mmio
.
wErrorRet
);
if
(
hmmio
!=
NULL
)
{
pos
=
mmioSeek
(
hmmio
,
0
,
SEEK_CUR
);
ok
(
pos
==
offset
,
"expected %d, got %d
\n
"
,
offset
,
pos
);
mmioClose
(
hmmio
,
0
);
}
}
DeleteFileA
(
test_file
);
}
...
...
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