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
b331b1a3
Commit
b331b1a3
authored
Aug 26, 2008
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Aug 27, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Fix results for UrlApplyScheme.
parent
177c2a27
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
url.c
dlls/shlwapi/url.c
+22
-22
No files found.
dlls/shlwapi/url.c
View file @
b331b1a3
...
...
@@ -1504,32 +1504,38 @@ HRESULT WINAPI UrlHashW(LPCWSTR pszUrl, unsigned char *lpDest, DWORD nDestLen)
HRESULT
WINAPI
UrlApplySchemeA
(
LPCSTR
pszIn
,
LPSTR
pszOut
,
LPDWORD
pcchOut
,
DWORD
dwFlags
)
{
LPWSTR
in
,
out
;
DWORD
ret
,
len
,
len2
;
HRESULT
ret
;
DWORD
len
;
TRACE
(
"(in %s, out size %d, flags %08x) using W version
\n
"
,
debugstr_a
(
pszIn
),
*
pcchOut
,
dwFlags
);
TRACE
(
"(%s, %p, %p:out size %d, 0x%08x)
\n
"
,
debugstr_a
(
pszIn
),
pszOut
,
pcchOut
,
pcchOut
?
*
pcchOut
:
0
,
dwFlags
);
if
(
!
pszIn
||
!
pszOut
||
!
pcchOut
)
return
E_INVALIDARG
;
in
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
2
*
INTERNET_MAX_URL_LENGTH
)
*
sizeof
(
WCHAR
));
out
=
in
+
INTERNET_MAX_URL_LENGTH
;
MultiByteToWideChar
(
0
,
0
,
pszIn
,
-
1
,
in
,
INTERNET_MAX_URL_LENGTH
);
MultiByteToWideChar
(
CP_ACP
,
0
,
pszIn
,
-
1
,
in
,
INTERNET_MAX_URL_LENGTH
);
len
=
INTERNET_MAX_URL_LENGTH
;
ret
=
UrlApplySchemeW
(
in
,
out
,
&
len
,
dwFlags
);
if
(
(
ret
!=
S_OK
)
&&
(
ret
!=
S_FALSE
)
)
{
if
(
ret
!=
S_OK
)
{
HeapFree
(
GetProcessHeap
(),
0
,
in
);
return
ret
;
}
len2
=
WideCharToMultiByte
(
0
,
0
,
out
,
len
+
1
,
0
,
0
,
0
,
0
);
if
(
len2
>
*
pcchOut
)
{
*
pcchOut
=
len2
;
HeapFree
(
GetProcessHeap
(),
0
,
in
);
return
E_POINTER
;
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
out
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
len
>
*
pcchOut
)
{
ret
=
E_POINTER
;
goto
cleanup
;
}
WideCharToMultiByte
(
0
,
0
,
out
,
len
+
1
,
pszOut
,
*
pcchOut
,
0
,
0
);
*
pcchOut
=
len2
;
WideCharToMultiByte
(
CP_ACP
,
0
,
out
,
-
1
,
pszOut
,
*
pcchOut
,
NULL
,
NULL
);
len
--
;
cleanup:
*
pcchOut
=
len
;
HeapFree
(
GetProcessHeap
(),
0
,
in
);
return
ret
;
}
...
...
@@ -1623,8 +1629,10 @@ HRESULT WINAPI UrlApplySchemeW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut, DW
DWORD
res1
;
HRESULT
ret
;
TRACE
(
"(in %s, out size %d, flags %08x)
\n
"
,
debugstr_w
(
pszIn
),
*
pcchOut
,
dwFlags
);
TRACE
(
"(%s, %p, %p:out size %d, 0x%08x)
\n
"
,
debugstr_w
(
pszIn
),
pszOut
,
pcchOut
,
pcchOut
?
*
pcchOut
:
0
,
dwFlags
);
if
(
!
pszIn
||
!
pszOut
||
!
pcchOut
)
return
E_INVALIDARG
;
if
(
dwFlags
&
URL_APPLY_GUESSFILE
)
{
FIXME
(
"(%s %p %p(%d) 0x%08x): stub URL_APPLY_GUESSFILE not implemented
\n
"
,
...
...
@@ -1669,14 +1677,6 @@ HRESULT WINAPI UrlApplySchemeW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut, DW
return
URL_ApplyDefault
(
pszIn
,
pszOut
,
pcchOut
);
}
/* just copy and give proper return code */
if
(
strlenW
(
pszIn
)
+
1
>
*
pcchOut
)
{
*
pcchOut
=
strlenW
(
pszIn
)
+
1
;
return
E_POINTER
;
}
strcpyW
(
pszOut
,
pszIn
);
*
pcchOut
=
strlenW
(
pszOut
);
TRACE
(
"returning copy, left alone
\n
"
);
return
S_FALSE
;
}
...
...
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