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
November 2017
----- 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
2 participants
436 discussions
Start a n
N
ew thread
Hans Leidekker : advapi32: Fix EnumServicesStatusEx on Wow64.
by Alexandre Julliard
08 Nov '17
08 Nov '17
Module: wine Branch: master Commit: 445996d31ba5818eb9fe4e41130349b6730284a1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=445996d31ba5818eb9fe4e411…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Nov 7 14:10:40 2017 +0100 advapi32: Fix EnumServicesStatusEx on Wow64. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/advapi32/service.c | 82 +++++++++++++++++++++++++++++++++++++++++-------- include/wine/svcctl.idl | 7 +++++ programs/services/rpc.c | 16 +++++----- 3 files changed, 84 insertions(+), 21 deletions(-) diff --git a/dlls/advapi32/service.c b/dlls/advapi32/service.c index 79d0693..78491ae 100644 --- a/dlls/advapi32/service.c +++ b/dlls/advapi32/service.c @@ -1893,9 +1893,11 @@ EnumServicesStatusExW( SC_HANDLE hmngr, SC_ENUM_TYPE level, DWORD type, DWORD st LPBYTE buffer, DWORD size, LPDWORD needed, LPDWORD returned, LPDWORD resume_handle, LPCWSTR group ) { - DWORD err, i; - ENUM_SERVICE_STATUS_PROCESSW dummy_status; + DWORD err, i, offset, buflen, count, total_size = 0; ENUM_SERVICE_STATUS_PROCESSW *services = (ENUM_SERVICE_STATUS_PROCESSW *)buffer; + struct enum_service_status_process *entry; + const WCHAR *str; + BYTE *buf; TRACE("%p %u 0x%x 0x%x %p %u %p %p %p %s\n", hmngr, level, type, state, buffer, size, needed, returned, resume_handle, debugstr_w(group)); @@ -1910,18 +1912,24 @@ EnumServicesStatusExW( SC_HANDLE hmngr, SC_ENUM_TYPE level, DWORD type, DWORD st SetLastError( ERROR_INVALID_HANDLE ); return FALSE; } + if (!needed || !returned) + { + SetLastError( ERROR_INVALID_ADDRESS ); + return FALSE; + } - /* make sure we pass a valid buffer pointer */ - if (!services || size < sizeof(*services)) + /* make sure we pass a valid pointer */ + buflen = max( size, sizeof(*services) ); + if (!(buf = heap_alloc( buflen ))) { - buffer = (BYTE *)&dummy_status; - size = sizeof(dummy_status); + SetLastError( ERROR_NOT_ENOUGH_MEMORY ); + return FALSE; } __TRY { - err = svcctl_EnumServicesStatusExW( hmngr, SC_ENUM_PROCESS_INFO, type, state, buffer, size, needed, - returned, resume_handle, group ); + err = svcctl_EnumServicesStatusExW( hmngr, SC_ENUM_PROCESS_INFO, type, state, buf, buflen, needed, + &count, resume_handle, group ); } __EXCEPT(rpc_filter) { @@ -1929,20 +1937,68 @@ EnumServicesStatusExW( SC_HANDLE hmngr, SC_ENUM_TYPE level, DWORD type, DWORD st } __ENDTRY + *returned = 0; if (err != ERROR_SUCCESS) { + /* double the needed size to fit the potentially larger ENUM_SERVICE_STATUS_PROCESSW */ + if (err == ERROR_MORE_DATA) *needed *= 2; + heap_free( buf ); SetLastError( err ); return FALSE; } - for (i = 0; i < *returned; i++) + entry = (struct enum_service_status_process *)buf; + for (i = 0; i < count; i++) { - /* convert buffer offsets into pointers */ - services[i].lpServiceName = (WCHAR *)((char *)services + (DWORD_PTR)services[i].lpServiceName); - if (services[i].lpDisplayName) - services[i].lpDisplayName = (WCHAR *)((char *)services + (DWORD_PTR)services[i].lpDisplayName); + total_size += sizeof(*services); + if (entry->service_name) + { + str = (const WCHAR *)(buf + entry->service_name); + total_size += (strlenW( str ) + 1) * sizeof(WCHAR); + } + if (entry->display_name) + { + str = (const WCHAR *)(buf + entry->display_name); + total_size += (strlenW( str ) + 1) * sizeof(WCHAR); + } + entry++; } + if (total_size > size) + { + heap_free( buf ); + *needed = total_size; + SetLastError( ERROR_MORE_DATA ); + return FALSE; + } + + offset = count * sizeof(*services); + entry = (struct enum_service_status_process *)buf; + for (i = 0; i < count; i++) + { + DWORD str_size; + str = (const WCHAR *)(buf + entry->service_name); + str_size = (strlenW( str ) + 1) * sizeof(WCHAR); + services[i].lpServiceName = (WCHAR *)((char *)services + offset); + memcpy( services[i].lpServiceName, str, str_size ); + offset += str_size; + + if (!entry->display_name) services[i].lpDisplayName = NULL; + else + { + str = (const WCHAR *)(buf + entry->display_name); + str_size = (strlenW( str ) + 1) * sizeof(WCHAR); + services[i].lpDisplayName = (WCHAR *)((char *)services + offset); + memcpy( services[i].lpDisplayName, str, str_size ); + offset += str_size; + } + services[i].ServiceStatusProcess = entry->service_status_process; + entry++; + } + + heap_free( buf ); + *needed = 0; + *returned = count; return TRUE; } diff --git a/include/wine/svcctl.idl b/include/wine/svcctl.idl index b7d1e92..7c5df7d 100644 --- a/include/wine/svcctl.idl +++ b/include/wine/svcctl.idl @@ -218,6 +218,13 @@ struct enum_service_status SERVICE_STATUS service_status; }; +struct enum_service_status_process +{ + DWORD service_name; + DWORD display_name; + SERVICE_STATUS_PROCESS service_status_process; +}; + typedef struct _SERVICE_RPC_REQUIRED_PRIVILEGES_INFO { DWORD cbRequiredPrivileges; [size_is(cbRequiredPrivileges)] BYTE *pRequiredPrivileges; diff --git a/programs/services/rpc.c b/programs/services/rpc.c index 7215504..a1d3c9e 100644 --- a/programs/services/rpc.c +++ b/programs/services/rpc.c @@ -1461,7 +1461,7 @@ DWORD __cdecl svcctl_EnumServicesStatusExW( DWORD_PTR offset; struct sc_manager_handle *manager; struct service_entry *service; - ENUM_SERVICE_STATUS_PROCESSW *s; + struct enum_service_status_process *s; WINE_TRACE("(%p, 0x%x, 0x%x, %p, %u, %p, %p, %s)\n", hmngr, type, state, buffer, size, needed, returned, wine_dbgstr_w(group)); @@ -1489,7 +1489,7 @@ DWORD __cdecl svcctl_EnumServicesStatusExW( if ((service->status.dwServiceType & type) && map_state(service->status.dwCurrentState, state) && match_group(service->config.lpLoadOrderGroup, group)) { - total_size += sizeof(ENUM_SERVICE_STATUS_PROCESSW); + total_size += sizeof(*s); total_size += (strlenW(service->name) + 1) * sizeof(WCHAR); if (service->config.lpDisplayName) { @@ -1505,8 +1505,8 @@ DWORD __cdecl svcctl_EnumServicesStatusExW( scmdatabase_unlock(manager->db); return ERROR_MORE_DATA; } - s = (ENUM_SERVICE_STATUS_PROCESSW *)buffer; - offset = num_services * sizeof(ENUM_SERVICE_STATUS_PROCESSW); + s = (struct enum_service_status_process *)buffer; + offset = num_services * sizeof(*s); LIST_FOR_EACH_ENTRY(service, &manager->db->services, struct service_entry, entry) { if ((service->status.dwServiceType & type) && map_state(service->status.dwCurrentState, state) @@ -1514,18 +1514,18 @@ DWORD __cdecl svcctl_EnumServicesStatusExW( { sz = (strlenW(service->name) + 1) * sizeof(WCHAR); memcpy(buffer + offset, service->name, sz); - s->lpServiceName = (WCHAR *)offset; /* store a buffer offset instead of a pointer */ + s->service_name = offset; offset += sz; - if (!service->config.lpDisplayName) s->lpDisplayName = NULL; + if (!service->config.lpDisplayName) s->display_name = 0; else { sz = (strlenW(service->config.lpDisplayName) + 1) * sizeof(WCHAR); memcpy(buffer + offset, service->config.lpDisplayName, sz); - s->lpDisplayName = (WCHAR *)offset; + s->display_name = offset; offset += sz; } - fill_status_process(&s->ServiceStatusProcess, service); + fill_status_process(&s->service_status_process, service); s++; } }
1
0
0
0
Hans Leidekker : advapi32: Fix EnumServicesStatus on Wow64.
by Alexandre Julliard
08 Nov '17
08 Nov '17
Module: wine Branch: master Commit: ac0744d4505a583de2cbdc6082f2726393c797df URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ac0744d4505a583de2cbdc608…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Nov 7 14:10:39 2017 +0100 advapi32: Fix EnumServicesStatus on Wow64. The structures returned by this function contain pointers, which breaks on Wow64 if the client is 32-bit (the service manager always runs in a 64-bit process). This patch introduces a variant of ENUM_SERVICE_STATUS with offsets instead of pointers and converts the structures on the client side. The downside is that we need to buffer the data, but in return we can get rid of the dummy buffer pointer. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/advapi32/service.c | 89 +++++++++++++++++++++++++++++++++++++++++++------ include/wine/svcctl.idl | 8 +++++ programs/services/rpc.c | 19 +++++------ 3 files changed, 95 insertions(+), 21 deletions(-) diff --git a/dlls/advapi32/service.c b/dlls/advapi32/service.c index fa6ebfe..79d0693 100644 --- a/dlls/advapi32/service.c +++ b/dlls/advapi32/service.c @@ -1654,6 +1654,17 @@ EnumServicesStatusA( SC_HANDLE hmngr, DWORD type, DWORD state, LPENUM_SERVICE_ST TRACE("%p 0x%x 0x%x %p %u %p %p %p\n", hmngr, type, state, services, size, needed, returned, resume_handle); + if (!hmngr) + { + SetLastError( ERROR_INVALID_HANDLE ); + return FALSE; + } + if (!needed || !returned) + { + SetLastError( ERROR_INVALID_ADDRESS ); + return FALSE; + } + sz = max( 2 * size, sizeof(*servicesW) ); if (!(servicesW = heap_alloc( sz ))) { @@ -1701,8 +1712,10 @@ EnumServicesStatusW( SC_HANDLE hmngr, DWORD type, DWORD state, LPENUM_SERVICE_ST services, DWORD size, LPDWORD needed, LPDWORD returned, LPDWORD resume_handle ) { - DWORD err, i; - ENUM_SERVICE_STATUSW dummy_status; + DWORD err, i, offset, buflen, count, total_size = 0; + struct enum_service_status *entry; + const WCHAR *str; + BYTE *buf; TRACE("%p 0x%x 0x%x %p %u %p %p %p\n", hmngr, type, state, services, size, needed, returned, resume_handle); @@ -1712,17 +1725,23 @@ EnumServicesStatusW( SC_HANDLE hmngr, DWORD type, DWORD state, LPENUM_SERVICE_ST SetLastError( ERROR_INVALID_HANDLE ); return FALSE; } + if (!needed || !returned) + { + SetLastError( ERROR_INVALID_ADDRESS ); + return FALSE; + } /* make sure we pass a valid pointer */ - if (!services || size < sizeof(*services)) + buflen = max( size, sizeof(*services) ); + if (!(buf = heap_alloc( buflen ))) { - services = &dummy_status; - size = sizeof(dummy_status); + SetLastError( ERROR_NOT_ENOUGH_MEMORY ); + return FALSE; } __TRY { - err = svcctl_EnumServicesStatusW( hmngr, type, state, (BYTE *)services, size, needed, returned, resume_handle ); + err = svcctl_EnumServicesStatusW( hmngr, type, state, buf, buflen, needed, &count, resume_handle ); } __EXCEPT(rpc_filter) { @@ -1730,20 +1749,68 @@ EnumServicesStatusW( SC_HANDLE hmngr, DWORD type, DWORD state, LPENUM_SERVICE_ST } __ENDTRY + *returned = 0; if (err != ERROR_SUCCESS) { + /* double the needed size to fit the potentially larger ENUM_SERVICE_STATUSW */ + if (err == ERROR_MORE_DATA) *needed *= 2; + heap_free( buf ); SetLastError( err ); return FALSE; } - for (i = 0; i < *returned; i++) + entry = (struct enum_service_status *)buf; + for (i = 0; i < count; i++) { - /* convert buffer offsets into pointers */ - services[i].lpServiceName = (WCHAR *)((char *)services + (DWORD_PTR)services[i].lpServiceName); - if (services[i].lpDisplayName) - services[i].lpDisplayName = (WCHAR *)((char *)services + (DWORD_PTR)services[i].lpDisplayName); + total_size += sizeof(*services); + if (entry->service_name) + { + str = (const WCHAR *)(buf + entry->service_name); + total_size += (strlenW( str ) + 1) * sizeof(WCHAR); + } + if (entry->display_name) + { + str = (const WCHAR *)(buf + entry->display_name); + total_size += (strlenW( str ) + 1) * sizeof(WCHAR); + } + entry++; + } + + if (total_size > size) + { + heap_free( buf ); + *needed = total_size; + SetLastError( ERROR_MORE_DATA ); + return FALSE; + } + + offset = count * sizeof(*services); + entry = (struct enum_service_status *)buf; + for (i = 0; i < count; i++) + { + DWORD str_size; + str = (const WCHAR *)(buf + entry->service_name); + str_size = (strlenW( str ) + 1) * sizeof(WCHAR); + services[i].lpServiceName = (WCHAR *)((char *)services + offset); + memcpy( services[i].lpServiceName, str, str_size ); + offset += str_size; + + if (!entry->display_name) services[i].lpDisplayName = NULL; + else + { + str = (const WCHAR *)(buf + entry->display_name); + str_size = (strlenW( str ) + 1) * sizeof(WCHAR); + services[i].lpDisplayName = (WCHAR *)((char *)services + offset); + memcpy( services[i].lpDisplayName, str, str_size ); + offset += str_size; + } + services[i].ServiceStatus = entry->service_status; + entry++; } + heap_free( buf ); + *needed = 0; + *returned = count; return TRUE; } diff --git a/include/wine/svcctl.idl b/include/wine/svcctl.idl index 9fd5ca4..b7d1e92 100644 --- a/include/wine/svcctl.idl +++ b/include/wine/svcctl.idl @@ -210,6 +210,14 @@ typedef enum _SC_ENUM_TYPE { cpp_quote("#endif") +/* internal version of ENUM_SERVICE_STATUSA/W that doesn't depend on pointer size */ +struct enum_service_status +{ + DWORD service_name; + DWORD display_name; + SERVICE_STATUS service_status; +}; + typedef struct _SERVICE_RPC_REQUIRED_PRIVILEGES_INFO { DWORD cbRequiredPrivileges; [size_is(cbRequiredPrivileges)] BYTE *pRequiredPrivileges; diff --git a/programs/services/rpc.c b/programs/services/rpc.c index 4435af9..7215504 100644 --- a/programs/services/rpc.c +++ b/programs/services/rpc.c @@ -1342,11 +1342,10 @@ DWORD __cdecl svcctl_EnumServicesStatusW( LPDWORD returned, LPDWORD resume) { - DWORD err, sz, total_size, num_services; - DWORD_PTR offset; + DWORD err, sz, total_size, num_services, offset; struct sc_manager_handle *manager; struct service_entry *service; - ENUM_SERVICE_STATUSW *s; + struct enum_service_status *s; WINE_TRACE("(%p, 0x%x, 0x%x, %p, %u, %p, %p, %p)\n", hmngr, type, state, buffer, size, needed, returned, resume); @@ -1366,7 +1365,7 @@ DWORD __cdecl svcctl_EnumServicesStatusW( { if ((service->status.dwServiceType & type) && map_state(service->status.dwCurrentState, state)) { - total_size += sizeof(ENUM_SERVICE_STATUSW); + total_size += sizeof(*s); total_size += (strlenW(service->name) + 1) * sizeof(WCHAR); if (service->config.lpDisplayName) { @@ -1382,26 +1381,26 @@ DWORD __cdecl svcctl_EnumServicesStatusW( scmdatabase_unlock(manager->db); return ERROR_MORE_DATA; } - s = (ENUM_SERVICE_STATUSW *)buffer; - offset = num_services * sizeof(ENUM_SERVICE_STATUSW); + s = (struct enum_service_status *)buffer; + offset = num_services * sizeof(struct enum_service_status); LIST_FOR_EACH_ENTRY(service, &manager->db->services, struct service_entry, entry) { if ((service->status.dwServiceType & type) && map_state(service->status.dwCurrentState, state)) { sz = (strlenW(service->name) + 1) * sizeof(WCHAR); memcpy(buffer + offset, service->name, sz); - s->lpServiceName = (WCHAR *)offset; /* store a buffer offset instead of a pointer */ + s->service_name = offset; offset += sz; - if (!service->config.lpDisplayName) s->lpDisplayName = NULL; + if (!service->config.lpDisplayName) s->display_name = 0; else { sz = (strlenW(service->config.lpDisplayName) + 1) * sizeof(WCHAR); memcpy(buffer + offset, service->config.lpDisplayName, sz); - s->lpDisplayName = (WCHAR *)offset; + s->display_name = offset; offset += sz; } - s->ServiceStatus = service->status; + s->service_status = service->status; s++; } }
1
0
0
0
Alex Henrie : libport: Move rint fallback implementations from msvcrt to libport.
by Alexandre Julliard
08 Nov '17
08 Nov '17
Module: wine Branch: master Commit: 06d9c7e25e4ff71731c81f172269c8cd81b0c68a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=06d9c7e25e4ff71731c81f172…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Mon Nov 6 21:01:13 2017 -0500 libport: Move rint fallback implementations from msvcrt to libport. Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dsound/dsound_convert.c | 1 + dlls/msvcrt/math.c | 24 ---------------- include/wine/port.h | 24 ++++++++++++++++ libs/port/Makefile.in | 1 + libs/port/rint.c | 66 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 92 insertions(+), 24 deletions(-) diff --git a/dlls/dsound/dsound_convert.c b/dlls/dsound/dsound_convert.c index 6887bae..26dbb32 100644 --- a/dlls/dsound/dsound_convert.c +++ b/dlls/dsound/dsound_convert.c @@ -35,6 +35,7 @@ */ #include "config.h" +#include "wine/port.h" #include <stdarg.h> #include <math.h> diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 60ce4e6..b7288cf 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -2604,11 +2604,7 @@ LDOUBLE CDECL MSVCR120_log2l(LDOUBLE x) */ double CDECL MSVCR120_rint(double x) { -#ifdef HAVE_RINT return rint(x); -#else - return x >= 0 ? floor(x + 0.5) : ceil(x - 0.5); -#endif } /********************************************************************* @@ -2616,11 +2612,7 @@ double CDECL MSVCR120_rint(double x) */ float CDECL MSVCR120_rintf(float x) { -#ifdef HAVE_RINTF return rintf(x); -#else - return MSVCR120_rint(x); -#endif } /********************************************************************* @@ -2636,11 +2628,7 @@ LDOUBLE CDECL MSVCR120_rintl(LDOUBLE x) */ MSVCRT_long CDECL MSVCR120_lrint(double x) { -#ifdef HAVE_LRINT return lrint(x); -#else - return MSVCR120_rint(x); -#endif } /********************************************************************* @@ -2648,11 +2636,7 @@ MSVCRT_long CDECL MSVCR120_lrint(double x) */ MSVCRT_long CDECL MSVCR120_lrintf(float x) { -#ifdef HAVE_LRINTF return lrintf(x); -#else - return MSVCR120_lrint(x); -#endif } /********************************************************************* @@ -2668,11 +2652,7 @@ MSVCRT_long CDECL MSVCR120_lrintl(LDOUBLE x) */ MSVCRT_longlong CDECL MSVCR120_llrint(double x) { -#ifdef HAVE_LLRINT return llrint(x); -#else - return MSVCR120_rint(x); -#endif } /********************************************************************* @@ -2680,11 +2660,7 @@ MSVCRT_longlong CDECL MSVCR120_llrint(double x) */ MSVCRT_longlong CDECL MSVCR120_llrintf(float x) { -#ifdef HAVE_LLRINTF return llrintf(x); -#else - return MSVCR120_llrint(x); -#endif } /********************************************************************* diff --git a/include/wine/port.h b/include/wine/port.h index 2989b39..addece0 100644 --- a/include/wine/port.h +++ b/include/wine/port.h @@ -272,6 +272,22 @@ int isinf(double x); int isnan(double x); #endif +#ifndef HAVE_LLRINT +__int64 llrint(double x); +#endif + +#ifndef HAVE_LLRINTF +__int64 llrintf(float x); +#endif + +#ifndef HAVE_LRINT +long lrint(double x); +#endif + +#ifndef HAVE_LRINTF +long lrintf(float x); +#endif + #ifndef HAVE_LSTAT int lstat(const char *file_name, struct stat *buf); #endif /* HAVE_LSTAT */ @@ -308,6 +324,14 @@ ssize_t pwrite( int fd, const void *buf, size_t count, off_t offset ); int readlink( const char *path, char *buf, size_t size ); #endif /* HAVE_READLINK */ +#ifndef HAVE_RINT +double rint(double x); +#endif + +#ifndef HAVE_RINTF +float rintf(float x); +#endif + #ifndef HAVE_STATVFS int statvfs( const char *path, struct statvfs *buf ); #endif diff --git a/libs/port/Makefile.in b/libs/port/Makefile.in index 9d7e44f..7fefda1 100644 --- a/libs/port/Makefile.in +++ b/libs/port/Makefile.in @@ -96,6 +96,7 @@ C_SRCS = \ pread.c \ pwrite.c \ readlink.c \ + rint.c \ spawn.c \ statvfs.c \ strcasecmp.c \ diff --git a/libs/port/rint.c b/libs/port/rint.c new file mode 100644 index 0000000..a99c00b --- /dev/null +++ b/libs/port/rint.c @@ -0,0 +1,66 @@ +/* + * rint family + * + * Copyright 2017 Alex Henrie + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" +#include "wine/port.h" + +#include <math.h> + +#ifndef HAVE_RINT +double rint(double x) +{ + return x >= 0 ? floor(x + 0.5) : ceil(x - 0.5); +} +#endif + +#ifndef HAVE_RINTF +float rintf(float x) +{ + return rintf(x); +} +#endif + +#ifndef HAVE_LRINT +long lrint(double x) +{ + return x >= 0 ? floor(x + 0.5) : ceil(x - 0.5); +} +#endif + +#ifndef HAVE_LRINTF +long lrintf(float x) +{ + return lrint(x); +} +#endif + +#ifndef HAVE_LLRINT +__int64 llrint(double x) +{ + return x >= 0 ? floor(x + 0.5) : ceil(x - 0.5); +} +#endif + +#ifndef HAVE_LLRINTF +__int64 llrintf(float x) +{ + return llrint(x); +} +#endif
1
0
0
0
Nikolay Sivov : d3dx9: Implement D3DXFrameFind().
by Alexandre Julliard
08 Nov '17
08 Nov '17
Module: wine Branch: master Commit: 6bae0a003e893072ab2b636d5b6c982d76b39f36 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6bae0a003e893072ab2b636d5…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Nov 6 13:31:10 2017 +0300 d3dx9: Implement D3DXFrameFind(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dx9_24/d3dx9_24.spec | 2 +- dlls/d3dx9_25/d3dx9_25.spec | 2 +- dlls/d3dx9_26/d3dx9_26.spec | 2 +- dlls/d3dx9_27/d3dx9_27.spec | 2 +- dlls/d3dx9_28/d3dx9_28.spec | 2 +- dlls/d3dx9_29/d3dx9_29.spec | 2 +- dlls/d3dx9_30/d3dx9_30.spec | 2 +- dlls/d3dx9_31/d3dx9_31.spec | 2 +- dlls/d3dx9_32/d3dx9_32.spec | 2 +- dlls/d3dx9_33/d3dx9_33.spec | 2 +- dlls/d3dx9_34/d3dx9_34.spec | 2 +- dlls/d3dx9_35/d3dx9_35.spec | 2 +- dlls/d3dx9_36/d3dx9_36.spec | 2 +- dlls/d3dx9_36/mesh.c | 80 +++++++++++++++++++++++++++++++++++++++++++++ dlls/d3dx9_36/tests/mesh.c | 76 ++++++++++++++++++++++++++++++++++++++++++ dlls/d3dx9_37/d3dx9_37.spec | 2 +- dlls/d3dx9_38/d3dx9_38.spec | 2 +- dlls/d3dx9_39/d3dx9_39.spec | 2 +- dlls/d3dx9_40/d3dx9_40.spec | 2 +- dlls/d3dx9_41/d3dx9_41.spec | 2 +- dlls/d3dx9_42/d3dx9_42.spec | 2 +- dlls/d3dx9_43/d3dx9_43.spec | 2 +- 22 files changed, 176 insertions(+), 20 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=6bae0a003e893072ab2b6…
1
0
0
0
Hans Leidekker : include: Add missing BCRYPT_CHAIN_MODE definitions.
by Alexandre Julliard
08 Nov '17
08 Nov '17
Module: wine Branch: master Commit: 63e3179c64ff3934ca75d717947642282e0ccce9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=63e3179c64ff3934ca75d7179…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Nov 8 16:25:51 2017 +0100 include: Add missing BCRYPT_CHAIN_MODE definitions. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/bcrypt.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/bcrypt.h b/include/bcrypt.h index c71b1e8..2555bf0 100644 --- a/include/bcrypt.h +++ b/include/bcrypt.h @@ -74,6 +74,9 @@ typedef LONG NTSTATUS; #define BCRYPT_CHAIN_MODE_NA (const WCHAR []){'C','h','a','i','n','i','n','g','M','o','d','e','N','/','A',0} #define BCRYPT_CHAIN_MODE_CBC (const WCHAR []){'C','h','a','i','n','i','n','g','M','o','d','e','C','B','C',0} #define BCRYPT_CHAIN_MODE_ECB (const WCHAR []){'C','h','a','i','n','i','n','g','M','o','d','e','E','C','B',0} +#define BCRYPT_CHAIN_MODE_CFB (const WCHAR []){'C','h','a','i','n','i','n','g','M','o','d','e','C','F','B',0} +#define BCRYPT_CHAIN_MODE_CCM (const WCHAR []){'C','h','a','i','n','i','n','g','M','o','d','e','C','C','M',0} +#define BCRYPT_CHAIN_MODE_GCM (const WCHAR []){'C','h','a','i','n','i','n','g','M','o','d','e','G','C','M',0} typedef struct _BCRYPT_ALGORITHM_IDENTIFIER {
1
0
0
0
Piotr Caban : vbscript: Don't leak IEnumVARIANT in interp_enumnext.
by Alexandre Julliard
08 Nov '17
08 Nov '17
Module: wine Branch: master Commit: f595523413240b34862438565bd43fcf1d1aec92 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f595523413240b34862438565…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Nov 8 18:11:56 2017 +0100 vbscript: Don't leak IEnumVARIANT in interp_enumnext. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/vbscript/interp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index 2f414be..9ec3299 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -1203,7 +1203,7 @@ static HRESULT interp_enumnext(exec_ctx_t *ctx) if(do_continue) { ctx->instr++; }else { - stack_pop(ctx); + stack_popn(ctx, 1); instr_jmp(ctx, loop_end); } return S_OK;
1
0
0
0
Piotr Caban : vbscript: Don't return error on VBScript_SetScriptState( SCRIPTSTATE_DISCONNECTED) call.
by Alexandre Julliard
08 Nov '17
08 Nov '17
Module: wine Branch: master Commit: a2438ce8109677a8e185342c343f55c1e558844c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a2438ce8109677a8e185342c3…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Nov 8 15:05:20 2017 +0100 vbscript: Don't return error on VBScript_SetScriptState(SCRIPTSTATE_DISCONNECTED) call. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/vbscript/vbscript.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/vbscript/vbscript.c b/dlls/vbscript/vbscript.c index b594b07..645068e 100644 --- a/dlls/vbscript/vbscript.c +++ b/dlls/vbscript/vbscript.c @@ -351,6 +351,9 @@ static HRESULT WINAPI VBScript_SetScriptState(IActiveScript *iface, SCRIPTSTATE case SCRIPTSTATE_INITIALIZED: FIXME("unimplemented SCRIPTSTATE_INITIALIZED\n"); return S_OK; + case SCRIPTSTATE_DISCONNECTED: + FIXME("unimplemented SCRIPTSTATE_DISCONNECTED\n"); + return S_OK; default: FIXME("unimplemented state %d\n", ss); return E_NOTIMPL;
1
0
0
0
Piotr Caban : vbscript: Add for each tests on array.
by Alexandre Julliard
08 Nov '17
08 Nov '17
Module: wine Branch: master Commit: c8a94b5d7a39a323f73c2df380c4cfafd9b23ac4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c8a94b5d7a39a323f73c2df38…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Nov 8 15:05:06 2017 +0100 vbscript: Add for each tests on array. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/vbscript/tests/lang.vbs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index a904f5d..2af77bd 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -1304,6 +1304,35 @@ arr(0) = "not modified" modifyarr(arr) Call todo_wine_ok(arr(0) = "not modified", "arr(0) = " & arr(0)) +for x = 0 to UBound(arr) + arr(x) = x +next +y = 0 +for each x in arr + Call ok(x = y, "x = " & x & ", expected " & y) + Call ok(arr(y) = y, "arr(" & y & ") = " & arr(y)) + arr(y) = 1 + x = 1 + y = y+1 +next +Call ok(y = 4, "y = " & y & " after array enumeration") + +for x=0 to UBound(arr2, 1) + for y=0 to UBound(arr2, 2) + arr2(x, y) = x + y*(UBound(arr2, 1)+1) + next +next +y = 0 +for each x in arr2 + Call ok(x = y, "x = " & x & ", expected " & y) + y = y+1 +next +Call ok(y = 20, "y = " & y & " after array enumeration") + +for each x in noarr + Call ok(false, "Empty array contains: " & x) +next + ' It's allowed to declare non-builtin RegExp class... class RegExp public property get Global()
1
0
0
0
Piotr Caban : vbscript: Add support for "for each" on arrays.
by Alexandre Julliard
08 Nov '17
08 Nov '17
Module: wine Branch: master Commit: a85d12af447057d40882c58e2bb9b51f389abecb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a85d12af447057d40882c58e2…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Nov 8 15:05:01 2017 +0100 vbscript: Add support for "for each" on arrays. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/vbscript/Makefile.in | 1 + dlls/vbscript/interp.c | 12 +++ dlls/vbscript/utils.c | 193 ++++++++++++++++++++++++++++++++++++++++++++++ dlls/vbscript/vbscript.h | 2 + 4 files changed, 208 insertions(+) diff --git a/dlls/vbscript/Makefile.in b/dlls/vbscript/Makefile.in index 5ad0600..5c613f0 100644 --- a/dlls/vbscript/Makefile.in +++ b/dlls/vbscript/Makefile.in @@ -7,6 +7,7 @@ C_SRCS = \ interp.c \ lex.c \ regexp.c \ + utils.c \ vbdisp.c \ vbregexp.c \ vbscript.c \ diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index feb8119..2f414be 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -1148,6 +1148,18 @@ static HRESULT interp_newenum(exec_ctx_t *ctx) V_UNKNOWN(r) = (IUnknown*)iter; break; } + case VT_VARIANT|VT_ARRAY: + case VT_VARIANT|VT_ARRAY|VT_BYREF: { + IEnumVARIANT *iter; + + hres = create_safearray_iter(V_ISBYREF(v.v) ? *V_ARRAYREF(v.v) : V_ARRAY(v.v), &iter); + if(FAILED(hres)) + return hres; + + V_VT(r) = VT_UNKNOWN; + V_UNKNOWN(r) = (IUnknown*)iter; + break; + } default: FIXME("Unsupported for %s\n", debugstr_variant(v.v)); release_val(&v); diff --git a/dlls/vbscript/utils.c b/dlls/vbscript/utils.c new file mode 100644 index 0000000..d30842c --- /dev/null +++ b/dlls/vbscript/utils.c @@ -0,0 +1,193 @@ +/* + * Copyright 2017 Piotr Caban for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "vbscript.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(vbscript); + +typedef struct { + IEnumVARIANT IEnumVARIANT_iface; + + LONG ref; + + SAFEARRAY *sa; + ULONG i, size; +} safearray_iter; + +static inline safearray_iter *impl_from_IEnumVARIANT(IEnumVARIANT *iface) +{ + return CONTAINING_RECORD(iface, safearray_iter, IEnumVARIANT_iface); +} + +static HRESULT WINAPI safearray_iter_IEnumVARIANT_QueryInterface( + IEnumVARIANT *iface, REFIID riid, void **ppv) +{ + safearray_iter *This = impl_from_IEnumVARIANT(iface); + + if(IsEqualGUID(riid, &IID_IUnknown)) { + TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); + *ppv = &This->IEnumVARIANT_iface; + }else if(IsEqualGUID(riid, &IID_IEnumVARIANT)) { + TRACE("(%p)->(IID_IEnumVARIANT %p)\n", This, ppv); + *ppv = &This->IEnumVARIANT_iface; + }else { + FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI safearray_iter_IEnumVARIANT_AddRef(IEnumVARIANT *iface) +{ + safearray_iter *This = impl_from_IEnumVARIANT(iface); + LONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + return ref; +} + +static ULONG WINAPI safearray_iter_IEnumVARIANT_Release(IEnumVARIANT *iface) +{ + safearray_iter *This = impl_from_IEnumVARIANT(iface); + LONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%d\n", iface, ref); + + if(!ref) { + if(This->sa) + SafeArrayUnlock(This->sa); + heap_free(This); + } + + return ref; +} + +static HRESULT WINAPI safearray_iter_IEnumVARIANT_Next(IEnumVARIANT *iface, + ULONG celt, VARIANT *rgVar, ULONG *pCeltFetched) +{ + safearray_iter *This = impl_from_IEnumVARIANT(iface); + HRESULT hres; + VARIANT *v; + + TRACE("(%p)->(%u %p %p)\n", This, celt, rgVar, pCeltFetched); + + if(celt != 1) { + FIXME("celt != 1\n"); + return E_NOTIMPL; + } + + if(This->i >= This->size) { + if(pCeltFetched) + *pCeltFetched = 0; + return S_FALSE; + } + + if(!This->sa->cLocks) + ERR("SAFEARRAY not locked\n"); + + v = (VARIANT*)(((BYTE*)This->sa->pvData) + This->i * This->sa->cbElements); + V_VT(rgVar) = VT_EMPTY; + hres = VariantCopy(rgVar, v); + if(FAILED(hres)) + return hres; + + This->i++; + if(pCeltFetched) + *pCeltFetched = 1; + return S_OK; +} + +static HRESULT WINAPI safearray_iter_IEnumVARIANT_Skip(IEnumVARIANT *iface, ULONG celt) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI safearray_iter_IEnumVARIANT_Reset(IEnumVARIANT *iface) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI safearray_iter_IEnumVARIANT_Clone( + IEnumVARIANT *iface, IEnumVARIANT **ppEnum) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static const IEnumVARIANTVtbl safearray_iter_EnumVARIANTVtbl = { + safearray_iter_IEnumVARIANT_QueryInterface, + safearray_iter_IEnumVARIANT_AddRef, + safearray_iter_IEnumVARIANT_Release, + safearray_iter_IEnumVARIANT_Next, + safearray_iter_IEnumVARIANT_Skip, + safearray_iter_IEnumVARIANT_Reset, + safearray_iter_IEnumVARIANT_Clone +}; + +static ULONG get_safearray_size(SAFEARRAY *sa) +{ + ULONG ret = 1; + USHORT i; + + if(!sa) + return 0; + + for(i=0; i<sa->cDims && ret; i++) + ret *= sa->rgsabound[i].cElements; + return ret; +} + +HRESULT create_safearray_iter(SAFEARRAY *sa, IEnumVARIANT **ev) +{ + safearray_iter *iter; + HRESULT hres; + + if(sa && !(sa->fFeatures & FADF_VARIANT)) { + FIXME("enumeration not supported: %x\n", sa->fFeatures); + return E_NOTIMPL; + } + + iter = heap_alloc(sizeof(*iter)); + if(!iter) + return E_OUTOFMEMORY; + + if(sa) { + hres = SafeArrayLock(sa); + if(FAILED(hres)) { + heap_free(iter); + return hres; + } + } + + iter->IEnumVARIANT_iface.lpVtbl = &safearray_iter_EnumVARIANTVtbl; + iter->ref = 1; + iter->sa = sa; + iter->i = 0; + iter->size = get_safearray_size(sa); + + *ev = &iter->IEnumVARIANT_iface; + return S_OK; +} diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index d3be4f0..ec41737 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -391,6 +391,8 @@ HRESULT create_regexp(IDispatch**) DECLSPEC_HIDDEN; HRESULT map_hres(HRESULT) DECLSPEC_HIDDEN; +HRESULT create_safearray_iter(SAFEARRAY *sa, IEnumVARIANT **ev) DECLSPEC_HIDDEN; + #define FACILITY_VBS 0xa #define MAKE_VBSERROR(code) MAKE_HRESULT(SEVERITY_ERROR, FACILITY_VBS, code)
1
0
0
0
Huw Davies : rpcrt4: Don't free the argument if the freer was called, unless it's a simple ref.
by Alexandre Julliard
08 Nov '17
08 Nov '17
Module: wine Branch: master Commit: b2667416c21e0e9e829169404be4c04b4c973139 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b2667416c21e0e9e829169404…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Nov 8 11:19:56 2017 +0000 rpcrt4: Don't free the argument if the freer was called, unless it's a simple ref. In the simple reference case the freer will not see the top-level pointer, so we need to free that here. This fixes a double-free caused by commit 614afcefa33c727f31d566c3d7ee05d74afc363f. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/rpcrt4/ndr_stubless.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c index f65eaf5..f84c617 100644 --- a/dlls/rpcrt4/ndr_stubless.c +++ b/dlls/rpcrt4/ndr_stubless.c @@ -1137,6 +1137,11 @@ LONG_PTR __cdecl call_server_func(SERVER_ROUTINE func, unsigned char * args, uns } #endif +static inline BOOL param_needs_alloc( PARAM_ATTRIBUTES attr ) +{ + return attr.IsOut && !attr.IsIn && !attr.IsBasetype && !attr.IsByValue; +} + static LONG_PTR *stub_do_args(MIDL_STUB_MESSAGE *pStubMsg, PFORMAT_STRING pFormat, enum stubless_phase phase, unsigned short number_of_params) @@ -1172,20 +1177,14 @@ static LONG_PTR *stub_do_args(MIDL_STUB_MESSAGE *pStubMsg, { HeapFree(GetProcessHeap(), 0, *(void **)pArg); } - else if (params[i].attr.IsOut && - !params[i].attr.IsIn && - !params[i].attr.IsBasetype && - !params[i].attr.IsByValue) + else if (param_needs_alloc(params[i].attr) && + (!params[i].attr.MustFree || params[i].attr.IsSimpleRef)) { if (*pTypeFormat != RPC_FC_BIND_CONTEXT) pStubMsg->pfnFree(*(void **)pArg); } break; case STUBLESS_INITOUT: - if (!params[i].attr.IsIn && - params[i].attr.IsOut && - !params[i].attr.IsBasetype && - !params[i].attr.ServerAllocSize && - !params[i].attr.IsByValue) + if (param_needs_alloc(params[i].attr) && !params[i].attr.ServerAllocSize) { if (*pTypeFormat == RPC_FC_BIND_CONTEXT) {
1
0
0
0
← Newer
1
...
27
28
29
30
31
32
33
...
44
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Results per page:
10
25
50
100
200