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
68d18612
Commit
68d18612
authored
Jun 02, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Jun 02, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Fix up and test InternetSetCookie parameter checking.
parent
7b3cf21d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
cookie.c
dlls/wininet/cookie.c
+2
-2
internet.c
dlls/wininet/tests/internet.c
+32
-0
No files found.
dlls/wininet/cookie.c
View file @
68d18612
...
...
@@ -402,9 +402,9 @@ BOOL WINAPI InternetSetCookieW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName,
TRACE
(
"(%s,%s,%s)
\n
"
,
debugstr_w
(
lpszUrl
),
debugstr_w
(
lpszCookieName
),
debugstr_w
(
lpCookieData
));
if
(
!
lpCookieData
||
!
strlenW
(
lpCookieData
)
)
if
(
!
lpCookieData
)
{
TRACE
(
"no cookie data, not adding
\n
"
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
!
lpszCookieName
)
...
...
dlls/wininet/tests/internet.c
View file @
68d18612
...
...
@@ -123,6 +123,9 @@ static void test_null(void)
{
HINTERNET
hi
,
hc
;
static
const
WCHAR
szServer
[]
=
{
's'
,
'e'
,
'r'
,
'v'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
szEmpty
[]
=
{
0
};
static
const
WCHAR
szUrl
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'a'
,
'.'
,
'b'
,
'.'
,
'c'
,
0
};
BOOL
r
;
hi
=
InternetOpenW
(
NULL
,
0
,
NULL
,
NULL
,
0
);
ok
(
hi
!=
NULL
,
"open failed
\n
"
);
...
...
@@ -152,6 +155,35 @@ static void test_null(void)
ok
(
hc
==
NULL
,
"connect failed
\n
"
);
InternetCloseHandle
(
hi
);
r
=
InternetSetCookieW
(
NULL
,
NULL
,
NULL
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"wrong error
\n
"
);
ok
(
r
==
FALSE
,
"return wrong
\n
"
);
r
=
InternetSetCookieW
(
szServer
,
NULL
,
NULL
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"wrong error
\n
"
);
ok
(
r
==
FALSE
,
"return wrong
\n
"
);
r
=
InternetSetCookieW
(
szUrl
,
szServer
,
NULL
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"wrong error
\n
"
);
ok
(
r
==
FALSE
,
"return wrong
\n
"
);
r
=
InternetSetCookieW
(
szUrl
,
szServer
,
szServer
);
ok
(
r
==
TRUE
,
"return wrong
\n
"
);
todo_wine
{
r
=
InternetSetCookieW
(
szUrl
,
NULL
,
szServer
);
ok
(
r
==
TRUE
,
"return wrong
\n
"
);
}
r
=
InternetSetCookieW
(
szUrl
,
szServer
,
szEmpty
);
ok
(
r
==
TRUE
,
"return wrong
\n
"
);
r
=
InternetSetCookieW
(
szServer
,
NULL
,
szServer
);
todo_wine
{
ok
(
GetLastError
()
==
ERROR_INTERNET_UNRECOGNIZED_SCHEME
,
"wrong error
\n
"
);
}
ok
(
r
==
FALSE
,
"return wrong
\n
"
);
}
START_TEST
(
internet
)
...
...
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