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
f5987092
Commit
f5987092
authored
Jul 17, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 17, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Rename WININET_strdupW to standard heap_strdupW.
parent
b465a7da
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
65 deletions
+60
-65
ftp.c
dlls/wininet/ftp.c
+16
-20
http.c
dlls/wininet/http.c
+28
-35
internet.c
dlls/wininet/internet.c
+3
-6
internet.h
dlls/wininet/internet.h
+12
-3
utility.c
dlls/wininet/utility.c
+1
-1
No files found.
dlls/wininet/ftp.c
View file @
f5987092
...
...
@@ -307,8 +307,8 @@ BOOL WINAPI FtpPutFileW(HINTERNET hConnect, LPCWSTR lpszLocalFile,
workRequest
.
asyncproc
=
AsyncFtpPutFileProc
;
workRequest
.
hdr
=
WININET_AddRef
(
&
lpwfs
->
hdr
);
req
->
lpszLocalFile
=
WININET
_strdupW
(
lpszLocalFile
);
req
->
lpszNewRemoteFile
=
WININET
_strdupW
(
lpszNewRemoteFile
);
req
->
lpszLocalFile
=
heap
_strdupW
(
lpszLocalFile
);
req
->
lpszNewRemoteFile
=
heap
_strdupW
(
lpszNewRemoteFile
);
req
->
dwFlags
=
dwFlags
;
req
->
dwContext
=
dwContext
;
...
...
@@ -477,7 +477,7 @@ BOOL WINAPI FtpSetCurrentDirectoryW(HINTERNET hConnect, LPCWSTR lpszDirectory)
workRequest
.
asyncproc
=
AsyncFtpSetCurrentDirectoryProc
;
workRequest
.
hdr
=
WININET_AddRef
(
&
lpwfs
->
hdr
);
req
=
&
workRequest
.
u
.
FtpSetCurrentDirectoryW
;
req
->
lpszDirectory
=
WININET
_strdupW
(
lpszDirectory
);
req
->
lpszDirectory
=
heap
_strdupW
(
lpszDirectory
);
r
=
INTERNET_AsyncCall
(
&
workRequest
);
}
...
...
@@ -627,7 +627,7 @@ BOOL WINAPI FtpCreateDirectoryW(HINTERNET hConnect, LPCWSTR lpszDirectory)
workRequest
.
asyncproc
=
AsyncFtpCreateDirectoryProc
;
workRequest
.
hdr
=
WININET_AddRef
(
&
lpwfs
->
hdr
);
req
=
&
workRequest
.
u
.
FtpCreateDirectoryW
;
req
->
lpszDirectory
=
WININET
_strdupW
(
lpszDirectory
);
req
->
lpszDirectory
=
heap
_strdupW
(
lpszDirectory
);
r
=
INTERNET_AsyncCall
(
&
workRequest
);
}
...
...
@@ -771,7 +771,7 @@ HINTERNET WINAPI FtpFindFirstFileW(HINTERNET hConnect,
workRequest
.
asyncproc
=
AsyncFtpFindFirstFileProc
;
workRequest
.
hdr
=
WININET_AddRef
(
&
lpwfs
->
hdr
);
req
=
&
workRequest
.
u
.
FtpFindFirstFileW
;
req
->
lpszSearchFile
=
(
lpszSearchFile
==
NULL
)
?
NULL
:
WININET
_strdupW
(
lpszSearchFile
);
req
->
lpszSearchFile
=
(
lpszSearchFile
==
NULL
)
?
NULL
:
heap
_strdupW
(
lpszSearchFile
);
req
->
lpFindFileData
=
lpFindFileData
;
req
->
dwFlags
=
dwFlags
;
req
->
dwContext
=
dwContext
;
...
...
@@ -1431,7 +1431,7 @@ HINTERNET WINAPI FtpOpenFileW(HINTERNET hFtpSession,
workRequest
.
asyncproc
=
AsyncFtpOpenFileProc
;
workRequest
.
hdr
=
WININET_AddRef
(
&
lpwfs
->
hdr
);
req
=
&
workRequest
.
u
.
FtpOpenFileW
;
req
->
lpszFilename
=
WININET
_strdupW
(
lpszFileName
);
req
->
lpszFilename
=
heap
_strdupW
(
lpszFileName
);
req
->
dwAccess
=
fdwAccess
;
req
->
dwFlags
=
dwFlags
;
req
->
dwContext
=
dwContext
;
...
...
@@ -1552,8 +1552,8 @@ BOOL WINAPI FtpGetFileW(HINTERNET hInternet, LPCWSTR lpszRemoteFile, LPCWSTR lps
workRequest
.
asyncproc
=
AsyncFtpGetFileProc
;
workRequest
.
hdr
=
WININET_AddRef
(
&
lpwfs
->
hdr
);
req
=
&
workRequest
.
u
.
FtpGetFileW
;
req
->
lpszRemoteFile
=
WININET
_strdupW
(
lpszRemoteFile
);
req
->
lpszNewFile
=
WININET
_strdupW
(
lpszNewFile
);
req
->
lpszRemoteFile
=
heap
_strdupW
(
lpszRemoteFile
);
req
->
lpszNewFile
=
heap
_strdupW
(
lpszNewFile
);
req
->
dwLocalFlagsAttribute
=
dwLocalFlagsAttribute
;
req
->
fFailIfExists
=
fFailIfExists
;
req
->
dwFlags
=
dwInternetFlags
;
...
...
@@ -1743,7 +1743,7 @@ BOOL WINAPI FtpDeleteFileW(HINTERNET hFtpSession, LPCWSTR lpszFileName)
workRequest
.
asyncproc
=
AsyncFtpDeleteFileProc
;
workRequest
.
hdr
=
WININET_AddRef
(
&
lpwfs
->
hdr
);
req
=
&
workRequest
.
u
.
FtpDeleteFileW
;
req
->
lpszFilename
=
WININET
_strdupW
(
lpszFileName
);
req
->
lpszFilename
=
heap
_strdupW
(
lpszFileName
);
r
=
INTERNET_AsyncCall
(
&
workRequest
);
}
...
...
@@ -1888,7 +1888,7 @@ BOOL WINAPI FtpRemoveDirectoryW(HINTERNET hFtpSession, LPCWSTR lpszDirectory)
workRequest
.
asyncproc
=
AsyncFtpRemoveDirectoryProc
;
workRequest
.
hdr
=
WININET_AddRef
(
&
lpwfs
->
hdr
);
req
=
&
workRequest
.
u
.
FtpRemoveDirectoryW
;
req
->
lpszDirectory
=
WININET
_strdupW
(
lpszDirectory
);
req
->
lpszDirectory
=
heap
_strdupW
(
lpszDirectory
);
r
=
INTERNET_AsyncCall
(
&
workRequest
);
}
...
...
@@ -2038,8 +2038,8 @@ BOOL WINAPI FtpRenameFileW(HINTERNET hFtpSession, LPCWSTR lpszSrc, LPCWSTR lpszD
workRequest
.
asyncproc
=
AsyncFtpRenameFileProc
;
workRequest
.
hdr
=
WININET_AddRef
(
&
lpwfs
->
hdr
);
req
=
&
workRequest
.
u
.
FtpRenameFileW
;
req
->
lpszSrcFile
=
WININET
_strdupW
(
lpszSrc
);
req
->
lpszDestFile
=
WININET
_strdupW
(
lpszDest
);
req
->
lpszSrcFile
=
heap
_strdupW
(
lpszSrc
);
req
->
lpszDestFile
=
heap
_strdupW
(
lpszDest
);
r
=
INTERNET_AsyncCall
(
&
workRequest
);
}
...
...
@@ -2398,7 +2398,7 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
WCHAR
szPassword
[
MAX_PATH
];
DWORD
len
=
sizeof
(
szPassword
);
lpwfs
->
lpszUserName
=
WININET
_strdupW
(
szDefaultUsername
);
lpwfs
->
lpszUserName
=
heap
_strdupW
(
szDefaultUsername
);
RegOpenKeyW
(
HKEY_CURRENT_USER
,
szKey
,
&
key
);
if
(
RegQueryValueExW
(
key
,
szValue
,
NULL
,
NULL
,
(
LPBYTE
)
szPassword
,
&
len
))
{
...
...
@@ -2411,15 +2411,11 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
RegCloseKey
(
key
);
TRACE
(
"Password used for anonymous ftp : (%s)
\n
"
,
debugstr_w
(
szPassword
));
lpwfs
->
lpszPassword
=
WININET
_strdupW
(
szPassword
);
lpwfs
->
lpszPassword
=
heap
_strdupW
(
szPassword
);
}
else
{
lpwfs
->
lpszUserName
=
WININET_strdupW
(
lpszUserName
);
if
(
lpszPassword
)
lpwfs
->
lpszPassword
=
WININET_strdupW
(
lpszPassword
);
else
lpwfs
->
lpszPassword
=
WININET_strdupW
(
szEmpty
);
lpwfs
->
lpszUserName
=
heap_strdupW
(
lpszUserName
);
lpwfs
->
lpszPassword
=
heap_strdupW
(
lpszPassword
?
lpszPassword
:
szEmpty
);
}
/* Don't send a handle created callback if this handle was created with InternetOpenUrl */
...
...
dlls/wininet/http.c
View file @
f5987092
...
...
@@ -374,7 +374,7 @@ static void HTTP_FixURL(http_request_t *lpwhr)
/* If we don't have a path we set it to root */
if
(
NULL
==
lpwhr
->
lpszPath
)
lpwhr
->
lpszPath
=
WININET
_strdupW
(
szSlash
);
lpwhr
->
lpszPath
=
heap
_strdupW
(
szSlash
);
else
/* remove \r and \n*/
{
int
nLen
=
strlenW
(
lpwhr
->
lpszPath
);
...
...
@@ -528,7 +528,7 @@ static BOOL HTTP_DoAuthorization( http_request_t *lpwhr, LPCWSTR pszAuthValue,
if
(
is_basic_auth_value
(
pszAuthValue
))
{
static
const
WCHAR
szBasic
[]
=
{
'B'
,
'a'
,
's'
,
'i'
,
'c'
,
0
};
pAuthInfo
->
scheme
=
WININET
_strdupW
(
szBasic
);
pAuthInfo
->
scheme
=
heap
_strdupW
(
szBasic
);
if
(
!
pAuthInfo
->
scheme
)
{
HeapFree
(
GetProcessHeap
(),
0
,
pAuthInfo
);
...
...
@@ -540,7 +540,7 @@ static BOOL HTTP_DoAuthorization( http_request_t *lpwhr, LPCWSTR pszAuthValue,
PVOID
pAuthData
;
SEC_WINNT_AUTH_IDENTITY_W
nt_auth_identity
;
pAuthInfo
->
scheme
=
WININET
_strdupW
(
pszAuthValue
);
pAuthInfo
->
scheme
=
heap
_strdupW
(
pszAuthValue
);
if
(
!
pAuthInfo
->
scheme
)
{
HeapFree
(
GetProcessHeap
(),
0
,
pAuthInfo
);
...
...
@@ -911,7 +911,7 @@ static BOOL HTTP_HttpEndRequestW(http_request_t *lpwhr, DWORD dwFlags, DWORD_PTR
{
/* redirects are always GETs */
HeapFree
(
GetProcessHeap
(),
0
,
lpwhr
->
lpszVerb
);
lpwhr
->
lpszVerb
=
WININET
_strdupW
(
szGET
);
lpwhr
->
lpszVerb
=
heap
_strdupW
(
szGET
);
HTTP_DrainContent
(
lpwhr
);
if
((
new_url
=
HTTP_GetRedirectURL
(
lpwhr
,
szNewLocation
)))
{
...
...
@@ -1440,7 +1440,7 @@ static BOOL HTTP_DealWithProxy(appinfo_t *hIC, http_session_t *lpwhs, http_reque
UrlComponents
.
nPort
=
INTERNET_DEFAULT_HTTP_PORT
;
HeapFree
(
GetProcessHeap
(),
0
,
lpwhs
->
lpszServerName
);
lpwhs
->
lpszServerName
=
WININET
_strdupW
(
UrlComponents
.
lpszHostName
);
lpwhs
->
lpszServerName
=
heap
_strdupW
(
UrlComponents
.
lpszHostName
);
lpwhs
->
nServerPort
=
UrlComponents
.
nPort
;
TRACE
(
"proxy server=%s port=%d
\n
"
,
debugstr_w
(
lpwhs
->
lpszServerName
),
lpwhs
->
nServerPort
);
...
...
@@ -1812,12 +1812,12 @@ static DWORD HTTPREQ_SetOption(object_header_t *hdr, DWORD option, void *buffer,
case
INTERNET_OPTION_USERNAME
:
HeapFree
(
GetProcessHeap
(),
0
,
req
->
lpHttpSession
->
lpszUserName
);
if
(
!
(
req
->
lpHttpSession
->
lpszUserName
=
WININET
_strdupW
(
buffer
)))
return
ERROR_OUTOFMEMORY
;
if
(
!
(
req
->
lpHttpSession
->
lpszUserName
=
heap
_strdupW
(
buffer
)))
return
ERROR_OUTOFMEMORY
;
return
ERROR_SUCCESS
;
case
INTERNET_OPTION_PASSWORD
:
HeapFree
(
GetProcessHeap
(),
0
,
req
->
lpHttpSession
->
lpszPassword
);
if
(
!
(
req
->
lpHttpSession
->
lpszPassword
=
WININET
_strdupW
(
buffer
)))
return
ERROR_OUTOFMEMORY
;
if
(
!
(
req
->
lpHttpSession
->
lpszPassword
=
heap
_strdupW
(
buffer
)))
return
ERROR_OUTOFMEMORY
;
return
ERROR_SUCCESS
;
case
INTERNET_OPTION_HTTP_DECODING
:
if
(
size
!=
sizeof
(
BOOL
))
...
...
@@ -2467,7 +2467,7 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(http_session_t *lpwhs,
}
else
{
static
const
WCHAR
slashW
[]
=
{
'/'
,
0
};
lpwhr
->
lpszPath
=
WININET
_strdupW
(
slashW
);
lpwhr
->
lpszPath
=
heap
_strdupW
(
slashW
);
}
if
(
lpszReferrer
&&
*
lpszReferrer
)
...
...
@@ -2486,12 +2486,8 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(http_session_t *lpwhs,
}
}
lpwhr
->
lpszVerb
=
WININET_strdupW
(
lpszVerb
&&
*
lpszVerb
?
lpszVerb
:
szGET
);
if
(
lpszVersion
)
lpwhr
->
lpszVersion
=
WININET_strdupW
(
lpszVersion
);
else
lpwhr
->
lpszVersion
=
WININET_strdupW
(
g_szHttp1_1
);
lpwhr
->
lpszVerb
=
heap_strdupW
(
lpszVerb
&&
*
lpszVerb
?
lpszVerb
:
szGET
);
lpwhr
->
lpszVersion
=
heap_strdupW
(
lpszVersion
?
lpszVersion
:
g_szHttp1_1
);
if
(
lpwhs
->
nHostPort
!=
INTERNET_INVALID_PORT_NUMBER
&&
lpwhs
->
nHostPort
!=
INTERNET_DEFAULT_HTTP_PORT
&&
...
...
@@ -3161,11 +3157,8 @@ BOOL WINAPI HttpSendRequestExW(HINTERNET hRequest,
req
=
&
workRequest
.
u
.
HttpSendRequestW
;
if
(
lpBuffersIn
)
{
if
(
lpBuffersIn
->
lpcszHeader
)
/* FIXME: this should use dwHeadersLength or may not be necessary at all */
req
->
lpszHeader
=
WININET_strdupW
(
lpBuffersIn
->
lpcszHeader
);
else
req
->
lpszHeader
=
NULL
;
/* FIXME: this should use dwHeadersLength or may not be necessary at all */
req
->
lpszHeader
=
heap_strdupW
(
lpBuffersIn
->
lpcszHeader
);
req
->
dwHeaderLength
=
lpBuffersIn
->
dwHeadersLength
;
req
->
lpOptional
=
lpBuffersIn
->
lpvBuffer
;
req
->
dwOptionalLength
=
lpBuffersIn
->
dwBufferLength
;
...
...
@@ -3480,21 +3473,21 @@ static BOOL HTTP_HandleRedirect(http_request_t *lpwhr, LPCWSTR lpszUrl)
sprintfW
(
lpwhs
->
lpszHostName
,
fmt
,
hostName
,
urlComponents
.
nPort
);
}
else
lpwhs
->
lpszHostName
=
WININET
_strdupW
(
hostName
);
lpwhs
->
lpszHostName
=
heap
_strdupW
(
hostName
);
HTTP_ProcessHeader
(
lpwhr
,
hostW
,
lpwhs
->
lpszHostName
,
HTTP_ADDREQ_FLAG_ADD
|
HTTP_ADDREQ_FLAG_REPLACE
|
HTTP_ADDHDR_FLAG_REQ
);
HeapFree
(
GetProcessHeap
(),
0
,
lpwhs
->
lpszUserName
);
lpwhs
->
lpszUserName
=
NULL
;
if
(
userName
[
0
])
lpwhs
->
lpszUserName
=
WININET
_strdupW
(
userName
);
lpwhs
->
lpszUserName
=
heap
_strdupW
(
userName
);
if
(
!
using_proxy
)
{
if
(
strcmpiW
(
lpwhs
->
lpszServerName
,
hostName
)
||
lpwhs
->
nServerPort
!=
urlComponents
.
nPort
)
{
HeapFree
(
GetProcessHeap
(),
0
,
lpwhs
->
lpszServerName
);
lpwhs
->
lpszServerName
=
WININET
_strdupW
(
hostName
);
lpwhs
->
lpszServerName
=
heap
_strdupW
(
hostName
);
lpwhs
->
nServerPort
=
urlComponents
.
nPort
;
NETCON_close
(
&
lpwhr
->
netConnection
);
...
...
@@ -3665,7 +3658,7 @@ BOOL WINAPI HTTP_HttpSendRequestW(http_request_t *lpwhr, LPCWSTR lpszHeaders,
/* if the verb is NULL default to GET */
if
(
!
lpwhr
->
lpszVerb
)
lpwhr
->
lpszVerb
=
WININET
_strdupW
(
szGET
);
lpwhr
->
lpszVerb
=
heap
_strdupW
(
szGET
);
if
(
dwContentLength
||
strcmpW
(
lpwhr
->
lpszVerb
,
szGET
))
{
...
...
@@ -3813,7 +3806,7 @@ BOOL WINAPI HTTP_HttpSendRequestW(http_request_t *lpwhr, LPCWSTR lpszHeaders,
{
/* redirects are always GETs */
HeapFree
(
GetProcessHeap
(),
0
,
lpwhr
->
lpszVerb
);
lpwhr
->
lpszVerb
=
WININET
_strdupW
(
szGET
);
lpwhr
->
lpszVerb
=
heap
_strdupW
(
szGET
);
HTTP_DrainContent
(
lpwhr
);
if
((
new_url
=
HTTP_GetRedirectURL
(
lpwhr
,
szNewLocation
)))
...
...
@@ -3885,7 +3878,7 @@ BOOL WINAPI HTTP_HttpSendRequestW(http_request_t *lpwhr, LPCWSTR lpszHeaders,
b
=
CreateUrlCacheEntryW
(
url
,
lpwhr
->
dwContentLength
>
0
?
lpwhr
->
dwContentLength
:
0
,
NULL
,
cacheFileName
,
0
);
if
(
b
)
{
lpwhr
->
lpszCacheFile
=
WININET
_strdupW
(
cacheFileName
);
lpwhr
->
lpszCacheFile
=
heap
_strdupW
(
cacheFileName
);
lpwhr
->
hCacheFile
=
CreateFileW
(
lpwhr
->
lpszCacheFile
,
GENERIC_WRITE
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
lpwhr
->
hCacheFile
==
INVALID_HANDLE_VALUE
)
{
...
...
@@ -3980,13 +3973,13 @@ static DWORD HTTPSESSION_SetOption(object_header_t *hdr, DWORD option, void *buf
case
INTERNET_OPTION_USERNAME
:
{
HeapFree
(
GetProcessHeap
(),
0
,
ses
->
lpszUserName
);
if
(
!
(
ses
->
lpszUserName
=
WININET
_strdupW
(
buffer
)))
return
ERROR_OUTOFMEMORY
;
if
(
!
(
ses
->
lpszUserName
=
heap
_strdupW
(
buffer
)))
return
ERROR_OUTOFMEMORY
;
return
ERROR_SUCCESS
;
}
case
INTERNET_OPTION_PASSWORD
:
{
HeapFree
(
GetProcessHeap
(),
0
,
ses
->
lpszPassword
);
if
(
!
(
ses
->
lpszPassword
=
WININET
_strdupW
(
buffer
)))
return
ERROR_OUTOFMEMORY
;
if
(
!
(
ses
->
lpszPassword
=
heap
_strdupW
(
buffer
)))
return
ERROR_OUTOFMEMORY
;
return
ERROR_SUCCESS
;
}
default:
break
;
...
...
@@ -4075,13 +4068,13 @@ HINTERNET HTTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
}
if
(
lpszServerName
&&
lpszServerName
[
0
])
{
lpwhs
->
lpszServerName
=
WININET
_strdupW
(
lpszServerName
);
lpwhs
->
lpszHostName
=
WININET
_strdupW
(
lpszServerName
);
lpwhs
->
lpszServerName
=
heap
_strdupW
(
lpszServerName
);
lpwhs
->
lpszHostName
=
heap
_strdupW
(
lpszServerName
);
}
if
(
lpszUserName
&&
lpszUserName
[
0
])
lpwhs
->
lpszUserName
=
WININET
_strdupW
(
lpszUserName
);
lpwhs
->
lpszUserName
=
heap
_strdupW
(
lpszUserName
);
if
(
lpszPassword
&&
lpszPassword
[
0
])
lpwhs
->
lpszPassword
=
WININET
_strdupW
(
lpszPassword
);
lpwhs
->
lpszPassword
=
heap
_strdupW
(
lpszPassword
);
lpwhs
->
nServerPort
=
nServerPort
;
lpwhs
->
nHostPort
=
nServerPort
;
...
...
@@ -4306,8 +4299,8 @@ static INT HTTP_GetResponseHeaders(http_request_t *lpwhr, BOOL clear)
HeapFree
(
GetProcessHeap
(),
0
,
lpwhr
->
lpszVersion
);
HeapFree
(
GetProcessHeap
(),
0
,
lpwhr
->
lpszStatusText
);
lpwhr
->
lpszVersion
=
WININET
_strdupW
(
buffer
);
lpwhr
->
lpszStatusText
=
WININET
_strdupW
(
status_text
);
lpwhr
->
lpszVersion
=
heap
_strdupW
(
buffer
);
lpwhr
->
lpszStatusText
=
heap
_strdupW
(
status_text
);
/* Restore the spaces */
*
(
status_code
-
1
)
=
' '
;
...
...
@@ -4698,8 +4691,8 @@ static BOOL HTTP_InsertCustomHeader(http_request_t *lpwhr, LPHTTPHEADERW lpHdr)
if
(
NULL
!=
lph
)
{
lpwhr
->
pCustHeaders
=
lph
;
lpwhr
->
pCustHeaders
[
count
-
1
].
lpszField
=
WININET
_strdupW
(
lpHdr
->
lpszField
);
lpwhr
->
pCustHeaders
[
count
-
1
].
lpszValue
=
WININET
_strdupW
(
lpHdr
->
lpszValue
);
lpwhr
->
pCustHeaders
[
count
-
1
].
lpszField
=
heap
_strdupW
(
lpHdr
->
lpszField
);
lpwhr
->
pCustHeaders
[
count
-
1
].
lpszValue
=
heap
_strdupW
(
lpHdr
->
lpszValue
);
lpwhr
->
pCustHeaders
[
count
-
1
].
wFlags
=
lpHdr
->
wFlags
;
lpwhr
->
pCustHeaders
[
count
-
1
].
wCount
=
lpHdr
->
wCount
;
lpwhr
->
nCustHeaders
++
;
...
...
dlls/wininet/internet.c
View file @
f5987092
...
...
@@ -2982,12 +2982,9 @@ HINTERNET WINAPI InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl,
workRequest
.
asyncproc
=
AsyncInternetOpenUrlProc
;
workRequest
.
hdr
=
WININET_AddRef
(
&
hIC
->
hdr
);
req
=
&
workRequest
.
u
.
InternetOpenUrlW
;
req
->
lpszUrl
=
WININET_strdupW
(
lpszUrl
);
if
(
lpszHeaders
)
req
->
lpszHeaders
=
WININET_strdupW
(
lpszHeaders
);
else
req
->
lpszHeaders
=
0
;
req
=
&
workRequest
.
u
.
InternetOpenUrlW
;
req
->
lpszUrl
=
heap_strdupW
(
lpszUrl
);
req
->
lpszHeaders
=
heap_strdupW
(
lpszHeaders
);
req
->
dwHeadersLength
=
dwHeadersLength
;
req
->
dwFlags
=
dwFlags
;
req
->
dwContext
=
dwContext
;
...
...
dlls/wininet/internet.h
View file @
f5987092
...
...
@@ -55,10 +55,19 @@ typedef struct
void
*
ssl_s
;
}
WININET_NETCONNECTION
;
static
inline
LPWSTR
WININET_strdupW
(
LPCWSTR
str
)
static
inline
LPWSTR
heap_strdupW
(
LPCWSTR
str
)
{
LPWSTR
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
strlenW
(
str
)
+
1
)
*
sizeof
(
WCHAR
)
);
if
(
ret
)
strcpyW
(
ret
,
str
);
LPWSTR
ret
=
NULL
;
if
(
str
)
{
DWORD
size
;
size
=
(
strlenW
(
str
)
+
1
)
*
sizeof
(
WCHAR
);
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
ret
)
memcpy
(
ret
,
str
,
size
);
}
return
ret
;
}
...
...
dlls/wininet/utility.c
View file @
f5987092
...
...
@@ -310,7 +310,7 @@ VOID INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR dwContext,
break
;
case
INTERNET_STATUS_RESOLVING_NAME
:
case
INTERNET_STATUS_REDIRECT
:
lpvNewInfo
=
WININET
_strdupW
(
lpvStatusInfo
);
lpvNewInfo
=
heap
_strdupW
(
lpvStatusInfo
);
break
;
}
}
else
{
...
...
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