Module: wine
Branch: master
Commit: 96291a4b0d9b0cd036246af612e99384320a68a7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=96291a4b0d9b0cd036246af61…
Author: Christian Costa <titan.costa(a)wanadoo.fr>
Date: Thu Dec 18 21:22:32 2008 +0100
winealsa.drv: Handle midi sysex greater than a buffer.
---
dlls/winealsa.drv/midi.c | 27 +++++++++++++++++----------
1 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/dlls/winealsa.drv/midi.c b/dlls/winealsa.drv/midi.c
index dedfe02..c1bcb10 100644
--- a/dlls/winealsa.drv/midi.c
+++ b/dlls/winealsa.drv/midi.c
@@ -374,27 +374,34 @@ static DWORD WINAPI midRecThread(LPVOID arg)
break;
case SND_SEQ_EVENT_SYSEX:
{
+ int pos = 0;
int len = ev->data.ext.len;
LPBYTE ptr = (BYTE*) ev->data.ext.ptr;
LPMIDIHDR lpMidiHdr;
- /* FIXME: Should handle sysex greater than lpMidiHdr->dwBufferLength */
EnterCriticalSection(&crit_sect);
- if ((lpMidiHdr = MidiInDev[wDevID].lpQueueHdr) != NULL) {
- if (lpMidiHdr->dwBytesRecorded + len <= lpMidiHdr->dwBufferLength) {
- memcpy(lpMidiHdr->lpData + lpMidiHdr->dwBytesRecorded, ptr, len);
- lpMidiHdr->dwBytesRecorded += len;
- if (*(ptr + (len-1)) == 0xF7) {
+ while (len) {
+ if ((lpMidiHdr = MidiInDev[wDevID].lpQueueHdr) != NULL) {
+ int copylen = min(len, lpMidiHdr->dwBufferLength - lpMidiHdr->dwBytesRecorded);
+ memcpy(lpMidiHdr->lpData + lpMidiHdr->dwBytesRecorded, ptr + pos, copylen);
+ lpMidiHdr->dwBytesRecorded += copylen;
+ len -= copylen;
+ pos += copylen;
+ /* We check if we reach the end of buffer or the end of sysex before notifying
+ * to handle the case where ALSA splitted the sysex into several events */
+ if ((lpMidiHdr->dwBytesRecorded == lpMidiHdr->dwBufferLength) ||
+ (*(BYTE*)(lpMidiHdr->lpData + lpMidiHdr->dwBytesRecorded - 1) == 0xF7)) {
lpMidiHdr->dwFlags &= ~MHDR_INQUEUE;
lpMidiHdr->dwFlags |= MHDR_DONE;
MidiInDev[wDevID].lpQueueHdr = (LPMIDIHDR)lpMidiHdr->lpNext;
if (MIDI_NotifyClient(wDevID, MIM_LONGDATA, (DWORD_PTR)lpMidiHdr, dwTime) != MMSYSERR_NOERROR)
WARN("Couldn't notify client\n");
}
- } else
- FIXME("No enough space in the buffer to store sysex!\n");
- } else
- FIXME("Sysex received but no buffer to store it!\n");
+ } else {
+ FIXME("Sysex data received but no buffer to store it!\n");
+ break;
+ }
+ }
LeaveCriticalSection(&crit_sect);
}
break;
Module: wine
Branch: master
Commit: 5dc1271ba6af791e2f7475da12ed7fb1b25451ba
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5dc1271ba6af791e2f7475da1…
Author: Dylan Smith <dylan.ah.smith(a)gmail.com>
Date: Fri Dec 19 10:57:28 2008 -0500
richedit: Move message handling to function callable without window.
In order to make the message handling available to windowless richedit
controls, the message handling must be in a function that can be
called from the ITextServices_TxSendMessage method. This method will
never have a handle to a window to pass to RichEditWndProc_common in
order to get the editor with GetWindowLongPtrW, but passing the editor
will work (even if hWnd is NULL).
---
dlls/riched20/editor.c | 132 +++++++++++++++++++++++++++++------------------
dlls/riched20/editor.h | 2 +
2 files changed, 83 insertions(+), 51 deletions(-)
Diff: http://source.winehq.org/git/wine.git/?a=commitdiff;h=5dc1271ba6af791e2f747…
Module: wine
Branch: master
Commit: 97a83147b3ce867604088fec0072290c044ed30e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=97a83147b3ce867604088fec0…
Author: Dylan Smith <dylan.ah.smith(a)gmail.com>
Date: Fri Dec 19 09:54:58 2008 -0500
richedit: Avoid re-calculating positions found in wrapping for painting.
When the text is wrapped, the positions for all the runs, paragraphs,
and cells are already calculated and stored. The only thing left to do
for painting is to offset them by the formatting rectangle and the
scroll position.
---
dlls/riched20/paint.c | 203 +++++++++++++++++++------------------------------
dlls/riched20/wrap.c | 3 +-
2 files changed, 81 insertions(+), 125 deletions(-)
Diff: http://source.winehq.org/git/wine.git/?a=commitdiff;h=97a83147b3ce867604088…