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
f57360af
Commit
f57360af
authored
May 15, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
May 16, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Return correct errors in InternetConnectW
parent
336e67e2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
1 deletion
+38
-1
internet.c
dlls/wininet/internet.c
+10
-1
internet.c
dlls/wininet/tests/internet.c
+28
-0
No files found.
dlls/wininet/internet.c
View file @
f57360af
...
...
@@ -812,17 +812,26 @@ HINTERNET WINAPI InternetConnectW(HINTERNET hInternet,
DWORD
dwService
,
DWORD
dwFlags
,
DWORD
dwContext
)
{
LPWININETAPPINFOW
hIC
;
HINTERNET
rc
=
(
HINTERNET
)
NULL
;
HINTERNET
rc
=
NULL
;
TRACE
(
"(%p, %s, %i, %s, %s, %li, %li, %li)
\n
"
,
hInternet
,
debugstr_w
(
lpszServerName
),
nServerPort
,
debugstr_w
(
lpszUserName
),
debugstr_w
(
lpszPassword
),
dwService
,
dwFlags
,
dwContext
);
if
(
!
lpszServerName
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
NULL
;
}
/* Clear any error information */
INTERNET_SetLastError
(
0
);
hIC
=
(
LPWININETAPPINFOW
)
WININET_GetObject
(
hInternet
);
if
(
(
hIC
==
NULL
)
||
(
hIC
->
hdr
.
htype
!=
WH_HINIT
)
)
{
SetLastError
(
ERROR_INVALID_HANDLE
);
goto
lend
;
}
switch
(
dwService
)
{
...
...
dlls/wininet/tests/internet.c
View file @
f57360af
...
...
@@ -119,8 +119,36 @@ static void test_get_cookie(void)
ret
?
"TRUE"
:
"FALSE"
,
GetLastError
());
}
static
void
test_null
(
void
)
{
HINTERNET
hi
,
hc
;
static
const
WCHAR
szServer
[]
=
{
's'
,
'e'
,
'r'
,
'v'
,
'e'
,
'r'
,
0
};
hi
=
InternetOpenW
(
NULL
,
0
,
NULL
,
NULL
,
0
);
ok
(
hi
!=
NULL
,
"open failed
\n
"
);
hc
=
InternetConnectW
(
hi
,
NULL
,
0
,
NULL
,
NULL
,
0
,
0
,
0
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"wrong error
\n
"
);
ok
(
hc
==
NULL
,
"connect failed
\n
"
);
hc
=
InternetConnectW
(
hi
,
NULL
,
0
,
NULL
,
NULL
,
INTERNET_SERVICE_HTTP
,
0
,
0
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"wrong error
\n
"
);
ok
(
hc
==
NULL
,
"connect failed
\n
"
);
hc
=
InternetConnectW
(
hi
,
NULL
,
0
,
NULL
,
NULL
,
INTERNET_SERVICE_FTP
,
0
,
0
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"wrong error
\n
"
);
ok
(
hc
==
NULL
,
"connect failed
\n
"
);
hc
=
InternetConnectW
(
NULL
,
szServer
,
0
,
NULL
,
NULL
,
INTERNET_SERVICE_FTP
,
0
,
0
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"wrong error
\n
"
);
ok
(
hc
==
NULL
,
"connect failed
\n
"
);
InternetCloseHandle
(
hi
);
}
START_TEST
(
internet
)
{
InternetQueryOptionA_test
();
test_get_cookie
();
test_null
();
}
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