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
December 2019
----- 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
225 discussions
Start a n
N
ew thread
[reactos] 01/01: [WBEMPROX] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=628f4c996cc4a80294369…
commit 628f4c996cc4a80294369e10ef07e02e6607e248 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Dec 1 19:45:00 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Dec 1 19:45:00 2019 +0100 [WBEMPROX] Sync with Wine Staging 4.18. CORE-16441 --- dll/win32/wbemprox/builtin.c | 1708 ++++++++++++++++++++++++++------- dll/win32/wbemprox/class.c | 89 +- dll/win32/wbemprox/main.c | 2 - dll/win32/wbemprox/precomp.h | 2 - dll/win32/wbemprox/process.c | 1 - dll/win32/wbemprox/qualifier.c | 73 +- dll/win32/wbemprox/query.c | 702 ++++++++++---- dll/win32/wbemprox/reg.c | 1 - dll/win32/wbemprox/security.c | 1 - dll/win32/wbemprox/service.c | 1 - dll/win32/wbemprox/services.c | 68 +- dll/win32/wbemprox/table.c | 31 +- dll/win32/wbemprox/wbemlocator.c | 17 +- dll/win32/wbemprox/wbemprox_private.h | 66 +- dll/win32/wbemprox/wql.tab.c | 827 +++++++++------- dll/win32/wbemprox/wql.tab.h | 43 +- dll/win32/wbemprox/wql.y | 182 +++- media/doc/README.WINE | 2 +- 18 files changed, 2756 insertions(+), 1060 deletions(-) diff --git a/dll/win32/wbemprox/builtin.c b/dll/win32/wbemprox/builtin.c index 5f689635cf0..b92231c8152 100644 --- a/dll/win32/wbemprox/builtin.c +++ b/dll/win32/wbemprox/builtin.c @@ -20,32 +20,17 @@ #define NONAMELESSUNION #define NONAMELESSSTRUCT -#include "config.h" #include <stdarg.h> -#include <fcntl.h> -#ifdef HAVE_UNISTD_H -# include <unistd.h> -#endif -#ifdef HAVE_ARPA_INET_H -# include <arpa/inet.h> +#ifdef __REACTOS__ +#include <wchar.h> #endif #include "ntstatus.h" #define WIN32_NO_STATUS #include "windef.h" #include "winbase.h" -#ifdef __MINGW32__ -# include "winsock2.h" -# include "ws2tcpip.h" -# define WS_AF_INET AF_INET -# define WS_AF_UNSPEC AF_UNSPEC -# define WS_NI_MAXHOST NI_MAXHOST -# define WS_NI_NAMEREQD NI_NAMEREQD -#else -# define USE_WS_PREFIX -# include "winsock2.h" -# include "ws2tcpip.h" -#endif +#include "winsock2.h" +#include "ws2tcpip.h" #include "initguid.h" #include "wbemcli.h" #include "wbemprov.h" @@ -68,11 +53,14 @@ #include "winspool.h" #include "setupapi.h" +#include "wine/asm.h" #include "wine/debug.h" #include "wbemprox_private.h" WINE_DEFAULT_DEBUG_CHANNEL(wbemprox); +static const WCHAR class_associatorsW[] = + {'_','_','A','S','S','O','C','I','A','T','O','R','S',0}; static const WCHAR class_baseboardW[] = {'W','i','n','3','2','_','B','a','s','e','B','o','a','r','d',0}; static const WCHAR class_biosW[] = @@ -91,20 +79,27 @@ static const WCHAR class_directoryW[] = {'W','i','n','3','2','_','D','i','r','e','c','t','o','r','y',0}; static const WCHAR class_diskdriveW[] = {'W','i','n','3','2','_','D','i','s','k','D','r','i','v','e',0}; +static const WCHAR class_diskdrivetodiskpartitionW[] = + {'W','i','n','3','2','_','D','i','s','k','D','r','i','v','e','T','o','D','i','s','k','P','a','r','t','i','t','i','o','n',0}; static const WCHAR class_diskpartitionW[] = {'W','i','n','3','2','_','D','i','s','k','P','a','r','t','i','t','i','o','n',0}; +static const WCHAR class_displaycontrollerconfigW[] = + {'W','i','n','3','2','_','D','i','s','p','l','a','y','C','o','n','t','r','o','l','l','e','r', + 'C','o','n','f','i','g','u','r','a','t','i','o','n',0}; static const WCHAR class_ip4routetableW[] = {'W','i','n','3','2','_','I','P','4','R','o','u','t','e','T','a','b','l','e',0}; static const WCHAR class_logicaldiskW[] = {'W','i','n','3','2','_','L','o','g','i','c','a','l','D','i','s','k',0}; static const WCHAR class_logicaldisk2W[] = {'C','I','M','_','L','o','g','i','c','a','l','D','i','s','k',0}; +static const WCHAR class_logicaldisktopartitionW[] = + {'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 class_networkadapterW[] = {'W','i','n','3','2','_','N','e','t','w','o','r','k','A','d','a','p','t','e','r',0}; static const WCHAR class_networkadapterconfigW[] = {'W','i','n','3','2','_','N','e','t','w','o','r','k','A','d','a','p','t','e','r', 'C','o','n','f','i','g','u','r','a','t','i','o','n',0}; -static const WCHAR class_osW[] = +static const WCHAR class_operatingsystemW[] = {'W','i','n','3','2','_','O','p','e','r','a','t','i','n','g','S','y','s','t','e','m',0}; static const WCHAR class_paramsW[] = {'_','_','P','A','R','A','M','E','T','E','R','S',0}; @@ -125,6 +120,8 @@ static const WCHAR class_processor2W[] = {'C','I','M','_','P','r','o','c','e','s','s','o','r',0}; static const WCHAR class_qualifiersW[] = {'_','_','Q','U','A','L','I','F','I','E','R','S',0}; +static const WCHAR class_quickfixengineeringW[] = + {'W','i','n','3','2','_','Q','u','i','c','k','F','i','x','E','n','g','i','n','e','e','r','i','n','g',0}; static const WCHAR class_sidW[] = {'W','i','n','3','2','_','S','I','D',0}; static const WCHAR class_sounddeviceW[] = @@ -135,6 +132,8 @@ static const WCHAR class_systemenclosureW[] = static const WCHAR class_videocontrollerW[] = {'W','i','n','3','2','_','V','i','d','e','o','C','o','n','t','r','o','l','l','e','r',0}; #endif +static const WCHAR class_winsatW[] = + {'W','i','n','3','2','_','W','i','n','S','A','T',0}; static const WCHAR prop_accountnameW[] = {'A','c','c','o','u','n','t','N','a','m','e',0}; @@ -152,10 +151,18 @@ static const WCHAR prop_adapterramW[] = #endif static const WCHAR prop_adaptertypeW[] = {'A','d','a','p','t','e','r','T','y','p','e',0}; +static const WCHAR prop_adaptertypeidW[] = + {'A','d','a','p','t','e','r','T','y','p','e','I','D',0}; static const WCHAR prop_addresswidthW[] = {'A','d','d','r','e','s','s','W','i','d','t','h',0}; +static const WCHAR prop_antecedentW[] = + {'A','n','t','e','c','e','d','e','n','t',0}; static const WCHAR prop_architectureW[] = {'A','r','c','h','i','t','e','c','t','u','r','e',0}; +static const WCHAR prop_assocclassW[] = + {'A','s','s','o','c','C','l','a','s','s',0}; +static const WCHAR prop_associatorW[] = + {'A','s','s','o','c','i','a','t','o','r',0}; static const WCHAR prop_attributesW[] = {'A','t','t','r','i','b','u','t','e','s',0}; #ifndef __REACTOS__ @@ -164,6 +171,10 @@ static const WCHAR prop_availabilityW[] = #endif static const WCHAR prop_binaryrepresentationW[] = {'B','i','n','a','r','y','R','e','p','r','e','s','e','n','t','a','t','i','o','n',0}; +static const WCHAR prop_bitsperpixelW[] = + {'B','i','t','s','P','e','r','P','i','x','e','l',0}; +static const WCHAR prop_boolvalueW[] = + {'B','o','o','l','V','a','l','u','e',0}; static const WCHAR prop_bootableW[] = {'B','o','o','t','a','b','l','e',0}; static const WCHAR prop_bootpartitionW[] = @@ -184,44 +195,60 @@ static const WCHAR prop_commandlineW[] = {'C','o','m','m','a','n','d','L','i','n','e',0}; static const WCHAR prop_configmanagererrorcodeW[] = {'C','o','n','f','i','g','M','a','n','a','g','e','r','E','r','r','o','r','C','o','d','e',0}; +static const WCHAR prop_configuredclockspeedW[] = + {'C','o','n','f','i','g','u','r','e','d','C','l','o','c','k','S','p','e','e','d',0}; static const WCHAR prop_countrycodeW[] = {'C','o','u','n','t','r','y','C','o','d','e',0}; +static const WCHAR prop_cpuscoreW[] = + {'C','P','U','S','c','o','r','e',0}; static const WCHAR prop_cpustatusW[] = {'C','p','u','S','t','a','t','u','s',0}; static const WCHAR prop_csdversionW[] = {'C','S','D','V','e','r','s','i','o','n',0}; +static const WCHAR prop_csnameW[] = + {'C','S','N','a','m','e',0}; #ifndef __REACTOS__ static const WCHAR prop_currentbitsperpixelW[] = {'C','u','r','r','e','n','t','B','i','t','s','P','e','r','P','i','x','e','l',0}; #endif static const WCHAR prop_currentclockspeedW[] = {'C','u','r','r','e','n','t','C','l','o','c','k','S','p','e','e','d',0}; -#ifndef __REACTOS__ static const WCHAR prop_currenthorizontalresW[] = {'C','u','r','r','e','n','t','H','o','r','i','z','o','n','t','a','l','R','e','s','o','l','u','t','i','o','n',0}; +static const WCHAR prop_currentlanguageW[] = + {'C','u','r','r','e','n','t','L','a','n','g','u','a','g','e',0}; static const WCHAR prop_currentrefreshrateW[] = {'C','u','r','r','e','n','t','R','e','f','r','e','s','h','R','a','t','e',0}; static const WCHAR prop_currentscanmodeW[] = {'C','u','r','r','e','n','t','S','c','a','n','M','o','d','e',0}; +static const WCHAR prop_currenttimezoneW[] = + {'C','u','r','r','e','n','t','T','i','m','e','Z','o','n','e',0}; static const WCHAR prop_currentverticalresW[] = {'C','u','r','r','e','n','t','V','e','r','t','i','c','a','l','R','e','s','o','l','u','t','i','o','n',0}; -#endif +static const WCHAR prop_d3dscoreW[] = + {'D','3','D','S','c','o','r','e',0}; static const WCHAR prop_datawidthW[] = {'D','a','t','a','W','i','d','t','h',0}; static const WCHAR prop_defaultipgatewayW[] = {'D','e','f','a','u','l','t','I','P','G','a','t','e','w','a','y',0}; static const WCHAR prop_defaultvalueW[] = {'D','e','f','a','u','l','t','V','a','l','u','e',0}; +static const WCHAR prop_dependentW[] = + {'D','e','p','e','n','d','e','n','t',0}; static const WCHAR prop_descriptionW[] = {'D','e','s','c','r','i','p','t','i','o','n',0}; static const WCHAR prop_destinationW[] = {'D','e','s','t','i','n','a','t','i','o','n',0}; static const WCHAR prop_deviceidW[] = {'D','e','v','i','c','e','I','d',0}; +static const WCHAR prop_devicelocatorW[] = + {'D','e','v','i','c','e','L','o','c','a','t','o','r',0}; static const WCHAR prop_dhcpenabledW[] = {'D','H','C','P','E','n','a','b','l','e','d',0}; static const WCHAR prop_directionW[] = {'D','i','r','e','c','t','i','o','n',0}; +static const WCHAR prop_diskscoreW[] = + {'D','i','s','k','S','c','o','r','e',0}; static const WCHAR prop_displaynameW[] = {'D','i','s','p','l','a','y','N','a','m','e',0}; static const WCHAR prop_diskindexW[] = @@ -258,8 +285,12 @@ static const WCHAR prop_freephysicalmemoryW[] = {'F','r','e','e','P','h','y','s','i','c','a','l','M','e','m','o','r','y',0}; static const WCHAR prop_handleW[] = {'H','a','n','d','l','e',0}; +static const WCHAR prop_graphicsscoreW[] = + {'G','r','a','p','h','i','c','s','S','c','o','r','e',0}; static const WCHAR prop_horizontalresolutionW[] = {'H','o','r','i','z','o','n','t','a','l','R','e','s','o','l','u','t','i','o','n',0}; +static const WCHAR prop_hotfixidW[] = + {'H','o','t','F','i','x','I','D',0}; static const WCHAR prop_idW[] = {'I','D',0}; static const WCHAR prop_identificationcodeW[] = @@ -310,6 +341,8 @@ static const WCHAR prop_mediatypeW[] = {'M','e','d','i','a','T','y','p','e',0}; static const WCHAR prop_memberW[] = {'M','e','m','b','e','r',0}; +static const WCHAR prop_memoryscoreW[] = + {'M','e','m','o','r','y','S','c','o','r','e',0}; static const WCHAR prop_memorytypeW[] = {'M','e','m','o','r','y','T','y','p','e',0}; static const WCHAR prop_methodW[] = @@ -328,6 +361,8 @@ static const WCHAR prop_numlogicalprocessorsW[] = {'N','u','m','b','e','r','O','f','L','o','g','i','c','a','l','P','r','o','c','e','s','s','o','r','s',0}; static const WCHAR prop_numprocessorsW[] = {'N','u','m','b','e','r','O','f','P','r','o','c','e','s','s','o','r','s',0}; +static const WCHAR prop_operatingsystemskuW[] = + {'O','p','e','r','a','t','i','n','g','S','y','s','t','e','m','S','K','U',0}; static const WCHAR prop_osarchitectureW[] = {'O','S','A','r','c','h','i','t','e','c','t','u','r','e',0}; static const WCHAR prop_oslanguageW[] = @@ -338,6 +373,8 @@ static const WCHAR prop_ostypeW[] = {'O','S','T','y','p','e',0}; static const WCHAR prop_parameterW[] = {'P','a','r','a','m','e','t','e','r',0}; +static const WCHAR prop_partnumberW[] = + {'P','a','r','t','N','u','m','b','e','r',0}; static const WCHAR prop_physicaladapterW[] = {'P','h','y','s','i','c','a','l','A','d','a','p','t','e','r',0}; static const WCHAR prop_pixelsperxlogicalinchW[] = @@ -408,12 +445,16 @@ static const WCHAR prop_suitemaskW[] = {'S','u','i','t','e','M','a','s','k',0}; static const WCHAR prop_systemdirectoryW[] = {'S','y','s','t','e','m','D','i','r','e','c','t','o','r','y',0}; +static const WCHAR prop_systemdriveW[] = + {'S','y','s','t','e','m','D','r','i','v','e',0}; static const WCHAR prop_systemnameW[] = {'S','y','s','t','e','m','N','a','m','e',0}; static const WCHAR prop_tagW[] = {'T','a','g',0}; static const WCHAR prop_threadcountW[] = {'T','h','r','e','a','d','C','o','u','n','t',0}; +static const WCHAR prop_timetakenW[] = + {'T','i','m','e','T','a','k','e','n',0}; static const WCHAR prop_totalphysicalmemoryW[] = {'T','o','t','a','l','P','h','y','s','i','c','a','l','M','e','m','o','r','y',0}; static const WCHAR prop_totalvirtualmemorysizeW[] = @@ -428,12 +469,12 @@ static const WCHAR prop_usernameW[] = {'U','s','e','r','N','a','m','e',0}; static const WCHAR prop_uuidW[] = {'U','U','I','D',0}; -static const WCHAR prop_varianttypeW[] = - {'V','a','r','i','a','n','t','T','y','p','e',0}; static const WCHAR prop_vendorW[] = {'V','e','n','d','o','r',0}; static const WCHAR prop_versionW[] = {'V','e','r','s','i','o','n',0}; +static const WCHAR prop_verticalresolutionW[] = + {'V','e','r','t','i','c','a','l','R','e','s','o','l','u','t','i','o','n',0}; #ifndef __REACTOS__ static const WCHAR prop_videoarchitectureW[] = {'V','i','d','e','o','A','r','c','h','i','t','e','c','t','u','r','e',0}; @@ -448,31 +489,42 @@ static const WCHAR prop_volumenameW[] = {'V','o','l','u','m','e','N','a','m','e',0}; static const WCHAR prop_volumeserialnumberW[] = {'V','o','l','u','m','e','S','e','r','i','a','l','N','u','m','b','e','r',0}; +static const WCHAR prop_winsatassessmentstateW[] = + {'W','i','n','S','A','T','A','s','s','e','s','s','m','e','n','t','S','t','a','t','e',0}; +static const WCHAR prop_winsprlevelW[] = + {'W','i','n','S','P','R','L','e','v','e','l',0}; static const WCHAR prop_workingsetsizeW[] = {'W','o','r','k','i','n','g','S','e','t','S','i','z','e',0}; /* column definitions must be kept in sync with record structures below */ +static const struct column col_associator[] = +{ + { prop_assocclassW, CIM_STRING }, + { prop_classW, CIM_STRING }, + { prop_associatorW, CIM_STRING } +}; static const struct column col_baseboard[] = { - { prop_manufacturerW, CIM_STRING }, + { prop_manufacturerW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_modelW, CIM_STRING }, { prop_nameW, CIM_STRING }, - { prop_productW, CIM_STRING }, - { prop_serialnumberW, CIM_STRING }, + { prop_productW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_serialnumberW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_tagW, CIM_STRING|COL_FLAG_KEY }, - { prop_versionW, CIM_STRING } + { prop_versionW, CIM_STRING|COL_FLAG_DYNAMIC } }; static const struct column col_bios[] = { + { prop_currentlanguageW, CIM_STRING }, { prop_descriptionW, CIM_STRING }, { prop_identificationcodeW, CIM_STRING }, - { prop_manufacturerW, CIM_STRING }, + { prop_manufacturerW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_nameW, CIM_STRING }, - { prop_releasedateW, CIM_DATETIME }, + { prop_releasedateW, CIM_DATETIME|COL_FLAG_DYNAMIC }, { prop_serialnumberW, CIM_STRING }, - { prop_smbiosbiosversionW, CIM_STRING }, - { prop_smbiosmajorversionW, CIM_UINT16, VT_I4 }, - { prop_smbiosminorversionW, CIM_UINT16, VT_I4 }, + { prop_smbiosbiosversionW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_smbiosmajorversionW, CIM_UINT16 }, + { prop_smbiosminorversionW, CIM_UINT16 }, { prop_versionW, CIM_STRING|COL_FLAG_KEY } }; static const struct column col_cdromdrive[] = @@ -487,23 +539,23 @@ static const struct column col_compsys[] = { { prop_descriptionW, CIM_STRING }, { prop_domainW, CIM_STRING }, - { prop_domainroleW, CIM_UINT16, VT_I4 }, + { prop_domainroleW, CIM_UINT16 }, { prop_manufacturerW, CIM_STRING }, { prop_modelW, CIM_STRING }, { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC }, - { prop_numlogicalprocessorsW, CIM_UINT32, VT_I4 }, - { prop_numprocessorsW, CIM_UINT32, VT_I4 }, + { prop_numlogicalprocessorsW, CIM_UINT32 }, + { prop_numprocessorsW, CIM_UINT32 }, { prop_totalphysicalmemoryW, CIM_UINT64 }, { prop_usernameW, CIM_STRING|COL_FLAG_DYNAMIC } }; static const struct column col_compsysproduct[] = { - { prop_identifyingnumberW, CIM_STRING|COL_FLAG_KEY }, - { prop_nameW, CIM_STRING|COL_FLAG_KEY }, + { prop_identifyingnumberW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, + { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, { prop_skunumberW, CIM_STRING }, { prop_uuidW, CIM_STRING|COL_FLAG_DYNAMIC }, - { prop_vendorW, CIM_STRING }, - { prop_versionW, CIM_STRING|COL_FLAG_KEY } + { prop_vendorW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_versionW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY } }; static const struct column col_datafile[] = { @@ -522,7 +574,7 @@ static const struct column col_directory[] = static const struct column col_diskdrive[] = { { prop_deviceidW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, - { prop_indexW, CIM_UINT32, VT_I4 }, + { prop_indexW, CIM_UINT32 }, { prop_interfacetypeW, CIM_STRING }, { prop_manufacturerW, CIM_STRING }, { prop_mediatypeW, CIM_STRING }, @@ -531,18 +583,31 @@ static const struct column col_diskdrive[] = { prop_serialnumberW, CIM_STRING }, { prop_sizeW, CIM_UINT64 } }; +static const struct column col_diskdrivetodiskpartition[] = +{ + { prop_antecedentW, CIM_REFERENCE|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, + { prop_dependentW, CIM_REFERENCE|COL_FLAG_DYNAMIC|COL_FLAG_KEY } +}; static const struct column col_diskpartition[] = { { prop_bootableW, CIM_BOOLEAN }, { prop_bootpartitionW, CIM_BOOLEAN }, { prop_deviceidW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, - { prop_diskindexW, CIM_UINT32, VT_I4 }, - { prop_indexW, CIM_UINT32, VT_I4 }, + { prop_diskindexW, CIM_UINT32 }, + { prop_indexW, CIM_UINT32 }, { prop_pnpdeviceidW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_sizeW, CIM_UINT64 }, { prop_startingoffsetW, CIM_UINT64 }, { prop_typeW, CIM_STRING|COL_FLAG_DYNAMIC } }; +static const struct column col_displaycontrollerconfig[] = +{ + { prop_bitsperpixelW, CIM_UINT32 }, + { prop_captionW, CIM_STRING }, + { prop_horizontalresolutionW, CIM_UINT32 }, + { prop_nameW, CIM_STRING|COL_FLAG_KEY }, + { prop_verticalresolutionW, CIM_UINT32 } +}; static const struct column col_ip4routetable[] = { { prop_destinationW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, @@ -552,7 +617,7 @@ static const struct column col_ip4routetable[] = static const struct column col_logicaldisk[] = { { prop_deviceidW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, - { prop_drivetypeW, CIM_UINT32, VT_I4 }, + { prop_drivetypeW, CIM_UINT32 }, { prop_filesystemW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_freespaceW, CIM_UINT64 }, { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC }, @@ -560,16 +625,23 @@ static const struct column col_logicaldisk[] = { prop_volumenameW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_volumeserialnumberW, CIM_STRING|COL_FLAG_DYNAMIC } }; +static const struct column col_logicaldisktopartition[] = +{ + { prop_antecedentW, CIM_REFERENCE|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, + { prop_dependentW, CIM_REFERENCE|COL_FLAG_DYNAMIC|COL_FLAG_KEY } +}; static const struct column col_networkadapter[] = { { prop_adaptertypeW, CIM_STRING }, + { prop_adaptertypeidW, CIM_UINT16 }, + { prop_descriptionW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_deviceidW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, - { prop_indexW, CIM_UINT32, VT_I4 }, - { prop_interfaceindexW, CIM_UINT32, VT_I4 }, + { prop_indexW, CIM_UINT32 }, + { prop_interfaceindexW, CIM_UINT32 }, { prop_macaddressW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_manufacturerW, CIM_STRING }, { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC }, - { prop_netconnectionstatusW, CIM_UINT16, VT_I4 }, + { prop_netconnectionstatusW, CIM_UINT16 }, { prop_physicaladapterW, CIM_BOOLEAN }, { prop_pnpdeviceidW, CIM_STRING }, { prop_speedW, CIM_UINT64 } @@ -581,37 +653,42 @@ static const struct column col_networkadapterconfig[] = { prop_dhcpenabledW, CIM_BOOLEAN }, { prop_dnshostnameW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_dnsserversearchorderW, CIM_STRING|CIM_FLAG_ARRAY|COL_FLAG_DYNAMIC }, - { prop_indexW, CIM_UINT32|COL_FLAG_KEY, VT_I4 }, + { prop_indexW, CIM_UINT32|COL_FLAG_KEY }, { prop_ipaddressW, CIM_STRING|CIM_FLAG_ARRAY|COL_FLAG_DYNAMIC }, - { prop_ipconnectionmetricW, CIM_UINT32, VT_I4 }, + { prop_ipconnectionmetricW, CIM_UINT32 }, { prop_ipenabledW, CIM_BOOLEAN }, { prop_ipsubnet, CIM_STRING|CIM_FLAG_ARRAY|COL_FLAG_DYNAMIC }, { prop_macaddressW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_settingidW, CIM_STRING|COL_FLAG_DYNAMIC } }; -static const struct column col_os[] = +static const struct column col_operatingsystem[] = { { prop_buildnumberW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_captionW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_codesetW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_countrycodeW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_csdversionW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_csnameW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_currenttimezoneW, CIM_SINT16 }, { prop_freephysicalmemoryW, CIM_UINT64 }, { prop_installdateW, CIM_DATETIME }, { prop_lastbootuptimeW, CIM_DATETIME|COL_FLAG_DYNAMIC }, { prop_localdatetimeW, CIM_DATETIME|COL_FLAG_DYNAMIC }, { prop_localeW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_manufacturerW, CIM_STRING }, { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_operatingsystemskuW, CIM_UINT32 }, { prop_osarchitectureW, CIM_STRING }, - { prop_oslanguageW, CIM_UINT32, VT_I4 }, - { prop_osproductsuiteW, CIM_UINT32, VT_I4 }, - { prop_ostypeW, CIM_UINT16, VT_I4 }, + { prop_oslanguageW, CIM_UINT32 }, + { prop_osproductsuiteW, CIM_UINT32 }, + { prop_ostypeW, CIM_UINT16 }, { prop_primaryW, CIM_BOOLEAN }, { prop_serialnumberW, CIM_STRING }, - { prop_servicepackmajorW, CIM_UINT16, VT_I4 }, - { prop_servicepackminorW, CIM_UINT16, VT_I4 }, - { prop_suitemaskW, CIM_UINT32, VT_I4 }, + { prop_servicepackmajorW, CIM_UINT16 }, + { prop_servicepackminorW, CIM_UINT16 }, + { prop_suitemaskW, CIM_UINT32 }, { prop_systemdirectoryW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_systemdriveW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_totalvirtualmemorysizeW, CIM_UINT64 }, { prop_totalvisiblememorysizeW, CIM_UINT64 }, { prop_versionW, CIM_STRING|COL_FLAG_DYNAMIC } @@ -623,7 +700,6 @@ static const struct column col_param[] = { prop_directionW, CIM_SINT32 }, { prop_parameterW, CIM_STRING }, { prop_typeW, CIM_UINT32 }, - { prop_varianttypeW, CIM_UINT32 }, { prop_defaultvalueW, CIM_UINT32 } }; static const struct column col_physicalmedia[] = @@ -633,8 +709,11 @@ static const struct column col_physicalmedia[] = }; static const struct column col_physicalmemory[] = { - { prop_capacityW, CIM_UINT64 }, - { prop_memorytypeW, CIM_UINT16, VT_I4 } + { prop_capacityW, CIM_UINT64 }, + { prop_configuredclockspeedW, CIM_UINT32 }, + { prop_devicelocatorW, CIM_STRING }, + { prop_memorytypeW, CIM_UINT16 }, + { prop_partnumberW, CIM_STRING } }; static const struct column col_pnpentity[] = { @@ -659,45 +738,51 @@ static const struct column col_process[] = { prop_descriptionW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_handleW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC }, - { prop_pprocessidW, CIM_UINT32, VT_I4 }, - { prop_processidW, CIM_UINT32, VT_I4 }, - { prop_threadcountW, CIM_UINT32, VT_I4 }, + { prop_pprocessidW, CIM_UINT32 }, + { prop_processidW, CIM_UINT32 }, + { prop_threadcountW, CIM_UINT32 }, { prop_workingsetsizeW, CIM_UINT64 }, /* methods */ { method_getownerW, CIM_FLAG_ARRAY|COL_FLAG_METHOD } }; static const struct column col_processor[] = { - { prop_addresswidthW, CIM_UINT16, VT_I4 }, - { prop_architectureW, CIM_UINT16, VT_I4 }, + { prop_addresswidthW, CIM_UINT16 }, + { prop_architectureW, CIM_UINT16 }, { prop_captionW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_cpustatusW, CIM_UINT16 }, - { prop_currentclockspeedW, CIM_UINT32, VT_I4 }, - { prop_datawidthW, CIM_UINT16, VT_I4 }, + { prop_currentclockspeedW, CIM_UINT32 }, + { prop_datawidthW, CIM_UINT16 }, { prop_descriptionW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_deviceidW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, - { prop_familyW, CIM_UINT16, VT_I4 }, - { prop_levelW, CIM_UINT16, VT_I4 }, + { prop_familyW, CIM_UINT16 }, + { prop_levelW, CIM_UINT16 }, { prop_manufacturerW, CIM_STRING|COL_FLAG_DYNAMIC }, - { prop_maxclockspeedW, CIM_UINT32, VT_I4 }, + { prop_maxclockspeedW, CIM_UINT32 }, { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC }, - { prop_numcoresW, CIM_UINT32, VT_I4 }, - { prop_numlogicalprocessorsW, CIM_UINT32, VT_I4 }, + { prop_numcoresW, CIM_UINT32 }, + { prop_numlogicalprocessorsW, CIM_UINT32 }, { prop_processoridW, CIM_STRING|COL_FLAG_DYNAMIC }, - { prop_processortypeW, CIM_UINT16, VT_I4 }, - { prop_revisionW, CIM_UINT16, VT_I4 }, + { prop_processortypeW, CIM_UINT16 }, + { prop_revisionW, CIM_UINT16 }, { prop_uniqueidW, CIM_STRING }, { prop_versionW, CIM_STRING|COL_FLAG_DYNAMIC } }; static const struct column col_qualifier[] = { - { prop_classW, CIM_STRING }, - { prop_memberW, CIM_STRING }, - { prop_typeW, CIM_UINT32 }, - { prop_flavorW, CIM_SINT32 }, - { prop_nameW, CIM_STRING }, - { prop_intvalueW, CIM_SINT32 }, - { prop_strvalueW, CIM_STRING } + { prop_classW, CIM_STRING }, + { prop_memberW, CIM_STRING }, + { prop_typeW, CIM_UINT32 }, + { prop_flavorW, CIM_SINT32 }, + { prop_nameW, CIM_STRING }, + { prop_intvalueW, CIM_SINT32 }, + { prop_strvalueW, CIM_STRING }, + { prop_boolvalueW, CIM_BOOLEAN } +}; +static const struct column col_quickfixengineering[] = +{ + { prop_captionW, CIM_STRING }, + { prop_hotfixidW, CIM_STRING|COL_FLAG_KEY } }; static const struct column col_service[] = { @@ -728,7 +813,7 @@ static const struct column col_sounddevice[] = { { prop_nameW, CIM_STRING }, { prop_productnameW, CIM_STRING }, - { prop_statusinfoW, CIM_UINT16, VT_I4 } + { prop_statusinfoW, CIM_UINT16 } }; static const struct column col_stdregprov[] = { @@ -740,10 +825,10 @@ static const struct column col_stdregprov[] = static const struct column col_systemenclosure[] = { { prop_captionW, CIM_STRING }, - { prop_chassistypesW, CIM_UINT16|CIM_FLAG_ARRAY, VT_I4|VT_ARRAY }, + { prop_chassistypesW, CIM_UINT16|CIM_FLAG_ARRAY|COL_FLAG_DYNAMIC }, { prop_descriptionW, CIM_STRING }, { prop_lockpresentW, CIM_BOOLEAN }, - { prop_manufacturerW, CIM_STRING }, + { prop_manufacturerW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_nameW, CIM_STRING }, { prop_tagW, CIM_STRING }, }; @@ -757,15 +842,15 @@ static const struct column col_systemsecurity[] = static const struct column col_videocontroller[] = { { prop_adapterdactypeW, CIM_STRING }, - { prop_adapterramW, CIM_UINT32, VT_I4 }, + { prop_adapterramW, CIM_UINT32 }, { prop_availabilityW, CIM_UINT16 }, { prop_captionW, CIM_STRING|COL_FLAG_DYNAMIC }, - { prop_configmanagererrorcodeW, CIM_UINT32, VT_I4 }, - { prop_currentbitsperpixelW, CIM_UINT32, VT_I4 }, - { prop_currenthorizontalresW, CIM_UINT32, VT_I4 }, - { prop_currentrefreshrateW, CIM_UINT32, VT_I4 }, - { prop_currentscanmodeW, CIM_UINT16, VT_I4 }, - { prop_currentverticalresW, CIM_UINT32, VT_I4 }, + { prop_configmanagererrorcodeW, CIM_UINT32 }, + { prop_currentbitsperpixelW, CIM_UINT32 }, + { prop_currenthorizontalresW, CIM_UINT32 }, + { prop_currentrefreshrateW, CIM_UINT32 }, + { prop_currentscanmodeW, CIM_UINT16 }, + { prop_currentverticalresW, CIM_UINT32 }, { prop_descriptionW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_deviceidW, CIM_STRING|COL_FLAG_KEY }, { prop_driverdateW, CIM_DATETIME }, @@ -774,13 +859,26 @@ static const struct column col_videocontroller[] = { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_pnpdeviceidW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_statusW, CIM_STRING }, - { prop_videoarchitectureW, CIM_UINT16, VT_I4 }, - { prop_videomemorytypeW, CIM_UINT16, VT_I4 }, + { prop_videoarchitectureW, CIM_UINT16 }, + { prop_videomemorytypeW, CIM_UINT16 }, { prop_videomodedescriptionW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_videoprocessorW, CIM_STRING|COL_FLAG_DYNAMIC }, }; #endif +static const struct column col_winsat[] = +{ + { prop_cpuscoreW, CIM_REAL32 }, + { prop_d3dscoreW, CIM_REAL32 }, + { prop_diskscoreW, CIM_REAL32 }, + { prop_graphicsscoreW, CIM_REAL32 }, + { prop_memoryscoreW, CIM_REAL32 }, + { prop_timetakenW, CIM_STRING|COL_FLAG_KEY }, + { prop_winsatassessmentstateW, CIM_UINT32 }, + { prop_winsprlevelW, CIM_REAL32 }, +}; + + static const WCHAR baseboard_manufacturerW[] = {'I','n','t','e','l',' ','C','o','r','p','o','r','a','t','i','o','n',0}; static const WCHAR baseboard_serialnumberW[] = @@ -793,8 +891,6 @@ static const WCHAR bios_descriptionW[] = {'D','e','f','a','u','l','t',' ','S','y','s','t','e','m',' ','B','I','O','S',0}; static const WCHAR bios_manufacturerW[] = {'T','h','e',' ','W','i','n','e',' ','P','r','o','j','e','c','t',0}; -static const WCHAR bios_nameW[] = - {'W','I','N','E',' ','B','I','O','S',0}; static const WCHAR bios_releasedateW[] = {'2','0','1','2','0','6','0','8','0','0','0','0','0','0','.','0','0','0','0','0','0','+','0','0','0',0}; static const WCHAR bios_serialnumberW[] = @@ -859,6 +955,10 @@ static const WCHAR os_serialnumberW[] = {'1','2','3','4','5','-','O','E','M','-','1','2','3','4','5','6','7','-','1','2','3','4','5',0}; static const WCHAR physicalmedia_tagW[] = {'\\','\\','.','\\','P','H','Y','S','I','C','A','L','D','R','I','V','E','0',0}; +static const WCHAR quickfixengineering_captionW[] = + {'h','t','t','p',':','/','/','w','i','n','e','h','q','.','o','r','g',0}; +static const WCHAR quickfixengineering_hotfixidW[] = + {'K','B','1','2','3','4','5','6','7',0}; static const WCHAR sounddevice_productnameW[] = {'W','i','n','e',' ','A','u','d','i','o',' ','D','e','v','i','c','e',0}; static const WCHAR systemenclosure_systemenclosureW[] = @@ -867,7 +967,6 @@ static const WCHAR systemenclosure_tagW[] = {'S','y','s','t','e','m',' ','E','n','c','l','o','s','u','r','e',' ','0',0}; static const WCHAR systemenclosure_manufacturerW[] = {'W','i','n','e',0}; -#ifndef __REACTOS__ static const WCHAR videocontroller_dactypeW[] = {'I','n','t','e','g','r','a','t','e','d',' ','R','A','M','D','A','C',0}; static const WCHAR videocontroller_deviceidW[] = @@ -878,9 +977,16 @@ static const WCHAR videocontroller_driverversionW[] = {'1','.','0',0}; static const WCHAR videocontroller_statusW[] = {'O','K',0}; -#endif +static const WCHAR winsat_timetakenW[] = + {'M','o','s','t','R','e','c','e','n','t','A','s','s','e','s','s','m','e','n','t',0}; #include "pshpack1.h" +struct record_associator +{ + const WCHAR *assocclass; + const WCHAR *class; + const WCHAR *associator; +}; struct record_baseboard { const WCHAR *manufacturer; @@ -893,6 +999,7 @@ struct record_baseboard }; struct record_bios { + const WCHAR *currentlanguage; const WCHAR *description; const WCHAR *identificationcode; const WCHAR *manufacturer; @@ -960,6 +1067,11 @@ struct record_diskdrive const WCHAR *serialnumber; UINT64 size; }; +struct record_diskdrivetodiskpartition +{ + const WCHAR *antecedent; + const WCHAR *dependent; +}; struct record_diskpartition { int bootable; @@ -972,6 +1084,14 @@ struct record_diskpartition UINT64 startingoffset; const WCHAR *type; }; +struct record_displaycontrollerconfig +{ + UINT32 bitsperpixel; + const WCHAR *caption; + UINT32 horizontalresolution; + const WCHAR *name; + UINT32 verticalresolution; +}; struct record_ip4routetable { const WCHAR *destination; @@ -989,9 +1109,16 @@ struct record_logicaldisk const WCHAR *volumename; const WCHAR *volumeserialnumber; }; +struct record_logicaldisktopartition +{ + const WCHAR *antecedent; + const WCHAR *dependent; +}; struct record_networkadapter { const WCHAR *adaptertype; + UINT16 adaptertypeid; + const WCHAR *description; const WCHAR *device_id; UINT32 index; UINT32 interface_index; @@ -1025,12 +1152,16 @@ struct record_operatingsystem const WCHAR *codeset; const WCHAR *countrycode; const WCHAR *csdversion; + const WCHAR *csname; + INT16 currenttimezone; UINT64 freephysicalmemory; const WCHAR *installdate; const WCHAR *lastbootuptime; const WCHAR *localdatetime; const WCHAR *locale; + const WCHAR *manufacturer; const WCHAR *name; + UINT32 operatingsystemsku; const WCHAR *osarchitecture; UINT32 oslanguage; UINT32 osproductsuite; @@ -1041,6 +1172,7 @@ struct record_operatingsystem UINT16 servicepackminor; UINT32 suitemask; const WCHAR *systemdirectory; + const WCHAR *systemdrive; UINT64 totalvirtualmemorysize; UINT64 totalvisiblememorysize; const WCHAR *version; @@ -1052,7 +1184,6 @@ struct record_param INT32 direction; const WCHAR *parameter; UINT32 type; - UINT32 varianttype; UINT32 defaultvalue; }; struct record_physicalmedia @@ -1062,8 +1193,11 @@ struct record_physicalmedia }; struct record_physicalmemory { - UINT64 capacity; - UINT16 memorytype; + UINT64 capacity; + UINT32 configuredclockspeed; + const WCHAR *devicelocator; + UINT16 memorytype; + const WCHAR *partnumber; }; struct record_pnpentity { @@ -1127,6 +1261,12 @@ struct record_qualifier const WCHAR *name; INT32 intvalue; const WCHAR *strvalue; + int boolvalue; +}; +struct record_quickfixengineering +{ + const WCHAR *caption; + const WCHAR *hotfixid; }; struct record_service { @@ -1173,13 +1313,13 @@ struct record_systemsecurity }; struct record_systemenclosure { - const WCHAR *caption; + const WCHAR *caption; const struct array *chassistypes; - const WCHAR *description; - int lockpresent; - const WCHAR *manufacturer; - const WCHAR *name; - const WCHAR *tag; + const WCHAR *description; + int lockpresent; + const WCHAR *manufacturer; + const WCHAR *name; + const WCHAR *tag; }; struct record_videocontroller { @@ -1206,47 +1346,54 @@ struct record_videocontroller const WCHAR *videomodedescription; const WCHAR *videoprocessor; }; +struct record_winsat +{ + FLOAT cpuscore; + FLOAT d3dscore; + FLOAT diskscrore; + FLOAT graphicsscore; + FLOAT memoryscore; + const WCHAR *timetaken; + UINT32 winsatassessmentstate; + FLOAT winsprlevel; +}; #include "poppack.h" -static const struct record_baseboard data_baseboard[] = -{ - { baseboard_manufacturerW, baseboard_tagW, baseboard_tagW, baseboard_tagW, baseboard_serialnumberW, baseboard_versionW } -}; -static const struct record_bios data_bios[] = +static const struct record_associator data_associator[] = { - { bios_descriptionW, NULL, bios_manufacturerW, bios_nameW, bios_releasedateW, bios_serialnumberW, - bios_smbiosbiosversionW, 1, 0, bios_versionW } + { class_diskdrivetodiskpartitionW, class_diskpartitionW, class_diskdriveW }, + { class_logicaldisktopartitionW, class_logicaldiskW, class_diskpartitionW }, }; static const struct record_param data_param[] = { - { class_processW, method_getownerW, -1, param_returnvalueW, CIM_UINT32, VT_I4 }, + { class_processW, method_getownerW, -1, param_returnvalueW, CIM_UINT32 }, { class_processW, method_getownerW, -1, param_userW, CIM_STRING }, { class_processW, method_getownerW, -1, param_domainW, CIM_STRING }, - { class_serviceW, method_pauseserviceW, -1, param_returnvalueW, CIM_UINT32, VT_I4 }, - { class_serviceW, method_resumeserviceW, -1, param_returnvalueW, CIM_UINT32, VT_I4 }, - { class_serviceW, method_startserviceW, -1, param_returnvalueW, CIM_UINT32, VT_I4 }, - { class_serviceW, method_stopserviceW, -1, param_returnvalueW, CIM_UINT32, VT_I4 }, - { class_stdregprovW, method_createkeyW, 1, param_defkeyW, CIM_SINT32, 0, 0x80000002 }, + { class_serviceW, method_pauseserviceW, -1, param_returnvalueW, CIM_UINT32 }, + { class_serviceW, method_resumeserviceW, -1, param_returnvalueW, CIM_UINT32 }, + { class_serviceW, method_startserviceW, -1, param_returnvalueW, CIM_UINT32 }, + { class_serviceW, method_stopserviceW, -1, param_returnvalueW, CIM_UINT32 }, + { class_stdregprovW, method_createkeyW, 1, param_defkeyW, CIM_SINT32, 0x80000002 }, { class_stdregprovW, method_createkeyW, 1, param_subkeynameW, CIM_STRING }, - { class_stdregprovW, method_createkeyW, -1, param_returnvalueW, CIM_UINT32, VT_I4 }, - { class_stdregprovW, method_enumkeyW, 1, param_defkeyW, CIM_SINT32, 0, 0x80000002 }, + { class_stdregprovW, method_createkeyW, -1, param_returnvalueW, CIM_UINT32 }, + { class_stdregprovW, method_enumkeyW, 1, param_defkeyW, CIM_SINT32, 0x80000002 }, { class_stdregprovW, method_enumkeyW, 1, param_subkeynameW, CIM_STRING }, - { class_stdregprovW, method_enumkeyW, -1, param_returnvalueW, CIM_UINT32, VT_I4 }, + { class_stdregprovW, method_enumkeyW, -1, param_returnvalueW, CIM_UINT32 }, { class_stdregprovW, method_enumkeyW, -1, param_namesW, CIM_STRING|CIM_FLAG_ARRAY }, - { class_stdregprovW, method_enumvaluesW, 1, param_defkeyW, CIM_SINT32, 0, 0x80000002 }, + { class_stdregprovW, method_enumvaluesW, 1, param_defkeyW, CIM_SINT32, 0x80000002 }, { class_stdregprovW, method_enumvaluesW, 1, param_subkeynameW, CIM_STRING }, - { class_stdregprovW, method_enumvaluesW, -1, param_returnvalueW, CIM_UINT32, VT_I4 }, + { class_stdregprovW, method_enumvaluesW, -1, param_returnvalueW, CIM_UINT32 }, { class_stdregprovW, method_enumvaluesW, -1, param_namesW, CIM_STRING|CIM_FLAG_ARRAY }, { class_stdregprovW, method_enumvaluesW, -1, param_typesW, CIM_SINT32|CIM_FLAG_ARRAY }, - { class_stdregprovW, method_getstringvalueW, 1, param_defkeyW, CIM_SINT32, 0, 0x80000002 }, + { class_stdregprovW, method_getstringvalueW, 1, param_defkeyW, CIM_SINT32, 0x80000002 }, { class_stdregprovW, method_getstringvalueW, 1, param_subkeynameW, CIM_STRING }, { class_stdregprovW, method_getstringvalueW, 1, param_valuenameW, CIM_STRING }, - { class_stdregprovW, method_getstringvalueW, -1, param_returnvalueW, CIM_UINT32, VT_I4 }, + { class_stdregprovW, method_getstringvalueW, -1, param_returnvalueW, CIM_UINT32 }, { class_stdregprovW, method_getstringvalueW, -1, param_valueW, CIM_STRING }, - { class_systemsecurityW, method_getsdW, -1, param_returnvalueW, CIM_UINT32, VT_I4 }, + { class_systemsecurityW, method_getsdW, -1, param_returnvalueW, CIM_UINT32 }, { class_systemsecurityW, method_getsdW, -1, param_sdW, CIM_UINT8|CIM_FLAG_ARRAY }, { class_systemsecurityW, method_setsdW, 1, param_sdW, CIM_UINT8|CIM_FLAG_ARRAY }, - { class_systemsecurityW, method_setsdW, -1, param_returnvalueW, CIM_UINT32, VT_I4 }, + { class_systemsecurityW, method_setsdW, -1, param_returnvalueW, CIM_UINT32 }, }; #define FLAVOR_ID (WBEM_FLAVOR_FLAG_PROPAGATE_TO_INSTANCE | WBEM_FLAVOR_NOT_OVERRIDABLE |\ @@ -1261,6 +1408,10 @@ static const struct record_qualifier data_qualifier[] = { class_process_getowner_outW, param_userW, CIM_SINT32, FLAVOR_ID, prop_idW, 0 }, { class_process_getowner_outW, param_domainW, CIM_SINT32, FLAVOR_ID, prop_idW, 1 } }; +static const struct record_quickfixengineering data_quickfixengineering[] = +{ + { quickfixengineering_captionW, quickfixengineering_hotfixidW }, +}; static const struct record_sounddevice data_sounddevice[] = { { sounddevice_productnameW, sounddevice_productnameW, 3 /* enabled */ } @@ -1275,25 +1426,18 @@ static UINT16 systemenclosure_chassistypes[] = }; static const struct array systemenclosure_chassistypes_array = { + sizeof(*systemenclosure_chassistypes), ARRAY_SIZE(systemenclosure_chassistypes), &systemenclosure_chassistypes }; -static const struct record_systemenclosure data_systemenclosure[] = -{ - { - systemenclosure_systemenclosureW, - &systemenclosure_chassistypes_array, - systemenclosure_systemenclosureW, - FALSE, - systemenclosure_manufacturerW, - systemenclosure_systemenclosureW, - systemenclosure_tagW, - } -}; static const struct record_systemsecurity data_systemsecurity[] = { { security_get_sd, security_set_sd } }; +static const struct record_winsat data_winsat[] = +{ + { 8.0f, 8.0f, 8.0f, 8.0f, 8.0f, winsat_timetakenW, 1 /* Valid */, 8.0f }, +}; /* check if row matches condition and update status */ static BOOL match_row( const struct table *table, UINT row, const struct expr *cond, enum fill_status *status ) @@ -1334,6 +1478,318 @@ static BOOL resize_table( struct table *table, UINT row_count, UINT row_size ) return TRUE; } +#include "pshpack1.h" +struct smbios_prologue +{ + BYTE calling_method; + BYTE major_version; + BYTE minor_version; + BYTE revision; + DWORD length; +}; + +enum smbios_type +{ + SMBIOS_TYPE_BIOS, + SMBIOS_TYPE_SYSTEM, + SMBIOS_TYPE_BASEBOARD, + SMBIOS_TYPE_CHASSIS, +}; + +struct smbios_header +{ + BYTE type; + BYTE length; + WORD handle; +}; + +struct smbios_baseboard +{ + struct smbios_header hdr; + BYTE vendor; + BYTE product; + BYTE version; + BYTE serial; +}; + +struct smbios_bios +{ + struct smbios_header hdr; + BYTE vendor; + BYTE version; + WORD start; + BYTE date; + BYTE size; + UINT64 characteristics; +}; + +struct smbios_chassis +{ + struct smbios_header hdr; + BYTE vendor; + BYTE type; + BYTE version; + BYTE serial; + BYTE asset_tag; +}; + +struct smbios_system +{ + struct smbios_header hdr; + BYTE vendor; + BYTE product; + BYTE version; + BYTE serial; + BYTE uuid[16]; +}; +#include "poppack.h" + +#define RSMB (('R' << 24) | ('S' << 16) | ('M' << 8) | 'B') + +static const struct smbios_header *find_smbios_entry( enum smbios_type type, const char *buf, UINT len ) +{ + const char *ptr, *start; + const struct smbios_prologue *prologue; + const struct smbios_header *hdr; + + if (len < sizeof(struct smbios_prologue)) return NULL; + prologue = (const struct smbios_prologue *)buf; + if (prologue->length > len - sizeof(*prologue) || prologue->length < sizeof(*hdr)) return NULL; + + start = (const char *)(prologue + 1); + hdr = (const struct smbios_header *)start; + + for (;;) + { + if ((const char *)hdr - start >= prologue->length - sizeof(*hdr)) return NULL; + + if (!hdr->length) + { + WARN( "invalid entry\n" ); + return NULL; + } + + if (hdr->type == type) + { + if ((const char *)hdr - start + hdr->length > prologue->length) return NULL; + break; + } + else /* skip other entries and their strings */ + { + for (ptr = (const char *)hdr + hdr->length; ptr - buf < len && *ptr; ptr++) + { + for (; ptr - buf < len; ptr++) if (!*ptr) break; + } + if (ptr == (const char *)hdr + hdr->length) ptr++; + hdr = (const struct smbios_header *)(ptr + 1); + } + } + + return hdr; +} + +static WCHAR *get_smbios_string( BYTE id, const char *buf, UINT offset, UINT buflen ) +{ + const char *ptr = buf + offset; + UINT i = 0; + + if (!id || offset >= buflen) return NULL; + for (ptr = buf + offset; ptr - buf < buflen && *ptr; ptr++) + { + if (++i == id) return heap_strdupAW( ptr ); + for (; ptr - buf < buflen; ptr++) if (!*ptr) break; + } + return NULL; +} + +static WCHAR *get_baseboard_string( BYTE id, const char *buf, UINT len ) +{ + const struct smbios_header *hdr; + const struct smbios_baseboard *baseboard; + UINT offset; + + if (!(hdr = find_smbios_entry( SMBIOS_TYPE_BASEBOARD, buf, len ))) return NULL; + + baseboard = (const struct smbios_baseboard *)hdr; + offset = (const char *)baseboard - buf + baseboard->hdr.length; + return get_smbios_string( id, buf, offset, len ); +} + +static WCHAR *get_baseboard_manufacturer( const char *buf, UINT len ) +{ + WCHAR *ret = get_baseboard_string( 1, buf, len ); + if (!ret) return heap_strdupW( baseboard_manufacturerW ); + return ret; +} + +static WCHAR *get_baseboard_product( const char *buf, UINT len ) +{ + WCHAR *ret = get_baseboard_string( 2, buf, len ); + if (!ret) return heap_strdupW( baseboard_tagW ); + return ret; +} + +static WCHAR *get_baseboard_serialnumber( const char *buf, UINT len ) +{ + WCHAR *ret = get_baseboard_string( 4, buf, len ); + if (!ret) return heap_strdupW( baseboard_serialnumberW ); + return ret; +} + +static WCHAR *get_baseboard_version( const char *buf, UINT len ) +{ + WCHAR *ret = get_baseboard_string( 3, buf, len ); + if (!ret) return heap_strdupW( baseboard_versionW ); + return ret; +} + +static enum fill_status fill_baseboard( struct table *table, const struct expr *cond ) +{ + struct record_baseboard *rec; + enum fill_status status = FILL_STATUS_UNFILTERED; + UINT row = 0, len; + char *buf; + + if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED; + + len = GetSystemFirmwareTable( RSMB, 0, NULL, 0 ); + if (!(buf = heap_alloc( len ))) return FILL_STATUS_FAILED; + GetSystemFirmwareTable( RSMB, 0, buf, len ); + + rec = (struct record_baseboard *)table->data; + rec->manufacturer = get_baseboard_manufacturer( buf, len ); + rec->model = baseboard_tagW; + rec->name = baseboard_tagW; + rec->product = get_baseboard_product( buf, len ); + rec->serialnumber = get_baseboard_serialnumber( buf, len ); + rec->tag = baseboard_tagW; + rec->version = get_baseboard_version( buf, len ); + if (!match_row( table, row, cond, &status )) free_row_values( table, row ); + else row++; + + heap_free( buf ); + + TRACE("created %u rows\n", row); + table->num_rows = row; + return status; +} + +static UINT16 get_bios_smbiosmajorversion( const char *buf, UINT len ) +{ + const struct smbios_prologue *prologue = (const struct smbios_prologue *)buf; + if (len < sizeof(*prologue)) return 2; + return prologue->major_version; +} + +static UINT16 get_bios_smbiosminorversion( const char *buf, UINT len ) +{ + const struct smbios_prologue *prologue = (const struct smbios_prologue *)buf; + if (len < sizeof(*prologue)) return 0; + return prologue->minor_version; +} + +static WCHAR *get_bios_string( BYTE id, const char *buf, UINT len ) +{ + const struct smbios_header *hdr; + const struct smbios_bios *bios; + UINT offset; + + if (!(hdr = find_smbios_entry( SMBIOS_TYPE_BIOS, buf, len ))) return NULL; + + bios = (const struct smbios_bios *)hdr; + offset = (const char *)bios - buf + bios->hdr.length; + return get_smbios_string( id, buf, offset, len ); +} + +static WCHAR *get_bios_manufacturer( const char *buf, UINT len ) +{ + WCHAR *ret = get_bios_string( 1, buf, len ); + if (!ret) return heap_strdupW( bios_manufacturerW ); + return ret; +} + +static WCHAR *convert_bios_date( const WCHAR *str ) +{ + static const WCHAR fmtW[] = + {'%','0','4','u','%','0','2','u','%','0','2','u','0','0','0','0','0','0','.','0','0','0','0','0','0','+','0','0','0',0}; + UINT year, month, day, len = lstrlenW( str ); + const WCHAR *p = str, *q; + WCHAR *ret; + + while (len && iswspace( *p )) { p++; len--; } + while (len && iswspace( p[len - 1] )) { len--; } + + q = p; + while (len && iswdigit( *q )) { q++; len--; }; + if (q - p != 2 || !len || *q != '/') return NULL; + month = (p[0] - '0') * 10 + p[1] - '0'; + + p = ++q; len--; + while (len && iswdigit( *q )) { q++; len--; }; + if (q - p != 2 || !len || *q != '/') return NULL; + day = (p[0] - '0') * 10 + p[1] - '0'; + + p = ++q; len--; + while (len && iswdigit( *q )) { q++; len--; }; + if (q - p == 4) year = (p[0] - '0') * 1000 + (p[1] - '0') * 100 + (p[2] - '0') * 10 + p[3] - '0'; + else if (q - p == 2) year = 1900 + (p[0] - '0') * 10 + p[1] - '0'; + else return NULL; + + if (!(ret = heap_alloc( sizeof(fmtW) ))) return NULL; + swprintf( ret, fmtW, year, month, day ); + return ret; +} + +static WCHAR *get_bios_releasedate( const char *buf, UINT len ) +{ + WCHAR *ret, *date = get_bios_string( 3, buf, len ); + if (!date || !(ret = convert_bios_date( date ))) ret = heap_strdupW( bios_releasedateW ); + heap_free( date ); + return ret; +} + +static WCHAR *get_bios_smbiosbiosversion( const char *buf, UINT len ) +{ + WCHAR *ret = get_bios_string( 2, buf, len ); + if (!ret) return heap_strdupW( bios_smbiosbiosversionW ); + return ret; +} + +static enum fill_status fill_bios( struct table *table, const struct expr *cond ) +{ + struct record_bios *rec; + enum fill_status status = FILL_STATUS_UNFILTERED; + UINT row = 0, len; + char *buf; + + if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED; + + len = GetSystemFirmwareTable( RSMB, 0, NULL, 0 ); + if (!(buf = heap_alloc( len ))) return FILL_STATUS_FAILED; + GetSystemFirmwareTable( RSMB, 0, buf, len ); + + rec = (struct record_bios *)table->data; + rec->currentlanguage = NULL; + rec->description = bios_descriptionW; + rec->identificationcode = NULL; + rec->manufacturer = get_bios_manufacturer( buf, len ); + rec->name = bios_descriptionW; + rec->releasedate = get_bios_releasedate( buf, len ); + rec->serialnumber = bios_serialnumberW; + rec->smbiosbiosversion = get_bios_smbiosbiosversion( buf, len ); + rec->smbiosmajorversion = get_bios_smbiosmajorversion( buf, len ); + rec->smbiosminorversion = get_bios_smbiosminorversion( buf, len ); + rec->version = bios_versionW; + if (!match_row( table, row, cond, &status )) free_row_values( table, row ); + else row++; + + heap_free( buf ); + + TRACE("created %u rows\n", row); + table->num_rows = row; + return status; +} + static enum fill_status fill_cdromdrive( struct table *table, const struct expr *cond ) { static const WCHAR fmtW[] = {'%','c',':',0}; @@ -1357,7 +1813,7 @@ static enum fill_status fill_cdromdrive( struct table *table, const struct expr rec = (struct record_cdromdrive *)(table->data + offset); rec->device_id = cdromdrive_pnpdeviceidW; - sprintfW( drive, fmtW, 'A' + i ); + swprintf( drive, fmtW, 'A' + i ); rec->drive = heap_strdupW( drive ); rec->mediatype = cdromdrive_mediatypeW; rec->name = cdromdrive_nameW; @@ -1384,6 +1840,7 @@ static UINT get_processor_count(void) return info.NumberOfProcessors; } +#ifdef __REACTOS__ static UINT get_logical_processor_count( UINT *num_cores ) { SYSTEM_LOGICAL_PROCESSOR_INFORMATION *info; @@ -1417,6 +1874,50 @@ static UINT get_logical_processor_count( UINT *num_cores ) heap_free( info ); return count; } +#else +static UINT get_logical_processor_count( UINT *num_physical, UINT *num_packages ) +{ + SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *buf, *entry; + UINT core_relation_count = 0, package_relation_count = 0; + NTSTATUS status; + ULONG len, offset = 0; + BOOL smt_enabled = FALSE; + DWORD all = RelationAll; + + if (num_packages) *num_packages = 1; + status = NtQuerySystemInformationEx( SystemLogicalProcessorInformationEx, &all, sizeof(all), NULL, 0, &len ); + if (status != STATUS_INFO_LENGTH_MISMATCH) return get_processor_count(); + + if (!(buf = heap_alloc( len ))) return get_processor_count(); + status = NtQuerySystemInformationEx( SystemLogicalProcessorInformationEx, &all, sizeof(all), buf, len, NULL ); + if (status != STATUS_SUCCESS) + { + heap_free( buf ); + return get_processor_count(); + } + + while (offset < len) + { + entry = (SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *)((char *)buf + offset); + + if (entry->Relationship == RelationProcessorCore) + { + core_relation_count++; + if (entry->u.Processor.Flags & LTP_PC_SMT) smt_enabled = TRUE; + } + else if (entry->Relationship == RelationProcessorPackage) + { + package_relation_count++; + } + offset += entry->Size; + } + + heap_free( buf ); + if (num_physical) *num_physical = core_relation_count; + if (num_packages) *num_packages = package_relation_count; + return smt_enabled ? core_relation_count * 2 : core_relation_count; +} +#endif static UINT64 get_total_physical_memory(void) { @@ -1479,8 +1980,12 @@ static enum fill_status fill_compsys( struct table *table, const struct expr *co rec->manufacturer = compsys_manufacturerW; rec->model = compsys_modelW; rec->name = get_computername(); +#ifdef __REACTOS__ rec->num_logical_processors = get_logical_processor_count( NULL ); rec->num_processors = get_processor_count(); +#else + rec->num_logical_processors = get_logical_processor_count( NULL, &rec->num_processors ); +#endif rec->total_physical_memory = get_total_physical_memory(); rec->username = get_username(); if (!match_row( table, row, cond, &status )) free_row_values( table, row ); @@ -1491,72 +1996,97 @@ static enum fill_status fill_compsys( struct table *table, const struct expr *co return status; } -static WCHAR *get_compsysproduct_uuid(void) +static WCHAR *get_compsysproduct_string( BYTE id, const char *buf, UINT len ) { -#ifdef __APPLE__ - unsigned char uuid[16]; - const struct timespec timeout = {1, 0}; - if (!gethostuuid( uuid, &timeout )) - { - static const WCHAR fmtW[] = - {'%','0','2','X','%','0','2','X','%','0','2','X','%','0','2','X','-','%','0','2','X','%','0','2','X','-', - '%','0','2','X','%','0','2','X','-','%','0','2','X','%','0','2','X','-','%','0','2','X','%','0','2','X', - '%','0','2','X','%','0','2','X','%','0','2','X','%','0','2','X',0}; - WCHAR *ret = heap_alloc( 37 * sizeof(WCHAR) ); - if (!ret) return NULL; - sprintfW( ret, fmtW, uuid[0], uuid[1], uuid[2], uuid[3], uuid[4], uuid[5], uuid[6], uuid[7], - uuid[8], uuid[9], uuid[10], uuid[11], uuid[12], uuid[13], uuid[14], uuid[15] ); - return ret; - } -#endif -#ifdef __linux__ - int file; - if ((file = open( "/var/lib/dbus/machine-id", O_RDONLY )) != -1) - { - unsigned char buf[32]; - if (read( file, buf, sizeof(buf) ) == sizeof(buf)) - { - unsigned int i, j; - WCHAR *ret, *p; - - close( file ); - if (!(p = ret = heap_alloc( 37 * sizeof(WCHAR) ))) return NULL; - for (i = 0, j = 0; i < 8; i++) p[i] = toupperW( buf[j++] ); - p[8] = '-'; - for (i = 9; i < 13; i++) p[i] = toupperW( buf[j++] ); - p[13] = '-'; - for (i = 14; i < 18; i++) p[i] = toupperW( buf[j++] ); - p[18] = '-'; - for (i = 19; i < 23; i++) p[i] = toupperW( buf[j++] ); - p[23] = '-'; - for (i = 24; i < 36; i++) p[i] = toupperW( buf[j++] ); - ret[i] = 0; - return ret; - } - close( file ); - } -#endif - return heap_strdupW( compsysproduct_uuidW ); + const struct smbios_header *hdr; + const struct smbios_system *system; + UINT offset; + + if (!(hdr = find_smbios_entry( SMBIOS_TYPE_SYSTEM, buf, len ))) return NULL; + + system = (const struct smbios_system *)hdr; + offset = (const char *)system - buf + system->hdr.length; + return get_smbios_string( id, buf, offset, len ); +} + +static WCHAR *get_compsysproduct_identifyingnumber( const char *buf, UINT len ) +{ + WCHAR *ret = get_compsysproduct_string( 4, buf, len ); + if (!ret) return heap_strdupW( compsysproduct_identifyingnumberW ); + return ret; +} + +static WCHAR *get_compsysproduct_name( const char *buf, UINT len ) +{ + WCHAR *ret = get_compsysproduct_string( 2, buf, len ); + if (!ret) return heap_strdupW( compsysproduct_nameW ); + return ret; +} + +static WCHAR *get_compsysproduct_uuid( const char *buf, UINT len ) +{ + static const WCHAR fmtW[] = + {'%','0','2','X','%','0','2','X','%','0','2','X','%','0','2','X','-','%','0','2','X','%','0','2','X','-', + '%','0','2','X','%','0','2','X','-','%','0','2','X','%','0','2','X','-','%','0','2','X','%','0','2','X', + '%','0','2','X','%','0','2','X','%','0','2','X','%','0','2','X',0}; + static const BYTE none[] = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; + const struct smbios_header *hdr; + const struct smbios_system *system; + const BYTE *ptr; + WCHAR *ret = NULL; + + if (!(hdr = find_smbios_entry( SMBIOS_TYPE_SYSTEM, buf, len )) || hdr->length < sizeof(*system)) goto done; + system = (const struct smbios_system *)hdr; + if (!memcmp( system->uuid, none, sizeof(none) ) || !(ret = heap_alloc( 37 * sizeof(WCHAR) ))) goto done; + + ptr = system->uuid; + swprintf( ret, fmtW, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7], ptr[8], ptr[9], + ptr[10], ptr[11], ptr[12], ptr[13], ptr[14], ptr[15] ); + +done: + if (!ret) ret = heap_strdupW( compsysproduct_uuidW ); + return ret; +} + +static WCHAR *get_compsysproduct_vendor( const char *buf, UINT len ) +{ + WCHAR *ret = get_compsysproduct_string( 1, buf, len ); + if (!ret) return heap_strdupW( compsysproduct_vendorW ); + return ret; +} + +static WCHAR *get_compsysproduct_version( const char *buf, UINT len ) +{ + WCHAR *ret = get_compsysproduct_string( 3, buf, len ); + if (!ret) return heap_strdupW( compsysproduct_versionW ); + return ret; } static enum fill_status fill_compsysproduct( struct table *table, const struct expr *cond ) { struct record_computersystemproduct *rec; enum fill_status status = FILL_STATUS_UNFILTERED; - UINT row = 0; + UINT row = 0, len; + char *buf; if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED; + len = GetSystemFirmwareTable( RSMB, 0, NULL, 0 ); + if (!(buf = heap_alloc( len ))) return FILL_STATUS_FAILED; + GetSystemFirmwareTable( RSMB, 0, buf, len ); + rec = (struct record_computersystemproduct *)table->data; - rec->identifyingnumber = compsysproduct_identifyingnumberW; - rec->name = compsysproduct_nameW; + rec->identifyingnumber = get_compsysproduct_identifyingnumber( buf, len ); + rec->name = get_compsysproduct_name( buf, len ); rec->skunumber = NULL; - rec->uuid = get_compsysproduct_uuid(); - rec->vendor = compsysproduct_vendorW; - rec->version = compsysproduct_versionW; + rec->uuid = get_compsysproduct_uuid( buf, len ); + rec->vendor = get_compsysproduct_vendor( buf, len ); + rec->version = get_compsysproduct_version( buf, len ); if (!match_row( table, row, cond, &status )) free_row_values( table, row ); else row++; + heap_free( buf ); + TRACE("created %u rows\n", row); table->num_rows = row; return status; @@ -1703,9 +2233,9 @@ static WCHAR *build_dirname( const WCHAR *path, UINT *ret_len ) UINT len, i; WCHAR *ret; - if (!isalphaW( p[0] ) || p[1] != ':' || p[2] != '\\' || p[3] != '\\' || !p[4]) return NULL; + if (!iswalpha( p[0] ) || p[1] != ':' || p[2] != '\\' || p[3] != '\\' || !p[4]) return NULL; start = path + 4; - len = strlenW( start ); + len = lstrlenW( start ); p = start + len - 1; if (*p == '\\') return NULL; @@ -1730,7 +2260,7 @@ static WCHAR *build_dirname( const WCHAR *path, UINT *ret_len ) static BOOL seen_dir( struct dirstack *dirstack, const WCHAR *path ) { UINT i; - for (i = 0; i < dirstack->num_dirs; i++) if (!strcmpW( dirstack->dirs[i], path )) return TRUE; + for (i = 0; i < dirstack->num_dirs; i++) if (!wcscmp( dirstack->dirs[i], path )) return TRUE; return FALSE; } @@ -1750,14 +2280,14 @@ static UINT seed_dirs( struct dirstack *dirstack, const struct expr *cond, WCHAR const WCHAR *str = NULL; if (left->type == EXPR_PROPVAL && right->type == EXPR_SVAL && - !strcmpW( left->u.propval->name, prop_nameW ) && - toupperW( right->u.sval[0] ) == toupperW( root )) + !wcscmp( left->u.propval->name, prop_nameW ) && + towupper( right->u.sval[0] ) == towupper( root )) { str = right->u.sval; } else if (left->type == EXPR_SVAL && right->type == EXPR_PROPVAL && - !strcmpW( right->u.propval->name, prop_nameW ) && - toupperW( left->u.sval[0] ) == toupperW( root )) + !wcscmp( right->u.propval->name, prop_nameW ) && + towupper( left->u.sval[0] ) == towupper( root )) { str = left->u.sval; } @@ -1786,11 +2316,11 @@ static UINT seed_dirs( struct dirstack *dirstack, const struct expr *cond, WCHAR static WCHAR *append_path( const WCHAR *path, const WCHAR *segment, UINT *len ) { - UINT len_path = 0, len_segment = strlenW( segment ); + UINT len_path = 0, len_segment = lstrlenW( segment ); WCHAR *ret; *len = 0; - if (path) len_path = strlenW( path ); + if (path) len_path = lstrlenW( path ); if (!(ret = heap_alloc( (len_path + len_segment + 2) * sizeof(WCHAR) ))) return NULL; if (path && len_path) { @@ -1808,11 +2338,11 @@ static WCHAR *get_file_version( const WCHAR *filename ) { static const WCHAR slashW[] = {'\\',0}, fmtW[] = {'%','u','.','%','u','.','%','u','.','%','u',0}; VS_FIXEDFILEINFO *info; - DWORD size; + DWORD size, len = 4 * 5 + ARRAY_SIZE( fmtW ); void *block; WCHAR *ret; - if (!(ret = heap_alloc( (4 * 5 + ARRAY_SIZE( fmtW )) * sizeof(WCHAR) ))) return NULL; + if (!(ret = heap_alloc( len * sizeof(WCHAR) ))) return NULL; if (!(size = GetFileVersionInfoSizeW( filename, NULL )) || !(block = heap_alloc( size ))) { heap_free( ret ); @@ -1825,8 +2355,8 @@ static WCHAR *get_file_version( const WCHAR *filename ) heap_free( ret ); return NULL; } - sprintfW( ret, fmtW, info->dwFileVersionMS >> 16, info->dwFileVersionMS & 0xffff, - info->dwFileVersionLS >> 16, info->dwFileVersionLS & 0xffff ); + swprintf( ret, fmtW, info->dwFileVersionMS >> 16, info->dwFileVersionMS & 0xffff, + info->dwFileVersionLS >> 16, info->dwFileVersionLS & 0xffff ); heap_free( block ); return ret; } @@ -1877,7 +2407,7 @@ static enum fill_status fill_datafile( struct table *table, const struct expr *c FindClose( handle ); goto done; } - if (!strcmpW( data.cFileName, dotW ) || !strcmpW( data.cFileName, dotdotW )) continue; + if (!wcscmp( data.cFileName, dotW ) || !wcscmp( data.cFileName, dotdotW )) continue; new_path = append_path( path, data.cFileName, &len ); if (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) @@ -1999,7 +2529,7 @@ static enum fill_status fill_directory( struct table *table, const struct expr * goto done; } if (!(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || - !strcmpW( data.cFileName, dotW ) || !strcmpW( data.cFileName, dotdotW )) + !wcscmp( data.cFileName, dotW ) || !wcscmp( data.cFileName, dotdotW )) continue; new_path = append_path( path, data.cFileName, &len ); @@ -2092,15 +2622,12 @@ static enum fill_status fill_diskdrive( struct table *table, const struct expr * if (!resize_table( table, row + 1, sizeof(*rec) )) return FILL_STATUS_FAILED; rec = (struct record_diskdrive *)(table->data + offset); - sprintfW( device_id, fmtW, index ); + swprintf( device_id, fmtW, index ); rec->device_id = heap_strdupW( device_id ); - rec->index = index; + rec->index = index++; rec->interfacetype = diskdrive_interfacetypeW; rec->manufacturer = diskdrive_manufacturerW; - if (type == DRIVE_FIXED) - rec->mediatype = diskdrive_mediatype_fixedW; - else - rec->mediatype = diskdrive_mediatype_removableW; + rec->mediatype = (type == DRIVE_FIXED) ? diskdrive_mediatype_fixedW : diskdrive_mediatype_removableW; rec->model = diskdrive_modelW; rec->pnpdevice_id = diskdrive_pnpdeviceidW; rec->serialnumber = diskdrive_serialW; @@ -2112,7 +2639,6 @@ static enum fill_status fill_diskdrive( struct table *table, const struct expr * continue; } offset += sizeof(*rec); - index++; row++; } } @@ -2121,6 +2647,110 @@ static enum fill_status fill_diskdrive( struct table *table, const struct expr * return status; } +struct association +{ + WCHAR *ref; + WCHAR *ref2; +}; + +static void free_assocations( struct association *assoc, UINT count ) +{ + UINT i; + if (!assoc) return; + for (i = 0; i < count; i++) + { + heap_free( assoc[i].ref ); + heap_free( assoc[i].ref2 ); + } + heap_free( assoc ); +} + +static struct association *get_diskdrivetodiskpartition_pairs( UINT *count ) +{ + static const WCHAR pathW[] = + {'_','_','P','A','T','H',0}; + static const WCHAR selectW[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_', + 'D','i','s','k','D','r','i','v','e',0}; + static const WCHAR select2W[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_', + 'D','i','s','k','P','a','r','t','i','t','i','o','n',0}; + struct association *ret = NULL; + struct query *query, *query2 = NULL; + VARIANT val; + HRESULT hr; + UINT i; + + if (!(query = create_query())) return NULL; + if ((hr = parse_query( selectW, &query->view, &query->mem )) != S_OK) goto done; + if ((hr = execute_view( query->view )) != S_OK) goto done; + + if (!(query2 = create_query())) return FALSE; + if ((hr = parse_query( select2W, &query2->view, &query2->mem )) != S_OK) goto done; + if ((hr = execute_view( query2->view )) != S_OK) goto done; + + if (!(ret = heap_alloc_zero( query->view->result_count * sizeof(*ret) ))) goto done; + + for (i = 0; i < query->view->result_count; i++) + { + if ((hr = get_propval( query->view, i, pathW, &val, NULL, NULL )) != S_OK) goto done; + if (!(ret[i].ref = heap_strdupW( V_BSTR(&val) ))) goto done; + VariantClear( &val ); + + if ((hr = get_propval( query2->view, i, pathW, &val, NULL, NULL )) != S_OK) goto done; + if (!(ret[i].ref2 = heap_strdupW( V_BSTR(&val) ))) goto done; + VariantClear( &val ); + } + + *count = query->view->result_count; + +done: + if (!ret) free_assocations( ret, query->view->result_count ); + free_query( query ); + free_query( query2 ); + return ret; +} + +static enum fill_status fill_diskdrivetodiskpartition( struct table *table, const struct expr *cond ) +{ + struct record_diskdrivetodiskpartition *rec; + UINT i, row = 0, offset = 0, count = 0; + enum fill_status status = FILL_STATUS_UNFILTERED; + struct association *assoc; + + if (!(assoc = get_diskdrivetodiskpartition_pairs( &count ))) return FILL_STATUS_FAILED; + if (!count) + { + free_assocations( assoc, count ); + return FILL_STATUS_UNFILTERED; + } + if (!resize_table( table, count, sizeof(*rec) )) + { + free_assocations( assoc, count ); + return FILL_STATUS_FAILED; + } + + for (i = 0; i < count; i++) + { + rec = (struct record_diskdrivetodiskpartition *)(table->data + offset); + rec->antecedent = assoc[i].ref; + rec->dependent = assoc[i].ref2; + if (!match_row( table, row, cond, &status )) + { + free_row_values( table, row ); + continue; + } + offset += sizeof(*rec); + row++; + } + + heap_free( assoc ); + + TRACE("created %u rows\n", row); + table->num_rows = row; + return status; +} + static WCHAR *get_filesystem( const WCHAR *root ) { static const WCHAR ntfsW[] = {'N','T','F','S',0}; @@ -2158,9 +2788,9 @@ static enum fill_status fill_diskpartition( struct table *table, const struct ex rec = (struct record_diskpartition *)(table->data + offset); rec->bootable = (i == 2) ? -1 : 0; rec->bootpartition = (i == 2) ? -1 : 0; - sprintfW( device_id, fmtW, index ); + swprintf( device_id, fmtW, index ); rec->device_id = heap_strdupW( device_id ); - rec->diskindex = index; + rec->diskindex = index++; rec->index = 0; rec->pnpdevice_id = heap_strdupW( device_id ); get_freespace( root, &size ); @@ -2174,7 +2804,6 @@ static enum fill_status fill_diskpartition( struct table *table, const struct ex } offset += sizeof(*rec); row++; - index++; } } TRACE("created %u rows\n", row); @@ -2182,13 +2811,49 @@ static enum fill_status fill_diskpartition( struct table *table, const struct ex return status; } +static UINT32 get_bitsperpixel( UINT *hres, UINT *vres ) +{ + HDC hdc = GetDC( NULL ); + UINT32 ret; + + if (!hdc) return 32; + ret = GetDeviceCaps( hdc, BITSPIXEL ); + *hres = GetDeviceCaps( hdc, HORZRES ); + *vres = GetDeviceCaps( hdc, VERTRES ); + ReleaseDC( NULL, hdc ); + return ret; +} + +static enum fill_status fill_displaycontrollerconfig( struct table *table, const struct expr *cond ) +{ + struct record_displaycontrollerconfig *rec; + UINT row = 0, hres = 1024, vres = 768; + enum fill_status status = FILL_STATUS_UNFILTERED; + + if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED; + + rec = (struct record_displaycontrollerconfig *)table->data; + rec->bitsperpixel = get_bitsperpixel( &hres, &vres ); + rec->caption = videocontroller_deviceidW; + rec->horizontalresolution = hres; + rec->name = videocontroller_deviceidW; + rec->verticalresolution = vres; + if (!match_row( table, row, cond, &status )) free_row_values( table, row ); + else row++; + + TRACE("created %u rows\n", row); + table->num_rows = row; + return status; +} + static WCHAR *get_ip4_string( DWORD addr ) { static const WCHAR fmtW[] = {'%','u','.','%','u','.','%','u','.','%','u',0}; + DWORD len = sizeof("ddd.ddd.ddd.ddd"); WCHAR *ret; - if (!(ret = heap_alloc( sizeof("ddd.ddd.ddd.ddd") * sizeof(WCHAR) ))) return NULL; - sprintfW( ret, fmtW, (addr >> 24) & 0xff, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff ); + if (!(ret = heap_alloc( len * sizeof(WCHAR) ))) return NULL; + swprintf( ret, fmtW, (addr >> 24) & 0xff, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff ); return ret; } @@ -2248,7 +2913,7 @@ static WCHAR *get_volumeserialnumber( const WCHAR *root ) WCHAR buffer[9]; GetVolumeInformationW( root, NULL, 0, &serial, NULL, NULL, NULL, 0 ); - sprintfW( buffer, fmtW, serial ); + swprintf( buffer, fmtW, serial ); return heap_strdupW( buffer ); } @@ -2276,7 +2941,7 @@ static enum fill_status fill_logicaldisk( struct table *table, const struct expr if (!resize_table( table, row + 1, sizeof(*rec) )) return FILL_STATUS_FAILED; rec = (struct record_logicaldisk *)(table->data + offset); - sprintfW( device_id, fmtW, 'A' + i ); + swprintf( device_id, fmtW, 'A' + i ); rec->device_id = heap_strdupW( device_id ); rec->drivetype = type; rec->filesystem = get_filesystem( root ); @@ -2299,6 +2964,94 @@ static enum fill_status fill_logicaldisk( struct table *table, const struct expr return status; } +static struct association *get_logicaldisktopartition_pairs( UINT *count ) +{ + static const WCHAR pathW[] = + {'_','_','P','A','T','H',0}; + static const WCHAR selectW[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_', + 'D','i','s','k','P','a','r','t','i','t','i','o','n',0}; + static const WCHAR select2W[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_', + 'L','o','g','i','c','a','l','D','i','s','k',' ','W','H','E','R','E',' ', + 'D','r','i','v','e','T','y','p','e','=','2',' ','O','R',' ','D','r','i','v','e','T','y','p','e','=','3',0}; + struct association *ret = NULL; + struct query *query, *query2 = NULL; + VARIANT val; + HRESULT hr; + UINT i; + + if (!(query = create_query())) return NULL; + if ((hr = parse_query( selectW, &query->view, &query->mem )) != S_OK) goto done; + if ((hr = execute_view( query->view )) != S_OK) goto done; + + if (!(query2 = create_query())) return FALSE; + if ((hr = parse_query( select2W, &query2->view, &query2->mem )) != S_OK) goto done; + if ((hr = execute_view( query2->view )) != S_OK) goto done; + + if (!(ret = heap_alloc_zero( query->view->result_count * sizeof(*ret) ))) goto done; + + /* assume fixed and removable disks are enumerated in the same order as partitions */ + for (i = 0; i < query->view->result_count; i++) + { + if ((hr = get_propval( query->view, i, pathW, &val, NULL, NULL )) != S_OK) goto done; + if (!(ret[i].ref = heap_strdupW( V_BSTR(&val) ))) goto done; + VariantClear( &val ); + + if ((hr = get_propval( query2->view, i, pathW, &val, NULL, NULL )) != S_OK) goto done; + if (!(ret[i].ref2 = heap_strdupW( V_BSTR(&val) ))) goto done; + VariantClear( &val ); + } + + *count = query->view->result_count; + +done: + if (!ret) free_assocations( ret, query->view->result_count ); + free_query( query ); + free_query( query2 ); + return ret; +} + +static enum fill_status fill_logicaldisktopartition( struct table *table, const struct expr *cond ) +{ + struct record_logicaldisktopartition *rec; + UINT i, row = 0, offset = 0, count = 0; + enum fill_status status = FILL_STATUS_UNFILTERED; + struct association *assoc; + + if (!(assoc = get_logicaldisktopartition_pairs( &count ))) return FILL_STATUS_FAILED; + if (!count) + { + free_assocations( assoc, count ); + return FILL_STATUS_UNFILTERED; + } + if (!resize_table( table, count, sizeof(*rec) )) + { + free_assocations( assoc, count ); + return FILL_STATUS_FAILED; + } + + for (i = 0; i < count; i++) + { + rec = (struct record_logicaldisktopartition *)(table->data + offset); + rec->antecedent = assoc[i].ref; + rec->dependent = assoc[i].ref2; + if (!match_row( table, row, cond, &status )) + { + free_row_values( table, row ); + continue; + } + offset += sizeof(*rec); + row++; + } + + heap_free( assoc ); + + TRACE("created %u rows\n", row); + table->num_rows = row; + return status; +} + static UINT16 get_connection_status( IF_OPER_STATUS status ) { switch (status) @@ -2321,10 +3074,10 @@ static WCHAR *get_mac_address( const BYTE *addr, DWORD len ) WCHAR *ret; if (len != 6 || !(ret = heap_alloc( 18 * sizeof(WCHAR) ))) return NULL; - sprintfW( ret, fmtW, addr[0], addr[1], addr[2], addr[3], addr[4], addr[5] ); + swprintf( ret, fmtW, addr[0], addr[1], addr[2], addr[3], addr[4], addr[5] ); return ret; } -static const WCHAR *get_adaptertype( DWORD type, int *physical ) +static const WCHAR *get_adaptertype( DWORD type, int *id, int *physical ) { static const WCHAR ethernetW[] = {'E','t','h','e','r','n','e','t',' ','8','0','2','.','3',0}; static const WCHAR wirelessW[] = {'W','i','r','e','l','e','s','s',0}; @@ -2333,11 +3086,26 @@ static const WCHAR *get_adaptertype( DWORD type, int *physical ) switch (type) { - case IF_TYPE_ETHERNET_CSMACD: *physical = -1; return ethernetW; - case IF_TYPE_IEEE80211: *physical = -1; return wirelessW; - case IF_TYPE_IEEE1394: *physical = -1; return firewireW; - case IF_TYPE_TUNNEL: *physical = 0; return tunnelW; - default: *physical = 0; return NULL; + case IF_TYPE_ETHERNET_CSMACD: + *id = 0; + *physical = -1; + return ethernetW; + case IF_TYPE_IEEE80211: + *id = 9; + *physical = -1; + return wirelessW; + case IF_TYPE_IEEE1394: + *id = 13; + *physical = -1; + return firewireW; + case IF_TYPE_TUNNEL: + *id = 15; + *physical = 0; + return tunnelW; + default: + *id = -1; + *physical = 0; + return NULL; } } @@ -2349,7 +3117,7 @@ static enum fill_status fill_networkadapter( struct table *table, const struct e IP_ADAPTER_ADDRESSES *aa, *buffer; UINT row = 0, offset = 0, count = 0; DWORD size = 0, ret; - int physical; + int adaptertypeid, physical; enum fill_status status = FILL_STATUS_UNFILTERED; ret = GetAdaptersAddresses( AF_UNSPEC, 0, NULL, NULL, &size ); @@ -2375,8 +3143,10 @@ static enum fill_status fill_networkadapter( struct table *table, const struct e if (aa->IfType == IF_TYPE_SOFTWARE_LOOPBACK) continue; rec = (struct record_networkadapter *)(table->data + offset); - sprintfW( device_id, fmtW, aa->u.s.IfIndex ); - rec->adaptertype = get_adaptertype( aa->IfType, &physical ); + swprintf( device_id, fmtW, aa->u.s.IfIndex ); + rec->adaptertype = get_adaptertype( aa->IfType, &adaptertypeid, &physical ); + rec->adaptertypeid = adaptertypeid; + rec->description = heap_strdupW( aa->Description ); rec->device_id = heap_strdupW( device_id ); rec->index = aa->u.s.IfIndex; rec->interface_index = aa->u.s.IfIndex; @@ -2440,8 +3210,9 @@ static struct array *get_defaultipgateway( IP_ADAPTER_GATEWAY_ADDRESS *list ) return NULL; } } - ret->count = count; - ret->ptr = ptr; + ret->elem_size = sizeof(*ptr); + ret->count = count; + ret->ptr = ptr; return ret; } static struct array *get_dnsserversearchorder( IP_ADAPTER_DNS_SERVER_ADDRESS *list ) @@ -2471,10 +3242,11 @@ static struct array *get_dnsserversearchorder( IP_ADAPTER_DNS_SERVER_ADDRESS *li heap_free( ret ); return NULL; } - if ((p = strrchrW( ptr[i - 1], ':' ))) *p = 0; + if ((p = wcsrchr( ptr[i - 1], ':' ))) *p = 0; } - ret->count = count; - ret->ptr = ptr; + ret->elem_size = sizeof(*ptr); + ret->count = count; + ret->ptr = ptr; return ret; } @@ -2508,8 +3280,9 @@ static struct array *get_ipaddress( IP_ADAPTER_UNICAST_ADDRESS_LH *list ) return NULL; } } - ret->count = count; - ret->ptr = ptr; + ret->elem_size = sizeof(*ptr); + ret->count = count; + ret->ptr = ptr; return ret; } static struct array *get_ipsubnet( IP_ADAPTER_UNICAST_ADDRESS_LH *list ) @@ -2530,14 +3303,14 @@ static struct array *get_ipsubnet( IP_ADAPTER_UNICAST_ADDRESS_LH *list ) } for (address = list; address; address = address->Next) { - if (address->Address.lpSockaddr->sa_family == WS_AF_INET) + if (address->Address.lpSockaddr->sa_family == AF_INET) { WCHAR buf[INET_ADDRSTRLEN]; SOCKADDR_IN addr; ULONG buflen = ARRAY_SIZE( buf ); memset( &addr, 0, sizeof(addr) ); - addr.sin_family = WS_AF_INET; + addr.sin_family = AF_INET; if (ConvertLengthToIpv4Mask( address->OnLinkPrefixLength, &addr.sin_addr.S_un.S_addr ) != NO_ERROR || WSAAddressToStringW( (SOCKADDR*)&addr, sizeof(addr), NULL, buf, &buflen)) ptr[i] = NULL; @@ -2549,7 +3322,7 @@ static struct array *get_ipsubnet( IP_ADAPTER_UNICAST_ADDRESS_LH *list ) static const WCHAR fmtW[] = {'%','u',0}; WCHAR buf[11]; - sprintfW(buf, fmtW, address->OnLinkPrefixLength); + swprintf( buf, fmtW, address->OnLinkPrefixLength ); ptr[i] = heap_strdupW( buf ); } if (!ptr[i++]) @@ -2560,8 +3333,9 @@ static struct array *get_ipsubnet( IP_ADAPTER_UNICAST_ADDRESS_LH *list ) return NULL; } } - ret->count = count; - ret->ptr = ptr; + ret->elem_size = sizeof(*ptr); + ret->count = count; + ret->ptr = ptr; return ret; } @@ -2643,6 +3417,7 @@ static enum fill_status fill_networkadapterconfig( struct table *table, const st static enum fill_status fill_physicalmemory( struct table *table, const struct expr *cond ) { + static const WCHAR dimm0W[] = {'D','I','M','M',' ','0',0}; struct record_physicalmemory *rec; enum fill_status status = FILL_STATUS_UNFILTERED; UINT row = 0; @@ -2650,8 +3425,11 @@ static enum fill_status fill_physicalmemory( struct table *table, const struct e if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED; rec = (struct record_physicalmemory *)table->data; - rec->capacity = get_total_physical_memory(); - rec->memorytype = 9; /* RAM */ + rec->capacity = get_total_physical_memory(); + rec->configuredclockspeed = 0; + rec->devicelocator = dimm0W; + rec->memorytype = 9; /* RAM */ + rec->partnumber = NULL; if (!match_row( table, row, cond, &status )) free_row_values( table, row ); else row++; @@ -2717,7 +3495,7 @@ static enum fill_status fill_printer( struct table *table, const struct expr *co WCHAR id[20]; EnumPrintersW( PRINTER_ENUM_LOCAL, NULL, 2, NULL, 0, &size, &count ); - if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) return FILL_STATUS_FAILED; + if (!count) return FILL_STATUS_UNFILTERED; if (!(info = heap_alloc( size ))) return FILL_STATUS_FAILED; if (!EnumPrintersW( PRINTER_ENUM_LOCAL, NULL, 2, (BYTE *)info, size, &size, &count )) @@ -2735,7 +3513,7 @@ static enum fill_status fill_printer( struct table *table, const struct expr *co { rec = (struct record_printer *)(table->data + offset); rec->attributes = info[i].Attributes; - sprintfW( id, fmtW, i ); + swprintf( id, fmtW, i ); rec->device_id = heap_strdupW( id ); rec->drivername = heap_strdupW( info[i].pDriverName ); rec->horizontalresolution = info[i].pDevMode->u1.s1.dmPrintQuality; @@ -2784,13 +3562,17 @@ static enum fill_status fill_process( struct table *table, const struct expr *co do { - if (!resize_table( table, row + 1, sizeof(*rec) )) goto done; + if (!resize_table( table, row + 1, sizeof(*rec) )) + { + status = FILL_STATUS_FAILED; + goto done; + } rec = (struct record_process *)(table->data + offset); rec->caption = heap_strdupW( entry.szExeFile ); rec->commandline = get_cmdline( entry.th32ProcessID ); rec->description = heap_strdupW( entry.szExeFile ); - sprintfW( handle, fmtW, entry.th32ProcessID ); + swprintf( handle, fmtW, entry.th32ProcessID ); rec->handle = heap_strdupW( handle ); rec->name = heap_strdupW( entry.szExeFile ); rec->process_id = entry.th32ProcessID; @@ -2809,27 +3591,85 @@ static enum fill_status fill_process( struct table *table, const struct expr *co TRACE("created %u rows\n", row); table->num_rows = row; - status = FILL_STATUS_UNFILTERED; done: CloseHandle( snap ); return status; } -static inline void do_cpuid( unsigned int ax, unsigned int *p ) +extern void do_cpuid( unsigned int ax, unsigned int *p ); +#if defined(_MSC_VER) +void do_cpuid( unsigned int ax, unsigned int *p ) { -#ifdef __i386__ -#ifdef _MSC_VER - __cpuid(p, ax); + __cpuid( p, ax ); +} +#elif defined(__i386__) +__ASM_GLOBAL_FUNC( do_cpuid, + "pushl %esi\n\t" + "pushl %ebx\n\t" + "movl 12(%esp),%eax\n\t" + "movl 16(%esp),%esi\n\t" + "cpuid\n\t" + "movl %eax,(%esi)\n\t" + "movl %ebx,4(%esi)\n\t" + "movl %ecx,8(%esi)\n\t" + "movl %edx,12(%esi)\n\t" + "popl %ebx\n\t" + "popl %esi\n\t" + "ret" ) +#elif defined(__x86_64__) +__ASM_GLOBAL_FUNC( do_cpuid, + "pushq %rsi\n\t" + "pushq %rbx\n\t" + "movq %rcx,%rax\n\t" + "movq %rdx,%rsi\n\t" + "cpuid\n\t" + "movl %eax,(%rsi)\n\t" + "movl %ebx,4(%rsi)\n\t" + "movl %ecx,8(%rsi)\n\t" + "movl %edx,12(%rsi)\n\t" + "popq %rbx\n\t" + "popq %rsi\n\t" + "ret" ) #else - __asm__("pushl %%ebx\n\t" - "cpuid\n\t" - "movl %%ebx, %%esi\n\t" - "popl %%ebx" - : "=a" (p[0]), "=S" (p[1]), "=c" (p[2]), "=d" (p[3]) - : "0" (ax)); -#endif +void do_cpuid( unsigned int ax, unsigned int *p ) +{ + FIXME("\n"); +} #endif + +static unsigned int get_processor_model( unsigned int reg0, unsigned int *stepping, unsigned int *family ) +{ + unsigned int model, family_id = (reg0 & (0x0f << 8)) >> 8; + + model = (reg0 & (0x0f << 4)) >> 4; + if (family_id == 6 || family_id == 15) model |= (reg0 & (0x0f << 16)) >> 12; + if (family) + { + *family = family_id; + if (family_id == 15) *family += (reg0 & (0xff << 20)) >> 20; + } + *stepping = reg0 & 0x0f; + return model; +} +static void regs_to_str( unsigned int *regs, unsigned int len, WCHAR *buffer ) +{ + unsigned int i; + unsigned char *p = (unsigned char *)regs; + + for (i = 0; i < len; i++) { buffer[i] = *p++; } + buffer[i] = 0; +} +static void get_processor_manufacturer( WCHAR *manufacturer, UINT len ) +{ + unsigned int tmp, regs[4] = {0, 0, 0, 0}; + + do_cpuid( 0, regs ); + tmp = regs[2]; /* swap edx and ecx */ + regs[2] = regs[3]; + regs[3] = tmp; + + regs_to_str( regs + 1, min( 12, len ), manufacturer ); } static const WCHAR *get_osarchitecture(void) { @@ -2838,27 +3678,39 @@ static const WCHAR *get_osarchitecture(void) if (info.u.s.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) return os_64bitW; return os_32bitW; } -static void get_processor_caption( WCHAR *caption ) +static void get_processor_caption( WCHAR *caption, UINT len ) { static const WCHAR fmtW[] = {'%','s',' ','F','a','m','i','l','y',' ','%','u',' ', 'M','o','d','e','l',' ','%','u',' ','S','t','e','p','p','i','n','g',' ','%','u',0}; static const WCHAR x86W[] = {'x','8','6',0}; static const WCHAR intel64W[] = {'I','n','t','e','l','6','4',0}; - const WCHAR *arch = (get_osarchitecture() == os_32bitW) ? x86W : intel64W; - unsigned int regs[4] = {0, 0, 0, 0}; + static const WCHAR amd64W[] = {'A','M','D','6','4',0}; + static const WCHAR authenticamdW[] = {'A','u','t','h','e','n','t','i','c','A','M','D',0}; + const WCHAR *arch; + WCHAR manufacturer[13]; + unsigned int regs[4] = {0, 0, 0, 0}, family, model, stepping; + + get_processor_manufacturer( manufacturer, ARRAY_SIZE( manufacturer ) ); + if (get_osarchitecture() == os_32bitW) arch = x86W; + else if (!wcscmp( manufacturer, authenticamdW )) arch = amd64W; + else arch = intel64W; do_cpuid( 1, regs ); - sprintfW( caption, fmtW, arch, (regs[0] & (15 << 8)) >> 8, (regs[0] & (15 << 4)) >> 4, regs[0] & 15 ); + + model = get_processor_model( regs[0], &stepping, &family ); + swprintf( caption, fmtW, arch, family, model, stepping ); } -static void get_processor_version( WCHAR *version ) +static void get_processor_version( WCHAR *version, UINT len ) { static const WCHAR fmtW[] = {'M','o','d','e','l',' ','%','u',',',' ','S','t','e','p','p','i','n','g',' ','%','u',0}; - unsigned int regs[4] = {0, 0, 0, 0}; + unsigned int regs[4] = {0, 0, 0, 0}, model, stepping; do_cpuid( 1, regs ); - sprintfW( version, fmtW, (regs[0] & (15 << 4)) >> 4, regs[0] & 15 ); + + model = get_processor_model( regs[0], &stepping, NULL ); + swprintf( version, fmtW, model, stepping ); } static UINT16 get_processor_revision(void) { @@ -2866,36 +3718,18 @@ static UINT16 get_processor_revision(void) do_cpuid( 1, regs ); return regs[0]; } -static void get_processor_id( WCHAR *processor_id ) +static void get_processor_id( WCHAR *processor_id, UINT len ) { static const WCHAR fmtW[] = {'%','0','8','X','%','0','8','X',0}; unsigned int regs[4] = {0, 0, 0, 0}; do_cpuid( 1, regs ); - sprintfW( processor_id, fmtW, regs[3], regs[0] ); -} -static void regs_to_str( unsigned int *regs, unsigned int len, WCHAR *buffer ) -{ - unsigned int i; - unsigned char *p = (unsigned char *)regs; - - for (i = 0; i < len; i++) { buffer[i] = *p++; } - buffer[i] = 0; -} -static void get_processor_manufacturer( WCHAR *manufacturer ) -{ - unsigned int tmp, regs[4] = {0, 0, 0, 0}; - - do_cpuid( 0, regs ); - tmp = regs[2]; /* swap edx and ecx */ - regs[2] = regs[3]; - regs[3] = tmp; - - regs_to_str( regs + 1, 12, manufacturer ); + swprintf( processor_id, fmtW, regs[3], regs[0] ); } static void get_processor_name( WCHAR *name ) { unsigned int regs[4] = {0, 0, 0, 0}; + int i; do_cpuid( 0x80000000, regs ); if (regs[0] >= 0x80000004) @@ -2907,6 +3741,7 @@ static void get_processor_name( WCHAR *name ) do_cpuid( 0x80000004, regs ); regs_to_str( regs, 16, name + 32 ); } + for (i = lstrlenW(name) - 1; i >= 0 && name[i] == ' '; i--) name[i] = 0; } static UINT get_processor_currentclockspeed( UINT index ) { @@ -2942,21 +3777,35 @@ static enum fill_status fill_processor( struct table *table, const struct expr * static const WCHAR fmtW[] = {'C','P','U','%','u',0}; WCHAR caption[100], device_id[14], processor_id[17], manufacturer[13], name[49] = {0}, version[50]; struct record_processor *rec; +#ifdef __REACTOS__ UINT i, offset = 0, num_rows = 0, num_cores, num_logical_processors, count = get_processor_count(); +#else + UINT i, offset = 0, num_rows = 0, num_logical, num_physical, num_packages; +#endif enum fill_status status = FILL_STATUS_UNFILTERED; +#ifdef __REACTOS__ if (!resize_table( table, count, sizeof(*rec) )) return FILL_STATUS_FAILED; +#else + num_logical = get_logical_processor_count( &num_physical, &num_packages ); + + if (!resize_table( table, num_packages, sizeof(*rec) )) return FILL_STATUS_FAILED; +#endif - get_processor_caption( caption ); - get_processor_id( processor_id ); - get_processor_manufacturer( manufacturer ); + get_processor_caption( caption, ARRAY_SIZE( caption ) ); + get_processor_id( processor_id, ARRAY_SIZE( processor_id ) ); + get_processor_manufacturer( manufacturer, ARRAY_SIZE( manufacturer ) ); get_processor_name( name ); - get_processor_version( version ); + get_processor_version( version, ARRAY_SIZE( version ) ); +#ifdef __REACTOS__ num_logical_processors = get_logical_processor_count( &num_cores ) / count; num_cores /= count; for (i = 0; i < count; i++) +#else + for (i = 0; i < num_packages; i++) +#endif { rec = (struct record_processor *)(table->data + offset); rec->addresswidth = get_osarchitecture() == os_32bitW ? 32 : 64; @@ -2966,15 +3815,20 @@ static enum fill_status fill_processor( struct table *table, const struct expr * rec->currentclockspeed = get_processor_currentclockspeed( i ); rec->datawidth = get_osarchitecture() == os_32bitW ? 32 : 64; rec->description = heap_strdupW( caption ); - sprintfW( device_id, fmtW, i ); + swprintf( device_id, fmtW, i ); rec->device_id = heap_strdupW( device_id ); rec->family = 2; /* Unknown */ rec->level = 15; rec->manufacturer = heap_strdupW( manufacturer ); rec->maxclockspeed = get_processor_maxclockspeed( i ); rec->name = heap_strdupW( name ); +#ifdef __REACTOS__ rec->num_cores = num_cores; rec->num_logical_processors = num_logical_processors; +#else + rec->num_cores = num_physical / num_packages; + rec->num_logical_processors = num_logical / num_packages; +#endif rec->processor_id = heap_strdupW( processor_id ); rec->processortype = 3; /* central processor */ rec->revision = get_processor_revision(); @@ -3007,7 +3861,7 @@ static WCHAR *get_lastbootuptime(void) NtQuerySystemInformation( SystemTimeOfDayInformation, &ti, sizeof(ti), NULL ); RtlTimeToTimeFields( &ti.liKeBootTime, &tf ); - sprintfW( ret, fmtW, tf.Year, tf.Month, tf.Day, tf.Hour, tf.Minute, tf.Second, tf.Milliseconds * 1000 ); + swprintf( ret, fmtW, tf.Year, tf.Month, tf.Day, tf.Hour, tf.Minute, tf.Second, tf.Milliseconds * 1000 ); return ret; } static WCHAR *get_localdatetime(void) @@ -3032,7 +3886,7 @@ static WCHAR *get_localdatetime(void) if (!(ret = heap_alloc( 26 * sizeof(WCHAR) ))) return NULL; GetLocalTime(&st); - sprintfW( ret, fmtW, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds * 1000, -Bias); + swprintf( ret, fmtW, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds * 1000, -Bias ); return ret; } static WCHAR *get_systemdirectory(void) @@ -3046,11 +3900,18 @@ static WCHAR *get_systemdirectory(void) Wow64RevertWow64FsRedirection( redir ); return ret; } +static WCHAR *get_systemdrive(void) +{ + WCHAR *ret = heap_alloc( 3 * sizeof(WCHAR) ); /* "c:" */ + if (ret && GetEnvironmentVariableW( prop_systemdriveW, ret, 3 )) return ret; + heap_free( ret ); + return NULL; +} static WCHAR *get_codeset(void) { static const WCHAR fmtW[] = {'%','u',0}; WCHAR *ret = heap_alloc( 11 * sizeof(WCHAR) ); - if (ret) sprintfW( ret, fmtW, GetACP() ); + if (ret) swprintf( ret, fmtW, GetACP() ); return ret; } static WCHAR *get_countrycode(void) @@ -3069,7 +3930,7 @@ static WCHAR *get_osbuildnumber( OSVERSIONINFOEXW *ver ) { static const WCHAR fmtW[] = {'%','u',0}; WCHAR *ret = heap_alloc( 11 * sizeof(WCHAR) ); - if (ret) sprintfW( ret, fmtW, ver->dwBuildNumber ); + if (ret) swprintf( ret, fmtW, ver->dwBuildNumber ); return ret; } static WCHAR *get_oscaption( OSVERSIONINFOEXW *ver ) @@ -3130,7 +3991,7 @@ static WCHAR *get_osname( const WCHAR *caption ) static const WCHAR partitionW[] = {'|','C',':','\\','W','I','N','D','O','W','S','|','\\','D','e','v','i','c','e','\\', 'H','a','r','d','d','i','s','k','0','\\','P','a','r','t','i','t','i','o','n','1',0}; - int len = strlenW( caption ); + int len = lstrlenW( caption ); WCHAR *ret; if (!(ret = heap_alloc( len * sizeof(WCHAR) + sizeof(partitionW) ))) return NULL; @@ -3142,12 +4003,29 @@ static WCHAR *get_osversion( OSVERSIONINFOEXW *ver ) { static const WCHAR fmtW[] = {'%','u','.','%','u','.','%','u',0}; WCHAR *ret = heap_alloc( 33 * sizeof(WCHAR) ); - if (ret) sprintfW( ret, fmtW, ver->dwMajorVersion, ver->dwMinorVersion, ver->dwBuildNumber ); + if (ret) swprintf( ret, fmtW, ver->dwMajorVersion, ver->dwMinorVersion, ver->dwBuildNumber ); + return ret; +} +#ifndef __REACTOS__ +static DWORD get_operatingsystemsku(void) +{ + DWORD ret = PRODUCT_UNDEFINED; + GetProductInfo( 6, 0, 0, 0, &ret ); return ret; } +#endif +static INT16 get_currenttimezone(void) +{ + TIME_ZONE_INFORMATION info; + DWORD status = GetTimeZoneInformation( &info ); + if (status == TIME_ZONE_ID_INVALID) return 0; + if (status == TIME_ZONE_ID_DAYLIGHT) return -(info.Bias + info.DaylightBias); + return -(info.Bias + info.StandardBias); +} -static enum fill_status fill_os( struct table *table, const struct expr *cond ) +static enum fill_status fill_operatingsystem( struct table *table, const struct expr *cond ) { + static const WCHAR wineprojectW[] = {'T','h','e',' ','W','i','n','e',' ','P','r','o','j','e','c','t',0}; struct record_operatingsystem *rec; enum fill_status status = FILL_STATUS_UNFILTERED; OSVERSIONINFOEXW ver; @@ -3164,12 +4042,18 @@ static enum fill_status fill_os( struct table *table, const struct expr *cond ) rec->codeset = get_codeset(); rec->countrycode = get_countrycode(); rec->csdversion = ver.szCSDVersion[0] ? heap_strdupW( ver.szCSDVersion ) : NULL; + rec->csname = get_computername(); + rec->currenttimezone = get_currenttimezone(); rec->freephysicalmemory = get_available_physical_memory() / 1024; rec->installdate = os_installdateW; rec->lastbootuptime = get_lastbootuptime(); rec->localdatetime = get_localdatetime(); rec->locale = get_locale(); + rec->manufacturer = wineprojectW; rec->name = get_osname( rec->caption ); +#ifndef __REACTOS__ + rec->operatingsystemsku = get_operatingsystemsku(); +#endif rec->osarchitecture = get_osarchitecture(); rec->oslanguage = GetSystemDefaultLangID(); rec->osproductsuite = 2461140; /* Windows XP Professional */ @@ -3180,6 +4064,7 @@ static enum fill_status fill_os( struct table *table, const struct expr *cond ) rec->servicepackminor = ver.wServicePackMinor; rec->suitemask = 272; /* Single User + Terminal */ rec->systemdirectory = get_systemdirectory(); + rec->systemdrive = get_systemdrive(); rec->totalvirtualmemorysize = get_total_physical_memory() / 1024; rec->totalvisiblememorysize = rec->totalvirtualmemorysize; rec->version = get_osversion( &ver ); @@ -3354,20 +4239,20 @@ static WCHAR *get_accountname( LSA_TRANSLATED_NAME *name ) } static struct array *get_binaryrepresentation( PSID sid, UINT len ) { - struct array *array = heap_alloc( sizeof(struct array) ); - if (array) + struct array *ret; + UINT8 *ptr; + + if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL; + if (!(ptr = heap_alloc( len ))) { - UINT8 *ret = heap_alloc( len ); - if (ret) - { - memcpy( ret, sid, len ); - array->count = len; - array->ptr = ret; - return array; - } - heap_free( array ); + heap_free( ret ); + return NULL; } - return NULL; + memcpy( ptr, sid, len ); + ret->elem_size = sizeof(*ptr); + ret->count = len; + ret->ptr = ptr; + return ret; } static WCHAR *get_referenceddomainname( LSA_REFERENCED_DOMAIN_LIST *domain ) { @@ -3383,11 +4268,11 @@ static const WCHAR *find_sid_str( const struct expr *cond ) left = cond->u.expr.left; right = cond->u.expr.right; - if (left->type == EXPR_PROPVAL && right->type == EXPR_SVAL && !strcmpiW( left->u.propval->name, prop_sidW )) + if (left->type == EXPR_PROPVAL && right->type == EXPR_SVAL && !wcsicmp( left->u.propval->name, prop_sidW )) { ret = right->u.sval; } - else if (left->type == EXPR_SVAL && right->type == EXPR_PROPVAL && !strcmpiW( right->u.propval->name, prop_sidW )) + else if (left->type == EXPR_SVAL && right->type == EXPR_PROPVAL && !wcsicmp( right->u.propval->name, prop_sidW )) { ret = left->u.sval; } @@ -3442,38 +4327,133 @@ static enum fill_status fill_sid( struct table *table, const struct expr *cond ) return FILL_STATUS_FILTERED; } -#ifndef __REACTOS__ +static WCHAR *get_systemenclosure_string( BYTE id, const char *buf, UINT len ) +{ + const struct smbios_header *hdr; + const struct smbios_chassis *chassis; + UINT offset; -static UINT32 get_bits_per_pixel( UINT *hres, UINT *vres ) + if (!(hdr = find_smbios_entry( SMBIOS_TYPE_CHASSIS, buf, len ))) return NULL; + + chassis = (const struct smbios_chassis *)hdr; + offset = (const char *)chassis - buf + chassis->hdr.length; + return get_smbios_string( id, buf, offset, len ); +} + +static WCHAR *get_systemenclosure_manufacturer( const char *buf, UINT len ) { - HDC hdc = GetDC( NULL ); - UINT32 ret; + WCHAR *ret = get_systemenclosure_string( 1, buf, len ); + if (!ret) return heap_strdupW( systemenclosure_manufacturerW ); + return ret; +} - if (!hdc) return 32; - ret = GetDeviceCaps( hdc, BITSPIXEL ); - *hres = GetDeviceCaps( hdc, HORZRES ); - *vres = GetDeviceCaps( hdc, VERTRES ); - ReleaseDC( NULL, hdc ); +static int get_systemenclosure_lockpresent( const char *buf, UINT len ) +{ + const struct smbios_header *hdr; + const struct smbios_chassis *chassis; + + if (!(hdr = find_smbios_entry( SMBIOS_TYPE_CHASSIS, buf, len )) || hdr->length < sizeof(*chassis)) return 0; + + chassis = (const struct smbios_chassis *)hdr; + return (chassis->type & 0x80) ? -1 : 0; +} + +static struct array *dup_array( const struct array *src ) +{ + struct array *dst; + if (!(dst = heap_alloc( sizeof(*dst) ))) return NULL; + if (!(dst->ptr = heap_alloc( src->count * src->elem_size ))) + { + heap_free( dst ); + return NULL; + } + memcpy( dst->ptr, src->ptr, src->count * src->elem_size ); + dst->elem_size = src->elem_size; + dst->count = src->count; + return dst; +} + +static struct array *get_systemenclosure_chassistypes( const char *buf, UINT len ) +{ + const struct smbios_header *hdr; + const struct smbios_chassis *chassis; + struct array *ret = NULL; + UINT16 *types; + + if (!(hdr = find_smbios_entry( SMBIOS_TYPE_CHASSIS, buf, len )) || hdr->length < sizeof(*chassis)) goto done; + chassis = (const struct smbios_chassis *)hdr; + + if (!(ret = heap_alloc( sizeof(*ret) ))) goto done; + if (!(types = heap_alloc( sizeof(*types) ))) + { + heap_free( ret ); + return NULL; + } + types[0] = chassis->type & ~0x80; + + ret->elem_size = sizeof(*types); + ret->count = 1; + ret->ptr = types; + +done: + if (!ret) ret = dup_array( &systemenclosure_chassistypes_array ); return ret; } + +static enum fill_status fill_systemenclosure( struct table *table, const struct expr *cond ) +{ + struct record_systemenclosure *rec; + enum fill_status status = FILL_STATUS_UNFILTERED; + UINT row = 0, len; + char *buf; + + if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED; + + len = GetSystemFirmwareTable( RSMB, 0, NULL, 0 ); + if (!(buf = heap_alloc( len ))) return FILL_STATUS_FAILED; + GetSystemFirmwareTable( RSMB, 0, buf, len ); + + rec = (struct record_systemenclosure *)table->data; + rec->caption = systemenclosure_systemenclosureW; + rec->chassistypes = get_systemenclosure_chassistypes( buf, len ); + rec->description = systemenclosure_systemenclosureW; + rec->lockpresent = get_systemenclosure_lockpresent( buf, len ); + rec->manufacturer = get_systemenclosure_manufacturer( buf, len ); + rec->name = systemenclosure_systemenclosureW; + rec->tag = systemenclosure_tagW; + if (!match_row( table, row, cond, &status )) free_row_values( table, row ); + else row++; + + heap_free( buf ); + + TRACE("created %u rows\n", row); + table->num_rows = row; + return status; +} + +#ifndef __REACTOS__ static WCHAR *get_pnpdeviceid( DXGI_ADAPTER_DESC *desc ) { static const WCHAR fmtW[] = {'P','C','I','\\','V','E','N','_','%','0','4','X','&','D','E','V','_','%','0','4','X', '&','S','U','B','S','Y','S','_','%','0','8','X','&','R','E','V','_','%','0','2','X','\\', '0','&','D','E','A','D','B','E','E','F','&','0','&','D','E','A','D',0}; + UINT len = sizeof(fmtW) + 2; WCHAR *ret; - if (!(ret = heap_alloc( sizeof(fmtW) + 2 * sizeof(WCHAR) ))) return NULL; - sprintfW( ret, fmtW, desc->VendorId, desc->DeviceId, desc->SubSysId, desc->Revision ); + if (!(ret = heap_alloc( len * sizeof(WCHAR) ))) return NULL; + swprintf( ret, fmtW, desc->VendorId, desc->DeviceId, desc->SubSysId, desc->Revision ); return ret; } +#endif #define HW_VENDOR_AMD 0x1002 #define HW_VENDOR_NVIDIA 0x10de #define HW_VENDOR_VMWARE 0x15ad #define HW_VENDOR_INTEL 0x8086 +#ifndef __REACTOS__ + static const WCHAR *get_installeddriver( UINT vendorid ) { static const WCHAR driver_amdW[] = {'a','t','i','c','f','x','3','2','.','d','l','l',0}; @@ -3528,7 +4508,7 @@ done: rec->availability = 3; /* Running or Full Power */ rec->config_errorcode = 0; /* no error */ rec->caption = heap_strdupW( name ); - rec->current_bitsperpixel = get_bits_per_pixel( &hres, &vres ); + rec->current_bitsperpixel = get_bitsperpixel( &hres, &vres ); rec->current_horizontalres = hres; rec->current_refreshrate = 0; /* default refresh rate */ rec->current_scanmode = 2; /* Unknown */ @@ -3543,7 +4523,7 @@ done: rec->status = videocontroller_statusW; rec->videoarchitecture = 2; /* Unknown */ rec->videomemorytype = 2; /* Unknown */ - wsprintfW( mode, fmtW, hres, vres, (UINT64)1 << rec->current_bitsperpixel ); + swprintf( mode, fmtW, hres, vres, (UINT64)1 << rec->current_bitsperpixel ); rec->videomodedescription = heap_strdupW( mode ); rec->videoprocessor = heap_strdupW( name ); if (!match_row( table, row, cond, &status )) free_row_values( table, row ); @@ -3559,44 +4539,54 @@ done: #endif /* !__REACTOS__ */ +#define C(c) sizeof(c)/sizeof(c[0]), c +#define D(d) sizeof(d)/sizeof(d[0]), 0, (BYTE *)d static struct table builtin_classes[] = { - { class_baseboardW, ARRAY_SIZE(col_baseboard), col_baseboard, ARRAY_SIZE(data_baseboard), 0, (BYTE *)data_baseboard }, - { class_biosW, ARRAY_SIZE(col_bios), col_bios, ARRAY_SIZE(data_bios), 0, (BYTE *)data_bios }, - { class_cdromdriveW, ARRAY_SIZE(col_cdromdrive), col_cdromdrive, 0, 0, NULL, fill_cdromdrive }, - { class_compsysW, ARRAY_SIZE(col_compsys), col_compsys, 0, 0, NULL, fill_compsys }, - { class_compsysproductW, ARRAY_SIZE(col_compsysproduct), col_compsysproduct, 0, 0, NULL, fill_compsysproduct }, - { class_datafileW, ARRAY_SIZE(col_datafile), col_datafile, 0, 0, NULL, fill_datafile }, - { class_desktopmonitorW, ARRAY_SIZE(col_desktopmonitor), col_desktopmonitor, 0, 0, NULL, fill_desktopmonitor }, - { class_directoryW, ARRAY_SIZE(col_directory), col_directory, 0, 0, NULL, fill_directory }, - { class_diskdriveW, ARRAY_SIZE(col_diskdrive), col_diskdrive, 0, 0, NULL, fill_diskdrive }, - { class_diskpartitionW, ARRAY_SIZE(col_diskpartition), col_diskpartition, 0, 0, NULL, fill_diskpartition }, - { class_ip4routetableW, ARRAY_SIZE(col_ip4routetable), col_ip4routetable, 0, 0, NULL, fill_ip4routetable }, - { class_logicaldiskW, ARRAY_SIZE(col_logicaldisk), col_logicaldisk, 0, 0, NULL, fill_logicaldisk }, - { class_logicaldisk2W, ARRAY_SIZE(col_logicaldisk), col_logicaldisk, 0, 0, NULL, fill_logicaldisk }, - { class_networkadapterW, ARRAY_SIZE(col_networkadapter), col_networkadapter, 0, 0, NULL, fill_networkadapter }, - { class_networkadapterconfigW, ARRAY_SIZE(col_networkadapterconfig), col_networkadapterconfig, 0, 0, NULL, fill_networkadapterconfig }, - { class_osW, ARRAY_SIZE(col_os), col_os, 0, 0, NULL, fill_os }, - { class_paramsW, ARRAY_SIZE(col_param), col_param, ARRAY_SIZE(data_param), 0, (BYTE *)data_param }, - { class_physicalmediaW, ARRAY_SIZE(col_physicalmedia), col_physicalmedia, ARRAY_SIZE(data_physicalmedia), 0, (BYTE *)data_physicalmedia }, - { class_physicalmemoryW, ARRAY_SIZE(col_physicalmemory), col_physicalmemory, 0, 0, NULL, fill_physicalmemory }, - { class_pnpentityW, ARRAY_SIZE(col_pnpentity), col_pnpentity, 0, 0, NULL, fill_pnpentity }, - { class_printerW, ARRAY_SIZE(col_printer), col_printer, 0, 0, NULL, fill_printer }, - { class_processW, ARRAY_SIZE(col_process), col_process, 0, 0, NULL, fill_process }, - { class_processorW, ARRAY_SIZE(col_processor), col_processor, 0, 0, NULL, fill_processor }, - { class_processor2W, ARRAY_SIZE(col_processor), col_processor, 0, 0, NULL, fill_processor }, - { class_qualifiersW, ARRAY_SIZE(col_qualifier), col_qualifier, ARRAY_SIZE(data_qualifier), 0, (BYTE *)data_qualifier }, - { class_serviceW, ARRAY_SIZE(col_service), col_service, 0, 0, NULL, fill_service }, - { class_sidW, ARRAY_SIZE(col_sid), col_sid, 0, 0, NULL, fill_sid }, - { class_sounddeviceW, ARRAY_SIZE(col_sounddevice), col_sounddevice, ARRAY_SIZE(data_sounddevice), 0, (BYTE *)data_sounddevice }, - { class_stdregprovW, ARRAY_SIZE(col_stdregprov), col_stdregprov, ARRAY_SIZE(data_stdregprov), 0, (BYTE *)data_stdregprov }, - { class_systemsecurityW, ARRAY_SIZE(col_systemsecurity), col_systemsecurity, ARRAY_SIZE(data_systemsecurity), 0, (BYTE *)data_systemsecurity }, - { class_systemenclosureW, ARRAY_SIZE(col_systemenclosure), col_systemenclosure, ARRAY_SIZE(data_systemenclosure), 0, (BYTE *)data_systemenclosure }, + { class_associatorsW, C(col_associator), D(data_associator) }, + { class_baseboardW, C(col_baseboard), 0, 0, NULL, fill_baseboard }, + { class_biosW, C(col_bios), 0, 0, NULL, fill_bios }, + { class_cdromdriveW, C(col_cdromdrive), 0, 0, NULL, fill_cdromdrive }, + { class_compsysW, C(col_compsys), 0, 0, NULL, fill_compsys }, + { class_compsysproductW, C(col_compsysproduct), 0, 0, NULL, fill_compsysproduct }, + { class_datafileW, C(col_datafile), 0, 0, NULL, fill_datafile }, + { class_desktopmonitorW, C(col_desktopmonitor), 0, 0, NULL, fill_desktopmonitor }, + { class_directoryW, C(col_directory), 0, 0, NULL, fill_directory }, + { class_diskdriveW, C(col_diskdrive), 0, 0, NULL, fill_diskdrive }, + { class_diskdrivetodiskpartitionW, C(col_diskdrivetodiskpartition), 0, 0, NULL, fill_diskdrivetodiskpartition }, + { class_diskpartitionW, C(col_diskpartition), 0, 0, NULL, fill_diskpartition }, + { class_displaycontrollerconfigW, C(col_displaycontrollerconfig), 0, 0, NULL, fill_displaycontrollerconfig }, + { class_ip4routetableW, C(col_ip4routetable), 0, 0, NULL, fill_ip4routetable }, + { class_logicaldiskW, C(col_logicaldisk), 0, 0, NULL, fill_logicaldisk }, + { class_logicaldisk2W, C(col_logicaldisk), 0, 0, NULL, fill_logicaldisk }, + { class_logicaldisktopartitionW, C(col_logicaldisktopartition), 0, 0, NULL, fill_logicaldisktopartition }, + { class_networkadapterW, C(col_networkadapter), 0, 0, NULL, fill_networkadapter }, + { class_networkadapterconfigW, C(col_networkadapterconfig), 0, 0, NULL, fill_networkadapterconfig }, + { class_operatingsystemW, C(col_operatingsystem), 0, 0, NULL, fill_operatingsystem }, + { class_paramsW, C(col_param), D(data_param) }, + { class_physicalmediaW, C(col_physicalmedia), D(data_physicalmedia) }, + { class_physicalmemoryW, C(col_physicalmemory), 0, 0, NULL, fill_physicalmemory }, + { class_pnpentityW, C(col_pnpentity), 0, 0, NULL, fill_pnpentity }, + { class_printerW, C(col_printer), 0, 0, NULL, fill_printer }, + { class_processW, C(col_process), 0, 0, NULL, fill_process }, + { class_processorW, C(col_processor), 0, 0, NULL, fill_processor }, + { class_processor2W, C(col_processor), 0, 0, NULL, fill_processor }, + { class_qualifiersW, C(col_qualifier), D(data_qualifier) }, + { class_quickfixengineeringW, C(col_quickfixengineering), D(data_quickfixengineering) }, + { class_serviceW, C(col_service), 0, 0, NULL, fill_service }, + { class_sidW, C(col_sid), 0, 0, NULL, fill_sid }, + { class_sounddeviceW, C(col_sounddevice), D(data_sounddevice) }, + { class_stdregprovW, C(col_stdregprov), D(data_stdregprov) }, + { class_systemsecurityW, C(col_systemsecurity), D(data_systemsecurity) }, + { class_systemenclosureW, C(col_systemenclosure), 0, 0, NULL, fill_systemenclosure }, #ifndef __REACTOS__ /* Requires dxgi.dll */ - { class_videocontrollerW, ARRAY_SIZE(col_videocontroller), col_videocontroller, 0, 0, NULL, fill_videocontroller } + { class_videocontrollerW, C(col_videocontroller), 0, 0, NULL, fill_videocontroller }, #endif + { class_winsatW, C(col_winsat), D(data_winsat) }, }; +#undef C +#undef D void init_table_list( void ) { diff --git a/dll/win32/wbemprox/class.c b/dll/win32/wbemprox/class.c index a0052047911..8000774c65d 100644 --- a/dll/win32/wbemprox/class.c +++ b/dll/win32/wbemprox/class.c @@ -18,8 +18,10 @@ #define COBJMACROS -#include "config.h" #include <stdarg.h> +#ifdef __REACTOS__ +#include <wchar.h> +#endif #include "windef.h" #include "winbase.h" @@ -114,6 +116,7 @@ static HRESULT WINAPI enum_class_object_Next( { struct enum_class_object *ec = impl_from_IEnumWbemClassObject( iface ); struct view *view = ec->query->view; + struct table *table; static int once = 0; HRESULT hr; @@ -124,14 +127,15 @@ static HRESULT WINAPI enum_class_object_Next( if (lTimeout != WBEM_INFINITE && !once++) FIXME("timeout not supported\n"); *puReturned = 0; - if (ec->index >= view->count) return WBEM_S_FALSE; + if (ec->index >= view->result_count) return WBEM_S_FALSE; - hr = create_class_object( view->table->name, iface, ec->index, NULL, apObjects ); + table = get_view_table( view, ec->index ); + hr = create_class_object( table->name, iface, ec->index, NULL, apObjects ); if (hr != S_OK) return hr; ec->index++; *puReturned = 1; - if (ec->index == view->count && uCount > 1) return WBEM_S_FALSE; + if (ec->index == view->result_count && uCount > 1) return WBEM_S_FALSE; if (uCount > 1) return WBEM_S_TIMEDOUT; return WBEM_S_NO_ERROR; } @@ -169,11 +173,11 @@ static HRESULT WINAPI enum_class_object_Skip( if (lTimeout != WBEM_INFINITE && !once++) FIXME("timeout not supported\n"); - if (!view->count) return WBEM_S_FALSE; + if (!view->result_count) return WBEM_S_FALSE; - if (nCount > view->count - ec->index) + if (nCount > view->result_count - ec->index) { - ec->index = view->count - 1; + ec->index = view->result_count - 1; return WBEM_S_FALSE; } ec->index += nCount; @@ -226,7 +230,6 @@ static struct record *create_record( struct table *table ) for (i = 0; i < table->num_cols; i++) { record->fields[i].type = table->columns[i].type; - record->fields[i].vartype = table->columns[i].vartype; record->fields[i].u.ival = 0; } record->count = table->num_cols; @@ -236,13 +239,11 @@ static struct record *create_record( struct table *table ) void destroy_array( struct array *array, CIMTYPE type ) { - UINT i, size; - + UINT i; if (!array) return; - if (type == CIM_STRING || type == CIM_DATETIME) + if (type == CIM_STRING || type == CIM_DATETIME || type == CIM_REFERENCE) { - size = get_type_size( type ); - for (i = 0; i < array->count; i++) heap_free( *(WCHAR **)((char *)array->ptr + i * size) ); + for (i = 0; i < array->count; i++) heap_free( *(WCHAR **)((char *)array->ptr + i * array->elem_size) ); } heap_free( array->ptr ); heap_free( array ); @@ -256,8 +257,9 @@ static void destroy_record( struct record *record ) release_table( record->table ); for (i = 0; i < record->count; i++) { - if (record->fields[i].type == CIM_STRING || record->fields[i].type == CIM_DATETIME) - heap_free( record->fields[i].u.sval ); + if (record->fields[i].type == CIM_STRING || + record->fields[i].type == CIM_DATETIME || + record->fields[i].type == CIM_REFERENCE) heap_free( record->fields[i].u.sval ); else if (record->fields[i].type & CIM_FLAG_ARRAY) destroy_array( record->fields[i].u.aval, record->fields[i].type & CIM_TYPE_MASK ); } @@ -338,19 +340,22 @@ static HRESULT WINAPI class_object_GetQualifierSet( IWbemClassObject *iface, IWbemQualifierSet **ppQualSet ) { - FIXME("%p, %p\n", iface, ppQualSet); - return E_NOTIMPL; + struct class_object *co = impl_from_IWbemClassObject( iface ); + + TRACE("%p, %p\n", iface, ppQualSet); + + return WbemQualifierSet_create( co->name, NULL, (void **)ppQualSet ); } static HRESULT record_get_value( const struct record *record, UINT index, VARIANT *var, CIMTYPE *type ) { - VARTYPE vartype = record->fields[index].vartype; + VARTYPE vartype = to_vartype( record->fields[index].type & CIM_TYPE_MASK ); if (type) *type = record->fields[index].type; if (record->fields[index].type & CIM_FLAG_ARRAY) { - V_VT( var ) = vartype ? vartype : to_vartype( record->fields[index].type & CIM_TYPE_MASK ) | VT_ARRAY; + V_VT( var ) = vartype | VT_ARRAY; V_ARRAY( var ) = to_safearray( record->fields[index].u.aval, record->fields[index].type & CIM_TYPE_MASK ); return S_OK; } @@ -358,15 +363,13 @@ static HRESULT record_get_value( const struct record *record, UINT index, VARIAN { case CIM_STRING: case CIM_DATETIME: - if (!vartype) vartype = VT_BSTR; + case CIM_REFERENCE: V_BSTR( var ) = SysAllocString( record->fields[index].u.sval ); break; case CIM_SINT32: - if (!vartype) vartype = VT_I4; V_I4( var ) = record->fields[index].u.ival; break; case CIM_UINT32: - if (!vartype) vartype = VT_UI4; V_UI4( var ) = record->fields[index].u.ival; break; default: @@ -419,6 +422,7 @@ static HRESULT record_set_value( struct record *record, UINT index, VARIANT *var { case CIM_STRING: case CIM_DATETIME: + case CIM_REFERENCE: record->fields[index].u.sval = (WCHAR *)(INT_PTR)val; return S_OK; case CIM_SINT16: @@ -488,7 +492,7 @@ static HRESULT WINAPI class_object_GetNames( if (wszQualifierName || pQualifierVal) FIXME("qualifier not supported\n"); - return get_properties( ec->query->view, lFlags, pNames ); + return get_properties( ec->query->view, co->index, lFlags, pNames ); } static HRESULT WINAPI class_object_BeginEnumeration( @@ -516,17 +520,18 @@ static HRESULT WINAPI class_object_Next( struct class_object *obj = impl_from_IWbemClassObject( iface ); struct enum_class_object *iter = impl_from_IEnumWbemClassObject( obj->iter ); struct view *view = iter->query->view; + struct table *table = get_view_table( view, obj->index ); BSTR prop; HRESULT hr; UINT i; TRACE("%p, %08x, %p, %p, %p, %p\n", iface, lFlags, strName, pVal, pType, plFlavor); - for (i = obj->index_property; i < view->table->num_cols; i++) + for (i = obj->index_property; i < table->num_cols; i++) { - if (is_method( view->table, i )) continue; - if (!is_selected_prop( view, view->table->columns[i].name )) continue; - if (!(prop = SysAllocString( view->table->columns[i].name ))) return E_OUTOFMEMORY; + if (is_method( table, i )) continue; + if (!is_result_prop( view, table->columns[i].name )) continue; + if (!(prop = SysAllocString( table->columns[i].name ))) return E_OUTOFMEMORY; if ((hr = get_propval( view, obj->index, prop, pVal, pType, plFlavor )) != S_OK) { SysFreeString( prop ); @@ -586,7 +591,7 @@ static BSTR get_body_text( const struct table *table, UINT row, UINT *len ) if ((value = get_value_bstr( table, row, i ))) { *len += ARRAY_SIZE( fmtW ); - *len += strlenW( table->columns[i].name ); + *len += lstrlenW( table->columns[i].name ); *len += SysStringLen( value ); SysFreeString( value ); } @@ -597,7 +602,7 @@ static BSTR get_body_text( const struct table *table, UINT row, UINT *len ) { if ((value = get_value_bstr( table, row, i ))) { - p += sprintfW( p, fmtW, table->columns[i].name, value ); + p += swprintf( p, fmtW, table->columns[i].name, value ); SysFreeString( value ); } } @@ -609,15 +614,16 @@ static BSTR get_object_text( const struct view *view, UINT index ) static const WCHAR fmtW[] = {'\n','i','n','s','t','a','n','c','e',' ','o','f',' ','%','s','\n','{','%','s','\n','}',';',0}; UINT len, len_body, row = view->result[index]; + struct table *table = get_view_table( view, index ); BSTR ret, body; len = ARRAY_SIZE( fmtW ); - len += strlenW( view->table->name ); - if (!(body = get_body_text( view->table, row, &len_body ))) return NULL; + len += lstrlenW( table->name ); + if (!(body = get_body_text( table, row, &len_body ))) return NULL; len += len_body; if (!(ret = SysAllocStringLen( NULL, len ))) return NULL; - sprintfW( ret, fmtW, view->table->name, body ); + swprintf( ret, fmtW, table->name, body ); SysFreeString( body ); return ret; } @@ -657,12 +663,12 @@ static HRESULT WINAPI class_object_SpawnInstance( { struct class_object *co = impl_from_IWbemClassObject( iface ); struct enum_class_object *ec = impl_from_IEnumWbemClassObject( co->iter ); - struct view *view = ec->query->view; + struct table *table = get_view_table( ec->query->view, co->index ); struct record *record; TRACE("%p, %08x, %p\n", iface, lFlags, ppNewInstance); - if (!(record = create_record( view->table ))) return E_OUTOFMEMORY; + if (!(record = create_record( table ))) return E_OUTOFMEMORY; return create_class_object( co->name, NULL, 0, record, ppNewInstance ); } @@ -728,7 +734,6 @@ static HRESULT create_signature_columns_and_data( IEnumWbemClassObject *iter, UI { static const WCHAR parameterW[] = {'P','a','r','a','m','e','t','e','r',0}; static const WCHAR typeW[] = {'T','y','p','e',0}; - static const WCHAR varianttypeW[] = {'V','a','r','i','a','n','t','T','y','p','e',0}; static const WCHAR defaultvalueW[] = {'D','e','f','a','u','l','t','V','a','l','u','e',0}; struct column *columns; BYTE *row; @@ -757,10 +762,6 @@ static HRESULT create_signature_columns_and_data( IEnumWbemClassObject *iter, UI if (hr != S_OK) goto error; columns[i].type = V_UI4( &val ); - hr = IWbemClassObject_Get( param, varianttypeW, 0, &val, NULL, NULL ); - if (hr != S_OK) goto error; - columns[i].vartype = V_UI4( &val ); - hr = IWbemClassObject_Get( param, defaultvalueW, 0, &val, NULL, NULL ); if (hr != S_OK) goto error; if (V_UI4( &val )) set_default_value( columns[i].type, V_UI4( &val ), row + offset ); @@ -807,12 +808,12 @@ static WCHAR *build_signature_table_name( const WCHAR *class, const WCHAR *metho static const WCHAR fmtW[] = {'_','_','%','s','_','%','s','_','%','s',0}; static const WCHAR outW[] = {'O','U','T',0}; static const WCHAR inW[] = {'I','N',0}; - UINT len = ARRAY_SIZE(fmtW) + ARRAY_SIZE(outW) + strlenW( class ) + strlenW( method ); + UINT len = ARRAY_SIZE(fmtW) + ARRAY_SIZE(outW) + lstrlenW( class ) + lstrlenW( method ); WCHAR *ret; if (!(ret = heap_alloc( len * sizeof(WCHAR) ))) return NULL; - sprintfW( ret, fmtW, class, method, dir == PARAM_IN ? inW : outW ); - return struprW( ret ); + swprintf( ret, fmtW, class, method, dir == PARAM_IN ? inW : outW ); + return _wcsupr( ret ); } HRESULT create_signature( const WCHAR *class, const WCHAR *method, enum param_direction dir, @@ -831,9 +832,9 @@ HRESULT create_signature( const WCHAR *class, const WCHAR *method, enum param_di WCHAR *query, *name; HRESULT hr; - len += strlenW( class ) + strlenW( method ); + len += lstrlenW( class ) + lstrlenW( method ); if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return E_OUTOFMEMORY; - sprintfW( query, selectW, class, method, dir >= 0 ? geW : leW ); + swprintf( query, selectW, class, method, dir >= 0 ? geW : leW ); hr = exec_query( query, &iter ); heap_free( query ); diff --git a/dll/win32/wbemprox/main.c b/dll/win32/wbemprox/main.c index e6ccd5c21c0..d90f4f8cc63 100644 --- a/dll/win32/wbemprox/main.c +++ b/dll/win32/wbemprox/main.c @@ -17,8 +17,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" - #include <stdarg.h> #define COBJMACROS diff --git a/dll/win32/wbemprox/precomp.h b/dll/win32/wbemprox/precomp.h index 54f2817c4c0..91403f2cc2f 100644 --- a/dll/win32/wbemprox/precomp.h +++ b/dll/win32/wbemprox/precomp.h @@ -2,8 +2,6 @@ #ifndef _WBEMPROX_PRECOMP_H_ #define _WBEMPROX_PRECOMP_H_ -#include <wine/config.h> - #include <stdarg.h> #define _INC_WINDOWS diff --git a/dll/win32/wbemprox/process.c b/dll/win32/wbemprox/process.c index 6bc3f37529f..de9b03f7089 100644 --- a/dll/win32/wbemprox/process.c +++ b/dll/win32/wbemprox/process.c @@ -20,7 +20,6 @@ #define COBJMACROS -#include "config.h" #include <stdarg.h> #include "windef.h" diff --git a/dll/win32/wbemprox/qualifier.c b/dll/win32/wbemprox/qualifier.c index 06dcc59e318..7243a2d69d5 100644 --- a/dll/win32/wbemprox/qualifier.c +++ b/dll/win32/wbemprox/qualifier.c @@ -18,8 +18,10 @@ #define COBJMACROS -#include "config.h" #include <stdarg.h> +#ifdef __REACTOS__ +#include <wchar.h> +#endif #include "windef.h" #include "winbase.h" @@ -102,19 +104,32 @@ static HRESULT create_qualifier_enum( const WCHAR *class, const WCHAR *member, c {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','_','_','Q','U','A','L', 'I','F','I','E','R','S',' ','W','H','E','R','E',' ','C','l','a','s','s','=', '\'','%','s','\'',' ','A','N','D',' ','M','e','m','b','e','r','=','\'','%','s','\'',0}; - static const WCHAR noneW[] = {'_','_','N','O','N','E',0}; + static const WCHAR fmt3W[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','_','_','Q','U','A','L', + 'I','F','I','E','R','S',' ','W','H','E','R','E',' ','C','l','a','s','s','=', + '\'','%','s','\'',0}; WCHAR *query; HRESULT hr; int len; - if (!member) member = noneW; - len = strlenW( class ) + strlenW( member ); - if (name) len += strlenW( name ) + ARRAY_SIZE(fmtW); - else len += ARRAY_SIZE(fmt2W); - - if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return E_OUTOFMEMORY; - if (name) sprintfW( query, fmtW, class, member, name ); - else sprintfW( query, fmt2W, class, member ); + if (member && name) + { + len = lstrlenW( class ) + lstrlenW( member ) + lstrlenW( name ) + ARRAY_SIZE(fmtW); + if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return E_OUTOFMEMORY; + swprintf( query, fmtW, class, member, name ); + } + else if (member) + { + len = lstrlenW( class ) + lstrlenW( member ) + ARRAY_SIZE(fmt2W); + if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return E_OUTOFMEMORY; + swprintf( query, fmt2W, class, member ); + } + else + { + len = lstrlenW( class ) + ARRAY_SIZE(fmt3W); + if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return E_OUTOFMEMORY; + swprintf( query, fmt3W, class ); + } hr = exec_query( query, iter ); heap_free( query ); @@ -124,9 +139,9 @@ static HRESULT create_qualifier_enum( const WCHAR *class, const WCHAR *member, c static HRESULT get_qualifier_value( const WCHAR *class, const WCHAR *member, const WCHAR *name, VARIANT *val, LONG *flavor ) { - static const WCHAR qualifiersW[] = {'_','_','Q','U','A','L','I','F','I','E','R','S',0}; static const WCHAR intvalueW[] = {'I','n','t','e','g','e','r','V','a','l','u','e',0}; static const WCHAR strvalueW[] = {'S','t','r','i','n','g','V','a','l','u','e',0}; + static const WCHAR boolvalueW[] = {'B','o','o','l','V','a','l','u','e',0}; static const WCHAR flavorW[] = {'F','l','a','v','o','r',0}; static const WCHAR typeW[] = {'T','y','p','e',0}; IEnumWbemClassObject *iter; @@ -137,7 +152,7 @@ static HRESULT get_qualifier_value( const WCHAR *class, const WCHAR *member, con hr = create_qualifier_enum( class, member, name, &iter ); if (FAILED( hr )) return hr; - hr = create_class_object( qualifiersW, iter, 0, NULL, &obj ); + hr = create_class_object( NULL, iter, 0, NULL, &obj ); IEnumWbemClassObject_Release( iter ); if (FAILED( hr )) return hr; @@ -157,6 +172,9 @@ static HRESULT get_qualifier_value( const WCHAR *class, const WCHAR *member, con case CIM_SINT32: hr = IWbemClassObject_Get( obj, intvalueW, 0, val, NULL, NULL ); break; + case CIM_BOOLEAN: + hr = IWbemClassObject_Get( obj, boolvalueW, 0, val, NULL, NULL ); + break; default: ERR("unhandled type %u\n", V_UI4( &var )); break; @@ -176,7 +194,12 @@ static HRESULT WINAPI qualifier_set_Get( { struct qualifier_set *set = impl_from_IWbemQualifierSet( iface ); - FIXME("%p, %s, %08x, %p, %p\n", iface, debugstr_w(wszName), lFlags, pVal, plFlavor); + TRACE("%p, %s, %08x, %p, %p\n", iface, debugstr_w(wszName), lFlags, pVal, plFlavor); + if (lFlags) + { + FIXME("flags %08x not supported\n", lFlags); + return E_NOTIMPL; + } return get_qualifier_value( set->class, set->member, wszName, pVal, plFlavor ); } @@ -203,8 +226,28 @@ static HRESULT WINAPI qualifier_set_GetNames( LONG lFlags, SAFEARRAY **pNames ) { - FIXME("%p, %08x, %p\n", iface, lFlags, pNames); - return E_NOTIMPL; + struct qualifier_set *set = impl_from_IWbemQualifierSet( iface ); + IEnumWbemClassObject *iter; + IWbemClassObject *obj; + HRESULT hr; + + TRACE("%p, %08x, %p\n", iface, lFlags, pNames); + if (lFlags) + { + FIXME("flags %08x not supported\n", lFlags); + return E_NOTIMPL; + } + + hr = create_qualifier_enum( set->class, set->member, NULL, &iter ); + if (FAILED( hr )) return hr; + + hr = create_class_object( NULL, iter, 0, NULL, &obj ); + IEnumWbemClassObject_Release( iter ); + if (FAILED( hr )) return hr; + + hr = IWbemClassObject_GetNames( obj, NULL, 0, NULL, pNames ); + IWbemClassObject_Release( obj ); + return hr; } static HRESULT WINAPI qualifier_set_BeginEnumeration( diff --git a/dll/win32/wbemprox/query.c b/dll/win32/wbemprox/query.c index d193574a393..85c93792bd0 100644 --- a/dll/win32/wbemprox/query.c +++ b/dll/win32/wbemprox/query.c @@ -18,8 +18,10 @@ #define COBJMACROS -#include "config.h" #include <stdarg.h> +#ifdef __REACTOS__ +#include <wchar.h> +#endif #include "windef.h" #include "winbase.h" @@ -30,25 +32,60 @@ WINE_DEFAULT_DEBUG_CHANNEL(wbemprox); -HRESULT create_view( const struct property *proplist, const WCHAR *class, - const struct expr *cond, struct view **ret ) +static HRESULT append_table( struct view *view, struct table *table ) { - struct view *view = heap_alloc( sizeof(struct view) ); + struct table **tmp; + if (!(tmp = heap_realloc( view->table, (view->table_count + 1) * sizeof(*tmp) ))) return E_OUTOFMEMORY; + view->table = tmp; + view->table[view->table_count++] = table; + return S_OK; +} + +HRESULT create_view( enum view_type type, const WCHAR *path, const struct keyword *keywordlist, const WCHAR *class, + const struct property *proplist, const struct expr *cond, struct view **ret ) +{ + struct view *view = heap_alloc_zero( sizeof(*view) ); if (!view) return E_OUTOFMEMORY; - view->proplist = proplist; - view->table = grab_table( class ); - view->cond = cond; - view->result = NULL; - view->count = 0; + + switch (type) + { + case VIEW_TYPE_ASSOCIATORS: + view->path = path; + view->keywordlist = keywordlist; + break; + + case VIEW_TYPE_SELECT: + { + struct table *table = grab_table( class ); + HRESULT hr; + + if (table && (hr = append_table( view, table )) != S_OK) + { + heap_free( view ); + return hr; + } + view->proplist = proplist; + view->cond = cond; + break; + } + default: + ERR( "unhandled type %u\n", type ); + heap_free( view ); + return E_INVALIDARG; + } + + view->type = type; *ret = view; return S_OK; } void destroy_view( struct view *view ) { + ULONG i; if (!view) return; - if (view->table) release_table( view->table ); + for (i = 0; i < view->table_count; i++) release_table( view->table[i] ); + heap_free( view->table ); heap_free( view->result ); heap_free( view ); } @@ -63,10 +100,10 @@ static BOOL eval_like( const WCHAR *lstr, const WCHAR *rstr ) { while (*q == '%') q++; if (!*q) return TRUE; - while (*p && *q && toupperW( *p ) == toupperW( *q )) { p++; q++; }; + while (*p && *q && towupper( *p ) == towupper( *q )) { p++; q++; }; if (!*p && !*q) return TRUE; } - if (*q != '%' && toupperW( *p++ ) != toupperW( *q++ )) return FALSE; + if (*q != '%' && towupper( *p++ ) != towupper( *q++ )) return FALSE; } return TRUE; } @@ -81,22 +118,22 @@ static HRESULT eval_strcmp( UINT op, const WCHAR *lstr, const WCHAR *rstr, LONGL switch (op) { case OP_EQ: - *val = !strcmpW( lstr, rstr ); + *val = !wcscmp( lstr, rstr ); break; case OP_GT: - *val = strcmpW( lstr, rstr ) > 0; + *val = wcscmp( lstr, rstr ) > 0; break; case OP_LT: - *val = strcmpW( lstr, rstr ) < 0; + *val = wcscmp( lstr, rstr ) < 0; break; case OP_LE: - *val = strcmpW( lstr, rstr ) <= 0; + *val = wcscmp( lstr, rstr ) <= 0; break; case OP_GE: - *val = strcmpW( lstr, rstr ) >= 0; + *val = wcscmp( lstr, rstr ) >= 0; break; case OP_NE: - *val = strcmpW( lstr, rstr ); + *val = wcscmp( lstr, rstr ); break; case OP_LIKE: *val = eval_like( lstr, rstr ); @@ -148,8 +185,8 @@ static HRESULT eval_boolcmp( UINT op, LONGLONG lval, LONGLONG rval, UINT ltype, { static const WCHAR trueW[] = {'T','r','u','e',0}; - if (ltype == CIM_STRING) lval = !strcmpiW( (const WCHAR *)(INT_PTR)lval, trueW ) ? -1 : 0; - else if (rtype == CIM_STRING) rval = !strcmpiW( (const WCHAR *)(INT_PTR)rval, trueW ) ? -1 : 0; + if (ltype == CIM_STRING) lval = !wcsicmp( (const WCHAR *)(INT_PTR)lval, trueW ) ? -1 : 0; + else if (rtype == CIM_STRING) rval = !wcsicmp( (const WCHAR *)(INT_PTR)rval, trueW ) ? -1 : 0; switch (op) { @@ -166,6 +203,35 @@ static HRESULT eval_boolcmp( UINT op, LONGLONG lval, LONGLONG rval, UINT ltype, return S_OK; } +static inline BOOL is_refcmp( const struct complex_expr *expr, UINT ltype, UINT rtype ) +{ + if (ltype == CIM_REFERENCE && expr->left->type == EXPR_PROPVAL && expr->right->type == EXPR_SVAL) return TRUE; + else if (rtype == CIM_REFERENCE && expr->right->type == EXPR_PROPVAL && expr->left->type == EXPR_SVAL) return TRUE; + return FALSE; +} + +static HRESULT eval_refcmp( UINT op, const WCHAR *lstr, const WCHAR *rstr, LONGLONG *val ) +{ + if (!lstr || !rstr) + { + *val = 0; + return S_OK; + } + switch (op) + { + case OP_EQ: + *val = !wcsicmp( lstr, rstr ); + break; + case OP_NE: + *val = wcsicmp( lstr, rstr ); + break; + default: + ERR("unhandled operator %u\n", op); + return WBEM_E_INVALID_QUERY; + } + return S_OK; +} + static UINT resolve_type( UINT left, UINT right ) { switch (left) @@ -201,13 +267,17 @@ static UINT resolve_type( UINT left, UINT right ) if (right == CIM_BOOLEAN) return CIM_BOOLEAN; break; + case CIM_REFERENCE: + if (right == CIM_REFERENCE) return CIM_REFERENCE; + break; + default: break; } return CIM_ILLEGAL; } -static const WCHAR *format_int( WCHAR *buf, CIMTYPE type, LONGLONG val ) +static const WCHAR *format_int( WCHAR *buf, UINT len, CIMTYPE type, LONGLONG val ) { static const WCHAR fmt_signedW[] = {'%','d',0}; static const WCHAR fmt_unsignedW[] = {'%','u',0}; @@ -219,13 +289,13 @@ static const WCHAR *format_int( WCHAR *buf, CIMTYPE type, LONGLONG val ) case CIM_SINT8: case CIM_SINT16: case CIM_SINT32: - sprintfW( buf, fmt_signedW, val ); + swprintf( buf, fmt_signedW, val ); return buf; case CIM_UINT8: case CIM_UINT16: case CIM_UINT32: - sprintfW( buf, fmt_unsignedW, val ); + swprintf( buf, fmt_unsignedW, val ); return buf; case CIM_SINT64: @@ -255,22 +325,28 @@ static HRESULT eval_binary( const struct table *table, UINT row, const struct co *type = resolve_type( ltype, rtype ); - if (is_boolcmp( expr, ltype, rtype )) - return eval_boolcmp( expr->op, lval, rval, ltype, rtype, val ); - if (is_strcmp( expr, ltype, rtype )) { const WCHAR *lstr, *rstr; WCHAR lbuf[21], rbuf[21]; - if (is_int( ltype )) lstr = format_int( lbuf, ltype, lval ); + if (is_int( ltype )) lstr = format_int( lbuf, ARRAY_SIZE( lbuf ), ltype, lval ); else lstr = (const WCHAR *)(INT_PTR)lval; - if (is_int( rtype )) rstr = format_int( rbuf, rtype, rval ); + if (is_int( rtype )) rstr = format_int( rbuf, ARRAY_SIZE( rbuf ), rtype, rval ); else rstr = (const WCHAR *)(INT_PTR)rval; return eval_strcmp( expr->op, lstr, rstr, val ); } + if (is_boolcmp( expr, ltype, rtype )) + { + return eval_boolcmp( expr->op, lval, rval, ltype, rtype, val ); + } + if (is_refcmp( expr, ltype, rtype )) + { + return eval_refcmp( expr->op, (const WCHAR *)(INT_PTR)lval, (const WCHAR *)(INT_PTR)rval, val ); + } + switch (expr->op) { case OP_EQ: @@ -402,22 +478,243 @@ HRESULT eval_cond( const struct table *table, UINT row, const struct expr *cond, return WBEM_E_INVALID_QUERY; } -HRESULT execute_view( struct view *view ) +static WCHAR *build_assoc_query( const WCHAR *class, UINT class_len ) +{ + static const WCHAR fmtW[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','_','_','A','S','S','O','C','I','A','T','O','R','S', + ' ','W','H','E','R','E',' ','C','l','a','s','s','=','\'','%','s','\'',0}; + UINT len = class_len + ARRAY_SIZE(fmtW); + WCHAR *ret; + + if (!(ret = heap_alloc( len * sizeof(WCHAR) ))) return NULL; + swprintf( ret, fmtW, class ); + return ret; +} + +static HRESULT create_assoc_enum( const WCHAR *class, UINT class_len, IEnumWbemClassObject **iter ) +{ + WCHAR *query; + HRESULT hr; + + if (!(query = build_assoc_query( class, class_len ))) return E_OUTOFMEMORY; + hr = exec_query( query, iter ); + heap_free( query ); + return hr; +} + +static WCHAR *build_antecedent_query( const WCHAR *assocclass, const WCHAR *dependent ) +{ + static const WCHAR fmtW[] = + {'S','E','L','E','C','T',' ','A','n','t','e','c','e','d','e','n','t',' ','F','R','O','M',' ','%','s',' ', + 'W','H','E','R','E',' ','D','e','p','e','n','d','e','n','t','=','\'','%','s','\'',0}; + UINT len = lstrlenW(assocclass) + lstrlenW(dependent) + ARRAY_SIZE(fmtW); + WCHAR *ret; + + if (!(ret = heap_alloc( len * sizeof(WCHAR) ))) return NULL; + swprintf( ret, fmtW, assocclass, dependent ); + return ret; +} + +static BSTR build_servername(void) +{ + WCHAR server[MAX_COMPUTERNAME_LENGTH + 1], *p; + DWORD len = ARRAY_SIZE( server ); + + if (!(GetComputerNameW( server, &len ))) return NULL; + for (p = server; *p; p++) *p = towupper( *p ); + return SysAllocString( server ); +} + +static BSTR build_namespace(void) +{ + static const WCHAR cimv2W[] = {'R','O','O','T','\\','C','I','M','V','2',0}; + return SysAllocString( cimv2W ); +} + +static WCHAR *build_canonical_path( const WCHAR *relpath ) +{ + static const WCHAR fmtW[] = {'\\','\\','%','s','\\','%','s',':',0}; + BSTR server, namespace; + WCHAR *ret; + UINT len, i; + + if (!(server = build_servername())) return NULL; + if (!(namespace = build_namespace())) + { + SysFreeString( server ); + return NULL; + } + + len = ARRAY_SIZE( fmtW ) + SysStringLen( server ) + SysStringLen( namespace ) + lstrlenW( relpath ); + if ((ret = heap_alloc( len * sizeof(WCHAR ) ))) + { + len = swprintf( ret, fmtW, server, namespace ); + for (i = 0; i < lstrlenW( relpath ); i ++) + { + if (relpath[i] == '\'') ret[len++] = '"'; + else ret[len++] = relpath[i]; + } + ret[len] = 0; + } + + SysFreeString( server ); + SysFreeString( namespace ); + return ret; +} + +static HRESULT get_antecedent( const WCHAR *assocclass, const WCHAR *dependent, BSTR *ret ) +{ + static const WCHAR antecedentW[] = {'A','n','t','e','c','e','d','e','n','t',0}; + WCHAR *fullpath, *str; + IEnumWbemClassObject *iter = NULL; + IWbemClassObject *obj; + HRESULT hr = E_OUTOFMEMORY; + ULONG count; + VARIANT var; + + if (!(fullpath = build_canonical_path( dependent ))) return E_OUTOFMEMORY; + if (!(str = build_antecedent_query( assocclass, fullpath ))) goto done; + if ((hr = exec_query( str, &iter )) != S_OK) goto done; + + IEnumWbemClassObject_Next( iter, WBEM_INFINITE, 1, &obj, &count ); + if (!count) + { + *ret = NULL; + goto done; + } + + hr = IWbemClassObject_Get( obj, antecedentW, 0, &var, NULL, NULL ); + IWbemClassObject_Release( obj ); + if (hr != S_OK) goto done; + *ret = V_BSTR( &var ); + +done: + if (iter) IEnumWbemClassObject_Release( iter ); + heap_free( str ); + heap_free( fullpath ); + return hr; +} + +static HRESULT do_query( const WCHAR *str, struct query **ret_query ) +{ + struct query *query; + HRESULT hr; + + if (!(query = create_query())) return E_OUTOFMEMORY; + if ((hr = parse_query( str, &query->view, &query->mem )) != S_OK || (hr = execute_view( query->view )) != S_OK) + { + release_query( query ); + return hr; + } + *ret_query = query; + return S_OK; +} + +static HRESULT get_antecedent_table( const WCHAR *assocclass, const WCHAR *dependent, struct table **table ) +{ + BSTR antecedent = NULL; + struct path *path = NULL; + WCHAR *str = NULL; + struct query *query = NULL; + HRESULT hr; + + if ((hr = get_antecedent( assocclass, dependent, &antecedent )) != S_OK) return hr; + if (!antecedent) + { + *table = NULL; + return S_OK; + } + if ((hr = parse_path( antecedent, &path )) != S_OK) goto done; + if (!(str = query_from_path( path ))) + { + hr = E_OUTOFMEMORY; + goto done; + } + + if ((hr = do_query( str, &query )) != S_OK) goto done; + if (query->view->table_count) *table = addref_table( query->view->table[0] ); + else *table = NULL; + +done: + if (query) release_query( query ); + free_path( path ); + SysFreeString( antecedent ); + heap_free( str ); + return hr; +} + +static HRESULT exec_assoc_view( struct view *view ) +{ + static const WCHAR assocclassW[] = {'A','s','s','o','c','C','l','a','s','s',0}; + IEnumWbemClassObject *iter = NULL; + struct path *path; + HRESULT hr; + + if (view->keywordlist) FIXME( "ignoring keywords\n" ); + if ((hr = parse_path( view->path, &path )) != S_OK) return hr; + + if ((hr = create_assoc_enum( path->class, path->class_len, &iter )) != S_OK) goto done; + for (;;) + { + ULONG count; + IWbemClassObject *obj; + struct table *table; + VARIANT var; + + IEnumWbemClassObject_Next( iter, WBEM_INFINITE, 1, &obj, &count ); + if (!count) break; + + if ((hr = IWbemClassObject_Get( obj, assocclassW, 0, &var, NULL, NULL )) != S_OK) + { + IWbemClassObject_Release( obj ); + goto done; + } + IWbemClassObject_Release( obj ); + + hr = get_antecedent_table( V_BSTR(&var), view->path, &table ); + VariantClear( &var ); + if (hr != S_OK) goto done; + + if (table && (hr = append_table( view, table )) != S_OK) + { + release_table( table ); + goto done; + } + } + + if (view->table_count) + { + if (!(view->result = heap_alloc_zero( view->table_count * sizeof(UINT) ))) hr = E_OUTOFMEMORY; + else view->result_count = view->table_count; + } + +done: + if (iter) IEnumWbemClassObject_Release( iter ); + free_path( path ); + return hr; +} + +static HRESULT exec_select_view( struct view *view ) { UINT i, j = 0, len; + enum fill_status status = FILL_STATUS_UNFILTERED; + struct table *table; + + if (!view->table_count) return S_OK; - if (!view->table) return S_OK; - if (view->table->fill) + table = view->table[0]; + if (table->fill) { - clear_table( view->table ); - view->table->fill( view->table, view->cond ); + clear_table( table ); + status = table->fill( table, view->cond ); } - if (!view->table->num_rows) return S_OK; + if (status == FILL_STATUS_FAILED) return WBEM_E_FAILED; + if (!table->num_rows) return S_OK; - len = min( view->table->num_rows, 16 ); + len = min( table->num_rows, 16 ); if (!(view->result = heap_alloc( len * sizeof(UINT) ))) return E_OUTOFMEMORY; - for (i = 0; i < view->table->num_rows; i++) + for (i = 0; i < table->num_rows; i++) { HRESULT hr; LONGLONG val = 0; @@ -430,13 +727,31 @@ HRESULT execute_view( struct view *view ) if (!(tmp = heap_realloc( view->result, len * sizeof(UINT) ))) return E_OUTOFMEMORY; view->result = tmp; } - if ((hr = eval_cond( view->table, i, view->cond, &val, &type )) != S_OK) return hr; + if (status == FILL_STATUS_FILTERED) val = 1; + else if ((hr = eval_cond( table, i, view->cond, &val, &type )) != S_OK) return hr; if (val) view->result[j++] = i; } - view->count = j; + + view->result_count = j; return S_OK; } +HRESULT execute_view( struct view *view ) +{ + switch (view->type) + { + case VIEW_TYPE_ASSOCIATORS: + return exec_assoc_view( view ); + + case VIEW_TYPE_SELECT: + return exec_select_view( view ); + + default: + ERR( "unhandled type %u\n", view->type ); + return E_INVALIDARG; + } +} + struct query *create_query(void) { struct query *query; @@ -486,14 +801,13 @@ done: return hr; } -BOOL is_selected_prop( const struct view *view, const WCHAR *name ) +BOOL is_result_prop( const struct view *view, const WCHAR *name ) { const struct property *prop = view->proplist; - if (!prop) return TRUE; while (prop) { - if (!strcmpiW( prop->name, name )) return TRUE; + if (!wcsicmp( prop->name, name )) return TRUE; prop = prop->next; } return FALSE; @@ -504,61 +818,34 @@ static BOOL is_system_prop( const WCHAR *name ) return (name[0] == '_' && name[1] == '_'); } -static BSTR build_servername( const struct view *view ) -{ - WCHAR server[MAX_COMPUTERNAME_LENGTH + 1], *p; - DWORD len = ARRAY_SIZE( server ); - - if (view->proplist) return NULL; - - if (!(GetComputerNameW( server, &len ))) return NULL; - for (p = server; *p; p++) *p = toupperW( *p ); - return SysAllocString( server ); -} - -static BSTR build_classname( const struct view *view ) -{ - return SysAllocString( view->table->name ); -} - -static BSTR build_namespace( const struct view *view ) -{ - static const WCHAR cimv2W[] = {'R','O','O','T','\\','C','I','M','V','2',0}; - - if (view->proplist) return NULL; - return SysAllocString( cimv2W ); -} - -static BSTR build_proplist( const struct view *view, UINT index, UINT count, UINT *len ) +static BSTR build_proplist( const struct table *table, UINT row, UINT count, UINT *len ) { static const WCHAR fmtW[] = {'%','s','=','%','s',0}; - UINT i, j, offset, row = view->result[index]; + UINT i, j, offset; BSTR *values, ret = NULL; if (!(values = heap_alloc( count * sizeof(BSTR) ))) return NULL; *len = j = 0; - for (i = 0; i < view->table->num_cols; i++) + for (i = 0; i < table->num_cols; i++) { - if (view->table->columns[i].type & COL_FLAG_KEY) + if (table->columns[i].type & COL_FLAG_KEY) { - const WCHAR *name = view->table->columns[i].name; - - values[j] = get_value_bstr( view->table, row, i ); - *len += strlenW( fmtW ) + strlenW( name ) + strlenW( values[j] ); + const WCHAR *name = table->columns[i].name; + values[j] = get_value_bstr( table, row, i ); + *len += lstrlenW( fmtW ) + lstrlenW( name ) + lstrlenW( values[j] ); j++; } } if ((ret = SysAllocStringLen( NULL, *len ))) { offset = j = 0; - for (i = 0; i < view->table->num_cols; i++) + for (i = 0; i < table->num_cols; i++) { - if (view->table->columns[i].type & COL_FLAG_KEY) + if (table->columns[i].type & COL_FLAG_KEY) { - const WCHAR *name = view->table->columns[i].name; - - offset += sprintfW( ret + offset, fmtW, name, values[j] ); + const WCHAR *name = table->columns[i].name; + offset += swprintf( ret + offset, fmtW, name, values[j] ); if (j < count - 1) ret[offset++] = ','; j++; } @@ -569,32 +856,34 @@ static BSTR build_proplist( const struct view *view, UINT index, UINT count, UIN return ret; } -static UINT count_key_columns( const struct view *view ) +static UINT count_key_columns( const struct table *table ) { UINT i, num_keys = 0; - for (i = 0; i < view->table->num_cols; i++) + for (i = 0; i < table->num_cols; i++) { - if (view->table->columns[i].type & COL_FLAG_KEY) num_keys++; + if (table->columns[i].type & COL_FLAG_KEY) num_keys++; } return num_keys; } -static BSTR build_relpath( const struct view *view, UINT index, const WCHAR *name ) +static BSTR build_relpath( const struct view *view, UINT table_index, UINT result_index, const WCHAR *name ) { static const WCHAR fmtW[] = {'%','s','.','%','s',0}; BSTR class, proplist, ret = NULL; + struct table *table = view->table[table_index]; + UINT row = view->result[result_index]; UINT num_keys, len; if (view->proplist) return NULL; - if (!(class = build_classname( view ))) return NULL; - if (!(num_keys = count_key_columns( view ))) return class; - if (!(proplist = build_proplist( view, index, num_keys, &len ))) goto done; + if (!(class = SysAllocString( view->table[table_index]->name ))) return NULL; + if (!(num_keys = count_key_columns( table ))) return class; + if (!(proplist = build_proplist( table, row, num_keys, &len ))) goto done; - len += strlenW( fmtW ) + SysStringLen( class ); + len += lstrlenW( fmtW ) + SysStringLen( class ); if (!(ret = SysAllocStringLen( NULL, len ))) goto done; - sprintfW( ret, fmtW, class, proplist ); + swprintf( ret, fmtW, class, proplist ); done: SysFreeString( class ); @@ -602,7 +891,7 @@ done: return ret; } -static BSTR build_path( const struct view *view, UINT index, const WCHAR *name ) +static BSTR build_path( const struct view *view, UINT table_index, UINT result_index, const WCHAR *name ) { static const WCHAR fmtW[] = {'\\','\\','%','s','\\','%','s',':','%','s',0}; BSTR server, namespace = NULL, relpath = NULL, ret = NULL; @@ -610,13 +899,13 @@ static BSTR build_path( const struct view *view, UINT index, const WCHAR *name ) if (view->proplist) return NULL; - if (!(server = build_servername( view ))) return NULL; - if (!(namespace = build_namespace( view ))) goto done; - if (!(relpath = build_relpath( view, index, name ))) goto done; + if (!(server = build_servername())) return NULL; + if (!(namespace = build_namespace())) goto done; + if (!(relpath = build_relpath( view, table_index, result_index, name ))) goto done; - len = strlenW( fmtW ) + SysStringLen( server ) + SysStringLen( namespace ) + SysStringLen( relpath ); + len = lstrlenW( fmtW ) + SysStringLen( server ) + SysStringLen( namespace ) + SysStringLen( relpath ); if (!(ret = SysAllocStringLen( NULL, len ))) goto done; - sprintfW( ret, fmtW, server, namespace, relpath ); + swprintf( ret, fmtW, server, namespace, relpath ); done: SysFreeString( server ); @@ -630,30 +919,30 @@ BOOL is_method( const struct table *table, UINT column ) return table->columns[column].type & COL_FLAG_METHOD; } -static UINT count_properties( const struct view *view ) +static UINT count_properties( const struct table *table ) { UINT i, num_props = 0; - for (i = 0; i < view->table->num_cols; i++) + for (i = 0; i < table->num_cols; i++) { - if (!is_method( view->table, i)) num_props++; + if (!is_method( table, i )) num_props++; } return num_props; } -static UINT count_selected_properties( const struct view *view ) +static UINT count_result_properties( const struct view *view, UINT table_index ) { const struct property *prop = view->proplist; UINT count; - if (!prop) return count_properties( view ); + if (!prop) return count_properties( view->table[table_index] ); count = 1; while ((prop = prop->next)) count++; return count; } -static HRESULT get_system_propval( const struct view *view, UINT index, const WCHAR *name, +static HRESULT get_system_propval( const struct view *view, UINT table_index, UINT result_index, const WCHAR *name, VARIANT *ret, CIMTYPE *type, LONG *flavor ) { static const WCHAR classW[] = {'_','_','C','L','A','S','S',0}; @@ -666,17 +955,17 @@ static HRESULT get_system_propval( const struct view *view, UINT index, const WC if (flavor) *flavor = WBEM_FLAVOR_ORIGIN_SYSTEM; - if (!strcmpiW( name, classW )) + if (!wcsicmp( name, classW )) { if (ret) { V_VT( ret ) = VT_BSTR; - V_BSTR( ret ) = build_classname( view ); + V_BSTR( ret ) = SysAllocString( view->table[table_index]->name ); } if (type) *type = CIM_STRING; return S_OK; } - if (!strcmpiW( name, genusW )) + if (!wcsicmp( name, genusW )) { if (ret) { @@ -686,52 +975,52 @@ static HRESULT get_system_propval( const struct view *view, UINT index, const WC if (type) *type = CIM_SINT32; return S_OK; } - else if (!strcmpiW( name, namespaceW )) + else if (!wcsicmp( name, namespaceW )) { if (ret) { V_VT( ret ) = VT_BSTR; - V_BSTR( ret ) = build_namespace( view ); + V_BSTR( ret ) = view->proplist ? NULL : build_namespace(); } if (type) *type = CIM_STRING; return S_OK; } - else if (!strcmpiW( name, pathW )) + else if (!wcsicmp( name, pathW )) { if (ret) { V_VT( ret ) = VT_BSTR; - V_BSTR( ret ) = build_path( view, index, name ); + V_BSTR( ret ) = build_path( view, table_index, result_index, name ); } if (type) *type = CIM_STRING; return S_OK; } - if (!strcmpiW( name, propcountW )) + if (!wcsicmp( name, propcountW )) { if (ret) { V_VT( ret ) = VT_I4; - V_I4( ret ) = count_selected_properties( view ); + V_I4( ret ) = count_result_properties( view, table_index ); } if (type) *type = CIM_SINT32; return S_OK; } - else if (!strcmpiW( name, relpathW )) + else if (!wcsicmp( name, relpathW )) { if (ret) { V_VT( ret ) = VT_BSTR; - V_BSTR( ret ) = build_relpath( view, index, name ); + V_BSTR( ret ) = build_relpath( view, table_index, result_index, name ); } if (type) *type = CIM_STRING; return S_OK; } - else if (!strcmpiW( name, serverW )) + else if (!wcsicmp( name, serverW )) { if (ret) { V_VT( ret ) = VT_BSTR; - V_BSTR( ret ) = build_servername( view ); + V_BSTR( ret ) = view->proplist ? NULL : build_servername(); } if (type) *type = CIM_STRING; return S_OK; @@ -744,17 +1033,25 @@ VARTYPE to_vartype( CIMTYPE type ) { switch (type) { - case CIM_BOOLEAN: return VT_BOOL; + case CIM_BOOLEAN: return VT_BOOL; + case CIM_STRING: - case CIM_DATETIME: return VT_BSTR; - case CIM_SINT8: return VT_I1; - case CIM_UINT8: return VT_UI1; - case CIM_SINT16: return VT_I2; - case CIM_UINT16: return VT_UI2; - case CIM_SINT32: return VT_I4; - case CIM_UINT32: return VT_UI4; - case CIM_SINT64: return VT_I8; - case CIM_UINT64: return VT_UI8; + case CIM_REFERENCE: + case CIM_DATETIME: return VT_BSTR; + + case CIM_SINT8: return VT_I1; + case CIM_UINT8: return VT_UI1; + case CIM_SINT16: return VT_I2; + + case CIM_UINT16: + case CIM_SINT32: + case CIM_UINT32: return VT_I4; + + case CIM_SINT64: return VT_I8; + case CIM_UINT64: return VT_UI8; + + case CIM_REAL32: return VT_R4; + default: ERR("unhandled type %u\n", type); break; @@ -762,18 +1059,17 @@ VARTYPE to_vartype( CIMTYPE type ) return 0; } -SAFEARRAY *to_safearray( const struct array *array, CIMTYPE type ) +SAFEARRAY *to_safearray( const struct array *array, CIMTYPE basetype ) { SAFEARRAY *ret; - UINT size = get_type_size( type ); - VARTYPE vartype = to_vartype( type ); + VARTYPE vartype = to_vartype( basetype ); LONG i; if (!array || !(ret = SafeArrayCreateVector( vartype, 0, array->count ))) return NULL; for (i = 0; i < array->count; i++) { - void *ptr = (char *)array->ptr + i * size; + void *ptr = (char *)array->ptr + i * array->elem_size; if (vartype == VT_BSTR) { BSTR str = SysAllocString( *(const WCHAR **)ptr ); @@ -830,6 +1126,9 @@ void set_variant( VARTYPE type, LONGLONG val, void *val_ptr, VARIANT *ret ) break; case VT_NULL: break; + case VT_R4: + V_R4( ret ) = *(FLOAT *)&val; + break; default: ERR("unhandled variant type %u\n", type); return; @@ -837,48 +1136,88 @@ void set_variant( VARTYPE type, LONGLONG val, void *val_ptr, VARIANT *ret ) V_VT( ret ) = type; } -HRESULT get_propval( const struct view *view, UINT index, const WCHAR *name, VARIANT *ret, - CIMTYPE *type, LONG *flavor ) +static HRESULT map_view_index( const struct view *view, UINT index, UINT *table_index, UINT *result_index ) +{ + if (!view->table) return WBEM_E_NOT_FOUND; + + switch (view->type) + { + case VIEW_TYPE_SELECT: + *table_index = 0; + *result_index = index; + break; + + case VIEW_TYPE_ASSOCIATORS: + *table_index = *result_index = index; + break; + + default: + ERR( "unhandled view type %u\n", view->type ); + return WBEM_E_FAILED; + } + return S_OK; +} + +struct table *get_view_table( const struct view *view, UINT index ) +{ + switch (view->type) + { + case VIEW_TYPE_SELECT: + return view->table[0]; + + case VIEW_TYPE_ASSOCIATORS: + return view->table[index]; + + default: + ERR( "unhandled view type %u\n", view->type ); + return NULL; + } +} + +HRESULT get_propval( const struct view *view, UINT index, const WCHAR *name, VARIANT *ret, CIMTYPE *type, + LONG *flavor ) { HRESULT hr; - UINT column, row; + UINT column, row, table_index, result_index; + struct table *table; VARTYPE vartype; void *val_ptr = NULL; LONGLONG val; - if (is_system_prop( name )) return get_system_propval( view, index, name, ret, type, flavor ); - if (!view->count || !is_selected_prop( view, name )) return WBEM_E_NOT_FOUND; + if ((hr = map_view_index( view, index, &table_index, &result_index )) != S_OK) return hr; - hr = get_column_index( view->table, name, &column ); - if (hr != S_OK || is_method( view->table, column )) return WBEM_E_NOT_FOUND; + if (is_system_prop( name )) return get_system_propval( view, table_index, result_index, name, ret, type, flavor ); + if (!view->result_count || !is_result_prop( view, name )) return WBEM_E_NOT_FOUND; - row = view->result[index]; - hr = get_value( view->table, row, column, &val ); + table = view->table[table_index]; + hr = get_column_index( table, name, &column ); + if (hr != S_OK || is_method( table, column )) return WBEM_E_NOT_FOUND; + + row = view->result[result_index]; + hr = get_value( table, row, column, &val ); if (hr != S_OK) return hr; - if (type) *type = view->table->columns[column].type & COL_TYPE_MASK; + if (type) *type = table->columns[column].type & COL_TYPE_MASK; if (flavor) *flavor = 0; if (!ret) return S_OK; - vartype = view->table->columns[column].vartype; - if (view->table->columns[column].type & CIM_FLAG_ARRAY) + vartype = to_vartype( table->columns[column].type & CIM_TYPE_MASK ); + if (table->columns[column].type & CIM_FLAG_ARRAY) { - CIMTYPE basetype = view->table->columns[column].type & CIM_TYPE_MASK; + CIMTYPE basetype = table->columns[column].type & CIM_TYPE_MASK; val_ptr = to_safearray( (const struct array *)(INT_PTR)val, basetype ); if (!val_ptr) vartype = VT_NULL; - else if (!vartype) vartype = to_vartype( basetype ) | VT_ARRAY; + else vartype |= VT_ARRAY; set_variant( vartype, val, val_ptr, ret ); return S_OK; } - switch (view->table->columns[column].type & COL_TYPE_MASK) + switch (table->columns[column].type & COL_TYPE_MASK) { - case CIM_BOOLEAN: - if (!vartype) vartype = VT_BOOL; - break; case CIM_STRING: + case CIM_REFERENCE: case CIM_DATETIME: if (val) { @@ -888,34 +1227,25 @@ HRESULT get_propval( const struct view *view, UINT index, const WCHAR *name, VAR else vartype = VT_NULL; break; - case CIM_SINT8: - if (!vartype) vartype = VT_I1; + case CIM_SINT64: + vartype = VT_BSTR; + val_ptr = get_value_bstr( table, row, column ); break; - case CIM_UINT8: - if (!vartype) vartype = VT_UI1; + case CIM_UINT64: + vartype = VT_BSTR; + val_ptr = get_value_bstr( table, row, column ); break; + case CIM_BOOLEAN: + case CIM_SINT8: + case CIM_UINT8: case CIM_SINT16: - if (!vartype) vartype = VT_I2; - break; case CIM_UINT16: - if (!vartype) vartype = VT_UI2; - break; case CIM_SINT32: - if (!vartype) vartype = VT_I4; - break; case CIM_UINT32: - if (!vartype) vartype = VT_UI4; - break; - case CIM_SINT64: - vartype = VT_BSTR; - val_ptr = get_value_bstr( view->table, row, column ); - break; - case CIM_UINT64: - vartype = VT_BSTR; - val_ptr = get_value_bstr( view->table, row, column ); + case CIM_REAL32: break; default: - ERR("unhandled column type %u\n", view->table->columns[column].type); + ERR("unhandled column type %u\n", table->columns[column].type); return WBEM_E_FAILED; } @@ -950,23 +1280,22 @@ static struct array *to_array( VARIANT *var, CIMTYPE *type ) LONG bound, i; VARTYPE vartype; CIMTYPE basetype; - UINT size; if (SafeArrayGetVartype( V_ARRAY( var ), &vartype ) != S_OK) return NULL; if (!(basetype = to_cimtype( vartype ))) return NULL; if (SafeArrayGetUBound( V_ARRAY( var ), 1, &bound ) != S_OK) return NULL; if (!(ret = heap_alloc( sizeof(struct array) ))) return NULL; - ret->count = bound + 1; - size = get_type_size( basetype ); - if (!(ret->ptr = heap_alloc_zero( ret->count * size ))) + ret->count = bound + 1; + ret->elem_size = get_type_size( basetype ); + if (!(ret->ptr = heap_alloc_zero( ret->count * ret->elem_size ))) { heap_free( ret ); return NULL; } for (i = 0; i < ret->count; i++) { - void *ptr = (char *)ret->ptr + i * size; + void *ptr = (char *)ret->ptr + i * ret->elem_size; if (vartype == VT_BSTR) { BSTR str; @@ -1046,45 +1375,56 @@ HRESULT to_longlong( VARIANT *var, LONGLONG *val, CIMTYPE *type ) HRESULT put_propval( const struct view *view, UINT index, const WCHAR *name, VARIANT *var, CIMTYPE type ) { HRESULT hr; - UINT column, row = view->result[index]; + UINT row, column, table_index, result_index; + struct table *table; LONGLONG val; - hr = get_column_index( view->table, name, &column ); + if ((hr = map_view_index( view, index, &table_index, &result_index )) != S_OK) return hr; + + table = view->table[table_index]; + hr = get_column_index( table, name, &column ); if (hr != S_OK) { FIXME("no support for creating new properties\n"); return WBEM_E_FAILED; } - if (is_method( view->table, column ) || !(view->table->columns[column].type & COL_FLAG_DYNAMIC)) + if (is_method( table, column ) || !(table->columns[column].type & COL_FLAG_DYNAMIC)) return WBEM_E_FAILED; hr = to_longlong( var, &val, &type ); if (hr != S_OK) return hr; - return set_value( view->table, row, column, val, type ); + row = view->result[result_index]; + return set_value( table, row, column, val, type ); } -HRESULT get_properties( const struct view *view, LONG flags, SAFEARRAY **props ) +HRESULT get_properties( const struct view *view, UINT index, LONG flags, SAFEARRAY **props ) { SAFEARRAY *sa; BSTR str; - UINT i, num_props = count_selected_properties( view ); + UINT i, table_index, result_index, num_props; + struct table *table; + HRESULT hr; LONG j; + if ((hr = map_view_index( view, index, &table_index, &result_index )) != S_OK) return hr; + + num_props = count_result_properties( view, table_index ); if (!(sa = SafeArrayCreateVector( VT_BSTR, 0, num_props ))) return E_OUTOFMEMORY; - for (i = 0, j = 0; i < view->table->num_cols; i++) + table = view->table[table_index]; + for (i = 0, j = 0; i < table->num_cols; i++) { BOOL is_system; - if (is_method( view->table, i )) continue; - if (!is_selected_prop( view, view->table->columns[i].name )) continue; + if (is_method( table, i )) continue; + if (!is_result_prop( view, table->columns[i].name )) continue; - is_system = is_system_prop( view->table->columns[i].name ); + is_system = is_system_prop( table->columns[i].name ); if ((flags & WBEM_FLAG_NONSYSTEM_ONLY) && is_system) continue; else if ((flags & WBEM_FLAG_SYSTEM_ONLY) && !is_system) continue; - str = SysAllocString( view->table->columns[i].name ); + str = SysAllocString( table->columns[i].name ); if (!str || SafeArrayPutElement( sa, &j, str ) != S_OK) { SysFreeString( str ); diff --git a/dll/win32/wbemprox/reg.c b/dll/win32/wbemprox/reg.c index c45cbbef78c..1cbad2df81f 100644 --- a/dll/win32/wbemprox/reg.c +++ b/dll/win32/wbemprox/reg.c @@ -20,7 +20,6 @@ #define COBJMACROS -#include "config.h" #include <stdarg.h> #include "windef.h" diff --git a/dll/win32/wbemprox/security.c b/dll/win32/wbemprox/security.c index d3057e01f55..3ad7321a60c 100644 --- a/dll/win32/wbemprox/security.c +++ b/dll/win32/wbemprox/security.c @@ -20,7 +20,6 @@ #define COBJMACROS -#include "config.h" #include <stdarg.h> #include "windef.h" diff --git a/dll/win32/wbemprox/service.c b/dll/win32/wbemprox/service.c index b096c5ceb90..53010bc100c 100644 --- a/dll/win32/wbemprox/service.c +++ b/dll/win32/wbemprox/service.c @@ -20,7 +20,6 @@ #define COBJMACROS -#include "config.h" #include <stdarg.h> #include "windef.h" diff --git a/dll/win32/wbemprox/services.c b/dll/win32/wbemprox/services.c index 599a421ced8..b0840fbd3d3 100644 --- a/dll/win32/wbemprox/services.c +++ b/dll/win32/wbemprox/services.c @@ -18,8 +18,10 @@ #define COBJMACROS -#include "config.h" #include <stdarg.h> +#ifdef __REACTOS__ +#include <wchar.h> +#endif #include "windef.h" #include "winbase.h" @@ -27,7 +29,6 @@ #include "wbemcli.h" #include "wine/debug.h" -#include "wine/unicode.h" #include "wbemprox_private.h" WINE_DEFAULT_DEBUG_CHANNEL(wbemprox); @@ -279,7 +280,7 @@ static HRESULT WINAPI wbem_services_OpenNamespace( TRACE("%p, %s, 0x%08x, %p, %p, %p\n", iface, debugstr_w(strNamespace), lFlags, pCtx, ppWorkingNamespace, ppResult); - if ((strcmpiW( strNamespace, cimv2W ) && strcmpiW( strNamespace, defaultW )) || ws->namespace) + if ((wcsicmp( strNamespace, cimv2W ) && wcsicmp( strNamespace, defaultW )) || ws->namespace) return WBEM_E_INVALID_NAMESPACE; return WbemServices_create( cimv2W, (void **)ppWorkingNamespace ); @@ -322,15 +323,7 @@ static HRESULT WINAPI wbem_services_QueryObjectSink( return WBEM_E_FAILED; } -struct path -{ - WCHAR *class; - UINT class_len; - WCHAR *filter; - UINT filter_len; -}; - -static HRESULT parse_path( const WCHAR *str, struct path **ret ) +HRESULT parse_path( const WCHAR *str, struct path **ret ) { struct path *path; const WCHAR *p = str, *q; @@ -340,31 +333,47 @@ static HRESULT parse_path( const WCHAR *str, struct path **ret ) if (*p == '\\') { - static const WCHAR cimv2W[] = {'R','O','O','T','\\','C','I','M','V','2'}; - + static const WCHAR cimv2W[] = {'R','O','O','T','\\','C','I','M','V','2',0}; WCHAR server[MAX_COMPUTERNAME_LENGTH+1]; DWORD server_len = ARRAY_SIZE(server); p++; - if (*p != '\\') return WBEM_E_INVALID_OBJECT_PATH; + if (*p != '\\') + { + heap_free( path ); + return WBEM_E_INVALID_OBJECT_PATH; + } p++; q = p; while (*p && *p != '\\') p++; - if (!*p) return WBEM_E_INVALID_OBJECT_PATH; + if (!*p) + { + heap_free( path ); + return WBEM_E_INVALID_OBJECT_PATH; + } len = p - q; - if (!GetComputerNameW( server, &server_len ) || server_len != len - || memcmp( q, server, server_len * sizeof(WCHAR) )) + if (!GetComputerNameW( server, &server_len ) || server_len != len || _wcsnicmp( q, server, server_len )) + { + heap_free( path ); return WBEM_E_NOT_SUPPORTED; + } q = ++p; while (*p && *p != ':') p++; - if (!*p) return WBEM_E_INVALID_OBJECT_PATH; + if (!*p) + { + heap_free( path ); + return WBEM_E_INVALID_OBJECT_PATH; + } len = p - q; - if (len != ARRAY_SIZE(cimv2W) || memcmp( q, cimv2W, sizeof(cimv2W) )) + if (len != ARRAY_SIZE(cimv2W) - 1 || _wcsnicmp( q, cimv2W, ARRAY_SIZE(cimv2W) - 1 )) + { + heap_free( path ); return WBEM_E_INVALID_NAMESPACE; + } p++; } @@ -401,14 +410,15 @@ static HRESULT parse_path( const WCHAR *str, struct path **ret ) return S_OK; } -static void free_path( struct path *path ) +void free_path( struct path *path ) { + if (!path) return; heap_free( path->class ); heap_free( path->filter ); heap_free( path ); } -static WCHAR *query_from_path( const struct path *path ) +WCHAR *query_from_path( const struct path *path ) { static const WCHAR selectW[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','%','s',' ', @@ -422,14 +432,14 @@ static WCHAR *query_from_path( const struct path *path ) { len = path->class_len + path->filter_len + ARRAY_SIZE(selectW); if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return NULL; - sprintfW( query, selectW, path->class, path->filter ); + swprintf( query, selectW, path->class, path->filter ); } else { len = path->class_len + ARRAY_SIZE(select_allW); if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return NULL; - strcpyW( query, select_allW ); - strcatW( query, path->class ); + lstrcpyW( query, select_allW ); + lstrcatW( query, path->class ); } return query; } @@ -653,7 +663,7 @@ static HRESULT WINAPI wbem_services_ExecQuery( debugstr_w(strQuery), lFlags, pCtx, ppEnum); if (!strQueryLanguage || !strQuery || !strQuery[0]) return WBEM_E_INVALID_PARAMETER; - if (strcmpiW( strQueryLanguage, wqlW )) return WBEM_E_INVALID_QUERY_TYPE; + if (wcsicmp( strQueryLanguage, wqlW )) return WBEM_E_INVALID_QUERY_TYPE; return exec_query( strQuery, ppEnum ); } @@ -823,6 +833,7 @@ static HRESULT WINAPI wbem_services_ExecMethod( struct path *path; WCHAR *str; class_method *func; + struct table *table; HRESULT hr; TRACE("%p, %s, %s, %08x, %p, %p, %p, %p\n", iface, debugstr_w(strObjectPath), @@ -850,10 +861,11 @@ static HRESULT WINAPI wbem_services_ExecMethod( hr = EnumWbemClassObject_create( query, (void **)&result ); if (hr != S_OK) goto done; - hr = create_class_object( query->view->table->name, result, 0, NULL, &obj ); + table = get_view_table( query->view, 0 ); + hr = create_class_object( table->name, result, 0, NULL, &obj ); if (hr != S_OK) goto done; - hr = get_method( query->view->table, strMethodName, &func ); + hr = get_method( table, strMethodName, &func ); if (hr != S_OK) goto done; hr = func( obj, pInParams, ppOutParams ); diff --git a/dll/win32/wbemprox/table.c b/dll/win32/wbemprox/table.c index ad56e0c7bab..8e08d952257 100644 --- a/dll/win32/wbemprox/table.c +++ b/dll/win32/wbemprox/table.c @@ -18,8 +18,10 @@ #define COBJMACROS -#include "config.h" #include <stdarg.h> +#ifdef __REACTOS__ +#include <wchar.h> +#endif #include "windef.h" #include "winbase.h" @@ -35,7 +37,7 @@ HRESULT get_column_index( const struct table *table, const WCHAR *name, UINT *co UINT i; for (i = 0; i < table->num_cols; i++) { - if (!strcmpiW( table->columns[i].name, name )) + if (!wcsicmp( table->columns[i].name, name )) { *column = i; return S_OK; @@ -65,8 +67,11 @@ UINT get_type_size( CIMTYPE type ) case CIM_UINT64: return sizeof(INT64); case CIM_DATETIME: + case CIM_REFERENCE: case CIM_STRING: return sizeof(WCHAR *); + case CIM_REAL32: + return sizeof(FLOAT); default: ERR("unhandled type %u\n", type); break; @@ -111,6 +116,7 @@ HRESULT get_value( const struct table *table, UINT row, UINT column, LONGLONG *v *val = *(const int *)ptr; break; case CIM_DATETIME: + case CIM_REFERENCE: case CIM_STRING: *val = (INT_PTR)*(const WCHAR **)ptr; break; @@ -138,6 +144,9 @@ HRESULT get_value( const struct table *table, UINT row, UINT column, LONGLONG *v case CIM_UINT64: *val = *(const UINT64 *)ptr; break; + case CIM_REAL32: + memcpy( val, ptr, sizeof(FLOAT) ); + break; default: ERR("invalid column type %u\n", table->columns[column].type & COL_TYPE_MASK); *val = 0; @@ -174,21 +183,22 @@ BSTR get_value_bstr( const struct table *table, UINT row, UINT column ) else return SysAllocString( falseW ); case CIM_DATETIME: + case CIM_REFERENCE: case CIM_STRING: if (!val) return NULL; - len = strlenW( (const WCHAR *)(INT_PTR)val ) + 2; + len = lstrlenW( (const WCHAR *)(INT_PTR)val ) + 2; if (!(ret = SysAllocStringLen( NULL, len ))) return NULL; - sprintfW( ret, fmt_strW, (const WCHAR *)(INT_PTR)val ); + swprintf( ret, fmt_strW, (const WCHAR *)(INT_PTR)val ); return ret; case CIM_SINT16: case CIM_SINT32: - sprintfW( number, fmt_signedW, val ); + swprintf( number, fmt_signedW, val ); return SysAllocString( number ); case CIM_UINT16: case CIM_UINT32: - sprintfW( number, fmt_unsignedW, val ); + swprintf( number, fmt_unsignedW, val ); return SysAllocString( number ); case CIM_SINT64: @@ -221,6 +231,7 @@ HRESULT set_value( const struct table *table, UINT row, UINT column, LONGLONG va switch (table->columns[column].type & COL_TYPE_MASK) { case CIM_DATETIME: + case CIM_REFERENCE: case CIM_STRING: *(WCHAR **)ptr = (WCHAR *)(INT_PTR)val; break; @@ -263,7 +274,7 @@ HRESULT get_method( const struct table *table, const WCHAR *name, class_method * { for (j = 0; j < table->num_cols; j++) { - if (table->columns[j].type & COL_FLAG_METHOD && !strcmpW( table->columns[j].name, name )) + if (table->columns[j].type & COL_FLAG_METHOD && !wcscmp( table->columns[j].name, name )) { HRESULT hr; LONGLONG val; @@ -288,7 +299,7 @@ void free_row_values( const struct table *table, UINT row ) if (!(table->columns[i].type & COL_FLAG_DYNAMIC)) continue; type = table->columns[i].type & COL_TYPE_MASK; - if (type == CIM_STRING || type == CIM_DATETIME) + if (type == CIM_STRING || type == CIM_DATETIME || type == CIM_REFERENCE) { if (get_value( table, row, i, &val ) == S_OK) heap_free( (void *)(INT_PTR)val ); } @@ -357,7 +368,7 @@ struct table *grab_table( const WCHAR *name ) LIST_FOR_EACH_ENTRY( table, table_list, struct table, entry ) { - if (!strcmpiW( table->name, name )) + if (name && !wcsicmp( table->name, name )) { TRACE("returning %p\n", table); return addref_table( table ); @@ -392,7 +403,7 @@ BOOL add_table( struct table *table ) LIST_FOR_EACH_ENTRY( iter, table_list, struct table, entry ) { - if (!strcmpiW( iter->name, table->name )) + if (!wcsicmp( iter->name, table->name )) { TRACE("table %s already exists\n", debugstr_w(table->name)); return FALSE; diff --git a/dll/win32/wbemprox/wbemlocator.c b/dll/win32/wbemprox/wbemlocator.c index fe26a871b50..7bd49c80e83 100644 --- a/dll/win32/wbemprox/wbemlocator.c +++ b/dll/win32/wbemprox/wbemlocator.c @@ -18,7 +18,6 @@ #define COBJMACROS -#include "config.h" #include <stdarg.h> #include "windef.h" @@ -27,7 +26,6 @@ #include "wbemcli.h" #include "wine/debug.h" -#include "wine/unicode.h" #include "wbemprox_private.h" WINE_DEFAULT_DEBUG_CHANNEL(wbemprox); @@ -93,16 +91,16 @@ static BOOL is_local_machine( const WCHAR *server ) WCHAR buffer[MAX_COMPUTERNAME_LENGTH + 1]; DWORD len = ARRAY_SIZE( buffer ); - if (!server || !strcmpW( server, dotW ) || !strcmpiW( server, localhostW )) return TRUE; - if (GetComputerNameW( buffer, &len ) && !strcmpiW( server, buffer )) return TRUE; + if (!server || !wcscmp( server, dotW ) || !wcsicmp( server, localhostW )) return TRUE; + if (GetComputerNameW( buffer, &len ) && !wcsicmp( server, buffer )) return TRUE; return FALSE; } static HRESULT parse_resource( const WCHAR *resource, WCHAR **server, WCHAR **namespace ) { static const WCHAR rootW[] = {'R','O','O','T'}; - static const WCHAR cimv2W[] = {'C','I','M','V','2'}; - static const WCHAR defaultW[] = {'D','E','F','A','U','L','T'}; + static const WCHAR cimv2W[] = {'C','I','M','V','2',0}; + static const WCHAR defaultW[] = {'D','E','F','A','U','L','T',0}; HRESULT hr = WBEM_E_INVALID_NAMESPACE; const WCHAR *p, *q; unsigned int len; @@ -133,16 +131,15 @@ static HRESULT parse_resource( const WCHAR *resource, WCHAR **server, WCHAR **na p = q; while (*q && *q != '\\' && *q != '/') q++; len = q - p; - if (len >= ARRAY_SIZE( rootW ) && memicmpW( rootW, p, len )) goto done; + if (len >= ARRAY_SIZE( rootW ) && _wcsnicmp( rootW, p, len )) goto done; if (!*q) { hr = S_OK; goto done; } q++; - len = strlenW( q ); - if ((len != ARRAY_SIZE( cimv2W ) || memicmpW( q, cimv2W, len )) && - (len != ARRAY_SIZE( defaultW ) || memicmpW( q, defaultW, len ))) + len = lstrlenW( q ); + if (wcsicmp( q, cimv2W ) && wcsicmp( q, defaultW )) goto done; if (!(*namespace = heap_alloc( (len + 1) * sizeof(WCHAR) ))) hr = E_OUTOFMEMORY; else diff --git a/dll/win32/wbemprox/wbemprox_private.h b/dll/win32/wbemprox/wbemprox_private.h index 596ad21d51b..5c04c45d973 100644 --- a/dll/win32/wbemprox/wbemprox_private.h +++ b/dll/win32/wbemprox/wbemprox_private.h @@ -21,7 +21,9 @@ #include "wine/debug.h" #include "wine/heap.h" #include "wine/list.h" -#include "wine/unicode.h" +#ifdef __REACTOS__ +#include <winnls.h> +#endif IClientSecurity client_security DECLSPEC_HIDDEN; struct list *table_list DECLSPEC_HIDDEN; @@ -92,7 +94,6 @@ struct column { const WCHAR *name; UINT type; - VARTYPE vartype; /* 0 for default mapping */ }; enum fill_status @@ -127,6 +128,7 @@ struct property struct array { + UINT elem_size; UINT count; void *ptr; }; @@ -134,7 +136,6 @@ struct array struct field { UINT type; - VARTYPE vartype; /* 0 for default mapping */ union { LONGLONG ival; @@ -150,13 +151,30 @@ struct record struct table *table; }; +struct keyword +{ + const WCHAR *name; + const WCHAR *value; + const struct keyword *next; +}; + +enum view_type +{ + VIEW_TYPE_SELECT, + VIEW_TYPE_ASSOCIATORS, +}; + struct view { - const struct property *proplist; - struct table *table; + enum view_type type; + const WCHAR *path; /* ASSOCIATORS OF query */ + const struct keyword *keywordlist; + const struct property *proplist; /* SELECT query */ const struct expr *cond; + UINT table_count; + struct table **table; + UINT result_count; UINT *result; - UINT count; }; struct query @@ -166,16 +184,29 @@ struct query struct list mem; }; +struct path +{ + WCHAR *class; + UINT class_len; + WCHAR *filter; + UINT filter_len; +}; + +HRESULT parse_path( const WCHAR *, struct path ** ) DECLSPEC_HIDDEN; +void free_path( struct path * ) DECLSPEC_HIDDEN; +WCHAR *query_from_path( const struct path * ) DECLSPEC_HIDDEN; + struct query *create_query(void) DECLSPEC_HIDDEN; void free_query( struct query * ) DECLSPEC_HIDDEN; struct query *addref_query( struct query * ) DECLSPEC_HIDDEN; void release_query( struct query *query ) DECLSPEC_HIDDEN; HRESULT exec_query( const WCHAR *, IEnumWbemClassObject ** ) DECLSPEC_HIDDEN; HRESULT parse_query( const WCHAR *, struct view **, struct list * ) DECLSPEC_HIDDEN; -HRESULT create_view( const struct property *, const WCHAR *, const struct expr *, - struct view ** ) DECLSPEC_HIDDEN; +HRESULT create_view( enum view_type, const WCHAR *, const struct keyword *, const WCHAR *, const struct property *, + const struct expr *, struct view ** ) DECLSPEC_HIDDEN; void destroy_view( struct view * ) DECLSPEC_HIDDEN; HRESULT execute_view( struct view * ) DECLSPEC_HIDDEN; +struct table *get_view_table( const struct view *, UINT ) DECLSPEC_HIDDEN; void init_table_list( void ) DECLSPEC_HIDDEN; struct table *grab_table( const WCHAR * ) DECLSPEC_HIDDEN; struct table *addref_table( struct table * ) DECLSPEC_HIDDEN; @@ -195,15 +226,14 @@ BSTR get_value_bstr( const struct table *, UINT, UINT ) DECLSPEC_HIDDEN; HRESULT set_value( const struct table *, UINT, UINT, LONGLONG, CIMTYPE ) DECLSPEC_HIDDEN; BOOL is_method( const struct table *, UINT ) DECLSPEC_HIDDEN; HRESULT get_method( const struct table *, const WCHAR *, class_method ** ) DECLSPEC_HIDDEN; -HRESULT get_propval( const struct view *, UINT, const WCHAR *, VARIANT *, - CIMTYPE *, LONG * ) DECLSPEC_HIDDEN; +HRESULT get_propval( const struct view *, UINT, const WCHAR *, VARIANT *, CIMTYPE *, LONG * ) DECLSPEC_HIDDEN; HRESULT put_propval( const struct view *, UINT, const WCHAR *, VARIANT *, CIMTYPE ) DECLSPEC_HIDDEN; HRESULT to_longlong( VARIANT *, LONGLONG *, CIMTYPE * ) DECLSPEC_HIDDEN; SAFEARRAY *to_safearray( const struct array *, CIMTYPE ) DECLSPEC_HIDDEN; VARTYPE to_vartype( CIMTYPE ) DECLSPEC_HIDDEN; void destroy_array( struct array *, CIMTYPE ) DECLSPEC_HIDDEN; -BOOL is_selected_prop( const struct view *, const WCHAR * ) DECLSPEC_HIDDEN; -HRESULT get_properties( const struct view *, LONG, SAFEARRAY ** ) DECLSPEC_HIDDEN; +BOOL is_result_prop( const struct view *, const WCHAR * ) DECLSPEC_HIDDEN; +HRESULT get_properties( const struct view *, UINT, LONG, SAFEARRAY ** ) DECLSPEC_HIDDEN; HRESULT get_object( const WCHAR *, IWbemClassObject ** ) DECLSPEC_HIDDEN; BSTR get_method_name( const WCHAR *, UINT ) DECLSPEC_HIDDEN; void set_variant( VARTYPE, LONGLONG, void *, VARIANT * ) DECLSPEC_HIDDEN; @@ -233,7 +263,17 @@ static inline WCHAR *heap_strdupW( const WCHAR *src ) { WCHAR *dst; if (!src) return NULL; - if ((dst = heap_alloc( (strlenW( src ) + 1) * sizeof(WCHAR) ))) strcpyW( dst, src ); + if ((dst = heap_alloc( (lstrlenW( src ) + 1) * sizeof(WCHAR) ))) lstrcpyW( dst, src ); + return dst; +} + +static inline WCHAR *heap_strdupAW( const char *src ) +{ + int len; + WCHAR *dst; + if (!src) return NULL; + len = MultiByteToWideChar( CP_ACP, 0, src, -1, NULL, 0 ); + if ((dst = heap_alloc( len * sizeof(*dst) ))) MultiByteToWideChar( CP_ACP, 0, src, -1, dst, len ); return dst; } diff --git a/dll/win32/wbemprox/wql.tab.c b/dll/win32/wbemprox/wql.tab.c index 42e82328546..62249558393 100644 --- a/dll/win32/wbemprox/wql.tab.c +++ b/dll/win32/wbemprox/wql.tab.c @@ -1,8 +1,9 @@ -/* A Bison parser, made by GNU Bison 3.0. */ +/* A Bison parser, made by GNU Bison 3.4.1. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, + Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -40,11 +41,14 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ +/* Undocumented macros, especially those whose name start with YY_, + are private implementation details. Do not rely on them. */ + /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.0" +#define YYBISON_VERSION "3.4.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -67,8 +71,8 @@ #define yynerrs wql_nerrs -/* Copy the first part of user declarations. */ -#line 1 "wql.y" /* yacc.c:339 */ +/* First part of user prologue. */ +#line 1 "wql.y" /* @@ -89,7 +93,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" #include <stdarg.h> #include "windef.h" @@ -99,7 +102,6 @@ #include "wine/list.h" #include "wine/debug.h" -#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(wbemprox); @@ -138,6 +140,18 @@ static struct property *alloc_property( struct parser *parser, const WCHAR *clas return prop; } +static struct keyword *alloc_keyword( struct parser *parser, const WCHAR *name, const WCHAR *value ) +{ ... 2009 lines suppressed ...
5 years
1
0
0
0
[reactos] 01/01: [PSDK] Add GetSystemFirmwareTable. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e5a5f62909b78979eb2e6…
commit e5a5f62909b78979eb2e6fb9b62c91dde9af2a43 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Dec 1 19:44:36 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Dec 1 19:44:36 2019 +0100 [PSDK] Add GetSystemFirmwareTable. CORE-16441 --- sdk/include/psdk/winbase.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sdk/include/psdk/winbase.h b/sdk/include/psdk/winbase.h index cd7446c5c4c..7c45b151c87 100644 --- a/sdk/include/psdk/winbase.h +++ b/sdk/include/psdk/winbase.h @@ -2369,6 +2369,16 @@ VOID WINAPI GetStartupInfoW(LPSTARTUPINFOW); HANDLE WINAPI GetStdHandle(_In_ DWORD); UINT WINAPI GetSystemDirectoryA(LPSTR,UINT); UINT WINAPI GetSystemDirectoryW(LPWSTR,UINT); + +WINBASEAPI +UINT +WINAPI +GetSystemFirmwareTable( + _In_ DWORD FirmwareTableProviderSignature, + _In_ DWORD FirmwareTableID, + _Out_writes_bytes_to_opt_(BufferSize,return) PVOID pFirmwareTableBuffer, + _In_ DWORD BufferSize); + VOID WINAPI GetSystemInfo(LPSYSTEM_INFO); BOOL WINAPI GetSystemPowerStatus(_Out_ LPSYSTEM_POWER_STATUS); #if (_WIN32_WINNT >= 0x0502)
5 years
1
0
0
0
[reactos] 01/01: [WBEMDISP] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=36873c49345171875fbbf…
commit 36873c49345171875fbbf50db6288003ebce6150 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Dec 1 19:44:13 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Dec 1 19:44:13 2019 +0100 [WBEMDISP] Sync with Wine Staging 4.18. CORE-16441 --- dll/win32/wbemdisp/locator.c | 28 +++++++++++++--------------- dll/win32/wbemdisp/main.c | 6 ++---- dll/win32/wbemdisp/precomp.h | 3 --- media/doc/README.WINE | 2 +- 4 files changed, 16 insertions(+), 23 deletions(-) diff --git a/dll/win32/wbemdisp/locator.c b/dll/win32/wbemdisp/locator.c index c307e347cf8..a9ef1618882 100644 --- a/dll/win32/wbemdisp/locator.c +++ b/dll/win32/wbemdisp/locator.c @@ -18,7 +18,6 @@ #define COBJMACROS -#include "config.h" #include <stdarg.h> #include "windef.h" @@ -31,7 +30,6 @@ #include "wine/debug.h" #include "wine/heap.h" -#include "wine/unicode.h" #include "wbemdisp_private.h" #include "wbemdisp_classes.h" @@ -620,8 +618,8 @@ static HRESULT init_members( struct object *object ) { count++; SysFreeString( name ); - IWbemClassObject_Release( sig_in ); - IWbemClassObject_Release( sig_out ); + if (sig_in) IWbemClassObject_Release( sig_in ); + if (sig_out) IWbemClassObject_Release( sig_out ); } IWbemClassObject_EndMethodEnumeration( object->object ); } @@ -659,8 +657,8 @@ static HRESULT init_members( struct object *object ) IWbemClassObject_EndMethodEnumeration( object->object ); goto error; } - IWbemClassObject_Release( sig_in ); - IWbemClassObject_Release( sig_out ); + if (sig_in) IWbemClassObject_Release( sig_in ); + if (sig_out) IWbemClassObject_Release( sig_out ); TRACE( "added method %s\n", debugstr_w(name) ); } IWbemClassObject_EndMethodEnumeration( object->object ); @@ -683,7 +681,7 @@ static DISPID get_member_dispid( struct object *object, const WCHAR *name ) UINT i; for (i = 0; i < object->nb_members; i++) { - if (!strcmpiW( object->members[i].name, name )) + if (!wcsicmp( object->members[i].name, name )) { if (!object->members[i].dispid) { @@ -1704,12 +1702,12 @@ static HRESULT WINAPI services_DeleteAsync( static BSTR build_query_string( const WCHAR *class ) { static const WCHAR selectW[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',0}; - UINT len = strlenW(class) + ARRAY_SIZE(selectW); + UINT len = lstrlenW(class) + ARRAY_SIZE(selectW); BSTR ret; if (!(ret = SysAllocStringLen( NULL, len ))) return NULL; - strcpyW( ret, selectW ); - strcatW( ret, class ); + lstrcpyW( ret, selectW ); + lstrcatW( ret, class ); return ret; } @@ -2134,22 +2132,22 @@ static BSTR build_resource_string( BSTR server, BSTR namespace ) ULONG len, len_server = 0, len_namespace = 0; BSTR ret; - if (server && *server) len_server = strlenW( server ); + if (server && *server) len_server = lstrlenW( server ); else len_server = 1; - if (namespace && *namespace) len_namespace = strlenW( namespace ); + if (namespace && *namespace) len_namespace = lstrlenW( namespace ); else len_namespace = ARRAY_SIZE(defaultW) - 1; if (!(ret = SysAllocStringLen( NULL, 2 + len_server + 1 + len_namespace ))) return NULL; ret[0] = ret[1] = '\\'; - if (server && *server) strcpyW( ret + 2, server ); + if (server && *server) lstrcpyW( ret + 2, server ); else ret[2] = '.'; len = len_server + 2; ret[len++] = '\\'; - if (namespace && *namespace) strcpyW( ret + len, namespace ); - else strcpyW( ret + len, defaultW ); + if (namespace && *namespace) lstrcpyW( ret + len, namespace ); + else lstrcpyW( ret + len, defaultW ); return ret; } diff --git a/dll/win32/wbemdisp/main.c b/dll/win32/wbemdisp/main.c index aff4d5042b7..f434eecb353 100644 --- a/dll/win32/wbemdisp/main.c +++ b/dll/win32/wbemdisp/main.c @@ -16,7 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" #include <stdarg.h> #define COBJMACROS @@ -30,7 +29,6 @@ #include "wine/debug.h" #include "wine/heap.h" -#include "wine/unicode.h" #include "wbemdisp_private.h" #include "wbemdisp_classes.h" @@ -384,7 +382,7 @@ static HRESULT WINAPI WinMGMTS_ParseDisplayName(IParseDisplayName *iface, IBindC TRACE( "%p, %p, %s, %p, %p\n", iface, pbc, debugstr_w(pszDisplayName), pchEaten, ppmkOut ); - if (strncmpiW( pszDisplayName, prefixW, prefix_len )) return MK_E_SYNTAX; + if (_wcsnicmp( pszDisplayName, prefixW, prefix_len )) return MK_E_SYNTAX; p = pszDisplayName + prefix_len; if (*p == '{') @@ -418,7 +416,7 @@ done: SysFreeString( server ); SysFreeString( namespace ); SysFreeString( relative ); - if (hr == S_OK) *pchEaten = strlenW( pszDisplayName ); + if (hr == S_OK) *pchEaten = lstrlenW( pszDisplayName ); return hr; } diff --git a/dll/win32/wbemdisp/precomp.h b/dll/win32/wbemdisp/precomp.h index c1f67ee56a5..0578883a8be 100644 --- a/dll/win32/wbemdisp/precomp.h +++ b/dll/win32/wbemdisp/precomp.h @@ -2,8 +2,6 @@ #ifndef _WBEMDISP_PRECOMP_H_ #define _WBEMDISP_PRECOMP_H_ -#include <wine/config.h> - #include <stdarg.h> #define WIN32_NO_STATUS @@ -19,7 +17,6 @@ #include <wbemdisp.h> #include <wine/debug.h> -#include <wine/unicode.h> #include "wbemdisp_private.h" diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 2d72bc86a44..3098a88e6d1 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -195,7 +195,7 @@ dll/win32/uxtheme # Forked dll/win32/vbscript # Synced to WineStaging-4.18 dll/win32/version # Synced to WineStaging-4.18 dll/win32/vssapi # Synced to WineStaging-4.18 -dll/win32/wbemdisp # Synced to WineStaging-4.0 +dll/win32/wbemdisp # Synced to WineStaging-4.18 dll/win32/wbemprox # Synced to WineStaging-4.0 dll/win32/windowscodecs # Synced to WineStaging-4.0 dll/win32/windowscodecsext # Synced to WineStaging-2.9
5 years
1
0
0
0
[reactos] 01/01: [VSSAPI] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=658118f09886feded96d3…
commit 658118f09886feded96d35d10e5f1e3b44f746db Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Dec 1 19:43:49 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Dec 1 19:43:49 2019 +0100 [VSSAPI] Sync with Wine Staging 4.18. CORE-16441 --- dll/win32/vssapi/main.c | 38 +++++++------------------------------- dll/win32/vssapi/vssapi.spec | 10 +++++----- media/doc/README.WINE | 2 +- 3 files changed, 13 insertions(+), 37 deletions(-) diff --git a/dll/win32/vssapi/main.c b/dll/win32/vssapi/main.c index 427447c2a15..acb24003397 100644 --- a/dll/win32/vssapi/main.c +++ b/dll/win32/vssapi/main.c @@ -16,48 +16,24 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#ifndef __REACTOS__ #include "config.h" +#endif #include <stdarg.h> #include "windef.h" #include "winbase.h" #include "vss.h" #include "vswriter.h" +#include "wine/asm.h" #include "wine/debug.h" -WINE_DEFAULT_DEBUG_CHANNEL( vssapi ); - -#ifdef __i386__ /* thiscall functions are i386-specific */ - -#define THISCALL(func) __thiscall_ ## func -#define THISCALL_NAME(func) __ASM_NAME("__thiscall_" #func) -#undef __thiscall -#define __thiscall __stdcall +#ifdef __REACTOS__ #ifdef _MSC_VER -#define DEFINE_THISCALL_WRAPPER(func,args) \ - void __declspec(naked) __thiscall_ ##func(void) \ - { \ - __asm { pop eax } \ - __asm { push ecx } \ - __asm { push eax } \ - __asm { jmp func } \ - } -#else -#define DEFINE_THISCALL_WRAPPER(func,args) \ - extern void THISCALL(func)(void); \ - __ASM_GLOBAL_FUNC(__thiscall_ ## func, \ - "popl %eax\n\t" \ - "pushl %ecx\n\t" \ - "pushl %eax\n\t" \ - "jmp " __ASM_NAME(#func) __ASM_STDCALL(args) ) +#define __thiscall __stdcall +#endif #endif -#else /* __i386__ */ - -#define THISCALL(func) func -#define THISCALL_NAME(func) __ASM_NAME(#func) -#define __thiscall __cdecl -#define DEFINE_THISCALL_WRAPPER(func,args) /* nothing */ -#endif /* __i386__ */ +WINE_DEFAULT_DEBUG_CHANNEL( vssapi ); struct CVssWriter { diff --git a/dll/win32/vssapi/vssapi.spec b/dll/win32/vssapi/vssapi.spec index 84f9003ddc5..3c6ec60e356 100644 --- a/dll/win32/vssapi/vssapi.spec +++ b/dll/win32/vssapi/vssapi.spec @@ -2,9 +2,9 @@ @ stub VssFreeSnapshotProperties @ stub ShouldBlockRevert @ stub ??0CVssJetWriter@@QAE@XZ -@ cdecl -arch=i386 ??0CVssWriter@@QAE@XZ(ptr) __thiscall_VSSAPI_CVssWriter_default_ctor +@ cdecl -arch=i386 ??0CVssWriter@@QAE@XZ(ptr) VSSAPI_CVssWriter_default_ctor @ stub ??1CVssJetWriter@@UAE@XZ -@ cdecl -arch=i386 ??1CVssWriter@@UAE@XZ(ptr) __thiscall_VSSAPI_CVssWriter_dtor +@ cdecl -arch=i386 ??1CVssWriter@@UAE@XZ(ptr) VSSAPI_CVssWriter_dtor @ stub ?AreComponentsSelected@CVssJetWriter@@IBG_NXZ @ stub ?AreComponentsSelected@CVssWriter@@IBG_NXZ @ stub ?CreateVssBackupComponents@@YGJPAPAVIVssBackupComponents@@@Z @@ -27,7 +27,7 @@ @ stub ?GetSnapshotDeviceName@CVssJetWriter@@IBGJPBGPAPBG@Z @ stub ?GetSnapshotDeviceName@CVssWriter@@IBGJPBGPAPBG@Z @ stub ?Initialize@CVssJetWriter@@QAGJU_GUID@@PBG_N211K@Z -@ cdecl -arch=i386 ?Initialize@CVssWriter@@QAGJU_GUID@@PBGW4VSS_USAGE_TYPE@@W4VSS_SOURCE_TYPE@@W4_VSS_APPLICATION_LEVEL@@KW4VSS_ALTERNATE_WRITER_STATE@@_N@Z(ptr ptr wstr long long long long long long wstr) __thiscall_VSSAPI_CVssWriter_Initialize +@ cdecl -arch=i386 ?Initialize@CVssWriter@@QAGJU_GUID@@PBGW4VSS_USAGE_TYPE@@W4VSS_SOURCE_TYPE@@W4_VSS_APPLICATION_LEVEL@@KW4VSS_ALTERNATE_WRITER_STATE@@_N@Z(ptr ptr wstr long long long long long long wstr) VSSAPI_CVssWriter_Initialize @ stub ?InstallAlternateWriter@CVssWriter@@QAGJU_GUID@@0@Z @ stub ?IsBootableSystemStateBackedUp@CVssJetWriter@@IBG_NXZ @ stub ?IsBootableSystemStateBackedUp@CVssWriter@@IBG_NXZ @@ -67,9 +67,9 @@ @ stub ?OnVSSShutdown@CVssWriter@@UAG_NXZ @ stub ?SetWriterFailure@CVssJetWriter@@IAGJJ@Z @ stub ?SetWriterFailure@CVssWriter@@IAGJJ@Z -@ cdecl -arch=i386 ?Subscribe@CVssWriter@@QAGJK@Z(ptr long) __thiscall_VSSAPI_CVssWriter_Subscribe +@ cdecl -arch=i386 ?Subscribe@CVssWriter@@QAGJK@Z(ptr long) VSSAPI_CVssWriter_Subscribe @ stub ?Uninitialize@CVssJetWriter@@QAGXXZ -@ cdecl -arch=i386 ?Unsubscribe@CVssWriter@@QAGJXZ(ptr) __thiscall_VSSAPI_CVssWriter_Unsubscribe +@ cdecl -arch=i386 ?Unsubscribe@CVssWriter@@QAGJXZ(ptr) VSSAPI_CVssWriter_Unsubscribe @ stub CreateVssBackupComponentsInternal @ stub CreateVssExamineWriterMetadataInternal @ stub CreateVssExpressWriterInternal diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 050a8fe31c8..2d72bc86a44 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -194,7 +194,7 @@ dll/win32/usp10 # Synced to WineStaging-4.18 dll/win32/uxtheme # Forked dll/win32/vbscript # Synced to WineStaging-4.18 dll/win32/version # Synced to WineStaging-4.18 -dll/win32/vssapi # Synced to WineStaging-2.9 +dll/win32/vssapi # Synced to WineStaging-4.18 dll/win32/wbemdisp # Synced to WineStaging-4.0 dll/win32/wbemprox # Synced to WineStaging-4.0 dll/win32/windowscodecs # Synced to WineStaging-4.0
5 years
1
0
0
0
[reactos] 01/01: [VERSION] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f1e575c3d2b84f20db560…
commit f1e575c3d2b84f20db560bc3137df488891598bd Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Dec 1 19:43:24 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Dec 1 19:43:24 2019 +0100 [VERSION] Sync with Wine Staging 4.18. CORE-16441 --- dll/win32/version/version.c | 19 +++++++------------ media/doc/README.WINE | 2 +- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/dll/win32/version/version.c b/dll/win32/version/version.c index 68dd4a8df8c..0e2f35dd107 100644 --- a/dll/win32/version/version.c +++ b/dll/win32/version/version.c @@ -21,7 +21,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * */ -#include "config.h" #include <stdarg.h> #include <stdlib.h> @@ -29,9 +28,6 @@ #include <stdio.h> #include <sys/types.h> -#ifdef HAVE_UNISTD_H -# include <unistd.h> -#endif #define NONAMELESSUNION #define NONAMELESSSTRUCT @@ -40,9 +36,8 @@ #include "winver.h" #include "winuser.h" #include "winnls.h" -#include "winternl.h" +#include "wine/winternl.h" #include "lzexpand.h" -#include "wine/unicode.h" #include "winerror.h" #include "wine/debug.h" @@ -594,7 +589,7 @@ typedef struct #define VersionInfo16_Value( ver ) \ DWORD_ALIGN( (ver), (ver)->szKey + strlen((ver)->szKey) + 1 ) #define VersionInfo32_Value( ver ) \ - DWORD_ALIGN( (ver), (ver)->szKey + strlenW((ver)->szKey) + 1 ) + DWORD_ALIGN( (ver), (ver)->szKey + lstrlenW((ver)->szKey) + 1 ) #define VersionInfo16_Children( ver ) \ (const VS_VERSION_INFO_STRUCT16 *)( VersionInfo16_Value( ver ) + \ @@ -870,7 +865,7 @@ static const VS_VERSION_INFO_STRUCT16 *VersionInfo16_FindChild( const VS_VERSION while ((char *)child < (char *)info + info->wLength ) { - if (!strncasecmp( child->szKey, szKey, cbKey ) && !child->szKey[cbKey]) + if (!_strnicmp( child->szKey, szKey, cbKey ) && !child->szKey[cbKey]) return child; if (!(child->wLength)) return NULL; @@ -890,7 +885,7 @@ static const VS_VERSION_INFO_STRUCT32 *VersionInfo32_FindChild( const VS_VERSION while ((char *)child < (char *)info + info->wLength ) { - if (!strncmpiW( child->szKey, szKey, cbKey ) && !child->szKey[cbKey]) + if (!_wcsnicmp( child->szKey, szKey, cbKey ) && !child->szKey[cbKey]) return child; if (!(child->wLength)) return NULL; @@ -1087,7 +1082,7 @@ BOOL WINAPI VerQueryValueW( LPCVOID pBlock, LPCWSTR lpSubBlock, HeapFree(GetProcessHeap(), 0, lpSubBlockA); - if (ret && strcmpiW( lpSubBlock, rootW ) && strcmpiW( lpSubBlock, varfileinfoW )) + if (ret && wcsicmp( lpSubBlock, rootW ) && wcsicmp( lpSubBlock, varfileinfoW )) { /* Set lpBuffer so it points to the 'empty' area where we store * the converted strings @@ -1360,8 +1355,8 @@ DWORD WINAPI VerFindFileW( DWORD flags,LPCWSTR lpszFilename,LPCWSTR lpszWinDir, if (lpszFilename && !testFileExistenceW(curDir, lpszFilename, TRUE)) retval |= VFF_FILEINUSE; - curDirSizeReq = strlenW(curDir) + 1; - destDirSizeReq = strlenW(destDir) + 1; + curDirSizeReq = lstrlenW(curDir) + 1; + destDirSizeReq = lstrlenW(destDir) + 1; /* Make sure that the pointers to the size of the buffers are valid; if not, do NOTHING with that buffer. If that pointer diff --git a/media/doc/README.WINE b/media/doc/README.WINE index c7d47ba6730..050a8fe31c8 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -193,7 +193,7 @@ dll/win32/urlmon # Synced to WineStaging-4.18 dll/win32/usp10 # Synced to WineStaging-4.18 dll/win32/uxtheme # Forked dll/win32/vbscript # Synced to WineStaging-4.18 -dll/win32/version # Synced to WineStaging-4.0 +dll/win32/version # Synced to WineStaging-4.18 dll/win32/vssapi # Synced to WineStaging-2.9 dll/win32/wbemdisp # Synced to WineStaging-4.0 dll/win32/wbemprox # Synced to WineStaging-4.0
5 years
1
0
0
0
[reactos] 01/01: [VBSCRIPT_WINETEST] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7d76303d2d96afbb3a1b6…
commit 7d76303d2d96afbb3a1b6587a03127b034c8bfeb Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Dec 1 19:43:01 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Dec 1 19:43:01 2019 +0100 [VBSCRIPT_WINETEST] Sync with Wine Staging 4.18. CORE-16441 --- modules/rostests/winetests/vbscript/api.vbs | 184 +++++++ modules/rostests/winetests/vbscript/lang.vbs | 134 +++++ modules/rostests/winetests/vbscript/run.c | 706 +++++++++++++++++++++++-- modules/rostests/winetests/vbscript/vbscript.c | 206 +++++++- 4 files changed, 1189 insertions(+), 41 deletions(-) diff --git a/modules/rostests/winetests/vbscript/api.vbs b/modules/rostests/winetests/vbscript/api.vbs index 8ebbfb6c5c8..49dd4959f77 100644 --- a/modules/rostests/winetests/vbscript/api.vbs +++ b/modules/rostests/winetests/vbscript/api.vbs @@ -129,6 +129,16 @@ TestCStr 3, "3" if isEnglishLang then TestCStr 3.5, "3.5" if isEnglishLang then TestCStr true, "True" +sub testCStrError() + on error resume next + Error.clear() + CStr(null) + call ok(Err.number = 94, "Err.number = " & Err.number) + if isEnglishLang then call ok(Err.source = "Microsoft VBScript runtime error", "Err.source = " & Err.source) + if isEnglishLang then call ok(Err.description = "Invalid use of Null", "Err.description = " & Err.description) +end sub +call testCStrError() + Call ok(getVT(Chr(120)) = "VT_BSTR", "getVT(Chr(120)) = " & getVT(Chr(120))) Call ok(getVT(Chr(255)) = "VT_BSTR", "getVT(Chr(255)) = " & getVT(Chr(255))) Call ok(Chr(120) = "x", "Chr(120) = " & Chr(120)) @@ -144,6 +154,7 @@ sub testChrError call Err.clear() call Chr(-1) call ok(Err.number = 5, "Err.number = " & Err.number) + if isEnglishLang then call ok(Err.description = "Invalid procedure call or argument", "Err.description = " & Err.description) call Err.clear() call Chr(256) @@ -237,6 +248,19 @@ Call ok(UBound(arr2) = 2, "UBound(x) = " & UBound(x)) Call ok(UBound(arr2, 1) = 2, "UBound(x) = " & UBound(x)) Call ok(UBound(arr2, 2) = 4, "UBound(x) = " & UBound(x)) +sub testUBoundError() + on error resume next + call Err.clear() + call UBound() + call ok(Err.number = 450, "Err.number = " & Err.number) + call Err.clear() + call UBound(arr, 1, 2) + call ok(Err.number = 450, "Err.number = " & Err.number) + if isEnglishLang then call ok(Err.description = "Wrong number of arguments or invalid property assignment", _ + "Err.description = " & Err.description) +end sub +call testUBoundError() + Dim newObject Set newObject = New ValClass newObject.myval = 1 @@ -494,6 +518,17 @@ TestStrComp "ABC", Empty, 1, 1 TestStrComp vbNull, vbNull, 1, 0 TestStrComp "", vbNull, 1, -1 +sub testStrCompError() + on error resume next + call Err.clear() + call StrComp() + call ok(Err.number = 450, "Err.number = " & Err.number) + call Err.clear() + call StrComp("a", "a", 0, 1) + call ok(Err.number = 450, "Err.number = " & Err.number) +end sub +call testStrCompError() + Call ok(Len("abc") = 3, "Len(abc) = " & Len("abc")) Call ok(Len("") = 0, "Len() = " & Len("")) Call ok(Len(1) = 1, "Len(1) = " & Len(1)) @@ -1066,6 +1101,9 @@ Call ok(VarType(Null) = vbNull, "VarType(Null) = " & VarType(Null)) Call ok(getVT(VarType(Null)) = "VT_I2", "getVT(VarType(Null)) = " & getVT(VarType(Null))) Call ok(VarType(255) = vbInteger, "VarType(255) = " & VarType(255)) Call ok(getVT(VarType(255)) = "VT_I2", "getVT(VarType(255)) = " & getVT(VarType(255))) +set x = new EmptyClass +Call ok(VarType(x) = vbObject, "VarType(x) = " & VarType(x)) +Call ok(getVT(VarType(x)) = "VT_I2", "getVT(VarType(x)) = " & getVT(VarType(x))) Call ok(VarType(32768) = vbLong, "VarType(32768) = " & VarType(32768)) Call ok(getVT(VarType(32768)) = "VT_I2", "getVT(VarType(32768)) = " & getVT(VarType(32768))) Call ok(VarType(CSng(0.5)) = vbSingle, "VarType(CSng(0.5)) = " & VarType(CSng(0.5))) @@ -1080,6 +1118,8 @@ Call ok(VarType(CBool(0.5)) = vbBoolean, "VarType(CBool(0.5)) = " & VarType(CBoo Call ok(getVT(VarType(CBool(0.5))) = "VT_I2", "getVT(VarType(CBool(0.5))) = " & getVT(VarType(CBool(0.5)))) Call ok(VarType(CByte(255)) = vbByte, "VarType(CByte(255)) = " & VarType(CByte(255))) Call ok(getVT(VarType(CByte(255))) = "VT_I2", "getVT(VarType(CByte(255))) = " & getVT(VarType(CByte(255)))) +Call ok(VarType(arr) = (vbArray or vbVariant), "VarType(arr) = " & VarType(arr)) +Call ok(getVT(VarType(arr)) = "VT_I2", "getVT(VarType(arr)) = " & getVT(VarType(arr))) Call ok(Sgn(Empty) = 0, "Sgn(MyEmpty) = " & Sgn(Empty)) Call ok(getVT(Sgn(Empty)) = "VT_I2", "getVT(Sgn(MyEmpty)) = " & getVT(Sgn(Empty))) @@ -1407,6 +1447,21 @@ Call ok(getVT(Log(CByte(2))) = "VT_R8", "getVT(Log(CByte(2))) = " & getVT(Log(CB Call ok(getVT(Date) = "VT_DATE", "getVT(Date) = " & getVT(Date)) Call ok(getVT(Time) = "VT_DATE", "getVT(Time) = " & getVT(Time)) +Call ok(getVT(Day(now)) = "VT_I2", "getVT(Day(now)) = " & getVT(Day(now))) +Call ok(Day(2) = 1, "Day(2) = " & Day(2)) +Call ok(getVT(Month(now)) = "VT_I2", "getVT(Month(now)) = " & getVT(Month(now))) +Call ok(Month(2) = 1, "Month(2) = " & Month(2)) +Call ok(getVT(Year(now)) = "VT_I2", "getVT(Year(now)) = " & getVT(Year(now))) +Call ok(Year(2) = 1900, "Year(2) = " & Year(2)) +Call ok(getVT(Hour(now)) = "VT_I2", "getVT(Hour(now)) = " & getVT(Hour(now))) +Call ok(Hour(2) = 0, "Hour(2) = " & Hour(2)) +Call ok(Hour(2.75) = 18, "Hour(2) = " & Hour(2.75)) +Call ok(getVT(Minute(now)) = "VT_I2", "getVT(Minute(now)) = " & getVT(Minute(now))) +Call ok(Minute(2) = 0, "Minute(2) = " & Minute(2)) +Call ok(Minute(2.02083) = 30, "Minute(2.02083) = " & Minute(2.02083)) +Call ok(getVT(Second(now)) = "VT_I2", "getVT(Second(now)) = " & getVT(Second(now))) +Call ok(Second(2) = 0, "Second(2) = " & Second(2)) + Sub testRGBError(arg1, arg2, arg3, error_num) on error resume next Dim x @@ -1431,4 +1486,133 @@ Call testRGBError(&h4d&, -2, &h2f&, 5) Call ok(getVT(Timer) = "VT_R4", "getVT(Timer) = " & getVT(Timer)) +sub testAsc(arg, expected) + dim x + x = Asc(arg) + call ok(x = expected, "x = " & x & " expected " & expected) + call ok(getVT(x) = "VT_I2*", "getVT = " & getVT(x)) +end sub + +sub testAscError() + on error resume next + call Err.clear() + call Asc(null) + Call ok(Err.number = 94, "Err.number = " & Err.number) + call Err.clear() + call Asc(empty) + Call ok(Err.number = 5, "Err.number = " & Err.number) + call Err.clear() + call Asc() + Call ok(Err.number = 450, "Err.number = " & Err.number) + call Err.clear() + call Asc(Chr(260)) ' some versions of vista allow it + Call ok(Err.number = 5 or Err.number = 0, "asc4 Err.number = " & Err.number) + call Err.clear() + call Asc("") + Call ok(Err.number = 5, "Err.number = " & Err.number) +end sub + +call testAsc("T", 84) +call testAsc("test", 116) +call testAsc("3", 51) +call testAsc(3, 51) +call testAsc(" ", 32) +call testAsc(Chr(255), 255) +call testAsc(Chr(0), 0) +if isEnglishLang then testAsc true, 84 +call testAscError() + +sub testErrNumber(n) + call ok(err.number = n, "err.number = " & err.number & " expected " & n) +end sub + +sub testErrRaise() + on error resume next + call ok(err.number = 0, "err.number = " & err.number) + err.raise 1 + call ok(err.number = 1, "err.number = " & err.number) + err.raise + call ok(err.number = 450, "err.number = " & err.number) + call testErrNumber(450) + err.raise &h10000& + call ok(err.number = 5, "err.number = " & err.number) + + err.clear + call ok(getVT(err.source) = "VT_BSTR", "err.source = " & err.source) + call ok(getVT(err.description) = "VT_BSTR", "err.description = " & err.description) + call ok(getVT(err.helpfile) = "VT_BSTR", "err.helpfile = " & err.helpfile) + call ok(getVT(err.helpcontext) = "VT_I4", "err.helpcontext = " & err.helpcontext) + call ok(err.source = "", "err.source = " & err.source) + call ok(err.description = "", "err.description = " & err.description) + call ok(err.helpfile = "", "err.helpfile = " & err.helpfile) + call ok(err.helpcontext = 0, "err.helpcontext = " & err.helpcontext) + + err.raise 1, "abc" + call ok(err.number = 1, "err.number = " & err.number) + call ok(err.source = "abc", "err.source = " & err.source) + if isEnglishLang then call ok(err.description = "Unknown runtime error", "err.description = " & err.description) + call ok(err.helpfile = "", "err.helpfile = " & err.helpfile) + + err.raise 1, 2, "desc", "hf", 1 + call ok(err.number = 1, "err.number = " & err.number) + call ok(getVT(err.source) = "VT_BSTR", "err.source = " & err.source) + call ok(err.source = "2", "err.source = " & err.source) + call ok(err.description = "desc", "err.description = " & err.description) + call ok(err.helpfile = "hf", "err.helpfile = " & err.helpfile) + call ok(getVT(err.helpcontext) = "VT_I4", "err.helpcontext = " & err.helpcontext) + call ok(err.helpcontext = 1, "err.helpcontext = " & err.helpcontext) + + err.raise 5 + call ok(err.number = 5, "err.number = " & err.number) + call ok(err.source = "2", "err.source = " & err.source) + call ok(err.description = "desc", "err.description = " & err.description) + call ok(err.helpfile = "hf", "err.helpfile = " & err.helpfile) + call ok(getVT(err.helpcontext) = "VT_I4", "err.helpcontext = " & err.helpcontext) + call ok(err.helpcontext = 1, "err.helpcontext = " & err.helpcontext) + + err.clear + err.raise &h8007000E& + call ok(err.number = 7, "err.number = " & err.number) + if isEnglishLang then call ok(err.source = "Microsoft VBScript runtime error", "err.source = " & err.source) + if isEnglishLang then call ok(err.description = "Out of memory", "err.description = " & err.description) + call ok(err.helpfile = "", "err.helpfile = " & err.helpfile) + call ok(err.helpcontext = 0, "err.helpcontext = " & err.helpcontext) + + err.clear + err.raise 1, "test" + err.raise &h8007000E& + call ok(err.number = 7, "err.number = " & err.number) + call ok(err.source = "test", "err.source = " & err.source) + if isEnglishLang then call ok(err.description = "Unknown runtime error", "err.description = " & err.description) + call ok(err.helpfile = "", "err.helpfile = " & err.helpfile) + call ok(err.helpcontext = 0, "err.helpcontext = " & err.helpcontext) + + err.raise 1, 2, "desc", "hf", 1 + err.unknownIdent + call ok(err.number = 438, "err.number = " & err.number) + if isEnglishLang then call ok(err.source = "Microsoft VBScript runtime error", "err.source = " & err.source) + if isEnglishLang then call ok(err.description = "Object doesn't support this property or method", _ + "err.description = " & err.description) + call ok(err.helpfile = "", "err.helpfile = " & err.helpfile) + call ok(err.helpcontext = 0, "err.helpcontext = " & err.helpcontext) + + e = err + call ok(getVT(e) = "VT_I4*", "getVT(e) = " & getVT(e)) + call ok(e = 438, "e = " & e) + + err.raise 1, 2, "desc", "hf", 1 + on error goto 0 + call ok(err.number = 0, "err.number = " & err.number) + call ok(err.source = "", "err.source = " & err.source) + call ok(err.description = "", "err.description = " & err.description) + call ok(err.helpfile = "", "err.helpfile = " & err.helpfile) + call ok(err.helpcontext = 0, "err.helpcontext = " & err.helpcontext) + + dim e + e = err + call ok(getVT(e) = "VT_I4*", "getVT(e) = " & getVT(e)) + call ok(e = 0, "e = " & e) +end sub +call testErrRaise() + Call reportSuccess() diff --git a/modules/rostests/winetests/vbscript/lang.vbs b/modules/rostests/winetests/vbscript/lang.vbs index 2af77bdfcc4..6ddb2e79f51 100644 --- a/modules/rostests/winetests/vbscript/lang.vbs +++ b/modules/rostests/winetests/vbscript/lang.vbs @@ -41,6 +41,7 @@ Call ok(10. = 10, "10. <> 10") Call ok(&hffFFffFF& = -1, "&hffFFffFF& <> -1") Call ok(&hffFFffFF& = -1, "&hffFFffFF& <> -1") Call ok(34e5 = 3400000, "34e5 <> 3400000") +Call ok(34e+5 = 3400000, "34e+5 <> 3400000") Call ok(56.789e5 = 5678900, "56.789e5 = 5678900") Call ok(56.789e-2 = 0.56789, "56.789e-2 <> 0.56789") Call ok(1e-94938484 = 0, "1e-... <> 0") @@ -1093,6 +1094,14 @@ Call ok(getVT(cs) = "VT_BSTR", "getVT(cs) = " & getVT(cs)) Call ok(isNull(cnull), "cnull = " & cnull) Call ok(getVT(cnull) = "VT_NULL", "getVT(cnull) = " & getVT(cnull)) +Call ok(+1 = 1, "+1 != 1") +Call ok(+true = true, "+1 != 1") +Call ok(getVT(+true) = "VT_BOOL", "getVT(+true) = " & getVT(+true)) +Call ok(+"true" = "true", """+true"" != true") +Call ok(getVT(+"true") = "VT_BSTR", "getVT(+""true"") = " & getVT(+"true")) +Call ok(+obj is obj, "+obj != obj") +Call ok(+--+-+1 = -1, "+--+-+1 != -1") + if false then Const conststr = "str" Call ok(conststr = "str", "conststr = " & conststr) Call ok(getVT(conststr) = "VT_BSTR", "getVT(conststr) = " & getVT(conststr)) @@ -1345,4 +1354,129 @@ end class set x = new RegExp Call ok(x.Global = false, "x.Global = " & x.Global) +sub test_nothing_errors + dim x + on error resume next + + x = 1 + err.clear + x = nothing + call ok(err.number = 91, "err.number = " & err.number) + call ok(x = 1, "x = " & x) + + err.clear + x = not nothing + call ok(err.number = 91, "err.number = " & err.number) + call ok(x = 1, "x = " & x) + + err.clear + x = "" & nothing + call ok(err.number = 91, "err.number = " & err.number) + call ok(x = 1, "x = " & x) +end sub +call test_nothing_errors() + +sub test_identifiers + ' test keywords that can also be a declared identifier + Dim default + default = "xx" + Call ok(default = "xx", "default = " & default & " expected ""xx""") + + Dim error + error = "xx" + Call ok(error = "xx", "error = " & error & " expected ""xx""") + + Dim explicit + explicit = "xx" + Call ok(explicit = "xx", "explicit = " & explicit & " expected ""xx""") + + Dim step + step = "xx" + Call ok(step = "xx", "step = " & step & " expected ""xx""") +end sub +call test_identifiers() + +sub test_dotIdentifiers + ' test keywords that can also be an identifier after a dot + ' Call ok(testObj.rem = 10, "testObj.rem = " & testObj.rem & " expected 10") + Call ok(testObj.true = 10, "testObj.true = " & testObj.true & " expected 10") + Call ok(testObj.false = 10, "testObj.false = " & testObj.false & " expected 10") + Call ok(testObj.not = 10, "testObj.not = " & testObj.not & " expected 10") + Call ok(testObj.and = 10, "testObj.and = " & testObj.and & " expected 10") + Call ok(testObj.or = 10, "testObj.or = " & testObj.or & " expected 10") + Call ok(testObj.xor = 10, "testObj.xor = " & testObj.xor & " expected 10") + Call ok(testObj.eqv = 10, "testObj.eqv = " & testObj.eqv & " expected 10") + Call ok(testObj.imp = 10, "testObj.imp = " & testObj.imp & " expected 10") + Call ok(testObj.is = 10, "testObj.is = " & testObj.is & " expected 10") + Call ok(testObj.mod = 10, "testObj.mod = " & testObj.mod & " expected 10") + Call ok(testObj.call = 10, "testObj.call = " & testObj.call & " expected 10") + Call ok(testObj.dim = 10, "testObj.dim = " & testObj.dim & " expected 10") + Call ok(testObj.sub = 10, "testObj.sub = " & testObj.sub & " expected 10") + Call ok(testObj.function = 10, "testObj.function = " & testObj.function & " expected 10") + Call ok(testObj.get = 10, "testObj.get = " & testObj.get & " expected 10") + Call ok(testObj.let = 10, "testObj.let = " & testObj.let & " expected 10") + Call ok(testObj.const = 10, "testObj.const = " & testObj.const & " expected 10") + Call ok(testObj.if = 10, "testObj.if = " & testObj.if & " expected 10") + Call ok(testObj.else = 10, "testObj.else = " & testObj.else & " expected 10") + Call ok(testObj.elseif = 10, "testObj.elseif = " & testObj.elseif & " expected 10") + Call ok(testObj.end = 10, "testObj.end = " & testObj.end & " expected 10") + Call ok(testObj.then = 10, "testObj.then = " & testObj.then & " expected 10") + Call ok(testObj.exit = 10, "testObj.exit = " & testObj.exit & " expected 10") + Call ok(testObj.while = 10, "testObj.while = " & testObj.while & " expected 10") + Call ok(testObj.wend = 10, "testObj.wend = " & testObj.wend & " expected 10") + Call ok(testObj.do = 10, "testObj.do = " & testObj.do & " expected 10") + Call ok(testObj.loop = 10, "testObj.loop = " & testObj.loop & " expected 10") + Call ok(testObj.until = 10, "testObj.until = " & testObj.until & " expected 10") + Call ok(testObj.for = 10, "testObj.for = " & testObj.for & " expected 10") + Call ok(testObj.to = 10, "testObj.to = " & testObj.to & " expected 10") + Call ok(testObj.each = 10, "testObj.each = " & testObj.each & " expected 10") + Call ok(testObj.in = 10, "testObj.in = " & testObj.in & " expected 10") + Call ok(testObj.select = 10, "testObj.select = " & testObj.select & " expected 10") + Call ok(testObj.case = 10, "testObj.case = " & testObj.case & " expected 10") + Call ok(testObj.byref = 10, "testObj.byref = " & testObj.byref & " expected 10") + Call ok(testObj.byval = 10, "testObj.byval = " & testObj.byval & " expected 10") + Call ok(testObj.option = 10, "testObj.option = " & testObj.option & " expected 10") + Call ok(testObj.nothing = 10, "testObj.nothing = " & testObj.nothing & " expected 10") + Call ok(testObj.empty = 10, "testObj.empty = " & testObj.empty & " expected 10") + Call ok(testObj.null = 10, "testObj.null = " & testObj.null & " expected 10") + Call ok(testObj.class = 10, "testObj.class = " & testObj.class & " expected 10") + Call ok(testObj.set = 10, "testObj.set = " & testObj.set & " expected 10") + Call ok(testObj.new = 10, "testObj.new = " & testObj.new & " expected 10") + Call ok(testObj.public = 10, "testObj.public = " & testObj.public & " expected 10") + Call ok(testObj.private = 10, "testObj.private = " & testObj.private & " expected 10") + Call ok(testObj.next = 10, "testObj.next = " & testObj.next & " expected 10") + Call ok(testObj.on = 10, "testObj.on = " & testObj.on & " expected 10") + Call ok(testObj.resume = 10, "testObj.resume = " & testObj.resume & " expected 10") + Call ok(testObj.goto = 10, "testObj.goto = " & testObj.goto & " expected 10") +end sub +call test_dotIdentifiers + +' Test End statements not required to be preceeded by a newline or separator +Sub EndTestSub + x = 1 End Sub + +Sub EndTestSubWithCall + x = 1 + Call ok(x = 1, "x = " & x)End Sub +Call EndTestSubWithCall() + +Function EndTestFunc(x) + Call ok(x > 0, "x = " & x)End Function +EndTestFunc(1) + +Class EndTestClassWithStorageId + Public x End Class + +Class EndTestClassWithDim + Dim x End Class + +Class EndTestClassWithFunc + Function test(ByVal x) + x = 0 End Function End Class + +Class EndTestClassWithProperty + Public x + Public default Property Get defprop + defprop = x End Property End Class + reportSuccess() diff --git a/modules/rostests/winetests/vbscript/run.c b/modules/rostests/winetests/vbscript/run.c index 191f5a79a0d..2d34a8c80f2 100644 --- a/modules/rostests/winetests/vbscript/run.c +++ b/modules/rostests/winetests/vbscript/run.c @@ -58,6 +58,9 @@ extern const CLSID CLSID_VBScriptRegExp; #define SET_EXPECT(func) \ expect_ ## func = TRUE +#define REF_EXPECT(func) \ + (&expect_ ## func), (&called_ ## func) + #define CHECK_EXPECT2(func) \ do { \ ok(expect_ ##func, "unexpected call " #func "\n"); \ @@ -76,6 +79,12 @@ extern const CLSID CLSID_VBScriptRegExp; expect_ ## func = called_ ## func = FALSE; \ }while(0) +#define CHECK_NOT_CALLED(func) \ + do { \ + ok(!called_ ## func, "unexpected " #func "\n"); \ + expect_ ## func = called_ ## func = FALSE; \ + }while(0) + #define CLEAR_CALLED(func) \ expect_ ## func = called_ ## func = FALSE @@ -85,6 +94,7 @@ DEFINE_EXPECT(global_vbvar_d); DEFINE_EXPECT(global_vbvar_i); DEFINE_EXPECT(global_letobj_i); DEFINE_EXPECT(global_setobj_i); +DEFINE_EXPECT(global_globalcallback_i); DEFINE_EXPECT(testobj_propget_d); DEFINE_EXPECT(testobj_propget_i); DEFINE_EXPECT(testobj_propput_d); @@ -95,12 +105,15 @@ DEFINE_EXPECT(global_propargput_i); DEFINE_EXPECT(global_propargput1_d); DEFINE_EXPECT(global_propargput1_i); DEFINE_EXPECT(global_testoptionalarg_i); +DEFINE_EXPECT(global_testerrorobject_i); DEFINE_EXPECT(collectionobj_newenum_i); DEFINE_EXPECT(Next); DEFINE_EXPECT(GetWindow); DEFINE_EXPECT(GetUIBehavior); DEFINE_EXPECT(EnableModeless); DEFINE_EXPECT(OnScriptError); +DEFINE_EXPECT(OnEnterScript); +DEFINE_EXPECT(OnLeaveScript); #define DISPID_GLOBAL_REPORTSUCCESS 1000 #define DISPID_GLOBAL_TRACE 1001 @@ -124,9 +137,12 @@ DEFINE_EXPECT(OnScriptError); #define DISPID_GLOBAL_SETOBJ 1019 #define DISPID_GLOBAL_TODO_WINE_OK 1020 #define DISPID_GLOBAL_WEEKSTARTDAY 1021 +#define DISPID_GLOBAL_GLOBALCALLBACK 1022 +#define DISPID_GLOBAL_TESTERROROBJECT 1023 #define DISPID_TESTOBJ_PROPGET 2000 #define DISPID_TESTOBJ_PROPPUT 2001 +#define DISPID_TESTOBJ_KEYWORD 2002 #define DISPID_COLLOBJ_RESET 3000 @@ -143,6 +159,7 @@ static int test_counter; static SCRIPTUICHANDLING uic_handling = SCRIPTUICHANDLING_NOUIERROR; static IDispatchEx testObj; static HRESULT onerror_hres = E_NOTIMPL; +static BOOL strict_enter_script; static BSTR a2bstr(const char *str) { @@ -163,6 +180,13 @@ static int strcmp_wa(LPCWSTR strw, const char *stra) return lstrcmpA(buf, stra); } +static int stricmp_wa(LPCWSTR strw, const char *stra) +{ + CHAR buf[512]; + WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), 0, 0); + return lstrcmpiA(buf, stra); +} + static const char *vt2a(VARIANT *v) { if(V_VT(v) == (VT_BYREF|VT_VARIANT)) { @@ -685,7 +709,6 @@ static HRESULT WINAPI DispatchEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pcti static HRESULT WINAPI DispatchEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { - ok(0, "unexpected call\n"); return E_NOTIMPL; } @@ -756,17 +779,81 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc static HRESULT WINAPI testObj_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) { - if(!strcmp_wa(bstrName, "propget")) { - CHECK_EXPECT(testobj_propget_d); - test_grfdex(grfdex, fdexNameCaseInsensitive); - *pid = DISPID_TESTOBJ_PROPGET; - return S_OK; - } - if(!strcmp_wa(bstrName, "propput")) { - CHECK_EXPECT(testobj_propput_d); - test_grfdex(grfdex, fdexNameCaseInsensitive); - *pid = DISPID_TESTOBJ_PROPPUT; - return S_OK; + typedef struct { + const char * const name; + DISPID pid; + BOOL *expect; + BOOL *called; + } dispid_t; + + dispid_t dispids[] = { + { "propget", DISPID_TESTOBJ_PROPGET, REF_EXPECT(testobj_propget_d) }, + { "propput", DISPID_TESTOBJ_PROPPUT, REF_EXPECT(testobj_propput_d) }, + { "rem", DISPID_TESTOBJ_KEYWORD, NULL }, + { "true", DISPID_TESTOBJ_KEYWORD, NULL }, + { "false", DISPID_TESTOBJ_KEYWORD, NULL }, + { "not", DISPID_TESTOBJ_KEYWORD, NULL }, + { "and", DISPID_TESTOBJ_KEYWORD, NULL }, + { "or", DISPID_TESTOBJ_KEYWORD, NULL }, + { "xor", DISPID_TESTOBJ_KEYWORD, NULL }, + { "eqv", DISPID_TESTOBJ_KEYWORD, NULL }, + { "imp", DISPID_TESTOBJ_KEYWORD, NULL }, + { "is", DISPID_TESTOBJ_KEYWORD, NULL }, + { "mod", DISPID_TESTOBJ_KEYWORD, NULL }, + { "call", DISPID_TESTOBJ_KEYWORD, NULL }, + { "dim", DISPID_TESTOBJ_KEYWORD, NULL }, + { "sub", DISPID_TESTOBJ_KEYWORD, NULL }, + { "function", DISPID_TESTOBJ_KEYWORD, NULL }, + { "get", DISPID_TESTOBJ_KEYWORD, NULL }, + { "let", DISPID_TESTOBJ_KEYWORD, NULL }, + { "const", DISPID_TESTOBJ_KEYWORD, NULL }, + { "if", DISPID_TESTOBJ_KEYWORD, NULL }, + { "else", DISPID_TESTOBJ_KEYWORD, NULL }, + { "elseif", DISPID_TESTOBJ_KEYWORD, NULL }, + { "end", DISPID_TESTOBJ_KEYWORD, NULL }, + { "then", DISPID_TESTOBJ_KEYWORD, NULL }, + { "exit", DISPID_TESTOBJ_KEYWORD, NULL }, + { "while", DISPID_TESTOBJ_KEYWORD, NULL }, + { "wend", DISPID_TESTOBJ_KEYWORD, NULL }, + { "do", DISPID_TESTOBJ_KEYWORD, NULL }, + { "loop", DISPID_TESTOBJ_KEYWORD, NULL }, + { "until", DISPID_TESTOBJ_KEYWORD, NULL }, + { "for", DISPID_TESTOBJ_KEYWORD, NULL }, + { "to", DISPID_TESTOBJ_KEYWORD, NULL }, + { "each", DISPID_TESTOBJ_KEYWORD, NULL }, + { "in", DISPID_TESTOBJ_KEYWORD, NULL }, + { "select", DISPID_TESTOBJ_KEYWORD, NULL }, + { "case", DISPID_TESTOBJ_KEYWORD, NULL }, + { "byref", DISPID_TESTOBJ_KEYWORD, NULL }, + { "byval", DISPID_TESTOBJ_KEYWORD, NULL }, + { "option", DISPID_TESTOBJ_KEYWORD, NULL }, + { "nothing", DISPID_TESTOBJ_KEYWORD, NULL }, + { "empty", DISPID_TESTOBJ_KEYWORD, NULL }, + { "null", DISPID_TESTOBJ_KEYWORD, NULL }, + { "class", DISPID_TESTOBJ_KEYWORD, NULL }, + { "set", DISPID_TESTOBJ_KEYWORD, NULL }, + { "new", DISPID_TESTOBJ_KEYWORD, NULL }, + { "public", DISPID_TESTOBJ_KEYWORD, NULL }, + { "private", DISPID_TESTOBJ_KEYWORD, NULL }, + { "next", DISPID_TESTOBJ_KEYWORD, NULL }, + { "on", DISPID_TESTOBJ_KEYWORD, NULL }, + { "resume", DISPID_TESTOBJ_KEYWORD, NULL }, + { "goto", DISPID_TESTOBJ_KEYWORD, NULL }, + }; + int i; + + for (i = 0; i < ARRAY_SIZE(dispids); i++) { + if(!stricmp_wa(bstrName, dispids[i].name)) { + dispid_t *d = &dispids[i]; + if(d->expect) { + ok(*d->expect, "unexpected call %s\n", d->name); + *d->called = TRUE; + *d->expect = FALSE; + } + test_grfdex(grfdex, fdexNameCaseInsensitive); + *pid = d->pid; + return S_OK; + } } ok(0, "unexpected call %s\n", wine_dbgstr_w(bstrName)); @@ -831,6 +918,11 @@ static HRESULT WINAPI testObj_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, ok(V_VT(pdp->rgvarg) == VT_I2, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg)); ok(V_I2(pdp->rgvarg) == 1, "V_I2(psp->rgvargs) = %d\n", V_I2(pdp->rgvarg)); return S_OK; + + case DISPID_TESTOBJ_KEYWORD: + V_VT(pvarRes) = VT_I2; + V_I2(pvarRes) = 10; + return S_OK; } ok(0, "unexpected call %d\n", id); @@ -1024,6 +1116,11 @@ static HRESULT WINAPI Global_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD *pid = DISPID_GLOBAL_WEEKSTARTDAY; return S_OK; } + if(!strcmp_wa(bstrName, "globalCallback")) { + test_grfdex(grfdex, fdexNameCaseInsensitive); + *pid = DISPID_GLOBAL_GLOBALCALLBACK; + return S_OK; + } if(!strcmp_wa(bstrName, "testObj")) { test_grfdex(grfdex, fdexNameCaseInsensitive); *pid = DISPID_GLOBAL_TESTOBJ; @@ -1102,6 +1199,11 @@ static HRESULT WINAPI Global_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD *pid = DISPID_GLOBAL_TESTOPTIONALARG; return S_OK; } + if(!strcmp_wa(bstrName, "testErrorObject")) { + test_grfdex(grfdex, fdexNameCaseInsensitive); + *pid = DISPID_GLOBAL_TESTERROROBJECT; + return S_OK; + } if(strict_dispid_check && strcmp_wa(bstrName, "x")) ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex); @@ -1480,6 +1582,115 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, ok(V_ERROR(v) == DISP_E_PARAMNOTFOUND, "V_ERROR(v) = %08x\n", V_ERROR(v)); return S_OK; } + case DISPID_GLOBAL_GLOBALCALLBACK: { + DISPPARAMS dp = {0}; + IDispatchEx *dispex; + EXCEPINFO ei; + VARIANT v; + DISPID id; + BSTR str; + HRESULT hres; + + CHECK_EXPECT(global_globalcallback_i); + CHECK_CALLED(OnEnterScript); + + ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags); + ok(pdp != NULL, "pdp == NULL\n"); + ok(pdp->rgvarg != NULL, "rgvarg == NULL\n"); + ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg)); + ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n"); + ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs); + ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs); + ok(!pvarRes, "pvarRes != NULL\n"); + ok(pei != NULL, "pei == NULL\n"); + + hres = IDispatch_QueryInterface(V_DISPATCH(pdp->rgvarg), &IID_IDispatchEx, (void**)&dispex); + ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres); + + str = SysAllocString(L"callback"); + hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &id); + ok(hres == S_OK, "GetDispID failed: %08x\n", hres); + SysFreeString(str); + + SET_EXPECT(OnEnterScript); + SET_EXPECT(OnLeaveScript); + memset(&ei, 0, sizeof(ei)); + hres = IDispatchEx_InvokeEx(dispex, id, 0, DISPATCH_METHOD, &dp, &v, &ei, pspCaller); + ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + CHECK_CALLED(OnEnterScript); + CHECK_CALLED(OnLeaveScript); + ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v)); + ok(V_BOOL(&v) == VARIANT_TRUE, "V_BOOL(v) = %x\n", V_BOOL(&v)); + + IDispatchEx_Release(dispex); + + SET_EXPECT(OnLeaveScript); + return S_OK; + } + case DISPID_GLOBAL_TESTERROROBJECT: { + ITypeInfo *typeinfo; + IDispatchEx *dispex; + DISPPARAMS dp; + VARIANT v, r; + EXCEPINFO ei; + IDispatch *disp; + WCHAR *names[1]; + UINT count, i; + DISPID id; + HRESULT hres; + + static WCHAR props[][32] = { L"clear", L"description", L"helpcontext", L"helpFILE", L"number", L"raise", L"source" }; + + CHECK_EXPECT(global_testerrorobject_i); + + ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags); + ok(pdp != NULL, "pdp == NULL\n"); + ok(pdp->rgvarg != NULL, "rgvarg == NULL\n"); + ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n"); + ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs); + ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs); + ok(!pvarRes, "pvarRes != NULL\n"); + ok(pei != NULL, "pei == NULL\n"); + + ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg)); + disp = V_DISPATCH(pdp->rgvarg); + hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex); + ok(hres == E_NOINTERFACE, "Could not get IDispatchEx iface: %08x\n", hres); + + hres = IDispatch_GetTypeInfoCount(disp, &count); + ok(hres == S_OK, "GetTypeInfoCount returned: %08x\n", hres); + ok(count == 0, "count = %u\n", count); + + hres = IDispatch_GetTypeInfo(disp, 0, 0, &typeinfo); + ok(hres == DISP_E_BADINDEX, "GetTypeInfo returned: %08x\n", hres); + + for(i = 0; i < ARRAY_SIZE(props); i++) { + names[0] = props[i]; + hres = IDispatch_GetIDsOfNames(disp, &IID_NULL, names, 1, 0, &id); + ok(hres == S_OK, "GetIDsOfNames failed: %08x\n", hres); + ok(id == i + 1, "%s id = %u\n", wine_dbgstr_w(props[i]), id); + } + + memset(&dp, 0, sizeof(dp)); + memset(&ei, 0, sizeof(ei)); + V_VT(&v) = VT_ERROR; + hres = IDispatch_Invoke(disp, 5, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL); + ok(hres == S_OK, "Invoke failed: %08x\n", hres); + ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v)); + ok(V_I4(&v) == 1, "V_I4(v) = %d\n", V_I4(&v)); + hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL); + ok(hres == S_OK, "Invoke failed: %08x\n", hres); + ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v)); + ok(V_I4(&v) == 1, "V_I4(v) = %d\n", V_I4(&v)); + + dp.rgvarg = &v; + V_VT(&v) = VT_I4; + V_I4(&v) = 6; + V_VT(&r) = VT_EMPTY; + hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 6, DISPATCH_METHOD|DISPATCH_PROPERTYGET, &dp, &r, &ei, NULL); + ok(hres == S_OK, "Invoke failed: %08x\n", hres); + return S_OK; + } } ok(0, "unexpected call %d\n", id); @@ -1651,9 +1862,11 @@ static HRESULT WINAPI ActiveScriptSite_OnStateChange(IActiveScriptSite *iface, S return E_NOTIMPL; } +static IActiveScriptError **store_script_error; + static HRESULT WINAPI ActiveScriptSite_OnScriptError(IActiveScriptSite *iface, IActiveScriptError *pscripterror) { - HRESULT hr = onerror_hres; + HRESULT hr = onerror_hres, hres; if(!expect_OnScriptError) { EXCEPINFO info; @@ -1664,7 +1877,18 @@ static HRESULT WINAPI ActiveScriptSite_OnScriptError(IActiveScriptSite *iface, I if(SUCCEEDED(hres)) hres = IActiveScriptError_GetExceptionInfo(pscripterror, &info); if(SUCCEEDED(hres)) - trace("Error in line %u: %s\n", line+1, wine_dbgstr_w(info.bstrDescription)); + trace("Error in line %u: %x %s\n", line+1, info.wCode, wine_dbgstr_w(info.bstrDescription)); + }else { + IDispatchEx *dispex; + + hres = IActiveScriptError_QueryInterface(pscripterror, &IID_IDispatchEx, (void**)&dispex); + ok(hres == E_NOINTERFACE, "QI(IDispatchEx) returned: %08x\n", hres); + } + + if(store_script_error) { + IActiveScriptError_AddRef(pscripterror); + *store_script_error = pscripterror; + store_script_error = NULL; } CHECK_EXPECT(OnScriptError); @@ -1675,16 +1899,18 @@ static HRESULT WINAPI ActiveScriptSite_OnScriptError(IActiveScriptSite *iface, I static HRESULT WINAPI ActiveScriptSite_OnEnterScript(IActiveScriptSite *iface) { + if(strict_enter_script) + CHECK_EXPECT(OnEnterScript); return E_NOTIMPL; } static HRESULT WINAPI ActiveScriptSite_OnLeaveScript(IActiveScriptSite *iface) { + if(strict_enter_script) + CHECK_EXPECT(OnLeaveScript); return E_NOTIMPL; } -#undef ACTSCPSITE_THIS - static const IActiveScriptSiteVtbl ActiveScriptSiteVtbl = { ActiveScriptSite_QueryInterface, ActiveScriptSite_AddRef, @@ -1713,7 +1939,7 @@ static IActiveScript *create_script(void) return script; } -static IActiveScript *create_and_init_script(DWORD flags) +static IActiveScript *create_and_init_script(DWORD flags, BOOL start) { IActiveScriptParse *parser; IActiveScript *engine; @@ -1738,8 +1964,11 @@ static IActiveScript *create_and_init_script(DWORD flags) SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|flags); ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres); - hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED); - ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres); + if (start) + { + hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres); + } return engine; } @@ -1764,7 +1993,7 @@ static HRESULT parse_script(DWORD flags, BSTR script_str, const WCHAR *delim) LONG ref; HRESULT hres; - engine = create_and_init_script(flags); + engine = create_and_init_script(flags, TRUE); if(!engine) return S_OK; @@ -1828,13 +2057,17 @@ static void test_parse_context(void) static const WCHAR yW[] = {'y',0}; global_ref = 1; - engine = create_and_init_script(0); + engine = create_and_init_script(0, TRUE); if(!engine) return; hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser); ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + /* NULL code text succeeds but does nothing */ + hres = IActiveScriptParse_ParseScriptText(parser, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, NULL); + ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + /* unknown identifier context is not a valid argument */ str = a2bstr("Call reportSuccess()\n"); hres = IActiveScriptParse_ParseScriptText(parser, str, yW, NULL, NULL, 0, 0, 0, NULL, NULL); @@ -1891,7 +2124,7 @@ static void _parse_htmlscript_a(unsigned line, const char *src) ok_(__FILE__,line)(hres == S_OK, "parse_script failed: %08x\n", hres); } -static IDispatchEx *parse_procedure(IActiveScriptParseProcedure2 *parse_proc, const char *src) +static IDispatchEx *parse_procedure(IActiveScriptParseProcedure2 *parse_proc, const char *src, DWORD flags) { IDispatchEx *dispex; IDispatch *disp; @@ -1902,7 +2135,7 @@ static IDispatchEx *parse_procedure(IActiveScriptParseProcedure2 *parse_proc, co str = a2bstr(src); hres = IActiveScriptParseProcedure2_ParseProcedureText(parse_proc, str, NULL, emptyW, NULL, NULL, delimiterW, 0, 0, - SCRIPTPROC_HOSTMANAGESSOURCE|SCRIPTPROC_IMPLICIT_THIS|SCRIPTPROC_IMPLICIT_PARENTS, &disp); + SCRIPTPROC_HOSTMANAGESSOURCE|SCRIPTPROC_IMPLICIT_THIS|SCRIPTPROC_IMPLICIT_PARENTS|flags, &disp); SysFreeString(str); ok(hres == S_OK, "ParseProcedureText failed: %08x\n", hres); ok(disp != NULL, "disp = NULL\n"); @@ -1921,26 +2154,220 @@ static void test_procedures(void) DISPPARAMS dp = {NULL}; IActiveScript *script; IDispatchEx *proc; + IDispatch *disp; EXCEPINFO ei = {0}; VARIANT v; HRESULT hres; - script = create_and_init_script(0); + strict_enter_script = TRUE; + script = create_and_init_script(0, TRUE); hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParseProcedure2, (void**)&parse_proc); ok(hres == S_OK, "Could not get IActiveScriptParseProcedure2 iface: %08x\n", hres); - proc = parse_procedure(parse_proc, "dim x\nif true then x=false"); + hres = IActiveScriptParseProcedure2_ParseProcedureText(parse_proc, NULL, NULL, emptyW, NULL, NULL, NULL, 0, 0, 0, &disp); + ok(hres == S_OK, "ParseProcedureText failed: %08x\n", hres); + IDispatch_Release(disp); + + proc = parse_procedure(parse_proc, "dim x\nif true then x=false", 0); + SET_EXPECT(OnEnterScript); + SET_EXPECT(OnLeaveScript); V_VT(&v) = VT_EMPTY; hres = IDispatchEx_InvokeEx(proc, DISPID_VALUE, 0, DISPATCH_METHOD, &dp, &v, &ei, &caller_sp); ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + CHECK_CALLED(OnEnterScript); + CHECK_CALLED(OnLeaveScript); + VariantClear(&v); + IDispatchEx_Release(proc); + + proc = parse_procedure(parse_proc, "\"foobar\"", SCRIPTPROC_ISEXPRESSION); + SET_EXPECT(OnEnterScript); + SET_EXPECT(OnLeaveScript); + hres = IDispatchEx_InvokeEx(proc, DISPID_VALUE, 0, DISPATCH_METHOD, &dp, &v, &ei, &caller_sp); + ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + CHECK_CALLED(OnEnterScript); + CHECK_CALLED(OnLeaveScript); + ok(V_VT(&v) == VT_BSTR, "Expected VT_BSTR, got %s\n", vt2a(&v)); + ok(!strcmp_wa(V_BSTR(&v), "foobar"), "Wrong string, got %s\n", wine_dbgstr_w(V_BSTR(&v))); + VariantClear(&v); IDispatchEx_Release(proc); IActiveScriptParseProcedure2_Release(parse_proc); close_script(script); + strict_enter_script = FALSE; +} + +static void free_ei(EXCEPINFO *ei) +{ + SysFreeString(ei->bstrSource); + SysFreeString(ei->bstrDescription); + SysFreeString(ei->bstrHelpFile); +} + +static void test_callbacks(void) +{ + IActiveScriptError *error1, *error2; + IActiveScriptParse *parser; + DISPPARAMS dp = {NULL}; + IActiveScript *script; + IDispatchEx *dispex; + IDispatch *disp; + DISPID id; + EXCEPINFO ei = {0}; + BSTR str; + VARIANT v; + HRESULT hres; + + strict_enter_script = TRUE; + script = create_and_init_script(SCRIPTITEM_GLOBALMEMBERS, TRUE); + + hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parser); + ok(hres == S_OK, "Could not get IActiveScriptParseProcedure2 iface: %08x\n", hres); + + SET_EXPECT(OnEnterScript); + SET_EXPECT(OnLeaveScript); + hres = IActiveScriptParse_ParseScriptText(parser, + L"class CallbackClass\n" + L" public function callback()\n" + L" call ok(err.number = 2, \"err.number = \" & err.number)\n" + L" callback = true\n" + L" end function\n" + L"end class\n" + L"function callGlobalCallback()\n" + L" on error resume next\n" + L" err.raise 2\n" + L" call test.globalCallback(new CallbackClass)\n" + L" call ok(err.number = 2, \"err.number = \" & err.numner)\n" + L"end function\n", + NULL, NULL, NULL, 0, 0, 0, NULL, NULL); + ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + CHECK_CALLED(OnEnterScript); + CHECK_CALLED(OnLeaveScript); + + hres = IActiveScript_GetScriptDispatch(script, NULL, &disp); + ok(hres == S_OK, "GetScriptDispatch failed: %08x\n", hres); + + hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex); + ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres); + IDispatch_Release(disp); + + str = SysAllocString(L"callGlobalCallback"); + hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &id); + ok(hres == S_OK, "GetDispID failed: %08x\n", hres); + SysFreeString(str); + + SET_EXPECT(OnEnterScript); + /* OnLeaveScript will be set in global callback */ + SET_EXPECT(global_globalcallback_i); + hres = IDispatchEx_InvokeEx(dispex, id, 0, DISPATCH_METHOD, &dp, &v, &ei, &caller_sp); + ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + /* OnEnterScript was checked in global callback */ + CHECK_CALLED(OnLeaveScript); + CHECK_CALLED(global_globalcallback_i); + + store_script_error = &error1; + + SET_EXPECT(OnEnterScript); + SET_EXPECT(OnLeaveScript); + SET_EXPECT(OnScriptError); + hres = IActiveScriptParse_ParseScriptText(parser, L"err.raise 2\n", + NULL, NULL, NULL, 0, 0, 0, NULL, NULL); + ok(hres == MAKE_VBSERROR(2), "ParseScriptText failed: %08x\n", hres); + CHECK_CALLED(OnEnterScript); + CHECK_CALLED(OnLeaveScript); + CHECK_CALLED(OnScriptError); + + store_script_error = &error2; + + SET_EXPECT(OnEnterScript); + SET_EXPECT(OnLeaveScript); + SET_EXPECT(OnScriptError); + hres = IActiveScriptParse_ParseScriptText(parser, + L"call ok(err.number = 0, \"err.number = \" & err.number)\n" + L"err.raise &h86664004&, \"src\", \"desc\", \"help\", 1\n", + NULL, NULL, NULL, 0, 0, 0, NULL, NULL); + ok(hres == SCRIPT_E_RECORDED, "ParseScriptText failed: %08x\n", hres); + CHECK_CALLED(OnEnterScript); + CHECK_CALLED(OnLeaveScript); + CHECK_CALLED(OnScriptError); + + memset(&ei, 0xcc, sizeof(ei)); + hres = IActiveScriptError_GetExceptionInfo(error1, &ei); + ok(hres == S_OK, "GetExceptionInfo returned %08x\n", hres); + ok(!ei.wCode, "wCode = %x\n", ei.wCode); + ok(!ei.wReserved, "wReserved = %x\n", ei.wReserved); + if(is_english) { + ok(!wcscmp(ei.bstrSource, L"Microsoft VBScript runtime error"), + "bstrSource = %s\n", wine_dbgstr_w(ei.bstrSource)); + ok(!wcscmp(ei.bstrDescription, L"Object doesn't support this property or method"), + "bstrDescription = %s\n", wine_dbgstr_w(ei.bstrDescription)); + } + ok(!ei.bstrHelpFile, "bstrHelpFile = %s\n", wine_dbgstr_w(ei.bstrHelpFile)); + ok(!ei.dwHelpContext, "dwHelpContext = %x\n", ei.dwHelpContext); + ok(!ei.pvReserved, "pvReserved = %p\n", ei.pvReserved); + ok(!ei.pfnDeferredFillIn, "pfnDeferredFillIn = %p\n", ei.pfnDeferredFillIn); + ok(ei.scode == MAKE_VBSERROR(2), "scode = %x\n", ei.scode); + free_ei(&ei); + + IActiveScriptError_Release(error1); + + memset(&ei, 0xcc, sizeof(ei)); + hres = IActiveScriptError_GetExceptionInfo(error2, &ei); + ok(hres == S_OK, "GetExceptionInfo returned %08x\n", hres); + ok(!ei.wCode, "wCode = %x\n", ei.wCode); + ok(!ei.wReserved, "wReserved = %x\n", ei.wReserved); + ok(!wcscmp(ei.bstrSource, L"src"), "bstrSource = %s\n", wine_dbgstr_w(ei.bstrSource)); + ok(!wcscmp(ei.bstrDescription, L"desc"), "bstrDescription = %s\n", wine_dbgstr_w(ei.bstrDescription)); + ok(!wcscmp(ei.bstrHelpFile, L"help"), "bstrHelpFile = %s\n", wine_dbgstr_w(ei.bstrHelpFile)); + ok(ei.dwHelpContext == 1, "dwHelpContext = %x\n", ei.dwHelpContext); + ok(!ei.pvReserved, "pvReserved = %p\n", ei.pvReserved); + ok(!ei.pfnDeferredFillIn, "pfnDeferredFillIn = %p\n", ei.pfnDeferredFillIn); + ok(ei.scode == SCRIPT_E_RECORDED, "scode = %x\n", ei.scode); + free_ei(&ei); + + IActiveScriptError_Release(error2); + + SET_EXPECT(OnEnterScript); + SET_EXPECT(OnLeaveScript); + SET_EXPECT(OnScriptError); + hres = IActiveScriptParse_ParseScriptText(parser, L"err.raise &hffff&\n", + NULL, NULL, NULL, 0, 0, 0, NULL, NULL); + ok(hres == MAKE_VBSERROR(0xffff), "ParseScriptText failed: %08x\n", hres); + CHECK_CALLED(OnEnterScript); + CHECK_CALLED(OnLeaveScript); + CHECK_CALLED(OnScriptError); + + SET_EXPECT(OnEnterScript); + SET_EXPECT(OnLeaveScript); + SET_EXPECT(OnScriptError); + hres = IActiveScriptParse_ParseScriptText(parser, L"err.raise &h80102030&\n", + NULL, NULL, NULL, 0, 0, 0, NULL, NULL); + ok(hres == 0x80102030, "ParseScriptText failed: %08x\n", hres); + CHECK_CALLED(OnEnterScript); + CHECK_CALLED(OnLeaveScript); + CHECK_CALLED(OnScriptError); + + SET_EXPECT(OnEnterScript); + SET_EXPECT(global_testerrorobject_i); + SET_EXPECT(OnLeaveScript); + hres = IActiveScriptParse_ParseScriptText(parser, + L"on error resume next\n" + L"err.raise 1\n" + L"testErrorObject err\n", + NULL, NULL, NULL, 0, 0, 0, NULL, NULL); + ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + CHECK_CALLED(OnEnterScript); + CHECK_CALLED(global_testerrorobject_i); + CHECK_CALLED(OnLeaveScript); + + IDispatchEx_Release(dispex); + + IActiveScriptParse_Release(parser); + close_script(script); + strict_enter_script = FALSE; } static void test_gc(void) @@ -1998,6 +2425,62 @@ static void test_gc(void) IActiveScriptParse_Release(parser); } +static void test_parse_errors(void) +{ + static const char *invalid_scripts[] = + { + /* If...End If */ + "If 0 > 1 Then\n" + " x = 0 End If\n", + + /* While...End While */ + "While False\n" + " x = 0 End While\n", + + /* While...Wend */ + "While False\n" + " x = 0 Wend\n", + + /* Do While...Loop */ + "Do While False\n" + " x = 0 Loop\n", + + /* Do Until...Loop */ + "Do Until True\n" + " x = 0 Loop\n", + + /* Do...Loop While */ + "Do\n" + " x = 0 Loop While False\n", + + /* Do...Loop Until */ + "Do\n" + " x = 0 Loop Until True\n", + + /* Select...End Select */ + "x = False\n" + "Select Case 42\n" + " Case 0\n" + " Call ok(False, \"unexpected case\")\n" + " Case 42\n" + " x = True End Select\n" + "Call ok(x, \"wrong case\")\n", + + /* Class...End Class (empty) */ + "Class C End Class" + }; + HRESULT hres; + UINT i; + + for (i = 0; i < ARRAY_SIZE(invalid_scripts); i++) + { + SET_EXPECT(OnScriptError); + hres = parse_script_ar(invalid_scripts[i]); + ok(FAILED(hres), "[%u] script did not fail\n", i); + CHECK_CALLED(OnScriptError); + } +} + static void test_msgbox(void) { HRESULT hres; @@ -2035,7 +2518,7 @@ static void test_msgbox(void) CHECK_CALLED(GetUIBehavior); CHECK_CALLED(GetWindow); CHECK_CALLED(EnableModeless); - todo_wine CHECK_CALLED(OnScriptError); + CHECK_CALLED(OnScriptError); uic_handling = SCRIPTUICHANDLING_NOUIERROR; @@ -2044,7 +2527,7 @@ static void test_msgbox(void) hres = parse_script_ar("MsgBox \"testing...\""); ok(FAILED(hres), "script not failed\n"); CHECK_CALLED(GetUIBehavior); - todo_wine CHECK_CALLED(OnScriptError); + CHECK_CALLED(OnScriptError); } static HRESULT test_global_vars_ref(BOOL use_close) @@ -2104,6 +2587,141 @@ static HRESULT test_global_vars_ref(BOOL use_close) return hres; } +static void test_isexpression(void) +{ + IActiveScriptParse *parser; + IActiveScript *engine; + SCRIPTSTATE ss; + HRESULT hres; + VARIANT var; + BSTR str; + + if (!(engine = create_and_init_script(0, FALSE))) + return; + + hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + if (FAILED(hres)) + { + close_script(engine); + return; + } + + /* Expression when script is not started is still executed */ + hres = IActiveScript_GetScriptState(engine, &ss); + ok(hres == S_OK, "GetScriptState failed: %08x\n", hres); + ok(ss == SCRIPTSTATE_INITIALIZED, "Wrong script state %u\n", ss); + + str = a2bstr("13"); + hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); + ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok(V_VT(&var) == VT_I2, "Expected VT_I2, got %s\n", vt2a(&var)); + ok(V_I2(&var) == 13, "Expected 13, got %d\n", V_I2(&var)); + VariantClear(&var); + SysFreeString(str); + + hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres); + + /* Empty expressions */ + V_VT(&var) = VT_I2; + str = a2bstr(""); + hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); + ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok(V_VT(&var) == VT_EMPTY, "Expected VT_EMPTY, got %s\n", vt2a(&var)); + VariantClear(&var); + SysFreeString(str); + + /* Two expressions fail */ + str = a2bstr("1\n3"); + SET_EXPECT(OnScriptError); + hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); + ok(FAILED(hres), "ParseScriptText did not fail: %08x\n", hres); + CHECK_CALLED(OnScriptError); + VariantClear(&var); + SysFreeString(str); + + /* Simple numerical expression */ + str = a2bstr("(1 + 7) * 2 - 3"); + hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, NULL, NULL); + ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + + hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); + ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok(V_VT(&var) == VT_I2, "Expected VT_I2, got %s\n", vt2a(&var)); + ok(V_I2(&var) == 13, "Expected 13, got %d\n", V_I2(&var)); + VariantClear(&var); + SysFreeString(str); + + /* An expression can also refer to a variable, function, class, etc previously set */ + V_VT(&var) = VT_I2; + str = a2bstr("If True Then foo = 42 Else foo = 0\n"); + hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, 0, &var, NULL); + ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok(V_VT(&var) == VT_EMPTY, "Expected VT_EMPTY, got %s\n", vt2a(&var)); + VariantClear(&var); + SysFreeString(str); + + str = a2bstr("foo\n\n"); + hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); + ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok(V_VT(&var) == VT_I2, "Expected VT_I2, got %s\n", vt2a(&var)); + ok(V_I2(&var) == 42, "Expected 42, got %d\n", V_I2(&var)); + VariantClear(&var); + SysFreeString(str); + + str = a2bstr("foo : "); + SET_EXPECT(OnScriptError); + hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); + ok(FAILED(hres), "ParseScriptText did not fail: %08x\n", hres); + CHECK_CALLED(OnScriptError); + VariantClear(&var); + SysFreeString(str); + + str = a2bstr("\"foo is \" & CStr(foo) \n \n\n "); + hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); + ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok(V_VT(&var) == VT_BSTR, "Expected VT_BSTR, got %s\n", vt2a(&var)); + ok(!strcmp_wa(V_BSTR(&var), "foo is 42"), "Wrong string, got %s\n", wine_dbgstr_w(V_BSTR(&var))); + VariantClear(&var); + SysFreeString(str); + + str = a2bstr("Function test(x)\n" + " test = x + 0.5\n" + "End Function\n"); + hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, 0, NULL, NULL); + ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + SysFreeString(str); + + str = a2bstr("test(4) * 3\n"); + hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); + ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok(V_VT(&var) == VT_R8, "Expected VT_R8, got %s\n", vt2a(&var)); + ok(V_R8(&var) == 13.5, "Expected %lf, got %lf\n", 13.5, V_R8(&var)); + VariantClear(&var); + SysFreeString(str); + + str = a2bstr("Class C\n" + " Public x\n" + "End Class\n" + "Set obj = New C\n" + "obj.x = True\n"); + hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, 0, NULL, NULL); + ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + SysFreeString(str); + + str = a2bstr("obj.x"); + hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); + ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok(V_VT(&var) == VT_BOOL, "Expected VT_BOOL, got %s\n", vt2a(&var)); + ok(V_BOOL(&var) == VARIANT_TRUE, "Expected %x, got %x\n", VARIANT_TRUE, V_BOOL(&var)); + VariantClear(&var); + SysFreeString(str); + + IActiveScriptParse_Release(parser); + close_script(engine); +} + static BSTR get_script_from_file(const char *filename) { DWORD size, len; @@ -2186,6 +2804,7 @@ static void run_from_res(const char *name) ok(hres == S_OK, "parse_script failed: %08x\n", hres); SysFreeString(str); + test_name = ""; } static void run_tests(void) @@ -2255,6 +2874,13 @@ static void run_tests(void) parse_script_a("Option Explicit\nset test.setobj = testObj"); CHECK_CALLED(global_setobj_i); + SET_EXPECT(OnScriptError); + hres = parse_script_ar("dim x\nx = testObj.rem"); + todo_wine + ok(hres == S_OK, "use of 'rem' as dot identifier failed: %x08\n", hres); + todo_wine + CHECK_NOT_CALLED(OnScriptError); + SET_EXPECT(testobj_propget_d); SET_EXPECT(testobj_propget_i); parse_script_a("dim x\nx = testObj.propget"); @@ -2299,7 +2925,7 @@ static void run_tests(void) SET_EXPECT(OnScriptError); hres = parse_script_ar("<!--"); ok(FAILED(hres), "script didn't fail\n"); - todo_wine CHECK_CALLED(OnScriptError); + CHECK_CALLED(OnScriptError); SET_EXPECT(global_success_d); SET_EXPECT(global_success_i); @@ -2325,36 +2951,36 @@ static void run_tests(void) SET_EXPECT(OnScriptError); hres = parse_script_ar("throwInt(&h80080008&)"); ok(hres == 0x80080008, "hres = %08x\n", hres); - todo_wine CHECK_CALLED(OnScriptError); + CHECK_CALLED(OnScriptError); /* DISP_E_BADINDEX */ SET_EXPECT(OnScriptError); hres = parse_script_ar("throwInt(&h8002000b&)"); ok(hres == MAKE_VBSERROR(9), "hres = %08x\n", hres); - todo_wine CHECK_CALLED(OnScriptError); + CHECK_CALLED(OnScriptError); SET_EXPECT(OnScriptError); hres = parse_script_ar("throwInt(&h800a0009&)"); ok(hres == MAKE_VBSERROR(9), "hres = %08x\n", hres); - todo_wine CHECK_CALLED(OnScriptError); + CHECK_CALLED(OnScriptError); onerror_hres = S_OK; SET_EXPECT(OnScriptError); hres = parse_script_ar("throwInt(&h800a0009&)"); - todo_wine ok(hres == SCRIPT_E_REPORTED, "hres = %08x\n", hres); - todo_wine CHECK_CALLED(OnScriptError); + ok(hres == SCRIPT_E_REPORTED, "hres = %08x\n", hres); + CHECK_CALLED(OnScriptError); /* E_NOTIMPL */ SET_EXPECT(OnScriptError); hres = parse_script_ar("throwInt(&h80004001&)"); ok(hres == MAKE_VBSERROR(445), "hres = %08x\n", hres); - todo_wine CHECK_CALLED(OnScriptError); + CHECK_CALLED(OnScriptError); onerror_hres = S_OK; SET_EXPECT(OnScriptError); hres = parse_script_ar("throwInt(&h80004001&)"); - todo_wine ok(hres == SCRIPT_E_REPORTED, "hres = %08x\n", hres); - todo_wine CHECK_CALLED(OnScriptError); + ok(hres == SCRIPT_E_REPORTED, "hres = %08x\n", hres); + CHECK_CALLED(OnScriptError); SET_EXPECT(global_testoptionalarg_i); parse_script_a("call testOptionalArg(1,,2)"); @@ -2392,11 +3018,14 @@ static void run_tests(void) SET_EXPECT(OnScriptError); hres = parse_script_ar("x = y(\"a\")"); ok(FAILED(hres), "script didn't fail\n"); - todo_wine CHECK_CALLED(OnScriptError); + CHECK_CALLED(OnScriptError); SET_EXPECT(global_success_d); SET_EXPECT(global_success_i); parse_script_a("' comment\r" + "x = _\r3\r" + "x = _\n3\r" + "x = _\r\n3\r" "Sub testsub(arg)\r" "If arg = 1 Then\r\r" "Call reportSuccess()\n\n" @@ -2414,7 +3043,10 @@ static void run_tests(void) test_procedures(); test_gc(); test_msgbox(); + test_isexpression(); + test_parse_errors(); test_parse_context(); + test_callbacks(); } static BOOL check_vbscript(void) diff --git a/modules/rostests/winetests/vbscript/vbscript.c b/modules/rostests/winetests/vbscript/vbscript.c index 9e86a5f9198..08edfc1be79 100644 --- a/modules/rostests/winetests/vbscript/vbscript.c +++ b/modules/rostests/winetests/vbscript/vbscript.c @@ -84,6 +84,9 @@ DEFINE_EXPECT(OnStateChange_CLOSED); DEFINE_EXPECT(OnStateChange_INITIALIZED); DEFINE_EXPECT(OnEnterScript); DEFINE_EXPECT(OnLeaveScript); +DEFINE_EXPECT(GetItemInfo_global); +DEFINE_EXPECT(GetItemInfo_visible); +DEFINE_EXPECT(testCall); DEFINE_GUID(CLSID_VBScript, 0xb54f3741, 0x5b07, 0x11cf, 0xa4,0xb0, 0x00,0xaa,0x00,0x4a,0x55,0xe8); DEFINE_GUID(CLSID_VBScriptRegExp, 0x3f4daca4, 0x160d, 0x11d2, 0xa8,0xe9, 0x00,0x10,0x4b,0x36,0x5c,0x9f); @@ -111,6 +114,95 @@ static void _test_state(unsigned line, IActiveScript *script, SCRIPTSTATE exstat ok_(__FILE__,line) (state == exstate, "state=%d, expected %d\n", state, exstate); } +static HRESULT WINAPI Dispatch_QueryInterface(IDispatch *iface, REFIID riid, void **ppv) +{ + if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IDispatch, riid)) { + *ppv = iface; + IDispatch_AddRef(iface); + return S_OK; + } + + *ppv = NULL; + return E_NOINTERFACE; +} + +static ULONG global_named_item_ref, visible_named_item_ref; + +static ULONG WINAPI global_AddRef(IDispatch *iface) +{ + return ++global_named_item_ref; +} + +static ULONG WINAPI global_Release(IDispatch *iface) +{ + return --global_named_item_ref; +} + +static ULONG WINAPI visible_AddRef(IDispatch *iface) +{ + return ++visible_named_item_ref; +} + +static ULONG WINAPI visible_Release(IDispatch *iface) +{ + return --visible_named_item_ref; +} + +static HRESULT WINAPI Dispatch_GetTypeInfoCount(IDispatch *iface, UINT *pctinfo) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI Dispatch_GetTypeInfo(IDispatch *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) +{ + return DISP_E_BADINDEX; +} + +static HRESULT WINAPI Dispatch_GetIDsOfNames(IDispatch *iface, REFIID riid, LPOLESTR *names, UINT name_cnt, + LCID lcid, DISPID *ids) +{ + ok(name_cnt == 1, "name_cnt = %u\n", name_cnt); + ok(!wcscmp(names[0], L"testCall"), "names[0] = %s\n", wine_dbgstr_w(names[0])); + *ids = 1; + return S_OK; +} + +static HRESULT WINAPI Dispatch_Invoke(IDispatch *iface, DISPID id, REFIID riid, LCID lcid, WORD flags, + DISPPARAMS *dp, VARIANT *res, EXCEPINFO *ei, UINT *err) +{ + CHECK_EXPECT(testCall); + ok(id == 1, "id = %u\n", id); + ok(flags == DISPATCH_METHOD, "flags = %x\n", flags); + ok(!dp->cArgs, "cArgs = %u\n", dp->cArgs); + ok(!res, "res = %p\n", res); + return S_OK; +} + +static const IDispatchVtbl global_named_item_vtbl = { + Dispatch_QueryInterface, + global_AddRef, + global_Release, + Dispatch_GetTypeInfoCount, + Dispatch_GetTypeInfo, + Dispatch_GetIDsOfNames, + Dispatch_Invoke +}; + +static IDispatch global_named_item = { &global_named_item_vtbl }; + +static const IDispatchVtbl visible_named_item_vtbl = { + Dispatch_QueryInterface, + visible_AddRef, + visible_Release, + Dispatch_GetTypeInfoCount, + Dispatch_GetTypeInfo, + Dispatch_GetIDsOfNames, + Dispatch_Invoke +}; + +static IDispatch visible_named_item = { &visible_named_item_vtbl }; + static HRESULT WINAPI ActiveScriptSite_QueryInterface(IActiveScriptSite *iface, REFIID riid, void **ppv) { *ppv = NULL; @@ -142,10 +234,23 @@ static HRESULT WINAPI ActiveScriptSite_GetLCID(IActiveScriptSite *iface, LCID *p return E_NOTIMPL; } -static HRESULT WINAPI ActiveScriptSite_GetItemInfo(IActiveScriptSite *iface, LPCOLESTR pstrName, - DWORD dwReturnMask, IUnknown **ppiunkItem, ITypeInfo **ppti) +static HRESULT WINAPI ActiveScriptSite_GetItemInfo(IActiveScriptSite *iface, LPCOLESTR name, + DWORD return_mask, IUnknown **item_unk, ITypeInfo **item_ti) { - ok(0, "unexpected call\n"); + ok(return_mask == SCRIPTINFO_IUNKNOWN, "return_mask = %x\n", return_mask); + if(!wcscmp(name, L"globalItem")) { + CHECK_EXPECT(GetItemInfo_global); + IDispatch_AddRef(&global_named_item); + *item_unk = (IUnknown*)&global_named_item; + return S_OK; + } + if(!wcscmp(name, L"visibleItem")) { + CHECK_EXPECT(GetItemInfo_visible); + IDispatch_AddRef(&visible_named_item); + *item_unk = (IUnknown*)&visible_named_item; + return S_OK; + } + ok(0, "unexpected call %s\n", wine_dbgstr_w(name)); return E_NOTIMPL; } @@ -392,8 +497,8 @@ static IActiveScript *create_vbscript(void) static void test_scriptdisp(void) { + IDispatchEx *script_disp, *script_disp2; IActiveScriptParse *parser; - IDispatchEx *script_disp; IActiveScript *vbscript; DISPID id, id2; DISPPARAMS dp; @@ -415,6 +520,8 @@ static void test_scriptdisp(void) ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); CHECK_CALLED(GetLCID); + script_disp2 = get_script_dispatch(vbscript); + test_state(vbscript, SCRIPTSTATE_UNINITIALIZED); SET_EXPECT(OnStateChange_INITIALIZED); @@ -432,6 +539,8 @@ static void test_scriptdisp(void) test_state(vbscript, SCRIPTSTATE_CONNECTED); script_disp = get_script_dispatch(vbscript); + ok(script_disp == script_disp2, "script_disp != script_disp2\n"); + IDispatchEx_Release(script_disp2); id = 100; get_disp_id(script_disp, "LCase", DISP_E_UNKNOWNNAME, &id); @@ -529,6 +638,7 @@ static void test_vbscript(void) test_state(vbscript, SCRIPTSTATE_UNINITIALIZED); test_safety(vbscript); + test_no_script_dispatch(vbscript); SET_EXPECT(GetLCID); hres = IActiveScript_SetScriptSite(vbscript, &ActiveScriptSite); @@ -600,6 +710,8 @@ static void test_vbscript_uninitializing(void) hres = IActiveScriptParse_InitNew(parse); ok(hres == S_OK, "InitNew failed: %08x\n", hres); + test_no_script_dispatch(script); + SET_EXPECT(GetLCID); SET_EXPECT(OnStateChange_INITIALIZED); hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite); @@ -685,6 +797,9 @@ static void test_vbscript_uninitializing(void) test_state(script, SCRIPTSTATE_CLOSED); + hres = IActiveScriptParse_InitNew(parse); + ok(hres == E_UNEXPECTED, "InitNew failed: %08x\n", hres); + IActiveScriptParse_Release(parse); ref = IActiveScript_Release(script); @@ -794,6 +909,88 @@ static void test_vbscript_initializing(void) ok(!ref, "ref = %d\n", ref); } +static void test_named_items(void) +{ + IActiveScriptParse *parse; + IActiveScript *script; + ULONG ref; + HRESULT hres; + + script = create_vbscript(); + + hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parse); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + + test_state(script, SCRIPTSTATE_UNINITIALIZED); + + hres = IActiveScript_AddNamedItem(script, L"visibleItem", SCRIPTITEM_ISVISIBLE); + ok(hres == E_UNEXPECTED, "AddNamedItem returned: %08x\n", hres); + hres = IActiveScript_AddNamedItem(script, L"globalItem", SCRIPTITEM_GLOBALMEMBERS); + ok(hres == E_UNEXPECTED, "AddNamedItem returned: %08x\n", hres); + + SET_EXPECT(GetLCID); + hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite); + ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); + CHECK_CALLED(GetLCID); + + SET_EXPECT(GetItemInfo_global); + hres = IActiveScript_AddNamedItem(script, L"globalItem", SCRIPTITEM_GLOBALMEMBERS); + ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres); + CHECK_CALLED(GetItemInfo_global); + + hres = IActiveScript_AddNamedItem(script, L"visibleItem", SCRIPTITEM_ISVISIBLE); + ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres); + + ok(global_named_item_ref > 0, "global_named_item_ref = %u\n", global_named_item_ref); + ok(visible_named_item_ref == 0, "visible_named_item_ref = %u\n", visible_named_item_ref); + + SET_EXPECT(OnStateChange_INITIALIZED); + hres = IActiveScriptParse_InitNew(parse); + ok(hres == S_OK, "InitNew failed: %08x\n", hres); + CHECK_CALLED(OnStateChange_INITIALIZED); + + SET_EXPECT(OnStateChange_CONNECTED); + hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hres); + CHECK_CALLED(OnStateChange_CONNECTED); + + SET_EXPECT(testCall); + parse_script(parse, "testCall\n"); + CHECK_CALLED(testCall); + + SET_EXPECT(GetItemInfo_visible); + SET_EXPECT(testCall); + parse_script(parse, "visibleItem.testCall\n"); + CHECK_CALLED(GetItemInfo_visible); + CHECK_CALLED(testCall); + + ok(global_named_item_ref > 0, "global_named_item_ref = %u\n", global_named_item_ref); + ok(visible_named_item_ref == 1, "visible_named_item_ref = %u\n", visible_named_item_ref); + + SET_EXPECT(testCall); + parse_script(parse, "visibleItem.testCall\n"); + CHECK_CALLED(testCall); + + SET_EXPECT(OnStateChange_DISCONNECTED); + SET_EXPECT(OnStateChange_INITIALIZED); + SET_EXPECT(OnStateChange_CLOSED); + hres = IActiveScript_Close(script); + ok(hres == S_OK, "Close failed: %08x\n", hres); + CHECK_CALLED(OnStateChange_DISCONNECTED); + CHECK_CALLED(OnStateChange_INITIALIZED); + CHECK_CALLED(OnStateChange_CLOSED); + + ok(global_named_item_ref == 0, "global_named_item_ref = %u\n", global_named_item_ref); + ok(visible_named_item_ref == 0, "visible_named_item_ref = %u\n", visible_named_item_ref); + + test_state(script, SCRIPTSTATE_CLOSED); + + IActiveScriptParse_Release(parse); + + ref = IActiveScript_Release(script); + ok(!ref, "ref = %d\n", ref); +} + static void test_RegExp(void) { IRegExp2 *regexp; @@ -957,6 +1154,7 @@ START_TEST(vbscript) test_vbscript_release(); test_vbscript_simplecreate(); test_vbscript_initializing(); + test_named_items(); test_scriptdisp(); test_RegExp(); }else {
5 years
1
0
0
0
[reactos] 01/01: [PSDK] Update activscp.idl. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=285df607d2315f23882bd…
commit 285df607d2315f23882bd464d7c0e21c7a3967d9 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Dec 1 19:42:38 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Dec 1 19:42:38 2019 +0100 [PSDK] Update activscp.idl. CORE-16441 --- sdk/include/psdk/activscp.idl | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/sdk/include/psdk/activscp.idl b/sdk/include/psdk/activscp.idl index 8a3d75d5b52..f70db4a7431 100644 --- a/sdk/include/psdk/activscp.idl +++ b/sdk/include/psdk/activscp.idl @@ -45,7 +45,14 @@ cpp_quote("#define SCRIPTPROP_INVOKEVERSIONING 0x00004000") cpp_quote("#define SCRIPTPROP_HACK_FIBERSUPPORT 0x70000000") cpp_quote("#define SCRIPTPROP_HACK_TRIDENTEVENTSINK 0x70000001") cpp_quote("#define SCRIPTPROP_ABBREVIATE_GLOBALNAME_RESOLUTION 0x70000002") - + +typedef enum tagSCRIPTLANGUAGEVERSION { + SCRIPTLANGUAGEVERSION_DEFAULT = 0, + SCRIPTLANGUAGEVERSION_5_7 = 1, + SCRIPTLANGUAGEVERSION_5_8 = 2, + SCRIPTLANGUAGEVERSION_MAX = 255 +} SCRIPTLANGUAGEVERSION; + typedef enum tagSCRIPTSTATE { SCRIPTSTATE_UNINITIALIZED = 0, SCRIPTSTATE_STARTED = 1, @@ -71,6 +78,11 @@ typedef enum tagSCRIPTUICHANDLING { SCRIPTUICHANDLING_NOUIDEFAULT = 2 } SCRIPTUICHANDLING; +typedef enum tagSCRIPTGCTYPE { + SCRIPTGCTYPE_NORMAL = 0, + SCRIPTGCTYPE_EXHAUSTIVE = 1 +} SCRIPTGCTYPE; + typedef DWORD SCRIPTTHREADID; cpp_quote("#define SCRIPTTHREADID_CURRENT ((SCRIPTTHREADID)-1)") cpp_quote("#define SCRIPTTHREADID_BASE ((SCRIPTTHREADID)-2)") @@ -101,6 +113,7 @@ cpp_quote(" SCRIPTTEXT_ISVISIBLE | \\") cpp_quote(" SCRIPTTEXT_ISEXPRESSION | \\") cpp_quote(" SCRIPTTEXT_ISPERSISTENT | \\") cpp_quote(" SCRIPTTEXT_HOSTMANAGESSOURCE)") +cpp_quote("#define SCRIPTPROC_ISEXPRESSION 0x00000020") cpp_quote("#define SCRIPTPROC_HOSTMANAGESSOURCE 0x00000080") cpp_quote("#define SCRIPTPROC_IMPLICIT_THIS 0x00000100") cpp_quote("#define SCRIPTPROC_IMPLICIT_PARENTS 0x00000200") @@ -551,3 +564,14 @@ interface IActiveScriptProperty : IUnknown [in] VARIANT *pvarIndex, [in] VARIANT *pvarValue); } + +[ + object, + uuid(6aa2c4a0-2b53-11d4-a2a0-00104bd35090), + pointer_default(unique) +] +interface IActiveScriptGarbageCollector : IUnknown +{ + HRESULT CollectGarbage( + [in] SCRIPTGCTYPE gctype); +}
5 years
1
0
0
0
[reactos] 01/01: [VBSCRIPT] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9a0ddc1388bb296ea8c7b…
commit 9a0ddc1388bb296ea8c7b97057b44428ad3b843e Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Dec 1 19:42:07 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Dec 1 19:42:07 2019 +0100 [VBSCRIPT] Sync with Wine Staging 4.18. CORE-16441 --- dll/win32/vbscript/compile.c | 108 +- dll/win32/vbscript/global.c | 1168 ++++++++++------ dll/win32/vbscript/interp.c | 138 +- dll/win32/vbscript/lex.c | 66 +- dll/win32/vbscript/parse.h | 13 +- dll/win32/vbscript/parser.tab.c | 2600 +++++++++++++++++++++--------------- dll/win32/vbscript/parser.tab.h | 149 ++- dll/win32/vbscript/parser.y | 169 ++- dll/win32/vbscript/regexp.c | 28 +- dll/win32/vbscript/vbdisp.c | 288 ++-- dll/win32/vbscript/vbregexp.c | 4 +- dll/win32/vbscript/vbscript.c | 281 ++-- dll/win32/vbscript/vbscript.h | 111 +- dll/win32/vbscript/vbscript.rc | 42 + dll/win32/vbscript/vbscript_defs.h | 37 + dll/win32/vbscript/vbscript_main.c | 64 +- media/doc/README.WINE | 2 +- 17 files changed, 3165 insertions(+), 2103 deletions(-) diff --git a/dll/win32/vbscript/compile.c b/dll/win32/vbscript/compile.c index 302804f4c28..c129f3670da 100644 --- a/dll/win32/vbscript/compile.c +++ b/dll/win32/vbscript/compile.c @@ -136,7 +136,7 @@ static WCHAR *compiler_alloc_string(vbscode_t *vbscode, const WCHAR *str) size_t size; WCHAR *ret; - size = (strlenW(str)+1)*sizeof(WCHAR); + size = (lstrlenW(str)+1)*sizeof(WCHAR); ret = compiler_alloc(vbscode, size); if(ret) memcpy(ret, str, size); @@ -375,12 +375,24 @@ static inline BOOL emit_catch(compile_ctx_t *ctx, unsigned off) return emit_catch_jmp(ctx, off, ctx->instr_cnt); } +static HRESULT compile_error(script_ctx_t *ctx, HRESULT error) +{ + if(error == SCRIPT_E_REPORTED) + return error; + + clear_ei(&ctx->ei); + ctx->ei.scode = error = map_hres(error); + ctx->ei.bstrSource = get_vbscript_string(VBS_COMPILE_ERROR); + ctx->ei.bstrDescription = get_vbscript_error_string(error); + return report_script_error(ctx); +} + static expression_t *lookup_const_decls(compile_ctx_t *ctx, const WCHAR *name, BOOL lookup_global) { const_decl_t *decl; for(decl = ctx->const_decls; decl; decl = decl->next) { - if(!strcmpiW(decl->name, name)) + if(!wcsicmp(decl->name, name)) return decl->value_expr; } @@ -388,7 +400,7 @@ static expression_t *lookup_const_decls(compile_ctx_t *ctx, const WCHAR *name, B return NULL; for(decl = ctx->global_consts; decl; decl = decl->next) { - if(!strcmpiW(decl->name, name)) + if(!wcsicmp(decl->name, name)) return decl->value_expr; } @@ -536,10 +548,8 @@ static HRESULT compile_expression(compile_ctx_t *ctx, expression_t *expr) return push_instr_str(ctx, OP_string, ((string_expression_t*)expr)->value); case EXPR_SUB: return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_sub); - case EXPR_USHORT: - return push_instr_int(ctx, OP_short, ((int_expression_t*)expr)->value); - case EXPR_ULONG: - return push_instr_int(ctx, OP_long, ((int_expression_t*)expr)->value); + case EXPR_INT: + return push_instr_int(ctx, OP_int, ((int_expression_t*)expr)->value); case EXPR_XOR: return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_xor); default: @@ -781,7 +791,7 @@ static HRESULT compile_forto_statement(compile_ctx_t *ctx, forto_statement_t *st if(!push_instr(ctx, OP_val)) return E_OUTOFMEMORY; }else { - hres = push_instr_int(ctx, OP_short, 1); + hres = push_instr_int(ctx, OP_int, 1); if(FAILED(hres)) return hres; } @@ -994,7 +1004,7 @@ static BOOL lookup_dim_decls(compile_ctx_t *ctx, const WCHAR *name) dim_decl_t *dim_decl; for(dim_decl = ctx->dim_decls; dim_decl; dim_decl = dim_decl->next) { - if(!strcmpiW(dim_decl->name, name)) + if(!wcsicmp(dim_decl->name, name)) return TRUE; } @@ -1006,7 +1016,7 @@ static BOOL lookup_args_name(compile_ctx_t *ctx, const WCHAR *name) unsigned i; for(i = 0; i < ctx->func->arg_cnt; i++) { - if(!strcmpiW(ctx->func->args[i].name, name)) + if(!wcsicmp(ctx->func->args[i].name, name)) return TRUE; } @@ -1198,6 +1208,21 @@ static HRESULT compile_onerror_statement(compile_ctx_t *ctx, onerror_statement_t return push_instr_int(ctx, OP_errmode, stat->resume_next); } +static HRESULT compile_retval_statement(compile_ctx_t *ctx, retval_statement_t *stat) +{ + HRESULT hres; + + hres = compile_expression(ctx, stat->expr); + if(FAILED(hres)) + return hres; + + hres = push_instr(ctx, OP_retval); + if(FAILED(hres)) + return hres; + + return S_OK; +} + static HRESULT compile_statement(compile_ctx_t *ctx, statement_ctx_t *stat_ctx, statement_t *stat) { HRESULT hres; @@ -1269,6 +1294,9 @@ static HRESULT compile_statement(compile_ctx_t *ctx, statement_ctx_t *stat_ctx, case STAT_WHILELOOP: hres = compile_while_statement(ctx, (while_statement_t*)stat); break; + case STAT_RETVAL: + hres = compile_retval_statement(ctx, (retval_statement_t*)stat); + break; default: FIXME("Unimplemented statement type %d\n", stat->type); hres = E_NOTIMPL; @@ -1444,7 +1472,7 @@ static BOOL lookup_funcs_name(compile_ctx_t *ctx, const WCHAR *name) function_t *iter; for(iter = ctx->funcs; iter; iter = iter->next) { - if(!strcmpiW(iter->name, name)) + if(!wcsicmp(iter->name, name)) return TRUE; } @@ -1511,7 +1539,7 @@ static BOOL lookup_class_name(compile_ctx_t *ctx, const WCHAR *name) class_desc_t *iter; for(iter = ctx->classes; iter; iter = iter->next) { - if(!strcmpiW(iter->name, name)) + if(!wcsicmp(iter->name, name)) return TRUE; } @@ -1563,7 +1591,7 @@ static BOOL lookup_class_funcs(class_desc_t *class_desc, const WCHAR *name) unsigned i; for(i=0; i < class_desc->func_cnt; i++) { - if(class_desc->funcs[i].name && !strcmpiW(class_desc->funcs[i].name, name)) + if(class_desc->funcs[i].name && !wcsicmp(class_desc->funcs[i].name, name)) return TRUE; } @@ -1619,14 +1647,14 @@ static HRESULT compile_class(compile_ctx_t *ctx, class_decl_t *class_decl) } } - if(!strcmpiW(class_initializeW, func_decl->name)) { + if(!wcsicmp(class_initializeW, func_decl->name)) { if(func_decl->type != FUNC_SUB) { FIXME("class initializer is not sub\n"); return E_FAIL; } class_desc->class_initialize_id = i; - }else if(!strcmpiW(class_terminateW, func_decl->name)) { + }else if(!wcsicmp(class_terminateW, func_decl->name)) { if(func_decl->type != FUNC_SUB) { FIXME("class terminator is not sub\n"); return E_FAIL; @@ -1690,17 +1718,17 @@ static BOOL lookup_script_identifier(script_ctx_t *script, const WCHAR *identifi function_t *func; for(var = script->global_vars; var; var = var->next) { - if(!strcmpiW(var->name, identifier)) + if(!wcsicmp(var->name, identifier)) return TRUE; } for(func = script->global_funcs; func; func = func->next) { - if(!strcmpiW(func->name, identifier)) + if(!wcsicmp(func->name, identifier)) return TRUE; } for(class = script->classes; class; class = class->next) { - if(!strcmpiW(class->name, identifier)) + if(!wcsicmp(class->name, identifier)) return TRUE; } @@ -1797,7 +1825,7 @@ static void release_compiler(compile_ctx_t *ctx) release_vbscode(ctx->code); } -HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *delimiter, vbscode_t **ret) +HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *delimiter, DWORD flags, vbscode_t **ret) { function_t *new_func; function_decl_t *func_decl; @@ -1806,13 +1834,15 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *deli vbscode_t *code; HRESULT hres; - hres = parse_script(&ctx.parser, src, delimiter); + if (!src) src = L""; + + hres = parse_script(&ctx.parser, src, delimiter, flags); if(FAILED(hres)) - return hres; + return compile_error(script, hres); code = ctx.code = alloc_vbscode(&ctx, src); if(!ctx.code) - return E_OUTOFMEMORY; + return compile_error(script, E_OUTOFMEMORY); ctx.funcs = NULL; ctx.func_decls = NULL; @@ -1826,7 +1856,7 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *deli hres = compile_func(&ctx, ctx.parser.stats, &ctx.code->main_code); if(FAILED(hres)) { release_compiler(&ctx); - return hres; + return compile_error(script, hres); } ctx.global_consts = ctx.const_decls; @@ -1835,7 +1865,7 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *deli hres = create_function(&ctx, func_decl, &new_func); if(FAILED(hres)) { release_compiler(&ctx); - return hres; + return compile_error(script, hres); } new_func->next = ctx.funcs; @@ -1846,14 +1876,14 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *deli hres = compile_class(&ctx, class_decl); if(FAILED(hres)) { release_compiler(&ctx); - return hres; + return compile_error(script, hres); } } hres = check_script_collisions(&ctx, script); if(FAILED(hres)) { release_compiler(&ctx); - return hres; + return compile_error(script, hres); } if(ctx.global_vars) { @@ -1896,3 +1926,29 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *deli *ret = code; return S_OK; } + +HRESULT compile_procedure(script_ctx_t *script, const WCHAR *src, const WCHAR *delimiter, DWORD flags, class_desc_t **ret) +{ + class_desc_t *desc; + vbscode_t *code; + HRESULT hres; + + hres = compile_script(script, src, delimiter, flags, &code); + if(FAILED(hres)) + return hres; + + if(!(desc = compiler_alloc_zero(code, sizeof(*desc)))) + return E_OUTOFMEMORY; + if(!(desc->funcs = compiler_alloc_zero(code, sizeof(*desc->funcs)))) + return E_OUTOFMEMORY; + + desc->ctx = script; + desc->func_cnt = 1; + desc->funcs->entries[VBDISP_CALLGET] = &code->main_code; + + desc->next = script->procs; + script->procs = desc; + + *ret = desc; + return S_OK; +} diff --git a/dll/win32/vbscript/global.c b/dll/win32/vbscript/global.c index 6d26b2c6a5c..db1f4c74405 100644 --- a/dll/win32/vbscript/global.c +++ b/dll/win32/vbscript/global.c @@ -29,6 +29,7 @@ #ifdef __REACTOS__ #include <wingdi.h> +#include <winnls.h> #endif WINE_DEFAULT_DEBUG_CHANNEL(vbscript); @@ -43,6 +44,252 @@ const GUID GUID_CUSTOM_CONFIRMOBJECTSAFETY = static const WCHAR emptyW[] = {0}; static const WCHAR vbscriptW[] = {'V','B','S','c','r','i','p','t',0}; +#define BP_GET 1 +#define BP_GETPUT 2 + +typedef struct { + UINT16 len; + WCHAR buf[7]; +} string_constant_t; + +struct _builtin_prop_t { + const WCHAR *name; + HRESULT (*proc)(BuiltinDisp*,VARIANT*,unsigned,VARIANT*); + DWORD flags; + unsigned min_args; + UINT_PTR max_args; +}; + +static inline BuiltinDisp *impl_from_IDispatch(IDispatch *iface) +{ + return CONTAINING_RECORD(iface, BuiltinDisp, IDispatch_iface); +} + +static HRESULT WINAPI Builtin_QueryInterface(IDispatch *iface, REFIID riid, void **ppv) +{ + BuiltinDisp *This = impl_from_IDispatch(iface); + + if(IsEqualGUID(&IID_IUnknown, riid)) { + TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); + *ppv = &This->IDispatch_iface; + }else if(IsEqualGUID(&IID_IDispatch, riid)) { + TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv); + *ppv = &This->IDispatch_iface; + }else { + WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI Builtin_AddRef(IDispatch *iface) +{ + BuiltinDisp *This = impl_from_IDispatch(iface); + LONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + return ref; +} + +static ULONG WINAPI Builtin_Release(IDispatch *iface) +{ + BuiltinDisp *This = impl_from_IDispatch(iface); + LONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + if(!ref) { + assert(!This->ctx); + heap_free(This); + } + + return ref; +} + +static HRESULT WINAPI Builtin_GetTypeInfoCount(IDispatch *iface, UINT *pctinfo) +{ + BuiltinDisp *This = impl_from_IDispatch(iface); + TRACE("(%p)->(%p)\n", This, pctinfo); + *pctinfo = 0; + return S_OK; +} + +static HRESULT WINAPI Builtin_GetTypeInfo(IDispatch *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) +{ + BuiltinDisp *This = impl_from_IDispatch(iface); + TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); + return DISP_E_BADINDEX; +} + +HRESULT get_builtin_id(BuiltinDisp *disp, const WCHAR *name, DISPID *id) +{ + size_t min = 1, max = disp->member_cnt - 1, i; + int r; + + while(min <= max) { + i = (min + max) / 2; + r = wcsicmp(disp->members[i].name, name); + if(!r) { + *id = i; + return S_OK; + } + if(r < 0) + min = i+1; + else + max = i-1; + } + + return DISP_E_MEMBERNOTFOUND; + +} + +static HRESULT WINAPI Builtin_GetIDsOfNames(IDispatch *iface, REFIID riid, LPOLESTR *names, UINT name_cnt, + LCID lcid, DISPID *ids) +{ + BuiltinDisp *This = impl_from_IDispatch(iface); + unsigned i; + HRESULT hres; + + TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), names, name_cnt, lcid, ids); + + if(!This->ctx) { + FIXME("NULL context\n"); + return E_UNEXPECTED; + } + + for(i = 0; i < name_cnt; i++) { + hres = get_builtin_id(This, names[i], &ids[i]); + if(FAILED(hres)) + return hres; + } + + return S_OK; +} + +static HRESULT WINAPI Builtin_Invoke(IDispatch *iface, DISPID id, REFIID riid, LCID lcid, WORD flags, + DISPPARAMS *dp, VARIANT *res, EXCEPINFO *ei, UINT *err) +{ + BuiltinDisp *This = impl_from_IDispatch(iface); + const builtin_prop_t *prop; + VARIANT args[8]; + unsigned argn, i; + + TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, id, debugstr_guid(riid), lcid, flags, dp, res, ei, err); + + if(!This->ctx) { + FIXME("NULL context\n"); + return E_UNEXPECTED; + } + + if(id >= This->member_cnt || (!This->members[id].proc && !This->members[id].flags)) + return DISP_E_MEMBERNOTFOUND; + prop = This->members + id; + + switch(flags) { + case DISPATCH_PROPERTYGET: + if(!(prop->flags & (BP_GET|BP_GETPUT))) { + FIXME("property does not support DISPATCH_PROPERTYGET\n"); + return E_FAIL; + } + break; + case DISPATCH_PROPERTYGET|DISPATCH_METHOD: + if(!prop->proc && prop->flags == BP_GET) { + const int vt = prop->min_args, val = prop->max_args; + switch(vt) { + case VT_I2: + V_VT(res) = VT_I2; + V_I2(res) = val; + break; + case VT_I4: + V_VT(res) = VT_I4; + V_I4(res) = val; + break; + case VT_BSTR: { + const string_constant_t *str = (const string_constant_t*)prop->max_args; + BSTR ret; + + ret = SysAllocStringLen(str->buf, str->len); + if(!ret) + return E_OUTOFMEMORY; + + V_VT(res) = VT_BSTR; + V_BSTR(res) = ret; + break; + } + DEFAULT_UNREACHABLE; + } + return S_OK; + } + break; + case DISPATCH_METHOD: + if(prop->flags & (BP_GET|BP_GETPUT)) { + FIXME("Call on property\n"); + return E_FAIL; + } + break; + case DISPATCH_PROPERTYPUT: + if(!(prop->flags & BP_GETPUT)) { + FIXME("property does not support DISPATCH_PROPERTYPUT\n"); + return E_FAIL; + } + + FIXME("call put\n"); + return E_NOTIMPL; + default: + FIXME("unsupported flags %x\n", flags); + return E_NOTIMPL; + } + + argn = arg_cnt(dp); + + if(argn < prop->min_args || argn > (prop->max_args ? prop->max_args : prop->min_args)) { + WARN("invalid number of arguments\n"); + return MAKE_VBSERROR(VBSE_FUNC_ARITY_MISMATCH); + } + + assert(argn < ARRAY_SIZE(args)); + + for(i=0; i < argn; i++) { + if(V_VT(dp->rgvarg+dp->cArgs-i-1) == (VT_BYREF|VT_VARIANT)) + args[i] = *V_VARIANTREF(dp->rgvarg+dp->cArgs-i-1); + else + args[i] = dp->rgvarg[dp->cArgs-i-1]; + } + + return prop->proc(This, args, dp->cArgs, res); +} + +static const IDispatchVtbl BuiltinDispVtbl = { + Builtin_QueryInterface, + Builtin_AddRef, + Builtin_Release, + Builtin_GetTypeInfoCount, + Builtin_GetTypeInfo, + Builtin_GetIDsOfNames, + Builtin_Invoke +}; + +static HRESULT create_builtin_dispatch(script_ctx_t *ctx, const builtin_prop_t *members, size_t member_cnt, BuiltinDisp **ret) +{ + BuiltinDisp *disp; + + if(!(disp = heap_alloc(sizeof(*disp)))) + return E_OUTOFMEMORY; + + disp->IDispatch_iface.lpVtbl = &BuiltinDispVtbl; + disp->ref = 1; + disp->members = members; + disp->member_cnt = member_cnt; + disp->ctx = ctx; + + *ret = disp; + return S_OK; +} + static IInternetHostSecurityManager *get_sec_mgr(script_ctx_t *ctx) { IInternetHostSecurityManager *secmgr; @@ -202,6 +449,19 @@ static HRESULT to_string(VARIANT *v, BSTR *ret) return S_OK; } +static HRESULT to_system_time(VARIANT *v, SYSTEMTIME *st) +{ + VARIANT date; + HRESULT hres; + + V_VT(&date) = VT_EMPTY; + hres = VariantChangeType(&date, v, 0, VT_DATE); + if(FAILED(hres)) + return hres; + + return VariantTimeToSystemTime(V_DATE(&date), st); +} + static HRESULT set_object_site(script_ctx_t *ctx, IUnknown *obj) { IObjectWithSite *obj_site; @@ -333,7 +593,7 @@ static HRESULT show_msgbox(script_ctx_t *ctx, BSTR prompt, unsigned type, BSTR o if(orig_title && *orig_title) { WCHAR *ptr; - title = title_buf = heap_alloc(sizeof(vbscriptW) + (strlenW(orig_title)+2)*sizeof(WCHAR)); + title = title_buf = heap_alloc(sizeof(vbscriptW) + (lstrlenW(orig_title)+2)*sizeof(WCHAR)); if(!title) return E_OUTOFMEMORY; @@ -342,7 +602,7 @@ static HRESULT show_msgbox(script_ctx_t *ctx, BSTR prompt, unsigned type, BSTR o *ptr++ = ':'; *ptr++ = ' '; - strcpyW(ptr, orig_title); + lstrcpyW(ptr, orig_title); }else { title = vbscriptW; } @@ -369,7 +629,7 @@ static HRESULT show_msgbox(script_ctx_t *ctx, BSTR prompt, unsigned type, BSTR o return return_short(res, ret); } -static HRESULT Global_CCur(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_CCur(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { VARIANT v; HRESULT hres; @@ -392,7 +652,7 @@ static HRESULT Global_CCur(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI return S_OK; } -static HRESULT Global_CInt(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_CInt(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { VARIANT v; HRESULT hres; @@ -414,7 +674,7 @@ static HRESULT Global_CInt(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI } } -static HRESULT Global_CLng(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_CLng(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { int i; HRESULT hres; @@ -432,7 +692,7 @@ static HRESULT Global_CLng(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI return return_int(res, i); } -static HRESULT Global_CBool(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_CBool(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { VARIANT v; HRESULT hres; @@ -453,7 +713,7 @@ static HRESULT Global_CBool(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR return S_OK; } -static HRESULT Global_CByte(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_CByte(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { VARIANT v; HRESULT hres; @@ -476,13 +736,13 @@ static HRESULT Global_CByte(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR return S_OK; } -static HRESULT Global_CDate(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_CDate(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_CDbl(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_CDbl(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { VARIANT v; HRESULT hres; @@ -504,7 +764,7 @@ static HRESULT Global_CDbl(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI } } -static HRESULT Global_CSng(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_CSng(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { VARIANT v; HRESULT hres; @@ -525,13 +785,16 @@ static HRESULT Global_CSng(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI return S_OK; } -static HRESULT Global_CStr(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_CStr(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { BSTR str; HRESULT hres; TRACE("%s\n", debugstr_variant(arg)); + if(V_VT(arg) == VT_NULL) + return MAKE_VBSERROR(VBSE_ILLEGAL_NULL_USE); + hres = to_string(arg, &str); if(FAILED(hres)) return hres; @@ -544,7 +807,7 @@ static inline WCHAR hex_char(unsigned n) return n < 10 ? '0'+n : 'A'+n-10; } -static HRESULT Global_Hex(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Hex(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { WCHAR buf[17], *ptr; DWORD n; @@ -585,7 +848,7 @@ static HRESULT Global_Hex(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_string(res, ptr); } -static HRESULT Global_Oct(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Oct(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; WCHAR buf[23], *ptr; @@ -626,27 +889,30 @@ static HRESULT Global_Oct(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_string(res, ptr); } -static HRESULT Global_VarType(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_VarType(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { + VARTYPE vt; + TRACE("(%s)\n", debugstr_variant(arg)); assert(args_cnt == 1); - if(V_VT(arg) & ~VT_TYPEMASK) { + vt = V_VT(arg) & ~VT_BYREF; + if(vt & ~(VT_TYPEMASK | VT_ARRAY)) { FIXME("not supported %s\n", debugstr_variant(arg)); return E_NOTIMPL; } - return return_short(res, V_VT(arg)); + return return_short(res, vt); } -static HRESULT Global_IsDate(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_IsDate(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_IsEmpty(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_IsEmpty(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { TRACE("(%s)\n", debugstr_variant(arg)); @@ -659,7 +925,7 @@ static HRESULT Global_IsEmpty(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, V return S_OK; } -static HRESULT Global_IsNull(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_IsNull(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { TRACE("(%s)\n", debugstr_variant(arg)); @@ -672,7 +938,7 @@ static HRESULT Global_IsNull(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VA return S_OK; } -static HRESULT Global_IsNumeric(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_IsNumeric(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; double d; @@ -686,13 +952,13 @@ static HRESULT Global_IsNumeric(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, return return_bool(res, SUCCEEDED(hres)); } -static HRESULT Global_IsArray(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_IsArray(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_IsObject(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_IsObject(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { TRACE("(%s)\n", debugstr_variant(arg)); @@ -705,7 +971,7 @@ static HRESULT Global_IsObject(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, return S_OK; } -static HRESULT Global_Atn(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Atn(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; double d; @@ -717,7 +983,7 @@ static HRESULT Global_Atn(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_double(res, atan(d)); } -static HRESULT Global_Cos(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Cos(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; double d; @@ -729,7 +995,7 @@ static HRESULT Global_Cos(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_double(res, cos(d)); } -static HRESULT Global_Sin(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Sin(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; double d; @@ -741,7 +1007,7 @@ static HRESULT Global_Sin(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_double(res, sin(d)); } -static HRESULT Global_Tan(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Tan(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; double d; @@ -753,7 +1019,7 @@ static HRESULT Global_Tan(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_double(res, tan(d)); } -static HRESULT Global_Exp(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Exp(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; double d; @@ -765,7 +1031,7 @@ static HRESULT Global_Exp(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_double(res, exp(d)); } -static HRESULT Global_Log(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Log(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; double d; @@ -780,7 +1046,7 @@ static HRESULT Global_Log(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_double(res, log(d)); } -static HRESULT Global_Sqr(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Sqr(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; double d; @@ -795,19 +1061,19 @@ static HRESULT Global_Sqr(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_double(res, sqrt(d)); } -static HRESULT Global_Randomize(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Randomize(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_Rnd(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Rnd(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_Timer(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Timer(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { SYSTEMTIME lt; double sec; @@ -818,13 +1084,13 @@ static HRESULT Global_Timer(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR } -static HRESULT Global_LBound(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_LBound(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_UBound(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_UBound(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { SAFEARRAY *sa; HRESULT hres; @@ -862,7 +1128,7 @@ static HRESULT Global_UBound(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VA return return_int(res, ubound); } -static HRESULT Global_RGB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_RGB(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; int i, color[3]; @@ -884,7 +1150,7 @@ static HRESULT Global_RGB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_int(res, RGB(color[0], color[1], color[2])); } -static HRESULT Global_Len(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Len(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { DWORD len; HRESULT hres; @@ -910,13 +1176,13 @@ static HRESULT Global_Len(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_int(res, len); } -static HRESULT Global_LenB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_LenB(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_Left(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Left(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { BSTR str, ret, conv_str = NULL; int len, str_len; @@ -954,13 +1220,13 @@ static HRESULT Global_Left(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VAR return return_bstr(res, ret); } -static HRESULT Global_LeftB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_LeftB(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_Right(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Right(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { BSTR str, ret, conv_str = NULL; int len, str_len; @@ -998,13 +1264,13 @@ static HRESULT Global_Right(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VA return return_bstr(res, ret); } -static HRESULT Global_RightB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_RightB(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_Mid(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Mid(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { int len = -1, start, str_len; BSTR str; @@ -1057,13 +1323,13 @@ static HRESULT Global_Mid(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARI return S_OK; } -static HRESULT Global_MidB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_MidB(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_StrComp(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Global_StrComp(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { BSTR left, right; int mode, ret; @@ -1098,7 +1364,7 @@ static HRESULT Global_StrComp(vbdisp_t *This, VARIANT *args, unsigned args_cnt, return hres; } - ret = mode ? strcmpiW(left, right) : strcmpW(left, right); + ret = mode ? wcsicmp(left, right) : wcscmp(left, right); val = ret < 0 ? -1 : (ret > 0 ? 1 : 0); SysFreeString(left); @@ -1106,7 +1372,7 @@ static HRESULT Global_StrComp(vbdisp_t *This, VARIANT *args, unsigned args_cnt, return return_short(res, val); } -static HRESULT Global_LCase(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_LCase(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { BSTR str; HRESULT hres; @@ -1127,7 +1393,7 @@ static HRESULT Global_LCase(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR WCHAR *ptr; for(ptr = str; *ptr; ptr++) - *ptr = tolowerW(*ptr); + *ptr = towlower(*ptr); V_VT(res) = VT_BSTR; V_BSTR(res) = str; @@ -1137,7 +1403,7 @@ static HRESULT Global_LCase(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR return S_OK; } -static HRESULT Global_UCase(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_UCase(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { BSTR str; HRESULT hres; @@ -1158,7 +1424,7 @@ static HRESULT Global_UCase(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR WCHAR *ptr; for(ptr = str; *ptr; ptr++) - *ptr = toupperW(*ptr); + *ptr = towupper(*ptr); V_VT(res) = VT_BSTR; V_BSTR(res) = str; @@ -1168,7 +1434,7 @@ static HRESULT Global_UCase(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR return S_OK; } -static HRESULT Global_LTrim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_LTrim(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { BSTR str, conv_str = NULL; WCHAR *ptr; @@ -1185,7 +1451,7 @@ static HRESULT Global_LTrim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR str = conv_str; } - for(ptr = str; *ptr && isspaceW(*ptr); ptr++); + for(ptr = str; *ptr && iswspace(*ptr); ptr++); str = SysAllocString(ptr); SysFreeString(conv_str); @@ -1195,7 +1461,7 @@ static HRESULT Global_LTrim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR return return_bstr(res, str); } -static HRESULT Global_RTrim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_RTrim(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { BSTR str, conv_str = NULL; WCHAR *ptr; @@ -1212,7 +1478,7 @@ static HRESULT Global_RTrim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR str = conv_str; } - for(ptr = str+SysStringLen(str); ptr-1 > str && isspaceW(*(ptr-1)); ptr--); + for(ptr = str+SysStringLen(str); ptr-1 > str && iswspace(*(ptr-1)); ptr--); str = SysAllocStringLen(str, ptr-str); SysFreeString(conv_str); @@ -1222,7 +1488,7 @@ static HRESULT Global_RTrim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR return return_bstr(res, str); } -static HRESULT Global_Trim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Trim(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { BSTR str, conv_str = NULL; WCHAR *begin_ptr, *end_ptr; @@ -1239,8 +1505,8 @@ static HRESULT Global_Trim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI str = conv_str; } - for(begin_ptr = str; *begin_ptr && isspaceW(*begin_ptr); begin_ptr++); - for(end_ptr = str+SysStringLen(str); end_ptr-1 > begin_ptr && isspaceW(*(end_ptr-1)); end_ptr--); + for(begin_ptr = str; *begin_ptr && iswspace(*begin_ptr); begin_ptr++); + for(end_ptr = str+SysStringLen(str); end_ptr-1 > begin_ptr && iswspace(*(end_ptr-1)); end_ptr--); str = SysAllocStringLen(begin_ptr, end_ptr-begin_ptr); SysFreeString(conv_str); @@ -1250,7 +1516,7 @@ static HRESULT Global_Trim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI return return_bstr(res, str); } -static HRESULT Global_Space(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Space(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { BSTR str; int n, i; @@ -1282,13 +1548,13 @@ static HRESULT Global_Space(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR return S_OK; } -static HRESULT Global_String(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_String(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_InStr(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Global_InStr(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { VARIANT *startv, *str1v, *str2v; BSTR str1, str2; @@ -1346,7 +1612,7 @@ static HRESULT Global_InStr(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VA if(start < SysStringLen(str1)) { WCHAR *ptr; - ptr = strstrW(str1+start, str2); + ptr = wcsstr(str1+start, str2); ret = ptr ? ptr-str1+1 : 0; }else { ret = 0; @@ -1355,34 +1621,58 @@ static HRESULT Global_InStr(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VA return return_int(res, ret); } -static HRESULT Global_InStrB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_InStrB(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_AscB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_AscB(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_ChrB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_ChrB(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_Asc(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Asc(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + BSTR conv_str = NULL, str; + HRESULT hres = S_OK; + + TRACE("(%s)\n", debugstr_variant(arg)); + + switch(V_VT(arg)) { + case VT_NULL: + return MAKE_VBSERROR(VBSE_ILLEGAL_NULL_USE); + case VT_EMPTY: + return MAKE_VBSERROR(VBSE_ILLEGAL_FUNC_CALL); + case VT_BSTR: + str = V_BSTR(arg); + break; + default: + hres = to_string(arg, &conv_str); + if(FAILED(hres)) + return hres; + str = conv_str; + } + + if(!SysStringLen(str) || *str >= 0x100) + hres = MAKE_VBSERROR(VBSE_ILLEGAL_FUNC_CALL); + else if(res) + hres = return_short(res, *str); + SysFreeString(conv_str); + return hres; } /* The function supports only single-byte and double-byte character sets. It * ignores language specified by IActiveScriptSite::GetLCID. The argument needs * to be in range of short or unsigned short. */ -static HRESULT Global_Chr(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Chr(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { int cp, c, len = 0; CPINFO cpi; @@ -1424,19 +1714,19 @@ static HRESULT Global_Chr(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return S_OK; } -static HRESULT Global_AscW(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_AscW(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_ChrW(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_ChrW(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_Abs(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Abs(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; VARIANT dst; @@ -1457,7 +1747,7 @@ static HRESULT Global_Abs(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return S_OK; } -static HRESULT Global_Fix(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Fix(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; VARIANT dst; @@ -1478,7 +1768,7 @@ static HRESULT Global_Fix(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return S_OK; } -static HRESULT Global_Int(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Int(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { HRESULT hres; VARIANT dst; @@ -1499,7 +1789,7 @@ static HRESULT Global_Int(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return S_OK; } -static HRESULT Global_Sgn(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Sgn(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { double v; short val; @@ -1520,7 +1810,7 @@ static HRESULT Global_Sgn(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_short(res, val); } -static HRESULT Global_Now(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Now(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { SYSTEMTIME lt; double date; @@ -1532,7 +1822,7 @@ static HRESULT Global_Now(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA return return_date(res, date); } -static HRESULT Global_Date(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Date(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { SYSTEMTIME lt; UDATE ud; @@ -1550,7 +1840,7 @@ static HRESULT Global_Date(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI return return_date(res, date); } -static HRESULT Global_Time(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Time(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { SYSTEMTIME lt; UDATE ud; @@ -1568,79 +1858,109 @@ static HRESULT Global_Time(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI return return_date(res, time); } -static HRESULT Global_Day(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Day(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + SYSTEMTIME st; + HRESULT hres; + + TRACE("(%s)\n", debugstr_variant(arg)); + + hres = to_system_time(arg, &st); + return FAILED(hres) ? hres : return_short(res, st.wDay); } -static HRESULT Global_Month(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Month(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + SYSTEMTIME st; + HRESULT hres; + + TRACE("(%s)\n", debugstr_variant(arg)); + + hres = to_system_time(arg, &st); + return FAILED(hres) ? hres : return_short(res, st.wMonth); } -static HRESULT Global_Weekday(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Weekday(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_Year(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Year(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + SYSTEMTIME st; + HRESULT hres; + + TRACE("(%s)\n", debugstr_variant(arg)); + + hres = to_system_time(arg, &st); + return FAILED(hres) ? hres : return_short(res, st.wYear); } -static HRESULT Global_Hour(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Hour(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + SYSTEMTIME st; + HRESULT hres; + + TRACE("(%s)\n", debugstr_variant(arg)); + + hres = to_system_time(arg, &st); + return FAILED(hres) ? hres : return_short(res, st.wHour); } -static HRESULT Global_Minute(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Minute(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + SYSTEMTIME st; + HRESULT hres; + + TRACE("(%s)\n", debugstr_variant(arg)); + + hres = to_system_time(arg, &st); + return FAILED(hres) ? hres : return_short(res, st.wMinute); } -static HRESULT Global_Second(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Second(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + SYSTEMTIME st; + HRESULT hres; + + TRACE("(%s)\n", debugstr_variant(arg)); + + hres = to_system_time(arg, &st); + return FAILED(hres) ? hres : return_short(res, st.wSecond); } -static HRESULT Global_DateValue(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_DateValue(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_TimeValue(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_TimeValue(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_DateSerial(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_DateSerial(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_TimeSerial(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_TimeSerial(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_InputBox(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_InputBox(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_MsgBox(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Global_MsgBox(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { BSTR prompt, title = NULL; int type = MB_OK; @@ -1666,14 +1986,14 @@ static HRESULT Global_MsgBox(vbdisp_t *This, VARIANT *args, unsigned args_cnt, V } if(SUCCEEDED(hres)) - hres = show_msgbox(This->desc->ctx, prompt, type, title, res); + hres = show_msgbox(This->ctx, prompt, type, title, res); SysFreeString(prompt); SysFreeString(title); return hres; } -static HRESULT Global_CreateObject(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_CreateObject(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { IUnknown *obj; HRESULT hres; @@ -1685,7 +2005,7 @@ static HRESULT Global_CreateObject(vbdisp_t *This, VARIANT *arg, unsigned args_c return E_INVALIDARG; } - obj = create_object(This->desc->ctx, V_BSTR(arg)); + obj = create_object(This->ctx, V_BSTR(arg)); if(!obj) return VB_E_CANNOT_CREATE_OBJ; @@ -1701,7 +2021,7 @@ static HRESULT Global_CreateObject(vbdisp_t *This, VARIANT *arg, unsigned args_c return S_OK; } -static HRESULT Global_GetObject(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Global_GetObject(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { IBindCtx *bind_ctx; IUnknown *obj_unk; @@ -1717,7 +2037,7 @@ static HRESULT Global_GetObject(vbdisp_t *This, VARIANT *args, unsigned args_cnt return E_NOTIMPL; } - if(This->desc->ctx->safeopt & (INTERFACE_USES_SECURITY_MANAGER|INTERFACESAFE_FOR_UNTRUSTED_DATA)) { + if(This->ctx->safeopt & (INTERFACE_USES_SECURITY_MANAGER|INTERFACESAFE_FOR_UNTRUSTED_DATA)) { WARN("blocked in current safety mode\n"); return VB_E_CANNOT_CREATE_OBJ; } @@ -1737,7 +2057,7 @@ static HRESULT Global_GetObject(vbdisp_t *This, VARIANT *args, unsigned args_cnt if(FAILED(hres)) return hres; - hres = set_object_site(This->desc->ctx, obj_unk); + hres = set_object_site(This->ctx, obj_unk); if(FAILED(hres)) { IUnknown_Release(obj_unk); return hres; @@ -1758,25 +2078,25 @@ static HRESULT Global_GetObject(vbdisp_t *This, VARIANT *args, unsigned args_cnt return hres; } -static HRESULT Global_DateAdd(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_DateAdd(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_DateDiff(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_DateDiff(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_DatePart(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_DatePart(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_TypeName(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_TypeName(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { static const WCHAR ByteW[] = {'B', 'y', 't', 'e', 0}; static const WCHAR IntegerW[] = {'I', 'n', 't', 'e', 'g', 'e', 'r', 0}; @@ -1826,7 +2146,7 @@ static HRESULT Global_TypeName(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, } } -static HRESULT Global_Array(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Array(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { SAFEARRAYBOUND bounds; SAFEARRAY *sa; @@ -1868,37 +2188,37 @@ static HRESULT Global_Array(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR return S_OK; } -static HRESULT Global_Erase(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Erase(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_Filter(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Filter(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_Join(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Join(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_Split(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Split(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_Replace(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Replace(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_StrReverse(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_StrReverse(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { WCHAR *ptr1, *ptr2, ch; BSTR ret; @@ -1921,7 +2241,7 @@ static HRESULT Global_StrReverse(vbdisp_t *This, VARIANT *arg, unsigned args_cnt return return_bstr(res, ret); } -static HRESULT Global_InStrRev(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Global_InStrRev(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { int start, ret = 0; BSTR str1, str2; @@ -1981,13 +2301,13 @@ static HRESULT Global_InStrRev(vbdisp_t *This, VARIANT *args, unsigned args_cnt, return return_int(res, ret); } -static HRESULT Global_LoadPicture(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_LoadPicture(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_ScriptEngine(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_ScriptEngine(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { TRACE("%s\n", debugstr_variant(arg)); @@ -1996,7 +2316,7 @@ static HRESULT Global_ScriptEngine(vbdisp_t *This, VARIANT *arg, unsigned args_c return return_string(res, vbscriptW); } -static HRESULT Global_ScriptEngineMajorVersion(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_ScriptEngineMajorVersion(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { TRACE("%s\n", debugstr_variant(arg)); @@ -2005,7 +2325,7 @@ static HRESULT Global_ScriptEngineMajorVersion(vbdisp_t *This, VARIANT *arg, uns return return_int(res, VBSCRIPT_MAJOR_VERSION); } -static HRESULT Global_ScriptEngineMinorVersion(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_ScriptEngineMinorVersion(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { TRACE("%s\n", debugstr_variant(arg)); @@ -2014,7 +2334,7 @@ static HRESULT Global_ScriptEngineMinorVersion(vbdisp_t *This, VARIANT *arg, uns return return_int(res, VBSCRIPT_MINOR_VERSION); } -static HRESULT Global_ScriptEngineBuildVersion(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_ScriptEngineBuildVersion(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { TRACE("%s\n", debugstr_variant(arg)); @@ -2023,31 +2343,31 @@ static HRESULT Global_ScriptEngineBuildVersion(vbdisp_t *This, VARIANT *arg, uns return return_int(res, VBSCRIPT_BUILD_VERSION); } -static HRESULT Global_FormatNumber(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_FormatNumber(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_FormatCurrency(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_FormatCurrency(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_FormatPercent(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_FormatPercent(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_FormatDateTime(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_FormatDateTime(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_WeekdayName(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Global_WeekdayName(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { int weekday, first_day = 1, abbrev = 0; BSTR ret; @@ -2080,7 +2400,7 @@ static HRESULT Global_WeekdayName(vbdisp_t *This, VARIANT *args, unsigned args_c return return_bstr(res, ret); } -static HRESULT Global_MonthName(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Global_MonthName(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { int month, abbrev = 0; BSTR ret; @@ -2107,7 +2427,7 @@ static HRESULT Global_MonthName(vbdisp_t *This, VARIANT *args, unsigned args_cnt return return_bstr(res, ret); } -static HRESULT Global_Round(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Round(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { double n; HRESULT hres; @@ -2135,42 +2455,57 @@ static HRESULT Global_Round(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR return return_double(res, round(n)); } -static HRESULT Global_Escape(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Escape(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_Unescape(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Unescape(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_Eval(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Eval(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_Execute(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_Execute(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_ExecuteGlobal(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_ExecuteGlobal(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT Global_GetRef(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +static HRESULT Global_GetRef(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { FIXME("\n"); return E_NOTIMPL; } +static HRESULT Global_Err(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) +{ + TRACE("\n"); + + if(args_cnt) { + FIXME("Setter not supported\n"); + return E_NOTIMPL; + } + + V_VT(res) = VT_DISPATCH; + V_DISPATCH(res) = &This->ctx->err_obj->IDispatch_iface; + IDispatch_AddRef(V_DISPATCH(res)); + return S_OK; +} + static const string_constant_t vbCr = {1, {'\r'}}; static const string_constant_t vbCrLf = {2, {'\r','\n'}}; static const string_constant_t vbNewLine = {2, {'\r','\n'}}; @@ -2182,296 +2517,363 @@ static const string_constant_t vbTab = {1, {'\t'}}; static const string_constant_t vbVerticalTab = {1, {0xb}}; static const builtin_prop_t global_props[] = { - {DISPID_GLOBAL_VBUSESYSTEM, NULL, BP_GET, VT_I2, 0}, - {DISPID_GLOBAL_USESYSTEMDAYOFWEEK, NULL, BP_GET, VT_I2, 0}, - {DISPID_GLOBAL_VBSUNDAY, NULL, BP_GET, VT_I2, 1}, - {DISPID_GLOBAL_VBMONDAY, NULL, BP_GET, VT_I2, 2}, - {DISPID_GLOBAL_VBTUESDAY, NULL, BP_GET, VT_I2, 3}, - {DISPID_GLOBAL_VBWEDNESDAY, NULL, BP_GET, VT_I2, 4}, - {DISPID_GLOBAL_VBTHURSDAY, NULL, BP_GET, VT_I2, 5}, - {DISPID_GLOBAL_VBFRIDAY, NULL, BP_GET, VT_I2, 6}, - {DISPID_GLOBAL_VBSATURDAY, NULL, BP_GET, VT_I2, 7}, - {DISPID_GLOBAL_VBFIRSTJAN1, NULL, BP_GET, VT_I2, 1}, - {DISPID_GLOBAL_VBFIRSTFOURDAYS, NULL, BP_GET, VT_I2, 2}, - {DISPID_GLOBAL_VBFIRSTFULLWEEK, NULL, BP_GET, VT_I2, 3}, - {DISPID_GLOBAL_VBOKONLY, NULL, BP_GET, VT_I2, MB_OK}, - {DISPID_GLOBAL_VBOKCANCEL, NULL, BP_GET, VT_I2, MB_OKCANCEL}, - {DISPID_GLOBAL_VBABORTRETRYIGNORE, NULL, BP_GET, VT_I2, MB_ABORTRETRYIGNORE}, - {DISPID_GLOBAL_VBYESNOCANCEL, NULL, BP_GET, VT_I2, MB_YESNOCANCEL}, - {DISPID_GLOBAL_VBYESNO, NULL, BP_GET, VT_I2, MB_YESNO}, - {DISPID_GLOBAL_VBRETRYCANCEL, NULL, BP_GET, VT_I2, MB_RETRYCANCEL}, - {DISPID_GLOBAL_VBCRITICAL, NULL, BP_GET, VT_I2, MB_ICONHAND}, - {DISPID_GLOBAL_VBQUESTION, NULL, BP_GET, VT_I2, MB_ICONQUESTION}, - {DISPID_GLOBAL_VBEXCLAMATION, NULL, BP_GET, VT_I2, MB_ICONEXCLAMATION}, - {DISPID_GLOBAL_VBINFORMATION, NULL, BP_GET, VT_I2, MB_ICONASTERISK}, - {DISPID_GLOBAL_VBDEFAULTBUTTON1, NULL, BP_GET, VT_I2, MB_DEFBUTTON1}, - {DISPID_GLOBAL_VBDEFAULTBUTTON2, NULL, BP_GET, VT_I2, MB_DEFBUTTON2}, - {DISPID_GLOBAL_VBDEFAULTBUTTON3, NULL, BP_GET, VT_I2, MB_DEFBUTTON3}, - {DISPID_GLOBAL_VBDEFAULTBUTTON4, NULL, BP_GET, VT_I2, MB_DEFBUTTON4}, - {DISPID_GLOBAL_VBAPPLICATIONMODAL, NULL, BP_GET, VT_I2, MB_APPLMODAL}, - {DISPID_GLOBAL_VBSYSTEMMODAL, NULL, BP_GET, VT_I2, MB_SYSTEMMODAL}, - {DISPID_GLOBAL_VBOK, NULL, BP_GET, VT_I2, IDOK}, - {DISPID_GLOBAL_VBCANCEL, NULL, BP_GET, VT_I2, IDCANCEL}, - {DISPID_GLOBAL_VBABORT, NULL, BP_GET, VT_I2, IDABORT}, - {DISPID_GLOBAL_VBRETRY, NULL, BP_GET, VT_I2, IDRETRY}, - {DISPID_GLOBAL_VBIGNORE, NULL, BP_GET, VT_I2, IDIGNORE}, - {DISPID_GLOBAL_VBYES, NULL, BP_GET, VT_I2, IDYES}, - {DISPID_GLOBAL_VBNO, NULL, BP_GET, VT_I2, IDNO}, - {DISPID_GLOBAL_VBEMPTY, NULL, BP_GET, VT_I2, VT_EMPTY}, - {DISPID_GLOBAL_VBNULL, NULL, BP_GET, VT_I2, VT_NULL}, - {DISPID_GLOBAL_VBINTEGER, NULL, BP_GET, VT_I2, VT_I2}, - {DISPID_GLOBAL_VBLONG, NULL, BP_GET, VT_I2, VT_I4}, - {DISPID_GLOBAL_VBSINGLE, NULL, BP_GET, VT_I2, VT_R4}, - {DISPID_GLOBAL_VBDOUBLE, NULL, BP_GET, VT_I2, VT_R8}, - {DISPID_GLOBAL_VBCURRENCY, NULL, BP_GET, VT_I2, VT_CY}, - {DISPID_GLOBAL_VBDATE, NULL, BP_GET, VT_I2, VT_DATE}, - {DISPID_GLOBAL_VBSTRING, NULL, BP_GET, VT_I2, VT_BSTR}, - {DISPID_GLOBAL_VBOBJECT, NULL, BP_GET, VT_I2, VT_DISPATCH}, - {DISPID_GLOBAL_VBERROR, NULL, BP_GET, VT_I2, VT_ERROR}, - {DISPID_GLOBAL_VBBOOLEAN, NULL, BP_GET, VT_I2, VT_BOOL}, - {DISPID_GLOBAL_VBVARIANT, NULL, BP_GET, VT_I2, VT_VARIANT}, - {DISPID_GLOBAL_VBDATAOBJECT, NULL, BP_GET, VT_I2, VT_UNKNOWN}, - {DISPID_GLOBAL_VBDECIMAL, NULL, BP_GET, VT_I2, VT_DECIMAL}, - {DISPID_GLOBAL_VBBYTE, NULL, BP_GET, VT_I2, VT_UI1}, - {DISPID_GLOBAL_VBARRAY, NULL, BP_GET, VT_I2, VT_ARRAY}, - {DISPID_GLOBAL_VBTRUE, NULL, BP_GET, VT_I2, VARIANT_TRUE}, - {DISPID_GLOBAL_VBFALSE, NULL, BP_GET, VT_I2, VARIANT_FALSE}, - {DISPID_GLOBAL_VBUSEDEFAULT, NULL, BP_GET, VT_I2, -2}, - {DISPID_GLOBAL_VBBINARYCOMPARE, NULL, BP_GET, VT_I2, 0}, - {DISPID_GLOBAL_VBTEXTCOMPARE, NULL, BP_GET, VT_I2, 1}, - {DISPID_GLOBAL_VBDATABASECOMPARE, NULL, BP_GET, VT_I2, 2}, - {DISPID_GLOBAL_VBGENERALDATE, NULL, BP_GET, VT_I2, 0}, - {DISPID_GLOBAL_VBLONGDATE, NULL, BP_GET, VT_I2, 1}, - {DISPID_GLOBAL_VBSHORTDATE, NULL, BP_GET, VT_I2, 2}, - {DISPID_GLOBAL_VBLONGTIME, NULL, BP_GET, VT_I2, 3}, - {DISPID_GLOBAL_VBSHORTTIME, NULL, BP_GET, VT_I2, 4}, - {DISPID_GLOBAL_VBOBJECTERROR, NULL, BP_GET, VT_I4, 0x80040000}, - {DISPID_GLOBAL_VBBLACK, NULL, BP_GET, VT_I4, 0x000000}, - {DISPID_GLOBAL_VBBLUE, NULL, BP_GET, VT_I4, 0xff0000}, - {DISPID_GLOBAL_VBCYAN, NULL, BP_GET, VT_I4, 0xffff00}, - {DISPID_GLOBAL_VBGREEN, NULL, BP_GET, VT_I4, 0x00ff00}, - {DISPID_GLOBAL_VBMAGENTA, NULL, BP_GET, VT_I4, 0xff00ff}, - {DISPID_GLOBAL_VBRED, NULL, BP_GET, VT_I4, 0x0000ff}, - {DISPID_GLOBAL_VBWHITE, NULL, BP_GET, VT_I4, 0xffffff}, - {DISPID_GLOBAL_VBYELLOW, NULL, BP_GET, VT_I4, 0x00ffff}, - {DISPID_GLOBAL_VBCR, NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbCr}, - {DISPID_GLOBAL_VBCRLF, NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbCrLf}, - {DISPID_GLOBAL_VBNEWLINE, NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbNewLine}, - {DISPID_GLOBAL_VBFORMFEED, NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbFormFeed}, - {DISPID_GLOBAL_VBLF, NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbLf}, - {DISPID_GLOBAL_VBNULLCHAR, NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbNullChar}, - {DISPID_GLOBAL_VBNULLSTRING, NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbNullString}, - {DISPID_GLOBAL_VBTAB, NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbTab}, - {DISPID_GLOBAL_VBVERTICALTAB, NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbVerticalTab}, - {DISPID_GLOBAL_CCUR, Global_CCur, 0, 1}, - {DISPID_GLOBAL_CINT, Global_CInt, 0, 1}, - {DISPID_GLOBAL_CLNG, Global_CLng, 0, 1}, - {DISPID_GLOBAL_CBOOL, Global_CBool, 0, 1}, - {DISPID_GLOBAL_CBYTE, Global_CByte, 0, 1}, - {DISPID_GLOBAL_CDATE, Global_CDate, 0, 1}, - {DISPID_GLOBAL_CDBL, Global_CDbl, 0, 1}, - {DISPID_GLOBAL_CSNG, Global_CSng, 0, 1}, - {DISPID_GLOBAL_CSTR, Global_CStr, 0, 1}, - {DISPID_GLOBAL_HEX, Global_Hex, 0, 1}, - {DISPID_GLOBAL_OCT, Global_Oct, 0, 1}, - {DISPID_GLOBAL_VARTYPE, Global_VarType, 0, 1}, - {DISPID_GLOBAL_ISDATE, Global_IsDate, 0, 1}, - {DISPID_GLOBAL_ISEMPTY, Global_IsEmpty, 0, 1}, - {DISPID_GLOBAL_ISNULL, Global_IsNull, 0, 1}, - {DISPID_GLOBAL_ISNUMERIC, Global_IsNumeric, 0, 1}, - {DISPID_GLOBAL_ISARRAY, Global_IsArray, 0, 1}, - {DISPID_GLOBAL_ISOBJECT, Global_IsObject, 0, 1}, - {DISPID_GLOBAL_ATN, Global_Atn, 0, 1}, - {DISPID_GLOBAL_COS, Global_Cos, 0, 1}, - {DISPID_GLOBAL_SIN, Global_Sin, 0, 1}, - {DISPID_GLOBAL_TAN, Global_Tan, 0, 1}, - {DISPID_GLOBAL_EXP, Global_Exp, 0, 1}, - {DISPID_GLOBAL_LOG, Global_Log, 0, 1}, - {DISPID_GLOBAL_SQR, Global_Sqr, 0, 1}, - {DISPID_GLOBAL_RANDOMIZE, Global_Randomize, 0, 1}, - {DISPID_GLOBAL_RND, Global_Rnd, 0, 1}, - {DISPID_GLOBAL_TIMER, Global_Timer, 0, 0}, - {DISPID_GLOBAL_LBOUND, Global_LBound, 0, 1}, - {DISPID_GLOBAL_UBOUND, Global_UBound, 0, 1, 2}, - {DISPID_GLOBAL_RGB, Global_RGB, 0, 3}, - {DISPID_GLOBAL_LEN, Global_Len, 0, 1}, - {DISPID_GLOBAL_LENB, Global_LenB, 0, 1}, - {DISPID_GLOBAL_LEFT, Global_Left, 0, 2}, - {DISPID_GLOBAL_LEFTB, Global_LeftB, 0, 2}, - {DISPID_GLOBAL_RIGHT, Global_Right, 0, 2}, - {DISPID_GLOBAL_RIGHTB, Global_RightB, 0, 2}, - {DISPID_GLOBAL_MID, Global_Mid, 0, 2, 3}, - {DISPID_GLOBAL_MIDB, Global_MidB, 0, 2, 3}, - {DISPID_GLOBAL_STRCOMP, Global_StrComp, 0, 2, 3}, - {DISPID_GLOBAL_LCASE, Global_LCase, 0, 1}, - {DISPID_GLOBAL_UCASE, Global_UCase, 0, 1}, - {DISPID_GLOBAL_LTRIM, Global_LTrim, 0, 1}, - {DISPID_GLOBAL_RTRIM, Global_RTrim, 0, 1}, - {DISPID_GLOBAL_TRIM, Global_Trim, 0, 1}, - {DISPID_GLOBAL_SPACE, Global_Space, 0, 1}, - {DISPID_GLOBAL_STRING, Global_String, 0, 0, 2}, - {DISPID_GLOBAL_INSTR, Global_InStr, 0, 2, 4}, - {DISPID_GLOBAL_INSTRB, Global_InStrB, 0, 3, 4}, - {DISPID_GLOBAL_ASCB, Global_AscB, 0, 1}, - {DISPID_GLOBAL_CHRB, Global_ChrB, 0, 1}, - {DISPID_GLOBAL_ASC, Global_Asc, 0, 1}, - {DISPID_GLOBAL_CHR, Global_Chr, 0, 1}, - {DISPID_GLOBAL_ASCW, Global_AscW, 0, 1}, - {DISPID_GLOBAL_CHRW, Global_ChrW, 0, 1}, - {DISPID_GLOBAL_ABS, Global_Abs, 0, 1}, - {DISPID_GLOBAL_FIX, Global_Fix, 0, 1}, - {DISPID_GLOBAL_INT, Global_Int, 0, 1}, - {DISPID_GLOBAL_SGN, Global_Sgn, 0, 1}, - {DISPID_GLOBAL_NOW, Global_Now, 0, 0}, - {DISPID_GLOBAL_DATE, Global_Date, 0, 0}, - {DISPID_GLOBAL_TIME, Global_Time, 0, 0}, - {DISPID_GLOBAL_DAY, Global_Day, 0, 1}, - {DISPID_GLOBAL_MONTH, Global_Month, 0, 1}, - {DISPID_GLOBAL_WEEKDAY, Global_Weekday, 0, 1, 2}, - {DISPID_GLOBAL_YEAR, Global_Year, 0, 1}, - {DISPID_GLOBAL_HOUR, Global_Hour, 0, 1}, - {DISPID_GLOBAL_MINUTE, Global_Minute, 0, 1}, - {DISPID_GLOBAL_SECOND, Global_Second, 0, 1}, - {DISPID_GLOBAL_DATEVALUE, Global_DateValue, 0, 1}, - {DISPID_GLOBAL_TIMEVALUE, Global_TimeValue, 0, 1}, - {DISPID_GLOBAL_DATESERIAL, Global_DateSerial, 0, 3}, - {DISPID_GLOBAL_TIMESERIAL, Global_TimeSerial, 0, 3}, - {DISPID_GLOBAL_INPUTBOX, Global_InputBox, 0, 1, 7}, - {DISPID_GLOBAL_MSGBOX, Global_MsgBox, 0, 1, 5}, - {DISPID_GLOBAL_CREATEOBJECT, Global_CreateObject, 0, 1}, - {DISPID_GLOBAL_GETOBJECT, Global_GetObject, 0, 0, 2}, - {DISPID_GLOBAL_DATEADD, Global_DateAdd, 0, 3}, - {DISPID_GLOBAL_DATEDIFF, Global_DateDiff, 0, 3, 5}, - {DISPID_GLOBAL_DATEPART, Global_DatePart, 0, 2, 4}, - {DISPID_GLOBAL_TYPENAME, Global_TypeName, 0, 1}, - {DISPID_GLOBAL_ARRAY, Global_Array, 0, 0, MAXDWORD}, - {DISPID_GLOBAL_ERASE, Global_Erase, 0, 1}, - {DISPID_GLOBAL_FILTER, Global_Filter, 0, 2, 4}, - {DISPID_GLOBAL_JOIN, Global_Join, 0, 1, 2}, - {DISPID_GLOBAL_SPLIT, Global_Split, 0, 1, 4}, - {DISPID_GLOBAL_REPLACE, Global_Replace, 0, 3, 6}, - {DISPID_GLOBAL_STRREVERSE, Global_StrReverse, 0, 1}, - {DISPID_GLOBAL_INSTRREV, Global_InStrRev, 0, 2, 4}, - {DISPID_GLOBAL_LOADPICTURE, Global_LoadPicture, 0, 1}, - {DISPID_GLOBAL_SCRIPTENGINE, Global_ScriptEngine, 0, 0}, - {DISPID_GLOBAL_SCRIPTENGINEMAJORVERSION, Global_ScriptEngineMajorVersion, 0, 0}, - {DISPID_GLOBAL_SCRIPTENGINEMINORVERSION, Global_ScriptEngineMinorVersion, 0, 0}, - {DISPID_GLOBAL_SCRIPTENGINEBUILDVERSION, Global_ScriptEngineBuildVersion, 0, 0}, - {DISPID_GLOBAL_FORMATNUMBER, Global_FormatNumber, 0, 1, 5}, - {DISPID_GLOBAL_FORMATCURRENCY, Global_FormatCurrency, 0, 1, 5}, - {DISPID_GLOBAL_FORMATPERCENT, Global_FormatPercent, 0, 1, 5}, - {DISPID_GLOBAL_FORMATDATETIME, Global_FormatDateTime, 0, 1, 2}, - {DISPID_GLOBAL_WEEKDAYNAME, Global_WeekdayName, 0, 1, 3}, - {DISPID_GLOBAL_MONTHNAME, Global_MonthName, 0, 1, 2}, - {DISPID_GLOBAL_ROUND, Global_Round, 0, 1, 2}, - {DISPID_GLOBAL_ESCAPE, Global_Escape, 0, 1}, - {DISPID_GLOBAL_UNESCAPE, Global_Unescape, 0, 1}, - {DISPID_GLOBAL_EVAL, Global_Eval, 0, 1}, - {DISPID_GLOBAL_EXECUTE, Global_Execute, 0, 1}, - {DISPID_GLOBAL_EXECUTEGLOBAL, Global_ExecuteGlobal, 0, 1}, - {DISPID_GLOBAL_GETREF, Global_GetRef, 0, 1}, - {DISPID_GLOBAL_VBMSGBOXHELPBUTTON, NULL, BP_GET, VT_I4, MB_HELP}, - {DISPID_GLOBAL_VBMSGBOXSETFOREGROUND, NULL, BP_GET, VT_I4, MB_SETFOREGROUND}, - {DISPID_GLOBAL_VBMSGBOXRIGHT, NULL, BP_GET, VT_I4, MB_RIGHT}, - {DISPID_GLOBAL_VBMSGBOXRTLREADING, NULL, BP_GET, VT_I4, MB_RTLREADING} + {NULL}, /* no default value */ + {L"Abs", Global_Abs, 0, 1}, + {L"Array", Global_Array, 0, 0, MAXDWORD}, + {L"Asc", Global_Asc, 0, 1}, + {L"AscB", Global_AscB, 0, 1}, + {L"AscW", Global_AscW, 0, 1}, + {L"Atn", Global_Atn, 0, 1}, + {L"CBool", Global_CBool, 0, 1}, + {L"CByte", Global_CByte, 0, 1}, + {L"CCur", Global_CCur, 0, 1}, + {L"CDate", Global_CDate, 0, 1}, + {L"CDbl", Global_CDbl, 0, 1}, + {L"Chr", Global_Chr, 0, 1}, + {L"ChrB", Global_ChrB, 0, 1}, + {L"ChrW", Global_ChrW, 0, 1}, + {L"CInt", Global_CInt, 0, 1}, + {L"CLng", Global_CLng, 0, 1}, + {L"Cos", Global_Cos, 0, 1}, + {L"CreateObject", Global_CreateObject, 0, 1}, + {L"CSng", Global_CSng, 0, 1}, + {L"CStr", Global_CStr, 0, 1}, + {L"Date", Global_Date, 0, 0}, + {L"DateAdd", Global_DateAdd, 0, 3}, + {L"DateDiff", Global_DateDiff, 0, 3, 5}, + {L"DatePart", Global_DatePart, 0, 2, 4}, + {L"DateSerial", Global_DateSerial, 0, 3}, + {L"DateValue", Global_DateValue, 0, 1}, + {L"Day", Global_Day, 0, 1}, + {L"Erase", Global_Erase, 0, 1}, + {L"Err", Global_Err, BP_GETPUT}, + {L"Escape", Global_Escape, 0, 1}, + {L"Eval", Global_Eval, 0, 1}, + {L"Execute", Global_Execute, 0, 1}, + {L"ExecuteGlobal", Global_ExecuteGlobal, 0, 1}, + {L"Exp", Global_Exp, 0, 1}, + {L"Filter", Global_Filter, 0, 2, 4}, + {L"Fix", Global_Fix, 0, 1}, + {L"FormatCurrency", Global_FormatCurrency, 0, 1, 5}, + {L"FormatDateTime", Global_FormatDateTime, 0, 1, 2}, + {L"FormatNumber", Global_FormatNumber, 0, 1, 5}, + {L"FormatPercent", Global_FormatPercent, 0, 1, 5}, + {L"GetObject", Global_GetObject, 0, 0, 2}, + {L"GetRef", Global_GetRef, 0, 1}, + {L"Hex", Global_Hex, 0, 1}, + {L"Hour", Global_Hour, 0, 1}, + {L"InputBox", Global_InputBox, 0, 1, 7}, + {L"InStr", Global_InStr, 0, 2, 4}, + {L"InStrB", Global_InStrB, 0, 3, 4}, + {L"InStrRev", Global_InStrRev, 0, 2, 4}, + {L"Int", Global_Int, 0, 1}, + {L"IsArray", Global_IsArray, 0, 1}, + {L"IsDate", Global_IsDate, 0, 1}, + {L"IsEmpty", Global_IsEmpty, 0, 1}, + {L"IsNull", Global_IsNull, 0, 1}, + {L"IsNumeric", Global_IsNumeric, 0, 1}, + {L"IsObject", Global_IsObject, 0, 1}, + {L"Join", Global_Join, 0, 1, 2}, + {L"LBound", Global_LBound, 0, 1}, + {L"LCase", Global_LCase, 0, 1}, + {L"Left", Global_Left, 0, 2}, + {L"LeftB", Global_LeftB, 0, 2}, + {L"Len", Global_Len, 0, 1}, + {L"LenB", Global_LenB, 0, 1}, + {L"LoadPicture", Global_LoadPicture, 0, 1}, + {L"Log", Global_Log, 0, 1}, + {L"LTrim", Global_LTrim, 0, 1}, + {L"Mid", Global_Mid, 0, 2, 3}, + {L"MidB", Global_MidB, 0, 2, 3}, + {L"Minute", Global_Minute, 0, 1}, + {L"Month", Global_Month, 0, 1}, + {L"MonthName", Global_MonthName, 0, 1, 2}, + {L"MsgBox", Global_MsgBox, 0, 1, 5}, + {L"Now", Global_Now, 0, 0}, + {L"Oct", Global_Oct, 0, 1}, + {L"Randomize", Global_Randomize, 0, 1}, + {L"Replace", Global_Replace, 0, 3, 6}, + {L"RGB", Global_RGB, 0, 3}, + {L"Right", Global_Right, 0, 2}, + {L"RightB", Global_RightB, 0, 2}, + {L"Rnd", Global_Rnd, 0, 1}, + {L"Round", Global_Round, 0, 1, 2}, + {L"RTrim", Global_RTrim, 0, 1}, + {L"ScriptEngine", Global_ScriptEngine, 0, 0}, + {L"ScriptEngineBuildVersion", Global_ScriptEngineBuildVersion, 0, 0}, + {L"ScriptEngineMajorVersion", Global_ScriptEngineMajorVersion, 0, 0}, + {L"ScriptEngineMinorVersion", Global_ScriptEngineMinorVersion, 0, 0}, + {L"Second", Global_Second, 0, 1}, + {L"Sgn", Global_Sgn, 0, 1}, + {L"Sin", Global_Sin, 0, 1}, + {L"Space", Global_Space, 0, 1}, + {L"Split", Global_Split, 0, 1, 4}, + {L"Sqr", Global_Sqr, 0, 1}, + {L"StrComp", Global_StrComp, 0, 2, 3}, + {L"String", Global_String, 0, 0, 2}, + {L"StrReverse", Global_StrReverse, 0, 1}, + {L"Tan", Global_Tan, 0, 1}, + {L"Time", Global_Time, 0, 0}, + {L"Timer", Global_Timer, 0, 0}, + {L"TimeSerial", Global_TimeSerial, 0, 3}, + {L"TimeValue", Global_TimeValue, 0, 1}, + {L"Trim", Global_Trim, 0, 1}, + {L"TypeName", Global_TypeName, 0, 1}, + {L"UBound", Global_UBound, 0, 1, 2}, + {L"UCase", Global_UCase, 0, 1}, + {L"Unescape", Global_Unescape, 0, 1}, + {L"VarType", Global_VarType, 0, 1}, + {L"vbAbort", NULL, BP_GET, VT_I2, IDABORT}, + {L"vbAbortRetryIgnore", NULL, BP_GET, VT_I2, MB_ABORTRETRYIGNORE}, + {L"vbApplicationModal", NULL, BP_GET, VT_I2, MB_APPLMODAL}, + {L"vbArray", NULL, BP_GET, VT_I2, VT_ARRAY}, + {L"vbBinaryCompare", NULL, BP_GET, VT_I2, 0}, + {L"vbBlack", NULL, BP_GET, VT_I4, 0x000000}, + {L"vbBlue", NULL, BP_GET, VT_I4, 0xff0000}, + {L"vbBoolean", NULL, BP_GET, VT_I2, VT_BOOL}, + {L"vbByte", NULL, BP_GET, VT_I2, VT_UI1}, + {L"vbCancel", NULL, BP_GET, VT_I2, IDCANCEL}, + {L"vbCr", NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbCr}, + {L"vbCritical", NULL, BP_GET, VT_I2, MB_ICONHAND}, + {L"vbCrLf", NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbCrLf}, + {L"vbCurrency", NULL, BP_GET, VT_I2, VT_CY}, + {L"vbCyan", NULL, BP_GET, VT_I4, 0xffff00}, + {L"vbDatabaseCompare", NULL, BP_GET, VT_I2, 2}, + {L"vbDataObject", NULL, BP_GET, VT_I2, VT_UNKNOWN}, + {L"vbDate", NULL, BP_GET, VT_I2, VT_DATE}, + {L"vbDecimal", NULL, BP_GET, VT_I2, VT_DECIMAL}, + {L"vbDefaultButton1", NULL, BP_GET, VT_I2, MB_DEFBUTTON1}, + {L"vbDefaultButton2", NULL, BP_GET, VT_I2, MB_DEFBUTTON2}, + {L"vbDefaultButton3", NULL, BP_GET, VT_I2, MB_DEFBUTTON3}, + {L"vbDefaultButton4", NULL, BP_GET, VT_I2, MB_DEFBUTTON4}, + {L"vbDouble", NULL, BP_GET, VT_I2, VT_R8}, + {L"vbEmpty", NULL, BP_GET, VT_I2, VT_EMPTY}, + {L"vbError", NULL, BP_GET, VT_I2, VT_ERROR}, + {L"vbExclamation", NULL, BP_GET, VT_I2, MB_ICONEXCLAMATION}, + {L"vbFalse", NULL, BP_GET, VT_I2, VARIANT_FALSE}, + {L"vbFirstFourDays", NULL, BP_GET, VT_I2, 2}, + {L"vbFirstFullWeek", NULL, BP_GET, VT_I2, 3}, + {L"vbFirstJan1", NULL, BP_GET, VT_I2, 1}, + {L"vbFormFeed", NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbFormFeed}, + {L"vbFriday", NULL, BP_GET, VT_I2, 6}, + {L"vbGeneralDate", NULL, BP_GET, VT_I2, 0}, + {L"vbGreen", NULL, BP_GET, VT_I4, 0x00ff00}, + {L"vbIgnore", NULL, BP_GET, VT_I2, IDIGNORE}, + {L"vbInformation", NULL, BP_GET, VT_I2, MB_ICONASTERISK}, + {L"vbInteger", NULL, BP_GET, VT_I2, VT_I2}, + {L"vbLf", NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbLf}, + {L"vbLong", NULL, BP_GET, VT_I2, VT_I4}, + {L"vbLongDate", NULL, BP_GET, VT_I2, 1}, + {L"vbLongTime", NULL, BP_GET, VT_I2, 3}, + {L"vbMagenta", NULL, BP_GET, VT_I4, 0xff00ff}, + {L"vbMonday", NULL, BP_GET, VT_I2, 2}, + {L"vbMsgBoxHelpButton", NULL, BP_GET, VT_I4, MB_HELP}, + {L"vbMsgBoxRight", NULL, BP_GET, VT_I4, MB_RIGHT}, + {L"vbMsgBoxRtlReading", NULL, BP_GET, VT_I4, MB_RTLREADING}, + {L"vbMsgBoxSetForeground", NULL, BP_GET, VT_I4, MB_SETFOREGROUND}, + {L"vbNewLine", NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbNewLine}, + {L"vbNo", NULL, BP_GET, VT_I2, IDNO}, + {L"vbNull", NULL, BP_GET, VT_I2, VT_NULL}, + {L"vbNullChar", NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbNullChar}, + {L"vbNullString", NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbNullString}, + {L"vbObject", NULL, BP_GET, VT_I2, VT_DISPATCH}, + {L"vbObjectError", NULL, BP_GET, VT_I4, 0x80040000}, + {L"vbOK", NULL, BP_GET, VT_I2, IDOK}, + {L"vbOKCancel", NULL, BP_GET, VT_I2, MB_OKCANCEL}, + {L"vbOKOnly", NULL, BP_GET, VT_I2, MB_OK}, + {L"vbQuestion", NULL, BP_GET, VT_I2, MB_ICONQUESTION}, + {L"vbRed", NULL, BP_GET, VT_I4, 0x0000ff}, + {L"vbRetry", NULL, BP_GET, VT_I2, IDRETRY}, + {L"vbRetryCancel", NULL, BP_GET, VT_I2, MB_RETRYCANCEL}, + {L"vbSaturday", NULL, BP_GET, VT_I2, 7}, + {L"vbShortDate", NULL, BP_GET, VT_I2, 2}, + {L"vbShortTime", NULL, BP_GET, VT_I2, 4}, + {L"vbSingle", NULL, BP_GET, VT_I2, VT_R4}, + {L"vbString", NULL, BP_GET, VT_I2, VT_BSTR}, + {L"vbSunday", NULL, BP_GET, VT_I2, 1}, + {L"vbSystemModal", NULL, BP_GET, VT_I2, MB_SYSTEMMODAL}, + {L"vbTab", NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbTab}, + {L"vbTextCompare", NULL, BP_GET, VT_I2, 1}, + {L"vbThursday", NULL, BP_GET, VT_I2, 5}, + {L"vbTrue", NULL, BP_GET, VT_I2, VARIANT_TRUE}, + {L"vbTuesday", NULL, BP_GET, VT_I2, 3}, + {L"vbUseDefault", NULL, BP_GET, VT_I2, -2}, + {L"vbUseSystem", NULL, BP_GET, VT_I2, 0}, + {L"vbUseSystemDayOfWeek", NULL, BP_GET, VT_I2, 0}, + {L"vbVariant", NULL, BP_GET, VT_I2, VT_VARIANT}, + {L"vbVerticalTab", NULL, BP_GET, VT_BSTR, (UINT_PTR)&vbVerticalTab}, + {L"vbWednesday", NULL, BP_GET, VT_I2, 4}, + {L"vbWhite", NULL, BP_GET, VT_I4, 0xffffff}, + {L"vbYellow", NULL, BP_GET, VT_I4, 0x00ffff}, + {L"vbYes", NULL, BP_GET, VT_I2, IDYES}, + {L"vbYesNo", NULL, BP_GET, VT_I2, MB_YESNO}, + {L"vbYesNoCancel", NULL, BP_GET, VT_I2, MB_YESNOCANCEL}, + {L"Weekday", Global_Weekday, 0, 1, 2}, + {L"WeekdayName", Global_WeekdayName, 0, 1, 3}, + {L"Year", Global_Year, 0, 1} }; -static HRESULT Err_Description(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT err_string_prop(BSTR *prop, VARIANT *args, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + BSTR str; + HRESULT hres; + + if(!args_cnt) + return return_string(res, *prop ? *prop : L""); + + hres = to_string(args, &str); + if(FAILED(hres)) + return hres; + + SysFreeString(*prop); + *prop = str; + return S_OK; } -static HRESULT Err_HelpContext(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Err_Description(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + return err_string_prop(&This->ctx->ei.bstrDescription, args, args_cnt, res); } -static HRESULT Err_HelpFile(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Err_HelpContext(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + + if(args_cnt) { + FIXME("setter not implemented\n"); + return E_NOTIMPL; + } + + return return_int(res, This->ctx->ei.dwHelpContext); } -static HRESULT Err_Number(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Err_HelpFile(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +{ + TRACE("\n"); + return err_string_prop(&This->ctx->ei.bstrHelpFile, args, args_cnt, res); +} + +static HRESULT Err_Number(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { HRESULT hres; TRACE("\n"); - if(!This->desc) - return E_UNEXPECTED; - if(args_cnt) { FIXME("setter not implemented\n"); return E_NOTIMPL; } - hres = This->desc->ctx->err_number; + hres = This->ctx->ei.scode; return return_int(res, HRESULT_FACILITY(hres) == FACILITY_VBS ? HRESULT_CODE(hres) : hres); } -static HRESULT Err_Source(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Err_Source(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + return err_string_prop(&This->ctx->ei.bstrSource, args, args_cnt, res); } -static HRESULT Err_Clear(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Err_Clear(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { TRACE("\n"); - if(!This->desc) - return E_UNEXPECTED; - - This->desc->ctx->err_number = S_OK; + clear_ei(&This->ctx->ei); return S_OK; } -static HRESULT Err_Raise(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +static HRESULT Err_Raise(BuiltinDisp *This, VARIANT *args, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + BSTR source = NULL, description = NULL, helpfile = NULL; + int code, helpcontext = 0; + HRESULT hres, error; + + TRACE("%s %u...\n", debugstr_variant(args), args_cnt); + + hres = to_int(args, &code); + if(FAILED(hres)) + return hres; + if(code > 0 && code > 0xffff) + return E_INVALIDARG; + + if(args_cnt >= 2) + hres = to_string(args + 1, &source); + if(args_cnt >= 3 && SUCCEEDED(hres)) + hres = to_string(args + 2, &description); + if(args_cnt >= 4 && SUCCEEDED(hres)) + hres = to_string(args + 3, &helpfile); + if(args_cnt >= 5 && SUCCEEDED(hres)) + hres = to_int(args + 4, &helpcontext); + + if(SUCCEEDED(hres)) { + script_ctx_t *ctx = This->ctx; + + error = (code & ~0xffff) ? map_hres(code) : MAKE_VBSERROR(code); + + if(source) { + if(ctx->ei.bstrSource) SysFreeString(ctx->ei.bstrSource); + ctx->ei.bstrSource = source; + } + if(!ctx->ei.bstrSource) + ctx->ei.bstrSource = get_vbscript_string(VBS_RUNTIME_ERROR); + if(description) { + if(ctx->ei.bstrDescription) SysFreeString(ctx->ei.bstrDescription); + ctx->ei.bstrDescription = description; + } + if(!ctx->ei.bstrDescription) + ctx->ei.bstrDescription = get_vbscript_error_string(error); + if(helpfile) { + if(ctx->ei.bstrHelpFile) SysFreeString(ctx->ei.bstrHelpFile); + ctx->ei.bstrHelpFile = helpfile; + } + if(args_cnt >= 5) + ctx->ei.dwHelpContext = helpcontext; + + ctx->ei.scode = error; + hres = SCRIPT_E_RECORDED; + }else { + SysFreeString(source); + SysFreeString(description); + SysFreeString(helpfile); + } + + return hres; } static const builtin_prop_t err_props[] = { - {DISPID_ERR_DESCRIPTION, Err_Description, BP_GETPUT}, - {DISPID_ERR_HELPCONTEXT, Err_HelpContext, BP_GETPUT}, - {DISPID_ERR_HELPFILE, Err_HelpFile, BP_GETPUT}, - {DISPID_ERR_NUMBER, Err_Number, BP_GETPUT}, - {DISPID_ERR_SOURCE, Err_Source, BP_GETPUT}, - {DISPID_ERR_CLEAR, Err_Clear}, - {DISPID_ERR_RAISE, Err_Raise, 0, 5}, + {NULL, Err_Number, BP_GETPUT}, + {L"Clear", Err_Clear}, + {L"Description", Err_Description, BP_GETPUT}, + {L"HelpContext", Err_HelpContext, BP_GETPUT}, + {L"HelpFile", Err_HelpFile, BP_GETPUT}, + {L"Number", Err_Number, BP_GETPUT}, + {L"Raise", Err_Raise, 0, 1, 5}, + {L"Source", Err_Source, BP_GETPUT} }; -HRESULT init_global(script_ctx_t *ctx) +void detach_global_objects(script_ctx_t *ctx) { - HRESULT hres; - - ctx->global_desc.ctx = ctx; - ctx->global_desc.builtin_prop_cnt = ARRAY_SIZE(global_props); - ctx->global_desc.builtin_props = global_props; - - hres = get_typeinfo(GlobalObj_tid, &ctx->global_desc.typeinfo); - if(FAILED(hres)) - return hres; - - hres = create_vbdisp(&ctx->global_desc, &ctx->global_obj); - if(FAILED(hres)) - return hres; + if(ctx->err_obj) { + ctx->err_obj->ctx = NULL; + IDispatch_Release(&ctx->err_obj->IDispatch_iface); + ctx->err_obj = NULL; + } - hres = create_script_disp(ctx, &ctx->script_obj); - if(FAILED(hres)) - return hres; + if(ctx->global_obj) { + ctx->global_obj->ctx = NULL; + IDispatch_Release(&ctx->global_obj->IDispatch_iface); + ctx->global_obj = NULL; + } +} - ctx->err_desc.ctx = ctx; - ctx->err_desc.builtin_prop_cnt = ARRAY_SIZE(err_props); - ctx->err_desc.builtin_props = err_props; +HRESULT init_global(script_ctx_t *ctx) +{ + HRESULT hres; - hres = get_typeinfo(ErrObj_tid, &ctx->err_desc.typeinfo); + hres = create_builtin_dispatch(ctx, global_props, ARRAY_SIZE(global_props), &ctx->global_obj); if(FAILED(hres)) return hres; - return create_vbdisp(&ctx->err_desc, &ctx->err_obj); + return create_builtin_dispatch(ctx, err_props, ARRAY_SIZE(err_props), &ctx->err_obj); } diff --git a/dll/win32/vbscript/interp.c b/dll/win32/vbscript/interp.c index b46bd01c0fc..80ecc416998 100644 --- a/dll/win32/vbscript/interp.c +++ b/dll/win32/vbscript/interp.c @@ -83,7 +83,7 @@ typedef struct { static BOOL lookup_dynamic_vars(dynamic_var_t *var, const WCHAR *name, ref_t *ref) { while(var) { - if(!strcmpiW(var->name, name)) { + if(!wcsicmp(var->name, name)) { ref->type = var->is_const ? REF_CONST : REF_VAR; ref->u.v = &var->v; return TRUE; @@ -104,18 +104,16 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_ DISPID id; HRESULT hres; - static const WCHAR errW[] = {'e','r','r',0}; - if(invoke_type == VBDISP_LET && (ctx->func->type == FUNC_FUNCTION || ctx->func->type == FUNC_PROPGET || ctx->func->type == FUNC_DEFGET) - && !strcmpiW(name, ctx->func->name)) { + && !wcsicmp(name, ctx->func->name)) { ref->type = REF_VAR; ref->u.v = &ctx->ret_val; return S_OK; } for(i=0; i < ctx->func->var_cnt; i++) { - if(!strcmpiW(ctx->func->vars[i].name, name)) { + if(!wcsicmp(ctx->func->vars[i].name, name)) { ref->type = REF_VAR; ref->u.v = ctx->vars+i; return TRUE; @@ -123,7 +121,7 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_ } for(i=0; i < ctx->func->arg_cnt; i++) { - if(!strcmpiW(ctx->func->args[i].name, name)) { + if(!wcsicmp(ctx->func->args[i].name, name)) { ref->type = REF_VAR; ref->u.v = ctx->args+i; return S_OK; @@ -137,7 +135,7 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_ if(ctx->vbthis) { /* FIXME: Bind such identifier while generating bytecode. */ for(i=0; i < ctx->vbthis->desc->prop_cnt; i++) { - if(!strcmpiW(ctx->vbthis->desc->props[i].name, name)) { + if(!wcsicmp(ctx->vbthis->desc->props[i].name, name)) { ref->type = REF_VAR; ref->u.v = ctx->vbthis->props+i; return S_OK; @@ -168,23 +166,17 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_ return S_OK; for(func = ctx->script->global_funcs; func; func = func->next) { - if(!strcmpiW(func->name, name)) { + if(!wcsicmp(func->name, name)) { ref->type = REF_FUNC; ref->u.f = func; return S_OK; } } - if(!strcmpiW(name, errW)) { - ref->type = REF_OBJ; - ref->u.obj = (IDispatch*)&ctx->script->err_obj->IDispatchEx_iface; - return S_OK; - } - - hres = vbdisp_get_id(ctx->script->global_obj, name, invoke_type, TRUE, &id); + hres = get_builtin_id(ctx->script->global_obj, name, &id); if(SUCCEEDED(hres)) { ref->type = REF_DISP; - ref->u.d.disp = (IDispatch*)&ctx->script->global_obj->IDispatchEx_iface; + ref->u.d.disp = &ctx->script->global_obj->IDispatch_iface; ref->u.d.id = id; return S_OK; } @@ -226,7 +218,7 @@ static HRESULT add_dynamic_var(exec_ctx_t *ctx, const WCHAR *name, if(!new_var) return E_OUTOFMEMORY; - size = (strlenW(name)+1)*sizeof(WCHAR); + size = (lstrlenW(name)+1)*sizeof(WCHAR); str = heap_pool_alloc(heap, size); if(!str) return E_OUTOFMEMORY; @@ -247,6 +239,14 @@ static HRESULT add_dynamic_var(exec_ctx_t *ctx, const WCHAR *name, return S_OK; } +void clear_ei(EXCEPINFO *ei) +{ + SysFreeString(ei->bstrSource); + SysFreeString(ei->bstrDescription); + SysFreeString(ei->bstrHelpFile); + memset(ei, 0, sizeof(*ei)); +} + static inline VARIANT *stack_pop(exec_ctx_t *ctx) { assert(ctx->top); @@ -319,7 +319,7 @@ static HRESULT stack_pop_val(exec_ctx_t *ctx, variant_val_t *r) HRESULT hres; hres = get_disp_value(ctx->script, V_DISPATCH(r->v), &r->store); - if(r->owned) + if(r->owned && V_DISPATCH(r->v)) IDispatch_Release(V_DISPATCH(r->v)); if(FAILED(hres)) return hres; @@ -350,7 +350,8 @@ static HRESULT stack_assume_val(exec_ctx_t *ctx, unsigned n) disp = V_DISPATCH(v); hres = get_disp_value(ctx->script, disp, v); - IDispatch_Release(disp); + if(disp) + IDispatch_Release(disp); if(FAILED(hres)) return hres; } @@ -580,7 +581,7 @@ static HRESULT do_icall(exec_ctx_t *ctx, VARIANT *res) break; case REF_FUNC: vbstack_to_dp(ctx, arg_cnt, FALSE, &dp); - hres = exec_script(ctx->script, ref.u.f, NULL, &dp, res); + hres = exec_script(ctx->script, FALSE, ref.u.f, NULL, &dp, res); if(FAILED(hres)) return hres; break; @@ -688,23 +689,27 @@ static HRESULT interp_mcallv(exec_ctx_t *ctx) static HRESULT assign_value(exec_ctx_t *ctx, VARIANT *dst, VARIANT *src, WORD flags) { + VARIANT value; HRESULT hres; - hres = VariantCopyInd(dst, src); + V_VT(&value) = VT_EMPTY; + hres = VariantCopyInd(&value, src); if(FAILED(hres)) return hres; - if(V_VT(dst) == VT_DISPATCH && !(flags & DISPATCH_PROPERTYPUTREF)) { - VARIANT value; + if(V_VT(&value) == VT_DISPATCH && !(flags & DISPATCH_PROPERTYPUTREF)) { + IDispatch *disp = V_DISPATCH(&value); - hres = get_disp_value(ctx->script, V_DISPATCH(dst), &value); - IDispatch_Release(V_DISPATCH(dst)); + V_VT(&value) = VT_EMPTY; + hres = get_disp_value(ctx->script, disp, &value); + if(disp) + IDispatch_Release(disp); if(FAILED(hres)) return hres; - - *dst = value; } + VariantClear(dst); + *dst = value; return S_OK; } @@ -988,7 +993,7 @@ static HRESULT interp_new(exec_ctx_t *ctx) TRACE("%s\n", debugstr_w(arg)); - if(!strcmpiW(arg, regexpW)) { + if(!wcsicmp(arg, regexpW)) { V_VT(&v) = VT_DISPATCH; hres = create_regexp(&V_DISPATCH(&v)); if(FAILED(hres)) @@ -998,7 +1003,7 @@ static HRESULT interp_new(exec_ctx_t *ctx) } for(class_desc = ctx->script->classes; class_desc; class_desc = class_desc->next) { - if(!strcmpiW(class_desc->name, arg)) + if(!wcsicmp(class_desc->name, arg)) break; } if(!class_desc) { @@ -1258,6 +1263,30 @@ static HRESULT interp_ret(exec_ctx_t *ctx) return S_OK; } +static HRESULT interp_retval(exec_ctx_t *ctx) +{ + variant_val_t val; + HRESULT hres; + + TRACE("\n"); + + hres = stack_pop_val(ctx, &val); + if(FAILED(hres)) + return hres; + + if(val.owned) { + VariantClear(&ctx->ret_val); + ctx->ret_val = *val.v; + } + else { + hres = VariantCopy(&ctx->ret_val, val.v); + if(FAILED(hres)) + return hres; + } + + return S_OK; +} + static HRESULT interp_stop(exec_ctx_t *ctx) { WARN("\n"); @@ -1297,7 +1326,7 @@ static HRESULT interp_errmode(exec_ctx_t *ctx) TRACE("%d\n", err_mode); ctx->resume_next = err_mode; - ctx->script->err_number = S_OK; + clear_ei(&ctx->script->ei); return S_OK; } @@ -1315,27 +1344,20 @@ static HRESULT interp_string(exec_ctx_t *ctx) return stack_push(ctx, &v); } -static HRESULT interp_long(exec_ctx_t *ctx) +static HRESULT interp_int(exec_ctx_t *ctx) { const LONG arg = ctx->instr->arg1.lng; VARIANT v; TRACE("%d\n", arg); - V_VT(&v) = VT_I4; - V_I4(&v) = arg; - return stack_push(ctx, &v); -} - -static HRESULT interp_short(exec_ctx_t *ctx) -{ - const LONG arg = ctx->instr->arg1.lng; - VARIANT v; - - TRACE("%d\n", arg); - - V_VT(&v) = VT_I2; - V_I2(&v) = arg; + if(arg == (INT16)arg) { + V_VT(&v) = VT_I2; + V_I2(&v) = arg; + }else { + V_VT(&v) = VT_I4; + V_I4(&v) = arg; + } return stack_push(ctx, &v); } @@ -2061,7 +2083,7 @@ static void release_exec(exec_ctx_t *ctx) heap_free(ctx->stack); } -HRESULT exec_script(script_ctx_t *ctx, function_t *func, vbdisp_t *vbthis, DISPPARAMS *dp, VARIANT *res) +HRESULT exec_script(script_ctx_t *ctx, BOOL extern_caller, function_t *func, vbdisp_t *vbthis, DISPPARAMS *dp, VARIANT *res) { exec_ctx_t exec = {func->code_ctx}; vbsop_t op; @@ -2123,6 +2145,9 @@ HRESULT exec_script(script_ctx_t *ctx, function_t *func, vbdisp_t *vbthis, DISPP return E_OUTOFMEMORY; } + if(extern_caller) + IActiveScriptSite_OnEnterScript(ctx->site); + if(vbthis) { exec.this_obj = (IDispatch*)&vbthis->IDispatchEx_iface; exec.vbthis = vbthis; @@ -2141,7 +2166,15 @@ HRESULT exec_script(script_ctx_t *ctx, function_t *func, vbdisp_t *vbthis, DISPP op = exec.instr->op; hres = op_funcs[op](&exec); if(FAILED(hres)) { - ctx->err_number = hres = map_hres(hres); + if(hres != SCRIPT_E_RECORDED) { + clear_ei(&ctx->ei); + + ctx->ei.scode = hres = map_hres(hres); + ctx->ei.bstrSource = get_vbscript_string(VBS_RUNTIME_ERROR); + ctx->ei.bstrDescription = get_vbscript_error_string(hres); + }else { + hres = ctx->ei.scode; + } if(exec.resume_next) { unsigned stack_off; @@ -2186,8 +2219,15 @@ HRESULT exec_script(script_ctx_t *ctx, function_t *func, vbdisp_t *vbthis, DISPP } assert(!exec.top); - if(func->type != FUNC_FUNCTION && func->type != FUNC_PROPGET && func->type != FUNC_DEFGET) - assert(V_VT(&exec.ret_val) == VT_EMPTY); + + if(extern_caller) { + IActiveScriptSite_OnLeaveScript(ctx->site); + if(FAILED(hres)) { + if(!ctx->ei.scode) + ctx->ei.scode = hres; + hres = report_script_error(ctx); + } + } if(SUCCEEDED(hres) && res) { *res = exec.ret_val; diff --git a/dll/win32/vbscript/lex.c b/dll/win32/vbscript/lex.c index 571854db58e..26b3d45a727 100644 --- a/dll/win32/vbscript/lex.c +++ b/dll/win32/vbscript/lex.c @@ -16,11 +16,13 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - +#ifdef __REACTOS__ +#include <wine/config.h> +#include <wine/port.h> +#endif #include <assert.h> #include <limits.h> +#include <math.h> #include "vbscript.h" #include "parse.h" @@ -153,17 +155,17 @@ static const struct { static inline BOOL is_identifier_char(WCHAR c) { - return isalnumW(c) || c == '_'; + return iswalnum(c) || c == '_'; } -static int check_keyword(parser_ctx_t *ctx, const WCHAR *word) +static int check_keyword(parser_ctx_t *ctx, const WCHAR *word, const WCHAR **lval) { const WCHAR *p1 = ctx->ptr; const WCHAR *p2 = word; WCHAR c; while(p1 < ctx->end && *p2) { - c = tolowerW(*p1); + c = towlower(*p1); if(c != *p2) return c - *p2; p1++; @@ -174,17 +176,18 @@ static int check_keyword(parser_ctx_t *ctx, const WCHAR *word) return 1; ctx->ptr = p1; + *lval = word; return 0; } -static int check_keywords(parser_ctx_t *ctx) +static int check_keywords(parser_ctx_t *ctx, const WCHAR **lval) { int min = 0, max = ARRAY_SIZE(keywords)-1, r, i; while(min <= max) { i = (min+max)/2; - r = check_keyword(ctx, keywords[i].word); + r = check_keyword(ctx, keywords[i].word, lval); if(!r) return keywords[i].token; @@ -224,7 +227,7 @@ static int parse_string_literal(parser_ctx_t *ctx, const WCHAR **ret) int len = 0; while(ctx->ptr < ctx->end) { - if(*ctx->ptr == '\n') { + if(*ctx->ptr == '\n' || *ctx->ptr == '\r') { FIXME("newline inside string literal\n"); return 0; } @@ -270,7 +273,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret) if(*ctx->ptr == '0' && !('0' <= ctx->ptr[1] && ctx->ptr[1] <= '9') && ctx->ptr[1] != '.') return *ctx->ptr++; - while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) { + while(ctx->ptr < ctx->end && iswdigit(*ctx->ptr)) { hlp = d*10 + *(ctx->ptr++) - '0'; if(d>MAXLONGLONG/10 || hlp<0) { exp++; @@ -279,7 +282,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret) else d = hlp; } - while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) { + while(ctx->ptr < ctx->end && iswdigit(*ctx->ptr)) { exp++; ctx->ptr++; } @@ -288,7 +291,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret) use_int = FALSE; ctx->ptr++; - while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) { + while(ctx->ptr < ctx->end && iswdigit(*ctx->ptr)) { hlp = d*10 + *(ctx->ptr++) - '0'; if(d>MAXLONGLONG/10 || hlp<0) break; @@ -296,19 +299,22 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret) d = hlp; exp--; } - while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) + while(ctx->ptr < ctx->end && iswdigit(*ctx->ptr)) ctx->ptr++; } if(*ctx->ptr == 'e' || *ctx->ptr == 'E') { int e = 0, sign = 1; - if(*++ctx->ptr == '-') { + ctx->ptr++; + if(*ctx->ptr == '-') { ctx->ptr++; sign = -1; + }else if(*ctx->ptr == '+') { + ctx->ptr++; } - if(!isdigitW(*ctx->ptr)) { + if(!iswdigit(*ctx->ptr)) { FIXME("Invalid numeric literal\n"); return 0; } @@ -319,7 +325,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret) e = e*10 + *(ctx->ptr++) - '0'; if(sign == -1 && -e+exp < -(INT_MAX/100)) { /* The literal will be rounded to 0 anyway. */ - while(isdigitW(*ctx->ptr)) + while(iswdigit(*ctx->ptr)) ctx->ptr++; *(double*)ret = 0; return tDouble; @@ -329,15 +335,14 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret) FIXME("Invalid numeric literal\n"); return 0; } - } while(isdigitW(*ctx->ptr)); + } while(iswdigit(*ctx->ptr)); exp += sign*e; } if(use_int && (LONG)d == d) { - LONG l = d; - *(LONG*)ret = l; - return (short)l == l ? tShort : tLong; + *(LONG*)ret = d; + return tInt; } r = exp>=0 ? d*pow(10, exp) : d/pow(10, -exp); @@ -378,7 +383,7 @@ static int parse_hex_literal(parser_ctx_t *ctx, LONG *ret) ctx->ptr++; *ret = l; - return (short)l == l ? tShort : tLong; + return tInt; } static void skip_spaces(parser_ctx_t *ctx) @@ -390,7 +395,7 @@ static void skip_spaces(parser_ctx_t *ctx) static int comment_line(parser_ctx_t *ctx) { static const WCHAR newlineW[] = {'\n','\r',0}; - ctx->ptr = strpbrkW(ctx->ptr, newlineW); + ctx->ptr = wcspbrk(ctx->ptr, newlineW); if(ctx->ptr) ctx->ptr++; else @@ -411,8 +416,8 @@ static int parse_next_token(void *lval, parser_ctx_t *ctx) if('0' <= c && c <= '9') return parse_numeric_literal(ctx, lval); - if(isalphaW(c)) { - int ret = check_keywords(ctx); + if(iswalpha(c)) { + int ret = check_keywords(ctx, lval); if(!ret) return parse_identifier(ctx, lval); if(ret != tREM) @@ -492,15 +497,24 @@ int parser_lex(void *lval, parser_ctx_t *ctx) { int ret; + if (ctx->last_token == tEXPRESSION) + { + ctx->last_token = tNL; + return tEXPRESSION; + } + while(1) { ret = parse_next_token(lval, ctx); if(ret == '_') { skip_spaces(ctx); - if(*ctx->ptr != '\n') { + if(*ctx->ptr != '\n' && *ctx->ptr != '\r') { FIXME("'_' not followed by newline\n"); return 0; } - ctx->ptr++; + if(*ctx->ptr == '\r') + ctx->ptr++; + if(*ctx->ptr == '\n') + ctx->ptr++; continue; } if(ret != tNL || ctx->last_token != tNL) diff --git a/dll/win32/vbscript/parse.h b/dll/win32/vbscript/parse.h index 1fc2650748e..6e5188c8c5e 100644 --- a/dll/win32/vbscript/parse.h +++ b/dll/win32/vbscript/parse.h @@ -34,6 +34,7 @@ typedef enum { EXPR_GTEQ, EXPR_IDIV, EXPR_IMP, + EXPR_INT, EXPR_IS, EXPR_LT, EXPR_LTEQ, @@ -51,8 +52,6 @@ typedef enum { EXPR_OR, EXPR_STRING, EXPR_SUB, - EXPR_ULONG, - EXPR_USHORT, EXPR_XOR } expression_type_t; @@ -121,7 +120,8 @@ typedef enum { STAT_STOP, STAT_UNTIL, STAT_WHILE, - STAT_WHILELOOP + STAT_WHILELOOP, + STAT_RETVAL } statement_type_t; typedef struct _statement_t { @@ -251,6 +251,11 @@ typedef struct { case_clausule_t *case_clausules; } select_statement_t; +typedef struct { + statement_t stat; + expression_t *expr; +} retval_statement_t; + typedef struct { const WCHAR *code; const WCHAR *ptr; @@ -271,7 +276,7 @@ typedef struct { heap_pool_t heap; } parser_ctx_t; -HRESULT parse_script(parser_ctx_t*,const WCHAR*,const WCHAR*) DECLSPEC_HIDDEN; +HRESULT parse_script(parser_ctx_t*,const WCHAR*,const WCHAR*,DWORD) DECLSPEC_HIDDEN; void parser_release(parser_ctx_t*) DECLSPEC_HIDDEN; int parser_lex(void*,parser_ctx_t*) DECLSPEC_HIDDEN; void *parser_alloc(parser_ctx_t*,size_t) DECLSPEC_HIDDEN; diff --git a/dll/win32/vbscript/parser.tab.c b/dll/win32/vbscript/parser.tab.c index af2c0448591..cc702c598a9 100644 --- a/dll/win32/vbscript/parser.tab.c +++ b/dll/win32/vbscript/parser.tab.c @@ -1,8 +1,9 @@ -/* A Bison parser, made by GNU Bison 3.0. */ +/* A Bison parser, made by GNU Bison 3.4.1. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, + Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -40,11 +41,14 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ +/* Undocumented macros, especially those whose name start with YY_, + are private implementation details. Do not rely on them. */ + /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.0" +#define YYBISON_VERSION "3.4.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -67,8 +71,8 @@ #define yynerrs parser_nerrs -/* Copy the first part of user declarations. */ -#line 19 "parser.y" /* yacc.c:339 */ +/* First part of user prologue. */ +#line 19 "parser.y" #include "vbscript.h" @@ -81,6 +85,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(vbscript); static int parser_error(parser_ctx_t *,const char*); static void parse_complete(parser_ctx_t*,BOOL); +static void handle_isexpression_script(parser_ctx_t *ctx, expression_t *expr); static void source_add_statement(parser_ctx_t*,statement_t*); static void source_add_class(parser_ctx_t*,class_decl_t*); @@ -124,21 +129,23 @@ static class_decl_t *add_dim_prop(parser_ctx_t*,class_decl_t*,dim_decl_t*,unsign static statement_t *link_statements(statement_t*,statement_t*); -static const WCHAR propertyW[] = {'p','r','o','p','e','r','t','y',0}; - #define STORAGE_IS_PRIVATE 1 #define STORAGE_IS_DEFAULT 2 #define CHECK_ERROR if(((parser_ctx_t*)ctx)->hres != S_OK) YYABORT -#line 136 "parser.tab.c" /* yacc.c:339 */ +#line 139 "parser.tab.c" -# ifndef YY_NULL -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif # else -# define YY_NULL 0 +# define YY_NULLPTR ((void*)0) # endif # endif @@ -150,8 +157,8 @@ static const WCHAR propertyW[] = {'p','r','o','p','e','r','t','y',0}; # define YYERROR_VERBOSE 0 #endif -/* In a future release of Bison, this section will be replaced - by #include "parser.tab.h". */ +/* Use api.header.include to #include this header + instead of duplicating it here. */ #ifndef YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_VBSCRIPT_PARSER_TAB_H_INCLUDED # define YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_VBSCRIPT_PARSER_TAB_H_INCLUDED /* Debug traces. */ @@ -167,83 +174,82 @@ extern int parser_debug; # define YYTOKENTYPE enum yytokentype { - tEOF = 258, - tNL = 259, - tREM = 260, + tEXPRESSION = 258, + tEOF = 259, + tNL = 260, tEMPTYBRACKETS = 261, - tTRUE = 262, - tFALSE = 263, - tNOT = 264, - tAND = 265, - tOR = 266, - tXOR = 267, - tEQV = 268, - tIMP = 269, - tNEQ = 270, - tIS = 271, - tLTEQ = 272, - tGTEQ = 273, - tMOD = 274, - tCALL = 275, - tDIM = 276, - tSUB = 277, - tFUNCTION = 278, - tPROPERTY = 279, - tGET = 280, - tLET = 281, - tCONST = 282, - tIF = 283, - tELSE = 284, - tELSEIF = 285, - tEND = 286, - tTHEN = 287, - tEXIT = 288, - tWHILE = 289, - tWEND = 290, - tDO = 291, - tLOOP = 292, - tUNTIL = 293, - tFOR = 294, - tTO = 295, - tSTEP = 296, - tEACH = 297, - tIN = 298, - tSELECT = 299, - tCASE = 300, - tBYREF = 301, - tBYVAL = 302, - tOPTION = 303, - tEXPLICIT = 304, - tSTOP = 305, - tNOTHING = 306, - tEMPTY = 307, - tNULL = 308, - tCLASS = 309, - tSET = 310, - tNEW = 311, - tPUBLIC = 312, - tPRIVATE = 313, - tDEFAULT = 314, - tME = 315, - tERROR = 316, - tNEXT = 317, - tON = 318, - tRESUME = 319, - tGOTO = 320, - tIdentifier = 321, - tString = 322, - tLong = 323, - tShort = 324, + tLTEQ = 262, + tGTEQ = 263, + tNEQ = 264, + tSTOP = 265, + tME = 266, + tREM = 267, + tTRUE = 268, + tFALSE = 269, + tNOT = 270, + tAND = 271, + tOR = 272, + tXOR = 273, + tEQV = 274, + tIMP = 275, + tIS = 276, + tMOD = 277, + tCALL = 278, + tDIM = 279, + tSUB = 280, + tFUNCTION = 281, + tGET = 282, + tLET = 283, + tCONST = 284, + tIF = 285, + tELSE = 286, + tELSEIF = 287, + tEND = 288, + tTHEN = 289, + tEXIT = 290, + tWHILE = 291, + tWEND = 292, + tDO = 293, + tLOOP = 294, + tUNTIL = 295, + tFOR = 296, + tTO = 297, + tEACH = 298, + tIN = 299, + tSELECT = 300, + tCASE = 301, + tBYREF = 302, + tBYVAL = 303, + tOPTION = 304, + tNOTHING = 305, + tEMPTY = 306, + tNULL = 307, + tCLASS = 308, + tSET = 309, + tNEW = 310, + tPUBLIC = 311, + tPRIVATE = 312, + tNEXT = 313, + tON = 314, + tRESUME = 315, + tGOTO = 316, + tIdentifier = 317, + tString = 318, + tDEFAULT = 319, + tERROR = 320, + tEXPLICIT = 321, + tPROPERTY = 322, + tSTEP = 323, + tInt = 324, tDouble = 325 }; #endif /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE YYSTYPE; union YYSTYPE { -#line 88 "parser.y" /* yacc.c:355 */ +#line 87 "parser.y" const WCHAR *string; statement_t *statement; @@ -258,12 +264,14 @@ union YYSTYPE const_decl_t *const_decl; case_clausule_t *case_clausule; unsigned uint; - LONG lng; + LONG integer; BOOL boolean; double dbl; -#line 266 "parser.tab.c" /* yacc.c:355 */ +#line 272 "parser.tab.c" + }; +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif @@ -274,9 +282,7 @@ int parser_parse (parser_ctx_t *ctx); #endif /* !YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_VBSCRIPT_PARSER_TAB_H_INCLUDED */ -/* Copy the second part of user declarations. */ -#line 280 "parser.tab.c" /* yacc.c:358 */ #ifdef short # undef short @@ -297,13 +303,13 @@ typedef signed char yytype_int8; #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else -typedef unsigned short int yytype_uint16; +typedef unsigned short yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else -typedef short int yytype_int16; +typedef short yytype_int16; #endif #ifndef YYSIZE_T @@ -315,7 +321,7 @@ typedef short int yytype_int16; # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else -# define YYSIZE_T unsigned int +# define YYSIZE_T unsigned # endif #endif @@ -333,14 +339,24 @@ typedef short int yytype_int16; # endif #endif -#ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if (! defined __GNUC__ || __GNUC__ < 2 \ - || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)) -# define __attribute__(Spec) /* empty */ +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ # endif #endif +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) @@ -348,7 +364,7 @@ typedef short int yytype_int16; # define YYUSE(E) /* empty */ #endif -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ @@ -368,6 +384,8 @@ typedef short int yytype_int16; #endif +#define YY_ASSERT(E) ((void) (0 && (E))) + #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -497,29 +515,29 @@ union yyalloc #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 5 +#define YYFINAL 48 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 944 +#define YYLAST 1153 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 87 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 60 +#define YYNNTS 63 /* YYNRULES -- Number of rules. */ -#define YYNRULES 169 +#define YYNRULES 232 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 343 +#define YYNSTATES 405 -/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned - by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 325 +/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, with out-of-bounds checking. */ #define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, without out-of-bounds checking. */ + as returned by yylex. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -561,23 +579,30 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 147, 147, 150, 151, 153, 155, 156, 159, 160, - 163, 164, 167, 170, 171, 172, 173, 174, 177, 178, - 179, 181, 182, 183, 185, 188, 191, 192, 193, 194, - 195, 196, 197, 198, 200, 201, 202, 203, 204, 206, - 208, 212, 213, 216, 217, 220, 221, 222, 225, 226, - 229, 230, 233, 236, 237, 240, 241, 244, 245, 248, - 250, 251, 254, 256, 259, 260, 263, 264, 267, 271, - 272, 275, 276, 277, 281, 282, 285, 286, 289, 290, - 291, 293, 295, 298, 299, 302, 303, 306, 307, 310, - 311, 314, 315, 318, 319, 322, 323, 326, 327, 328, - 329, 330, 331, 332, 333, 336, 337, 340, 341, 342, - 345, 346, 349, 350, 354, 355, 357, 361, 362, 365, - 366, 367, 368, 371, 372, 375, 376, 377, 378, 379, - 380, 381, 384, 385, 386, 387, 390, 391, 392, 395, - 396, 399, 402, 403, 405, 407, 408, 411, 413, 415, - 419, 421, 425, 426, 429, 430, 431, 434, 435, 438, - 439, 442, 443, 444, 448, 449, 453, 454, 455, 456 + 0, 148, 148, 149, 152, 153, 156, 157, 158, 161, + 162, 165, 166, 167, 170, 171, 174, 175, 178, 181, + 182, 183, 184, 185, 188, 189, 190, 192, 193, 194, + 196, 199, 202, 203, 204, 205, 206, 207, 208, 209, + 211, 212, 213, 214, 215, 217, 219, 223, 224, 227, + 228, 231, 232, 233, 236, 237, 240, 241, 244, 247, + 248, 251, 252, 255, 256, 259, 261, 262, 266, 267, + 270, 271, 274, 275, 278, 282, 283, 286, 287, 288, + 292, 293, 296, 297, 300, 301, 302, 305, 306, 309, + 310, 313, 314, 317, 318, 321, 322, 325, 326, 329, + 330, 333, 334, 337, 338, 339, 340, 341, 342, 343, + 344, 347, 348, 351, 352, 353, 356, 357, 360, 361, + 365, 366, 368, 372, 373, 376, 377, 378, 379, 380, + 383, 384, 387, 388, 389, 390, 391, 392, 393, 396, + 397, 398, 401, 402, 405, 406, 409, 412, 413, 414, + 416, 418, 420, 421, 422, 423, 426, 428, 430, 434, + 436, 440, 441, 444, 445, 446, 449, 450, 453, 454, + 457, 458, 459, 463, 464, 465, 466, 467, 468, 472, + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, + 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, + 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 525, + 526, 527, 528 }; #endif @@ -586,23 +611,24 @@ static const yytype_uint16 yyrline[] = First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "tEOF", "tNL", "tREM", "tEMPTYBRACKETS", - "tTRUE", "tFALSE", "tNOT", "tAND", "tOR", "tXOR", "tEQV", "tIMP", "tNEQ", - "tIS", "tLTEQ", "tGTEQ", "tMOD", "tCALL", "tDIM", "tSUB", "tFUNCTION", - "tPROPERTY", "tGET", "tLET", "tCONST", "tIF", "tELSE", "tELSEIF", "tEND", - "tTHEN", "tEXIT", "tWHILE", "tWEND", "tDO", "tLOOP", "tUNTIL", "tFOR", - "tTO", "tSTEP", "tEACH", "tIN", "tSELECT", "tCASE", "tBYREF", "tBYVAL", - "tOPTION", "tEXPLICIT", "tSTOP", "tNOTHING", "tEMPTY", "tNULL", "tCLASS", - "tSET", "tNEW", "tPUBLIC", "tPRIVATE", "tDEFAULT", "tME", "tERROR", - "tNEXT", "tON", "tRESUME", "tGOTO", "tIdentifier", "tString", "tLong", - "tShort", "tDouble", "':'", "'='", "'0'", "'.'", "','", "'('", "')'", - "'-'", "'>'", "'<'", "'&'", "'+'", "'\\\\'", "'*'", "'/'", "'^'", - "$accept", "Program", "OptionExplicit_opt", "SourceElements", - "StatementsNl_opt", "StatementsNl", "StatementNl", "Statement", - "SimpleStatement", "MemberExpression", "DimDeclList", "DimDecl", - "DimList", "ConstDeclList", "ConstDecl", "ConstExpression", "DoType", - "Step_opt", "IfStatement", "EndIf_opt", "ElseIfs_opt", "ElseIfs", - "ElseIf", "Else_opt", "CaseClausules", "Arguments_opt", + "$end", "error", "$undefined", "tEXPRESSION", "tEOF", "tNL", + "tEMPTYBRACKETS", "tLTEQ", "tGTEQ", "tNEQ", "tSTOP", "tME", "tREM", + "tTRUE", "tFALSE", "tNOT", "tAND", "tOR", "tXOR", "tEQV", "tIMP", "tIS", + "tMOD", "tCALL", "tDIM", "tSUB", "tFUNCTION", "tGET", "tLET", "tCONST", + "tIF", "tELSE", "tELSEIF", "tEND", "tTHEN", "tEXIT", "tWHILE", "tWEND", + "tDO", "tLOOP", "tUNTIL", "tFOR", "tTO", "tEACH", "tIN", "tSELECT", + "tCASE", "tBYREF", "tBYVAL", "tOPTION", "tNOTHING", "tEMPTY", "tNULL", + "tCLASS", "tSET", "tNEW", "tPUBLIC", "tPRIVATE", "tNEXT", "tON", + "tRESUME", "tGOTO", "tIdentifier", "tString", "tDEFAULT", "tERROR", + "tEXPLICIT", "tPROPERTY", "tSTEP", "tInt", "tDouble", "':'", "'='", + "'0'", "'.'", "','", "'('", "')'", "'-'", "'>'", "'<'", "'&'", "'+'", + "'\\\\'", "'*'", "'/'", "'^'", "$accept", "Program", + "OptionExplicit_opt", "SourceElements", "ExpressionNl_opt", + "BodyStatements", "StatementsNl_opt", "StatementsNl", "StatementNl", + "Statement", "SimpleStatement", "MemberExpression", "DimDeclList", + "DimDecl", "DimList", "ConstDeclList", "ConstDecl", "ConstExpression", + "DoType", "Step_opt", "IfStatement", "EndIf_opt", "ElseIfs_opt", + "ElseIfs", "ElseIf", "Else_opt", "CaseClausules", "Arguments_opt", "ArgumentList_opt", "ArgumentList", "EmptyBrackets_opt", "ExpressionList", "Expression", "EqvExpression", "XorExpression", "OrExpression", "AndExpression", "NotExpression", "EqualityExpression", @@ -612,7 +638,7 @@ static const char *const yytname[] = "NumericLiteralExpression", "IntegerValue", "PrimaryExpression", "ClassDeclaration", "ClassBody", "PropertyDecl", "FunctionDecl", "Storage_opt", "Storage", "ArgumentsDecl_opt", "ArgumentDeclList", - "ArgumentDecl", "Identifier", "StSep", YY_NULL + "ArgumentDecl", "Identifier", "DotIdentifier", "StSep", YY_NULLPTR }; #endif @@ -633,12 +659,12 @@ static const yytype_uint16 yytoknum[] = }; # endif -#define YYPACT_NINF -205 +#define YYPACT_NINF -294 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-205))) + (!!((Yystate) == (-294))) -#define YYTABLE_NINF -153 +#define YYTABLE_NINF -162 #define yytable_value_is_error(Yytable_value) \ 0 @@ -647,41 +673,47 @@ static const yytype_uint16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - -12, -8, 47, -205, 22, -205, 346, 22, 22, -205, - -205, 34, 35, -205, 35, 537, 134, 537, 12, 32, - 60, -205, 35, 34, -10, -205, -205, 65, -205, 639, - 537, -205, 57, 2, 427, -205, 85, -205, -205, -205, - 109, -205, -205, -205, -205, 4, -205, 33, 5, -205, - 46, 81, -205, -205, 537, -205, -205, -205, 35, -205, - -205, -205, -205, -205, 571, 4, 16, 126, 155, 160, - 168, -205, 37, 117, 29, 181, 119, 79, 130, -205, - 85, -205, -205, -205, -205, -205, -205, -205, 18, -205, - -205, 537, 680, 35, 146, 537, 22, 4, -205, 121, - -205, 13, -205, 639, -205, 457, 457, 147, -205, -205, - 77, 0, 35, 35, 35, 457, 148, -205, 35, -205, - 111, 35, 601, -205, -205, -205, -205, 537, 387, 537, - 537, 537, 537, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 733, 18, - 183, -205, 639, 178, 537, 18, 8, 152, 165, 156, - -205, -205, -205, 151, 1, 537, 457, -205, 6, 6, - -205, -205, -205, -205, 154, 157, -205, 136, -205, -205, - 126, 639, 143, 155, 160, 168, -205, 117, 117, 117, - 117, 117, 117, 117, 29, 181, 181, 119, 79, 130, - 130, -205, 198, 680, 95, -205, 537, 28, 189, 35, - 204, 22, 22, 96, 170, 537, -205, -205, -205, 223, - -205, -3, -205, 22, 22, -205, 111, -205, 210, 868, - 214, -205, -205, 212, 537, 18, 537, 507, 221, 22, - 199, 8, 8, 70, 22, 223, 35, 35, 177, 180, - 253, 774, 774, -205, 537, 231, -205, 210, 230, -205, - -205, 223, 815, 71, 22, 22, 17, 219, 8, 22, - -205, -205, 201, 202, 206, 8, 253, 253, -205, -3, - -205, 234, 239, 19, 269, 243, -205, -205, 213, 537, - 22, 868, 639, 537, -205, -205, -205, 6, 200, 203, - -205, -205, -205, -205, 255, 257, 274, 774, 254, -205, - 223, 815, -205, 189, -205, 22, -3, -3, -205, -205, - 639, -205, -205, 222, -205, 774, 216, 220, -205, -205, - 250, 22, 22, 259, 774, 774, -205, 267, 268, 266, - 278, -205, -205 + 34, 617, -19, 50, -294, -294, -294, -294, 617, -294, + -294, -294, 166, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, 617, 660, 660, 30, 2, 16, 43, + 96, 51, 111, -294, 37, 53, -17, 110, 100, 41, + 65, -294, 119, -294, -294, -294, -294, 15, -294, 466, + -294, -294, 19, -294, -294, -294, -294, 545, -294, -294, + -294, 617, 617, 617, 617, 617, 660, 660, 660, 660, + 660, 660, 660, 660, 660, 660, 660, 660, 660, 660, + 660, 1085, 15, 15, -294, -294, -294, 368, 166, 166, + 617, 117, 617, 20, 107, 163, 166, 368, 126, -294, + 149, 721, -294, 212, 152, 391, -294, 119, -294, -294, + 131, -294, -294, 545, 147, -8, 43, 96, 51, 111, + -294, 53, 53, 53, 53, 53, 53, 53, -17, 110, + 110, 100, 41, 65, 65, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, + -294, -294, -294, -294, -294, -294, -294, -294, -294, 2, + -294, 154, 11, -294, 160, 164, 18, -294, -294, -294, + -294, -294, 9, -294, -294, 617, 771, 166, 169, 617, + 15, 2, -294, 144, -294, -294, 721, 545, 172, -294, + -294, -32, 166, 166, -294, -294, 545, 171, 166, -294, + 68, 166, 116, 516, 821, 9, 199, -294, 721, 202, + 617, 9, 82, 175, 190, 176, -294, 4, 617, 13, + 13, -294, -294, -294, -294, 173, 177, -294, -16, -294, + -294, 721, 66, 216, 771, 142, -294, 617, 104, 211, + 166, 227, 15, 15, 85, 201, 617, -294, -294, 241, + 97, -294, 15, 15, -294, 68, -294, 234, 1021, 237, + -294, -294, 230, 617, 9, 617, 588, 238, 15, 221, + 82, 82, -5, 15, 241, 166, 166, 200, 203, 270, + 871, 871, -294, 617, 249, -294, 234, 248, -294, -294, + 241, 921, 7, 15, 15, 10, 239, 82, 15, -294, + -294, 224, 225, 226, 82, 270, 270, -294, 97, -294, + 250, 871, 212, 256, 113, 285, 258, -294, -294, 243, + 617, 15, 1021, 721, 617, -294, -294, -294, 13, 228, + 229, -294, -294, -294, -294, 267, -294, 271, 305, 971, + 283, -294, 241, 921, -294, 211, -294, 15, 97, 97, + -294, -294, 721, -294, -294, 257, -294, 871, 240, 242, + -294, -294, 281, 15, 15, 251, 871, 871, -294, 287, + 288, 255, 261, -294, -294 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -689,63 +721,71 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 3, 0, 0, 5, 0, 1, 152, 166, 167, 4, - 2, 0, 0, 165, 0, 0, 0, 0, 0, 0, - 0, 34, 0, 0, 155, 156, 140, 0, 164, 13, - 0, 6, 0, 15, 81, 22, 0, 123, 7, 27, - 0, 153, 41, 168, 169, 81, 21, 43, 45, 37, - 50, 0, 125, 126, 0, 131, 129, 130, 0, 127, - 134, 132, 135, 133, 0, 81, 0, 85, 87, 89, - 91, 93, 95, 97, 105, 107, 110, 112, 114, 117, - 120, 119, 128, 32, 30, 31, 28, 29, 0, 55, - 56, 0, 152, 0, 0, 0, 0, 81, 154, 0, - 14, 0, 12, 17, 82, 0, 0, 124, 18, 77, - 76, 78, 0, 0, 0, 0, 19, 74, 0, 47, - 0, 0, 0, 96, 121, 122, 124, 0, 152, 0, + 4, 9, 0, 0, 6, 145, 132, 133, 0, 138, + 136, 137, 0, 173, 134, 174, 175, 176, 177, 178, + 140, 141, 139, 0, 0, 0, 0, 87, 0, 91, + 93, 95, 97, 99, 101, 103, 111, 113, 116, 118, + 120, 123, 126, 125, 135, 130, 47, 0, 1, 161, + 102, 127, 0, 128, 129, 3, 88, 0, 131, 80, + 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 152, 0, - 0, 9, 10, 0, 0, 0, 152, 124, 0, 0, - 139, 16, 80, 0, 0, 0, 0, 42, 81, 81, - 44, 138, 136, 137, 0, 48, 51, 0, 52, 53, - 86, 8, 62, 88, 90, 92, 94, 99, 104, 103, - 102, 98, 100, 101, 106, 109, 108, 111, 113, 115, - 116, 118, 0, 152, 26, 11, 0, 0, 71, 0, - 0, 0, 0, 0, 153, 0, 35, 36, 75, 20, - 79, 0, 157, 0, 0, 46, 0, 54, 64, 152, - 0, 60, 23, 0, 0, 0, 0, 0, 0, 0, - 0, 152, 152, 0, 0, 33, 0, 0, 0, 159, - 81, 152, 152, 49, 0, 69, 65, 66, 62, 63, - 24, 25, 152, 57, 0, 0, 83, 0, 152, 0, - 146, 143, 0, 0, 0, 152, 81, 81, 158, 0, - 161, 0, 0, 0, 0, 0, 67, 61, 0, 0, - 0, 152, 8, 0, 40, 145, 141, 81, 0, 0, - 144, 162, 163, 160, 0, 0, 0, 152, 0, 39, - 58, 152, 72, 71, 84, 0, 0, 0, 150, 151, - 8, 70, 59, 0, 73, 152, 0, 0, 68, 38, - 0, 0, 0, 0, 152, 152, 147, 0, 0, 0, - 0, 148, 149 + 0, 0, 229, 230, 5, 2, 40, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 164, 165, + 0, 19, 7, 0, 21, 87, 28, 0, 8, 33, + 0, 162, 144, 0, 0, 84, 92, 94, 96, 98, + 100, 109, 108, 105, 110, 104, 106, 107, 112, 115, + 114, 117, 119, 121, 122, 124, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 179, 48, 231, 232, 87, + 27, 49, 51, 43, 56, 0, 0, 38, 36, 34, + 35, 37, 0, 61, 62, 0, 161, 0, 0, 0, + 0, 87, 163, 0, 20, 18, 23, 0, 131, 24, + 83, 82, 0, 0, 86, 81, 0, 25, 0, 53, + 0, 0, 0, 161, 161, 0, 0, 15, 16, 0, + 0, 0, 161, 131, 0, 0, 22, 0, 0, 87, + 87, 85, 50, 143, 142, 0, 54, 57, 0, 58, + 59, 14, 68, 0, 161, 32, 17, 0, 0, 77, + 0, 0, 154, 148, 0, 162, 0, 41, 42, 26, + 0, 166, 0, 0, 52, 0, 60, 70, 161, 0, + 66, 29, 0, 0, 0, 0, 0, 0, 152, 0, + 161, 161, 0, 150, 39, 0, 0, 0, 168, 87, + 161, 161, 55, 0, 75, 71, 72, 68, 69, 30, + 31, 161, 63, 0, 0, 89, 0, 161, 0, 155, + 149, 0, 0, 0, 161, 87, 87, 167, 0, 170, + 0, 161, 12, 0, 0, 0, 0, 73, 67, 0, + 0, 0, 161, 14, 0, 46, 153, 146, 87, 0, + 0, 151, 171, 172, 169, 0, 13, 0, 0, 161, + 0, 45, 64, 161, 78, 77, 90, 0, 0, 0, + 159, 160, 14, 76, 65, 0, 79, 161, 0, 0, + 74, 44, 0, 0, 0, 0, 161, 161, 156, 0, + 0, 0, 0, 157, 158 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -205, -205, -205, -205, -124, -148, 298, -26, -205, -6, - 188, 99, 83, 190, -205, -205, 106, -205, -205, 54, - -205, 58, -205, -205, 7, -25, -205, -21, -33, 20, - 135, 191, 193, 194, 192, -45, -205, 56, 185, 66, - 195, 182, 67, -56, -4, 211, 158, -205, -205, -205, - -204, -205, -138, -128, -87, -163, 53, -102, 48, 27 + -294, -294, -294, -294, -294, -293, -233, -231, -38, -85, + -294, -46, 101, 54, 40, 99, -294, -294, 69, -294, + -294, 23, -294, 22, -294, -294, -40, -99, -294, -103, + -96, -11, 3, 276, 282, 284, 290, 27, -294, 130, + 272, 102, 279, 269, 128, 39, 21, 120, 90, -294, + -294, -294, -268, -294, -229, -227, -199, -245, 25, -157, + -12, -294, 98 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 2, 3, 6, 150, 151, 152, 32, 33, 65, - 46, 47, 174, 49, 50, 178, 91, 290, 35, 231, - 255, 256, 257, 285, 238, 107, 108, 163, 117, 265, - 111, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 175, 37, 38, - 210, 211, 39, 40, 41, 223, 248, 249, 42, 9 + -1, 3, 4, 49, 26, 340, 236, 237, 238, 103, + 104, 27, 190, 191, 255, 193, 194, 259, 205, 351, + 106, 290, 314, 315, 316, 346, 297, 58, 219, 114, + 59, 324, 115, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 256, + 45, 108, 271, 272, 109, 110, 111, 282, 307, 308, + 46, 186, 84 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -753,285 +793,347 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 34, 110, 36, 100, 205, 45, 224, 36, 125, 123, - 104, 119, 104, 109, 127, 127, 7, 97, 212, 36, - 116, 13, 7, 34, 202, 36, 7, 127, 213, 209, - 127, 127, 127, 127, 43, 44, 1, 270, 271, -142, - 126, 4, 127, 246, 247, 92, 89, 5, 128, 98, - 90, 306, 133, 134, 135, 136, 13, 228, 13, 13, - 48, 102, 51, 28, 295, 24, 25, 94, 236, 214, - 96, 300, 157, 103, 93, 166, 166, 161, 160, 233, - 115, 120, 221, 8, 162, 127, 34, 186, 36, 8, - 160, 201, 293, 8, 26, 272, 273, 34, 28, 36, - 28, 28, 182, 212, 212, 95, 124, 141, 118, 137, - 30, 142, 289, 213, 213, 148, 138, 139, 113, 114, - 243, 121, 34, 156, 36, 274, 99, 281, 282, 89, - 212, 113, 114, 90, 315, 222, 222, 212, 288, 129, - 213, 153, 34, 312, 36, 220, 34, 213, 36, -74, - 66, -74, 88, 122, 214, 214, 83, 84, 85, 112, - 167, 168, 169, 145, 146, 101, 48, 130, 313, 51, - 86, 131, 229, 87, 230, 34, 203, 36, 132, 171, - 172, 214, 208, 321, 173, 158, 159, 323, 214, 187, - 188, 189, 190, 191, 192, 193, 328, 34, 140, 36, - 143, 330, 144, 258, 60, 61, 62, 195, 196, 63, - 337, 338, 199, 200, 326, 327, 147, 280, 154, 165, - 204, 206, -124, 34, 215, 36, 149, 216, 218, 217, - 155, 225, 226, 232, 237, 240, 244, 127, 241, 242, - 254, 164, 259, 301, 302, 34, 34, 36, 36, 260, - 251, 252, 267, 269, 278, 279, 34, 48, 36, 104, - 284, 230, 262, 294, 222, 304, 268, 297, 298, 250, - 305, 275, 299, 307, 308, 309, 316, 318, 320, 317, - 319, 333, 322, 336, 329, 34, 34, 36, 36, 207, - 341, 291, 292, 331, 276, 277, 296, 332, 339, 340, - 219, 34, 342, 36, 31, 34, 170, 36, 239, 253, - 234, 176, 287, 314, 34, 286, 36, 311, 180, 34, - 324, 36, 183, 185, 184, 194, 198, 250, 34, 34, - 36, 36, 303, 179, 0, 227, 0, 0, 197, 0, - 0, 235, 325, 0, 0, 0, 0, 0, 0, 10, - 245, 0, 0, 0, 0, 0, 0, 0, 334, 335, - 0, 0, 0, 0, 250, 250, 11, 12, 0, 261, - 13, 263, 266, 14, 15, 0, 0, 0, 0, 16, - 17, 0, 18, 0, 0, 19, 0, 0, 0, 283, - 20, 181, 0, 0, 0, 0, 21, 0, 0, 0, - 22, 23, 0, 24, 25, 0, 26, 11, 12, 27, - 0, 13, 28, 0, 14, 15, 0, 29, 0, 0, - 16, 17, 30, 18, 310, 0, 19, 0, 266, 0, - 0, 20, 0, 104, 52, 53, 54, 21, 0, 0, - 0, 0, 23, 0, 24, 25, 0, 26, 0, 0, - 27, 13, 0, 28, 0, 0, 0, 0, 29, 0, - 0, 0, 0, 30, 52, 53, 54, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 55, 56, - 57, 13, 0, 58, 0, 0, 0, 26, 0, 0, - 0, 0, 0, 28, 59, 60, 61, 62, 0, 0, - 63, 0, 105, 106, 0, 64, 0, 0, 55, 56, - 57, 0, 0, 58, 52, 53, 54, 26, 0, 0, - 0, 0, 0, 28, 59, 60, 61, 62, 0, 0, - 63, 13, 105, 30, 0, 64, 264, 0, 0, 0, - 0, 0, 0, 0, 52, 53, 54, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 55, 56, - 57, 13, 0, 58, 0, 0, 0, 26, 0, 0, - 0, 0, 0, 28, 59, 60, 61, 62, 52, 53, - 63, 0, 0, 30, 0, 64, 0, 0, 55, 56, - 57, 0, 0, 58, 0, 13, 0, 26, 0, 0, - 0, 0, 0, 28, 59, 60, 61, 62, 52, 53, - 63, 0, 0, 30, 0, 64, 0, 0, 0, 0, - 0, 0, 55, 56, 57, 0, 0, 58, 0, 0, - 0, 26, 0, 0, 0, 0, 0, 28, 59, 60, - 61, 62, 0, 0, 63, 0, 0, 30, 0, 64, - 0, 0, 55, 56, 57, 0, 0, 0, 0, 11, - 12, -152, -152, 13, 0, 0, 14, 15, 59, 60, - 61, 62, 16, 17, 63, 18, 0, 0, 19, 177, - 0, 0, 0, 20, 0, 0, 0, 0, 0, 21, - 0, 0, 0, 0, 23, 0, 24, 25, 0, 26, - 11, 12, 27, 0, 13, 28, 0, 14, 15, 0, - 29, 0, 0, 16, 17, 30, 18, -8, 0, 19, - 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 0, 23, 0, 24, 25, 0, - 26, 0, 0, 27, 0, 0, 28, 0, 0, 0, - 0, 29, 0, 11, 12, 0, 30, 13, 0, 0, - 14, 15, 0, 0, 0, 0, 16, 17, -8, 18, - 0, 0, 19, 0, 0, 0, 0, 20, 0, 0, - 0, 0, 0, 21, 0, 0, 0, 0, 23, 0, - 24, 25, 0, 26, 11, 12, 27, 0, 13, 28, - 0, 14, 15, 0, 29, -8, 0, 16, 17, 30, - 18, 0, 0, 19, 0, 0, 0, 0, 20, 0, - 0, 0, 0, 0, 21, 0, 0, 0, 0, 23, - 0, 24, 25, 0, 26, 11, 12, 27, 0, 13, - 28, 0, 14, 15, 0, 29, 0, 0, 16, 17, - 30, 18, 0, 0, 19, 0, 0, 0, 0, 20, - 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, - 23, 0, 24, 25, 0, 26, 0, -8, 27, 0, - 0, 28, 0, 0, 0, 0, 29, 0, 11, 12, - 0, 30, 13, 0, 0, 14, 15, 0, 0, 0, - 0, 16, 17, 0, 18, 0, 0, 19, 0, 0, - 0, 0, 20, 0, 0, 0, 0, 0, 21, 0, - 0, 0, 0, 23, 0, 24, 25, 0, 26, 0, - 0, 27, 0, 0, 28, 0, 0, 0, 0, 29, - 0, 0, 0, 0, 30 + 51, 263, 220, 105, 28, 283, 218, 266, 56, 221, + 224, 102, 61, 273, 82, 274, 214, 229, 343, 56, + 82, 60, 331, 332, 61, 82, 52, 61, 287, 61, + 61, 292, 329, 330, 55, 50, 61, 1, 61, 61, + -80, 189, -80, 275, 66, 67, 68, 47, 366, 333, + 48, 211, 233, 20, 21, 105, 203, 22, 69, 356, + 204, 74, 62, 53, 54, 75, 361, 226, 64, 185, + 107, 273, 273, 274, 274, 350, 192, 195, 57, 226, + 83, 112, 208, 2, 210, 354, 83, 230, 349, 280, + 227, 83, 120, 196, 392, 202, 112, 288, 273, 289, + 274, 275, 275, 399, 400, 273, 270, 274, 107, 70, + 222, 223, 243, 377, 63, -147, 71, 72, 107, 135, + 375, 374, 107, 251, 61, 78, 79, 65, 275, 6, + 7, 246, 76, 61, 73, 275, 383, 253, 98, 99, + 385, 254, 197, 198, 305, 306, 295, 368, 262, 390, + 207, 80, 302, 281, 281, 199, 222, 223, 200, 13, + 105, 15, 16, 17, 18, 19, 9, 10, 11, 13, + 105, 15, 16, 17, 18, 19, 129, 130, 203, 14, + 187, 188, 204, 77, 201, 20, 21, 105, 105, 22, + 212, 206, 105, 81, 258, 239, 121, 122, 123, 124, + 125, 126, 127, 317, 244, 245, 133, 134, 235, 209, + 249, 250, 241, 339, 213, 105, 192, 215, 105, 195, + 247, 388, 389, 216, 225, 342, 342, 107, 13, 228, + 15, 16, 17, 18, 19, 231, 232, 107, 265, 362, + 363, 240, 105, 268, 248, -131, 267, 276, 277, 278, + 284, 279, 285, 291, 107, 107, 342, 296, 192, 107, + 299, 61, 281, 303, 105, 105, 313, 318, 309, 319, + 294, 326, 341, 341, 328, 105, 56, 337, 338, 304, + 345, 289, 107, 365, 355, 107, 358, 359, 360, 367, + 369, 370, 380, 335, 336, 105, 320, 381, 322, 325, + 234, 371, 342, 341, 378, 379, 105, 105, 242, 107, + 382, 342, 342, 384, 395, 391, 344, 393, 398, 394, + 401, 402, 403, 105, 298, 312, 309, 105, 404, 252, + 257, 107, 107, 264, 293, 386, 105, 116, 347, 269, + 348, 105, 107, 376, 117, 128, 132, 118, 286, 341, + 105, 105, 260, 372, 119, 131, 0, 325, 341, 341, + 0, 0, 107, 364, 0, 0, 309, 309, 0, 0, + 300, 301, 0, 107, 107, 0, 0, 0, 0, 5, + 310, 311, 0, 0, 0, 0, 0, 0, 0, 0, + 107, 0, 321, 0, 107, 0, 327, 56, 0, 0, + 0, 334, 5, 107, 6, 7, 8, 0, 107, 0, + 0, 0, 0, 0, 0, 0, 0, 107, 107, 0, + 0, 352, 353, 0, 0, 0, 357, 0, 0, 0, + 13, 0, 15, 16, 17, 18, 19, 0, 0, 0, + 0, 9, 10, 11, 23, 0, 12, 0, 0, 373, + 0, 0, 0, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 0, 0, 22, 0, 113, 217, 0, 24, + 85, 0, 0, 25, 0, 387, 86, 5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, + 88, 396, 397, 0, 0, 89, 90, 0, 0, 0, + 0, 91, 92, 0, 93, 0, 0, 94, 0, 0, + 0, 95, 0, 0, 0, 0, 0, 0, 0, 96, + 97, 261, 98, 99, 0, 100, 86, 5, 13, 0, + 15, 16, 17, 18, 19, 0, 0, 101, 0, 87, + 88, 0, 23, 0, 0, 89, 90, 0, 0, 0, + 0, 91, 92, 0, 93, 0, 5, 94, 6, 7, + 8, 95, 0, 0, 0, 0, 0, 0, 0, 0, + 97, 0, 98, 99, 0, 100, 0, 0, 13, 0, + 15, 16, 17, 18, 19, 0, 0, 101, 0, 0, + 0, 0, 23, 0, 0, 9, 10, 11, 0, 5, + 12, 6, 7, 8, 0, 0, 0, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 0, 0, 22, 323, + 113, 23, 0, 24, 0, 0, 0, 25, 5, 0, + 6, 7, 8, 0, 0, 0, 0, 0, 9, 10, + 11, 0, 0, 12, 0, 0, 0, 0, 0, 0, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 0, + 0, 22, 0, 0, 23, 0, 24, 9, 10, 11, + 25, 5, 12, 6, 7, 0, 0, 0, 0, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 0, 0, + 22, 0, 0, 23, 0, 24, 0, 0, 0, 25, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 9, 10, 11, 0, 0, 12, 0, 0, 0, 0, + 0, 0, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 86, 5, 22, 0, 0, 23, 0, 24, 0, + 0, 0, 25, 0, 87, 88, -161, -161, 0, 0, + 89, 90, 0, 0, 0, 0, 91, 92, 0, 93, + 0, 0, 94, 0, 0, 0, 95, 0, 0, 0, + 0, 0, 0, 0, 0, 97, 0, 98, 99, 0, + 100, 86, 5, 13, 0, 15, 16, 17, 18, 19, + 0, 0, 101, 0, 87, 88, 0, 23, 0, 0, + 89, 90, 0, 0, 0, 0, 91, 92, 0, 93, + -14, 0, 94, 0, 0, 0, 95, 0, 0, 0, + 0, 0, 0, 0, 0, 97, 0, 98, 99, 0, + 100, 86, 5, 13, 0, 15, 16, 17, 18, 19, + 0, 0, 101, 0, 87, 88, 0, 23, 0, 0, + 89, 90, 0, 0, 0, 0, 91, 92, -14, 93, + 0, 0, 94, 0, 0, 0, 95, 0, 0, 0, + 0, 0, 0, 0, 0, 97, 0, 98, 99, 0, + 100, 86, 5, 13, 0, 15, 16, 17, 18, 19, + 0, 0, 101, 0, 87, 88, 0, 23, 0, 0, + 89, 90, 0, 0, -11, 0, 91, 92, 0, 93, + 0, 0, 94, 0, 0, 0, 95, 0, 0, 0, + 0, 0, 0, 0, 0, 97, 0, 98, 99, 0, + 100, 86, 5, 13, 0, 15, 16, 17, 18, 19, + 0, 0, 101, 0, 87, 88, 0, 23, 0, 0, + 89, 90, 0, 0, 0, 0, 91, 92, 0, 93, + 0, 0, 94, 0, 0, 0, 95, 0, 0, 0, + 0, 0, 0, 0, 0, 97, 0, 98, 99, -14, + 100, 86, 5, 13, 0, 15, 16, 17, 18, 19, + 0, 0, 101, 0, 87, 88, 0, 23, 0, 0, + 89, 90, 0, 0, -14, 0, 91, 92, 0, 93, + 0, 0, 94, 0, 0, 0, 95, 0, 0, 0, + 0, 0, 0, 0, 0, 97, 0, 98, 99, 0, + 100, 86, 5, 13, 0, 15, 16, 17, 18, 19, + 0, 0, 101, 0, 87, 88, 0, 23, 0, 0, + 89, 90, 0, 0, 0, 0, 91, 92, 0, 93, + 0, 0, 94, 0, 0, 0, 95, 0, 0, 0, + 0, 0, 0, 0, 0, 97, 0, 98, 99, 0, + 100, 0, 0, 13, 0, 15, 16, 17, 18, 19, + 0, 0, 101, 0, 0, 0, 0, 23, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 13, 0, 15, + 16, 17, 18, 19 }; static const yytype_int16 yycheck[] = { - 6, 34, 6, 29, 152, 11, 169, 11, 64, 54, - 6, 6, 6, 34, 14, 14, 4, 23, 156, 23, - 45, 24, 4, 29, 148, 29, 4, 14, 156, 21, - 14, 14, 14, 14, 7, 8, 48, 241, 242, 31, - 65, 49, 14, 46, 47, 18, 34, 0, 32, 59, - 38, 32, 15, 16, 17, 18, 24, 181, 24, 24, - 12, 4, 14, 66, 268, 57, 58, 19, 40, 156, - 22, 275, 97, 71, 42, 75, 75, 103, 77, 203, - 76, 76, 76, 71, 105, 14, 92, 132, 92, 71, - 77, 147, 75, 71, 60, 25, 26, 103, 66, 103, - 66, 66, 128, 241, 242, 45, 58, 78, 75, 72, - 76, 82, 41, 241, 242, 88, 79, 80, 22, 23, - 24, 75, 128, 96, 128, 55, 61, 251, 252, 34, - 268, 22, 23, 38, 297, 168, 169, 275, 262, 13, - 268, 93, 148, 291, 148, 166, 152, 275, 152, 72, - 15, 74, 17, 72, 241, 242, 22, 23, 24, 74, - 112, 113, 114, 84, 85, 30, 118, 12, 292, 121, - 36, 11, 29, 39, 31, 181, 149, 181, 10, 68, - 69, 268, 155, 307, 73, 64, 65, 311, 275, 133, - 134, 135, 136, 137, 138, 139, 320, 203, 81, 203, - 19, 325, 83, 229, 68, 69, 70, 141, 142, 73, - 334, 335, 145, 146, 316, 317, 86, 250, 72, 72, - 37, 43, 74, 229, 72, 229, 91, 62, 77, 73, - 95, 77, 75, 35, 45, 31, 66, 14, 211, 212, - 30, 106, 28, 276, 277, 251, 252, 251, 252, 37, - 223, 224, 31, 54, 77, 75, 262, 209, 262, 6, - 29, 31, 235, 44, 297, 31, 239, 66, 66, 221, - 31, 244, 66, 4, 31, 62, 76, 22, 4, 76, - 23, 31, 28, 24, 62, 291, 292, 291, 292, 154, - 24, 264, 265, 77, 246, 247, 269, 77, 31, 31, - 165, 307, 24, 307, 6, 311, 118, 311, 209, 226, - 204, 121, 258, 293, 320, 257, 320, 290, 127, 325, - 313, 325, 129, 131, 130, 140, 144, 279, 334, 335, - 334, 335, 279, 122, -1, 177, -1, -1, 143, -1, - -1, 206, 315, -1, -1, -1, -1, -1, -1, 3, - 215, -1, -1, -1, -1, -1, -1, -1, 331, 332, - -1, -1, -1, -1, 316, 317, 20, 21, -1, 234, - 24, 236, 237, 27, 28, -1, -1, -1, -1, 33, - 34, -1, 36, -1, -1, 39, -1, -1, -1, 254, - 44, 4, -1, -1, -1, -1, 50, -1, -1, -1, - 54, 55, -1, 57, 58, -1, 60, 20, 21, 63, - -1, 24, 66, -1, 27, 28, -1, 71, -1, -1, - 33, 34, 76, 36, 289, -1, 39, -1, 293, -1, - -1, 44, -1, 6, 7, 8, 9, 50, -1, -1, - -1, -1, 55, -1, 57, 58, -1, 60, -1, -1, - 63, 24, -1, 66, -1, -1, -1, -1, 71, -1, - -1, -1, -1, 76, 7, 8, 9, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, - 53, 24, -1, 56, -1, -1, -1, 60, -1, -1, - -1, -1, -1, 66, 67, 68, 69, 70, -1, -1, - 73, -1, 75, 76, -1, 78, -1, -1, 51, 52, - 53, -1, -1, 56, 7, 8, 9, 60, -1, -1, - -1, -1, -1, 66, 67, 68, 69, 70, -1, -1, - 73, 24, 75, 76, -1, 78, 29, -1, -1, -1, - -1, -1, -1, -1, 7, 8, 9, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, - 53, 24, -1, 56, -1, -1, -1, 60, -1, -1, - -1, -1, -1, 66, 67, 68, 69, 70, 7, 8, - 73, -1, -1, 76, -1, 78, -1, -1, 51, 52, - 53, -1, -1, 56, -1, 24, -1, 60, -1, -1, - -1, -1, -1, 66, 67, 68, 69, 70, 7, 8, - 73, -1, -1, 76, -1, 78, -1, -1, -1, -1, - -1, -1, 51, 52, 53, -1, -1, 56, -1, -1, - -1, 60, -1, -1, -1, -1, -1, 66, 67, 68, - 69, 70, -1, -1, 73, -1, -1, 76, -1, 78, - -1, -1, 51, 52, 53, -1, -1, -1, -1, 20, - 21, 22, 23, 24, -1, -1, 27, 28, 67, 68, - 69, 70, 33, 34, 73, 36, -1, -1, 39, 78, - -1, -1, -1, 44, -1, -1, -1, -1, -1, 50, - -1, -1, -1, -1, 55, -1, 57, 58, -1, 60, - 20, 21, 63, -1, 24, 66, -1, 27, 28, -1, - 71, -1, -1, 33, 34, 76, 36, 37, -1, 39, - -1, -1, -1, -1, 44, -1, -1, -1, -1, -1, - 50, -1, -1, -1, -1, 55, -1, 57, 58, -1, - 60, -1, -1, 63, -1, -1, 66, -1, -1, -1, - -1, 71, -1, 20, 21, -1, 76, 24, -1, -1, - 27, 28, -1, -1, -1, -1, 33, 34, 35, 36, - -1, -1, 39, -1, -1, -1, -1, 44, -1, -1, - -1, -1, -1, 50, -1, -1, -1, -1, 55, -1, - 57, 58, -1, 60, 20, 21, 63, -1, 24, 66, - -1, 27, 28, -1, 71, 31, -1, 33, 34, 76, - 36, -1, -1, 39, -1, -1, -1, -1, 44, -1, - -1, -1, -1, -1, 50, -1, -1, -1, -1, 55, - -1, 57, 58, -1, 60, 20, 21, 63, -1, 24, - 66, -1, 27, 28, -1, 71, -1, -1, 33, 34, - 76, 36, -1, -1, 39, -1, -1, -1, -1, 44, - -1, -1, -1, -1, -1, 50, -1, -1, -1, -1, - 55, -1, 57, 58, -1, 60, -1, 62, 63, -1, - -1, 66, -1, -1, -1, -1, 71, -1, 20, 21, - -1, 76, 24, -1, -1, 27, 28, -1, -1, -1, - -1, 33, 34, -1, 36, -1, -1, 39, -1, -1, - -1, -1, 44, -1, -1, -1, -1, -1, 50, -1, - -1, -1, -1, 55, -1, 57, 58, -1, 60, -1, - -1, 63, -1, -1, 66, -1, -1, -1, -1, 71, - -1, -1, -1, -1, 76 + 12, 234, 105, 49, 1, 250, 105, 238, 6, 105, + 113, 49, 20, 242, 5, 242, 101, 6, 311, 6, + 5, 5, 27, 28, 20, 5, 23, 20, 261, 20, + 20, 264, 300, 301, 4, 8, 20, 3, 20, 20, + 72, 87, 74, 242, 7, 8, 9, 66, 341, 54, + 0, 97, 34, 69, 70, 101, 36, 73, 21, 327, + 40, 78, 19, 24, 25, 82, 334, 75, 17, 81, + 49, 300, 301, 300, 301, 68, 88, 89, 76, 75, + 71, 77, 94, 49, 96, 75, 71, 76, 321, 76, + 189, 71, 65, 90, 387, 92, 77, 31, 327, 33, + 327, 300, 301, 396, 397, 334, 24, 334, 87, 72, + 25, 26, 211, 358, 18, 33, 79, 80, 97, 80, + 353, 352, 101, 226, 20, 84, 85, 16, 327, 13, + 14, 216, 22, 20, 81, 334, 369, 69, 56, 57, + 373, 73, 25, 26, 47, 48, 42, 34, 233, 382, + 43, 86, 67, 249, 250, 38, 25, 26, 41, 62, + 206, 64, 65, 66, 67, 68, 50, 51, 52, 62, + 216, 64, 65, 66, 67, 68, 74, 75, 36, 63, + 82, 83, 40, 83, 67, 69, 70, 233, 234, 73, + 64, 93, 238, 74, 78, 207, 66, 67, 68, 69, + 70, 71, 72, 288, 60, 61, 78, 79, 205, 46, + 222, 223, 209, 309, 65, 261, 228, 5, 264, 231, + 217, 378, 379, 71, 77, 310, 311, 206, 62, 75, + 64, 65, 66, 67, 68, 75, 72, 216, 39, 335, + 336, 72, 288, 240, 72, 74, 44, 72, 58, 73, + 77, 248, 75, 37, 233, 234, 341, 46, 270, 238, + 33, 20, 358, 62, 310, 311, 32, 30, 280, 39, + 267, 33, 310, 311, 53, 321, 6, 77, 75, 276, + 31, 33, 261, 33, 45, 264, 62, 62, 62, 33, + 5, 33, 25, 305, 306, 341, 293, 26, 295, 296, + 202, 58, 387, 341, 76, 76, 352, 353, 210, 288, + 5, 396, 397, 30, 33, 58, 313, 77, 67, 77, + 33, 33, 67, 369, 270, 285, 338, 373, 67, 228, + 231, 310, 311, 235, 265, 375, 382, 61, 316, 241, + 317, 387, 321, 354, 62, 73, 77, 63, 258, 387, + 396, 397, 232, 350, 64, 76, -1, 354, 396, 397, + -1, -1, 341, 338, -1, -1, 378, 379, -1, -1, + 272, 273, -1, 352, 353, -1, -1, -1, -1, 11, + 282, 283, -1, -1, -1, -1, -1, -1, -1, -1, + 369, -1, 294, -1, 373, -1, 298, 6, -1, -1, + -1, 303, 11, 382, 13, 14, 15, -1, 387, -1, + -1, -1, -1, -1, -1, -1, -1, 396, 397, -1, + -1, 323, 324, -1, -1, -1, 328, -1, -1, -1, + 62, -1, 64, 65, 66, 67, 68, -1, -1, -1, + -1, 50, 51, 52, 76, -1, 55, -1, -1, 351, + -1, -1, -1, 62, 63, 64, 65, 66, 67, 68, + 69, 70, -1, -1, 73, -1, 75, 76, -1, 78, + 4, -1, -1, 82, -1, 377, 10, 11, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 23, + 24, 393, 394, -1, -1, 29, 30, -1, -1, -1, + -1, 35, 36, -1, 38, -1, -1, 41, -1, -1, + -1, 45, -1, -1, -1, -1, -1, -1, -1, 53, + 54, 5, 56, 57, -1, 59, 10, 11, 62, -1, + 64, 65, 66, 67, 68, -1, -1, 71, -1, 23, + 24, -1, 76, -1, -1, 29, 30, -1, -1, -1, + -1, 35, 36, -1, 38, -1, 11, 41, 13, 14, + 15, 45, -1, -1, -1, -1, -1, -1, -1, -1, + 54, -1, 56, 57, -1, 59, -1, -1, 62, -1, + 64, 65, 66, 67, 68, -1, -1, 71, -1, -1, + -1, -1, 76, -1, -1, 50, 51, 52, -1, 11, + 55, 13, 14, 15, -1, -1, -1, 62, 63, 64, + 65, 66, 67, 68, 69, 70, -1, -1, 73, 31, + 75, 76, -1, 78, -1, -1, -1, 82, 11, -1, + 13, 14, 15, -1, -1, -1, -1, -1, 50, 51, + 52, -1, -1, 55, -1, -1, -1, -1, -1, -1, + 62, 63, 64, 65, 66, 67, 68, 69, 70, -1, + -1, 73, -1, -1, 76, -1, 78, 50, 51, 52, + 82, 11, 55, 13, 14, -1, -1, -1, -1, 62, + 63, 64, 65, 66, 67, 68, 69, 70, -1, -1, + 73, -1, -1, 76, -1, 78, -1, -1, -1, 82, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 50, 51, 52, -1, -1, 55, -1, -1, -1, -1, + -1, -1, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 10, 11, 73, -1, -1, 76, -1, 78, -1, + -1, -1, 82, -1, 23, 24, 25, 26, -1, -1, + 29, 30, -1, -1, -1, -1, 35, 36, -1, 38, + -1, -1, 41, -1, -1, -1, 45, -1, -1, -1, + -1, -1, -1, -1, -1, 54, -1, 56, 57, -1, + 59, 10, 11, 62, -1, 64, 65, 66, 67, 68, + -1, -1, 71, -1, 23, 24, -1, 76, -1, -1, + 29, 30, -1, -1, -1, -1, 35, 36, -1, 38, + 39, -1, 41, -1, -1, -1, 45, -1, -1, -1, + -1, -1, -1, -1, -1, 54, -1, 56, 57, -1, + 59, 10, 11, 62, -1, 64, 65, 66, 67, 68, + -1, -1, 71, -1, 23, 24, -1, 76, -1, -1, + 29, 30, -1, -1, -1, -1, 35, 36, 37, 38, + -1, -1, 41, -1, -1, -1, 45, -1, -1, -1, + -1, -1, -1, -1, -1, 54, -1, 56, 57, -1, + 59, 10, 11, 62, -1, 64, 65, 66, 67, 68, + -1, -1, 71, -1, 23, 24, -1, 76, -1, -1, + 29, 30, -1, -1, 33, -1, 35, 36, -1, 38, + -1, -1, 41, -1, -1, -1, 45, -1, -1, -1, + -1, -1, -1, -1, -1, 54, -1, 56, 57, -1, + 59, 10, 11, 62, -1, 64, 65, 66, 67, 68, + -1, -1, 71, -1, 23, 24, -1, 76, -1, -1, + 29, 30, -1, -1, -1, -1, 35, 36, -1, 38, + -1, -1, 41, -1, -1, -1, 45, -1, -1, -1, + -1, -1, -1, -1, -1, 54, -1, 56, 57, 58, + 59, 10, 11, 62, -1, 64, 65, 66, 67, 68, + -1, -1, 71, -1, 23, 24, -1, 76, -1, -1, + 29, 30, -1, -1, 33, -1, 35, 36, -1, 38, + -1, -1, 41, -1, -1, -1, 45, -1, -1, -1, + -1, -1, -1, -1, -1, 54, -1, 56, 57, -1, + 59, 10, 11, 62, -1, 64, 65, 66, 67, 68, + -1, -1, 71, -1, 23, 24, -1, 76, -1, -1, + 29, 30, -1, -1, -1, -1, 35, 36, -1, 38, + -1, -1, 41, -1, -1, -1, 45, -1, -1, -1, + -1, -1, -1, -1, -1, 54, -1, 56, 57, -1, + 59, -1, -1, 62, -1, 64, 65, 66, 67, 68, + -1, -1, 71, -1, -1, -1, -1, 76, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, + 65, 66, 67, 68 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 48, 88, 89, 49, 0, 90, 4, 71, 146, - 3, 20, 21, 24, 27, 28, 33, 34, 36, 39, - 44, 50, 54, 55, 57, 58, 60, 63, 66, 71, - 76, 93, 94, 95, 96, 105, 131, 135, 136, 139, - 140, 141, 145, 146, 146, 96, 97, 98, 145, 100, - 101, 145, 7, 8, 9, 51, 52, 53, 56, 67, - 68, 69, 70, 73, 78, 96, 117, 118, 119, 120, + 0, 3, 49, 88, 89, 11, 13, 14, 15, 50, + 51, 52, 55, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 73, 76, 78, 82, 91, 98, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 22, 23, 24, 36, 39, 117, 34, - 38, 103, 146, 42, 145, 45, 145, 96, 59, 61, - 94, 117, 4, 71, 6, 75, 76, 112, 113, 114, - 115, 117, 74, 22, 23, 76, 112, 115, 75, 6, - 76, 75, 72, 122, 145, 130, 112, 14, 32, 13, - 12, 11, 10, 15, 16, 17, 18, 72, 79, 80, - 81, 78, 82, 19, 83, 84, 85, 86, 146, 117, - 91, 92, 93, 145, 72, 117, 146, 112, 64, 65, - 77, 94, 114, 114, 117, 72, 75, 145, 145, 145, - 97, 68, 69, 73, 99, 134, 100, 78, 102, 132, - 118, 4, 94, 119, 120, 121, 122, 124, 124, 124, - 124, 124, 124, 124, 125, 126, 126, 127, 128, 129, - 129, 130, 91, 146, 37, 92, 43, 117, 146, 21, - 137, 138, 139, 140, 141, 72, 62, 73, 77, 117, - 114, 76, 115, 142, 142, 77, 75, 133, 91, 29, - 31, 106, 35, 91, 103, 117, 40, 45, 111, 98, - 31, 146, 146, 24, 66, 117, 46, 47, 143, 144, - 145, 146, 146, 99, 30, 107, 108, 109, 94, 28, - 37, 117, 146, 117, 29, 116, 117, 31, 146, 54, - 137, 137, 25, 26, 55, 146, 145, 145, 77, 75, - 115, 91, 91, 117, 29, 110, 108, 106, 91, 41, - 104, 146, 146, 75, 44, 137, 146, 66, 66, 66, - 137, 115, 115, 143, 31, 31, 32, 4, 31, 62, - 117, 146, 92, 91, 116, 142, 76, 76, 22, 23, - 4, 91, 28, 91, 111, 146, 144, 144, 91, 62, - 91, 77, 77, 31, 146, 146, 24, 91, 91, 31, - 31, 24, 24 + 131, 132, 133, 134, 135, 137, 147, 66, 0, 90, + 124, 147, 119, 132, 132, 4, 6, 76, 114, 117, + 5, 20, 19, 18, 17, 16, 7, 8, 9, 21, + 72, 79, 80, 81, 78, 82, 22, 83, 84, 85, + 86, 74, 5, 71, 149, 4, 10, 23, 24, 29, + 30, 35, 36, 38, 41, 45, 53, 54, 56, 57, + 59, 71, 95, 96, 97, 98, 107, 133, 138, 141, + 142, 143, 77, 75, 116, 119, 120, 121, 122, 123, + 124, 126, 126, 126, 126, 126, 126, 126, 127, 128, + 128, 129, 130, 131, 131, 132, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 147, 148, 149, 149, 98, + 99, 100, 147, 102, 103, 147, 119, 25, 26, 38, + 41, 67, 119, 36, 40, 105, 149, 43, 147, 46, + 147, 98, 64, 65, 96, 5, 71, 76, 114, 115, + 116, 117, 25, 26, 116, 77, 75, 114, 75, 6, + 76, 75, 72, 34, 149, 119, 93, 94, 95, 147, + 72, 119, 149, 114, 60, 61, 96, 119, 72, 147, + 147, 116, 99, 69, 73, 101, 136, 102, 78, 104, + 134, 5, 96, 93, 149, 39, 94, 44, 119, 149, + 24, 139, 140, 141, 142, 143, 72, 58, 73, 119, + 76, 117, 144, 144, 77, 75, 135, 93, 31, 33, + 108, 37, 93, 105, 119, 42, 46, 113, 100, 33, + 149, 149, 67, 62, 119, 47, 48, 145, 146, 147, + 149, 149, 101, 32, 109, 110, 111, 96, 30, 39, + 119, 149, 119, 31, 118, 119, 33, 149, 53, 139, + 139, 27, 28, 54, 149, 147, 147, 77, 75, 117, + 92, 95, 96, 92, 119, 31, 112, 110, 108, 93, + 68, 106, 149, 149, 75, 45, 139, 149, 62, 62, + 62, 139, 117, 117, 145, 33, 92, 33, 34, 5, + 33, 58, 119, 149, 94, 93, 118, 144, 76, 76, + 25, 26, 5, 93, 30, 93, 113, 149, 146, 146, + 93, 58, 92, 77, 77, 33, 149, 149, 67, 92, + 92, 33, 33, 67, 67 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 87, 88, 89, 89, 90, 90, 90, 91, 91, - 92, 92, 93, 94, 94, 94, 94, 94, 95, 95, - 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, - 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, - 95, 96, 96, 97, 97, 98, 98, 98, 99, 99, - 100, 100, 101, 102, 102, 103, 103, 104, 104, 105, - 105, 105, 106, 106, 107, 107, 108, 108, 109, 110, - 110, 111, 111, 111, 112, 112, 113, 113, 114, 114, - 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, - 119, 120, 120, 121, 121, 122, 122, 123, 123, 123, - 123, 123, 123, 123, 123, 124, 124, 125, 125, 125, - 126, 126, 127, 127, 128, 128, 128, 129, 129, 130, + 0, 87, 88, 88, 89, 89, 90, 90, 90, 91, + 91, 92, 92, 92, 93, 93, 94, 94, 95, 96, + 96, 96, 96, 96, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 98, 98, 99, + 99, 100, 100, 100, 101, 101, 102, 102, 103, 104, + 104, 105, 105, 106, 106, 107, 107, 107, 108, 108, + 109, 109, 110, 110, 111, 112, 112, 113, 113, 113, + 114, 114, 115, 115, 116, 116, 116, 117, 117, 118, + 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, + 123, 124, 124, 125, 125, 125, 125, 125, 125, 125, + 125, 126, 126, 127, 127, 127, 128, 128, 129, 129, 130, 130, 130, 131, 131, 132, 132, 132, 132, 132, - 132, 132, 133, 133, 133, 133, 134, 134, 134, 135, - 135, 136, 137, 137, 137, 137, 137, 138, 138, 138, - 139, 139, 140, 140, 141, 141, 141, 142, 142, 143, - 143, 144, 144, 144, 145, 145, 146, 146, 146, 146 + 133, 133, 134, 134, 134, 134, 134, 134, 134, 135, + 135, 135, 136, 136, 137, 137, 138, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 140, 140, 140, 141, + 141, 142, 142, 143, 143, 143, 144, 144, 145, 145, + 146, 146, 146, 147, 147, 147, 147, 147, 147, 148, + 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, 148, 149, + 149, 149, 149 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { - 0, 2, 3, 0, 3, 0, 2, 2, 0, 1, - 1, 2, 2, 1, 2, 1, 3, 2, 2, 3, - 4, 2, 1, 5, 6, 6, 4, 1, 2, 2, - 2, 2, 2, 5, 1, 4, 4, 2, 10, 8, - 7, 1, 3, 1, 3, 1, 4, 2, 1, 3, - 1, 3, 3, 1, 2, 1, 1, 0, 2, 9, - 5, 7, 0, 2, 0, 1, 1, 2, 5, 0, - 3, 0, 4, 5, 1, 3, 1, 1, 1, 3, - 2, 0, 1, 1, 3, 1, 3, 1, 3, 1, - 3, 1, 3, 1, 3, 1, 2, 1, 3, 3, - 3, 3, 3, 3, 3, 1, 3, 1, 3, 3, - 1, 3, 1, 3, 1, 3, 3, 1, 3, 1, - 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, - 1, 7, 0, 3, 4, 4, 3, 9, 11, 11, - 8, 8, 0, 1, 2, 1, 1, 1, 3, 1, - 3, 2, 3, 3, 1, 1, 1, 1, 2, 2 + 0, 2, 3, 3, 0, 3, 0, 2, 2, 0, + 2, 0, 1, 2, 0, 1, 1, 2, 2, 1, + 2, 1, 3, 2, 2, 3, 4, 2, 1, 5, + 6, 6, 4, 1, 2, 2, 2, 2, 2, 5, + 1, 4, 4, 2, 10, 8, 7, 1, 3, 1, + 3, 1, 4, 2, 1, 3, 1, 3, 3, 1, + 2, 1, 1, 0, 2, 9, 5, 7, 0, 2, + 0, 1, 1, 2, 5, 0, 3, 0, 4, 5, + 1, 3, 1, 1, 1, 3, 2, 0, 1, 1, + 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, + 3, 1, 2, 1, 3, 3, 3, 3, 3, 3, + 3, 1, 3, 1, 3, 3, 1, 3, 1, 3, + 1, 3, 3, 1, 3, 1, 1, 2, 2, 2, + 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 1, 7, 0, 1, 3, + 2, 4, 2, 4, 1, 3, 9, 11, 11, 8, + 8, 0, 1, 2, 1, 1, 1, 3, 1, 3, + 2, 3, 3, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 2 }; @@ -1047,22 +1149,22 @@ static const yytype_uint8 yyr2[] = #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (ctx, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) +#define YYBACKUP(Token, Value) \ + do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (ctx, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ + while (0) /* Error token number */ #define YYTERROR 1 @@ -1102,38 +1204,38 @@ do { \ } while (0) -/*----------------------------------------. -| Print this symbol's value on YYOUTPUT. | -`----------------------------------------*/ +/*-----------------------------------. +| Print this symbol's value on YYO. | +`-----------------------------------*/ static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_ctx_t *ctx) +yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, parser_ctx_t *ctx) { - FILE *yyo = yyoutput; - YYUSE (yyo); + FILE *yyoutput = yyo; + YYUSE (yyoutput); YYUSE (ctx); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); + YYPRINT (yyo, yytoknum[yytype], *yyvaluep); # endif YYUSE (yytype); } -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +/*---------------------------. +| Print this symbol on YYO. | +`---------------------------*/ static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_ctx_t *ctx) +yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, parser_ctx_t *ctx) { - YYFPRINTF (yyoutput, "%s %s (", + YYFPRINTF (yyo, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - yy_symbol_value_print (yyoutput, yytype, yyvaluep, ctx); - YYFPRINTF (yyoutput, ")"); + yy_symbol_value_print (yyo, yytype, yyvaluep, ctx); + YYFPRINTF (yyo, ")"); } /*------------------------------------------------------------------. @@ -1167,7 +1269,7 @@ do { \ static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, parser_ctx_t *ctx) { - unsigned long int yylno = yyrline[yyrule]; + unsigned long yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", @@ -1178,7 +1280,7 @@ yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, parser_ctx_t * YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yystos[yyssp[yyi + 1 - yynrhs]], - &(yyvsp[(yyi + 1) - (yynrhs)]) + &yyvsp[(yyi + 1) - (yynrhs)] , ctx); YYFPRINTF (stderr, "\n"); } @@ -1282,7 +1384,10 @@ yytnamerr (char *yyres, const char *yystr) case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; - /* Fall through. */ + else + goto append; + + append: default: if (yyres) yyres[yyn] = *yyp; @@ -1300,7 +1405,7 @@ yytnamerr (char *yyres, const char *yystr) if (! yyres) return yystrlen (yystr); - return yystpcpy (yyres, yystr) - yyres; + return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); } # endif @@ -1316,11 +1421,11 @@ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *yyformat = YY_NULL; + const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per @@ -1377,11 +1482,11 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, } yyarg[yycount++] = yytname[yyx]; { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else return 2; - yysize = yysize1; } } } @@ -1393,6 +1498,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, case N: \ yyformat = S; \ break + default: /* Avoid compiler warnings. */ YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); @@ -1404,9 +1510,10 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, { YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else return 2; - yysize = yysize1; } if (*yymsg_alloc < yysize) @@ -1537,23 +1644,33 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yychar = YYEMPTY; /* Cause a token to be read. */ goto yysetstate; + /*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | +| yynewstate -- push a new state, which is found in yystate. | `------------------------------------------------------------*/ - yynewstate: +yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; - yysetstate: - *yyssp = yystate; + +/*--------------------------------------------------------------------. +| yynewstate -- set current state (the top of the stack) to yystate. | +`--------------------------------------------------------------------*/ +yysetstate: + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); + *yyssp = (yytype_int16) yystate; if (yyss + yystacksize - 1 <= yyssp) +#if !defined yyoverflow && !defined YYSTACK_RELOCATE + goto yyexhaustedlab; +#else { /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); -#ifdef yyoverflow +# if defined yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into @@ -1569,14 +1686,10 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); - yyss = yyss1; yyvs = yyvs1; } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else +# else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; @@ -1592,35 +1705,33 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE +# undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif -#endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); +#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ if (yystate == YYFINAL) YYACCEPT; goto yybackup; + /*-----------. | yybackup. | `-----------*/ yybackup: - /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ @@ -1678,7 +1789,6 @@ yybackup: YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END - goto yynewstate; @@ -1693,7 +1803,7 @@ yydefault: /*-----------------------------. -| yyreduce -- Do a reduction. | +| yyreduce -- do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ @@ -1713,965 +1823,1345 @@ yyreduce: YY_REDUCE_PRINT (yyn); switch (yyn) { - case 2: -#line 147 "parser.y" /* yacc.c:1646 */ + case 2: +#line 148 "parser.y" { parse_complete(ctx, (yyvsp[-2].boolean)); } -#line 1720 "parser.tab.c" /* yacc.c:1646 */ +#line 1830 "parser.tab.c" break; case 3: -#line 150 "parser.y" /* yacc.c:1646 */ - { (yyval.boolean) = FALSE; } -#line 1726 "parser.tab.c" /* yacc.c:1646 */ +#line 149 "parser.y" + { handle_isexpression_script(ctx, (yyvsp[-1].expression)); } +#line 1836 "parser.tab.c" break; case 4: -#line 151 "parser.y" /* yacc.c:1646 */ - { (yyval.boolean) = TRUE; } -#line 1732 "parser.tab.c" /* yacc.c:1646 */ +#line 152 "parser.y" + { (yyval.boolean) = FALSE; } +#line 1842 "parser.tab.c" break; - case 6: -#line 155 "parser.y" /* yacc.c:1646 */ - { source_add_statement(ctx, (yyvsp[0].statement)); } -#line 1738 "parser.tab.c" /* yacc.c:1646 */ + case 5: +#line 153 "parser.y" + { (yyval.boolean) = TRUE; } +#line 1848 "parser.tab.c" break; case 7: -#line 156 "parser.y" /* yacc.c:1646 */ - { source_add_class(ctx, (yyvsp[0].class_decl)); } -#line 1744 "parser.tab.c" /* yacc.c:1646 */ +#line 157 "parser.y" + { source_add_statement(ctx, (yyvsp[0].statement)); } +#line 1854 "parser.tab.c" break; case 8: -#line 159 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = NULL; } -#line 1750 "parser.tab.c" /* yacc.c:1646 */ +#line 158 "parser.y" + { source_add_class(ctx, (yyvsp[0].class_decl)); } +#line 1860 "parser.tab.c" break; case 9: -#line 160 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = (yyvsp[0].statement); } -#line 1756 "parser.tab.c" /* yacc.c:1646 */ +#line 161 "parser.y" + { (yyval.expression) = NULL; } +#line 1866 "parser.tab.c" break; case 10: -#line 163 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = (yyvsp[0].statement); } -#line 1762 "parser.tab.c" /* yacc.c:1646 */ +#line 162 "parser.y" + { (yyval.expression) = (yyvsp[-1].expression); } +#line 1872 "parser.tab.c" break; case 11: -#line 164 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = link_statements((yyvsp[-1].statement), (yyvsp[0].statement)); } -#line 1768 "parser.tab.c" /* yacc.c:1646 */ +#line 165 "parser.y" + { (yyval.statement) = NULL; } +#line 1878 "parser.tab.c" break; case 12: -#line 167 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = (yyvsp[-1].statement); } -#line 1774 "parser.tab.c" /* yacc.c:1646 */ +#line 166 "parser.y" + { (yyval.statement) = (yyvsp[0].statement); } +#line 1884 "parser.tab.c" break; case 13: -#line 170 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = NULL; } -#line 1780 "parser.tab.c" /* yacc.c:1646 */ +#line 167 "parser.y" + { (yyval.statement) = link_statements((yyvsp[-1].statement), (yyvsp[0].statement)); } +#line 1890 "parser.tab.c" break; case 14: -#line 171 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = (yyvsp[0].statement); } -#line 1786 "parser.tab.c" /* yacc.c:1646 */ +#line 170 "parser.y" + { (yyval.statement) = NULL; } +#line 1896 "parser.tab.c" break; case 15: -#line 172 "parser.y" /* yacc.c:1646 */ +#line 171 "parser.y" { (yyval.statement) = (yyvsp[0].statement); } -#line 1792 "parser.tab.c" /* yacc.c:1646 */ +#line 1902 "parser.tab.c" break; case 16: -#line 173 "parser.y" /* yacc.c:1646 */ - { (yyvsp[-2].statement)->next = (yyvsp[0].statement); (yyval.statement) = (yyvsp[-2].statement); } -#line 1798 "parser.tab.c" /* yacc.c:1646 */ +#line 174 "parser.y" + { (yyval.statement) = (yyvsp[0].statement); } +#line 1908 "parser.tab.c" break; case 17: -#line 174 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = (yyvsp[-1].statement); } -#line 1804 "parser.tab.c" /* yacc.c:1646 */ +#line 175 "parser.y" + { (yyval.statement) = link_statements((yyvsp[-1].statement), (yyvsp[0].statement)); } +#line 1914 "parser.tab.c" break; case 18: -#line 177 "parser.y" /* yacc.c:1646 */ - { (yyvsp[-1].member)->args = (yyvsp[0].expression); (yyval.statement) = new_call_statement(ctx, FALSE, (yyvsp[-1].member)); CHECK_ERROR; } -#line 1810 "parser.tab.c" /* yacc.c:1646 */ +#line 178 "parser.y" + { (yyval.statement) = (yyvsp[-1].statement); } +#line 1920 "parser.tab.c" break; case 19: -#line 178 "parser.y" /* yacc.c:1646 */ - { (yyvsp[-1].member)->args = (yyvsp[0].expression); (yyval.statement) = new_call_statement(ctx, TRUE, (yyvsp[-1].member)); CHECK_ERROR; } -#line 1816 "parser.tab.c" /* yacc.c:1646 */ +#line 181 "parser.y" + { (yyval.statement) = NULL; } +#line 1926 "parser.tab.c" break; case 20: -#line 180 "parser.y" /* yacc.c:1646 */ - { (yyvsp[-3].member)->args = (yyvsp[-2].expression); (yyval.statement) = new_assign_statement(ctx, (yyvsp[-3].member), (yyvsp[0].expression)); CHECK_ERROR; } -#line 1822 "parser.tab.c" /* yacc.c:1646 */ +#line 182 "parser.y" + { (yyval.statement) = (yyvsp[0].statement); } +#line 1932 "parser.tab.c" break; case 21: -#line 181 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_dim_statement(ctx, (yyvsp[0].dim_decl)); CHECK_ERROR; } -#line 1828 "parser.tab.c" /* yacc.c:1646 */ +#line 183 "parser.y" + { (yyval.statement) = (yyvsp[0].statement); } +#line 1938 "parser.tab.c" break; case 22: -#line 182 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = (yyvsp[0].statement); } -#line 1834 "parser.tab.c" /* yacc.c:1646 */ +#line 184 "parser.y" + { (yyvsp[-2].statement)->next = (yyvsp[0].statement); (yyval.statement) = (yyvsp[-2].statement); } +#line 1944 "parser.tab.c" break; case 23: -#line 184 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_while_statement(ctx, STAT_WHILE, (yyvsp[-3].expression), (yyvsp[-1].statement)); CHECK_ERROR; } -#line 1840 "parser.tab.c" /* yacc.c:1646 */ +#line 185 "parser.y" + { (yyval.statement) = (yyvsp[-1].statement); } +#line 1950 "parser.tab.c" break; case 24: -#line 186 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_while_statement(ctx, (yyvsp[-4].boolean) ? STAT_WHILELOOP : STAT_UNTIL, (yyvsp[-3].expression), (yyvsp[-1].statement)); - CHECK_ERROR; } -#line 1847 "parser.tab.c" /* yacc.c:1646 */ +#line 188 "parser.y" + { (yyvsp[-1].member)->args = (yyvsp[0].expression); (yyval.statement) = new_call_statement(ctx, FALSE, (yyvsp[-1].member)); CHECK_ERROR; } +#line 1956 "parser.tab.c" break; case 25: -#line 189 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_while_statement(ctx, (yyvsp[-1].boolean) ? STAT_DOWHILE : STAT_DOUNTIL, (yyvsp[0].expression), (yyvsp[-3].statement)); - CHECK_ERROR; } -#line 1854 "parser.tab.c" /* yacc.c:1646 */ +#line 189 "parser.y" + { (yyvsp[-1].member)->args = (yyvsp[0].expression); (yyval.statement) = new_call_statement(ctx, TRUE, (yyvsp[-1].member)); CHECK_ERROR; } +#line 1962 "parser.tab.c" break; case 26: -#line 191 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_while_statement(ctx, STAT_DOWHILE, NULL, (yyvsp[-1].statement)); CHECK_ERROR; } -#line 1860 "parser.tab.c" /* yacc.c:1646 */ +#line 191 "parser.y" + { (yyvsp[-3].member)->args = (yyvsp[-2].expression); (yyval.statement) = new_assign_statement(ctx, (yyvsp[-3].member), (yyvsp[0].expression)); CHECK_ERROR; } +#line 1968 "parser.tab.c" break; case 27: -#line 192 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_function_statement(ctx, (yyvsp[0].func_decl)); CHECK_ERROR; } -#line 1866 "parser.tab.c" /* yacc.c:1646 */ +#line 192 "parser.y" + { (yyval.statement) = new_dim_statement(ctx, (yyvsp[0].dim_decl)); CHECK_ERROR; } +#line 1974 "parser.tab.c" break; case 28: -#line 193 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_statement(ctx, STAT_EXITDO, 0); CHECK_ERROR; } -#line 1872 "parser.tab.c" /* yacc.c:1646 */ +#line 193 "parser.y" + { (yyval.statement) = (yyvsp[0].statement); } +#line 1980 "parser.tab.c" break; case 29: -#line 194 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_statement(ctx, STAT_EXITFOR, 0); CHECK_ERROR; } -#line 1878 "parser.tab.c" /* yacc.c:1646 */ +#line 195 "parser.y" + { (yyval.statement) = new_while_statement(ctx, STAT_WHILE, (yyvsp[-3].expression), (yyvsp[-1].statement)); CHECK_ERROR; } +#line 1986 "parser.tab.c" break; case 30: -#line 195 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_statement(ctx, STAT_EXITFUNC, 0); CHECK_ERROR; } -#line 1884 "parser.tab.c" /* yacc.c:1646 */ +#line 197 "parser.y" + { (yyval.statement) = new_while_statement(ctx, (yyvsp[-4].boolean) ? STAT_WHILELOOP : STAT_UNTIL, (yyvsp[-3].expression), (yyvsp[-1].statement)); + CHECK_ERROR; } +#line 1993 "parser.tab.c" break; case 31: -#line 196 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_statement(ctx, STAT_EXITPROP, 0); CHECK_ERROR; } -#line 1890 "parser.tab.c" /* yacc.c:1646 */ +#line 200 "parser.y" + { (yyval.statement) = new_while_statement(ctx, (yyvsp[-1].boolean) ? STAT_DOWHILE : STAT_DOUNTIL, (yyvsp[0].expression), (yyvsp[-3].statement)); + CHECK_ERROR; } +#line 2000 "parser.tab.c" break; case 32: -#line 197 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_statement(ctx, STAT_EXITSUB, 0); CHECK_ERROR; } -#line 1896 "parser.tab.c" /* yacc.c:1646 */ +#line 202 "parser.y" + { (yyval.statement) = new_while_statement(ctx, STAT_DOWHILE, NULL, (yyvsp[-1].statement)); CHECK_ERROR; } +#line 2006 "parser.tab.c" break; case 33: -#line 199 "parser.y" /* yacc.c:1646 */ - { (yyvsp[-3].member)->args = (yyvsp[-2].expression); (yyval.statement) = new_set_statement(ctx, (yyvsp[-3].member), (yyvsp[0].expression)); CHECK_ERROR; } -#line 1902 "parser.tab.c" /* yacc.c:1646 */ +#line 203 "parser.y" + { (yyval.statement) = new_function_statement(ctx, (yyvsp[0].func_decl)); CHECK_ERROR; } +#line 2012 "parser.tab.c" break; case 34: -#line 200 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_statement(ctx, STAT_STOP, 0); CHECK_ERROR; } -#line 1908 "parser.tab.c" /* yacc.c:1646 */ +#line 204 "parser.y" + { (yyval.statement) = new_statement(ctx, STAT_EXITDO, 0); CHECK_ERROR; } +#line 2018 "parser.tab.c" break; case 35: -#line 201 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_onerror_statement(ctx, TRUE); CHECK_ERROR; } -#line 1914 "parser.tab.c" /* yacc.c:1646 */ +#line 205 "parser.y" + { (yyval.statement) = new_statement(ctx, STAT_EXITFOR, 0); CHECK_ERROR; } +#line 2024 "parser.tab.c" break; case 36: -#line 202 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_onerror_statement(ctx, FALSE); CHECK_ERROR; } -#line 1920 "parser.tab.c" /* yacc.c:1646 */ +#line 206 "parser.y" + { (yyval.statement) = new_statement(ctx, STAT_EXITFUNC, 0); CHECK_ERROR; } +#line 2030 "parser.tab.c" break; case 37: -#line 203 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_const_statement(ctx, (yyvsp[0].const_decl)); CHECK_ERROR; } -#line 1926 "parser.tab.c" /* yacc.c:1646 */ +#line 207 "parser.y" + { (yyval.statement) = new_statement(ctx, STAT_EXITPROP, 0); CHECK_ERROR; } +#line 2036 "parser.tab.c" break; case 38: -#line 205 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_forto_statement(ctx, (yyvsp[-8].string), (yyvsp[-6].expression), (yyvsp[-4].expression), (yyvsp[-3].expression), (yyvsp[-1].statement)); CHECK_ERROR; } -#line 1932 "parser.tab.c" /* yacc.c:1646 */ +#line 208 "parser.y" + { (yyval.statement) = new_statement(ctx, STAT_EXITSUB, 0); CHECK_ERROR; } +#line 2042 "parser.tab.c" break; case 39: -#line 207 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_foreach_statement(ctx, (yyvsp[-5].string), (yyvsp[-3].expression), (yyvsp[-1].statement)); } -#line 1938 "parser.tab.c" /* yacc.c:1646 */ +#line 210 "parser.y" + { (yyvsp[-3].member)->args = (yyvsp[-2].expression); (yyval.statement) = new_set_statement(ctx, (yyvsp[-3].member), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2048 "parser.tab.c" break; case 40: -#line 209 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_select_statement(ctx, (yyvsp[-4].expression), (yyvsp[-2].case_clausule)); } -#line 1944 "parser.tab.c" /* yacc.c:1646 */ +#line 211 "parser.y" + { (yyval.statement) = new_statement(ctx, STAT_STOP, 0); CHECK_ERROR; } +#line 2054 "parser.tab.c" break; case 41: -#line 212 "parser.y" /* yacc.c:1646 */ - { (yyval.member) = new_member_expression(ctx, NULL, (yyvsp[0].string)); CHECK_ERROR; } -#line 1950 "parser.tab.c" /* yacc.c:1646 */ +#line 212 "parser.y" + { (yyval.statement) = new_onerror_statement(ctx, TRUE); CHECK_ERROR; } +#line 2060 "parser.tab.c" break; case 42: -#line 213 "parser.y" /* yacc.c:1646 */ - { (yyval.member) = new_member_expression(ctx, (yyvsp[-2].expression), (yyvsp[0].string)); CHECK_ERROR; } -#line 1956 "parser.tab.c" /* yacc.c:1646 */ +#line 213 "parser.y" + { (yyval.statement) = new_onerror_statement(ctx, FALSE); CHECK_ERROR; } +#line 2066 "parser.tab.c" break; case 43: -#line 216 "parser.y" /* yacc.c:1646 */ - { (yyval.dim_decl) = (yyvsp[0].dim_decl); } -#line 1962 "parser.tab.c" /* yacc.c:1646 */ +#line 214 "parser.y" + { (yyval.statement) = new_const_statement(ctx, (yyvsp[0].const_decl)); CHECK_ERROR; } +#line 2072 "parser.tab.c" break; case 44: -#line 217 "parser.y" /* yacc.c:1646 */ - { (yyvsp[-2].dim_decl)->next = (yyvsp[0].dim_decl); (yyval.dim_decl) = (yyvsp[-2].dim_decl); } -#line 1968 "parser.tab.c" /* yacc.c:1646 */ +#line 216 "parser.y" + { (yyval.statement) = new_forto_statement(ctx, (yyvsp[-8].string), (yyvsp[-6].expression), (yyvsp[-4].expression), (yyvsp[-3].expression), (yyvsp[-1].statement)); CHECK_ERROR; } +#line 2078 "parser.tab.c" break; case 45: -#line 220 "parser.y" /* yacc.c:1646 */ - { (yyval.dim_decl) = new_dim_decl(ctx, (yyvsp[0].string), FALSE, NULL); CHECK_ERROR; } -#line 1974 "parser.tab.c" /* yacc.c:1646 */ +#line 218 "parser.y" + { (yyval.statement) = new_foreach_statement(ctx, (yyvsp[-5].string), (yyvsp[-3].expression), (yyvsp[-1].statement)); } +#line 2084 "parser.tab.c" break; case 46: -#line 221 "parser.y" /* yacc.c:1646 */ - { (yyval.dim_decl) = new_dim_decl(ctx, (yyvsp[-3].string), TRUE, (yyvsp[-1].dim_list)); CHECK_ERROR; } -#line 1980 "parser.tab.c" /* yacc.c:1646 */ +#line 220 "parser.y" + { (yyval.statement) = new_select_statement(ctx, (yyvsp[-4].expression), (yyvsp[-2].case_clausule)); } +#line 2090 "parser.tab.c" break; case 47: -#line 222 "parser.y" /* yacc.c:1646 */ - { (yyval.dim_decl) = new_dim_decl(ctx, (yyvsp[-1].string), TRUE, NULL); CHECK_ERROR; } -#line 1986 "parser.tab.c" /* yacc.c:1646 */ +#line 223 "parser.y" + { (yyval.member) = new_member_expression(ctx, NULL, (yyvsp[0].string)); CHECK_ERROR; } +#line 2096 "parser.tab.c" break; case 48: -#line 225 "parser.y" /* yacc.c:1646 */ - { (yyval.dim_list) = new_dim(ctx, (yyvsp[0].uint), NULL); } -#line 1992 "parser.tab.c" /* yacc.c:1646 */ +#line 224 "parser.y" + { (yyval.member) = new_member_expression(ctx, (yyvsp[-2].expression), (yyvsp[0].string)); CHECK_ERROR; } +#line 2102 "parser.tab.c" break; case 49: -#line 226 "parser.y" /* yacc.c:1646 */ - { (yyval.dim_list) = new_dim(ctx, (yyvsp[-2].uint), (yyvsp[0].dim_list)); } -#line 1998 "parser.tab.c" /* yacc.c:1646 */ +#line 227 "parser.y" + { (yyval.dim_decl) = (yyvsp[0].dim_decl); } +#line 2108 "parser.tab.c" break; case 50: -#line 229 "parser.y" /* yacc.c:1646 */ - { (yyval.const_decl) = (yyvsp[0].const_decl); } -#line 2004 "parser.tab.c" /* yacc.c:1646 */ +#line 228 "parser.y" + { (yyvsp[-2].dim_decl)->next = (yyvsp[0].dim_decl); (yyval.dim_decl) = (yyvsp[-2].dim_decl); } +#line 2114 "parser.tab.c" break; case 51: -#line 230 "parser.y" /* yacc.c:1646 */ - { (yyvsp[-2].const_decl)->next = (yyvsp[0].const_decl); (yyval.const_decl) = (yyvsp[-2].const_decl); } -#line 2010 "parser.tab.c" /* yacc.c:1646 */ +#line 231 "parser.y" + { (yyval.dim_decl) = new_dim_decl(ctx, (yyvsp[0].string), FALSE, NULL); CHECK_ERROR; } +#line 2120 "parser.tab.c" break; case 52: -#line 233 "parser.y" /* yacc.c:1646 */ - { (yyval.const_decl) = new_const_decl(ctx, (yyvsp[-2].string), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2016 "parser.tab.c" /* yacc.c:1646 */ +#line 232 "parser.y" + { (yyval.dim_decl) = new_dim_decl(ctx, (yyvsp[-3].string), TRUE, (yyvsp[-1].dim_list)); CHECK_ERROR; } +#line 2126 "parser.tab.c" break; case 53: -#line 236 "parser.y" /* yacc.c:1646 */ - { (yyval.expression) = (yyvsp[0].expression); } -#line 2022 "parser.tab.c" /* yacc.c:1646 */ +#line 233 "parser.y" + { (yyval.dim_decl) = new_dim_decl(ctx, (yyvsp[-1].string), TRUE, NULL); CHECK_ERROR; } +#line 2132 "parser.tab.c" break; case 54: -#line 237 "parser.y" /* yacc.c:1646 */ - { (yyval.expression) = new_unary_expression(ctx, EXPR_NEG, (yyvsp[0].expression)); CHECK_ERROR; } -#line 2028 "parser.tab.c" /* yacc.c:1646 */ +#line 236 "parser.y" + { (yyval.dim_list) = new_dim(ctx, (yyvsp[0].uint), NULL); } +#line 2138 "parser.tab.c" break; case 55: -#line 240 "parser.y" /* yacc.c:1646 */ - { (yyval.boolean) = TRUE; } -#line 2034 "parser.tab.c" /* yacc.c:1646 */ +#line 237 "parser.y" + { (yyval.dim_list) = new_dim(ctx, (yyvsp[-2].uint), (yyvsp[0].dim_list)); } +#line 2144 "parser.tab.c" break; case 56: -#line 241 "parser.y" /* yacc.c:1646 */ - { (yyval.boolean) = FALSE; } -#line 2040 "parser.tab.c" /* yacc.c:1646 */ +#line 240 "parser.y" + { (yyval.const_decl) = (yyvsp[0].const_decl); } +#line 2150 "parser.tab.c" break; case 57: -#line 244 "parser.y" /* yacc.c:1646 */ - { (yyval.expression) = NULL;} -#line 2046 "parser.tab.c" /* yacc.c:1646 */ +#line 241 "parser.y" + { (yyvsp[-2].const_decl)->next = (yyvsp[0].const_decl); (yyval.const_decl) = (yyvsp[-2].const_decl); } +#line 2156 "parser.tab.c" break; case 58: -#line 245 "parser.y" /* yacc.c:1646 */ - { (yyval.expression) = (yyvsp[0].expression); } -#line 2052 "parser.tab.c" /* yacc.c:1646 */ +#line 244 "parser.y" + { (yyval.const_decl) = new_const_decl(ctx, (yyvsp[-2].string), (yyvsp[0].expression)); CHECK_ERROR; } +#line 2162 "parser.tab.c" break; case 59: -#line 249 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_if_statement(ctx, (yyvsp[-7].expression), (yyvsp[-4].statement), (yyvsp[-3].elseif), (yyvsp[-2].statement)); CHECK_ERROR; } -#line 2058 "parser.tab.c" /* yacc.c:1646 */ +#line 247 "parser.y" + { (yyval.expression) = (yyvsp[0].expression); } +#line 2168 "parser.tab.c" break; case 60: -#line 250 "parser.y" /* yacc.c:1646 */ - { (yyval.statement) = new_if_statement(ctx, (yyvsp[-3].expression), (yyvsp[-1].statement), NULL, NULL); CHECK_ERROR; } -#line 2064 "parser.tab.c" /* yacc.c:1646 */ +#line 248 "parser.y" + { (yyval.expression) = new_unary_expression(ctx, EXPR_NEG, (yyvsp[0].expression)); CHECK_ERROR; } +#line 2174 "parser.tab.c" ... 3379 lines suppressed ...
5 years
1
0
0
0
[reactos] 01/01: [USP10_WINETEST] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=573d40fbaa200c1a311cb…
commit 573d40fbaa200c1a311cbda3c968e47efe32914f Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Dec 1 19:41:41 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Dec 1 19:41:41 2019 +0100 [USP10_WINETEST] Sync with Wine Staging 4.18. CORE-16441 --- modules/rostests/winetests/usp10/usp10.c | 64 +++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/modules/rostests/winetests/usp10/usp10.c b/modules/rostests/winetests/usp10/usp10.c index e907c8c40ae..9e870ee3a5f 100644 --- a/modules/rostests/winetests/usp10/usp10.c +++ b/modules/rostests/winetests/usp10/usp10.c @@ -2091,6 +2091,7 @@ static void test_ScriptShape(HDC hdc) static void test_ScriptPlace(HDC hdc) { static const WCHAR test1[] = {'t', 'e', 's', 't',0}; + static const WCHAR test2[] = {0x3044, 0x308d, 0x306f,0}; /* Hiragana, Iroha */ BOOL ret; HRESULT hr; SCRIPT_CACHE sc = NULL; @@ -2101,6 +2102,9 @@ static void test_ScriptPlace(HDC hdc) int nb, widths[4]; GOFFSET offset[4]; ABC abc[4]; + HFONT hfont, prev_hfont; + LOGFONTA lf; + TEXTMETRICW tm; hr = ScriptItemize(test1, 4, 2, NULL, NULL, items, NULL); ok(hr == S_OK, "ScriptItemize should return S_OK not %08x\n", hr); @@ -2154,6 +2158,62 @@ static void test_ScriptPlace(HDC hdc) ok(ret, "ExtTextOutW should return TRUE\n"); ScriptFreeCache(&sc); + + /* test CJK bitmap font which has associated font */ + memset(&lf, 0, sizeof(lf)); + strcpy(lf.lfFaceName, "Fixedsys"); + lf.lfCharSet = DEFAULT_CHARSET; + hfont = CreateFontIndirectA(&lf); + prev_hfont = SelectObject(hdc, hfont); + ret = GetTextMetricsW(hdc, &tm); + ok(ret, "GetTextMetrics failed\n"); + + switch(tm.tmCharSet) { + case SHIFTJIS_CHARSET: + case HANGUL_CHARSET: + case GB2312_CHARSET: + case CHINESEBIG5_CHARSET: + { + SIZE sz; + DWORD len = lstrlenW(test2), i, total; + ret = GetTextExtentExPointW(hdc, test2, len, 0, NULL, NULL, &sz); + ok(ret, "GetTextExtentExPoint failed\n"); + + if (sz.cx > len * tm.tmAveCharWidth) + { + hr = ScriptItemize(test2, len, 2, NULL, NULL, items, NULL); + ok(hr == S_OK, "ScriptItemize should return S_OK not %08x\n", hr); + ok(items[0].a.fNoGlyphIndex == FALSE, "fNoGlyphIndex TRUE\n"); + + items[0].a.fNoGlyphIndex = TRUE; + memset(glyphs, 'a', sizeof(glyphs)); + hr = ScriptShape(hdc, &sc, test2, len, ARRAY_SIZE(glyphs), &items[0].a, glyphs, logclust, attrs, &nb); + ok(hr == S_OK, "ScriptShape should return S_OK not %08x\n", hr); + + memset(offset, 'a', sizeof(offset)); + memset(widths, 'a', sizeof(widths)); + hr = ScriptPlace(hdc, &sc, glyphs, ARRAY_SIZE(widths), attrs, &items[0].a, widths, offset, NULL); + ok(hr == S_OK, "ScriptPlace should return S_OK not %08x\n", hr); + + for (total = 0, i = 0; i < nb; i++) + { + ok(offset[i].du == 0, "[%d] expected 0, got %d\n", i, offset[i].du); + ok(offset[i].dv == 0, "[%d] expected 0, got %d\n", i, offset[i].dv); + ok(widths[i] > tm.tmAveCharWidth, "[%d] expected greater than %d, got %d\n", + i, tm.tmAveCharWidth, widths[i]); + total += widths[i]; + } + ok(total == sz.cx, "expected %d, got %d\n", sz.cx, total); + } + else + skip("Associated font is unavailable\n"); + + break; + } + default: + skip("Non-CJK locale\n"); + } + SelectObject(hdc, prev_hfont); } static void test_ScriptItemIzeShapePlace(HDC hdc, unsigned short pwOutGlyphs[256]) @@ -2345,7 +2405,7 @@ static void test_ScriptGetCMap(HDC hdc, unsigned short pwOutGlyphs[256]) hr = ScriptGetCMap(hdc, &psc, TestItem1, cInChars, 0, pwOutGlyphs3); ok( hr == S_OK, "ScriptGetCMap(NULL,&psc,NULL,0,0,NULL), expected S_OK, " "got %08x\n", hr); - ok( psc != NULL, "ScritpGetCMap expected psc to be not NULL\n"); + ok( psc != NULL, "ScriptGetCMap expected psc to be not NULL\n"); ScriptFreeCache( &psc); /* Set psc to NULL, to be able to check if a pointer is returned in psc */ @@ -3019,6 +3079,7 @@ static void test_ScriptXtoX(void) WORD clust = 0; INT advance = 16; hr = ScriptXtoCP(iX, 1, 1, &clust, psva, &advance, &sa, &piCP, &piTrailing); + ok(hr == S_OK, "ScriptXtoCP failed, hr %#x.\n", hr); ok(piCP==0 && piTrailing==0,"%i should return 0(%i) and 0(%i)\n",iX, piCP,piTrailing); } for (iX = 8; iX < 16; iX++) @@ -3026,6 +3087,7 @@ static void test_ScriptXtoX(void) WORD clust = 0; INT advance = 16; hr = ScriptXtoCP(iX, 1, 1, &clust, psva, &advance, &sa, &piCP, &piTrailing); + ok(hr == S_OK, "ScriptXtoCP failed, hr %#x.\n", hr); ok(piCP==0 && piTrailing==1,"%i should return 0(%i) and 1(%i)\n",iX, piCP,piTrailing); }
5 years
1
0
0
0
[reactos] 01/01: [USP10] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=29ff85ba5d77b3398b692…
commit 29ff85ba5d77b3398b6922aeaec3c97a18a6ccd5 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Dec 1 19:41:14 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Dec 1 19:41:14 2019 +0100 [USP10] Sync with Wine Staging 4.18. CORE-16441 --- dll/win32/usp10/CMakeLists.txt | 1 + dll/win32/usp10/bidi.c | 54 +--- dll/win32/usp10/bracket.c | 4 +- dll/win32/usp10/breaking.c | 2 +- dll/win32/usp10/direction.c | 575 ++++++++++++++++++++++++++++++++++++++++ dll/win32/usp10/indic.c | 2 +- dll/win32/usp10/indicsyllable.c | 74 +++--- dll/win32/usp10/linebreak.c | 240 +++++++++-------- dll/win32/usp10/mirror.c | 4 +- dll/win32/usp10/opentype.c | 2 +- dll/win32/usp10/precomp.h | 3 - dll/win32/usp10/shaping.c | 8 +- dll/win32/usp10/usp10.c | 84 +++--- media/doc/README.WINE | 2 +- 14 files changed, 795 insertions(+), 260 deletions(-) diff --git a/dll/win32/usp10/CMakeLists.txt b/dll/win32/usp10/CMakeLists.txt index 57fc2be44f7..26dbe33ec71 100644 --- a/dll/win32/usp10/CMakeLists.txt +++ b/dll/win32/usp10/CMakeLists.txt @@ -7,6 +7,7 @@ list(APPEND SOURCE bidi.c bracket.c breaking.c + direction.c indic.c indicsyllable.c linebreak.c diff --git a/dll/win32/usp10/bidi.c b/dll/win32/usp10/bidi.c index 0fb03ef061a..7de2be51d7c 100644 --- a/dll/win32/usp10/bidi.c +++ b/dll/win32/usp10/bidi.c @@ -41,8 +41,6 @@ * has been modified. */ -#include "config.h" - #include <stdarg.h> #include <stdlib.h> #include "windef.h" @@ -50,7 +48,6 @@ #include "wingdi.h" #include "winnls.h" #include "usp10.h" -#include "wine/unicode.h" #include "wine/debug.h" #include "wine/heap.h" #include "wine/list.h" @@ -58,6 +55,7 @@ #include "usp10_internal.h" extern const unsigned short bidi_bracket_table[] DECLSPEC_HIDDEN; +extern const unsigned short bidi_direction_table[] DECLSPEC_HIDDEN; WINE_DEFAULT_DEBUG_CHANNEL(bidi); @@ -162,56 +160,14 @@ static inline void dump_types(const char* header, WORD *types, int start, int en /* Convert the libwine information to the direction enum */ static void classify(const WCHAR *string, WORD *chartype, DWORD count, const SCRIPT_CONTROL *c) { - static const enum directions dir_map[16] = - { - L, /* unassigned defaults to L */ - L, - R, - EN, - ES, - ET, - AN, - CS, - B, - S, - WS, - ON, - AL, - NSM, - BN, - PDF /* also LRE, LRO, RLE, RLO */ - }; - unsigned i; for (i = 0; i < count; ++i) { - chartype[i] = dir_map[get_char_typeW(string[i]) >> 12]; - switch (chartype[i]) + chartype[i] = get_table_entry( bidi_direction_table, string[i] ); + if (c->fLegacyBidiClass && chartype[i] == ES) { - case ES: - if (!c->fLegacyBidiClass) break; - switch (string[i]) - { - case '-': - case '+': chartype[i] = NI; break; - case '/': chartype[i] = CS; break; - } - break; - case PDF: - switch (string[i]) - { - case 0x202A: chartype[i] = LRE; break; - case 0x202B: chartype[i] = RLE; break; - case 0x202C: chartype[i] = PDF; break; - case 0x202D: chartype[i] = LRO; break; - case 0x202E: chartype[i] = RLO; break; - case 0x2066: chartype[i] = LRI; break; - case 0x2067: chartype[i] = RLI; break; - case 0x2068: chartype[i] = FSI; break; - case 0x2069: chartype[i] = PDI; break; - } - break; + if (string[i] == '+' || string[i] == '-') chartype[i] = NI; } } } @@ -682,7 +638,7 @@ typedef struct tagBracketPair int end; } BracketPair; -static int compr(const void *a, const void* b) +static int __cdecl compr(const void *a, const void* b) { return ((BracketPair*)a)->start - ((BracketPair*)b)->start; } diff --git a/dll/win32/usp10/bracket.c b/dll/win32/usp10/bracket.c index 16df6381a66..210495f38f1 100644 --- a/dll/win32/usp10/bracket.c +++ b/dll/win32/usp10/bracket.c @@ -1,8 +1,8 @@ /* Unicode Bidirectional Bracket table */ -/* generated from
http://www.unicode.org/Public/11.0.0/ucd/BidiBrackets.txt
*/ +/* generated from
http://www.unicode.org/Public/12.0.0/ucd/BidiBrackets.txt
*/ /* DO NOT EDIT!! */ -#include "wine/unicode.h" +#include "windef.h" const unsigned short DECLSPEC_HIDDEN bidi_bracket_table[768] = { diff --git a/dll/win32/usp10/breaking.c b/dll/win32/usp10/breaking.c index 9b12d9e63d5..480d69234af 100644 --- a/dll/win32/usp10/breaking.c +++ b/dll/win32/usp10/breaking.c @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * */ -#include "config.h" + #include <stdarg.h> #include <stdio.h> #include <stdlib.h> diff --git a/dll/win32/usp10/direction.c b/dll/win32/usp10/direction.c new file mode 100644 index 00000000000..aafd34250fd --- /dev/null +++ b/dll/win32/usp10/direction.c @@ -0,0 +1,575 @@ +/* Unicode BiDi direction table */ +/* Automatically generated; DO NOT EDIT!! */ + +#include "windef.h" + +const unsigned short DECLSPEC_HIDDEN bidi_direction_table[4512] = +{ + /* level 1 offsets */ + 0x0100, 0x0110, 0x0120, 0x0130, 0x0140, 0x0150, 0x0160, 0x0170, + 0x0180, 0x0190, 0x01a0, 0x01b0, 0x01c0, 0x01d0, 0x01e0, 0x01f0, + 0x0200, 0x0110, 0x0110, 0x0210, 0x0220, 0x0110, 0x0230, 0x0240, + 0x0250, 0x0260, 0x0270, 0x0280, 0x0290, 0x02a0, 0x0110, 0x02b0, + 0x02c0, 0x02d0, 0x02e0, 0x02f0, 0x0300, 0x0310, 0x0320, 0x0310, + 0x0110, 0x0310, 0x0310, 0x0330, 0x0340, 0x0350, 0x0360, 0x0370, + 0x0380, 0x0390, 0x03a0, 0x03b0, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x03c0, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x03d0, 0x0110, 0x03e0, 0x03f0, + 0x0400, 0x0410, 0x0420, 0x0430, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0440, 0x0450, 0x0460, 0x0470, 0x0480, + /* level 2 offsets */ + 0x0490, 0x04a0, 0x04b0, 0x04c0, 0x04d0, 0x04e0, 0x04d0, 0x04f0, + 0x0500, 0x0510, 0x0520, 0x0530, 0x0540, 0x0550, 0x0540, 0x0550, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, + 0x0540, 0x0540, 0x0540, 0x0560, 0x0570, 0x0570, 0x0580, 0x0590, + 0x05a0, 0x05a0, 0x05a0, 0x05a0, 0x05a0, 0x05a0, 0x05a0, 0x05b0, + 0x05c0, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x05d0, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, + 0x05e0, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, + 0x05f0, 0x0600, 0x05a0, 0x0610, 0x0620, 0x0630, 0x0640, 0x0650, + 0x0660, 0x0670, 0x0680, 0x0680, 0x0690, 0x05a0, 0x06a0, 0x06b0, + 0x0680, 0x0680, 0x0680, 0x0680, 0x0680, 0x06c0, 0x06d0, 0x06e0, + 0x06f0, 0x0700, 0x0680, 0x05a0, 0x0710, 0x0680, 0x0680, 0x0680, + 0x0680, 0x0680, 0x0720, 0x0730, 0x0630, 0x0630, 0x0740, 0x0750, + 0x0630, 0x0760, 0x0770, 0x0780, 0x0630, 0x0790, 0x07a0, 0x0540, + 0x0540, 0x0540, 0x0680, 0x07b0, 0x0540, 0x07c0, 0x07d0, 0x05a0, + 0x07e0, 0x0540, 0x0540, 0x07f0, 0x0800, 0x0810, 0x0820, 0x0540, + 0x0830, 0x0540, 0x0540, 0x0840, 0x0850, 0x0540, 0x0820, 0x0860, + 0x0870, 0x0540, 0x0540, 0x0840, 0x0880, 0x0830, 0x0540, 0x0890, + 0x0870, 0x0540, 0x0540, 0x0840, 0x08a0, 0x0540, 0x0820, 0x08b0, + 0x0830, 0x0540, 0x0540, 0x08c0, 0x0850, 0x08d0, 0x0820, 0x0540, + 0x08e0, 0x0540, 0x0540, 0x0540, 0x08f0, 0x0540, 0x0540, 0x0900, + 0x0910, 0x0540, 0x0540, 0x0920, 0x0930, 0x0940, 0x0820, 0x0950, + 0x0830, 0x0540, 0x0540, 0x0840, 0x0960, 0x0540, 0x0820, 0x0540, + 0x0970, 0x0540, 0x0540, 0x0980, 0x0850, 0x0540, 0x0820, 0x0540, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0990, 0x09a0, 0x0540, 0x0540, + 0x0540, 0x0540, 0x0540, 0x09b0, 0x09c0, 0x0540, 0x0540, 0x0540, + 0x0540, 0x0540, 0x0540, 0x09d0, 0x09e0, 0x0540, 0x0540, 0x0540, + 0x0540, 0x09f0, 0x0540, 0x0a00, 0x0540, 0x0540, 0x0540, 0x0a10, + 0x0a20, 0x0a30, 0x05a0, 0x0a40, 0x08d0, 0x0540, 0x0540, 0x0540, + 0x0540, 0x0540, 0x0a50, 0x0a60, 0x0540, 0x0a70, 0x0a80, 0x0a90, + 0x0aa0, 0x0ab0, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0a50, 0x0540, 0x0540, + 0x0540, 0x0ac0, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, + 0x04d0, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, + 0x0ad0, 0x0ae0, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, + 0x0540, 0x0af0, 0x0540, 0x0af0, 0x0540, 0x0820, 0x0540, 0x0820, + 0x0540, 0x0540, 0x0540, 0x0b00, 0x0b10, 0x0b20, 0x0540, 0x0ac0, + 0x0b30, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, + 0x0940, 0x0540, 0x0b40, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, + 0x0540, 0x0540, 0x0b50, 0x0b60, 0x0b70, 0x0540, 0x0540, 0x0540, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0b80, 0x0590, 0x0590, + 0x0540, 0x0b90, 0x0540, 0x0540, 0x0540, 0x0ba0, 0x0bb0, 0x0bc0, + 0x0540, 0x0540, 0x0540, 0x0bd0, 0x0540, 0x0540, 0x0540, 0x0540, + 0x0be0, 0x0540, 0x0540, 0x0bf0, 0x08e0, 0x0540, 0x0c00, 0x0be0, + 0x0970, 0x0540, 0x0c10, 0x0540, 0x0540, 0x0540, 0x0c20, 0x0970, + 0x0540, 0x0540, 0x0c30, 0x0c40, 0x0540, 0x0540, 0x0540, 0x0540, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0c50, 0x0c60, 0x0c70, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, + 0x0540, 0x0540, 0x0540, 0x0540, 0x05a0, 0x05a0, 0x05a0, 0x0c80, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, + 0x0540, 0x0540, 0x0540, 0x0c90, 0x0ca0, 0x0cb0, 0x0cb0, 0x0cc0, + 0x0cd0, 0x0590, 0x0ce0, 0x0cf0, 0x0d00, 0x0d10, 0x0d20, 0x0d30, + 0x0d40, 0x0540, 0x0d50, 0x0d50, 0x0540, 0x05a0, 0x05a0, 0x0a80, + 0x0d60, 0x0d70, 0x0d80, 0x0d90, 0x0da0, 0x0590, 0x0540, 0x0540, + 0x0db0, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, + 0x0590, 0x0dc0, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, + 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, + 0x0590, 0x0590, 0x0590, 0x0dd0, 0x0540, 0x0540, 0x0540, 0x04e0, + 0x0590, 0x0de0, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, + 0x0590, 0x0590, 0x0df0, 0x0540, 0x0e00, 0x0540, 0x0590, 0x0590, + 0x0e10, 0x0e20, 0x0540, 0x0540, 0x0540, 0x0540, 0x0e30, 0x0590, + 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, + 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, + 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, + 0x0590, 0x0590, 0x0e40, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, + 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0e50, + 0x0590, 0x0e60, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0e70, 0x0e80, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0e90, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x05a0, 0x05a0, + 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0540, 0x0540, 0x0540, + 0x0590, 0x0ea0, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0eb0, + 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, + 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0dd0, 0x0540, 0x0ec0, + 0x0ed0, 0x0590, 0x0ee0, 0x0ef0, 0x0540, 0x0540, 0x0540, 0x0540, + 0x0540, 0x0f00, 0x04d0, 0x0540, 0x0540, 0x0540, 0x0540, 0x0f10, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0590, 0x0590, 0x0eb0, 0x0540, + 0x0540, 0x0cc0, 0x0540, 0x0540, 0x0540, 0x0590, 0x0540, 0x0f20, + 0x0540, 0x0540, 0x0540, 0x0f30, 0x0f40, 0x0540, 0x0540, 0x0540, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0f50, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0b80, 0x0540, 0x0f60, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0590, 0x0590, 0x0590, 0x0590, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, + 0x0540, 0x0590, 0x0590, 0x0590, 0x0df0, 0x0540, 0x0540, 0x0540, + 0x0cb0, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0e90, 0x0f70, + 0x0540, 0x0920, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0970, + 0x0590, 0x0590, 0x0f80, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, + 0x0f90, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, + 0x0fa0, 0x0540, 0x0fb0, 0x0fc0, 0x0540, 0x0540, 0x0540, 0x0fd0, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0fe0, 0x0540, 0x05a0, 0x0ff0, + 0x0540, 0x0540, 0x1000, 0x0540, 0x1010, 0x0970, 0x0540, 0x0540, + 0x07e0, 0x0540, 0x0540, 0x1020, 0x0540, 0x0540, 0x1030, 0x0540, + 0x0540, 0x0540, 0x1040, 0x1050, 0x1060, 0x0540, 0x0540, 0x0840, + 0x0540, 0x0540, 0x0540, 0x1070, 0x0830, 0x0540, 0x0960, 0x08d0, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x1080, 0x0540, + 0x0540, 0x1090, 0x10a0, 0x10b0, 0x10c0, 0x0680, 0x0680, 0x0680, + 0x0680, 0x0680, 0x0680, 0x0680, 0x10d0, 0x10e0, 0x0680, 0x0680, + 0x0680, 0x0680, 0x0680, 0x0680, 0x0680, 0x0680, 0x0680, 0x0680, + 0x0680, 0x0680, 0x0680, 0x0680, 0x0680, 0x0680, 0x0680, 0x0680, + 0x0680, 0x0680, 0x0680, 0x10f0, 0x0540, 0x0680, 0x0680, 0x0680, + 0x0680, 0x1100, 0x0680, 0x0680, 0x1110, 0x0540, 0x0540, 0x1120, + 0x05a0, 0x0ac0, 0x05a0, 0x0590, 0x0590, 0x1130, 0x1140, 0x1150, + 0x0680, 0x0680, 0x0680, 0x0680, 0x0680, 0x0680, 0x0680, 0x1160, + 0x1170, 0x04c0, 0x04d0, 0x04e0, 0x04d0, 0x04e0, 0x0dd0, 0x0540, + 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x0540, 0x1180, 0x1190, + /* values */ + 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, + 0x000a, 0x000b, 0x000d, 0x000b, 0x000c, 0x000d, 0x000a, 0x000a, + 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, + 0x000a, 0x000a, 0x000a, 0x000a, 0x000d, 0x000d, 0x000d, 0x000b, + 0x000c, 0x0000, 0x0000, 0x0009, 0x0009, 0x0009, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0008, 0x0007, 0x0008, 0x0007, 0x0007, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0007, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x000a, + 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000d, 0x000a, 0x000a, + 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, + 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, + 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, + 0x0007, 0x0000, 0x0009, 0x0009, 0x0009, 0x0009, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x000a, 0x0000, 0x0000, + 0x0009, 0x0009, 0x0004, 0x0004, 0x0000, 0x0001, 0x0000, 0x0000, + 0x0000, 0x0004, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0000, 0x0001, 0x0001, 0x0000, 0x0000, 0x0009, + 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0002, 0x0006, + 0x0002, 0x0006, 0x0006, 0x0002, 0x0006, 0x0006, 0x0002, 0x0006, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0001, 0x0001, 0x0001, 0x0001, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0000, 0x0000, + 0x0005, 0x0009, 0x0009, 0x0005, 0x0007, 0x0005, 0x0000, 0x0000, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0005, 0x0005, 0x0001, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, + 0x0003, 0x0003, 0x0009, 0x0003, 0x0003, 0x0005, 0x0005, 0x0005, + 0x0006, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0003, 0x0000, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0005, 0x0005, 0x0006, + 0x0006, 0x0000, 0x0006, 0x0006, 0x0006, 0x0006, 0x0005, 0x0005, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0001, 0x0005, + 0x0005, 0x0006, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, 0x0005, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0005, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0002, 0x0002, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0002, 0x0001, 0x0001, 0x0006, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0002, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0002, 0x0006, 0x0006, 0x0006, + 0x0002, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0001, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, 0x0002, 0x0001, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0001, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0003, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0006, 0x0001, 0x0006, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, + 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0009, 0x0009, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0009, 0x0001, 0x0001, 0x0006, 0x0001, + 0x0001, 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, + 0x0006, 0x0001, 0x0001, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, + 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, 0x0006, + 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, + 0x0001, 0x0009, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, 0x0006, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0009, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0006, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0006, + 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0006, + 0x0006, 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0006, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0006, 0x0001, 0x0001, + 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0006, 0x0006, 0x0006, 0x0001, 0x0006, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0006, 0x0001, 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0009, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, + 0x0001, 0x0006, 0x0001, 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, 0x0006, + 0x0001, 0x0006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, + 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, 0x0006, 0x0006, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0001, 0x0006, 0x0006, 0x0001, 0x0001, 0x0006, 0x0006, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0006, + 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, 0x0006, 0x0006, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x000c, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0006, 0x0001, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, + 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0009, 0x0001, 0x0006, 0x0001, 0x0001, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0006, 0x0006, 0x0006, 0x000a, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, + 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0000, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, + 0x0006, 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, + 0x0006, 0x0001, 0x0006, 0x0001, 0x0001, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0001, 0x0006, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0001, 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, + 0x0006, 0x0006, 0x0001, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, + 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, 0x0006, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, 0x0006, 0x0006, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0006, 0x0006, 0x0006, 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, 0x0001, + 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0001, + 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, + 0x000c, 0x000c, 0x000c, 0x000a, 0x000a, 0x000a, 0x0001, 0x0002, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x000c, 0x000d, 0x0011, 0x000f, 0x0012, 0x0010, 0x000e, 0x0007, + 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0007, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000c, + 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x0001, 0x0013, 0x0014, + 0x0015, 0x0016, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, + 0x0004, 0x0001, 0x0001, 0x0001, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0001, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0001, + 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, + 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, + 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, + 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, + 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, + 0x0001, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0009, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0000, 0x0000, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, + 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, + 0x000c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, + 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0006, 0x0006, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0001, + 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, + 0x0006, 0x0006, 0x0006, 0x0000, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0006, 0x0001, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0009, 0x0009, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0006, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0001, 0x0001, 0x0006, 0x0006, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0001, + 0x0001, 0x0006, 0x0006, 0x0001, 0x0001, 0x0006, 0x0006, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, 0x0001, + 0x0006, 0x0001, 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, 0x0006, + 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0006, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, + 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0002, 0x0006, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0008, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0001, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0001, 0x0002, 0x0001, + 0x0002, 0x0002, 0x0001, 0x0002, 0x0002, 0x0001, 0x0002, 0x0002, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, + 0x0005, 0x0005, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0000, 0x0000, + 0x0001, 0x0001, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0000, 0x0001, 0x0001, + 0x0007, 0x0000, 0x0007, 0x0001, 0x0000, 0x0007, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0009, + 0x0000, 0x0000, 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0001, + 0x0000, 0x0009, 0x0009, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0001, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0001, 0x0001, 0x000a, + 0x0001, 0x0000, 0x0000, 0x0009, 0x0009, 0x0009, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0008, 0x0007, 0x0008, 0x0007, 0x0007, + 0x0009, 0x0009, 0x0000, 0x0000, 0x0000, 0x0009, 0x0009, 0x0001, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001 +}; diff --git a/dll/win32/usp10/indic.c b/dll/win32/usp10/indic.c index 5a228e88dea..b537eb232d9 100644 --- a/dll/win32/usp10/indic.c +++ b/dll/win32/usp10/indic.c @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * */ -#include "config.h" + #include <stdarg.h> #include <stdio.h> #include <stdlib.h> diff --git a/dll/win32/usp10/indicsyllable.c b/dll/win32/usp10/indicsyllable.c index fba732bc149..bc13fec2940 100644 --- a/dll/win32/usp10/indicsyllable.c +++ b/dll/win32/usp10/indicsyllable.c @@ -1,11 +1,11 @@ /* Unicode Indic Syllabic Category */ -/* generated from
http://www.unicode.org/Public/11.0.0/ucd/IndicSyllabicCategory.txt
*/ -/* and from
http://www.unicode.org/Public/11.0.0/ucd/IndicPositionalCategory.txt
*/ +/* generated from
http://www.unicode.org/Public/12.0.0/ucd/IndicSyllabicCategory.txt
*/ +/* and from
http://www.unicode.org/Public/12.0.0/ucd/IndicPositionalCategory.txt
*/ /* DO NOT EDIT!! */ -#include "wine/unicode.h" +#include "windef.h" -const unsigned short DECLSPEC_HIDDEN indic_syllabic_table[3328] = +const unsigned short DECLSPEC_HIDDEN indic_syllabic_table[3344] = { /* level 1 offsets */ 0x0100, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, @@ -56,35 +56,35 @@ const unsigned short DECLSPEC_HIDDEN indic_syllabic_table[3328] = 0x05c0, 0x0530, 0x02f0, 0x05d0, 0x05e0, 0x05f0, 0x0330, 0x0600, 0x0610, 0x0620, 0x02f0, 0x0630, 0x0640, 0x0650, 0x0400, 0x0660, 0x0670, 0x02f0, 0x0680, 0x0690, 0x06a0, 0x0290, 0x0270, 0x0270, - 0x06b0, 0x06c0, 0x06d0, 0x06e0, 0x06f0, 0x0700, 0x0270, 0x0270, - 0x0270, 0x0710, 0x0720, 0x0730, 0x0740, 0x02f0, 0x0750, 0x0760, - 0x0770, 0x0780, 0x0790, 0x07a0, 0x07b0, 0x0270, 0x0270, 0x0270, - 0x02f0, 0x02f0, 0x07c0, 0x07d0, 0x07e0, 0x07f0, 0x0800, 0x0810, - 0x0820, 0x0830, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, - 0x0840, 0x0850, 0x0860, 0x0850, 0x0860, 0x0870, 0x0840, 0x0880, - 0x02f0, 0x02f0, 0x0890, 0x08a0, 0x08b0, 0x08c0, 0x0290, 0x0270, - 0x08d0, 0x0680, 0x08e0, 0x08f0, 0x0400, 0x02f0, 0x0900, 0x0910, - 0x02f0, 0x02f0, 0x0920, 0x0930, 0x0940, 0x0290, 0x0270, 0x0270, + 0x06b0, 0x02f0, 0x06c0, 0x06d0, 0x06e0, 0x06f0, 0x0270, 0x0270, + 0x0270, 0x0700, 0x0710, 0x0720, 0x0730, 0x02f0, 0x0740, 0x0750, + 0x0760, 0x0770, 0x0780, 0x0790, 0x07a0, 0x0270, 0x0270, 0x0270, + 0x02f0, 0x02f0, 0x07b0, 0x07c0, 0x07d0, 0x07e0, 0x07f0, 0x0800, + 0x0810, 0x0820, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, + 0x0830, 0x0840, 0x0850, 0x0840, 0x0850, 0x0860, 0x0830, 0x0870, + 0x02f0, 0x02f0, 0x0880, 0x0890, 0x08a0, 0x08b0, 0x0290, 0x0270, + 0x08c0, 0x0680, 0x08d0, 0x08e0, 0x0400, 0x02f0, 0x08f0, 0x0900, + 0x02f0, 0x02f0, 0x0910, 0x0920, 0x0930, 0x0940, 0x0270, 0x0270, 0x02f0, 0x0950, 0x02f0, 0x02f0, 0x0960, 0x0970, 0x0980, 0x0990, 0x0290, 0x0290, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, - 0x09a0, 0x0860, 0x02f0, 0x09b0, 0x09c0, 0x0290, 0x09d0, 0x09e0, + 0x09a0, 0x0850, 0x02f0, 0x09b0, 0x09c0, 0x0290, 0x09d0, 0x09e0, 0x09f0, 0x02f0, 0x0a00, 0x0a10, 0x02f0, 0x02f0, 0x0a20, 0x0a30, 0x02f0, 0x02f0, 0x0a40, 0x0a50, 0x0a60, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0a70, 0x0a80, 0x0a90, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0aa0, 0x0ab0, 0x0ac0, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0ad0, - 0x0ae0, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, + 0x0ae0, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0af0, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, - 0x0270, 0x0270, 0x0270, 0x0270, 0x0af0, 0x0270, 0x0270, 0x0270, - 0x0b00, 0x02f0, 0x0b10, 0x0270, 0x02f0, 0x0b20, 0x0b30, 0x0b40, - 0x0b50, 0x0b60, 0x02f0, 0x0b70, 0x0b80, 0x0290, 0x0b90, 0x0ba0, - 0x0bb0, 0x02f0, 0x0bc0, 0x02f0, 0x0bd0, 0x0be0, 0x0270, 0x0270, - 0x0bf0, 0x02f0, 0x02f0, 0x0c00, 0x0c10, 0x0290, 0x0c20, 0x0c30, - 0x0c40, 0x02f0, 0x0c50, 0x0c60, 0x0c70, 0x0290, 0x02f0, 0x0c80, - 0x02f0, 0x02f0, 0x02f0, 0x0c90, 0x0ca0, 0x0270, 0x0cb0, 0x0cc0, + 0x0270, 0x0270, 0x0270, 0x0270, 0x0b00, 0x0270, 0x0270, 0x0270, + 0x0b10, 0x02f0, 0x0b20, 0x0270, 0x02f0, 0x0b30, 0x0b40, 0x0b50, + 0x0b60, 0x0b70, 0x02f0, 0x0b80, 0x0b90, 0x0290, 0x0ba0, 0x0bb0, + 0x0bc0, 0x02f0, 0x0bd0, 0x02f0, 0x0be0, 0x0bf0, 0x0270, 0x0270, + 0x0c00, 0x02f0, 0x02f0, 0x0c10, 0x0c20, 0x0290, 0x0c30, 0x0c40, + 0x0c50, 0x02f0, 0x0c60, 0x0c70, 0x0c80, 0x0290, 0x02f0, 0x0c90, + 0x02f0, 0x02f0, 0x02f0, 0x0ca0, 0x0cb0, 0x0270, 0x0cc0, 0x0cd0, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, 0x0270, - 0x0270, 0x0270, 0x0270, 0x0270, 0x0cd0, 0x0ce0, 0x0cf0, 0x0290, + 0x0270, 0x0270, 0x0270, 0x0270, 0x0ce0, 0x0cf0, 0x0d00, 0x0290, /* values */ 0x5f00, 0x9c00, 0x9500, 0x9500, 0x8600, 0x8600, 0x8600, 0x8600, 0x7e00, 0x6e00, 0x6c00, 0x6000, 0x5100, 0x3c00, 0x2600, 0x1900, @@ -136,7 +136,7 @@ const unsigned short DECLSPEC_HIDDEN indic_syllabic_table[3328] = 0x000a, 0x000a, 0x0000, 0x0000, 0x0604, 0x0000, 0x0107, 0x0207, 0x0107, 0x0607, 0x0607, 0x0000, 0x0000, 0x0000, 0x0000, 0x0507, 0x0507, 0x0000, 0x0000, 0x0507, 0x0507, 0x0605, 0x0000, 0x0000, - 0x0000, 0x0019, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0619, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000a, 0x000a, 0x000a, 0x000a, 0x0000, 0x000a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, @@ -184,7 +184,7 @@ const unsigned short DECLSPEC_HIDDEN indic_syllabic_table[3328] = 0x0007, 0x0000, 0x0507, 0x0507, 0x0507, 0x0505, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0507, 0x0607, 0x0000, 0x000a, 0x000a, 0x000a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0501, 0x0101, 0x0102, 0x0000, 0x0006, 0x0006, 0x0006, + 0x0001, 0x0501, 0x0101, 0x0102, 0x0000, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0000, 0x0006, 0x0006, 0x000a, 0x000a, 0x000a, 0x000a, 0x0000, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x0000, 0x0000, 0x0604, 0x0003, 0x0107, 0x0507, @@ -224,14 +224,12 @@ const unsigned short DECLSPEC_HIDDEN indic_syllabic_table[3328] = 0x0607, 0x0607, 0x0616, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0307, 0x0307, 0x0307, 0x0307, 0x0307, 0x0107, 0x0000, 0x0507, 0x0513, 0x0513, 0x0513, 0x0513, 0x0522, 0x0501, 0x0516, 0x0000, - 0x0000, 0x000a, 0x000a, 0x0000, 0x000a, 0x0000, 0x0000, 0x000a, - 0x000a, 0x0000, 0x000a, 0x0000, 0x0000, 0x000a, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x000a, 0x000a, 0x000a, 0x000a, - 0x0000, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, - 0x0000, 0x000a, 0x000a, 0x000a, 0x0000, 0x000a, 0x0000, 0x000a, - 0x0000, 0x0000, 0x000a, 0x000a, 0x0000, 0x000a, 0x000a, 0x0000, + 0x0000, 0x000a, 0x000a, 0x0000, 0x000a, 0x0000, 0x000a, 0x000a, + 0x000a, 0x000a, 0x000a, 0x0000, 0x000a, 0x000a, 0x000a, 0x000a, + 0x000a, 0x000a, 0x000a, 0x000a, 0x0000, 0x000a, 0x0000, 0x000a, + 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x0000, 0x0107, 0x0507, 0x0107, 0x0107, 0x0507, 0x0507, 0x0507, 0x0507, - 0x0607, 0x0607, 0x0000, 0x0507, 0x060e, 0x000e, 0x0000, 0x0000, + 0x0607, 0x0607, 0x0616, 0x0507, 0x060e, 0x000e, 0x0000, 0x0000, 0x0307, 0x0307, 0x0307, 0x0307, 0x0307, 0x0000, 0x0000, 0x0000, 0x0513, 0x0513, 0x0513, 0x0513, 0x0500, 0x0501, 0x0000, 0x0000, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, @@ -308,6 +306,8 @@ const unsigned short DECLSPEC_HIDDEN indic_syllabic_table[3328] = 0x0107, 0x0107, 0x0007, 0x0107, 0x0107, 0x0107, 0x0107, 0x0107, 0x0107, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, 0x0113, 0x0113, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, + 0x001d, 0x001d, 0x001d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x0507, 0x0607, 0x0207, 0x0107, 0x0507, 0x0000, 0x0000, 0x0000, 0x0000, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, @@ -348,8 +348,8 @@ const unsigned short DECLSPEC_HIDDEN indic_syllabic_table[3328] = 0x0619, 0x0619, 0x0519, 0x0519, 0x0619, 0x0619, 0x0619, 0x0619, 0x0519, 0x0119, 0x0d00, 0x0d00, 0x0d00, 0x0d00, 0x0d00, 0x0d00, 0x0d00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0600, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0002, 0x0002, 0x0519, 0x001f, 0x001f, 0x0119, - 0x0019, 0x0019, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x000b, 0x000b, 0x0519, 0x001f, 0x001f, 0x0119, + 0x0019, 0x0019, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0521, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -360,9 +360,11 @@ const unsigned short DECLSPEC_HIDDEN indic_syllabic_table[3328] = 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0021, 0x0021, 0x0021, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0519, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0009, 0x0000, 0x0000, 0x0000, - 0x0006, 0x0006, 0x0000, 0x0006, 0x0006, 0x0006, 0x0516, 0x000a, + 0x0006, 0x0006, 0x0507, 0x0006, 0x0006, 0x0006, 0x0505, 0x000a, 0x000a, 0x000a, 0x000a, 0x0501, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x0107, 0x0107, 0x0607, 0x0507, 0x0107, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -395,7 +397,7 @@ const unsigned short DECLSPEC_HIDDEN indic_syllabic_table[3328] = 0x0501, 0x0501, 0x050c, 0x0102, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x000a, 0x000a, 0x000a, 0x0006, 0x0006, 0x0006, 0x000a, 0x000a, 0x000a, 0x000a, 0x0504, 0x0107, 0x0107, 0x0507, 0x0507, - 0x0607, 0x0607, 0x0207, 0x0207, 0x0507, 0x010d, 0x010e, 0x000e, + 0x0607, 0x0607, 0x0207, 0x0207, 0x0507, 0x060e, 0x010e, 0x000e, 0x0005, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x0507, 0x0000, 0x000a, diff --git a/dll/win32/usp10/linebreak.c b/dll/win32/usp10/linebreak.c index 6d92c4465bc..904efc6538c 100644 --- a/dll/win32/usp10/linebreak.c +++ b/dll/win32/usp10/linebreak.c @@ -1,10 +1,10 @@ /* Unicode Line Break Properties */ -/* generated from
http://www.unicode.org/Public/11.0.0/ucd/LineBreak.txt
*/ +/* generated from
http://www.unicode.org/Public/12.0.0/ucd/LineBreak.txt
*/ /* DO NOT EDIT!! */ -#include "wine/unicode.h" +#include "windef.h" -const unsigned short DECLSPEC_HIDDEN wine_linebreak_table[7232] = +const unsigned short DECLSPEC_HIDDEN wine_linebreak_table[7216] = { /* level 1 offsets */ 0x0100, 0x0110, 0x0120, 0x0130, 0x0140, 0x0150, 0x0160, 0x0170, @@ -69,119 +69,119 @@ const unsigned short DECLSPEC_HIDDEN wine_linebreak_table[7232] = 0x0b70, 0x0ae0, 0x05b0, 0x0b80, 0x0b90, 0x0ba0, 0x0950, 0x0bb0, 0x0bc0, 0x0bd0, 0x05b0, 0x0be0, 0x0bf0, 0x0c00, 0x09b0, 0x0c10, 0x0c20, 0x0c30, 0x0c30, 0x0c40, 0x0c50, 0x0c60, 0x0870, 0x0870, - 0x0c70, 0x0c80, 0x0c90, 0x0ca0, 0x0cb0, 0x0cc0, 0x0870, 0x0870, - 0x0cd0, 0x0ce0, 0x07b0, 0x0cf0, 0x0d00, 0x05b0, 0x0d10, 0x0d20, - 0x0d30, 0x0d40, 0x0580, 0x0d50, 0x0d60, 0x0d70, 0x0870, 0x0870, - 0x0c30, 0x0c30, 0x0c30, 0x0c30, 0x0d80, 0x0c30, 0x0c30, 0x0c30, - 0x0c30, 0x0d90, 0x05b0, 0x05b0, 0x0da0, 0x05b0, 0x05b0, 0x05b0, - 0x0db0, 0x0db0, 0x0db0, 0x0db0, 0x0db0, 0x0db0, 0x0dc0, 0x0dc0, - 0x0dc0, 0x0dc0, 0x0dd0, 0x0de0, 0x0de0, 0x0de0, 0x0de0, 0x0de0, - 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x0df0, 0x0e00, 0x05b0, 0x05b0, - 0x0df0, 0x05b0, 0x05b0, 0x0e10, 0x0e20, 0x0e30, 0x05b0, 0x05b0, - 0x05b0, 0x0e20, 0x05b0, 0x05b0, 0x05b0, 0x0e40, 0x0e50, 0x0d10, - 0x05b0, 0x0e60, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x0e70, - 0x0e80, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, + 0x0c70, 0x0c30, 0x0c80, 0x0c90, 0x0ca0, 0x0cb0, 0x0870, 0x0870, + 0x0cc0, 0x0cd0, 0x07b0, 0x0ce0, 0x0cf0, 0x05b0, 0x0d00, 0x0d10, + 0x0d20, 0x0d30, 0x0580, 0x0d40, 0x0d50, 0x0d60, 0x0870, 0x0870, + 0x0c30, 0x0c30, 0x0c30, 0x0c30, 0x0d70, 0x0c30, 0x0c30, 0x0c30, + 0x0c30, 0x0d80, 0x05b0, 0x05b0, 0x0d90, 0x05b0, 0x05b0, 0x05b0, + 0x0da0, 0x0da0, 0x0da0, 0x0da0, 0x0da0, 0x0da0, 0x0db0, 0x0db0, + 0x0db0, 0x0db0, 0x0dc0, 0x0dd0, 0x0dd0, 0x0dd0, 0x0dd0, 0x0dd0, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x0de0, 0x0df0, 0x05b0, 0x05b0, + 0x0de0, 0x05b0, 0x05b0, 0x0e00, 0x0e10, 0x0e20, 0x05b0, 0x05b0, + 0x05b0, 0x0e10, 0x05b0, 0x05b0, 0x05b0, 0x0e30, 0x0e40, 0x0d00, + 0x05b0, 0x0e50, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x0e60, + 0x0e70, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, - 0x0e80, 0x0e90, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x0ea0, 0x0eb0, - 0x0ec0, 0x0ed0, 0x05b0, 0x0ee0, 0x05b0, 0x0ef0, 0x0ec0, 0x0f00, - 0x0c30, 0x0c30, 0x0c30, 0x0c30, 0x0c30, 0x0f10, 0x0f20, 0x0e60, - 0x0f30, 0x0f20, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x0eb0, - 0x0f40, 0x05b0, 0x0f50, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x0f60, - 0x05b0, 0x0840, 0x0f70, 0x0f70, 0x0f80, 0x0c30, 0x0f90, 0x0fa0, - 0x0c30, 0x0c30, 0x0fb0, 0x0c30, 0x0fc0, 0x0fd0, 0x05b0, 0x05b0, - 0x05b0, 0x0fe0, 0x0c30, 0x0c30, 0x0c30, 0x0ff0, 0x0c30, 0x1000, - 0x0f20, 0x0f20, 0x0f90, 0x1010, 0x0870, 0x0870, 0x0870, 0x0870, - 0x1020, 0x05b0, 0x05b0, 0x1030, 0x1040, 0x1050, 0x1060, 0x1070, - 0x1080, 0x05b0, 0x1090, 0x07b0, 0x05b0, 0x05b0, 0x07f0, 0x10a0, - 0x05b0, 0x05b0, 0x1030, 0x10b0, 0x10c0, 0x07b0, 0x05b0, 0x10d0, - 0x0eb0, 0x05b0, 0x05b0, 0x10e0, 0x0a50, 0x10f0, 0x1100, 0x1110, + 0x0e70, 0x0e80, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x0e90, 0x0ea0, + 0x0eb0, 0x0ec0, 0x05b0, 0x0ed0, 0x05b0, 0x0ee0, 0x0eb0, 0x0ef0, + 0x0c30, 0x0c30, 0x0c30, 0x0c30, 0x0c30, 0x0f00, 0x0f10, 0x0e50, + 0x0f20, 0x0f10, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x0ea0, + 0x0f30, 0x05b0, 0x0f40, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x0f50, + 0x05b0, 0x0840, 0x0f60, 0x0f60, 0x0f70, 0x0c30, 0x0c90, 0x0f80, + 0x0c30, 0x0c30, 0x0f90, 0x0c30, 0x0fa0, 0x0fb0, 0x05b0, 0x05b0, + 0x05b0, 0x0fc0, 0x0c30, 0x0c30, 0x0c30, 0x0fd0, 0x0c30, 0x0fe0, + 0x0f10, 0x0f10, 0x0c90, 0x0ff0, 0x0870, 0x0870, 0x0870, 0x0870, + 0x1000, 0x05b0, 0x05b0, 0x1010, 0x1020, 0x1030, 0x1040, 0x1050, + 0x1060, 0x05b0, 0x1070, 0x07b0, 0x05b0, 0x05b0, 0x07f0, 0x1080, + 0x05b0, 0x05b0, 0x1010, 0x1090, 0x10a0, 0x07b0, 0x05b0, 0x10b0, + 0x0ea0, 0x05b0, 0x05b0, 0x10c0, 0x0a50, 0x10d0, 0x10e0, 0x10f0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, - 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x0580, 0x0580, 0x0580, 0x1120, - 0x05b0, 0x0e70, 0x05b0, 0x05b0, 0x0e70, 0x1130, 0x05b0, 0x1140, - 0x05b0, 0x05b0, 0x05b0, 0x1150, 0x1150, 0x1160, 0x05b0, 0x1170, - 0x1180, 0x1190, 0x11a0, 0x11b0, 0x11c0, 0x11d0, 0x11e0, 0x11f0, - 0x1200, 0x0d10, 0x1210, 0x1220, 0x1230, 0x0580, 0x0580, 0x1240, - 0x1250, 0x1260, 0x1270, 0x05b0, 0x05b0, 0x1280, 0x1290, 0x12a0, - 0x12b0, 0x12a0, 0x05b0, 0x05b0, 0x05b0, 0x12c0, 0x05b0, 0x05b0, - 0x12d0, 0x12e0, 0x12f0, 0x1300, 0x1310, 0x1320, 0x1330, 0x05b0, - 0x1340, 0x1350, 0x1360, 0x1370, 0x05b0, 0x05b0, 0x1380, 0x05b0, - 0x1390, 0x13a0, 0x13b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, - 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x13c0, - 0x05b0, 0x05b0, 0x13d0, 0x0870, 0x0860, 0x0870, 0x13e0, 0x13e0, - 0x13e0, 0x13e0, 0x13e0, 0x13e0, 0x13e0, 0x13e0, 0x13e0, 0x13f0, - 0x13e0, 0x13e0, 0x13e0, 0x13e0, 0x1290, 0x13e0, 0x13e0, 0x1400, - 0x13e0, 0x1410, 0x1420, 0x1430, 0x1440, 0x1450, 0x1460, 0x05b0, - 0x1470, 0x1480, 0x05b0, 0x1490, 0x14a0, 0x05b0, 0x14b0, 0x14c0, - 0x05b0, 0x14d0, 0x05b0, 0x14e0, 0x14f0, 0x1500, 0x1510, 0x1520, - 0x1530, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1540, 0x1550, 0x1560, - 0x13e0, 0x1570, 0x05b0, 0x05b0, 0x1580, 0x05b0, 0x1590, 0x05b0, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x0580, 0x0580, 0x0580, 0x1100, + 0x05b0, 0x0e60, 0x05b0, 0x05b0, 0x0e60, 0x1110, 0x05b0, 0x1120, + 0x05b0, 0x05b0, 0x05b0, 0x1130, 0x1130, 0x1140, 0x05b0, 0x1150, + 0x1160, 0x1170, 0x1180, 0x1190, 0x11a0, 0x11b0, 0x11c0, 0x11d0, + 0x11e0, 0x0d00, 0x11f0, 0x1200, 0x1210, 0x0580, 0x0580, 0x1220, + 0x1230, 0x1240, 0x1250, 0x05b0, 0x05b0, 0x1260, 0x1270, 0x1280, + 0x1290, 0x1280, 0x05b0, 0x05b0, 0x05b0, 0x12a0, 0x05b0, 0x05b0, + 0x12b0, 0x12c0, 0x12d0, 0x12e0, 0x12f0, 0x1300, 0x1310, 0x05b0, + 0x1320, 0x1330, 0x1340, 0x1350, 0x05b0, 0x05b0, 0x1360, 0x05b0, + 0x1370, 0x1380, 0x1390, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x13a0, + 0x05b0, 0x05b0, 0x13b0, 0x0870, 0x0860, 0x0870, 0x13c0, 0x13c0, + 0x13c0, 0x13c0, 0x13c0, 0x13c0, 0x13c0, 0x13c0, 0x13c0, 0x13d0, + 0x13c0, 0x13c0, 0x13c0, 0x13c0, 0x1270, 0x13c0, 0x13c0, 0x13e0, + 0x13c0, 0x13f0, 0x1400, 0x1410, 0x1420, 0x1430, 0x1440, 0x05b0, + 0x1450, 0x1460, 0x05b0, 0x1470, 0x1480, 0x05b0, 0x1490, 0x14a0, + 0x05b0, 0x14b0, 0x05b0, 0x14c0, 0x14d0, 0x14e0, 0x14f0, 0x1500, + 0x1510, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1520, 0x1530, 0x1540, + 0x13c0, 0x1550, 0x05b0, 0x05b0, 0x1560, 0x05b0, 0x1570, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, - 0x15a0, 0x15b0, 0x05b0, 0x05b0, 0x05b0, 0x1390, 0x05b0, 0x15c0, - 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x15d0, 0x05b0, 0x15e0, - 0x05b0, 0x15f0, 0x05b0, 0x05b0, 0x0910, 0x05b0, 0x05b0, 0x0840, + 0x1580, 0x1590, 0x05b0, 0x05b0, 0x05b0, 0x1370, 0x05b0, 0x15a0, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x15b0, 0x05b0, 0x15c0, + 0x05b0, 0x15d0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x0840, 0x05b0, 0x05b0, 0x0840, 0x05b0, 0x05b0, - 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1600, 0x1610, - 0x05b0, 0x05b0, 0x0da0, 0x05b0, 0x05b0, 0x05b0, 0x1620, 0x1630, - 0x05b0, 0x13d0, 0x1640, 0x1640, 0x1640, 0x1640, 0x0580, 0x0580, - 0x1650, 0x1660, 0x1670, 0x1680, 0x1690, 0x0870, 0x0870, 0x0870, - 0x16a0, 0x16b0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16c0, - 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, - 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16d0, 0x0870, 0x16e0, - 0x16f0, 0x1700, 0x1710, 0x1720, 0x1730, 0x16a0, 0x1740, 0x16a0, - 0x1750, 0x1760, 0x1770, 0x16a0, 0x1740, 0x16a0, 0x1750, 0x1780, - 0x1790, 0x16a0, 0x16a0, 0x17a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, - 0x17b0, 0x16a0, 0x16a0, 0x17c0, 0x16a0, 0x16a0, 0x16c0, 0x17d0, - 0x16a0, 0x17b0, 0x16a0, 0x16a0, 0x17e0, 0x16a0, 0x16a0, 0x16a0, - 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x17b0, - 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, - 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, - 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, - 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, - 0x16a0, 0x17f0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, - 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, - 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, 0x16a0, - 0x1800, 0x16a0, 0x16a0, 0x16a0, 0x1810, 0x05b0, 0x05b0, 0x10d0, - 0x1820, 0x05b0, 0x1830, 0x0870, 0x05b0, 0x05b0, 0x1600, 0x1840, - 0x05b0, 0x1850, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1860, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x15e0, 0x15f0, + 0x05b0, 0x05b0, 0x0d90, 0x05b0, 0x05b0, 0x05b0, 0x1600, 0x1610, + 0x05b0, 0x13b0, 0x1620, 0x1620, 0x1620, 0x1620, 0x0580, 0x0580, + 0x1630, 0x1640, 0x1650, 0x1660, 0x1670, 0x0870, 0x0870, 0x0870, + 0x1680, 0x1690, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x16a0, + 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, + 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x16b0, 0x0870, 0x16c0, + 0x16d0, 0x16e0, 0x16f0, 0x1700, 0x1710, 0x1680, 0x1720, 0x1680, + 0x1730, 0x1740, 0x1750, 0x1680, 0x1720, 0x1680, 0x1730, 0x1760, + 0x1770, 0x1680, 0x1680, 0x1780, 0x1680, 0x1680, 0x1680, 0x1680, + 0x1790, 0x1680, 0x1680, 0x17a0, 0x1680, 0x1680, 0x16a0, 0x17b0, + 0x1680, 0x1790, 0x1680, 0x1680, 0x17c0, 0x1680, 0x1680, 0x1680, + 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1790, + 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, + 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, + 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, + 0x1680, 0x1680, 0x1680, 0x1680, 0x05b0, 0x05b0, 0x05b0, 0x05b0, + 0x1680, 0x17d0, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, + 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, + 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, + 0x17e0, 0x1680, 0x1680, 0x1680, 0x17f0, 0x05b0, 0x05b0, 0x10b0, + 0x1800, 0x05b0, 0x1810, 0x0870, 0x05b0, 0x05b0, 0x15e0, 0x1820, + 0x05b0, 0x1830, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1840, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, - 0x05b0, 0x05b0, 0x05b0, 0x0e60, 0x0870, 0x0870, 0x0870, 0x1870, - 0x1880, 0x05b0, 0x1890, 0x18a0, 0x05b0, 0x05b0, 0x05b0, 0x18b0, - 0x18c0, 0x05b0, 0x05b0, 0x1030, 0x18d0, 0x0f20, 0x0580, 0x18e0, - 0x07b0, 0x05b0, 0x18f0, 0x05b0, 0x1900, 0x1910, 0x0db0, 0x1920, - 0x08b0, 0x05b0, 0x05b0, 0x1930, 0x1940, 0x1950, 0x0c30, 0x1960, - 0x05b0, 0x05b0, 0x1970, 0x1980, 0x1990, 0x19a0, 0x0c30, 0x0c30, - 0x0c30, 0x0c30, 0x0c30, 0x0c30, 0x19b0, 0x19c0, 0x0760, 0x19d0, - 0x19e0, 0x19f0, 0x1640, 0x05b0, 0x05b0, 0x05b0, 0x0f60, 0x05b0, - 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1a00, 0x0f20, - 0x1a10, 0x1a20, 0x1a30, 0x1a40, 0x1a30, 0x1a50, 0x1a30, 0x1a10, - 0x1a20, 0x1a30, 0x1a40, 0x1a30, 0x1a50, 0x1a30, 0x1a10, 0x1a20, - 0x1a30, 0x1a40, 0x1a30, 0x1a50, 0x1a30, 0x1a10, 0x1a20, 0x1a30, - 0x1a40, 0x1a30, 0x1a50, 0x1a30, 0x1a10, 0x1a20, 0x1a30, 0x1a40, - 0x1a30, 0x1a50, 0x1a30, 0x1a10, 0x1a20, 0x1a30, 0x1a40, 0x1a30, - 0x1a50, 0x1a30, 0x1a10, 0x1a20, 0x1a30, 0x1a40, 0x1a30, 0x1a50, - 0x1a30, 0x1a10, 0x1a20, 0x1a30, 0x1a40, 0x1a30, 0x1a50, 0x1a30, - 0x1a10, 0x1a20, 0x1a30, 0x1a40, 0x1a30, 0x1a50, 0x1a30, 0x1a10, - 0x1a20, 0x1a30, 0x1a40, 0x1a30, 0x1a50, 0x1a30, 0x1a10, 0x1a20, - 0x1a30, 0x1a40, 0x1a30, 0x1a50, 0x1a30, 0x1a10, 0x1a20, 0x1a30, - 0x1a40, 0x1a30, 0x1a50, 0x1a30, 0x1a10, 0x1a20, 0x1a30, 0x1a40, - 0x1a30, 0x1a50, 0x1a30, 0x1a10, 0x1a20, 0x1a30, 0x1a40, 0x1a30, - 0x1a50, 0x1a30, 0x1a10, 0x1a20, 0x1a30, 0x1a40, 0x1a30, 0x1a50, - 0x1a30, 0x1a10, 0x1a20, 0x1a30, 0x1a40, 0x1a30, 0x1a50, 0x1a30, - 0x1a30, 0x1a40, 0x1a30, 0x1a50, 0x1a30, 0x1a10, 0x1a20, 0x1a30, - 0x1a40, 0x1a30, 0x1a60, 0x0dc0, 0x1a70, 0x0de0, 0x0de0, 0x1a80, - 0x1a90, 0x1a90, 0x1a90, 0x1a90, 0x1a90, 0x1a90, 0x1a90, 0x1a90, - 0x1a90, 0x1a90, 0x1a90, 0x1a90, 0x1a90, 0x1a90, 0x1a90, 0x1a90, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1850, 0x0870, 0x0870, 0x1860, + 0x1870, 0x05b0, 0x1880, 0x1890, 0x05b0, 0x05b0, 0x05b0, 0x18a0, + 0x18b0, 0x05b0, 0x05b0, 0x1010, 0x18c0, 0x0f10, 0x0580, 0x18d0, + 0x07b0, 0x05b0, 0x18e0, 0x05b0, 0x18f0, 0x1900, 0x0da0, 0x1910, + 0x08b0, 0x05b0, 0x05b0, 0x1920, 0x1930, 0x1940, 0x0c30, 0x1950, + 0x05b0, 0x05b0, 0x1960, 0x1970, 0x1980, 0x1990, 0x0c30, 0x0c30, + 0x0c30, 0x0c30, 0x0c30, 0x0c30, 0x19a0, 0x19b0, 0x0760, 0x19c0, + 0x19d0, 0x19e0, 0x1620, 0x05b0, 0x05b0, 0x05b0, 0x0a50, 0x05b0, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x19f0, 0x0f10, + 0x1a00, 0x1a10, 0x1a20, 0x1a30, 0x1a20, 0x1a40, 0x1a20, 0x1a00, + 0x1a10, 0x1a20, 0x1a30, 0x1a20, 0x1a40, 0x1a20, 0x1a00, 0x1a10, + 0x1a20, 0x1a30, 0x1a20, 0x1a40, 0x1a20, 0x1a00, 0x1a10, 0x1a20, + 0x1a30, 0x1a20, 0x1a40, 0x1a20, 0x1a00, 0x1a10, 0x1a20, 0x1a30, + 0x1a20, 0x1a40, 0x1a20, 0x1a00, 0x1a10, 0x1a20, 0x1a30, 0x1a20, + 0x1a40, 0x1a20, 0x1a00, 0x1a10, 0x1a20, 0x1a30, 0x1a20, 0x1a40, + 0x1a20, 0x1a00, 0x1a10, 0x1a20, 0x1a30, 0x1a20, 0x1a40, 0x1a20, + 0x1a00, 0x1a10, 0x1a20, 0x1a30, 0x1a20, 0x1a40, 0x1a20, 0x1a00, + 0x1a10, 0x1a20, 0x1a30, 0x1a20, 0x1a40, 0x1a20, 0x1a00, 0x1a10, + 0x1a20, 0x1a30, 0x1a20, 0x1a40, 0x1a20, 0x1a00, 0x1a10, 0x1a20, + 0x1a30, 0x1a20, 0x1a40, 0x1a20, 0x1a00, 0x1a10, 0x1a20, 0x1a30, + 0x1a20, 0x1a40, 0x1a20, 0x1a00, 0x1a10, 0x1a20, 0x1a30, 0x1a20, + 0x1a40, 0x1a20, 0x1a00, 0x1a10, 0x1a20, 0x1a30, 0x1a20, 0x1a40, + 0x1a20, 0x1a00, 0x1a10, 0x1a20, 0x1a30, 0x1a20, 0x1a40, 0x1a20, + 0x1a20, 0x1a30, 0x1a20, 0x1a40, 0x1a20, 0x1a00, 0x1a10, 0x1a20, + 0x1a30, 0x1a20, 0x1a50, 0x0db0, 0x1a60, 0x0dd0, 0x0dd0, 0x1a70, + 0x1a80, 0x1a80, 0x1a80, 0x1a80, 0x1a80, 0x1a80, 0x1a80, 0x1a80, + 0x1a80, 0x1a80, 0x1a80, 0x1a80, 0x1a80, 0x1a80, 0x1a80, 0x1a80, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, - 0x13d0, 0x1aa0, 0x1ab0, 0x1ac0, 0x1ad0, 0x05b0, 0x05b0, 0x05b0, - 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1ae0, 0x1af0, 0x05b0, 0x05b0, - 0x05b0, 0x05b0, 0x05b0, 0x1b00, 0x0870, 0x05b0, 0x05b0, 0x05b0, - 0x05b0, 0x1b10, 0x05b0, 0x05b0, 0x0a50, 0x0870, 0x0870, 0x1b20, - 0x0580, 0x1b30, 0x0580, 0x1b40, 0x1b50, 0x1b60, 0x1b70, 0x1150, - 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1b80, - 0x1b90, 0x1ba0, 0x16a0, 0x1bb0, 0x16a0, 0x1bc0, 0x1bd0, 0x1be0, - 0x16a0, 0x1bf0, 0x16a0, 0x17b0, 0x1c00, 0x1c10, 0x1c20, 0x1c30, + 0x13b0, 0x1a90, 0x1aa0, 0x1ab0, 0x1ac0, 0x05b0, 0x05b0, 0x05b0, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1ad0, 0x1ae0, 0x05b0, 0x05b0, + 0x05b0, 0x05b0, 0x05b0, 0x1af0, 0x0870, 0x05b0, 0x05b0, 0x05b0, + 0x05b0, 0x1b00, 0x05b0, 0x05b0, 0x0a50, 0x0870, 0x0870, 0x1b10, + 0x0580, 0x1b20, 0x0580, 0x1b30, 0x1b40, 0x1b50, 0x1b60, 0x1130, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1b70, + 0x1b80, 0x1b90, 0x1680, 0x1ba0, 0x1680, 0x1bb0, 0x1bc0, 0x1bd0, + 0x1680, 0x1be0, 0x1680, 0x1790, 0x1bf0, 0x1c00, 0x1c10, 0x1c20, /* values */ 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0022, 0x0003, 0x0001, 0x0001, 0x0002, 0x0004, 0x0004, @@ -365,7 +365,7 @@ const unsigned short DECLSPEC_HIDDEN wine_linebreak_table[7232] = 0x0004, 0x0011, 0x0004, 0x0004, 0x0004, 0x0004, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0004, 0x0004, 0x0011, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, - 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, + 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0021, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0004, 0x0004, 0x0004, 0x0021, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x001d, 0x001d, @@ -407,14 +407,12 @@ const unsigned short DECLSPEC_HIDDEN wine_linebreak_table[7232] = 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x001d, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x0022, 0x0022, 0x0011, 0x0011, 0x0011, 0x0011, - 0x0011, 0x0023, 0x0023, 0x0011, 0x0023, 0x0011, 0x0011, 0x0023, - 0x0023, 0x0011, 0x0023, 0x0011, 0x0011, 0x0023, 0x0011, 0x0011, - 0x0011, 0x0011, 0x0011, 0x0011, 0x0023, 0x0023, 0x0023, 0x0023, - 0x0011, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, - 0x0011, 0x0023, 0x0023, 0x0023, 0x0011, 0x0023, 0x0011, 0x0023, - 0x0011, 0x0011, 0x0023, 0x0023, 0x0011, 0x0023, 0x0023, 0x0023, + 0x0011, 0x0023, 0x0023, 0x0011, 0x0023, 0x0011, 0x0023, 0x0023, + 0x0023, 0x0023, 0x0023, 0x0011, 0x0023, 0x0023, 0x0023, 0x0023, + 0x0023, 0x0023, 0x0023, 0x0023, 0x0011, 0x0023, 0x0011, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, - 0x0023, 0x0023, 0x0011, 0x0023, 0x0023, 0x0023, 0x0011, 0x0011, + 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, + 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0011, 0x0011, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0011, 0x0023, 0x0011, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0011, 0x0011, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, @@ -507,8 +505,6 @@ const unsigned short DECLSPEC_HIDDEN wine_linebreak_table[7232] = 0x0004, 0x0004, 0x0004, 0x0004, 0x0011, 0x0011, 0x0011, 0x0011, 0x001d, 0x0011, 0x0011, 0x0011, 0x0017, 0x0017, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, - 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, - 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0011, 0x0011, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, @@ -555,8 +551,8 @@ const unsigned short DECLSPEC_HIDDEN wine_linebreak_table[7232] = 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x001d, 0x001d, 0x001d, 0x001d, 0x0004, 0x001d, 0x001d, - 0x001d, 0x001d, 0x0004, 0x0004, 0x0004, 0x001d, 0x001d, 0x0004, - 0x0004, 0x0004, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, + 0x001d, 0x001d, 0x001d, 0x001d, 0x0004, 0x001d, 0x001d, 0x0004, + 0x0004, 0x0004, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0011, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, @@ -732,7 +728,7 @@ const unsigned short DECLSPEC_HIDDEN wine_linebreak_table[7232] = 0x0022, 0x0022, 0x001d, 0x0022, 0x0022, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0025, 0x0025, 0x0022, 0x0022, 0x0022, 0x001d, 0x0022, 0x0022, 0x0012, 0x0022, 0x0022, 0x0022, 0x0022, 0x0022, - 0x0022, 0x0022, 0x0022, 0x001d, 0x0022, 0x001d, 0x0022, 0x0011, + 0x0022, 0x0022, 0x0022, 0x001d, 0x0022, 0x001d, 0x0022, 0x0022, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, @@ -791,6 +787,8 @@ const unsigned short DECLSPEC_HIDDEN wine_linebreak_table[7232] = 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0004, 0x0004, 0x0004, 0x0004, 0x001d, 0x0022, 0x0022, 0x0022, 0x0022, 0x0022, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, + 0x0011, 0x0011, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, + 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0004, 0x001d, 0x001d, 0x001d, 0x0004, 0x001d, diff --git a/dll/win32/usp10/mirror.c b/dll/win32/usp10/mirror.c index 9239d79596c..7b43a85703c 100644 --- a/dll/win32/usp10/mirror.c +++ b/dll/win32/usp10/mirror.c @@ -1,8 +1,8 @@ /* Unicode BiDi mirroring */ -/* generated from
http://www.unicode.org/Public/11.0.0/ucd/BidiMirroring.txt
*/ +/* generated from
http://www.unicode.org/Public/12.0.0/ucd/BidiMirroring.txt
*/ /* DO NOT EDIT!! */ -#include "wine/unicode.h" +#include "windef.h" const WCHAR DECLSPEC_HIDDEN wine_mirror_map[3544] = { diff --git a/dll/win32/usp10/opentype.c b/dll/win32/usp10/opentype.c index 53632714a4e..a6ce76072d9 100644 --- a/dll/win32/usp10/opentype.c +++ b/dll/win32/usp10/opentype.c @@ -658,7 +658,7 @@ static VOID *load_CMAP_format12_table(HDC hdc, ScriptCache *psc) return NULL; } -static int compare_group(const void *a, const void* b) +static int __cdecl compare_group(const void *a, const void* b) { const DWORD *chr = a; const CMAP_SegmentedCoverage_group *group = b; diff --git a/dll/win32/usp10/precomp.h b/dll/win32/usp10/precomp.h index 00da1b9083c..f0f190cc1ae 100644 --- a/dll/win32/usp10/precomp.h +++ b/dll/win32/usp10/precomp.h @@ -2,8 +2,6 @@ #ifndef _USP10_PRECOMP_H_ #define _USP10_PRECOMP_H_ -#include <config.h> - #include <stdarg.h> #define WIN32_NO_STATUS @@ -16,7 +14,6 @@ #include <usp10.h> #include <wine/debug.h> -#include <wine/unicode.h> #include "usp10_internal.h" diff --git a/dll/win32/usp10/shaping.c b/dll/win32/usp10/shaping.c index 941bd594151..ebb6fae5097 100644 --- a/dll/win32/usp10/shaping.c +++ b/dll/win32/usp10/shaping.c @@ -1,8 +1,8 @@ /* Unicode Arabic shaping */ -/* generated from
http://www.unicode.org/Public/11.0.0/ucd/ArabicShaping.txt
*/ +/* generated from
http://www.unicode.org/Public/12.0.0/ucd/ArabicShaping.txt
*/ /* DO NOT EDIT!! */ -#include "wine/unicode.h" +#include "windef.h" const unsigned short DECLSPEC_HIDDEN wine_shaping_table[2944] = { @@ -258,7 +258,7 @@ const unsigned short DECLSPEC_HIDDEN wine_shaping_table[2944] = 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, - 0x0001, 0x0001, 0x0000, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -360,7 +360,7 @@ const unsigned short DECLSPEC_HIDDEN wine_shaping_table[2944] = 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0001, 0x0001, - 0x0001, 0x0001, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0001, 0x0000, 0x0000, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, diff --git a/dll/win32/usp10/usp10.c b/dll/win32/usp10/usp10.c index a18c049b080..c53f3e97d1e 100644 --- a/dll/win32/usp10/usp10.c +++ b/dll/win32/usp10/usp10.c @@ -27,6 +27,9 @@ #include <stdarg.h> #include <stdlib.h> #include <math.h> +#ifdef __REACTOS__ +#include <wchar.h> +#endif #include "windef.h" #include "winbase.h" @@ -40,7 +43,6 @@ #include "wine/debug.h" #include "wine/heap.h" -#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(uniscribe); @@ -876,7 +878,7 @@ static HRESULT init_script_cache(const HDC hdc, SCRIPT_CACHE *psc) return E_INVALIDARG; } /* Ensure canonical result by zeroing extra space in lfFaceName */ - size = strlenW(lf.lfFaceName); + size = lstrlenW(lf.lfFaceName); memset(lf.lfFaceName + size, 0, sizeof(lf.lfFaceName) - size * sizeof(WCHAR)); EnterCriticalSection(&cs_script_cache); @@ -952,7 +954,7 @@ static DWORD decode_surrogate_pair(const WCHAR *str, unsigned int index, unsigne return 0; } -static int usp10_compare_script_range(const void *key, const void *value) +static int __cdecl usp10_compare_script_range(const void *key, const void *value) { const struct usp10_script_range *range = value; const DWORD *ch = key; @@ -978,7 +980,7 @@ static enum usp10_script get_char_script(const WCHAR *str, unsigned int index, return Script_CR; /* These punctuation characters are separated out as Latin punctuation */ - if (strchrW(latin_punc,str[index])) + if (wcschr(latin_punc,str[index])) return Script_Punctuation2; /* These chars are itemized as Punctuation by Windows */ @@ -1023,7 +1025,7 @@ static enum usp10_script get_char_script(const WCHAR *str, unsigned int index, return range->script; } -static int compare_FindGlyph(const void *a, const void* b) +static int __cdecl compare_FindGlyph(const void *a, const void* b) { const FindGlyph_struct *find = (FindGlyph_struct*)a; const WORD *idx= (WORD*)b; @@ -1534,7 +1536,7 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars, { if (i > 0 && i < cInChars-1 && script_is_numeric(scripts[i-1]) && - strchrW(math_punc, pwcInChars[i])) + wcschr(math_punc, pwcInChars[i])) { if (script_is_numeric(scripts[i+1])) { @@ -1543,7 +1545,7 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars, strength[i] = strength[i-1]; i++; } - else if (strchrW(repeatable_math_punc, pwcInChars[i])) + else if (wcschr(repeatable_math_punc, pwcInChars[i])) { int j; for (j = i+1; j < cInChars; j++) @@ -1967,7 +1969,7 @@ static void find_fallback_font(enum usp10_script scriptid, WCHAR *FaceName) DWORD count = LF_FACESIZE * sizeof(WCHAR); DWORD type; - sprintfW(value, szFmt, scriptInformation[scriptid].scriptTag); + swprintf(value, szFmt, scriptInformation[scriptid].scriptTag); if (RegQueryValueExW(hkey, value, 0, &type, (BYTE *)FaceName, &count)) lstrcpyW(FaceName,scriptInformation[scriptid].fallbackFont); RegCloseKey(hkey); @@ -3434,9 +3436,27 @@ HRESULT WINAPI ScriptPlaceOpenType( HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS if (FAILED(hr = ScriptGetCMap(hdc, psc, &pwGlyphs[i], 1, 0, &glyph))) return hr; } else + { + hr = S_OK; glyph = pwGlyphs[i]; + } - if (!get_cache_glyph_widths(psc, glyph, &abc)) + if (hr == S_FALSE) + { + if (!hdc) return E_PENDING; + if (get_cache_pitch_family(psc) & TMPF_TRUETYPE) + { + if (!GetCharABCWidthsW(hdc, pwGlyphs[i], pwGlyphs[i], &abc)) return S_FALSE; + } + else + { + INT width; + if (!GetCharWidthW(hdc, pwGlyphs[i], pwGlyphs[i], &width)) return S_FALSE; + abc.abcB = width; + abc.abcA = abc.abcC = 0; + } + } + else if (!get_cache_glyph_widths(psc, glyph, &abc)) { if (!hdc) return E_PENDING; if (get_cache_pitch_family(psc) & TMPF_TRUETYPE) @@ -3544,42 +3564,27 @@ HRESULT WINAPI ScriptGetCMap(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcInChars hr = S_OK; - if ((get_cache_pitch_family(psc) & TMPF_TRUETYPE)) + for (i = 0; i < cChars; i++) { - for (i = 0; i < cChars; i++) + WCHAR inChar; + if (dwFlags == SGCM_RTL) + inChar = mirror_char(pwcInChars[i]); + else + inChar = pwcInChars[i]; + if (!(pwOutGlyphs[i] = get_cache_glyph(psc, inChar))) { - WCHAR inChar; - if (dwFlags == SGCM_RTL) - inChar = mirror_char(pwcInChars[i]); - else - inChar = pwcInChars[i]; - if (!(pwOutGlyphs[i] = get_cache_glyph(psc, inChar))) + WORD glyph; + if (!hdc) return E_PENDING; + if (GetGlyphIndicesW(hdc, &inChar, 1, &glyph, GGI_MARK_NONEXISTING_GLYPHS) == GDI_ERROR) return S_FALSE; + if (glyph == 0xffff) { - WORD glyph; - if (!hdc) return E_PENDING; - if (GetGlyphIndicesW(hdc, &inChar, 1, &glyph, GGI_MARK_NONEXISTING_GLYPHS) == GDI_ERROR) return S_FALSE; - if (glyph == 0xffff) - { - hr = S_FALSE; - glyph = 0x0; - } - pwOutGlyphs[i] = set_cache_glyph(psc, inChar, glyph); + hr = S_FALSE; + glyph = 0x0; } + pwOutGlyphs[i] = set_cache_glyph(psc, inChar, glyph); } } - else - { - TRACE("no glyph translation\n"); - for (i = 0; i < cChars; i++) - { - WCHAR inChar; - if (dwFlags == SGCM_RTL) - inChar = mirror_char(pwcInChars[i]); - else - inChar = pwcInChars[i]; - pwOutGlyphs[i] = inChar; - } - } + return hr; } @@ -3890,6 +3895,7 @@ const SIZE * WINAPI ScriptString_pSize(SCRIPT_STRING_ANALYSIS ssa) for (j = 0; j < analysis->glyphs[i].numGlyphs; j++) analysis->sz.cx += analysis->glyphs[i].piAdvance[j]; } + analysis->flags |= SCRIPT_STRING_ANALYSIS_FLAGS_SIZE; } return &analysis->sz; } diff --git a/media/doc/README.WINE b/media/doc/README.WINE index ba7afbefd41..8cd29acad9a 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -190,7 +190,7 @@ dll/win32/twain_32 # Synced to WineStaging-4.18 dll/win32/updspapi # Synced to WineStaging-4.18 dll/win32/url # Synced to WineStaging-3.3 dll/win32/urlmon # Synced to WineStaging-4.18 -dll/win32/usp10 # Synced to WineStaging-4.0 +dll/win32/usp10 # Synced to WineStaging-4.18 dll/win32/uxtheme # Forked dll/win32/vbscript # Synced to WineStaging-4.0 dll/win32/version # Synced to WineStaging-4.0
5 years
1
0
0
0
← Newer
1
...
18
19
20
21
22
23
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
Results per page:
10
25
50
100
200