winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
June 2015
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
610 discussions
Start a n
N
ew thread
Jacek Caban : scrrun: Added IFile::put_Attributes imeplementation.
by Alexandre Julliard
15 Jun '15
15 Jun '15
Module: wine Branch: master Commit: dd26d1f9811c9c9c4c81801718a80caf77cf075f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dd26d1f9811c9c9c4c8180171…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Jun 12 15:46:36 2015 +0200 scrrun: Added IFile::put_Attributes imeplementation. --- dlls/scrrun/filesystem.c | 6 ++++-- dlls/scrrun/tests/filesystem.c | 28 ++++++++++++++++++++++++---- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c index 8b771c7..d490d93 100644 --- a/dlls/scrrun/filesystem.c +++ b/dlls/scrrun/filesystem.c @@ -2645,8 +2645,10 @@ static HRESULT WINAPI file_get_Attributes(IFile *iface, FileAttribute *pfa) static HRESULT WINAPI file_put_Attributes(IFile *iface, FileAttribute pfa) { struct file *This = impl_from_IFile(iface); - FIXME("(%p)->(%x)\n", This, pfa); - return E_NOTIMPL; + + TRACE("(%p)->(%x)\n", This, pfa); + + return SetFileAttributesW(This->path, pfa) ? S_OK : create_error(GetLastError()); } static HRESULT WINAPI file_get_DateCreated(IFile *iface, DATE *pdate) diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c index db7c338..b22e006 100644 --- a/dlls/scrrun/tests/filesystem.c +++ b/dlls/scrrun/tests/filesystem.c @@ -542,7 +542,7 @@ static void test_GetFile(void) WCHAR pathW[MAX_PATH]; FileAttribute fa; VARIANT size; - DWORD gfa; + DWORD gfa, new_gfa; IFile *file; HRESULT hr; HANDLE hf; @@ -580,10 +580,30 @@ static void test_GetFile(void) ok(!lstrcmpW(str, pathW), "got %s\n", wine_dbgstr_w(str)); SysFreeString(str); +#define FILE_ATTR_MASK (FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | \ + FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_ARCHIVE | \ + FILE_ATTRIBUTE_REPARSE_POINT | FILE_ATTRIBUTE_COMPRESSED) + + hr = IFile_get_Attributes(file, &fa); + gfa = GetFileAttributesW(pathW) & FILE_ATTR_MASK; + ok(hr == S_OK, "get_Attributes returned %x, expected S_OK\n", hr); + ok(fa == gfa, "fa = %x, expected %x\n", fa, gfa); + + hr = IFile_put_Attributes(file, gfa | FILE_ATTRIBUTE_READONLY); + ok(hr == S_OK, "put_Attributes failed: %08x\n", hr); + new_gfa = GetFileAttributesW(pathW) & FILE_ATTR_MASK; + ok(new_gfa == (gfa|FILE_ATTRIBUTE_READONLY), "new_gfa = %x, expected %x\n", new_gfa, gfa|FILE_ATTRIBUTE_READONLY); + + hr = IFile_get_Attributes(file, &fa); + ok(hr == S_OK, "get_Attributes returned %x, expected S_OK\n", hr); + ok(fa == new_gfa, "fa = %x, expected %x\n", fa, new_gfa); + + hr = IFile_put_Attributes(file, gfa); + ok(hr == S_OK, "put_Attributes failed: %08x\n", hr); + new_gfa = GetFileAttributesW(pathW) & FILE_ATTR_MASK; + ok(new_gfa == gfa, "new_gfa = %x, expected %x\n", new_gfa, gfa); + hr = IFile_get_Attributes(file, &fa); - gfa = GetFileAttributesW(pathW) & (FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | - FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_ARCHIVE | - FILE_ATTRIBUTE_REPARSE_POINT | FILE_ATTRIBUTE_COMPRESSED); ok(hr == S_OK, "get_Attributes returned %x, expected S_OK\n", hr); ok(fa == gfa, "fa = %x, expected %x\n", fa, gfa);
1
0
0
0
Hans Leidekker : winhttp: Store credentials set with WinHttpSetCredentials separately from username and password set through options.
by Alexandre Julliard
15 Jun '15
15 Jun '15
Module: wine Branch: master Commit: 3b8a8d31dc460e0dcff9c9dc918ee4b80c81734b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3b8a8d31dc460e0dcff9c9dc9…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Jun 12 15:08:30 2015 +0200 winhttp: Store credentials set with WinHttpSetCredentials separately from username and password set through options. --- dlls/winhttp/request.c | 55 ++++++++++++++++++++----------- dlls/winhttp/session.c | 10 +++++- dlls/winhttp/tests/winhttp.c | 75 ++++++++++++++++++++++++++++++++++++++++-- dlls/winhttp/winhttp_private.h | 16 ++++++++- 4 files changed, 133 insertions(+), 23 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=3b8a8d31dc460e0dcff9c…
1
0
0
0
Hans Leidekker : qmgr/tests: Add tests.
by Alexandre Julliard
15 Jun '15
15 Jun '15
Module: wine Branch: master Commit: c5a969904f9f06cbe9d29bf14f7d4efc7d78f590 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c5a969904f9f06cbe9d29bf14…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Jun 12 15:07:46 2015 +0200 qmgr/tests: Add tests. --- dlls/qmgr/tests/enum_files.c | 1 + dlls/qmgr/tests/job.c | 250 ++++++++++++++++++++++++++++++++++++++----- dlls/qmgr/tests/qmgr.c | 1 - 3 files changed, 223 insertions(+), 29 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=c5a969904f9f06cbe9d29…
1
0
0
0
Hans Leidekker : qmgr: Don't inline transitionJobState.
by Alexandre Julliard
15 Jun '15
15 Jun '15
Module: wine Branch: master Commit: bda14f61fc9abc86b03a8e72ed58f861806b831f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bda14f61fc9abc86b03a8e72e…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Jun 12 15:07:22 2015 +0200 qmgr: Don't inline transitionJobState. --- dlls/qmgr/job.c | 14 ++++++++++++++ dlls/qmgr/qmgr.h | 16 +--------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/dlls/qmgr/job.c b/dlls/qmgr/job.c index 37ef5f9..8ca04ad 100644 --- a/dlls/qmgr/job.c +++ b/dlls/qmgr/job.c @@ -27,6 +27,20 @@ WINE_DEFAULT_DEBUG_CHANNEL(qmgr); +BOOL transitionJobState(BackgroundCopyJobImpl *job, BG_JOB_STATE from, BG_JOB_STATE to) +{ + BOOL ret = FALSE; + + EnterCriticalSection(&globalMgr.cs); + if (job->state == from) + { + job->state = to; + ret = TRUE; + } + LeaveCriticalSection(&globalMgr.cs); + return ret; +} + struct copy_error { IBackgroundCopyError IBackgroundCopyError_iface; diff --git a/dlls/qmgr/qmgr.h b/dlls/qmgr/qmgr.h index 611896d..2bc5b8b 100644 --- a/dlls/qmgr/qmgr.h +++ b/dlls/qmgr/qmgr.h @@ -113,6 +113,7 @@ HRESULT EnumBackgroundCopyFilesConstructor(BackgroundCopyJobImpl*, IEnumBackgrou DWORD WINAPI fileTransfer(void *param) DECLSPEC_HIDDEN; void processJob(BackgroundCopyJobImpl *job) DECLSPEC_HIDDEN; BOOL processFile(BackgroundCopyFileImpl *file, BackgroundCopyJobImpl *job) DECLSPEC_HIDDEN; +BOOL transitionJobState(BackgroundCopyJobImpl *job, BG_JOB_STATE from, BG_JOB_STATE to) DECLSPEC_HIDDEN; /* Little helper functions */ static inline WCHAR *strdupW(const WCHAR *src) @@ -142,19 +143,4 @@ static inline HRESULT return_strval(const WCHAR *str, WCHAR **ret) return S_OK; } -static inline BOOL -transitionJobState(BackgroundCopyJobImpl *job, BG_JOB_STATE fromState, - BG_JOB_STATE toState) -{ - BOOL rv = FALSE; - EnterCriticalSection(&globalMgr.cs); - if (job->state == fromState) - { - job->state = toState; - rv = TRUE; - } - LeaveCriticalSection(&globalMgr.cs); - return rv; -} - #endif /* __QMGR_H__ */
1
0
0
0
Hans Leidekker : qmgr: Implement IBackgroundCopyJob::Cancel.
by Alexandre Julliard
15 Jun '15
15 Jun '15
Module: wine Branch: master Commit: 13c3f7ac2b563596a74811590239ebee535a0889 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=13c3f7ac2b563596a74811590…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Jun 12 15:06:59 2015 +0200 qmgr: Implement IBackgroundCopyJob::Cancel. --- dlls/qmgr/file.c | 1 + dlls/qmgr/job.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/dlls/qmgr/file.c b/dlls/qmgr/file.c index a5a41d1..0321ab6 100644 --- a/dlls/qmgr/file.c +++ b/dlls/qmgr/file.c @@ -201,6 +201,7 @@ HRESULT BackgroundCopyFileConstructor(BackgroundCopyJobImpl *owner, This->fileProgress.Completed = FALSE; This->owner = owner; This->read_size = 0; + This->tempFileName[0] = 0; IBackgroundCopyJob3_AddRef(&owner->IBackgroundCopyJob3_iface); *file = This; diff --git a/dlls/qmgr/job.c b/dlls/qmgr/job.c index bf48480..37ef5f9 100644 --- a/dlls/qmgr/job.c +++ b/dlls/qmgr/job.c @@ -259,6 +259,9 @@ static ULONG WINAPI BackgroundCopyJob_Release(IBackgroundCopyJob3 *iface) HeapFree(GetProcessHeap(), 0, cred->Credentials.Basic.Password); } } + CloseHandle(This->wait); + CloseHandle(This->cancel); + CloseHandle(This->done); HeapFree(GetProcessHeap(), 0, This); } @@ -365,8 +368,48 @@ static HRESULT WINAPI BackgroundCopyJob_Cancel( IBackgroundCopyJob3 *iface) { BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); - FIXME("(%p): stub\n", This); - return E_NOTIMPL; + HRESULT rv = S_OK; + + TRACE("(%p)\n", This); + + EnterCriticalSection(&This->cs); + + if (is_job_done(This)) + { + rv = BG_E_INVALID_STATE; + } + else + { + BackgroundCopyFileImpl *file; + + if (This->state == BG_JOB_STATE_CONNECTING || This->state == BG_JOB_STATE_TRANSFERRING) + { + This->state = BG_JOB_STATE_CANCELLED; + SetEvent(This->cancel); + + LeaveCriticalSection(&This->cs); + WaitForSingleObject(This->done, INFINITE); + EnterCriticalSection(&This->cs); + } + + LIST_FOR_EACH_ENTRY(file, &This->files, BackgroundCopyFileImpl, entryFromJob) + { + if (file->tempFileName[0] && !DeleteFileW(file->tempFileName)) + { + WARN("Couldn't delete %s (%u)\n", debugstr_w(file->tempFileName), GetLastError()); + rv = BG_S_UNABLE_TO_DELETE_FILES; + } + if (file->info.LocalName && !DeleteFileW(file->info.LocalName)) + { + WARN("Couldn't delete %s (%u)\n", debugstr_w(file->info.LocalName), GetLastError()); + rv = BG_S_UNABLE_TO_DELETE_FILES; + } + } + This->state = BG_JOB_STATE_CANCELLED; + } + + LeaveCriticalSection(&This->cs); + return rv; } static HRESULT WINAPI BackgroundCopyJob_Complete( @@ -1193,6 +1236,10 @@ HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type, GUID memset(&This->http_options, 0, sizeof(This->http_options)); + This->wait = CreateEventW(NULL, FALSE, FALSE, NULL); + This->cancel = CreateEventW(NULL, FALSE, FALSE, NULL); + This->done = CreateEventW(NULL, FALSE, FALSE, NULL); + *job = This; TRACE("created job %s:%p\n", debugstr_guid(&This->jobId), This);
1
0
0
0
Hans Leidekker : qmgr: Implement IBackgroundCopyJob:: SetCredentials and IBackgroundCopyJob::RemoveCredentials.
by Alexandre Julliard
15 Jun '15
15 Jun '15
Module: wine Branch: master Commit: 63aa94573f0dd0e595d9430da4ede38218b3098d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=63aa94573f0dd0e595d9430da…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Jun 12 15:06:26 2015 +0200 qmgr: Implement IBackgroundCopyJob::SetCredentials and IBackgroundCopyJob::RemoveCredentials. --- dlls/qmgr/file.c | 50 ++++++++++++++++++++++++++++++++++++++ dlls/qmgr/job.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++---- dlls/qmgr/qmgr.h | 2 +- 3 files changed, 119 insertions(+), 6 deletions(-) diff --git a/dlls/qmgr/file.c b/dlls/qmgr/file.c index 55e93aa..a5a41d1 100644 --- a/dlls/qmgr/file.c +++ b/dlls/qmgr/file.c @@ -321,6 +321,55 @@ static DWORD wait_for_completion(BackgroundCopyJobImpl *job) return error; } +static UINT target_from_index(UINT index) +{ + switch (index) + { + case 0: return WINHTTP_AUTH_TARGET_SERVER; + case 1: return WINHTTP_AUTH_TARGET_PROXY; + default: + ERR("unhandled index %u\n", index); + break; + } + return 0; +} + +static UINT scheme_from_index(UINT index) +{ + switch (index) + { + case 0: return WINHTTP_AUTH_SCHEME_BASIC; + case 1: return WINHTTP_AUTH_SCHEME_NTLM; + case 2: return WINHTTP_AUTH_SCHEME_PASSPORT; + case 3: return WINHTTP_AUTH_SCHEME_DIGEST; + case 4: return WINHTTP_AUTH_SCHEME_NEGOTIATE; + default: + ERR("unhandled index %u\n", index); + break; + } + return 0; +} + +static BOOL set_request_credentials(HINTERNET req, BackgroundCopyJobImpl *job) +{ + UINT i, j; + + for (i = 0; i < BG_AUTH_TARGET_PROXY; i++) + { + UINT target = target_from_index(i); + for (j = 0; j < BG_AUTH_SCHEME_PASSPORT; j++) + { + UINT scheme = scheme_from_index(j); + const WCHAR *username = job->http_options.creds[i][j].Credentials.Basic.UserName; + const WCHAR *password = job->http_options.creds[i][j].Credentials.Basic.Password; + + if (!username) continue; + if (!WinHttpSetCredentials(req, target, scheme, username, password, NULL)) return FALSE; + } + } + return TRUE; +} + static BOOL transfer_file_http(BackgroundCopyFileImpl *file, URL_COMPONENTSW *uc, const WCHAR *tmpfile) { @@ -339,6 +388,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 (!set_request_credentials(req, job)) 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; diff --git a/dlls/qmgr/job.c b/dlls/qmgr/job.c index 9595616..bf48480 100644 --- a/dlls/qmgr/job.c +++ b/dlls/qmgr/job.c @@ -237,7 +237,7 @@ static ULONG WINAPI BackgroundCopyJob_AddRef(IBackgroundCopyJob3 *iface) static ULONG WINAPI BackgroundCopyJob_Release(IBackgroundCopyJob3 *iface) { BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); - ULONG ref = InterlockedDecrement(&This->ref); + ULONG i, j, ref = InterlockedDecrement(&This->ref); TRACE("(%p)->(%d)\n", This, ref); @@ -250,6 +250,15 @@ static ULONG WINAPI BackgroundCopyJob_Release(IBackgroundCopyJob3 *iface) HeapFree(GetProcessHeap(), 0, This->displayName); HeapFree(GetProcessHeap(), 0, This->description); HeapFree(GetProcessHeap(), 0, This->http_options.headers); + for (i = 0; i < BG_AUTH_TARGET_PROXY; i++) + { + for (j = 0; j < BG_AUTH_SCHEME_PASSPORT; j++) + { + BG_AUTH_CREDENTIALS *cred = &This->http_options.creds[i][j]; + HeapFree(GetProcessHeap(), 0, cred->Credentials.Basic.UserName); + HeapFree(GetProcessHeap(), 0, cred->Credentials.Basic.Password); + } + } HeapFree(GetProcessHeap(), 0, This); } @@ -795,12 +804,49 @@ static HRESULT WINAPI BackgroundCopyJob_GetReplyFileName( return E_NOTIMPL; } +static int index_from_target(BG_AUTH_TARGET target) +{ + if (!target || target > BG_AUTH_TARGET_PROXY) return -1; + return target - 1; +} + +static int index_from_scheme(BG_AUTH_SCHEME scheme) +{ + if (!scheme || scheme > BG_AUTH_SCHEME_PASSPORT) return -1; + return scheme - 1; +} + static HRESULT WINAPI BackgroundCopyJob_SetCredentials( IBackgroundCopyJob3 *iface, BG_AUTH_CREDENTIALS *cred) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); - FIXME("(%p)->(%p): stub\n", This, cred); + BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob3(iface); + BG_AUTH_CREDENTIALS *new_cred; + int idx_target, idx_scheme; + + TRACE("(%p)->(%p)\n", job, cred); + + if ((idx_target = index_from_target(cred->Target)) < 0) return BG_E_INVALID_AUTH_TARGET; + if ((idx_scheme = index_from_scheme(cred->Scheme)) < 0) return BG_E_INVALID_AUTH_SCHEME; + new_cred = &job->http_options.creds[idx_target][idx_scheme]; + + EnterCriticalSection(&job->cs); + + new_cred->Target = cred->Target; + new_cred->Scheme = cred->Scheme; + + if (cred->Credentials.Basic.UserName) + { + HeapFree(GetProcessHeap(), 0, new_cred->Credentials.Basic.UserName); + new_cred->Credentials.Basic.UserName = strdupW(cred->Credentials.Basic.UserName); + } + if (cred->Credentials.Basic.Password) + { + HeapFree(GetProcessHeap(), 0, new_cred->Credentials.Basic.Password); + new_cred->Credentials.Basic.Password = strdupW(cred->Credentials.Basic.Password); + } + + LeaveCriticalSection(&job->cs); return S_OK; } @@ -809,8 +855,25 @@ static HRESULT WINAPI BackgroundCopyJob_RemoveCredentials( BG_AUTH_TARGET target, BG_AUTH_SCHEME scheme) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); - FIXME("(%p)->(%d %d): stub\n", This, target, scheme); + BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob3(iface); + BG_AUTH_CREDENTIALS *new_cred; + int idx_target, idx_scheme; + + TRACE("(%p)->(%u %u)\n", job, target, scheme); + + if ((idx_target = index_from_target(target)) < 0) return BG_E_INVALID_AUTH_TARGET; + if ((idx_scheme = index_from_scheme(scheme)) < 0) return BG_E_INVALID_AUTH_SCHEME; + new_cred = &job->http_options.creds[idx_target][idx_scheme]; + + EnterCriticalSection(&job->cs); + + new_cred->Target = new_cred->Scheme = 0; + HeapFree(GetProcessHeap(), 0, new_cred->Credentials.Basic.UserName); + new_cred->Credentials.Basic.UserName = NULL; + HeapFree(GetProcessHeap(), 0, new_cred->Credentials.Basic.Password); + new_cred->Credentials.Basic.Password = NULL; + + LeaveCriticalSection(&job->cs); return S_OK; } diff --git a/dlls/qmgr/qmgr.h b/dlls/qmgr/qmgr.h index 268fabc..611896d 100644 --- a/dlls/qmgr/qmgr.h +++ b/dlls/qmgr/qmgr.h @@ -56,7 +56,7 @@ typedef struct { WCHAR *headers; ULONG flags; - BG_AUTH_CREDENTIALS creds; + BG_AUTH_CREDENTIALS creds[BG_AUTH_TARGET_PROXY][BG_AUTH_SCHEME_PASSPORT]; } http_options; struct {
1
0
0
0
Hans Leidekker : qmgr: Implement IBackgroundCopyJobHttpOptions:: SetCustomHeaders and IBackgroundCopyJobHttpOptions::GetCustomHeaders.
by Alexandre Julliard
15 Jun '15
15 Jun '15
Module: wine Branch: master Commit: 1e800c7b944e79e85268290510322bf888d637c3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1e800c7b944e79e8526829051…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Jun 12 15:05:59 2015 +0200 qmgr: Implement IBackgroundCopyJobHttpOptions::SetCustomHeaders and IBackgroundCopyJobHttpOptions::GetCustomHeaders. --- dlls/qmgr/file.c | 2 +- dlls/qmgr/job.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++---- dlls/qmgr/qmgr.h | 14 ++++++++++++++ 3 files changed, 62 insertions(+), 5 deletions(-) diff --git a/dlls/qmgr/file.c b/dlls/qmgr/file.c index 3c92bb0..55e93aa 100644 --- a/dlls/qmgr/file.c +++ b/dlls/qmgr/file.c @@ -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; diff --git a/dlls/qmgr/job.c b/dlls/qmgr/job.c index 8ee6498..9595616 100644 --- a/dlls/qmgr/job.c +++ b/dlls/qmgr/job.c @@ -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( diff --git a/dlls/qmgr/qmgr.h b/dlls/qmgr/qmgr.h index 4b9d2fb..268fabc 100644 --- a/dlls/qmgr/qmgr.h +++ b/dlls/qmgr/qmgr.h @@ -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;
1
0
0
0
Hans Leidekker : qmgr: Implement IBackgroundCopyJobHttpOptions:: SetSecurityFlags and IBackgroundCopyJobHttpOptions::GetSecurityFlags.
by Alexandre Julliard
15 Jun '15
15 Jun '15
Module: wine Branch: master Commit: dcfe6648f877abcaf7f3a9afa6b0a3de30b1cedd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dcfe6648f877abcaf7f3a9afa…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Jun 12 15:05:31 2015 +0200 qmgr: Implement IBackgroundCopyJobHttpOptions::SetSecurityFlags and IBackgroundCopyJobHttpOptions::GetSecurityFlags. --- dlls/qmgr/job.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/dlls/qmgr/job.c b/dlls/qmgr/job.c index 5cb85ae..8ee6498 100644 --- a/dlls/qmgr/job.c +++ b/dlls/qmgr/job.c @@ -992,16 +992,24 @@ static HRESULT WINAPI http_options_SetSecurityFlags( IBackgroundCopyJobHttpOptions *iface, ULONG Flags) { - FIXME("\n"); - return E_NOTIMPL; + BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJobHttpOptions(iface); + + TRACE("(%p)->(0x%08x)\n", iface, Flags); + + job->http_options.flags = Flags; + return S_OK; } static HRESULT WINAPI http_options_GetSecurityFlags( IBackgroundCopyJobHttpOptions *iface, ULONG *pFlags) { - FIXME("\n"); - return E_NOTIMPL; + BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJobHttpOptions(iface); + + TRACE("(%p)->(%p)\n", iface, pFlags); + + *pFlags = job->http_options.flags; + return S_OK; } static const IBackgroundCopyJobHttpOptionsVtbl http_options_vtbl =
1
0
0
0
Hans Leidekker : qmgr: Add a stub implementation of IBackgroundCopyJobHttpOptions.
by Alexandre Julliard
15 Jun '15
15 Jun '15
Module: wine Branch: master Commit: faa65f629119f1388f46a16b300b14e814f4cb6e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=faa65f629119f1388f46a16b3…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Jun 12 15:05:11 2015 +0200 qmgr: Add a stub implementation of IBackgroundCopyJobHttpOptions. --- dlls/qmgr/job.c | 122 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ dlls/qmgr/qmgr.h | 7 ++++ 2 files changed, 129 insertions(+) diff --git a/dlls/qmgr/job.c b/dlls/qmgr/job.c index d342041..5cb85ae 100644 --- a/dlls/qmgr/job.c +++ b/dlls/qmgr/job.c @@ -212,6 +212,10 @@ static HRESULT WINAPI BackgroundCopyJob_QueryInterface( { *obj = &This->IBackgroundCopyJob3_iface; } + else if (IsEqualGUID(riid, &IID_IBackgroundCopyJobHttpOptions)) + { + *obj = &This->IBackgroundCopyJobHttpOptions_iface; + } else { *obj = NULL; @@ -245,6 +249,7 @@ static ULONG WINAPI BackgroundCopyJob_Release(IBackgroundCopyJob3 *iface) IBackgroundCopyCallback2_Release(This->callback); HeapFree(GetProcessHeap(), 0, This->displayName); HeapFree(GetProcessHeap(), 0, This->description); + HeapFree(GetProcessHeap(), 0, This->http_options.headers); HeapFree(GetProcessHeap(), 0, This); } @@ -900,6 +905,120 @@ static const IBackgroundCopyJob3Vtbl BackgroundCopyJob3Vtbl = BackgroundCopyJob_GetFileACLFlags }; +static inline BackgroundCopyJobImpl *impl_from_IBackgroundCopyJobHttpOptions( + IBackgroundCopyJobHttpOptions *iface) +{ + return CONTAINING_RECORD(iface, BackgroundCopyJobImpl, IBackgroundCopyJobHttpOptions_iface); +} + +static HRESULT WINAPI http_options_QueryInterface( + IBackgroundCopyJobHttpOptions *iface, + REFIID riid, + void **ppvObject) +{ + BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJobHttpOptions(iface); + return IBackgroundCopyJob3_QueryInterface(&job->IBackgroundCopyJob3_iface, riid, ppvObject); +} + +static ULONG WINAPI http_options_AddRef( + IBackgroundCopyJobHttpOptions *iface) +{ + BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJobHttpOptions(iface); + return IBackgroundCopyJob3_AddRef(&job->IBackgroundCopyJob3_iface); +} + +static ULONG WINAPI http_options_Release( + IBackgroundCopyJobHttpOptions *iface) +{ + BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJobHttpOptions(iface); + return IBackgroundCopyJob3_Release(&job->IBackgroundCopyJob3_iface); +} + +static HRESULT WINAPI http_options_SetClientCertificateByID( + IBackgroundCopyJobHttpOptions *iface, + BG_CERT_STORE_LOCATION StoreLocation, + LPCWSTR StoreName, + BYTE *pCertHashBlob) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI http_options_SetClientCertificateByName( + IBackgroundCopyJobHttpOptions *iface, + BG_CERT_STORE_LOCATION StoreLocation, + LPCWSTR StoreName, + LPCWSTR SubjectName) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI http_options_RemoveClientCertificate( + IBackgroundCopyJobHttpOptions *iface) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI http_options_GetClientCertificate( + IBackgroundCopyJobHttpOptions *iface, + BG_CERT_STORE_LOCATION *pStoreLocation, + LPWSTR *pStoreName, + BYTE **ppCertHashBlob, + LPWSTR *pSubjectName) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI http_options_SetCustomHeaders( + IBackgroundCopyJobHttpOptions *iface, + LPCWSTR RequestHeaders) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI http_options_GetCustomHeaders( + IBackgroundCopyJobHttpOptions *iface, + LPWSTR *pRequestHeaders) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI http_options_SetSecurityFlags( + IBackgroundCopyJobHttpOptions *iface, + ULONG Flags) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI http_options_GetSecurityFlags( + IBackgroundCopyJobHttpOptions *iface, + ULONG *pFlags) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static const IBackgroundCopyJobHttpOptionsVtbl http_options_vtbl = +{ + http_options_QueryInterface, + http_options_AddRef, + http_options_Release, + http_options_SetClientCertificateByID, + http_options_SetClientCertificateByName, + http_options_RemoveClientCertificate, + http_options_GetClientCertificate, + http_options_SetCustomHeaders, + http_options_GetCustomHeaders, + http_options_SetSecurityFlags, + http_options_GetSecurityFlags +}; + HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type, GUID *job_id, BackgroundCopyJobImpl **job) { HRESULT hr; @@ -913,6 +1032,7 @@ HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type, GUID return E_OUTOFMEMORY; This->IBackgroundCopyJob3_iface.lpVtbl = &BackgroundCopyJob3Vtbl; + This->IBackgroundCopyJobHttpOptions_iface.lpVtbl = &http_options_vtbl; InitializeCriticalSection(&This->cs); This->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": BackgroundCopyJobImpl.cs"); @@ -957,6 +1077,8 @@ HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type, GUID This->error.code = 0; This->error.file = NULL; + memset(&This->http_options, 0, sizeof(This->http_options)); + *job = This; TRACE("created job %s:%p\n", debugstr_guid(&This->jobId), This); diff --git a/dlls/qmgr/qmgr.h b/dlls/qmgr/qmgr.h index 9595f22..4b9d2fb 100644 --- a/dlls/qmgr/qmgr.h +++ b/dlls/qmgr/qmgr.h @@ -37,6 +37,7 @@ typedef struct { IBackgroundCopyJob3 IBackgroundCopyJob3_iface; + IBackgroundCopyJobHttpOptions IBackgroundCopyJobHttpOptions_iface; LONG ref; LPWSTR displayName; LPWSTR description; @@ -53,6 +54,12 @@ typedef struct struct list entryFromQmgr; struct { + WCHAR *headers; + ULONG flags; + BG_AUTH_CREDENTIALS creds; + } http_options; + struct + { BG_ERROR_CONTEXT context; HRESULT code; IBackgroundCopyFile2 *file;
1
0
0
0
Hans Leidekker : qmgr: Use winhttp for HTTP transfers instead of wininet.
by Alexandre Julliard
15 Jun '15
15 Jun '15
Module: wine Branch: master Commit: 230b52da181eb4fc78c153c1950dd54936586cc1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=230b52da181eb4fc78c153c19…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Jun 12 15:04:44 2015 +0200 qmgr: Use winhttp for HTTP transfers instead of wininet. --- dlls/qmgr/Makefile.in | 2 +- dlls/qmgr/file.c | 477 +++++++++++++++++++++----------------------------- dlls/qmgr/qmgr.h | 12 +- 3 files changed, 204 insertions(+), 287 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=230b52da181eb4fc78c15…
1
0
0
0
← Newer
1
...
32
33
34
35
36
37
38
...
61
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Results per page:
10
25
50
100
200