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
e931f0e8
Commit
e931f0e8
authored
Feb 26, 2016
by
Sebastian Lackner
Committed by
Alexandre Julliard
Feb 26, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedevice: Get rid of global driver_hkey variable and fix some leaks.
Signed-off-by:
Sebastian Lackner
<
sebastian@fds-team.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4bed3d23
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
device.c
programs/winedevice/device.c
+14
-4
No files found.
programs/winedevice/device.c
View file @
e931f0e8
...
...
@@ -42,7 +42,6 @@ extern NTSTATUS CDECL wine_ntoskrnl_main_loop( HANDLE stop_event );
static
WCHAR
*
driver_name
;
static
SERVICE_STATUS_HANDLE
service_handle
;
static
HKEY
driver_hkey
;
static
HANDLE
stop_event
;
static
DRIVER_OBJECT
driver_obj
;
static
DRIVER_EXTENSION
driver_extension
;
...
...
@@ -203,6 +202,7 @@ static HMODULE load_driver(void)
'\\'
,
'S'
,
'e'
,
'r'
,
'v'
,
'i'
,
'c'
,
'e'
,
's'
,
'\\'
,
0
};
UNICODE_STRING
keypath
;
HKEY
driver_hkey
;
HMODULE
module
;
LPWSTR
path
=
NULL
,
str
;
DWORD
type
,
size
;
...
...
@@ -215,7 +215,7 @@ static HMODULE load_driver(void)
{
WINE_ERR
(
"cannot open key %s, err=%u
\n
"
,
wine_dbgstr_w
(
str
),
GetLastError
()
);
HeapFree
(
GetProcessHeap
(),
0
,
str
);
return
FALSE
;
return
NULL
;
}
RtlInitUnicodeString
(
&
keypath
,
str
);
...
...
@@ -231,7 +231,12 @@ static HMODULE load_driver(void)
ExpandEnvironmentStringsW
(
str
,
path
,
size
);
}
HeapFree
(
GetProcessHeap
(),
0
,
str
);
if
(
!
path
)
return
FALSE
;
if
(
!
path
)
{
RtlFreeUnicodeString
(
&
keypath
);
RegCloseKey
(
driver_hkey
);
return
NULL
;
}
if
(
!
strncmpiW
(
path
,
systemrootW
,
12
))
{
...
...
@@ -265,12 +270,17 @@ static HMODULE load_driver(void)
lstrcatW
(
path
,
postfixW
);
str
=
path
;
}
RegCloseKey
(
driver_hkey
);
WINE_TRACE
(
"loading driver %s
\n
"
,
wine_dbgstr_w
(
str
)
);
module
=
load_driver_module
(
str
);
HeapFree
(
GetProcessHeap
(),
0
,
path
);
if
(
!
module
)
return
NULL
;
if
(
!
module
)
{
RtlFreeUnicodeString
(
&
keypath
);
return
NULL
;
}
init_driver
(
module
,
&
keypath
);
return
module
;
...
...
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