Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
a4e902cb
Commit
a4e902cb
authored
Mar 30, 2004
by
Mike McCormack
Committed by
Alexandre Julliard
Mar 30, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert the wininet HTTP functions to Unicode.
parent
bcaac8e1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
123 additions
and
100 deletions
+123
-100
cookie.c
dlls/wininet/cookie.c
+4
-4
dialogs.c
dlls/wininet/dialogs.c
+8
-8
ftp.c
dlls/wininet/ftp.c
+20
-11
http.c
dlls/wininet/http.c
+0
-0
internet.c
dlls/wininet/internet.c
+0
-0
internet.h
dlls/wininet/internet.h
+53
-44
netconnection.c
dlls/wininet/netconnection.c
+7
-5
utility.c
dlls/wininet/utility.c
+28
-25
wininet.spec
dlls/wininet/wininet.spec
+1
-1
wininet.h
include/wininet.h
+2
-2
No files found.
dlls/wininet/cookie.c
View file @
a4e902cb
...
...
@@ -404,11 +404,11 @@ BOOL WINAPI InternetGetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName,
* FALSE on failure
*
*/
BOOL
WINAPI
InternetGetCookieW
(
LPCSTR
lpszUrl
,
LPCWSTR
lpszCookieName
,
BOOL
WINAPI
InternetGetCookieW
(
LPC
W
STR
lpszUrl
,
LPCWSTR
lpszCookieName
,
LPWSTR
lpCookieData
,
LPDWORD
lpdwSize
)
{
FIXME
(
"STUB
\n
"
);
TRACE
(
"(%s,%s,%p)
\n
"
,
debugstr_
a
(
lpszUrl
),
debugstr_w
(
lpszCookieName
),
TRACE
(
"(%s,%s,%p)
\n
"
,
debugstr_
w
(
lpszUrl
),
debugstr_w
(
lpszCookieName
),
lpCookieData
);
return
FALSE
;
}
...
...
@@ -483,11 +483,11 @@ BOOL WINAPI InternetSetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName,
* FALSE on failure
*
*/
BOOL
WINAPI
InternetSetCookieW
(
LPCSTR
lpszUrl
,
LPCWSTR
lpszCookieName
,
BOOL
WINAPI
InternetSetCookieW
(
LPC
W
STR
lpszUrl
,
LPCWSTR
lpszCookieName
,
LPCWSTR
lpCookieData
)
{
FIXME
(
"STUB
\n
"
);
TRACE
(
"(%s,%s,%s)
\n
"
,
debugstr_
a
(
lpszUrl
),
TRACE
(
"(%s,%s,%s)
\n
"
,
debugstr_
w
(
lpszUrl
),
debugstr_w
(
lpszCookieName
),
debugstr_w
(
lpCookieData
));
return
FALSE
;
}
dlls/wininet/dialogs.c
View file @
a4e902cb
...
...
@@ -58,15 +58,15 @@ struct WININET_ErrorDlgParams
*/
static
BOOL
WININET_GetProxyServer
(
HINTERNET
hRequest
,
LPWSTR
szBuf
,
DWORD
sz
)
{
LPWININETHTTPREQ
A
lpwhr
=
(
LPWININETHTTPREQA
)
hRequest
;
LPWININETHTTPSESSION
A
lpwhs
=
NULL
;
LPWININETHTTPREQ
W
lpwhr
=
(
LPWININETHTTPREQW
)
hRequest
;
LPWININETHTTPSESSION
W
lpwhs
=
NULL
;
LPWININETAPPINFOW
hIC
=
NULL
;
LPWSTR
p
;
if
(
NULL
==
lpwhr
)
return
FALSE
;
lpwhs
=
(
LPWININETHTTPSESSION
A
)
lpwhr
->
hdr
.
lpwhparent
;
lpwhs
=
(
LPWININETHTTPSESSION
W
)
lpwhr
->
hdr
.
lpwhparent
;
if
(
NULL
==
lpwhs
)
return
FALSE
;
...
...
@@ -194,12 +194,12 @@ static BOOL WININET_GetSetPassword( HWND hdlg, LPCWSTR szServer,
static
BOOL
WININET_SetProxyAuthorization
(
HINTERNET
hRequest
,
LPWSTR
username
,
LPWSTR
password
)
{
LPWININETHTTPREQ
A
lpwhr
=
(
LPWININETHTTPREQA
)
hRequest
;
LPWININETHTTPSESSION
A
lpwhs
;
LPWININETHTTPREQ
W
lpwhr
=
(
LPWININETHTTPREQW
)
hRequest
;
LPWININETHTTPSESSION
W
lpwhs
;
LPWININETAPPINFOW
hIC
;
LPWSTR
p
;
lpwhs
=
(
LPWININETHTTPSESSION
A
)
lpwhr
->
hdr
.
lpwhparent
;
lpwhs
=
(
LPWININETHTTPSESSION
W
)
lpwhr
->
hdr
.
lpwhparent
;
if
(
NULL
==
lpwhs
||
lpwhs
->
hdr
.
htype
!=
WH_HHTTPSESSION
)
{
INTERNET_SetLastError
(
ERROR_INTERNET_INCORRECT_HANDLE_TYPE
);
...
...
@@ -272,7 +272,7 @@ static INT_PTR WINAPI WININET_ProxyPasswordDialog(
case
WM_COMMAND
:
if
(
wParam
==
IDOK
)
{
LPWININETHTTPREQ
A
lpwhr
=
(
LPWININETHTTPREQA
)
params
->
hRequest
;
LPWININETHTTPREQ
W
lpwhr
=
(
LPWININETHTTPREQW
)
params
->
hRequest
;
WCHAR
username
[
0x20
],
password
[
0x20
];
username
[
0
]
=
0
;
...
...
@@ -320,7 +320,7 @@ static INT WININET_GetConnectionStatus( HINTERNET hRequest )
TRACE
(
"%p
\n
"
,
hRequest
);
sz
=
sizeof
(
szStatus
)
/
sizeof
(
WCHAR
)
;
sz
=
sizeof
szStatus
;
index
=
0
;
if
(
!
HttpQueryInfoW
(
hRequest
,
HTTP_QUERY_STATUS_CODE
,
szStatus
,
&
sz
,
&
index
))
...
...
dlls/wininet/ftp.c
View file @
a4e902cb
...
...
@@ -144,6 +144,15 @@ inline static LPSTR FTP_strdup( LPCSTR str )
return
ret
;
}
inline
static
LPSTR
FTP_strdup_WtoA
(
LPCWSTR
str
)
{
int
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
LPSTR
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
if
(
ret
)
WideCharToMultiByte
(
CP_ACP
,
0
,
str
,
-
1
,
ret
,
len
,
NULL
,
NULL
);
return
ret
;
}
/***********************************************************************
* FtpPutFileA (WININET.@)
*
...
...
@@ -1475,9 +1484,9 @@ lend:
*
*/
HINTERNET
FTP_Connect
(
HINTERNET
hInternet
,
LPCSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
LPCSTR
lpszUserName
,
LPCSTR
lpszPassword
,
DWORD
dwFlags
,
DWORD
dwContext
)
HINTERNET
FTP_Connect
(
HINTERNET
hInternet
,
LPC
W
STR
lpszServerName
,
INTERNET_PORT
nServerPort
,
LPC
W
STR
lpszUserName
,
LPC
W
STR
lpszPassword
,
DWORD
dwFlags
,
DWORD
dwContext
)
{
struct
sockaddr_in
socketAddr
;
struct
hostent
*
phe
=
NULL
;
...
...
@@ -1488,8 +1497,8 @@ HINTERNET FTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName,
HINTERNET
handle
=
NULL
;
TRACE
(
"0x%08lx Server(%s) Port(%d) User(%s) Paswd(%s)
\n
"
,
(
ULONG
)
hInternet
,
lpszServerName
,
nServerPort
,
lpszUserName
,
lpszPassword
);
(
ULONG
)
hInternet
,
debugstr_w
(
lpszServerName
)
,
nServerPort
,
debugstr_w
(
lpszUserName
),
debugstr_w
(
lpszPassword
)
);
hIC
=
(
LPWININETAPPINFOW
)
WININET_GetObject
(
hInternet
);
if
(
(
hIC
==
NULL
)
||
(
hIC
->
hdr
.
htype
!=
WH_HINIT
)
)
...
...
@@ -1506,7 +1515,7 @@ HINTERNET FTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName,
if
(
hIC
->
lpfnStatusCB
)
hIC
->
lpfnStatusCB
(
hInternet
,
dwContext
,
INTERNET_STATUS_RESOLVING_NAME
,
(
LP
STR
)
lpszServerName
,
strlen
(
lpszServerName
));
(
LP
WSTR
)
lpszServerName
,
strlenW
(
lpszServerName
));
if
(
!
GetAddress
(
lpszServerName
,
nServerPort
,
&
phe
,
&
socketAddr
))
{
...
...
@@ -1516,7 +1525,7 @@ HINTERNET FTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName,
if
(
hIC
->
lpfnStatusCB
)
hIC
->
lpfnStatusCB
(
hInternet
,
dwContext
,
INTERNET_STATUS_NAME_RESOLVED
,
(
LP
STR
)
lpszServerName
,
strlen
(
lpszServerName
));
(
LP
WSTR
)
lpszServerName
,
strlenW
(
lpszServerName
));
nsocket
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
);
if
(
nsocket
==
-
1
)
...
...
@@ -1558,7 +1567,7 @@ HINTERNET FTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName,
lpwfs
->
hdr
.
htype
=
WH_HFTPSESSION
;
lpwfs
->
hdr
.
dwFlags
=
dwFlags
;
lpwfs
->
hdr
.
dwContext
=
dwContext
;
lpwfs
->
hdr
.
lpwhparent
=
&
hIC
->
hdr
;
lpwfs
->
hdr
.
lpwhparent
=
(
LPWININETHANDLEHEADER
)
hInternet
;
lpwfs
->
sndSocket
=
nsocket
;
lpwfs
->
download_in_progress
=
NULL
;
sock_namelen
=
sizeof
(
lpwfs
->
socketAddress
);
...
...
@@ -1572,8 +1581,8 @@ HINTERNET FTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName,
}
else
{
lpwfs
->
lpszUserName
=
FTP_strdup
(
lpszUserName
);
lpwfs
->
lpszPassword
=
FTP_strdup
(
lpszPassword
);
lpwfs
->
lpszUserName
=
FTP_strdup
_WtoA
(
lpszUserName
);
lpwfs
->
lpszPassword
=
FTP_strdup
_WtoA
(
lpszPassword
);
}
if
(
FTP_ConnectToHost
(
lpwfs
))
...
...
@@ -2543,7 +2552,7 @@ HINTERNET FTP_ReceiveFileList(LPWININETFTPSESSIONA lpwfs, INT nSocket,
if
(
handle
)
{
lpwfn
->
hdr
.
htype
=
WH_HFINDNEXT
;
lpwfn
->
hdr
.
lpwhparent
=
&
lpwfs
->
hdr
;
lpwfn
->
hdr
.
lpwhparent
=
(
LPWININETHANDLEHEADER
)
lpwfs
;
lpwfn
->
hdr
.
dwContext
=
dwContext
;
lpwfn
->
index
=
1
;
/* Next index is 1 since we return index 0 */
lpwfn
->
size
=
dwSize
;
...
...
dlls/wininet/http.c
View file @
a4e902cb
This diff is collapsed.
Click to expand it.
dlls/wininet/internet.c
View file @
a4e902cb
This diff is collapsed.
Click to expand it.
dlls/wininet/internet.h
View file @
a4e902cb
...
...
@@ -23,6 +23,8 @@
#ifndef _WINE_INTERNET_H_
#define _WINE_INTERNET_H_
#include "wine/unicode.h"
#include <time.h>
#ifdef HAVE_NETDB_H
# include <netdb.h>
...
...
@@ -61,6 +63,13 @@ inline static LPSTR WININET_strdup( LPCSTR str )
return
ret
;
}
inline
static
LPWSTR
WININET_strdupW
(
LPCWSTR
str
)
{
LPWSTR
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
strlenW
(
str
)
+
1
)
*
sizeof
(
WCHAR
)
);
if
(
ret
)
strcpyW
(
ret
,
str
);
return
ret
;
}
typedef
enum
{
WH_HINIT
=
INTERNET_HANDLE_TYPE_INTERNET
,
...
...
@@ -98,12 +107,12 @@ typedef struct
typedef
struct
{
WININETHANDLEHEADER
hdr
;
LPSTR
lpszServerName
;
LPSTR
lpszUserName
;
LP
W
STR
lpszServerName
;
LP
W
STR
lpszUserName
;
INTERNET_PORT
nServerPort
;
struct
sockaddr_in
socketAddress
;
struct
hostent
*
phostent
;
}
WININETHTTPSESSION
A
,
*
LPWININETHTTPSESSIONA
;
}
WININETHTTPSESSION
W
,
*
LPWININETHTTPSESSIONW
;
#define HDR_ISREQUEST 0x0001
#define HDR_COMMADELIMITED 0x0002
...
...
@@ -111,24 +120,24 @@ typedef struct
typedef
struct
{
LPSTR
lpszField
;
LPSTR
lpszValue
;
LP
W
STR
lpszField
;
LP
W
STR
lpszValue
;
WORD
wFlags
;
WORD
wCount
;
}
HTTPHEADER
A
,
*
LPHTTPHEADERA
;
}
HTTPHEADER
W
,
*
LPHTTPHEADERW
;
typedef
struct
{
WININETHANDLEHEADER
hdr
;
LPSTR
lpszPath
;
LPSTR
lpszVerb
;
LPSTR
lpszHostName
;
LP
W
STR
lpszPath
;
LP
W
STR
lpszVerb
;
LP
W
STR
lpszHostName
;
WININET_NETCONNECTION
netConnection
;
HTTPHEADER
A
StdHeaders
[
HTTP_QUERY_MAX
+
1
];
HTTPHEADER
A
*
pCustHeaders
;
HTTPHEADER
W
StdHeaders
[
HTTP_QUERY_MAX
+
1
];
HTTPHEADER
W
*
pCustHeaders
;
INT
nCustHeaders
;
}
WININETHTTPREQ
A
,
*
LPWININETHTTPREQA
;
}
WININETHTTPREQ
W
,
*
LPWININETHTTPREQW
;
typedef
struct
...
...
@@ -185,10 +194,10 @@ typedef enum
FTPREMOVEDIRECTORYA
,
FTPRENAMEFILEA
,
INTERNETFINDNEXTA
,
HTTPSENDREQUEST
A
,
HTTPOPENREQUEST
A
,
HTTPSENDREQUEST
W
,
HTTPOPENREQUEST
W
,
SENDCALLBACK
,
INTERNETOPENURL
A
,
INTERNETOPENURL
W
,
}
ASYNC_FUNC
;
struct
WORKREQ_FTPPUTFILEA
...
...
@@ -262,20 +271,20 @@ struct WORKREQ_INTERNETFINDNEXTA
LPWIN32_FIND_DATAA
lpFindFileData
;
};
struct
WORKREQ_HTTPOPENREQUEST
A
struct
WORKREQ_HTTPOPENREQUEST
W
{
LPSTR
lpszVerb
;
LPSTR
lpszObjectName
;
LPSTR
lpszVersion
;
LPSTR
lpszReferrer
;
LPCSTR
*
lpszAcceptTypes
;
LP
W
STR
lpszVerb
;
LP
W
STR
lpszObjectName
;
LP
W
STR
lpszVersion
;
LP
W
STR
lpszReferrer
;
LPC
W
STR
*
lpszAcceptTypes
;
DWORD
dwFlags
;
DWORD
dwContext
;
};
struct
WORKREQ_HTTPSENDREQUEST
A
struct
WORKREQ_HTTPSENDREQUEST
W
{
LPSTR
lpszHeader
;
LP
W
STR
lpszHeader
;
DWORD
dwHeaderLength
;
LPVOID
lpOptional
;
DWORD
dwOptionalLength
;
...
...
@@ -290,11 +299,11 @@ struct WORKREQ_SENDCALLBACK
DWORD
dwStatusInfoLength
;
};
struct
WORKREQ_INTERNETOPENURL
A
struct
WORKREQ_INTERNETOPENURL
W
{
HINTERNET
hInternet
;
LPSTR
lpszUrl
;
LPSTR
lpszHeaders
;
LP
W
STR
lpszUrl
;
LP
W
STR
lpszHeaders
;
DWORD
dwHeadersLength
;
DWORD
dwFlags
;
DWORD
dwContext
;
...
...
@@ -317,10 +326,10 @@ typedef struct WORKREQ
struct
WORKREQ_FTPREMOVEDIRECTORYA
FtpRemoveDirectoryA
;
struct
WORKREQ_FTPRENAMEFILEA
FtpRenameFileA
;
struct
WORKREQ_INTERNETFINDNEXTA
InternetFindNextA
;
struct
WORKREQ_HTTPOPENREQUEST
A
HttpOpenRequestA
;
struct
WORKREQ_HTTPSENDREQUEST
A
HttpSendRequestA
;
struct
WORKREQ_HTTPOPENREQUEST
W
HttpOpenRequestW
;
struct
WORKREQ_HTTPSENDREQUEST
W
HttpSendRequestW
;
struct
WORKREQ_SENDCALLBACK
SendCallback
;
struct
WORKREQ_INTERNETOPENURL
A
InternetOpenUrlA
;
struct
WORKREQ_INTERNETOPENURL
W
InternetOpenUrlW
;
}
u
;
struct
WORKREQ
*
next
;
...
...
@@ -333,17 +342,17 @@ LPWININETHANDLEHEADER WININET_GetObject( HINTERNET hinternet );
BOOL
WININET_FreeHandle
(
HINTERNET
hinternet
);
HINTERNET
WININET_FindHandle
(
LPWININETHANDLEHEADER
info
);
time_t
ConvertTimeString
(
LPCSTR
asctime
);
time_t
ConvertTimeString
(
LPC
W
STR
asctime
);
HINTERNET
FTP_Connect
(
HINTERNET
hInterent
,
LPCSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
LPCSTR
lpszUserName
,
LPCSTR
lpszPassword
,
DWORD
dwFlags
,
DWORD
dwContext
);
HINTERNET
FTP_Connect
(
HINTERNET
hInterent
,
LPC
W
STR
lpszServerName
,
INTERNET_PORT
nServerPort
,
LPC
W
STR
lpszUserName
,
LPC
W
STR
lpszPassword
,
DWORD
dwFlags
,
DWORD
dwContext
);
HINTERNET
HTTP_Connect
(
HINTERNET
hInterent
,
LPCSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
LPCSTR
lpszUserName
,
LPCSTR
lpszPassword
,
DWORD
dwFlags
,
DWORD
dwContext
);
HINTERNET
HTTP_Connect
(
HINTERNET
hInterent
,
LPC
W
STR
lpszServerName
,
INTERNET_PORT
nServerPort
,
LPC
W
STR
lpszUserName
,
LPC
W
STR
lpszPassword
,
DWORD
dwFlags
,
DWORD
dwContext
);
BOOL
GetAddress
(
LPCSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
BOOL
GetAddress
(
LPC
W
STR
lpszServerName
,
INTERNET_PORT
nServerPort
,
struct
hostent
**
phe
,
struct
sockaddr_in
*
psa
);
void
INTERNET_SetLastError
(
DWORD
dwError
);
...
...
@@ -373,14 +382,14 @@ BOOLAPI FTP_FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR lpszN
BOOL
fFailIfExists
,
DWORD
dwLocalFlagsAttribute
,
DWORD
dwInternetFlags
,
DWORD
dwContext
);
BOOLAPI
HTTP_HttpSendRequest
A
(
HINTERNET
hHttpRequest
,
LPC
STR
lpszHeaders
,
BOOLAPI
HTTP_HttpSendRequest
W
(
HINTERNET
hHttpRequest
,
LPCW
STR
lpszHeaders
,
DWORD
dwHeaderLength
,
LPVOID
lpOptional
,
DWORD
dwOptionalLength
);
INTERNETAPI
HINTERNET
WINAPI
HTTP_HttpOpenRequest
A
(
HINTERNET
hHttpSession
,
LPC
STR
lpszVerb
,
LPCSTR
lpszObjectName
,
LPC
STR
lpszVersion
,
LPC
STR
lpszReferrer
,
LPC
STR
*
lpszAcceptTypes
,
INTERNETAPI
HINTERNET
WINAPI
HTTP_HttpOpenRequest
W
(
HINTERNET
hHttpSession
,
LPC
WSTR
lpszVerb
,
LPCWSTR
lpszObjectName
,
LPCW
STR
lpszVersion
,
LPC
WSTR
lpszReferrer
,
LPCW
STR
*
lpszAcceptTypes
,
DWORD
dwFlags
,
DWORD
dwContext
);
void
HTTP_CloseHTTPSessionHandle
(
LPWININETHTTPSESSION
A
lpwhs
);
void
HTTP_CloseHTTPRequestHandle
(
LPWININETHTTPREQ
A
lpwhr
);
void
HTTP_CloseHTTPSessionHandle
(
LPWININETHTTPSESSION
W
lpwhs
);
void
HTTP_CloseHTTPRequestHandle
(
LPWININETHTTPREQ
W
lpwhr
);
VOID
SendAsyncCallback
(
LPWININETAPPINFOW
hIC
,
HINTERNET
hHttpSession
,
DWORD
dwContext
,
DWORD
dwInternetStatus
,
LPVOID
...
...
@@ -390,7 +399,7 @@ VOID SendAsyncCallbackInt(LPWININETAPPINFOW hIC, HINTERNET hHttpSession,
DWORD
dwContext
,
DWORD
dwInternetStatus
,
LPVOID
lpvStatusInfo
,
DWORD
dwStatusInfoLength
);
BOOL
HTTP_InsertProxyAuthorization
(
LPWININETHTTPREQ
A
lpwhr
,
BOOL
HTTP_InsertProxyAuthorization
(
LPWININETHTTPREQ
W
lpwhr
,
LPCWSTR
username
,
LPCWSTR
password
);
BOOL
NETCON_connected
(
WININET_NETCONNECTION
*
connection
);
...
...
dlls/wininet/netconnection.c
View file @
a4e902cb
...
...
@@ -26,7 +26,9 @@
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#include <sys/types.h>
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
...
...
@@ -446,8 +448,8 @@ BOOL NETCON_getNextLine(WININET_NETCONNECTION *connection, LPSTR lpszBuffer, LPD
lend:
/* FIXME: don't use labels */
if
(
bSuccess
)
{
lpszBuffer
[
nRecv
]
=
'\0'
;
*
dwBuffer
=
nRecv
-
1
;
lpszBuffer
[
nRecv
++
]
=
'\0'
;
*
dwBuffer
=
nRecv
;
TRACE
(
":%d %s
\n
"
,
nRecv
,
lpszBuffer
);
return
TRUE
;
}
...
...
@@ -487,8 +489,8 @@ BOOL NETCON_getNextLine(WININET_NETCONNECTION *connection, LPSTR lpszBuffer, LPD
pSSL_CTX_set_timeout
(
ctx
,
prev_timeout
);
if
(
success
)
{
lpszBuffer
[
nRecv
]
=
'\0'
;
*
dwBuffer
=
nRecv
-
1
;
lpszBuffer
[
nRecv
++
]
=
'\0'
;
*
dwBuffer
=
nRecv
;
TRACE
(
"_SSL:%d %s
\n
"
,
nRecv
,
lpszBuffer
);
return
TRUE
;
}
...
...
dlls/wininet/utility.c
View file @
a4e902cb
...
...
@@ -33,6 +33,7 @@
#include "winbase.h"
#include "wininet.h"
#include "winerror.h"
#include "winnls.h"
#include "wine/debug.h"
#include "internet.h"
...
...
@@ -41,17 +42,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(wininet);
#define TIME_STRING_LEN 30
time_t
ConvertTimeString
(
LPCSTR
asctime
)
time_t
ConvertTimeString
(
LPC
W
STR
asctime
)
{
char
tmpChar
[
TIME_STRING_LEN
];
char
*
tmpChar2
;
WCHAR
tmpChar
[
TIME_STRING_LEN
];
WCHAR
*
tmpChar2
;
struct
tm
t
;
int
timelen
=
strlen
(
asctime
);
int
timelen
=
strlen
W
(
asctime
);
if
(
!
asctime
||
!
timelen
)
return
0
;
strncpy
(
tmpChar
,
asctime
,
TIME_STRING_LEN
);
strncpy
W
(
tmpChar
,
asctime
,
TIME_STRING_LEN
);
/* Assert that the string is the expected length */
if
(
tmpChar
[
TIME_STRING_LEN
]
!=
'\0'
)
...
...
@@ -72,11 +73,11 @@ time_t ConvertTimeString(LPCSTR asctime)
tmpChar
[
22
]
=
'\0'
;
tmpChar
[
25
]
=
'\0'
;
t
.
tm_year
=
atoi
(
tmpChar
+
12
)
-
1900
;
t
.
tm_mday
=
atoi
(
tmpChar
+
5
);
t
.
tm_hour
=
atoi
(
tmpChar
+
17
);
t
.
tm_min
=
atoi
(
tmpChar
+
20
);
t
.
tm_sec
=
atoi
(
tmpChar
+
23
);
t
.
tm_year
=
atoi
W
(
tmpChar
+
12
)
-
1900
;
t
.
tm_mday
=
atoi
W
(
tmpChar
+
5
);
t
.
tm_hour
=
atoi
W
(
tmpChar
+
17
);
t
.
tm_min
=
atoi
W
(
tmpChar
+
20
);
t
.
tm_sec
=
atoi
W
(
tmpChar
+
23
);
/* and month */
tmpChar2
=
tmpChar
+
8
;
...
...
@@ -126,34 +127,36 @@ time_t ConvertTimeString(LPCSTR asctime)
}
BOOL
GetAddress
(
LPCSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
BOOL
GetAddress
(
LPC
W
STR
lpszServerName
,
INTERNET_PORT
nServerPort
,
struct
hostent
**
phe
,
struct
sockaddr_in
*
psa
)
{
char
*
found
;
WCHAR
*
found
;
char
*
name
;
int
len
,
sz
;
TRACE
(
"%s
\n
"
,
lpszServerName
);
TRACE
(
"%s
\n
"
,
debugstr_w
(
lpszServerName
)
);
/* Validate server name first
* Check if there is sth. like
* pinger.macromedia.com:80
* if yes, eliminate the :80....
*/
found
=
strchr
(
lpszServerName
,
':'
);
found
=
strchr
W
(
lpszServerName
,
':'
);
if
(
found
)
{
int
len
=
found
-
lpszServerName
;
char
*
new
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
+
1
);
memcpy
(
new
,
lpszServerName
,
len
);
new
[
len
]
=
'\0'
;
TRACE
(
"Found a ':' inside the server name, reparsed name: %s
\n
"
,
new
);
*
phe
=
gethostbyname
(
new
);
HeapFree
(
GetProcessHeap
(),
0
,
new
)
;
}
else
*
phe
=
gethostbyname
(
lpszServerName
);
len
=
found
-
lpszServerName
;
else
len
=
strlenW
(
lpszServerName
);
sz
=
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
lpszServerName
,
len
,
NULL
,
0
,
NULL
,
NULL
)
;
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sz
+
1
);
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
lpszServerName
,
len
,
name
,
sz
,
NULL
,
NULL
);
name
[
sz
]
=
0
;
*
phe
=
gethostbyname
(
name
);
HeapFree
(
GetProcessHeap
(),
0
,
name
);
if
(
NULL
==
*
phe
)
{
TRACE
(
"Failed to get hostname: (%s)
\n
"
,
lpszServerName
);
TRACE
(
"Failed to get hostname: (%s)
\n
"
,
debugstr_w
(
lpszServerName
)
);
return
FALSE
;
}
...
...
dlls/wininet/wininet.spec
View file @
a4e902cb
...
...
@@ -89,7 +89,7 @@
@ stdcall GopherOpenFileA(ptr str str long long)
@ stdcall GopherOpenFileW(ptr wstr wstr long long)
@ stdcall HttpAddRequestHeadersA(ptr str long long)
@ st
ub HttpAddRequestHeadersW
@ st
dcall HttpAddRequestHeadersW(ptr wstr long long)
@ stdcall HttpEndRequestA(ptr ptr long long)
@ stdcall HttpEndRequestW(ptr ptr long long)
@ stdcall HttpOpenRequestA(ptr str str str str ptr long long)
...
...
include/wininet.h
View file @
a4e902cb
...
...
@@ -1142,11 +1142,11 @@ BOOLAPI HttpQueryInfoW(HINTERNET ,DWORD ,LPVOID lpBuffer ,LPDWORD ,LPDWORD lpdwI
#define HttpQueryInfo WINELIB_NAME_AW(HttpQueryInfo)
BOOLAPI
InternetSetCookieA
(
LPCSTR
,
LPCSTR
,
LPCSTR
);
BOOLAPI
InternetSetCookieW
(
LPCSTR
,
LPCWSTR
,
LPCWSTR
);
BOOLAPI
InternetSetCookieW
(
LPC
W
STR
,
LPCWSTR
,
LPCWSTR
);
#define InternetSetCookie WINELIB_NAME_AW(InternetSetCookie)
BOOLAPI
InternetGetCookieA
(
LPCSTR
,
LPCSTR
,
LPSTR
,
LPDWORD
);
BOOLAPI
InternetGetCookieW
(
LPCSTR
,
LPCWSTR
,
LPWSTR
,
LPDWORD
);
BOOLAPI
InternetGetCookieW
(
LPC
W
STR
,
LPCWSTR
,
LPWSTR
,
LPDWORD
);
#define InternetGetCookie WINELIB_NAME_AW(InternetGetCookie)
INTERNETAPI
DWORD
WINAPI
InternetAttemptConnect
(
DWORD
);
...
...
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