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
9b43174f
Commit
9b43174f
authored
Oct 12, 2007
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Oct 16, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Fix flags and SetLastError for InternetCanonicalizeUrlA/W.
parent
1d87649f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
24 deletions
+42
-24
internet.c
dlls/wininet/internet.c
+42
-22
internet.c
dlls/wininet/tests/internet.c
+0
-2
No files found.
dlls/wininet/internet.c
View file @
9b43174f
...
...
@@ -1506,32 +1506,41 @@ BOOL WINAPI InternetCanonicalizeUrlA(LPCSTR lpszUrl, LPSTR lpszBuffer,
LPDWORD
lpdwBufferLength
,
DWORD
dwFlags
)
{
HRESULT
hr
;
DWORD
dwURLFlags
=
0x80000000
;
/* Don't know what this means */
DWORD
dwURLFlags
=
URL_WININET_COMPATIBILITY
|
URL_ESCAPE_UNSAFE
;
TRACE
(
"(%s, %p, %p, 0x%08x) bufferlength: %d
\n
"
,
debugstr_a
(
lpszUrl
),
lpszBuffer
,
lpdwBufferLength
,
lpdwBufferLength
?
*
lpdwBufferLength
:
-
1
,
dwFlags
);
if
(
dwFlags
&
ICU_DECODE
)
{
dwURLFlags
|=
URL_UNESCAPE
;
dwFlags
&=
~
ICU_DECODE
;
dwURLFlags
|=
URL_UNESCAPE
;
dwFlags
&=
~
ICU_DECODE
;
}
if
(
dwFlags
&
ICU_ESCAPE
)
{
dwURLFlags
|=
URL_UNESCAPE
;
dwFlags
&=
~
ICU_ESCAPE
;
dwURLFlags
|=
URL_UNESCAPE
;
dwFlags
&=
~
ICU_ESCAPE
;
}
if
(
dwFlags
&
ICU_BROWSER_MODE
)
{
dwURLFlags
|=
URL_BROWSER_MODE
;
dwFlags
&=
~
ICU_BROWSER_MODE
;
}
if
(
dwFlags
)
FIXME
(
"Unhandled flags 0x%08x
\n
"
,
dwFlags
);
TRACE
(
"%s %p %p %08x
\n
"
,
debugstr_a
(
lpszUrl
),
lpszBuffer
,
lpdwBufferLength
,
dwURLFlags
);
/* Flip this bit to correspond to URL_ESCAPE_UNSAFE */
dwFlags
^=
ICU_NO_ENCODE
;
if
(
dwFlags
&
ICU_NO_ENCODE
)
{
/* Flip this bit to correspond to URL_ESCAPE_UNSAFE */
dwURLFlags
^=
URL_ESCAPE_UNSAFE
;
dwFlags
&=
~
ICU_NO_ENCODE
;
}
if
(
dwFlags
)
FIXME
(
"Unhandled flags 0x%08x
\n
"
,
dwFlags
);
hr
=
UrlCanonicalizeA
(
lpszUrl
,
lpszBuffer
,
lpdwBufferLength
,
dwURLFlags
);
if
(
hr
==
E_POINTER
)
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
if
(
hr
==
E_INVALIDARG
)
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
(
hr
==
S_OK
)
?
TRUE
:
FALSE
;
}
...
...
@@ -1550,36 +1559,47 @@ BOOL WINAPI InternetCanonicalizeUrlW(LPCWSTR lpszUrl, LPWSTR lpszBuffer,
LPDWORD
lpdwBufferLength
,
DWORD
dwFlags
)
{
HRESULT
hr
;
DWORD
dwURLFlags
=
0x80000000
;
/* Don't know what this means */
DWORD
dwURLFlags
=
URL_WININET_COMPATIBILITY
|
URL_ESCAPE_UNSAFE
;
TRACE
(
"(%s, %p, %p, 0x%08x) bufferlength: %d
\n
"
,
debugstr_w
(
lpszUrl
),
lpszBuffer
,
lpdwBufferLength
,
lpdwBufferLength
?
*
lpdwBufferLength
:
-
1
,
dwFlags
);
if
(
dwFlags
&
ICU_DECODE
)
{
dwURLFlags
|=
URL_UNESCAPE
;
dwFlags
&=
~
ICU_DECODE
;
dwURLFlags
|=
URL_UNESCAPE
;
dwFlags
&=
~
ICU_DECODE
;
}
if
(
dwFlags
&
ICU_ESCAPE
)
{
dwURLFlags
|=
URL_UNESCAPE
;
dwFlags
&=
~
ICU_ESCAPE
;
dwURLFlags
|=
URL_UNESCAPE
;
dwFlags
&=
~
ICU_ESCAPE
;
}
if
(
dwFlags
&
ICU_BROWSER_MODE
)
{
dwURLFlags
|=
URL_BROWSER_MODE
;
dwFlags
&=
~
ICU_BROWSER_MODE
;
}
if
(
dwFlags
)
FIXME
(
"Unhandled flags 0x%08x
\n
"
,
dwFlags
);
TRACE
(
"%s %p %p %08x
\n
"
,
debugstr_w
(
lpszUrl
),
lpszBuffer
,
lpdwBufferLength
,
dwURLFlags
);
/* Flip this bit to correspond to URL_ESCAPE_UNSAFE */
dwFlags
^=
ICU_NO_ENCODE
;
if
(
dwFlags
&
ICU_NO_ENCODE
)
{
/* Flip this bit to correspond to URL_ESCAPE_UNSAFE */
dwURLFlags
^=
URL_ESCAPE_UNSAFE
;
dwFlags
&=
~
ICU_NO_ENCODE
;
}
if
(
dwFlags
)
FIXME
(
"Unhandled flags 0x%08x
\n
"
,
dwFlags
);
hr
=
UrlCanonicalizeW
(
lpszUrl
,
lpszBuffer
,
lpdwBufferLength
,
dwURLFlags
);
if
(
hr
==
E_POINTER
)
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
if
(
hr
==
E_INVALIDARG
)
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
(
hr
==
S_OK
)
?
TRUE
:
FALSE
;
}
/* #################################################### */
static
INTERNET_STATUS_CALLBACK
set_status_callback
(
LPWININETHANDLEHEADER
lpwh
,
INTERNET_STATUS_CALLBACK
callback
,
BOOL
unicode
)
{
...
...
dlls/wininet/tests/internet.c
View file @
9b43174f
...
...
@@ -46,7 +46,6 @@ static void test_InternetCanonicalizeUrlA(void)
dwSize
=
1
;
/* Acrobat Updater use this size */
SetLastError
(
0xdeadbeef
);
res
=
InternetCanonicalizeUrlA
(
url
,
buffer
,
&
dwSize
,
0
);
todo_wine
ok
(
!
res
&&
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
)
&&
(
dwSize
==
(
urllen
+
1
)),
"got %u and %u with size %u for '%s' (%d)
\n
"
,
res
,
GetLastError
(),
dwSize
,
buffer
,
lstrlenA
(
buffer
));
...
...
@@ -59,7 +58,6 @@ static void test_InternetCanonicalizeUrlA(void)
SetLastError
(
0xdeadbeef
);
res
=
InternetCanonicalizeUrlA
(
url
,
buffer
,
&
dwSize
,
0
);
/* dwSize is nr. of needed bytes with the terminating '\0' */
todo_wine
ok
(
!
res
&&
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
)
&&
(
dwSize
==
(
urllen
+
1
)),
"got %u and %u with size %u for '%s' (%d)
\n
"
,
res
,
GetLastError
(),
dwSize
,
buffer
,
lstrlenA
(
buffer
));
...
...
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