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
a65c31e4
Commit
a65c31e4
authored
Aug 10, 2016
by
Pierre Schweitzer
Committed by
Alexandre Julliard
Aug 11, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpr: Implement provider selection given remote name.
Signed-off-by:
Pierre Schweitzer
<
pierre@reactos.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b452e628
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
28 deletions
+44
-28
wnet.c
dlls/mpr/wnet.c
+44
-28
No files found.
dlls/mpr/wnet.c
View file @
a65c31e4
...
@@ -1617,10 +1617,36 @@ static void use_connection_set_accessnameW(struct use_connection_context *ctxt,
...
@@ -1617,10 +1617,36 @@ static void use_connection_set_accessnameW(struct use_connection_context *ctxt,
strcpyW
(
accessname
,
ctxt
->
resource
->
lpRemoteName
);
strcpyW
(
accessname
,
ctxt
->
resource
->
lpRemoteName
);
}
}
static
DWORD
wnet_use_provider
(
struct
use_connection_context
*
ctxt
,
NETRESOURCEW
*
netres
,
WNetProvider
*
provider
,
BOOLEAN
redirect
)
{
DWORD
caps
,
ret
;
caps
=
provider
->
getCaps
(
WNNC_CONNECTION
);
if
(
!
(
caps
&
(
WNNC_CON_ADDCONNECTION
|
WNNC_CON_ADDCONNECTION3
)))
return
ERROR_BAD_PROVIDER
;
ret
=
WN_ACCESS_DENIED
;
do
{
if
((
caps
&
WNNC_CON_ADDCONNECTION3
)
&&
provider
->
addConnection3
)
ret
=
provider
->
addConnection3
(
ctxt
->
hwndOwner
,
netres
,
ctxt
->
password
,
ctxt
->
userid
,
ctxt
->
flags
);
else
if
((
caps
&
WNNC_CON_ADDCONNECTION
)
&&
provider
->
addConnection
)
ret
=
provider
->
addConnection
(
netres
,
ctxt
->
password
,
ctxt
->
userid
);
if
(
ret
==
WN_ALREADY_CONNECTED
&&
redirect
)
netres
->
lpLocalName
[
0
]
-=
1
;
}
while
(
redirect
&&
ret
==
WN_ALREADY_CONNECTED
&&
netres
->
lpLocalName
[
0
]
>=
'C'
);
if
(
ret
==
WN_SUCCESS
&&
ctxt
->
accessname
)
ctxt
->
set_accessname
(
ctxt
,
netres
->
lpLocalName
);
return
ret
;
}
static
DWORD
wnet_use_connection
(
struct
use_connection_context
*
ctxt
)
static
DWORD
wnet_use_connection
(
struct
use_connection_context
*
ctxt
)
{
{
WNetProvider
*
provider
;
WNetProvider
*
provider
;
DWORD
index
,
ret
,
caps
;
DWORD
index
,
ret
=
WN_NO_NETWORK
;
BOOL
redirect
=
FALSE
;
BOOL
redirect
=
FALSE
;
WCHAR
letter
[
3
]
=
{
'Z'
,
':'
,
0
};
WCHAR
letter
[
3
]
=
{
'Z'
,
':'
,
0
};
NETRESOURCEW
netres
;
NETRESOURCEW
netres
;
...
@@ -1647,41 +1673,31 @@ static DWORD wnet_use_connection( struct use_connection_context *ctxt )
...
@@ -1647,41 +1673,31 @@ static DWORD wnet_use_connection( struct use_connection_context *ctxt )
netres
.
lpLocalName
=
letter
;
netres
.
lpLocalName
=
letter
;
}
}
if
(
!
netres
.
lpProvider
)
{
FIXME
(
"Networking provider selection is not implemented.
\n
"
);
return
WN_NO_NETWORK
;
}
if
(
ctxt
->
flags
&
CONNECT_INTERACTIVE
)
if
(
ctxt
->
flags
&
CONNECT_INTERACTIVE
)
return
ERROR_BAD_NET_NAME
;
return
ERROR_BAD_NET_NAME
;
index
=
_findProviderIndexW
(
netres
.
lpProvider
);
if
(
index
==
BAD_PROVIDER_INDEX
)
return
ERROR_BAD_PROVIDER
;
provider
=
&
providerTable
->
table
[
index
];
caps
=
provider
->
getCaps
(
WNNC_CONNECTION
);
if
(
!
(
caps
&
(
WNNC_CON_ADDCONNECTION
|
WNNC_CON_ADDCONNECTION3
)))
return
ERROR_BAD_PROVIDER
;
if
((
ret
=
ctxt
->
pre_set_accessname
(
ctxt
,
netres
.
lpLocalName
)))
if
((
ret
=
ctxt
->
pre_set_accessname
(
ctxt
,
netres
.
lpLocalName
)))
return
ret
;
return
ret
;
ret
=
WN_ACCESS_DENIED
;
if
(
netres
.
lpProvider
)
do
{
{
if
((
caps
&
WNNC_CON_ADDCONNECTION3
)
&&
provider
->
addConnection3
)
index
=
_findProviderIndexW
(
netres
.
lpProvider
);
ret
=
provider
->
addConnection3
(
ctxt
->
hwndOwner
,
&
netres
,
ctxt
->
password
,
ctxt
->
userid
,
ctxt
->
flags
);
if
(
index
==
BAD_PROVIDER_INDEX
)
else
if
((
caps
&
WNNC_CON_ADDCONNECTION
)
&&
provider
->
addConnection
)
return
ERROR_BAD_PROVIDER
;
ret
=
provider
->
addConnection
(
&
netres
,
ctxt
->
password
,
ctxt
->
userid
);
if
(
ret
!=
NO_ERROR
&&
redirect
)
provider
=
&
providerTable
->
table
[
index
];
letter
[
0
]
-=
1
;
ret
=
wnet_use_provider
(
ctxt
,
&
netres
,
provider
,
redirect
);
}
while
(
redirect
&&
ret
==
WN_ALREADY_CONNECTED
&&
letter
[
0
]
>=
'C'
);
}
else
if
(
ret
==
WN_SUCCESS
&&
ctxt
->
accessname
)
{
ctxt
->
set_accessname
(
ctxt
,
netres
.
lpLocalName
);
for
(
index
=
0
;
index
<
providerTable
->
numProviders
;
index
++
)
{
provider
=
&
providerTable
->
table
[
index
];
ret
=
wnet_use_provider
(
ctxt
,
&
netres
,
provider
,
redirect
);
if
(
ret
==
WN_SUCCESS
||
ret
==
WN_ALREADY_CONNECTED
)
break
;
}
}
return
ret
;
return
ret
;
}
}
...
...
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