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
1c8a466c
Commit
1c8a466c
authored
Aug 13, 2007
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Aug 14, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winspool/tests: Fix 2 failing tests for restricted users.
parent
4f405b22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
21 deletions
+27
-21
info.c
dlls/winspool.drv/tests/info.c
+27
-21
No files found.
dlls/winspool.drv/tests/info.c
View file @
1c8a466c
...
...
@@ -87,17 +87,29 @@ static LPWSTR tempfileW = NULL;
/* ################################ */
/* report common behavior only once */
static
DWORD
report_deactivated_spooler
=
1
;
static
DWORD
deactivated_spooler_reported
=
0
;
#define RETURN_ON_DEACTIVATED_SPOOLER(res) \
if((res == 0) && (GetLastError() == RPC_S_SERVER_UNAVAILABLE)) \
if
((res == 0) && (GetLastError() == RPC_S_SERVER_UNAVAILABLE)) \
{ \
if
(report_deactivated_spooler > 0
) { \
report_deactivated_spooler--
; \
if
(!deactivated_spooler_reported
) { \
deactivated_spooler_reported++
; \
skip("The Service 'Spooler' is required for many test\n"); \
} \
return; \
}
static
DWORD
access_denied_reported
=
0
;
#define RETURN_ON_ACCESS_DENIED(res) \
if ((res == 0) && (GetLastError() == ERROR_ACCESS_DENIED)) \
{ \
if (!access_denied_reported) { \
access_denied_reported++; \
skip("More Access-Rights are required for many test\n"); \
} \
return; \
}
/* ################################ */
static
void
find_default_printer
(
VOID
)
{
...
...
@@ -313,11 +325,7 @@ static void test_AddMonitor(void)
SetLastError
(
MAGIC_DEAD
);
res
=
AddMonitorA
(
NULL
,
2
,
(
LPBYTE
)
&
mi2a
);
RETURN_ON_DEACTIVATED_SPOOLER
(
res
)
if
(
!
res
&&
(
GetLastError
()
==
ERROR_ACCESS_DENIED
))
{
skip
(
"(ACCESS_DENIED)
\n
"
);
return
;
}
RETURN_ON_ACCESS_DENIED
(
res
)
/* NT: ERROR_INVALID_PARAMETER, 9x: ERROR_INVALID_ENVIRONMENT */
ok
(
!
res
&&
((
GetLastError
()
==
ERROR_INVALID_PARAMETER
)
||
...
...
@@ -440,10 +448,8 @@ static void test_AddPort(void)
SetLastError
(
0xdeadbeef
);
res
=
AddPortA
(
NULL
,
0
,
empty
);
/* Allowed only for (Printer-)Administrators */
if
(
!
res
&&
(
GetLastError
()
==
ERROR_ACCESS_DENIED
))
{
skip
(
"(ACCESS_DENIED)
\n
"
);
return
;
}
RETURN_ON_ACCESS_DENIED
(
res
)
/* XP: ERROR_NOT_SUPPORTED, NT351 and 9x: ERROR_INVALID_PARAMETER */
ok
(
!
res
&&
((
GetLastError
()
==
ERROR_NOT_SUPPORTED
)
||
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
)),
...
...
@@ -593,10 +599,8 @@ static void test_ConfigurePort(void)
SetLastError
(
0xdeadbeef
);
res
=
ConfigurePortA
(
NULL
,
0
,
empty
);
/* Allowed only for (Printer-)Administrators */
if
(
!
res
&&
(
GetLastError
()
==
ERROR_ACCESS_DENIED
))
{
skip
(
"(ACCESS_DENIED)
\n
"
);
return
;
}
RETURN_ON_ACCESS_DENIED
(
res
)
/* XP: ERROR_NOT_SUPPORTED, NT351 and 9x: ERROR_INVALID_PARAMETER */
ok
(
!
res
&&
((
GetLastError
()
==
ERROR_NOT_SUPPORTED
)
||
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
)),
...
...
@@ -734,10 +738,8 @@ static void test_DeletePort(void)
SetLastError
(
0xdeadbeef
);
res
=
DeletePortA
(
NULL
,
0
,
empty
);
/* Allowed only for (Printer-)Administrators */
if
(
!
res
&&
(
GetLastError
()
==
ERROR_ACCESS_DENIED
))
{
skip
(
"(ACCESS_DENIED)
\n
"
);
return
;
}
RETURN_ON_ACCESS_DENIED
(
res
)
/* XP: ERROR_NOT_SUPPORTED, NT351 and 9x: ERROR_INVALID_PARAMETER */
ok
(
!
res
&&
((
GetLastError
()
==
ERROR_NOT_SUPPORTED
)
||
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
)),
...
...
@@ -1810,6 +1812,8 @@ static void test_XcvDataW_MonitorUI(void)
SetLastError
(
0xdeadbeef
);
res
=
OpenPrinter
(
xcv_localport
,
&
hXcv
,
&
pd
);
RETURN_ON_DEACTIVATED_SPOOLER
(
res
)
RETURN_ON_ACCESS_DENIED
(
res
)
ok
(
res
,
"returned %d with %u and handle %p (expected '!= 0')
\n
"
,
res
,
GetLastError
(),
hXcv
);
if
(
!
res
)
return
;
...
...
@@ -1927,6 +1931,8 @@ static void test_XcvDataW_PortIsValid(void)
res
=
OpenPrinter
(
xcv_localport
,
&
hXcv
,
&
pd
);
RETURN_ON_DEACTIVATED_SPOOLER
(
res
)
RETURN_ON_ACCESS_DENIED
(
res
)
ok
(
res
,
"returned %d with %u and handle %p (expected '!= 0')
\n
"
,
res
,
GetLastError
(),
hXcv
);
if
(
!
res
)
return
;
...
...
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