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
e018a5e2
Commit
e018a5e2
authored
Dec 04, 2009
by
Hans Leidekker
Committed by
Alexandre Julliard
Dec 04, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Add a test for status callbacks on ftp connections.
parent
5f082498
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
ftp.c
dlls/wininet/tests/ftp.c
+48
-0
No files found.
dlls/wininet/tests/ftp.c
View file @
e018a5e2
...
...
@@ -42,6 +42,7 @@
static
BOOL
(
WINAPI
*
pFtpCommandA
)(
HINTERNET
,
BOOL
,
DWORD
,
LPCSTR
,
DWORD_PTR
,
HINTERNET
*
);
static
INTERNET_STATUS_CALLBACK
(
WINAPI
*
pInternetSetStatusCallbackA
)(
HINTERNET
,
INTERNET_STATUS_CALLBACK
);
static
void
test_getfile_no_open
(
void
)
...
...
@@ -908,6 +909,51 @@ static void test_get_current_dir(HINTERNET hFtp, HINTERNET hConnect)
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got: %d
\n
"
,
GetLastError
());
}
static
void
WINAPI
status_callback
(
HINTERNET
handle
,
DWORD_PTR
ctx
,
DWORD
status
,
LPVOID
info
,
DWORD
info_len
)
{
switch
(
status
)
{
case
INTERNET_STATUS_RESOLVING_NAME
:
case
INTERNET_STATUS_NAME_RESOLVED
:
case
INTERNET_STATUS_CONNECTING_TO_SERVER
:
case
INTERNET_STATUS_CONNECTED_TO_SERVER
:
trace
(
"%p %lx %u %s %u
\n
"
,
handle
,
ctx
,
status
,
(
char
*
)
info
,
info_len
);
break
;
default:
break
;
}
}
static
void
test_status_callbacks
(
HINTERNET
hInternet
)
{
INTERNET_STATUS_CALLBACK
cb
;
HINTERNET
hFtp
;
BOOL
ret
;
if
(
!
pInternetSetStatusCallbackA
)
{
win_skip
(
"InternetSetStatusCallbackA() is not available, skipping test
\n
"
);
return
;
}
cb
=
pInternetSetStatusCallbackA
(
hInternet
,
status_callback
);
ok
(
cb
==
NULL
,
"expected NULL got %p
\n
"
,
cb
);
hFtp
=
InternetConnect
(
hInternet
,
"ftp.winehq.org"
,
INTERNET_DEFAULT_FTP_PORT
,
"anonymous"
,
NULL
,
INTERNET_SERVICE_FTP
,
INTERNET_FLAG_PASSIVE
,
1
);
if
(
!
hFtp
)
{
skip
(
"No ftp connection could be made to ftp.winehq.org %u
\n
"
,
GetLastError
());
return
;
}
ret
=
InternetCloseHandle
(
hFtp
);
ok
(
ret
,
"InternetCloseHandle failed %u
\n
"
,
GetLastError
());
cb
=
pInternetSetStatusCallbackA
(
hInternet
,
NULL
);
ok
(
cb
==
status_callback
,
"expected check_status got %p
\n
"
,
cb
);
}
START_TEST
(
ftp
)
{
HMODULE
hWininet
;
...
...
@@ -915,6 +961,7 @@ START_TEST(ftp)
hWininet
=
GetModuleHandleA
(
"wininet.dll"
);
pFtpCommandA
=
(
void
*
)
GetProcAddress
(
hWininet
,
"FtpCommandA"
);
pInternetSetStatusCallbackA
=
(
void
*
)
GetProcAddress
(
hWininet
,
"InternetSetStatusCallbackA"
);
SetLastError
(
0xdeadbeef
);
hInternet
=
InternetOpen
(
"winetest"
,
0
,
NULL
,
NULL
,
0
);
...
...
@@ -956,6 +1003,7 @@ START_TEST(ftp)
test_command
(
hFtp
,
hHttp
);
test_find_first_file
(
hFtp
,
hHttp
);
test_get_current_dir
(
hFtp
,
hHttp
);
test_status_callbacks
(
hInternet
);
InternetCloseHandle
(
hHttp
);
InternetCloseHandle
(
hFtp
);
...
...
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