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 2016
----- 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
18 participants
358 discussions
Start a n
N
ew thread
[akhaldi] 71736: [VBSCRIPT] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jul 2 13:09:58 2016 New Revision: 71736 URL:
http://svn.reactos.org/svn/reactos?rev=71736&view=rev
Log: [VBSCRIPT] Sync with Wine Staging 1.9.11. CORE-11368 Modified: trunk/reactos/dll/win32/vbscript/global.c trunk/reactos/dll/win32/vbscript/vbdisp.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/vbscript/global.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/vbscript/global.…
============================================================================== --- trunk/reactos/dll/win32/vbscript/global.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/vbscript/global.c [iso-8859-1] Sat Jul 2 13:09:58 2016 @@ -21,8 +21,6 @@ #include <math.h> #include <wingdi.h> #include <mshtmhst.h> - -#define round(x) (((x) < 0) ? (int)((x) - 0.5) : (int)((x) + 0.5)) #define VB_E_CANNOT_CREATE_OBJ 0x800a01ad #define VB_E_MK_PARSE_ERROR 0x800a01b0 Modified: trunk/reactos/dll/win32/vbscript/vbdisp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/vbscript/vbdisp.…
============================================================================== --- trunk/reactos/dll/win32/vbscript/vbdisp.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/vbscript/vbdisp.c [iso-8859-1] Sat Jul 2 13:09:58 2016 @@ -549,7 +549,7 @@ static inline vbdisp_t *unsafe_impl_from_IDispatch(IDispatch *iface) { return iface->lpVtbl == (IDispatchVtbl*)&DispatchExVtbl - ? CONTAINING_RECORD(iface, vbdisp_t, IDispatchEx_iface) + ? CONTAINING_RECORD((IDispatchEx *)iface, vbdisp_t, IDispatchEx_iface) : NULL; } 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] Sat Jul 2 13:09:58 2016 @@ -195,7 +195,7 @@ reactos/dll/win32/urlmon # Synced to WineStaging-1.9.4 reactos/dll/win32/usp10 # Synced to WineStaging-1.9.11 reactos/dll/win32/uxtheme # Forked -reactos/dll/win32/vbscript # Synced to WineStaging-1.9.4 +reactos/dll/win32/vbscript # Synced to WineStaging-1.9.11 reactos/dll/win32/version # Synced to WineStaging-1.9.11 reactos/dll/win32/vssapi # Synced to WineStaging-1.9.4 reactos/dll/win32/wbemdisp # Synced to WineStaging-1.9.4
8 years, 5 months
1
0
0
0
[akhaldi] 71735: [WBEMPROX_WINETEST] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jul 2 13:07:46 2016 New Revision: 71735 URL:
http://svn.reactos.org/svn/reactos?rev=71735&view=rev
Log: [WBEMPROX_WINETEST] Sync with Wine Staging 1.9.11. CORE-11368 Modified: trunk/rostests/winetests/wbemprox/query.c trunk/rostests/winetests/wbemprox/services.c Modified: trunk/rostests/winetests/wbemprox/query.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wbemprox/query.…
============================================================================== --- trunk/rostests/winetests/wbemprox/query.c [iso-8859-1] (original) +++ trunk/rostests/winetests/wbemprox/query.c [iso-8859-1] Sat Jul 2 13:07:46 2016 @@ -147,6 +147,29 @@ SysFreeString( query ); } +static void test_associators( IWbemServices *services ) +{ + static const WCHAR query1[] = + {'A','S','S','O','C','I','A','T','O','R','S',' ','O','F',' ','{','W','i','n','3','2','_', + 'L','o','g','i','c','a','l','D','i','s','k','.','D','e','v','i','c','e','I','D','=','"','C',':','"','}',0}; + static const WCHAR query2[] = + {'A','S','S','O','C','I','A','T','O','R','S',' ','O','F',' ','{','W','i','n','3','2','_', + 'L','o','g','i','c','a','l','D','i','s','k','.','D','e','v','i','c','e','I','D','=','"','C',':','"','}',' ', + 'W','H','E','R','E',' ','A','s','s','o','c','C','l','a','s','s',' ','=',' ','W','i','n','3','2','_', + 'L','o','g','i','c','a','l','D','i','s','k','T','o','P','a','r','t','i','t','i','o','n',0}; + static const WCHAR *test[] = { query1, query2 }; + HRESULT hr; + IEnumWbemClassObject *result; + UINT i; + + for (i = 0; i < sizeof(test)/sizeof(test[0]); i++) + { + hr = exec_query( services, test[i], &result ); + todo_wine ok( hr == S_OK, "query %u failed: %08x\n", i, hr ); + if (result) IEnumWbemClassObject_Release( result ); + } +} + static void test_Win32_Service( IWbemServices *services ) { static const WCHAR returnvalueW[] = {'R','e','t','u','r','n','V','a','l','u','e',0}; @@ -1054,6 +1077,7 @@ ok( hr == S_OK, "failed to set proxy blanket %08x\n", hr ); test_select( services ); + test_associators( services ); test_Win32_Bios( services ); test_Win32_Process( services ); test_Win32_Service( services ); Modified: trunk/rostests/winetests/wbemprox/services.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wbemprox/servic…
============================================================================== --- trunk/rostests/winetests/wbemprox/services.c [iso-8859-1] (original) +++ trunk/rostests/winetests/wbemprox/services.c [iso-8859-1] Sat Jul 2 13:07:46 2016 @@ -168,10 +168,7 @@ { resource = SysAllocString( test[i].path ); hr = IWbemLocator_ConnectServer( locator, resource, NULL, NULL, NULL, 0, NULL, NULL, &services ); - if (test[i].todo) todo_wine - ok( hr == test[i].result || broken(hr == test[i].result_broken), - "%u: expected %08x got %08x\n", i, test[i].result, hr ); - else + todo_wine_if (test[i].todo) ok( hr == test[i].result || broken(hr == test[i].result_broken), "%u: expected %08x got %08x\n", i, test[i].result, hr ); SysFreeString( resource );
8 years, 5 months
1
0
0
0
[akhaldi] 71734: [WBEMPROX] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jul 2 13:06:47 2016 New Revision: 71734 URL:
http://svn.reactos.org/svn/reactos?rev=71734&view=rev
Log: [WBEMPROX] Sync with Wine Staging 1.9.11. CORE-11368 Modified: trunk/reactos/dll/win32/wbemprox/builtin.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/wbemprox/builtin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wbemprox/builtin…
============================================================================== --- trunk/reactos/dll/win32/wbemprox/builtin.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wbemprox/builtin.c [iso-8859-1] Sat Jul 2 13:06:47 2016 @@ -220,6 +220,8 @@ {'L','o','c','a','l','D','a','t','e','T','i','m','e',0}; static const WCHAR prop_localeW[] = {'L','o','c','a','l','e',0}; +static const WCHAR prop_locationW[] = + {'L','o','c','a','t','i','o','n',0}; static const WCHAR prop_lockpresentW[] = {'L','o','c','k','P','r','e','s','e','n','t',0}; static const WCHAR prop_macaddressW[] = @@ -262,6 +264,8 @@ {'P','i','x','e','l','s','P','e','r','X','L','o','g','i','c','a','l','I','n','c','h',0}; static const WCHAR prop_pnpdeviceidW[] = {'P','N','P','D','e','v','i','c','e','I','D',0}; +static const WCHAR prop_portnameW[] = + {'P','o','r','t','N','a','m','e',0}; static const WCHAR prop_pprocessidW[] = {'P','a','r','e','n','t','P','r','o','c','e','s','s','I','D',0}; static const WCHAR prop_primaryW[] = @@ -526,7 +530,10 @@ { prop_horizontalresolutionW, CIM_UINT32 }, { prop_localW, CIM_BOOLEAN }, { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC }, - { prop_networkW, CIM_BOOLEAN } + { prop_networkW, CIM_BOOLEAN }, + { prop_deviceidW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, + { prop_portnameW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_locationW, CIM_STRING|COL_FLAG_DYNAMIC }, }; static const struct column col_process[] = { @@ -923,6 +930,9 @@ int local; const WCHAR *name; int network; + const WCHAR *device_id; + const WCHAR *portname; + const WCHAR *location; }; struct record_process { @@ -2268,10 +2278,12 @@ static enum fill_status fill_printer( struct table *table, const struct expr *cond ) { + static const WCHAR fmtW[] = {'P','r','i','n','t','e','r','%','d',0}; struct record_printer *rec; enum fill_status status = FILL_STATUS_UNFILTERED; PRINTER_INFO_2W *info; DWORD i, offset = 0, count = 0, size = 0; + WCHAR id[20]; EnumPrintersW( PRINTER_ENUM_LOCAL, NULL, 2, NULL, 0, &size, &count ); if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) return FILL_STATUS_FAILED; @@ -2297,6 +2309,10 @@ rec->local = -1; rec->name = heap_strdupW( info[i].pPrinterName ); rec->network = 0; + sprintfW( id, fmtW, i ); + rec->device_id = heap_strdupW( id ); + rec->portname = heap_strdupW( info[i].pPortName ); + rec->location = heap_strdupW( info[i].pLocation ); if (!match_row( table, i, cond, &status )) { free_row_values( table, i ); 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] Sat Jul 2 13:06:47 2016 @@ -199,7 +199,7 @@ reactos/dll/win32/version # Synced to WineStaging-1.9.11 reactos/dll/win32/vssapi # Synced to WineStaging-1.9.4 reactos/dll/win32/wbemdisp # Synced to WineStaging-1.9.4 -reactos/dll/win32/wbemprox # Synced to WineStaging-1.9.4 +reactos/dll/win32/wbemprox # Synced to WineStaging-1.9.11 reactos/dll/win32/windowscodecs # Synced to WineStaging-1.9.4 reactos/dll/win32/windowscodecsext # Synced to WineStaging-1.9.4 reactos/dll/win32/winemp3.acm # Synced to WineStaging-1.9.4
8 years, 5 months
1
0
0
0
[akhaldi] 71733: [WINSCARD] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jul 2 13:05:27 2016 New Revision: 71733 URL:
http://svn.reactos.org/svn/reactos?rev=71733&view=rev
Log: [WINSCARD] Sync with Wine Staging 1.9.11. CORE-11368 Modified: trunk/reactos/dll/win32/winscard/winscard.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/winscard/winscard.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winscard/winscar…
============================================================================== --- trunk/reactos/dll/win32/winscard/winscard.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/winscard/winscard.c [iso-8859-1] Sat Jul 2 13:05:27 2016 @@ -124,14 +124,14 @@ FIXME("stub\n"); } -LONG WINAPI SCardListReadersA(SCARDCONTEXT context, LPCSTR groups, LPSTR readers, LPDWORD buflen) +LONG WINAPI SCardListReadersA(SCARDCONTEXT context, const CHAR *groups, CHAR *readers, DWORD *buflen) { FIXME("(%lx, %s, %p, %p) stub\n", context, debugstr_a(groups), readers, buflen); - return SCARD_F_INTERNAL_ERROR; + return SCARD_E_NO_READERS_AVAILABLE; } -LONG WINAPI SCardListReadersW(SCARDCONTEXT context, LPCWSTR groups, LPWSTR readers, LPDWORD buflen) +LONG WINAPI SCardListReadersW(SCARDCONTEXT context, const WCHAR *groups, WCHAR *readers, DWORD *buflen) { FIXME("(%lx, %s, %p, %p) stub\n", context, debugstr_w(groups), readers, buflen); - return SCARD_F_INTERNAL_ERROR; + return SCARD_E_NO_READERS_AVAILABLE; } 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] Sat Jul 2 13:05:27 2016 @@ -209,7 +209,7 @@ reactos/dll/win32/winmm # Forked at Wine-20050628 reactos/dll/win32/winmm/midimap # Forked at Wine-20050628 reactos/dll/win32/winmm/wavemap # Forked at Wine-20050628 -reactos/dll/win32/winscard # Synced to WineStaging-1.9.4 +reactos/dll/win32/winscard # Synced to WineStaging-1.9.11 reactos/dll/win32/wintrust # Synced to WineStaging-1.9.11 reactos/dll/win32/wldap32 # Synced to WineStaging-1.9.11 reactos/dll/win32/wmi # Synced to WineStaging-1.9.4
8 years, 5 months
1
0
0
0
[akhaldi] 71732: [WINTRUST_WINETEST] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jul 2 13:04:19 2016 New Revision: 71732 URL:
http://svn.reactos.org/svn/reactos?rev=71732&view=rev
Log: [WINTRUST_WINETEST] Sync with Wine Staging 1.9.11. CORE-11368 Modified: trunk/rostests/winetests/wintrust/crypt.c Modified: trunk/rostests/winetests/wintrust/crypt.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wintrust/crypt.…
============================================================================== --- trunk/rostests/winetests/wintrust/crypt.c [iso-8859-1] (original) +++ trunk/rostests/winetests/wintrust/crypt.c [iso-8859-1] Sat Jul 2 13:04:19 2016 @@ -23,6 +23,7 @@ #include <stdio.h> #include "windows.h" +#include "wincrypt.h" #include "mscat.h" #include "wine/test.h" @@ -1232,21 +1233,21 @@ ok(ret, "CryptSIPRetrieveSubjectGuid failed (%x)\n", GetLastError()); ret = pPutSignedDataMsg(&info, X509_ASN_ENCODING, &index, 4, (BYTE*)"test"); - ok(!ret, "CryptSIPPutSignedDataMsg succeedded\n"); + ok(!ret, "CryptSIPPutSignedDataMsg succeeded\n"); index = GetLastError(); ok(index == ERROR_PATH_NOT_FOUND, "GetLastError returned %x\n", index); info.hFile = file; info.pwsFileName = nameW; ret = pPutSignedDataMsg(&info, X509_ASN_ENCODING, &index, 4, (BYTE*)"test"); - ok(!ret, "CryptSIPPutSignedDataMsg succeedded\n"); + ok(!ret, "CryptSIPPutSignedDataMsg succeeded\n"); index = GetLastError(); todo_wine ok(index == ERROR_INVALID_PARAMETER, "GetLastError returned %x\n", index); info.hFile = INVALID_HANDLE_VALUE; info.pwsFileName = nameW; ret = pPutSignedDataMsg(&info, X509_ASN_ENCODING, &index, 4, (BYTE*)"test"); - ok(!ret, "CryptSIPPutSignedDataMsg succeedded\n"); + ok(!ret, "CryptSIPPutSignedDataMsg succeeded\n"); index = GetLastError(); ok(index == ERROR_SHARING_VIOLATION, "GetLastError returned %x\n", index);
8 years, 5 months
1
0
0
0
[akhaldi] 71731: [WINTRUST] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jul 2 13:03:38 2016 New Revision: 71731 URL:
http://svn.reactos.org/svn/reactos?rev=71731&view=rev
Log: [WINTRUST] Sync with Wine Staging 1.9.11. CORE-11368 Modified: trunk/reactos/dll/win32/wintrust/register.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/wintrust/register.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wintrust/registe…
============================================================================== --- trunk/reactos/dll/win32/wintrust/register.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wintrust/register.c [iso-8859-1] Sat Jul 2 13:03:38 2016 @@ -25,7 +25,7 @@ static CRYPT_TRUST_REG_ENTRY SoftpubInitialization; static CRYPT_TRUST_REG_ENTRY SoftpubMessage; static CRYPT_TRUST_REG_ENTRY SoftpubSignature; -static CRYPT_TRUST_REG_ENTRY SoftpubCertficate; +static CRYPT_TRUST_REG_ENTRY SoftpubCertificate; static CRYPT_TRUST_REG_ENTRY SoftpubCertCheck; static CRYPT_TRUST_REG_ENTRY SoftpubFinalPolicy; static CRYPT_TRUST_REG_ENTRY SoftpubCleanup; @@ -85,7 +85,7 @@ WINTRUST_INITREGENTRY(SoftpubInitialization, SP_POLICY_PROVIDER_DLL_NAME, SP_INIT_FUNCTION) WINTRUST_INITREGENTRY(SoftpubMessage, SP_POLICY_PROVIDER_DLL_NAME, SP_OBJTRUST_FUNCTION) WINTRUST_INITREGENTRY(SoftpubSignature, SP_POLICY_PROVIDER_DLL_NAME, SP_SIGTRUST_FUNCTION) - WINTRUST_INITREGENTRY(SoftpubCertficate, SP_POLICY_PROVIDER_DLL_NAME, WT_PROVIDER_CERTTRUST_FUNCTION) + WINTRUST_INITREGENTRY(SoftpubCertificate, SP_POLICY_PROVIDER_DLL_NAME, WT_PROVIDER_CERTTRUST_FUNCTION) WINTRUST_INITREGENTRY(SoftpubCertCheck, SP_POLICY_PROVIDER_DLL_NAME, SP_CHKCERT_FUNCTION) WINTRUST_INITREGENTRY(SoftpubFinalPolicy, SP_POLICY_PROVIDER_DLL_NAME, SP_FINALPOLICY_FUNCTION) WINTRUST_INITREGENTRY(SoftpubCleanup, SP_POLICY_PROVIDER_DLL_NAME, SP_CLEANUPPOLICY_FUNCTION) @@ -119,7 +119,7 @@ WINTRUST_FREEREGENTRY(SoftpubInitialization); WINTRUST_FREEREGENTRY(SoftpubMessage); WINTRUST_FREEREGENTRY(SoftpubSignature); - WINTRUST_FREEREGENTRY(SoftpubCertficate); + WINTRUST_FREEREGENTRY(SoftpubCertificate); WINTRUST_FREEREGENTRY(SoftpubCertCheck); WINTRUST_FREEREGENTRY(SoftpubFinalPolicy); WINTRUST_FREEREGENTRY(SoftpubCleanup); @@ -417,7 +417,7 @@ ProvInfo.sInitProvider = SoftpubInitialization; ProvInfo.sObjectProvider = SoftpubMessage; ProvInfo.sSignatureProvider = SoftpubSignature; - ProvInfo.sCertificateProvider = SoftpubCertficate; + ProvInfo.sCertificateProvider = SoftpubCertificate; ProvInfo.sCertificatePolicyProvider = SoftpubCertCheck; ProvInfo.sFinalPolicyProvider = SoftpubFinalPolicy; ProvInfo.sTestPolicyProvider = NullCTRE; /* No diagnostic policy */ @@ -450,7 +450,7 @@ ProvInfo.sInitProvider = SoftpubInitialization; ProvInfo.sObjectProvider = SoftpubMessage; ProvInfo.sSignatureProvider = SoftpubSignature; - ProvInfo.sCertificateProvider = SoftpubCertficate; + ProvInfo.sCertificateProvider = SoftpubCertificate; ProvInfo.sCertificatePolicyProvider = SoftpubCertCheck; ProvInfo.sFinalPolicyProvider = SoftpubFinalPolicy; ProvInfo.sTestPolicyProvider = NullCTRE; /* No diagnostic policy */ @@ -482,7 +482,7 @@ ProvInfo.sInitProvider = SoftpubInitialization; ProvInfo.sObjectProvider = SoftpubMessage; ProvInfo.sSignatureProvider = SoftpubSignature; - ProvInfo.sCertificateProvider = SoftpubCertficate; + ProvInfo.sCertificateProvider = SoftpubCertificate; ProvInfo.sCertificatePolicyProvider = SoftpubCertCheck; ProvInfo.sFinalPolicyProvider = SoftpubFinalPolicy; ProvInfo.sTestPolicyProvider = NullCTRE; /* No diagnostic policy */ @@ -512,7 +512,7 @@ ProvInfo.sInitProvider = SoftpubDefCertInit; ProvInfo.sObjectProvider = SoftpubMessage; ProvInfo.sSignatureProvider = SoftpubSignature; - ProvInfo.sCertificateProvider = SoftpubCertficate; + ProvInfo.sCertificateProvider = SoftpubCertificate; ProvInfo.sCertificatePolicyProvider = SoftpubCertCheck; ProvInfo.sFinalPolicyProvider = SoftpubFinalPolicy; ProvInfo.sTestPolicyProvider = NullCTRE; /* No diagnostic policy */ @@ -542,7 +542,7 @@ ProvInfo.sInitProvider = SoftpubInitialization; ProvInfo.sObjectProvider = SoftpubMessage; ProvInfo.sSignatureProvider = SoftpubSignature; - ProvInfo.sCertificateProvider = SoftpubCertficate; + ProvInfo.sCertificateProvider = SoftpubCertificate; ProvInfo.sCertificatePolicyProvider = SoftpubCertCheck; ProvInfo.sFinalPolicyProvider = SoftpubFinalPolicy; ProvInfo.sTestPolicyProvider = SoftpubDumpStructure; @@ -624,7 +624,7 @@ ProvInfo.sInitProvider = OfficeInitializePolicy; ProvInfo.sObjectProvider = SoftpubMessage; ProvInfo.sSignatureProvider = SoftpubSignature; - ProvInfo.sCertificateProvider = SoftpubCertficate; + ProvInfo.sCertificateProvider = SoftpubCertificate; ProvInfo.sCertificatePolicyProvider = SoftpubCertCheck; ProvInfo.sFinalPolicyProvider = SoftpubFinalPolicy; ProvInfo.sTestPolicyProvider = NullCTRE; /* No diagnostic policy */ @@ -655,7 +655,7 @@ ProvInfo.sInitProvider = DriverInitializePolicy; ProvInfo.sObjectProvider = SoftpubMessage; ProvInfo.sSignatureProvider = SoftpubSignature; - ProvInfo.sCertificateProvider = SoftpubCertficate; + ProvInfo.sCertificateProvider = SoftpubCertificate; ProvInfo.sCertificatePolicyProvider = SoftpubCertCheck; ProvInfo.sFinalPolicyProvider = DriverFinalPolicy; ProvInfo.sTestPolicyProvider = NullCTRE; /* No diagnostic policy */ 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] Sat Jul 2 13:03:38 2016 @@ -210,7 +210,7 @@ reactos/dll/win32/winmm/midimap # Forked at Wine-20050628 reactos/dll/win32/winmm/wavemap # Forked at Wine-20050628 reactos/dll/win32/winscard # Synced to WineStaging-1.9.4 -reactos/dll/win32/wintrust # Synced to WineStaging-1.9.4 +reactos/dll/win32/wintrust # Synced to WineStaging-1.9.11 reactos/dll/win32/wldap32 # Synced to WineStaging-1.9.11 reactos/dll/win32/wmi # Synced to WineStaging-1.9.4 reactos/dll/win32/wmiutils # Synced to WineStaging-1.9.4
8 years, 5 months
1
0
0
0
[akhaldi] 71730: [WLDAP32] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jul 2 13:02:31 2016 New Revision: 71730 URL:
http://svn.reactos.org/svn/reactos?rev=71730&view=rev
Log: [WLDAP32] Sync with Wine Staging 1.9.11. CORE-11368 Modified: trunk/reactos/dll/win32/wldap32/error.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/wldap32/error.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wldap32/error.c?…
============================================================================== --- trunk/reactos/dll/win32/wldap32/error.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wldap32/error.c [iso-8859-1] Sat Jul 2 13:02:31 2016 @@ -21,8 +21,6 @@ #include "winldap_private.h" #include <winuser.h> - -extern HINSTANCE hwldap32; ULONG map_error( int error ) { 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] Sat Jul 2 13:02:31 2016 @@ -211,7 +211,7 @@ reactos/dll/win32/winmm/wavemap # Forked at Wine-20050628 reactos/dll/win32/winscard # Synced to WineStaging-1.9.4 reactos/dll/win32/wintrust # Synced to WineStaging-1.9.4 -reactos/dll/win32/wldap32 # Synced to WineStaging-1.9.4 +reactos/dll/win32/wldap32 # Synced to WineStaging-1.9.11 reactos/dll/win32/wmi # Synced to WineStaging-1.9.4 reactos/dll/win32/wmiutils # Synced to WineStaging-1.9.4 reactos/dll/win32/wmvcore # Synced to WineStaging-1.9.4
8 years, 5 months
1
0
0
0
[akhaldi] 71729: [VERSION_WINETEST] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jul 2 13:01:07 2016 New Revision: 71729 URL:
http://svn.reactos.org/svn/reactos?rev=71729&view=rev
Log: [VERSION_WINETEST] Sync with Wine Staging 1.9.11. CORE-11368 Modified: trunk/rostests/winetests/version/CMakeLists.txt trunk/rostests/winetests/version/install.c Modified: trunk/rostests/winetests/version/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/version/CMakeLi…
============================================================================== --- trunk/rostests/winetests/version/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/winetests/version/CMakeLists.txt [iso-8859-1] Sat Jul 2 13:01:07 2016 @@ -8,7 +8,7 @@ add_executable(version_winetest ${SOURCE} version.rc) set_module_type(version_winetest win32cui) -add_importlibs(version_winetest version msvcrt kernel32) +add_importlibs(version_winetest shell32 version msvcrt kernel32) if(MSVC) add_importlibs(version_winetest ntdll) Modified: trunk/rostests/winetests/version/install.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/version/install…
============================================================================== --- trunk/rostests/winetests/version/install.c [iso-8859-1] (original) +++ trunk/rostests/winetests/version/install.c [iso-8859-1] Sat Jul 2 13:01:07 2016 @@ -24,11 +24,13 @@ #include "winbase.h" #include "winerror.h" #include "winver.h" +#include "shlobj.h" static void test_find_file(void) { DWORD ret; UINT dwCur, dwOut ; + char tmp[MAX_PATH]; char appdir[MAX_PATH]; char curdir[MAX_PATH]; char filename[MAX_PATH]; @@ -115,10 +117,11 @@ } } } - if(!GetModuleFileNameA(NULL, filename, MAX_PATH) || - !GetSystemDirectoryA(windir, MAX_PATH) || - !GetTempPathA(MAX_PATH, appdir)) - trace("GetModuleFileNameA, GetSystemDirectoryA or GetTempPathA failed\n"); + if(!GetSystemDirectoryA(windir, MAX_PATH) || + !SHGetSpecialFolderPathA(0, appdir, CSIDL_PROGRAM_FILES, FALSE) || + !GetTempPathA(MAX_PATH, tmp) || + !GetTempFileNameA(tmp, "tes", 0, filename)) + ok(0, "GetSystemDirectoryA, SHGetSpecialFolderPathA, GetTempPathA or GetTempFileNameA failed\n"); else { char *p = strrchr(filename, '\\'); if(p) { @@ -150,7 +153,7 @@ memset(outBuf, 0, MAX_PATH); memset(curdir, 0, MAX_PATH); ret = VerFindFileA(VFFF_ISSHAREDFILE, filename, NULL, appdir, curdir, &dwCur, outBuf, &dwOut); - todo_wine ok(VFF_CURNEDEST == ret, "Wrong return value got %x expected VFF_CURNEDEST\n", ret); + ok(VFF_CURNEDEST == ret, "Wrong return value got %x expected VFF_CURNEDEST\n", ret); ok(dwOut == 1 + strlen(windir), "Wrong length of buffer for current location: " "got %d(%s) expected %d\n", dwOut, outBuf, lstrlenA(windir)+1); @@ -159,9 +162,145 @@ memset(outBuf, 0, MAX_PATH); memset(curdir, 0, MAX_PATH); ret = VerFindFileA(0, filename, NULL, appdir, curdir, &dwCur, outBuf, &dwOut); - todo_wine ok(VFF_CURNEDEST == ret, "Wrong return value got %x expected VFF_CURNEDEST\n", ret); + ok(VFF_CURNEDEST == ret, "Wrong return value got %x expected VFF_CURNEDEST\n", ret); ok(dwOut == 1 + strlen(appdir), "Wrong length of buffer for current location: " "got %d(%s) expected %d\n", dwOut, outBuf, lstrlenA(appdir)+1); + + /* search for filename */ + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(0, filename, NULL, NULL, curdir, &dwCur, outBuf, &dwOut); + ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret); + + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(0, filename, NULL, empty, curdir, &dwCur, outBuf, &dwOut); + ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret); + + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(0, filename, NULL, appdir, curdir, &dwCur, outBuf, &dwOut); + ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret); + + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(VFFF_ISSHAREDFILE, filename, NULL, NULL, curdir, &dwCur, outBuf, &dwOut); + ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret); + + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(VFFF_ISSHAREDFILE, filename, NULL, empty, curdir, &dwCur, outBuf, &dwOut); + ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret); + + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(VFFF_ISSHAREDFILE, filename, NULL, appdir, curdir, &dwCur, outBuf, &dwOut); + ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret); + + /* search for regedit */ + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(0, "regedit", NULL, NULL, curdir, &dwCur, outBuf, &dwOut); + ok(!ret, "Wrong return value got %x expected 0\n", ret); + + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(0, "regedit", NULL, empty, curdir, &dwCur, outBuf, &dwOut); + ok(!ret, "Wrong return value got %x expected 0\n", ret); + + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(0, "regedit", NULL, appdir, curdir, &dwCur, outBuf, &dwOut); + ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret); + + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(VFFF_ISSHAREDFILE, "regedit", NULL, NULL, curdir, &dwCur, outBuf, &dwOut); + ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret); + + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(VFFF_ISSHAREDFILE, "regedit", NULL, empty, curdir, &dwCur, outBuf, &dwOut); + ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret); + + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(VFFF_ISSHAREDFILE, "regedit", NULL, appdir, curdir, &dwCur, outBuf, &dwOut); + ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret); + + /* search for regedit.exe */ + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(0, "regedit.exe", NULL, NULL, curdir, &dwCur, outBuf, &dwOut); + ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret); + + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(0, "regedit.exe", NULL, empty, curdir, &dwCur, outBuf, &dwOut); + ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret); + + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(0, "regedit.exe", NULL, appdir, curdir, &dwCur, outBuf, &dwOut); + ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret); + + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(VFFF_ISSHAREDFILE, "regedit.exe", NULL, NULL, curdir, &dwCur, outBuf, &dwOut); + ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret); + + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(VFFF_ISSHAREDFILE, "regedit.exe", NULL, empty, curdir, &dwCur, outBuf, &dwOut); + ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret); + + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(VFFF_ISSHAREDFILE, "regedit.exe", NULL, appdir, curdir, &dwCur, outBuf, &dwOut); + ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret); + + /* nonexistent filename */ + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(0, "doesnotexist.exe", NULL, NULL, curdir, &dwCur, outBuf, &dwOut); + ok(!ret, "Wrong return value got %x expected 0\n", ret); + + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(0, "doesnotexist.exe", NULL, empty, curdir, &dwCur, outBuf, &dwOut); + ok(!ret, "Wrong return value got %x expected 0\n", ret); + + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(0, "doesnotexist.exe", NULL, appdir, curdir, &dwCur, outBuf, &dwOut); + ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret); + + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(0, "doesnotexist.exe", NULL, "C:\\random_path_does_not_exist", curdir, &dwCur, outBuf, &dwOut); + ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret); + + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(VFFF_ISSHAREDFILE, "doesnotexist.exe", NULL, NULL, curdir, &dwCur, outBuf, &dwOut); + ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret); + + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(VFFF_ISSHAREDFILE, "doesnotexist.exe", NULL, empty, curdir, &dwCur, outBuf, &dwOut); + ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret); + + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(VFFF_ISSHAREDFILE, "doesnotexist.exe", NULL, appdir, curdir, &dwCur, outBuf, &dwOut); + ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret); + + dwCur=MAX_PATH; + dwOut=MAX_PATH; + ret = VerFindFileA(VFFF_ISSHAREDFILE, "doesnotexist.exe", NULL, "C:\\random_path_does_not_exist", curdir, &dwCur, outBuf, &dwOut); + ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret); + + DeleteFileA(filename); } }
8 years, 5 months
1
0
0
0
[akhaldi] 71728: [VERSION] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jul 2 12:58:50 2016 New Revision: 71728 URL:
http://svn.reactos.org/svn/reactos?rev=71728&view=rev
Log: [VERSION] Sync with Wine Staging 1.9.11. CORE-11368 Modified: trunk/reactos/dll/win32/version/version.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/version/version.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/version/version.…
============================================================================== --- trunk/reactos/dll/win32/version/version.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/version/version.c [iso-8859-1] Sat Jul 2 12:58:50 2016 @@ -694,7 +694,12 @@ return (len * 2) + 4; default: - SetLastError( lzfd == HFILE_ERROR ? ofs.nErrCode : ERROR_RESOURCE_DATA_NOT_FOUND ); + if (lzfd == HFILE_ERROR) + SetLastError(ofs.nErrCode); + else if (GetVersion() & 0x80000000) + SetLastError(ERROR_FILE_NOT_FOUND); + else + SetLastError(ERROR_RESOURCE_DATA_NOT_FOUND); return 0; } } @@ -1109,16 +1114,22 @@ fileinfo.cBytes = sizeof(OFSTRUCT); - strcpy(filename, path); - filenamelen = strlen(filename); - - /* Add a trailing \ if necessary */ - if(filenamelen) { - if(filename[filenamelen - 1] != '\\') - strcat(filename, "\\"); - } - else /* specify the current directory */ - strcpy(filename, ".\\"); + if (path) + { + strcpy(filename, path); + filenamelen = strlen(filename); + + /* Add a trailing \ if necessary */ + if(filenamelen) + { + if(filename[filenamelen - 1] != '\\') + strcat(filename, "\\"); + } + else /* specify the current directory */ + strcpy(filename, ".\\"); + } + else + filename[0] = 0; /* Create the full pathname */ strcat(filename, file); @@ -1208,10 +1219,10 @@ { if(testFileExistenceA(destDir, lpszFilename, FALSE)) curDir = destDir; else if(lpszAppDir && testFileExistenceA(lpszAppDir, lpszFilename, FALSE)) - { curDir = lpszAppDir; + + if(!testFileExistenceA(systemDir, lpszFilename, FALSE)) retval |= VFF_CURNEDEST; - } } } else /* not a shared file */ @@ -1222,15 +1233,17 @@ GetWindowsDirectoryA( winDir, MAX_PATH ); if(testFileExistenceA(destDir, lpszFilename, FALSE)) curDir = destDir; else if(testFileExistenceA(winDir, lpszFilename, FALSE)) + curDir = winDir; + else if(testFileExistenceA(systemDir, lpszFilename, FALSE)) + curDir = systemDir; + + if (lpszAppDir && lpszAppDir[0]) { - curDir = winDir; + if(!testFileExistenceA(lpszAppDir, lpszFilename, FALSE)) + retval |= VFF_CURNEDEST; + } + else if(testFileExistenceA(NULL, lpszFilename, FALSE)) retval |= VFF_CURNEDEST; - } - else if(testFileExistenceA(systemDir, lpszFilename, FALSE)) - { - curDir = systemDir; - retval |= VFF_CURNEDEST; - } } } 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] Sat Jul 2 12:58:50 2016 @@ -196,7 +196,7 @@ reactos/dll/win32/usp10 # Synced to WineStaging-1.9.11 reactos/dll/win32/uxtheme # Forked reactos/dll/win32/vbscript # Synced to WineStaging-1.9.4 -reactos/dll/win32/version # Synced to WineStaging-1.9.4 +reactos/dll/win32/version # Synced to WineStaging-1.9.11 reactos/dll/win32/vssapi # Synced to WineStaging-1.9.4 reactos/dll/win32/wbemdisp # Synced to WineStaging-1.9.4 reactos/dll/win32/wbemprox # Synced to WineStaging-1.9.4
8 years, 5 months
1
0
0
0
[akhaldi] 71727: [XMLLITE_WINETEST] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jul 2 12:57:07 2016 New Revision: 71727 URL:
http://svn.reactos.org/svn/reactos?rev=71727&view=rev
Log: [XMLLITE_WINETEST] Sync with Wine Staging 1.9.11. CORE-11368 Modified: trunk/rostests/winetests/xmllite/CMakeLists.txt trunk/rostests/winetests/xmllite/reader.c trunk/rostests/winetests/xmllite/writer.c Modified: trunk/rostests/winetests/xmllite/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/xmllite/CMakeLi…
============================================================================== --- trunk/rostests/winetests/xmllite/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/winetests/xmllite/CMakeLists.txt [iso-8859-1] Sat Jul 2 12:57:07 2016 @@ -8,5 +8,5 @@ add_executable(xmllite_winetest ${SOURCE}) set_module_type(xmllite_winetest win32cui) -add_importlibs(xmllite_winetest ole32 msvcrt kernel32) +add_importlibs(xmllite_winetest xmllite ole32 msvcrt kernel32) add_cd_file(TARGET xmllite_winetest DESTINATION reactos/bin FOR all) Modified: trunk/rostests/winetests/xmllite/reader.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/xmllite/reader.…
============================================================================== --- trunk/rostests/winetests/xmllite/reader.c [iso-8859-1] (original) +++ trunk/rostests/winetests/xmllite/reader.c [iso-8859-1] Sat Jul 2 12:57:07 2016 @@ -38,14 +38,6 @@ DEFINE_GUID(IID_IXmlReaderInput, 0x0b3ccc9b, 0x9214, 0x428b, 0xa2, 0xae, 0xef, 0x3a, 0xa8, 0x71, 0xaf, 0xda); -static HRESULT (WINAPI *pCreateXmlReader)(REFIID riid, void **ppvObject, IMalloc *pMalloc); -static HRESULT (WINAPI *pCreateXmlReaderInputWithEncodingName)(IUnknown *stream, - IMalloc *pMalloc, - LPCWSTR encoding, - BOOL hint, - LPCWSTR base_uri, - IXmlReaderInput **ppInput); - static WCHAR *a2w(const char *str) { int len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0); @@ -372,27 +364,51 @@ teststream_Write }; -static BOOL init_pointers(void) -{ - /* don't free module here, it's to be unloaded on exit */ - HMODULE mod = LoadLibraryA("xmllite.dll"); - - if (!mod) - { - win_skip("xmllite library not available\n"); - return FALSE; - } - -#define MAKEFUNC(f) if (!(p##f = (void*)GetProcAddress(mod, #f))) return FALSE; - MAKEFUNC(CreateXmlReader); - MAKEFUNC(CreateXmlReaderInputWithEncodingName); -#undef MAKEFUNC - - return TRUE; -} +static HRESULT WINAPI resolver_QI(IXmlResolver *iface, REFIID riid, void **obj) +{ + ok(0, "unexpected call, riid %s\n", wine_dbgstr_guid(riid)); + + if (IsEqualIID(riid, &IID_IXmlResolver) || IsEqualIID(riid, &IID_IUnknown)) + { + *obj = iface; + IXmlResolver_AddRef(iface); + return S_OK; + } + + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI resolver_AddRef(IXmlResolver *iface) +{ + return 2; +} + +static ULONG WINAPI resolver_Release(IXmlResolver *iface) +{ + return 1; +} + +static HRESULT WINAPI resolver_ResolveUri(IXmlResolver *iface, const WCHAR *base_uri, + const WCHAR *public_id, const WCHAR *system_id, IUnknown **input) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static const IXmlResolverVtbl resolvervtbl = +{ + resolver_QI, + resolver_AddRef, + resolver_Release, + resolver_ResolveUri +}; + +static IXmlResolver testresolver = { &resolvervtbl }; static void test_reader_create(void) { + IXmlResolver *resolver; HRESULT hr; IXmlReader *reader; IUnknown *input; @@ -402,11 +418,11 @@ /* crashes native */ if (0) { - pCreateXmlReader(&IID_IXmlReader, NULL, NULL); - pCreateXmlReader(NULL, (void**)&reader, NULL); - } - - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + CreateXmlReader(&IID_IXmlReader, NULL, NULL); + CreateXmlReader(NULL, (void**)&reader, NULL); + } + + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); test_read_state(reader, XmlReadState_Closed, -1, FALSE); @@ -415,6 +431,26 @@ hr = IXmlReader_GetNodeType(reader, &nodetype); ok(hr == S_FALSE, "got %08x\n", hr); ok(nodetype == XmlNodeType_None, "got %d\n", nodetype); + + resolver = (void*)0xdeadbeef; + hr = IXmlReader_GetProperty(reader, XmlReaderProperty_XmlResolver, (LONG_PTR*)&resolver); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(resolver == NULL, "got %p\n", resolver); + + hr = IXmlReader_SetProperty(reader, XmlReaderProperty_XmlResolver, 0); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlReader_SetProperty(reader, XmlReaderProperty_XmlResolver, (LONG_PTR)&testresolver); + ok(hr == S_OK, "got 0x%08x\n", hr); + + resolver = NULL; + hr = IXmlReader_GetProperty(reader, XmlReaderProperty_XmlResolver, (LONG_PTR*)&resolver); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(resolver == &testresolver, "got %p\n", resolver); + IXmlResolver_Release(resolver); + + hr = IXmlReader_SetProperty(reader, XmlReaderProperty_XmlResolver, 0); + ok(hr == S_OK, "got 0x%08x\n", hr); dtd = 2; hr = IXmlReader_GetProperty(reader, XmlReaderProperty_DtdProcessing, (LONG_PTR*)&dtd); @@ -459,9 +495,9 @@ HRESULT hr; LONG ref; - hr = pCreateXmlReaderInputWithEncodingName(NULL, NULL, NULL, FALSE, NULL, NULL); + hr = CreateXmlReaderInputWithEncodingName(NULL, NULL, NULL, FALSE, NULL, NULL); ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr); - hr = pCreateXmlReaderInputWithEncodingName(NULL, NULL, NULL, FALSE, NULL, &reader_input); + hr = CreateXmlReaderInputWithEncodingName(NULL, NULL, NULL, FALSE, NULL, &reader_input); ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr); hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); @@ -470,7 +506,7 @@ ref = IStream_AddRef(stream); ok(ref == 2, "Expected 2, got %d\n", ref); IStream_Release(stream); - hr = pCreateXmlReaderInputWithEncodingName((IUnknown*)stream, NULL, NULL, FALSE, NULL, &reader_input); + hr = CreateXmlReaderInputWithEncodingName((IUnknown*)stream, NULL, NULL, FALSE, NULL, &reader_input); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); hr = IUnknown_QueryInterface(reader_input, &IID_IStream, (void**)&stream2); @@ -485,7 +521,7 @@ IStream_Release(stream); /* try ::SetInput() with valid IXmlReaderInput */ - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ref = IUnknown_AddRef(reader_input); @@ -551,7 +587,7 @@ ref = IUnknown_AddRef(input); ok(ref == 2, "Expected 2, got %d\n", ref); IUnknown_Release(input); - hr = pCreateXmlReaderInputWithEncodingName(input, NULL, NULL, FALSE, NULL, &reader_input); + hr = CreateXmlReaderInputWithEncodingName(input, NULL, NULL, FALSE, NULL, &reader_input); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok_iids(&input_iids, empty_seq, NULL, FALSE); /* IXmlReaderInput stores stream interface as IUnknown */ @@ -559,7 +595,7 @@ ok(ref == 3, "Expected 3, got %d\n", ref); IUnknown_Release(input); - hr = pCreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); input_iids.count = 0; @@ -590,7 +626,7 @@ ok_iids(&input_iids, setinput_readerinput, NULL, FALSE); /* another reader */ - hr = pCreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader2, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader2, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); /* resolving from IXmlReaderInput to IStream/ISequentialStream is done at @@ -613,7 +649,7 @@ XmlNodeType nodetype; HRESULT hr; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); /* invalid arguments */ @@ -653,7 +689,7 @@ BOOL ret; const WCHAR *val; - hr = pCreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); /* position methods with Null args */ @@ -874,7 +910,7 @@ IXmlReader *reader; HRESULT hr; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "S_OK, got %08x\n", hr); while (test->xml) @@ -956,7 +992,7 @@ IXmlReader *reader; HRESULT hr; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "S_OK, got %08x\n", hr); while (test->xml) @@ -1072,7 +1108,7 @@ HRESULT hr; int i; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "S_OK, got %08x\n", hr); stream = create_stream_on_data(test->xml, strlen(test->xml)+1); @@ -1121,7 +1157,7 @@ UINT len, count; HRESULT hr; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "S_OK, got %08x\n", hr); hr = IXmlReader_SetProperty(reader, XmlReaderProperty_DtdProcessing, DtdProcessing_Parse); @@ -1214,7 +1250,7 @@ UINT depth; HRESULT hr; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "S_OK, got %08x\n", hr); while (test->xml) @@ -1345,7 +1381,7 @@ HRESULT hr; int c; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "S_OK, got 0x%08x\n", hr); hr = IXmlReader_SetInput(reader, (IUnknown*)&teststream); @@ -1383,7 +1419,7 @@ HRESULT hr; UINT c; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "S_OK, got %08x\n", hr); stream = create_stream_on_data(testA, sizeof(testA)); @@ -1438,7 +1474,7 @@ IXmlReader *reader; HRESULT hr; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "S_OK, got %08x\n", hr); while (test->xml) @@ -1531,7 +1567,7 @@ IXmlReader *reader; HRESULT hr; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "S_OK, got %08x\n", hr); while (test->xml) @@ -1629,7 +1665,7 @@ IXmlReader *reader; HRESULT hr; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "S_OK, got %08x\n", hr); while (test->xml) @@ -1687,7 +1723,7 @@ IXmlReader *reader; HRESULT hr; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "S_OK, got %08x\n", hr); while (test->xml) @@ -1756,9 +1792,6 @@ START_TEST(reader) { - if (!init_pointers()) - return; - test_reader_create(); test_readerinput(); test_reader_state(); Modified: trunk/rostests/winetests/xmllite/writer.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/xmllite/writer.…
============================================================================== --- trunk/rostests/winetests/xmllite/writer.c [iso-8859-1] (original) +++ trunk/rostests/winetests/xmllite/writer.c [iso-8859-1] Sat Jul 2 12:57:07 2016 @@ -39,15 +39,116 @@ #include <initguid.h> DEFINE_GUID(IID_IXmlWriterOutput, 0xc1131708, 0x0f59, 0x477f, 0x93, 0x59, 0x7d, 0x33, 0x24, 0x51, 0xbc, 0x1a); -static HRESULT (WINAPI *pCreateXmlWriter)(REFIID riid, void **ppvObject, IMalloc *pMalloc); -static HRESULT (WINAPI *pCreateXmlWriterOutputWithEncodingName)(IUnknown *stream, - IMalloc *imalloc, - LPCWSTR encoding_name, - IXmlWriterOutput **output); -static HRESULT (WINAPI *pCreateXmlWriterOutputWithEncodingCodePage)(IUnknown *stream, - IMalloc *imalloc, - UINT codepage, - IXmlWriterOutput **output); +static void check_output(IStream *stream, const char *expected, int line) +{ + HGLOBAL hglobal; + int len = strlen(expected), size; + char *ptr; + HRESULT hr; + + hr = GetHGlobalFromStream(stream, &hglobal); + ok_(__FILE__, line)(hr == S_OK, "got 0x%08x\n", hr); + + size = GlobalSize(hglobal); + ptr = GlobalLock(hglobal); + if (size != len) + { + ok_(__FILE__, line)(0, "data size mismatch, expected %u, got %u\n", len, size); + ok_(__FILE__, line)(0, "got %s, expected %s\n", ptr, expected); + } + else + ok_(__FILE__, line)(!strncmp(ptr, expected, len), "got %s, expected %s\n", ptr, expected); + GlobalUnlock(hglobal); +} +#define CHECK_OUTPUT(stream, expected) check_output(stream, expected, __LINE__) + +/* used to test all Write* methods for consistent error state */ +static void check_writer_state(IXmlWriter *writer, HRESULT exp_hr) +{ + static const WCHAR aW[] = {'a',0}; + HRESULT hr; + + /* FIXME: add WriteAttributes */ + + hr = IXmlWriter_WriteAttributeString(writer, NULL, aW, NULL, aW); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteCData(writer, aW); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteCharEntity(writer, aW[0]); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteChars(writer, aW, 1); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteComment(writer, aW); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + /* FIXME: add WriteDocType */ + + hr = IXmlWriter_WriteElementString(writer, NULL, aW, NULL, aW); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteEndDocument(writer); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteEndElement(writer); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteEntityRef(writer, aW); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteFullEndElement(writer); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteName(writer, aW); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteNmToken(writer, aW); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + /* FIXME: add WriteNode */ + /* FIXME: add WriteNodeShallow */ + + hr = IXmlWriter_WriteProcessingInstruction(writer, aW, aW); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteQualifiedName(writer, aW, NULL); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteRaw(writer, aW); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteRawChars(writer, aW, 1); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteString(writer, aW); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + /* FIXME: add WriteSurrogateCharEntity */ + /* FIXME: add WriteWhitespace */ +} + +static IStream *writer_set_output(IXmlWriter *writer) +{ + IStream *stream; + HRESULT hr; + + hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + return stream; +} static HRESULT WINAPI testoutput_QueryInterface(IUnknown *iface, REFIID riid, void **obj) { @@ -135,11 +236,11 @@ /* crashes native */ if (0) { - pCreateXmlWriter(&IID_IXmlWriter, NULL, NULL); - pCreateXmlWriter(NULL, (void**)&writer, NULL); + CreateXmlWriter(&IID_IXmlWriter, NULL, NULL); + CreateXmlWriter(NULL, (void**)&writer, NULL); } - hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); /* check default properties values */ @@ -166,26 +267,6 @@ IXmlWriter_Release(writer); } -static BOOL init_pointers(void) -{ - /* don't free module here, it's to be unloaded on exit */ - HMODULE mod = LoadLibraryA("xmllite.dll"); - - if (!mod) - { - win_skip("xmllite library not available\n"); - return FALSE; - } - -#define MAKEFUNC(f) if (!(p##f = (void*)GetProcAddress(mod, #f))) return FALSE; - MAKEFUNC(CreateXmlWriter); - MAKEFUNC(CreateXmlWriterOutputWithEncodingName); - MAKEFUNC(CreateXmlWriterOutputWithEncodingCodePage); -#undef MAKEFUNC - - return TRUE; -} - static void test_writeroutput(void) { static const WCHAR utf16W[] = {'u','t','f','-','1','6',0}; @@ -194,11 +275,11 @@ HRESULT hr; output = NULL; - hr = pCreateXmlWriterOutputWithEncodingName(&testoutput, NULL, NULL, &output); + hr = CreateXmlWriterOutputWithEncodingName(&testoutput, NULL, NULL, &output); ok(hr == S_OK, "got %08x\n", hr); IUnknown_Release(output); - hr = pCreateXmlWriterOutputWithEncodingName(&testoutput, NULL, utf16W, &output); + hr = CreateXmlWriterOutputWithEncodingName(&testoutput, NULL, utf16W, &output); ok(hr == S_OK, "got %08x\n", hr); unk = NULL; hr = IUnknown_QueryInterface(output, &IID_IXmlWriterOutput, (void**)&unk); @@ -208,11 +289,11 @@ IUnknown_Release(output); output = NULL; - hr = pCreateXmlWriterOutputWithEncodingCodePage(&testoutput, NULL, ~0u, &output); + hr = CreateXmlWriterOutputWithEncodingCodePage(&testoutput, NULL, ~0u, &output); ok(hr == S_OK, "got %08x\n", hr); IUnknown_Release(output); - hr = pCreateXmlWriterOutputWithEncodingCodePage(&testoutput, NULL, CP_UTF8, &output); + hr = CreateXmlWriterOutputWithEncodingCodePage(&testoutput, NULL, CP_UTF8, &output); ok(hr == S_OK, "got %08x\n", hr); unk = NULL; hr = IUnknown_QueryInterface(output, &IID_IXmlWriterOutput, (void**)&unk); @@ -229,12 +310,10 @@ static const WCHAR versionW[] = {'v','e','r','s','i','o','n','=','"','1','.','0','"',0}; static const WCHAR xmlW[] = {'x','m','l',0}; IXmlWriter *writer; - HGLOBAL hglobal; IStream *stream; HRESULT hr; - char *ptr; - - hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); /* output not set */ @@ -247,11 +326,7 @@ hr = IXmlWriter_Flush(writer); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream); - ok(hr == S_OK, "got 0x%08x\n", hr); + stream = writer_set_output(writer); /* nothing written yet */ hr = IXmlWriter_Flush(writer); @@ -263,12 +338,7 @@ hr = IXmlWriter_Flush(writer); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = GetHGlobalFromStream(stream, &hglobal); - ok(hr == S_OK, "got 0x%08x\n", hr); - - ptr = GlobalLock(hglobal); - ok(!strncmp(ptr, fullprolog, strlen(fullprolog)), "got %s, expected %s\n", ptr, fullprolog); - GlobalUnlock(hglobal); + CHECK_OUTPUT(stream, fullprolog); /* one more time */ hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes); @@ -276,11 +346,7 @@ IStream_Release(stream); /* now add PI manually, and try to start a document */ - hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream); - ok(hr == S_OK, "got 0x%08x\n", hr); + stream = writer_set_output(writer); hr = IXmlWriter_WriteProcessingInstruction(writer, xmlW, versionW); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -298,12 +364,7 @@ hr = IXmlWriter_Flush(writer); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = GetHGlobalFromStream(stream, &hglobal); - ok(hr == S_OK, "got 0x%08x\n", hr); - - ptr = GlobalLock(hglobal); - ok(!strncmp(ptr, prologversion, strlen(prologversion)), "got %s\n", ptr); - GlobalUnlock(hglobal); + CHECK_OUTPUT(stream, prologversion); IStream_Release(stream); IXmlWriter_Release(writer); @@ -314,7 +375,7 @@ IXmlWriter *writer; HRESULT hr; - hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); hr = IXmlWriter_SetOutput(writer, (IUnknown*)&teststream); @@ -350,14 +411,10 @@ HRESULT hr; char *ptr; - hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); - ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); - - hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream); - ok(hr == S_OK, "got 0x%08x\n", hr); + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + + stream = writer_set_output(writer); hr = IXmlWriter_SetProperty(writer, XmlWriterProperty_OmitXmlDeclaration, TRUE); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -382,11 +439,7 @@ IStream_Release(stream); /* now add PI manually, and try to start a document */ - hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream); - ok(hr == S_OK, "got 0x%08x\n", hr); + stream = writer_set_output(writer); hr = IXmlWriter_WriteProcessingInstruction(writer, xmlW, versionW); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -394,32 +447,23 @@ hr = IXmlWriter_Flush(writer); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = GetHGlobalFromStream(stream, &hglobal); - ok(hr == S_OK, "got 0x%08x\n", hr); - - ptr = GlobalLock(hglobal); - ok(!strncmp(ptr, prologversion, strlen(prologversion)), "got %s\n", ptr); - GlobalUnlock(hglobal); - - hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = IXmlWriter_Flush(writer); - ok(hr == S_OK, "got 0x%08x\n", hr); - - ptr = GlobalLock(hglobal); - ok(!strncmp(ptr, prologversion, strlen(prologversion)), "got %s\n", ptr); - GlobalUnlock(hglobal); - - hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes); - ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); - - hr = IXmlWriter_Flush(writer); - ok(hr == S_OK, "got 0x%08x\n", hr); - - ptr = GlobalLock(hglobal); - ok(!strncmp(ptr, prologversion, strlen(prologversion)), "got %s\n", ptr); - GlobalUnlock(hglobal); + CHECK_OUTPUT(stream, prologversion); + + hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_Flush(writer); + ok(hr == S_OK, "got 0x%08x\n", hr); + + CHECK_OUTPUT(stream, prologversion); + + hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + hr = IXmlWriter_Flush(writer); + ok(hr == S_OK, "got 0x%08x\n", hr); + + CHECK_OUTPUT(stream, prologversion); /* another attempt to add 'xml' PI */ hr = IXmlWriter_WriteProcessingInstruction(writer, xmlW, versionW); @@ -448,10 +492,10 @@ hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = pCreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output); + hr = CreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output); ok(hr == S_OK, "got %08x\n", hr); - hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); hr = IXmlWriter_SetProperty(writer, XmlWriterProperty_OmitXmlDeclaration, TRUE); @@ -481,7 +525,7 @@ hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = pCreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output); + hr = CreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output); ok(hr == S_OK, "got %08x\n", hr); hr = IXmlWriter_SetOutput(writer, output); @@ -507,7 +551,7 @@ hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = pCreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output); + hr = CreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output); ok(hr == S_OK, "got %08x\n", hr); hr = IXmlWriter_SetOutput(writer, output); @@ -533,7 +577,7 @@ hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = pCreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output); + hr = CreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output); ok(hr == S_OK, "got %08x\n", hr); hr = IXmlWriter_SetOutput(writer, output); @@ -564,211 +608,416 @@ static const char *str = "<a><b>value</b>"; static const WCHAR aW[] = {'a',0}; static const WCHAR bW[] = {'b',0}; - char *ptr; + IXmlWriter *writer; + IStream *stream; + HRESULT hr; + + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + + hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL); + ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr); + + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteStartElement(writer, aW, NULL, NULL); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteStartElement(writer, NULL, NULL, NULL); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteStartElement(writer, NULL, NULL, aW); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + hr = IXmlWriter_Flush(writer); + ok(hr == S_OK, "got 0x%08x\n", hr); + + CHECK_OUTPUT(stream, "<a"); + + hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteStartElement(writer, NULL, NULL, NULL); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteProcessingInstruction(writer, aW, aW); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + IStream_Release(stream); + IXmlWriter_Release(writer); + + /* WriteElementString */ + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + + hr = IXmlWriter_WriteElementString(writer, NULL, bW, NULL, valueW); + ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr); + + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteElementString(writer, NULL, bW, NULL, valueW); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_Flush(writer); + ok(hr == S_OK, "got 0x%08x\n", hr); + + CHECK_OUTPUT(stream, str); + + IStream_Release(stream); + IXmlWriter_Release(writer); +} + +static void test_writeendelement(void) +{ + static const WCHAR aW[] = {'a',0}; + static const WCHAR bW[] = {'b',0}; + IXmlWriter *writer; + IStream *stream; + HRESULT hr; + + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteStartElement(writer, NULL, bW, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteEndElement(writer); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteEndElement(writer); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_Flush(writer); + ok(hr == S_OK, "got 0x%08x\n", hr); + + CHECK_OUTPUT(stream, "<a><b /></a>"); + + IXmlWriter_Release(writer); + IStream_Release(stream); +} + +static void test_writeenddocument(void) +{ + static const WCHAR aW[] = {'a',0}; + static const WCHAR bW[] = {'b',0}; IXmlWriter *writer; IStream *stream; HGLOBAL hglobal; HRESULT hr; - - hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); - ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + char *ptr; + + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + + hr = IXmlWriter_WriteEndDocument(writer); + ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr); + + stream = writer_set_output(writer); + + /* WriteEndDocument resets it to initial state */ + hr = IXmlWriter_WriteEndDocument(writer); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteEndDocument(writer); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL); - ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = IXmlWriter_WriteStartElement(writer, aW, NULL, NULL); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); - - hr = IXmlWriter_WriteStartElement(writer, NULL, NULL, NULL); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); - - hr = IXmlWriter_WriteStartElement(writer, NULL, NULL, aW); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); - hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL); ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IXmlWriter_WriteStartElement(writer, NULL, bW, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteEndDocument(writer); + ok(hr == S_OK, "got 0x%08x\n", hr); + hr = GetHGlobalFromStream(stream, &hglobal); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes); - ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); - - hr = IXmlWriter_Flush(writer); - ok(hr == S_OK, "got 0x%08x\n", hr); - ptr = GlobalLock(hglobal); - ok(!strncmp(ptr, "<a", 2), "got %s\n", ptr); - GlobalUnlock(hglobal); - - hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes); - ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); - - hr = IXmlWriter_WriteStartElement(writer, NULL, NULL, NULL); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); - - hr = IXmlWriter_WriteProcessingInstruction(writer, aW, aW); - ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); - - IStream_Release(stream); - IXmlWriter_Release(writer); - - /* WriteElementString */ - hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); - ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); - - hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = IXmlWriter_WriteElementString(writer, NULL, bW, NULL, valueW); - ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr); - - hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = IXmlWriter_WriteElementString(writer, NULL, bW, NULL, valueW); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = IXmlWriter_Flush(writer); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = GetHGlobalFromStream(stream, &hglobal); - ok(hr == S_OK, "got 0x%08x\n", hr); - - ptr = GlobalLock(hglobal); - ok(!strncmp(ptr, str, strlen(str)), "got %s\n", ptr); - GlobalUnlock(hglobal); - - IStream_Release(stream); - IXmlWriter_Release(writer); -} - -static void test_writeendelement(void) -{ + ok(ptr == NULL, "got %p\n", ptr); + + /* we still need to flush manually, WriteEndDocument doesn't do that */ + hr = IXmlWriter_Flush(writer); + ok(hr == S_OK, "got 0x%08x\n", hr); + + CHECK_OUTPUT(stream, "<a><b /></a>"); + + IXmlWriter_Release(writer); + IStream_Release(stream); +} + +static void test_WriteComment(void) +{ + static const WCHAR closeW[] = {'-','-','>',0}; static const WCHAR aW[] = {'a',0}; static const WCHAR bW[] = {'b',0}; - char *ptr; IXmlWriter *writer; IStream *stream; - HGLOBAL hglobal; - HRESULT hr; - - hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); - ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); - - hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL); + HRESULT hr; + + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + + hr = IXmlWriter_SetProperty(writer, XmlWriterProperty_OmitXmlDeclaration, TRUE); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteComment(writer, aW); + ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr); + + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteComment(writer, aW); ok(hr == S_OK, "got 0x%08x\n", hr); hr = IXmlWriter_WriteStartElement(writer, NULL, bW, NULL); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = IXmlWriter_WriteEndElement(writer); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = IXmlWriter_WriteEndElement(writer); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = GetHGlobalFromStream(stream, &hglobal); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = IXmlWriter_Flush(writer); - ok(hr == S_OK, "got 0x%08x\n", hr); - - ptr = GlobalLock(hglobal); - ok(!strncmp(ptr, "<a><b /></a>", 12), "got %s\n", ptr); - GlobalUnlock(hglobal); - - IXmlWriter_Release(writer); - IStream_Release(stream); -} - -static void test_writeenddocument(void) -{ + hr = IXmlWriter_WriteComment(writer, aW); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteComment(writer, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteComment(writer, closeW); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_Flush(writer); + ok(hr == S_OK, "got 0x%08x\n", hr); + + CHECK_OUTPUT(stream, "<!--a--><b><!--a--><!----><!--- ->-->"); + + IXmlWriter_Release(writer); + IStream_Release(stream); +} + +static void test_WriteCData(void) +{ + static const WCHAR closeW[] = {']',']','>',0}; + static const WCHAR close2W[] = {'a',']',']','>','b',0}; static const WCHAR aW[] = {'a',0}; static const WCHAR bW[] = {'b',0}; IXmlWriter *writer; IStream *stream; - HGLOBAL hglobal; - HRESULT hr; - char *ptr; - - hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); - ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + HRESULT hr; + + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + + hr = IXmlWriter_SetProperty(writer, XmlWriterProperty_OmitXmlDeclaration, TRUE); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteCData(writer, aW); + ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr); + + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteStartElement(writer, NULL, bW, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteCData(writer, aW); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteCData(writer, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteCData(writer, closeW); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteCData(writer, close2W); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_Flush(writer); + ok(hr == S_OK, "got 0x%08x\n", hr); + + CHECK_OUTPUT(stream, + "<b>" + "<![CDATA[a]]>" + "<![CDATA[]]>" + "<![CDATA[]]]]>" + "<![CDATA[>]]>" + "<![CDATA[a]]]]>" + "<![CDATA[>b]]>"); + + IXmlWriter_Release(writer); + IStream_Release(stream); +} + +static void test_WriteRaw(void) +{ + static const WCHAR rawW[] = {'a','<',':',0}; + static const WCHAR aW[] = {'a',0}; + IXmlWriter *writer; + IStream *stream; + HRESULT hr; + + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + + hr = IXmlWriter_WriteRaw(writer, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteRaw(writer, rawW); + ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr); + + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteRaw(writer, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteRaw(writer, rawW); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteRaw(writer, rawW); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteComment(writer, rawW); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteRaw(writer, rawW); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteElementString(writer, NULL, aW, NULL, aW); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteComment(writer, rawW); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); hr = IXmlWriter_WriteEndDocument(writer); - ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr); - - hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream); - ok(hr == S_OK, "got 0x%08x\n", hr); - - /* WriteEndDocument resets it to initial state */ + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteRaw(writer, rawW); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + hr = IXmlWriter_Flush(writer); + ok(hr == S_OK, "got 0x%08x\n", hr); + + CHECK_OUTPUT(stream, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>a<:a<:<!--a<:-->a<:<a>a</a>"); + + IXmlWriter_Release(writer); + IStream_Release(stream); +} + +static void test_writer_state(void) +{ + static const WCHAR aW[] = {'a',0}; + IXmlWriter *writer; + IStream *stream; + HRESULT hr; + + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + + /* initial state */ + check_writer_state(writer, E_UNEXPECTED); + + /* set output and call 'wrong' method, WriteEndElement */ + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteEndElement(writer); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + check_writer_state(writer, WR_E_INVALIDACTION); + IStream_Release(stream); + + /* WriteAttributeString */ + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteAttributeString(writer, NULL, aW, NULL, aW); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + check_writer_state(writer, WR_E_INVALIDACTION); + IStream_Release(stream); + + /* WriteEndDocument */ + stream = writer_set_output(writer); + hr = IXmlWriter_WriteEndDocument(writer); ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); - hr = IXmlWriter_WriteEndDocument(writer); - ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); - - hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit); - ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); - - hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL); - ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); - - hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = IXmlWriter_WriteStartElement(writer, NULL, bW, NULL); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = IXmlWriter_WriteEndDocument(writer); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = GetHGlobalFromStream(stream, &hglobal); - ok(hr == S_OK, "got 0x%08x\n", hr); - - ptr = GlobalLock(hglobal); - ok(ptr == NULL, "got %p\n", ptr); - - /* we still need to flush manually, WriteEndDocument doesn't do that */ - hr = IXmlWriter_Flush(writer); - ok(hr == S_OK, "got 0x%08x\n", hr); - - ptr = GlobalLock(hglobal); - ok(ptr != NULL, "got %p\n", ptr); - ok(!strncmp(ptr, "<a><b /></a>", 12), "got %s\n", ptr); - GlobalUnlock(hglobal); - - IXmlWriter_Release(writer); - IStream_Release(stream); + check_writer_state(writer, WR_E_INVALIDACTION); + IStream_Release(stream); + + /* WriteFullEndElement */ + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteFullEndElement(writer); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + check_writer_state(writer, WR_E_INVALIDACTION); + IStream_Release(stream); + + /* WriteCData */ + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteCData(writer, aW); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + check_writer_state(writer, WR_E_INVALIDACTION); + IStream_Release(stream); + + /* WriteName */ + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteName(writer, aW); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + check_writer_state(writer, WR_E_INVALIDACTION); + IStream_Release(stream); + + /* WriteNmToken */ + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteNmToken(writer, aW); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + check_writer_state(writer, WR_E_INVALIDACTION); + IStream_Release(stream); + + /* WriteString */ + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteString(writer, aW); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + check_writer_state(writer, WR_E_INVALIDACTION); + IStream_Release(stream); + + IXmlWriter_Release(writer); } START_TEST(writer) { - if (!init_pointers()) - return; - test_writer_create(); + test_writer_state(); test_writeroutput(); test_writestartdocument(); test_writestartelement(); @@ -777,4 +1026,7 @@ test_omitxmldeclaration(); test_bom(); test_writeenddocument(); -} + test_WriteComment(); + test_WriteCData(); + test_WriteRaw(); +}
8 years, 5 months
1
0
0
0
← Newer
1
...
31
32
33
34
35
36
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Results per page:
10
25
50
100
200