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
1ad05ac7
Commit
1ad05ac7
authored
Nov 07, 2006
by
Huw Davies
Committed by
Alexandre Julliard
Nov 08, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winspool.drv: Fix AddPrinterDriverA so that the strings actually get written.
Include the size of the terminating zero in set_reg_szW.
parent
388fd47c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
9 deletions
+23
-9
info.c
dlls/winspool.drv/info.c
+23
-9
No files found.
dlls/winspool.drv/info.c
View file @
1ad05ac7
...
...
@@ -325,6 +325,20 @@ static LPWSTR strdupW(LPCWSTR p)
return
ret
;
}
/* Returns the number of bytes in an ansi \0\0 terminated string (multi_sz).
The result includes all \0s (specifically the last two). */
static
int
multi_sz_lenA
(
const
char
*
str
)
{
const
char
*
ptr
=
str
;
if
(
!
str
)
return
0
;
do
{
ptr
+=
lstrlenA
(
ptr
)
+
1
;
}
while
(
*
ptr
);
return
ptr
-
str
+
1
;
}
static
void
WINSPOOL_SetDefaultPrinter
(
const
char
*
devname
,
const
char
*
name
,
BOOL
force
)
{
char
qbuf
[
200
];
...
...
@@ -623,7 +637,7 @@ static inline DWORD set_reg_szW(HKEY hkey, const WCHAR *keyname, const WCHAR *va
{
if
(
value
)
return
RegSetValueExW
(
hkey
,
keyname
,
0
,
REG_SZ
,
(
const
BYTE
*
)
value
,
lstrlenW
(
value
)
*
sizeof
(
WCHAR
));
(
lstrlenW
(
value
)
+
1
)
*
sizeof
(
WCHAR
));
else
return
ERROR_FILE_NOT_FOUND
;
}
...
...
@@ -641,7 +655,7 @@ void WINSPOOL_LoadSystemPrinters(void)
data_file
[]
=
"<datafile?>"
,
config_file
[]
=
"wineps16"
,
help_file
[]
=
"<helpfile?>"
,
dep_file
[]
=
"<dependen
d files?>
"
,
dep_file
[]
=
"<dependen
t files?>
\0
"
,
monitor_name
[]
=
"<monitor name?>"
,
default_data_type
[]
=
"RAW"
;
...
...
@@ -4369,16 +4383,16 @@ BOOL WINAPI AddPrinterDriverA(LPSTR pName, DWORD level, LPBYTE pDriverInfo)
return
FALSE
;
}
RegSetValueExA
(
hkeyName
,
"Configuration File"
,
0
,
REG_SZ
,
(
LPBYTE
)
di3
.
pConfigFile
,
0
);
RegSetValueExA
(
hkeyName
,
"Data File"
,
0
,
REG_SZ
,
(
LPBYTE
)
di3
.
pDataFile
,
0
);
RegSetValueExA
(
hkeyName
,
"Driver"
,
0
,
REG_SZ
,
(
LPBYTE
)
di3
.
pDriverPath
,
0
);
lstrlenA
(
di3
.
pConfigFile
)
+
1
);
RegSetValueExA
(
hkeyName
,
"Data File"
,
0
,
REG_SZ
,
(
LPBYTE
)
di3
.
pDataFile
,
lstrlenA
(
di3
.
pDataFile
)
+
1
);
RegSetValueExA
(
hkeyName
,
"Driver"
,
0
,
REG_SZ
,
(
LPBYTE
)
di3
.
pDriverPath
,
lstrlenA
(
di3
.
pDriverPath
)
+
1
);
RegSetValueExA
(
hkeyName
,
"Version"
,
0
,
REG_DWORD
,
(
LPBYTE
)
&
di3
.
cVersion
,
sizeof
(
DWORD
));
RegSetValueExA
(
hkeyName
,
"Datatype"
,
0
,
REG_SZ
,
(
LPBYTE
)
di3
.
pDefaultDataType
,
0
);
RegSetValueExA
(
hkeyName
,
"Datatype"
,
0
,
REG_SZ
,
(
LPBYTE
)
di3
.
pDefaultDataType
,
lstrlenA
(
di3
.
pDefaultDataType
)
);
RegSetValueExA
(
hkeyName
,
"Dependent Files"
,
0
,
REG_MULTI_SZ
,
(
LPBYTE
)
di3
.
pDependentFiles
,
0
);
RegSetValueExA
(
hkeyName
,
"Help File"
,
0
,
REG_SZ
,
(
LPBYTE
)
di3
.
pHelpFile
,
0
);
RegSetValueExA
(
hkeyName
,
"Monitor"
,
0
,
REG_SZ
,
(
LPBYTE
)
di3
.
pMonitorName
,
0
);
(
LPBYTE
)
di3
.
pDependentFiles
,
multi_sz_lenA
(
di3
.
pDependentFiles
)
);
RegSetValueExA
(
hkeyName
,
"Help File"
,
0
,
REG_SZ
,
(
LPBYTE
)
di3
.
pHelpFile
,
lstrlenA
(
di3
.
pHelpFile
)
+
1
);
RegSetValueExA
(
hkeyName
,
"Monitor"
,
0
,
REG_SZ
,
(
LPBYTE
)
di3
.
pMonitorName
,
lstrlenA
(
di3
.
pMonitorName
)
+
1
);
RegCloseKey
(
hkeyName
);
RegCloseKey
(
hkeyDrivers
);
...
...
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