ReactOS.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
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
List overview
Download
Ros-diffs
July 2015
----- 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
ros-diffs@reactos.org
13 participants
257 discussions
Start a n
N
ew thread
[akhaldi] 68494: [RASAPI32_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Jul 20 22:52:14 2015 New Revision: 68494 URL:
http://svn.reactos.org/svn/reactos?rev=68494&view=rev
Log: [RASAPI32_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/rostests/winetests/rasapi32/rasapi.c Modified: trunk/rostests/winetests/rasapi32/rasapi.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/rasapi32/rasapi…
============================================================================== --- trunk/rostests/winetests/rasapi32/rasapi.c [iso-8859-1] (original) +++ trunk/rostests/winetests/rasapi32/rasapi.c [iso-8859-1] Mon Jul 20 22:52:14 2015 @@ -77,54 +77,71 @@ /* test first parameter */ cb = bufsize; + cDevices = 0xdeadbeef; result = pRasEnumDevicesA(NULL, &cb, &cDevices); + ok(0 < cDevices && cDevices < 32, "expected 0 < cDevices < 32, got %u\n", cDevices); ok(result == ERROR_BUFFER_TOO_SMALL || result == ERROR_INVALID_USER_BUFFER, /* win98 */ "Expected ERROR_BUFFER_TOO_SMALL, got %08d\n", result); rasDevInfo[0].dwSize = 0; cb = bufsize; + cDevices = 0xdeadbeef; result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); + ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %u\n", cDevices); ok(result == ERROR_INVALID_SIZE || result == ERROR_INVALID_USER_BUFFER, /* win98 */ "Expected ERROR_INVALID_SIZE, got %08d\n", result); rasDevInfo[0].dwSize = sizeof(RASDEVINFOA) -1; cb = bufsize; + cDevices = 0xdeadbeef; result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); + ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %u\n", cDevices); ok(result == ERROR_INVALID_SIZE || result == ERROR_INVALID_USER_BUFFER, /* win98 */ "Expected ERROR_INVALID_SIZE, got %08d\n", result); rasDevInfo[0].dwSize = sizeof(RASDEVINFOA) +1; cb = bufsize; + cDevices = 0xdeadbeef; result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); + ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %u\n", cDevices); ok(result == ERROR_INVALID_SIZE || result == ERROR_INVALID_USER_BUFFER, /* win98 */ "Expected ERROR_INVALID_SIZE, got %08d\n", result); /* test second parameter */ rasDevInfo[0].dwSize = sizeof(RASDEVINFOA); + cDevices = 0xdeadbeef; result = pRasEnumDevicesA(rasDevInfo, NULL, &cDevices); + ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %u\n", cDevices); ok(result == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %08d\n", result); rasDevInfo[0].dwSize = sizeof(RASDEVINFOA); cb = 0; + cDevices = 0xdeadbeef; result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); + todo_wine + ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %u\n", cDevices); ok(result == ERROR_BUFFER_TOO_SMALL || result == ERROR_INVALID_SIZE, /* vista, 2k8 */ "Expected ERROR_BUFFER_TOO_SMALL/ERROR_INVALID_SIZE, got %08d\n", result); rasDevInfo[0].dwSize = sizeof(RASDEVINFOA); cb = bufsize -1; + cDevices = 0xdeadbeef; result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); + ok(0 < cDevices && cDevices < 32, "expected 0 < cDevices < 32, got %u\n", cDevices); ok(result == ERROR_BUFFER_TOO_SMALL, "Expected ERROR_BUFFER_TOO_SMALL, got %08d\n", result); rasDevInfo[0].dwSize = sizeof(RASDEVINFOA); cb = bufsize +1; + cDevices = 0xdeadbeef; result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); + ok(0 < cDevices && cDevices < 32, "expected 0 < cDevices < 32, got %u\n", cDevices); ok(result == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %08d\n", result); @@ -136,7 +153,9 @@ "Expected ERROR_INVALID_PARAMETER, got %08d\n", result); /* test combinations of invalid parameters */ + cDevices = 0xdeadbeef; result = pRasEnumDevicesA(NULL, NULL, &cDevices); + ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %u\n", cDevices); ok(result == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %08d\n", result); @@ -147,7 +166,9 @@ cb = 0; rasDevInfo[0].dwSize = 0; + cDevices = 0xdeadbeef; result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); + ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %u\n", cDevices); ok(result == ERROR_INVALID_SIZE || broken(result == ERROR_BUFFER_TOO_SMALL), /* win98 */ "Expected ERROR_INVALID_SIZE, got %08d\n", result);
9 years, 5 months
1
0
0
0
[akhaldi] 68493: [RASAPI32] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Jul 20 22:50:34 2015 New Revision: 68493 URL:
http://svn.reactos.org/svn/reactos?rev=68493&view=rev
Log: [RASAPI32] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/reactos/dll/win32/rasapi32/rasapi.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/rasapi32/rasapi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rasapi32/rasapi.…
============================================================================== --- trunk/reactos/dll/win32/rasapi32/rasapi.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rasapi32/rasapi.c [iso-8859-1] Mon Jul 20 22:50:34 2015 @@ -256,6 +256,8 @@ if(lpRasDevinfo && lpRasDevinfo->dwSize != sizeof(RASDEVINFOA)) return ERROR_INVALID_SIZE; + *lpcDevices = 1; + if (!lpRasDevinfo || (*lpcb < sizeof(RASDEVINFOA))) { *lpcb = sizeof(RASDEVINFOA); return ERROR_BUFFER_TOO_SMALL; Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Mon Jul 20 22:50:34 2015 @@ -162,7 +162,7 @@ reactos/dll/win32/qmgr # Synced to WineStaging-1.7.47 reactos/dll/win32/qmgrprxy # Synced to WineStaging-1.7.47 reactos/dll/win32/query # Synced to WineStaging-1.7.37 -reactos/dll/win32/rasapi32 # Synced to WineStaging-1.7.37 +reactos/dll/win32/rasapi32 # Synced to WineStaging-1.7.47 reactos/dll/win32/resutils # Synced to WineStaging-1.7.37 reactos/dll/win32/riched20 # Synced to WineStaging-1.7.37 reactos/dll/win32/riched32 # Synced to WineStaging-1.7.37
9 years, 5 months
1
0
0
0
[akhaldi] 68492: [QMGRPRXY] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Jul 20 22:49:30 2015 New Revision: 68492 URL:
http://svn.reactos.org/svn/reactos?rev=68492&view=rev
Log: [QMGRPRXY] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/reactos/dll/win32/qmgrprxy/qmgrprxy.idl trunk/reactos/dll/win32/qmgrprxy/qmgrprxy.rgs trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/qmgrprxy/qmgrprxy.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgrprxy/qmgrprx…
============================================================================== --- trunk/reactos/dll/win32/qmgrprxy/qmgrprxy.idl [iso-8859-1] (original) +++ trunk/reactos/dll/win32/qmgrprxy/qmgrprxy.idl [iso-8859-1] Mon Jul 20 22:49:30 2015 @@ -24,6 +24,8 @@ #define DO_NO_IMPORTS #include "bits1_5.idl" +#include "bits2_0.idl" +#include "bits2_5.idl" #include "bits3_0.idl" [ Modified: trunk/reactos/dll/win32/qmgrprxy/qmgrprxy.rgs URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgrprxy/qmgrprx…
============================================================================== --- trunk/reactos/dll/win32/qmgrprxy/qmgrprxy.rgs [iso-8859-1] (original) +++ trunk/reactos/dll/win32/qmgrprxy/qmgrprxy.rgs [iso-8859-1] Mon Jul 20 22:49:30 2015 @@ -42,6 +42,21 @@ NumMethods = s 43 ProxyStubClsid32 = s '{5CE34C0D-0DC9-4C1F-897C-DAA1B78CEE7C}' } + '{443C8934-90FF-48ED-BCDE-26F5C7450042}' = s 'IBackgroundCopyJob3' + { + NumMethods = s 47 + ProxyStubClsid32 = s '{5CE34C0D-0DC9-4C1F-897C-DAA1B78CEE7C}' + } + '{83E81B93-0873-474D-8A8C-F2018B1A939C}' = s 'IBackgroundCopyFile2' + { + NumMethods = s 8 + ProxyStubClsid32 = s '{5CE34C0D-0DC9-4C1F-897C-DAA1B78CEE7C}' + } + '{F1BD1079-9F01-4BDC-8036-F09B70095066}' = s 'IBackgroundCopyJobHttpOptions' + { + NumMethods = s 11 + ProxyStubClsid32 = s '{5CE34C0D-0DC9-4C1F-897C-DAA1B78CEE7C}' + } '{659CDEAC-489E-11D9-A9CD-000D56965251}' = s 'IBackgroundCopyCallback2' { NumMethods = s 7 Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Mon Jul 20 22:49:30 2015 @@ -160,7 +160,7 @@ reactos/dll/win32/propsys # Synced to WineStaging-1.7.37 reactos/dll/win32/pstorec # Synced to WineStaging-1.7.37 reactos/dll/win32/qmgr # Synced to WineStaging-1.7.47 -reactos/dll/win32/qmgrprxy # Synced to WineStaging-1.7.37 +reactos/dll/win32/qmgrprxy # Synced to WineStaging-1.7.47 reactos/dll/win32/query # Synced to WineStaging-1.7.37 reactos/dll/win32/rasapi32 # Synced to WineStaging-1.7.37 reactos/dll/win32/resutils # Synced to WineStaging-1.7.37
9 years, 5 months
1
0
0
0
[akhaldi] 68491: [QMGR_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Jul 20 22:48:46 2015 New Revision: 68491 URL:
http://svn.reactos.org/svn/reactos?rev=68491&view=rev
Log: [QMGR_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/rostests/winetests/qmgr/job.c Modified: trunk/rostests/winetests/qmgr/job.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/qmgr/job.c?rev=…
============================================================================== --- trunk/rostests/winetests/qmgr/job.c [iso-8859-1] (original) +++ trunk/rostests/winetests/qmgr/job.c [iso-8859-1] Mon Jul 20 22:48:46 2015 @@ -30,6 +30,8 @@ #include <objbase.h> #include <bits.h> #include <initguid.h> +#include <bits2_0.h> +#include <bits2_5.h> /* Globals used by many tests */ static const WCHAR test_displayName[] = {'T', 'e', 's', 't', 0}; @@ -106,51 +108,74 @@ /* Generic test cleanup */ static void teardown(void) { + IBackgroundCopyJob_Cancel(test_job); IBackgroundCopyJob_Release(test_job); IBackgroundCopyManager_Release(test_manager); } -/* FIXME: Remove when Wine has implemented this */ -DEFINE_GUID(CLSID_BackgroundCopyManager2_0, 0x6d18ad12, 0xbde3, 0x4393, 0xb3,0x11, 0x09,0x9c,0x34,0x6e,0x6d,0xf9); - static BOOL check_bits20(void) { HRESULT hres; IBackgroundCopyManager *manager; - BOOL ret = TRUE; - - hres = CoCreateInstance(&CLSID_BackgroundCopyManager2_0, NULL, - CLSCTX_LOCAL_SERVER, - &IID_IBackgroundCopyManager, - (void **) &manager); - - if (hres == REGDB_E_CLASSNOTREG) - { - ret = FALSE; - - /* FIXME: Wine implements 2.0 functionality but doesn't advertise 2.0 - * - * Remove when Wine is fixed - */ - if (setup()) - { - HRESULT hres2; - - hres2 = IBackgroundCopyJob_AddFile(test_job, test_remotePathA, - test_localPathA); - if (hres2 == S_OK) - { - trace("Running on Wine, claim 2.0 is present\n"); - ret = TRUE; - } - teardown(); - } - } - - if (manager) + IBackgroundCopyJob *job, *job3; + + hres = CoCreateInstance(&CLSID_BackgroundCopyManager, NULL, + CLSCTX_LOCAL_SERVER, &IID_IBackgroundCopyManager, + (void **)&manager); + if (hres != S_OK) return FALSE; + + hres = IBackgroundCopyManager_CreateJob(manager, test_displayName, test_type, &test_jobId, &job); + if (hres != S_OK) + { IBackgroundCopyManager_Release(manager); - - return ret; + return FALSE; + } + + hres = IBackgroundCopyJob_QueryInterface(job, &IID_IBackgroundCopyJob3, (void **)&job3); + IBackgroundCopyJob_Cancel(job); + IBackgroundCopyJob_Release(job); + if (hres != S_OK) + { + IBackgroundCopyManager_Release(manager); + return FALSE; + } + + IBackgroundCopyJob_Release(job3); + IBackgroundCopyManager_Release(manager); + return TRUE; +} + +static BOOL check_bits25(void) +{ + HRESULT hres; + IBackgroundCopyManager *manager; + IBackgroundCopyJob *job; + IBackgroundCopyJobHttpOptions *options; + + hres = CoCreateInstance(&CLSID_BackgroundCopyManager, NULL, + CLSCTX_LOCAL_SERVER, &IID_IBackgroundCopyManager, + (void **)&manager); + if (hres != S_OK) return FALSE; + + hres = IBackgroundCopyManager_CreateJob(manager, test_displayName, test_type, &test_jobId, &job); + if (hres != S_OK) + { + IBackgroundCopyManager_Release(manager); + return FALSE; + } + + hres = IBackgroundCopyJob_QueryInterface(job, &IID_IBackgroundCopyJobHttpOptions, (void **)&options); + IBackgroundCopyJob_Cancel(job); + IBackgroundCopyJob_Release(job); + if (hres != S_OK) + { + IBackgroundCopyManager_Release(manager); + return FALSE; + } + + IBackgroundCopyJobHttpOptions_Release(options); + IBackgroundCopyManager_Release(manager); + return TRUE; } /* Test that the jobId is properly set */ @@ -460,6 +485,151 @@ hr = IBackgroundCopyJob_GetNotifyInterface(test_job, &unk); ok(hr == S_OK, "got 0x%08x\n", hr); ok(unk == NULL, "got %p\n", unk); +} + +static void test_Cancel(void) +{ + HRESULT hr; + BG_JOB_STATE state; + + state = BG_JOB_STATE_ERROR; + hr = IBackgroundCopyJob_GetState(test_job, &state); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(state != BG_JOB_STATE_CANCELLED, "got %u\n", state); + + hr = IBackgroundCopyJob_Cancel(test_job); + ok(hr == S_OK, "got 0x%08x\n", hr); + + state = BG_JOB_STATE_ERROR; + hr = IBackgroundCopyJob_GetState(test_job, &state); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(state == BG_JOB_STATE_CANCELLED, "got %u\n", state); + + hr = IBackgroundCopyJob_Cancel(test_job); + ok(hr == BG_E_INVALID_STATE, "got 0x%08x\n", hr); +} + +static void test_HttpOptions(void) +{ + static const WCHAR urlW[] = + {'h','t','t','p','s',':','/','/','t','e','s','t','.','w','i','n','e','h','q','.','o','r','g','/',0}; + static const WCHAR winetestW[] = + {'W','i','n','e',':',' ','t','e','s','t','\r','\n',0}; + static const unsigned int timeout = 30; + HRESULT hr; + IBackgroundCopyJobHttpOptions *options; + IBackgroundCopyError *error; + BG_JOB_STATE state; + unsigned int i; + WCHAR *headers; + ULONG flags, orig_flags; + + DeleteFileW(test_localPathA); + hr = IBackgroundCopyJob_AddFile(test_job, urlW, test_localPathA); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IBackgroundCopyJob_QueryInterface(test_job, &IID_IBackgroundCopyJobHttpOptions, (void **)&options); + ok(hr == S_OK, "got 0x%08x\n", hr); + + if (options) + { + headers = (WCHAR *)0xdeadbeef; + hr = IBackgroundCopyJobHttpOptions_GetCustomHeaders(options, &headers); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + ok(headers == NULL, "got %p\n", headers); + + hr = IBackgroundCopyJobHttpOptions_SetCustomHeaders(options, winetestW); + ok(hr == S_OK, "got 0x%08x\n", hr); + + headers = (WCHAR *)0xdeadbeef; + hr = IBackgroundCopyJobHttpOptions_GetCustomHeaders(options, &headers); + ok(hr == S_OK, "got 0x%08x\n", hr); + if (hr == S_OK) + { + ok(!lstrcmpW(headers, winetestW), "got %s\n", wine_dbgstr_w(headers)); + CoTaskMemFree(headers); + } + + hr = IBackgroundCopyJobHttpOptions_SetCustomHeaders(options, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + headers = (WCHAR *)0xdeadbeef; + hr = IBackgroundCopyJobHttpOptions_GetCustomHeaders(options, &headers); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + ok(headers == NULL, "got %p\n", headers); + + orig_flags = 0xdeadbeef; + hr = IBackgroundCopyJobHttpOptions_GetSecurityFlags(options, &orig_flags); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(!orig_flags, "got 0x%08x\n", orig_flags); + + hr = IBackgroundCopyJobHttpOptions_SetSecurityFlags(options, 0); + ok(hr == S_OK, "got 0x%08x\n", hr); + + flags = 0xdeadbeef; + hr = IBackgroundCopyJobHttpOptions_GetSecurityFlags(options, &flags); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(!flags, "got 0x%08x\n", flags); + } + + hr = IBackgroundCopyJob_Resume(test_job); + ok(hr == S_OK, "got 0x%08x\n", hr); + + for (i = 0; i < timeout; i++) + { + hr = IBackgroundCopyJob_GetState(test_job, &state); + ok(hr == S_OK, "got 0x%08x\n", hr); + + ok(state == BG_JOB_STATE_QUEUED || + state == BG_JOB_STATE_CONNECTING || + state == BG_JOB_STATE_TRANSFERRING || + state == BG_JOB_STATE_TRANSFERRED, "unexpected state: %u\n", state); + + if (state == BG_JOB_STATE_TRANSFERRED) break; + Sleep(1000); + } + ok(i < timeout, "BITS job timed out\n"); + if (i < timeout) + { + hr = IBackgroundCopyJob_GetError(test_job, &error); + ok(hr == BG_E_ERROR_INFORMATION_UNAVAILABLE, "got 0x%08x\n", hr); + } + + if (options) + { + headers = (WCHAR *)0xdeadbeef; + hr = IBackgroundCopyJobHttpOptions_GetCustomHeaders(options, &headers); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + ok(headers == NULL, "got %p\n", headers); + + hr = IBackgroundCopyJobHttpOptions_SetCustomHeaders(options, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IBackgroundCopyJobHttpOptions_GetCustomHeaders(options, &headers); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + + flags = 0xdeadbeef; + hr = IBackgroundCopyJobHttpOptions_GetSecurityFlags(options, &flags); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(!flags, "got 0x%08x\n", flags); + + hr = IBackgroundCopyJobHttpOptions_SetSecurityFlags(options, orig_flags); + ok(hr == S_OK, "got 0x%08x\n", hr); + + IBackgroundCopyJobHttpOptions_Release(options); + } + + hr = IBackgroundCopyJob_Complete(test_job); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IBackgroundCopyJob_GetState(test_job, &state); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(state == BG_JOB_STATE_ACKNOWLEDGED, "unexpected state: %u\n", state); + + hr = IBackgroundCopyJob_Complete(test_job); + ok(hr == BG_E_INVALID_STATE, "got 0x%08x\n", hr); + + DeleteFileW(test_localPathA); } typedef void (*test_t)(void); @@ -483,6 +653,11 @@ test_EnumFiles, test_CompleteLocal, test_CompleteLocalURL, + test_Cancel, /* must be last */ + 0 + }; + static const test_t tests_bits25[] = { + test_HttpOptions, 0 }; const test_t *test; @@ -530,5 +705,24 @@ win_skip("Tests need BITS 2.0 or higher\n"); } + if (check_bits25()) + { + for (test = tests_bits25, i = 0; *test; ++test, ++i) + { + /* Keep state separate between tests. */ + if (!setup()) + { + ok(0, "tests_bits25:%d: Unable to setup test\n", i); + break; + } + (*test)(); + teardown(); + } + } + else + { + win_skip("Tests need BITS 2.5 or higher\n"); + } + CoUninitialize(); }
9 years, 5 months
1
0
0
0
[akhaldi] 68490: [QMGR] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Jul 20 22:48:28 2015 New Revision: 68490 URL:
http://svn.reactos.org/svn/reactos?rev=68490&view=rev
Log: [QMGR] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/reactos/dll/win32/qmgr/CMakeLists.txt trunk/reactos/dll/win32/qmgr/enum_files.c trunk/reactos/dll/win32/qmgr/enum_jobs.c trunk/reactos/dll/win32/qmgr/file.c trunk/reactos/dll/win32/qmgr/job.c trunk/reactos/dll/win32/qmgr/qmgr.c trunk/reactos/dll/win32/qmgr/qmgr.h trunk/reactos/dll/win32/qmgr/qmgr_local.idl trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/qmgr/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/CMakeLists.…
============================================================================== --- trunk/reactos/dll/win32/qmgr/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/qmgr/CMakeLists.txt [iso-8859-1] Mon Jul 20 22:48:28 2015 @@ -25,7 +25,7 @@ add_idl_headers(qmgr_idlheader qmgr_local.idl) set_module_type(qmgr win32dll) target_link_libraries(qmgr uuid wine) -add_importlibs(qmgr ole32 wininet urlmon advapi32 msvcrt kernel32 ntdll) +add_importlibs(qmgr winhttp ole32 advapi32 msvcrt kernel32 ntdll) add_pch(qmgr qmgr.h SOURCE) add_cd_file(TARGET qmgr DESTINATION reactos/system32 FOR all) add_dependencies(qmgr qmgr_idlheader) Modified: trunk/reactos/dll/win32/qmgr/enum_files.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/enum_files.…
============================================================================== --- trunk/reactos/dll/win32/qmgr/enum_files.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/qmgr/enum_files.c [iso-8859-1] Mon Jul 20 22:48:28 2015 @@ -24,7 +24,7 @@ { IEnumBackgroundCopyFiles IEnumBackgroundCopyFiles_iface; LONG ref; - IBackgroundCopyFile **files; + IBackgroundCopyFile2 **files; ULONG numFiles; ULONG indexFiles; } EnumBackgroundCopyFilesImpl; @@ -72,7 +72,7 @@ if (ref == 0) { for(i = 0; i < This->numFiles; i++) - IBackgroundCopyFile_Release(This->files[i]); + IBackgroundCopyFile2_Release(This->files[i]); HeapFree(GetProcessHeap(), 0, This->files); HeapFree(GetProcessHeap(), 0, This); } @@ -87,7 +87,7 @@ EnumBackgroundCopyFilesImpl *This = impl_from_IEnumBackgroundCopyFiles(iface); ULONG fetched; ULONG i; - IBackgroundCopyFile *file; + IBackgroundCopyFile2 *file; TRACE("(%p)->(%d %p %p)\n", This, celt, rgelt, pceltFetched); @@ -113,8 +113,8 @@ for (i = 0; i < fetched; i++) { file = This->files[This->indexFiles++]; - IBackgroundCopyFile_AddRef(file); - rgelt[i] = file; + IBackgroundCopyFile2_AddRef(file); + rgelt[i] = (IBackgroundCopyFile *)file; } return fetched == celt ? S_OK : S_FALSE; @@ -212,8 +212,8 @@ i = 0; LIST_FOR_EACH_ENTRY(file, &job->files, BackgroundCopyFileImpl, entryFromJob) { - IBackgroundCopyFile_AddRef(&file->IBackgroundCopyFile_iface); - This->files[i] = &file->IBackgroundCopyFile_iface; + IBackgroundCopyFile2_AddRef(&file->IBackgroundCopyFile2_iface); + This->files[i] = &file->IBackgroundCopyFile2_iface; ++i; } LeaveCriticalSection(&job->cs); Modified: trunk/reactos/dll/win32/qmgr/enum_jobs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/enum_jobs.c…
============================================================================== --- trunk/reactos/dll/win32/qmgr/enum_jobs.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/qmgr/enum_jobs.c [iso-8859-1] Mon Jul 20 22:48:28 2015 @@ -24,7 +24,7 @@ { IEnumBackgroundCopyJobs IEnumBackgroundCopyJobs_iface; LONG ref; - IBackgroundCopyJob **jobs; + IBackgroundCopyJob3 **jobs; ULONG numJobs; ULONG indexJobs; } EnumBackgroundCopyJobsImpl; @@ -72,7 +72,7 @@ if (ref == 0) { for(i = 0; i < This->numJobs; i++) - IBackgroundCopyJob_Release(This->jobs[i]); + IBackgroundCopyJob3_Release(This->jobs[i]); HeapFree(GetProcessHeap(), 0, This->jobs); HeapFree(GetProcessHeap(), 0, This); } @@ -86,7 +86,7 @@ EnumBackgroundCopyJobsImpl *This = impl_from_IEnumBackgroundCopyJobs(iface); ULONG fetched; ULONG i; - IBackgroundCopyJob *job; + IBackgroundCopyJob3 *job; TRACE("(%p)->(%d %p %p)\n", This, celt, rgelt, pceltFetched); @@ -109,8 +109,8 @@ for (i = 0; i < fetched; ++i) { job = This->jobs[This->indexJobs++]; - IBackgroundCopyJob_AddRef(job); - rgelt[i] = job; + IBackgroundCopyJob3_AddRef(job); + rgelt[i] = (IBackgroundCopyJob *)job; } return fetched == celt ? S_OK : S_FALSE; @@ -210,9 +210,8 @@ i = 0; LIST_FOR_EACH_ENTRY(job, &qmgr->jobs, BackgroundCopyJobImpl, entryFromQmgr) { - IBackgroundCopyJob *job_iface = (IBackgroundCopyJob*)&job->IBackgroundCopyJob2_iface; - IBackgroundCopyJob_AddRef(job_iface); - This->jobs[i++] = job_iface; + IBackgroundCopyJob3_AddRef(&job->IBackgroundCopyJob3_iface); + This->jobs[i++] = &job->IBackgroundCopyJob3_iface; } LeaveCriticalSection(&qmgr->cs); Modified: trunk/reactos/dll/win32/qmgr/file.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/file.c?rev=…
============================================================================== --- trunk/reactos/dll/win32/qmgr/file.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/qmgr/file.c [iso-8859-1] Mon Jul 20 22:48:28 2015 @@ -21,56 +21,62 @@ #include "qmgr.h" #include <urlmon.h> -#include <wininet.h> - -static inline BackgroundCopyFileImpl *impl_from_IBackgroundCopyFile(IBackgroundCopyFile *iface) -{ - return CONTAINING_RECORD(iface, BackgroundCopyFileImpl, IBackgroundCopyFile_iface); +#include <winhttp.h> + +static inline BackgroundCopyFileImpl *impl_from_IBackgroundCopyFile2( + IBackgroundCopyFile2 *iface) +{ + return CONTAINING_RECORD(iface, BackgroundCopyFileImpl, IBackgroundCopyFile2_iface); } static HRESULT WINAPI BackgroundCopyFile_QueryInterface( - IBackgroundCopyFile* iface, + IBackgroundCopyFile2 *iface, REFIID riid, void **obj) { - BackgroundCopyFileImpl *This = impl_from_IBackgroundCopyFile(iface); - - TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj); - - if (IsEqualGUID(riid, &IID_IUnknown) - || IsEqualGUID(riid, &IID_IBackgroundCopyFile)) + BackgroundCopyFileImpl *file = impl_from_IBackgroundCopyFile2(iface); + + TRACE("(%p)->(%s %p)\n", file, debugstr_guid(riid), obj); + + if (IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IBackgroundCopyFile) || + IsEqualGUID(riid, &IID_IBackgroundCopyFile2)) { *obj = iface; - IBackgroundCopyFile_AddRef(iface); - return S_OK; - } - - *obj = NULL; - return E_NOINTERFACE; -} - -static ULONG WINAPI BackgroundCopyFile_AddRef(IBackgroundCopyFile* iface) -{ - BackgroundCopyFileImpl *This = impl_from_IBackgroundCopyFile(iface); - ULONG ref = InterlockedIncrement(&This->ref); - TRACE("(%p)->(%d)\n", This, ref); + } + else + { + *obj = NULL; + return E_NOINTERFACE; + } + + IBackgroundCopyFile2_AddRef(iface); + return S_OK; +} + +static ULONG WINAPI BackgroundCopyFile_AddRef( + IBackgroundCopyFile2 *iface) +{ + BackgroundCopyFileImpl *file = impl_from_IBackgroundCopyFile2(iface); + ULONG ref = InterlockedIncrement(&file->ref); + TRACE("(%p)->(%d)\n", file, ref); return ref; } static ULONG WINAPI BackgroundCopyFile_Release( - IBackgroundCopyFile* iface) -{ - BackgroundCopyFileImpl *This = impl_from_IBackgroundCopyFile(iface); - ULONG ref = InterlockedDecrement(&This->ref); - - TRACE("(%p)->(%d)\n", This, ref); + IBackgroundCopyFile2 *iface) +{ + BackgroundCopyFileImpl *file = impl_from_IBackgroundCopyFile2(iface); + ULONG ref = InterlockedDecrement(&file->ref); + + TRACE("(%p)->(%d)\n", file, ref); if (ref == 0) { - IBackgroundCopyJob2_Release(&This->owner->IBackgroundCopyJob2_iface); - HeapFree(GetProcessHeap(), 0, This->info.LocalName); - HeapFree(GetProcessHeap(), 0, This->info.RemoteName); - HeapFree(GetProcessHeap(), 0, This); + IBackgroundCopyJob3_Release(&file->owner->IBackgroundCopyJob3_iface); + HeapFree(GetProcessHeap(), 0, file->info.LocalName); + HeapFree(GetProcessHeap(), 0, file->info.RemoteName); + HeapFree(GetProcessHeap(), 0, file); } return ref; @@ -78,52 +84,71 @@ /* Get the remote name of a background copy file */ static HRESULT WINAPI BackgroundCopyFile_GetRemoteName( - IBackgroundCopyFile* iface, + IBackgroundCopyFile2 *iface, LPWSTR *pVal) { - BackgroundCopyFileImpl *This = impl_from_IBackgroundCopyFile(iface); - - TRACE("(%p)->(%p)\n", This, pVal); - - return return_strval(This->info.RemoteName, pVal); + BackgroundCopyFileImpl *file = impl_from_IBackgroundCopyFile2(iface); + + TRACE("(%p)->(%p)\n", file, pVal); + + return return_strval(file->info.RemoteName, pVal); } static HRESULT WINAPI BackgroundCopyFile_GetLocalName( - IBackgroundCopyFile* iface, + IBackgroundCopyFile2 *iface, LPWSTR *pVal) { - BackgroundCopyFileImpl *This = impl_from_IBackgroundCopyFile(iface); - - TRACE("(%p)->(%p)\n", This, pVal); - - return return_strval(This->info.LocalName, pVal); + BackgroundCopyFileImpl *file = impl_from_IBackgroundCopyFile2(iface); + + TRACE("(%p)->(%p)\n", file, pVal); + + return return_strval(file->info.LocalName, pVal); } static HRESULT WINAPI BackgroundCopyFile_GetProgress( - IBackgroundCopyFile* iface, + IBackgroundCopyFile2 *iface, BG_FILE_PROGRESS *pVal) { - BackgroundCopyFileImpl *This = impl_from_IBackgroundCopyFile(iface); - - TRACE("(%p)->(%p)\n", This, pVal); - - EnterCriticalSection(&This->owner->cs); - pVal->BytesTotal = This->fileProgress.BytesTotal; - pVal->BytesTransferred = This->fileProgress.BytesTransferred; - pVal->Completed = This->fileProgress.Completed; - LeaveCriticalSection(&This->owner->cs); + BackgroundCopyFileImpl *file = impl_from_IBackgroundCopyFile2(iface); + + TRACE("(%p)->(%p)\n", file, pVal); + + EnterCriticalSection(&file->owner->cs); + *pVal = file->fileProgress; + LeaveCriticalSection(&file->owner->cs); return S_OK; } -static const IBackgroundCopyFileVtbl BackgroundCopyFileVtbl = +static HRESULT WINAPI BackgroundCopyFile_GetFileRanges( + IBackgroundCopyFile2 *iface, + DWORD *RangeCount, + BG_FILE_RANGE **Ranges) +{ + BackgroundCopyFileImpl *file = impl_from_IBackgroundCopyFile2(iface); + FIXME("(%p)->(%p %p)\n", file, RangeCount, Ranges); + return E_NOTIMPL; +} + +static HRESULT WINAPI BackgroundCopyFile_SetRemoteName( + IBackgroundCopyFile2 *iface, + LPCWSTR Val) +{ + BackgroundCopyFileImpl *file = impl_from_IBackgroundCopyFile2(iface); + FIXME("(%p)->(%s)\n", file, debugstr_w(Val)); + return E_NOTIMPL; +} + +static const IBackgroundCopyFile2Vtbl BackgroundCopyFile2Vtbl = { BackgroundCopyFile_QueryInterface, BackgroundCopyFile_AddRef, BackgroundCopyFile_Release, BackgroundCopyFile_GetRemoteName, BackgroundCopyFile_GetLocalName, - BackgroundCopyFile_GetProgress + BackgroundCopyFile_GetProgress, + BackgroundCopyFile_GetFileRanges, + BackgroundCopyFile_SetRemoteName }; HRESULT BackgroundCopyFileConstructor(BackgroundCopyJobImpl *owner, @@ -131,7 +156,6 @@ BackgroundCopyFileImpl **file) { BackgroundCopyFileImpl *This; - int n; TRACE("(%s, %s, %p)\n", debugstr_w(remoteName), debugstr_w(localName), file); @@ -139,47 +163,264 @@ if (!This) return E_OUTOFMEMORY; - n = (lstrlenW(remoteName) + 1) * sizeof(WCHAR); - This->info.RemoteName = HeapAlloc(GetProcessHeap(), 0, n); + This->info.RemoteName = strdupW(remoteName); if (!This->info.RemoteName) { HeapFree(GetProcessHeap(), 0, This); return E_OUTOFMEMORY; } - memcpy(This->info.RemoteName, remoteName, n); - - n = (lstrlenW(localName) + 1) * sizeof(WCHAR); - This->info.LocalName = HeapAlloc(GetProcessHeap(), 0, n); + + This->info.LocalName = strdupW(localName); if (!This->info.LocalName) { HeapFree(GetProcessHeap(), 0, This->info.RemoteName); HeapFree(GetProcessHeap(), 0, This); return E_OUTOFMEMORY; } - memcpy(This->info.LocalName, localName, n); - - This->IBackgroundCopyFile_iface.lpVtbl = &BackgroundCopyFileVtbl; + + This->IBackgroundCopyFile2_iface.lpVtbl = &BackgroundCopyFile2Vtbl; This->ref = 1; This->fileProgress.BytesTotal = BG_SIZE_UNKNOWN; This->fileProgress.BytesTransferred = 0; This->fileProgress.Completed = FALSE; This->owner = owner; - IBackgroundCopyJob2_AddRef(&owner->IBackgroundCopyJob2_iface); + This->read_size = 0; + This->tempFileName[0] = 0; + IBackgroundCopyJob3_AddRef(&owner->IBackgroundCopyJob3_iface); *file = This; return S_OK; } -static DWORD CALLBACK copyProgressCallback(LARGE_INTEGER totalSize, - LARGE_INTEGER totalTransferred, - LARGE_INTEGER streamSize, - LARGE_INTEGER streamTransferred, - DWORD streamNum, - DWORD reason, - HANDLE srcFile, - HANDLE dstFile, - LPVOID obj) +static HRESULT error_from_http_response(DWORD code) +{ + switch (code) + { + case 200: return S_OK; + case 400: return BG_E_HTTP_ERROR_400; + case 401: return BG_E_HTTP_ERROR_401; + case 404: return BG_E_HTTP_ERROR_404; + case 407: return BG_E_HTTP_ERROR_407; + case 414: return BG_E_HTTP_ERROR_414; + case 501: return BG_E_HTTP_ERROR_501; + case 503: return BG_E_HTTP_ERROR_503; + case 504: return BG_E_HTTP_ERROR_504; + case 505: return BG_E_HTTP_ERROR_505; + default: + FIXME("unhandled response code %u\n", code); + return S_OK; + } +} + +static void CALLBACK progress_callback_http(HINTERNET handle, DWORD_PTR context, DWORD status, + LPVOID buf, DWORD buflen) +{ + BackgroundCopyFileImpl *file = (BackgroundCopyFileImpl *)context; + BackgroundCopyJobImpl *job = file->owner; + + TRACE("%p, %p, %x, %p, %u\n", handle, file, status, buf, buflen); + + switch (status) + { + case WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE: + { + DWORD code, len, size; + + size = sizeof(code); + if (WinHttpQueryHeaders(handle, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, + NULL, &code, &size, NULL)) + { + if ((job->error.code = error_from_http_response(code))) + { + EnterCriticalSection(&job->cs); + + job->error.context = BG_ERROR_CONTEXT_REMOTE_FILE; + if (job->error.file) IBackgroundCopyFile2_Release(job->error.file); + job->error.file = &file->IBackgroundCopyFile2_iface; + IBackgroundCopyFile2_AddRef(job->error.file); + + LeaveCriticalSection(&job->cs); + transitionJobState(job, BG_JOB_STATE_TRANSFERRING, BG_JOB_STATE_ERROR); + } + else + { + EnterCriticalSection(&job->cs); + + job->error.context = 0; + if (job->error.file) + { + IBackgroundCopyFile2_Release(job->error.file); + job->error.file = NULL; + } + + LeaveCriticalSection(&job->cs); + } + } + size = sizeof(len); + if (WinHttpQueryHeaders(handle, WINHTTP_QUERY_CONTENT_LENGTH|WINHTTP_QUERY_FLAG_NUMBER, + NULL, &len, &size, NULL)) + { + file->fileProgress.BytesTotal = len; + } + break; + } + case WINHTTP_CALLBACK_STATUS_READ_COMPLETE: + { + file->read_size = buflen; + break; + } + case WINHTTP_CALLBACK_STATUS_REQUEST_ERROR: + { + WINHTTP_ASYNC_RESULT *result = (WINHTTP_ASYNC_RESULT *)buf; + job->error.code = result->dwError; + transitionJobState(job, BG_JOB_STATE_TRANSFERRING, BG_JOB_STATE_ERROR); + break; + } + default: break; + } + + SetEvent(job->wait); +} + +static DWORD wait_for_completion(BackgroundCopyJobImpl *job) +{ + HANDLE handles[2] = {job->wait, job->cancel}; + DWORD error = ERROR_SUCCESS; + + switch (WaitForMultipleObjects(2, handles, FALSE, INFINITE)) + { + case WAIT_OBJECT_0: + break; + + case WAIT_OBJECT_0 + 1: + error = ERROR_CANCELLED; + transitionJobState(job, BG_JOB_STATE_TRANSFERRING, BG_JOB_STATE_CANCELLED); + break; + + default: + error = GetLastError(); + transitionJobState(job, BG_JOB_STATE_TRANSFERRING, BG_JOB_STATE_ERROR); + break; + } + + 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) +{ + BackgroundCopyJobImpl *job = file->owner; + HANDLE handle; + HINTERNET ses, con = NULL, req = NULL; + DWORD flags = (uc->nScheme == INTERNET_SCHEME_HTTPS) ? WINHTTP_FLAG_SECURE : 0; + char buf[4096]; + BOOL ret = FALSE; + + transitionJobState(job, BG_JOB_STATE_QUEUED, BG_JOB_STATE_CONNECTING); + + if (!(ses = WinHttpOpen(NULL, 0, NULL, NULL, WINHTTP_FLAG_ASYNC))) return FALSE; + WinHttpSetStatusCallback(ses, progress_callback_http, WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS, 0); + if (!WinHttpSetOption(ses, WINHTTP_OPTION_CONTEXT_VALUE, &file, sizeof(file))) goto done; + + 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; + + if (!(WinHttpReceiveResponse(req, NULL))) goto done; + if (wait_for_completion(job) || job->error.code) goto done; + + transitionJobState(job, BG_JOB_STATE_CONNECTING, BG_JOB_STATE_TRANSFERRING); + + handle = CreateFileW(tmpfile, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + if (handle == INVALID_HANDLE_VALUE) goto done; + + for (;;) + { + file->read_size = 0; + if (!(ret = WinHttpReadData(req, buf, sizeof(buf), NULL))) break; + if (wait_for_completion(job) || job->error.code) + { + ret = FALSE; + break; + } + if (!file->read_size) break; + if (!(ret = WriteFile(handle, buf, file->read_size, NULL, NULL))) break; + + EnterCriticalSection(&job->cs); + file->fileProgress.BytesTransferred += file->read_size; + job->jobProgress.BytesTransferred += file->read_size; + LeaveCriticalSection(&job->cs); + } + + CloseHandle(handle); + +done: + WinHttpCloseHandle(req); + WinHttpCloseHandle(con); + WinHttpCloseHandle(ses); + if (!ret) DeleteFileW(tmpfile); + + SetEvent(job->done); + return ret; +} + +static DWORD CALLBACK progress_callback_local(LARGE_INTEGER totalSize, LARGE_INTEGER totalTransferred, + LARGE_INTEGER streamSize, LARGE_INTEGER streamTransferred, + DWORD streamNum, DWORD reason, HANDLE srcFile, + HANDLE dstFile, LPVOID obj) { BackgroundCopyFileImpl *file = obj; BackgroundCopyJobImpl *job = file->owner; @@ -199,173 +440,37 @@ : PROGRESS_CANCEL); } -typedef struct -{ - IBindStatusCallback IBindStatusCallback_iface; - BackgroundCopyFileImpl *file; - LONG ref; -} DLBindStatusCallback; - -static inline DLBindStatusCallback *impl_from_IBindStatusCallback(IBindStatusCallback *iface) -{ - return CONTAINING_RECORD(iface, DLBindStatusCallback, IBindStatusCallback_iface); -} - -static HRESULT WINAPI DLBindStatusCallback_QueryInterface( - IBindStatusCallback *iface, - REFIID riid, - void **ppvObject) -{ - DLBindStatusCallback *This = impl_from_IBindStatusCallback(iface); - - if (IsEqualGUID(riid, &IID_IUnknown) - || IsEqualGUID(riid, &IID_IBindStatusCallback)) - { - *ppvObject = &This->IBindStatusCallback_iface; - IBindStatusCallback_AddRef(iface); - return S_OK; - } - - *ppvObject = NULL; - return E_NOINTERFACE; -} - -static ULONG WINAPI DLBindStatusCallback_AddRef(IBindStatusCallback *iface) -{ - DLBindStatusCallback *This = impl_from_IBindStatusCallback(iface); - return InterlockedIncrement(&This->ref); -} - -static ULONG WINAPI DLBindStatusCallback_Release(IBindStatusCallback *iface) -{ - DLBindStatusCallback *This = impl_from_IBindStatusCallback(iface); - ULONG ref = InterlockedDecrement(&This->ref); - - if (ref == 0) - { - IBackgroundCopyFile_Release(&This->file->IBackgroundCopyFile_iface); - HeapFree(GetProcessHeap(), 0, This); - } - - return ref; -} - -static HRESULT WINAPI DLBindStatusCallback_GetBindInfo( - IBindStatusCallback *iface, - DWORD *grfBINDF, - BINDINFO *pbindinfo) -{ - return E_NOTIMPL; -} - -static HRESULT WINAPI DLBindStatusCallback_GetPriority( - IBindStatusCallback *iface, - LONG *pnPriority) -{ - return E_NOTIMPL; -} - -static HRESULT WINAPI DLBindStatusCallback_OnDataAvailable( - IBindStatusCallback *iface, - DWORD grfBSCF, - DWORD dwSize, - FORMATETC *pformatetc, - STGMEDIUM *pstgmed) -{ - return E_NOTIMPL; -} - -static HRESULT WINAPI DLBindStatusCallback_OnLowResource( - IBindStatusCallback *iface, - DWORD reserved) -{ - return E_NOTIMPL; -} - -static HRESULT WINAPI DLBindStatusCallback_OnObjectAvailable( - IBindStatusCallback *iface, - REFIID riid, - IUnknown *punk) -{ - return E_NOTIMPL; -} - -static HRESULT WINAPI DLBindStatusCallback_OnProgress( - IBindStatusCallback *iface, - ULONG progress, - ULONG progressMax, - ULONG statusCode, - LPCWSTR statusText) -{ - DLBindStatusCallback *This = impl_from_IBindStatusCallback(iface); - BackgroundCopyFileImpl *file = This->file; +static BOOL transfer_file_local(BackgroundCopyFileImpl *file, const WCHAR *tmpname) +{ + static const WCHAR fileW[] = {'f','i','l','e',':','/','/',0}; BackgroundCopyJobImpl *job = file->owner; - ULONG64 diff; - - EnterCriticalSection(&job->cs); - diff = (file->fileProgress.BytesTotal == BG_SIZE_UNKNOWN - ? progress - : progress - file->fileProgress.BytesTransferred); - file->fileProgress.BytesTotal = progressMax ? progressMax : BG_SIZE_UNKNOWN; - file->fileProgress.BytesTransferred = progress; - job->jobProgress.BytesTransferred += diff; - LeaveCriticalSection(&job->cs); - - return S_OK; -} - -static HRESULT WINAPI DLBindStatusCallback_OnStartBinding( - IBindStatusCallback *iface, - DWORD dwReserved, - IBinding *pib) -{ - return E_NOTIMPL; -} - -static HRESULT WINAPI DLBindStatusCallback_OnStopBinding( - IBindStatusCallback *iface, - HRESULT hresult, - LPCWSTR szError) -{ - return E_NOTIMPL; -} - -static const IBindStatusCallbackVtbl DLBindStatusCallback_Vtbl = -{ - DLBindStatusCallback_QueryInterface, - DLBindStatusCallback_AddRef, - DLBindStatusCallback_Release, - DLBindStatusCallback_OnStartBinding, - DLBindStatusCallback_GetPriority, - DLBindStatusCallback_OnLowResource, - DLBindStatusCallback_OnProgress, - DLBindStatusCallback_OnStopBinding, - DLBindStatusCallback_GetBindInfo, - DLBindStatusCallback_OnDataAvailable, - DLBindStatusCallback_OnObjectAvailable -}; - -static DLBindStatusCallback *DLBindStatusCallbackConstructor( - BackgroundCopyFileImpl *file) -{ - DLBindStatusCallback *This = HeapAlloc(GetProcessHeap(), 0, sizeof *This); - if (!This) - return NULL; - - This->IBindStatusCallback_iface.lpVtbl = &DLBindStatusCallback_Vtbl; - IBackgroundCopyFile_AddRef(&file->IBackgroundCopyFile_iface); - This->file = file; - This->ref = 1; - return This; + const WCHAR *ptr; + BOOL ret; + + transitionJobState(job, BG_JOB_STATE_QUEUED, BG_JOB_STATE_TRANSFERRING); + + if (strlenW(file->info.RemoteName) > 7 && !memicmpW(file->info.RemoteName, fileW, 7)) + ptr = file->info.RemoteName + 7; + else + ptr = file->info.RemoteName; + + if (!(ret = CopyFileExW(ptr, tmpname, progress_callback_local, file, NULL, 0))) + { + WARN("Local file copy failed: error %u\n", GetLastError()); + transitionJobState(job, BG_JOB_STATE_TRANSFERRING, BG_JOB_STATE_ERROR); + } + + SetEvent(job->done); + return ret; } BOOL processFile(BackgroundCopyFileImpl *file, BackgroundCopyJobImpl *job) { static const WCHAR prefix[] = {'B','I','T', 0}; - DLBindStatusCallback *callbackObj; - WCHAR tmpDir[MAX_PATH]; - WCHAR tmpName[MAX_PATH]; - HRESULT hr; + WCHAR tmpDir[MAX_PATH], tmpName[MAX_PATH]; + WCHAR host[MAX_PATH], path[MAX_PATH]; + URL_COMPONENTSW uc; + BOOL ret; if (!GetTempPathW(MAX_PATH, tmpDir)) { @@ -379,14 +484,6 @@ { ERR("Couldn't create temp file: %d\n", GetLastError()); /* Guessing on what state this should give us */ - transitionJobState(job, BG_JOB_STATE_QUEUED, BG_JOB_STATE_TRANSIENT_ERROR); - return FALSE; - } - - callbackObj = DLBindStatusCallbackConstructor(file); - if (!callbackObj) - { - ERR("Out of memory\n"); transitionJobState(job, BG_JOB_STATE_QUEUED, BG_JOB_STATE_TRANSIENT_ERROR); return FALSE; } @@ -402,31 +499,35 @@ debugstr_w(tmpName), debugstr_w(file->info.LocalName)); - transitionJobState(job, BG_JOB_STATE_QUEUED, BG_JOB_STATE_TRANSFERRING); - - DeleteUrlCacheEntryW(file->info.RemoteName); - hr = URLDownloadToFileW(NULL, file->info.RemoteName, tmpName, 0, - &callbackObj->IBindStatusCallback_iface); - IBindStatusCallback_Release(&callbackObj->IBindStatusCallback_iface); - if (hr == INET_E_DOWNLOAD_FAILURE) - { - TRACE("URLDownload failed, trying local file copy\n"); - if (!CopyFileExW(file->info.RemoteName, tmpName, copyProgressCallback, - file, NULL, 0)) - { - ERR("Local file copy failed: error %d\n", GetLastError()); - transitionJobState(job, BG_JOB_STATE_TRANSFERRING, BG_JOB_STATE_ERROR); - return FALSE; - } - } - else if (FAILED(hr)) - { - ERR("URLDownload failed: eh 0x%08x\n", hr); - transitionJobState(job, BG_JOB_STATE_TRANSFERRING, BG_JOB_STATE_ERROR); + uc.dwStructSize = sizeof(uc); + uc.nScheme = 0; + uc.lpszScheme = NULL; + uc.dwSchemeLength = 0; + uc.lpszUserName = NULL; + uc.dwUserNameLength = 0; + uc.lpszPassword = NULL; + uc.dwPasswordLength = 0; + uc.lpszHostName = host; + uc.dwHostNameLength = sizeof(host)/sizeof(host[0]); + uc.nPort = 0; + uc.lpszUrlPath = path; + uc.dwUrlPathLength = sizeof(path)/sizeof(path[0]); + uc.lpszExtraInfo = NULL; + uc.dwExtraInfoLength = 0; + ret = WinHttpCrackUrl(file->info.RemoteName, 0, 0, &uc); + if (!ret) + { + TRACE("WinHttpCrackUrl failed, trying local file copy\n"); + if (!transfer_file_local(file, tmpName)) return FALSE; + } + else if (!transfer_file_http(file, &uc, tmpName)) + { + WARN("HTTP transfer failed\n"); return FALSE; } - if (transitionJobState(job, BG_JOB_STATE_TRANSFERRING, BG_JOB_STATE_QUEUED)) + if (transitionJobState(job, BG_JOB_STATE_CONNECTING, BG_JOB_STATE_QUEUED) || + transitionJobState(job, BG_JOB_STATE_TRANSFERRING, BG_JOB_STATE_QUEUED)) { lstrcpyW(file->tempFileName, tmpName); Modified: trunk/reactos/dll/win32/qmgr/job.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/job.c?rev=6…
============================================================================== --- trunk/reactos/dll/win32/qmgr/job.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/qmgr/job.c [iso-8859-1] Mon Jul 20 22:48:28 2015 @@ -20,48 +20,231 @@ #include "qmgr.h" +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; + LONG refs; + BG_ERROR_CONTEXT context; + HRESULT code; + IBackgroundCopyFile2 *file; +}; + +static inline struct copy_error *impl_from_IBackgroundCopyError(IBackgroundCopyError *iface) +{ + return CONTAINING_RECORD(iface, struct copy_error, IBackgroundCopyError_iface); +} + +static HRESULT WINAPI copy_error_QueryInterface( + IBackgroundCopyError *iface, + REFIID riid, + void **obj) +{ + struct copy_error *error = impl_from_IBackgroundCopyError(iface); + + TRACE("(%p)->(%s %p)\n", error, debugstr_guid(riid), obj); + + if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IBackgroundCopyError)) + { + *obj = &error->IBackgroundCopyError_iface; + } + else + { + *obj = NULL; + WARN("interface %s not supported\n", debugstr_guid(riid)); + return E_NOINTERFACE; + } + + IBackgroundCopyError_AddRef(iface); + return S_OK; +} + +static ULONG WINAPI copy_error_AddRef( + IBackgroundCopyError *iface) +{ + struct copy_error *error = impl_from_IBackgroundCopyError(iface); + LONG refs = InterlockedIncrement(&error->refs); + TRACE("(%p)->(%d)\n", error, refs); + return refs; +} + +static ULONG WINAPI copy_error_Release( + IBackgroundCopyError *iface) +{ + struct copy_error *error = impl_from_IBackgroundCopyError(iface); + LONG refs = InterlockedDecrement(&error->refs); + + TRACE("(%p)->(%d)\n", error, refs); + + if (!refs) + { + if (error->file) IBackgroundCopyFile2_Release(error->file); + HeapFree(GetProcessHeap(), 0, error); + } + return refs; +} + +static HRESULT WINAPI copy_error_GetError( + IBackgroundCopyError *iface, + BG_ERROR_CONTEXT *pContext, + HRESULT *pCode) +{ + struct copy_error *error = impl_from_IBackgroundCopyError(iface); + + TRACE("(%p)->(%p %p)\n", error, pContext, pCode); + + *pContext = error->context; + *pCode = error->code; + + TRACE("returning context %u error code 0x%08x\n", error->context, error->code); + return S_OK; +} + +static HRESULT WINAPI copy_error_GetFile( + IBackgroundCopyError *iface, + IBackgroundCopyFile **pVal) +{ + struct copy_error *error = impl_from_IBackgroundCopyError(iface); + + TRACE("(%p)->(%p)\n", error, pVal); + + if (error->file) + { + IBackgroundCopyFile2_AddRef(error->file); + *pVal = (IBackgroundCopyFile *)error->file; + return S_OK; + } + *pVal = NULL; + return BG_E_FILE_NOT_AVAILABLE; +} + +static HRESULT WINAPI copy_error_GetErrorDescription( + IBackgroundCopyError *iface, + DWORD LanguageId, + LPWSTR *pErrorDescription) +{ + struct copy_error *error = impl_from_IBackgroundCopyError(iface); + FIXME("(%p)->(%p)\n", error, pErrorDescription); + return E_NOTIMPL; +} + +static HRESULT WINAPI copy_error_GetErrorContextDescription( + IBackgroundCopyError *iface, + DWORD LanguageId, + LPWSTR *pContextDescription) +{ + struct copy_error *error = impl_from_IBackgroundCopyError(iface); + FIXME("(%p)->(%p)\n", error, pContextDescription); + return E_NOTIMPL; +} + +static HRESULT WINAPI copy_error_GetProtocol( + IBackgroundCopyError *iface, + LPWSTR *pProtocol) +{ + struct copy_error *error = impl_from_IBackgroundCopyError(iface); + FIXME("(%p)->(%p)\n", error, pProtocol); + return E_NOTIMPL; +} + +static const IBackgroundCopyErrorVtbl copy_error_vtbl = +{ + copy_error_QueryInterface, + copy_error_AddRef, + copy_error_Release, + copy_error_GetError, + copy_error_GetFile, + copy_error_GetErrorDescription, + copy_error_GetErrorContextDescription, + copy_error_GetProtocol +}; + +static HRESULT create_copy_error( + BG_ERROR_CONTEXT context, + HRESULT code, + IBackgroundCopyFile2 *file, + IBackgroundCopyError **obj) +{ + struct copy_error *error; + + TRACE("context %u code %08x file %p\n", context, code, file); + + if (!(error = HeapAlloc(GetProcessHeap(), 0, sizeof(*error) ))) return E_OUTOFMEMORY; + error->IBackgroundCopyError_iface.lpVtbl = ©_error_vtbl; + error->refs = 1; + error->context = context; + error->code = code; + error->file = file; + if (error->file) IBackgroundCopyFile2_AddRef(error->file); + + *obj = &error->IBackgroundCopyError_iface; + TRACE("returning iface %p\n", *obj); + return S_OK; +} + static inline BOOL is_job_done(const BackgroundCopyJobImpl *job) { return job->state == BG_JOB_STATE_CANCELLED || job->state == BG_JOB_STATE_ACKNOWLEDGED; } -static inline BackgroundCopyJobImpl *impl_from_IBackgroundCopyJob2(IBackgroundCopyJob2 *iface) -{ - return CONTAINING_RECORD(iface, BackgroundCopyJobImpl, IBackgroundCopyJob2_iface); +static inline BackgroundCopyJobImpl *impl_from_IBackgroundCopyJob3(IBackgroundCopyJob3 *iface) +{ + return CONTAINING_RECORD(iface, BackgroundCopyJobImpl, IBackgroundCopyJob3_iface); } static HRESULT WINAPI BackgroundCopyJob_QueryInterface( - IBackgroundCopyJob2 *iface, REFIID riid, void **obj) -{ - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + IBackgroundCopyJob3 *iface, REFIID riid, void **obj) +{ + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj); - if (IsEqualGUID(riid, &IID_IUnknown) - || IsEqualGUID(riid, &IID_IBackgroundCopyJob) - || IsEqualGUID(riid, &IID_IBackgroundCopyJob2)) - { - *obj = iface; - IBackgroundCopyJob2_AddRef(iface); - return S_OK; - } - - *obj = NULL; - return E_NOINTERFACE; -} - -static ULONG WINAPI BackgroundCopyJob_AddRef(IBackgroundCopyJob2 *iface) -{ - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + if (IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IBackgroundCopyJob) || + IsEqualGUID(riid, &IID_IBackgroundCopyJob2) || + IsEqualGUID(riid, &IID_IBackgroundCopyJob3)) + { + *obj = &This->IBackgroundCopyJob3_iface; + } + else if (IsEqualGUID(riid, &IID_IBackgroundCopyJobHttpOptions)) + { + *obj = &This->IBackgroundCopyJobHttpOptions_iface; + } + else + { + *obj = NULL; + return E_NOINTERFACE; + } + + IBackgroundCopyJob3_AddRef(iface); + return S_OK; +} + +static ULONG WINAPI BackgroundCopyJob_AddRef(IBackgroundCopyJob3 *iface) +{ + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p)->(%d)\n", This, ref); return ref; } -static ULONG WINAPI BackgroundCopyJob_Release(IBackgroundCopyJob2 *iface) -{ - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); - ULONG ref = InterlockedDecrement(&This->ref); +static ULONG WINAPI BackgroundCopyJob_Release(IBackgroundCopyJob3 *iface) +{ + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); + ULONG i, j, ref = InterlockedDecrement(&This->ref); TRACE("(%p)->(%d)\n", This, ref); @@ -73,6 +256,19 @@ IBackgroundCopyCallback2_Release(This->callback); 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); + } + } + CloseHandle(This->wait); + CloseHandle(This->cancel); + CloseHandle(This->done); HeapFree(GetProcessHeap(), 0, This); } @@ -82,11 +278,11 @@ /*** IBackgroundCopyJob methods ***/ static HRESULT WINAPI BackgroundCopyJob_AddFileSet( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, ULONG cFileCount, BG_FILE_INFO *pFileSet) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); HRESULT hr = S_OK; ULONG i; @@ -116,41 +312,41 @@ } static HRESULT WINAPI BackgroundCopyJob_AddFile( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, LPCWSTR RemoteUrl, LPCWSTR LocalName) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); BG_FILE_INFO file; TRACE("(%p)->(%s %s)\n", This, debugstr_w(RemoteUrl), debugstr_w(LocalName)); file.RemoteName = (LPWSTR)RemoteUrl; file.LocalName = (LPWSTR)LocalName; - return IBackgroundCopyJob2_AddFileSet(iface, 1, &file); + return IBackgroundCopyJob3_AddFileSet(iface, 1, &file); } static HRESULT WINAPI BackgroundCopyJob_EnumFiles( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, IEnumBackgroundCopyFiles **enum_files) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); TRACE("(%p)->(%p)\n", This, enum_files); return EnumBackgroundCopyFilesConstructor(This, enum_files); } static HRESULT WINAPI BackgroundCopyJob_Suspend( - IBackgroundCopyJob2 *iface) -{ - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + IBackgroundCopyJob3 *iface) +{ + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); FIXME("(%p): stub\n", This); return E_NOTIMPL; } static HRESULT WINAPI BackgroundCopyJob_Resume( - IBackgroundCopyJob2 *iface) -{ - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + IBackgroundCopyJob3 *iface) +{ + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); HRESULT rv = S_OK; TRACE("(%p)\n", This); @@ -176,17 +372,57 @@ } static HRESULT WINAPI BackgroundCopyJob_Cancel( - IBackgroundCopyJob2 *iface) -{ - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); - FIXME("(%p): stub\n", This); - return E_NOTIMPL; + IBackgroundCopyJob3 *iface) +{ + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); + 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( - IBackgroundCopyJob2 *iface) -{ - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + IBackgroundCopyJob3 *iface) +{ + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); HRESULT rv = S_OK; TRACE("(%p)\n", This); @@ -227,20 +463,20 @@ } static HRESULT WINAPI BackgroundCopyJob_GetId( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, GUID *pVal) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); TRACE("(%p)->(%p)\n", This, pVal); *pVal = This->jobId; return S_OK; } static HRESULT WINAPI BackgroundCopyJob_GetType( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, BG_JOB_TYPE *pVal) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); TRACE("(%p)->(%p)\n", This, pVal); @@ -252,10 +488,10 @@ } static HRESULT WINAPI BackgroundCopyJob_GetProgress( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, BG_JOB_PROGRESS *pVal) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); TRACE("(%p)->(%p)\n", This, pVal); @@ -263,29 +499,26 @@ return E_INVALIDARG; EnterCriticalSection(&This->cs); - pVal->BytesTotal = This->jobProgress.BytesTotal; - pVal->BytesTransferred = This->jobProgress.BytesTransferred; - pVal->FilesTotal = This->jobProgress.FilesTotal; - pVal->FilesTransferred = This->jobProgress.FilesTransferred; + *pVal = This->jobProgress; LeaveCriticalSection(&This->cs); return S_OK; } static HRESULT WINAPI BackgroundCopyJob_GetTimes( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, BG_JOB_TIMES *pVal) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); FIXME("(%p)->(%p): stub\n", This, pVal); return E_NOTIMPL; } static HRESULT WINAPI BackgroundCopyJob_GetState( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, BG_JOB_STATE *pVal) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); TRACE("(%p)->(%p)\n", This, pVal); @@ -298,37 +531,41 @@ } static HRESULT WINAPI BackgroundCopyJob_GetError( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, IBackgroundCopyError **ppError) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); - FIXME("(%p)->(%p): stub\n", This, ppError); - return E_NOTIMPL; + BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob3(iface); + + TRACE("(%p)->(%p)\n", job, ppError); + + if (!job->error.context) return BG_E_ERROR_INFORMATION_UNAVAILABLE; + + return create_copy_error(job->error.context, job->error.code, job->error.file, ppError); } static HRESULT WINAPI BackgroundCopyJob_GetOwner( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, LPWSTR *pVal) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); FIXME("(%p)->(%p): stub\n", This, pVal); return E_NOTIMPL; } static HRESULT WINAPI BackgroundCopyJob_SetDisplayName( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, LPCWSTR Val) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); FIXME("(%p)->(%s): stub\n", This, debugstr_w(Val)); return E_NOTIMPL; } static HRESULT WINAPI BackgroundCopyJob_GetDisplayName( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, LPWSTR *pVal) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); TRACE("(%p)->(%p)\n", This, pVal); @@ -336,10 +573,10 @@ } static HRESULT WINAPI BackgroundCopyJob_SetDescription( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, LPCWSTR Val) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); static const int max_description_len = 1024; HRESULT hr = S_OK; int len; @@ -372,10 +609,10 @@ } static HRESULT WINAPI BackgroundCopyJob_GetDescription( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, LPWSTR *pVal) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); TRACE("(%p)->(%p)\n", This, pVal); @@ -383,28 +620,28 @@ } static HRESULT WINAPI BackgroundCopyJob_SetPriority( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, BG_JOB_PRIORITY Val) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); FIXME("(%p)->(%d): stub\n", This, Val); return S_OK; } static HRESULT WINAPI BackgroundCopyJob_GetPriority( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, BG_JOB_PRIORITY *pVal) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); FIXME("(%p)->(%p): stub\n", This, pVal); return E_NOTIMPL; } static HRESULT WINAPI BackgroundCopyJob_SetNotifyFlags( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, ULONG Val) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); static const ULONG valid_flags = BG_NOTIFY_JOB_TRANSFERRED | BG_NOTIFY_JOB_ERROR | BG_NOTIFY_DISABLE | @@ -420,10 +657,10 @@ } static HRESULT WINAPI BackgroundCopyJob_GetNotifyFlags( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, ULONG *pVal) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); TRACE("(%p)->(%p)\n", This, pVal); @@ -435,10 +672,10 @@ } static HRESULT WINAPI BackgroundCopyJob_SetNotifyInterface( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, IUnknown *Val) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); HRESULT hr = S_OK; TRACE("(%p)->(%p)\n", This, Val); @@ -465,10 +702,10 @@ } static HRESULT WINAPI BackgroundCopyJob_GetNotifyInterface( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, IUnknown **pVal) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); TRACE("(%p)->(%p)\n", This, pVal); @@ -482,7 +719,7 @@ } static HRESULT WINAPI BackgroundCopyJob_SetMinimumRetryDelay( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, ULONG Seconds) { FIXME("%u\n", Seconds); @@ -490,150 +727,244 @@ } static HRESULT WINAPI BackgroundCopyJob_GetMinimumRetryDelay( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, ULONG *Seconds) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); FIXME("(%p)->(%p): stub\n", This, Seconds); *Seconds = 30; return S_OK; } static HRESULT WINAPI BackgroundCopyJob_SetNoProgressTimeout( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, ULONG Seconds) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); FIXME("(%p)->(%d): stub\n", This, Seconds); return S_OK; } static HRESULT WINAPI BackgroundCopyJob_GetNoProgressTimeout( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, ULONG *Seconds) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); FIXME("(%p)->(%p): stub\n", This, Seconds); *Seconds = 900; return S_OK; } static HRESULT WINAPI BackgroundCopyJob_GetErrorCount( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, ULONG *Errors) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); FIXME("(%p)->(%p): stub\n", This, Errors); return E_NOTIMPL; } static HRESULT WINAPI BackgroundCopyJob_SetProxySettings( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, BG_JOB_PROXY_USAGE ProxyUsage, const WCHAR *ProxyList, const WCHAR *ProxyBypassList) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); FIXME("(%p)->(%d %s %s): stub\n", This, ProxyUsage, debugstr_w(ProxyList), debugstr_w(ProxyBypassList)); return E_NOTIMPL; } static HRESULT WINAPI BackgroundCopyJob_GetProxySettings( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, BG_JOB_PROXY_USAGE *pProxyUsage, LPWSTR *pProxyList, LPWSTR *pProxyBypassList) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); FIXME("(%p)->(%p %p %p): stub\n", This, pProxyUsage, pProxyList, pProxyBypassList); return E_NOTIMPL; } static HRESULT WINAPI BackgroundCopyJob_TakeOwnership( - IBackgroundCopyJob2 *iface) -{ - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + IBackgroundCopyJob3 *iface) +{ + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); FIXME("(%p): stub\n", This); return E_NOTIMPL; } static HRESULT WINAPI BackgroundCopyJob_SetNotifyCmdLine( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, LPCWSTR prog, LPCWSTR params) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); FIXME("(%p)->(%s %s): stub\n", This, debugstr_w(prog), debugstr_w(params)); return E_NOTIMPL; } static HRESULT WINAPI BackgroundCopyJob_GetNotifyCmdLine( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, LPWSTR *prog, LPWSTR *params) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); FIXME("(%p)->(%p %p): stub\n", This, prog, params); return E_NOTIMPL; } static HRESULT WINAPI BackgroundCopyJob_GetReplyProgress( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, BG_JOB_REPLY_PROGRESS *progress) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); FIXME("(%p)->(%p): stub\n", This, progress); return E_NOTIMPL; } static HRESULT WINAPI BackgroundCopyJob_GetReplyData( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, byte **pBuffer, UINT64 *pLength) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); FIXME("(%p)->(%p %p): stub\n", This, pBuffer, pLength); return E_NOTIMPL; } static HRESULT WINAPI BackgroundCopyJob_SetReplyFileName( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, LPCWSTR filename) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); FIXME("(%p)->(%s): stub\n", This, debugstr_w(filename)); return E_NOTIMPL; } static HRESULT WINAPI BackgroundCopyJob_GetReplyFileName( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, LPWSTR *pFilename) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); FIXME("(%p)->(%p): stub\n", This, pFilename); 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( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, BG_AUTH_CREDENTIALS *cred) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(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; } static HRESULT WINAPI BackgroundCopyJob_RemoveCredentials( - IBackgroundCopyJob2 *iface, + IBackgroundCopyJob3 *iface, BG_AUTH_TARGET target, BG_AUTH_SCHEME scheme) { - BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob2(iface); - FIXME("(%p)->(%d %d): stub\n", This, target, scheme); - return S_OK; -} - -static const IBackgroundCopyJob2Vtbl BackgroundCopyJobVtbl = + 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; +} + +static HRESULT WINAPI BackgroundCopyJob_ReplaceRemotePrefix( + IBackgroundCopyJob3 *iface, + LPCWSTR OldPrefix, + LPCWSTR NewPrefix) +{ + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); + FIXME("(%p)->(%s %s): stub\n", This, debugstr_w(OldPrefix), debugstr_w(NewPrefix)); + return S_OK; +} + +static HRESULT WINAPI BackgroundCopyJob_AddFileWithRanges( + IBackgroundCopyJob3 *iface, + LPCWSTR RemoteUrl, + LPCWSTR LocalName, + DWORD RangeCount, + BG_FILE_RANGE Ranges[]) +{ + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); + FIXME("(%p)->(%s %s %u %p): stub\n", This, debugstr_w(RemoteUrl), debugstr_w(LocalName), RangeCount, Ranges); + return S_OK; +} + +static HRESULT WINAPI BackgroundCopyJob_SetFileACLFlags( + IBackgroundCopyJob3 *iface, + DWORD Flags) +{ + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); + FIXME("(%p)->(%x): stub\n", This, Flags); + return S_OK; +} + +static HRESULT WINAPI BackgroundCopyJob_GetFileACLFlags( + IBackgroundCopyJob3 *iface, + DWORD *Flags) +{ + BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface); + FIXME("(%p)->(%p): stub\n", This, Flags); + return S_OK; +} + +static const IBackgroundCopyJob3Vtbl BackgroundCopyJob3Vtbl = { BackgroundCopyJob_QueryInterface, BackgroundCopyJob_AddRef, @@ -677,14 +1008,182 @@ BackgroundCopyJob_SetReplyFileName, BackgroundCopyJob_GetReplyFileName, BackgroundCopyJob_SetCredentials, - BackgroundCopyJob_RemoveCredentials + BackgroundCopyJob_RemoveCredentials, + BackgroundCopyJob_ReplaceRemotePrefix, + BackgroundCopyJob_AddFileWithRanges, + BackgroundCopyJob_SetFileACLFlags, + 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) +{ + 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) +{ + 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( + IBackgroundCopyJobHttpOptions *iface, + ULONG Flags) +{ + 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) +{ + 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 = +{ + 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; BackgroundCopyJobImpl *This; - int n; TRACE("(%s,%d,%p)\n", debugstr_w(displayName), type, job); @@ -692,15 +1191,15 @@ if (!This) return E_OUTOFMEMORY; - This->IBackgroundCopyJob2_iface.lpVtbl = &BackgroundCopyJobVtbl; + 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"); This->ref = 1; This->type = type; - n = (strlenW(displayName) + 1) * sizeof *displayName; - This->displayName = HeapAlloc(GetProcessHeap(), 0, n); + This->displayName = strdupW(displayName); if (!This->displayName) { This->cs.DebugInfo->Spare[0] = 0; @@ -708,7 +1207,6 @@ HeapFree(GetProcessHeap(), 0, This); return E_OUTOFMEMORY; } - memcpy(This->displayName, displayName, n); hr = CoCreateGuid(&This->jobId); if (FAILED(hr)) @@ -732,6 +1230,16 @@ This->notify_flags = BG_NOTIFY_JOB_ERROR | BG_NOTIFY_JOB_TRANSFERRED; This->callback = NULL; This->callback2 = FALSE; + + This->error.context = 0; + This->error.code = 0; + This->error.file = NULL; + + 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; Modified: trunk/reactos/dll/win32/qmgr/qmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/qmgr.c?rev=…
============================================================================== --- trunk/reactos/dll/win32/qmgr/qmgr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/qmgr/qmgr.c [iso-8859-1] Mon Jul 20 22:48:28 2015 @@ -63,7 +63,7 @@ return hres; /* Add a reference to the job to job list */ - *ppJob = (IBackgroundCopyJob*)&job->IBackgroundCopyJob2_iface; + *ppJob = (IBackgroundCopyJob *)&job->IBackgroundCopyJob3_iface; IBackgroundCopyJob_AddRef(*ppJob); EnterCriticalSection(&globalMgr.cs); list_add_head(&globalMgr.jobs, &job->entryFromQmgr); @@ -90,8 +90,8 @@ { if (IsEqualGUID(&cur->jobId, jobID)) { - *job = (IBackgroundCopyJob*)&cur->IBackgroundCopyJob2_iface; - IBackgroundCopyJob2_AddRef(&cur->IBackgroundCopyJob2_iface); + *job = (IBackgroundCopyJob *)&cur->IBackgroundCopyJob3_iface; + IBackgroundCopyJob3_AddRef(&cur->IBackgroundCopyJob3_iface); hr = S_OK; break; } @@ -161,7 +161,7 @@ LIST_FOR_EACH_ENTRY_SAFE(job, jobCur, &qmgr->jobs, BackgroundCopyJobImpl, entryFromQmgr) { list_remove(&job->entryFromQmgr); - IBackgroundCopyJob2_Release(&job->IBackgroundCopyJob2_iface); + IBackgroundCopyJob3_Release(&job->IBackgroundCopyJob3_iface); } return 0; } @@ -176,7 +176,7 @@ if (job->state == BG_JOB_STATE_ACKNOWLEDGED || job->state == BG_JOB_STATE_CANCELLED) { list_remove(&job->entryFromQmgr); - IBackgroundCopyJob2_Release(&job->IBackgroundCopyJob2_iface); + IBackgroundCopyJob3_Release(&job->IBackgroundCopyJob3_iface); } else if (job->state == BG_JOB_STATE_QUEUED) { Modified: trunk/reactos/dll/win32/qmgr/qmgr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/qmgr.h?rev=…
============================================================================== --- trunk/reactos/dll/win32/qmgr/qmgr.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/qmgr/qmgr.h [iso-8859-1] Mon Jul 20 22:48:28 2015 @@ -34,6 +34,8 @@ #include <winsvc.h> #include <objbase.h> #include <bits1_5.h> +#include <bits2_0.h> +#include <bits2_5.h> #include <bits3_0.h> #include <wine/list.h> @@ -45,7 +47,8 @@ /* Background copy job vtbl and related data */ typedef struct { - IBackgroundCopyJob2 IBackgroundCopyJob2_iface; + IBackgroundCopyJob3 IBackgroundCopyJob3_iface; + IBackgroundCopyJobHttpOptions IBackgroundCopyJobHttpOptions_iface; LONG ref; LPWSTR displayName; LPWSTR description; @@ -60,18 +63,34 @@ /* Protects file list, and progress */ CRITICAL_SECTION cs; struct list entryFromQmgr; + struct + { + WCHAR *headers; + ULONG flags; + BG_AUTH_CREDENTIALS creds[BG_AUTH_TARGET_PROXY][BG_AUTH_SCHEME_PASSPORT]; + } http_options; + struct + { + BG_ERROR_CONTEXT context; + HRESULT code; + IBackgroundCopyFile2 *file; + } error; + HANDLE wait; + HANDLE cancel; + HANDLE done; } BackgroundCopyJobImpl; /* Background copy file vtbl and related data */ typedef struct { - IBackgroundCopyFile IBackgroundCopyFile_iface; + IBackgroundCopyFile2 IBackgroundCopyFile2_iface; LONG ref; BG_FILE_INFO info; BG_FILE_PROGRESS fileProgress; WCHAR tempFileName[MAX_PATH]; struct list entryFromJob; BackgroundCopyJobImpl *owner; + DWORD read_size; } BackgroundCopyFileImpl; /* Background copy manager vtbl and related data */ @@ -105,14 +124,21 @@ 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 char * -qmgr_strdup(const char *s) +static inline WCHAR *strdupW(const WCHAR *src) { - size_t n = strlen(s) + 1; - char *d = HeapAlloc(GetProcessHeap(), 0, n); - return d ? memcpy(d, s, n) : NULL; + 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) @@ -128,19 +154,4 @@ 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__ */ Modified: trunk/reactos/dll/win32/qmgr/qmgr_local.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/qmgr/qmgr_local.…
============================================================================== --- trunk/reactos/dll/win32/qmgr/qmgr_local.idl [iso-8859-1] (original) +++ trunk/reactos/dll/win32/qmgr/qmgr_local.idl [iso-8859-1] Mon Jul 20 22:48:28 2015 @@ -22,4 +22,6 @@ #define DO_NO_IMPORTS #include "bits1_5.idl" +#include "bits2_0.idl" +#include "bits2_5.idl" #include "bits3_0.idl" Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Mon Jul 20 22:48:28 2015 @@ -159,7 +159,7 @@ reactos/dll/win32/printui # Synced to WineStaging-1.7.37 reactos/dll/win32/propsys # Synced to WineStaging-1.7.37 reactos/dll/win32/pstorec # Synced to WineStaging-1.7.37 -reactos/dll/win32/qmgr # Synced to WineStaging-1.7.37 +reactos/dll/win32/qmgr # Synced to WineStaging-1.7.47 reactos/dll/win32/qmgrprxy # Synced to WineStaging-1.7.37 reactos/dll/win32/query # Synced to WineStaging-1.7.37 reactos/dll/win32/rasapi32 # Synced to WineStaging-1.7.37
9 years, 5 months
1
0
0
0
[akhaldi] 68489: [OLEDLG_WINETEST] Import from Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Jul 20 22:46:22 2015 New Revision: 68489 URL:
http://svn.reactos.org/svn/reactos?rev=68489&view=rev
Log: [OLEDLG_WINETEST] Import from Wine Staging 1.7.47. CORE-9924 Added: trunk/rostests/winetests/oledlg/ (with props) trunk/rostests/winetests/oledlg/CMakeLists.txt (with props) trunk/rostests/winetests/oledlg/main.c (with props) trunk/rostests/winetests/oledlg/testlist.c (with props) Modified: trunk/rostests/winetests/CMakeLists.txt Modified: trunk/rostests/winetests/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/CMakeLists.txt?…
============================================================================== --- trunk/rostests/winetests/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/winetests/CMakeLists.txt [iso-8859-1] Mon Jul 20 22:46:22 2015 @@ -67,6 +67,7 @@ add_subdirectory(ole32) add_subdirectory(oleacc) add_subdirectory(oleaut32) +add_subdirectory(oledlg) add_subdirectory(opengl32) add_subdirectory(pdh) add_subdirectory(propsys) Propchange: trunk/rostests/winetests/oledlg/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Mon Jul 20 22:46:22 2015 @@ -0,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/rostests/winetests/oledlg/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/rostests/winetests/oledlg/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Added: trunk/rostests/winetests/oledlg/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oledlg/CMakeLis…
============================================================================== --- trunk/rostests/winetests/oledlg/CMakeLists.txt (added) +++ trunk/rostests/winetests/oledlg/CMakeLists.txt [iso-8859-1] Mon Jul 20 22:46:22 2015 @@ -0,0 +1,7 @@ + +add_definitions(-DUSE_WINE_TODOS) +include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) +add_executable(oledlg_winetest main.c testlist.c) +set_module_type(oledlg_winetest win32cui) +add_importlibs(oledlg_winetest oledlg ole32 user32 msvcrt kernel32) +add_cd_file(TARGET oledlg_winetest DESTINATION reactos/bin FOR all) Propchange: trunk/rostests/winetests/oledlg/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/oledlg/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oledlg/main.c?r…
============================================================================== --- trunk/rostests/winetests/oledlg/main.c (added) +++ trunk/rostests/winetests/oledlg/main.c [iso-8859-1] Mon Jul 20 22:46:22 2015 @@ -0,0 +1,413 @@ +/* + * oledlg tests + * + * Copyright 2015 Nikolay Sivov for CodeWeavers + * + * 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 + */ + +#define COBJMACROS + +#include <wine/test.h> +#include <stdio.h> + +#include <initguid.h> +#include <oledlg.h> + +static HRESULT WINAPI enumverbs_QueryInterface(IEnumOLEVERB *iface, REFIID riid, void **ppv) +{ + if (IsEqualIID(riid, &IID_IEnumOLEVERB) || IsEqualIID(riid, &IID_IUnknown)) { + *ppv = iface; + IEnumOLEVERB_AddRef(iface); + return S_OK; + } + + *ppv = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI enumverbs_AddRef(IEnumOLEVERB *iface) +{ + return 2; +} + +static ULONG WINAPI enumverbs_Release(IEnumOLEVERB *iface) +{ + return 1; +} + +static int g_enumpos; +static const WCHAR verbW[] = {'v','e','r','b',0}; +static HRESULT WINAPI enumverbs_Next(IEnumOLEVERB *iface, ULONG count, OLEVERB *verbs, ULONG *fetched) +{ + ok(count == 1, "got %u\n", count); + ok(fetched == NULL, "got %p\n", fetched); + ok(g_enumpos == 0 || g_enumpos == 1, "got pos %d\n", g_enumpos); + + if (g_enumpos++ == 0) { + verbs->lVerb = 123; + verbs->lpszVerbName = CoTaskMemAlloc(sizeof(verbW)); + lstrcpyW(verbs->lpszVerbName, verbW); + verbs->fuFlags = MF_ENABLED; + verbs->grfAttribs = OLEVERBATTRIB_ONCONTAINERMENU; + if (fetched) *fetched = 1; + return S_OK; + } + + return S_FALSE; +} + +static HRESULT WINAPI enumverbs_Skip(IEnumOLEVERB *iface, ULONG count) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI enumverbs_Reset(IEnumOLEVERB *iface) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI enumverbs_Clone(IEnumOLEVERB *iface, IEnumOLEVERB **ppenum) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static IEnumOLEVERBVtbl enumverbsvtbl = { + enumverbs_QueryInterface, + enumverbs_AddRef, + enumverbs_Release, + enumverbs_Next, + enumverbs_Skip, + enumverbs_Reset, + enumverbs_Clone +}; + +static IEnumOLEVERB enumverbs = { &enumverbsvtbl }; + +static HRESULT WINAPI oleobject_QueryInterface(IOleObject *iface, REFIID riid, void **ppv) +{ + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IOleObject)) { + *ppv = iface; + IOleObject_AddRef(iface); + return S_OK; + } + + *ppv = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI oleobject_AddRef(IOleObject *iface) +{ + return 2; +} + +static ULONG WINAPI oleobject_Release(IOleObject *iface) +{ + return 1; +} + +static HRESULT WINAPI oleobject_SetClientSite(IOleObject *iface, IOleClientSite *site) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI oleobject_GetClientSite(IOleObject *iface, IOleClientSite **site) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI oleobject_SetHostNames(IOleObject *iface, LPCOLESTR containerapp, + LPCOLESTR containerObj) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI oleobject_Close(IOleObject *iface, DWORD saveopt) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI oleobject_SetMoniker(IOleObject *iface, DWORD whichmoniker, IMoniker *mk) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI oleobject_GetMoniker(IOleObject *iface, DWORD assign, DWORD whichmoniker, + IMoniker **mk) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI oleobject_InitFromData(IOleObject *iface, IDataObject *dataobject, + BOOL creation, DWORD reserved) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI oleobject_GetClipboardData(IOleObject *iface, DWORD reserved, IDataObject **dataobject) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI oleobject_DoVerb(IOleObject *iface, LONG verb, MSG *msg, IOleClientSite *activesite, + LONG index, HWND hwndParent, LPCRECT rect) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static BOOL g_enumverbsfail; +static HRESULT WINAPI oleobject_EnumVerbs(IOleObject *iface, IEnumOLEVERB **enumverb) +{ + if (g_enumverbsfail) { + *enumverb = NULL; + return E_FAIL; + } + *enumverb = &enumverbs; + return S_OK; +} + +static HRESULT WINAPI oleobject_Update(IOleObject *iface) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI oleobject_IsUpToDate(IOleObject *iface) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI oleobject_GetUserClassID(IOleObject *iface, CLSID *clsid) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static const WCHAR testW[] = {'t','e','s','t',0}; +static HRESULT WINAPI oleobject_GetUserType(IOleObject *iface, DWORD formoftype, + LPOLESTR *usertype) +{ + ok(formoftype == USERCLASSTYPE_SHORT, "got %d\n", formoftype); + *usertype = CoTaskMemAlloc(sizeof(testW)); + lstrcpyW(*usertype, testW); + return S_OK; +} + +static HRESULT WINAPI oleobject_SetExtent(IOleObject *iface, DWORD aspect, SIZEL *size) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI oleobject_GetExtent(IOleObject *iface, DWORD aspect, SIZEL *size) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI oleobject_Advise(IOleObject *iface, IAdviseSink *sink, DWORD *connection) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI oleobject_Unadvise(IOleObject *iface, DWORD connection) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI oleobject_EnumAdvise(IOleObject *iface, IEnumSTATDATA **enumadvise) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI oleobject_GetMiscStatus(IOleObject *iface, DWORD aspect, DWORD *status) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI oleobject_SetColorScheme(IOleObject *iface, LOGPALETTE *pal) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static IOleObjectVtbl oleobjectvtbl = { + oleobject_QueryInterface, + oleobject_AddRef, + oleobject_Release, + oleobject_SetClientSite, + oleobject_GetClientSite, + oleobject_SetHostNames, + oleobject_Close, + oleobject_SetMoniker, + oleobject_GetMoniker, + oleobject_InitFromData, + oleobject_GetClipboardData, + oleobject_DoVerb, + oleobject_EnumVerbs, + oleobject_Update, + oleobject_IsUpToDate, + oleobject_GetUserClassID, + oleobject_GetUserType, + oleobject_SetExtent, + oleobject_GetExtent, + oleobject_Advise, + oleobject_Unadvise, + oleobject_EnumAdvise, + oleobject_GetMiscStatus, + oleobject_SetColorScheme +}; + +static IOleObject oleobject = { &oleobjectvtbl }; + +static void test_OleUIAddVerbMenu(void) +{ + HMENU hMenu, verbmenu; + MENUITEMINFOW info; + WCHAR buffW[50]; + int count; + BOOL ret; + + ret = OleUIAddVerbMenuW(NULL, NULL, NULL, 0, 0, 0, FALSE, 0, NULL); + ok(!ret, "got %d\n", ret); + + verbmenu = (HMENU)0xdeadbeef; + ret = OleUIAddVerbMenuW(NULL, NULL, NULL, 0, 0, 0, FALSE, 0, &verbmenu); + ok(!ret, "got %d\n", ret); + ok(verbmenu == NULL, "got %p\n", verbmenu); + + g_enumpos = 0; + ret = OleUIAddVerbMenuW(&oleobject, NULL, NULL, 0, 0, 0, FALSE, 0, NULL); + ok(!ret, "got %d\n", ret); + + hMenu = CreatePopupMenu(); + + memset(&info, 0, sizeof(info)); + info.cbSize = sizeof(info); + ret = InsertMenuItemW(hMenu, 0, TRUE, &info); + ok(ret, "got %d\n", ret); + + count = GetMenuItemCount(hMenu); + ok(count == 1, "got %d\n", count); + + g_enumpos = 0; + ret = OleUIAddVerbMenuW(&oleobject, NULL, hMenu, 0, 0, 0, FALSE, 0, NULL); + ok(!ret, "got %d\n", ret); + + count = GetMenuItemCount(hMenu); + ok(count == 1, "got %d\n", count); + + ret = InsertMenuItemW(hMenu, 0, TRUE, &info); + ok(ret, "got %d\n", ret); + + count = GetMenuItemCount(hMenu); + ok(count == 2, "got %d\n", count); + + verbmenu = (HMENU)0xdeadbeef; + g_enumpos = 0; + ret = OleUIAddVerbMenuW(&oleobject, NULL, hMenu, 1, 0, 0, FALSE, 0, &verbmenu); + ok(ret, "got %d\n", ret); + ok(verbmenu == NULL, "got %p\n", verbmenu); + + count = GetMenuItemCount(hMenu); + ok(count == 2, "got %d\n", count); + + /* object doesn't support EnumVerbs() */ + g_enumverbsfail = TRUE; + g_enumpos = 0; + verbmenu = (HMENU)0xdeadbeef; + ret = OleUIAddVerbMenuW(&oleobject, NULL, hMenu, 2, 0, 0, FALSE, 0, &verbmenu); + ok(!ret, "got %d\n", ret); + ok(verbmenu == NULL, "got %p\n", verbmenu); + g_enumverbsfail = FALSE; + + /* added disabled item */ + memset(&info, 0, sizeof(info)); + info.cbSize = sizeof(info); + info.fMask = MIIM_STATE|MIIM_SUBMENU; + ret = GetMenuItemInfoW(hMenu, 2, TRUE, &info); + ok(ret, "got %d\n", ret); + ok(info.fState & MFS_DISABLED, "got state 0x%08x\n", info.fState); + ok(info.hSubMenu == NULL, "got submenu %p\n", info.hSubMenu); + + count = GetMenuItemCount(hMenu); + ok(count == 3, "got %d\n", count); + + /* now without object */ + verbmenu = (HMENU)0xdeadbeef; + ret = OleUIAddVerbMenuW(NULL, testW, hMenu, 3, 42, 0, FALSE, 0, &verbmenu); + ok(!ret, "got %d\n", ret); + ok(verbmenu == NULL, "got %p\n", verbmenu); + + memset(&info, 0, sizeof(info)); + info.cbSize = sizeof(info); + info.fMask = MIIM_STATE|MIIM_ID|MIIM_STRING|MIIM_SUBMENU; + info.dwTypeData = buffW; + info.cch = sizeof(buffW)/sizeof(WCHAR); + ret = GetMenuItemInfoW(hMenu, 3, TRUE, &info); + ok(ret, "got %d\n", ret); + ok(info.fState == MF_GRAYED, "got state 0x%08x\n", info.fState); + ok(info.wID == 42, "got id %d\n", info.wID); + ok(info.hSubMenu == NULL, "got submenu %p\n", info.hSubMenu); + + count = GetMenuItemCount(hMenu); + ok(count == 4, "got %d\n", count); + + verbmenu = (HMENU)0xdeadbeef; + g_enumpos = 0; + ret = OleUIAddVerbMenuW(&oleobject, NULL, hMenu, 4, 0, 0, FALSE, 0, &verbmenu); + ok(ret, "got %d\n", ret); + ok(verbmenu == NULL, "got %p\n", verbmenu); + + /* check newly added item */ + memset(&info, 0, sizeof(info)); + info.cbSize = sizeof(info); + info.fMask = MIIM_STRING|MIIM_STATE|MIIM_SUBMENU; + info.dwTypeData = buffW; + info.cch = sizeof(buffW)/sizeof(WCHAR); + ret = GetMenuItemInfoW(hMenu, 4, TRUE, &info); + ok(ret, "got %d\n", ret); + /* item string has a form of '<verb> <usertype> <Object>', where Object is localized */ + ok(!memcmp(buffW, verbW, sizeof(verbW) - sizeof(WCHAR)), "str %s\n", wine_dbgstr_w(buffW)); + ok(info.fState == 0, "got state 0x%08x\n", info.fState); + ok(info.hSubMenu == NULL, "got submenu %p\n", info.hSubMenu); + + count = GetMenuItemCount(hMenu); + ok(count == 5, "got %d\n", count); + + DestroyMenu(hMenu); +} + +START_TEST(main) +{ + test_OleUIAddVerbMenu(); +} Propchange: trunk/rostests/winetests/oledlg/main.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/oledlg/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oledlg/testlist…
============================================================================== --- trunk/rostests/winetests/oledlg/testlist.c (added) +++ trunk/rostests/winetests/oledlg/testlist.c [iso-8859-1] Mon Jul 20 22:46:22 2015 @@ -0,0 +1,12 @@ +/* Automatically generated by make depend; DO NOT EDIT!! */ + +#define STANDALONE +#include <wine/test.h> + +extern void func_main(void); + +const struct test winetest_testlist[] = +{ + { "main", func_main }, + { 0, 0 } +}; Propchange: trunk/rostests/winetests/oledlg/testlist.c ------------------------------------------------------------------------------ svn:eol-style = native
9 years, 5 months
1
0
0
0
[akhaldi] 68488: [OLEDLG] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Jul 20 22:45:19 2015 New Revision: 68488 URL:
http://svn.reactos.org/svn/reactos?rev=68488&view=rev
Log: [OLEDLG] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_Cs.rc trunk/reactos/dll/win32/oledlg/lang/oledlg_Da.rc trunk/reactos/dll/win32/oledlg/lang/oledlg_De.rc trunk/reactos/dll/win32/oledlg/lang/oledlg_En.rc trunk/reactos/dll/win32/oledlg/lang/oledlg_Es.rc trunk/reactos/dll/win32/oledlg/lang/oledlg_Fr.rc trunk/reactos/dll/win32/oledlg/lang/oledlg_He.rc trunk/reactos/dll/win32/oledlg/lang/oledlg_Hu.rc trunk/reactos/dll/win32/oledlg/lang/oledlg_It.rc trunk/reactos/dll/win32/oledlg/lang/oledlg_Ja.rc trunk/reactos/dll/win32/oledlg/lang/oledlg_Ko.rc trunk/reactos/dll/win32/oledlg/lang/oledlg_Lt.rc trunk/reactos/dll/win32/oledlg/lang/oledlg_Nl.rc trunk/reactos/dll/win32/oledlg/lang/oledlg_No.rc trunk/reactos/dll/win32/oledlg/lang/oledlg_Pl.rc trunk/reactos/dll/win32/oledlg/lang/oledlg_Pt.rc trunk/reactos/dll/win32/oledlg/lang/oledlg_Ro.rc trunk/reactos/dll/win32/oledlg/lang/oledlg_Ru.rc trunk/reactos/dll/win32/oledlg/lang/oledlg_Si.rc trunk/reactos/dll/win32/oledlg/lang/oledlg_Sq.rc trunk/reactos/dll/win32/oledlg/lang/oledlg_Sv.rc trunk/reactos/dll/win32/oledlg/lang/oledlg_Tr.rc trunk/reactos/dll/win32/oledlg/lang/oledlg_Uk.rc trunk/reactos/dll/win32/oledlg/lang/oledlg_Zh.rc trunk/reactos/dll/win32/oledlg/oledlg_main.c trunk/reactos/dll/win32/oledlg/pastespl.c trunk/reactos/dll/win32/oledlg/resource.h trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_Cs.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_Cs.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_Cs.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -30,6 +30,8 @@ IDS_BROWSE "Procházet" IDS_NOTOLEMOD "Soubor nenà platným OLE modulem. Nelze registrovat OLE propojenÃ." IDS_NOTOLEMODCAPTION "PÅidat propojenÃ" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_Da.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_Da.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_Da.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -27,6 +27,8 @@ IDS_BROWSE "Gennemse" IDS_NOTOLEMOD "Filen ser ikke ud til at være et gyldig OLE modul. Kunne ikke registrere OLE control'en." IDS_NOTOLEMODCAPTION "Tilføj control" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_De.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_De.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_De.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -27,6 +27,8 @@ IDS_BROWSE "Durchsuchen" IDS_NOTOLEMOD "Die Datei ist offenbar kein gültiges OLE-Steuermodul. Die OLE-Steuerung konnte nicht registriert werden." IDS_NOTOLEMODCAPTION "Steuerung hinzufügen" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_En.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_En.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_En.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -25,6 +25,8 @@ IDS_BROWSE "Browse" IDS_NOTOLEMOD "File does not appear to be a valid OLE module. Unable to register OLE control." IDS_NOTOLEMODCAPTION "Add Control" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_Es.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_Es.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_Es.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -25,6 +25,8 @@ IDS_BROWSE "Explorar" IDS_NOTOLEMOD "El archivo no parece ser un módulo OLE válido. Incapaz de registrar el control OLE." IDS_NOTOLEMODCAPTION "Añadir control" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_Fr.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_Fr.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_Fr.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -32,6 +32,8 @@ IDS_BROWSE "Parcourir" IDS_NOTOLEMOD "Le fichier ne semble pas être un module OLE valide. Impossible d'enregistrer le contrôle OLE." IDS_NOTOLEMODCAPTION "Ajouter un contrôle" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_He.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_He.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_He.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -27,6 +27,8 @@ IDS_BROWSE "ס××ר" IDS_NOTOLEMOD "File does not appear to be a valid OLE module. Unable to register OLE control." IDS_NOTOLEMODCAPTION "××ספת ×קר" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_Hu.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_Hu.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_Hu.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -28,6 +28,8 @@ IDS_BROWSE "Tallózás" IDS_NOTOLEMOD "A fájl úgy tűnik nem egy érvényes OLE modul. Nem tudom regisztrálni az OLE vezérlÅt." IDS_NOTOLEMODCAPTION "VezérlÅ hozzáadása" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_It.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_It.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_It.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -29,6 +29,8 @@ IDS_BROWSE "Esplora" IDS_NOTOLEMOD "Il file non sembra essere un modulo OLE valido. Impossibile registrare il controllo OLE." IDS_NOTOLEMODCAPTION "Aggiungi Controllo" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_Ja.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_Ja.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_Ja.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -28,6 +28,8 @@ IDS_BROWSE "åç §" IDS_NOTOLEMOD "ãã¡ã¤ã«ã¯æå¹ãªOLEã¢ã¸ã¥ã¼ã«ã§ã¯ãªãããã§ããOLEã³ã³ããã¼ã«ãç»é²ã§ãã¾ããã" IDS_NOTOLEMODCAPTION "ã³ã³ããã¼ã«ã追å " + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_Ko.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_Ko.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_Ko.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -26,6 +26,8 @@ IDS_BROWSE "찾기" IDS_NOTOLEMOD "ì´ íì¼ì ì¬ë°ë¥¸ OLE모ëì´ ìëê±°ë¡ ë³´ì ëë¤. OLE컨í¸ë¡¤ì ë±ë¡í ì ììµëë¤." IDS_NOTOLEMODCAPTION "컨í¸ë¡¤ ëí기" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_Lt.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_Lt.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_Lt.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -28,6 +28,8 @@ IDS_BROWSE "Parinkti" IDS_NOTOLEMOD "PanaÅ¡u, kad failas nÄra galiojantis OLE modulis. Nepavyko užregistruoti OLE valdiklio." IDS_NOTOLEMODCAPTION "PridÄti valdiklį" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_Nl.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_Nl.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_Nl.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -29,6 +29,8 @@ IDS_BROWSE "Bladeren" IDS_NOTOLEMOD "Het bestand is geen geldig OLE bestand. De registratie is mislukt." IDS_NOTOLEMODCAPTION "Toevoegen" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_No.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_No.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_No.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -25,6 +25,8 @@ IDS_BROWSE "Bla" IDS_NOTOLEMOD "Filen ser ikke ut til å være en gyldig OLE-modul. Kunne ikke registrere OLE-kontroller." IDS_NOTOLEMODCAPTION "Legg til kontroller" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_Pl.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_Pl.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_Pl.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -26,6 +26,8 @@ IDS_BROWSE "PrzeglÄ daj" IDS_NOTOLEMOD "Plik nie wydaje siÄ byÄ poprawnym moduÅem OLE. Nie udaÅo siÄ zarejestrowaÄ kontrolki OLE." IDS_NOTOLEMODCAPTION "Dodaj kontrolkÄ" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_Pt.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_Pt.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_Pt.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -30,6 +30,8 @@ IDS_BROWSE "Procurar" IDS_NOTOLEMOD "O arquivo não parece ser um módulo OLE válido. ImpossÃvel registrar o controle OLE." IDS_NOTOLEMODCAPTION "Adicionar Controle" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE @@ -108,6 +110,8 @@ IDS_BROWSE "Procurar" IDS_NOTOLEMOD "O ficheiro não parece ser um módulo OLE válido. ImpossÃvel registrar o controlo OLE." IDS_NOTOLEMODCAPTION "Adicionar Controlo" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_Ro.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_Ro.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_Ro.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -30,6 +30,8 @@ IDS_BROWSE "Navigare" IDS_NOTOLEMOD "FiÈierul nu pare a fi un modul OLE valid. Nu se poate înregistra controlul OLE." IDS_NOTOLEMODCAPTION "AdaugÄ un control" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_Ru.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_Ru.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_Ru.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -28,6 +28,8 @@ IDS_BROWSE "ÐÑоÑмоÑÑ" IDS_NOTOLEMOD "Файл не ÑвлÑеÑÑÑ ÐºÐ¾ÑÑекÑнÑм модÑлем OLE. Ðевозможно заÑегиÑÑÑиÑоваÑÑ ÑÐ»ÐµÐ¼ÐµÐ½Ñ ÑпÑÐ°Ð²Ð»ÐµÐ½Ð¸Ñ OLE." IDS_NOTOLEMODCAPTION "ÐобавиÑÑ ÑÐ»ÐµÐ¼ÐµÐ½Ñ ÑпÑавлениÑ" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_Si.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_Si.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_Si.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -27,6 +27,8 @@ IDS_BROWSE "Brskaj" IDS_NOTOLEMOD "Datoteka ni veljaven OLE modul. OLE kontrole ni mogoÄe registrirati." IDS_NOTOLEMODCAPTION "Dodajanje kontrole" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_Sq.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_Sq.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_Sq.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -28,6 +28,8 @@ IDS_BROWSE "Shfleto" IDS_NOTOLEMOD "Dokument nuk duket të ketë një modul të vlefshme OLE. Në pamundësi për të regjistruar kontrollin OLE." IDS_NOTOLEMODCAPTION "Shto Kontroll" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_Sv.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_Sv.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_Sv.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -25,6 +25,8 @@ IDS_BROWSE "Bläddra" IDS_NOTOLEMOD "File does not appear to be a valid OLE module. Unable to register OLE control." IDS_NOTOLEMODCAPTION "Add Control" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_Tr.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_Tr.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_Tr.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -27,6 +27,8 @@ IDS_BROWSE "Göz At" IDS_NOTOLEMOD "Kütük, geçerli bir OLE parçası olarak görünmüyor. OLE denetimi saklanamıyor." IDS_NOTOLEMODCAPTION "Denetim Ekle" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_Uk.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_Uk.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_Uk.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -28,6 +28,8 @@ IDS_BROWSE "ÐглÑд" IDS_NOTOLEMOD "Файл не Ñ Ð¼Ð¾Ð´Ñлем ÑпÑавлÑÐ½Ð½Ñ OLE. Ðе вдаÑÑÑÑÑ Ð·Ð°ÑеÑÑÑÑÑваÑи ÐµÐ»ÐµÐ¼ÐµÐ½Ñ ÑпÑавлÑÐ½Ð½Ñ OLE." IDS_NOTOLEMODCAPTION "ÐодаÑи ÐµÐ»ÐµÐ¼ÐµÐ½Ñ ÑпÑавлÑннÑ" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/lang/oledlg_Zh.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/lang/oled…
============================================================================== --- trunk/reactos/dll/win32/oledlg/lang/oledlg_Zh.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/lang/oledlg_Zh.rc [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -30,6 +30,8 @@ IDS_BROWSE "æµè§" IDS_NOTOLEMOD "æ¬æ件ä¸åæ¯ä¸ä¸ªææç OLE 模å. ä¸è½æ³¨å OLE æ§ä»¶." IDS_NOTOLEMODCAPTION "æ·»å æ§ä»¶" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE @@ -108,6 +110,8 @@ IDS_BROWSE "ç覽" IDS_NOTOLEMOD "æ¬æªæ¡ä¸åæ¯ä¸åææç OLE 模å. ä¸è½è¨»å OLE æ§ä»¶." IDS_NOTOLEMODCAPTION "æ·»å æ§ä»¶" + IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_CONVERT "&Convert..." } STRINGTABLE Modified: trunk/reactos/dll/win32/oledlg/oledlg_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/oledlg_ma…
============================================================================== --- trunk/reactos/dll/win32/oledlg/oledlg_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/oledlg_main.c [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -87,35 +87,154 @@ /*********************************************************************** * OleUIAddVerbMenuA (OLEDLG.1) */ -BOOL WINAPI OleUIAddVerbMenuA( - LPOLEOBJECT lpOleObj, LPCSTR lpszShortType, - HMENU hMenu, UINT uPos, UINT uIDVerbMin, UINT uIDVerbMax, - BOOL bAddConvert, UINT idConvert, HMENU *lphMenu) -{ - FIXME("(%p, %s, %p, %d, %d, %d, %d, %d, %p): stub\n", - lpOleObj, debugstr_a(lpszShortType), - hMenu, uPos, uIDVerbMin, uIDVerbMax, - bAddConvert, idConvert, lphMenu - ); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; +BOOL WINAPI OleUIAddVerbMenuA(IOleObject *object, LPCSTR shorttype, + HMENU hMenu, UINT uPos, UINT uIDVerbMin, UINT uIDVerbMax, + BOOL addConvert, UINT idConvert, HMENU *lphMenu) +{ + WCHAR *shorttypeW = NULL; + BOOL ret; + + TRACE("(%p, %s, %p, %d, %d, %d, %d, %d, %p)\n", object, debugstr_a(shorttype), + hMenu, uPos, uIDVerbMin, uIDVerbMax, addConvert, idConvert, lphMenu); + + if (shorttype) + { + INT len = MultiByteToWideChar(CP_ACP, 0, shorttype, -1, NULL, 0); + shorttypeW = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); + if (shorttypeW) + MultiByteToWideChar(CP_ACP, 0, shorttype, -1, shorttypeW, len); + } + + ret = OleUIAddVerbMenuW(object, shorttypeW, hMenu, uPos, uIDVerbMin, uIDVerbMax, + addConvert, idConvert, lphMenu); + HeapFree(GetProcessHeap(), 0, shorttypeW); + return ret; +} + +static inline BOOL is_verb_in_range(const OLEVERB *verb, UINT idmin, UINT idmax) +{ + if (idmax == 0) return TRUE; + return (verb->lVerb + idmin <= idmax); +} + +static HRESULT get_next_insertable_verb(IEnumOLEVERB *enumverbs, UINT idmin, UINT idmax, OLEVERB *verb) +{ + memset(verb, 0, sizeof(*verb)); + + while (IEnumOLEVERB_Next(enumverbs, 1, verb, NULL) == S_OK) { + if (is_verb_in_range(verb, idmin, idmax) && (verb->grfAttribs & OLEVERBATTRIB_ONCONTAINERMENU)) + return S_OK; + + CoTaskMemFree(verb->lpszVerbName); + memset(verb, 0, sizeof(*verb)); + } + + return S_FALSE; +} + +static void insert_verb_to_menu(HMENU menu, UINT idmin, const OLEVERB *verb) +{ + InsertMenuW(menu, ~0, verb->fuFlags | MF_BYPOSITION | MF_STRING, verb->lVerb + idmin, verb->lpszVerbName); } /*********************************************************************** * OleUIAddVerbMenuW (OLEDLG.14) */ -BOOL WINAPI OleUIAddVerbMenuW( - LPOLEOBJECT lpOleObj, LPCWSTR lpszShortType, - HMENU hMenu, UINT uPos, UINT uIDVerbMin, UINT uIDVerbMax, - BOOL bAddConvert, UINT idConvert, HMENU *lphMenu) -{ - FIXME("(%p, %s, %p, %d, %d, %d, %d, %d, %p): stub\n", - lpOleObj, debugstr_w(lpszShortType), - hMenu, uPos, uIDVerbMin, uIDVerbMax, - bAddConvert, idConvert, lphMenu - ); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; +BOOL WINAPI OleUIAddVerbMenuW(IOleObject *object, LPCWSTR shorttype, + HMENU hMenu, UINT uPos, UINT idmin, UINT idmax, BOOL addConvert, UINT idConvert, HMENU *ret_submenu) +{ + static const WCHAR spaceW[] = {' ',0}; + IEnumOLEVERB *enumverbs = NULL; + WCHAR *rootname, *objecttype; + LPOLESTR usertype = NULL; + OLEVERB firstverb, verb; + WCHAR resstrW[32]; /* should be enough */ + BOOL singleverb; + HMENU submenu; + + TRACE("(%p, %s, %p, %d, %d, %d, %d, %d, %p)\n", object, debugstr_w(shorttype), + hMenu, uPos, idmin, idmax, addConvert, idConvert, ret_submenu); + + if (ret_submenu) + *ret_submenu = NULL; + + if (!hMenu || !ret_submenu) + return FALSE; + + /* check if we can get verbs at all */ + if (object) + IOleObject_EnumVerbs(object, &enumverbs); + + LoadStringW(OLEDLG_hInstance, IDS_VERBMENU_OBJECT, resstrW, sizeof(resstrW)/sizeof(WCHAR)); + /* no object, or object without enumeration support */ + if (!object || (object && !enumverbs)) { + InsertMenuW(hMenu, uPos, MF_BYPOSITION|MF_STRING|MF_GRAYED, idmin, resstrW); + return FALSE; + } + + /* root entry string */ + if (!shorttype && (IOleObject_GetUserType(object, USERCLASSTYPE_SHORT, &usertype) == S_OK)) + objecttype = usertype; + else + objecttype = (WCHAR*)shorttype; + + rootname = CoTaskMemAlloc((strlenW(objecttype) + strlenW(resstrW) + 2)*sizeof(WCHAR)); + strcpyW(rootname, objecttype); + strcatW(rootname, spaceW); + strcatW(rootname, resstrW); + CoTaskMemFree(usertype); + + /* iterate through verbs */ + + /* find first suitable verb */ + get_next_insertable_verb(enumverbs, idmin, idmax, &firstverb); + singleverb = get_next_insertable_verb(enumverbs, idmin, idmax, &verb) != S_OK; + + if (singleverb && !addConvert) { + WCHAR *str = CoTaskMemAlloc((strlenW(rootname) + strlenW(firstverb.lpszVerbName) + 2)*sizeof(WCHAR)); + + strcpyW(str, firstverb.lpszVerbName); + strcatW(str, spaceW); + strcatW(str, rootname); + + RemoveMenu(hMenu, uPos, MF_BYPOSITION); + InsertMenuW(hMenu, uPos, MF_BYPOSITION|MF_STRING, idmin, str); + CoTaskMemFree(firstverb.lpszVerbName); + CoTaskMemFree(rootname); + CoTaskMemFree(str); + IEnumOLEVERB_Release(enumverbs); + return TRUE; + } + + submenu = CreatePopupMenu(); + insert_verb_to_menu(submenu, idmin, &firstverb); + CoTaskMemFree(firstverb.lpszVerbName); + + if (!singleverb) { + insert_verb_to_menu(submenu, idmin, &verb); + CoTaskMemFree(verb.lpszVerbName); + } + + while (get_next_insertable_verb(enumverbs, idmin, idmax, &verb) == S_OK) { + insert_verb_to_menu(submenu, idmin, &verb); + CoTaskMemFree(verb.lpszVerbName); + } + + /* convert verb is at the bottom of a popup, separated from verbs */ + if (addConvert) { + LoadStringW(OLEDLG_hInstance, IDS_VERBMENU_CONVERT, resstrW, sizeof(resstrW)/sizeof(WCHAR)); + InsertMenuW(submenu, ~0, MF_BYPOSITION|MF_SEPARATOR, 0, NULL); + InsertMenuW(submenu, ~0, MF_BYPOSITION|MF_STRING, idConvert, resstrW); + } + + if (submenu) + *ret_submenu = submenu; + + /* now submenu is ready, add root entry to original menu, attach submenu */ + InsertMenuW(hMenu, uPos, MF_BYPOSITION|MF_POPUP|MF_STRING, (UINT_PTR)submenu, rootname); + IEnumOLEVERB_Release(enumverbs); + CoTaskMemFree(rootname); + return TRUE; } /*********************************************************************** Modified: trunk/reactos/dll/win32/oledlg/pastespl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/pastespl.…
============================================================================== --- trunk/reactos/dll/win32/oledlg/pastespl.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/pastespl.c [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -693,7 +693,7 @@ HRSRC hrsrc; if(name == NULL) return OLEUI_ERR_LPSZTEMPLATEINVALID; - hrsrc = FindResourceW(hInst, name, MAKEINTRESOURCEW(RT_DIALOG)); + hrsrc = FindResourceW(hInst, name, (LPWSTR)RT_DIALOG); if(!hrsrc) return OLEUI_ERR_FINDTEMPLATEFAILURE; dlg_templ = LoadResource(hInst, hrsrc); if(!dlg_templ) return OLEUI_ERR_LOADTEMPLATEFAILURE; Modified: trunk/reactos/dll/win32/oledlg/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oledlg/resource.…
============================================================================== --- trunk/reactos/dll/win32/oledlg/resource.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oledlg/resource.h [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -41,6 +41,10 @@ #define IDC_FILELBL 1010 #define IDC_FILE 1011 +/* String ids for verb menu */ +#define IDS_VERBMENU_CONVERT 0x130 +#define IDS_VERBMENU_OBJECT 0x135 + /* String ids for Paste Special */ #define IDS_PS_PASTE_DATA 0x190 #define IDS_PS_PASTE_OBJECT 0x191 Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Mon Jul 20 22:45:19 2015 @@ -149,7 +149,7 @@ reactos/dll/win32/oleacc # Synced to WineStaging-1.7.47 reactos/dll/win32/oleaut32 # Synced to WineStaging-1.7.47 reactos/dll/win32/olecli32 # Synced to WineStaging-1.7.37 -reactos/dll/win32/oledlg # Synced to WineStaging-1.7.37 +reactos/dll/win32/oledlg # Synced to WineStaging-1.7.47 reactos/dll/win32/olepro32 # Synced to WineStaging-1.7.37 reactos/dll/win32/olesvr32 # Synced to WineStaging-1.7.37 reactos/dll/win32/olethk32 # Synced to WineStaging-1.7.37
9 years, 5 months
1
0
0
0
[akhaldi] 68487: [OLEAUT32_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Jul 20 22:44:40 2015 New Revision: 68487 URL:
http://svn.reactos.org/svn/reactos?rev=68487&view=rev
Log: [OLEAUT32_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/rostests/winetests/oleaut32/safearray.c trunk/rostests/winetests/oleaut32/test_reg.idl trunk/rostests/winetests/oleaut32/test_tlb.idl trunk/rostests/winetests/oleaut32/typelib.c trunk/rostests/winetests/oleaut32/usrmarshal.c trunk/rostests/winetests/oleaut32/vartest.c trunk/rostests/winetests/oleaut32/vartype.c Modified: trunk/rostests/winetests/oleaut32/safearray.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/safear…
============================================================================== --- trunk/rostests/winetests/oleaut32/safearray.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/safearray.c [iso-8859-1] Mon Jul 20 22:44:40 2015 @@ -460,11 +460,15 @@ bound.lLbound = 0; SafeArrayRedim(a, &bound); SafeArrayPtrOfIndex(a, indices, (void **)&ptr1); - ok(*(WORD *)ptr1 == 0, "Expanded area not zero-initialized\n"); + ok(*(WORD *)ptr1 == 0 || + broken(*(WORD *)ptr1 != 0), /* Win 2003 */ + "Expanded area not zero-initialized\n"); indices[1] = 1; SafeArrayPtrOfIndex(a, indices, (void **)&ptr1); - ok(*(WORD *)ptr1 == 0x55aa, "Data not preserved when resizing array\n"); + ok(*(WORD *)ptr1 == 0x55aa || + broken(*(WORD *)ptr1 != 0x55aa), /* Win 2003 */ + "Data not preserved when resizing array\n"); hres = SafeArrayDestroy(a); ok(hres == S_OK,"SAD failed with hres %x\n", hres); @@ -709,7 +713,7 @@ return; for (i=0;i<sizeof(vttypes)/sizeof(vttypes[0]);i++) { - a = NULL; + a = NULL; hres = pSafeArrayAllocDescriptorEx(vttypes[i].vt,1,&a); ok(hres == S_OK, "SafeArrayAllocDescriptorEx gave hres 0x%x\n", hres); ok(a->fFeatures == vttypes[i].expflags,"SAADE(%d) resulted with flags %x, expected %x\n", vttypes[i].vt, a->fFeatures, vttypes[i].expflags); Modified: trunk/rostests/winetests/oleaut32/test_reg.idl URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/test_r…
============================================================================== --- trunk/rostests/winetests/oleaut32/test_reg.idl [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/test_reg.idl [iso-8859-1] Mon Jul 20 22:44:40 2015 @@ -142,4 +142,12 @@ [propputref, id(2)] LONG testprop2([in] IUnknown *i); } + + /* uuid is same as for test_struct2 in test_tlb.idl, fields are different */ + [uuid(4029f190-ca4a-4611-aeb9-673983cb96de)] + struct test_struct3 + { + UINT32 field; + HRESULT hr; + }; } Modified: trunk/rostests/winetests/oleaut32/test_tlb.idl URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/test_t…
============================================================================== --- trunk/rostests/winetests/oleaut32/test_tlb.idl [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/test_tlb.idl [iso-8859-1] Mon Jul 20 22:44:40 2015 @@ -48,4 +48,14 @@ IDispatch *disp; BSTR bstr; }; + + /* identical to 'test_struct', only guid is different */ + [uuid(4029f190-ca4a-4611-aeb9-673983cb96de)] + struct test_struct2 + { + HRESULT hr; + VARIANT_BOOL b; + IDispatch *disp; + BSTR bstr; + }; } Modified: trunk/rostests/winetests/oleaut32/typelib.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/typeli…
============================================================================== --- trunk/rostests/winetests/oleaut32/typelib.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/typelib.c [iso-8859-1] Mon Jul 20 22:44:40 2015 @@ -4008,6 +4008,11 @@ "test_struct", "{4029f190-ca4a-4611-aeb9-673983cb96dd}", /* kind */ TKIND_RECORD, /*flags*/ 0, /*align*/ 4, /*size*/ sizeof(struct test_struct) +}, +{ + "test_struct2", + "{4029f190-ca4a-4611-aeb9-673983cb96de}", + /* kind */ TKIND_RECORD, /*flags*/ 0, /*align*/ 4, /*size*/ sizeof(struct test_struct) } }; @@ -4216,7 +4221,7 @@ { TYPEKIND kind; WORD flags; - } attrs[12] = + } attrs[13] = { { TKIND_INTERFACE, 0 }, { TKIND_INTERFACE, TYPEFLAG_FDISPATCHABLE }, @@ -4229,7 +4234,8 @@ { TKIND_DISPATCH, TYPEFLAG_FDISPATCHABLE }, { TKIND_DISPATCH, TYPEFLAG_FDISPATCHABLE }, { TKIND_DISPATCH, TYPEFLAG_FDISPATCHABLE }, - { TKIND_INTERFACE, TYPEFLAG_FDISPATCHABLE } + { TKIND_INTERFACE, TYPEFLAG_FDISPATCHABLE }, + { TKIND_RECORD, 0 } }; trace("Starting %s typelib registration tests\n", @@ -4264,7 +4270,7 @@ ok(hr == S_OK, "got %08x\n", hr); count = ITypeLib_GetTypeInfoCount(typelib); - ok(count == 12, "got %d\n", count); + ok(count == 13, "got %d\n", count); for(i = 0; i < count; i++) { @@ -5500,6 +5506,7 @@ hr = IPSFactoryBuffer_CreateStub(factory, &interfaceguid, &uk, &base_stub); ok(hr == S_OK, "got: %x, side: %04x\n", hr, side); + IRpcStubBuffer_Release(base_stub); IPSFactoryBuffer_Release(factory); next: Modified: trunk/rostests/winetests/oleaut32/usrmarshal.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/usrmar…
============================================================================== --- trunk/rostests/winetests/oleaut32/usrmarshal.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/usrmarshal.c [iso-8859-1] Mon Jul 20 22:44:40 2015 @@ -195,11 +195,13 @@ static void * WINAPI user_allocate(SIZE_T size) { + ok(0, "unexpected user_allocate call\n"); return CoTaskMemAlloc(size); } static void WINAPI user_free(void *p) { + ok(0, "unexpected user_free call\n"); CoTaskMemFree(p); } @@ -716,29 +718,35 @@ HeapUnknown_Release }; -static void check_variant_header(DWORD *wirev, VARIANT *v, ULONG size) -{ - WORD *wp; +typedef struct +{ + DWORD clSize; + DWORD rpcReserved; + USHORT vt; + USHORT wReserved1; + USHORT wReserved2; + USHORT wReserved3; DWORD switch_is; - - ok(*wirev == (size + 7) >> 3, "wv[0] %08x, expected %08x\n", *wirev, (size + 7) >> 3); - wirev++; - ok(*wirev == 0, "wv[1] %08x\n", *wirev); - wirev++; - wp = (WORD*)wirev; - ok(*wp == V_VT(v), "vt %04x expected %04x\n", *wp, V_VT(v)); - wp++; - ok(*wp == V_U2(v).wReserved1, "res1 %04x expected %04x\n", *wp, V_U2(v).wReserved1); - wp++; - ok(*wp == V_U2(v).wReserved2, "res2 %04x expected %04x\n", *wp, V_U2(v).wReserved2); - wp++; - ok(*wp == V_U2(v).wReserved3, "res3 %04x expected %04x\n", *wp, V_U2(v).wReserved3); - wp++; - wirev = (DWORD*)wp; +} variant_wire_t; + +static DWORD *check_variant_header(DWORD *wirev, VARIANT *v, ULONG size) +{ + const variant_wire_t *header = (const variant_wire_t*)wirev; + DWORD switch_is; + + ok(header->clSize == (size + 7) >> 3, "wv[0] %08x, expected %08x\n", header->clSize, (size + 7) >> 3); + ok(header->rpcReserved == 0, "wv[1] %08x\n", header->rpcReserved); + ok(header->vt == V_VT(v), "vt %04x expected %04x\n", header->vt, V_VT(v)); + ok(header->wReserved1 == V_U2(v).wReserved1, "res1 %04x expected %04x\n", header->wReserved1, V_U2(v).wReserved1); + ok(header->wReserved2 == V_U2(v).wReserved2, "res2 %04x expected %04x\n", header->wReserved2, V_U2(v).wReserved2); + ok(header->wReserved3 == V_U2(v).wReserved3, "res3 %04x expected %04x\n", header->wReserved3, V_U2(v).wReserved3); + switch_is = V_VT(v); if(switch_is & VT_ARRAY) switch_is &= ~VT_TYPEMASK; - ok(*wirev == switch_is, "switch_is %08x expected %08x\n", *wirev, switch_is); + ok(header->switch_is == switch_is, "switch_is %08x expected %08x\n", header->switch_is, switch_is); + + return (DWORD*)((unsigned char*)wirev + sizeof(variant_wire_t)); } /* Win9x and WinME don't always align as needed. Variants have @@ -807,8 +815,7 @@ ok(next == buffer + stubMsg.BufferLength, "got %p expect %p\n", next, buffer + stubMsg.BufferLength); wirev = (DWORD*)buffer; - check_variant_header(wirev, &v, stubMsg.BufferLength); - wirev += 5; + wirev = check_variant_header(wirev, &v, stubMsg.BufferLength); ok(*(char*)wirev == V_I1(&v), "wv[5] %08x\n", *wirev); VariantInit(&v2); stubMsg.Buffer = buffer; @@ -834,8 +841,7 @@ ok(next == buffer + stubMsg.BufferLength, "got %p expect %p\n", next, buffer + stubMsg.BufferLength); wirev = (DWORD*)buffer; - check_variant_header(wirev, &v, stubMsg.BufferLength); - wirev += 5; + wirev = check_variant_header(wirev, &v, stubMsg.BufferLength); ok(*(short*)wirev == V_I2(&v), "wv[5] %08x\n", *wirev); VariantInit(&v2); stubMsg.Buffer = buffer; @@ -862,8 +868,7 @@ ok(next == buffer + stubMsg.BufferLength, "got %p expect %p\n", next, buffer + stubMsg.BufferLength); wirev = (DWORD*)buffer; - check_variant_header(wirev, &v, stubMsg.BufferLength); - wirev += 5; + wirev = check_variant_header(wirev, &v, stubMsg.BufferLength); ok(*wirev == 0x4, "wv[5] %08x\n", *wirev); wirev++; ok(*(short*)wirev == s, "wv[6] %08x\n", *wirev); @@ -894,8 +899,7 @@ ok(next == buffer + stubMsg.BufferLength, "got %p expect %p\n", next, buffer + stubMsg.BufferLength); wirev = (DWORD*)buffer; - check_variant_header(wirev, &v, stubMsg.BufferLength); - wirev += 5; + wirev = check_variant_header(wirev, &v, stubMsg.BufferLength); ok(*wirev == V_I4(&v), "wv[5] %08x\n", *wirev); VariantInit(&v2); @@ -922,8 +926,7 @@ ok(next == buffer + stubMsg.BufferLength, "got %p expect %p\n", next, buffer + stubMsg.BufferLength); wirev = (DWORD*)buffer; - check_variant_header(wirev, &v, stubMsg.BufferLength); - wirev += 5; + wirev = check_variant_header(wirev, &v, stubMsg.BufferLength); ok(*wirev == 0x1234, "wv[5] %08x\n", *wirev); VariantInit(&v2); stubMsg.Buffer = buffer; @@ -950,8 +953,7 @@ ok(next == buffer + stubMsg.BufferLength, "got %p expect %p\n", next, buffer + stubMsg.BufferLength); wirev = (DWORD*)buffer; - check_variant_header(wirev, &v, stubMsg.BufferLength); - wirev += 5; + wirev = check_variant_header(wirev, &v, stubMsg.BufferLength); ok(*wirev == 0x4, "wv[5] %08x\n", *wirev); wirev++; ok(*wirev == ul, "wv[6] %08x\n", *wirev); @@ -980,8 +982,7 @@ ok(next == buffer + stubMsg.BufferLength, "got %p expect %p\n", next, buffer + stubMsg.BufferLength); wirev = (DWORD*)buffer; - check_variant_header(wirev, &v, stubMsg.BufferLength); - wirev += 5; + wirev = check_variant_header(wirev, &v, stubMsg.BufferLength); ok(*(float*)wirev == V_R4(&v), "wv[5] %08x\n", *wirev); VariantInit(&v2); stubMsg.Buffer = buffer; @@ -1008,8 +1009,7 @@ ok(next == buffer + stubMsg.BufferLength, "got %p expect %p\n", next, buffer + stubMsg.BufferLength); wirev = (DWORD*)buffer; - check_variant_header(wirev, &v, stubMsg.BufferLength); - wirev += 5; + wirev = check_variant_header(wirev, &v, stubMsg.BufferLength); ok(*wirev == 0xcccccccc, "wv[5] %08x\n", *wirev); /* pad */ wirev++; ok(*(double*)wirev == V_R8(&v), "wv[6] %08x, wv[7] %08x\n", *wirev, *(wirev+1)); @@ -1038,8 +1038,7 @@ ok(next == buffer + stubMsg.BufferLength, "got %p expect %p\n", next, buffer + stubMsg.BufferLength); wirev = (DWORD*)buffer; - check_variant_header(wirev, &v, stubMsg.BufferLength); - wirev += 5; + wirev = check_variant_header(wirev, &v, stubMsg.BufferLength); ok(*wirev == 8, "wv[5] %08x\n", *wirev); wirev++; ok(*(double*)wirev == d, "wv[6] %08x wv[7] %08x\n", *wirev, *(wirev+1)); @@ -1067,8 +1066,7 @@ ok(next == buffer + stubMsg.BufferLength, "got %p expect %p\n", next, buffer + stubMsg.BufferLength); wirev = (DWORD*)buffer; - check_variant_header(wirev, &v, stubMsg.BufferLength); - wirev += 5; + wirev = check_variant_header(wirev, &v, stubMsg.BufferLength); ok(*(short*)wirev == V_BOOL(&v), "wv[5] %04x\n", *(WORD*)wirev); VariantInit(&v2); stubMsg.Buffer = buffer; @@ -1097,8 +1095,7 @@ ok(next == buffer + stubMsg.BufferLength, "got %p expect %p\n", next, buffer + stubMsg.BufferLength); wirev = (DWORD*)buffer; - check_variant_header(wirev, &v, stubMsg.BufferLength); - wirev += 5; + wirev = check_variant_header(wirev, &v, stubMsg.BufferLength); ok(*wirev == 0xcccccccc, "wirev[5] %08x\n", *wirev); /* pad */ wirev++; dec2 = dec; @@ -1129,8 +1126,7 @@ ok(next == buffer + stubMsg.BufferLength, "got %p expect %p\n", next, buffer + stubMsg.BufferLength); wirev = (DWORD*)buffer; - check_variant_header(wirev, &v, stubMsg.BufferLength); - wirev += 5; + wirev = check_variant_header(wirev, &v, stubMsg.BufferLength); ok(*wirev == 16, "wv[5] %08x\n", *wirev); wirev++; ok(!memcmp(wirev, &dec, sizeof(dec)), "wirev[6] %08x wirev[7] %08x wirev[8] %08x wirev[9] %08x\n", *wirev, *(wirev + 1), *(wirev + 2), *(wirev + 3)); @@ -1211,8 +1207,7 @@ ok(next == buffer + stubMsg.BufferLength, "got %p expect %p\n", next, buffer + stubMsg.BufferLength); wirev = (DWORD*)buffer; - check_variant_header(wirev, &v, stubMsg.BufferLength); - wirev += 5; + wirev = check_variant_header(wirev, &v, stubMsg.BufferLength); ok(*wirev, "wv[5] %08x\n", *wirev); /* win2k: this is b. winxp: this is (char*)b + 1 */ wirev++; check_bstr(wirev, V_BSTR(&v)); @@ -1240,8 +1235,7 @@ ok(next == buffer + stubMsg.BufferLength, "got %p expect %p\n", next, buffer + stubMsg.BufferLength); wirev = (DWORD*)buffer; - check_variant_header(wirev, &v, stubMsg.BufferLength); - wirev += 5; + wirev = check_variant_header(wirev, &v, stubMsg.BufferLength); ok(*wirev == 0x4, "wv[5] %08x\n", *wirev); wirev++; ok(*wirev, "wv[6] %08x\n", *wirev); /* win2k: this is b. winxp: this is (char*)b + 1 */ @@ -1281,8 +1275,7 @@ ok(next == buffer + expected, "got %p expect %p\n", next, buffer + expected); wirev = (DWORD*)buffer; - check_variant_header(wirev, &v, expected); - wirev += 5; + wirev = check_variant_header(wirev, &v, expected); ok(*wirev, "wv[5] %08x\n", *wirev); /* win2k: this is lpsa. winxp: this is (char*)lpsa + 1 */ wirev++; check_safearray(wirev, lpsa); @@ -1322,8 +1315,7 @@ ok(next == buffer + expected, "got %p expect %p\n", next, buffer + expected); wirev = (DWORD*)buffer; - check_variant_header(wirev, &v, expected); - wirev += 5; + wirev = check_variant_header(wirev, &v, expected); ok(*wirev == 4, "wv[5] %08x\n", *wirev); wirev++; ok(*wirev, "wv[6] %08x\n", *wirev); /* win2k: this is lpsa. winxp: this is (char*)lpsa + 1 */ @@ -1368,8 +1360,7 @@ next = VARIANT_UserMarshal(&umcb.Flags, buffer, &v); ok(next == buffer + stubMsg.BufferLength, "got %p expect %p\n", next, buffer + stubMsg.BufferLength); wirev = (DWORD*)buffer; - check_variant_header(wirev, &v, stubMsg.BufferLength); - wirev += 5; + wirev = check_variant_header(wirev, &v, stubMsg.BufferLength); ok(*wirev == sizeof(VARIANT), "wv[5] %08x\n", *wirev); wirev++; @@ -1377,8 +1368,7 @@ wirev++; ok(*wirev == 0xcccccccc, "wv[7] %08x\n", *wirev); /* pad */ wirev++; - check_variant_header(wirev, &v2, stubMsg.BufferLength - 32); - wirev += 5; + wirev = check_variant_header(wirev, &v2, stubMsg.BufferLength - 32); ok(*wirev == 0xcccccccc, "wv[13] %08x\n", *wirev); /* pad for VT_R8 */ wirev++; ok(*(double*)wirev == V_R8(&v2), "wv[6] %08x wv[7] %08x\n", *wirev, *(wirev+1)); @@ -1403,32 +1393,31 @@ V_UNKNOWN(&v) = &heap_unknown->IUnknown_iface; rpcMsg.BufferLength = stubMsg.BufferLength = VARIANT_UserSize(&umcb.Flags, 0, &v); - ok(stubMsg.BufferLength > 32, "size %d\n", stubMsg.BufferLength); + ok(stubMsg.BufferLength > 40, "size %d\n", stubMsg.BufferLength); buffer = rpcMsg.Buffer = stubMsg.Buffer = stubMsg.BufferStart = alloc_aligned(stubMsg.BufferLength, &oldbuffer); stubMsg.BufferEnd = stubMsg.Buffer + stubMsg.BufferLength; memset(buffer, 0xcc, stubMsg.BufferLength); next = VARIANT_UserMarshal(&umcb.Flags, buffer, &v); - wirev = (DWORD*)buffer; - check_variant_header(wirev, &v, next - buffer); - wirev += 5; - - todo_wine +todo_wine + ok(heap_unknown->refs == 2, "got refcount %d\n", heap_unknown->refs); + wirev = (DWORD*)buffer; + wirev = check_variant_header(wirev, &v, next - buffer); + ok(*wirev == (DWORD_PTR)V_UNKNOWN(&v) /* Win9x */ || *wirev == (DWORD_PTR)V_UNKNOWN(&v) + 1 /* NT */, "wv[5] %08x\n", *wirev); wirev++; - todo_wine ok(*wirev == next - buffer - 0x20, "wv[6] %08x\n", *wirev); wirev++; - todo_wine ok(*wirev == next - buffer - 0x20, "wv[7] %08x\n", *wirev); wirev++; - todo_wine ok(*wirev == 0x574f454d, "wv[8] %08x\n", *wirev); VariantInit(&v3); V_VT(&v3) = VT_UNKNOWN; V_UNKNOWN(&v3) = &heap_unknown->IUnknown_iface; IUnknown_AddRef(V_UNKNOWN(&v3)); stubMsg.Buffer = buffer; +todo_wine + ok(heap_unknown->refs == 3, "got refcount %d\n", heap_unknown->refs); next = VARIANT_UserUnmarshal(&umcb.Flags, buffer, &v3); ok(V_VT(&v) == V_VT(&v3), "got vt %d expect %d\n", V_VT(&v), V_VT(&v3)); ok(V_UNKNOWN(&v) == V_UNKNOWN(&v3), "got %p expect %p\n", V_UNKNOWN(&v), V_UNKNOWN(&v3)); @@ -1449,8 +1438,7 @@ memset(buffer, 0xcc, stubMsg.BufferLength); next = VARIANT_UserMarshal(&umcb.Flags, buffer, &v); wirev = (DWORD*)buffer; - check_variant_header(wirev, &v, next - buffer); - wirev += 5; + wirev = check_variant_header(wirev, &v, next - buffer); ok(*wirev == 0, "wv[5] %08x\n", *wirev); VariantInit(&v2); @@ -1471,28 +1459,26 @@ V_UNKNOWNREF(&v) = (IUnknown **)&heap_unknown; rpcMsg.BufferLength = stubMsg.BufferLength = VARIANT_UserSize(&umcb.Flags, 0, &v); - ok(stubMsg.BufferLength > 36, "size %d\n", stubMsg.BufferLength); + ok(stubMsg.BufferLength >= 44, "size %d\n", stubMsg.BufferLength); buffer = rpcMsg.Buffer = stubMsg.Buffer = stubMsg.BufferStart = alloc_aligned(stubMsg.BufferLength, &oldbuffer); stubMsg.BufferEnd = stubMsg.Buffer + stubMsg.BufferLength; memset(buffer, 0xcc, stubMsg.BufferLength); - next = VARIANT_UserMarshal(&umcb.Flags, buffer, &v); - wirev = (DWORD*)buffer; - check_variant_header(wirev, &v, next - buffer); - wirev += 5; + ok(heap_unknown->refs == 1, "got refcount %d\n", heap_unknown->refs); + next = VARIANT_UserMarshal(&umcb.Flags, buffer, &v); +todo_wine + ok(heap_unknown->refs == 2, "got refcount %d\n", heap_unknown->refs); + wirev = (DWORD*)buffer; + wirev = check_variant_header(wirev, &v, next - buffer); ok(*wirev == 4, "wv[5] %08x\n", *wirev); wirev++; - todo_wine ok(*wirev == (DWORD_PTR)heap_unknown /* Win9x, Win2000 */ || *wirev == (DWORD_PTR)heap_unknown + 1 /* XP */, "wv[6] %08x\n", *wirev); wirev++; - todo_wine ok(*wirev == next - buffer - 0x24, "wv[7] %08x\n", *wirev); wirev++; - todo_wine ok(*wirev == next - buffer - 0x24, "wv[8] %08x\n", *wirev); wirev++; - todo_wine ok(*wirev == 0x574f454d, "wv[9] %08x\n", *wirev); VariantInit(&v3); @@ -1501,6 +1487,7 @@ IUnknown_AddRef(V_UNKNOWN(&v3)); stubMsg.Buffer = buffer; next = VARIANT_UserUnmarshal(&umcb.Flags, buffer, &v3); + ok(heap_unknown->refs == 2, "got refcount %d\n", heap_unknown->refs); ok(V_VT(&v) == V_VT(&v3), "got vt %d expect %d\n", V_VT(&v), V_VT(&v3)); ok(*V_UNKNOWNREF(&v) == *V_UNKNOWNREF(&v3), "got %p expect %p\n", *V_UNKNOWNREF(&v), *V_UNKNOWNREF(&v3)); VARIANT_UserFree(&umcb.Flags, &v3); Modified: trunk/rostests/winetests/oleaut32/vartest.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/vartes…
============================================================================== --- trunk/rostests/winetests/oleaut32/vartest.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/vartest.c [iso-8859-1] Mon Jul 20 22:44:40 2015 @@ -7552,7 +7552,7 @@ } /* Determine return type */ - if (!(rightvt == VT_EMPTY)) + if (rightvt != VT_EMPTY) { if (leftvt == VT_NULL || rightvt == VT_NULL) resvt = VT_NULL; @@ -7581,7 +7581,7 @@ else if (leftvt == VT_R4 || rightvt == VT_R4) resvt = VT_R4; } - else if (leftvt == VT_NULL && rightvt == VT_EMPTY) + else if (leftvt == VT_NULL) resvt = VT_NULL; else bFail = TRUE; Modified: trunk/rostests/winetests/oleaut32/vartype.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/vartyp…
============================================================================== --- trunk/rostests/winetests/oleaut32/vartype.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/vartype.c [iso-8859-1] Mon Jul 20 22:44:40 2015 @@ -6323,6 +6323,11 @@ static const WCHAR testW[] = {'t','e','s','t',0}; + if (GetEnvironmentVariableA("OANOCACHE", NULL, 0)) { + skip("BSTR cache is disabled, some tests will be skipped.\n"); + return; + } + str = SysAllocString(testW); /* This should put the string into cache */ SysFreeString(str); @@ -6387,22 +6392,30 @@ { static const WCHAR testW[] = {'t','e','s','t',0}; static WCHAR teststructW[] = {'t','e','s','t','_','s','t','r','u','c','t',0}; + static WCHAR teststruct2W[] = {'t','e','s','t','_','s','t','r','u','c','t','2',0}; + static WCHAR teststruct3W[] = {'t','e','s','t','_','s','t','r','u','c','t','3',0}; + WCHAR filenameW[MAX_PATH], filename2W[MAX_PATH]; + ITypeInfo *typeinfo, *typeinfo2, *typeinfo3; + IRecordInfo *recinfo, *recinfo2, *recinfo3; struct test_struct teststruct, testcopy; - WCHAR filenameW[MAX_PATH]; + ITypeLib *typelib, *typelib2; const char *filename; - IRecordInfo *recinfo; - ITypeInfo *typeinfo; DummyDispatch dispatch; - ITypeLib *typelib; TYPEATTR *attr; MEMBERID memid; UINT16 found; HRESULT hr; ULONG size; + BOOL ret; filename = create_test_typelib(2); MultiByteToWideChar(CP_ACP, 0, filename, -1, filenameW, MAX_PATH); hr = LoadTypeLibEx(filenameW, REGKIND_NONE, &typelib); + ok(hr == S_OK, "got 0x%08x\n", hr); + + filename = create_test_typelib(3); + MultiByteToWideChar(CP_ACP, 0, filename, -1, filename2W, MAX_PATH); + hr = LoadTypeLibEx(filename2W, REGKIND_NONE, &typelib2); ok(hr == S_OK, "got 0x%08x\n", hr); typeinfo = NULL; @@ -6415,8 +6428,39 @@ ok(IsEqualGUID(&attr->guid, &UUID_test_struct), "got %s\n", wine_dbgstr_guid(&attr->guid)); ok(attr->typekind == TKIND_RECORD, "got %d\n", attr->typekind); + typeinfo2 = NULL; + found = 1; + hr = ITypeLib_FindName(typelib, teststruct2W, 0, &typeinfo2, &memid, &found); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(typeinfo2 != NULL, "got %p\n", typeinfo2); + + typeinfo3 = NULL; + found = 1; + hr = ITypeLib_FindName(typelib2, teststruct3W, 0, &typeinfo3, &memid, &found); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(typeinfo3 != NULL, "got %p\n", typeinfo3); + hr = GetRecordInfoFromTypeInfo(typeinfo, &recinfo); ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = GetRecordInfoFromTypeInfo(typeinfo2, &recinfo2); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = GetRecordInfoFromTypeInfo(typeinfo3, &recinfo3); + ok(hr == S_OK, "got 0x%08x\n", hr); + + /* IsMatchingType, these two records only differ in GUIDs */ + ret = IRecordInfo_IsMatchingType(recinfo, recinfo2); + ok(!ret, "got %d\n", ret); + + /* these two have same GUIDs, but different set of fields */ + ret = IRecordInfo_IsMatchingType(recinfo2, recinfo3); + ok(ret, "got %d\n", ret); + + IRecordInfo_Release(recinfo3); + ITypeInfo_Release(typeinfo3); + IRecordInfo_Release(recinfo2); + ITypeInfo_Release(typeinfo2); size = 0; hr = IRecordInfo_GetSize(recinfo, &size); @@ -6476,7 +6520,8 @@ ITypeInfo_Release(typeinfo); ITypeLib_Release(typelib); - DeleteFileA(filename); + DeleteFileW(filenameW); + DeleteFileW(filename2W); } START_TEST(vartype)
9 years, 5 months
1
0
0
0
[akhaldi] 68486: [OLEAUT32] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Jul 20 22:44:15 2015 New Revision: 68486 URL:
http://svn.reactos.org/svn/reactos?rev=68486&view=rev
Log: [OLEAUT32] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/reactos/dll/win32/oleaut32/connpt.c trunk/reactos/dll/win32/oleaut32/olepropframe.c trunk/reactos/dll/win32/oleaut32/recinfo.c trunk/reactos/dll/win32/oleaut32/tmarshal.c trunk/reactos/dll/win32/oleaut32/typelib.c trunk/reactos/dll/win32/oleaut32/usrmarshal.c trunk/reactos/dll/win32/oleaut32/varformat.c trunk/reactos/dll/win32/oleaut32/variant.c trunk/reactos/dll/win32/oleaut32/variant.h trunk/reactos/dll/win32/oleaut32/vartype.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/oleaut32/connpt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/connpt.…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/connpt.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/connpt.c [iso-8859-1] Mon Jul 20 22:44:15 2015 @@ -53,9 +53,6 @@ DWORD nSinks; } ConnectionPointImpl; -static const IConnectionPointVtbl ConnectionPointImpl_VTable; - - /************************************************************************ * Implementation of IEnumConnections */ @@ -89,26 +86,6 @@ static inline EnumConnectionsImpl *impl_from_IEnumConnections(IEnumConnections *iface) { return CONTAINING_RECORD(iface, EnumConnectionsImpl, IEnumConnections_iface); -} - -/************************************************************************ - * ConnectionPointImpl_Construct - */ -static ConnectionPointImpl *ConnectionPointImpl_Construct(IUnknown *pUnk, - REFIID riid) -{ - ConnectionPointImpl *Obj; - - Obj = HeapAlloc(GetProcessHeap(), 0, sizeof(*Obj)); - Obj->IConnectionPoint_iface.lpVtbl = &ConnectionPointImpl_VTable; - Obj->Obj = pUnk; - Obj->ref = 1; - Obj->iid = *riid; - Obj->maxSinks = MAXSINKS; - Obj->sinks = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(IUnknown*) * MAXSINKS); - Obj->nSinks = 0; - return Obj; } /************************************************************************ @@ -128,7 +105,6 @@ return; } -static ULONG WINAPI ConnectionPointImpl_AddRef(IConnectionPoint* iface); /************************************************************************ * ConnectionPointImpl_QueryInterface (IUnknown) * @@ -145,7 +121,7 @@ /* * Perform a sanity check on the parameters. */ - if ( (This==0) || (ppvObject==0) ) + if (!ppvObject) return E_INVALIDARG; /* @@ -153,28 +129,20 @@ */ *ppvObject = 0; - /* - * Compare the riid with the interface IDs implemented by this object. - */ - if (IsEqualIID(&IID_IUnknown, riid)) - *ppvObject = This; - else if (IsEqualIID(&IID_IConnectionPoint, riid)) - *ppvObject = This; + + if (IsEqualIID(&IID_IConnectionPoint, riid) || IsEqualIID(&IID_IUnknown, riid)) + *ppvObject = iface; /* * Check that we obtained an interface. */ if ((*ppvObject)==0) { - FIXME("() : asking for un supported interface %s\n",debugstr_guid(riid)); + FIXME("() : asking for unsupported interface %s\n", debugstr_guid(riid)); return E_NOINTERFACE; } - /* - * Query Interface always increases the reference count by one when it is - * successful - */ - ConnectionPointImpl_AddRef(&This->IConnectionPoint_iface); + IUnknown_AddRef((IUnknown*)*ppvObject); return S_OK; } @@ -330,9 +298,9 @@ /* Bump the ref count of this object up by one. It gets Released in IEnumConnections_Release */ - IUnknown_AddRef((IUnknown*)This); - - EnumObj = EnumConnectionsImpl_Construct((IUnknown*)This, This->nSinks, pCD); + IConnectionPoint_AddRef(iface); + + EnumObj = EnumConnectionsImpl_Construct((IUnknown*)iface, This->nSinks, pCD); hr = IEnumConnections_QueryInterface(&EnumObj->IEnumConnections_iface, &IID_IEnumConnections, (void**)ppEnum); IEnumConnections_Release(&EnumObj->IEnumConnections_iface); @@ -355,7 +323,6 @@ static const IEnumConnectionsVtbl EnumConnectionsImpl_VTable; -static ULONG WINAPI EnumConnectionsImpl_AddRef(IEnumConnections* iface); /************************************************************************ * EnumConnectionsImpl_Construct @@ -412,7 +379,7 @@ /* * Perform a sanity check on the parameters. */ - if ( (This==0) || (ppvObject==0) ) + if (!ppvObject) return E_INVALIDARG; /* @@ -420,28 +387,19 @@ */ *ppvObject = 0; - /* - * Compare the riid with the interface IDs implemented by this object. - */ - if (IsEqualIID(&IID_IUnknown, riid)) - *ppvObject = This; - else if (IsEqualIID(&IID_IEnumConnections, riid)) - *ppvObject = This; + if (IsEqualIID(&IID_IEnumConnections, riid) || IsEqualIID(&IID_IUnknown, riid)) + *ppvObject = iface; /* * Check that we obtained an interface. */ if ((*ppvObject)==0) { - FIXME("() : asking for un supported interface %s\n",debugstr_guid(riid)); + FIXME("() : asking for unsupported interface %s\n", debugstr_guid(riid)); return E_NOINTERFACE; } - /* - * Query Interface always increases the reference count by one when it is - * successful - */ - EnumConnectionsImpl_AddRef((IEnumConnections*)This); + IUnknown_AddRef((IUnknown*)*ppvObject); return S_OK; } @@ -568,7 +526,7 @@ newObj = EnumConnectionsImpl_Construct(This->pUnk, This->nConns, This->pCD); newObj->nCur = This->nCur; - *ppEnum = (LPENUMCONNECTIONS)newObj; + *ppEnum = &newObj->IEnumConnections_iface; IUnknown_AddRef(This->pUnk); return S_OK; } @@ -602,13 +560,22 @@ IConnectionPoint **pCP) { ConnectionPointImpl *Obj; - HRESULT hr; - - Obj = ConnectionPointImpl_Construct(pUnk, riid); - if(!Obj) return E_OUTOFMEMORY; - - hr = IConnectionPoint_QueryInterface(&Obj->IConnectionPoint_iface, - &IID_IConnectionPoint, (void**)pCP); - IConnectionPoint_Release(&Obj->IConnectionPoint_iface); - return hr; -} + + TRACE("(%p %s %p)\n", pUnk, debugstr_guid(riid), pCP); + + *pCP = NULL; + Obj = HeapAlloc(GetProcessHeap(), 0, sizeof(*Obj)); + if (!Obj) + return E_OUTOFMEMORY; + + Obj->IConnectionPoint_iface.lpVtbl = &ConnectionPointImpl_VTable; + Obj->Obj = pUnk; + Obj->ref = 1; + Obj->iid = *riid; + Obj->maxSinks = MAXSINKS; + Obj->sinks = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IUnknown*) * MAXSINKS); + Obj->nSinks = 0; + + *pCP = &Obj->IConnectionPoint_iface; + return S_OK; +} Modified: trunk/reactos/dll/win32/oleaut32/olepropframe.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/oleprop…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/olepropframe.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/olepropframe.c [iso-8859-1] Mon Jul 20 22:44:15 2015 @@ -201,6 +201,7 @@ if(property_sheet_dialog_data) { if(property_sheet_dialog_data[1] == 0xffff) { ERR("Expected DLGTEMPLATE structure\n"); + FreeLibrary(hcomctl); return E_OUTOFMEMORY; } Modified: trunk/reactos/dll/win32/oleaut32/recinfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/recinfo…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/recinfo.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/recinfo.c [iso-8859-1] Mon Jul 20 22:44:15 2015 @@ -503,12 +503,7 @@ TRACE( "(%p)->(%p)\n", This, info2 ); IRecordInfo_GetGuid( info2, &guid2 ); - if (IsEqualGUID( &This->guid, &guid2 )) return TRUE; - - FIXME( "records have different guids (%s %s) but could still match\n", - debugstr_guid( &This->guid ), debugstr_guid( &guid2 ) ); - - return FALSE; + return IsEqualGUID( &This->guid, &guid2 ); } static PVOID WINAPI IRecordInfoImpl_RecordCreate(IRecordInfo *iface) @@ -642,7 +637,12 @@ WARN("GetRefTypeInfo failed: %08x\n", hres); return hres; } - ITypeInfo_GetTypeAttr(pTypeInfo, &typeattr); + hres = ITypeInfo_GetTypeAttr(pTypeInfo, &typeattr); + if(FAILED(hres)) { + ITypeInfo_Release(pTypeInfo); + WARN("GetTypeAttr failed for referenced type: %08x\n", hres); + return hres; + } }else { pTypeInfo = pTI; ITypeInfo_AddRef(pTypeInfo); Modified: trunk/reactos/dll/win32/oleaut32/tmarshal.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/tmarsha…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/tmarshal.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/tmarshal.c [iso-8859-1] Mon Jul 20 22:44:15 2015 @@ -242,18 +242,71 @@ static ULONG WINAPI PSFacBuf_AddRef(LPPSFACTORYBUFFER iface) { return 2; } static ULONG WINAPI PSFacBuf_Release(LPPSFACTORYBUFFER iface) { return 1; } -static HRESULT -_get_typeinfo_for_iid(REFIID riid, ITypeInfo**ti) { - HRESULT hres; +struct ifacepsredirect_data +{ + ULONG size; + DWORD mask; + GUID iid; + ULONG nummethods; + GUID tlbid; + GUID base; + ULONG name_len; + ULONG name_offset; +}; + +struct tlibredirect_data +{ + ULONG size; + DWORD res; + ULONG name_len; + ULONG name_offset; + LANGID langid; + WORD flags; + ULONG help_len; + ULONG help_offset; + WORD major_version; + WORD minor_version; +}; + +static BOOL actctx_get_typelib_module(REFIID riid, WCHAR *module, DWORD len) +{ + struct ifacepsredirect_data *iface; + struct tlibredirect_data *tlib; + ACTCTX_SECTION_KEYED_DATA data; + WCHAR *ptrW; + + data.cbSize = sizeof(data); + if (!FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION, + riid, &data)) + return FALSE; + + iface = (struct ifacepsredirect_data*)data.lpData; + if (!FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION, + &iface->tlbid, &data)) + return FALSE; + + tlib = (struct tlibredirect_data*)data.lpData; + ptrW = (WCHAR*)((BYTE*)data.lpSectionBase + tlib->name_offset); + + if (tlib->name_len/sizeof(WCHAR) >= len) { + ERR("need larger module buffer, %u\n", tlib->name_len); + return FALSE; + } + + memcpy(module, ptrW, tlib->name_len); + module[tlib->name_len/sizeof(WCHAR)] = 0; + return TRUE; +} + +static HRESULT reg_get_typelib_module(REFIID riid, WCHAR *module, DWORD len) +{ HKEY ikey; REGSAM opposite = (sizeof(void*) == 8) ? KEY_WOW64_32KEY : KEY_WOW64_64KEY; BOOL is_wow64; char tlguid[200],typelibkey[300],interfacekey[300],ver[100]; char tlfn[260]; - OLECHAR tlfnW[260]; DWORD tlguidlen, verlen, type; LONG tlfnlen, err; - ITypeLib *tl; sprintf( interfacekey, "Interface\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\Typelib", riid->Data1, riid->Data2, riid->Data3, @@ -297,19 +350,37 @@ } #endif } - MultiByteToWideChar(CP_ACP, 0, tlfn, -1, tlfnW, sizeof(tlfnW) / sizeof(tlfnW[0])); - hres = LoadTypeLib(tlfnW,&tl); - if (hres) { + MultiByteToWideChar(CP_ACP, 0, tlfn, -1, module, len); + return S_OK; +} + +static HRESULT +_get_typeinfo_for_iid(REFIID riid, ITypeInfo **typeinfo) +{ + OLECHAR moduleW[260]; + ITypeLib *typelib; + HRESULT hres; + + *typeinfo = NULL; + + moduleW[0] = 0; + if (!actctx_get_typelib_module(riid, moduleW, sizeof(moduleW)/sizeof(moduleW[0]))) { + hres = reg_get_typelib_module(riid, moduleW, sizeof(moduleW)/sizeof(moduleW[0])); + if (FAILED(hres)) + return hres; + } + + hres = LoadTypeLib(moduleW, &typelib); + if (hres != S_OK) { ERR("Failed to load typelib for %s, but it should be there.\n",debugstr_guid(riid)); return hres; } - hres = ITypeLib_GetTypeInfoOfGuid(tl,riid,ti); - if (hres) { - ERR("typelib does not contain info for %s?\n",debugstr_guid(riid)); - ITypeLib_Release(tl); - return hres; - } - ITypeLib_Release(tl); + + hres = ITypeLib_GetTypeInfoOfGuid(typelib, riid, typeinfo); + ITypeLib_Release(typelib); + if (hres != S_OK) + ERR("typelib does not contain info for %s\n", debugstr_guid(riid)); + return hres; } @@ -1714,9 +1785,7 @@ /* nrofargs including This */ int nrofargs = 1; ITypeInfo *tinfo2; -#ifdef __i386__ TMAsmProxy *xasm = proxy->asmstubs + num; -#endif HRESULT hres; const FUNCDESC *fdesc; Modified: trunk/reactos/dll/win32/oleaut32/typelib.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/typelib…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/typelib.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/typelib.c [iso-8859-1] Mon Jul 20 22:44:15 2015 @@ -3393,18 +3393,27 @@ h = CreateFileW(pszPath, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if(h != INVALID_HANDLE_VALUE){ - FILE_NAME_INFORMATION *info; - char data[MAX_PATH * sizeof(WCHAR) + sizeof(info->FileNameLength)]; + FILE_NAME_INFORMATION size_info; BOOL br; - info = (FILE_NAME_INFORMATION*)data; /* GetFileInformationByHandleEx returns the path of the file without * WOW64 redirection */ - br = GetFileInformationByHandleEx(h, FileNameInfo, data, sizeof(data)); - if(br){ - info->FileName[info->FileNameLength / sizeof(WCHAR)] = 0; - lstrcpynW(pszPath + 2, info->FileName, cchPath - 2); - } + br = GetFileInformationByHandleEx(h, FileNameInfo, &size_info, sizeof(size_info)); + if(br || GetLastError() == ERROR_MORE_DATA){ + FILE_NAME_INFORMATION *info; + DWORD size = sizeof(*info) + size_info.FileNameLength + sizeof(WCHAR); + + info = HeapAlloc(GetProcessHeap(), 0, size); + + br = GetFileInformationByHandleEx(h, FileNameInfo, info, size); + if(br){ + info->FileName[info->FileNameLength / sizeof(WCHAR)] = 0; + lstrcpynW(pszPath + 2, info->FileName, cchPath - 2); + } + + HeapFree(GetProcessHeap(), 0, info); + } + CloseHandle(h); } @@ -6487,10 +6496,10 @@ "movq 8(%rsp),%rdx\n\t" "movq 16(%rsp),%r8\n\t" "movq 24(%rsp),%r9\n\t" - "movq %rcx,%xmm0\n\t" - "movq %rdx,%xmm1\n\t" - "movq %r8,%xmm2\n\t" - "movq %r9,%xmm3\n\t" + "movq 0(%rsp),%xmm0\n\t" + "movq 8(%rsp),%xmm1\n\t" + "movq 16(%rsp),%xmm2\n\t" + "movq 24(%rsp),%xmm3\n\t" "callq *%rax\n\t" "leaq -16(%rbp),%rsp\n\t" "popq %rdi\n\t" Modified: trunk/reactos/dll/win32/oleaut32/usrmarshal.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/usrmars…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/usrmarshal.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/usrmarshal.c [iso-8859-1] Mon Jul 20 22:44:15 2015 @@ -27,6 +27,11 @@ #define ALIGNED_POINTER(_Ptr, _Align) ((LPVOID)ALIGNED_LENGTH((ULONG_PTR)(_Ptr), _Align)) #define ALIGN_LENGTH(_Len, _Align) _Len = ALIGNED_LENGTH(_Len, _Align) #define ALIGN_POINTER(_Ptr, _Align) _Ptr = ALIGNED_POINTER(_Ptr, _Align) + +/* ole32 exports those, not defined in public headers */ +ULONG __RPC_USER WdtpInterfacePointer_UserSize(ULONG*, ULONG, ULONG, IUnknown*, REFIID); +unsigned char * __RPC_USER WdtpInterfacePointer_UserMarshal(ULONG*, ULONG, unsigned char*, IUnknown*, REFIID); +unsigned char * __RPC_USER WdtpInterfacePointer_UserUnmarshal(ULONG*, unsigned char*, IUnknown**, REFIID); static void dump_user_flags(const ULONG *pFlags) { @@ -239,21 +244,21 @@ return 7; } -static unsigned interface_variant_size(const ULONG *pFlags, REFIID riid, IUnknown *punk) +/* WdtpInterfacePointer_UserSize takes care of 2 additional DWORDs to store marshalling buffer size */ +static unsigned interface_variant_size(ULONG *pFlags, REFIID riid, IUnknown *punk) { ULONG size = 0; - HRESULT hr; if (punk) { - hr = CoGetMarshalSizeMax(&size, riid, punk, LOWORD(*pFlags), NULL, MSHLFLAGS_NORMAL); - if (FAILED(hr)) + size = WdtpInterfacePointer_UserSize(pFlags, LOWORD(*pFlags), 0, punk, riid); + if (!size) { - ERR("interface variant buffer size calculation failed, HRESULT=0x%x\n", hr); + ERR("interface variant buffer size calculation failed\n"); return 0; } } - size += sizeof(ULONG); /* we have to store the buffersize in the stream */ + size += sizeof(ULONG); TRACE("wire-size extra of interface variant is %d\n", size); return size; } @@ -295,115 +300,47 @@ } } -/* helper: called for VT_DISPATCH variants to marshal the IDispatch* into the buffer. returns Buffer on failure, new position otherwise */ -static unsigned char* interface_variant_marshal(const ULONG *pFlags, unsigned char *Buffer, +/* helper: called for VT_DISPATCH variants to marshal the IDispatch* into the buffer */ +static unsigned char* interface_variant_marshal(ULONG *pFlags, unsigned char *Buffer, REFIID riid, IUnknown *punk) { - IStream *working; - HGLOBAL working_mem; - void *working_memlocked; - unsigned char *oldpos; - ULONG size; - HRESULT hr; - TRACE("pFlags=%d, Buffer=%p, pUnk=%p\n", *pFlags, Buffer, punk); + /* first DWORD is used to store pointer itself, truncated on win64 */ if(!punk) { memset(Buffer, 0, sizeof(ULONG)); return Buffer + sizeof(ULONG); } - - oldpos = Buffer; - - /* CoMarshalInterface needs a stream, whereas at this level we are operating in terms of buffers. - * We create a stream on an HGLOBAL, so we can simply do a memcpy to move it to the buffer. - * in rpcrt4/ndr_ole.c, a simple IStream implementation is wrapped around the buffer object, - * but that would be overkill here, hence this implementation. We save the size because the unmarshal - * code has no way to know how long the marshalled buffer is. */ - - size = interface_variant_size(pFlags, riid, punk); - - working_mem = GlobalAlloc(0, size); - if (!working_mem) return oldpos; - - hr = CreateStreamOnHGlobal(working_mem, TRUE, &working); - if (hr != S_OK) { - GlobalFree(working_mem); - return oldpos; + else + { + *(DWORD*)Buffer = (DWORD_PTR)punk; + Buffer += sizeof(DWORD); } - - hr = CoMarshalInterface(working, riid, punk, LOWORD(*pFlags), NULL, MSHLFLAGS_NORMAL); - if (hr != S_OK) { - IStream_Release(working); /* this also releases the hglobal */ - return oldpos; - } - - working_memlocked = GlobalLock(working_mem); - memcpy(Buffer, &size, sizeof(ULONG)); /* copy the buffersize */ - memcpy(Buffer + sizeof(ULONG), working_memlocked, size - sizeof(ULONG)); - GlobalUnlock(working_mem); - - IStream_Release(working); - - /* size includes the ULONG for the size written above */ - TRACE("done, size=%d\n", size); - return Buffer + size; -} - -/* helper: called for VT_DISPATCH / VT_UNKNOWN variants to unmarshal the buffer. returns Buffer on failure, new position otherwise */ -static unsigned char *interface_variant_unmarshal(const ULONG *pFlags, unsigned char *Buffer, + + return WdtpInterfacePointer_UserMarshal(pFlags, LOWORD(*pFlags), Buffer, punk, riid); +} + +/* helper: called for VT_DISPATCH / VT_UNKNOWN variants to unmarshal the buffer */ +static unsigned char *interface_variant_unmarshal(ULONG *pFlags, unsigned char *Buffer, REFIID riid, IUnknown **ppunk) { - IStream *working; - HGLOBAL working_mem; - void *working_memlocked; - unsigned char *oldpos; - ULONG size; - HRESULT hr; + DWORD ptr; TRACE("pFlags=%d, Buffer=%p, ppUnk=%p\n", *pFlags, Buffer, ppunk); - oldpos = Buffer; - - /* get the buffersize */ - memcpy(&size, Buffer, sizeof(ULONG)); - TRACE("buffersize=%d\n", size); - - if(!size) + /* skip pointer part itself */ + ptr = *(DWORD*)Buffer; + Buffer += sizeof(DWORD); + + if(!ptr) { *ppunk = NULL; - return Buffer + sizeof(ULONG); + return Buffer; } - working_mem = GlobalAlloc(0, size); - if (!working_mem) return oldpos; - - hr = CreateStreamOnHGlobal(working_mem, TRUE, &working); - if (hr != S_OK) { - GlobalFree(working_mem); - return oldpos; - } - - working_memlocked = GlobalLock(working_mem); - - /* now we copy the contents of the marshalling buffer to working_memlocked, unlock it, and demarshal the stream */ - memcpy(working_memlocked, Buffer + sizeof(ULONG), size); - GlobalUnlock(working_mem); - - hr = CoUnmarshalInterface(working, riid, (void**)ppunk); - if (hr != S_OK) { - IStream_Release(working); - return oldpos; - } - - IStream_Release(working); /* this also frees the underlying hglobal */ - - /* size includes the ULONG for the size written above */ - TRACE("done, processed=%d bytes\n", size); - return Buffer + size; -} - + return WdtpInterfacePointer_UserUnmarshal(pFlags, Buffer, ppunk, riid); +} ULONG WINAPI VARIANT_UserSize(ULONG *pFlags, ULONG Start, VARIANT *pvar) { @@ -502,19 +439,15 @@ Pos = VARIANT_UserMarshal(pFlags, Pos, V_VARIANTREF(pvar)); break; case VT_UNKNOWN: - /* this should probably call WdtpInterfacePointer_UserMarshal in ole32.dll */ Pos = interface_variant_marshal(pFlags, Pos, &IID_IUnknown, V_UNKNOWN(pvar)); break; case VT_UNKNOWN | VT_BYREF: - /* this should probably call WdtpInterfacePointer_UserMarshal in ole32.dll */ Pos = interface_variant_marshal(pFlags, Pos, &IID_IUnknown, *V_UNKNOWNREF(pvar)); break; case VT_DISPATCH: - /* this should probably call WdtpInterfacePointer_UserMarshal in ole32.dll */ Pos = interface_variant_marshal(pFlags, Pos, &IID_IDispatch, (IUnknown*)V_DISPATCH(pvar)); break; case VT_DISPATCH | VT_BYREF: - /* this should probably call WdtpInterfacePointer_UserMarshal in ole32.dll */ Pos = interface_variant_marshal(pFlags, Pos, &IID_IDispatch, (IUnknown*)*V_DISPATCHREF(pvar)); break; case VT_RECORD: @@ -617,19 +550,15 @@ Pos = VARIANT_UserUnmarshal(pFlags, Pos, V_VARIANTREF(pvar)); break; case VT_UNKNOWN: - /* this should probably call WdtpInterfacePointer_UserUnmarshal in ole32.dll */ Pos = interface_variant_unmarshal(pFlags, Pos, &IID_IUnknown, &V_UNKNOWN(pvar)); break; case VT_UNKNOWN | VT_BYREF: - /* this should probably call WdtpInterfacePointer_UserUnmarshal in ole32.dll */ Pos = interface_variant_unmarshal(pFlags, Pos, &IID_IUnknown, V_UNKNOWNREF(pvar)); break; case VT_DISPATCH: - /* this should probably call WdtpInterfacePointer_UserUnmarshal in ole32.dll */ Pos = interface_variant_unmarshal(pFlags, Pos, &IID_IDispatch, (IUnknown**)&V_DISPATCH(pvar)); break; case VT_DISPATCH | VT_BYREF: - /* this should probably call WdtpInterfacePointer_UserUnmarshal in ole32.dll */ Pos = interface_variant_unmarshal(pFlags, Pos, &IID_IDispatch, (IUnknown**)V_DISPATCHREF(pvar)); break; case VT_RECORD: @@ -2256,8 +2185,14 @@ LPCONNECTDATA rgcd, ULONG *pcFetched) { - FIXME("not implemented\n"); - return E_NOTIMPL; + ULONG fetched; + + TRACE("(%u, %p %p)\n", cConnections, rgcd, pcFetched); + + if (!pcFetched) + pcFetched = &fetched; + + return IEnumConnections_RemoteNext_Proxy(This, cConnections, rgcd, pcFetched); } HRESULT __RPC_STUB IEnumConnections_Next_Stub( @@ -2266,28 +2201,50 @@ LPCONNECTDATA rgcd, ULONG *pcFetched) { - FIXME("not implemented\n"); - return E_NOTIMPL; + HRESULT hr; + + TRACE("(%u, %p, %p)\n", cConnections, rgcd, pcFetched); + + *pcFetched = 0; + hr = IEnumConnections_Next(This, cConnections, rgcd, pcFetched); + if (hr == S_OK) + *pcFetched = cConnections; + + return hr; } HRESULT CALLBACK IEnumConnectionPoints_Next_Proxy( IEnumConnectionPoints* This, ULONG cConnections, - LPCONNECTIONPOINT *ppCP, + IConnectionPoint **ppCP, ULONG *pcFetched) { - FIXME("not implemented\n"); - return E_NOTIMPL; + ULONG fetched; + + TRACE("(%u, %p %p)\n", cConnections, ppCP, pcFetched); + + if (!pcFetched) + pcFetched = &fetched; + + return IEnumConnectionPoints_RemoteNext_Proxy(This, cConnections, ppCP, pcFetched); } HRESULT __RPC_STUB IEnumConnectionPoints_Next_Stub( IEnumConnectionPoints* This, ULONG cConnections, - LPCONNECTIONPOINT *ppCP, + IConnectionPoint **ppCP, ULONG *pcFetched) { - FIXME("not implemented\n"); - return E_NOTIMPL; + HRESULT hr; + + TRACE("(%u, %p, %p)\n", cConnections, ppCP, pcFetched); + + *pcFetched = 0; + hr = IEnumConnectionPoints_Next(This, cConnections, ppCP, pcFetched); + if (hr == S_OK) + *pcFetched = cConnections; + + return hr; } HRESULT CALLBACK IPersistMemory_Load_Proxy( @@ -2295,8 +2252,12 @@ LPVOID pMem, ULONG cbSize) { - FIXME("not implemented\n"); - return E_NOTIMPL; + TRACE("(%p, %u)\n", pMem, cbSize); + + if (!pMem) + return E_POINTER; + + return IPersistMemory_RemoteLoad_Proxy(This, pMem, cbSize); } HRESULT __RPC_STUB IPersistMemory_Load_Stub( @@ -2304,8 +2265,8 @@ BYTE *pMem, ULONG cbSize) { - FIXME("not implemented\n"); - return E_NOTIMPL; + TRACE("(%p, %u)\n", pMem, cbSize); + return IPersistMemory_Load(This, pMem, cbSize); } HRESULT CALLBACK IPersistMemory_Save_Proxy( @@ -2314,8 +2275,12 @@ BOOL fClearDirty, ULONG cbSize) { - FIXME("not implemented\n"); - return E_NOTIMPL; + TRACE("(%p, %d, %u)\n", pMem, fClearDirty, cbSize); + + if (!pMem) + return E_POINTER; + + return IPersistMemory_RemoteSave_Proxy(This, pMem, fClearDirty, cbSize); } HRESULT __RPC_STUB IPersistMemory_Save_Stub( @@ -2324,23 +2289,25 @@ BOOL fClearDirty, ULONG cbSize) { - FIXME("not implemented\n"); - return E_NOTIMPL; + TRACE("(%p, %d, %u)\n", pMem, fClearDirty, cbSize); + return IPersistMemory_Save(This, pMem, fClearDirty, cbSize); } void CALLBACK IAdviseSinkEx_OnViewStatusChange_Proxy( IAdviseSinkEx* This, DWORD dwViewStatus) { - FIXME("not implemented\n"); + TRACE("(%p, 0x%08x)\n", This, dwViewStatus); + IAdviseSinkEx_RemoteOnViewStatusChange_Proxy(This, dwViewStatus); } HRESULT __RPC_STUB IAdviseSinkEx_OnViewStatusChange_Stub( IAdviseSinkEx* This, DWORD dwViewStatus) { - FIXME("not implemented\n"); - return E_NOTIMPL; + TRACE("(%p, 0x%08x)\n", This, dwViewStatus); + IAdviseSinkEx_OnViewStatusChange(This, dwViewStatus); + return S_OK; } HRESULT CALLBACK IEnumOleUndoUnits_Next_Proxy( @@ -2349,8 +2316,14 @@ IOleUndoUnit **rgElt, ULONG *pcEltFetched) { - FIXME("not implemented\n"); - return E_NOTIMPL; + ULONG fetched; + + TRACE("(%u, %p %p)\n", cElt, rgElt, pcEltFetched); + + if (!pcEltFetched) + pcEltFetched = &fetched; + + return IEnumOleUndoUnits_RemoteNext_Proxy(This, cElt, rgElt, pcEltFetched); } HRESULT __RPC_STUB IEnumOleUndoUnits_Next_Stub( @@ -2359,8 +2332,16 @@ IOleUndoUnit **rgElt, ULONG *pcEltFetched) { - FIXME("not implemented\n"); - return E_NOTIMPL; + HRESULT hr; + + TRACE("(%u, %p, %p)\n", cElt, rgElt, pcEltFetched); + + *pcEltFetched = 0; + hr = IEnumOleUndoUnits_Next(This, cElt, rgElt, pcEltFetched); + if (hr == S_OK) + *pcEltFetched = cElt; + + return hr; } HRESULT CALLBACK IQuickActivate_QuickActivate_Proxy( Modified: trunk/reactos/dll/win32/oleaut32/varformat.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/varform…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/varformat.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/varformat.c [iso-8859-1] Mon Jul 20 22:44:15 2015 @@ -270,8 +270,6 @@ #define FMT_NUM_ON_OFF 0x3F /* Convert to "On" or "Off" */ #define FMT_STR_COPY_SPACE 0x40 /* Copy len chars with space if no char */ #define FMT_STR_COPY_SKIP 0x41 /* Copy len chars or skip if no char */ -/* Wine additions */ -#define FMT_WINE_HOURS_12 0x81 /* Hours using 12 hour clock */ /* Named Formats and their tokenised values */ static const WCHAR szGeneralDate[] = { 'G','e','n','e','r','a','l',' ','D','a','t','e','\0' }; Modified: trunk/reactos/dll/win32/oleaut32/variant.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/variant…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/variant.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/variant.c [iso-8859-1] Mon Jul 20 22:44:15 2015 @@ -3930,9 +3930,6 @@ break; case VT_I2: V_I2(result) = V_I2(&lv) - V_I2(&rv); - break; - case VT_I1: - V_I1(result) = V_I1(&lv) - V_I1(&rv); break; case VT_UI1: V_UI1(result) = V_UI2(&lv) - V_UI1(&rv); Modified: trunk/reactos/dll/win32/oleaut32/variant.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/variant…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/variant.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/variant.h [iso-8859-1] Mon Jul 20 22:44:15 2015 @@ -112,7 +112,7 @@ WCHAR cCurrencyDigitSeparator; } VARIANT_NUMBER_CHARS; -unsigned int get_type_size(ULONG*, VARTYPE); +unsigned int get_type_size(ULONG*, VARTYPE) DECLSPEC_HIDDEN; BOOL VARIANT_GetLocalisedText(LANGID, DWORD, WCHAR *) DECLSPEC_HIDDEN; HRESULT VARIANT_ClearInd(VARIANTARG *) DECLSPEC_HIDDEN; BOOL get_date_format(LCID, DWORD, const SYSTEMTIME *, Modified: trunk/reactos/dll/win32/oleaut32/vartype.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/vartype…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/vartype.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/vartype.c [iso-8859-1] Mon Jul 20 22:44:15 2015 @@ -4137,8 +4137,6 @@ } return S_OK; } - -#define LOCALE_EN_US (MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT)) /* internal representation of the value stored in a DECIMAL. The bytes are stored from LSB at index 0 to MSB at index 11 Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Mon Jul 20 22:44:15 2015 @@ -147,7 +147,7 @@ reactos/dll/win32/odbccp32 # Synced to WineStaging-1.7.47 reactos/dll/win32/ole32 # Synced to WineStaging-1.7.47 reactos/dll/win32/oleacc # Synced to WineStaging-1.7.47 -reactos/dll/win32/oleaut32 # Synced to WineStaging-1.7.37 +reactos/dll/win32/oleaut32 # Synced to WineStaging-1.7.47 reactos/dll/win32/olecli32 # Synced to WineStaging-1.7.37 reactos/dll/win32/oledlg # Synced to WineStaging-1.7.37 reactos/dll/win32/olepro32 # Synced to WineStaging-1.7.37
9 years, 5 months
1
0
0
0
[tfaber] 68485: [C++] - Make <cmath> functions available in top-level namespace. Fixes stlport build with VS2015. - Remove unused __cmath_power and __pow_helper
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Jul 20 22:35:06 2015 New Revision: 68485 URL:
http://svn.reactos.org/svn/reactos?rev=68485&view=rev
Log: [C++] - Make <cmath> functions available in top-level namespace. Fixes stlport build with VS2015. - Remove unused __cmath_power and __pow_helper Modified: trunk/reactos/include/c++/cmath Modified: trunk/reactos/include/c++/cmath URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/c%2B%2B/cmath?rev=…
============================================================================== --- trunk/reactos/include/c++/cmath [iso-8859-1] (original) +++ trunk/reactos/include/c++/cmath [iso-8859-1] Mon Jul 20 22:35:06 2015 @@ -31,263 +31,229 @@ #undef tan #undef tanh +inline double +abs(double __x) +{ return fabs(__x); } + +inline float +abs(float __x) +{ return fabsf(__x); } + +inline long double +abs(long double __x) +{ return fabsl(__x); } + +inline float +acos(float __x) +{ return acosf(__x); } + +inline long double +acos(long double __x) +{ return acosl(__x); } + +inline float +asin(float __x) +{ return asinf(__x); } + +inline long double +asin(long double __x) +{ return asinl(__x); } + +inline float +atan(float __x) +{ return atanf(__x); } + +inline long double +atan(long double __x) +{ return atanl(__x); } + +inline float +atan2(float __y, float __x) +{ return atan2f(__y, __x); } + +inline long double +atan2(long double __y, long double __x) +{ return atan2l(__y, __x); } + +inline float +ceil(float __x) +{ return ceilf(__x); } + +inline long double +ceil(long double __x) +{ return ceill(__x); } + +inline float +cos(float __x) +{ return cosf(__x); } + +inline long double +cos(long double __x) +{ return cosl(__x); } + +inline float +cosh(float __x) +{ return coshf(__x); } + +inline long double +cosh(long double __x) +{ return coshl(__x); } + +inline float +exp(float __x) +{ return expf(__x); } + +inline long double +exp(long double __x) +{ return expl(__x); } + +inline float +fabs(float __x) +{ return fabsf(__x); } + +inline long double +fabs(long double __x) +{ return fabsl(__x); } + +inline float +floor(float __x) +{ return floorf(__x); } + +inline long double +floor(long double __x) +{ return floorl(__x); } + +inline float +fmod(float __x, float __y) +{ return fmodf(__x, __y); } + +inline long double +fmod(long double __x, long double __y) +{ return fmodl(__x, __y); } + +inline float +frexp(float __x, int* __exp) +{ return frexpf(__x, __exp); } + +inline long double +frexp(long double __x, int* __exp) +{ return frexpl(__x, __exp); } + +inline float +ldexp(float __x, int __exp) +{ return ldexpf(__x, __exp); } + +inline long double +ldexp(long double __x, int __exp) +{ return ldexpl(__x, __exp); } + +inline float +log(float __x) +{ return logf(__x); } + +inline long double +log(long double __x) +{ return logl(__x); } + +inline float +log10(float __x) +{ return log10f(__x); } + +inline long double +log10(long double __x) +{ return log10l(__x); } + +inline float +modf(float __x, float* __iptr) +{ return modff(__x, __iptr); } + +inline long double +modf(long double __x, long double* __iptr) +{ return modfl(__x, __iptr); } + +inline float +pow(float __x, float __y) +{ return powf(__x, __y); } + +inline long double +pow(long double __x, long double __y) +{ return powl(__x, __y); } + +inline double +pow(double __x, int __i) +{ return pow(__x, static_cast<double>(__i)); } + +inline float +pow(float __x, int __n) +{ return powf(__x, static_cast<float>(__n)); } + +inline long double +pow(long double __x, int __n) +{ return powl(__x, static_cast<long double>(__n)); } + +inline float +sin(float __x) +{ return sinf(__x); } + +inline long double +sin(long double __x) +{ return sinl(__x); } + +inline float +sinh(float __x) +{ return sinhf(__x); } + +inline long double +sinh(long double __x) +{ return sinhl(__x); } + +inline float +sqrt(float __x) +{ return sqrtf(__x); } + +inline long double +sqrt(long double __x) +{ return sqrtl(__x); } + +inline float +tan(float __x) +{ return tanf(__x); } + +inline long double +tan(long double __x) +{ return tanl(__x); } + +inline float +tanh(float __x) +{ return tanhf(__x); } + +inline long double +tanh(long double __x) +{ return tanhl(__x); } + namespace std { - // Forward declaration of a helper function. This really should be - // an `exported' forward declaration. - template<typename _Tp> - _Tp __cmath_power(_Tp, unsigned int); - - template<typename _Tp> - inline _Tp - __pow_helper(_Tp __x, int __n) - { - return __n < 0 - ? _Tp(1)/__cmath_power(__x, -__n) - : __cmath_power(__x, __n); - } - - inline double - abs(double __x) - { return fabs(__x); } - - inline float - abs(float __x) - { return fabsf(__x); } - - inline long double - abs(long double __x) - { return fabsl(__x); } - + using ::abs; using ::acos; - - inline float - acos(float __x) - { return acosf(__x); } - - inline long double - acos(long double __x) - { return acosl(__x); } - using ::asin; - - inline float - asin(float __x) - { return asinf(__x); } - - inline long double - asin(long double __x) - { return asinl(__x); } - using ::atan; - - inline float - atan(float __x) - { return atanf(__x); } - - inline long double - atan(long double __x) - { return atanl(__x); } - using ::atan2; - - inline float - atan2(float __y, float __x) - { return atan2f(__y, __x); } - - inline long double - atan2(long double __y, long double __x) - { return atan2l(__y, __x); } - using ::ceil; - - inline float - ceil(float __x) - { return ceilf(__x); } - - inline long double - ceil(long double __x) - { return ceill(__x); } - using ::cos; - - inline float - cos(float __x) - { return cosf(__x); } - - inline long double - cos(long double __x) - { return cosl(__x); } - using ::cosh; - - inline float - cosh(float __x) - { return coshf(__x); } - - inline long double - cosh(long double __x) - { return coshl(__x); } - using ::exp; - - inline float - exp(float __x) - { return expf(__x); } - - inline long double - exp(long double __x) - { return expl(__x); } - using ::fabs; - - inline float - fabs(float __x) - { return fabsf(__x); } - - inline long double - fabs(long double __x) - { return fabsl(__x); } - using ::floor; - - inline float - floor(float __x) - { return floorf(__x); } - - inline long double - floor(long double __x) - { return floorl(__x); } - using ::fmod; - - inline float - fmod(float __x, float __y) - { return fmodf(__x, __y); } - - inline long double - fmod(long double __x, long double __y) - { return fmodl(__x, __y); } - using ::frexp; - - inline float - frexp(float __x, int* __exp) - { return frexpf(__x, __exp); } - - inline long double - frexp(long double __x, int* __exp) - { return frexpl(__x, __exp); } - using ::ldexp; - - inline float - ldexp(float __x, int __exp) - { return ldexpf(__x, __exp); } - - inline long double - ldexp(long double __x, int __exp) - { return ldexpl(__x, __exp); } - using ::log; - - inline float - log(float __x) - { return logf(__x); } - - inline long double - log(long double __x) - { return logl(__x); } - using ::log10; - - inline float - log10(float __x) - { return log10f(__x); } - - inline long double - log10(long double __x) - { return log10l(__x); } - using ::modf; - - inline float - modf(float __x, float* __iptr) - { return modff(__x, __iptr); } - - inline long double - modf(long double __x, long double* __iptr) - { return modfl(__x, __iptr); } - using ::pow; - - inline float - pow(float __x, float __y) - { return powf(__x, __y); } - - inline long double - pow(long double __x, long double __y) - { return powl(__x, __y); } - - inline double - pow(double __x, int __i) - { return pow(__x, static_cast<double>(__i)); } - - inline float - pow(float __x, int __n) - { return powf(__x, static_cast<float>(__n)); } - - inline long double - pow(long double __x, int __n) - { return powl(__x, static_cast<long double>(__n)); } - using ::sin; - - inline float - sin(float __x) - { return sinf(__x); } - - inline long double - sin(long double __x) - { return sinl(__x); } - using ::sinh; - - inline float - sinh(float __x) - { return sinhf(__x); } - - inline long double - sinh(long double __x) - { return sinhl(__x); } - using ::sqrt; - - inline float - sqrt(float __x) - { return sqrtf(__x); } - - inline long double - sqrt(long double __x) - { return sqrtl(__x); } - using ::tan; - - inline float - tan(float __x) - { return tanf(__x); } - - inline long double - tan(long double __x) - { return tanl(__x); } - using ::tanh; - - inline float - tanh(float __x) - { return tanhf(__x); } - - inline long double - tanh(long double __x) - { return tanhl(__x); } }
9 years, 5 months
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
13
...
26
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
Results per page:
10
25
50
100
200