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
ee72094c
Commit
ee72094c
authored
May 19, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
May 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Added INTERNET_OPTION_ERROR_MASK flag handling to InternetSetOptionW.
parent
4ba60d26
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
10 deletions
+74
-10
internet.c
dlls/wininet/internet.c
+13
-2
internet.h
dlls/wininet/internet.h
+1
-0
internet.c
dlls/wininet/tests/internet.c
+57
-8
wininet.h
include/wininet.h
+3
-0
No files found.
dlls/wininet/internet.c
View file @
ee72094c
...
@@ -2484,8 +2484,19 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption,
...
@@ -2484,8 +2484,19 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption,
break
;
break
;
case
INTERNET_OPTION_ERROR_MASK
:
case
INTERNET_OPTION_ERROR_MASK
:
{
{
ULONG
flags
=
*
(
ULONG
*
)
lpBuffer
;
if
(
!
lpwhh
)
{
FIXME
(
"Option INTERNET_OPTION_ERROR_MASK(%d): STUB
\n
"
,
flags
);
SetLastError
(
ERROR_INTERNET_INCORRECT_HANDLE_TYPE
);
return
FALSE
;
}
else
if
(
*
(
ULONG
*
)
lpBuffer
&
(
~
(
INTERNET_ERROR_MASK_INSERT_CDROM
|
INTERNET_ERROR_MASK_COMBINED_SEC_CERT
|
INTERNET_ERROR_MASK_LOGIN_FAILURE_DISPLAY_ENTITY_BODY
)))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
ret
=
FALSE
;
}
else
if
(
dwBufferLength
!=
sizeof
(
ULONG
))
{
SetLastError
(
ERROR_INTERNET_BAD_OPTION_LENGTH
);
ret
=
FALSE
;
}
else
lpwhh
->
ErrorMask
=
*
(
ULONG
*
)
lpBuffer
;
}
}
break
;
break
;
case
INTERNET_OPTION_CODEPAGE
:
case
INTERNET_OPTION_CODEPAGE
:
...
...
dlls/wininet/internet.h
View file @
ee72094c
...
@@ -156,6 +156,7 @@ struct _object_header_t
...
@@ -156,6 +156,7 @@ struct _object_header_t
DWORD
dwFlags
;
DWORD
dwFlags
;
DWORD_PTR
dwContext
;
DWORD_PTR
dwContext
;
DWORD
dwError
;
DWORD
dwError
;
ULONG
ErrorMask
;
DWORD
dwInternalFlags
;
DWORD
dwInternalFlags
;
LONG
refs
;
LONG
refs
;
INTERNET_STATUS_CALLBACK
lpfnStatusCB
;
INTERNET_STATUS_CALLBACK
lpfnStatusCB
;
...
...
dlls/wininet/tests/internet.c
View file @
ee72094c
...
@@ -835,27 +835,75 @@ static void test_PrivacyGetSetZonePreferenceW(void)
...
@@ -835,27 +835,75 @@ static void test_PrivacyGetSetZonePreferenceW(void)
ok
(
ret
==
0
,
"expected ret == 0, got %u
\n
"
,
ret
);
ok
(
ret
==
0
,
"expected ret == 0, got %u
\n
"
,
ret
);
}
}
static
void
test_
Option_Policy
(
void
)
static
void
test_
InternetSetOption
(
void
)
{
{
HINTERNET
hinet
;
HINTERNET
ses
,
con
,
req
;
ULONG
ulArg
;
DWORD
size
;
BOOL
ret
;
BOOL
ret
;
hinet
=
InternetOpen
(
NULL
,
INTERNET_OPEN_TYPE_DIRECT
,
NULL
,
NULL
,
0
);
ses
=
InternetOpen
(
NULL
,
INTERNET_OPEN_TYPE_DIRECT
,
NULL
,
NULL
,
0
);
ok
(
hinet
!=
0
,
"InternetOpen failed: 0x%08x
\n
"
,
GetLastError
());
ok
(
ses
!=
0
,
"InternetOpen failed: 0x%08x
\n
"
,
GetLastError
());
con
=
InternetConnect
(
ses
,
"www.winehq.org"
,
80
,
NULL
,
NULL
,
INTERNET_SERVICE_HTTP
,
0
,
0
);
ok
(
con
!=
0
,
"InternetConnect failed: 0x%08x
\n
"
,
GetLastError
());
req
=
HttpOpenRequest
(
con
,
"GET"
,
"/"
,
NULL
,
NULL
,
NULL
,
0
,
0
);
ok
(
req
!=
0
,
"HttpOpenRequest failed: 0x%08x
\n
"
,
GetLastError
());
/* INTERNET_OPTION_POLICY tests */
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
InternetSetOptionW
(
hinet
,
INTERNET_OPTION_POLICY
,
NULL
,
0
);
ret
=
InternetSetOptionW
(
ses
,
INTERNET_OPTION_POLICY
,
NULL
,
0
);
ok
(
ret
==
FALSE
,
"InternetSetOption should've failed
\n
"
);
ok
(
ret
==
FALSE
,
"InternetSetOption should've failed
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"GetLastError should've "
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"GetLastError should've "
"given ERROR_INVALID_PARAMETER, gave: 0x%08x
\n
"
,
GetLastError
());
"given ERROR_INVALID_PARAMETER, gave: 0x%08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
InternetQueryOptionW
(
hinet
,
INTERNET_OPTION_POLICY
,
NULL
,
0
);
ret
=
InternetQueryOptionW
(
ses
,
INTERNET_OPTION_POLICY
,
NULL
,
0
);
ok
(
ret
==
FALSE
,
"InternetQueryOption should've failed
\n
"
);
ok
(
ret
==
FALSE
,
"InternetQueryOption should've failed
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"GetLastError should've "
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"GetLastError should've "
"given ERROR_INVALID_PARAMETER, gave: 0x%08x
\n
"
,
GetLastError
());
"given ERROR_INVALID_PARAMETER, gave: 0x%08x
\n
"
,
GetLastError
());
ret
=
InternetCloseHandle
(
hinet
);
/* INTERNET_OPTION_ERROR_MASK tests */
SetLastError
(
0xdeadbeef
);
size
=
sizeof
(
ulArg
);
ret
=
InternetQueryOptionW
(
NULL
,
INTERNET_OPTION_ERROR_MASK
,
(
void
*
)
&
ulArg
,
&
size
);
ok
(
ret
==
FALSE
,
"InternetQueryOption should've failed
\n
"
);
ok
(
GetLastError
()
==
ERROR_INTERNET_INCORRECT_HANDLE_TYPE
,
"GetLastError() = %x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ulArg
=
11
;
ret
=
InternetSetOption
(
NULL
,
INTERNET_OPTION_ERROR_MASK
,
(
void
*
)
&
ulArg
,
sizeof
(
ULONG
));
ok
(
ret
==
FALSE
,
"InternetQueryOption should've failed
\n
"
);
ok
(
GetLastError
()
==
ERROR_INTERNET_INCORRECT_HANDLE_TYPE
,
"GetLastError() = %x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ulArg
=
11
;
ret
=
InternetSetOption
(
req
,
INTERNET_OPTION_ERROR_MASK
,
(
void
*
)
&
ulArg
,
20
);
ok
(
ret
==
FALSE
,
"InternetQueryOption should've failed
\n
"
);
ok
(
GetLastError
()
==
ERROR_INTERNET_BAD_OPTION_LENGTH
,
"GetLastError() = %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ulArg
=
11
;
ret
=
InternetSetOption
(
req
,
INTERNET_OPTION_ERROR_MASK
,
(
void
*
)
&
ulArg
,
sizeof
(
ULONG
));
ok
(
ret
==
TRUE
,
"InternetQueryOption should've succeeded
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"GetLastError() = %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ulArg
=
4
;
ret
=
InternetSetOption
(
req
,
INTERNET_OPTION_ERROR_MASK
,
(
void
*
)
&
ulArg
,
sizeof
(
ULONG
));
ok
(
ret
==
FALSE
,
"InternetQueryOption should've failed
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"GetLastError() = %x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ulArg
=
16
;
ret
=
InternetSetOption
(
req
,
INTERNET_OPTION_ERROR_MASK
,
(
void
*
)
&
ulArg
,
sizeof
(
ULONG
));
ok
(
ret
==
FALSE
,
"InternetQueryOption should've failed
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"GetLastError() = %x
\n
"
,
GetLastError
());
ret
=
InternetCloseHandle
(
req
);
ok
(
ret
==
TRUE
,
"InternetCloseHandle failed: 0x%08x
\n
"
,
GetLastError
());
ret
=
InternetCloseHandle
(
con
);
ok
(
ret
==
TRUE
,
"InternetCloseHandle failed: 0x%08x
\n
"
,
GetLastError
());
ret
=
InternetCloseHandle
(
ses
);
ok
(
ret
==
TRUE
,
"InternetCloseHandle failed: 0x%08x
\n
"
,
GetLastError
());
ok
(
ret
==
TRUE
,
"InternetCloseHandle failed: 0x%08x
\n
"
,
GetLastError
());
}
}
...
@@ -1097,7 +1145,6 @@ START_TEST(internet)
...
@@ -1097,7 +1145,6 @@ START_TEST(internet)
test_complicated_cookie
();
test_complicated_cookie
();
test_version
();
test_version
();
test_null
();
test_null
();
test_Option_Policy
();
test_Option_PerConnectionOption
();
test_Option_PerConnectionOption
();
test_Option_PerConnectionOptionA
();
test_Option_PerConnectionOptionA
();
...
@@ -1123,4 +1170,6 @@ START_TEST(internet)
...
@@ -1123,4 +1170,6 @@ START_TEST(internet)
test_PrivacyGetSetZonePreferenceW
();
test_PrivacyGetSetZonePreferenceW
();
else
else
win_skip
(
"Privacy[SG]etZonePreferenceW are not available
\n
"
);
win_skip
(
"Privacy[SG]etZonePreferenceW are not available
\n
"
);
test_InternetSetOption
();
}
}
include/wininet.h
View file @
ee72094c
...
@@ -122,6 +122,9 @@ INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP)
...
@@ -122,6 +122,9 @@ INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP)
)
)
#define INTERNET_ERROR_MASK_INSERT_CDROM 0x1
#define INTERNET_ERROR_MASK_INSERT_CDROM 0x1
#define INTERNET_ERROR_MASK_COMBINED_SEC_CERT 0x2
#define INTERNET_ERROR_MASK_NEED_MSN_SSPI_PKG 0x4
#define INTERNET_ERROR_MASK_LOGIN_FAILURE_DISPLAY_ENTITY_BODY 0x8
#define INTERNET_OPTIONS_MASK (~INTERNET_FLAGS_MASK)
#define INTERNET_OPTIONS_MASK (~INTERNET_FLAGS_MASK)
#define WININET_API_FLAG_ASYNC 0x00000001
#define WININET_API_FLAG_ASYNC 0x00000001
...
...
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