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
1e800c7b
Commit
1e800c7b
authored
Jun 12, 2015
by
Hans Leidekker
Committed by
Alexandre Julliard
Jun 15, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qmgr: Implement IBackgroundCopyJobHttpOptions::SetCustomHeaders and…
qmgr: Implement IBackgroundCopyJobHttpOptions::SetCustomHeaders and IBackgroundCopyJobHttpOptions::GetCustomHeaders.
parent
dcfe6648
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
5 deletions
+62
-5
file.c
dlls/qmgr/file.c
+1
-1
job.c
dlls/qmgr/job.c
+47
-4
qmgr.h
dlls/qmgr/qmgr.h
+14
-0
No files found.
dlls/qmgr/file.c
View file @
1e800c7b
...
...
@@ -340,7 +340,7 @@ static BOOL transfer_file_http(BackgroundCopyFileImpl *file, URL_COMPONENTSW *uc
if
(
!
(
con
=
WinHttpConnect
(
ses
,
uc
->
lpszHostName
,
uc
->
nPort
,
0
)))
goto
done
;
if
(
!
(
req
=
WinHttpOpenRequest
(
con
,
NULL
,
uc
->
lpszUrlPath
,
NULL
,
NULL
,
NULL
,
flags
)))
goto
done
;
if
(
!
(
WinHttpSendRequest
(
req
,
NULL
,
0
,
NULL
,
0
,
0
,
(
DWORD_PTR
)
file
)))
goto
done
;
if
(
!
(
WinHttpSendRequest
(
req
,
job
->
http_options
.
headers
,
~
0u
,
NULL
,
0
,
0
,
(
DWORD_PTR
)
file
)))
goto
done
;
if
(
wait_for_completion
(
job
)
||
job
->
error
.
code
)
goto
done
;
if
(
!
(
WinHttpReceiveResponse
(
req
,
NULL
)))
goto
done
;
...
...
dlls/qmgr/job.c
View file @
1e800c7b
...
...
@@ -976,16 +976,59 @@ static HRESULT WINAPI http_options_SetCustomHeaders(
IBackgroundCopyJobHttpOptions
*
iface
,
LPCWSTR
RequestHeaders
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
BackgroundCopyJobImpl
*
job
=
impl_from_IBackgroundCopyJobHttpOptions
(
iface
);
TRACE
(
"(%p)->(%s)
\n
"
,
iface
,
debugstr_w
(
RequestHeaders
));
EnterCriticalSection
(
&
job
->
cs
);
if
(
RequestHeaders
)
{
WCHAR
*
headers
=
strdupW
(
RequestHeaders
);
if
(
!
headers
)
{
LeaveCriticalSection
(
&
job
->
cs
);
return
E_OUTOFMEMORY
;
}
HeapFree
(
GetProcessHeap
(),
0
,
job
->
http_options
.
headers
);
job
->
http_options
.
headers
=
headers
;
}
else
{
HeapFree
(
GetProcessHeap
(),
0
,
job
->
http_options
.
headers
);
job
->
http_options
.
headers
=
NULL
;
}
LeaveCriticalSection
(
&
job
->
cs
);
return
S_OK
;
}
static
HRESULT
WINAPI
http_options_GetCustomHeaders
(
IBackgroundCopyJobHttpOptions
*
iface
,
LPWSTR
*
pRequestHeaders
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
BackgroundCopyJobImpl
*
job
=
impl_from_IBackgroundCopyJobHttpOptions
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
iface
,
pRequestHeaders
);
EnterCriticalSection
(
&
job
->
cs
);
if
(
job
->
http_options
.
headers
)
{
WCHAR
*
headers
=
co_strdupW
(
job
->
http_options
.
headers
);
if
(
!
headers
)
{
LeaveCriticalSection
(
&
job
->
cs
);
return
E_OUTOFMEMORY
;
}
*
pRequestHeaders
=
headers
;
LeaveCriticalSection
(
&
job
->
cs
);
return
S_OK
;
}
*
pRequestHeaders
=
NULL
;
LeaveCriticalSection
(
&
job
->
cs
);
return
S_FALSE
;
}
static
HRESULT
WINAPI
http_options_SetSecurityFlags
(
...
...
dlls/qmgr/qmgr.h
View file @
1e800c7b
...
...
@@ -115,6 +115,20 @@ void processJob(BackgroundCopyJobImpl *job) DECLSPEC_HIDDEN;
BOOL
processFile
(
BackgroundCopyFileImpl
*
file
,
BackgroundCopyJobImpl
*
job
)
DECLSPEC_HIDDEN
;
/* Little helper functions */
static
inline
WCHAR
*
strdupW
(
const
WCHAR
*
src
)
{
WCHAR
*
dst
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
strlenW
(
src
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
dst
)
strcpyW
(
dst
,
src
);
return
dst
;
}
static
inline
WCHAR
*
co_strdupW
(
const
WCHAR
*
src
)
{
WCHAR
*
dst
=
CoTaskMemAlloc
((
strlenW
(
src
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
dst
)
strcpyW
(
dst
,
src
);
return
dst
;
}
static
inline
HRESULT
return_strval
(
const
WCHAR
*
str
,
WCHAR
**
ret
)
{
int
len
;
...
...
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