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
12812772
Commit
12812772
authored
Mar 22, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat: Set default attributes for file-based bytestream object.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e3c76d77
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
11 deletions
+18
-11
main.c
dlls/mfplat/main.c
+16
-4
mfplat.c
dlls/mfplat/tests/mfplat.c
+2
-7
No files found.
dlls/mfplat/main.c
View file @
12812772
...
...
@@ -2632,6 +2632,7 @@ HRESULT WINAPI MFCreateFile(MF_FILE_ACCESSMODE accessmode, MF_FILE_OPENMODE open
DWORD
filesharemode
=
FILE_SHARE_READ
;
DWORD
filecreation_disposition
=
0
;
DWORD
fileattributes
=
0
;
FILETIME
writetime
;
HANDLE
file
;
HRESULT
hr
;
...
...
@@ -2680,15 +2681,16 @@ HRESULT WINAPI MFCreateFile(MF_FILE_ACCESSMODE accessmode, MF_FILE_OPENMODE open
if
(
file
==
INVALID_HANDLE_VALUE
)
return
HRESULT_FROM_WIN32
(
GetLastError
());
/* Close the file again, since we don't do anything with it yet */
CloseHandle
(
file
);
object
=
heap_alloc_zero
(
sizeof
(
*
object
));
if
(
!
object
)
{
CloseHandle
(
file
);
return
E_OUTOFMEMORY
;
}
if
(
FAILED
(
hr
=
init_attributes_object
(
&
object
->
attributes
,
0
)))
if
(
FAILED
(
hr
=
init_attributes_object
(
&
object
->
attributes
,
2
)))
{
CloseHandle
(
file
);
heap_free
(
object
);
return
hr
;
}
...
...
@@ -2699,8 +2701,18 @@ HRESULT WINAPI MFCreateFile(MF_FILE_ACCESSMODE accessmode, MF_FILE_OPENMODE open
InitializeCriticalSection
(
&
object
->
cs
);
list_init
(
&
object
->
pending
);
if
(
GetFileTime
(
file
,
NULL
,
NULL
,
&
writetime
))
{
IMFAttributes_SetBlob
(
&
object
->
attributes
.
IMFAttributes_iface
,
&
MF_BYTESTREAM_LAST_MODIFIED_TIME
,
(
const
UINT8
*
)
&
writetime
,
sizeof
(
writetime
));
}
IMFAttributes_SetString
(
&
object
->
attributes
.
IMFAttributes_iface
,
&
MF_BYTESTREAM_ORIGIN_NAME
,
url
);
*
bytestream
=
&
object
->
IMFByteStream_iface
;
CloseHandle
(
file
);
return
S_OK
;
}
...
...
dlls/mfplat/tests/mfplat.c
View file @
12812772
...
...
@@ -1169,24 +1169,19 @@ todo_wine
hr
=
IMFAttributes_GetCount
(
attributes
,
&
count
);
ok
(
hr
==
S_OK
,
"Failed to get attributes count, hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
count
==
2
,
"Unexpected attributes count %u.
\n
"
,
count
);
/* Original file name. */
hr
=
IMFAttributes_GetAllocatedString
(
attributes
,
&
MF_BYTESTREAM_ORIGIN_NAME
,
&
str
,
&
count
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to get attribute, hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
ok
(
!
lstrcmpW
(
str
,
filename
),
"Unexpected name %s.
\n
"
,
wine_dbgstr_w
(
str
));
CoTaskMemFree
(
str
);
}
/* Modification time. */
hr
=
IMFAttributes_GetItemType
(
attributes
,
&
MF_BYTESTREAM_LAST_MODIFIED_TIME
,
&
item_type
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Failed to get item type, hr %#x.
\n
"
,
hr
);
ok
(
item_type
==
MF_ATTRIBUTE_BLOB
,
"Unexpected item type.
\n
"
);
}
IMFAttributes_Release
(
attributes
);
hr
=
MFCreateFile
(
MF_ACCESSMODE_READ
,
MF_OPENMODE_FAIL_IF_NOT_EXIST
,
...
...
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