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
5e1b3b2f
Commit
5e1b3b2f
authored
Mar 01, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat: Fail to create user queues on uninitialized platform.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
48b713ef
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
1 deletion
+61
-1
main.c
dlls/mfplat/main.c
+5
-0
mfplat_private.h
dlls/mfplat/mfplat_private.h
+1
-0
queue.c
dlls/mfplat/queue.c
+3
-0
mfplat.c
dlls/mfplat/tests/mfplat.c
+52
-1
No files found.
dlls/mfplat/main.c
View file @
5e1b3b2f
...
@@ -521,6 +521,11 @@ HRESULT WINAPI MFUnlockPlatform(void)
...
@@ -521,6 +521,11 @@ HRESULT WINAPI MFUnlockPlatform(void)
return
S_OK
;
return
S_OK
;
}
}
BOOL
is_platform_locked
(
void
)
{
return
platform_lock
>
0
;
}
/***********************************************************************
/***********************************************************************
* MFCopyImage (mfplat.@)
* MFCopyImage (mfplat.@)
*/
*/
...
...
dlls/mfplat/mfplat_private.h
View file @
5e1b3b2f
...
@@ -18,3 +18,4 @@
...
@@ -18,3 +18,4 @@
extern
void
init_system_queues
(
void
)
DECLSPEC_HIDDEN
;
extern
void
init_system_queues
(
void
)
DECLSPEC_HIDDEN
;
extern
void
shutdown_system_queues
(
void
)
DECLSPEC_HIDDEN
;
extern
void
shutdown_system_queues
(
void
)
DECLSPEC_HIDDEN
;
extern
BOOL
is_platform_locked
(
void
)
DECLSPEC_HIDDEN
;
dlls/mfplat/queue.c
View file @
5e1b3b2f
...
@@ -543,6 +543,9 @@ static HRESULT alloc_user_queue(MFASYNC_WORKQUEUE_TYPE queue_type, DWORD *queue_
...
@@ -543,6 +543,9 @@ static HRESULT alloc_user_queue(MFASYNC_WORKQUEUE_TYPE queue_type, DWORD *queue_
*
queue_id
=
MFASYNC_CALLBACK_QUEUE_UNDEFINED
;
*
queue_id
=
MFASYNC_CALLBACK_QUEUE_UNDEFINED
;
if
(
!
is_platform_locked
())
return
MF_E_SHUTDOWN
;
queue
=
heap_alloc_zero
(
sizeof
(
*
queue
));
queue
=
heap_alloc_zero
(
sizeof
(
*
queue
));
if
(
!
queue
)
if
(
!
queue
)
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
...
...
dlls/mfplat/tests/mfplat.c
View file @
5e1b3b2f
...
@@ -837,6 +837,7 @@ static void test_MFCreateAsyncResult(void)
...
@@ -837,6 +837,7 @@ static void test_MFCreateAsyncResult(void)
static
void
test_startup
(
void
)
static
void
test_startup
(
void
)
{
{
DWORD
queue
;
HRESULT
hr
;
HRESULT
hr
;
hr
=
MFStartup
(
MAKELONG
(
MF_API_VERSION
,
0xdead
),
MFSTARTUP_FULL
);
hr
=
MFStartup
(
MAKELONG
(
MF_API_VERSION
,
0xdead
),
MFSTARTUP_FULL
);
...
@@ -845,8 +846,58 @@ static void test_startup(void)
...
@@ -845,8 +846,58 @@ static void test_startup(void)
hr
=
MFStartup
(
MF_VERSION
,
MFSTARTUP_FULL
);
hr
=
MFStartup
(
MF_VERSION
,
MFSTARTUP_FULL
);
ok
(
hr
==
S_OK
,
"Failed to start up, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to start up, hr %#x.
\n
"
,
hr
);
hr
=
MFAllocateWorkQueue
(
&
queue
);
ok
(
hr
==
S_OK
,
"Failed to allocate a queue, hr %#x.
\n
"
,
hr
);
hr
=
MFUnlockWorkQueue
(
queue
);
ok
(
hr
==
S_OK
,
"Failed to unlock the queue, hr %#x.
\n
"
,
hr
);
hr
=
MFShutdown
();
hr
=
MFShutdown
();
ok
(
hr
==
S_OK
,
"Failed to shutdown, hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to shut down, hr %#x.
\n
"
,
hr
);
hr
=
MFAllocateWorkQueue
(
&
queue
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
/* Already shut down, has no effect. */
hr
=
MFShutdown
();
ok
(
hr
==
S_OK
,
"Failed to shut down, hr %#x.
\n
"
,
hr
);
hr
=
MFStartup
(
MF_VERSION
,
MFSTARTUP_FULL
);
ok
(
hr
==
S_OK
,
"Failed to start up, hr %#x.
\n
"
,
hr
);
hr
=
MFAllocateWorkQueue
(
&
queue
);
ok
(
hr
==
S_OK
,
"Failed to allocate a queue, hr %#x.
\n
"
,
hr
);
hr
=
MFUnlockWorkQueue
(
queue
);
ok
(
hr
==
S_OK
,
"Failed to unlock the queue, hr %#x.
\n
"
,
hr
);
hr
=
MFShutdown
();
ok
(
hr
==
S_OK
,
"Failed to shut down, hr %#x.
\n
"
,
hr
);
/* Platform lock. */
hr
=
MFStartup
(
MF_VERSION
,
MFSTARTUP_FULL
);
ok
(
hr
==
S_OK
,
"Failed to start up, hr %#x.
\n
"
,
hr
);
hr
=
MFAllocateWorkQueue
(
&
queue
);
ok
(
hr
==
S_OK
,
"Failed to allocate a queue, hr %#x.
\n
"
,
hr
);
hr
=
MFUnlockWorkQueue
(
queue
);
ok
(
hr
==
S_OK
,
"Failed to unlock the queue, hr %#x.
\n
"
,
hr
);
/* Unlocking implies shutdown. */
hr
=
MFUnlockPlatform
();
ok
(
hr
==
S_OK
,
"Failed to unlock, %#x.
\n
"
,
hr
);
hr
=
MFAllocateWorkQueue
(
&
queue
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
MFLockPlatform
();
ok
(
hr
==
S_OK
,
"Failed to lock, %#x.
\n
"
,
hr
);
hr
=
MFAllocateWorkQueue
(
&
queue
);
ok
(
hr
==
S_OK
,
"Failed to allocate a queue, hr %#x.
\n
"
,
hr
);
hr
=
MFUnlockWorkQueue
(
queue
);
ok
(
hr
==
S_OK
,
"Failed to unlock the queue, hr %#x.
\n
"
,
hr
);
hr
=
MFShutdown
();
ok
(
hr
==
S_OK
,
"Failed to shut down, hr %#x.
\n
"
,
hr
);
}
}
static
void
test_allocate_queue
(
void
)
static
void
test_allocate_queue
(
void
)
...
...
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