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
2e9a2d80
Commit
2e9a2d80
authored
Jul 24, 2015
by
Hans Leidekker
Committed by
Alexandre Julliard
Jul 28, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netapi32: Implement DavGetHTTPFromUNCPath.
parent
be7373f7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
92 additions
and
0 deletions
+92
-0
netapi32.c
dlls/netapi32/netapi32.c
+90
-0
netapi32.spec
dlls/netapi32/netapi32.spec
+1
-0
access.c
dlls/netapi32/tests/access.c
+0
-0
davclnt.h
include/davclnt.h
+1
-0
No files found.
dlls/netapi32/netapi32.c
View file @
2e9a2d80
...
...
@@ -51,6 +51,7 @@
#include "winnls.h"
#include "dsrole.h"
#include "dsgetdc.h"
#include "davclnt.h"
#include "wine/debug.h"
#include "wine/library.h"
#include "wine/list.h"
...
...
@@ -3347,3 +3348,92 @@ NET_API_STATUS WINAPI NetLocalGroupSetMembers(
debugstr_w
(
groupname
),
level
,
buf
,
totalentries
);
return
NERR_Success
;
}
/************************************************************
* DavGetHTTPFromUNCPath (NETAPI32.@)
*/
DWORD
WINAPI
DavGetHTTPFromUNCPath
(
const
WCHAR
*
unc_path
,
WCHAR
*
buf
,
DWORD
*
buflen
)
{
static
const
WCHAR
httpW
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
0
};
static
const
WCHAR
httpsW
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
's'
,
':'
,
'/'
,
'/'
,
0
};
static
const
WCHAR
sslW
[]
=
{
'S'
,
'S'
,
'L'
,
0
};
static
const
WCHAR
fmtW
[]
=
{
':'
,
'%'
,
'u'
,
0
};
const
WCHAR
*
p
=
unc_path
,
*
q
,
*
server
,
*
path
,
*
scheme
=
httpW
;
UINT
i
,
len_server
,
len_path
=
0
,
len_port
=
0
,
len
,
port
=
0
;
WCHAR
*
end
,
portbuf
[
12
];
TRACE
(
"(%s %p %p)
\n
"
,
debugstr_w
(
unc_path
),
buf
,
buflen
);
if
(
p
[
0
]
!=
'\\'
||
p
[
1
]
!=
'\\'
||
!
p
[
2
])
return
ERROR_INVALID_PARAMETER
;
q
=
p
+=
2
;
while
(
*
q
&&
*
q
!=
'\\'
&&
*
q
!=
'/'
&&
*
q
!=
'@'
)
q
++
;
server
=
p
;
len_server
=
q
-
p
;
if
(
*
q
==
'@'
)
{
p
=
++
q
;
while
(
*
p
&&
(
*
p
!=
'\\'
&&
*
p
!=
'/'
&&
*
p
!=
'@'
))
p
++
;
if
(
p
-
q
==
3
&&
!
memicmpW
(
q
,
sslW
,
3
))
{
scheme
=
httpsW
;
q
=
p
;
}
else
if
((
port
=
strtolW
(
q
,
&
end
,
10
)))
q
=
end
;
else
return
ERROR_INVALID_PARAMETER
;
}
if
(
*
q
==
'@'
)
{
if
(
!
(
port
=
strtolW
(
++
q
,
&
end
,
10
)))
return
ERROR_INVALID_PARAMETER
;
q
=
end
;
}
if
(
*
q
==
'\\'
||
*
q
==
'/'
)
q
++
;
path
=
q
;
while
(
*
q
++
)
len_path
++
;
if
(
len_path
&&
(
path
[
len_path
-
1
]
==
'\\'
||
path
[
len_path
-
1
]
==
'/'
))
len_path
--
;
/* remove trailing slash */
sprintfW
(
portbuf
,
fmtW
,
port
);
if
(
scheme
==
httpsW
)
{
len
=
strlenW
(
httpsW
);
if
(
port
&&
port
!=
443
)
len_port
=
strlenW
(
portbuf
);
}
else
{
len
=
strlenW
(
httpW
);
if
(
port
&&
port
!=
80
)
len_port
=
strlenW
(
portbuf
);
}
len
+=
len_server
;
len
+=
len_port
;
if
(
len_path
)
len
+=
len_path
+
1
;
/* leading '/' */
len
++
;
/* nul */
if
(
*
buflen
<
len
)
{
*
buflen
=
len
;
return
ERROR_INSUFFICIENT_BUFFER
;
}
memcpy
(
buf
,
scheme
,
strlenW
(
scheme
)
*
sizeof
(
WCHAR
)
);
buf
+=
strlenW
(
scheme
);
memcpy
(
buf
,
server
,
len_server
*
sizeof
(
WCHAR
)
);
buf
+=
len_server
;
if
(
len_port
)
{
memcpy
(
buf
,
portbuf
,
len_port
*
sizeof
(
WCHAR
)
);
buf
+=
len_port
;
}
if
(
len_path
)
{
*
buf
++
=
'/'
;
for
(
i
=
0
;
i
<
len_path
;
i
++
)
{
if
(
path
[
i
]
==
'\\'
)
*
buf
++
=
'/'
;
else
*
buf
++
=
path
[
i
];
}
}
*
buf
=
0
;
*
buflen
=
len
;
return
ERROR_SUCCESS
;
}
dlls/netapi32/netapi32.spec
View file @
2e9a2d80
@ stdcall DavGetHTTPFromUNCPath(wstr ptr ptr)
@ stub DsAddressToSiteNames
@ stub DsAddressToSiteNamesEx
@ stub DsDeregisterDnsHostRecords
...
...
dlls/netapi32/tests/access.c
View file @
2e9a2d80
This diff is collapsed.
Click to expand it.
include/davclnt.h
View file @
2e9a2d80
...
...
@@ -65,6 +65,7 @@ typedef DWORD (*PFNDAVAUTHCALLBACK_FREECRED)
typedef
DWORD
(
*
PFNDAVAUTHCALLBACK
)
(
LPWSTR
,
LPWSTR
,
DWORD
,
DWORD
,
PDAV_CALLBACK_CRED
,
AUTHNEXTSTEP
*
,
PFNDAVAUTHCALLBACK_FREECRED
*
);
DWORD
WINAPI
DavGetHTTPFromUNCPath
(
LPCWSTR
,
LPWSTR
,
LPDWORD
);
OPAQUE_HANDLE
WINAPI
DavRegisterAuthCallback
(
PFNDAVAUTHCALLBACK
,
ULONG
);
VOID
WINAPI
DavUnregisterAuthCallback
(
OPAQUE_HANDLE
);
...
...
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