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 2022
----- 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
1171 discussions
Start a n
N
ew thread
Piotr Caban : winprint: Add stub dll.
by Alexandre Julliard
21 Nov '22
21 Nov '22
Module: wine Branch: master Commit: b7d7b23a617bdbb4177830c074cc0c8807ec9bce URL:
https://gitlab.winehq.org/wine/wine/-/commit/b7d7b23a617bdbb4177830c074cc0c…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Oct 26 13:12:27 2022 +0200 winprint: Add stub dll. --- configure | 2 ++ configure.ac | 1 + dlls/winprint/Makefile.in | 4 +++ dlls/winprint/printproc.c | 64 +++++++++++++++++++++++++++++++++++++++++++++ dlls/winprint/winprint.spec | 6 +++++ loader/wine.inf.in | 2 ++ 6 files changed, 79 insertions(+) diff --git a/configure b/configure index 99fefd2c172..e17b71555f2 100755 --- a/configure +++ b/configure @@ -1472,6 +1472,7 @@ enable_winhttp enable_wininet enable_winmm enable_winnls32 +enable_winprint enable_winscard enable_winspool_drv enable_winsta @@ -21918,6 +21919,7 @@ wine_fn_config_makefile dlls/winmm enable_winmm wine_fn_config_makefile dlls/winmm/tests enable_tests wine_fn_config_makefile dlls/winnls.dll16 enable_win16 wine_fn_config_makefile dlls/winnls32 enable_winnls32 +wine_fn_config_makefile dlls/winprint enable_winprint wine_fn_config_makefile dlls/winscard enable_winscard wine_fn_config_makefile dlls/winsock.dll16 enable_win16 wine_fn_config_makefile dlls/winspool.drv enable_winspool_drv diff --git a/configure.ac b/configure.ac index abf03f41b09..b7d443c1182 100644 --- a/configure.ac +++ b/configure.ac @@ -3203,6 +3203,7 @@ WINE_CONFIG_MAKEFILE(dlls/winmm) WINE_CONFIG_MAKEFILE(dlls/winmm/tests) WINE_CONFIG_MAKEFILE(dlls/winnls.dll16,enable_win16) WINE_CONFIG_MAKEFILE(dlls/winnls32) +WINE_CONFIG_MAKEFILE(dlls/winprint) WINE_CONFIG_MAKEFILE(dlls/winscard) WINE_CONFIG_MAKEFILE(dlls/winsock.dll16,enable_win16) WINE_CONFIG_MAKEFILE(dlls/winspool.drv) diff --git a/dlls/winprint/Makefile.in b/dlls/winprint/Makefile.in new file mode 100644 index 00000000000..002004b1d0d --- /dev/null +++ b/dlls/winprint/Makefile.in @@ -0,0 +1,4 @@ +MODULE = winprint.dll + +C_SRCS = \ + printproc.c diff --git a/dlls/winprint/printproc.c b/dlls/winprint/printproc.c new file mode 100644 index 00000000000..7cc8759d801 --- /dev/null +++ b/dlls/winprint/printproc.c @@ -0,0 +1,64 @@ +/* + * Print processor implementation. + * + * Copyright 2022 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 "windows.h" +#include "winspool.h" +#include "ddk/winsplp.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(winprint); + +BOOL WINAPI EnumPrintProcessorDatatypesW(WCHAR *server, WCHAR *name, DWORD level, + BYTE *datatypes, DWORD size, DWORD *needed, DWORD *no) +{ + FIXME("%s, %s, %ld, %p, %ld, %p, %p\n", debugstr_w(server), debugstr_w(name), + level, datatypes, size, needed, no); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +HANDLE WINAPI OpenPrintProcessor(WCHAR *port, PRINTPROCESSOROPENDATA *open_data) +{ + FIXME("%s, %p\n", debugstr_w(port), open_data); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return NULL; +} + +BOOL WINAPI ClosePrintProcessor(HANDLE pp) +{ + FIXME("%p\n", pp); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI PrintDocumentOnPrintProcessor(HANDLE pp, WCHAR *doc_name) +{ + FIXME("%p, %s\n", pp, debugstr_w(doc_name)); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI ControlPrintProcessor(HANDLE pp, DWORD cmd) +{ + FIXME("%p, %ld\n", pp, cmd); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} diff --git a/dlls/winprint/winprint.spec b/dlls/winprint/winprint.spec new file mode 100644 index 00000000000..b7b4642b695 --- /dev/null +++ b/dlls/winprint/winprint.spec @@ -0,0 +1,6 @@ +@ stdcall ClosePrintProcessor(ptr) +@ stdcall ControlPrintProcessor(ptr long) +@ stdcall EnumPrintProcessorDatatypesW(ptr ptr long ptr long ptr ptr) +@ stub GetPrintProcessorCapabilities +@ stdcall OpenPrintProcessor(ptr ptr) +@ stdcall PrintDocumentOnPrintProcessor(ptr ptr) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index e7b435ed0f0..127d1f9ad6a 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -2149,6 +2149,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G" 16427,System\OLE DB,msdasql.dll 16427,System\ADO,msado15.dll 66000,3,wineps.drv +55,,winprint.dll 12,,*.sys,- 11,,*.msstyles,- 11,,* @@ -2211,6 +2212,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G" 16427,System\OLE DB,msdasql.dll 16427,System\ADO,msado15.dll 66000,3,wineps.drv +55,,winprint.dll 12,,*.sys 11,,*
1
0
0
0
Alex Henrie : dinput/tests: Avoid using GCC's typeof extension.
by Alexandre Julliard
21 Nov '22
21 Nov '22
Module: wine Branch: master Commit: f0605758e0b6762d5c2ad173a2026fe8a256a702 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f0605758e0b6762d5c2ad173a2026f…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Mon Nov 21 08:07:22 2022 -0700 dinput/tests: Avoid using GCC's typeof extension. typeof is not available in MSVC. --- dlls/dinput/tests/force_feedback.c | 12 +++++------- dlls/dinput/tests/hotplug.c | 10 ++++------ dlls/dinput/tests/joystick8.c | 12 +++++------- 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/dlls/dinput/tests/force_feedback.c b/dlls/dinput/tests/force_feedback.c index 8fb15e38f13..ba37320e9f0 100644 --- a/dlls/dinput/tests/force_feedback.c +++ b/dlls/dinput/tests/force_feedback.c @@ -48,13 +48,11 @@ #include "windows.gaming.input.forcefeedback.h" #undef Size -#define MAKE_FUNC(f) static typeof(f) *p ## f -MAKE_FUNC( RoGetActivationFactory ); -MAKE_FUNC( RoInitialize ); -MAKE_FUNC( WindowsCreateString ); -MAKE_FUNC( WindowsDeleteString ); -MAKE_FUNC( WindowsGetStringRawBuffer ); -#undef MAKE_FUNC +static HRESULT WINAPI (*pRoGetActivationFactory)( HSTRING, REFIID, void** ); +static HRESULT WINAPI (*pRoInitialize)( RO_INIT_TYPE ); +static HRESULT WINAPI (*pWindowsCreateString)( const WCHAR*, UINT32, HSTRING* ); +static HRESULT WINAPI (*pWindowsDeleteString)( HSTRING str ); +static const WCHAR* WINAPI (*pWindowsGetStringRawBuffer)( HSTRING, UINT32* ); static BOOL load_combase_functions(void) { diff --git a/dlls/dinput/tests/hotplug.c b/dlls/dinput/tests/hotplug.c index 9896e7b480e..e915d04745a 100644 --- a/dlls/dinput/tests/hotplug.c +++ b/dlls/dinput/tests/hotplug.c @@ -50,12 +50,10 @@ #include "windows.gaming.input.custom.h" #undef Size -#define MAKE_FUNC(f) static typeof(f) *p ## f -MAKE_FUNC( RoGetActivationFactory ); -MAKE_FUNC( RoInitialize ); -MAKE_FUNC( WindowsCreateString ); -MAKE_FUNC( WindowsDeleteString ); -#undef MAKE_FUNC +static HRESULT WINAPI (*pRoGetActivationFactory)( HSTRING, REFIID, void** ); +static HRESULT WINAPI (*pRoInitialize)( RO_INIT_TYPE ); +static HRESULT WINAPI (*pWindowsCreateString)( const WCHAR*, UINT32, HSTRING* ); +static HRESULT WINAPI (*pWindowsDeleteString)( HSTRING str ); static BOOL load_combase_functions(void) { diff --git a/dlls/dinput/tests/joystick8.c b/dlls/dinput/tests/joystick8.c index 0981d917b2a..f568c9298c6 100644 --- a/dlls/dinput/tests/joystick8.c +++ b/dlls/dinput/tests/joystick8.c @@ -47,13 +47,11 @@ #include "windows.gaming.input.h" #undef Size -#define MAKE_FUNC(f) static typeof(f) *p ## f -MAKE_FUNC( RoGetActivationFactory ); -MAKE_FUNC( RoInitialize ); -MAKE_FUNC( WindowsCreateString ); -MAKE_FUNC( WindowsDeleteString ); -MAKE_FUNC( WindowsGetStringRawBuffer ); -#undef MAKE_FUNC +static HRESULT WINAPI (*pRoGetActivationFactory)( HSTRING, REFIID, void** ); +static HRESULT WINAPI (*pRoInitialize)( RO_INIT_TYPE ); +static HRESULT WINAPI (*pWindowsCreateString)( const WCHAR*, UINT32, HSTRING* ); +static HRESULT WINAPI (*pWindowsDeleteString)( HSTRING str ); +static const WCHAR* WINAPI (*pWindowsGetStringRawBuffer)( HSTRING, UINT32* ); static BOOL load_combase_functions(void) {
1
0
0
0
Alex Henrie : msxml3: Use standard C functions for memory allocation in saxreader.c.
by Alexandre Julliard
21 Nov '22
21 Nov '22
Module: wine Branch: master Commit: c366fa43407dcb2fdf1cad9a6c22aee90d62568d URL:
https://gitlab.winehq.org/wine/wine/-/commit/c366fa43407dcb2fdf1cad9a6c22ae…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Sun Nov 20 18:44:24 2022 -0700 msxml3: Use standard C functions for memory allocation in saxreader.c. --- dlls/msxml3/msxml_private.h | 7 ------- dlls/msxml3/saxreader.c | 48 +++++++++++++++++++++++---------------------- 2 files changed, 25 insertions(+), 30 deletions(-) diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h index e41b7c9979d..cd8ae547c73 100644 --- a/dlls/msxml3/msxml_private.h +++ b/dlls/msxml3/msxml_private.h @@ -78,13 +78,6 @@ typedef enum _XDR_DT { extern HINSTANCE MSXML_hInstance DECLSPEC_HIDDEN; -/* memory allocation functions */ - -static inline void* __WINE_ALLOC_SIZE(2) heap_realloc_zero(void *mem, size_t size) -{ - return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, size); -} - /* XSLProcessor parameter list */ struct xslprocessor_par { diff --git a/dlls/msxml3/saxreader.c b/dlls/msxml3/saxreader.c index 8d58ed1d94b..0e886a2d051 100644 --- a/dlls/msxml3/saxreader.c +++ b/dlls/msxml3/saxreader.c @@ -466,13 +466,13 @@ static element_entry* alloc_element_entry(const xmlChar *local, const xmlChar *p element_entry *ret; int i; - ret = heap_alloc(sizeof(*ret)); + ret = malloc(sizeof(*ret)); if (!ret) return ret; ret->local = bstr_from_xmlChar(local); ret->prefix = bstr_from_xmlChar(prefix); ret->qname = build_qname(ret->prefix, ret->local); - ret->ns = nb_ns ? heap_alloc(nb_ns*sizeof(ns)) : NULL; + ret->ns = nb_ns ? malloc(nb_ns * sizeof(ns)) : NULL; ret->ns_count = nb_ns; for (i=0; i < nb_ns; i++) @@ -498,8 +498,8 @@ static void free_element_entry(element_entry *element) SysFreeString(element->local); SysFreeString(element->qname); - heap_free(element->ns); - heap_free(element); + free(element->ns); + free(element); } static void push_element_ns(saxlocator *locator, element_entry *element) @@ -567,7 +567,7 @@ static BOOL bstr_pool_insert(struct bstrpool *pool, BSTR pool_entry) { if (!pool->pool) { - pool->pool = heap_alloc(16 * sizeof(*pool->pool)); + pool->pool = malloc(16 * sizeof(*pool->pool)); if (!pool->pool) return FALSE; @@ -576,12 +576,12 @@ static BOOL bstr_pool_insert(struct bstrpool *pool, BSTR pool_entry) } else if (pool->index == pool->len) { - BSTR *realloc = heap_realloc(pool->pool, pool->len * 2 * sizeof(*realloc)); + BSTR *new_pool = realloc(pool->pool, pool->len * 2 * sizeof(*new_pool)); - if (!realloc) + if (!new_pool) return FALSE; - pool->pool = realloc; + pool->pool = new_pool; pool->len *= 2; } @@ -596,7 +596,7 @@ static void free_bstr_pool(struct bstrpool *pool) for (i = 0; i < pool->index; i++) SysFreeString(pool->pool[i]); - heap_free(pool->pool); + free(pool->pool); pool->pool = NULL; pool->index = pool->len = 0; @@ -1399,7 +1399,7 @@ static BSTR saxreader_get_unescaped_value(const xmlChar *buf, int len) str_len = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)buf, len, NULL, 0); if (len != -1) str_len++; - str = heap_alloc(str_len*sizeof(WCHAR)); + str = malloc(str_len * sizeof(WCHAR)); if (!str) return NULL; MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)buf, len, str, str_len); @@ -1421,7 +1421,7 @@ static BSTR saxreader_get_unescaped_value(const xmlChar *buf, int len) } bstr = SysAllocString(str); - heap_free(str); + free(str); return bstr; } @@ -1461,13 +1461,15 @@ static HRESULT SAXAttributes_populate(saxlocator *locator, if(locator->attr_count > locator->attr_alloc_count) { int new_size = locator->attr_count * 2; - attrs = heap_realloc_zero(locator->attributes, new_size * sizeof(struct _attributes)); + attrs = realloc(locator->attributes, new_size * sizeof(*locator->attributes)); if(!attrs) { free_attribute_values(locator); locator->attr_count = 0; return E_OUTOFMEMORY; } + memset(attrs + locator->attr_alloc_count, 0, + (new_size - locator->attr_alloc_count) * sizeof(*locator->attributes)); locator->attributes = attrs; locator->attr_alloc_count = new_size; } @@ -1930,7 +1932,7 @@ static void WINAPIV libxmlFatalError(void *ctx, const char *msg, ...) va_end(args); len = MultiByteToWideChar(CP_UNIXCP, 0, message, -1, NULL, 0); - error = heap_alloc(sizeof(WCHAR)*len); + error = malloc(sizeof(WCHAR) * len); if(error) { MultiByteToWideChar(CP_UNIXCP, 0, message, -1, error, len); @@ -1941,7 +1943,7 @@ static void WINAPIV libxmlFatalError(void *ctx, const char *msg, ...) { xmlStopParser(This->pParserCtxt); This->ret = E_FAIL; - heap_free(error); + free(error); return; } @@ -1957,7 +1959,7 @@ static void WINAPIV libxmlFatalError(void *ctx, const char *msg, ...) else ISAXErrorHandler_fatalError(handler->handler, &This->ISAXLocator_iface, error, E_FAIL); - heap_free(error); + free(error); xmlStopParser(This->pParserCtxt); This->ret = E_FAIL; @@ -2335,7 +2337,7 @@ static ULONG WINAPI isaxlocator_Release( SysFreeString(This->attributes[index].szValue); SysFreeString(This->attributes[index].szQName); } - heap_free(This->attributes); + free(This->attributes); /* element stack */ LIST_FOR_EACH_ENTRY_SAFE(element, element2, &This->elements, element_entry, entry) @@ -2345,7 +2347,7 @@ static ULONG WINAPI isaxlocator_Release( } ISAXXMLReader_Release(&This->saxreader->ISAXXMLReader_iface); - heap_free( This ); + free(This); } return ref; @@ -2434,7 +2436,7 @@ static HRESULT SAXLocator_create(saxreader *reader, saxlocator **ppsaxlocator, B saxlocator *locator; - locator = heap_alloc( sizeof (*locator) ); + locator = malloc(sizeof(*locator)); if( !locator ) return E_OUTOFMEMORY; @@ -2461,18 +2463,18 @@ static HRESULT SAXLocator_create(saxreader *reader, saxlocator **ppsaxlocator, B if(!locator->namespaceUri) { ISAXXMLReader_Release(&reader->ISAXXMLReader_iface); - heap_free(locator); + free(locator); return E_OUTOFMEMORY; } locator->attr_alloc_count = 8; locator->attr_count = 0; - locator->attributes = heap_alloc_zero(sizeof(struct _attributes)*locator->attr_alloc_count); + locator->attributes = calloc(locator->attr_alloc_count, sizeof(*locator->attributes)); if(!locator->attributes) { ISAXXMLReader_Release(&reader->ISAXXMLReader_iface); SysFreeString(locator->namespaceUri); - heap_free(locator); + free(locator); return E_OUTOFMEMORY; } @@ -2948,7 +2950,7 @@ static ULONG WINAPI saxxmlreader_Release( SysFreeString(This->xmldecl_version); free_bstr_pool(&This->pool); - heap_free( This ); + free(This); } return ref; @@ -3437,7 +3439,7 @@ HRESULT SAXXMLReader_create(MSXML_VERSION version, LPVOID *ppObj) TRACE("(%p)\n", ppObj); - reader = heap_alloc( sizeof (*reader) ); + reader = malloc(sizeof(*reader)); if( !reader ) return E_OUTOFMEMORY;
1
0
0
0
Alex Henrie : mshtml: Handle realloc failure in add_func_info.
by Alexandre Julliard
21 Nov '22
21 Nov '22
Module: wine Branch: master Commit: 6e79aff665767c2e4380a75109ce56af9be8dbaf URL:
https://gitlab.winehq.org/wine/wine/-/commit/6e79aff665767c2e4380a75109ce56…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Sun Nov 20 19:28:13 2022 -0700 mshtml: Handle realloc failure in add_func_info. --- dlls/mshtml/dispex.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index c70deb67209..61acef7e28b 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -300,8 +300,12 @@ static void add_func_info(dispex_data_t *data, tid_t tid, const FUNCDESC *desc, TRACE("adding %s...\n", debugstr_w(name)); if(info == data->funcs+data->func_cnt) { - if(data->func_cnt == data->func_size) - data->funcs = heap_realloc_zero(data->funcs, (data->func_size <<= 1)*sizeof(func_info_t)); + if(data->func_cnt == data->func_size) { + info = heap_realloc_zero(data->funcs, (data->func_size <<= 1) * sizeof(func_info_t)); + if(!info) + return; + data->funcs = info; + } info = data->funcs+data->func_cnt; data->func_cnt++;
1
0
0
0
Alex Henrie : urlmon: Remove unused function heap_strdupWtoA.
by Alexandre Julliard
21 Nov '22
21 Nov '22
Module: wine Branch: master Commit: dc3189a7103091b4a14de2a4c6ae12440ea1d0cd URL:
https://gitlab.winehq.org/wine/wine/-/commit/dc3189a7103091b4a14de2a4c6ae12…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Sun Nov 20 19:37:23 2022 -0700 urlmon: Remove unused function heap_strdupWtoA. This function was introduced in commit 59055c4d45c674c2a9dc2efcb8d0a973f870f3ac but never used. --- dlls/urlmon/urlmon_main.h | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/dlls/urlmon/urlmon_main.h b/dlls/urlmon/urlmon_main.h index 691c63e3b42..6687fbd0516 100644 --- a/dlls/urlmon/urlmon_main.h +++ b/dlls/urlmon/urlmon_main.h @@ -281,18 +281,4 @@ static inline LPWSTR heap_strdupAtoW(const char *str) return ret; } -static inline char *heap_strdupWtoA(const WCHAR *str) -{ - char *ret = NULL; - - if(str) { - size_t size = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL); - ret = heap_alloc(size); - if(ret) - WideCharToMultiByte(CP_ACP, 0, str, -1, ret, size, NULL, NULL); - } - - return ret; -} - #endif /* __WINE_URLMON_MAIN_H */
1
0
0
0
Nikolay Sivov : kernelbase: Add SetProcessInformation().
by Alexandre Julliard
21 Nov '22
21 Nov '22
Module: wine Branch: master Commit: ce91ef6426bf5065bd31bb82fa4f76011e7a9a36 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ce91ef6426bf5065bd31bb82fa4f76…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Nov 20 14:44:32 2022 +0300 kernelbase: Add SetProcessInformation(). Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53954
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/kernel32/kernel32.spec | 1 + dlls/kernelbase/kernelbase.spec | 2 +- dlls/kernelbase/process.c | 20 ++++++++++++++++++++ dlls/wow64/process.c | 3 +++ include/ddk/wdm.h | 2 +- include/winbase.h | 16 ++++++++++++++++ include/winternl.h | 6 ++++-- 7 files changed, 46 insertions(+), 4 deletions(-) diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 89c2511c3cf..ecfc40288f0 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -1448,6 +1448,7 @@ @ stdcall -import SetProcessAffinityUpdateMode(long long) @ stdcall -import SetProcessDefaultCpuSets(ptr ptr long) @ stdcall SetProcessDEPPolicy(long) +@ stdcall -import SetProcessInformation(long long ptr long) @ stdcall -import SetProcessMitigationPolicy(long ptr long) @ stdcall -import SetProcessPreferredUILanguages(long ptr ptr) @ stdcall -import SetProcessPriorityBoost(long long) diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index c51dbd6bc73..d679e190caa 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -1494,7 +1494,7 @@ @ stdcall SetProcessAffinityUpdateMode(long long) @ stdcall SetProcessDefaultCpuSets(ptr ptr long) @ stdcall SetProcessGroupAffinity(long ptr ptr) -# @ stub SetProcessInformation +@ stdcall SetProcessInformation(long long ptr long) @ stdcall SetProcessMitigationPolicy(long ptr long) @ stdcall SetProcessPreferredUILanguages(long ptr ptr) @ stdcall SetProcessPriorityBoost(long long) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index 32f622bdf3e..39de15066d4 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -691,6 +691,26 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW( const WCHAR *app_name, WCHAR *cmd_ } +/********************************************************************** + * SetProcessInformation (kernelbase.@) + */ +BOOL WINAPI SetProcessInformation( HANDLE process, PROCESS_INFORMATION_CLASS info_class, void *info, DWORD size ) +{ + switch (info_class) + { + case ProcessMemoryPriority: + return set_ntstatus( NtSetInformationProcess( process, ProcessPagePriority, info, size )); + case ProcessPowerThrottling: + return set_ntstatus( NtSetInformationProcess( process, ProcessPowerThrottlingState, info, size )); + case ProcessLeapSecondInfo: + return set_ntstatus( NtSetInformationProcess( process, ProcessLeapSecondInformation, info, size )); + default: + FIXME("Unrecognized information class %d.\n", info_class); + return FALSE; + } +} + + /********************************************************************* * DuplicateHandle (kernelbase.@) */ diff --git a/dlls/wow64/process.c b/dlls/wow64/process.c index 46bd6bfec36..ea7a1beb5e3 100644 --- a/dlls/wow64/process.c +++ b/dlls/wow64/process.c @@ -1078,6 +1078,9 @@ NTSTATUS WINAPI wow64_NtSetInformationProcess( UINT *args ) case ProcessDefaultHardErrorMode: /* ULONG */ case ProcessPriorityClass: /* PROCESS_PRIORITY_CLASS */ case ProcessExecuteFlags: /* ULONG */ + case ProcessPagePriority: /* MEMORY_PRIORITY_INFORMATION */ + case ProcessPowerThrottlingState: /* PROCESS_POWER_THROTTLING_STATE */ + case ProcessLeapSecondInformation: /* PROCESS_LEAP_SECOND_INFO */ return NtSetInformationProcess( handle, class, ptr, len ); case ProcessAffinityMask: /* ULONG_PTR */ diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index bd6ddbd67c5..321b07b84fa 100644 --- a/include/ddk/wdm.h +++ b/include/ddk/wdm.h @@ -1943,7 +1943,7 @@ NTSTATUS WINAPI ZwSetEvent(HANDLE,PULONG); NTSTATUS WINAPI ZwSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS); NTSTATUS WINAPI ZwSetInformationKey(HANDLE,const int,PVOID,ULONG); NTSTATUS WINAPI ZwSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG); -NTSTATUS WINAPI ZwSetInformationProcess(HANDLE,PROCESS_INFORMATION_CLASS,PVOID,ULONG); +NTSTATUS WINAPI ZwSetInformationProcess(HANDLE,PROCESSINFOCLASS,PVOID,ULONG); NTSTATUS WINAPI ZwSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG); NTSTATUS WINAPI ZwSetIoCompletion(HANDLE,ULONG,ULONG,NTSTATUS,ULONG); NTSTATUS WINAPI ZwSetLdtEntries(ULONG,ULONG,ULONG,ULONG,ULONG,ULONG); diff --git a/include/winbase.h b/include/winbase.h index 7ad56502566..7d7be1ae2a8 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -1771,6 +1771,21 @@ typedef struct _WIN32_MEMORY_RANGE_ENTRY SIZE_T NumberOfBytes; } WIN32_MEMORY_RANGE_ENTRY, *PWIN32_MEMORY_RANGE_ENTRY; +typedef enum _PROCESS_INFORMATION_CLASS +{ + ProcessMemoryPriority, + ProcessMemoryExhaustionInfo, + ProcessAppMemoryInfo, + ProcessInPrivateInfo, + ProcessPowerThrottling, + ProcessReservedValue1, + ProcessTelemetryCoverageInfo, + ProcessProtectionLevelInfo, + ProcessLeapSecondInfo, + ProcessMachineTypeInfo, + ProcessInformationClassMax +} PROCESS_INFORMATION_CLASS; + WINBASEAPI BOOL WINAPI ActivateActCtx(HANDLE,ULONG_PTR *); WINADVAPI BOOL WINAPI AddAccessAllowedAce(PACL,DWORD,DWORD,PSID); WINADVAPI BOOL WINAPI AddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID); @@ -2689,6 +2704,7 @@ WINBASEAPI BOOL WINAPI SetPriorityClass(HANDLE,DWORD); WINADVAPI BOOL WINAPI SetPrivateObjectSecurity(SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,PGENERIC_MAPPING,HANDLE); WINADVAPI BOOL WINAPI SetPrivateObjectSecurityEx(SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,ULONG,PGENERIC_MAPPING,HANDLE); WINBASEAPI BOOL WINAPI SetProcessAffinityMask(HANDLE,DWORD_PTR); +WINBASEAPI BOOL WINAPI SetProcessInformation(HANDLE,PROCESS_INFORMATION_CLASS,LPVOID,DWORD); WINBASEAPI BOOL WINAPI SetProcessPriorityBoost(HANDLE,BOOL); WINBASEAPI BOOL WINAPI SetProcessShutdownParameters(DWORD,DWORD); WINBASEAPI BOOL WINAPI SetProcessWorkingSetSize(HANDLE,SIZE_T,SIZE_T); diff --git a/include/winternl.h b/include/winternl.h index 3a62ff0b268..5a99827fe65 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -1574,12 +1574,14 @@ typedef enum _PROCESSINFOCLASS { ProcessConsoleHostProcess = 49, ProcessWindowInformation = 50, ProcessHandleInformation = 51, + ProcessPowerThrottlingState = 77, + ProcessLeapSecondInformation = 97, MaxProcessInfoClass, #ifdef __WINESRC__ ProcessWineMakeProcessSystem = 1000, ProcessWineLdtCopy, #endif -} PROCESSINFOCLASS, PROCESS_INFORMATION_CLASS; +} PROCESSINFOCLASS; #define MEM_EXECUTE_OPTION_DISABLE 0x01 #define MEM_EXECUTE_OPTION_ENABLE 0x02 @@ -4174,7 +4176,7 @@ NTSYSAPI NTSTATUS WINAPI NtSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULO NTSYSAPI NTSTATUS WINAPI NtSetInformationJobObject(HANDLE,JOBOBJECTINFOCLASS,PVOID,ULONG); NTSYSAPI NTSTATUS WINAPI NtSetInformationKey(HANDLE,const int,PVOID,ULONG); NTSYSAPI NTSTATUS WINAPI NtSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG); -NTSYSAPI NTSTATUS WINAPI NtSetInformationProcess(HANDLE,PROCESS_INFORMATION_CLASS,PVOID,ULONG); +NTSYSAPI NTSTATUS WINAPI NtSetInformationProcess(HANDLE,PROCESSINFOCLASS,PVOID,ULONG); NTSYSAPI NTSTATUS WINAPI NtSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG); NTSYSAPI NTSTATUS WINAPI NtSetInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG); NTSYSAPI NTSTATUS WINAPI NtSetInformationVirtualMemory(HANDLE,VIRTUAL_MEMORY_INFORMATION_CLASS,ULONG_PTR,PMEMORY_RANGE_ENTRY,PVOID,ULONG);
1
0
0
0
Nikolay Sivov : xmllite/reader: Use consistent formatting for traces.
by Alexandre Julliard
21 Nov '22
21 Nov '22
Module: wine Branch: master Commit: ec749f4e1f8b5fe9a5c67cfe013e583f39c2beb3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ec749f4e1f8b5fe9a5c67cfe013e58…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Nov 20 13:56:44 2022 +0300 xmllite/reader: Use consistent formatting for traces. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/xmllite/reader.c | 60 ++++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/dlls/xmllite/reader.c b/dlls/xmllite/reader.c index f238e2af79d..1e146493aa6 100644 --- a/dlls/xmllite/reader.c +++ b/dlls/xmllite/reader.c @@ -2641,9 +2641,7 @@ static HRESULT reader_parse_nextnode(xmlreader *reader) static HRESULT WINAPI xmlreader_QueryInterface(IXmlReader *iface, REFIID riid, void** ppvObject) { - xmlreader *This = impl_from_IXmlReader(iface); - - TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject); + TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), ppvObject); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IXmlReader)) @@ -2732,7 +2730,7 @@ static HRESULT WINAPI xmlreader_SetInput(IXmlReader* iface, IUnknown *input) IXmlReaderInput *readerinput; HRESULT hr; - TRACE("(%p)->(%p)\n", This, input); + TRACE("%p, %p.\n", iface, input); if (This->input) { @@ -2789,7 +2787,7 @@ static HRESULT WINAPI xmlreader_GetProperty(IXmlReader* iface, UINT property, LO { xmlreader *This = impl_from_IXmlReader(iface); - TRACE("(%p)->(%s %p)\n", This, debugstr_reader_prop(property), value); + TRACE("%p, %s, %p.\n", iface, debugstr_reader_prop(property), value); if (!value) return E_INVALIDARG; @@ -2868,7 +2866,7 @@ static HRESULT WINAPI xmlreader_Read(IXmlReader* iface, XmlNodeType *nodetype) XmlNodeType type; HRESULT hr; - TRACE("(%p)->(%p)\n", This, nodetype); + TRACE("%p, %p.\n", iface, nodetype); if (!nodetype) nodetype = &type; @@ -2905,7 +2903,7 @@ static HRESULT WINAPI xmlreader_GetNodeType(IXmlReader* iface, XmlNodeType *node { xmlreader *This = impl_from_IXmlReader(iface); - TRACE("(%p)->(%p)\n", This, node_type); + TRACE("%p, %p.\n", iface, node_type); if (!node_type) return E_INVALIDARG; @@ -2939,7 +2937,7 @@ static HRESULT WINAPI xmlreader_MoveToFirstAttribute(IXmlReader* iface) { xmlreader *This = impl_from_IXmlReader(iface); - TRACE("(%p)\n", This); + TRACE("%p.\n", iface); return reader_move_to_first_attribute(This); } @@ -2949,7 +2947,7 @@ static HRESULT WINAPI xmlreader_MoveToNextAttribute(IXmlReader* iface) xmlreader *This = impl_from_IXmlReader(iface); const struct list *next; - TRACE("(%p)\n", This); + TRACE("%p.\n", iface); if (!This->attr_count) return S_FALSE; @@ -3030,7 +3028,7 @@ static HRESULT WINAPI xmlreader_MoveToAttributeByName(IXmlReader* iface, UINT target_name_len, target_uri_len; struct attribute *attr; - TRACE("(%p)->(%s %s)\n", This, debugstr_w(local_name), debugstr_w(namespace_uri)); + TRACE("%p, %s, %s.\n", iface, debugstr_w(local_name), debugstr_w(namespace_uri)); if (!local_name) return E_INVALIDARG; @@ -3067,7 +3065,7 @@ static HRESULT WINAPI xmlreader_MoveToElement(IXmlReader* iface) { xmlreader *This = impl_from_IXmlReader(iface); - TRACE("(%p)\n", This); + TRACE("%p.\n", iface); if (!This->attr_count) return S_FALSE; @@ -3101,7 +3099,7 @@ static HRESULT WINAPI xmlreader_GetQualifiedName(IXmlReader* iface, LPCWSTR *nam struct element *element; UINT length; - TRACE("(%p)->(%p %p)\n", This, name, len); + TRACE("%p, %p, %p.\n", iface, name, len); if (!len) len = &length; @@ -3170,7 +3168,7 @@ static HRESULT WINAPI xmlreader_GetNamespaceUri(IXmlReader* iface, const WCHAR * struct ns *ns; UINT length; - TRACE("(%p %p %p)\n", iface, uri, len); + TRACE("%p, %p, %p.\n", iface, uri, len); if (!len) len = &length; @@ -3224,7 +3222,7 @@ static HRESULT WINAPI xmlreader_GetLocalName(IXmlReader* iface, LPCWSTR *name, U struct element *element; UINT length; - TRACE("(%p)->(%p %p)\n", This, name, len); + TRACE("%p, %p, %p.\n", iface, name, len); if (!len) len = &length; @@ -3262,7 +3260,7 @@ static HRESULT WINAPI xmlreader_GetPrefix(IXmlReader* iface, const WCHAR **ret, XmlNodeType nodetype; UINT length; - TRACE("(%p)->(%p %p)\n", This, ret, len); + TRACE("%p, %p, %p.\n", iface, ret, len); if (!len) len = &length; @@ -3349,7 +3347,7 @@ static HRESULT WINAPI xmlreader_GetValue(IXmlReader* iface, const WCHAR **value, const strval *val = &reader->strvalues[StringValue_Value]; UINT off; - TRACE("(%p)->(%p %p)\n", reader, value, len); + TRACE("%p, %p, %p.\n", iface, value, len); *value = NULL; @@ -3383,7 +3381,7 @@ static HRESULT WINAPI xmlreader_ReadValueChunk(IXmlReader* iface, WCHAR *buffer, const strval *val; UINT len = 0; - TRACE("(%p)->(%p %u %p)\n", reader, buffer, chunk_size, read); + TRACE("%p, %p, %u, %p.\n", iface, buffer, chunk_size, read); val = reader_get_value(reader, FALSE); @@ -3408,20 +3406,22 @@ static HRESULT WINAPI xmlreader_GetBaseUri(IXmlReader* iface, LPCWSTR *baseUri, UINT *baseUri_length) { - FIXME("(%p %p %p): stub\n", iface, baseUri, baseUri_length); + FIXME("%p, %p, %p: stub\n", iface, baseUri, baseUri_length); return E_NOTIMPL; } static BOOL WINAPI xmlreader_IsDefault(IXmlReader* iface) { - FIXME("(%p): stub\n", iface); + FIXME("%p: stub\n", iface); return FALSE; } static BOOL WINAPI xmlreader_IsEmptyElement(IXmlReader* iface) { xmlreader *This = impl_from_IXmlReader(iface); - TRACE("(%p)\n", This); + + TRACE("%p.\n", iface); + /* Empty elements are not placed in stack, it's stored as a global reader flag that makes sense when current node is start tag of an element */ return (reader_get_nodetype(This) == XmlNodeType_Element) ? This->is_empty_element : FALSE; @@ -3432,7 +3432,7 @@ static HRESULT WINAPI xmlreader_GetLineNumber(IXmlReader* iface, UINT *line_numb xmlreader *This = impl_from_IXmlReader(iface); const struct element *element; - TRACE("(%p %p)\n", This, line_number); + TRACE("%p, %p.\n", iface, line_number); if (!line_number) return E_INVALIDARG; @@ -3464,7 +3464,7 @@ static HRESULT WINAPI xmlreader_GetLinePosition(IXmlReader* iface, UINT *line_po xmlreader *This = impl_from_IXmlReader(iface); const struct element *element; - TRACE("(%p %p)\n", This, line_position); + TRACE("%p, %p.\n", iface, line_position); if (!line_position) return E_INVALIDARG; @@ -3495,7 +3495,7 @@ static HRESULT WINAPI xmlreader_GetAttributeCount(IXmlReader* iface, UINT *count { xmlreader *This = impl_from_IXmlReader(iface); - TRACE("(%p)->(%p)\n", This, count); + TRACE("%p, %p.\n", iface, count); if (!count) return E_INVALIDARG; @@ -3506,7 +3506,9 @@ static HRESULT WINAPI xmlreader_GetAttributeCount(IXmlReader* iface, UINT *count static HRESULT WINAPI xmlreader_GetDepth(IXmlReader* iface, UINT *depth) { xmlreader *This = impl_from_IXmlReader(iface); - TRACE("(%p)->(%p)\n", This, depth); + + TRACE("%p, %p.\n", iface, depth); + *depth = This->depth; return S_OK; } @@ -3514,7 +3516,9 @@ static HRESULT WINAPI xmlreader_GetDepth(IXmlReader* iface, UINT *depth) static BOOL WINAPI xmlreader_IsEOF(IXmlReader* iface) { xmlreader *This = impl_from_IXmlReader(iface); - TRACE("(%p)\n", iface); + + TRACE("%p.\n", iface); + return This->state == XmlReadState_EndOfFile; } @@ -3551,9 +3555,7 @@ static const struct IXmlReaderVtbl xmlreader_vtbl = /** IXmlReaderInput **/ static HRESULT WINAPI xmlreaderinput_QueryInterface(IXmlReaderInput *iface, REFIID riid, void** ppvObject) { - xmlreaderinput *This = impl_from_IXmlReaderInput(iface); - - TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject); + TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), ppvObject); if (IsEqualGUID(riid, &IID_IXmlReaderInput) || IsEqualGUID(riid, &IID_IUnknown)) @@ -3614,7 +3616,7 @@ HRESULT WINAPI CreateXmlReader(REFIID riid, void **obj, IMalloc *imalloc) HRESULT hr; int i; - TRACE("(%s, %p, %p)\n", wine_dbgstr_guid(riid), obj, imalloc); + TRACE("%s, %p, %p.\n", wine_dbgstr_guid(riid), obj, imalloc); if (!(reader = m_alloc(imalloc, sizeof(*reader)))) return E_OUTOFMEMORY;
1
0
0
0
Zhiyi Zhang : win32u: Fix a memory leak.
by Alexandre Julliard
21 Nov '22
21 Nov '22
Module: wine Branch: master Commit: df012ba4eb939b3b3ed8a8a602338046a662c5c7 URL:
https://gitlab.winehq.org/wine/wine/-/commit/df012ba4eb939b3b3ed8a8a6023380…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Sun Nov 20 15:33:55 2022 +0800 win32u: Fix a memory leak. --- dlls/win32u/message.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 346ae8bede7..5d983ef566c 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -2777,6 +2777,8 @@ static BOOL broadcast_message( struct send_message_info *info, DWORD_PTR *res_pt break; } } + + free( list ); } if (res_ptr) *res_ptr = 1;
1
0
0
0
Alex Henrie : appwiz: Use standard C functions for memory allocation.
by Alexandre Julliard
21 Nov '22
21 Nov '22
Module: wine Branch: master Commit: d34d0c1001db5c3ccb22c05770be2d7457c21e45 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d34d0c1001db5c3ccb22c05770be2d…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Sun Nov 20 18:58:20 2022 -0700 appwiz: Use standard C functions for memory allocation. --- dlls/appwiz.cpl/addons.c | 56 ++++++++++++++++++++++++------------------------ dlls/appwiz.cpl/appwiz.h | 21 ++---------------- 2 files changed, 30 insertions(+), 47 deletions(-) diff --git a/dlls/appwiz.cpl/addons.c b/dlls/appwiz.cpl/addons.c index b815ffbb5cb..f7e36b8b99b 100644 --- a/dlls/appwiz.cpl/addons.c +++ b/dlls/appwiz.cpl/addons.c @@ -193,7 +193,7 @@ static enum install_res install_from_dos_file(const WCHAR *dir, const WCHAR *sub HRESULT hr; size += lstrlenW( subdir ) + lstrlenW( file_name ) + 2; - if (!(path = heap_alloc( size * sizeof(WCHAR) ))) return INSTALL_FAILED; + if (!(path = malloc( size * sizeof(WCHAR) ))) return INSTALL_FAILED; lstrcpyW( path, dir ); if (!wcsncmp( path, L"\\??\\", 4 )) path[1] = '\\'; /* change \??\ into \\?\ */ @@ -207,10 +207,10 @@ static enum install_res install_from_dos_file(const WCHAR *dir, const WCHAR *sub if (FAILED( hr )) { ERR( "Failed to canonicalize %s, hr %#lx\n", debugstr_w(path), hr ); - heap_free( path ); + free( path ); return INSTALL_NEXT; } - heap_free( path ); + free( path ); if (GetFileAttributesW( canonical_path ) == INVALID_FILE_ATTRIBUTES) { @@ -233,7 +233,7 @@ static enum install_res install_from_unix_file(const char *dir, const WCHAR *sub if (p_wine_get_dos_file_name && (dos_dir = p_wine_get_dos_file_name( dir ))) { ret = install_from_dos_file( dos_dir, subdir, file_name ); - heap_free( dos_dir ); + free( dos_dir ); } return ret; } @@ -264,24 +264,24 @@ static enum install_res install_from_registered_dir(void) if(!hkey) return INSTALL_NEXT; - package_dir = heap_alloc(size); + package_dir = malloc(size); res = RegGetValueA(hkey, NULL, addon->dir_config_key, RRF_RT_ANY, &type, (PBYTE)package_dir, &size); if(res == ERROR_MORE_DATA) { - package_dir = heap_realloc(package_dir, size); + package_dir = realloc(package_dir, size); res = RegGetValueA(hkey, NULL, addon->dir_config_key, RRF_RT_ANY, &type, (PBYTE)package_dir, &size); } RegCloseKey(hkey); if(res == ERROR_FILE_NOT_FOUND) { - heap_free(package_dir); + free(package_dir); return INSTALL_NEXT; } else if(res != ERROR_SUCCESS || (type != REG_SZ && type != REG_EXPAND_SZ)) { - heap_free(package_dir); + free(package_dir); return INSTALL_FAILED; } ret = install_from_unix_file(package_dir, L"", addon->file_name); - heap_free(package_dir); + free(package_dir); return ret; } @@ -293,7 +293,7 @@ static enum install_res install_from_default_dir(void) if ((package_dir = _wgetenv( L"WINEBUILDDIR" ))) { - dir_buf = heap_alloc( lstrlenW(package_dir) * sizeof(WCHAR) + sizeof(L"\\..\\") ); + dir_buf = malloc( wcslen(package_dir) * sizeof(WCHAR) + sizeof(L"\\..\\") ); lstrcpyW( dir_buf, package_dir ); lstrcatW( dir_buf, L"\\..\\" ); package_dir = dir_buf; @@ -303,7 +303,7 @@ static enum install_res install_from_default_dir(void) if (package_dir) { ret = install_from_dos_file(package_dir, addon->subdir_name, addon->file_name); - heap_free(dir_buf); + free(dir_buf); } if (ret == INSTALL_NEXT) @@ -329,7 +329,7 @@ static WCHAR *get_cache_file_name(BOOL ensure_exists) } else if ((home_dir = _wgetenv( L"WINEHOMEDIR" ))) { - if (!(cache_dir = heap_alloc( lstrlenW(home_dir) * sizeof(WCHAR) + sizeof(L"\\.cache") ))) return NULL; + if (!(cache_dir = malloc( wcslen(home_dir) * sizeof(WCHAR) + sizeof(L"\\.cache") ))) return NULL; lstrcpyW( cache_dir, home_dir ); lstrcatW( cache_dir, L"\\.cache" ); cache_dir[1] = '\\'; /* change \??\ into \\?\ */ @@ -339,24 +339,24 @@ static WCHAR *get_cache_file_name(BOOL ensure_exists) if (ensure_exists && !CreateDirectoryW( cache_dir, NULL ) && GetLastError() != ERROR_ALREADY_EXISTS) { WARN( "%s does not exist and could not be created (%lu)\n", debugstr_w(cache_dir), GetLastError() ); - heap_free( cache_dir ); + free( cache_dir ); return NULL; } size = lstrlenW( cache_dir ) + ARRAY_SIZE(L"\\wine") + lstrlenW( addon->file_name ) + 1; - if (!(ret = heap_alloc( size * sizeof(WCHAR) ))) + if (!(ret = malloc( size * sizeof(WCHAR) ))) { - heap_free( cache_dir ); + free( cache_dir ); return NULL; } lstrcpyW( ret, cache_dir ); lstrcatW( ret, L"\\wine" ); - heap_free( cache_dir ); + free( cache_dir ); if (ensure_exists && !CreateDirectoryW( ret, NULL ) && GetLastError() != ERROR_ALREADY_EXISTS) { WARN( "%s does not exist and could not be created (%lu)\n", debugstr_w(ret), GetLastError() ); - heap_free( ret ); + free( ret ); return NULL; } len = lstrlenW( ret ); @@ -379,12 +379,12 @@ static enum install_res install_from_cache(void) if(!sha_check(cache_file_name)) { WARN("could not validate checksum\n"); DeleteFileW(cache_file_name); - heap_free(cache_file_name); + free(cache_file_name); return INSTALL_NEXT; } res = install_file(cache_file_name); - heap_free(cache_file_name); + free(cache_file_name); return res; } @@ -485,7 +485,7 @@ static HRESULT WINAPI InstallCallback_OnStopBinding(IBindStatusCallback *iface, cache_file_name = get_cache_file_name(TRUE); if(cache_file_name) { CopyFileW(msi_file, cache_file_name, FALSE); - heap_free(cache_file_name); + free(cache_file_name); } }else { WCHAR message[256]; @@ -495,7 +495,7 @@ static HRESULT WINAPI InstallCallback_OnStopBinding(IBindStatusCallback *iface, } DeleteFileW(msi_file); - heap_free(msi_file); + free(msi_file); msi_file = NULL; EndDialog(install_dialog, 0); @@ -515,7 +515,7 @@ static HRESULT WINAPI InstallCallback_OnDataAvailable(IBindStatusCallback *iface DWORD dwSize, FORMATETC* pformatetc, STGMEDIUM* pstgmed) { if(!msi_file) { - msi_file = heap_strdupW(pstgmed->u.lpszFileName); + msi_file = wcsdup(pstgmed->u.lpszFileName); TRACE("got file name %s\n", debugstr_w(msi_file)); } @@ -622,15 +622,15 @@ static LPWSTR get_url(void) static const WCHAR httpW[] = {'h','t','t','p'}; - url = heap_alloc(size); + url = malloc(size); returned_size = size; hkey = open_config_key(); if (hkey) { - config_key = heap_strdupAtoW(addon->url_config_key); + config_key = strdupAtoW(addon->url_config_key); res = RegQueryValueExW(hkey, config_key, NULL, &type, (LPBYTE)url, &returned_size); - heap_free(config_key); + free(config_key); RegCloseKey(hkey); if(res == ERROR_SUCCESS && type == REG_SZ) goto found; } @@ -684,7 +684,7 @@ static void run_winebrowser(const WCHAR *url) lstrcpyW(app+len, L"\\winebrowser.exe"); len += ARRAY_SIZE(L"\\winebrowser.exe") - 1; - args = heap_alloc((len+1+url_len)*sizeof(WCHAR)); + args = malloc((len + 1 + url_len) * sizeof(WCHAR)); if(!args) return; @@ -697,7 +697,7 @@ static void run_winebrowser(const WCHAR *url) memset(&si, 0, sizeof(si)); si.cb = sizeof(si); ret = CreateProcessW(app, args, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &si, &pi); - heap_free(args); + free(args); if (ret) { CloseHandle(pi.hThread); CloseHandle(pi.hProcess); @@ -766,7 +766,7 @@ BOOL install_addon(addon_t addon_type) && (url = get_url())) DialogBoxW(hInst, addon->dialog_template, 0, installer_proc); - heap_free(url); + free(url); url = NULL; return TRUE; } diff --git a/dlls/appwiz.cpl/appwiz.h b/dlls/appwiz.cpl/appwiz.h index ac8b5427d98..c6562e78cba 100644 --- a/dlls/appwiz.cpl/appwiz.h +++ b/dlls/appwiz.cpl/appwiz.h @@ -16,7 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "wine/heap.h" #include "winnls.h" typedef enum { @@ -28,23 +27,7 @@ BOOL install_addon(addon_t) DECLSPEC_HIDDEN; extern HINSTANCE hInst DECLSPEC_HIDDEN; -static inline WCHAR *heap_strdupW(const WCHAR *str) -{ - WCHAR *ret; - - if(str) { - size_t size = lstrlenW(str)+1; - ret = heap_alloc(size*sizeof(WCHAR)); - if(ret) - memcpy(ret, str, size*sizeof(WCHAR)); - }else { - ret = NULL; - } - - return ret; -} - -static inline WCHAR *heap_strdupAtoW(const char *str) +static inline WCHAR *strdupAtoW(const char *str) { WCHAR *ret = NULL; @@ -52,7 +35,7 @@ static inline WCHAR *heap_strdupAtoW(const char *str) size_t len; len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0); - ret = heap_alloc(len*sizeof(WCHAR)); + ret = malloc(len * sizeof(WCHAR)); if(ret) MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len); }
1
0
0
0
Alex Henrie : oledb32: Handle memory allocation failure in rowpos_cp_Advise.
by Alexandre Julliard
21 Nov '22
21 Nov '22
Module: wine Branch: master Commit: 82c451596bae24b03ad036f7dfe0dcca9781e70c URL:
https://gitlab.winehq.org/wine/wine/-/commit/82c451596bae24b03ad036f7dfe0dc…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Sun Nov 20 19:29:16 2022 -0700 oledb32: Handle memory allocation failure in rowpos_cp_Advise. --- dlls/oledb32/rowpos.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/oledb32/rowpos.c b/dlls/oledb32/rowpos.c index bc42f33f851..128208a9da3 100644 --- a/dlls/oledb32/rowpos.c +++ b/dlls/oledb32/rowpos.c @@ -380,6 +380,7 @@ static HRESULT WINAPI rowpos_cp_Advise(IConnectionPoint *iface, IUnknown *unksin { rowpos_cp *This = impl_from_IConnectionPoint(iface); IRowPositionChange *sink; + IRowPositionChange **new_sinks; HRESULT hr; DWORD i; @@ -404,14 +405,19 @@ static HRESULT WINAPI rowpos_cp_Advise(IConnectionPoint *iface, IUnknown *unksin if (i == This->sinks_size) { + new_sinks = heap_realloc_zero(This->sinks, 2 * This->sinks_size * sizeof(*This->sinks)); + if (!new_sinks) + return E_OUTOFMEMORY; + This->sinks = new_sinks; This->sinks_size *= 2; - This->sinks = heap_realloc_zero(This->sinks, This->sinks_size*sizeof(*This->sinks)); } } else { + This->sinks = heap_alloc_zero(10 * sizeof(*This->sinks)); + if (!This->sinks) + return E_OUTOFMEMORY; This->sinks_size = 10; - This->sinks = heap_alloc_zero(This->sinks_size*sizeof(*This->sinks)); i = 0; }
1
0
0
0
← Newer
1
...
40
41
42
43
44
45
46
...
118
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
Results per page:
10
25
50
100
200