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
December 2009
----- 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
3 participants
1233 discussions
Start a n
N
ew thread
Alexandre Julliard : winmm: Avoid using ReleaseThunkLock from 32-bit code.
by Alexandre Julliard
24 Dec '09
24 Dec '09
Module: wine Branch: master Commit: 18a7655234728efbf0ba32d7aae2fdf790c9b475 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=18a7655234728efbf0ba32d7a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Dec 24 12:29:24 2009 +0100 winmm: Avoid using ReleaseThunkLock from 32-bit code. --- dlls/winmm/winmm.c | 18 ++---------------- 1 files changed, 2 insertions(+), 16 deletions(-) diff --git a/dlls/winmm/winmm.c b/dlls/winmm/winmm.c index 4f3ace1..f5e2af1 100644 --- a/dlls/winmm/winmm.c +++ b/dlls/winmm/winmm.c @@ -1713,11 +1713,7 @@ the_end: static BOOL MMSYSTEM_MidiStream_PostMessage(WINE_MIDIStream* lpMidiStrm, WORD msg, DWORD pmt1, DWORD pmt2) { if (PostThreadMessageA(lpMidiStrm->dwThreadID, msg, pmt1, pmt2)) { - DWORD count; - - ReleaseThunkLock(&count); - WaitForSingleObject(lpMidiStrm->hEvent, INFINITE); - RestoreThunkLock(count); + MsgWaitForMultipleObjects( 1, &lpMidiStrm->hEvent, FALSE, INFINITE, 0 ); } else { WARN("bad PostThreadMessageA\n"); return FALSE; @@ -1796,17 +1792,7 @@ MMRESULT WINAPI midiStreamOpen(HMIDISTRM* lphMidiStrm, LPUINT lpuDeviceID, SetThreadPriority(lpMidiStrm->hThread, THREAD_PRIORITY_TIME_CRITICAL); /* wait for thread to have started, and for its queue to be created */ - { - DWORD count; - - /* (Release|Restore)ThunkLock() is needed when this method is called from 16 bit code, - * (meaning the Win16Lock is set), so that it's released and the 32 bit thread running - * MMSYSTEM_MidiStreamPlayer can acquire Win16Lock to create its queue. - */ - ReleaseThunkLock(&count); - WaitForSingleObject(lpMidiStrm->hEvent, INFINITE); - RestoreThunkLock(count); - } + WaitForSingleObject(lpMidiStrm->hEvent, INFINITE); TRACE("=> (%u/%d) hMidi=%p ret=%d lpMidiStrm=%p\n", *lpuDeviceID, lpwm->mld.uDeviceID, *lphMidiStrm, ret, lpMidiStrm);
1
0
0
0
Eric Pouech : dbghelp: Add support for loading dwarf debug information out of PE images.
by Alexandre Julliard
24 Dec '09
24 Dec '09
Module: wine Branch: master Commit: bc38d3eaac21b717effec9b6aabfee64bad5a01f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bc38d3eaac21b717effec9b6a…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Wed Dec 23 22:05:25 2009 +0100 dbghelp: Add support for loading dwarf debug information out of PE images. --- dlls/dbghelp/elf_module.c | 2 +- dlls/dbghelp/pe_module.c | 102 +++++++++++++++++++++++++++++++++++---------- 2 files changed, 81 insertions(+), 23 deletions(-) diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c index 702bca2..3399aeb 100644 --- a/dlls/dbghelp/elf_module.c +++ b/dlls/dbghelp/elf_module.c @@ -369,7 +369,7 @@ int elf_is_in_thunk_area(unsigned long addr, { unsigned i; - for (i = 0; thunks[i].symname; i++) + if (thunks) for (i = 0; thunks[i].symname; i++) { if (addr >= thunks[i].rva_start && addr < thunks[i].rva_end) return i; diff --git a/dlls/dbghelp/pe_module.c b/dlls/dbghelp/pe_module.c index 03e9c86..5cce6a3 100644 --- a/dlls/dbghelp/pe_module.c +++ b/dlls/dbghelp/pe_module.c @@ -98,6 +98,17 @@ static BOOL pe_load_symbol_table(struct module* module, IMAGE_NT_HEADERS* nth, v return TRUE; } +static inline void* pe_get_sect(IMAGE_NT_HEADERS* nth, void* mapping, + IMAGE_SECTION_HEADER* sect) +{ + return (sect) ? RtlImageRvaToVa(nth, mapping, sect->VirtualAddress, NULL) : NULL; +} + +static inline DWORD pe_get_sect_size(IMAGE_SECTION_HEADER* sect) +{ + return (sect) ? sect->SizeOfRawData : 0; +} + /****************************************************************** * pe_load_stabs * @@ -108,39 +119,85 @@ static BOOL pe_load_stabs(const struct process* pcs, struct module* module, void* mapping, IMAGE_NT_HEADERS* nth) { IMAGE_SECTION_HEADER* section; - int i, stabsize = 0, stabstrsize = 0; - unsigned int stabs = 0, stabstr = 0; - BOOL ret = FALSE; + IMAGE_SECTION_HEADER* sect_stabs = NULL; + IMAGE_SECTION_HEADER* sect_stabstr = NULL; + int i; + BOOL ret; section = (IMAGE_SECTION_HEADER*) ((char*)&nth->OptionalHeader + nth->FileHeader.SizeOfOptionalHeader); for (i = 0; i < nth->FileHeader.NumberOfSections; i++, section++) { - if (!strcasecmp((const char*)section->Name, ".stab")) - { - stabs = section->VirtualAddress; - stabsize = section->SizeOfRawData; - } - else if (!strncasecmp((const char*)section->Name, ".stabstr", 8)) - { - stabstr = section->VirtualAddress; - stabstrsize = section->SizeOfRawData; - } + if (!strcasecmp((const char*)section->Name, ".stab")) sect_stabs = section; + else if (!strncasecmp((const char*)section->Name, ".stabstr", 8)) sect_stabstr = section; } - - if (stabstrsize && stabsize) + if (sect_stabs && sect_stabstr) { - ret = stabs_parse(module, - module->module.BaseOfImage - nth->OptionalHeader.ImageBase, - RtlImageRvaToVa(nth, mapping, stabs, NULL), - stabsize, - RtlImageRvaToVa(nth, mapping, stabstr, NULL), - stabstrsize, + ret = stabs_parse(module, + module->module.BaseOfImage - nth->OptionalHeader.ImageBase, + pe_get_sect(nth, mapping, sect_stabs), pe_get_sect_size(sect_stabs), + pe_get_sect(nth, mapping, sect_stabstr), pe_get_sect_size(sect_stabstr), NULL, NULL); if (ret) pe_load_symbol_table(module, nth, mapping); } - TRACE("%s the STABS debug info\n", ret ? "successfully loaded" : "failed to load"); + + return ret; +} + +/****************************************************************** + * pe_load_dwarf + * + * look for dwarf information in PE header (it's also a way for the mingw compiler + * to provide its debugging information) + */ +static BOOL pe_load_dwarf(const struct process* pcs, struct module* module, + void* mapping, IMAGE_NT_HEADERS* nth) +{ + IMAGE_SECTION_HEADER* section; + IMAGE_SECTION_HEADER* sect_debuginfo = NULL; + IMAGE_SECTION_HEADER* sect_debugstr = NULL; + IMAGE_SECTION_HEADER* sect_debugabbrev = NULL; + IMAGE_SECTION_HEADER* sect_debugline = NULL; + IMAGE_SECTION_HEADER* sect_debugloc = NULL; + int i; + const char* strtable; + const char* sectname; + BOOL ret; + + if (nth->FileHeader.PointerToSymbolTable && nth->FileHeader.NumberOfSymbols) + /* FIXME: no way to get strtable size */ + strtable = (const char*)mapping + nth->FileHeader.PointerToSymbolTable + + nth->FileHeader.NumberOfSymbols * sizeof(IMAGE_SYMBOL); + else strtable = NULL; + + section = (IMAGE_SECTION_HEADER*) + ((char*)&nth->OptionalHeader + nth->FileHeader.SizeOfOptionalHeader); + for (i = 0; i < nth->FileHeader.NumberOfSections; i++, section++) + { + sectname = (const char*)section->Name; + /* long section names start with a '/' (at least on MinGW32) */ + if (*sectname == '/' && strtable) + sectname = strtable + atoi(sectname + 1); + if (!strcasecmp(sectname, ".debug_info")) sect_debuginfo = section; + else if (!strcasecmp(sectname, ".debug_str")) sect_debugstr = section; + else if (!strcasecmp(sectname, ".debug_abbrev")) sect_debugabbrev = section; + else if (!strcasecmp(sectname, ".debug_line")) sect_debugline = section; + else if (!strcasecmp(sectname, ".debug_loc")) sect_debugloc = section; + } + if (sect_debuginfo) + { + ret = dwarf2_parse(module, + module->module.BaseOfImage - nth->OptionalHeader.ImageBase, + NULL, /* FIXME: some thunks to deal with ? */ + pe_get_sect(nth, mapping, sect_debuginfo), pe_get_sect_size(sect_debuginfo), + pe_get_sect(nth, mapping, sect_debugabbrev), pe_get_sect_size(sect_debugabbrev), + pe_get_sect(nth, mapping, sect_debugstr), pe_get_sect_size(sect_debugstr), + pe_get_sect(nth, mapping, sect_debugline), pe_get_sect_size(sect_debugline), + pe_get_sect(nth, mapping, sect_debugloc), pe_get_sect_size(sect_debugloc)); + } + TRACE("%s the DWARF debug info\n", ret ? "successfully loaded" : "failed to load"); + return ret; } @@ -349,6 +406,7 @@ BOOL pe_load_debug_info(const struct process* pcs, struct module* module) if (!(dbghelp_options & SYMOPT_PUBLICS_ONLY)) { ret = pe_load_stabs(pcs, module, mapping, nth) || + pe_load_dwarf(pcs, module, mapping, nth) || pe_load_msc_debug_info(pcs, module, mapping, nth); /* if we still have no debug info (we could only get SymExport at this * point), then do the SymExport except if we have an ELF container,
1
0
0
0
Eric Pouech : winedump: Add support for long section names ( at least used by MinGW).
by Alexandre Julliard
24 Dec '09
24 Dec '09
Module: wine Branch: master Commit: 1c238c77f7679fc2122c07f2e1a05ab0a40f8e6c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1c238c77f7679fc2122c07f2e…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Wed Dec 23 22:05:44 2009 +0100 winedump: Add support for long section names (at least used by MinGW). --- tools/winedump/lib.c | 2 +- tools/winedump/pe.c | 22 ++++++++++++++++++---- tools/winedump/winedump.h | 2 +- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/tools/winedump/lib.c b/tools/winedump/lib.c index 85f305d..de5184a 100644 --- a/tools/winedump/lib.c +++ b/tools/winedump/lib.c @@ -88,7 +88,7 @@ static void dump_long_import(const void *base, const IMAGE_SECTION_HEADER *ish, for (i = 0; i < num_sect; i++) { if (globals.do_dumpheader) - dump_section(&ish[i]); + dump_section(&ish[i], NULL); if (globals.do_dump_rawdata) { diff --git a/tools/winedump/pe.c b/tools/winedump/pe.c index a79593c..1f9c5a7 100644 --- a/tools/winedump/pe.c +++ b/tools/winedump/pe.c @@ -371,10 +371,14 @@ static void dump_pe_header(void) dump_optional_header((const IMAGE_OPTIONAL_HEADER32*)&PE_nt_headers->OptionalHeader, PE_nt_headers->FileHeader.SizeOfOptionalHeader); } -void dump_section(const IMAGE_SECTION_HEADER *sectHead) +void dump_section(const IMAGE_SECTION_HEADER *sectHead, const char* strtable) { - printf(" %-8.8s VirtSize: 0x%08x VirtAddr: 0x%08x\n", - sectHead->Name, sectHead->Misc.VirtualSize, sectHead->VirtualAddress); + if (strtable && sectHead->Name[0] == '/') /* long section name */ + printf(" %.8s (%s)", sectHead->Name, strtable + atoi((const char*)sectHead->Name + 1)); + else + printf(" %-8.8s", sectHead->Name); + printf(" VirtSize: 0x%08x VirtAddr: 0x%08x\n", + sectHead->Misc.VirtualSize, sectHead->VirtualAddress); printf(" raw data offs: 0x%08x raw data size: 0x%08x\n", sectHead->PointerToRawData, sectHead->SizeOfRawData); printf(" relocation offs: 0x%08x relocations: 0x%08x\n", @@ -448,11 +452,21 @@ static void dump_sections(const void *base, const void* addr, unsigned num_sect) { const IMAGE_SECTION_HEADER* sectHead = addr; unsigned i; + const char* strtable; + + if (PE_nt_headers->FileHeader.PointerToSymbolTable && PE_nt_headers->FileHeader.NumberOfSymbols) + { + /* FIXME: no way to get strtable size */ + strtable = (const char*)base + + PE_nt_headers->FileHeader.PointerToSymbolTable + + PE_nt_headers->FileHeader.NumberOfSymbols * sizeof(IMAGE_SYMBOL); + } + else strtable = NULL; printf("Section Table\n"); for (i = 0; i < num_sect; i++, sectHead++) { - dump_section(sectHead); + dump_section(sectHead, strtable); if (globals.do_dump_rawdata) { diff --git a/tools/winedump/winedump.h b/tools/winedump/winedump.h index 9ad20a5..1f49369 100644 --- a/tools/winedump/winedump.h +++ b/tools/winedump/winedump.h @@ -234,7 +234,7 @@ const char* get_guid_str(const GUID* guid); const char* get_symbol_str(const char* symname); void dump_file_header(const IMAGE_FILE_HEADER *); void dump_optional_header(const IMAGE_OPTIONAL_HEADER32 *, UINT); -void dump_section(const IMAGE_SECTION_HEADER *); +void dump_section(const IMAGE_SECTION_HEADER *, const char* strtable); enum FileSig get_kind_exec(void); void dos_dump( void );
1
0
0
0
Nikolay Sivov : comctl32/rebar: Avoid empty band range when changing layout .
by Alexandre Julliard
24 Dec '09
24 Dec '09
Module: wine Branch: master Commit: 02c06f0d6662d5490761c7c43418b34e91228e95 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=02c06f0d6662d5490761c7c43…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Thu Dec 24 00:54:29 2009 +0300 comctl32/rebar: Avoid empty band range when changing layout. --- dlls/comctl32/rebar.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c index 90e79d5..021bc16 100644 --- a/dlls/comctl32/rebar.c +++ b/dlls/comctl32/rebar.c @@ -1377,7 +1377,8 @@ REBAR_Layout(REBAR_INFO *infoPtr) xMin += lpBand->cxMinBand; } - REBAR_LayoutRow(infoPtr, rowstart, infoPtr->uNumBands, adjcx, &row, &yPos); + if (rowstart < infoPtr->uNumBands) + REBAR_LayoutRow(infoPtr, rowstart, infoPtr->uNumBands, adjcx, &row, &yPos); if (!(infoPtr->dwStyle & RBS_VARHEIGHT)) yPos = REBAR_SetBandsHeight(infoPtr, first_visible(infoPtr), infoPtr->uNumBands, 0);
1
0
0
0
Nikolay Sivov : comctl32/comboex: Move debugging traces that require additional code into TRACE_ON() condition.
by Alexandre Julliard
24 Dec '09
24 Dec '09
Module: wine Branch: master Commit: 6398448974136abb443356166a7e7009e3a9879e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6398448974136abb443356166…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Thu Dec 24 00:00:46 2009 +0300 comctl32/comboex: Move debugging traces that require additional code into TRACE_ON() condition. --- dlls/comctl32/comboex.c | 53 +++++++++++++++++++++++++--------------------- 1 files changed, 29 insertions(+), 24 deletions(-) diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c index 813504c..14079b2 100644 --- a/dlls/comctl32/comboex.c +++ b/dlls/comctl32/comboex.c @@ -544,7 +544,7 @@ static BOOL COMBOEX_GetItemW (const COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit) INT_PTR index = cit->iItem; CBE_ITEMDATA *item; - TRACE("(...)\n"); + TRACE("\n"); /* if item number requested does not exist then return failure */ if ((index >= infoPtr->nb_items) || (index < -1)) return FALSE; @@ -564,7 +564,7 @@ static BOOL COMBOEX_GetItemA (const COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit) { COMBOBOXEXITEMW tmpcit; - TRACE("(...)\n"); + TRACE("\n"); tmpcit.mask = cit->mask; tmpcit.iItem = cit->iItem; @@ -747,7 +747,7 @@ static HIMAGELIST COMBOEX_SetImageList (COMBOEX_INFO *infoPtr, HIMAGELIST himl) { HIMAGELIST himlTemp = infoPtr->himl; - TRACE("(...)\n"); + TRACE("\n"); infoPtr->himl = himl; @@ -967,7 +967,7 @@ static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs) static const WCHAR NIL[] = { 0 }; COMBOEX_INFO *infoPtr; LOGFONTW mylogfont; - RECT wnrc1, clrc1, cmbwrc; + RECT win_rect; INT i; /* allocate memory for info structure */ @@ -992,11 +992,13 @@ static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs) SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); - /* create combo box */ - GetWindowRect(hwnd, &wnrc1); - GetClientRect(hwnd, &clrc1); - TRACE("EX window=(%s), client=(%s)\n", - wine_dbgstr_rect(&wnrc1), wine_dbgstr_rect(&clrc1)); + if (TRACE_ON(comboex)) { + RECT client, rect; + GetWindowRect(hwnd, &rect); + GetClientRect(hwnd, &client); + TRACE("EX window=(%s), client=(%s)\n", + wine_dbgstr_rect(&rect), wine_dbgstr_rect(&client)); + } /* Native version of ComboEx creates the ComboBox with DROPDOWNLIST */ /* specified. It then creates it's own version of the EDIT control */ @@ -1071,20 +1073,24 @@ static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs) /* Above is fairly certain, below is much less certain. */ - GetWindowRect(hwnd, &wnrc1); - GetClientRect(hwnd, &clrc1); - GetWindowRect(infoPtr->hwndCombo, &cmbwrc); - TRACE("EX window=(%s) client=(%s) CB wnd=(%s)\n", - wine_dbgstr_rect(&wnrc1), wine_dbgstr_rect(&clrc1), - wine_dbgstr_rect(&cmbwrc)); - SetWindowPos(infoPtr->hwndCombo, HWND_TOP, - 0, 0, wnrc1.right-wnrc1.left, wnrc1.bottom-wnrc1.top, + GetWindowRect(hwnd, &win_rect); + + if (TRACE_ON(comboex)) { + RECT client, rect; + GetClientRect(hwnd, &client); + GetWindowRect(infoPtr->hwndCombo, &rect); + TRACE("EX window=(%s) client=(%s) CB wnd=(%s)\n", + wine_dbgstr_rect(&win_rect), wine_dbgstr_rect(&client), + wine_dbgstr_rect(&rect)); + } + SetWindowPos(infoPtr->hwndCombo, HWND_TOP, 0, 0, + win_rect.right - win_rect.left, win_rect.bottom - win_rect.top, SWP_NOACTIVATE | SWP_NOREDRAW); - GetWindowRect(infoPtr->hwndCombo, &cmbwrc); - TRACE("CB window=(%s)\n", wine_dbgstr_rect(&cmbwrc)); - SetWindowPos(hwnd, HWND_TOP, - 0, 0, cmbwrc.right-cmbwrc.left, cmbwrc.bottom-cmbwrc.top, + GetWindowRect(infoPtr->hwndCombo, &win_rect); + TRACE("CB window=(%s)\n", wine_dbgstr_rect(&win_rect)); + SetWindowPos(hwnd, HWND_TOP, 0, 0, + win_rect.right - win_rect.left, win_rect.bottom - win_rect.top, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOMOVE); COMBOEX_AdjustEditPos (infoPtr); @@ -1357,12 +1363,11 @@ static LRESULT COMBOEX_DrawItem (const COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT con (dis->itemAction == ODA_DRAWENTIRE)) { /* draw of edit control data */ - /* testing */ - { + if (TRACE_ON(comboex)) { RECT exrc, cbrc, edrc; GetWindowRect (infoPtr->hwndSelf, &exrc); GetWindowRect (infoPtr->hwndCombo, &cbrc); - edrc.left=edrc.top=edrc.right=edrc.bottom=-1; + edrc.left = edrc.top = edrc.right = edrc.bottom = -1; if (infoPtr->hwndEdit) GetWindowRect (infoPtr->hwndEdit, &edrc); TRACE("window rects ex=(%s), cb=(%s), ed=(%s)\n", wine_dbgstr_rect(&exrc), wine_dbgstr_rect(&cbrc),
1
0
0
0
Nikolay Sivov : comctl32/comboex: Get rid of useless helper.
by Alexandre Julliard
24 Dec '09
24 Dec '09
Module: wine Branch: master Commit: 253edf0fbbe64504fbcbf958c2a8d644eee2f11e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=253edf0fbbe64504fbcbf958c…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Wed Dec 23 23:35:08 2009 +0300 comctl32/comboex: Get rid of useless helper. --- dlls/comctl32/comboex.c | 14 +++----------- 1 files changed, 3 insertions(+), 11 deletions(-) diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c index 185f1e1..813504c 100644 --- a/dlls/comctl32/comboex.c +++ b/dlls/comctl32/comboex.c @@ -484,13 +484,6 @@ static CBE_ITEMDATA * COMBOEX_FindItem(const COMBOEX_INFO *infoPtr, INT_PTR inde return item; } - -static inline BOOL COMBOEX_HasEdit(COMBOEX_INFO const *infoPtr) -{ - return infoPtr->hwndEdit ? TRUE : FALSE; -} - - /* *** CBEM_xxx message support *** */ static UINT COMBOEX_GetListboxText(const COMBOEX_INFO *infoPtr, INT_PTR n, LPWSTR buf) @@ -557,7 +550,7 @@ static BOOL COMBOEX_GetItemW (const COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit) if ((index >= infoPtr->nb_items) || (index < -1)) return FALSE; /* if the item is the edit control and there is no edit control, skip */ - if ((index == -1) && !COMBOEX_HasEdit(infoPtr)) return FALSE; + if ((index == -1) && !infoPtr->hwndEdit) return FALSE; if (!(item = COMBOEX_FindItem(infoPtr, index))) return FALSE; @@ -604,8 +597,7 @@ static BOOL COMBOEX_GetItemA (const COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit) static inline BOOL COMBOEX_HasEditChanged (COMBOEX_INFO const *infoPtr) { - return COMBOEX_HasEdit(infoPtr) && - (infoPtr->flags & WCBE_EDITHASCHANGED) == WCBE_EDITHASCHANGED; + return infoPtr->hwndEdit && (infoPtr->flags & WCBE_EDITHASCHANGED) == WCBE_EDITHASCHANGED; } @@ -778,7 +770,7 @@ static BOOL COMBOEX_SetItemW (const COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit) if ((index >= infoPtr->nb_items) || (index < -1)) return FALSE; /* if the item is the edit control and there is no edit control, skip */ - if ((index == -1) && !COMBOEX_HasEdit(infoPtr)) return FALSE; + if ((index == -1) && !infoPtr->hwndEdit) return FALSE; if (!(item = COMBOEX_FindItem(infoPtr, index))) return FALSE;
1
0
0
0
Nikolay Sivov : comctl32/comboex: Don' t invalidate all windows if Edit box isn't set up.
by Alexandre Julliard
24 Dec '09
24 Dec '09
Module: wine Branch: master Commit: 7d748b6ba0f7da0f18e88de91e6117b8793af6c0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7d748b6ba0f7da0f18e88de91…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Wed Dec 23 23:32:21 2009 +0300 comctl32/comboex: Don't invalidate all windows if Edit box isn't set up. --- dlls/comctl32/comboex.c | 14 +++++--------- 1 files changed, 5 insertions(+), 9 deletions(-) diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c index 1609b90..185f1e1 100644 --- a/dlls/comctl32/comboex.c +++ b/dlls/comctl32/comboex.c @@ -1149,7 +1149,7 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam) */ ShowWindow (infoPtr->hwndEdit, SW_SHOW); InvalidateRect (infoPtr->hwndCombo, 0, TRUE); - InvalidateRect (infoPtr->hwndEdit, 0, TRUE); + if (infoPtr->hwndEdit) InvalidateRect (infoPtr->hwndEdit, 0, TRUE); cursel = SendMessageW (infoPtr->hwndCombo, CB_GETCURSEL, 0, 0); if (cursel == -1) { cmp_func_t cmptext = get_cmp_func(infoPtr); @@ -1164,8 +1164,7 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam) if ((cursel == n) || ((INT_PTR)item == CB_ERR)) { TRACE("failed to find match??? item=%p cursel=%d\n", item, cursel); - if (infoPtr->hwndEdit) - SetFocus(infoPtr->hwndEdit); + if (infoPtr->hwndEdit) SetFocus(infoPtr->hwndEdit); return 0; } } @@ -1174,8 +1173,7 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam) if ((INT_PTR)item == CB_ERR) { TRACE("failed to find match??? item=%p cursel=%d\n", item, cursel); - if (infoPtr->hwndEdit) - SetFocus(infoPtr->hwndEdit); + if (infoPtr->hwndEdit) SetFocus(infoPtr->hwndEdit); return 0; } } @@ -1271,8 +1269,7 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam) * after passing the command to the parent of the ComboEx. */ lret = SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf); - if (infoPtr->hwndEdit) - SetFocus(infoPtr->hwndEdit); + if (infoPtr->hwndEdit) SetFocus(infoPtr->hwndEdit); return lret; } return 0; @@ -1374,8 +1371,7 @@ static LRESULT COMBOEX_DrawItem (const COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT con GetWindowRect (infoPtr->hwndSelf, &exrc); GetWindowRect (infoPtr->hwndCombo, &cbrc); edrc.left=edrc.top=edrc.right=edrc.bottom=-1; - if (infoPtr->hwndEdit) - GetWindowRect (infoPtr->hwndEdit, &edrc); + if (infoPtr->hwndEdit) GetWindowRect (infoPtr->hwndEdit, &edrc); TRACE("window rects ex=(%s), cb=(%s), ed=(%s)\n", wine_dbgstr_rect(&exrc), wine_dbgstr_rect(&cbrc), wine_dbgstr_rect(&edrc));
1
0
0
0
Nikolay Sivov : comctl32/comboex: Fix silly typo in CBEM_SETITEM handler ( lParam wasn't set).
by Alexandre Julliard
24 Dec '09
24 Dec '09
Module: wine Branch: master Commit: 7deb2779007993a8031ce943486120d42d82c22f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7deb2779007993a8031ce9434…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Wed Dec 23 23:08:32 2009 +0300 comctl32/comboex: Fix silly typo in CBEM_SETITEM handler (lParam wasn't set). --- dlls/comctl32/comboex.c | 2 +- dlls/comctl32/tests/comboex.c | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c index d423527..1609b90 100644 --- a/dlls/comctl32/comboex.c +++ b/dlls/comctl32/comboex.c @@ -806,7 +806,7 @@ static BOOL COMBOEX_SetItemW (const COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit) if (cit->mask & CBEIF_INDENT) item->iIndent = cit->iIndent; if (cit->mask & CBEIF_LPARAM) - cit->lParam = cit->lParam; + item->lParam = cit->lParam; if (TRACE_ON(comboex)) COMBOEX_DumpItem (item); diff --git a/dlls/comctl32/tests/comboex.c b/dlls/comctl32/tests/comboex.c index f732af5..d6bbce1 100644 --- a/dlls/comctl32/tests/comboex.c +++ b/dlls/comctl32/tests/comboex.c @@ -29,6 +29,8 @@ #define EDITBOX_ID 0 +#define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got) + static struct msg_sequence *sequences[NUM_MSG_SEQUENCES]; static HWND hComboExParentWnd; @@ -491,10 +493,27 @@ static void test_get_set_item(void) item.pszText = textA; item.iItem = -1; ret = SendMessage(hComboEx, CBEM_SETITEMA, 0, (LPARAM)&item); - ok(ret, "CBEM_SETITEMA failed\n"); + expect(TRUE, ret); ok_sequence(sequences, EDITBOX_SEQ_INDEX, test_setitem_edit_seq, "set item data for edit", FALSE); + /* get/set lParam */ + item.mask = CBEIF_LPARAM; + item.iItem = -1; + item.lParam = 0xdeadbeef; + ret = SendMessage(hComboEx, CBEM_GETITEMA, 0, (LPARAM)&item); + expect(TRUE, ret); + ok(item.lParam == 0, "Expected zero, got %ld\n", item.lParam); + + item.lParam = 0xdeadbeef; + ret = SendMessage(hComboEx, CBEM_SETITEMA, 0, (LPARAM)&item); + expect(TRUE, ret); + + item.lParam = 0; + ret = SendMessage(hComboEx, CBEM_GETITEMA, 0, (LPARAM)&item); + expect(TRUE, ret); + ok(item.lParam == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", item.lParam); + DestroyWindow(hComboEx); }
1
0
0
0
Nikolay Sivov : comctl32/comboex: Add test for internally sent Edit messages, remove corresponding comments.
by Alexandre Julliard
24 Dec '09
24 Dec '09
Module: wine Branch: master Commit: 96d965f29575c8fd6e7561236bbf1dcb9901fd9a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=96d965f29575c8fd6e7561236…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Wed Dec 23 22:51:54 2009 +0300 comctl32/comboex: Add test for internally sent Edit messages, remove corresponding comments. --- dlls/comctl32/comboex.c | 5 +-- dlls/comctl32/tests/comboex.c | 87 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 4 deletions(-) diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c index 62178f1..d423527 100644 --- a/dlls/comctl32/comboex.c +++ b/dlls/comctl32/comboex.c @@ -451,10 +451,7 @@ static void COMBOEX_ReSize (const COMBOEX_INFO *infoPtr) static void COMBOEX_SetEditText (const COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item) { if (!infoPtr->hwndEdit) return; - /* native issues the following messages to the {Edit} control */ - /* WM_SETTEXT (0,addr) */ - /* EM_SETSEL32 (0,0) */ - /* EM_SETSEL32 (0,-1) */ + if (item->mask & CBEIF_TEXT) { SendMessageW (infoPtr->hwndEdit, WM_SETTEXT, 0, (LPARAM)COMBOEX_GetText(infoPtr, item)); SendMessageW (infoPtr->hwndEdit, EM_SETSEL, 0, 0); diff --git a/dlls/comctl32/tests/comboex.c b/dlls/comctl32/tests/comboex.c index a8d7f79..f732af5 100644 --- a/dlls/comctl32/tests/comboex.c +++ b/dlls/comctl32/tests/comboex.c @@ -22,6 +22,14 @@ #include <commctrl.h> #include "wine/test.h" +#include "msg.h" + +#define EDITBOX_SEQ_INDEX 0 +#define NUM_MSG_SEQUENCES 1 + +#define EDITBOX_ID 0 + +static struct msg_sequence *sequences[NUM_MSG_SEQUENCES]; static HWND hComboExParentWnd; static HINSTANCE hMainHinst; @@ -70,6 +78,50 @@ static LONG getItem(HWND cbex, int idx, COMBOBOXEXITEM *cbItem) { return (LONG)SendMessage(cbex, CBEM_GETITEM, 0, (LPARAM)cbItem); } +static LRESULT WINAPI editbox_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + WNDPROC oldproc = (WNDPROC)GetWindowLongPtrA(hwnd, GWLP_USERDATA); + static LONG defwndproc_counter = 0; + LRESULT ret; + struct message msg; + + msg.message = message; + msg.flags = sent|wparam|lparam; + if (defwndproc_counter) msg.flags |= defwinproc; + msg.wParam = wParam; + msg.lParam = lParam; + msg.id = EDITBOX_ID; + + if (message != WM_PAINT && + message != WM_ERASEBKGND && + message != WM_NCPAINT && + message != WM_NCHITTEST && + message != WM_GETTEXT && + message != WM_GETICON && + message != WM_DEVICECHANGE) + { + add_message(sequences, EDITBOX_SEQ_INDEX, &msg); + } + + defwndproc_counter++; + ret = CallWindowProcA(oldproc, hwnd, message, wParam, lParam); + defwndproc_counter--; + return ret; +} + +static HWND subclass_editbox(HWND hwndComboEx) +{ + WNDPROC oldproc; + HWND hwnd; + + hwnd = (HWND)SendMessage(hwndComboEx, CBEM_GETEDITCONTROL, 0, 0); + oldproc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC, + (LONG_PTR)editbox_subclass_proc); + SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)oldproc); + + return hwnd; +} + static void test_comboboxex(void) { HWND myHwnd = 0; LONG res = -1; @@ -414,15 +466,50 @@ static void test_comboboxex_subclass(void) DestroyWindow(hComboEx); } +static const struct message test_setitem_edit_seq[] = { + { WM_SETTEXT, sent|id, 0, 0, EDITBOX_ID }, + { EM_SETSEL, sent|id|wparam|lparam, 0, 0, EDITBOX_ID }, + { EM_SETSEL, sent|id|wparam|lparam, 0, -1, EDITBOX_ID }, + { 0 } +}; + +static void test_get_set_item(void) +{ + char textA[] = "test"; + HWND hComboEx; + COMBOBOXEXITEMA item; + BOOL ret; + + hComboEx = createComboEx(WS_BORDER | WS_VISIBLE | WS_CHILD | CBS_DROPDOWN); + + subclass_editbox(hComboEx); + + flush_sequences(sequences, NUM_MSG_SEQUENCES); + + memset(&item, 0, sizeof(item)); + item.mask = CBEIF_TEXT; + item.pszText = textA; + item.iItem = -1; + ret = SendMessage(hComboEx, CBEM_SETITEMA, 0, (LPARAM)&item); + ok(ret, "CBEM_SETITEMA failed\n"); + + ok_sequence(sequences, EDITBOX_SEQ_INDEX, test_setitem_edit_seq, "set item data for edit", FALSE); + + DestroyWindow(hComboEx); +} + START_TEST(comboex) { if (!init()) return; + init_msg_sequences(sequences, NUM_MSG_SEQUENCES); + test_comboboxex(); test_WM_LBUTTONDOWN(); test_CB_GETLBTEXT(); test_comboboxex_subclass(); + test_get_set_item(); cleanup(); }
1
0
0
0
Nikolay Sivov : comctl32/comboex: Use subclass chain for internally used controls.
by Alexandre Julliard
24 Dec '09
24 Dec '09
Module: wine Branch: master Commit: ecc89bf6eff47d21a54b208fc2e7a646e06db2cc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ecc89bf6eff47d21a54b208fc…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Wed Dec 23 22:50:26 2009 +0300 comctl32/comboex: Use subclass chain for internally used controls. --- dlls/comctl32/comboex.c | 94 ++++++++++++++++------------------------- dlls/comctl32/tests/comboex.c | 25 +++++++++++ 2 files changed, 61 insertions(+), 58 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=ecc89bf6eff47d21a54b2…
1
0
0
0
← Newer
1
...
17
18
19
20
21
22
23
...
124
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
119
120
121
122
123
124
Results per page:
10
25
50
100
200