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
3098e3c3
Commit
3098e3c3
authored
Feb 18, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 18, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Address string should never be converted to UNICODE in status notifications.
parent
2544999e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
46 deletions
+59
-46
protocol.c
dlls/urlmon/protocol.c
+12
-3
http.c
dlls/wininet/tests/http.c
+24
-6
utility.c
dlls/wininet/utility.c
+23
-37
No files found.
dlls/urlmon/protocol.c
View file @
3098e3c3
...
...
@@ -115,10 +115,19 @@ static void WINAPI internet_status_callback(HINTERNET internet, DWORD_PTR contex
report_progress
(
protocol
,
BINDSTATUS_FINDINGRESOURCE
,
(
LPWSTR
)
status_info
);
break
;
case
INTERNET_STATUS_CONNECTING_TO_SERVER
:
TRACE
(
"%p INTERNET_STATUS_CONNECTING_TO_SERVER
\n
"
,
protocol
);
report_progress
(
protocol
,
BINDSTATUS_CONNECTING
,
(
LPWSTR
)
status_info
);
case
INTERNET_STATUS_CONNECTING_TO_SERVER
:
{
WCHAR
*
info
;
TRACE
(
"%p INTERNET_STATUS_CONNECTING_TO_SERVER %s
\n
"
,
protocol
,
(
const
char
*
)
status_info
);
info
=
heap_strdupAtoW
(
status_info
);
if
(
!
info
)
return
;
report_progress
(
protocol
,
BINDSTATUS_CONNECTING
,
info
);
heap_free
(
info
);
break
;
}
case
INTERNET_STATUS_SENDING_REQUEST
:
TRACE
(
"%p INTERNET_STATUS_SENDING_REQUEST
\n
"
,
protocol
);
...
...
dlls/wininet/tests/http.c
View file @
3098e3c3
...
...
@@ -159,6 +159,7 @@ static const test_data_t test_data[] = {
};
static
INTERNET_STATUS_CALLBACK
(
WINAPI
*
pInternetSetStatusCallbackA
)(
HINTERNET
,
INTERNET_STATUS_CALLBACK
);
static
INTERNET_STATUS_CALLBACK
(
WINAPI
*
pInternetSetStatusCallbackW
)(
HINTERNET
,
INTERNET_STATUS_CALLBACK
);
static
BOOL
(
WINAPI
*
pInternetGetSecurityInfoByURLA
)(
LPSTR
,
PCCERT_CHAIN_CONTEXT
*
,
DWORD
*
);
static
int
strcmp_wa
(
LPCWSTR
strw
,
const
char
*
stra
)
...
...
@@ -321,12 +322,16 @@ static VOID WINAPI callback(
trace
(
"%04x:Callback %p 0x%lx INTERNET_STATUS_CONNECTING_TO_SERVER
\"
%s
\"
%d
\n
"
,
GetCurrentThreadId
(),
hInternet
,
dwContext
,
(
LPCSTR
)
lpvStatusInformation
,
dwStatusInformationLength
);
ok
(
dwStatusInformationLength
==
strlen
(
lpvStatusInformation
)
+
1
,
"unexpected size %u
\n
"
,
dwStatusInformationLength
);
*
(
LPSTR
)
lpvStatusInformation
=
'\0'
;
break
;
case
INTERNET_STATUS_CONNECTED_TO_SERVER
:
trace
(
"%04x:Callback %p 0x%lx INTERNET_STATUS_CONNECTED_TO_SERVER
\"
%s
\"
%d
\n
"
,
GetCurrentThreadId
(),
hInternet
,
dwContext
,
(
LPCSTR
)
lpvStatusInformation
,
dwStatusInformationLength
);
ok
(
dwStatusInformationLength
==
strlen
(
lpvStatusInformation
)
+
1
,
"unexpected size %u
\n
"
,
dwStatusInformationLength
);
*
(
LPSTR
)
lpvStatusInformation
=
'\0'
;
break
;
case
INTERNET_STATUS_SENDING_REQUEST
:
...
...
@@ -3595,19 +3600,27 @@ static void WINAPI cb(HINTERNET handle, DWORD_PTR context, DWORD status, LPVOID
trace
(
"%p 0x%08lx %u %p 0x%08x
\n
"
,
handle
,
context
,
status
,
info
,
size
);
if
(
status
==
INTERNET_STATUS_REQUEST_COMPLETE
)
{
switch
(
status
)
{
case
INTERNET_STATUS_REQUEST_COMPLETE
:
trace
(
"request handle: 0x%08lx
\n
"
,
result
->
dwResult
);
ctx
->
req
=
(
HINTERNET
)
result
->
dwResult
;
SetEvent
(
ctx
->
event
);
}
if
(
status
==
INTERNET_STATUS_HANDLE_CLOSING
)
{
break
;
case
INTERNET_STATUS_HANDLE_CLOSING
:
{
DWORD
type
=
INTERNET_HANDLE_TYPE_CONNECT_HTTP
,
size
=
sizeof
(
type
);
if
(
InternetQueryOption
(
handle
,
INTERNET_OPTION_HANDLE_TYPE
,
&
type
,
&
size
))
ok
(
type
!=
INTERNET_HANDLE_TYPE_CONNECT_HTTP
,
"unexpected callback
\n
"
);
SetEvent
(
ctx
->
event
);
break
;
}
case
INTERNET_STATUS_NAME_RESOLVED
:
case
INTERNET_STATUS_CONNECTING_TO_SERVER
:
case
INTERNET_STATUS_CONNECTED_TO_SERVER
:
{
char
*
str
=
info
;
ok
(
str
[
0
]
&&
str
[
1
],
"Got string: %s
\n
"
,
str
);
ok
(
size
==
strlen
(
str
)
+
1
,
"unexpected size %u
\n
"
,
size
);
}
}
}
...
...
@@ -3619,6 +3632,10 @@ static void test_open_url_async(void)
struct
context
ctx
;
ULONG
type
;
/* Collect all existing persistent connections */
ret
=
InternetSetOptionA
(
NULL
,
INTERNET_OPTION_SETTINGS_CHANGED
,
NULL
,
0
);
ok
(
ret
,
"InternetSetOption(INTERNET_OPTION_END_BROWSER_SESSION) failed: %u
\n
"
,
GetLastError
());
ctx
.
req
=
NULL
;
ctx
.
event
=
CreateEvent
(
NULL
,
TRUE
,
FALSE
,
"Z:_home_hans_jaman-installer.exe_ev1"
);
...
...
@@ -3636,7 +3653,7 @@ static void test_open_url_async(void)
ok
(
!
ret
,
"InternetSetOptionA failed
\n
"
);
ok
(
error
==
ERROR_INTERNET_OPTION_NOT_SETTABLE
,
"got %u expected ERROR_INTERNET_OPTION_NOT_SETTABLE
\n
"
,
error
);
pInternetSetStatusCallback
A
(
ses
,
cb
);
pInternetSetStatusCallback
W
(
ses
,
cb
);
ResetEvent
(
ctx
.
event
);
req
=
InternetOpenUrl
(
ses
,
"http://test.winehq.org"
,
NULL
,
0
,
0
,
(
DWORD_PTR
)
&
ctx
);
...
...
@@ -4123,6 +4140,7 @@ START_TEST(http)
}
pInternetSetStatusCallbackA
=
(
void
*
)
GetProcAddress
(
hdll
,
"InternetSetStatusCallbackA"
);
pInternetSetStatusCallbackW
=
(
void
*
)
GetProcAddress
(
hdll
,
"InternetSetStatusCallbackW"
);
pInternetGetSecurityInfoByURLA
=
(
void
*
)
GetProcAddress
(
hdll
,
"InternetGetSecurityInfoByURLA"
);
init_status_tests
();
...
...
dlls/wininet/utility.c
View file @
3098e3c3
...
...
@@ -298,62 +298,48 @@ static const char *debugstr_status_info(DWORD status, void *info)
}
}
VOID
INTERNET_SendCallback
(
object_header_t
*
hdr
,
DWORD_PTR
dwContext
,
DWORD
dwInternetStatus
,
LPVOID
lpvStatusInfo
,
DWORD
dwStatusInfoLength
)
void
INTERNET_SendCallback
(
object_header_t
*
hdr
,
DWORD_PTR
context
,
DWORD
status
,
void
*
info
,
DWORD
info_len
)
{
LPVOID
lpvNewInfo
=
NULL
;
void
*
new_info
=
info
;
if
(
!
hdr
->
lpfnStatusCB
)
return
;
/* the IE5 version of wininet does not
send callbacks if dwContext is zero */
if
(
!
dwContext
)
if
(
!
context
)
return
;
lpvNewInfo
=
lpvStatusInfo
;
if
(
hdr
->
dwInternalFlags
&
INET_CALLBACKW
)
{
switch
(
dwInternetStatus
)
{
case
INTERNET_STATUS_NAME_RESOLVED
:
case
INTERNET_STATUS_CONNECTING_TO_SERVER
:
case
INTERNET_STATUS_CONNECTED_TO_SERVER
:
lpvNewInfo
=
heap_strdupAtoW
(
lpvStatusInfo
);
dwStatusInfoLength
*=
sizeof
(
WCHAR
);
break
;
case
INTERNET_STATUS_RESOLVING_NAME
:
case
INTERNET_STATUS_REDIRECT
:
lpvNewInfo
=
heap_strdupW
(
lpvStatusInfo
);
break
;
}
}
else
{
switch
(
dwInternetStatus
)
{
case
INTERNET_STATUS_NAME_RESOLVED
:
case
INTERNET_STATUS_CONNECTING_TO_SERVER
:
case
INTERNET_STATUS_CONNECTED_TO_SERVER
:
lpvNewInfo
=
heap_alloc
(
strlen
(
lpvStatusInfo
)
+
1
);
if
(
lpvNewInfo
)
strcpy
(
lpvNewInfo
,
lpvStatusInfo
);
switch
(
status
)
{
case
INTERNET_STATUS_NAME_RESOLVED
:
case
INTERNET_STATUS_CONNECTING_TO_SERVER
:
case
INTERNET_STATUS_CONNECTED_TO_SERVER
:
new_info
=
heap_alloc
(
info_len
);
if
(
new_info
)
memcpy
(
new_info
,
info
,
info_len
);
break
;
case
INTERNET_STATUS_RESOLVING_NAME
:
case
INTERNET_STATUS_REDIRECT
:
if
(
hdr
->
dwInternalFlags
&
INET_CALLBACKW
)
{
new_info
=
heap_strdupW
(
info
);
break
;
case
INTERNET_STATUS_RESOLVING_NAME
:
case
INTERNET_STATUS_REDIRECT
:
lpvNewInfo
=
heap_strdupWtoA
(
lpvStatusInfo
);
dwStatusInfoLength
/=
sizeof
(
WCHAR
);
}
else
{
new_info
=
heap_strdupWtoA
(
info
);
info_len
=
strlen
(
new_info
)
+
1
;
break
;
}
}
TRACE
(
" callback(%p) (%p (%p), %08lx, %d (%s), %s, %d)
\n
"
,
hdr
->
lpfnStatusCB
,
hdr
->
hInternet
,
hdr
,
dwContext
,
dwInternetStatus
,
get_callback_name
(
dwInternetS
tatus
),
debugstr_status_info
(
dwInternetStatus
,
lpvNewInfo
),
dwStatusInfoLength
);
hdr
->
lpfnStatusCB
,
hdr
->
hInternet
,
hdr
,
context
,
status
,
get_callback_name
(
s
tatus
),
debugstr_status_info
(
status
,
new_info
),
info_len
);
hdr
->
lpfnStatusCB
(
hdr
->
hInternet
,
dwContext
,
dwInternetStatus
,
lpvNewInfo
,
dwStatusInfoLength
);
hdr
->
lpfnStatusCB
(
hdr
->
hInternet
,
context
,
status
,
new_info
,
info_len
);
TRACE
(
" end callback().
\n
"
);
if
(
lpvNewInfo
!=
lpvStatusI
nfo
)
heap_free
(
lpvNewI
nfo
);
if
(
new_info
!=
i
nfo
)
heap_free
(
new_i
nfo
);
}
typedef
struct
{
...
...
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