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
aa4775ef
Commit
aa4775ef
authored
Apr 22, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
localspl: Avoid creating zero-length string values in the registry.
parent
06bf8ea2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
10 deletions
+26
-10
localspl_main.c
dlls/localspl/localspl_main.c
+26
-10
No files found.
dlls/localspl/localspl_main.c
View file @
aa4775ef
...
...
@@ -399,6 +399,7 @@ static BOOL WINAPI fpGetPrinterDriverDirectory(LPWSTR pName, LPWSTR pEnvironment
*/
static
BOOL
WINAPI
myAddPrinterDriverEx
(
DWORD
level
,
LPBYTE
pDriverInfo
,
DWORD
dwFileCopyFlags
,
BOOL
lazy
)
{
static
const
WCHAR
emptyW
[
1
];
const
printenv_t
*
env
;
apd_data_t
apd
;
DRIVER_INFO_8W
di
;
...
...
@@ -493,14 +494,20 @@ static BOOL WINAPI myAddPrinterDriverEx(DWORD level, LPBYTE pDriverInfo, DWORD d
apd_copyfile
(
di
.
pConfigFile
,
&
apd
);
/* settings for level 3 */
RegSetValueExW
(
hdrv
,
help_fileW
,
0
,
REG_SZ
,
(
LPBYTE
)
di
.
pHelpFile
,
di
.
pHelpFile
?
(
lstrlenW
(
di
.
pHelpFile
)
+
1
)
*
sizeof
(
WCHAR
)
:
0
);
if
(
di
.
pHelpFile
)
RegSetValueExW
(
hdrv
,
help_fileW
,
0
,
REG_SZ
,
(
LPBYTE
)
di
.
pHelpFile
,
(
lstrlenW
(
di
.
pHelpFile
)
+
1
)
*
sizeof
(
WCHAR
));
else
RegSetValueExW
(
hdrv
,
help_fileW
,
0
,
REG_SZ
,
(
LPBYTE
)
emptyW
,
sizeof
(
emptyW
));
apd_copyfile
(
di
.
pHelpFile
,
&
apd
);
ptr
=
di
.
pDependentFiles
;
RegSetValueExW
(
hdrv
,
dependent_filesW
,
0
,
REG_MULTI_SZ
,
(
LPBYTE
)
di
.
pDependentFiles
,
di
.
pDependentFiles
?
multi_sz_lenW
(
di
.
pDependentFiles
)
:
0
);
if
(
ptr
)
RegSetValueExW
(
hdrv
,
dependent_filesW
,
0
,
REG_MULTI_SZ
,
(
LPBYTE
)
di
.
pDependentFiles
,
multi_sz_lenW
(
di
.
pDependentFiles
));
else
RegSetValueExW
(
hdrv
,
dependent_filesW
,
0
,
REG_MULTI_SZ
,
(
LPBYTE
)
emptyW
,
sizeof
(
emptyW
));
while
((
ptr
!=
NULL
)
&&
(
ptr
[
0
]))
{
if
(
apd_copyfile
(
ptr
,
&
apd
))
{
ptr
+=
lstrlenW
(
ptr
)
+
1
;
...
...
@@ -512,15 +519,24 @@ static BOOL WINAPI myAddPrinterDriverEx(DWORD level, LPBYTE pDriverInfo, DWORD d
}
}
/* The language-Monitor was already copied by the caller to "%SystemRoot%\system32" */
RegSetValueExW
(
hdrv
,
monitorW
,
0
,
REG_SZ
,
(
LPBYTE
)
di
.
pMonitorName
,
di
.
pMonitorName
?
(
lstrlenW
(
di
.
pMonitorName
)
+
1
)
*
sizeof
(
WCHAR
)
:
0
);
if
(
di
.
pMonitorName
)
RegSetValueExW
(
hdrv
,
monitorW
,
0
,
REG_SZ
,
(
LPBYTE
)
di
.
pMonitorName
,
(
lstrlenW
(
di
.
pMonitorName
)
+
1
)
*
sizeof
(
WCHAR
));
else
RegSetValueExW
(
hdrv
,
monitorW
,
0
,
REG_SZ
,
(
LPBYTE
)
emptyW
,
sizeof
(
emptyW
));
RegSetValueExW
(
hdrv
,
datatypeW
,
0
,
REG_SZ
,
(
LPBYTE
)
di
.
pDefaultDataType
,
di
.
pDefaultDataType
?
(
lstrlenW
(
di
.
pDefaultDataType
)
+
1
)
*
sizeof
(
WCHAR
)
:
0
);
if
(
di
.
pDefaultDataType
)
RegSetValueExW
(
hdrv
,
datatypeW
,
0
,
REG_SZ
,
(
LPBYTE
)
di
.
pDefaultDataType
,
(
lstrlenW
(
di
.
pDefaultDataType
)
+
1
)
*
sizeof
(
WCHAR
));
else
RegSetValueExW
(
hdrv
,
datatypeW
,
0
,
REG_SZ
,
(
LPBYTE
)
emptyW
,
sizeof
(
emptyW
));
/* settings for level 4 */
RegSetValueExW
(
hdrv
,
previous_namesW
,
0
,
REG_MULTI_SZ
,
(
LPBYTE
)
di
.
pszzPreviousNames
,
di
.
pszzPreviousNames
?
multi_sz_lenW
(
di
.
pszzPreviousNames
)
:
0
);
if
(
di
.
pszzPreviousNames
)
RegSetValueExW
(
hdrv
,
previous_namesW
,
0
,
REG_MULTI_SZ
,
(
LPBYTE
)
di
.
pszzPreviousNames
,
multi_sz_lenW
(
di
.
pszzPreviousNames
));
else
RegSetValueExW
(
hdrv
,
previous_namesW
,
0
,
REG_MULTI_SZ
,
(
LPBYTE
)
emptyW
,
sizeof
(
emptyW
));
if
(
level
>
5
)
TRACE
(
"level %u for Driver %s is incomplete
\n
"
,
level
,
debugstr_w
(
di
.
pName
));
...
...
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