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
9f90c74f
Commit
9f90c74f
authored
Dec 08, 2006
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Dec 11, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
localspl/tests: Add tests for XcvOpenPort.
parent
3558cdb8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
3 deletions
+51
-3
localmon.c
dlls/localspl/tests/localmon.c
+50
-1
winsplp.h
include/ddk/winsplp.h
+1
-2
No files found.
dlls/localspl/tests/localmon.c
View file @
9f90c74f
...
...
@@ -54,7 +54,7 @@ static BOOL (WINAPI *pConfigurePort)(LPWSTR, HWND, LPWSTR);
static
BOOL
(
WINAPI
*
pDeletePort
)(
LPWSTR
,
HWND
,
LPWSTR
);
static
BOOL
(
WINAPI
*
pGetPrinterDataFromPort
)(
HANDLE
,
DWORD
,
LPWSTR
,
LPWSTR
,
DWORD
,
LPWSTR
,
DWORD
,
LPDWORD
);
static
BOOL
(
WINAPI
*
pSetPortTimeOuts
)(
HANDLE
,
LPCOMMTIMEOUTS
,
DWORD
);
static
BOOL
(
WINAPI
*
pXcvOpenPort
)(
HANDLE
,
LPCWSTR
,
ACCESS_MASK
,
PHANDLE
phXcv
);
static
BOOL
(
WINAPI
*
pXcvOpenPort
)(
LPCWSTR
,
ACCESS_MASK
,
PHANDLE
phXcv
);
static
DWORD
(
WINAPI
*
pXcvDataPort
)(
HANDLE
,
LPCWSTR
,
PBYTE
,
DWORD
,
PBYTE
,
DWORD
,
PDWORD
);
static
BOOL
(
WINAPI
*
pXcvClosePort
)(
HANDLE
);
...
...
@@ -291,6 +291,54 @@ static void test_InitializePrintMonitor(void)
"returned %p with %d (expected %p)
\n
"
,
res
,
GetLastError
(),
pm
);
}
/* ########################### */
static
void
test_XcvOpenPort
(
void
)
{
DWORD
res
;
HANDLE
hXcv
;
if
((
pXcvOpenPort
==
NULL
)
||
(
pXcvClosePort
==
NULL
))
return
;
#if 0
/* crash with native localspl.dll (w2k+xp) */
res = pXcvOpenPort(NULL, SERVER_ACCESS_ADMINISTER, &hXcv);
res = pXcvOpenPort(emptyW, SERVER_ACCESS_ADMINISTER, NULL);
#endif
/* The returned handle is the result from a previous "spoolss.dll,DllAllocSplMem" */
SetLastError
(
0xdeadbeef
);
hXcv
=
(
HANDLE
)
0xdeadbeef
;
res
=
pXcvOpenPort
(
emptyW
,
SERVER_ACCESS_ADMINISTER
,
&
hXcv
);
ok
(
res
,
"returned %d with 0x%x and %p (expected '!= 0')
\n
"
,
res
,
GetLastError
(),
hXcv
);
if
(
res
)
pXcvClosePort
(
hXcv
);
/* The ACCESS_MASK is not checked in XcvOpenPort */
SetLastError
(
0xdeadbeef
);
hXcv
=
(
HANDLE
)
0xdeadbeef
;
res
=
pXcvOpenPort
(
emptyW
,
0
,
&
hXcv
);
ok
(
res
,
"returned %d with 0x%x and %p (expected '!= 0')
\n
"
,
res
,
GetLastError
(),
hXcv
);
if
(
res
)
pXcvClosePort
(
hXcv
);
/* A copy of pszObject is saved in the Memory-Block */
SetLastError
(
0xdeadbeef
);
hXcv
=
(
HANDLE
)
0xdeadbeef
;
res
=
pXcvOpenPort
(
portname_lpt1W
,
SERVER_ALL_ACCESS
,
&
hXcv
);
ok
(
res
,
"returned %d with 0x%x and %p (expected '!= 0')
\n
"
,
res
,
GetLastError
(),
hXcv
);
if
(
res
)
pXcvClosePort
(
hXcv
);
SetLastError
(
0xdeadbeef
);
hXcv
=
(
HANDLE
)
0xdeadbeef
;
res
=
pXcvOpenPort
(
portname_fileW
,
SERVER_ALL_ACCESS
,
&
hXcv
);
ok
(
res
,
"returned %d with 0x%x and %p (expected '!= 0')
\n
"
,
res
,
GetLastError
(),
hXcv
);
if
(
res
)
pXcvClosePort
(
hXcv
);
}
/* ########################### */
#define GET_MONITOR_FUNC(name) \
...
...
@@ -352,4 +400,5 @@ START_TEST(localmon)
test_ConfigurePort
();
test_DeletePort
();
test_EnumPorts
();
test_XcvOpenPort
();
}
include/ddk/winsplp.h
View file @
9f90c74f
...
...
@@ -71,8 +71,7 @@ typedef struct _MONITOR {
LPWSTR
lpOutBuffer
,
DWORD
cbOutBuffer
,
LPDWORD
lpcbReturned
);
BOOL
(
WINAPI
*
pfnSetPortTimeOuts
)(
HANDLE
hPort
,
LPCOMMTIMEOUTS
lpCTO
,
DWORD
reserved
);
BOOL
(
WINAPI
*
pfnXcvOpenPort
)(
HANDLE
hMonitor
,
LPCWSTR
pszObject
,
ACCESS_MASK
GrantedAccess
,
PHANDLE
phXcv
);
BOOL
(
WINAPI
*
pfnXcvOpenPort
)(
LPCWSTR
pszObject
,
ACCESS_MASK
GrantedAccess
,
PHANDLE
phXcv
);
DWORD
(
WINAPI
*
pfnXcvDataPort
)(
HANDLE
hXcv
,
LPCWSTR
pszDataName
,
PBYTE
pInputData
,
DWORD
cbInputData
,
PBYTE
pOutputData
,
DWORD
cbOutputData
,
PDWORD
pcbOutputNeeded
);
...
...
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