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
July 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
639 discussions
Start a n
N
ew thread
Jacek Caban : win32u: Support undocumented SIF_RETURNPREV flag in set_scroll_info.
by Alexandre Julliard
05 Jul '22
05 Jul '22
Module: wine Branch: master Commit: c9c69dff7e9b9d9842a79f255c376f0baa3ad310 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c9c69dff7e9b9d9842a79f25…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun Jul 3 23:31:45 2022 +0200 win32u: Support undocumented SIF_RETURNPREV flag in set_scroll_info. --- dlls/user32/tests/scroll.c | 13 +++++++++++++ dlls/win32u/scroll.c | 9 ++++++--- include/ntuser.h | 3 +++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/dlls/user32/tests/scroll.c b/dlls/user32/tests/scroll.c index 20bb0dc111b..95782a47a6e 100644 --- a/dlls/user32/tests/scroll.c +++ b/dlls/user32/tests/scroll.c @@ -671,6 +671,19 @@ static void test_SetScrollInfo(void) ret = IsWindowEnabled(hScroll); ok(ret, "Unexpected enabled state.\n"); + EnableScrollBar(mainwnd, SB_CTL, ESB_ENABLE_BOTH); + + si.fMask = SIF_POS; + si.nPos = 3; + ret = SetScrollInfo(mainwnd, SB_HORZ, &si, FALSE); + ok(ret == 3, "SetScrollInfo returned %d\n", ret); + + /* undocumented flag making SetScrollInfo return previous position */ + si.fMask = SIF_POS | 0x1000; + si.nPos = 4; + ret = SetScrollInfo(mainwnd, SB_HORZ, &si, FALSE); + ok(ret == 3, "SetScrollInfo returned %d\n", ret); + DestroyWindow(hScroll); DestroyWindow(mainwnd); } diff --git a/dlls/win32u/scroll.c b/dlls/win32u/scroll.c index a51c7d3cf93..d48755cec7c 100644 --- a/dlls/win32u/scroll.c +++ b/dlls/win32u/scroll.c @@ -824,7 +824,7 @@ void track_scroll_bar( HWND hwnd, int scrollbar, POINT pt ) */ static inline BOOL validate_scroll_info( const SCROLLINFO *info ) { - return !(info->fMask & ~(SIF_ALL | SIF_DISABLENOSCROLL) || + return !(info->fMask & ~(SIF_ALL | SIF_DISABLENOSCROLL | SIF_RETURNPREV) || (info->cbSize != sizeof(*info) && info->cbSize != sizeof(*info) - sizeof(info->nTrackPos))); } @@ -862,7 +862,7 @@ static int set_scroll_info( HWND hwnd, int bar, const SCROLLINFO *info, BOOL red { struct scroll_info *scroll; UINT new_flags; - int action = 0, ret; + int action = 0, ret = 0; /* handle invalid data structure */ if (!validate_scroll_info( info ) || @@ -878,6 +878,9 @@ static int set_scroll_info( HWND hwnd, int bar, const SCROLLINFO *info, BOOL red TRACE( "\n" ); } + /* undocumented flag, return previous position instead of modified */ + if (info->fMask & SIF_RETURNPREV) ret = scroll->curVal; + /* Set the page size */ if ((info->fMask & SIF_PAGE) && scroll->page != info->nPage) { @@ -970,7 +973,7 @@ static int set_scroll_info( HWND hwnd, int bar, const SCROLLINFO *info, BOOL red } done: - ret = scroll->curVal; + if (!(info->fMask & SIF_RETURNPREV)) ret = scroll->curVal; release_scroll_info_ptr( scroll ); if (action & SA_SSI_HIDE) show_scroll_bar( hwnd, bar, FALSE, FALSE ); diff --git a/include/ntuser.h b/include/ntuser.h index fecdbbbe253..34701d21533 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -269,6 +269,9 @@ struct send_message_callback_params /* NtUserScrollWindowEx flag */ #define SW_NODCCACHE 0x8000 +/* NtUserSetScrollInfo flag */ +#define SIF_RETURNPREV 0x1000 + /* NtUserInitializeClientPfnArrays parameter, not compatible with Windows */ struct user_client_procs {
1
0
0
0
Nikolay Sivov : winemsibuilder: Use CRT allocation functions.
by Alexandre Julliard
05 Jul '22
05 Jul '22
Module: wine Branch: master Commit: f059013a419e89c343fc657323b280521703daf1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f059013a419e89c343fc6573…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Jul 3 19:20:56 2022 +0300 winemsibuilder: Use CRT allocation functions. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- programs/winemsibuilder/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/programs/winemsibuilder/main.c b/programs/winemsibuilder/main.c index 3b1221860b3..3bbd0735505 100644 --- a/programs/winemsibuilder/main.c +++ b/programs/winemsibuilder/main.c @@ -77,7 +77,7 @@ static int import_tables( const WCHAR *msifile, WCHAR **tables ) if (r != ERROR_SUCCESS) return 1; len = GetCurrentDirectoryW( 0, NULL ); - if (!(dir = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ))) + if (!(dir = malloc( (len + 1) * sizeof(WCHAR) ))) { MsiCloseHandle( hdb ); return 1; @@ -102,7 +102,7 @@ static int import_tables( const WCHAR *msifile, WCHAR **tables ) WINE_ERR( "failed to commit changes (%u)\n", r ); } - HeapFree( GetProcessHeap(), 0, dir ); + free( dir ); MsiCloseHandle( hdb ); return (r != ERROR_SUCCESS); } @@ -135,7 +135,7 @@ static WCHAR *encode_stream( const WCHAR *in ) return NULL; count += 2; - if (!(out = HeapAlloc( GetProcessHeap(), 0, count * sizeof(WCHAR) ))) return NULL; + if (!(out = malloc( count * sizeof(WCHAR) ))) return NULL; p = out; while (count--) { @@ -162,7 +162,7 @@ static WCHAR *encode_stream( const WCHAR *in ) } *p++ = c; } - HeapFree( GetProcessHeap(), 0, out ); + free( out ); return NULL; } @@ -236,7 +236,7 @@ static int add_stream( const WCHAR *msifile, const WCHAR *stream, const WCHAR *f ret = 0; done: - HeapFree( GetProcessHeap(), 0, encname ); + free( encname ); if (stm) IStream_Release( stm ); IStorage_Release( stg ); return ret;
1
0
0
0
Nikolay Sivov : winepath: Use CRT allocation functions.
by Alexandre Julliard
05 Jul '22
05 Jul '22
Module: wine Branch: master Commit: 5675994602c8758756a7f94becd1b8d8a6a7e70d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5675994602c8758756a7f94b…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Jul 3 15:50:09 2022 +0300 winepath: Use CRT allocation functions. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- programs/winepath/winepath.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/programs/winepath/winepath.c b/programs/winepath/winepath.c index 17cfdc1d2eb..88c64b91a42 100644 --- a/programs/winepath/winepath.c +++ b/programs/winepath/winepath.c @@ -195,7 +195,7 @@ int __cdecl wmain(int argc, WCHAR *argv[]) if (outputformats & UNIXFORMAT) { WCHAR *ntpath, *tail; int ntpathlen=lstrlenW(argv[i]); - ntpath=HeapAlloc(GetProcessHeap(), 0, sizeof(*ntpath)*(ntpathlen+1)); + ntpath = malloc(sizeof(*ntpath)*(ntpathlen+1)); lstrcpyW(ntpath, argv[i]); tail=NULL; while (1) @@ -215,7 +215,7 @@ int __cdecl wmain(int argc, WCHAR *argv[]) { printf("%s%c", unix_name, separator); } - HeapFree( GetProcessHeap(), 0, unix_name ); + free( unix_name ); break; } @@ -247,7 +247,7 @@ int __cdecl wmain(int argc, WCHAR *argv[]) tail=slash; *tail='\0'; } - HeapFree(GetProcessHeap(), 0, ntpath); + free(ntpath); } if (outputformats & WINDOWSFORMAT) { WCHAR* windows_name; @@ -255,17 +255,17 @@ int __cdecl wmain(int argc, WCHAR *argv[]) DWORD size; size=WideCharToMultiByte(CP_UNIXCP, 0, argv[i], -1, NULL, 0, NULL, NULL); - unix_name=HeapAlloc(GetProcessHeap(), 0, size); + unix_name = malloc(size); WideCharToMultiByte(CP_UNIXCP, 0, argv[i], -1, unix_name, size, NULL, NULL); if ((windows_name = wine_get_dos_file_name_ptr(unix_name))) { WideCharToMultiByte(CP_UNIXCP, 0, windows_name, -1, path, MAX_PATH, NULL, NULL); printf("%s%c", path, separator); - HeapFree( GetProcessHeap(), 0, windows_name ); + free( windows_name ); } else printf("%c", separator); - HeapFree( GetProcessHeap(), 0, unix_name ); + free( unix_name ); } }
1
0
0
0
Nikolay Sivov : wordpad: Use CRT allocation functions.
by Alexandre Julliard
05 Jul '22
05 Jul '22
Module: wine Branch: master Commit: ee1f96ebfbd06b16e6bb0982ea9e2e3b08d2658b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ee1f96ebfbd06b16e6bb0982…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Jul 3 15:06:58 2022 +0300 wordpad: Use CRT allocation functions. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- programs/wordpad/print.c | 8 +++----- programs/wordpad/registry.c | 6 ++---- programs/wordpad/wordpad.c | 34 ++++++++++++++++------------------ programs/wordpad/wordpad.h | 2 ++ 4 files changed, 23 insertions(+), 27 deletions(-) diff --git a/programs/wordpad/print.c b/programs/wordpad/print.c index acc583eefc5..d73c2d7757e 100644 --- a/programs/wordpad/print.c +++ b/programs/wordpad/print.c @@ -749,7 +749,7 @@ void close_preview(HWND hMainWnd) preview.window.right = 0; preview.window.bottom = 0; preview.page = 0; - HeapFree(GetProcessHeap(), 0, preview.pageEnds); + free(preview.pageEnds); preview.pageEnds = NULL; preview.pageCapacity = 0; if (preview.zoomlevel > 0) @@ -783,13 +783,11 @@ static void draw_preview(HWND hEditorWnd, FORMATRANGE* lpFr, RECT* paper, int pa if (!preview.pageEnds) { preview.pageCapacity = 32; - preview.pageEnds = HeapAlloc(GetProcessHeap(), 0, - sizeof(int) * preview.pageCapacity); + preview.pageEnds = malloc(sizeof(int) * preview.pageCapacity); if (!preview.pageEnds) return; } else if (page >= preview.pageCapacity) { int *new_buffer; - new_buffer = HeapReAlloc(GetProcessHeap(), 0, preview.pageEnds, - sizeof(int) * preview.pageCapacity * 2); + new_buffer = realloc(preview.pageEnds, sizeof(int) * preview.pageCapacity * 2); if (!new_buffer) return; preview.pageCapacity *= 2; preview.pageEnds = new_buffer; diff --git a/programs/wordpad/registry.c b/programs/wordpad/registry.c index 138111614bf..2de81c5d583 100644 --- a/programs/wordpad/registry.c +++ b/programs/wordpad/registry.c @@ -51,9 +51,7 @@ static LRESULT registry_get_handle(HKEY *hKey, LPDWORD action, LPCWSTR subKey) if(subKey) { WCHAR backslash[] = {'\\',0}; - key = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - (lstrlenW(wszProgramKey)+lstrlenW(subKey)+lstrlenW(backslash)+1) - *sizeof(WCHAR)); + key = calloc(lstrlenW(wszProgramKey)+lstrlenW(subKey)+lstrlenW(backslash)+1, sizeof(WCHAR)); if(!key) return 1; @@ -73,7 +71,7 @@ static LRESULT registry_get_handle(HKEY *hKey, LPDWORD action, LPCWSTR subKey) } if(subKey) - HeapFree(GetProcessHeap(), 0, key); + free(key); return ret; } diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c index 7f79eccc8bb..4a3aa2375bf 100644 --- a/programs/wordpad/wordpad.c +++ b/programs/wordpad/wordpad.c @@ -239,8 +239,7 @@ static void set_caption(LPCWSTR wszNewFileName) else wszNewFileName = file_basename((LPWSTR)wszNewFileName); - wszCaption = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - lstrlenW(wszNewFileName)*sizeof(WCHAR)+sizeof(wszSeparator)+sizeof(wszAppTitle)); + wszCaption = calloc(1, lstrlenW(wszNewFileName)*sizeof(WCHAR)+sizeof(wszSeparator)+sizeof(wszAppTitle)); if(!wszCaption) return; @@ -253,7 +252,7 @@ static void set_caption(LPCWSTR wszNewFileName) SetWindowTextW(hMainWnd, wszCaption); - HeapFree(GetProcessHeap(), 0, wszCaption); + free(wszCaption); } static BOOL validate_endptr(LPCWSTR endptr, UNIT *punit) @@ -615,8 +614,8 @@ static BOOL array_reserve(void **elements, size_t *capacity, size_t count, size_ if (new_capacity < count) new_capacity = max_capacity; - new_elements = *elements ? HeapReAlloc(GetProcessHeap(), 0, *elements, new_capacity * size) : - HeapAlloc(GetProcessHeap(), 0, new_capacity * size); + new_elements = *elements ? realloc(*elements, new_capacity * size) : + malloc(new_capacity * size); if (!new_elements) return FALSE; @@ -638,7 +637,7 @@ static void add_font(struct font_array *fonts, LPCWSTR fontName, DWORD fontType, fontHeight = ntmc->ntmTm.tmHeight - ntmc->ntmTm.tmInternalLeading; idx = fonts->count; - fonts->fonts[idx].name = HeapAlloc( GetProcessHeap(), 0, (lstrlenW(fontName) + 1)*sizeof(WCHAR) ); + fonts->fonts[idx].name = malloc((lstrlenW(fontName) + 1)*sizeof(WCHAR) ); lstrcpyW( fonts->fonts[idx].name, fontName ); fonts->fonts[idx].lParam = MAKELONG(fontType, fontHeight); @@ -685,7 +684,7 @@ static void populate_font_list(HWND hListWnd) { if (!lstrcmpiW(font_array.fonts[i].name, font_array.fonts[j].name)) { - HeapFree(GetProcessHeap(), 0, font_array.fonts[i].name); + free(font_array.fonts[i].name); font_array.fonts[i].name = NULL; } else if (++j != i) @@ -707,9 +706,9 @@ static void populate_font_list(HWND hListWnd) SendMessageW(hListWnd, CBEM_INSERTITEMW, 0, (LPARAM)&cbitem); - HeapFree(GetProcessHeap(), 0, font_array.fonts[i].name); + free(font_array.fonts[i].name); } - HeapFree(GetProcessHeap(), 0, font_array.fonts); + free(font_array.fonts); ZeroMemory(&fmt, sizeof(fmt)); fmt.cbSize = sizeof(fmt); @@ -1015,8 +1014,7 @@ static BOOL prompt_save_changes(void) else displayFileName = file_basename(wszFileName); - text = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - (lstrlenW(displayFileName)+lstrlenW(wszSaveChanges))*sizeof(WCHAR)); + text = calloc(lstrlenW(displayFileName)+lstrlenW(wszSaveChanges), sizeof(WCHAR)); if(!text) return FALSE; @@ -1025,7 +1023,7 @@ static BOOL prompt_save_changes(void) ret = MessageBoxW(hMainWnd, text, wszAppTitle, MB_YESNOCANCEL | MB_ICONEXCLAMATION); - HeapFree(GetProcessHeap(), 0, text); + free(text); switch(ret) { @@ -2401,20 +2399,20 @@ static LRESULT OnCommand( HWND hWnd, WPARAM wParam, LPARAM lParam) case ID_EDIT_GETTEXT: { int nLen = GetWindowTextLengthW(hwndEditor); - LPWSTR data = HeapAlloc( GetProcessHeap(), 0, (nLen+1)*sizeof(WCHAR) ); + LPWSTR data = malloc((nLen+1)*sizeof(WCHAR) ); TEXTRANGEW tr; GetWindowTextW(hwndEditor, data, nLen+1); MessageBoxW(NULL, data, wszAppTitle, MB_OK); - HeapFree( GetProcessHeap(), 0, data); - data = HeapAlloc(GetProcessHeap(), 0, (nLen+1)*sizeof(WCHAR)); + free(data); + data = malloc((nLen+1)*sizeof(WCHAR)); tr.chrg.cpMin = 0; tr.chrg.cpMax = nLen; tr.lpstrText = data; SendMessageW(hwndEditor, EM_GETTEXTRANGE, 0, (LPARAM)&tr); MessageBoxW(NULL, data, wszAppTitle, MB_OK); - HeapFree( GetProcessHeap(), 0, data ); + free(data); /* SendMessage(hwndEditor, EM_SETSEL, 0, -1); */ return 0; @@ -2449,12 +2447,12 @@ static LRESULT OnCommand( HWND hWnd, WPARAM wParam, LPARAM lParam) WCHAR *data = NULL; SendMessageW(hwndEditor, EM_EXGETSEL, 0, (LPARAM)&range); - data = HeapAlloc(GetProcessHeap(), 0, sizeof(*data) * (range.cpMax-range.cpMin+1)); + data = malloc(sizeof(*data) * (range.cpMax-range.cpMin+1)); SendMessageW(hwndEditor, EM_GETSELTEXT, 0, (LPARAM)data); sprintf(buf, "Start = %ld, End = %ld", range.cpMin, range.cpMax); MessageBoxA(hWnd, buf, "Editor", MB_OK); MessageBoxW(hWnd, data, wszAppTitle, MB_OK); - HeapFree( GetProcessHeap(), 0, data); + free(data); /* SendMessage(hwndEditor, EM_SETSEL, 0, -1); */ return 0; } diff --git a/programs/wordpad/wordpad.h b/programs/wordpad/wordpad.h index 0baf8c924dd..6dae06b38eb 100644 --- a/programs/wordpad/wordpad.h +++ b/programs/wordpad/wordpad.h @@ -17,6 +17,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include <stdlib.h> + #include <windef.h> #include <winuser.h>
1
0
0
0
Nikolay Sivov : wscript: Use CRT memory allocation functions.
by Alexandre Julliard
05 Jul '22
05 Jul '22
Module: wine Branch: master Commit: a0bef9f322d4f7fa5341ae2bae45a8be07ed7463 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a0bef9f322d4f7fa5341ae2b…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Jul 3 14:42:13 2022 +0300 wscript: Use CRT memory allocation functions. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- programs/wscript/host.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/programs/wscript/host.c b/programs/wscript/host.c index 463f5ee7aa6..44336deac13 100644 --- a/programs/wscript/host.c +++ b/programs/wscript/host.c @@ -28,7 +28,6 @@ #include "wscript.h" #include <wine/debug.h> -#include <wine/heap.h> WINE_DEFAULT_DEBUG_CHANNEL(wscript); @@ -81,13 +80,13 @@ static void print_string(const WCHAR *string) } lena = WideCharToMultiByte(GetOEMCP(), 0, string, len, NULL, 0, NULL, NULL); - buf = heap_alloc(len); + buf = malloc(len); if(!buf) return; WideCharToMultiByte(GetOEMCP(), 0, string, len, buf, lena, NULL, NULL); WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), buf, lena, &count, FALSE); - heap_free(buf); + free(buf); WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), "\r\n", 2, &count, FALSE); } @@ -334,8 +333,8 @@ static HRESULT WINAPI Host_Echo(IHost *iface, SAFEARRAY *args) return hres; argc = ubound-lbound+1; - strs = heap_alloc_zero(argc*sizeof(*strs)); - if(!strs) { + if (!(strs = calloc(argc, sizeof(*strs)))) + { SafeArrayUnaccessData(args); return E_OUTOFMEMORY; } @@ -353,7 +352,7 @@ static HRESULT WINAPI Host_Echo(IHost *iface, SAFEARRAY *args) SafeArrayUnaccessData(args); if(SUCCEEDED(hres)) { - ptr = output = heap_alloc((len+1)*sizeof(WCHAR)); + ptr = output = malloc((len+1)*sizeof(WCHAR)); if(output) { for(i=0; i < argc; i++) { if(i) @@ -370,13 +369,13 @@ static HRESULT WINAPI Host_Echo(IHost *iface, SAFEARRAY *args) for(i=0; i < argc; i++) SysFreeString(strs[i]); - heap_free(strs); + free(strs); if(FAILED(hres)) return hres; print_string(output); - heap_free(output); + free(output); return S_OK; }
1
0
0
0
Nikolay Sivov : rpcss: Use CRT memory allocation functions.
by Alexandre Julliard
05 Jul '22
05 Jul '22
Module: wine Branch: master Commit: 201ed0858fc5fcb64999b2752647d93afddd5e61 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=201ed0858fc5fcb64999b275…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Jul 3 14:37:49 2022 +0300 rpcss: Use CRT memory allocation functions. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- programs/rpcss/epmp.c | 6 +++--- programs/rpcss/irotp.c | 22 ++++++++++------------ programs/rpcss/rpcss_main.c | 11 +++++------ 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/programs/rpcss/epmp.c b/programs/rpcss/epmp.c index 2a13aaccb8b..0d4cb9af982 100644 --- a/programs/rpcss/epmp.c +++ b/programs/rpcss/epmp.c @@ -57,7 +57,7 @@ static void delete_registered_ept_entry(struct registered_ept_entry *entry) I_RpcFree(entry->endpoint); I_RpcFree(entry->address); list_remove(&entry->entry); - HeapFree(GetProcessHeap(), 0, entry); + free(entry); } static struct registered_ept_entry *find_ept_entry( @@ -106,7 +106,7 @@ void __cdecl ept_insert(handle_t h, for (i = 0; i < num_ents; i++) { - struct registered_ept_entry *entry = HeapAlloc(GetProcessHeap(), 0, sizeof(*entry)); + struct registered_ept_entry *entry = malloc(sizeof(*entry)); if (!entry) { /* FIXME: cleanup code to delete added entries */ @@ -121,7 +121,7 @@ void __cdecl ept_insert(handle_t h, { WINE_WARN("TowerExplode failed %lu\n", rpc_status); *status = rpc_status; - HeapFree(GetProcessHeap(), 0, entry); + free(entry); break; /* FIXME: more cleanup? */ } diff --git a/programs/rpcss/irotp.c b/programs/rpcss/irotp.c index 47a88852a2d..daf48daf0a7 100644 --- a/programs/rpcss/irotp.c +++ b/programs/rpcss/irotp.c @@ -61,10 +61,10 @@ static inline void rot_entry_release(struct rot_entry *rot_entry) { if (!InterlockedDecrement(&rot_entry->refs)) { - HeapFree(GetProcessHeap(), 0, rot_entry->object); - HeapFree(GetProcessHeap(), 0, rot_entry->moniker); - HeapFree(GetProcessHeap(), 0, rot_entry->moniker_data); - HeapFree(GetProcessHeap(), 0, rot_entry); + free(rot_entry->object); + free(rot_entry->moniker); + free(rot_entry->moniker_data); + free(rot_entry); } } @@ -88,12 +88,11 @@ HRESULT __cdecl IrotRegister( return E_INVALIDARG; } - rot_entry = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*rot_entry)); - if (!rot_entry) + if (!(rot_entry = calloc(1, sizeof(*rot_entry)))) return E_OUTOFMEMORY; rot_entry->refs = 1; - rot_entry->object = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(InterfaceData, abData[obj->ulCntData])); + rot_entry->object = malloc(FIELD_OFFSET(InterfaceData, abData[obj->ulCntData])); if (!rot_entry->object) { rot_entry_release(rot_entry); @@ -104,7 +103,7 @@ HRESULT __cdecl IrotRegister( rot_entry->last_modified = *time; - rot_entry->moniker = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(InterfaceData, abData[mk->ulCntData])); + rot_entry->moniker = malloc(FIELD_OFFSET(InterfaceData, abData[mk->ulCntData])); if (!rot_entry->moniker) { rot_entry_release(rot_entry); @@ -113,8 +112,7 @@ HRESULT __cdecl IrotRegister( rot_entry->moniker->ulCntData = mk->ulCntData; memcpy(&rot_entry->moniker->abData, mk->abData, mk->ulCntData); - rot_entry->moniker_data = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(MonikerComparisonData, abData[data->ulCntData])); - if (!rot_entry->moniker_data) + if (!(rot_entry->moniker_data = malloc(FIELD_OFFSET(MonikerComparisonData, abData[data->ulCntData])))) { rot_entry_release(rot_entry); return E_OUTOFMEMORY; @@ -370,10 +368,10 @@ void __RPC_USER IrotContextHandle_rundown(IrotContextHandle ctxt_handle) void * __RPC_USER MIDL_user_allocate(SIZE_T size) { - return HeapAlloc(GetProcessHeap(), 0, size); + return malloc(size); } void __RPC_USER MIDL_user_free(void * p) { - HeapFree(GetProcessHeap(), 0, p); + free(p); } diff --git a/programs/rpcss/rpcss_main.c b/programs/rpcss/rpcss_main.c index 2fef34d1171..dfe5ced7c07 100644 --- a/programs/rpcss/rpcss_main.c +++ b/programs/rpcss/rpcss_main.c @@ -31,7 +31,6 @@ #include "irpcss.h" #include "wine/debug.h" -#include "wine/heap.h" #include "wine/list.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -58,14 +57,14 @@ HRESULT __cdecl irpcss_server_register(handle_t h, const GUID *clsid, unsigned i struct registered_class *entry; static LONG next_cookie; - if (!(entry = heap_alloc_zero(sizeof(*entry)))) + if (!(entry = calloc(1, sizeof(*entry)))) return E_OUTOFMEMORY; entry->clsid = *clsid; entry->single_use = !(flags & (REGCLS_MULTIPLEUSE | REGCLS_MULTI_SEPARATE)); - if (!(entry->object = heap_alloc(FIELD_OFFSET(MInterfacePointer, abData[object->ulCntData])))) + if (!(entry->object = malloc(FIELD_OFFSET(MInterfacePointer, abData[object->ulCntData])))) { - heap_free(entry); + free(entry); return E_OUTOFMEMORY; } entry->object->ulCntData = object->ulCntData; @@ -82,8 +81,8 @@ HRESULT __cdecl irpcss_server_register(handle_t h, const GUID *clsid, unsigned i static void scm_revoke_class(struct registered_class *_class) { list_remove(&_class->entry); - heap_free(_class->object); - heap_free(_class); + free(_class->object); + free(_class); } HRESULT __cdecl irpcss_server_revoke(handle_t h, unsigned int cookie)
1
0
0
0
Nikolay Sivov : d2d1/tests: Use CRT allocation functions.
by Alexandre Julliard
05 Jul '22
05 Jul '22
Module: wine Branch: master Commit: 7918bfc5cd6d31d652f2b76602dc61b4febe3607 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7918bfc5cd6d31d652f2b766…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Jul 3 13:59:47 2022 +0300 d2d1/tests: Use CRT allocation functions. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/d2d1/tests/d2d1.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 335659c24b3..1a964475168 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -28,7 +28,6 @@ #include "initguid.h" #include "dwrite.h" #include "wincodec.h" -#include "wine/heap.h" DEFINE_GUID(CLSID_TestEffect, 0xb9ee12e9,0x32d9,0xe659,0xac,0x61,0x2d,0x7c,0xea,0x69,0x28,0x78); DEFINE_GUID(GUID_TestVertexShader, 0x5bcdcfae,0x1e92,0x4dc1,0x94,0xfa,0x3b,0x01,0xca,0x54,0x59,0x20); @@ -358,7 +357,7 @@ static void queue_d3d1x_test(void (*test)(BOOL d3d11), BOOL d3d11) if (mt_test_count >= mt_tests_size) { mt_tests_size = max(16, mt_tests_size * 2); - mt_tests = heap_realloc(mt_tests, mt_tests_size * sizeof(*mt_tests)); + mt_tests = realloc(mt_tests, mt_tests_size * sizeof(*mt_tests)); } mt_tests[mt_test_count].test = test; mt_tests[mt_test_count++].d3d11 = d3d11; @@ -408,7 +407,7 @@ static void run_queued_tests(void) GetSystemInfo(&si); thread_count = si.dwNumberOfProcessors; - threads = heap_calloc(thread_count, sizeof(*threads)); + threads = calloc(thread_count, sizeof(*threads)); for (i = 0, test_idx = 0; i < thread_count; ++i) { threads[i] = CreateThread(NULL, 0, thread_func, &test_idx, 0, NULL); @@ -419,7 +418,7 @@ static void run_queued_tests(void) { CloseHandle(threads[i]); } - heap_free(threads); + free(threads); } static void set_point(D2D1_POINT_2F *point, float x, float y) @@ -10680,7 +10679,7 @@ static ULONG STDMETHODCALLTYPE effect_impl_Release(ID2D1EffectImpl *iface) { if (effect_impl->effect_context) ID2D1EffectContext_Release(effect_impl->effect_context); - heap_free(effect_impl); + free(effect_impl); } return refcount; @@ -10718,7 +10717,7 @@ static HRESULT STDMETHODCALLTYPE effect_impl_create(IUnknown **effect_impl) { struct effect_impl *object; - if (!(object = heap_alloc(sizeof(*object)))) + if (!(object = calloc(1, sizeof(*object)))) return E_OUTOFMEMORY; object->ID2D1EffectImpl_iface.lpVtbl = &effect_impl_vtbl;
1
0
0
0
Nikolay Sivov : d2d1: Implement GetRegisteredEffects().
by Alexandre Julliard
05 Jul '22
05 Jul '22
Module: wine Branch: master Commit: 5284e1db832d48fb485a34577637fbe5f9af5ec1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5284e1db832d48fb485a3457…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sat Jul 2 23:21:04 2022 +0300 d2d1: Implement GetRegisteredEffects(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/d2d1/factory.c | 30 +++++++++++++++++++++-- dlls/d2d1/tests/d2d1.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 2 deletions(-) diff --git a/dlls/d2d1/factory.c b/dlls/d2d1/factory.c index 856af97cd43..a160d7071c2 100644 --- a/dlls/d2d1/factory.c +++ b/dlls/d2d1/factory.c @@ -1037,10 +1037,36 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_UnregisterEffect(ID2D1Factory3 *ifa static HRESULT STDMETHODCALLTYPE d2d_factory_GetRegisteredEffects(ID2D1Factory3 *iface, CLSID *effects, UINT32 effect_count, UINT32 *returned, UINT32 *registered) { - FIXME("iface %p, effects %p, effect_count %u, returned %p, registered %p stub!\n", + struct d2d_factory *factory = impl_from_ID2D1Factory3(iface); + struct d2d_effect_registration *effect; + UINT32 ret, reg; + + TRACE("iface %p, effects %p, effect_count %u, returned %p, registered %p.\n", iface, effects, effect_count, returned, registered); - return E_NOTIMPL; + if (!returned) returned = &ret; + if (!registered) registered = ® + + *registered = 0; + *returned = 0; + + d2d_factory_init_builtin_effects(factory); + + LIST_FOR_EACH_ENTRY(effect, &factory->effects, struct d2d_effect_registration, entry) + { + if (effects && effect_count) + { + *effects = effect->id; + effects++; + effect_count--; + *returned += 1; + } + + *registered += 1; + } + + if (!effects) return S_OK; + return *returned == *registered ? S_OK : D2DERR_INSUFFICIENT_BUFFER; } static HRESULT STDMETHODCALLTYPE d2d_factory_GetEffectProperties(ID2D1Factory3 *iface, diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 585016890a6..335659c24b3 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -11935,6 +11935,69 @@ static void test_effect_grayscale(BOOL d3d11) release_test_context(&ctx); } +static void test_registered_effects(BOOL d3d11) +{ + UINT32 ret, count, count2, count3; + struct d2d1_test_context ctx; + ID2D1Factory1 *factory; + CLSID *effects; + HRESULT hr; + + if (!init_test_context(&ctx, d3d11)) + return; + + factory = ctx.factory1; + + count = 0; + hr = ID2D1Factory1_GetRegisteredEffects(factory, NULL, 0, NULL, &count); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(count > 0, "Unexpected effect count %u.\n", count); + + hr = ID2D1Factory1_RegisterEffectFromString(factory, &CLSID_TestEffect, effect_xml_a, + NULL, 0, effect_impl_create); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + count2 = 0; + hr = ID2D1Factory1_GetRegisteredEffects(factory, NULL, 0, NULL, &count2); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(count2 == count + 1, "Unexpected effect count %u.\n", count2); + + effects = calloc(count2, sizeof(*effects)); + + count3 = 0; + hr = ID2D1Factory1_GetRegisteredEffects(factory, effects, 0, NULL, &count3); + ok(hr == D2DERR_INSUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); + ok(count2 == count3, "Unexpected effect count %u.\n", count3); + + ret = 999; + hr = ID2D1Factory1_GetRegisteredEffects(factory, effects, 0, &ret, NULL); + ok(hr == D2DERR_INSUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); + ok(!ret, "Unexpected count %u.\n", ret); + + ret = 0; + hr = ID2D1Factory1_GetRegisteredEffects(factory, effects, 1, &ret, NULL); + ok(hr == D2DERR_INSUFFICIENT_BUFFER, "Unexpected hr %#lx.\n", hr); + ok(ret == 1, "Unexpected count %u.\n", ret); + ok(!IsEqualGUID(effects, &CLSID_TestEffect), "Unexpected clsid.\n"); + + ret = 0; + hr = ID2D1Factory1_GetRegisteredEffects(factory, effects, count2, &ret, NULL); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(ret == count2, "Unexpected count %u.\n", ret); + ok(IsEqualGUID(&effects[ret - 1], &CLSID_TestEffect), "Unexpected clsid.\n"); + + free(effects); + + ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect); + + count2 = 0; + hr = ID2D1Factory1_GetRegisteredEffects(factory, NULL, 0, NULL, &count2); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(count2 == count, "Unexpected effect count %u.\n", count2); + + release_test_context(&ctx); +} + static void test_stroke_contains_point(BOOL d3d11) { ID2D1TransformedGeometry *transformed_geometry; @@ -12749,6 +12812,7 @@ START_TEST(d2d1) queue_test(test_effect_2d_affine); queue_test(test_effect_crop); queue_test(test_effect_grayscale); + queue_test(test_registered_effects); queue_d3d10_test(test_stroke_contains_point); queue_test(test_image_bounds); queue_test(test_bitmap_map);
1
0
0
0
Ziqing Hui : d2d1/effect: Keep builtin effects in the same list as the custom once.
by Alexandre Julliard
05 Jul '22
05 Jul '22
Module: wine Branch: master Commit: 97abb6d2bad51d8c5d63ec1531519d5d642427a3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=97abb6d2bad51d8c5d63ec15…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Sat Jul 2 23:02:49 2022 +0300 d2d1/effect: Keep builtin effects in the same list as the custom once. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/d2d1/d2d1_private.h | 6 ++++ dlls/d2d1/effect.c | 76 ++++++++++++++++++++---------------------------- dlls/d2d1/factory.c | 40 ++++++++++++++++++++++--- dlls/d2d1/tests/d2d1.c | 5 ++++ 4 files changed, 78 insertions(+), 49 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=97abb6d2bad51d8c5d63…
1
0
0
0
Nikolay Sivov : d2d1/effect: Check that "Inputs" property was specified in the description.
by Alexandre Julliard
05 Jul '22
05 Jul '22
Module: wine Branch: master Commit: ffab990bd6be33e4817c09fd88c8880851df00da URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ffab990bd6be33e4817c09fd…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sat Jul 2 20:13:46 2022 +0300 d2d1/effect: Check that "Inputs" property was specified in the description. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/d2d1/factory.c | 3 ++- dlls/d2d1/tests/d2d1.c | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/d2d1/factory.c b/dlls/d2d1/factory.c index 699b8c05669..0a8a3bbd5b1 100644 --- a/dlls/d2d1/factory.c +++ b/dlls/d2d1/factory.c @@ -921,7 +921,8 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_RegisterEffectFromStream(ID2D1Facto if (!parse_effect_get_property(effect, L"DisplayName") || !parse_effect_get_property(effect, L"Author") || !parse_effect_get_property(effect, L"Category") - || !parse_effect_get_property(effect, L"Description")) + || !parse_effect_get_property(effect, L"Description") + || !parse_effect_get_property(effect, L"Inputs")) { WARN("Missing required properties.\n"); d2d_effect_registration_cleanup(effect); diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index fed0e9bdf96..05ebf10e666 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -10855,7 +10855,6 @@ static void test_effect_register(BOOL d3d11) winetest_push_context("Test %u", i); hr = ID2D1Factory1_RegisterEffectFromString(factory, &CLSID_TestEffect, test->xml, NULL, 0, effect_impl_create); - todo_wine_if(i == 5) ok(hr == test->hr, "Got unexpected hr %#lx, expected %#lx.\n", hr, test->hr); if (hr == S_OK) {
1
0
0
0
← Newer
1
...
54
55
56
57
58
59
60
...
64
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
Results per page:
10
25
50
100
200