winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
December 2018
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
352 discussions
Start a n
N
ew thread
Zebediah Figura : setupapi: Delete all empty parent keys of a removed device key.
by Alexandre Julliard
03 Dec '18
03 Dec '18
Module: wine Branch: master Commit: 8fff6eeb76a22bd21888e592f0646362cbac7934 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8fff6eeb76a22bd21888e592…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Fri Nov 30 16:42:13 2018 -0600 setupapi: Delete all empty parent keys of a removed device key. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/devinst.c | 17 +++++++++++++++++ dlls/setupapi/tests/devinst.c | 31 ------------------------------- 2 files changed, 17 insertions(+), 31 deletions(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 5ae3fbd..82a45b4 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -578,7 +578,9 @@ static void remove_device_iface(struct device_iface *iface) static void remove_device(struct device *device) { + WCHAR id[MAX_DEVICE_ID_LEN], *p; struct device_iface *iface; + HKEY enum_key; LIST_FOR_EACH_ENTRY(iface, &device->interfaces, struct device_iface, entry) { @@ -587,6 +589,21 @@ static void remove_device(struct device *device) RegDeleteTreeW(device->key, NULL); RegDeleteKeyW(device->key, emptyW); + + /* delete all empty parents of the key */ + if (!RegOpenKeyExW(HKEY_LOCAL_MACHINE, Enum, 0, 0, &enum_key)) + { + strcpyW(id, device->instanceId); + + while ((p = strrchrW(id, '\\'))) + { + *p = 0; + RegDeleteKeyW(enum_key, id); + } + + RegCloseKey(enum_key); + } + RegCloseKey(device->key); device->key = NULL; device->removed = TRUE; diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index 07e082b..29f12c3 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -466,9 +466,6 @@ static void test_get_device_instance_id(void) static void test_register_device_info(void) { - static const WCHAR bogus[] = {'S','y','s','t','e','m','\\', - 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\', - 'E','n','u','m','\\','R','o','o','t','\\','L','E','G','A','C','Y','_','B','O','G','U','S',0}; SP_DEVINFO_DATA device = {0}; BOOL ret; HDEVINFO set; @@ -526,9 +523,6 @@ static void test_register_device_info(void) ok(GetLastError() == ERROR_NO_MORE_ITEMS, "Got unexpected error %#x.\n", GetLastError()); SetupDiDestroyDeviceInfoList(set); - - /* remove once Wine is fixed */ - devinst_RegDeleteTreeW(HKEY_LOCAL_MACHINE, bogus); } static void check_device_iface_(int line, HDEVINFO set, SP_DEVINFO_DATA *device, @@ -662,10 +656,6 @@ static void test_device_iface(void) static void test_device_iface_detail(void) { - static const WCHAR bogus[] = {'S','y','s','t','e','m','\\', - 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\', - 'E','n','u','m','\\','R','o','o','t','\\', - 'L','E','G','A','C','Y','_','B','O','G','U','S',0}; static const char path[] = "\\\\?\\root#legacy_bogus#0000#{6a55b5a4-3f65-11db-b704-0011955c2bdb}"; SP_DEVICE_INTERFACE_DETAIL_DATA_A *detail; SP_DEVICE_INTERFACE_DATA iface = {sizeof(iface)}; @@ -737,9 +727,6 @@ static void test_device_iface_detail(void) heap_free(detail); SetupDiDestroyDeviceInfoList(set); - - /* remove once Wine is fixed */ - devinst_RegDeleteTreeW(HKEY_LOCAL_MACHINE, bogus); } static void test_device_key(void) @@ -849,7 +836,6 @@ todo_wine { SetupDiDestroyDeviceInfoList(set); /* remove once Wine is fixed */ - devinst_RegDeleteTreeW(HKEY_LOCAL_MACHINE, bogus); devinst_RegDeleteTreeW(HKEY_LOCAL_MACHINE, classKey); } @@ -890,9 +876,6 @@ static void test_register_device_iface(void) SetupDiDestroyDeviceInfoList(set); SetupDiDestroyDeviceInfoList(set2); - - /* remove once Wine is fixed */ - devinst_RegDeleteTreeW(HKEY_LOCAL_MACHINE, bogus); } static void test_registry_property_a(void) @@ -992,14 +975,7 @@ todo_wine { SetupDiDestroyDeviceInfoList(set); res = RegOpenKeyA(HKEY_LOCAL_MACHINE, bogus, &key); -todo_wine ok(res == ERROR_FILE_NOT_FOUND, "Key should not exist.\n"); - /* FIXME: Remove when Wine is fixed */ - if (res == ERROR_SUCCESS) - { - /* Wine doesn't delete the information currently */ - RegDeleteKeyA(HKEY_LOCAL_MACHINE, bogus); - } } static void test_registry_property_w(void) @@ -1103,14 +1079,7 @@ todo_wine { SetupDiDestroyDeviceInfoList(set); res = RegOpenKeyW(HKEY_LOCAL_MACHINE, bogus, &key); -todo_wine ok(res == ERROR_FILE_NOT_FOUND, "Key should not exist.\n"); - /* FIXME: Remove when Wine is fixed */ - if (res == ERROR_SUCCESS) - { - /* Wine doesn't delete the information currently */ - RegDeleteKeyW(HKEY_LOCAL_MACHINE, bogus); - } } static void test_get_inf_class(void)
1
0
0
0
Zebediah Figura : setupapi: Implement SetupDiRemoveDevice().
by Alexandre Julliard
03 Dec '18
03 Dec '18
Module: wine Branch: master Commit: 24736edfa8b9011da4823a3a7c884b20b40c0535 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=24736edfa8b9011da4823a3a…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Fri Nov 30 16:42:12 2018 -0600 setupapi: Implement SetupDiRemoveDevice(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/devinst.c | 63 +++++++++++++++++++++++++++---------------- dlls/setupapi/tests/devinst.c | 6 ----- 2 files changed, 40 insertions(+), 29 deletions(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 4498fdc..5ae3fbd 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -118,6 +118,7 @@ struct device GUID class; DEVINST devnode; struct list entry; + BOOL removed; }; struct device_iface @@ -167,6 +168,12 @@ static struct device *get_device(HDEVINFO devinfo, const SP_DEVINFO_DATA *data) return NULL; } + if (device->removed) + { + SetLastError(ERROR_NO_SUCH_DEVINST); + return NULL; + } + return device; } @@ -569,32 +576,36 @@ static void remove_device_iface(struct device_iface *iface) iface->flags |= SPINT_REMOVED; } -static void SETUPDI_RemoveDevice(struct device *device) +static void remove_device(struct device *device) +{ + struct device_iface *iface; + + LIST_FOR_EACH_ENTRY(iface, &device->interfaces, struct device_iface, entry) + { + remove_device_iface(iface); + } + + RegDeleteTreeW(device->key, NULL); + RegDeleteKeyW(device->key, emptyW); + RegCloseKey(device->key); + device->key = NULL; + device->removed = TRUE; +} + +static void delete_device(struct device *device) { struct device_iface *iface, *next; - if (device->key != INVALID_HANDLE_VALUE) - RegCloseKey(device->key); if (device->phantom) - { - HKEY enumKey; - LONG l; + remove_device(device); - l = RegCreateKeyExW(HKEY_LOCAL_MACHINE, Enum, 0, NULL, 0, - KEY_ALL_ACCESS, NULL, &enumKey, NULL); - if (!l) - { - RegDeleteTreeW(enumKey, device->instanceId); - RegCloseKey(enumKey); - } - } + RegCloseKey(device->key); heap_free(device->instanceId); + LIST_FOR_EACH_ENTRY_SAFE(iface, next, &device->interfaces, struct device_iface, entry) { list_remove(&iface->entry); - if (device->phantom) - remove_device_iface(iface); RegCloseKey(iface->refstr_key); RegCloseKey(iface->class_key); heap_free(iface->refstr); @@ -635,6 +646,7 @@ static struct device *SETUPDI_CreateDeviceInfo(struct DeviceInfoSet *set, list_init(&device->interfaces); device->class = *class; device->devnode = alloc_devnode(device); + device->removed = FALSE; list_add_tail(&set->devices, &device->entry); set->cDevices++; @@ -1538,13 +1550,18 @@ BOOL WINAPI SetupDiRegisterDeviceInfo(HDEVINFO devinfo, SP_DEVINFO_DATA *device_ /*********************************************************************** * SetupDiRemoveDevice (SETUPAPI.@) */ -BOOL WINAPI SetupDiRemoveDevice( - HDEVINFO devinfo, - PSP_DEVINFO_DATA info) +BOOL WINAPI SetupDiRemoveDevice(HDEVINFO devinfo, SP_DEVINFO_DATA *device_data) { - FIXME("(%p, %p): stub\n", devinfo, info); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + struct device *device; + + TRACE("devinfo %p, device_data %p.\n", devinfo, device_data); + + if (!(device = get_device(devinfo, device_data))) + return FALSE; + + remove_device(device); + + return TRUE; } /*********************************************************************** @@ -2616,7 +2633,7 @@ BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo) LIST_FOR_EACH_ENTRY_SAFE(device, device2, &set->devices, struct device, entry) { - SETUPDI_RemoveDevice(device); + delete_device(device); } heap_free(set); diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index 45d145d1..07e082b 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -338,7 +338,6 @@ static void test_device_info(void) check_device_info(set, 3, &guid, NULL); ret = SetupDiRemoveDevice(set, &device); -todo_wine ok(ret, "Got unexpected error %#x.\n", GetLastError()); check_device_info(set, 0, &guid, "ROOT\\LEGACY_BOGUS\\0000"); @@ -349,10 +348,8 @@ todo_wine ok(IsEqualGUID(&ret_device.ClassGuid, &guid), "Got unexpected class %s.\n", wine_dbgstr_guid(&ret_device.ClassGuid)); ret = SetupDiGetDeviceInstanceIdA(set, &ret_device, id, sizeof(id), NULL); -todo_wine { ok(!ret, "Expected failure.\n"); ok(GetLastError() == ERROR_NO_SUCH_DEVINST, "Got unexpected error %#x.\n", GetLastError()); -} ok(ret_device.DevInst == device.DevInst, "Expected device node %#x, got %#x.\n", device.DevInst, ret_device.DevInst); @@ -522,7 +519,6 @@ static void test_register_device_info(void) ok(!strcasecmp(id, "Root\\LEGACY_BOGUS\\0000"), "Got unexpected id %s.\n", id); ret = SetupDiRemoveDevice(set, &device); -todo_wine ok(ret, "Failed to remove device, error %#x.\n", GetLastError()); ret = SetupDiEnumDeviceInfo(set, 1, &device); @@ -849,7 +845,6 @@ todo_wine { } ret = SetupDiRemoveDevice(set, &device); -todo_wine ok(ret, "Failed to remove device, error %#x.\n", GetLastError()); SetupDiDestroyDeviceInfoList(set); @@ -891,7 +886,6 @@ static void test_register_device_iface(void) check_device_iface(set2, NULL, &guid, 1, 0, NULL); ret = SetupDiRemoveDevice(set, &device); -todo_wine ok(ret, "Failed to remove device, error %#x.\n", GetLastError()); SetupDiDestroyDeviceInfoList(set);
1
0
0
0
Zebediah Figura : setupapi: Completely remove unregistered device interfaces.
by Alexandre Julliard
03 Dec '18
03 Dec '18
Module: wine Branch: master Commit: fa823476c6939114ec52c50b0e3756de7f936aea URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fa823476c6939114ec52c50b…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Fri Nov 30 16:42:11 2018 -0600 setupapi: Completely remove unregistered device interfaces. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/devinst.c | 2 +- dlls/setupapi/tests/devinst.c | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index cc05623..4498fdc 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -594,7 +594,7 @@ static void SETUPDI_RemoveDevice(struct device *device) { list_remove(&iface->entry); if (device->phantom) - RegDeleteKeyW(iface->refstr_key, emptyW); + remove_device_iface(iface); RegCloseKey(iface->refstr_key); RegCloseKey(iface->class_key); heap_free(iface->refstr); diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index fbc62dc..45d145d1 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -670,12 +670,6 @@ static void test_device_iface_detail(void) 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\', 'E','n','u','m','\\','R','o','o','t','\\', 'L','E','G','A','C','Y','_','B','O','G','U','S',0}; - static const WCHAR devclass[] = {'S','y','s','t','e','m','\\', - 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\', - 'C','o','n','t','r','o','l','\\','D','e','v','i','c','e','C','l','a','s','s','e','s','\\', - '{','6','a','5','5','b','5','a','4','-','3','f','6','5','-', - '1','1','d','b','-','b','7','0','4','-', - '0','0','1','1','9','5','5','c','2','b','d','b','}',0}; static const char path[] = "\\\\?\\root#legacy_bogus#0000#{6a55b5a4-3f65-11db-b704-0011955c2bdb}"; SP_DEVICE_INTERFACE_DETAIL_DATA_A *detail; SP_DEVICE_INTERFACE_DATA iface = {sizeof(iface)}; @@ -750,7 +744,6 @@ static void test_device_iface_detail(void) /* remove once Wine is fixed */ devinst_RegDeleteTreeW(HKEY_LOCAL_MACHINE, bogus); - devinst_RegDeleteTreeW(HKEY_LOCAL_MACHINE, devclass); } static void test_device_key(void)
1
0
0
0
Zebediah Figura : setupapi: Implement SetupDiRemoveDeviceInterface().
by Alexandre Julliard
03 Dec '18
03 Dec '18
Module: wine Branch: master Commit: 3ff98740346e69247b572b0a3e9b71c32b0abcf4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3ff98740346e69247b572b0a…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Fri Nov 30 16:42:10 2018 -0600 setupapi: Implement SetupDiRemoveDeviceInterface(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/devinst.c | 28 ++++++++++++++++++++++++---- dlls/setupapi/tests/devinst.c | 2 -- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index b3d7099..cc05623 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -556,6 +556,19 @@ static BOOL SETUPDI_SetDeviceRegistryPropertyW(struct device *device, return FALSE; } +static void remove_device_iface(struct device_iface *iface) +{ + RegDeleteTreeW(iface->refstr_key, NULL); + RegDeleteKeyW(iface->refstr_key, emptyW); + RegCloseKey(iface->refstr_key); + iface->refstr_key = NULL; + /* Also remove the class key if it's empty. */ + RegDeleteKeyW(iface->class_key, emptyW); + RegCloseKey(iface->class_key); + iface->class_key = NULL; + iface->flags |= SPINT_REMOVED; +} + static void SETUPDI_RemoveDevice(struct device *device) { struct device_iface *iface, *next; @@ -1537,11 +1550,18 @@ BOOL WINAPI SetupDiRemoveDevice( /*********************************************************************** * SetupDiRemoveDeviceInterface (SETUPAPI.@) */ -BOOL WINAPI SetupDiRemoveDeviceInterface(HDEVINFO info, PSP_DEVICE_INTERFACE_DATA data) +BOOL WINAPI SetupDiRemoveDeviceInterface(HDEVINFO devinfo, SP_DEVICE_INTERFACE_DATA *iface_data) { - FIXME("(%p, %p): stub\n", info, data); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + struct device_iface *iface; + + TRACE("devinfo %p, iface_data %p.\n", devinfo, iface_data); + + if (!(iface = get_device_iface(devinfo, iface_data))) + return FALSE; + + remove_device_iface(iface); + + return TRUE; } /*********************************************************************** diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index 338393e..fbc62dc 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -552,7 +552,6 @@ static void check_device_iface_(int line, HDEVINFO set, SP_DEVINFO_DATA *device, ok_(__FILE__, line)(ret, "Failed to enumerate interfaces, error %#x.\n", GetLastError()); ok_(__FILE__, line)(IsEqualGUID(&iface.InterfaceClassGuid, class), "Got unexpected class %s.\n", wine_dbgstr_guid(&iface.InterfaceClassGuid)); -todo_wine_if(flags & SPINT_REMOVED) ok_(__FILE__, line)(iface.Flags == flags, "Got unexpected flags %#x.\n", iface.Flags); ret = SetupDiGetDeviceInterfaceDetailA(set, &iface, detail, sizeof(buffer), NULL, NULL); ok_(__FILE__, line)(ret, "Failed to get interface detail, error %#x.\n", GetLastError()); @@ -656,7 +655,6 @@ static void test_device_iface(void) ret = SetupDiEnumDeviceInterfaces(set, &device, &guid2, 0, &iface); ok(ret, "Failed to enumerate interfaces, error %#x.\n", GetLastError()); ret = SetupDiRemoveDeviceInterface(set, &iface); -todo_wine ok(ret, "Failed to remove interface, error %#x.\n", GetLastError()); check_device_iface(set, &device, &guid2, 0, SPINT_REMOVED, "\\\\?\\ROOT#LEGACY_BOGUS#0000#{6A55B5A5-3F65-11DB-B704-0011955C2BDB}");
1
0
0
0
Jacek Caban : jscript: Add interpreter support for getters and setters in object initializer.
by Alexandre Julliard
03 Dec '18
03 Dec '18
Module: wine Branch: master Commit: 0cc68cf82a0414b019a750999c7ca859ad4cea30 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0cc68cf82a0414b019a75099…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Nov 30 22:44:40 2018 +0100 jscript: Add interpreter support for getters and setters in object initializer. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/compile.c | 9 +++---- dlls/jscript/engine.c | 24 ++++++++++++++++- dlls/jscript/engine.h | 2 +- dlls/mshtml/tests/es5.js | 69 +++++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 95 insertions(+), 9 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index a498abd..006386a 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -889,7 +889,6 @@ static HRESULT compile_array_literal(compiler_ctx_t *ctx, array_literal_expressi static HRESULT compile_object_literal(compiler_ctx_t *ctx, property_value_expression_t *expr) { property_definition_t *iter; - unsigned instr; BSTR name; HRESULT hres; @@ -905,11 +904,9 @@ static HRESULT compile_object_literal(compiler_ctx_t *ctx, property_value_expres if(FAILED(hres)) return hres; - instr = push_instr(ctx, OP_obj_prop); - if(!instr) - return E_OUTOFMEMORY; - - instr_ptr(ctx, instr)->u.arg->bstr = name; + hres = push_instr_bstr_uint(ctx, OP_obj_prop, name, iter->type); + if(FAILED(hres)) + return hres; } return S_OK; diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index bd4edda..0f9e3a5 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -1445,6 +1445,7 @@ static HRESULT interp_new_obj(script_ctx_t *ctx) static HRESULT interp_obj_prop(script_ctx_t *ctx) { const BSTR name = get_op_bstr(ctx, 0); + unsigned type = get_op_uint(ctx, 1); jsdisp_t *obj; jsval_t val; HRESULT hres; @@ -1456,7 +1457,28 @@ static HRESULT interp_obj_prop(script_ctx_t *ctx) assert(is_object_instance(stack_top(ctx))); obj = as_jsdisp(get_object(stack_top(ctx))); - hres = jsdisp_propput_name(obj, name, val); + if(type == PROPERTY_DEFINITION_VALUE) { + hres = jsdisp_propput_name(obj, name, val); + }else { + property_desc_t desc = {PROPF_ENUMERABLE | PROPF_CONFIGURABLE}; + jsdisp_t *func; + + assert(is_object_instance(val)); + func = iface_to_jsdisp(get_object(val)); + + desc.mask = desc.flags; + if(type == PROPERTY_DEFINITION_GETTER) { + desc.explicit_getter = TRUE; + desc.getter = func; + }else { + desc.explicit_setter = TRUE; + desc.setter = func; + } + + hres = jsdisp_define_property(obj, name, &desc); + jsdisp_release(func); + } + jsval_release(val); return hres; } diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index d0c419a..eb287d5 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -66,7 +66,7 @@ X(new, 1, ARG_UINT, 0) \ X(new_obj, 1, 0,0) \ X(null, 1, 0,0) \ - X(obj_prop, 1, ARG_BSTR, 0) \ + X(obj_prop, 1, ARG_BSTR, ARG_UINT) \ X(or, 1, 0,0) \ X(pop, 1, ARG_UINT, 0) \ X(pop_except, 0, ARG_ADDR, 0) \ diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index 6097f4c..3e81961 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -149,7 +149,7 @@ function test_identifier_keywords() { } function test_own_data_prop_desc(obj, prop, expected_writable, expected_enumerable, - expected_configurable) { + expected_configurable) { var desc = Object.getOwnPropertyDescriptor(obj, prop); ok("value" in desc, "value is not in desc"); ok(desc.value === obj[prop], "desc.value = " + desc.value + " expected " + obj[prop]); @@ -427,6 +427,72 @@ function test_defineProperty() { next_test(); } +function test_property_definitions() { + var obj, val, i, arr; + + function test_accessor_prop_desc(obj, prop, have_getter, have_setter) { + var desc = Object.getOwnPropertyDescriptor(obj, prop); + ok(desc.enumerable === true, "desc.enumerable = " + desc.enumerable); + ok(desc.configurable === true, "desc.configurable = " + desc.configurable); + + if(have_getter) { + ok(typeof(desc.get) === "function", "desc.get = " + desc.get); + ok(typeof(desc.get.prototype) === "object", "desc.get.prototype = " + desc.get.prototype); + trace("" + desc.get); + }else { + ok(!("get" in obj), "desc.get = " + desc.get); + } + + if(have_setter) { + ok(typeof(desc.set) === "function", "desc.set = " + desc.set); + ok(typeof(desc.set.prototype) === "object", "desc.set.prototype = " + desc.set.prototype); + }else { + ok(!("set" in obj), "desc.get = " + desc.get); + } + } + + obj = { + get prop() { return val + 1; }, + set prop(v) { val = v; } + }; + test_accessor_prop_desc(obj, "prop", true, true); + val = 0; + ok(obj.prop === 1, "obj.prop = " + obj.prop); + obj.prop = 3; + ok(val === 3, "val = " + val); + ok(obj.prop === 4, "obj.prop = " + obj.prop); + + arr = []; + for(i in obj) + arr.push(i); + ok(arr.join() === "prop", "prop of obj = " + arr.join()); + + obj = { + set prop(v) { val = v; } + }; + test_accessor_prop_desc(obj, "prop", false, true); + val = 1; + ok(obj.prop === undefined, "obj.prop = " + obj.prop); + obj.prop = 2; + ok(val === 2, "val = " + val); + ok(obj.prop === undefined, "obj.prop = " + obj.prop); + + obj = { + get prop() { return val + 1; }, + get 0() { return val + 2; } + }; + test_accessor_prop_desc(obj, "prop", true, false); + val = 5; + ok(obj.prop === 6, "obj.prop = " + obj.prop); + obj.prop = 10; + ok(val === 5, "val = " + val); + ok(obj.prop === 6, "obj.prop = " + obj.prop); + test_accessor_prop_desc(obj, "0", true, false); + ok(obj[0] === 7, "obj.prop = " + obj[0]); + + next_test(); +} + function test_string_trim() { function test_trim(value, expected) { var r = String.prototype.trim.call(value); @@ -513,6 +579,7 @@ var tests = [ test_identifier_keywords, test_getOwnPropertyDescriptor, test_defineProperty, + test_property_definitions, test_string_trim, test_global_properties, test_string_split
1
0
0
0
Jacek Caban : jscript: Add parser support for getters and setters in object initializer.
by Alexandre Julliard
03 Dec '18
03 Dec '18
Module: wine Branch: master Commit: 56be97fd5d5fc0a9a5b78005383f6e8770c7fec8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=56be97fd5d5fc0a9a5b78005…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Nov 30 22:44:32 2018 +0100 jscript: Add parser support for getters and setters in object initializer. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/engine.h | 6 ++++++ dlls/jscript/lex.c | 17 ++++++++++++++--- dlls/jscript/parser.h | 1 + dlls/jscript/parser.y | 29 +++++++++++++++++++++-------- dlls/jscript/tests/lang.js | 2 ++ 5 files changed, 44 insertions(+), 11 deletions(-) diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index d3fd3d77..d0c419a 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -129,6 +129,12 @@ typedef struct { } u; } instr_t; +typedef enum { + PROPERTY_DEFINITION_VALUE, + PROPERTY_DEFINITION_GETTER, + PROPERTY_DEFINITION_SETTER +} property_definition_type_t; + typedef struct { BSTR name; int ref; diff --git a/dlls/jscript/lex.c b/dlls/jscript/lex.c index 7ef2112..be20e99 100644 --- a/dlls/jscript/lex.c +++ b/dlls/jscript/lex.c @@ -46,12 +46,14 @@ static const WCHAR falseW[] = {'f','a','l','s','e',0}; static const WCHAR finallyW[] = {'f','i','n','a','l','l','y',0}; static const WCHAR forW[] = {'f','o','r',0}; static const WCHAR functionW[] = {'f','u','n','c','t','i','o','n',0}; +static const WCHAR getW[] = {'g','e','t',0}; static const WCHAR ifW[] = {'i','f',0}; static const WCHAR inW[] = {'i','n',0}; static const WCHAR instanceofW[] = {'i','n','s','t','a','n','c','e','o','f',0}; static const WCHAR newW[] = {'n','e','w',0}; static const WCHAR nullW[] = {'n','u','l','l',0}; static const WCHAR returnW[] = {'r','e','t','u','r','n',0}; +static const WCHAR setW[] = {'s','e','t',0}; static const WCHAR switchW[] = {'s','w','i','t','c','h',0}; static const WCHAR thisW[] = {'t','h','i','s',0}; static const WCHAR throwW[] = {'t','h','r','o','w',0}; @@ -70,11 +72,12 @@ static const struct { const WCHAR *word; int token; BOOL no_nl; + unsigned min_version; } keywords[] = { - {breakW, kBREAK, TRUE}, + {breakW, kBREAK, TRUE}, {caseW, kCASE}, {catchW, kCATCH}, - {continueW, kCONTINUE, TRUE}, + {continueW, kCONTINUE, TRUE}, {defaultW, kDEFAULT}, {deleteW, kDELETE}, {doW, kDO}, @@ -83,12 +86,14 @@ static const struct { {finallyW, kFINALLY}, {forW, kFOR}, {functionW, kFUNCTION}, + {getW, kGET, FALSE, SCRIPTLANGUAGEVERSION_ES5}, {ifW, kIF}, {inW, kIN}, {instanceofW, kINSTANCEOF}, {newW, kNEW}, {nullW, kNULL}, - {returnW, kRETURN, TRUE}, + {returnW, kRETURN, TRUE}, + {setW, kSET, FALSE, SCRIPTLANGUAGEVERSION_ES5}, {switchW, kSWITCH}, {thisW, kTHIS}, {throwW, kTHROW}, @@ -169,6 +174,12 @@ static int check_keywords(parser_ctx_t *ctx, const WCHAR **lval) r = check_keyword(ctx, keywords[i].word, lval); if(!r) { + if(ctx->script->version < keywords[i].min_version) { + TRACE("ignoring keyword %s in incompatible mode\n", + debugstr_w(keywords[i].word)); + ctx->ptr -= strlenW(keywords[i].word); + return 0; + } ctx->implicit_nl_semicolon = keywords[i].no_nl; return keywords[i].token; } diff --git a/dlls/jscript/parser.h b/dlls/jscript/parser.h index 908d6b6..03f504f 100644 --- a/dlls/jscript/parser.h +++ b/dlls/jscript/parser.h @@ -359,6 +359,7 @@ typedef struct { } array_literal_expression_t; typedef struct _property_definition_t { + unsigned type; literal_t *name; expression_t *value; diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index 47ac1bc..157bc18 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -45,8 +45,8 @@ typedef struct _property_list_t { property_definition_t *tail; } property_list_t; -static property_definition_t *new_property_definition(parser_ctx_t *ctx, literal_t *name, - expression_t *value); +static property_definition_t *new_property_definition(parser_ctx_t *ctx, property_definition_type_t, + literal_t *name, expression_t *value); static property_list_t *new_property_list(parser_ctx_t*,property_definition_t*); static property_list_t *property_list_add(parser_ctx_t*,property_list_t*,property_definition_t*); @@ -167,7 +167,7 @@ static source_elements_t *source_elements_add_statement(source_elements_t*,state } /* keywords */ -%token <identifier> kBREAK kCASE kCATCH kCONTINUE kDEFAULT kDELETE kDO kELSE kFUNCTION kIF kFINALLY kFOR kIN +%token <identifier> kBREAK kCASE kCATCH kCONTINUE kDEFAULT kDELETE kDO kELSE kFUNCTION kIF kFINALLY kFOR kGET kIN kSET %token <identifier> kINSTANCEOF kNEW kNULL kRETURN kSWITCH kTHIS kTHROW kTRUE kFALSE kTRY kTYPEOF kVAR kVOID kWHILE kWITH %token tANDAND tOROR tINC tDEC tHTMLCOMMENT kDIVEQ kDCOL @@ -224,6 +224,7 @@ static source_elements_t *source_elements_add_statement(source_elements_t*,state %type <expr> CallExpression %type <expr> MemberExpression %type <expr> PrimaryExpression +%type <expr> GetterSetterMethod %type <identifier> Identifier_opt %type <variable_list> VariableDeclarationList %type <variable_list> VariableDeclarationListNoIn @@ -243,7 +244,7 @@ static source_elements_t *source_elements_add_statement(source_elements_t*,state %type <property_definition> PropertyDefinition %type <literal> PropertyName %type <literal> BooleanLiteral -%type <srcptr> KFunction +%type <srcptr> KFunction left_bracket %type <ival> AssignOper %type <identifier> IdentifierName ReservedAsIdentifier @@ -800,9 +801,17 @@ PropertyNameAndValueList /* ECMA-262 5.1 Edition 12.2.6 */ PropertyDefinition : PropertyName ':' AssignmentExpression - { $$ = new_property_definition(ctx, $1, $3); } + { $$ = new_property_definition(ctx, PROPERTY_DEFINITION_VALUE, $1, $3); } + | kGET PropertyName GetterSetterMethod + { $$ = new_property_definition(ctx, PROPERTY_DEFINITION_GETTER, $2, $3); } + | kSET PropertyName GetterSetterMethod + { $$ = new_property_definition(ctx, PROPERTY_DEFINITION_SETTER, $2, $3); } -/* ECMA-262 3rd Edition 11.1.5 */ +GetterSetterMethod + : left_bracket FormalParameterList_opt right_bracket '{' FunctionBody '}' + { $$ = new_function_expression(ctx, NULL, $2, $5, NULL, $1, $6-$1); } + +/* Ecma-262 3rd Edition 11.1.5 */ PropertyName : IdentifierName { $$ = new_string_literal(ctx, $1); } | tStringLiteral { $$ = new_string_literal(ctx, $1); } @@ -839,12 +848,14 @@ ReservedAsIdentifier | kFINALLY { $$ = $1; } | kFOR { $$ = $1; } | kFUNCTION { $$ = $1; } + | kGET { $$ = $1; } | kIF { $$ = $1; } | kIN { $$ = $1; } | kINSTANCEOF { $$ = $1; } | kNEW { $$ = $1; } | kNULL { $$ = $1; } | kRETURN { $$ = $1; } + | kSET { $$ = $1; } | kSWITCH { $$ = $1; } | kTHIS { $$ = $1; } | kTHROW { $$ = $1; } @@ -878,7 +889,7 @@ semicolon_opt | error { if(!allow_auto_semicolon(ctx)) {YYABORT;} } left_bracket - : '(' + : '(' { $$ = ctx->ptr; } | error { set_error(ctx, JS_E_MISSING_LBRACKET); YYABORT; } right_bracket @@ -929,10 +940,12 @@ static literal_t *new_null_literal(parser_ctx_t *ctx) return ret; } -static property_definition_t *new_property_definition(parser_ctx_t *ctx, literal_t *name, expression_t *value) +static property_definition_t *new_property_definition(parser_ctx_t *ctx, property_definition_type_t type, + literal_t *name, expression_t *value) { property_definition_t *ret = parser_alloc(ctx, sizeof(property_definition_t)); + ret->type = type; ret->name = name; ret->value = value; ret->next = NULL; diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js index 1cd5668..2a30ea3 100644 --- a/dlls/jscript/tests/lang.js +++ b/dlls/jscript/tests/lang.js @@ -1832,6 +1832,8 @@ ok(tmp, "tmp = " + tmp); ok(x === undefined, "x = " + x); })(); +var get, set; + /* NoNewline rule parser tests */ while(true) { if(true) break
1
0
0
0
Jacek Caban : jscript: Use separated parser rule for property definition.
by Alexandre Julliard
03 Dec '18
03 Dec '18
Module: wine Branch: master Commit: fd4c34759f9cb045fd85768e22815017151e4eba URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fd4c34759f9cb045fd85768e…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Nov 30 22:44:14 2018 +0100 jscript: Use separated parser rule for property definition. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/parser.y | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index 5979ef0..47ac1bc 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -45,8 +45,10 @@ typedef struct _property_list_t { property_definition_t *tail; } property_list_t; -static property_list_t *new_property_list(parser_ctx_t*,literal_t*,expression_t*); -static property_list_t *property_list_add(parser_ctx_t*,property_list_t*,literal_t*,expression_t*); +static property_definition_t *new_property_definition(parser_ctx_t *ctx, literal_t *name, + expression_t *value); +static property_list_t *new_property_list(parser_ctx_t*,property_definition_t*); +static property_list_t *property_list_add(parser_ctx_t*,property_list_t*,property_definition_t*); typedef struct _element_list_t { array_element_t *head; @@ -156,6 +158,7 @@ static source_elements_t *source_elements_add_statement(source_elements_t*,state const WCHAR *identifier; struct _parameter_list_t *parameter_list; struct _property_list_t *property_list; + property_definition_t *property_definition; source_elements_t *source_elements; statement_t *statement; struct _statement_list_t *statement_list; @@ -237,6 +240,7 @@ static source_elements_t *source_elements_add_statement(source_elements_t*,state %type <ival> Elision Elision_opt %type <element_list> ElementList %type <property_list> PropertyNameAndValueList +%type <property_definition> PropertyDefinition %type <literal> PropertyName %type <literal> BooleanLiteral %type <srcptr> KFunction @@ -789,10 +793,14 @@ ObjectLiteral /* ECMA-262 3rd Edition 11.1.5 */ PropertyNameAndValueList + : PropertyDefinition { $$ = new_property_list(ctx, $1); } + | PropertyNameAndValueList ',' PropertyDefinition + { $$ = property_list_add(ctx, $1, $3); } + +/* ECMA-262 5.1 Edition 12.2.6 */ +PropertyDefinition : PropertyName ':' AssignmentExpression - { $$ = new_property_list(ctx, $1, $3); } - | PropertyNameAndValueList ',' PropertyName ':' AssignmentExpression - { $$ = property_list_add(ctx, $1, $3, $5); } + { $$ = new_property_definition(ctx, $1, $3); } /* ECMA-262 3rd Edition 11.1.5 */ PropertyName @@ -932,19 +940,16 @@ static property_definition_t *new_property_definition(parser_ctx_t *ctx, literal return ret; } -static property_list_t *new_property_list(parser_ctx_t *ctx, literal_t *name, expression_t *value) +static property_list_t *new_property_list(parser_ctx_t *ctx, property_definition_t *prop) { property_list_t *ret = parser_alloc_tmp(ctx, sizeof(property_list_t)); - - ret->head = ret->tail = new_property_definition(ctx, name, value); - + ret->head = ret->tail = prop; return ret; } -static property_list_t *property_list_add(parser_ctx_t *ctx, property_list_t *list, literal_t *name, expression_t *value) +static property_list_t *property_list_add(parser_ctx_t *ctx, property_list_t *list, property_definition_t *prop) { - list->tail = list->tail->next = new_property_definition(ctx, name, value); - + list->tail = list->tail->next = prop; return list; }
1
0
0
0
Jacek Caban : jscript: Rename prop_val_t to property_definition_t.
by Alexandre Julliard
03 Dec '18
03 Dec '18
Module: wine Branch: master Commit: 9193b9f52c5c77951ac6dff581a22f2152570260 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9193b9f52c5c77951ac6dff5…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Nov 30 22:44:07 2018 +0100 jscript: Rename prop_val_t to property_definition_t. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/compile.c | 4 ++-- dlls/jscript/parser.h | 8 ++++---- dlls/jscript/parser.y | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 3f9db7a..a498abd 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -888,7 +888,7 @@ static HRESULT compile_array_literal(compiler_ctx_t *ctx, array_literal_expressi static HRESULT compile_object_literal(compiler_ctx_t *ctx, property_value_expression_t *expr) { - prop_val_t *iter; + property_definition_t *iter; unsigned instr; BSTR name; HRESULT hres; @@ -1999,7 +1999,7 @@ static HRESULT visit_expression(compiler_ctx_t *ctx, expression_t *expr) hres = visit_expression(ctx, ((member_expression_t*)expr)->expression); break; case EXPR_PROPVAL: { - prop_val_t *iter; + property_definition_t *iter; for(iter = ((property_value_expression_t*)expr)->property_list; iter; iter = iter->next) { hres = visit_expression(ctx, iter->value); if(FAILED(hres)) diff --git a/dlls/jscript/parser.h b/dlls/jscript/parser.h index 65297b9..908d6b6 100644 --- a/dlls/jscript/parser.h +++ b/dlls/jscript/parser.h @@ -358,16 +358,16 @@ typedef struct { int length; } array_literal_expression_t; -typedef struct _prop_val_t { +typedef struct _property_definition_t { literal_t *name; expression_t *value; - struct _prop_val_t *next; -} prop_val_t; + struct _property_definition_t *next; +} property_definition_t; typedef struct { expression_t expr; - prop_val_t *property_list; + property_definition_t *property_list; } property_value_expression_t; BOOL try_parse_ccval(parser_ctx_t*,ccval_t*) DECLSPEC_HIDDEN; diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index 0bb8856..5979ef0 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -41,8 +41,8 @@ static literal_t *new_string_literal(parser_ctx_t*,const WCHAR*); static literal_t *new_null_literal(parser_ctx_t*); typedef struct _property_list_t { - prop_val_t *head; - prop_val_t *tail; + property_definition_t *head; + property_definition_t *tail; } property_list_t; static property_list_t *new_property_list(parser_ctx_t*,literal_t*,expression_t*); @@ -921,9 +921,9 @@ static literal_t *new_null_literal(parser_ctx_t *ctx) return ret; } -static prop_val_t *new_prop_val(parser_ctx_t *ctx, literal_t *name, expression_t *value) +static property_definition_t *new_property_definition(parser_ctx_t *ctx, literal_t *name, expression_t *value) { - prop_val_t *ret = parser_alloc(ctx, sizeof(prop_val_t)); + property_definition_t *ret = parser_alloc(ctx, sizeof(property_definition_t)); ret->name = name; ret->value = value; @@ -936,14 +936,14 @@ static property_list_t *new_property_list(parser_ctx_t *ctx, literal_t *name, ex { property_list_t *ret = parser_alloc_tmp(ctx, sizeof(property_list_t)); - ret->head = ret->tail = new_prop_val(ctx, name, value); + ret->head = ret->tail = new_property_definition(ctx, name, value); return ret; } static property_list_t *property_list_add(parser_ctx_t *ctx, property_list_t *list, literal_t *name, expression_t *value) { - list->tail = list->tail->next = new_prop_val(ctx, name, value); + list->tail = list->tail->next = new_property_definition(ctx, name, value); return list; }
1
0
0
0
Serge Gautherie : rpcrt4: Fix 'Routeines' typos.
by Alexandre Julliard
03 Dec '18
03 Dec '18
Module: wine Branch: master Commit: c73352047d20a503c67bdd583f6ef8d98711a678 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c73352047d20a503c67bdd58…
Author: Serge Gautherie <winehq-git_serge_180711(a)gautherie.fr> Date: Sat Dec 1 03:17:59 2018 +0100 rpcrt4: Fix 'Routeines' typos. Signed-off-by: Serge Gautherie <winehq-git_serge_180711(a)gautherie.fr> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/rpcrt4/rpcrt4.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/rpcrt4/rpcrt4.spec b/dlls/rpcrt4/rpcrt4.spec index 0dc6789..79c9645 100644 --- a/dlls/rpcrt4/rpcrt4.spec +++ b/dlls/rpcrt4/rpcrt4.spec @@ -519,9 +519,9 @@ @ stub long_from_ndr @ stub long_from_ndr_temp @ stub pfnFreeRoutines # wxp -@ stub pfnMarshallRouteines # wxp +@ stub pfnMarshallRoutines # wxp @ stub pfnSizeRoutines # wxp -@ stub pfnUnmarshallRouteines # wxp +@ stub pfnUnmarshallRoutines # wxp @ stub short_array_from_ndr @ stub short_from_ndr @ stub short_from_ndr_temp
1
0
0
0
Alex Henrie : riched20: Turn several constants and variables into static constants.
by Alexandre Julliard
03 Dec '18
03 Dec '18
Module: wine Branch: master Commit: 55a3dfe35e2c550edd334ec4be5b27de0bd3b191 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=55a3dfe35e2c550edd334ec4…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Fri Nov 30 00:14:17 2018 -0700 riched20: Turn several constants and variables into static constants. Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/riched20/editor.c | 4 ++-- dlls/riched20/paint.c | 4 ++-- dlls/riched20/para.c | 2 +- dlls/riched20/run.c | 2 +- dlls/riched20/table.c | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 052400c..99c87bf 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2520,11 +2520,11 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey) if (editor->styleFlags & ES_MULTILINE) { + static const WCHAR endl = '\r'; + static const WCHAR endlv10[] = {'\r','\n'}; ME_Cursor cursor = editor->pCursors[0]; ME_DisplayItem *para = cursor.pPara; int from, to; - const WCHAR endl = '\r'; - const WCHAR endlv10[] = {'\r','\n'}; ME_Style *style, *eop_style; if (editor->styleFlags & ES_READONLY) { diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c index 44cf3cb..e2ccef4 100644 --- a/dlls/riched20/paint.c +++ b/dlls/riched20/paint.c @@ -989,7 +989,7 @@ static void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph) } if (me_debug) { - const WCHAR wszRowDebug[] = {'r','o','w','[','%','d',']',0}; + static const WCHAR wszRowDebug[] = {'r','o','w','[','%','d',']',0}; WCHAR buf[128]; POINT pt = c->pt; wsprintfW(buf, wszRowDebug, no); @@ -1017,7 +1017,7 @@ static void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph) c->pt.y + para->pt.y + run->pt.y + baseline, p, para); if (me_debug) { - const WCHAR wszRunDebug[] = {'[','%','d',':','%','x',']',' ','%','l','s',0}; + static const WCHAR wszRunDebug[] = {'[','%','d',':','%','x',']',' ','%','l','s',0}; WCHAR buf[2560]; POINT pt; pt.x = c->pt.x + run->pt.x; diff --git a/dlls/riched20/para.c b/dlls/riched20/para.c index c4ddb65..7781ff2 100644 --- a/dlls/riched20/para.c +++ b/dlls/riched20/para.c @@ -152,6 +152,7 @@ void add_marked_para(ME_TextEditor *editor, ME_DisplayItem *di) void ME_MakeFirstParagraph(ME_TextEditor *editor) { + static const WCHAR cr_lf[] = {'\r','\n',0}; ME_Context c; CHARFORMAT2W cf; const CHARFORMATW *host_cf; @@ -162,7 +163,6 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor) ME_DisplayItem *run; ME_Style *style; int eol_len; - WCHAR cr_lf[] = {'\r','\n',0}; ME_InitContext(&c, editor, ITextHost_TxGetDC(editor->texthost)); diff --git a/dlls/riched20/run.c b/dlls/riched20/run.c index 2cdd3d8..66c24f8 100644 --- a/dlls/riched20/run.c +++ b/dlls/riched20/run.c @@ -612,8 +612,8 @@ int ME_PointFromChar(ME_TextEditor *editor, ME_Run *pRun, int nOffset, BOOL visu SIZE ME_GetRunSizeCommon(ME_Context *c, const ME_Paragraph *para, ME_Run *run, int nLen, int startx, int *pAscent, int *pDescent) { + static const WCHAR spaceW[] = {' ',0}; SIZE size; - WCHAR spaceW[] = {' ',0}; nLen = min( nLen, run->len ); diff --git a/dlls/riched20/table.c b/dlls/riched20/table.c index 4cd77eb..7e8d7ff 100644 --- a/dlls/riched20/table.c +++ b/dlls/riched20/table.c @@ -56,6 +56,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(richedit_lists); +static const WCHAR cr_lf[] = {'\r', '\n', 0}; + static ME_DisplayItem* ME_InsertEndParaFromCursor(ME_TextEditor *editor, int nCursor, const WCHAR *eol_str, int eol_len, @@ -77,7 +79,6 @@ static ME_DisplayItem* ME_InsertEndParaFromCursor(ME_TextEditor *editor, ME_DisplayItem* ME_InsertTableRowStartFromCursor(ME_TextEditor *editor) { ME_DisplayItem *para; - WCHAR cr_lf[] = {'\r', '\n', 0}; para = ME_InsertEndParaFromCursor(editor, 0, cr_lf, 2, MEPF_ROWSTART); return para->member.para.prev_para; } @@ -128,7 +129,6 @@ ME_DisplayItem* ME_InsertTableCellFromCursor(ME_TextEditor *editor) ME_DisplayItem* ME_InsertTableRowEndFromCursor(ME_TextEditor *editor) { ME_DisplayItem *para; - WCHAR cr_lf[] = {'\r', '\n', 0}; para = ME_InsertEndParaFromCursor(editor, 0, cr_lf, 2, MEPF_ROWEND); return para->member.para.prev_para; }
1
0
0
0
← Newer
1
...
31
32
33
34
35
36
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Results per page:
10
25
50
100
200