Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
57268241
Commit
57268241
authored
Mar 24, 2018
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Mar 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedevice: Wait until driver has started before returning.
Signed-off-by:
Alistair Leslie-Hughes
<
leslie_alistair@hotmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
041f5935
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
device.c
programs/winedevice/device.c
+10
-0
No files found.
programs/winedevice/device.c
View file @
57268241
...
...
@@ -55,6 +55,7 @@ struct wine_driver
struct
wine_rb_entry
entry
;
SERVICE_STATUS_HANDLE
handle
;
HANDLE
started
;
DRIVER_OBJECT
*
driver_obj
;
WCHAR
name
[
1
];
};
...
...
@@ -390,6 +391,8 @@ static void WINAPI async_create_driver( PTP_CALLBACK_INSTANCE instance, void *co
goto
error
;
}
SetEvent
(
driver
->
started
);
EnterCriticalSection
(
&
drivers_cs
);
driver
->
driver_obj
=
driver_obj
;
set_service_status
(
driver
->
handle
,
SERVICE_RUNNING
,
...
...
@@ -441,10 +444,16 @@ static NTSTATUS create_driver( const WCHAR *driver_name )
environment
.
Version
=
1
;
environment
.
CleanupGroup
=
cleanup_group
;
driver
->
started
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
/* don't block the service control handler */
if
(
!
TrySubmitThreadpoolCallback
(
async_create_driver
,
driver
,
&
environment
))
async_create_driver
(
NULL
,
driver
);
/* Windows wait 30 Seconds */
if
(
WaitForSingleObject
(
driver
->
started
,
30000
)
==
WAIT_TIMEOUT
)
return
ERROR_SERVICE_REQUEST_TIMEOUT
;
return
STATUS_SUCCESS
;
}
...
...
@@ -453,6 +462,7 @@ static void wine_drivers_rb_destroy( struct wine_rb_entry *entry, void *context
if
(
unload_driver
(
entry
,
TRUE
)
!=
STATUS_SUCCESS
)
{
struct
wine_driver
*
driver
=
WINE_RB_ENTRY_VALUE
(
entry
,
struct
wine_driver
,
entry
);
CloseHandle
(
driver
->
started
);
ObDereferenceObject
(
driver
->
driver_obj
);
CloseServiceHandle
(
(
void
*
)
driver
->
handle
);
HeapFree
(
GetProcessHeap
(),
0
,
driver
);
...
...
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