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
18193b19
Commit
18193b19
authored
Jun 16, 2010
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Jun 16, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winspool: Return ERROR_MORE_DATA, when the app probe for the needed buffer size.
parent
8e151f51
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
info.c
dlls/winspool.drv/info.c
+12
-0
info.c
dlls/winspool.drv/tests/info.c
+15
-0
No files found.
dlls/winspool.drv/info.c
View file @
18193b19
...
...
@@ -5367,6 +5367,8 @@ DWORD WINAPI GetPrinterDataExA(HANDLE hPrinter, LPCSTR pKeyName,
ret
=
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
PrintersW
,
&
hkeyPrinters
);
if
(
ret
)
return
ret
;
TRACE
(
"printer->name: %s
\n
"
,
debugstr_w
(
printer
->
name
));
if
(
printer
->
name
)
{
ret
=
RegOpenKeyW
(
hkeyPrinters
,
printer
->
name
,
&
hkeyPrinter
);
...
...
@@ -5385,9 +5387,13 @@ DWORD WINAPI GetPrinterDataExA(HANDLE hPrinter, LPCSTR pKeyName,
ret
=
RegQueryValueExA
(
printer
->
name
?
hkeySubkey
:
hkeyPrinters
,
pValueName
,
0
,
pType
,
pData
,
pcbNeeded
);
if
(
!
ret
&&
!
pData
)
ret
=
ERROR_MORE_DATA
;
RegCloseKey
(
hkeySubkey
);
RegCloseKey
(
hkeyPrinter
);
RegCloseKey
(
hkeyPrinters
);
TRACE
(
"--> %d
\n
"
,
ret
);
return
ret
;
}
...
...
@@ -5411,6 +5417,8 @@ DWORD WINAPI GetPrinterDataExW(HANDLE hPrinter, LPCWSTR pKeyName,
ret
=
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
PrintersW
,
&
hkeyPrinters
);
if
(
ret
)
return
ret
;
TRACE
(
"printer->name: %s
\n
"
,
debugstr_w
(
printer
->
name
));
if
(
printer
->
name
)
{
ret
=
RegOpenKeyW
(
hkeyPrinters
,
printer
->
name
,
&
hkeyPrinter
);
...
...
@@ -5429,9 +5437,13 @@ DWORD WINAPI GetPrinterDataExW(HANDLE hPrinter, LPCWSTR pKeyName,
ret
=
RegQueryValueExW
(
printer
->
name
?
hkeySubkey
:
hkeyPrinters
,
pValueName
,
0
,
pType
,
pData
,
pcbNeeded
);
if
(
!
ret
&&
!
pData
)
ret
=
ERROR_MORE_DATA
;
RegCloseKey
(
hkeySubkey
);
RegCloseKey
(
hkeyPrinter
);
RegCloseKey
(
hkeyPrinters
);
TRACE
(
"--> %d
\n
"
,
ret
);
return
ret
;
}
...
...
dlls/winspool.drv/tests/info.c
View file @
18193b19
...
...
@@ -2364,6 +2364,14 @@ static void test_GetPrinterData(void)
ok
(
!
res
&&
(
type
==
REG_SZ
)
&&
((
needed
==
len
)
||
(
needed
==
(
len
*
sizeof
(
WCHAR
)))),
"got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d or %d)
\n
"
,
res
,
type
,
needed
,
buffer
,
len
,
len
*
sizeof
(
WCHAR
));
needed
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
res
=
GetPrinterDataA
(
hprn
,
defaultspooldirectory
,
NULL
,
NULL
,
0
,
&
needed
);
ok
(
(
res
==
ERROR_MORE_DATA
)
&&
((
needed
==
len
)
||
(
needed
==
(
len
*
sizeof
(
WCHAR
)))),
"got %d, needed: %d (expected ERROR_MORE_DATA and %d or %d)
\n
"
,
res
,
needed
,
len
,
len
*
sizeof
(
WCHAR
));
/* ToDo: test SPLREG_* */
SetLastError
(
0xdeadbeef
);
...
...
@@ -2451,6 +2459,13 @@ static void test_GetPrinterDataEx(void)
"got %d, type %d, needed: %d and '%s' (expected ERROR_SUCCESS, REG_SZ and %d or %d)
\n
"
,
res
,
type
,
needed
,
buffer
,
len
,
len
*
sizeof
(
WCHAR
));
needed
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
res
=
pGetPrinterDataExA
(
hprn
,
NULL
,
defaultspooldirectory
,
NULL
,
NULL
,
0
,
&
needed
);
ok
(
(
res
==
ERROR_MORE_DATA
)
&&
((
needed
==
len
)
||
(
needed
==
(
len
*
sizeof
(
WCHAR
)))),
"got %d, needed: %d (expected ERROR_MORE_DATA and %d or %d)
\n
"
,
res
,
needed
,
len
,
len
*
sizeof
(
WCHAR
));
SetLastError
(
0xdeadbeef
);
res
=
ClosePrinter
(
hprn
);
ok
(
res
,
"ClosePrinter error %d
\n
"
,
GetLastError
());
...
...
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