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
3590a422
Commit
3590a422
authored
Nov 11, 2008
by
Aric Stewart
Committed by
Alexandre Julliard
Nov 12, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Correct another difference between InternetCrackurl and WinHttpCrackUrl.
parent
cc1cbade
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
1 deletion
+90
-1
request.c
dlls/winhttp/request.c
+1
-1
url.c
dlls/winhttp/tests/url.c
+77
-0
url.c
dlls/winhttp/url.c
+12
-0
No files found.
dlls/winhttp/request.c
View file @
3590a422
...
...
@@ -1104,7 +1104,7 @@ static BOOL handle_redirect( request_t *request )
heap_free
(
request
->
path
);
request
->
path
=
NULL
;
if
(
uc
.
lpszUrlPa
th
)
if
(
uc
.
dwUrlPathLeng
th
)
{
len
=
uc
.
dwUrlPathLength
+
uc
.
dwExtraInfoLength
;
if
(
!
(
request
->
path
=
heap_alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
goto
end
;
...
...
dlls/winhttp/tests/url.c
View file @
3590a422
...
...
@@ -60,6 +60,13 @@ static const WCHAR url9[] =
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'u'
,
's'
,
'e'
,
'r'
,
'n'
,
'a'
,
'm'
,
'e'
,
':'
,
'p'
,
'a'
,
's'
,
's'
,
'w'
,
'o'
,
'r'
,
'd'
,
'@'
,
'w'
,
'w'
,
'w'
,
'.'
,
'w'
,
'i'
,
'n'
,
'e'
,
'h'
,
'q'
,
'.'
,
'o'
,
'r'
,
'g'
,
':'
,
'0'
,
'/'
,
's'
,
'i'
,
't'
,
'e'
,
'/'
,
'a'
,
'b'
,
'o'
,
'u'
,
't'
,
'?'
,
'q'
,
'u'
,
'e'
,
'r'
,
'y'
,
0
};
static
const
WCHAR
url_k1
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'u'
,
's'
,
'e'
,
'r'
,
'n'
,
'a'
,
'm'
,
'e'
,
':'
,
'p'
,
'a'
,
's'
,
's'
,
'w'
,
'o'
,
'r'
,
'd'
,
'@'
,
'w'
,
'w'
,
'w'
,
'.'
,
'w'
,
'i'
,
'n'
,
'e'
,
'h'
,
'q'
,
'.'
,
'o'
,
'r'
,
'g'
,
'/'
,
's'
,
'i'
,
't'
,
'e'
,
'/'
,
'a'
,
'b'
,
'o'
,
'u'
,
't'
,
0
};
static
const
WCHAR
url_k2
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'w'
,
'w'
,
'w'
,
'.'
,
'w'
,
'i'
,
'n'
,
'e'
,
'h'
,
'q'
,
'.'
,
'o'
,
'r'
,
'g'
,
0
};
static
void
fill_url_components
(
URL_COMPONENTS
*
uc
)
{
uc
->
dwStructSize
=
sizeof
(
URL_COMPONENTS
);
...
...
@@ -269,7 +276,77 @@ static void WinHttpCreateUrl_test( void )
HeapFree
(
GetProcessHeap
(),
0
,
url
);
}
static
void
WinHttpCrackUrl_test
(
void
)
{
URL_COMPONENTSW
uc
;
DWORD
Len
=
0
;
BOOL
ret
;
/* NULL components */
SetLastError
(
0xdeadbeef
);
memset
(
&
uc
,
0
,
sizeof
(
uc
));
uc
.
dwStructSize
=
sizeof
(
URL_COMPONENTSW
);
uc
.
dwSchemeLength
=
-
1
;
uc
.
dwHostNameLength
=
-
1
;
uc
.
dwUserNameLength
=
-
1
;
uc
.
dwPasswordLength
=
-
1
;
uc
.
dwUrlPathLength
=
-
1
;
uc
.
dwExtraInfoLength
=
-
1
;
ret
=
WinHttpCrackUrl
(
url_k1
,
0
,
0
,
&
uc
);
Len
=
0
;
ok
(
ret
!=
0
,
"WinHttpCrackUrl failed
\n
"
);
ok
(
uc
.
lpszScheme
==
url_k1
,
"Failed to get uc.lpszScheme
\n
"
);
ok
(
uc
.
dwSchemeLength
==
4
,
"Unexpected dwSchemeLength
\n
"
);
Len
+=
uc
.
dwSchemeLength
+
3
;
ok
(
uc
.
lpszUserName
==
&
url_k1
[
Len
],
"Failed to get uc.lpszUserName
\n
"
);
ok
(
uc
.
dwUserNameLength
==
8
,
"Unexpected dwUserNameLength
\n
"
);
Len
+=
uc
.
dwUserNameLength
+
1
;
ok
(
uc
.
lpszPassword
==&
url_k1
[
Len
],
"Failed to get uc.lpszPassword
\n
"
);
ok
(
uc
.
dwPasswordLength
==
8
,
"Unexpected dwPasswordLength
\n
"
);
Len
+=
uc
.
dwPasswordLength
+
1
;
ok
(
uc
.
lpszHostName
==
&
url_k1
[
Len
],
"Failed to get uc.lpszHostName
\n
"
);
ok
(
uc
.
dwHostNameLength
==
14
,
"Unexpected dwHostNameLength
\n
"
);
Len
+=
uc
.
dwHostNameLength
;
ok
(
uc
.
lpszUrlPath
==
&
url_k1
[
Len
],
"Failed to get uc.lpszUrlPath
\n
"
);
ok
(
uc
.
dwUrlPathLength
==
11
,
"Unexpected dwUrlPathLength
\n
"
);
Len
+=
uc
.
dwUrlPathLength
;
ok
(
uc
.
lpszExtraInfo
==
&
url_k1
[
Len
],
"Failed to get uc.lpszExtraInfo
\n
"
);
ok
(
uc
.
dwExtraInfoLength
==
0
,
"Unexpected dwExtraInfoLength
\n
"
);
memset
(
&
uc
,
0
,
sizeof
(
uc
));
uc
.
dwStructSize
=
sizeof
(
URL_COMPONENTSW
);
uc
.
dwSchemeLength
=
-
1
;
uc
.
dwHostNameLength
=
-
1
;
uc
.
dwUserNameLength
=
-
1
;
uc
.
dwPasswordLength
=
-
1
;
uc
.
dwUrlPathLength
=
-
1
;
uc
.
dwExtraInfoLength
=
-
1
;
ret
=
WinHttpCrackUrl
(
url_k2
,
0
,
0
,
&
uc
);
Len
=
0
;
ok
(
ret
!=
0
,
"WinHttpCrackUrl failed
\n
"
);
ok
(
uc
.
lpszScheme
==
url_k2
,
"Failed to get uc.lpszScheme
\n
"
);
ok
(
uc
.
dwSchemeLength
==
4
,
"Unexpected dwSchemeLength
\n
"
);
Len
+=
uc
.
dwSchemeLength
+
3
;
ok
(
uc
.
lpszUserName
==
NULL
,
"Got uc.lpszUserName
\n
"
);
ok
(
uc
.
dwUserNameLength
==
0
,
"Unexpected dwUserNameLength
\n
"
);
ok
(
uc
.
lpszPassword
==
NULL
,
"Got uc.lpszPassword
\n
"
);
ok
(
uc
.
dwPasswordLength
==
0
,
"Unexpected dwPasswordLength
\n
"
);
ok
(
uc
.
lpszHostName
==
&
url_k2
[
Len
],
"Failed to get uc.lpszHostName
\n
"
);
ok
(
uc
.
dwHostNameLength
==
14
,
"Unexpected dwHostNameLength
\n
"
);
Len
+=
uc
.
dwHostNameLength
;
ok
(
uc
.
lpszUrlPath
==
&
url_k2
[
Len
],
"Failed to get uc.lpszUrlPath
\n
"
);
ok
(
uc
.
dwUrlPathLength
==
0
,
"Unexpected dwUrlPathLength
\n
"
);
Len
+=
uc
.
dwUrlPathLength
;
ok
(
uc
.
lpszExtraInfo
==
&
url_k2
[
Len
],
"Failed to get uc.lpszExtraInfo
\n
"
);
ok
(
uc
.
dwExtraInfoLength
==
0
,
"Unexpected dwExtraInfoLength
\n
"
);
}
START_TEST
(
url
)
{
WinHttpCreateUrl_test
();
WinHttpCrackUrl_test
();
}
dlls/winhttp/url.c
View file @
3590a422
...
...
@@ -40,8 +40,12 @@ BOOL WINAPI InternetCrackUrlW( LPCWSTR, DWORD, DWORD, LPURL_COMPONENTSW );
BOOL
WINAPI
WinHttpCrackUrl
(
LPCWSTR
url
,
DWORD
len
,
DWORD
flags
,
LPURL_COMPONENTSW
components
)
{
BOOL
ret
;
INT
upLen
;
INT
exLen
;
TRACE
(
"%s, %d, %x, %p
\n
"
,
debugstr_w
(
url
),
len
,
flags
,
components
);
upLen
=
components
->
dwUrlPathLength
;
exLen
=
components
->
dwExtraInfoLength
;
if
((
ret
=
InternetCrackUrlW
(
url
,
len
,
flags
,
components
)))
{
...
...
@@ -53,6 +57,14 @@ BOOL WINAPI WinHttpCrackUrl( LPCWSTR url, DWORD len, DWORD flags, LPURL_COMPONEN
set_last_error
(
ERROR_WINHTTP_UNRECOGNIZED_SCHEME
);
return
FALSE
;
}
if
(
!
len
)
len
=
lstrlenW
(
url
);
/* WinHttpCrackUrl actually returns pointers to the end of the string for components,
other than UserName and Password, that are missing */
if
(
upLen
&&
components
->
lpszUrlPath
==
NULL
)
components
->
lpszUrlPath
=
(
LPWSTR
)
&
url
[
len
];
if
(
exLen
&&
components
->
lpszExtraInfo
==
NULL
)
components
->
lpszExtraInfo
=
(
LPWSTR
)
&
url
[
len
];
}
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