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
d92c95d5
Commit
d92c95d5
authored
Jan 26, 1999
by
Huw D M Davies
Committed by
Alexandre Julliard
Jan 26, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure DrvGetPrinterData returns the correct data if cbData <= 1
parent
a4c8445b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
printdrv.c
misc/printdrv.c
+6
-4
No files found.
misc/printdrv.c
View file @
d92c95d5
...
...
@@ -138,14 +138,14 @@ INT32 WINAPI AbortDoc32(HDC32 hdc)
* Helper for DrvGetPrinterData
*/
static
DWORD
DrvGetPrinterDataInternal
(
LPSTR
RegStr_Printer
,
LPBYTE
lpPrinterData
,
int
cbData
)
LPBYTE
lpPrinterData
,
int
cbData
,
int
what
)
{
DWORD
res
=
-
1
;
HKEY
hkey
;
DWORD
dwType
,
cbQueryData
;
if
(
!
(
RegOpenKey32A
(
HKEY_LOCAL_MACHINE
,
RegStr_Printer
,
&
hkey
)))
{
if
(
cbData
>
1
)
{
/* "Default DevMode" */
if
(
what
==
INT_PD_DEFAULT_DEVMODE
)
{
/* "Default DevMode" */
if
(
!
(
RegQueryValueEx32A
(
hkey
,
DefaultDevMode
,
0
,
&
dwType
,
0
,
&
cbQueryData
)))
{
if
(
!
lpPrinterData
)
res
=
cbQueryData
;
...
...
@@ -200,7 +200,8 @@ DWORD WINAPI DrvGetPrinterData(LPSTR lpPrinter, LPSTR lpProfile,
if
(((
DWORD
)
lpProfile
==
INT_PD_DEFAULT_DEVMODE
)
||
(
HIWORD
(
lpProfile
)
&&
(
!
strcmp
(
lpProfile
,
DefaultDevMode
))))
{
size
=
DrvGetPrinterDataInternal
(
RegStr_Printer
,
lpPrinterData
,
cbData
);
size
=
DrvGetPrinterDataInternal
(
RegStr_Printer
,
lpPrinterData
,
cbData
,
INT_PD_DEFAULT_DEVMODE
);
if
(
size
+
1
)
{
*
lpNeeded
=
size
;
if
((
lpPrinterData
)
&&
(
*
lpNeeded
>
cbData
))
...
...
@@ -217,7 +218,8 @@ DWORD WINAPI DrvGetPrinterData(LPSTR lpPrinter, LPSTR lpProfile,
res
=
ERROR_MORE_DATA
;
goto
failed
;
}
size
=
DrvGetPrinterDataInternal
(
RegStr_Printer
,
lpPrinterData
,
1
);
size
=
DrvGetPrinterDataInternal
(
RegStr_Printer
,
lpPrinterData
,
cbData
,
INT_PD_DEFAULT_MODEL
);
if
((
size
+
1
)
&&
(
lpType
))
*
lpType
=
REG_SZ
;
else
...
...
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