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
02839948
Commit
02839948
authored
Mar 09, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Mar 09, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Get the string for the scheme if specified only by the
INTERNET_SCHEME enumeration in InternetCreateUrlW.
parent
01219c65
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
1 deletion
+45
-1
internet.c
dlls/wininet/internet.c
+27
-1
http.c
dlls/wininet/tests/http.c
+18
-0
No files found.
dlls/wininet/internet.c
View file @
02839948
...
...
@@ -3712,6 +3712,17 @@ static BOOL url_uses_default_port(LPURL_COMPONENTSW lpUrlComponents)
return
FALSE
;
}
static
LPCWSTR
INTERNET_GetSchemeString
(
INTERNET_SCHEME
scheme
)
{
int
index
;
if
(
scheme
<
INTERNET_SCHEME_FIRST
)
return
NULL
;
index
=
scheme
-
INTERNET_SCHEME_FIRST
;
if
(
index
>=
sizeof
(
url_schemes
)
/
sizeof
(
url_schemes
[
0
]))
return
NULL
;
return
(
LPCWSTR
)
&
url_schemes
[
index
];
}
/* we can calculate using ansi strings because we're just
* calculating string length, not size
*/
...
...
@@ -3720,7 +3731,15 @@ static BOOL calc_url_length(LPURL_COMPONENTSW lpUrlComponents,
{
*
lpdwUrlLength
=
0
;
*
lpdwUrlLength
+=
URL_GET_COMP_LENGTH
(
lpUrlComponents
,
Scheme
);
if
(
lpUrlComponents
->
lpszScheme
)
*
lpdwUrlLength
+=
URL_GET_COMP_LENGTH
(
lpUrlComponents
,
Scheme
);
else
{
LPCWSTR
scheme
=
INTERNET_GetSchemeString
(
lpUrlComponents
->
nScheme
);
TRACE
(
"got scheme %s
\n
"
,
debugstr_w
(
scheme
));
*
lpdwUrlLength
+=
strlenW
(
scheme
);
}
*
lpdwUrlLength
+=
strlen
(
"://"
);
if
(
lpUrlComponents
->
lpszUserName
)
...
...
@@ -3922,6 +3941,13 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COMPONENTSW lpUrlComponents, DWORD dwFlags,
memcpy
(
lpszUrl
,
lpUrlComponents
->
lpszScheme
,
dwLen
*
sizeof
(
WCHAR
));
lpszUrl
+=
dwLen
;
}
else
{
LPCWSTR
scheme
=
INTERNET_GetSchemeString
(
lpUrlComponents
->
nScheme
);
dwLen
=
strlenW
(
scheme
);
memcpy
(
lpszUrl
,
scheme
,
dwLen
*
sizeof
(
WCHAR
));
lpszUrl
+=
dwLen
;
}
memcpy
(
lpszUrl
,
colonSlashW
,
sizeof
(
colonSlashW
));
lpszUrl
+=
sizeof
(
colonSlashW
)
/
sizeof
(
colonSlashW
[
0
]);
...
...
dlls/wininet/tests/http.c
View file @
02839948
...
...
@@ -47,6 +47,7 @@
#define CREATE_URL6 "nhttp://username:password@www.winehq.org:80/site/about"
#define CREATE_URL7 "http://username:password@www.winehq.org:42/site/about"
#define CREATE_URL8 "https://username:password@www.winehq.org/site/about"
#define CREATE_URL9 "about:blank"
static
HANDLE
hCompleteEvent
;
...
...
@@ -1102,6 +1103,23 @@ static void InternetCreateUrlA_test(void)
ok
(
!
strcmp
(
szUrl
,
CREATE_URL8
),
"Expected %s, got %s
\n
"
,
CREATE_URL8
,
szUrl
);
HeapFree
(
GetProcessHeap
(),
0
,
szUrl
);
memset
(
&
urlComp
,
0
,
sizeof
(
urlComp
));
urlComp
.
dwStructSize
=
sizeof
(
URL_COMPONENTS
);
urlComp
.
lpszScheme
=
"about"
;
urlComp
.
dwSchemeLength
=
5
;
urlComp
.
lpszUrlPath
=
"blank"
;
urlComp
.
dwUrlPathLength
=
5
;
len
=
strlen
(
CREATE_URL9
);
szUrl
=
(
char
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
++
len
);
ret
=
InternetCreateUrlA
(
&
urlComp
,
ICU_ESCAPE
,
szUrl
,
&
len
);
todo_wine
{
ok
(
ret
,
"Expected success
\n
"
);
ok
(
len
==
strlen
(
CREATE_URL9
),
"Expected len %d, got %ld
\n
"
,
strlen
(
CREATE_URL9
),
len
);
ok
(
!
strcmp
(
szUrl
,
CREATE_URL9
),
"Expected %s, got %s
\n
"
,
CREATE_URL9
,
szUrl
);
}
HeapFree
(
GetProcessHeap
(),
0
,
szUrl
);
}
static
void
HttpSendRequestEx_test
(
void
)
...
...
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