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
bc7b194b
Commit
bc7b194b
authored
Sep 17, 2008
by
Peter Dons Tychsen
Committed by
Alexandre Julliard
Sep 17, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedevice: Fix problems with driver entries without the "ImagePath" entry in registry.
parent
741dd708
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
9 deletions
+25
-9
device.c
programs/winedevice/device.c
+25
-9
No files found.
programs/winedevice/device.c
View file @
bc7b194b
...
...
@@ -147,6 +147,8 @@ static NTSTATUS init_driver( HMODULE module, UNICODE_STRING *keyname )
/* load the .sys module for a device driver */
static
BOOL
load_driver
(
void
)
{
static
const
WCHAR
driversW
[]
=
{
'\\'
,
'd'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
's'
,
'\\'
,
0
};
static
const
WCHAR
postfixW
[]
=
{
'.'
,
's'
,
'y'
,
's'
,
0
};
static
const
WCHAR
ntprefixW
[]
=
{
'\\'
,
'?'
,
'?'
,
'\\'
,
0
};
static
const
WCHAR
ImagePathW
[]
=
{
'I'
,
'm'
,
'a'
,
'g'
,
'e'
,
'P'
,
'a'
,
't'
,
'h'
,
0
};
static
const
WCHAR
servicesW
[]
=
{
'\\'
,
'R'
,
'e'
,
'g'
,
'i'
,
's'
,
't'
,
'r'
,
'y'
,
...
...
@@ -174,17 +176,31 @@ static BOOL load_driver(void)
/* read the executable path from memory */
size
=
0
;
if
(
RegQueryValueExW
(
driver_hkey
,
ImagePathW
,
NULL
,
&
type
,
NULL
,
&
size
))
return
FALSE
;
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
!
RegQueryValueExW
(
driver_hkey
,
ImagePathW
,
NULL
,
&
type
,
(
LPBYTE
)
str
,
&
size
))
if
(
!
RegQueryValueExW
(
driver_hkey
,
ImagePathW
,
NULL
,
&
type
,
NULL
,
&
size
))
{
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
!
RegQueryValueExW
(
driver_hkey
,
ImagePathW
,
NULL
,
&
type
,
(
LPBYTE
)
str
,
&
size
))
{
size
=
ExpandEnvironmentStringsW
(
str
,
NULL
,
0
);
path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
*
sizeof
(
WCHAR
));
ExpandEnvironmentStringsW
(
str
,
path
,
size
);
}
HeapFree
(
GetProcessHeap
(),
0
,
str
);
if
(
!
path
)
return
FALSE
;
}
else
{
size
=
ExpandEnvironmentStringsW
(
str
,
NULL
,
0
);
path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
*
sizeof
(
WCHAR
));
ExpandEnvironmentStringsW
(
str
,
path
,
size
);
/* default is to use the driver name + ".sys" */
WCHAR
buffer
[
MAX_PATH
];
GetSystemDirectoryW
(
buffer
,
MAX_PATH
);
path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
strlenW
(
buffer
)
+
strlenW
(
driversW
)
+
strlenW
(
driver_name
)
+
strlenW
(
postfixW
)
+
1
)
*
sizeof
(
WCHAR
));
lstrcpyW
(
path
,
buffer
);
lstrcatW
(
path
,
driversW
);
lstrcatW
(
path
,
driver_name
);
lstrcatW
(
path
,
postfixW
);
}
HeapFree
(
GetProcessHeap
(),
0
,
str
);
if
(
!
path
)
return
FALSE
;
/* GameGuard uses an NT-style path name */
str
=
path
;
...
...
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