Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
5ba0e02b
Commit
5ba0e02b
authored
Aug 23, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use WNetAddConnection2 directly
parent
efa68b29
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
22 deletions
+13
-22
modules/access/Modules.am
modules/access/Modules.am
+12
-3
modules/access/smb.c
modules/access/smb.c
+1
-19
No files found.
modules/access/Modules.am
View file @
5ba0e02b
...
...
@@ -34,13 +34,21 @@ libsdp_plugin_la_CFLAGS = $(AM_CFLAGS)
libsdp_plugin_la_LIBADD = $(AM_LIBADD)
libsdp_plugin_la_DEPENDENCIES =
libaccess_smb_plugin_la_SOURCES = smb.c
libaccess_smb_plugin_la_CFLAGS = $(AM_CFLAGS)
libaccess_smb_plugin_la_LIBADD = $(AM_LIBADD)
if HAVE_WIN32
libaccess_smb_plugin_la_LIBADD += -lmpr
endif
libaccess_smb_plugin_la_DEPENDENCIES =
libvlc_LTLIBRARIES += $(LTLIBaccess_smb)
SOURCES_access_directory = directory.c
SOURCES_access_dv = dv.c
SOURCES_access_udp = udp.c
SOURCES_access_tcp = tcp.c
SOURCES_access_http = http.c
SOURCES_access_ftp = ftp.c
SOURCES_access_smb = smb.c
SOURCES_access_gnomevfs = gnomevfs.c
SOURCES_access_eyetv = eyetv.m
SOURCES_dvdnav = dvdnav.c
...
...
@@ -175,7 +183,8 @@ libvlc_LTLIBRARIES += libdtv_plugin.la
endif
EXTRA_LTLIBRARIES += \
libaccess_rtmp_plugin.la \
libaccess_shm_plugin.la
libaccess_shm_plugin.la \
libaccess_smb_plugin.la \
$(NULL)
modules/access/smb.c
View file @
5ba0e02b
...
...
@@ -363,28 +363,12 @@ static void Win32AddConnection( access_t *p_access, char *psz_path,
char
*
psz_user
,
char
*
psz_pwd
,
char
*
psz_domain
)
{
DWORD
WINAPI
(
*
OurWNetAddConnection2
)(
LPNETRESOURCE
,
LPCTSTR
,
LPCTSTR
,
DWORD
);
char
psz_remote
[
MAX_PATH
],
psz_server
[
MAX_PATH
],
psz_share
[
MAX_PATH
];
NETRESOURCE
net_resource
;
DWORD
i_result
;
char
*
psz_parser
;
VLC_UNUSED
(
psz_domain
);
HINSTANCE
hdll
=
LoadLibrary
(
_T
(
"MPR.DLL"
));
if
(
!
hdll
)
{
msg_Warn
(
p_access
,
"couldn't load mpr.dll"
);
return
;
}
OurWNetAddConnection2
=
(
void
*
)
GetProcAddress
(
hdll
,
_T
(
"WNetAddConnection2A"
)
);
if
(
!
OurWNetAddConnection2
)
{
msg_Warn
(
p_access
,
"couldn't find WNetAddConnection2 in mpr.dll"
);
return
;
}
memset
(
&
net_resource
,
0
,
sizeof
(
net_resource
)
);
net_resource
.
dwType
=
RESOURCETYPE_DISK
;
...
...
@@ -402,7 +386,7 @@ static void Win32AddConnection( access_t *p_access, char *psz_path,
snprintf
(
psz_remote
,
sizeof
(
psz_remote
),
"
\\\\
%s
\\
%s"
,
psz_server
,
psz_share
);
net_resource
.
lpRemoteName
=
psz_remote
;
i_result
=
Our
WNetAddConnection2
(
&
net_resource
,
psz_pwd
,
psz_user
,
0
);
i_result
=
WNetAddConnection2
(
&
net_resource
,
psz_pwd
,
psz_user
,
0
);
if
(
i_result
!=
NO_ERROR
)
{
...
...
@@ -417,7 +401,5 @@ static void Win32AddConnection( access_t *p_access, char *psz_path,
{
msg_Dbg
(
p_access
,
"failed to connect to %s"
,
psz_remote
);
}
FreeLibrary
(
hdll
);
}
#endif // WIN32
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