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
Rémi Bernon : joy.cpl: Build without NONAMELESSUNION.
by Alexandre Julliard
30 Nov '22
30 Nov '22
Module: wine Branch: master Commit: efe01bc7cb1260a9fb1e819e814efeddab52e5e6 URL:
https://gitlab.winehq.org/wine/wine/-/commit/efe01bc7cb1260a9fb1e819e814efe…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sun Nov 27 21:33:10 2022 +0100 joy.cpl: Build without NONAMELESSUNION. --- dlls/joy.cpl/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dlls/joy.cpl/main.c b/dlls/joy.cpl/main.c index f0620b1e3fa..7469f8ad460 100644 --- a/dlls/joy.cpl/main.c +++ b/dlls/joy.cpl/main.c @@ -19,7 +19,6 @@ * */ -#define NONAMELESSUNION #define COBJMACROS #define CONST_VTABLE @@ -962,14 +961,14 @@ static void display_cpl_sheets( HWND parent, struct JoystickData *data ) { .dwSize = sizeof(PROPSHEETPAGEW), .hInstance = hcpl, - .u.pszTemplate = MAKEINTRESOURCEW( IDD_LIST ), + .pszTemplate = MAKEINTRESOURCEW( IDD_LIST ), .pfnDlgProc = list_dlgproc, .lParam = (INT_PTR)data, }, { .dwSize = sizeof(PROPSHEETPAGEW), .hInstance = hcpl, - .u.pszTemplate = MAKEINTRESOURCEW( IDD_TEST_DI ), + .pszTemplate = MAKEINTRESOURCEW( IDD_TEST_DI ), .pfnDlgProc = test_dlgproc, .lParam = (INT_PTR)data, }, @@ -982,7 +981,7 @@ static void display_cpl_sheets( HWND parent, struct JoystickData *data ) .hInstance = hcpl, .pszCaption = MAKEINTRESOURCEW( IDS_CPL_NAME ), .nPages = ARRAY_SIZE(pages), - .u3.ppsp = pages, + .ppsp = pages, .pfnCallback = propsheet_callback, }; ACTCTXW context_desc =
1
0
0
0
Rémi Bernon : joy.cpl: Use designated initializers in display_cpl_sheets.
by Alexandre Julliard
30 Nov '22
30 Nov '22
Module: wine Branch: master Commit: d645cd149b538900d26d4e5d4ff351410f2d2a95 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d645cd149b538900d26d4e5d4ff351…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sun Nov 27 21:31:59 2022 +0100 joy.cpl: Use designated initializers in display_cpl_sheets. --- dlls/joy.cpl/main.c | 118 ++++++++++++++++++++++++---------------------------- 1 file changed, 54 insertions(+), 64 deletions(-) diff --git a/dlls/joy.cpl/main.c b/dlls/joy.cpl/main.c index 279b5c07e22..f0620b1e3fa 100644 --- a/dlls/joy.cpl/main.c +++ b/dlls/joy.cpl/main.c @@ -950,73 +950,63 @@ static int CALLBACK propsheet_callback(HWND hwnd, UINT msg, LPARAM lparam) return 0; } -/****************************************************************************** - * display_cpl_sheets [internal] - * - * Build and display the dialog with all control panel propertysheets - * - */ -static void display_cpl_sheets(HWND parent, struct JoystickData *data) +static void display_cpl_sheets( HWND parent, struct JoystickData *data ) { - INITCOMMONCONTROLSEX icex; - BOOL activated = FALSE; - PROPSHEETPAGEW psp[2]; - PROPSHEETHEADERW psh; + INITCOMMONCONTROLSEX init = + { + .dwSize = sizeof(INITCOMMONCONTROLSEX), + .dwICC = ICC_LISTVIEW_CLASSES | ICC_BAR_CLASSES, + }; + PROPSHEETPAGEW pages[] = + { + { + .dwSize = sizeof(PROPSHEETPAGEW), + .hInstance = hcpl, + .u.pszTemplate = MAKEINTRESOURCEW( IDD_LIST ), + .pfnDlgProc = list_dlgproc, + .lParam = (INT_PTR)data, + }, + { + .dwSize = sizeof(PROPSHEETPAGEW), + .hInstance = hcpl, + .u.pszTemplate = MAKEINTRESOURCEW( IDD_TEST_DI ), + .pfnDlgProc = test_dlgproc, + .lParam = (INT_PTR)data, + }, + }; + PROPSHEETHEADERW header = + { + .dwSize = sizeof(PROPSHEETHEADERW), + .dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK, + .hwndParent = parent, + .hInstance = hcpl, + .pszCaption = MAKEINTRESOURCEW( IDS_CPL_NAME ), + .nPages = ARRAY_SIZE(pages), + .u3.ppsp = pages, + .pfnCallback = propsheet_callback, + }; + ACTCTXW context_desc = + { + .cbSize = sizeof(ACTCTXW), + .hModule = hcpl, + .lpResourceName = MAKEINTRESOURCEW( 124 ), + .dwFlags = ACTCTX_FLAG_HMODULE_VALID | ACTCTX_FLAG_RESOURCE_NAME_VALID, + }; ULONG_PTR cookie; - ACTCTXW actctx; HANDLE context; - DWORD id = 0; - - OleInitialize(NULL); - /* Activate context */ - memset(&actctx, 0, sizeof(actctx)); - actctx.cbSize = sizeof(actctx); - actctx.hModule = hcpl; - actctx.lpResourceName = MAKEINTRESOURCEW(124); - actctx.dwFlags = ACTCTX_FLAG_HMODULE_VALID | ACTCTX_FLAG_RESOURCE_NAME_VALID; - context = CreateActCtxW(&actctx); - if (context != INVALID_HANDLE_VALUE) - activated = ActivateActCtx(context, &cookie); - - /* Initialize common controls */ - icex.dwSize = sizeof(INITCOMMONCONTROLSEX); - icex.dwICC = ICC_LISTVIEW_CLASSES | ICC_BAR_CLASSES; - InitCommonControlsEx(&icex); - - ZeroMemory(&psh, sizeof(psh)); - ZeroMemory(psp, sizeof(psp)); - - /* Fill out all PROPSHEETPAGE */ - psp[id].dwSize = sizeof (PROPSHEETPAGEW); - psp[id].hInstance = hcpl; - psp[id].u.pszTemplate = MAKEINTRESOURCEW(IDD_LIST); - psp[id].pfnDlgProc = list_dlgproc; - psp[id].lParam = (INT_PTR) data; - id++; - - psp[id].dwSize = sizeof (PROPSHEETPAGEW); - psp[id].hInstance = hcpl; - psp[id].u.pszTemplate = MAKEINTRESOURCEW(IDD_TEST_DI); - psp[id].pfnDlgProc = test_dlgproc; - psp[id].lParam = (INT_PTR) data; - id++; - - /* Fill out the PROPSHEETHEADER */ - psh.dwSize = sizeof (PROPSHEETHEADERW); - psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK; - psh.hwndParent = parent; - psh.hInstance = hcpl; - psh.pszCaption = MAKEINTRESOURCEW(IDS_CPL_NAME); - psh.nPages = id; - psh.u3.ppsp = psp; - psh.pfnCallback = propsheet_callback; - - /* display the dialog */ - PropertySheetW(&psh); - - if (activated) - DeactivateActCtx(0, cookie); - ReleaseActCtx(context); + BOOL activated; + + OleInitialize( NULL ); + + context = CreateActCtxW( &context_desc ); + if (context == INVALID_HANDLE_VALUE) activated = FALSE; + else activated = ActivateActCtx( context, &cookie ); + + InitCommonControlsEx( &init ); + PropertySheetW( &header ); + + if (activated) DeactivateActCtx( 0, cookie ); + ReleaseActCtx( context ); OleUninitialize(); }
1
0
0
0
Rémi Bernon : joy.cpl: Add DI_ prefix to dinput dialog constants.
by Alexandre Julliard
30 Nov '22
30 Nov '22
Module: wine Branch: master Commit: 63758578293d876c7f18e27473881d4b7614fc27 URL:
https://gitlab.winehq.org/wine/wine/-/commit/63758578293d876c7f18e27473881d…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sun Nov 27 01:48:13 2022 +0100 joy.cpl: Add DI_ prefix to dinput dialog constants. --- dlls/joy.cpl/joy.rc | 16 ++++++++-------- dlls/joy.cpl/main.c | 47 +++++++++++++++++++++++------------------------ dlls/joy.cpl/resource.h | 14 +++++++------- po/ar.po | 4 ++-- po/ast.po | 2 +- po/bg.po | 2 +- po/ca.po | 4 ++-- po/cs.po | 4 ++-- po/da.po | 2 +- po/de.po | 4 ++-- po/el.po | 2 +- po/en.po | 4 ++-- po/en_US.po | 4 ++-- po/eo.po | 2 +- po/es.po | 4 ++-- po/fa.po | 2 +- po/fi.po | 4 ++-- po/fr.po | 4 ++-- po/he.po | 2 +- po/hi.po | 2 +- po/hr.po | 4 ++-- po/hu.po | 2 +- po/it.po | 2 +- po/ja.po | 4 ++-- po/ko.po | 4 ++-- po/lt.po | 4 ++-- po/ml.po | 2 +- po/nb_NO.po | 4 ++-- po/nl.po | 4 ++-- po/or.po | 2 +- po/pa.po | 2 +- po/pl.po | 4 ++-- po/pt_BR.po | 4 ++-- po/pt_PT.po | 4 ++-- po/rm.po | 2 +- po/ro.po | 4 ++-- po/ru.po | 4 ++-- po/si.po | 2 +- po/sk.po | 2 +- po/sl.po | 2 +- po/sr_RS(a)cyrillic.po | 2 +- po/sr_RS(a)latin.po | 2 +- po/sv.po | 4 ++-- po/ta.po | 2 +- po/te.po | 2 +- po/th.po | 2 +- po/tr.po | 4 ++-- po/uk.po | 4 ++-- po/wa.po | 2 +- po/wine.pot | 2 +- po/zh_CN.po | 4 ++-- po/zh_TW.po | 4 ++-- 52 files changed, 112 insertions(+), 113 deletions(-)
1
0
0
0
David Kahurani : xmllite/writer: Implement WriteSurrogateCharEntity.
by Alexandre Julliard
30 Nov '22
30 Nov '22
Module: wine Branch: master Commit: 05db7cf04d257c1fc409d0d0f256e03f65d303ff URL:
https://gitlab.winehq.org/wine/wine/-/commit/05db7cf04d257c1fc409d0d0f256e0…
Author: David Kahurani <k.kahurani(a)gmail.com> Date: Sat Oct 29 12:58:29 2022 +0300 xmllite/writer: Implement WriteSurrogateCharEntity. Signed-off-by: David Kahurani <k.kahurani(a)gmail.com> --- dlls/xmllite/tests/writer.c | 65 +++++++++++++++++++++++++++++++++++++++++++-- dlls/xmllite/writer.c | 30 ++++++++++++++++++--- 2 files changed, 90 insertions(+), 5 deletions(-) diff --git a/dlls/xmllite/tests/writer.c b/dlls/xmllite/tests/writer.c index 53f3297597e..572b3a9fd67 100644 --- a/dlls/xmllite/tests/writer.c +++ b/dlls/xmllite/tests/writer.c @@ -138,6 +138,8 @@ static void check_writer_state(IXmlWriter *writer, HRESULT exp_hr) { IXmlReader *reader; HRESULT hr; + WCHAR low = 0xdcef; + WCHAR high = 0xdaff; hr = CreateXmlReader(&IID_IXmlReader, (void **)&reader, NULL); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); @@ -217,7 +219,8 @@ static void check_writer_state(IXmlWriter *writer, HRESULT exp_hr) hr = IXmlWriter_WriteString(writer, L"a"); ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr); - /* FIXME: add WriteSurrogateCharEntity */ + hr = IXmlWriter_WriteSurrogateCharEntity(writer, low, high); + ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr); hr = IXmlWriter_WriteWhitespace(writer, L" "); ok(hr == exp_hr, "Unexpected hr %#lx, expected %#lx.\n", hr, exp_hr); @@ -372,6 +375,8 @@ static void test_invalid_output_encoding(IXmlWriter *writer, IUnknown *output) { IXmlReader *reader; HRESULT hr; + WCHAR low = 0xdcef; + WCHAR high = 0xdaff; hr = CreateXmlReader(&IID_IXmlReader, (void **)&reader, NULL); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); @@ -448,7 +453,8 @@ static void test_invalid_output_encoding(IXmlWriter *writer, IUnknown *output) hr = IXmlWriter_WriteString(writer, L"a"); ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr); - /* TODO: WriteSurrogateCharEntity */ + hr = IXmlWriter_WriteSurrogateCharEntity(writer, low, high); + ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr); hr = IXmlWriter_WriteWhitespace(writer, L" "); ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr); @@ -2021,6 +2027,60 @@ static void test_WriteRawChars(void) IXmlWriter_Release(writer); } +static void test_WriteSurrogateCharEntity(void) +{ + IXmlWriter *writer; + IStream *stream; + HRESULT hr; + WCHAR low = 0xdcef; + WCHAR high = 0xdaff; + + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_WriteSurrogateCharEntity(writer, high, low); + ok(hr == WC_E_XMLCHARACTER, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_WriteSurrogateCharEntity(writer, low, high); + ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr); + + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteStartElement(writer, NULL, L"root", NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_WriteSurrogateCharEntity(writer, high, low); + ok(hr == WC_E_XMLCHARACTER, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_Flush(writer); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + CHECK_OUTPUT(stream, "<root"); + + hr = IXmlWriter_WriteSurrogateCharEntity(writer, low, high); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_WriteFullEndElement(writer); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_Flush(writer); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + CHECK_OUTPUT(stream, "<root>󏳯</root>"); + IStream_Release(stream); + + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteEndElement(writer); + ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_WriteSurrogateCharEntity(writer, low, high); + ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr); + + IXmlWriter_Release(writer); + IStream_Release(stream); +} + static void test_WriteString(void) { static const WCHAR surrogates[] = {0xd800, 0xdc00, 'x', 'y', '\0'}; @@ -2903,6 +2963,7 @@ START_TEST(writer) test_WriteCharEntity(); test_WriteChars(); test_WriteRawChars(); + test_WriteSurrogateCharEntity(); test_WriteString(); test_WriteDocType(); test_WriteWhitespace(); diff --git a/dlls/xmllite/writer.c b/dlls/xmllite/writer.c index 55fe6ab05d7..128d666e82c 100644 --- a/dlls/xmllite/writer.c +++ b/dlls/xmllite/writer.c @@ -1979,11 +1979,35 @@ static HRESULT WINAPI xmlwriter_WriteString(IXmlWriter *iface, const WCHAR *stri static HRESULT WINAPI xmlwriter_WriteSurrogateCharEntity(IXmlWriter *iface, WCHAR wchLow, WCHAR wchHigh) { - xmlwriter *This = impl_from_IXmlWriter(iface); + xmlwriter *writer = impl_from_IXmlWriter(iface); + int codepoint; + WCHAR bufW[16]; - FIXME("%p %d %d\n", This, wchLow, wchHigh); + TRACE("%p, %d, %d.\n", iface, wchLow, wchHigh); - return E_NOTIMPL; + if (!IS_SURROGATE_PAIR(wchHigh, wchLow)) + return WC_E_XMLCHARACTER; + + switch (writer->state) + { + case XmlWriterState_Initial: + return E_UNEXPECTED; + case XmlWriterState_InvalidEncoding: + return MX_E_ENCODING; + case XmlWriterState_ElemStarted: + writer_close_starttag(writer); + break; + case XmlWriterState_DocClosed: + return WR_E_INVALIDACTION; + default: + ; + } + + codepoint = ((wchHigh - 0xd800) * 0x400) + (wchLow - 0xdc00) + 0x10000; + swprintf(bufW, ARRAY_SIZE(bufW), L"&#x%X;", codepoint); + write_output_buffer(writer->output, bufW, -1); + + return S_OK; } static HRESULT WINAPI xmlwriter_WriteWhitespace(IXmlWriter *iface, LPCWSTR text)
1
0
0
0
David Kahurani : xmllite/writer: Implement WriteRawChars.
by Alexandre Julliard
30 Nov '22
30 Nov '22
Module: wine Branch: master Commit: 083211f54df628896b1afed5e131571e0b375be1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/083211f54df628896b1afed5e13157…
Author: David Kahurani <k.kahurani(a)gmail.com> Date: Sat Oct 29 12:51:55 2022 +0300 xmllite/writer: Implement WriteRawChars. Signed-off-by: David Kahurani <k.kahurani(a)gmail.com> --- dlls/xmllite/tests/writer.c | 116 ++++++++++++++++++++++++++++++++++++++++++++ dlls/xmllite/writer.c | 32 ++++++++++-- 2 files changed, 143 insertions(+), 5 deletions(-) diff --git a/dlls/xmllite/tests/writer.c b/dlls/xmllite/tests/writer.c index 25257624f50..53f3297597e 100644 --- a/dlls/xmllite/tests/writer.c +++ b/dlls/xmllite/tests/writer.c @@ -456,6 +456,9 @@ static void test_invalid_output_encoding(IXmlWriter *writer, IUnknown *output) hr = IXmlWriter_WriteChars(writer, L"a", 1); ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr); + hr = IXmlWriter_WriteRawChars(writer, L"a", 1); + ok(hr == MX_E_ENCODING, "Unexpected hr %#lx.\n", hr); + hr = IXmlWriter_Flush(writer); ok(hr == S_OK, "Failed to flush, hr %#lx.\n", hr); @@ -1906,6 +1909,118 @@ static void test_WriteCharEntity(void) IStream_Release(stream); } +static void test_WriteRawChars(void) +{ + IXmlWriter *writer; + IStream *stream; + HRESULT hr; + static WCHAR surrogates[] = {0xd800, 0xdc00, 0}; + + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_WriteRawChars(writer, NULL, 0); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_WriteRawChars(writer, L"", 0); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_WriteRawChars(writer, NULL, 5); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_WriteRawChars(writer, L"", 6); + ok(hr == E_UNEXPECTED, "Unexpected hr %#lx.\n", hr); + + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteStartElement(writer, NULL, L"sub", NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_WriteRawChars(writer, L"<rawChars>", 5); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_Flush(writer); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + CHECK_OUTPUT(stream, "<sub><rawC"); + IStream_Release(stream); + + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteRawChars(writer, L"a", 1); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_WriteStartElement(writer, NULL, L"sub", NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_WriteRawChars(writer, L"<;;>", 10); + ok(hr == WC_E_XMLCHARACTER, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_Flush(writer); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + CHECK_OUTPUT(stream, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>a<sub><;;>"); + IStream_Release(stream); + + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteStartElement(writer, NULL, L"sub", NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_WriteRawChars(writer, surrogates, 1); + ok(hr == WR_E_INVALIDSURROGATEPAIR, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_WriteRawChars(writer, surrogates, 2); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_Flush(writer); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + CHECK_OUTPUT(stream, "<sub>\U00010000"); + IStream_Release(stream); + + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteStartElement(writer, NULL, L"sub", NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_WriteRawChars(writer, L"", 5); + ok(hr == WC_E_XMLCHARACTER, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_Flush(writer); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + CHECK_OUTPUT(stream, "<sub>"); + IStream_Release(stream); + + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteStartElement(writer, NULL, L"sub", NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_WriteRawChars(writer, L"", 0); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_Flush(writer); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + CHECK_OUTPUT(stream, "<sub"); + + IStream_Release(stream); + + stream = writer_set_output(writer); + + /* Force document close */ + hr = IXmlWriter_WriteEndElement(writer); + ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr); + + hr = IXmlWriter_WriteRawChars(writer, L"a", 1); + ok(hr == WR_E_INVALIDACTION, "Unexpected hr %#lx.\n", hr); + + IStream_Release(stream); + IXmlWriter_Release(writer); +} + static void test_WriteString(void) { static const WCHAR surrogates[] = {0xd800, 0xdc00, 'x', 'y', '\0'}; @@ -2787,6 +2902,7 @@ START_TEST(writer) test_WriteFullEndElement(); test_WriteCharEntity(); test_WriteChars(); + test_WriteRawChars(); test_WriteString(); test_WriteDocType(); test_WriteWhitespace(); diff --git a/dlls/xmllite/writer.c b/dlls/xmllite/writer.c index 9a2e75ec452..55fe6ab05d7 100644 --- a/dlls/xmllite/writer.c +++ b/dlls/xmllite/writer.c @@ -1808,13 +1808,21 @@ static HRESULT WINAPI xmlwriter_WriteRaw(IXmlWriter *iface, LPCWSTR data) return hr; } -static HRESULT WINAPI xmlwriter_WriteRawChars(IXmlWriter *iface, const WCHAR *pwch, UINT cwch) +static HRESULT WINAPI xmlwriter_WriteRawChars(IXmlWriter *iface, const WCHAR *characters, UINT length) { - xmlwriter *This = impl_from_IXmlWriter(iface); + xmlwriter *writer = impl_from_IXmlWriter(iface); + HRESULT hr = S_OK; + unsigned int count; - FIXME("%p %s %d\n", This, wine_dbgstr_w(pwch), cwch); + TRACE("%p, %s, %d.\n", iface, debugstr_wn(characters, length), length); - switch (This->state) + if ((characters == NULL && length != 0)) + return E_INVALIDARG; + + if (length == 0) + return S_OK; + + switch (writer->state) { case XmlWriterState_Initial: return E_UNEXPECTED; @@ -1822,11 +1830,25 @@ static HRESULT WINAPI xmlwriter_WriteRawChars(IXmlWriter *iface, const WCHAR *p return MX_E_ENCODING; case XmlWriterState_DocClosed: return WR_E_INVALIDACTION; + case XmlWriterState_Ready: + write_xmldecl(writer, XmlStandalone_Omit); + break; + case XmlWriterState_ElemStarted: + writer_close_starttag(writer); default: ; } - return E_NOTIMPL; + while (length) + { + if (FAILED(hr = writer_get_next_write_count(characters, length, &count))) return hr; + if (FAILED(hr = write_output_buffer(writer->output, characters, count))) return hr; + + characters += count; + length -= count; + } + + return hr; } static HRESULT WINAPI xmlwriter_WriteStartDocument(IXmlWriter *iface, XmlStandalone standalone)
1
0
0
0
David Kahurani : xmllite/writer: Implement WriteChars.
by Alexandre Julliard
30 Nov '22
30 Nov '22
Module: wine Branch: master Commit: f3cfbef6afbc772764f2426a81fe738ca42ebc05 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f3cfbef6afbc772764f2426a81fe73…
Author: David Kahurani <k.kahurani(a)gmail.com> Date: Mon Oct 31 16:46:39 2022 +0300 xmllite/writer: Implement WriteChars. Signed-off-by: David Kahurani <k.kahurani(a)gmail.com> --- dlls/xmllite/tests/writer.c | 137 ++++++++++++++++++++++++++++++++++++ dlls/xmllite/writer.c | 165 +++++++++++++++++++++++--------------------- 2 files changed, 225 insertions(+), 77 deletions(-)
1
0
0
0
Nikolay Sivov : comctl32/listview: Use CRT allocation functions.
by Alexandre Julliard
30 Nov '22
30 Nov '22
Module: wine Branch: master Commit: 0002cb89ec511b1ba0193a78bc46e7b2cae40ae8 URL:
https://gitlab.winehq.org/wine/wine/-/commit/0002cb89ec511b1ba0193a78bc46e7…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Nov 23 11:50:29 2022 +0300 comctl32/listview: Use CRT allocation functions. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/comctl32/listview.c | 91 ++++++++++++++++++++++++------------------------ 1 file changed, 45 insertions(+), 46 deletions(-)
1
0
0
0
Nikolay Sivov : comctl32/button: Use CRT allocation functions.
by Alexandre Julliard
30 Nov '22
30 Nov '22
Module: wine Branch: master Commit: aa98d43c45d3c0d71dfd2f28c4f89ca108a8614c URL:
https://gitlab.winehq.org/wine/wine/-/commit/aa98d43c45d3c0d71dfd2f28c4f89c…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Nov 23 11:43:49 2022 +0300 comctl32/button: Use CRT allocation functions. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/comctl32/button.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index 6c04c458a6a..d4196b144ed 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -55,7 +55,6 @@ #include "uxtheme.h" #include "vssym32.h" #include "wine/debug.h" -#include "wine/heap.h" #include "comctl32.h" @@ -255,7 +254,7 @@ static inline void paint_button( BUTTON_INFO *infoPtr, LONG style, UINT action ) static inline WCHAR *get_button_text( const BUTTON_INFO *infoPtr ) { INT len = GetWindowTextLengthW( infoPtr->hwnd ); - WCHAR *buffer = heap_alloc( (len + 1) * sizeof(WCHAR) ); + WCHAR *buffer = malloc( (len + 1) * sizeof(WCHAR) ); if (buffer) GetWindowTextW( infoPtr->hwnd, buffer, len + 1 ); return buffer; @@ -335,7 +334,7 @@ HRGN set_control_clipping( HDC hdc, const RECT *rect ) static WCHAR *heap_strndupW(const WCHAR *src, size_t length) { size_t size = (length + 1) * sizeof(WCHAR); - WCHAR *dst = heap_alloc(size); + WCHAR *dst = malloc(size); if (dst) memcpy(dst, src, size); return dst; } @@ -504,7 +503,7 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L { CREATESTRUCTW *cs = (CREATESTRUCTW *)lParam; - infoPtr = heap_alloc_zero( sizeof(*infoPtr) ); + infoPtr = calloc( 1, sizeof(*infoPtr) ); SetWindowLongPtrW( hWnd, 0, (LONG_PTR)infoPtr ); infoPtr->hwnd = hWnd; infoPtr->parent = cs->hwndParent; @@ -521,8 +520,8 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L DeleteObject(infoPtr->u.bitmap); else if (infoPtr->image_type == IMAGE_ICON) DestroyIcon(infoPtr->u.icon); - heap_free(infoPtr->note); - heap_free(infoPtr); + free(infoPtr->note); + free(infoPtr); break; case WM_CREATE: @@ -782,7 +781,7 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L return FALSE; } - heap_free(infoPtr->note); + free(infoPtr->note); if (note) { infoPtr->note_length = lstrlenW(note); @@ -792,7 +791,7 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L if (!note || !infoPtr->note) { infoPtr->note_length = 0; - infoPtr->note = heap_alloc_zero(sizeof(WCHAR)); + infoPtr->note = calloc(1, sizeof(WCHAR)); } SetLastError(NO_ERROR); @@ -1289,7 +1288,7 @@ static void BUTTON_GetTextIdealSize(BUTTON_INFO *infoPtr, LONG maxWidth, SIZE *s hdc = GetDC(infoPtr->hwnd); rect = BUTTON_GetTextRect(infoPtr, hdc, text, maxWidth); ReleaseDC(infoPtr->hwnd, hdc); - heap_free(text); + free(text); size->cx = rect.right - rect.left + margin->left + margin->right; size->cy = rect.bottom - rect.top + margin->top + margin->bottom; @@ -1489,7 +1488,7 @@ static BOOL CL_GetIdealSize(BUTTON_INFO *infoPtr, SIZE *size) RECT r; GetThemeTextExtent(theme, hdc, BP_COMMANDLINK, CMDLS_NORMAL, text, -1, flags, &text_bound, &r); - heap_free(text); + free(text); text_w = r.right - r.left; text_h = r.bottom - r.top; } @@ -1527,7 +1526,7 @@ static BOOL CL_GetIdealSize(BUTTON_INFO *infoPtr, SIZE *size) RECT r = text_bound; old_font = SelectObject(hdc, font); DrawTextW(hdc, text, -1, &r, flags | DT_CALCRECT); - heap_free(text); + free(text); text_w = r.right - r.left; text_h = r.bottom - r.top; @@ -1596,7 +1595,7 @@ static UINT BUTTON_CalcLayoutRects(const BUTTON_INFO *infoPtr, HDC hdc, RECT *la SetRectEmpty(labelRc); SetRectEmpty(imageRc); SetRectEmpty(textRc); - heap_free(text); + free(text); return (UINT)-1; } @@ -1699,7 +1698,7 @@ static UINT BUTTON_CalcLayoutRects(const BUTTON_INFO *infoPtr, HDC hdc, RECT *la SetRectEmpty(&imageRect); } } - heap_free(text); + free(text); CopyRect(labelRc, &labelRect); CopyRect(imageRc, &imageRect); @@ -1792,7 +1791,7 @@ static void BUTTON_DrawLabel(const BUTTON_INFO *infoPtr, HDC hdc, UINT dtFlags, if (!(text = get_button_text(infoPtr))) return; DrawStateW(hdc, hbr, BUTTON_DrawTextCallback, (LPARAM)text, dtFlags, textRect->left, textRect->top, textRect->right - textRect->left, textRect->bottom - textRect->top, flags); - heap_free(text); + free(text); } static void BUTTON_DrawThemedLabel(const BUTTON_INFO *info, HDC hdc, UINT text_flags, @@ -1824,7 +1823,7 @@ static void BUTTON_DrawThemedLabel(const BUTTON_INFO *info, HDC hdc, UINT text_f return; DrawThemeText(theme, hdc, part, state, text, lstrlenW(text), text_flags, 0, text_rect); - heap_free(text); + free(text); } /********************************************************************** @@ -2660,7 +2659,7 @@ static void CL_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action ) SelectObject(hDC, font); txt_h = DrawTextW(hDC, text, -1, &r, DT_TOP | DT_LEFT | DT_WORDBREAK | DT_END_ELLIPSIS); - heap_free(text); + free(text); } DeleteObject(font); } @@ -3153,7 +3152,7 @@ static void CL_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in DrawThemeText(theme, hDC, part, state, text, len, dtFlags | DT_END_ELLIPSIS, 0, &r); txt_h = text_rect.bottom - text_rect.top; - heap_free(text); + free(text); } /* Draw the note */
1
0
0
0
Nikolay Sivov : comctl32/static: Use CRT allocation functions.
by Alexandre Julliard
30 Nov '22
30 Nov '22
Module: wine Branch: master Commit: 7ef99635fbbec9c553bfb70f945730aa43e9ed0f URL:
https://gitlab.winehq.org/wine/wine/-/commit/7ef99635fbbec9c553bfb70f945730…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Nov 23 08:53:32 2022 +0300 comctl32/static: Use CRT allocation functions. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/comctl32/static.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/comctl32/static.c b/dlls/comctl32/static.c index 25eee289204..cab0235b8d3 100644 --- a/dlls/comctl32/static.c +++ b/dlls/comctl32/static.c @@ -29,6 +29,7 @@ */ #include <stdarg.h> +#include <stdlib.h> #include "windef.h" #include "winbase.h" @@ -37,7 +38,6 @@ #include "commctrl.h" #include "uxtheme.h" -#include "wine/heap.h" #include "wine/debug.h" #include "comctl32.h" @@ -94,7 +94,7 @@ static struct static_extra_info *get_extra_ptr( HWND hwnd, BOOL force ) struct static_extra_info *extra = (struct static_extra_info *)GetWindowLongPtrW( hwnd, 0 ); if (!extra && force) { - extra = heap_alloc_zero( sizeof(*extra) ); + extra = calloc( 1, sizeof(*extra) ); if (extra) SetWindowLongPtrW( hwnd, 0, (ULONG_PTR)extra ); } @@ -470,7 +470,7 @@ static LRESULT CALLBACK STATIC_WindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, { if (extra->image_has_alpha) DeleteObject( extra->image.hbitmap ); - heap_free( extra ); + free( extra ); } /* * FIXME @@ -751,13 +751,13 @@ static void STATIC_PaintTextfn( HWND hwnd, HDC hdc, HBRUSH hbrush, DWORD style ) } buf_size = 256; - if (!(text = HeapAlloc( GetProcessHeap(), 0, buf_size * sizeof(WCHAR) ))) + if (!(text = malloc( buf_size * sizeof(WCHAR) ))) goto no_TextOut; while ((len = InternalGetWindowText( hwnd, text, buf_size )) == buf_size - 1) { buf_size *= 2; - if (!(text = HeapReAlloc( GetProcessHeap(), 0, text, buf_size * sizeof(WCHAR) ))) + if (!(text = realloc( text, buf_size * sizeof(WCHAR) ))) goto no_TextOut; } @@ -777,7 +777,7 @@ static void STATIC_PaintTextfn( HWND hwnd, HDC hdc, HBRUSH hbrush, DWORD style ) } no_TextOut: - HeapFree( GetProcessHeap(), 0, text ); + free( text ); if (hFont) SelectObject( hdc, hOldFont );
1
0
0
0
Nikolay Sivov : comctl32/monthcal: Use CRT allocation functions.
by Alexandre Julliard
30 Nov '22
30 Nov '22
Module: wine Branch: master Commit: a1f4a2d13ab33fa82bc42ae14e7f6c39ef4ddca5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a1f4a2d13ab33fa82bc42ae14e7f6c…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Nov 23 08:51:28 2022 +0300 comctl32/monthcal: Use CRT allocation functions. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/comctl32/monthcal.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c index 4fc984f6f4b..ea220136182 100644 --- a/dlls/comctl32/monthcal.c +++ b/dlls/comctl32/monthcal.c @@ -46,7 +46,6 @@ #include "uxtheme.h" #include "vssym32.h" #include "wine/debug.h" -#include "wine/heap.h" WINE_DEFAULT_DEBUG_CHANNEL(monthcal); @@ -1946,7 +1945,7 @@ static void MONTHCAL_NotifyDayState(MONTHCAL_INFO *infoPtr) nmds.nmhdr.idFrom = GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID); nmds.nmhdr.code = MCN_GETDAYSTATE; nmds.cDayState = MONTHCAL_GetMonthRange(infoPtr, GMR_DAYSTATE, 0); - nmds.prgDayState = state = heap_alloc_zero(nmds.cDayState * sizeof(MONTHDAYSTATE)); + nmds.prgDayState = state = calloc(nmds.cDayState, sizeof(MONTHDAYSTATE)); MONTHCAL_GetMinDate(infoPtr, &nmds.stStart); nmds.stStart.wDay = 1; @@ -1955,7 +1954,7 @@ static void MONTHCAL_NotifyDayState(MONTHCAL_INFO *infoPtr) memcpy(infoPtr->monthdayState, nmds.prgDayState, MONTHCAL_GetMonthRange(infoPtr, GMR_DAYSTATE, 0)*sizeof(MONTHDAYSTATE)); - heap_free(state); + free(state); } /* no valid range check performed */ @@ -2593,9 +2592,9 @@ static void MONTHCAL_UpdateSize(MONTHCAL_INFO *infoPtr) { infoPtr->dim.cx = x; infoPtr->dim.cy = y; - infoPtr->calendars = heap_realloc(infoPtr->calendars, MONTHCAL_GetCalCount(infoPtr)*sizeof(CALENDAR_INFO)); + infoPtr->calendars = realloc(infoPtr->calendars, MONTHCAL_GetCalCount(infoPtr)*sizeof(CALENDAR_INFO)); - infoPtr->monthdayState = heap_realloc(infoPtr->monthdayState, + infoPtr->monthdayState = realloc(infoPtr->monthdayState, MONTHCAL_GetMonthRange(infoPtr, GMR_DAYSTATE, 0)*sizeof(MONTHDAYSTATE)); MONTHCAL_NotifyDayState(infoPtr); @@ -2750,7 +2749,7 @@ MONTHCAL_Create(HWND hwnd, LPCREATESTRUCTW lpcs) MONTHCAL_INFO *infoPtr; /* allocate memory for info structure */ - infoPtr = heap_alloc_zero(sizeof(*infoPtr)); + infoPtr = calloc(1, sizeof(*infoPtr)); SetWindowLongPtrW(hwnd, 0, (DWORD_PTR)infoPtr); if (infoPtr == NULL) { @@ -2762,9 +2761,9 @@ MONTHCAL_Create(HWND hwnd, LPCREATESTRUCTW lpcs) infoPtr->hwndNotify = lpcs->hwndParent; infoPtr->dwStyle = GetWindowLongW(hwnd, GWL_STYLE); infoPtr->dim.cx = infoPtr->dim.cy = 1; - infoPtr->calendars = heap_alloc_zero(sizeof(CALENDAR_INFO)); + infoPtr->calendars = calloc(1, sizeof(*infoPtr->calendars)); if (!infoPtr->calendars) goto fail; - infoPtr->monthdayState = heap_alloc_zero(3 * sizeof(MONTHDAYSTATE)); + infoPtr->monthdayState = calloc(3, sizeof(*infoPtr->monthdayState)); if (!infoPtr->monthdayState) goto fail; /* initialize info structure */ @@ -2805,9 +2804,9 @@ MONTHCAL_Create(HWND hwnd, LPCREATESTRUCTW lpcs) return 0; fail: - heap_free(infoPtr->monthdayState); - heap_free(infoPtr->calendars); - heap_free(infoPtr); + free(infoPtr->monthdayState); + free(infoPtr->calendars); + free(infoPtr); return 0; } @@ -2816,9 +2815,8 @@ MONTHCAL_Destroy(MONTHCAL_INFO *infoPtr) { INT i; - /* free month calendar info data */ - heap_free(infoPtr->monthdayState); - heap_free(infoPtr->calendars); + free(infoPtr->monthdayState); + free(infoPtr->calendars); SetWindowLongPtrW(infoPtr->hwndSelf, 0, 0); CloseThemeData (GetWindowTheme (infoPtr->hwndSelf)); @@ -2826,7 +2824,7 @@ MONTHCAL_Destroy(MONTHCAL_INFO *infoPtr) for (i = 0; i < BrushLast; i++) DeleteObject(infoPtr->brushes[i]); for (i = 0; i < PenLast; i++) DeleteObject(infoPtr->pens[i]); - heap_free(infoPtr); + free(infoPtr); return 0; }
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
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