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
23a232fc
Commit
23a232fc
authored
Nov 27, 2018
by
Pierre Schweitzer
Committed by
Alexandre Julliard
Dec 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpr: Implement support for making connections persistent.
Signed-off-by:
Pierre Schweitzer
<
pierre@reactos.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9b81989b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
1 deletion
+40
-1
wnet.c
dlls/mpr/wnet.c
+40
-1
No files found.
dlls/mpr/wnet.c
View file @
23a232fc
...
@@ -2004,9 +2004,12 @@ static DWORD wnet_use_provider( struct use_connection_context *ctxt, NETRESOURCE
...
@@ -2004,9 +2004,12 @@ static DWORD wnet_use_provider( struct use_connection_context *ctxt, NETRESOURCE
return
ret
;
return
ret
;
}
}
static
const
WCHAR
providerType
[]
=
{
'P'
,
'r'
,
'o'
,
'v'
,
'i'
,
'd'
,
'e'
,
'r'
,
'T'
,
'y'
,
'p'
,
'e'
,
0
};
static
const
WCHAR
userName
[]
=
{
'U'
,
's'
,
'e'
,
'r'
,
'N'
,
'a'
,
'm'
,
'e'
,
0
};
static
DWORD
wnet_use_connection
(
struct
use_connection_context
*
ctxt
)
static
DWORD
wnet_use_connection
(
struct
use_connection_context
*
ctxt
)
{
{
WNetProvider
*
provider
;
WNetProvider
*
provider
=
NULL
;
DWORD
index
,
ret
=
WN_NO_NETWORK
;
DWORD
index
,
ret
=
WN_NO_NETWORK
;
BOOL
redirect
=
FALSE
;
BOOL
redirect
=
FALSE
;
WCHAR
letter
[
3
]
=
{
'Z'
,
':'
,
0
};
WCHAR
letter
[
3
]
=
{
'Z'
,
':'
,
0
};
...
@@ -2060,6 +2063,42 @@ static DWORD wnet_use_connection( struct use_connection_context *ctxt )
...
@@ -2060,6 +2063,42 @@ static DWORD wnet_use_connection( struct use_connection_context *ctxt )
}
}
}
}
if
(
ret
==
WN_SUCCESS
&&
ctxt
->
flags
&
CONNECT_UPDATE_PROFILE
)
{
HKEY
user_profile
;
if
(
netres
.
dwType
==
RESOURCETYPE_PRINT
)
{
FIXME
(
"Persistent connection are not supported for printers
\n
"
);
return
ret
;
}
if
(
RegOpenCurrentUser
(
KEY_ALL_ACCESS
,
&
user_profile
)
==
ERROR_SUCCESS
)
{
HKEY
network
;
WCHAR
subkey
[
10
]
=
{
'N'
,
'e'
,
't'
,
'w'
,
'o'
,
'r'
,
'k'
,
'\\'
,
netres
.
lpLocalName
[
0
],
0
};
if
(
RegCreateKeyExW
(
user_profile
,
subkey
,
0
,
NULL
,
REG_OPTION_NON_VOLATILE
,
KEY_ALL_ACCESS
,
NULL
,
&
network
,
NULL
)
==
ERROR_SUCCESS
)
{
DWORD
dword_arg
=
RESOURCETYPE_DISK
;
DWORD
len
=
(
strlenW
(
provider
->
name
)
+
1
)
*
sizeof
(
WCHAR
);
static
const
WCHAR
empty
[
1
]
=
{
0
};
RegSetValueExW
(
network
,
connectionType
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
dword_arg
,
sizeof
(
DWORD
));
RegSetValueExW
(
network
,
providerName
,
0
,
REG_SZ
,
(
const
BYTE
*
)
provider
->
name
,
len
);
RegSetValueExW
(
network
,
providerType
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
provider
->
dwNetType
,
sizeof
(
DWORD
));
len
=
(
strlenW
(
netres
.
lpRemoteName
)
+
1
)
*
sizeof
(
WCHAR
);
RegSetValueExW
(
network
,
remotePath
,
0
,
REG_SZ
,
(
const
BYTE
*
)
netres
.
lpRemoteName
,
len
);
len
=
sizeof
(
empty
);
RegSetValueExW
(
network
,
userName
,
0
,
REG_SZ
,
(
const
BYTE
*
)
empty
,
len
);
RegCloseKey
(
network
);
}
RegCloseKey
(
user_profile
);
}
}
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