[Bug 16491] Pindersoft DotNet Test hangs when advancing months (monthcal day state/notification data handling)
wine-bugs at winehq.org
wine-bugs at winehq.org
Sun May 29 10:05:41 CDT 2011
http://bugs.winehq.org/show_bug.cgi?id=16491
Anastasius Focht <focht at gmx.net> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords|patch |
URL|http://www.pindersoft.com/d |http://pindersoft.com/ftp/D
|otnettest.htm |otNetTestDNF2.zip
Summary|monthcal: |Pindersoft DotNet Test
|MONTHCAL_GetMonthRange not |hangs when advancing months
|implemented |(monthcal day
| |state/notification data
| |handling)
--- Comment #11 from Anastasius Focht <focht at gmx.net> 2011-05-29 10:05:37 CDT ---
Hello,
updating download link and changing summary to reflect current state.
Still happens, sometimes you need to advance months quickly.
You need to revise the following code fragment:
http://source.winehq.org/git/wine.git/blob/HEAD:/dlls/comctl32/monthcal.c#l1798
--- snip dlls/comctl32/monthcal.c ---
1798 static void MONTHCAL_NotifyDayState(MONTHCAL_INFO *infoPtr)
1799 {
1800 if(infoPtr->dwStyle & MCS_DAYSTATE) {
1801 NMDAYSTATE nmds;
1802
1803 nmds.nmhdr.hwndFrom = infoPtr->hwndSelf;
1804 nmds.nmhdr.idFrom = GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID);
1805 nmds.nmhdr.code = MCN_GETDAYSTATE;
1806 nmds.cDayState = infoPtr->monthRange;
1807 nmds.prgDayState = Alloc(infoPtr->monthRange *
sizeof(MONTHDAYSTATE));
1808
1809 nmds.stStart = infoPtr->todaysDate;
1810 nmds.stStart.wYear = infoPtr->minSel.wYear;
1811 nmds.stStart.wMonth = infoPtr->minSel.wMonth;
1812 nmds.stStart.wDay = 1;
1813
1814 SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, nmds.nmhdr.idFrom,
(LPARAM)&nmds);
1815 memcpy(infoPtr->monthdayState, nmds.prgDayState,
infoPtr->monthRange*sizeof(MONTHDAYSTATE));
1816
1817 Free(nmds.prgDayState);
1818 }
1819 }
--- snip dlls/comctl32/monthcal.c ---
Passing day state structure and expect it still containing the _same_ member
data after notification handling? ;-)
Have a look at the following notification message handler snippet "Setting Day
States":
http://msdn.microsoft.com/en-us/library/bb760921.aspx
After fixing day state handling, the months can be advanced without any heap
corruption anymore (which is the reason for hang).
$ sha1sum DotNetTestDNF2.zip
62ac4b8c1590ac8e7000be28191b9d6b3003042c DotNetTestDNF2.zip
$ sha1sum DotNetTestDNF2.exe
60a9ef5cf5b3008fd44b827e350f671ec2cbfb10 DotNetTestDNF2.exe
$ wine --version
wine-1.3.21
Regards
--
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.
More information about the wine-bugs
mailing list