Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sam Joan Roque-Worcel
wine
Commits
e00aca02
Commit
e00aca02
authored
23 years ago
by
Bernhard Rosenkraenzer
Committed by
Alexandre Julliard
23 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added InternetOpenURLA implementation.
parent
1ec2839e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/wininet/internet.c
+78
-3
78 additions, 3 deletions
dlls/wininet/internet.c
dlls/wininet/wininet.spec
+1
-1
1 addition, 1 deletion
dlls/wininet/wininet.spec
with
79 additions
and
4 deletions
dlls/wininet/internet.c
+
78
−
3
View file @
e00aca02
...
...
@@ -22,7 +22,10 @@
#include
"config.h"
#define MAXHOSTNAME 100
/* from http.c */
#include
<string.h>
#include
<stdio.h>
#include
<sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
...
...
@@ -517,7 +520,7 @@ BOOL SetUrlComponentValue(LPSTR* lppszComponent, LPDWORD dwComponentLen, LPCSTR
*
* Break up URL into its components
*
* TODO: Ha
d
nle dwFlags
* TODO: Han
d
le dwFlags
*
* RETURNS
* TRUE on success
...
...
@@ -1165,7 +1168,80 @@ End:
return
rc
;
}
/**********************************************************
* InternetOpenUrlA (WININET.@)
*
* Opens an URL
*
* RETURNS
* handle of connection or NULL on failure
*/
HINTERNET
WINAPI
InternetOpenUrlA
(
HINTERNET
hInternet
,
LPCSTR
lpszUrl
,
LPCSTR
lpszHeaders
,
DWORD
dwHeadersLength
,
DWORD
dwFlags
,
DWORD
dwContext
)
{
URL_COMPONENTSA
urlComponents
;
char
protocol
[
32
],
hostName
[
MAXHOSTNAME
],
userName
[
1024
],
password
[
1024
],
path
[
2048
],
extra
[
1024
];
HINTERNET
client
=
NULL
,
client1
=
NULL
;
urlComponents
.
dwStructSize
=
sizeof
(
URL_COMPONENTSA
);
urlComponents
.
lpszScheme
=
protocol
;
urlComponents
.
dwSchemeLength
=
32
;
urlComponents
.
lpszHostName
=
hostName
;
urlComponents
.
dwHostNameLength
=
MAXHOSTNAME
;
urlComponents
.
lpszUserName
=
userName
;
urlComponents
.
dwUserNameLength
=
1024
;
urlComponents
.
lpszPassword
=
password
;
urlComponents
.
dwPasswordLength
=
1024
;
urlComponents
.
lpszUrlPath
=
path
;
urlComponents
.
dwUrlPathLength
=
2048
;
urlComponents
.
lpszExtraInfo
=
extra
;
urlComponents
.
dwExtraInfoLength
=
1024
;
if
(
!
InternetCrackUrlA
(
lpszUrl
,
strlen
(
lpszUrl
),
0
,
&
urlComponents
))
return
NULL
;
switch
(
urlComponents
.
nScheme
)
{
case
INTERNET_SCHEME_FTP
:
if
(
urlComponents
.
nPort
==
0
)
urlComponents
.
nPort
=
INTERNET_DEFAULT_FTP_PORT
;
client
=
InternetConnectA
(
hInternet
,
hostName
,
urlComponents
.
nPort
,
userName
,
password
,
INTERNET_SERVICE_FTP
,
dwFlags
,
dwContext
);
return
FtpOpenFileA
(
client
,
path
,
GENERIC_READ
,
dwFlags
,
dwContext
);
break
;
case
INTERNET_SCHEME_HTTP
:
case
INTERNET_SCHEME_HTTPS
:
{
LPCSTR
accept
[
2
]
=
{
"*/*"
,
NULL
};
char
*
hostreq
=
(
char
*
)
malloc
(
strlen
(
hostName
)
+
9
);
sprintf
(
hostreq
,
"Host: %s
\r\n
"
,
hostName
);
if
(
urlComponents
.
nPort
==
0
)
{
if
(
urlComponents
.
nScheme
==
INTERNET_SCHEME_HTTP
)
urlComponents
.
nPort
=
INTERNET_DEFAULT_HTTP_PORT
;
else
urlComponents
.
nPort
=
INTERNET_DEFAULT_HTTPS_PORT
;
}
client
=
InternetConnectA
(
hInternet
,
hostName
,
urlComponents
.
nPort
,
userName
,
password
,
INTERNET_SERVICE_HTTP
,
dwFlags
,
dwContext
);
if
(
client
==
NULL
)
return
NULL
;
client1
=
HttpOpenRequestA
(
hInternet
,
NULL
,
path
,
NULL
,
NULL
,
accept
,
dwFlags
,
dwContext
);
if
(
client1
==
NULL
)
{
InternetCloseHandle
(
client
);
return
NULL
;
}
HttpAddRequestHeadersA
(
client1
,
lpszHeaders
,
dwHeadersLength
,
HTTP_ADDREQ_FLAG_ADD
);
HttpAddRequestHeadersA
(
client1
,
hostreq
,
-
1L
,
HTTP_ADDREQ_FLAG_ADD_IF_NEW
);
if
(
!
HttpSendRequestA
(
client1
,
NULL
,
0
,
NULL
,
0
))
{
InternetCloseHandle
(
client1
);
InternetCloseHandle
(
client
);
return
NULL
;
}
return
client1
;
break
;
}
case
INTERNET_SCHEME_GOPHER
:
/* gopher doesn't seem to be implemented in wine, but it's supposed
* to be supported by InternetOpenUrlA. */
default:
return
NULL
;
}
if
(
client
!=
NULL
)
InternetCloseHandle
(
client
);
}
/***********************************************************************
* INTERNET_WriteDataToStream (internal)
...
...
@@ -1586,4 +1662,3 @@ lend:
return
NULL
;
}
}
This diff is collapsed.
Click to expand it.
dlls/wininet/wininet.spec
+
1
−
1
View file @
e00aca02
...
...
@@ -123,7 +123,7 @@ debug_channels (wininet)
@ stub InternetLockRequestFile
@ stdcall InternetOpenA(str long str str long) InternetOpenA
@ stub InternetOpenServerPushParse
@ st
ub
InternetOpenUrlA
@ st
dcall InternetOpenUrlA(ptr str str long long long)
InternetOpenUrlA
@ stub InternetOpenUrlW
@ stub InternetOpenW
@ stub InternetQueryDataAvailable
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment