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
366f452b
Commit
366f452b
authored
Feb 01, 2006
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Feb 01, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winspool: Empty string as environment is valid, with tests.
parent
c30ac077
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
12 deletions
+25
-12
info.c
dlls/winspool/info.c
+4
-5
info.c
dlls/winspool/tests/info.c
+21
-7
No files found.
dlls/winspool/info.c
View file @
366f452b
...
...
@@ -204,6 +204,7 @@ static DWORD WINSPOOL_GetOpenedPrinterRegKey(HANDLE hPrinter, HKEY *phkey);
* Success: PTR to printenv_t
*
* NOTES
* An empty string is handled the same way as NULL.
* SetLastEror(ERROR_INVALID_ENVIRONMENT) is called on Failure
*
*/
...
...
@@ -218,7 +219,7 @@ static const printenv_t * validate_envW(LPCWSTR env)
unsigned
int
i
;
TRACE
(
"testing %s
\n
"
,
debugstr_w
(
env
));
if
(
env
)
if
(
env
&&
env
[
0
]
)
{
for
(
i
=
0
;
i
<
sizeof
(
all_printenv
)
/
sizeof
(
all_printenv
[
0
]);
i
++
)
{
...
...
@@ -3399,9 +3400,7 @@ BOOL WINAPI GetPrinterDriverW(HANDLE hPrinter, LPWSTR pEnvironment,
* "%winsysdir%" is the Value from GetSystemDirectoryW()
*
* FIXME
*- pName != NULL not supported
*- pEnvironment != NULL not supported
*- Current Implementation returns always "%winsysdir%"
*- Only NULL or "" is supported for pName
*
*/
BOOL
WINAPI
GetPrinterDriverDirectoryW
(
LPWSTR
pName
,
LPWSTR
pEnvironment
,
...
...
@@ -3413,7 +3412,7 @@ BOOL WINAPI GetPrinterDriverDirectoryW(LPWSTR pName, LPWSTR pEnvironment,
TRACE
(
"(%s, %s, %ld, %p, %ld, %p)
\n
"
,
debugstr_w
(
pName
),
debugstr_w
(
pEnvironment
),
Level
,
pDriverDirectory
,
cbBuf
,
pcbNeeded
);
if
(
pName
!=
NULL
)
{
if
(
pName
!=
NULL
&&
pName
[
0
]
)
{
FIXME
(
"pName unsupported: %s
\n
"
,
debugstr_w
(
pName
));
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
...
...
dlls/winspool/tests/info.c
View file @
366f452b
...
...
@@ -94,7 +94,7 @@ static LPSTR find_default_printer(VOID)
}
static
void
test_
default_p
rinter
(
void
)
static
void
test_
GetDefaultP
rinter
(
void
)
{
BOOL
retval
;
DWORD
exact
=
DEFAULT_PRINTER_SIZE
;
...
...
@@ -171,8 +171,9 @@ static void test_default_printer(void)
exact
,
size
);
}
static
void
test_printer_directory
(
void
)
{
LPBYTE
buffer
=
NULL
;
static
void
test_GetPrinterDriverDirectory
(
void
)
{
LPBYTE
buffer
=
NULL
;
DWORD
cbBuf
=
0
,
pcbNeeded
=
0
;
BOOL
res
;
...
...
@@ -305,10 +306,23 @@ static void test_printer_directory(void)
"'len > 0' or '0' with ERROR_INVALID_ENVIRONMENT)
\n
"
,
res
,
GetLastError
(),
lstrlenA
((
char
*
)
buffer
));
/* A Setup-Programm (PDFCreator_0.8.0) use empty strings */
SetLastError
(
MAGIC_DEAD
);
res
=
GetPrinterDriverDirectoryA
(
""
,
""
,
1
,
buffer
,
cbBuf
*
2
,
&
pcbNeeded
);
ok
(
res
,
"returned %d with %ld (expected '!=0')
\n
"
,
res
,
GetLastError
()
);
SetLastError
(
MAGIC_DEAD
);
res
=
GetPrinterDriverDirectoryA
(
NULL
,
""
,
1
,
buffer
,
cbBuf
*
2
,
&
pcbNeeded
);
ok
(
res
,
"returned %d with %ld (expected '!=0')
\n
"
,
res
,
GetLastError
()
);
SetLastError
(
MAGIC_DEAD
);
res
=
GetPrinterDriverDirectoryA
(
""
,
NULL
,
1
,
buffer
,
cbBuf
*
2
,
&
pcbNeeded
);
ok
(
res
,
"returned %d with %ld (expected '!=0')
\n
"
,
res
,
GetLastError
()
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
}
static
void
test_
openp
rinter
(
void
)
static
void
test_
OpenP
rinter
(
void
)
{
PRINTER_DEFAULTSA
defaults
;
HANDLE
hprinter
;
...
...
@@ -458,7 +472,7 @@ START_TEST(info)
find_default_printer
();
test_
default_p
rinter
();
test_
printer_d
irectory
();
test_
openp
rinter
();
test_
GetDefaultP
rinter
();
test_
GetPrinterDriverD
irectory
();
test_
OpenP
rinter
();
}
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