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 2023
----- 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
989 discussions
Start a n
N
ew thread
Alexandre Julliard : opengl32: Make the GL driver function table const.
by Alexandre Julliard
03 Nov '23
03 Nov '23
Module: wine Branch: master Commit: c48a3bd349ebead5f7e3a8aa1f30d6dfddfe697c URL:
https://gitlab.winehq.org/wine/wine/-/commit/c48a3bd349ebead5f7e3a8aa1f30d6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Nov 3 13:40:19 2023 +0100 opengl32: Make the GL driver function table const. --- dlls/opengl32/make_opengl | 2 +- dlls/opengl32/unix_private.h | 4 ++-- dlls/opengl32/unix_wgl.c | 14 +++++++------- dlls/win32u/dc.c | 2 +- include/wine/wgl_driver.h | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index b1161632f81..6ea8c2b016e 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -920,7 +920,7 @@ foreach (sort keys %norm_functions) } print HEADER "\n\n"; -print HEADER "extern struct opengl_funcs *__wine_get_wgl_driver( HDC hdc, UINT version );\n\n"; +print HEADER "extern const struct opengl_funcs *__wine_get_wgl_driver( HDC hdc, UINT version );\n\n"; print HEADER "#endif /* __WINE_WGL_DRIVER_H */\n"; close HEADER; diff --git a/dlls/opengl32/unix_private.h b/dlls/opengl32/unix_private.h index f2a9477f990..693c916ddaa 100644 --- a/dlls/opengl32/unix_private.h +++ b/dlls/opengl32/unix_private.h @@ -43,9 +43,9 @@ extern const int extension_registry_size DECLSPEC_HIDDEN; extern struct opengl_funcs null_opengl_funcs DECLSPEC_HIDDEN; -static inline struct opengl_funcs *get_dc_funcs( HDC hdc ) +static inline const struct opengl_funcs *get_dc_funcs( HDC hdc ) { - struct opengl_funcs *funcs = __wine_get_wgl_driver( hdc, WINE_WGL_DRIVER_VERSION ); + const struct opengl_funcs *funcs = __wine_get_wgl_driver( hdc, WINE_WGL_DRIVER_VERSION ); if (!funcs) RtlSetLastWin32Error( ERROR_INVALID_HANDLE ); else if (funcs == (void *)-1) funcs = &null_opengl_funcs; return funcs; diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 4cf12893541..f97e3147c15 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -77,7 +77,7 @@ struct opengl_context struct wgl_handle { UINT handle; - struct opengl_funcs *funcs; + const struct opengl_funcs *funcs; union { struct opengl_context *context; /* for HANDLE_CONTEXT */ @@ -117,7 +117,7 @@ static struct wgl_handle *get_handle_ptr( HANDLE handle, enum wgl_handle_type ty return NULL; } -static HANDLE alloc_handle( enum wgl_handle_type type, struct opengl_funcs *funcs, void *user_ptr ) +static HANDLE alloc_handle( enum wgl_handle_type type, const struct opengl_funcs *funcs, void *user_ptr ) { HANDLE handle = 0; struct wgl_handle *ptr = NULL; @@ -647,7 +647,7 @@ static HGLRC wrap_wglCreateContext( HDC hdc ) HGLRC ret = 0; struct wgl_context *drv_ctx; struct opengl_context *context; - struct opengl_funcs *funcs = get_dc_funcs( hdc ); + const struct opengl_funcs *funcs = get_dc_funcs( hdc ); if (!funcs) return 0; if (!(drv_ctx = funcs->wgl.p_wglCreateContext( hdc ))) return 0; @@ -679,7 +679,7 @@ static BOOL wrap_wglMakeCurrent( TEB *teb, HDC hdc, HGLRC hglrc ) teb->glReserved1[0] = hdc; teb->glReserved1[1] = hdc; teb->glCurrentRC = hglrc; - teb->glTable = ptr->funcs; + teb->glTable = (void *)ptr->funcs; } } else @@ -751,7 +751,7 @@ static HGLRC wrap_wglCreateContextAttribsARB( HDC hdc, HGLRC share, const int *a struct wgl_context *drv_ctx; struct wgl_handle *share_ptr = NULL; struct opengl_context *context; - struct opengl_funcs *funcs = get_dc_funcs( hdc ); + const struct opengl_funcs *funcs = get_dc_funcs( hdc ); if (!funcs) { @@ -796,7 +796,7 @@ static HPBUFFERARB wrap_wglCreatePbufferARB( HDC hdc, int format, int width, int { HPBUFFERARB ret; struct wgl_pbuffer *pbuffer; - struct opengl_funcs *funcs = get_dc_funcs( hdc ); + const struct opengl_funcs *funcs = get_dc_funcs( hdc ); if (!funcs || !funcs->ext.p_wglCreatePbufferARB) return 0; if (!(pbuffer = funcs->ext.p_wglCreatePbufferARB( hdc, format, width, height, attribs ))) return 0; @@ -842,7 +842,7 @@ static BOOL wrap_wglMakeContextCurrentARB( TEB *teb, HDC draw_hdc, HDC read_hdc, teb->glReserved1[0] = draw_hdc; teb->glReserved1[1] = read_hdc; teb->glCurrentRC = hglrc; - teb->glTable = ptr->funcs; + teb->glTable = (void *)ptr->funcs; } } else diff --git a/dlls/win32u/dc.c b/dlls/win32u/dc.c index 0ff624068cb..2b8a56de5bd 100644 --- a/dlls/win32u/dc.c +++ b/dlls/win32u/dc.c @@ -1490,7 +1490,7 @@ BOOL WINAPI __wine_get_icm_profile( HDC hdc, BOOL allow_default, DWORD *size, WC /*********************************************************************** * __wine_get_wgl_driver (win32u.@) */ -struct opengl_funcs *__wine_get_wgl_driver( HDC hdc, UINT version ) +const struct opengl_funcs *__wine_get_wgl_driver( HDC hdc, UINT version ) { BOOL is_display, is_memdc; DC *dc; diff --git a/include/wine/wgl_driver.h b/include/wine/wgl_driver.h index ed11d8caa0e..daaddf9567d 100644 --- a/include/wine/wgl_driver.h +++ b/include/wine/wgl_driver.h @@ -3405,6 +3405,6 @@ struct opengl_funcs USE_GL_FUNC(glVertexPointer) \ USE_GL_FUNC(glViewport) -extern struct opengl_funcs *__wine_get_wgl_driver( HDC hdc, UINT version ); +extern const struct opengl_funcs *__wine_get_wgl_driver( HDC hdc, UINT version ); #endif /* __WINE_WGL_DRIVER_H */
1
0
0
0
Alex Henrie : include: Annotate MIDL_user_allocate with __WINE_(ALLOC_SIZE|DEALLOC|MALLOC).
by Alexandre Julliard
03 Nov '23
03 Nov '23
Module: wine Branch: master Commit: f27ac1bb777aa74c82d91203a06591299e6fef3d URL:
https://gitlab.winehq.org/wine/wine/-/commit/f27ac1bb777aa74c82d91203a06591…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Thu Nov 2 21:50:55 2023 -0600 include: Annotate MIDL_user_allocate with __WINE_(ALLOC_SIZE|DEALLOC|MALLOC). --- include/rpcndr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rpcndr.h b/include/rpcndr.h index 498aa4ddd40..2d836726a15 100644 --- a/include/rpcndr.h +++ b/include/rpcndr.h @@ -82,8 +82,8 @@ typedef unsigned char boolean; #define midl_user_free MIDL_user_free #define midl_user_allocate MIDL_user_allocate -void * __RPC_USER MIDL_user_allocate(SIZE_T); void __RPC_USER MIDL_user_free(void *); +void * __RPC_USER MIDL_user_allocate(SIZE_T) __WINE_ALLOC_SIZE(1) __WINE_DEALLOC(MIDL_user_free) __WINE_MALLOC; #define NdrFcShort(s) (unsigned char)(s & 0xff), (unsigned char)(s >> 8) #define NdrFcLong(s) (unsigned char)(s & 0xff), (unsigned char)((s & 0x0000ff00) >> 8), \
1
0
0
0
Alex Henrie : gdiplus/tests: Use CRT allocation functions.
by Alexandre Julliard
03 Nov '23
03 Nov '23
Module: wine Branch: master Commit: c2afbc8c0414db624b1a955a3eb063a8bf62f8d6 URL:
https://gitlab.winehq.org/wine/wine/-/commit/c2afbc8c0414db624b1a955a3eb063…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Wed Nov 1 22:55:19 2023 -0600 gdiplus/tests: Use CRT allocation functions. --- dlls/gdiplus/tests/graphics.c | 12 ++++++------ dlls/gdiplus/tests/graphicspath.c | 8 ++++---- dlls/gdiplus/tests/image.c | 20 ++++++++++---------- dlls/gdiplus/tests/metafile.c | 8 ++++---- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index 724be3f1030..de174257994 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -176,7 +176,7 @@ typedef struct node{ /* Linked list prepend function. */ static void log_state(GraphicsState data, node ** log) { - node * new_entry = HeapAlloc(GetProcessHeap(), 0, sizeof(node)); + node * new_entry = malloc(sizeof(node)); new_entry->data = data; new_entry->next = *log; @@ -209,7 +209,7 @@ static void check_no_duplicates(node * log) temp = orig; do{ temp2 = temp->next; - HeapFree(GetProcessHeap(), 0, temp); + free(temp); temp = temp2; }while(temp); @@ -7198,19 +7198,19 @@ static HDC create_printer_dc(void) if (!pOpenPrinterA(buffer, &hprn, NULL)) goto done; pGetPrinterA(hprn, 2, NULL, 0, &len); - pbuf = HeapAlloc(GetProcessHeap(), 0, len); + pbuf = malloc(len); if (!pGetPrinterA(hprn, 2, (LPBYTE)pbuf, len, &len)) goto done; pGetPrinterDriverA(hprn, NULL, 3, NULL, 0, &len); - dbuf = HeapAlloc(GetProcessHeap(), 0, len); + dbuf = malloc(len); if (!pGetPrinterDriverA(hprn, NULL, 3, (LPBYTE)dbuf, len, &len)) goto done; hdc = CreateDCA(dbuf->pDriverPath, pbuf->pPrinterName, pbuf->pPortName, pbuf->pDevMode); trace("hdc %p for driver '%s' printer '%s' port '%s'\n", hdc, dbuf->pDriverPath, pbuf->pPrinterName, pbuf->pPortName); done: - HeapFree(GetProcessHeap(), 0, dbuf); - HeapFree(GetProcessHeap(), 0, pbuf); + free(dbuf); + free(pbuf); if (hprn) pClosePrinter(hprn); if (winspool) FreeLibrary(winspool); return hdc; diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c index 823e1cf38ed..f6e0264b786 100644 --- a/dlls/gdiplus/tests/graphicspath.c +++ b/dlls/gdiplus/tests/graphicspath.c @@ -94,8 +94,8 @@ static void _ok_path_fudge(GpPath* path, const path_test_t *expected, INT expect ok_(__FILE__,line)(size == expected_size, "Path size %d does not match expected size %d\n", size, expected_size); - points = HeapAlloc(GetProcessHeap(), 0, size * sizeof(GpPointF)); - types = HeapAlloc(GetProcessHeap(), 0, size); + points = malloc(size * sizeof(GpPointF)); + types = malloc(size); if(GdipGetPathPoints(path, points, size) != Ok || GdipGetPathTypes(path, types, size) != Ok){ skip("Cannot perform path comparisons due to failure to retrieve path.\n"); @@ -125,8 +125,8 @@ static void _ok_path_fudge(GpPath* path, const path_test_t *expected, INT expect } end: - HeapFree(GetProcessHeap(), 0, types); - HeapFree(GetProcessHeap(), 0, points); + free(types); + free(points); } static void test_constructor_destructor(void) diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 4d93e28d951..8fc9aa78225 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -3797,7 +3797,7 @@ static void check_properties_id_list(GpImage *image, const struct property_test_ if (count_broken != ~0 && count_broken == prop_count) td = td_broken; - prop_id = HeapAlloc(GetProcessHeap(), 0, prop_count * sizeof(*prop_id)); + prop_id = malloc(prop_count * sizeof(*prop_id)); status = GdipGetPropertyIdList(image, prop_count, prop_id); expect(Ok, status); @@ -3821,7 +3821,7 @@ static void check_properties_id_list(GpImage *image, const struct property_test_ if (prop_size) *prop_size += size; - prop_item = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); + prop_item = calloc(1, size); status = GdipGetPropertyItem(image, prop_id[i], size, prop_item); size -= sizeof(*prop_item); expect(Ok, status); @@ -3845,12 +3845,12 @@ static void check_properties_id_list(GpImage *image, const struct property_test_ trace("(id %#lx) %s\n", prop_item->id, dbgstr_hexdata(prop_item->value, prop_item->length)); } - HeapFree(GetProcessHeap(), 0, prop_item); + free(prop_item); winetest_pop_context(); } - HeapFree(GetProcessHeap(), 0, prop_id); + free(prop_id); } static void check_properties_get_all(GpImage *image, const struct property_test_data *td, UINT count, @@ -3872,7 +3872,7 @@ static void check_properties_get_all(GpImage *image, const struct property_test_ if (count_broken != ~0 && count_broken == total_count) td = td_broken; - prop_item = HeapAlloc(GetProcessHeap(), 0, total_size); + prop_item = malloc(total_size); status = GdipGetAllPropertyItems(image, total_size, total_count, prop_item); expect(Ok, status); @@ -3902,7 +3902,7 @@ static void check_properties_get_all(GpImage *image, const struct property_test_ winetest_pop_context(); } - HeapFree(GetProcessHeap(), 0, prop_item); + free(prop_item); } static void test_image_properties(void) @@ -4072,7 +4072,7 @@ static void test_image_properties(void) expect(InvalidParameter, status); status = GdipGetAllPropertyItems(image, prop_size, prop_count, NULL); expect(InvalidParameter, status); - prop_item = HeapAlloc(GetProcessHeap(), 0, prop_size); + prop_item = malloc(prop_size); expected = (image_type == ImageTypeMetafile) ? NotImplemented : InvalidParameter; if (prop_count != 1) { @@ -4091,7 +4091,7 @@ static void test_image_properties(void) status = GdipGetAllPropertyItems(image, prop_size, prop_count, prop_item); ok(status == expected || broken(status == Ok && prop_count == 0), /* XP */ "Expected %d, got %d\n", expected, status); - HeapFree(GetProcessHeap(), 0, prop_item); + free(prop_item); GdipDisposeImage(image); @@ -6132,7 +6132,7 @@ static BYTE *init_bitmap(UINT *width, UINT *height, UINT *stride) *stride = (*width * 3 + 3) & ~3; trace("width %d, height %d, stride %d\n", *width, *height, *stride); - src = HeapAlloc(GetProcessHeap(), 0, *stride * *height); + src = malloc(*stride * *height); scale = 256 / *width; if (!scale) scale = 1; @@ -6263,7 +6263,7 @@ static void test_GdipInitializePalette(void) GdipFree(palette); GdipDisposeImage((GpImage *)bitmap); - HeapFree(GetProcessHeap(), 0, data); + free(data); } static void test_graphics_clear(void) diff --git a/dlls/gdiplus/tests/metafile.c b/dlls/gdiplus/tests/metafile.c index 0b7c8ad9827..f3ab27c0bd2 100644 --- a/dlls/gdiplus/tests/metafile.c +++ b/dlls/gdiplus/tests/metafile.c @@ -3502,19 +3502,19 @@ static HDC create_printer_dc(void) if (!pOpenPrinterA(buffer, &hprn, NULL)) goto done; pGetPrinterA(hprn, 2, NULL, 0, &len); - pbuf = HeapAlloc(GetProcessHeap(), 0, len); + pbuf = malloc(len); if (!pGetPrinterA(hprn, 2, (LPBYTE)pbuf, len, &len)) goto done; pGetPrinterDriverA(hprn, NULL, 3, NULL, 0, &len); - dbuf = HeapAlloc(GetProcessHeap(), 0, len); + dbuf = malloc(len); if (!pGetPrinterDriverA(hprn, NULL, 3, (LPBYTE)dbuf, len, &len)) goto done; hdc = CreateDCA(dbuf->pDriverPath, pbuf->pPrinterName, pbuf->pPortName, pbuf->pDevMode); trace("hdc %p for driver '%s' printer '%s' port '%s'\n", hdc, dbuf->pDriverPath, pbuf->pPrinterName, pbuf->pPortName); done: - HeapFree(GetProcessHeap(), 0, dbuf); - HeapFree(GetProcessHeap(), 0, pbuf); + free(dbuf); + free(pbuf); if (hprn) pClosePrinter(hprn); if (winspool) FreeLibrary(winspool); return hdc;
1
0
0
0
Alex Henrie : wtsapi32: Use CRT allocation functions.
by Alexandre Julliard
03 Nov '23
03 Nov '23
Module: wine Branch: master Commit: 48801b6dd7d5a5b5c7d8f4c371bc285a686b6d64 URL:
https://gitlab.winehq.org/wine/wine/-/commit/48801b6dd7d5a5b5c7d8f4c371bc28…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Thu Nov 2 22:24:01 2023 -0600 wtsapi32: Use CRT allocation functions. --- dlls/wtsapi32/wtsapi32.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/dlls/wtsapi32/wtsapi32.c b/dlls/wtsapi32/wtsapi32.c index f4072e7090b..785082d12a3 100644 --- a/dlls/wtsapi32/wtsapi32.c +++ b/dlls/wtsapi32/wtsapi32.c @@ -26,7 +26,6 @@ #include "lmcons.h" #include "wtsapi32.h" #include "wine/debug.h" -#include "wine/heap.h" WINE_DEFAULT_DEBUG_CHANNEL(wtsapi); @@ -149,7 +148,7 @@ BOOL WINAPI WTSEnumerateProcessesExW(HANDLE server, DWORD *level, DWORD session_ nt_process = (SYSTEM_PROCESS_INFORMATION *)((char *)nt_process + nt_process->NextEntryOffset); } - if (!(info = heap_alloc(size))) + if (!(info = malloc(size))) { free(nt_info); SetLastError(ERROR_OUTOFMEMORY); @@ -315,7 +314,7 @@ BOOL WINAPI WTSEnumerateSessionsA(HANDLE server, DWORD reserved, DWORD version, size += sizeof(**session_info) + len; } - if (!(*session_info = heap_alloc(size))) + if (!(*session_info = malloc(size))) { WTSFreeMemory(infoW); SetLastError(ERROR_OUTOFMEMORY); @@ -355,7 +354,7 @@ BOOL WINAPI WTSEnumerateSessionsW(HANDLE server, DWORD reserved, DWORD version, if (!session_info || !count) return FALSE; - if (!(*session_info = heap_alloc(sizeof(**session_info) + sizeof(session_name)))) + if (!(*session_info = malloc(sizeof(**session_info) + sizeof(session_name)))) { SetLastError(ERROR_OUTOFMEMORY); return FALSE; @@ -378,7 +377,7 @@ BOOL WINAPI WTSEnumerateSessionsW(HANDLE server, DWORD reserved, DWORD version, */ void WINAPI WTSFreeMemory(PVOID pMemory) { - heap_free(pMemory); + free(pMemory); } /************************************************************ @@ -387,7 +386,7 @@ void WINAPI WTSFreeMemory(PVOID pMemory) BOOL WINAPI WTSFreeMemoryExA(WTS_TYPE_CLASS type, void *ptr, ULONG nmemb) { TRACE("%d %p %ld\n", type, ptr, nmemb); - heap_free(ptr); + free(ptr); return TRUE; } @@ -397,7 +396,7 @@ BOOL WINAPI WTSFreeMemoryExA(WTS_TYPE_CLASS type, void *ptr, ULONG nmemb) BOOL WINAPI WTSFreeMemoryExW(WTS_TYPE_CLASS type, void *ptr, ULONG nmemb) { TRACE("%d %p %ld\n", type, ptr, nmemb); - heap_free(ptr); + free(ptr); return TRUE; } @@ -481,7 +480,7 @@ BOOL WINAPI WTSQuerySessionInformationA(HANDLE server, DWORD session_id, WTS_INF return FALSE; } - if (!(*buffer = heap_alloc(*count))) + if (!(*buffer = malloc(*count))) { WTSFreeMemory(bufferW); return FALSE; @@ -490,7 +489,7 @@ BOOL WINAPI WTSQuerySessionInformationA(HANDLE server, DWORD session_id, WTS_INF if (!(*count = WideCharToMultiByte(CP_ACP, 0, bufferW, -1, *buffer, *count, NULL, NULL))) { WTSFreeMemory(bufferW); - heap_free(*buffer); + free(*buffer); return FALSE; } @@ -515,7 +514,7 @@ BOOL WINAPI WTSQuerySessionInformationW(HANDLE server, DWORD session_id, WTS_INF { WTS_CONNECTSTATE_CLASS *state; - if (!(state = heap_alloc(sizeof(*state)))) return FALSE; + if (!(state = malloc(sizeof(*state)))) return FALSE; *state = WTSActive; *buffer = (WCHAR *)state; *count = sizeof(*state); @@ -526,7 +525,7 @@ BOOL WINAPI WTSQuerySessionInformationW(HANDLE server, DWORD session_id, WTS_INF { USHORT *protocol; - if (!(protocol = heap_alloc(sizeof(*protocol)))) return FALSE; + if (!(protocol = malloc(sizeof(*protocol)))) return FALSE; FIXME("returning 0 protocol type\n"); *protocol = 0; *buffer = (WCHAR *)protocol; @@ -539,7 +538,7 @@ BOOL WINAPI WTSQuerySessionInformationW(HANDLE server, DWORD session_id, WTS_INF DWORD size = UNLEN + 1; WCHAR *username; - if (!(username = heap_alloc(size * sizeof(WCHAR)))) return FALSE; + if (!(username = malloc(size * sizeof(WCHAR)))) return FALSE; GetUserNameW(username, &size); *buffer = username; *count = size * sizeof(WCHAR); @@ -551,7 +550,7 @@ BOOL WINAPI WTSQuerySessionInformationW(HANDLE server, DWORD session_id, WTS_INF DWORD size = MAX_COMPUTERNAME_LENGTH + 1; WCHAR *computername; - if (!(computername = heap_alloc(size * sizeof(WCHAR)))) return FALSE; + if (!(computername = malloc(size * sizeof(WCHAR)))) return FALSE; GetComputerNameW(computername, &size); *buffer = computername; /* GetComputerNameW() return size doesn't include terminator */
1
0
0
0
Alex Henrie : netio: Use CRT allocation functions.
by Alexandre Julliard
03 Nov '23
03 Nov '23
Module: wine Branch: master Commit: b1d29765660b5cf7784031d31a84d74fde2f83b9 URL:
https://gitlab.winehq.org/wine/wine/-/commit/b1d29765660b5cf7784031d31a84d7…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Thu Nov 2 22:17:16 2023 -0600 netio: Use CRT allocation functions. --- dlls/netio.sys/netio.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/dlls/netio.sys/netio.c b/dlls/netio.sys/netio.c index 05b5d6d2a69..46c9541536c 100644 --- a/dlls/netio.sys/netio.c +++ b/dlls/netio.sys/netio.c @@ -31,8 +31,6 @@ #include "winsock2.h" #include "ws2tcpip.h" -#include "wine/heap.h" - WINE_DEFAULT_DEBUG_CHANNEL(netio); struct _WSK_CLIENT @@ -270,7 +268,7 @@ static NTSTATUS WINAPI wsk_close_socket(WSK_SOCKET *socket, IRP *irp) unlock_socket(s); DeleteCriticalSection(&s->cs_socket); - heap_free(socket); + free(socket); irp->IoStatus.Information = 0; dispatch_irp(irp, status); @@ -313,7 +311,7 @@ static void create_accept_socket(struct wsk_socket_internal *socket, struct wsk_ SOCKADDR *local_address, *remote_address; struct wsk_socket_internal *accept_socket; - if (!(accept_socket = heap_alloc_zero(sizeof(*accept_socket)))) + if (!(accept_socket = calloc(1, sizeof(*accept_socket)))) { ERR("No memory.\n"); dispatch_pending_io(io, STATUS_NO_MEMORY, 0); @@ -761,7 +759,7 @@ static NTSTATUS WINAPI wsk_socket(WSK_CLIENT *client, ADDRESS_FAMILY address_fam goto done; } - if (!(socket = heap_alloc_zero(sizeof(*socket)))) + if (!(socket = calloc(1, sizeof(*socket)))) { status = STATUS_NO_MEMORY; closesocket(s); @@ -789,7 +787,7 @@ static NTSTATUS WINAPI wsk_socket(WSK_CLIENT *client, ADDRESS_FAMILY address_fam default: FIXME("Flags %#lx not implemented.\n", flags); closesocket(s); - heap_free(socket); + free(socket); status = STATUS_NOT_IMPLEMENTED; goto done; } @@ -855,7 +853,7 @@ static void WINAPI get_address_info_callback(TP_CALLBACK_INSTANCE *instance, voi context->irp->IoStatus.Information = 0; dispatch_irp(context->irp, sock_error_to_ntstatus(ret)); - heap_free(context); + free(context); } static NTSTATUS WINAPI wsk_get_address_info(WSK_CLIENT *client, UNICODE_STRING *node_name, @@ -873,7 +871,7 @@ static NTSTATUS WINAPI wsk_get_address_info(WSK_CLIENT *client, UNICODE_STRING * if (!irp) return STATUS_INVALID_PARAMETER; - if (!(context = heap_alloc(sizeof(*context)))) + if (!(context = malloc(sizeof(*context)))) { ERR("No memory.\n"); status = STATUS_NO_MEMORY; @@ -894,7 +892,7 @@ static NTSTATUS WINAPI wsk_get_address_info(WSK_CLIENT *client, UNICODE_STRING * ERR("Could not submit thread pool callback.\n"); status = STATUS_UNSUCCESSFUL; dispatch_irp(irp, status); - heap_free(context); + free(context); return status; } TRACE("Submitted threadpool callback, context %p.\n", context); @@ -959,7 +957,7 @@ NTSTATUS WINAPI WskRegister(WSK_CLIENT_NPI *wsk_client_npi, WSK_REGISTRATION *ws TRACE("wsk_client_npi %p, wsk_registration %p.\n", wsk_client_npi, wsk_registration); - if (!(client = heap_alloc(sizeof(*client)))) + if (!(client = malloc(sizeof(*client)))) { ERR("No memory.\n"); return STATUS_NO_MEMORY; @@ -979,7 +977,7 @@ void WINAPI WskDeregister(WSK_REGISTRATION *wsk_registration) { TRACE("wsk_registration %p.\n", wsk_registration); - heap_free(wsk_registration->ReservedRegistrationContext); + free(wsk_registration->ReservedRegistrationContext); } static void WINAPI driver_unload(DRIVER_OBJECT *driver)
1
0
0
0
Alex Henrie : msvfw32/tests: Use CRT allocation functions.
by Alexandre Julliard
03 Nov '23
03 Nov '23
Module: wine Branch: master Commit: 670d6391c41242aa71fc25e1916add06a05f6b97 URL:
https://gitlab.winehq.org/wine/wine/-/commit/670d6391c41242aa71fc25e1916add…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Thu Nov 2 22:07:35 2023 -0600 msvfw32/tests: Use CRT allocation functions. --- dlls/msvfw32/tests/drawdib.c | 8 ++++---- dlls/msvfw32/tests/mciwnd.c | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/dlls/msvfw32/tests/drawdib.c b/dlls/msvfw32/tests/drawdib.c index 92e60df264f..dc50429b40d 100644 --- a/dlls/msvfw32/tests/drawdib.c +++ b/dlls/msvfw32/tests/drawdib.c @@ -63,7 +63,7 @@ static char *hash_dib(const BITMAPINFO *bmi, const void *bits) CryptGetHashParam(hash, HP_HASHVAL, hash_buf, &hash_size, 0); CryptDestroyHash(hash); - buf = HeapAlloc(GetProcessHeap(), 0, hash_size * 2 + 1); + buf = malloc(hash_size * 2 + 1); for(i = 0; i < hash_size; i++) { @@ -131,7 +131,7 @@ static void test_DrawDib_sizeimage(void) init_bmi(&src_info, WIDTH, HEIGHT, 0); src_dib_size = get_dib_size(&src_info); - src_bits = HeapAlloc(GetProcessHeap(), 0, src_dib_size); + src_bits = malloc(src_dib_size); ok(src_bits != NULL, "Can't allocate memory\n"); memset(src_bits, 0x88, src_dib_size); @@ -160,13 +160,13 @@ static void test_DrawDib_sizeimage(void) ok(strcmp(hash, test_data[i].hash) == 0, "[%u] got %s, expected %s\n", i, hash, test_data[i].hash); - HeapFree(GetProcessHeap(), 0, hash); + free(hash); } r = DrawDibClose(hdd); ok(r, "DrawDibClose failed\n"); - HeapFree(GetProcessHeap(), 0, src_bits); + free(src_bits); DeleteDC(hdc); } diff --git a/dlls/msvfw32/tests/mciwnd.c b/dlls/msvfw32/tests/mciwnd.c index 8bf4c103a6c..af368cfcb19 100644 --- a/dlls/msvfw32/tests/mciwnd.c +++ b/dlls/msvfw32/tests/mciwnd.c @@ -23,7 +23,6 @@ #include <windows.h> #include <vfw.h> -#include "wine/heap.h" #include "wine/test.h" static const DWORD file_header[] = /* file_header */ @@ -136,7 +135,7 @@ static BOOL create_avi_file(char *fname) if (hFile == INVALID_HANDLE_VALUE) return FALSE; buffer_length = padding[1]; - buffer = heap_alloc_zero(buffer_length); + buffer = calloc(1, buffer_length); WriteFile(hFile, file_header, sizeof(file_header), &written, NULL); WriteFile(hFile, &main_avi_header, sizeof(MainAVIHeader), &written, NULL); @@ -147,7 +146,7 @@ static BOOL create_avi_file(char *fname) WriteFile(hFile, buffer, buffer_length, &written, NULL); WriteFile(hFile, data, sizeof(data), &written, NULL); - heap_free(buffer); + free(buffer); CloseHandle(hFile); return ret;
1
0
0
0
Alex Henrie : mstask: Use CRT allocation functions.
by Alexandre Julliard
03 Nov '23
03 Nov '23
Module: wine Branch: master Commit: abbc88f4a194ae773567be8ab3e6b4be8813e117 URL:
https://gitlab.winehq.org/wine/wine/-/commit/abbc88f4a194ae773567be8ab3e6b4…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Thu Nov 2 21:47:27 2023 -0600 mstask: Use CRT allocation functions. --- dlls/mstask/mstask_main.c | 4 ++-- dlls/mstask/mstask_private.h | 2 -- dlls/mstask/task_scheduler.c | 8 ++++---- dlls/mstask/task_trigger.c | 4 ++-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/dlls/mstask/mstask_main.c b/dlls/mstask/mstask_main.c index 481c26e9c2e..ab854f0a2b3 100644 --- a/dlls/mstask/mstask_main.c +++ b/dlls/mstask/mstask_main.c @@ -74,12 +74,12 @@ DWORD WINAPI NetrJobGetInfo_wrapper(ATSVC_HANDLE server_name, DWORD jobid, LPAT_ DECLSPEC_HIDDEN void __RPC_FAR *__RPC_USER MIDL_user_allocate(SIZE_T n) { - return HeapAlloc(GetProcessHeap(), 0, n); + return malloc(n); } DECLSPEC_HIDDEN void __RPC_USER MIDL_user_free(void __RPC_FAR *p) { - HeapFree(GetProcessHeap(), 0, p); + free(p); } DECLSPEC_HIDDEN handle_t __RPC_USER ATSVC_HANDLE_bind(ATSVC_HANDLE str) diff --git a/dlls/mstask/mstask_private.h b/dlls/mstask/mstask_private.h index 326cd4743bd..34d34d65f61 100644 --- a/dlls/mstask/mstask_private.h +++ b/dlls/mstask/mstask_private.h @@ -19,8 +19,6 @@ #ifndef __MSTASK_PRIVATE_H__ #define __MSTASK_PRIVATE_H__ -#include "wine/heap.h" - extern LONG dll_ref DECLSPEC_HIDDEN; typedef struct ClassFactoryImpl ClassFactoryImpl; diff --git a/dlls/mstask/task_scheduler.c b/dlls/mstask/task_scheduler.c index d8ccee37f59..4e4953654f3 100644 --- a/dlls/mstask/task_scheduler.c +++ b/dlls/mstask/task_scheduler.c @@ -60,7 +60,7 @@ static void TaskSchedulerDestructor(TaskSchedulerImpl *This) { TRACE("%p\n", This); ITaskService_Release(This->service); - heap_free(This); + free(This); InterlockedDecrement(&dll_ref); } @@ -100,7 +100,7 @@ static ULONG WINAPI EnumWorkItems_Release(IEnumWorkItems *iface) { if (This->handle != INVALID_HANDLE_VALUE) FindClose(This->handle); - heap_free(This); + free(This); InterlockedDecrement(&dll_ref); } @@ -259,7 +259,7 @@ static HRESULT create_task_enum(IEnumWorkItems **ret) *ret = NULL; - tasks = heap_alloc(sizeof(*tasks)); + tasks = malloc(sizeof(*tasks)); if (!tasks) return E_OUTOFMEMORY; @@ -523,7 +523,7 @@ HRESULT TaskSchedulerConstructor(LPVOID *ppObj) return hr; } - This = heap_alloc(sizeof(*This)); + This = malloc(sizeof(*This)); if (!This) { ITaskService_Release(service); diff --git a/dlls/mstask/task_trigger.c b/dlls/mstask/task_trigger.c index e3f190a315a..6cf470642bb 100644 --- a/dlls/mstask/task_trigger.c +++ b/dlls/mstask/task_trigger.c @@ -87,7 +87,7 @@ static ULONG WINAPI MSTASK_ITaskTrigger_Release( if (ref == 0) { ITask_Release(This->parent_task); - heap_free(This); + free(This); InterlockedDecrement(&dll_ref); } return ref; @@ -139,7 +139,7 @@ HRESULT TaskTriggerConstructor(ITask *task, WORD idx, ITaskTrigger **trigger) TRACE("(%p, %u, %p)\n", task, idx, trigger); - This = heap_alloc(sizeof(*This)); + This = malloc(sizeof(*This)); if (!This) return E_OUTOFMEMORY;
1
0
0
0
Alex Henrie : mspatcha: Use CRT allocation functions.
by Alexandre Julliard
03 Nov '23
03 Nov '23
Module: wine Branch: master Commit: 472ef2881a8f5910a1fd2aef501a7f300f605fb8 URL:
https://gitlab.winehq.org/wine/wine/-/commit/472ef2881a8f5910a1fd2aef501a7f…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Thu Nov 2 21:44:27 2023 -0600 mspatcha: Use CRT allocation functions. --- dlls/mspatcha/lzxd_dec.c | 5 ++--- dlls/mspatcha/mspatcha_main.c | 14 +++++++------- dlls/mspatcha/pa19.c | 10 ++-------- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/dlls/mspatcha/lzxd_dec.c b/dlls/mspatcha/lzxd_dec.c index fe04723b3a7..71c70bdf847 100644 --- a/dlls/mspatcha/lzxd_dec.c +++ b/dlls/mspatcha/lzxd_dec.c @@ -25,7 +25,6 @@ #include <assert.h> #include "windef.h" -#include "wine/heap.h" #include "wine/debug.h" #include "patchapi.h" @@ -683,7 +682,7 @@ DWORD decode_lzxd_stream(const BYTE *src, const size_t input_size, if (progress_fn != NULL && !progress_fn(progress_ctx, 0, (ULONG)output_size)) return ERROR_CANCELLED; - dec = heap_alloc(sizeof(*dec)); + dec = malloc(sizeof(*dec)); if (dec == NULL) return ERROR_OUTOFMEMORY; @@ -765,7 +764,7 @@ DWORD decode_lzxd_stream(const BYTE *src, const size_t input_size, reverse_e8_transform(dst + predef_size, output_size, e8_file_size); free_dec: - heap_free(dec); + free(dec); return err; } diff --git a/dlls/mspatcha/mspatcha_main.c b/dlls/mspatcha/mspatcha_main.c index 1f6653da161..d8582566e9b 100644 --- a/dlls/mspatcha/mspatcha_main.c +++ b/dlls/mspatcha/mspatcha_main.c @@ -48,7 +48,7 @@ static WCHAR *strdupAW(const char *src) if (src) { int len = MultiByteToWideChar(CP_ACP, 0, src, -1, NULL, 0); - if ((dst = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) + if ((dst = malloc(len * sizeof(WCHAR)))) MultiByteToWideChar(CP_ACP, 0, src, -1, dst, len); } return dst; @@ -65,12 +65,12 @@ BOOL WINAPI TestApplyPatchToFileA(LPCSTR patch_file, LPCSTR old_file, ULONG appl if (!(patch_fileW = strdupAW(patch_file))) return FALSE; if (old_file && !(old_fileW = strdupAW(old_file))) { - HeapFree(GetProcessHeap(), 0, patch_fileW); + free(patch_fileW); return FALSE; } ret = apply_patch_to_file(patch_fileW, old_fileW, NULL, apply_flags, NULL, NULL, TRUE); - HeapFree(GetProcessHeap(), 0, patch_fileW); - HeapFree(GetProcessHeap(), 0, old_fileW); + free(patch_fileW); + free(old_fileW); return ret; } @@ -123,10 +123,10 @@ BOOL WINAPI ApplyPatchToFileExA(LPCSTR patch_file, LPCSTR old_file, LPCSTR new_f ret = apply_patch_to_file(patch_fileW, old_fileW, new_fileW, apply_flags, progress_fn, progress_ctx, FALSE); - HeapFree(GetProcessHeap(), 0, new_fileW); + free(new_fileW); free_wstrs: - HeapFree(GetProcessHeap(), 0, patch_fileW); - HeapFree(GetProcessHeap(), 0, old_fileW); + free(patch_fileW); + free(old_fileW); return ret; } diff --git a/dlls/mspatcha/pa19.c b/dlls/mspatcha/pa19.c index dc6ef79e2b2..4b21b199ed8 100644 --- a/dlls/mspatcha/pa19.c +++ b/dlls/mspatcha/pa19.c @@ -37,7 +37,6 @@ #include "windef.h" #include "winternl.h" -#include "wine/heap.h" #include "wine/debug.h" #include "patchapi.h" @@ -319,7 +318,7 @@ static int read_header(struct patch_file_header *ph, const BYTE *buf, size_t siz if (ph->err != ERROR_SUCCESS) return -1; - ph->file_table = heap_calloc(ph->input_file_count, sizeof(struct input_file_info)); + ph->file_table = calloc(ph->input_file_count, sizeof(struct input_file_info)); if (ph->file_table == NULL) { ph->err = ERROR_OUTOFMEMORY; @@ -436,11 +435,6 @@ static int read_header(struct patch_file_header *ph, const BYTE *buf, size_t siz return (ph->err == ERROR_SUCCESS) ? 0 : -1; } -static void free_header(struct patch_file_header *ph) -{ - heap_free(ph->file_table); -} - #define TICKS_PER_SEC 10000000 #define SEC_TO_UNIX_EPOCH ((369 * 365 + 89) * (ULONGLONG)86400) @@ -787,7 +781,7 @@ free_decode_buf: VirtualFree(decode_buf, 0, MEM_RELEASE); free_patch_header: - free_header(&ph); + free(ph.file_table); return err; }
1
0
0
0
Alex Henrie : msident: Use CRT allocation functions.
by Alexandre Julliard
03 Nov '23
03 Nov '23
Module: wine Branch: master Commit: a76bf99eff09c6618e9882cc828755a0c62e081f URL:
https://gitlab.winehq.org/wine/wine/-/commit/a76bf99eff09c6618e9882cc828755…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Thu Nov 2 21:41:00 2023 -0600 msident: Use CRT allocation functions. --- dlls/msident/msident.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/msident/msident.c b/dlls/msident/msident.c index 2099038ef15..86c05536e15 100644 --- a/dlls/msident/msident.c +++ b/dlls/msident/msident.c @@ -24,7 +24,6 @@ #include "rpcproxy.h" #include "wine/debug.h" -#include "wine/heap.h" WINE_DEFAULT_DEBUG_CHANNEL(msident); @@ -76,7 +75,7 @@ static ULONG WINAPI EnumUserIdentity_Release(IEnumUserIdentity *iface) TRACE("(%p) ref=%ld\n", This, ref); if(!ref) - heap_free(This); + free(This); return ref; } @@ -166,7 +165,7 @@ static HRESULT WINAPI UserIdentityManager_EnumIdentities(IUserIdentityManager *i TRACE("(%p)\n", ppEnumUser); - ret = heap_alloc(sizeof(*ret)); + ret = malloc(sizeof(*ret)); if(!ret) return E_OUTOFMEMORY;
1
0
0
0
Alex Henrie : msdasql: Use CRT allocation functions.
by Alexandre Julliard
03 Nov '23
03 Nov '23
Module: wine Branch: master Commit: 3c2ec4ef94efd9fd47b4ed4b6dbd46250ec76f66 URL:
https://gitlab.winehq.org/wine/wine/-/commit/3c2ec4ef94efd9fd47b4ed4b6dbd46…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Thu Nov 2 21:40:07 2023 -0600 msdasql: Use CRT allocation functions. --- dlls/msdasql/session.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/dlls/msdasql/session.c b/dlls/msdasql/session.c index 3e6e5f2a0b3..056468f1054 100644 --- a/dlls/msdasql/session.c +++ b/dlls/msdasql/session.c @@ -25,7 +25,6 @@ #include "objbase.h" #include "rpcproxy.h" #include "msdasc.h" -#include "wine/heap.h" #include "wine/debug.h" #include "msdasql.h" @@ -409,7 +408,7 @@ static ULONG WINAPI session_Release(IUnknown *iface) TRACE( "destroying %p\n", session ); IUnknown_Release(session->datasource); - heap_free( session ); + free(session); } return refs; } @@ -693,15 +692,15 @@ static ULONG WINAPI command_Release(ICommandText *iface) if (!refs) { TRACE( "destroying %p\n", command ); - heap_free(command->properties); + free(command->properties); if (command->session) IUnknown_Release(command->session); if (command->hstmt) SQLFreeHandle(SQL_HANDLE_STMT, command->hstmt); - heap_free( command->query ); - heap_free( command ); + free(command->query); + free(command); } return refs; } @@ -826,7 +825,7 @@ static ULONG WINAPI msdasql_rowset_Release(IRowset *iface) if (rowset->caller) IUnknown_Release(rowset->caller); - heap_free( rowset ); + free(rowset); } return refs; } @@ -1259,7 +1258,7 @@ static HRESULT WINAPI command_Execute(ICommandText *iface, IUnknown *outer, REFI *rowset = NULL; if (!wcsnicmp( command->query, L"select ", 7 )) { - msrowset = heap_alloc(sizeof(*msrowset)); + msrowset = malloc(sizeof(*msrowset)); if (!msrowset) return E_OUTOFMEMORY; @@ -1326,8 +1325,7 @@ static HRESULT WINAPI command_GetCommandText(ICommandText *iface, GUID *dialect, hr = DB_S_DIALECTIGNORED; } - *commandstr = heap_alloc((lstrlenW(command->query)+1)*sizeof(WCHAR)); - wcscpy(*commandstr, command->query); + *commandstr = wcsdup(command->query); return hr; } @@ -1339,15 +1337,13 @@ static HRESULT WINAPI command_SetCommandText(ICommandText *iface, REFGUID dialec if (!IsEqualGUID(&DBGUID_DEFAULT, dialect)) FIXME("Currently non Default Dialect isn't supported\n"); - heap_free(command->query); + free(command->query); if (commandstr) { - command->query = heap_alloc((lstrlenW(commandstr)+1)*sizeof(WCHAR)); + command->query = wcsdup(commandstr); if (!command->query) return E_OUTOFMEMORY; - - wcscpy(command->query, commandstr); } else command->query = NULL; @@ -1775,7 +1771,7 @@ static HRESULT WINAPI createcommand_CreateCommand(IDBCreateCommand *iface, IUnkn if (outer) FIXME("Outer not currently supported\n"); - command = heap_alloc(sizeof(*command)); + command = malloc(sizeof(*command)); if (!command) return E_OUTOFMEMORY; @@ -1791,7 +1787,7 @@ static HRESULT WINAPI createcommand_CreateCommand(IDBCreateCommand *iface, IUnkn command->hstmt = NULL; command->prop_count = ARRAY_SIZE(msdasql_init_props); - command->properties = heap_alloc(sizeof(msdasql_init_props)); + command->properties = malloc(sizeof(msdasql_init_props)); memcpy(command->properties, msdasql_init_props, sizeof(msdasql_init_props)); IUnknown_QueryInterface(&session->session_iface, &IID_IUnknown, (void**)&command->session); @@ -1915,7 +1911,7 @@ HRESULT create_db_session(REFIID riid, IUnknown *datasource, HDBC hdbc, void **u struct msdasql_session *session; HRESULT hr; - session = heap_alloc(sizeof(*session)); + session = malloc(sizeof(*session)); if (!session) return E_OUTOFMEMORY;
1
0
0
0
← Newer
1
...
87
88
89
90
91
92
93
...
99
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
Results per page:
10
25
50
100
200