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
768300c8
Commit
768300c8
authored
Nov 18, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Implement WinHttpGetProxyForUrl.
parent
e3a54234
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
409 additions
and
4 deletions
+409
-4
Makefile.in
dlls/winhttp/Makefile.in
+1
-1
session.c
dlls/winhttp/session.c
+314
-3
winhttp.c
dlls/winhttp/tests/winhttp.c
+89
-0
winhttp.h
include/winhttp.h
+5
-0
No files found.
dlls/winhttp/Makefile.in
View file @
768300c8
MODULE
=
winhttp.dll
IMPORTLIB
=
winhttp
IMPORTS
=
uuid user32 advapi32
DELAYIMPORTS
=
oleaut32 crypt32
DELAYIMPORTS
=
oleaut32
ole32
crypt32
EXTRALIBS
=
@SOCKETLIBS@
C_SRCS
=
\
...
...
dlls/winhttp/session.c
View file @
768300c8
This diff is collapsed.
Click to expand it.
dlls/winhttp/tests/winhttp.c
View file @
768300c8
...
...
@@ -2581,6 +2581,94 @@ static void test_WinHttpGetIEProxyConfigForCurrentUser(void)
GlobalFree
(
cfg
.
lpszProxyBypass
);
}
static
void
test_WinHttpGetProxyForUrl
(
void
)
{
static
const
WCHAR
urlW
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'w'
,
'i'
,
'n'
,
'e'
,
'h'
,
'q'
,
'.'
,
'o'
,
'r'
,
'g'
,
0
};
static
const
WCHAR
emptyW
[]
=
{
0
};
BOOL
ret
;
DWORD
error
;
HINTERNET
session
;
WINHTTP_AUTOPROXY_OPTIONS
options
;
WINHTTP_PROXY_INFO
info
;
memset
(
&
options
,
0
,
sizeof
(
options
)
);
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpGetProxyForUrl
(
NULL
,
NULL
,
NULL
,
NULL
);
error
=
GetLastError
();
ok
(
!
ret
,
"expected failure
\n
"
);
ok
(
error
==
ERROR_INVALID_HANDLE
,
"got %u
\n
"
,
error
);
session
=
WinHttpOpen
(
test_useragent
,
0
,
NULL
,
NULL
,
0
);
ok
(
session
!=
NULL
,
"failed to open session %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpGetProxyForUrl
(
session
,
NULL
,
NULL
,
NULL
);
error
=
GetLastError
();
ok
(
!
ret
,
"expected failure
\n
"
);
ok
(
error
==
ERROR_INVALID_PARAMETER
,
"got %u
\n
"
,
error
);
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpGetProxyForUrl
(
session
,
emptyW
,
NULL
,
NULL
);
error
=
GetLastError
();
ok
(
!
ret
,
"expected failure
\n
"
);
ok
(
error
==
ERROR_INVALID_PARAMETER
,
"got %u
\n
"
,
error
);
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpGetProxyForUrl
(
session
,
urlW
,
NULL
,
NULL
);
error
=
GetLastError
();
ok
(
!
ret
,
"expected failure
\n
"
);
ok
(
error
==
ERROR_INVALID_PARAMETER
,
"got %u
\n
"
,
error
);
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpGetProxyForUrl
(
session
,
urlW
,
&
options
,
&
info
);
error
=
GetLastError
();
ok
(
!
ret
,
"expected failure
\n
"
);
ok
(
error
==
ERROR_INVALID_PARAMETER
,
"got %u
\n
"
,
error
);
options
.
dwFlags
=
WINHTTP_AUTOPROXY_AUTO_DETECT
;
options
.
dwAutoDetectFlags
=
WINHTTP_AUTO_DETECT_TYPE_DNS_A
;
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpGetProxyForUrl
(
session
,
urlW
,
&
options
,
NULL
);
error
=
GetLastError
();
ok
(
!
ret
,
"expected failure
\n
"
);
ok
(
error
==
ERROR_INVALID_PARAMETER
,
"got %u
\n
"
,
error
);
options
.
dwFlags
=
WINHTTP_AUTOPROXY_AUTO_DETECT
;
options
.
dwAutoDetectFlags
=
0
;
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpGetProxyForUrl
(
session
,
urlW
,
&
options
,
&
info
);
error
=
GetLastError
();
ok
(
!
ret
,
"expected failure
\n
"
);
ok
(
error
==
ERROR_INVALID_PARAMETER
,
"got %u
\n
"
,
error
);
options
.
dwFlags
=
WINHTTP_AUTOPROXY_AUTO_DETECT
|
WINHTTP_AUTOPROXY_CONFIG_URL
;
options
.
dwAutoDetectFlags
=
WINHTTP_AUTO_DETECT_TYPE_DNS_A
;
SetLastError
(
0xdeadbeef
);
ret
=
WinHttpGetProxyForUrl
(
session
,
urlW
,
&
options
,
&
info
);
error
=
GetLastError
();
ok
(
!
ret
,
"expected failure
\n
"
);
ok
(
error
==
ERROR_INVALID_PARAMETER
,
"got %u
\n
"
,
error
);
options
.
dwFlags
=
WINHTTP_AUTOPROXY_AUTO_DETECT
;
options
.
dwAutoDetectFlags
=
WINHTTP_AUTO_DETECT_TYPE_DNS_A
;
memset
(
&
info
,
0
,
sizeof
(
info
)
);
ret
=
WinHttpGetProxyForUrl
(
session
,
urlW
,
&
options
,
&
info
);
if
(
ret
)
{
trace
(
"%u
\n
"
,
info
.
dwAccessType
);
trace
(
"%s
\n
"
,
wine_dbgstr_w
(
info
.
lpszProxy
));
trace
(
"%s
\n
"
,
wine_dbgstr_w
(
info
.
lpszProxyBypass
));
GlobalFree
(
(
WCHAR
*
)
info
.
lpszProxy
);
GlobalFree
(
(
WCHAR
*
)
info
.
lpszProxyBypass
);
}
WinHttpCloseHandle
(
session
);
}
START_TEST
(
winhttp
)
{
static
const
WCHAR
basicW
[]
=
{
'/'
,
'b'
,
'a'
,
's'
,
'i'
,
'c'
,
0
};
...
...
@@ -2605,6 +2693,7 @@ START_TEST (winhttp)
test_IWinHttpRequest
();
test_WinHttpDetectAutoProxyConfigUrl
();
test_WinHttpGetIEProxyConfigForCurrentUser
();
test_WinHttpGetProxyForUrl
();
si
.
event
=
CreateEvent
(
NULL
,
0
,
0
,
NULL
);
si
.
port
=
7532
;
...
...
include/winhttp.h
View file @
768300c8
...
...
@@ -506,6 +506,11 @@ typedef VOID (CALLBACK *WINHTTP_STATUS_CALLBACK)(HINTERNET,DWORD_PTR,DWORD,LPVOI
#define WINHTTP_AUTO_DETECT_TYPE_DHCP 0x00000001
#define WINHTTP_AUTO_DETECT_TYPE_DNS_A 0x00000002
#define WINHTTP_AUTOPROXY_AUTO_DETECT 0x00000001
#define WINHTTP_AUTOPROXY_CONFIG_URL 0x00000002
#define WINHTTP_AUTOPROXY_RUN_INPROCESS 0x00010000
#define WINHTTP_AUTOPROXY_RUN_OUTPROCESS_ONLY 0x00020000
typedef
struct
{
DWORD
dwFlags
;
...
...
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