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
58bf3ca1
Commit
58bf3ca1
authored
Aug 26, 2015
by
Hans Leidekker
Committed by
Alexandre Julliard
Aug 26, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Add support for retrieving the URL codepage.
parent
3a771b60
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
3 deletions
+54
-3
request.c
dlls/winhttp/request.c
+19
-2
winhttp.c
dlls/winhttp/tests/winhttp.c
+35
-1
No files found.
dlls/winhttp/request.c
View file @
58bf3ca1
...
...
@@ -3999,8 +3999,25 @@ static HRESULT WINAPI winhttp_request_get_Option(
WinHttpRequestOption
option
,
VARIANT
*
value
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
struct
winhttp_request
*
request
=
impl_from_IWinHttpRequest
(
iface
);
HRESULT
hr
=
S_OK
;
TRACE
(
"%p, %u, %p
\n
"
,
request
,
option
,
value
);
EnterCriticalSection
(
&
request
->
cs
);
switch
(
option
)
{
case
WinHttpRequestOption_URLCodePage
:
V_VT
(
value
)
=
VT_I4
;
V_I4
(
value
)
=
request
->
url_codepage
;
break
;
default:
FIXME
(
"unimplemented option %u
\n
"
,
option
);
hr
=
E_NOTIMPL
;
break
;
}
LeaveCriticalSection
(
&
request
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
winhttp_request_put_Option
(
...
...
dlls/winhttp/tests/winhttp.c
View file @
58bf3ca1
...
...
@@ -3043,11 +3043,12 @@ static void test_IWinHttpRequest(void)
static
const
WCHAR
connectionW
[]
=
{
'C'
,
'o'
,
'n'
,
'n'
,
'e'
,
'c'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
static
const
WCHAR
dateW
[]
=
{
'D'
,
'a'
,
't'
,
'e'
,
0
};
static
const
WCHAR
test_dataW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'd'
,
'a'
,
't'
,
'a'
,
128
,
0
};
static
const
WCHAR
utf8W
[]
=
{
'u'
,
't'
,
'f'
,
'-'
,
'8'
,
0
};
HRESULT
hr
;
IWinHttpRequest
*
req
;
BSTR
method
,
url
,
username
,
password
,
response
=
NULL
,
status_text
=
NULL
,
headers
=
NULL
;
BSTR
date
,
today
,
connection
,
value
=
NULL
;
VARIANT
async
,
empty
,
timeout
,
body
,
body2
,
proxy_server
,
bypass_list
,
data
;
VARIANT
async
,
empty
,
timeout
,
body
,
body2
,
proxy_server
,
bypass_list
,
data
,
cp
;
VARIANT_BOOL
succeeded
;
LONG
status
;
WCHAR
todayW
[
WINHTTP_TIME_FORMAT_BUFSIZE
];
...
...
@@ -3131,6 +3132,39 @@ static void test_IWinHttpRequest(void)
hr
=
IWinHttpRequest_Open
(
req
,
method
,
url
,
async
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
V_VT
(
&
cp
)
=
VT_ERROR
;
V_ERROR
(
&
cp
)
=
0xdeadbeef
;
hr
=
IWinHttpRequest_get_Option
(
req
,
WinHttpRequestOption_URLCodePage
,
&
cp
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
V_VT
(
&
cp
)
==
VT_I4
,
"got %08x
\n
"
,
V_VT
(
&
cp
)
);
ok
(
V_I4
(
&
cp
)
==
CP_UTF8
,
"got %u
\n
"
,
V_I4
(
&
cp
)
);
V_VT
(
&
cp
)
=
VT_UI4
;
V_UI4
(
&
cp
)
=
CP_ACP
;
hr
=
IWinHttpRequest_put_Option
(
req
,
WinHttpRequestOption_URLCodePage
,
cp
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
V_VT
(
&
cp
)
=
VT_ERROR
;
V_ERROR
(
&
cp
)
=
0xdeadbeef
;
hr
=
IWinHttpRequest_get_Option
(
req
,
WinHttpRequestOption_URLCodePage
,
&
cp
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
V_VT
(
&
cp
)
==
VT_I4
,
"got %08x
\n
"
,
V_VT
(
&
cp
)
);
ok
(
V_I4
(
&
cp
)
==
CP_ACP
,
"got %u
\n
"
,
V_I4
(
&
cp
)
);
value
=
SysAllocString
(
utf8W
);
V_VT
(
&
cp
)
=
VT_BSTR
;
V_BSTR
(
&
cp
)
=
value
;
hr
=
IWinHttpRequest_put_Option
(
req
,
WinHttpRequestOption_URLCodePage
,
cp
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
SysFreeString
(
value
);
V_VT
(
&
cp
)
=
VT_ERROR
;
V_ERROR
(
&
cp
)
=
0xdeadbeef
;
hr
=
IWinHttpRequest_get_Option
(
req
,
WinHttpRequestOption_URLCodePage
,
&
cp
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
V_VT
(
&
cp
)
==
VT_I4
,
"got %08x
\n
"
,
V_VT
(
&
cp
)
);
ok
(
V_I4
(
&
cp
)
==
CP_UTF8
,
"got %u
\n
"
,
V_I4
(
&
cp
)
);
hr
=
IWinHttpRequest_Abort
(
req
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
...
...
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