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
d282a642
Commit
d282a642
authored
Apr 27, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 27, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Added new heap_strndupAtoW helper and use it in HttpAddRequestHeadersA.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
41f69916
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
9 deletions
+24
-9
http.c
dlls/wininet/http.c
+5
-9
internet.h
dlls/wininet/internet.h
+19
-0
No files found.
dlls/wininet/http.c
View file @
d282a642
...
...
@@ -1376,21 +1376,17 @@ BOOL WINAPI HttpAddRequestHeadersW(HINTERNET hHttpRequest,
BOOL
WINAPI
HttpAddRequestHeadersA
(
HINTERNET
hHttpRequest
,
LPCSTR
lpszHeader
,
DWORD
dwHeaderLength
,
DWORD
dwModifier
)
{
DWORD
len
;
LPWSTR
hdr
;
WCHAR
*
headers
=
NULL
;
BOOL
r
;
TRACE
(
"%p, %s, %i, %i
\n
"
,
hHttpRequest
,
debugstr_an
(
lpszHeader
,
dwHeaderLength
),
dwHeaderLength
,
dwModifier
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszHeader
,
dwHeaderLength
,
NULL
,
0
);
hdr
=
heap_alloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszHeader
,
dwHeaderLength
,
hdr
,
len
);
if
(
dwHeaderLength
!=
~
0U
)
dwHeaderLength
=
len
;
if
(
lpszHeader
)
headers
=
heap_strndupAtoW
(
lpszHeader
,
dwHeaderLength
,
&
dwHeaderLength
);
r
=
HttpAddRequestHeadersW
(
hHttpRequest
,
hdr
,
dwHeaderLength
,
dwModifier
);
r
=
HttpAddRequestHeadersW
(
hHttpRequest
,
headers
,
dwHeaderLength
,
dwModifier
);
heap_free
(
hdr
);
heap_free
(
headers
);
return
r
;
}
...
...
dlls/wininet/internet.h
View file @
d282a642
...
...
@@ -166,6 +166,25 @@ static inline LPWSTR heap_strndupW(LPCWSTR str, UINT max_len)
return
ret
;
}
static
inline
WCHAR
*
heap_strndupAtoW
(
const
char
*
str
,
int
len_a
,
DWORD
*
len_w
)
{
WCHAR
*
ret
=
NULL
;
if
(
str
)
{
size_t
len
;
if
(
len_a
<
0
)
len_a
=
strlen
(
str
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
len_a
,
NULL
,
0
);
ret
=
heap_alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
ret
)
{
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
len_a
,
ret
,
len
);
ret
[
len
]
=
0
;
*
len_w
=
len
;
}
}
return
ret
;
}
static
inline
WCHAR
*
heap_strdupAtoW
(
const
char
*
str
)
{
LPWSTR
ret
=
NULL
;
...
...
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