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
March 2008
----- 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
4 participants
1001 discussions
Start a n
N
ew thread
Roy Shea : qmgr: Implement IBackgroundCopyJob_GetProgress.
by Alexandre Julliard
04 Mar '08
04 Mar '08
Module: wine Branch: master Commit: dc484a9b934d3abbd1e360f4b0af1990c791c464 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dc484a9b934d3abbd1e360f4b…
Author: Roy Shea <roy(a)cs.hmc.edu> Date: Mon Mar 3 16:48:08 2008 -0800 qmgr: Implement IBackgroundCopyJob_GetProgress. --- dlls/qmgr/job.c | 15 ++++++++++++--- dlls/qmgr/tests/job.c | 22 ++++++++++++++++++++++ 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/dlls/qmgr/job.c b/dlls/qmgr/job.c index 20d72dd..8e3bce4 100644 --- a/dlls/qmgr/job.c +++ b/dlls/qmgr/job.c @@ -163,8 +163,17 @@ static HRESULT WINAPI BITS_IBackgroundCopyJob_GetProgress( IBackgroundCopyJob* iface, BG_JOB_PROGRESS *pVal) { - FIXME("Not implemented\n"); - return E_NOTIMPL; + BackgroundCopyJobImpl *This = (BackgroundCopyJobImpl *) iface; + + if (!pVal) + return E_INVALIDARG; + + pVal->BytesTotal = This->jobProgress.BytesTotal; + pVal->BytesTransferred = This->jobProgress.BytesTransferred; + pVal->FilesTotal = This->jobProgress.FilesTotal; + pVal->FilesTransferred = This->jobProgress.FilesTransferred; + + return S_OK; } static HRESULT WINAPI BITS_IBackgroundCopyJob_GetTimes( @@ -432,7 +441,7 @@ HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type, memcpy(pJobId, &This->jobId, sizeof(GUID)); list_init(&This->files); - This->jobProgress.BytesTotal = BG_SIZE_UNKNOWN; + This->jobProgress.BytesTotal = 0; This->jobProgress.BytesTransferred = 0; This->jobProgress.FilesTotal = 0; This->jobProgress.FilesTransferred = 0; diff --git a/dlls/qmgr/tests/job.c b/dlls/qmgr/tests/job.c index 6fcf681..26cbfe9 100644 --- a/dlls/qmgr/tests/job.c +++ b/dlls/qmgr/tests/job.c @@ -218,6 +218,27 @@ static void test_EnumFiles(void) ok(res == 0, "Bad ref count on release: %u\n", res); } +/* Test getting job progress */ +static void test_GetProgress_preTransfer(void) +{ + HRESULT hres; + BG_JOB_PROGRESS progress; + + hres = IBackgroundCopyJob_GetProgress(test_job, &progress); + ok(hres == S_OK, "GetProgress failed: 0x%08x\n", hres); + if (hres != S_OK) + { + skip("Unable to get job progress\n"); + teardown(); + return; + } + + ok(progress.BytesTotal == 0, "Incorrect BytesTotal: %llu\n", progress.BytesTotal); + ok(progress.BytesTransferred == 0, "Incorrect BytesTransferred: %llu\n", progress.BytesTransferred); + ok(progress.FilesTotal == 0, "Incorrect FilesTotal: %u\n", progress.FilesTotal); + ok(progress.FilesTransferred == 0, "Incorrect FilesTransferred %u\n", progress.FilesTransferred); +} + typedef void (*test_t)(void); START_TEST(job) @@ -228,6 +249,7 @@ START_TEST(job) test_GetName, test_AddFile, test_EnumFiles, + test_GetProgress_preTransfer, 0 }; const test_t *test;
1
0
0
0
Roy Shea : qmgr: Implement Skip and Reset for IEnumBackgroundCopyJobs.
by Alexandre Julliard
04 Mar '08
04 Mar '08
Module: wine Branch: master Commit: a0fd05f09ec7f7aef41be809285ae6aba30047e4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a0fd05f09ec7f7aef41be8092…
Author: Roy Shea <roy(a)cs.hmc.edu> Date: Mon Mar 3 16:47:21 2008 -0800 qmgr: Implement Skip and Reset for IEnumBackgroundCopyJobs. --- dlls/qmgr/enum_jobs.c | 17 +++++++++--- dlls/qmgr/tests/enum_jobs.c | 58 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 4 deletions(-) diff --git a/dlls/qmgr/enum_jobs.c b/dlls/qmgr/enum_jobs.c index 98b9cb2..e35730a 100644 --- a/dlls/qmgr/enum_jobs.c +++ b/dlls/qmgr/enum_jobs.c @@ -114,15 +114,24 @@ static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_Skip( IEnumBackgroundCopyJobs* iface, ULONG celt) { - FIXME("Not implemented\n"); - return E_NOTIMPL; + EnumBackgroundCopyJobsImpl *This = (EnumBackgroundCopyJobsImpl *) iface; + + if (This->numJobs - This->indexJobs < celt) + { + This->indexJobs = This->numJobs; + return S_FALSE; + } + + This->indexJobs += celt; + return S_OK; } static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_Reset( IEnumBackgroundCopyJobs* iface) { - FIXME("Not implemented\n"); - return E_NOTIMPL; + EnumBackgroundCopyJobsImpl *This = (EnumBackgroundCopyJobsImpl *) iface; + This->indexJobs = 0; + return S_OK; } static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_Clone( diff --git a/dlls/qmgr/tests/enum_jobs.c b/dlls/qmgr/tests/enum_jobs.c index 93aaf15..343d97a 100644 --- a/dlls/qmgr/tests/enum_jobs.c +++ b/dlls/qmgr/tests/enum_jobs.c @@ -232,6 +232,61 @@ static void test_Next_errors(void) ok(hres != S_OK, "Invalid call to Next succeeded: %08x\n", hres); } +/* Test skipping through the jobs in a list */ +static void test_Skip_walkList(void) +{ + HRESULT hres; + ULONG i; + + for (i = 0; i < test_jobCountB; i++) + { + hres = IEnumBackgroundCopyJobs_Skip(test_enumJobsB, 1); + ok(hres == S_OK, "Skip failed: %08x\n", hres); + if(hres != S_OK) + { + skip("Unable to propely Skip jobs\n"); + return; + } + } + + hres = IEnumBackgroundCopyJobs_Skip(test_enumJobsB, 1); + ok(hres == S_FALSE, "Skip expected end of list: %08x\n", hres); +} + +/* Test skipping off the end of the list */ +static void test_Skip_offEnd(void) +{ + HRESULT hres; + + hres = IEnumBackgroundCopyJobs_Skip(test_enumJobsB, test_jobCountB + 1); + ok(hres == S_FALSE, "Skip expected end of list: %08x\n", hres); +} + +/* Test reset */ +static void test_Reset(void) +{ + HRESULT hres; + + hres = IEnumBackgroundCopyJobs_Skip(test_enumJobsB, test_jobCountB); + ok(hres == S_OK, "Skip failed: %08x\n", hres); + if (hres != S_OK) + { + skip("Skip failed\n"); + return; + } + + hres = IEnumBackgroundCopyJobs_Reset(test_enumJobsB); + ok(hres == S_OK, "Reset failed: %08x\n", hres); + if(hres != S_OK) + { + skip("Unable to Reset enumerator\n"); + return; + } + + hres = IEnumBackgroundCopyJobs_Skip(test_enumJobsB, test_jobCountB); + ok(hres == S_OK, "Reset failed: %08x\n", hres); +} + typedef void (*test_t)(void); START_TEST(enum_jobs) @@ -242,6 +297,9 @@ START_TEST(enum_jobs) test_Next_walkList_1, test_Next_walkList_2, test_Next_errors, + test_Skip_walkList, + test_Skip_offEnd, + test_Reset, 0 }; const test_t *test;
1
0
0
0
Dan Hipschman : qmgr: Implement IEnumBackgroundCopyJobs_Next.
by Alexandre Julliard
04 Mar '08
04 Mar '08
Module: wine Branch: master Commit: 1317e3115adc0e580a333602ae1f27f89730c6a8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1317e3115adc0e580a333602a…
Author: Dan Hipschman <dsh(a)linux.ucla.edu> Date: Mon Mar 3 16:46:44 2008 -0800 qmgr: Implement IEnumBackgroundCopyJobs_Next. --- dlls/qmgr/enum_jobs.c | 32 +++++++++++- dlls/qmgr/tests/enum_jobs.c | 113 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 141 insertions(+), 4 deletions(-) diff --git a/dlls/qmgr/enum_jobs.c b/dlls/qmgr/enum_jobs.c index 6d14791..98b9cb2 100644 --- a/dlls/qmgr/enum_jobs.c +++ b/dlls/qmgr/enum_jobs.c @@ -73,15 +73,41 @@ static ULONG WINAPI BITS_IEnumBackgroundCopyJobs_Release( return ref; } -/*** IEnumBackgroundCopyJobs methods ***/ static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_Next( IEnumBackgroundCopyJobs* iface, ULONG celt, IBackgroundCopyJob **rgelt, ULONG *pceltFetched) { - FIXME("Not implemented\n"); - return E_NOTIMPL; + EnumBackgroundCopyJobsImpl *This = (EnumBackgroundCopyJobsImpl *) iface; + ULONG fetched; + ULONG i; + IBackgroundCopyJob *job; + + fetched = min(celt, This->numJobs - This->indexJobs); + if (pceltFetched) + *pceltFetched = fetched; + else + { + /* We need to initialize this array if the caller doesn't request + the length because length_is will default to celt. */ + for (i = 0; i < celt; ++i) + rgelt[i] = NULL; + + /* pceltFetched can only be NULL if celt is 1 */ + if (celt != 1) + return E_INVALIDARG; + } + + /* Fill in the array of objects */ + for (i = 0; i < fetched; ++i) + { + job = This->jobs[This->indexJobs++]; + IBackgroundCopyJob_AddRef(job); + rgelt[i] = job; + } + + return fetched == celt ? S_OK : S_FALSE; } static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_Skip( diff --git a/dlls/qmgr/tests/enum_jobs.c b/dlls/qmgr/tests/enum_jobs.c index 20344d3..93aaf15 100644 --- a/dlls/qmgr/tests/enum_jobs.c +++ b/dlls/qmgr/tests/enum_jobs.c @@ -1,7 +1,7 @@ /* * Unit test suite for Enum Background Copy Jobs Interface * - * Copyright 2007 Google (Roy Shea) + * Copyright 2007 Google (Roy Shea, Dan Hipschman) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -31,6 +31,7 @@ static const WCHAR test_displayNameB[] = {'T','e','s','t','B', 0}; static IBackgroundCopyManager *test_manager; static IBackgroundCopyJob *test_jobA; static IBackgroundCopyJob *test_jobB; +static ULONG test_jobCountB; static IEnumBackgroundCopyJobs *test_enumJobsA; static IEnumBackgroundCopyJobs *test_enumJobsB; static GUID test_jobIdA; @@ -73,6 +74,10 @@ static BOOL setup(void) if(hres != S_OK) return FALSE; + hres = IEnumBackgroundCopyJobs_GetCount(test_enumJobsB, &test_jobCountB); + if (hres != S_OK) + return FALSE; + return TRUE; } @@ -125,12 +130,118 @@ static void test_GetCount(void) ok(jobCountB == jobCountA + 1, "Got incorrect count\n"); } +/* Test Next with a NULL pceltFetched*/ +static void test_Next_walkListNull(void) +{ + HRESULT hres; + IBackgroundCopyJob *job; + ULONG i; + + /* Fetch the available jobs */ + for (i = 0; i < test_jobCountB; i++) + { + hres = IEnumBackgroundCopyJobs_Next(test_enumJobsB, 1, &job, NULL); + ok(hres == S_OK, "Next failed: %08x\n", hres); + if(hres != S_OK) + { + skip("Unable to get job from Next\n"); + return; + } + IBackgroundCopyJob_Release(job); + } + + /* Attempt to fetch one more than the number of available jobs */ + hres = IEnumBackgroundCopyJobs_Next(test_enumJobsB, 1, &job, NULL); + ok(hres == S_FALSE, "Next off end of available jobs failed: %08x\n", hres); +} + +/* Test Next */ +static void test_Next_walkList_1(void) +{ + HRESULT hres; + IBackgroundCopyJob *job; + ULONG fetched; + ULONG i; + + /* Fetch the available jobs */ + for (i = 0; i < test_jobCountB; i++) + { + fetched = 0; + hres = IEnumBackgroundCopyJobs_Next(test_enumJobsB, 1, &job, &fetched); + ok(hres == S_OK, "Next failed: %08x\n", hres); + if(hres != S_OK) + { + skip("Unable to get job from Next\n"); + return; + } + ok(fetched == 1, "Next returned the incorrect number of jobs: %08x\n", hres); + IBackgroundCopyJob_Release(job); + } + + /* Attempt to fetch one more than the number of available jobs */ + fetched = 0; + hres = IEnumBackgroundCopyJobs_Next(test_enumJobsB, 1, &job, &fetched); + ok(hres == S_FALSE, "Next off end of available jobs failed: %08x\n", hres); + ok(fetched == 0, "Next returned the incorrect number of jobs: %08x\n", hres); +} + +/* Test Next by requesting multiple files at a time */ +static void test_Next_walkList_2(void) +{ + HRESULT hres; + IBackgroundCopyJob **jobs; + ULONG fetched; + ULONG i; + + jobs = HeapAlloc(GetProcessHeap(), 0, test_jobCountB * sizeof *jobs); + if (!jobs) + { + skip("Couldn't allocate memory\n"); + return; + } + + for (i = 0; i < test_jobCountB; i++) + jobs[i] = NULL; + + fetched = 0; + hres = IEnumBackgroundCopyJobs_Next(test_enumJobsB, test_jobCountB, jobs, &fetched); + ok(hres == S_OK, "Next failed: %08x\n", hres); + if(hres != S_OK) + { + skip("Unable to get file from test_enumJobs\n"); + return; + } + ok(fetched == test_jobCountB, "Next returned the incorrect number of jobs: %08x\n", hres); + + for (i = 0; i < test_jobCountB; i++) + { + ok(jobs[i] != NULL, "Next returned NULL\n"); + if (jobs[i]) + IBackgroundCopyFile_Release(jobs[i]); + } +} + +/* Test Next Error conditions */ +static void test_Next_errors(void) +{ + HRESULT hres; + IBackgroundCopyJob *jobs[2]; + + /* E_INVALIDARG: pceltFetched can ONLY be NULL if celt is 1 */ + hres = IEnumBackgroundCopyJobs_Next(test_enumJobsB, 2, jobs, NULL); + ok(hres != S_OK, "Invalid call to Next succeeded: %08x\n", hres); +} + typedef void (*test_t)(void); START_TEST(enum_jobs) { static const test_t tests[] = { test_GetCount, + test_Next_walkListNull, + test_Next_walkList_1, + test_Next_walkList_2, + test_Next_errors, 0 }; const test_t *test;
1
0
0
0
Roy Shea : qmgr: Implement IEnumBackgroundCopyJobs_GetCount.
by Alexandre Julliard
04 Mar '08
04 Mar '08
Module: wine Branch: master Commit: 8dfba77c8cfcf235ee2c6b8927059c8b97f9ac0b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8dfba77c8cfcf235ee2c6b892…
Author: Roy Shea <roy(a)cs.hmc.edu> Date: Mon Mar 3 16:46:08 2008 -0800 qmgr: Implement IEnumBackgroundCopyJobs_GetCount. --- dlls/qmgr/enum_jobs.c | 39 +++++++++++- dlls/qmgr/qmgr.h | 3 + dlls/qmgr/tests/Makefile.in | 1 + dlls/qmgr/tests/enum_jobs.c | 152 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 193 insertions(+), 2 deletions(-) diff --git a/dlls/qmgr/enum_jobs.c b/dlls/qmgr/enum_jobs.c index 54ecaab..6d14791 100644 --- a/dlls/qmgr/enum_jobs.c +++ b/dlls/qmgr/enum_jobs.c @@ -25,6 +25,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(qmgr); static void EnumBackgroundCopyJobsDestructor(EnumBackgroundCopyJobsImpl *This) { + ULONG i; + + for(i = 0; i < This->numJobs; i++) + IBackgroundCopyJob_Release(This->jobs[i]); + + HeapFree(GetProcessHeap(), 0, This->jobs); HeapFree(GetProcessHeap(), 0, This); } @@ -105,8 +111,9 @@ static HRESULT WINAPI BITS_IEnumBackgroundCopyJobs_GetCount( IEnumBackgroundCopyJobs* iface, ULONG *puCount) { - FIXME("Not implemented\n"); - return E_NOTIMPL; + EnumBackgroundCopyJobsImpl *This = (EnumBackgroundCopyJobsImpl *) iface; + *puCount = This->numJobs; + return S_OK; } static const IEnumBackgroundCopyJobsVtbl BITS_IEnumBackgroundCopyJobs_Vtbl = @@ -124,7 +131,10 @@ static const IEnumBackgroundCopyJobsVtbl BITS_IEnumBackgroundCopyJobs_Vtbl = HRESULT EnumBackgroundCopyJobsConstructor(LPVOID *ppObj, IBackgroundCopyManager* copyManager) { + BackgroundCopyManagerImpl *qmgr = (BackgroundCopyManagerImpl *) copyManager; EnumBackgroundCopyJobsImpl *This; + BackgroundCopyJobImpl *job; + ULONG i; TRACE("%p, %p)\n", ppObj, copyManager); @@ -134,6 +144,31 @@ HRESULT EnumBackgroundCopyJobsConstructor(LPVOID *ppObj, This->lpVtbl = &BITS_IEnumBackgroundCopyJobs_Vtbl; This->ref = 1; + /* Create array of jobs */ + This->indexJobs = 0; + This->numJobs = list_count(&qmgr->jobs); + + if (0 < This->numJobs) + { + This->jobs = HeapAlloc(GetProcessHeap(), 0, + This->numJobs * sizeof *This->jobs); + if (!This->jobs) + { + HeapFree(GetProcessHeap(), 0, This); + return E_OUTOFMEMORY; + } + } + else + This->jobs = NULL; + + i = 0; + LIST_FOR_EACH_ENTRY(job, &qmgr->jobs, BackgroundCopyJobImpl, entryFromQmgr) + { + IBackgroundCopyJob *iJob = (IBackgroundCopyJob *) job; + IBackgroundCopyJob_AddRef(iJob); + This->jobs[i++] = iJob; + } + *ppObj = &This->lpVtbl; return S_OK; } diff --git a/dlls/qmgr/qmgr.h b/dlls/qmgr/qmgr.h index f5629c6..2ab3f57 100644 --- a/dlls/qmgr/qmgr.h +++ b/dlls/qmgr/qmgr.h @@ -48,6 +48,9 @@ typedef struct { const IEnumBackgroundCopyJobsVtbl *lpVtbl; LONG ref; + IBackgroundCopyJob **jobs; + ULONG numJobs; + ULONG indexJobs; } EnumBackgroundCopyJobsImpl; /* Enum background copy files vtbl and related data */ diff --git a/dlls/qmgr/tests/Makefile.in b/dlls/qmgr/tests/Makefile.in index 840676d..9a3c596 100644 --- a/dlls/qmgr/tests/Makefile.in +++ b/dlls/qmgr/tests/Makefile.in @@ -7,6 +7,7 @@ IMPORTS = ole32 shlwapi user32 kernel32 CTESTS = \ enum_files.c \ + enum_jobs.c \ file.c \ job.c \ qmgr.c diff --git a/dlls/qmgr/tests/enum_jobs.c b/dlls/qmgr/tests/enum_jobs.c new file mode 100644 index 0000000..20344d3 --- /dev/null +++ b/dlls/qmgr/tests/enum_jobs.c @@ -0,0 +1,152 @@ +/* + * Unit test suite for Enum Background Copy Jobs Interface + * + * Copyright 2007 Google (Roy Shea) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdio.h> + +#define COBJMACROS + +#include "wine/test.h" +#include "bits.h" + +/* Globals used by many tests */ +static const WCHAR test_displayNameA[] = {'T','e','s','t','A', 0}; +static const WCHAR test_displayNameB[] = {'T','e','s','t','B', 0}; +static IBackgroundCopyManager *test_manager; +static IBackgroundCopyJob *test_jobA; +static IBackgroundCopyJob *test_jobB; +static IEnumBackgroundCopyJobs *test_enumJobsA; +static IEnumBackgroundCopyJobs *test_enumJobsB; +static GUID test_jobIdA; +static GUID test_jobIdB; + +/* Generic test setup */ +static BOOL setup(void) +{ + HRESULT hres; + + test_manager = NULL; + test_jobA = NULL; + test_jobB = NULL; + memset(&test_jobIdA, 0, sizeof test_jobIdA); + memset(&test_jobIdB, 0, sizeof test_jobIdB); + + hres = CoCreateInstance(&CLSID_BackgroundCopyManager, NULL, + CLSCTX_LOCAL_SERVER, &IID_IBackgroundCopyManager, + (void **) &test_manager); + if(hres != S_OK) + return FALSE; + + hres = IBackgroundCopyManager_CreateJob(test_manager, test_displayNameA, + BG_JOB_TYPE_DOWNLOAD, &test_jobIdA, + &test_jobA); + if(hres != S_OK) + return FALSE; + + hres = IBackgroundCopyManager_EnumJobs(test_manager, 0, &test_enumJobsA); + if(hres != S_OK) + return FALSE; + + hres = IBackgroundCopyManager_CreateJob(test_manager, test_displayNameB, + BG_JOB_TYPE_DOWNLOAD, &test_jobIdB, + &test_jobB); + if(hres != S_OK) + return FALSE; + + hres = IBackgroundCopyManager_EnumJobs(test_manager, 0, &test_enumJobsB); + if(hres != S_OK) + return FALSE; + + return TRUE; +} + +/* Generic test cleanup */ +static void teardown(void) +{ + if (test_enumJobsB) + IEnumBackgroundCopyJobs_Release(test_enumJobsB); + test_enumJobsB = NULL; + if (test_jobB) + IBackgroundCopyJob_Release(test_jobB); + test_jobB = NULL; + if (test_enumJobsA) + IEnumBackgroundCopyJobs_Release(test_enumJobsA); + test_enumJobsA = NULL; + if (test_jobA) + IBackgroundCopyJob_Release(test_jobA); + test_jobA = NULL; + if (test_manager) + IBackgroundCopyManager_Release(test_manager); + test_manager = NULL; +} + +/* We can't assume the job count will start at any fixed number since esp + when testing on Windows there may be other jobs created by other + processes. Even this approach of creating two jobs and checking the + difference in counts could fail if a job was created in between, but + it's probably not worth worrying about in sane test environments. */ +static void test_GetCount(void) +{ + HRESULT hres; + ULONG jobCountA, jobCountB; + + hres = IEnumBackgroundCopyJobs_GetCount(test_enumJobsA, &jobCountA); + ok(hres == S_OK, "GetCount failed: %08x\n", hres); + if(hres != S_OK) + { + skip("Couldn't get job count\n"); + return; + } + + hres = IEnumBackgroundCopyJobs_GetCount(test_enumJobsB, &jobCountB); + ok(hres == S_OK, "GetCount failed: %08x\n", hres); + if(hres != S_OK) + { + skip("Couldn't get job count\n"); + return; + } + + ok(jobCountB == jobCountA + 1, "Got incorrect count\n"); +} + +typedef void (*test_t)(void); + +START_TEST(enum_jobs) +{ + static const test_t tests[] = { + test_GetCount, + 0 + }; + const test_t *test; + + CoInitialize(NULL); + for (test = tests; *test; ++test) + { + /* Keep state seperate between tests. */ + if (!setup()) + { + teardown(); + skip("Unable to setup test\n"); + break; + } + (*test)(); + teardown(); + } + CoUninitialize(); +}
1
0
0
0
James Hawkins : msi: Add tests for MsiGetProductInfoEx.
by Alexandre Julliard
04 Mar '08
04 Mar '08
Module: wine Branch: master Commit: 4609eccd720af4dc38b22e82df8d2de665ba629a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4609eccd720af4dc38b22e82d…
Author: James Hawkins <jhawkins(a)codeweavers.com> Date: Tue Mar 4 03:09:40 2008 -0600 msi: Add tests for MsiGetProductInfoEx. --- dlls/msi/tests/msi.c | 2733 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 2733 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=4609eccd720af4dc38b22…
1
0
0
0
James Hawkins : msi: Implement MsiGetProductInfoEx.
by Alexandre Julliard
04 Mar '08
04 Mar '08
Module: wine Branch: master Commit: ad70693539a634a28a2c2e4816bb7f085c91fd81 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ad70693539a634a28a2c2e481…
Author: James Hawkins <jhawkins(a)codeweavers.com> Date: Tue Mar 4 03:08:19 2008 -0600 msi: Implement MsiGetProductInfoEx. --- dlls/msi/msi.c | 286 +++++++++++++++++++++++++++++++++++++++++++++++++++++ dlls/msi/msi.spec | 4 +- include/msi.h | 4 + 3 files changed, 292 insertions(+), 2 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=ad70693539a634a28a2c2…
1
0
0
0
Austin English : winecfg: Raise max screen resolution to 160 DPI.
by Alexandre Julliard
04 Mar '08
04 Mar '08
Module: wine Branch: master Commit: d817d7c2205044b54dc6f05eb86c5d389a3babb6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d817d7c2205044b54dc6f05eb…
Author: Austin English <austinenglish(a)gmail.com> Date: Mon Mar 3 22:09:53 2008 -0600 winecfg: Raise max screen resolution to 160 DPI. --- programs/winecfg/x11drvdlg.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/programs/winecfg/x11drvdlg.c b/programs/winecfg/x11drvdlg.c index 51098e4..d6e9912 100644 --- a/programs/winecfg/x11drvdlg.c +++ b/programs/winecfg/x11drvdlg.c @@ -37,7 +37,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(winecfg); #define RES_MAXLEN 5 /* the maximum number of characters in a screen dimension. 5 digits should be plenty, what kind of crazy person runs their screen >10,000 pixels across? */ #define MINDPI 96 -#define MAXDPI 120 +#define MAXDPI 160 #define DEFDPI 96 static const char logpixels_reg[] = "System\\CurrentControlSet\\Hardware Profiles\\Current\\Software\\Fonts";
1
0
0
0
Jason Edmeades : cmd.exe: Support cd .. when saving current directory.
by Alexandre Julliard
04 Mar '08
04 Mar '08
Module: wine Branch: master Commit: 4492334762a71d037edfab61cb40ad337723d974 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4492334762a71d037edfab61c…
Author: Jason Edmeades <jason.edmeades(a)googlemail.com> Date: Mon Mar 3 23:14:30 2008 +0000 cmd.exe: Support cd .. when saving current directory. --- programs/cmd/builtins.c | 3 +++ programs/cmd/wcmdmain.c | 3 +++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index 8592090..17b385d 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -1865,6 +1865,9 @@ void WCMD_setshow_default (WCHAR *command) { return; } else { + /* Save away the actual new directory, to store as current location */ + GetCurrentDirectoryW (sizeof(string)/sizeof(WCHAR), string); + /* Restore old directory if drive letter would change, and CD x:\directory /D (or pushd c:\directory) not supplied */ if ((strstrW(quals, parmD) == NULL) && diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index 2261a28..4c482ee 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -419,6 +419,7 @@ int wmain (int argc, WCHAR *argvW[]) static const WCHAR fmt[] = {'=','%','c',':','\0'}; wsprintf(envvar, fmt, string[0]); SetEnvironmentVariable(envvar, string); + WINE_TRACE("Set %s to %s\n", wine_dbgstr_w(envvar), wine_dbgstr_w(string)); } if (opt_k) { @@ -643,7 +644,9 @@ void WCMD_execute (WCHAR *command, WCHAR *redirects, if (GetEnvironmentVariable(envvar, dir, MAX_PATH) == 0) { static const WCHAR fmt[] = {'%','s','\\','\0'}; wsprintf(cmd, fmt, cmd); + WINE_TRACE("No special directory settings, using dir of %s\n", wine_dbgstr_w(cmd)); } + WINE_TRACE("Got directory %s as %s\n", wine_dbgstr_w(envvar), wine_dbgstr_w(cmd)); status = SetCurrentDirectory (cmd); if (!status) WCMD_print_error (); HeapFree( GetProcessHeap(), 0, cmd );
1
0
0
0
Jason Edmeades : cmd.exe: Fix pipes.
by Alexandre Julliard
04 Mar '08
04 Mar '08
Module: wine Branch: master Commit: 84f02a6ab21690f9249672c7f547225e3cbdff72 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=84f02a6ab21690f9249672c7f…
Author: Jason Edmeades <jason.edmeades(a)googlemail.com> Date: Mon Mar 3 23:14:29 2008 +0000 cmd.exe: Fix pipes. --- programs/cmd/builtins.c | 12 ++- programs/cmd/wcmd.h | 11 ++- programs/cmd/wcmdmain.c | 188 ++++++++++++++++++++++++++--------------------- 3 files changed, 121 insertions(+), 90 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=84f02a6ab21690f924967…
1
0
0
0
Jason Edmeades : cmd.exe: Fix running programs from root of drive.
by Alexandre Julliard
04 Mar '08
04 Mar '08
Module: wine Branch: master Commit: 52e8f6f69b3a6766c278d4c085ba728e6199547f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=52e8f6f69b3a6766c278d4c08…
Author: Jason Edmeades <jason.edmeades(a)googlemail.com> Date: Mon Mar 3 23:14:28 2008 +0000 cmd.exe: Fix running programs from root of drive. --- programs/cmd/wcmdmain.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index 2966bcc..36faa8b 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -962,8 +962,11 @@ void WCMD_run_program (WCHAR *command, int called) { GetFullPathName(param1, sizeof(pathtosearch)/sizeof(WCHAR), pathtosearch, NULL); lastSlash = strrchrW(pathtosearch, '\\'); if (lastSlash && strchrW(lastSlash, '.') != NULL) extensionsupplied = TRUE; - if (lastSlash) *lastSlash = 0x00; strcpyW(stemofsearch, lastSlash+1); + + /* Reduce pathtosearch to a path with trailing '\' to support c:\a.bat and + c:\windows\a.bat syntax */ + if (lastSlash) *(lastSlash + 1) = 0x00; } /* Now extract PATHEXT */
1
0
0
0
← Newer
1
...
89
90
91
92
93
94
95
...
101
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
Results per page:
10
25
50
100
200