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
496fd1dc
Commit
496fd1dc
authored
Dec 22, 2006
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Dec 22, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winspoool/tests: Build the name of the local print server in a separate function.
parent
0bb3e4f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
14 deletions
+30
-14
info.c
dlls/winspool.drv/tests/info.c
+30
-14
No files found.
dlls/winspool.drv/tests/info.c
View file @
496fd1dc
...
...
@@ -56,6 +56,7 @@ struct monitor_entry {
};
static
LPSTR
default_printer
=
NULL
;
static
LPSTR
local_server
=
NULL
;
/* report common behavior only once */
static
DWORD
report_deactivated_spooler
=
1
;
...
...
@@ -179,6 +180,30 @@ static struct monitor_entry * find_installed_monitor(void)
return
entry
;
}
/* ########################### */
static
void
find_local_server
(
VOID
)
{
static
char
buffer
[
MAX_PATH
];
DWORD
res
;
DWORD
size
;
size
=
sizeof
(
buffer
)
-
3
;
buffer
[
0
]
=
'\\'
;
buffer
[
1
]
=
'\\'
;
buffer
[
2
]
=
'\0'
;
SetLastError
(
0xdeadbeef
);
res
=
GetComputerNameA
(
&
buffer
[
2
],
&
size
);
trace
(
"returned %d with %d and %d: '%s'
\n
"
,
res
,
GetLastError
(),
size
,
buffer
);
ok
(
res
!=
0
,
"returned %d with %d and %d: '%s' (expected '!= 0')
\n
"
,
res
,
GetLastError
(),
size
,
buffer
);
if
(
res
)
local_server
=
buffer
;
}
/* ########################### */
...
...
@@ -1219,10 +1244,6 @@ static void test_OpenPrinter(void)
PRINTER_DEFAULTSA
defaults
;
HANDLE
hprinter
;
DWORD
res
;
DWORD
size
;
CHAR
buffer
[
DEFAULT_PRINTER_SIZE
];
LPSTR
ptr
;
SetLastError
(
MAGIC_DEAD
);
res
=
OpenPrinter
(
NULL
,
NULL
,
NULL
);
...
...
@@ -1268,17 +1289,11 @@ static void test_OpenPrinter(void)
}
size
=
sizeof
(
buffer
)
-
3
;
ptr
=
buffer
;
ptr
[
0
]
=
'\\'
;
ptr
++
;
ptr
[
0
]
=
'\\'
;
ptr
++
;
if
(
GetComputerNameA
(
ptr
,
&
size
))
{
hprinter
=
(
HANDLE
)
MAGIC_DEAD
;
SetLastError
(
MAGIC_DEAD
);
res
=
OpenPrinter
(
buffer
,
&
hprinter
,
NULL
);
if
(
local_server
!=
NULL
)
{
hprinter
=
(
HANDLE
)
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
res
=
OpenPrinter
(
local_server
,
&
hprinter
,
NULL
);
todo_wine
{
ok
(
res
||
(
!
res
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
),
"returned %d with %d (expected '!=0' or '0' with ERROR_INVALID_PARAMETER)
\n
"
,
...
...
@@ -1681,6 +1696,7 @@ START_TEST(info)
pSetDefaultPrinterA
=
(
void
*
)
GetProcAddress
(
hwinspool
,
"SetDefaultPrinterA"
);
find_default_printer
();
find_local_server
();
test_AddMonitor
();
test_AddPort
();
...
...
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