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
e55b52fd
Commit
e55b52fd
authored
Jun 09, 2006
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Jun 10, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winspool/tests: Tests for GetPrintProcessorDirectory.
parent
072c11dc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
129 additions
and
0 deletions
+129
-0
info.c
dlls/winspool.drv/tests/info.c
+129
-0
No files found.
dlls/winspool.drv/tests/info.c
View file @
e55b52fd
...
@@ -735,6 +735,134 @@ static void test_GetPrinterDriverDirectory(void)
...
@@ -735,6 +735,134 @@ static void test_GetPrinterDriverDirectory(void)
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
}
}
/* ##### */
static
void
test_GetPrintProcessorDirectory
(
void
)
{
LPBYTE
buffer
=
NULL
;
DWORD
cbBuf
=
0
;
DWORD
pcbNeeded
=
0
;
BOOL
res
;
SetLastError
(
0xdeadbeef
);
res
=
GetPrintProcessorDirectoryA
(
NULL
,
NULL
,
1
,
NULL
,
0
,
&
cbBuf
);
/* The deactivated Spooler is catched here on NT3.51 */
RETURN_ON_DEACTIVATED_SPOOLER
(
res
)
ok
(
!
res
&&
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
),
"returned %d with %ld (expected '0' with ERROR_INSUFFICIENT_BUFFER)
\n
"
,
res
,
GetLastError
());
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cbBuf
*
2
);
if
(
buffer
==
NULL
)
return
;
buffer
[
0
]
=
'\0'
;
SetLastError
(
0xdeadbeef
);
res
=
GetPrintProcessorDirectoryA
(
NULL
,
NULL
,
1
,
buffer
,
cbBuf
,
&
pcbNeeded
);
ok
(
res
,
"returned %d with %ld (expected '!= 0')
\n
"
,
res
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
buffer
[
0
]
=
'\0'
;
res
=
GetPrintProcessorDirectoryA
(
NULL
,
NULL
,
1
,
buffer
,
cbBuf
*
2
,
&
pcbNeeded
);
ok
(
res
,
"returned %d with %ld (expected '!= 0')
\n
"
,
res
,
GetLastError
());
/* Buffer to small */
buffer
[
0
]
=
'\0'
;
SetLastError
(
0xdeadbeef
);
res
=
GetPrintProcessorDirectoryA
(
NULL
,
NULL
,
1
,
buffer
,
cbBuf
-
1
,
&
pcbNeeded
);
ok
(
!
res
&&
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
),
"returned %d with %ld (expected '0' with ERROR_INSUFFICIENT_BUFFER)
\n
"
,
res
,
GetLastError
());
#if 0
/* XPsp2: the programm will crash here, when the spooler is not running */
/* GetPrinterDriverDirectory has the same bug */
pcbNeeded = 0;
SetLastError(0xdeadbeef);
res = GetPrintProcessorDirectoryA( NULL, NULL, 1, NULL, cbBuf, &pcbNeeded);
#endif
buffer
[
0
]
=
'\0'
;
SetLastError
(
0xdeadbeef
);
res
=
GetPrintProcessorDirectoryA
(
NULL
,
NULL
,
1
,
buffer
,
cbBuf
,
NULL
);
/* NT: RPC_X_NULL_REF_POINTER, 9x: res != 0 */
ok
(
res
||
(
GetLastError
()
==
RPC_X_NULL_REF_POINTER
),
"returned %d with %ld (expected '!= 0' or '0' with "
\
"RPC_X_NULL_REF_POINTER)
\n
"
,
res
,
GetLastError
());
buffer
[
0
]
=
'\0'
;
SetLastError
(
0xdeadbeef
);
res
=
GetPrintProcessorDirectoryA
(
NULL
,
NULL
,
1
,
NULL
,
cbBuf
,
NULL
);
/* NT: RPC_X_NULL_REF_POINTER, 9x: res != 0 */
ok
(
res
||
(
GetLastError
()
==
RPC_X_NULL_REF_POINTER
),
"returned %d with %ld (expected '!= 0' or '0' with "
\
"RPC_X_NULL_REF_POINTER)
\n
"
,
res
,
GetLastError
());
/* with a valid buffer, but level is invalid */
buffer
[
0
]
=
'\0'
;
SetLastError
(
0xdeadbeef
);
res
=
GetPrintProcessorDirectoryA
(
NULL
,
NULL
,
2
,
buffer
,
cbBuf
,
&
pcbNeeded
);
if
(
res
&&
buffer
[
0
])
{
/* Level is ignored in win9x*/
trace
(
"invalid level (2) was ignored
\n
"
);
}
else
{
ok
(
!
res
&&
(
GetLastError
()
==
ERROR_INVALID_LEVEL
),
"returned %d with %ld (expected '0' with ERROR_INVALID_LEVEL)
\n
"
,
res
,
GetLastError
());
}
/* Empty environment is the same as the default environment */
buffer
[
0
]
=
'\0'
;
SetLastError
(
0xdeadbeef
);
res
=
GetPrintProcessorDirectoryA
(
NULL
,
""
,
1
,
buffer
,
cbBuf
*
2
,
&
pcbNeeded
);
ok
(
res
,
"returned %d with %ld (expected '!= 0')
\n
"
,
res
,
GetLastError
());
/* "Windows 4.0" is valid for win9x and NT */
buffer
[
0
]
=
'\0'
;
SetLastError
(
0xdeadbeef
);
res
=
GetPrintProcessorDirectoryA
(
NULL
,
env_win9x_case
,
1
,
buffer
,
cbBuf
*
2
,
&
pcbNeeded
);
ok
(
res
,
"returned %d with %ld (expected '!= 0')
\n
"
,
res
,
GetLastError
());
/* "Windows NT x86" is invalid for win9x */
buffer
[
0
]
=
'\0'
;
SetLastError
(
0xdeadbeef
);
res
=
GetPrintProcessorDirectoryA
(
NULL
,
env_x86
,
1
,
buffer
,
cbBuf
*
2
,
&
pcbNeeded
);
ok
(
res
||
(
GetLastError
()
==
ERROR_INVALID_ENVIRONMENT
),
"returned %d with %ld (expected '!= 0' or '0' with "
\
"ERROR_INVALID_ENVIRONMENT)
\n
"
,
res
,
GetLastError
());
/* invalid on all Systems */
buffer
[
0
]
=
'\0'
;
SetLastError
(
0xdeadbeef
);
res
=
GetPrintProcessorDirectoryA
(
NULL
,
"invalid_env"
,
1
,
buffer
,
cbBuf
*
2
,
&
pcbNeeded
);
ok
(
!
res
&&
(
GetLastError
()
==
ERROR_INVALID_ENVIRONMENT
),
"returned %d with %ld (expected '0' with ERROR_INVALID_ENVIRONMENT)
\n
"
,
res
,
GetLastError
());
/* Empty servername is the same as the local computer */
buffer
[
0
]
=
'\0'
;
SetLastError
(
0xdeadbeef
);
res
=
GetPrintProcessorDirectoryA
(
""
,
NULL
,
1
,
buffer
,
cbBuf
*
2
,
&
pcbNeeded
);
ok
(
res
,
"returned %d with %ld (expected '!= 0')
\n
"
,
res
,
GetLastError
());
/* invalid on all Systems */
buffer
[
0
]
=
'\0'
;
SetLastError
(
0xdeadbeef
);
res
=
GetPrintProcessorDirectoryA
(
"
\\
invalid_server"
,
NULL
,
1
,
buffer
,
cbBuf
*
2
,
&
pcbNeeded
);
ok
(
!
res
&&
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
),
"returned %d with %ld (expected '0' with ERROR_INVALID_PARAMETER)
\n
"
,
res
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
}
/* ##### */
static
void
test_OpenPrinter
(
void
)
static
void
test_OpenPrinter
(
void
)
{
{
PRINTER_DEFAULTSA
defaults
;
PRINTER_DEFAULTSA
defaults
;
...
@@ -1172,6 +1300,7 @@ START_TEST(info)
...
@@ -1172,6 +1300,7 @@ START_TEST(info)
test_EnumMonitors
();
test_EnumMonitors
();
test_GetDefaultPrinter
();
test_GetDefaultPrinter
();
test_GetPrinterDriverDirectory
();
test_GetPrinterDriverDirectory
();
test_GetPrintProcessorDirectory
();
test_OpenPrinter
();
test_OpenPrinter
();
test_GetPrinterDriver
();
test_GetPrinterDriver
();
test_SetDefaultPrinter
();
test_SetDefaultPrinter
();
...
...
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