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
25e78e04
Commit
25e78e04
authored
Mar 22, 2017
by
Hans Leidekker
Committed by
Alexandre Julliard
Mar 22, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpr/tests: Try other drive letters if J: is already assigned.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
49b644d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
41 deletions
+43
-41
mpr.c
dlls/mpr/tests/mpr.c
+43
-41
No files found.
dlls/mpr/tests/mpr.c
View file @
25e78e04
...
...
@@ -261,54 +261,56 @@ static void test_WNetCachePassword(void)
static
void
test_WNetUseConnection
(
void
)
{
DWORD
ret
;
DWORD
bufSize
;
DWORD
outRes
;
DWORD
ret
,
bufSize
,
outRes
;
LPNETRESOURCEA
netRes
;
CHAR
outBuf
[
4
]
;
char
outBuf
[
4
],
drive
[]
=
"J:"
,
letter
;
if
(
pWNetUseConnectionA
)
if
(
!
pWNetUseConnectionA
)
{
netRes
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
NETRESOURCEA
)
+
sizeof
(
"
\\\\
127.0.0.1
\\
c$"
)
+
sizeof
(
"J:"
));
netRes
->
dwType
=
RESOURCETYPE_DISK
;
netRes
->
dwDisplayType
=
RESOURCEDISPLAYTYPE_SHARE
;
netRes
->
dwUsage
=
RESOURCEUSAGE_CONNECTABLE
;
netRes
->
lpLocalName
=
(
LPSTR
)((
LPBYTE
)
netRes
+
sizeof
(
NETRESOURCEA
));
netRes
->
lpRemoteName
=
(
LPSTR
)((
LPBYTE
)
netRes
+
sizeof
(
NETRESOURCEA
)
+
sizeof
(
"J:"
));
strcpy
(
netRes
->
lpLocalName
,
"J:"
);
win_skip
(
"WNetUseConnection() is not supported.
\n
"
);
return
;
}
netRes
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
NETRESOURCEA
)
+
sizeof
(
"
\\\\
127.0.0.1
\\
c$"
)
+
sizeof
(
"J:"
));
netRes
->
dwType
=
RESOURCETYPE_DISK
;
netRes
->
dwDisplayType
=
RESOURCEDISPLAYTYPE_SHARE
;
netRes
->
dwUsage
=
RESOURCEUSAGE_CONNECTABLE
;
netRes
->
lpLocalName
=
(
LPSTR
)((
LPBYTE
)
netRes
+
sizeof
(
NETRESOURCEA
));
netRes
->
lpRemoteName
=
(
LPSTR
)((
LPBYTE
)
netRes
+
sizeof
(
NETRESOURCEA
)
+
sizeof
(
"J:"
));
for
(
letter
=
'J'
;
letter
<=
'Z'
;
letter
++
)
{
drive
[
0
]
=
letter
;
strcpy
(
netRes
->
lpLocalName
,
drive
);
strcpy
(
netRes
->
lpRemoteName
,
"
\\\\
127.0.0.1
\\
c$"
);
bufSize
=
0
;
ret
=
pWNetUseConnectionA
(
NULL
,
netRes
,
NULL
,
NULL
,
0
,
NULL
,
&
bufSize
,
&
outRes
);
todo_wine
ok
(
ret
==
WN_SUCCESS
,
"Unexpected return: %u
\n
"
,
ret
);
ok
(
bufSize
==
0
,
"Unexpected buffer size: %u
\n
"
,
bufSize
);
if
(
ret
==
WN_SUCCESS
)
WNetCancelConnectionA
(
"J:"
,
TRUE
);
bufSize
=
0
;
ret
=
pWNetUseConnectionA
(
NULL
,
netRes
,
NULL
,
NULL
,
0
,
outBuf
,
&
bufSize
,
&
outRes
);
todo_wine
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"Unexpected return: %u
\n
"
,
ret
);
ok
(
bufSize
==
0
,
"Unexpected buffer size: %u
\n
"
,
bufSize
);
if
(
ret
==
WN_SUCCESS
)
WNetCancelConnectionA
(
"J:"
,
TRUE
);
bufSize
=
1
;
todo_wine
{
ret
=
pWNetUseConnectionA
(
NULL
,
netRes
,
NULL
,
NULL
,
0
,
outBuf
,
&
bufSize
,
&
outRes
);
ok
(
ret
==
ERROR_MORE_DATA
,
"Unexpected return: %u
\n
"
,
ret
);
ok
(
bufSize
==
3
,
"Unexpected buffer size: %u
\n
"
,
bufSize
);
if
(
ret
==
WN_SUCCESS
)
WNetCancelConnectionA
(
"J:"
,
TRUE
);
bufSize
=
4
;
ret
=
pWNetUseConnectionA
(
NULL
,
netRes
,
NULL
,
NULL
,
0
,
outBuf
,
&
bufSize
,
&
outRes
);
ok
(
ret
==
WN_SUCCESS
,
"Unexpected return: %u
\n
"
,
ret
);
}
ok
(
bufSize
==
4
,
"Unexpected buffer size: %u
\n
"
,
bufSize
);
if
(
ret
==
WN_SUCCESS
)
WNetCancelConnectionA
(
"J:"
,
TRUE
);
HeapFree
(
GetProcessHeap
(),
0
,
netRes
);
}
else
{
win_skip
(
"WNetUseConnection() is not supported.
\n
"
);
if
(
ret
==
ERROR_ALREADY_ASSIGNED
)
continue
;
}
todo_wine
ok
(
ret
==
WN_SUCCESS
,
"Unexpected return: %u
\n
"
,
ret
);
ok
(
bufSize
==
0
,
"Unexpected buffer size: %u
\n
"
,
bufSize
);
if
(
ret
==
WN_SUCCESS
)
WNetCancelConnectionA
(
drive
,
TRUE
);
bufSize
=
0
;
ret
=
pWNetUseConnectionA
(
NULL
,
netRes
,
NULL
,
NULL
,
0
,
outBuf
,
&
bufSize
,
&
outRes
);
todo_wine
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"Unexpected return: %u
\n
"
,
ret
);
ok
(
bufSize
==
0
,
"Unexpected buffer size: %u
\n
"
,
bufSize
);
if
(
ret
==
WN_SUCCESS
)
WNetCancelConnectionA
(
drive
,
TRUE
);
todo_wine
{
bufSize
=
1
;
ret
=
pWNetUseConnectionA
(
NULL
,
netRes
,
NULL
,
NULL
,
0
,
outBuf
,
&
bufSize
,
&
outRes
);
ok
(
ret
==
ERROR_MORE_DATA
,
"Unexpected return: %u
\n
"
,
ret
);
ok
(
bufSize
==
3
,
"Unexpected buffer size: %u
\n
"
,
bufSize
);
if
(
ret
==
WN_SUCCESS
)
WNetCancelConnectionA
(
drive
,
TRUE
);
bufSize
=
4
;
ret
=
pWNetUseConnectionA
(
NULL
,
netRes
,
NULL
,
NULL
,
0
,
outBuf
,
&
bufSize
,
&
outRes
);
ok
(
ret
==
WN_SUCCESS
,
"Unexpected return: %u
\n
"
,
ret
);
}
ok
(
bufSize
==
4
,
"Unexpected buffer size: %u
\n
"
,
bufSize
);
if
(
ret
==
WN_SUCCESS
)
WNetCancelConnectionA
(
drive
,
TRUE
);
HeapFree
(
GetProcessHeap
(),
0
,
netRes
);
}
START_TEST
(
mpr
)
...
...
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