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
c4c3ff47
Commit
c4c3ff47
authored
Sep 04, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 04, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Set last error for invalid URL argument.
parent
b6ed7acc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
6 deletions
+44
-6
cookie.c
dlls/wininet/cookie.c
+4
-1
internet.c
dlls/wininet/tests/internet.c
+40
-5
No files found.
dlls/wininet/cookie.c
View file @
c4c3ff47
...
...
@@ -360,7 +360,10 @@ BOOL WINAPI InternetGetCookieW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName,
host
[
0
]
=
0
;
ret
=
COOKIE_crackUrlSimple
(
lpszUrl
,
host
,
sizeof
(
host
)
/
sizeof
(
host
[
0
]),
path
,
sizeof
(
path
)
/
sizeof
(
path
[
0
]));
if
(
!
ret
||
!
host
[
0
])
return
FALSE
;
if
(
!
ret
||
!
host
[
0
])
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
return
get_cookie
(
host
,
path
,
lpCookieData
,
lpdwSize
);
}
...
...
dlls/wininet/tests/internet.c
View file @
c4c3ff47
...
...
@@ -40,6 +40,8 @@ static BOOL (WINAPI *pInternetTimeToSystemTimeW)(LPCWSTR ,SYSTEMTIME *,DWORD);
static
BOOL
(
WINAPI
*
pIsDomainLegalCookieDomainW
)(
LPCWSTR
,
LPCWSTR
);
static
DWORD
(
WINAPI
*
pPrivacyGetZonePreferenceW
)(
DWORD
,
DWORD
,
LPDWORD
,
LPWSTR
,
LPDWORD
);
static
DWORD
(
WINAPI
*
pPrivacySetZonePreferenceW
)(
DWORD
,
DWORD
,
DWORD
,
LPCWSTR
);
static
BOOL
(
WINAPI
*
pInternetGetCookieExA
)(
LPCSTR
,
LPCSTR
,
LPSTR
,
LPDWORD
,
DWORD
,
LPVOID
);
static
BOOL
(
WINAPI
*
pInternetGetCookieExW
)(
LPCWSTR
,
LPCWSTR
,
LPWSTR
,
LPDWORD
,
DWORD
,
LPVOID
);
/* ############################### */
...
...
@@ -471,6 +473,36 @@ static void test_complicated_cookie(void)
ok
(
strstr
(
buffer
,
"O=P"
)
==
NULL
,
"O=P present
\n
"
);
}
static
void
test_cookie_url
(
void
)
{
WCHAR
bufw
[
512
];
char
buf
[
512
];
DWORD
len
;
BOOL
res
;
static
const
WCHAR
about_blankW
[]
=
{
'a'
,
'b'
,
'o'
,
'u'
,
't'
,
':'
,
'b'
,
'l'
,
'a'
,
'n'
,
'k'
,
0
};
len
=
sizeof
(
buf
);
res
=
InternetGetCookieA
(
"about:blank"
,
NULL
,
buf
,
&
len
);
ok
(
!
res
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"InternetGetCookeA failed: %u, expected ERROR_INVALID_PARAMETER
\n
"
,
GetLastError
());
len
=
sizeof
(
bufw
)
/
sizeof
(
*
bufw
);
res
=
InternetGetCookieW
(
about_blankW
,
NULL
,
bufw
,
&
len
);
ok
(
!
res
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"InternetGetCookeW failed: %u, expected ERROR_INVALID_PARAMETER
\n
"
,
GetLastError
());
len
=
sizeof
(
buf
);
res
=
pInternetGetCookieExA
(
"about:blank"
,
NULL
,
buf
,
&
len
,
0
,
NULL
);
ok
(
!
res
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"InternetGetCookeExA failed: %u, expected ERROR_INVALID_PARAMETER
\n
"
,
GetLastError
());
len
=
sizeof
(
bufw
)
/
sizeof
(
*
bufw
);
res
=
pInternetGetCookieExW
(
about_blankW
,
NULL
,
bufw
,
&
len
,
0
,
NULL
);
ok
(
!
res
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"InternetGetCookeExW failed: %u, expected ERROR_INVALID_PARAMETER
\n
"
,
GetLastError
());
}
static
void
test_null
(
void
)
{
HINTERNET
hi
,
hc
;
...
...
@@ -1381,11 +1413,6 @@ START_TEST(internet)
HMODULE
hdll
;
hdll
=
GetModuleHandleA
(
"wininet.dll"
);
if
(
!
GetProcAddress
(
hdll
,
"InternetGetCookieExW"
))
{
win_skip
(
"Too old IE (older than 6.0)
\n
"
);
return
;
}
pCreateUrlCacheContainerA
=
(
void
*
)
GetProcAddress
(
hdll
,
"CreateUrlCacheContainerA"
);
pCreateUrlCacheContainerW
=
(
void
*
)
GetProcAddress
(
hdll
,
"CreateUrlCacheContainerW"
);
pInternetTimeFromSystemTimeA
=
(
void
*
)
GetProcAddress
(
hdll
,
"InternetTimeFromSystemTimeA"
);
...
...
@@ -1395,11 +1422,19 @@ START_TEST(internet)
pIsDomainLegalCookieDomainW
=
(
void
*
)
GetProcAddress
(
hdll
,
(
LPCSTR
)
117
);
pPrivacyGetZonePreferenceW
=
(
void
*
)
GetProcAddress
(
hdll
,
"PrivacyGetZonePreferenceW"
);
pPrivacySetZonePreferenceW
=
(
void
*
)
GetProcAddress
(
hdll
,
"PrivacySetZonePreferenceW"
);
pInternetGetCookieExA
=
(
void
*
)
GetProcAddress
(
hdll
,
"InternetGetCookieExA"
);
pInternetGetCookieExW
=
(
void
*
)
GetProcAddress
(
hdll
,
"InternetGetCookieExW"
);
if
(
!
pInternetGetCookieExW
)
{
win_skip
(
"Too old IE (older than 6.0)
\n
"
);
return
;
}
test_InternetCanonicalizeUrlA
();
test_InternetQueryOptionA
();
test_get_cookie
();
test_complicated_cookie
();
test_cookie_url
();
test_version
();
test_null
();
test_Option_PerConnectionOption
();
...
...
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