Commit d1ce8b28 authored by Alexandre Julliard's avatar Alexandre Julliard

Release 960902

Sun Sep 1 19:22:46 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [misc/commdlg.c] [if1632/commdlg.spec] Fixed some SEGPTR problems. * [windows/winproc.c] Added message translation for WM_COMPAREITEM, WM_DELETEITEM and WM_MEASUREITEM Fixed 16-to-32 translation for WM_HSCROLL/WM_VSCROLL. Fri Aug 30 13:39:00 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de> * [files/drive.c] GetDriveType16 should report CDROMs as DRIVE_REMOTE (ACME setup). * [multimedia/audio.c] The minimum audiobuffer size shrunk somewhere in linux 1.3.xx below 4096 bytes. * [multimedia/mcistring.c] Segptr string handling fixed & enhanced. * [if1632/crtdll.spec][misc/crtdll.c] malloc,free,_strupr,_stricmp,_strcmpi added. * [if1632/wsock32.spec][misc/winsock.c] More direct thunks into unix libc and WsControl-stub added. Thu Aug 29 23:54:25 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [objects/metafile.c] Bug fixes to both recording and playback of ExtTextOut(). Tue Aug 27 15:43:21 1996 Slaven Rezic <eserte@cs.tu-berlin.de> * [multimedia/audio.c] [multimedia/mcianim.c] [multimedia/mcicda.c] [multimedia/midi.c] Made cdaudio, audio and midi work for FreeBSD. Sun Aug 25 20:18:56 1996 Jukka Iivonen <iivonen@cc.helsinki.fi> * [misc/crtdll.c] [if1632/crtdll.spec] Added a lot of functions. * [misc/ole2nls.c] Added ID values for all languages in GetUserDefaultLCID(). Fri Aug 24 21:02:28 1996 Albrecht Kleine <kleine@ak.sax.de> * [windows/event.c] [windows/message.c] First attempt at hook WH_JOURNALPLAYBACK.
parent 0e270f45
This is release 960824 of Wine, the MS Windows emulator. This is still a
This is release 960902 of Wine, the MS Windows emulator. This is still a
developer's only release. There are many bugs and many unimplemented API
features. Most applications still do not work correctly.
Patches should be submitted to "julliard@lrc.epfl.ch". Please don't
forget to include a ChangeLog entry.
WHAT'S NEW with Wine-960824: (see ChangeLog for details)
- Very preliminary printer support.
- Perl script to generate wine.conf.
WHAT'S NEW with Wine-960902: (see ChangeLog for details)
- JOURNALPLAYBACK hook.
- Multimedia support for FreeBSD.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
......@@ -16,10 +16,10 @@ Because of lags created by using mirror, this message may reach you before
the release is available at the ftp sites. The sources will be available
from the following locations:
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-960824.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-960824.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-960824.tar.gz
ftp://aris.com/pub/linux/ALPHA/Wine/development/Wine-960824.tar.gz
ftp://sunsite.unc.edu/pub/Linux/ALPHA/wine/development/Wine-960902.tar.gz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-960902.tar.gz
ftp://ftp.infomagic.com/pub/mirrors/linux/wine/development/Wine-960902.tar.gz
ftp://aris.com/pub/linux/ALPHA/Wine/development/Wine-960902.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.
......
----------------------------------------------------------------------
Sun Sep 1 19:22:46 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [misc/commdlg.c] [if1632/commdlg.spec]
Fixed some SEGPTR problems.
* [windows/winproc.c]
Added message translation for WM_COMPAREITEM, WM_DELETEITEM
and WM_MEASUREITEM
Fixed 16-to-32 translation for WM_HSCROLL/WM_VSCROLL.
Fri Aug 30 13:39:00 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/drive.c]
GetDriveType16 should report CDROMs as DRIVE_REMOTE (ACME setup).
* [multimedia/audio.c]
The minimum audiobuffer size shrunk somewhere in linux 1.3.xx
below 4096 bytes.
* [multimedia/mcistring.c]
Segptr string handling fixed & enhanced.
* [if1632/crtdll.spec][misc/crtdll.c]
malloc,free,_strupr,_stricmp,_strcmpi added.
* [if1632/wsock32.spec][misc/winsock.c]
More direct thunks into unix libc and WsControl-stub added.
Thu Aug 29 23:54:25 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk>
* [objects/metafile.c]
Bug fixes to both recording and playback of ExtTextOut().
Tue Aug 27 15:43:21 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [multimedia/audio.c] [multimedia/mcianim.c]
[multimedia/mcicda.c] [multimedia/midi.c]
Made cdaudio, audio and midi work for FreeBSD.
Sun Aug 25 20:18:56 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [misc/crtdll.c] [if1632/crtdll.spec]
Added a lot of functions.
* [misc/ole2nls.c]
Added ID values for all languages in GetUserDefaultLCID().
Fri Aug 24 21:02:28 1996 Albrecht Kleine <kleine@ak.sax.de>
* [windows/event.c] [windows/message.c]
First attempt at hook WH_JOURNALPLAYBACK.
----------------------------------------------------------------------
Sat Aug 24 13:57:01 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [controls/scroll.c]
......
......@@ -61,7 +61,7 @@ static const pfPaint btnPaintFunc[MAX_BTN_TYPE] =
ReleaseDC( (wndPtr)->hwndSelf, hdc ); }
#define BUTTON_SEND_CTLCOLOR(wndPtr,hdc) \
SendMessage32A( GetParent((wndPtr)->hwndSelf), WM_CTLCOLORBTN, \
SendMessage32A( GetParent32((wndPtr)->hwndSelf), WM_CTLCOLORBTN, \
(hdc), (wndPtr)->hwndSelf )
static HBITMAP hbitmapCheckBoxes = 0;
......@@ -149,7 +149,7 @@ LRESULT ButtonWndProc(HWND32 hWnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
((infoPtr->state & 3) + 1), 0 );
break;
}
SendMessage32A( GetParent(hWnd), WM_COMMAND,
SendMessage32A( GetParent32(hWnd), WM_COMMAND,
MAKEWPARAM( wndPtr->wIDmenu, BN_CLICKED ), hWnd);
}
break;
......@@ -519,6 +519,6 @@ static void OB_Paint( WND *wndPtr, HDC hDC, WORD action )
dis.hDC = hDC;
dis.itemData = 0;
GetClientRect32( wndPtr->hwndSelf, &dis.rcItem );
SendMessage32A( GetParent(wndPtr->hwndSelf), WM_DRAWITEM,
SendMessage32A( GetParent32(wndPtr->hwndSelf), WM_DRAWITEM,
wndPtr->wIDmenu, (LPARAM)&dis );
}
......@@ -131,7 +131,7 @@ static LRESULT CBCreate(HWND hwnd, WPARAM wParam, LPARAM lParam)
if (cstyle & CBS_SORT) style |= LBS_SORT;
if (cstyle & CBS_HASSTRINGS) style |= LBS_HASSTRINGS;
style |= LBS_NOTIFY;
CreateListBoxStruct(hwnd, ODT_COMBOBOX, style, GetParent(hwnd));
CreateListBoxStruct(hwnd, ODT_COMBOBOX, style, GetParent16(hwnd));
CreateComboStruct(hwnd,cstyle);
lphl = ComboGetListHeader(hwnd);
......@@ -726,13 +726,13 @@ static LRESULT CBCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
InvalidateRect32(hwnd, NULL, TRUE);
}
}
SendMessage16(GetParent(hwnd),WM_COMMAND,id,
SendMessage16(GetParent16(hwnd),WM_COMMAND,id,
MAKELONG(hwnd, CBN_EDITUPDATE));
break;
case EN_CHANGE:SendMessage16(GetParent(hwnd),WM_COMMAND,id,
case EN_CHANGE:SendMessage16(GetParent16(hwnd),WM_COMMAND,id,
MAKELONG(hwnd, CBN_EDITCHANGE));
break;
case EN_ERRSPACE:SendMessage16(GetParent(hwnd),WM_COMMAND,id,
case EN_ERRSPACE:SendMessage16(GetParent16(hwnd),WM_COMMAND,id,
MAKELONG(hwnd, CBN_ERRSPACE));
break;
}
......@@ -886,7 +886,7 @@ static LRESULT CBLKeyDown( HWND hwnd, WPARAM wParam, LPARAM lParam )
ListBoxSetCurSel(lphl, newFocused);
ListBoxSendNotification(lphl, CBN_SELCHANGE);
SendMessage16(GetParent(hwnd), WM_COMMAND,ID_CLB,MAKELONG(0,CBN_SELCHANGE));
SendMessage16(GetParent16(hwnd), WM_COMMAND,ID_CLB,MAKELONG(0,CBN_SELCHANGE));
lphl->ItemFocused = newFocused;
ListBoxScrollToFocus(lphl);
SetScrollPos(hwnd, SB_VERT, lphl->FirstVisible, TRUE);
......@@ -1039,7 +1039,7 @@ static LRESULT CBLLButtonUp( HWND hwnd, WPARAM wParam, LPARAM lParam )
else if (lphl->PrevFocused != lphl->ItemFocused)
{
SendMessage16(CLBoxGetCombo(hwnd),CB_SETCURSEL,lphl->ItemFocused,0);
SendMessage16(GetParent(hwnd), WM_COMMAND,ID_CLB,MAKELONG(0,CBN_SELCHANGE));
SendMessage16(GetParent16(hwnd), WM_COMMAND,ID_CLB,MAKELONG(0,CBN_SELCHANGE));
ListBoxSendNotification(lphl, CBN_SELCHANGE);
}
......
......@@ -888,7 +888,7 @@ static LONG LBCreate(HWND hwnd, WORD wParam, LONG lParam)
LONG dwStyle = GetWindowLong32A(hwnd,GWL_STYLE);
RECT16 rect;
CreateListBoxStruct(hwnd, ODT_LISTBOX, dwStyle, GetParent(hwnd));
CreateListBoxStruct(hwnd, ODT_LISTBOX, dwStyle, GetParent16(hwnd));
lphl = ListBoxGetStorageHeader(hwnd);
dprintf_listbox(stddeb,"ListBox created: lphl = %p dwStyle = %04x:%04x\n",
lphl, HIWORD(dwStyle), LOWORD(dwStyle));
......@@ -2093,37 +2093,37 @@ LRESULT ListBoxWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_SETFOCUS: return LBSetFocus(hwnd, wParam, lParam);
case WM_KILLFOCUS: return LBKillFocus(hwnd, wParam, lParam);
case WM_NCCALCSIZE: return LBNCCalcSize(hwnd, wParam, lParam);
case LB_RESETCONTENT: return LBResetContent(hwnd, wParam, lParam);
case LB_DIR: return LBDir(hwnd, wParam, lParam);
case LB_ADDSTRING: return LBAddString(hwnd, wParam, lParam);
case LB_INSERTSTRING: return LBInsertString(hwnd, wParam, lParam);
case LB_DELETESTRING: return LBDeleteString(hwnd, wParam, lParam);
case LB_FINDSTRING: return LBFindString(hwnd, wParam, lParam);
case LB_FINDSTRINGEXACT: return LBFindStringExact(hwnd, wParam, lParam);
case LB_GETCARETINDEX: return LBGetCaretIndex(hwnd, wParam, lParam);
case LB_GETCOUNT: return LBGetCount(hwnd, wParam, lParam);
case LB_GETCURSEL: return LBGetCurSel(hwnd, wParam, lParam);
case LB_GETHORIZONTALEXTENT: return LBGetHorizontalExtent(hwnd, wParam, lParam);
case LB_GETITEMDATA: return LBGetItemData(hwnd, wParam, lParam);
case LB_GETITEMHEIGHT: return LBGetItemHeight(hwnd, wParam, lParam);
case LB_GETITEMRECT: return LBGetItemRect(hwnd, wParam, lParam);
case LB_GETSEL: return LBGetSel(hwnd, wParam, lParam);
case LB_GETSELCOUNT: return LBGetSelCount(hwnd, wParam, lParam);
case LB_GETSELITEMS: return LBGetSelItems(hwnd, wParam, lParam);
case LB_GETTEXT: return LBGetText(hwnd, wParam, lParam);
case LB_GETTEXTLEN: return LBGetTextLen(hwnd, wParam, lParam);
case LB_GETTOPINDEX: return LBGetTopIndex(hwnd, wParam, lParam);
case LB_SELECTSTRING: return LBSelectString(hwnd, wParam, lParam);
case LB_SELITEMRANGE: return LBSelItemRange(hwnd, wParam, lParam);
case LB_SETCARETINDEX: return LBSetCaretIndex(hwnd, wParam, lParam);
case LB_SETCOLUMNWIDTH: return LBSetColumnWidth(hwnd, wParam, lParam);
case LB_SETHORIZONTALEXTENT: return LBSetHorizontalExtent(hwnd, wParam, lParam);
case LB_SETITEMDATA: return LBSetItemData(hwnd, wParam, lParam);
case LB_SETTABSTOPS: return LBSetTabStops(hwnd, wParam, lParam);
case LB_SETCURSEL: return LBSetCurSel(hwnd, wParam, lParam);
case LB_SETSEL: return LBSetSel(hwnd, wParam, lParam);
case LB_SETTOPINDEX: return LBSetTopIndex(hwnd, wParam, lParam);
case LB_SETITEMHEIGHT: return LBSetItemHeight(hwnd, wParam, lParam);
case LB_RESETCONTENT16: return LBResetContent(hwnd, wParam, lParam);
case LB_DIR16: return LBDir(hwnd, wParam, lParam);
case LB_ADDSTRING16: return LBAddString(hwnd, wParam, lParam);
case LB_INSERTSTRING16: return LBInsertString(hwnd, wParam, lParam);
case LB_DELETESTRING16: return LBDeleteString(hwnd, wParam, lParam);
case LB_FINDSTRING16: return LBFindString(hwnd, wParam, lParam);
case LB_FINDSTRINGEXACT16: return LBFindStringExact(hwnd, wParam, lParam);
case LB_GETCARETINDEX16: return LBGetCaretIndex(hwnd, wParam, lParam);
case LB_GETCOUNT16: return LBGetCount(hwnd, wParam, lParam);
case LB_GETCURSEL16: return LBGetCurSel(hwnd, wParam, lParam);
case LB_GETHORIZONTALEXTENT16: return LBGetHorizontalExtent(hwnd, wParam, lParam);
case LB_GETITEMDATA16: return LBGetItemData(hwnd, wParam, lParam);
case LB_GETITEMHEIGHT16: return LBGetItemHeight(hwnd, wParam, lParam);
case LB_GETITEMRECT16: return LBGetItemRect(hwnd, wParam, lParam);
case LB_GETSEL16: return LBGetSel(hwnd, wParam, lParam);
case LB_GETSELCOUNT16: return LBGetSelCount(hwnd, wParam, lParam);
case LB_GETSELITEMS16: return LBGetSelItems(hwnd, wParam, lParam);
case LB_GETTEXT16: return LBGetText(hwnd, wParam, lParam);
case LB_GETTEXTLEN16: return LBGetTextLen(hwnd, wParam, lParam);
case LB_GETTOPINDEX16: return LBGetTopIndex(hwnd, wParam, lParam);
case LB_SELECTSTRING16: return LBSelectString(hwnd, wParam, lParam);
case LB_SELITEMRANGE16: return LBSelItemRange(hwnd, wParam, lParam);
case LB_SETCARETINDEX16: return LBSetCaretIndex(hwnd, wParam, lParam);
case LB_SETCOLUMNWIDTH16: return LBSetColumnWidth(hwnd, wParam, lParam);
case LB_SETHORIZONTALEXTENT16: return LBSetHorizontalExtent(hwnd, wParam, lParam);
case LB_SETITEMDATA16: return LBSetItemData(hwnd, wParam, lParam);
case LB_SETTABSTOPS16: return LBSetTabStops(hwnd, wParam, lParam);
case LB_SETCURSEL16: return LBSetCurSel(hwnd, wParam, lParam);
case LB_SETSEL16: return LBSetSel(hwnd, wParam, lParam);
case LB_SETTOPINDEX16: return LBSetTopIndex(hwnd, wParam, lParam);
case LB_SETITEMHEIGHT16: return LBSetItemHeight(hwnd, wParam, lParam);
case WM_DROPFILES: return LBPassToParent(hwnd, message, wParam, lParam);
......@@ -2133,8 +2133,8 @@ LRESULT ListBoxWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
* range of currently selected items when listbox is in the extended
* selection mode.
*/
case LB_SETANCHORINDEX: return LB_SETANCHORINDEX; /* that's what Windows returns */
case LB_GETANCHORINDEX: return 0;
case LB_SETANCHORINDEX16: return LB_SETANCHORINDEX16; /* that's what Windows returns */
case LB_GETANCHORINDEX16: return 0;
case WM_DROPOBJECT:
case WM_QUERYDROPOBJECT:
......@@ -2164,10 +2164,10 @@ BOOL DlgDirSelect( HWND hDlg, LPSTR lpStr, INT id )
INT i;
dprintf_listbox( stddeb, "DlgDirSelect: %04x '%s' %d\n", hDlg, lpStr, id );
if ((i = SendDlgItemMessage16( hDlg, id, LB_GETCURSEL, 0, 0 )) == LB_ERR)
if ((i = SendDlgItemMessage16( hDlg, id, LB_GETCURSEL16, 0, 0 )) == LB_ERR)
return FALSE;
if (!(buffer = SEGPTR_ALLOC( 20 * sizeof(char) ))) return FALSE;
SendDlgItemMessage16(hDlg, id, LB_GETTEXT, i, (LPARAM)SEGPTR_GET(buffer) );
SendDlgItemMessage16(hDlg, id, LB_GETTEXT16, i, (LPARAM)SEGPTR_GET(buffer) );
if (buffer[0] == '[') /* drive or directory */
{
if (buffer[1] == '-') /* drive */
......@@ -2246,17 +2246,17 @@ INT DlgDirList( HWND hDlg, SEGPTR spec, INT idLBox, INT idStatic, UINT attrib )
dprintf_listbox(stddeb, "ListBoxDirectory: path=%c:\\%s mask=%s\n",
'A' + drive, DRIVE_GetDosCwd(drive), mask);
SENDMSG( LB_RESETCONTENT, 0, 0 );
SENDMSG( LB_RESETCONTENT16, 0, 0 );
if ((attrib & DDL_DIRECTORY) && !(attrib & DDL_EXCLUSIVE))
{
char *temp;
if (SENDMSG( LB_DIR, attrib & ~(DDL_DIRECTORY | DDL_DRIVES),
if (SENDMSG( LB_DIR16, attrib & ~(DDL_DIRECTORY | DDL_DRIVES),
(LPARAM)spec ) == LB_ERR) return FALSE;
if (!(temp = SEGPTR_ALLOC( 4*sizeof(char) ))) return FALSE;
strcpy( temp, "*.*" );
/* FIXME: this won't work with PostMessage(), as temp will */
/* have been freed by the time we do a DispatchMessage(). */
if (SENDMSG( LB_DIR, (attrib & (DDL_DIRECTORY | DDL_DRIVES)) | DDL_EXCLUSIVE,
if (SENDMSG( LB_DIR16, (attrib & (DDL_DIRECTORY | DDL_DRIVES)) | DDL_EXCLUSIVE,
(LPARAM)SEGPTR_GET(temp) ) == LB_ERR)
{
SEGPTR_FREE(temp);
......@@ -2266,7 +2266,7 @@ INT DlgDirList( HWND hDlg, SEGPTR spec, INT idLBox, INT idStatic, UINT attrib )
}
else
{
if (SENDMSG( LB_DIR, attrib, (LPARAM)spec) == LB_ERR) return FALSE;
if (SENDMSG( LB_DIR16, attrib, (LPARAM)spec) == LB_ERR) return FALSE;
}
}
......
......@@ -364,7 +364,7 @@ static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, int nBar, RECT16 *rect,
{
if (nBar == SB_CTL) /* Only scrollbar controls send WM_CTLCOLOR */
{
HBRUSH hbrush = SendMessage32A( GetParent(hwnd),
HBRUSH hbrush = SendMessage32A( GetParent32(hwnd),
WM_CTLCOLORSCROLLBAR, hdc, hwnd );
SelectObject( hdc, hbrush );
}
......@@ -519,7 +519,7 @@ static void SCROLL_HandleKbdEvent( HWND hwnd, WORD wParam )
default:
return;
}
SendMessage32A( GetParent(hwnd),
SendMessage32A( GetParent32(hwnd),
(wndPtr->dwStyle & SBS_VERT) ? WM_VSCROLL : WM_HSCROLL,
msg, hwnd );
}
......@@ -559,7 +559,7 @@ void SCROLL_HandleScrollEvent( HWND hwnd, int nBar, WORD msg, POINT16 pt )
hdc = (nBar == SB_CTL) ? GetDC(hwnd) : GetWindowDC(hwnd);
vertical = SCROLL_GetScrollBarRect( hwnd, nBar, &rect,
&arrowSize, &thumbPos );
hwndOwner = (nBar == SB_CTL) ? GetParent(hwnd) : hwnd;
hwndOwner = (nBar == SB_CTL) ? GetParent32(hwnd) : hwnd;
hwndCtl = (nBar == SB_CTL) ? hwnd : 0;
switch(msg)
......
......@@ -221,7 +221,7 @@ static void STATIC_PaintTextfn( WND *wndPtr, HDC hdc )
wFormat |= DT_NOPREFIX;
if (infoPtr->hFont) SelectObject( hdc, infoPtr->hFont );
hBrush = SendMessage32A( GetParent(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
hBrush = SendMessage32A( GetParent32(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
hdc, wndPtr->hwndSelf );
if (!hBrush) hBrush = GetStockObject(WHITE_BRUSH);
FillRect16(hdc, &rc, hBrush);
......@@ -275,7 +275,7 @@ static void STATIC_PaintIconfn( WND *wndPtr, HDC hdc )
STATICINFO *infoPtr = (STATICINFO *)wndPtr->wExtra;
GetClientRect16( wndPtr->hwndSelf, &rc);
hbrush = SendMessage32A( GetParent(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
hbrush = SendMessage32A( GetParent32(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
hdc, wndPtr->hwndSelf );
FillRect16( hdc, &rc, hbrush );
if (infoPtr->hIcon) DrawIcon( hdc, rc.left, rc.top, infoPtr->hIcon );
......
......@@ -279,7 +279,7 @@ SW_Create(STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
ReleaseDC(0, hdc);
}
parent = GetParent(hwnd);
parent = GetParent32(hwnd);
GetClientRect32(parent, &rect);
width = rect.right - rect.left;
height = (self->textHeight * 3)/2;
......@@ -393,7 +393,7 @@ SW_Size(STATUSWINDOWINFO *self, HWND32 hwnd, WPARAM32 wParam, LPARAM lParam)
if (flags == SIZE_RESTORED) {
/* width and height don't apply */
parent = GetParent(hwnd);
parent = GetParent32(hwnd);
GetClientRect32(parent, &parent_rect);
height = (self->textHeight * 3)/2;
width = parent_rect.right - parent_rect.left;
......
......@@ -586,7 +586,7 @@ UINT16 GetDriveType16( UINT16 drive )
{
case TYPE_FLOPPY: return DRIVE_REMOVABLE;
case TYPE_HD: return DRIVE_FIXED;
case TYPE_CDROM: return DRIVE_REMOVABLE;
case TYPE_CDROM: return DRIVE_REMOTE;
case TYPE_NETWORK: return DRIVE_REMOTE;
case TYPE_INVALID:
default: return DRIVE_CANNOTDETERMINE;
......
......@@ -429,7 +429,10 @@ static BOOL PROFILE_Open( const char *filename )
fclose( file );
}
else
{
/* Does not exist yet, we will create it in PROFILE_FlushFile */
fprintf( stderr, "Warning: profile file %s not found\n", newdos_name );
}
dprintf_profile( stddeb, "PROFILE_Open(%s): successful\n", filename );
return TRUE;
}
......
name commdlg
type win16
1 pascal16 GetOpenFileName(ptr) GetOpenFileName
2 pascal16 GetSaveFileName(ptr) GetSaveFileName
1 pascal16 GetOpenFileName(segptr) GetOpenFileName
2 pascal16 GetSaveFileName(segptr) GetSaveFileName
5 pascal16 ChooseColor(ptr) ChooseColor
6 pascal FileOpenDlgProc(word word word long) FileOpenDlgProc
7 pascal FileSaveDlgProc(word word word long) FileSaveDlgProc
8 pascal ColorDlgProc(word word word long) ColorDlgProc
#9 pascal LOADALTERBITMAP exported, shared data
11 pascal16 FindText(ptr) FindText
12 pascal16 ReplaceText(ptr) ReplaceText
11 pascal16 FindText(segptr) FindText
12 pascal16 ReplaceText(segptr) ReplaceText
13 pascal FindTextDlgProc(word word word long) FindTextDlgProc
14 pascal ReplaceTextDlgProc(word word word long) ReplaceTextDlgProc
15 pascal16 ChooseFont(ptr) ChooseFont
16 pascal16 FormatCharDlgProc(word word word long) FormatCharDlgProc
18 pascal16 FontStyleEnumProc(ptr ptr word long) FontStyleEnumProc
19 pascal16 FontFamilyEnumProc(ptr ptr word long) FontFamilyEnumProc
20 pascal16 PrintDlg(ptr) PrintDlg
20 pascal16 PrintDlg(segptr) PrintDlg
21 pascal PrintDlgProc(word word word long) PrintDlgProc
22 pascal PrintSetupDlgProc(word word word long) PrintSetupDlgProc
#23 pascal EDITINTEGERONLY exported, shared data
......
......@@ -284,12 +284,12 @@ base 1
279 stub _splitpath
280 stub _stat
281 stub _statusfp
282 stub _strcmpi
282 cdecl _strcmpi(ptr ptr) lstrcmpi32A
283 stub _strdate
284 stub _strdec
285 stub _strdup
286 stub _strerror
287 stub _stricmp
287 cdecl _stricmp(ptr ptr) lstrcmpi32A
288 stub _stricoll
289 stub _strinc
290 stub _strlwr
......@@ -302,7 +302,7 @@ base 1
297 stub _strset
298 stub _strspnp
299 stub _strtime
300 stub _strupr
300 cdecl _strupr(ptr) CRTDLL__strupr
301 stub _swab
302 stub _sys_errlist
303 stub _sys_nerr_dll
......@@ -341,29 +341,29 @@ base 1
336 stub _y1
337 stub _yn
338 stub abort
339 stub abs
340 stub acos
339 cdecl abs(long) CRTDLL_abs
340 cdecl acos(long) CRTDLL_acos
341 stub asctime
342 stub asin
343 stub atan
344 stub atan2
342 cdecl asin(long) CRTDLL_asin
343 cdecl atan(long) CRTDLL_atan
344 cdecl atan2(long long) CRTDLL_atan2
345 stub atexit
346 stub atof
347 stub atoi
348 stub atol
346 cdecl atof(ptr) CRTDLL_atof
347 cdecl atoi(ptr) CRTDLL_atoi
348 cdecl atol(ptr) CRTDLL_atol
349 stub bsearch
350 stub calloc
351 stub ceil
352 stub clearerr
353 stub clock
354 stub cos
355 stub cosh
354 cdecl cos(long) CRTDLL_cos
355 cdecl cosh(long) CRTDLL_cosh
356 stub ctime
357 stub difftime
358 stub div
359 cdecl exit(long) CRTDLL_exit
360 stub exp
361 stub fabs
360 cdecl exp(long) CRTDLL_exp
361 cdecl fabs(long) CRTDLL_fabs
362 stub fclose
363 stub feof
364 stub ferror
......@@ -380,7 +380,7 @@ base 1
375 stub fputs
376 stub fputwc
377 stub fread
378 stub free
378 cdecl free(ptr) CRTDLL_free
379 stub freopen
380 stub frexp
381 stub fscanf
......@@ -420,16 +420,16 @@ base 1
415 stub iswspace
416 stub iswupper
417 stub iswxdigit
418 stub isxdigit
419 stub labs
418 cdecl isxdigit(long) CRTDLL_isxdigit
419 cdecl labs(long) CRTDLL_labs
420 stub ldexp
421 stub ldiv
422 stub localeconv
423 stub localtime
424 stub log
425 stub log10
424 cdecl log(long) CRTDLL_log
425 cdecl log10(long) CRTDLL_log10
426 stub longjmp
427 stub malloc
427 cdecl malloc(ptr) CRTDLL_malloc
428 stub mblen
429 stub mbstowcs
430 stub mbtowc
......@@ -441,14 +441,14 @@ base 1
436 stub mktime
437 stub modf
438 stub perror
439 stub pow
439 cdecl pow(long long) CRTDLL_pow
440 cdecl printf() CRTDLL_printf
441 stub putc
442 cdecl putchar(long) CRTDLL_putchar
443 stub puts
444 stub qsort
445 stub raise
446 stub rand
446 cdecl rand() CRTDLL_rand
447 stub realloc
448 stub remove
449 stub rename
......@@ -458,10 +458,10 @@ base 1
453 stub setlocale
454 stub setvbuf
455 stub signal
456 stub sin
457 stub sinh
456 cdecl sin(long) CRTDLL_sin
457 cdecl sinh(long) CRTDLL_sinh
458 stub sprintf
459 stub sqrt
459 cdecl sqrt(long) CRTDLL_sqrt
460 cdecl srand(long) CRTDLL_srand
461 stub sscanf
462 cdecl strcat(ptr ptr) lstrcat32A
......@@ -488,8 +488,8 @@ base 1
483 stub swprintf
484 stub swscanf
485 stub system
486 stub tan
487 stub tanh
486 cdecl tan(long) CRTDLL_tan
487 cdecl tanh(long) CRTDLL_tanh
488 cdecl time(ptr) CRTDLL_time
489 stub tmpfile
490 stub tmpnam
......
......@@ -145,8 +145,8 @@ type win16
144 pascal16 CreateDirectory(ptr ptr) CreateDirectory16
145 pascal16 RemoveDirectory(ptr) RemoveDirectory16
146 pascal16 DeleteFile(ptr) DeleteFile16
147 stub SetLastError
148 stub GetLastError
147 pascal16 SetLastError(long) SetLastError
148 pascal16 GetLastError() GetLastError
149 stub GetVersionEx
150 pascal16 DirectedYield(word) DirectedYield
151 stub WinOldApCall
......
......@@ -46,7 +46,7 @@ heap 65520
43 pascal16 CloseWindow(word) CloseWindow
44 pascal16 OpenIcon(word) OpenIcon
45 pascal16 BringWindowToTop(word) BringWindowToTop
46 pascal16 GetParent(word) GetParent
46 pascal16 GetParent(word) GetParent16
47 pascal16 IsWindow(word) IsWindow
48 pascal16 IsChild(word word) IsChild
49 pascal16 IsWindowVisible(word) IsWindowVisible
......
......@@ -281,7 +281,7 @@ base 1
0274 stub GetNextDlgGroupItem
0275 stub GetNextDlgTabItem
0276 stub GetOpenClipboardWindow
0277 stdcall GetParent(long) GetParent
0277 stdcall GetParent(long) GetParent32
0278 stub GetPriorityClipboardFormat
0279 stub GetProcessWindowStation
0280 stdcall GetPropA(long ptr) GetProp32A
......@@ -292,7 +292,7 @@ base 1
0285 stub GetScrollRange
0286 stub GetShellWindow
0287 stdcall GetSubMenu(long long) GetSubMenu
0288 stdcall GetSysColor(long) GetSysColor
0288 stdcall GetSysColor(long) GetSysColor
0289 stdcall GetSysColorBrush(long) GetSysColorBrush
0290 stdcall GetSystemMenu(long long) GetSystemMenu
0291 stdcall GetSystemMetrics(long) GetSystemMetrics
......
......@@ -9,14 +9,14 @@ base 0
005 stub getpeername
006 stub getsockname
007 stub getsockopt
008 stub htonl
009 stub htons
008 stdcall htonl(long) htonl
009 stdcall htons(long) htons
010 stdcall inet_addr(ptr) inet_addr
011 stdcall inet_ntoa(ptr) inet_ntoa
012 stub ioctlsocket
013 stub listen
014 stub ntohl
015 stub ntohs
015 stdcall ntohs(long) ntohs
016 stub recv
017 stub recvfrom
018 stub select
......@@ -53,8 +53,9 @@ base 0
# applications *should* 'degrade gracefully if these are not present
# ... as it is, they don't
#1000 stub WSApSetPostRoutine
1100 stub inet_network
1101 stub getnetbyname
1001 stdcall WsControl(long long long long long long) WsControl
1100 stdcall inet_network(ptr) inet_network
1101 stdcall getnetbyname(ptr) getnetbyname
#1102 stub rcmd
#1103 stub rexec
#1104 stub rresvport
......
......@@ -277,12 +277,12 @@ typedef DEVNAMES * LPDEVNAMES;
BOOL ChooseColor(LPCHOOSECOLOR lpChCol);
DWORD CommDlgExtendedError(void);
BOOL FindText(LPFINDREPLACE lpFind);
BOOL FindText( SEGPTR find);
short GetFileTitle(LPCSTR lpFile, LPSTR lpTitle, UINT cbBuf);
BOOL GetOpenFileName(LPOPENFILENAME lpofn);
BOOL GetSaveFileName(LPOPENFILENAME lpofn);
BOOL PrintDlg(LPPRINTDLG lpPrint);
BOOL ReplaceText(LPFINDREPLACE lpFind);
BOOL GetOpenFileName(SEGPTR ofn);
BOOL GetSaveFileName(SEGPTR ofn);
BOOL PrintDlg( SEGPTR print);
BOOL ReplaceText( SEGPTR find);
BOOL ChooseFont(LPCHOOSEFONT lpChFont);
LRESULT FileOpenDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
......
......@@ -10,6 +10,10 @@
#include "gdi.h"
#define CLIP_INTERSECT 0x0001
#define CLIP_EXCLUDE 0x0002
#define CLIP_KEEPRGN 0x0004
extern void DC_InitDC( DC* dc );
extern BOOL DC_SetupGCForPatBlt( DC * dc, GC gc, BOOL fMapColors );
extern BOOL DC_SetupGCForBrush( DC * dc );
......
......@@ -521,14 +521,18 @@ void dde_msg_setup(int *msg_ptr)
*/
void DDE_TestDDE(HWND hwnd)
{
if (main_block != NULL)
static in_test = 0;
if (in_test++) return;
if (main_block != NULL) {
in_test--;
return;
}
dprintf_msg(stddeb,"DDE_TestDDE(0x%04x)\n", hwnd);
if (hwnd==0)
hwnd=-1;
/* just send a message to see how things are going */
SendMessage16( hwnd, WM_DDE_INITIATE, 0, 0);
in_test--;
}
void dde_proc_delete(int proc_idx)
......
......@@ -524,7 +524,7 @@ void NE_InitializeDLLs( HMODULE16 hModule )
if (!(pModule = MODULE_GetPtr( hModule ))) return;
if (pModule->flags & NE_FFLAGS_WIN32)
{
PE_InitializeDLLs(hModule);
/* PE_InitializeDLLs(hModule); */
return;
}
if (pModule->dlls_to_init)
......
......@@ -547,16 +547,10 @@ HINSTANCE PE_LoadModule( int fd, OFSTRUCT *ofs, LOADPARAMS* params )
if (!(pModule->pe_module->pe_header->coff.Characteristics & IMAGE_FILE_DLL))
{
int fs;
TASK_CreateTask( hModule, hInstance, 0,
params->hEnvironment,
(LPSTR)PTR_SEG_TO_LIN( params->cmdLine ),
*((WORD*)PTR_SEG_TO_LIN(params->showCmd) + 1) );
fs=(int)GlobalAlloc16( GMEM_FIXED | GMEM_ZEROINIT, 0x10000 );
PE_InitTEB(fs);
/* FIXME: this should be done in the context of the new task */
__asm__ __volatile__("movw %w0,%%fs"::"r" (fs));
PE_InitializeDLLs( hModule );
}
return hInstance;
}
......@@ -566,6 +560,7 @@ void PE_InitTEB(int hTEB);
void PE_Win32CallToStart( SIGCONTEXT *context )
{
int fs;
HMODULE16 hModule;
NE_MODULE *pModule;
......@@ -574,6 +569,10 @@ void PE_Win32CallToStart( SIGCONTEXT *context )
hModule = GetExePtr( GetCurrentTask() );
pModule = MODULE_GetPtr( hModule );
USER_InitApp( hModule );
fs=(int)GlobalAlloc16( GMEM_FIXED | GMEM_ZEROINIT, 0x10000 );
PE_InitTEB(fs);
__asm__ __volatile__("movw %w0,%%fs"::"r" (fs));
PE_InitializeDLLs( hModule );
CallTaskStart32( (FARPROC32)(pModule->pe_module->load_addr +
pModule->pe_module->pe_header->opt_coff.AddressOfEntryPoint) );
}
......
......@@ -291,11 +291,8 @@ INT32 lstrncmpi32A( LPCSTR str1, LPCSTR str2, INT32 n )
if (!n) return 0;
while ((--n > 0) && *str1)
{
if ((res = toupper(*str1) - toupper(*str2)) != 0) return res;
str1++;
str2++;
}
if ( (res = toupper(*str1++) - toupper(*str2++)) ) return res;
return toupper(*str1) - toupper(*str2);
}
......
......@@ -23,19 +23,36 @@ DWORD GetUserDefaultLCID()
/* Default sorting, neutral sublanguage */
switch(Options.language)
{
case LANG_En: return 0x09;
case LANG_Es: return 0x0a;
case LANG_De: return 0x07;
case LANG_No: return 0x14;
case LANG_Fr: return 0x0c;
case LANG_Fi: return 0x0b;
case LANG_Da: return 0x06;
case LANG_Cz: return 0x05;
case LANG_Eo: return 0x25; /* not official */
case LANG_It: return 0x10;
case LANG_Ko: return 0x12;
/* case LANG_Bu: return 0x02; */ /* Bulgarian */
/* case LANG_Ch: return 0x04; */ /* Chinese */
case LANG_Cz: return 0x05; /* Czech */
case LANG_Da: return 0x06; /* Danish */
case LANG_De: return 0x07; /* German */
/* case LANG_Gr: return 0x08; */ /* Greek */
case LANG_En: return 0x09; /* English */
case LANG_Es: return 0x0a; /* Spanish */
case LANG_Fi: return 0x0b; /* Finnish */
case LANG_Fr: return 0x0c; /* French */
/* case LANG_Hu: return 0x0e; */ /* Hungarian */
/* case LANG_Ic: return 0x0f; */ /* Icelandic */
case LANG_It: return 0x10; /* Italian */
/* case LANG_Jp: return 0x11; */ /* Japanese */
case LANG_Ko: return 0x12; /* Korean */
/* case LANG_Du: return 0x13; */ /* Dutch */
case LANG_No: return 0x14; /* Norwegian */
/* case LANG_Pl: return 0x15; */ /* Polish */
/* case LANG_Po: return 0x16; */ /* Portuguese */
/* case LANG_Ro: return 0x18; */ /* Romanian */
/* case LANG_Ru: return 0x19; */ /* Russian */
/* case LANG_Cr: return 0x1a; */ /* Croatian */
/* case LANG_Sl: return 0x1b; */ /* Slovak */
/* case LANG_Sw: return 0x1d; */ /* Swedish */
/* case LANG_Tu: return 0x1f; */ /* Turkish */
/* case LANG_Sv: return 0x24; */ /* Slovenian */
case LANG_Eo: return 0x25; /* Esperanto (not official) */
default:
return 0; /* Neutral language */
return 0x00; /* Neutral language */
}
}
......
......@@ -221,16 +221,50 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] =
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/* 0x0180 - Win32 Listboxes */
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/* 0x0190 */
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/* 0x01A0 */
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
"LB_ADDSTRING32", /* 0x0180 */
"LB_INSERTSTRING32", /* 0x0181 */
"LB_DELETESTRING32", /* 0x0182 */
"LB_SELITEMRANGEEX32", /* 0x0183 */
"LB_RESETCONTENT32", /* 0x0184 */
"LB_SETSEL32", /* 0x0185 */
"LB_SETCURSEL32", /* 0x0186 */
"LB_GETSEL32", /* 0x0187 */
"LB_GETCURSEL32", /* 0x0188 */
"LB_GETTEXT32", /* 0x0189 */
"LB_GETTEXTLEN32", /* 0x018a */
"LB_GETCOUNT32", /* 0x018b */
"LB_SELECTSTRING32", /* 0x018c */
"LB_DIR32", /* 0x018d */
"LB_GETTOPINDEX32", /* 0x018e */
"LB_FINDSTRING32", /* 0x018f */
"LB_GETSELCOUNT32", /* 0x0190 */
"LB_GETSELITEMS32", /* 0x0191 */
"LB_SETTABSTOPS32", /* 0x0192 */
"LB_GETHORIZONTALEXTENT32", /* 0x0193 */
"LB_SETHORIZONTALEXTENT32", /* 0x0194 */
"LB_SETCOLUMNWIDTH32", /* 0x0195 */
"LB_ADDFILE32", /* 0x0196 */
"LB_SETTOPINDEX32", /* 0x0197 */
"LB_GETITEMRECT32", /* 0x0198 */
"LB_GETITEMDATA32", /* 0x0199 */
"LB_SETITEMDATA32", /* 0x019a */
"LB_SELITEMRANGE32", /* 0x019b */
"LB_SETANCHORINDEX32", /* 0x019c */
"LB_GETANCHORINDEX32", /* 0x019d */
"LB_SETCARETINDEX32", /* 0x019e */
"LB_GETCARETINDEX32", /* 0x019f */
"LB_SETITEMHEIGHT32", /* 0x01a0 */
"LB_GETITEMHEIGHT32", /* 0x01a1 */
"LB_FINDSTRINGEXACT32", /* 0x01a2 */
NULL, NULL,
"LB_SETLOCALE32", /* 0x01a5 */
"LB_GETLOCALE32", /* 0x01a6 */
"LB_SETCOUNT32", /* 0x01a7 */
"LB_INITSTORAGE32", /* 0x01a8 */
"LB_ITEMFROMPOINT32", /* 0x01a9 */
NULL, NULL, NULL, NULL, NULL, NULL,
/* 0x01B0 */
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
......@@ -429,7 +463,7 @@ static int SPY_IndentLevel = 0;
/***********************************************************************
* SPY_GetMsgName
*/
static const char *SPY_GetMsgName( UINT msg )
const char *SPY_GetMsgName( UINT msg )
{
static char buffer[20];
......
......@@ -1559,3 +1559,14 @@ INT WSACleanup(void)
}
return 0;
}
VOID
WsControl(DWORD x1,DWORD x2,LPDWORD x3,LPDWORD x4,LPDWORD x5,LPDWORD x6) {
fprintf(stdnimp,"WsControl(%lx,%lx,%lx,%lx,%lx,%lx)\n",
x1,x2,x3,x4,x5,x6
);
fprintf(stdnimp,"WsControl(x,x,%lx,%lx,%lx,%lx)\n",
x3?*x3:0,x4?*x4:0,x5?*x5:0,x6?*x6:0
);
return;
}
......@@ -25,12 +25,14 @@
#ifdef linux
#include <linux/soundcard.h>
#elif __FreeBSD__
#include <machine/soundcard.h>
#endif
#include "stddebug.h"
#include "debug.h"
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
#define SOUND_DEV "/dev/dsp"
#ifdef SOUND_VERSION
......@@ -774,7 +776,7 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
return MMSYSERR_NOTENABLED;
}
IOCTL(audio, SNDCTL_DSP_GETBLKSIZE, abuf_size);
if (abuf_size < 4096 || abuf_size > 65536) {
if (abuf_size < 1024 || abuf_size > 65536) {
if (abuf_size == -1)
dprintf_mciwave(stddeb,"Linux 'wodOpen' // IOCTL can't 'SNDCTL_DSP_GETBLKSIZE' !\n");
else
......@@ -1073,7 +1075,7 @@ static DWORD wodSetVolume(WORD wDevID, DWORD dwParam)
return MMSYSERR_NOERROR;
}
#endif /* linux */
#endif /* linux || __FreeBSD__*/
/**************************************************************************
* wodMessage [sample driver]
......@@ -1083,7 +1085,7 @@ DWORD wodMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
{
dprintf_mciwave(stddeb,"wodMessage(%u, %04X, %08lX, %08lX, %08lX);\n",
wDevID, wMsg, dwUser, dwParam1, dwParam2);
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
switch(wMsg) {
case WODM_OPEN:
return wodOpen(wDevID, (LPWAVEOPENDESC)PTR_SEG_TO_LIN(dwParam1), dwParam2);
......@@ -1133,7 +1135,7 @@ DWORD wodMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
/*-----------------------------------------------------------------------*/
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
/**************************************************************************
* widGetDevCaps [internal]
......@@ -1223,7 +1225,7 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
return MMSYSERR_NOTENABLED;
}
IOCTL(audio, SNDCTL_DSP_GETBLKSIZE, abuf_size);
if (abuf_size < 4096 || abuf_size > 65536) {
if (abuf_size < 1024 || abuf_size > 65536) {
if (abuf_size == -1)
dprintf_mciwave(stddeb,"Linux 'widOpen' // IOCTL can't 'SNDCTL_DSP_GETBLKSIZE' !\n");
else
......@@ -1532,7 +1534,7 @@ static DWORD widGetPosition(WORD wDevID, LPMMTIME lpTime, DWORD uSize)
return MMSYSERR_NOERROR;
}
#endif /* linux */
#endif /* linux || __FreeBSD__ */
/**************************************************************************
* widMessage [sample driver]
......@@ -1542,7 +1544,7 @@ DWORD widMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
{
dprintf_mciwave(stddeb,"widMessage(%u, %04X, %08lX, %08lX, %08lX);\n",
wDevID, wMsg, dwUser, dwParam1, dwParam2);
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
switch(wMsg) {
case WIDM_OPEN:
return widOpen(wDevID, (LPWAVEOPENDESC)PTR_SEG_TO_LIN(dwParam1), dwParam2);
......@@ -1582,7 +1584,7 @@ DWORD widMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
LONG WAVE_DriverProc(DWORD dwDevID, HDRVR16 hDriv, WORD wMsg,
DWORD dwParam1, DWORD dwParam2)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
dprintf_mciwave(stddeb,"WAVE_DriverProc(%08lX, %04X, %04X, %08lX, %08lX)\n",
dwDevID, hDriv, wMsg, dwParam1, dwParam2);
switch(wMsg) {
......
......@@ -29,7 +29,7 @@
#define ANIMFRAMES_PERMIN 1800
#define SECONDS_PERMIN 60
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
typedef struct {
int nUseCount; /* Incremented for each shared open */
BOOL fShareable; /* TRUE if first open was shareable */
......@@ -57,7 +57,7 @@ static LINUX_ANIM AnimDev[MAX_ANIMDRV];
*/
static DWORD ANIM_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS lpParms)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
LPSTR lpstrElementName;
char str[128];
dprintf_mcianim(stddeb,"ANIM_mciOpen(%04X, %08lX, %p);\n",
......@@ -115,7 +115,7 @@ static DWORD ANIM_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS lpParms)
*/
static DWORD ANIM_mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
dprintf_mcianim(stddeb,"ANIM_mciClose(%u, %08lX, %p);\n",
wDevID, dwParam, lpParms);
if (AnimDev[wDevID].lpdwTrackLen != NULL) free(AnimDev[wDevID].lpdwTrackLen);
......@@ -130,7 +130,7 @@ static DWORD ANIM_mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpPar
static DWORD ANIM_mciGetDevCaps(UINT wDevID, DWORD dwFlags,
LPMCI_GETDEVCAPS_PARMS lpParms)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
dprintf_mcianim(stddeb,"ANIM_mciGetDevCaps(%u, %08lX, %p);\n",
wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_INTERNAL;
......@@ -186,7 +186,7 @@ static DWORD ANIM_mciGetDevCaps(UINT wDevID, DWORD dwFlags,
static DWORD ANIM_CalcTime(UINT wDevID, DWORD dwFormatType, DWORD dwFrame)
{
DWORD dwTime = 0;
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
UINT wTrack;
UINT wMinutes;
UINT wSeconds;
......@@ -240,7 +240,7 @@ static DWORD ANIM_CalcTime(UINT wDevID, DWORD dwFormatType, DWORD dwFrame)
static DWORD ANIM_CalcFrame(UINT wDevID, DWORD dwFormatType, DWORD dwTime)
{
DWORD dwFrame = 0;
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
UINT wTrack;
dprintf_mcianim(stddeb,"ANIM_CalcFrame(%u, %08lX, %lu);\n",
wDevID, dwFormatType, dwTime);
......@@ -288,7 +288,7 @@ static DWORD ANIM_CalcFrame(UINT wDevID, DWORD dwFormatType, DWORD dwTime)
*/
static DWORD ANIM_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
dprintf_mcianim(stddeb,"ANIM_mciInfo(%u, %08lX, %p);\n",
wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_INTERNAL;
......@@ -322,7 +322,7 @@ static DWORD ANIM_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms)
*/
static DWORD ANIM_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
dprintf_mcianim(stddeb,"ANIM_mciStatus(%u, %08lX, %p);\n",
wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_INTERNAL;
......@@ -411,7 +411,7 @@ static DWORD ANIM_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpPar
*/
static DWORD ANIM_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
int start, end;
dprintf_mcianim(stddeb,"ANIM_mciPlay(%u, %08lX, %p);\n",
wDevID, dwFlags, lpParms);
......@@ -450,7 +450,7 @@ static DWORD ANIM_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
*/
static DWORD ANIM_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
dprintf_mcianim(stddeb,"ANIM_mciStop(%u, %08lX, %p);\n",
wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_INTERNAL;
......@@ -473,7 +473,7 @@ static DWORD ANIM_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParm
*/
static DWORD ANIM_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
dprintf_mcianim(stddeb,"ANIM_mciPause(%u, %08lX, %p);\n",
wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_INTERNAL;
......@@ -496,7 +496,7 @@ static DWORD ANIM_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPar
*/
static DWORD ANIM_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
dprintf_mcianim(stddeb,"ANIM_mciResume(%u, %08lX, %p);\n",
wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_INTERNAL;
......@@ -519,7 +519,7 @@ static DWORD ANIM_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPa
*/
static DWORD ANIM_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
DWORD dwRet;
MCI_PLAY_PARMS PlayParms;
dprintf_mcianim(stddeb,"ANIM_mciSeek(%u, %08lX, %p);\n",
......@@ -559,7 +559,7 @@ static DWORD ANIM_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms)
*/
static DWORD ANIM_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
dprintf_mcianim(stddeb,"ANIM_mciSet(%u, %08lX, %p);\n",
wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_INTERNAL;
......@@ -608,7 +608,7 @@ static DWORD ANIM_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
LONG ANIM_DriverProc(DWORD dwDevID, HDRVR16 hDriv, WORD wMsg,
DWORD dwParam1, DWORD dwParam2)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
switch(wMsg) {
case DRV_LOAD:
return 1;
......
......@@ -89,16 +89,6 @@ LONG ANIM_DriverProc(DWORD dwDevID, HDRVR16 hDriv, WORD wMsg,
res=MCIERR_INVALID_DEVICE_NAME;\
break;\
}
/* we need to have strings in 16 bit space for some things
* FIXME: this is bad.
*/
#define _MCI_STRDUP_TO_SEG(dest,source) {\
HANDLE x;\
x=USER_HEAP_ALLOC(strlen(source));\
dest=(LPSTR)MAKELONG(x,USER_HeapSel);\
strcpy(PTR_SEG_TO_LIN(dest),source);\
}
/* print a DWORD in the specified timeformat */
static void
_MCISTR_printtf(char *buf,UINT uDevType,DWORD timef,DWORD val) {
......@@ -315,7 +305,7 @@ MCISTR_Open(_MCISTR_PROTO_) {
s=strchr(dev,'!');
if (s!=NULL) {
*s++='\0';
_MCI_STRDUP_TO_SEG(pU->openParams.lpstrElementName,s);
pU->openParams.lpstrElementName=SEGPTR_GET(SEGPTR_STRDUP(s));
}
if (!STRCMP(dev,"cdaudio")) {
uDevTyp=MCI_DEVTYPE_CD_AUDIO;
......@@ -328,37 +318,40 @@ MCISTR_Open(_MCISTR_PROTO_) {
} else if (!STRCMP(dev,"avivideo")) {
uDevTyp=MCI_DEVTYPE_DIGITAL_VIDEO;
} else {
SEGPTR_FREE(PTR_SEG_TO_LIN(pU->openParams.lpstrElementName));
SEGPTR_FREE(pU);
return MCIERR_INVALID_DEVICE_NAME;
}
wDevID=0;
while(mciDrv[wDevID].wType) {
if (++wDevID>=MAXMCIDRIVERS) {
dprintf_mci(stddeb, __FILE__":MCISTR_Open:MAXMCIDRIVERS reached!\n");
SEGPTR_FREE(PTR_SEG_TO_LIN(pU->openParams.lpstrElementName));
SEGPTR_FREE(pU);
return MCIERR_INTERNAL;
}
}
mciDrv[wDevID].wType = uDevTyp;
mciDrv[wDevID].wDeviceID = wDevID;
pU->openParams.dwCallback = 0;
pU->openParams.wDeviceID = wDevID;
pU->openParams.dwCallback = 0;
pU->openParams.wDeviceID = wDevID;
pU->ovlyopenParams.dwStyle = 0;
pU->animopenParams.dwStyle = 0;
_MCI_STRDUP_TO_SEG(pU->openParams.lpstrDeviceType,dev);
pU->openParams.lpstrAlias = NULL;
pU->openParams.lpstrDeviceType = SEGPTR_GET(SEGPTR_STRDUP(dev));
pU->openParams.lpstrAlias = NULL;
dwFlags |= MCI_OPEN_TYPE;
i=0;
while (i<nrofkeywords) {
FLAG1("shareable",MCI_OPEN_SHAREABLE);
if (!strcmp(keywords[i],"alias") && (i+1<nrofkeywords)) {
dwFlags |= MCI_OPEN_ALIAS;
_MCI_STRDUP_TO_SEG(pU->openParams.lpstrAlias,keywords[i]);
pU->openParams.lpstrAlias=SEGPTR_GET(SEGPTR_STRDUP(keywords[i]));
i+=2;
continue;
}
if (!strcmp(keywords[i],"element") && (i+1<nrofkeywords)) {
dwFlags |= MCI_OPEN_ELEMENT;
_MCI_STRDUP_TO_SEG(pU->openParams.lpstrElementName,keywords[i]);
pU->openParams.lpstrElementName=SEGPTR_GET(SEGPTR_STRDUP(keywords[i]));
i+=2;
continue;
}
......@@ -429,7 +422,12 @@ MCISTR_Open(_MCISTR_PROTO_) {
_MCI_CALL_DRIVER( MCI_OPEN, SEGPTR_GET(pU) );
if (res==0)
memcpy(&mciOpenDrv[wDevID],&pU->openParams,sizeof(MCI_OPEN_PARMS));
SEGPTR_FREE(pU);
else {
SEGPTR_FREE(PTR_SEG_TO_LIN(pU->openParams.lpstrElementName));
SEGPTR_FREE(PTR_SEG_TO_LIN(pU->openParams.lpstrDeviceType));
SEGPTR_FREE(PTR_SEG_TO_LIN(pU->openParams.lpstrAlias));
}
SEGPTR_FREE(pU);
return res;
}
......
......@@ -26,9 +26,11 @@
#ifdef linux
#include <linux/soundcard.h>
#elif __FreeBSD__
#include <machine/soundcard.h>
#endif
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
#define MIDI_DEV "/dev/sequencer"
#ifdef SOUND_VERSION
......@@ -89,7 +91,7 @@ static LINUX_MCIMIDI MCIMidiDev[MAX_MCIMIDIDRV];
static DWORD MIDI_NotifyClient(UINT wDevID, WORD wMsg,
DWORD dwParam1, DWORD dwParam2)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
if (MidiInDev[wDevID].wFlags != DCB_NULL && !DriverCallback(
MidiInDev[wDevID].midiDesc.dwCallback, MidiInDev[wDevID].wFlags,
MidiInDev[wDevID].midiDesc.hMidi, wMsg,
......@@ -109,7 +111,7 @@ static DWORD MIDI_NotifyClient(UINT wDevID, WORD wMsg,
*/
static DWORD MIDI_ReadByte(UINT wDevID, BYTE *lpbyt)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
if (lpbyt != NULL) {
if (mmioRead(MCIMidiDev[wDevID].hFile, (HPSTR)lpbyt,
(long) sizeof(BYTE)) == (long) sizeof(BYTE)) {
......@@ -196,7 +198,7 @@ static DWORD MIDI_ReadVaryLen(UINT wDevID, LPDWORD lpdw)
*/
static DWORD MIDI_ReadMThd(UINT wDevID, DWORD dwOffset)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
DWORD toberead;
FOURCC fourcc;
dprintf_midi(stddeb, "MIDI_ReadMThd(%04X, %08lX);\n", wDevID, dwOffset);
......@@ -239,7 +241,7 @@ static DWORD MIDI_ReadMThd(UINT wDevID, DWORD dwOffset)
static DWORD MIDI_ReadMTrk(UINT wDevID, DWORD dwOffset)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
DWORD toberead;
FOURCC fourcc;
if (mmioSeek(MCIMidiDev[wDevID].hFile, dwOffset, SEEK_SET) != dwOffset) {
......@@ -267,7 +269,7 @@ static DWORD MIDI_ReadMTrk(UINT wDevID, DWORD dwOffset)
*/
static DWORD MIDI_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS lpParms)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
MIDIOPENDESC MidiDesc;
DWORD dwRet;
DWORD dwOffset;
......@@ -362,7 +364,7 @@ static DWORD MIDI_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS lpParms)
*/
static DWORD MIDI_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
dprintf_midi(stddeb, "MIDI_mciStop(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_INTERNAL;
MCIMidiDev[wDevID].dwStatus = MCI_MODE_STOP;
......@@ -380,7 +382,7 @@ static DWORD MIDI_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParm
*/
static DWORD MIDI_mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
DWORD dwRet;
dprintf_midi(stddeb, "MIDI_mciClose(%u, %08lX, %p);\n", wDevID, dwParam, lpParms);
if (MCIMidiDev[wDevID].dwStatus != MCI_MODE_STOP) {
......@@ -411,7 +413,7 @@ static DWORD MIDI_mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpPar
*/
static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
int count;
int start, end;
LPMIDIHDR lpMidiHdr;
......@@ -501,7 +503,7 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
*/
static DWORD MIDI_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpParms)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
int start, end;
LPMIDIHDR lpMidiHdr;
DWORD dwRet;
......@@ -563,7 +565,7 @@ static DWORD MIDI_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpPar
*/
static DWORD MIDI_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
dprintf_midi(stddeb, "MIDI_mciPause(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_INTERNAL;
return 0;
......@@ -578,7 +580,7 @@ static DWORD MIDI_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPar
*/
static DWORD MIDI_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
dprintf_midi(stddeb, "MIDI_mciResume(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_INTERNAL;
return 0;
......@@ -593,7 +595,7 @@ static DWORD MIDI_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPa
*/
static DWORD MIDI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
dprintf_midi(stddeb, "MIDI_mciSet(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_INTERNAL;
dprintf_midi(stddeb, "MIDI_mciSet // dwTimeFormat=%08lX\n", lpParms->dwTimeFormat);
......@@ -659,7 +661,7 @@ static DWORD MIDI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
*/
static DWORD MIDI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
dprintf_midi(stddeb, "MIDI_mciStatus(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_INTERNAL;
if (dwFlags & MCI_STATUS_ITEM) {
......@@ -748,7 +750,7 @@ static DWORD MIDI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpPar
static DWORD MIDI_mciGetDevCaps(UINT wDevID, DWORD dwFlags,
LPMCI_GETDEVCAPS_PARMS lpParms)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
dprintf_midi(stddeb, "MIDI_mciGetDevCaps(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_INTERNAL;
if (dwFlags & MCI_GETDEVCAPS_ITEM) {
......@@ -795,7 +797,7 @@ static DWORD MIDI_mciGetDevCaps(UINT wDevID, DWORD dwFlags,
*/
static DWORD MIDI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
dprintf_midi(stddeb, "MIDI_mciInfo(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_INTERNAL;
lpParms->lpstrReturn = NULL;
......@@ -837,7 +839,7 @@ static DWORD midGetDevCaps(WORD wDevID, LPMIDIINCAPS lpCaps, DWORD dwSize)
*/
static DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
int midi;
dprintf_midi(stddeb,
"midOpen(%u, %p, %08lX);\n", wDevID, lpDesc, dwFlags);
......@@ -892,7 +894,7 @@ static DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
*/
static DWORD midClose(WORD wDevID)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
dprintf_midi(stddeb, "midClose(%u);\n", wDevID);
if (MidiInDev[wDevID].unixdev == 0) {
dprintf_midi(stddeb,"Linux 'midClose' // can't close !\n");
......@@ -1021,7 +1023,7 @@ static DWORD modGetDevCaps(WORD wDevID, LPMIDIOUTCAPS lpCaps, DWORD dwSize)
*/
static DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
int midi;
dprintf_midi(stddeb,
"modOpen(%u, %p, %08lX);\n", wDevID, lpDesc, dwFlags);
......@@ -1079,7 +1081,7 @@ static DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
*/
static DWORD modClose(WORD wDevID)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
dprintf_midi(stddeb, "modClose(%u);\n", wDevID);
if (MidiOutDev[wDevID].unixdev == 0) {
dprintf_midi(stddeb,"Linux 'modClose' // can't close !\n");
......@@ -1103,7 +1105,7 @@ static DWORD modClose(WORD wDevID)
*/
static DWORD modData(WORD wDevID, DWORD dwParam)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
WORD event;
dprintf_midi(stddeb,
"modData(%u, %08lX);\n", wDevID, dwParam);
......@@ -1128,7 +1130,7 @@ static DWORD modData(WORD wDevID, DWORD dwParam)
*/
static DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
int count;
LPWORD ptr;
dprintf_midi(stddeb,
......@@ -1178,7 +1180,7 @@ static DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
*/
static DWORD modPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
dprintf_midi(stddeb,
"modPrepare(%u, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize);
if (MidiOutDev[wDevID].unixdev == 0) {
......@@ -1205,7 +1207,7 @@ static DWORD modPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
*/
static DWORD modUnprepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
dprintf_midi(stddeb,
"modUnprepare(%u, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize);
if (MidiOutDev[wDevID].unixdev == 0) {
......@@ -1270,7 +1272,7 @@ DWORD modMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
LONG MIDI_DriverProc(DWORD dwDevID, HDRVR16 hDriv, WORD wMsg,
DWORD dwParam1, DWORD dwParam2)
{
#ifdef linux
#if defined(linux) || defined(__FreeBSD__)
switch(wMsg) {
case DRV_LOAD:
return 1;
......
......@@ -403,11 +403,16 @@ HBITMAP16 BITMAP_SelectObject( DC * dc, HBITMAP16 hbitmap,
HBITMAP prevHandle = dc->w.hBitmap;
if (!(dc->w.flags & DC_MEMORY)) return 0;
hrgn = CreateRectRgn( 0, 0, bmp->bitmap.bmWidth, bmp->bitmap.bmHeight );
if (!hrgn) return 0;
DeleteObject( dc->w.hVisRgn );
dc->w.hVisRgn = hrgn;
if (dc->w.hVisRgn)
SetRectRgn(dc->w.hVisRgn, 0, 0, bmp->bitmap.bmWidth, bmp->bitmap.bmHeight );
else
{
hrgn = CreateRectRgn( 0, 0, bmp->bitmap.bmWidth, bmp->bitmap.bmHeight );
if (!hrgn) return 0;
dc->w.hVisRgn = hrgn;
}
dc->u.x.drawable = bmp->pixmap;
dc->w.hBitmap = hbitmap;
......
......@@ -159,32 +159,32 @@ int OffsetVisRgn( HDC hdc, short x, short y )
/***********************************************************************
* CLIPPING_IntersectClipRect
*
* Helper function for {Intersect,Exclude}ClipRect
* Helper function for {Intersect,Exclude}ClipRect, can be called from
* elsewhere (like ExtTextOut()) to skip redundant metafile update and
* coordinate conversion.
*/
static int CLIPPING_IntersectClipRect( DC * dc, short left, short top,
short right, short bottom, BOOL exclude)
int CLIPPING_IntersectClipRect( DC * dc, short left, short top,
short right, short bottom, UINT16 flags)
{
HRGN tempRgn, newRgn;
int ret;
HRGN newRgn;
int ret;
left = XLPTODP( dc, left );
right = XLPTODP( dc, right );
top = YLPTODP( dc, top );
bottom = YLPTODP( dc, bottom );
if (!(newRgn = CreateRectRgn( 0, 0, 0, 0 ))) return ERROR;
if (!(tempRgn = CreateRectRgn( left, top, right, bottom )))
if ( !(newRgn = CreateRectRgn( left, top, right, bottom )) ) return ERROR;
if ( !dc->w.hClipRgn )
{
DeleteObject( newRgn );
return ERROR;
if( flags & CLIP_INTERSECT )
{
dc->w.hClipRgn = newRgn;
CLIPPING_UpdateGCRegion( dc );
}
return SIMPLEREGION;
}
ret = CombineRgn( newRgn, dc->w.hClipRgn ? dc->w.hClipRgn : dc->w.hVisRgn,
tempRgn, exclude ? RGN_DIFF : RGN_AND);
DeleteObject( tempRgn );
ret = CombineRgn( newRgn, dc->w.hClipRgn, newRgn,
(flags & CLIP_EXCLUDE)? RGN_DIFF : RGN_AND);
if (ret != ERROR)
{
if (dc->w.hClipRgn) DeleteObject( dc->w.hClipRgn );
if ( !(flags & CLIP_KEEPRGN) ) DeleteObject( dc->w.hClipRgn );
dc->w.hClipRgn = newRgn;
CLIPPING_UpdateGCRegion( dc );
}
......@@ -208,9 +208,14 @@ int ExcludeClipRect( HDC hdc, short left, short top,
return NULLREGION; /* ?? */
}
left = XLPTODP( dc, left );
right = XLPTODP( dc, right );
top = YLPTODP( dc, top );
bottom = YLPTODP( dc, bottom );
dprintf_clipping(stddeb, "ExcludeClipRect: %04x %dx%d,%dx%d\n",
hdc, left, top, right, bottom );
return CLIPPING_IntersectClipRect( dc, left, top, right, bottom, TRUE );
return CLIPPING_IntersectClipRect( dc, left, top, right, bottom, CLIP_EXCLUDE );
}
......@@ -229,9 +234,14 @@ int IntersectClipRect( HDC hdc, short left, short top,
return NULLREGION; /* ?? */
}
left = XLPTODP( dc, left );
right = XLPTODP( dc, right );
top = YLPTODP( dc, top );
bottom = YLPTODP( dc, bottom );
dprintf_clipping(stddeb, "IntersectClipRect: %04x %dx%d,%dx%d\n",
hdc, left, top, right, bottom );
return CLIPPING_IntersectClipRect( dc, left, top, right, bottom, FALSE );
return CLIPPING_IntersectClipRect( dc, left, top, right, bottom, CLIP_INTERSECT );
}
......
......@@ -582,6 +582,8 @@ HDC CreateCompatibleDC( HDC hdc )
return 0;
}
DC_InitDC( dc );
return handle;
}
......@@ -650,9 +652,9 @@ int GetDeviceCaps( HDC hdc, WORD cap )
/***********************************************************************
* SetBkColor (GDI.1)
* SetBkColor (GDI.1) (GDI32.305)
*/
COLORREF SetBkColor( HDC hdc, COLORREF color )
COLORREF SetBkColor( HDC32 hdc, COLORREF color )
{
COLORREF oldColor;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
......@@ -672,9 +674,9 @@ COLORREF SetBkColor( HDC hdc, COLORREF color )
/***********************************************************************
* SetTextColor (GDI.9)
* SetTextColor (GDI.9) (GDI32.338)
*/
COLORREF SetTextColor( HDC hdc, COLORREF color )
COLORREF SetTextColor( HDC32 hdc, COLORREF color )
{
COLORREF oldColor;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
......
......@@ -287,8 +287,9 @@ void FONT_GetMetrics( LOGFONT16 * logfont, XFontStruct * xfont,
metrics->tmHeight = xfont->ascent + xfont->descent;
metrics->tmInternalLeading = 0;
if (XGetFontProperty( xfont, XA_X_HEIGHT, &prop ))
metrics->tmInternalLeading = xfont->ascent - (short)prop;
if (XGetFontProperty( xfont, XA_CAP_HEIGHT, &prop ))
metrics->tmInternalLeading = xfont->ascent+xfont->descent-(INT16)prop;
metrics->tmExternalLeading = 0;
metrics->tmMaxCharWidth = xfont->max_bounds.width;
metrics->tmWeight = logfont->lfWeight;
......
......@@ -668,13 +668,22 @@ void PlayMetaFileRecord(HDC hdc, HANDLETABLE16 *ht, METARECORD *mr,
case META_EXTTEXTOUT:
{
LPINT16 dxx;
s1=mr->rdParam[2]; /* String length */
if (mr->rdSize-(s1+1))
dxx=&mr->rdParam[8+(s1+1)/2]; /* start of array */
else
dxx=NULL; /* NO array present */
ExtTextOut16( hdc, mr->rdParam[1], /* X position */
DWORD len;
s1 = mr->rdParam[2]; /* String length */
len = sizeof(METARECORD) + (((s1 + 1) >> 1) * 2) + 2 * sizeof(short)
+ sizeof(UINT16) + sizeof(RECT16);
if (mr->rdSize == len / 2)
dxx = NULL; /* No array present */
else if (mr->rdSize == (len + s1 * sizeof(INT16)) / 2)
dxx = &mr->rdParam[8+(s1+1)/2]; /* start of array */
else {
fprintf(stderr,
"PlayMetaFileRecord ExtTextOut mr->rdSize = %08lx, count = %x\n",
mr->rdSize, s1);
dxx = NULL;
}
ExtTextOut16( hdc, mr->rdParam[1], /* X position */
mr->rdParam[0], /* Y position */
mr->rdParam[3], /* options */
(LPRECT16) &mr->rdParam[4], /* rectangle */
......@@ -1247,7 +1256,8 @@ BOOL MF_ExtTextOut(DC *dc, short x, short y, UINT16 flags, const RECT16 *rect,
HANDLE hmr;
METARECORD *mr;
len = sizeof(METARECORD) + (((count + 1) >> 1) * 2) + 4 + sizeof(RECT16);
len = sizeof(METARECORD) + (((count + 1) >> 1) * 2) + 2 * sizeof(short)
+ sizeof(UINT16) + sizeof(RECT16);
if (lpDx)
len+=count*sizeof(INT16);
if (!(hmr = GlobalAlloc16(GMEM_MOVEABLE, len)))
......
......@@ -31,6 +31,8 @@ static int tabwidth;
static int spacewidth;
static int prefix_offset;
extern int CLIPPING_IntersectClipRect( DC * dc, short left, short top,
short right, short bottom, UINT16 flags);
static const char *TEXT_NextLine( HDC hdc, const char *str, int *count,
char *dest, int *len, int width, WORD format)
......@@ -321,10 +323,11 @@ BOOL16 ExtTextOut16( HDC16 hdc, INT16 x, INT16 y, UINT16 flags,
const RECT16 *lprect, LPCSTR str, UINT16 count,
const INT16 *lpDx )
{
int dir, ascent, descent, i;
HRGN hRgnClip = 0;
int dir, ascent, descent, i;
XCharStruct info;
XFontStruct *font;
RECT16 rect;
RECT16 rect;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc)
......@@ -442,8 +445,17 @@ BOOL16 ExtTextOut16( HDC16 hdc, INT16 x, INT16 y, UINT16 flags,
if (flags & ETO_CLIPPED)
{
SaveVisRgn( hdc );
IntersectVisRect( hdc, rect.left, rect.top, rect.right, rect.bottom );
if (dc->w.flags & DC_MEMORY)
{
hRgnClip = dc->w.hClipRgn;
CLIPPING_IntersectClipRect(dc, rect.left, rect.top, rect.right, rect.bottom,
CLIP_INTERSECT | CLIP_KEEPRGN);
}
else
{
SaveVisRgn( hdc );
IntersectVisRect( hdc, rect.left, rect.top, rect.right, rect.bottom );
}
}
/* Draw the text background if necessary */
......@@ -550,7 +562,13 @@ BOOL16 ExtTextOut16( HDC16 hdc, INT16 x, INT16 y, UINT16 flags,
dc->w.DCOrgX + x, dc->w.DCOrgY + y - lineAscent,
dc->w.DCOrgX + x + info.width, dc->w.DCOrgY + y - lineAscent );
}
if (flags & ETO_CLIPPED) RestoreVisRgn( hdc );
if (flags & ETO_CLIPPED)
{
if( dc->w.flags & DC_MEMORY )
SelectClipRgn( hdc, hRgnClip );
else RestoreVisRgn( hdc );
}
return TRUE;
}
......
......@@ -99,7 +99,7 @@ static ERRNO_XLAT_TABLE errno_xlat_table[] = {
};
/**********************************************************************
* GetLastError (KERNEL32.227)
* GetLastError (KERNEL.148) (KERNEL32.227)
*/
DWORD GetLastError(void)
{
......@@ -107,7 +107,7 @@ DWORD GetLastError(void)
}
/**********************************************************************
* SetLastError (KERNEL32.497)
* SetLastError (KERNEL.147) (KERNEL32.497)
*
* This is probably not used by apps too much, but it's useful for
* our own internal use.
......
......@@ -186,7 +186,7 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT32 msg, WPARAM32 wParam,
{
if( wndPtr->flags & WIN_NCACTIVATED )
{
FillWindow( GetParent(wndPtr->hwndSelf), wndPtr->hwndSelf,
FillWindow( GetParent16(wndPtr->hwndSelf), wndPtr->hwndSelf,
(HDC)wParam, sysColorObjects.hbrushActiveCaption );
return 1;
}
......@@ -199,11 +199,11 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT32 msg, WPARAM32 wParam,
{
HBRUSH hbrush = CreateSolidBrush(
GetSysColor(((DWORD)wndPtr->class->hbrBackground)-1));
FillWindow( GetParent(wndPtr->hwndSelf), wndPtr->hwndSelf,
FillWindow( GetParent16(wndPtr->hwndSelf), wndPtr->hwndSelf,
(HDC)wParam, hbrush);
DeleteObject (hbrush);
}
else FillWindow( GetParent(wndPtr->hwndSelf), wndPtr->hwndSelf,
else FillWindow( GetParent16(wndPtr->hwndSelf), wndPtr->hwndSelf,
(HDC)wParam, wndPtr->class->hbrBackground );
return 1;
}
......
......@@ -174,15 +174,18 @@ void EVENT_ProcessEvent( XEvent *event )
{
case KeyPress:
case KeyRelease:
EVENT_key( (XKeyEvent*)event );
if (!HOOK_GetHook(WH_JOURNALPLAYBACK, 0) )
EVENT_key( (XKeyEvent*)event );
break;
case ButtonPress:
EVENT_ButtonPress( (XButtonEvent*)event );
if (!HOOK_GetHook(WH_JOURNALPLAYBACK, 0) )
EVENT_ButtonPress( (XButtonEvent*)event );
break;
case ButtonRelease:
EVENT_ButtonRelease( (XButtonEvent*)event );
if (!HOOK_GetHook(WH_JOURNALPLAYBACK, 0) )
EVENT_ButtonRelease( (XButtonEvent*)event );
break;
case MotionNotify:
......@@ -194,9 +197,12 @@ void EVENT_ProcessEvent( XEvent *event )
problems if the event order is important. I'm not yet seen
of any problems. Jon 7/6/96.
*/
while (XCheckTypedWindowEvent(display, ((XAnyEvent *)event)->window,
MotionNotify, event));
EVENT_MotionNotify( (XMotionEvent*)event );
if (!HOOK_GetHook(WH_JOURNALPLAYBACK, 0) )
{
while (XCheckTypedWindowEvent(display,((XAnyEvent *)event)->window,
MotionNotify, event));
EVENT_MotionNotify( (XMotionEvent*)event );
}
break;
case FocusIn:
......
......@@ -227,7 +227,7 @@ HMENU MDISetMenu(HWND hwnd, BOOL fRefresh, HMENU hmenuFrame, HMENU hmenuWindow)
if (!fRefresh)
{
HWND hwndFrame = GetParent(hwnd);
HWND hwndFrame = GetParent16(hwnd);
HMENU oldFrameMenu = GetMenu(hwndFrame);
if( ci->hwndChildMaximized && hmenuFrame && hmenuFrame!=oldFrameMenu )
......@@ -504,7 +504,7 @@ HWND MDIDestroyChild(WND *w_parent, MDICLIENTINFO *ci, HWND parent,
if (flagDestroy)
{
MDI_PostUpdate(GetParent(child), ci, SB_BOTH+1);
MDI_PostUpdate(GetParent16(child), ci, SB_BOTH+1);
DestroyWindow(child);
}
}
......@@ -1329,7 +1329,7 @@ LRESULT DefMDIChildProc16( HWND16 hwnd, UINT16 message,
MDICLIENTINFO *ci;
WND *clientWnd;
clientWnd = WIN_FindWndPtr(GetParent(hwnd));
clientWnd = WIN_FindWndPtr(GetParent16(hwnd));
ci = (MDICLIENTINFO *) clientWnd->wExtra;
switch (message)
......@@ -1471,7 +1471,7 @@ LRESULT DefMDIChildProc32A( HWND32 hwnd, UINT32 message,
MDICLIENTINFO *ci;
WND *clientWnd;
clientWnd = WIN_FindWndPtr(GetParent(hwnd));
clientWnd = WIN_FindWndPtr(GetParent16(hwnd));
ci = (MDICLIENTINFO *) clientWnd->wExtra;
switch (message)
......@@ -1523,7 +1523,7 @@ LRESULT DefMDIChildProc32W( HWND32 hwnd, UINT32 message,
MDICLIENTINFO *ci;
WND *clientWnd;
clientWnd = WIN_FindWndPtr(GetParent(hwnd));
clientWnd = WIN_FindWndPtr(GetParent16(hwnd));
ci = (MDICLIENTINFO *) clientWnd->wExtra;
switch (message)
......
......@@ -6,6 +6,7 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <sys/time.h>
#include <sys/types.h>
......@@ -31,8 +32,13 @@
#define HWND_BROADCAST16 ((HWND16)0xffff)
#define HWND_BROADCAST32 ((HWND32)0xffffffff)
extern BYTE* KeyStateTable; /* event.c */
#define ASCII_CHAR_HACK 0x0800
extern WPARAM lastEventChar; /* event.c */
extern BOOL MouseButtonsStates[3];
extern BOOL AsyncMouseButtonsStates[3];
extern BYTE KeyStateTable[256];
extern BYTE AsyncKeyStateTable[256];
DWORD MSG_WineStartTicks; /* Ticks at Wine startup */
......@@ -263,8 +269,8 @@ static void MSG_JournalRecordMsg( MSG16 *msg )
HOOK_CallHooks( WH_JOURNALRECORD, HC_ACTION, 0,
(LPARAM)SEGPTR_GET(event) );
}
else if ((msg->message >= WM_NCMOUSEMOVE) &&
(msg->message <= WM_NCMBUTTONDBLCLK))
else if ((msg->message >= WM_NCMOUSEFIRST) &&
(msg->message <= WM_NCMOUSELAST))
{
event->paramL = LOWORD(msg->lParam); /* X pos */
event->paramH = HIWORD(msg->lParam); /* Y pos */
......@@ -275,6 +281,108 @@ static void MSG_JournalRecordMsg( MSG16 *msg )
SEGPTR_FREE(event);
}
/*****************************************************************
* MSG_JournalPlayBackIsAscii
*/
static BOOL MSG_JournalPlayBackIsAscii(WPARAM wParam)
{
return ((wParam>VK_HELP && wParam<VK_F1) ||
wParam == VK_SPACE ||
wParam == VK_ESCAPE ||
wParam == VK_RETURN ||
wParam == VK_TAB ||
wParam == VK_BACK);
}
/***********************************************************************
* MSG_JournalPlayBackMsg
*
* Get an EVENTMSG struct via call JOURNALPAYBACK hook function
*/
static int MSG_JournalPlayBackMsg(void)
{
EVENTMSG16 *tmpMsg;
long wtime,lParam;
WORD keyDown,i,wParam,result=0;
if ( HOOK_GetHook(WH_JOURNALPLAYBACK, 0) )
{
tmpMsg = SEGPTR_NEW(EVENTMSG16);
wtime=HOOK_CallHooks( WH_JOURNALPLAYBACK, HC_GETNEXT, 0, (LPARAM)SEGPTR_GET(tmpMsg));
/* dprintf_msg(stddeb,"Playback wait time =%ld\n",wtime); */
if (wtime<=0)
{
wtime=0;
if ((tmpMsg->message>= WM_KEYFIRST) && (tmpMsg->message <= WM_KEYLAST))
{
wParam=tmpMsg->paramL & 0xFF;
lParam=MAKELONG(tmpMsg->paramH&0x7ffff,tmpMsg->paramL>>8);
if (tmpMsg->message == WM_KEYDOWN || tmpMsg->message == WM_SYSKEYDOWN)
{
for (keyDown=i=0; i<256 && !keyDown; i++)
if (KeyStateTable[i] & 0x80)
keyDown++;
if (!keyDown)
lParam |= 0x40000000;
AsyncKeyStateTable[wParam]=KeyStateTable[wParam] |= 0x80;
if (MSG_JournalPlayBackIsAscii(wParam))
{
lastEventChar= wParam; /* control TranslateMessage() */
lParam |= (LONG)((LONG)ASCII_CHAR_HACK*0x10000L);
if (!(KeyStateTable[VK_SHIFT] & 0x80) &&
!(KeyStateTable[VK_CAPITAL] & 0x80))
lastEventChar= tolower(lastEventChar);
if (KeyStateTable[VK_CONTROL] & 0x80)
lastEventChar&=0x1f;
}
}
else /* WM_KEYUP, WM_SYSKEYUP */
{
lParam |= 0xC0000000;
AsyncKeyStateTable[wParam]=KeyStateTable[wParam] &= ~0x80;
}
if (KeyStateTable[VK_MENU] & 0x80)
lParam |= 0x20000000;
if (tmpMsg->paramH & 0x8000) /*special_key bit*/
lParam |= 0x01000000;
hardware_event( tmpMsg->message, wParam, lParam,0, 0, tmpMsg->time, 0 );
}
else
{
if ((tmpMsg->message>= WM_MOUSEFIRST) && (tmpMsg->message <= WM_MOUSELAST))
{
switch (tmpMsg->message)
{
case WM_LBUTTONDOWN:MouseButtonsStates[0]=AsyncMouseButtonsStates[0]=1;break;
case WM_LBUTTONUP: MouseButtonsStates[0]=AsyncMouseButtonsStates[0]=0;break;
case WM_MBUTTONDOWN:MouseButtonsStates[1]=AsyncMouseButtonsStates[1]=1;break;
case WM_MBUTTONUP: MouseButtonsStates[1]=AsyncMouseButtonsStates[1]=0;break;
case WM_RBUTTONDOWN:MouseButtonsStates[2]=AsyncMouseButtonsStates[2]=1;break;
case WM_RBUTTONUP: MouseButtonsStates[2]=AsyncMouseButtonsStates[2]=0;break;
}
AsyncKeyStateTable[VK_LBUTTON]= KeyStateTable[VK_LBUTTON] = MouseButtonsStates[0] << 8;
AsyncKeyStateTable[VK_MBUTTON]= KeyStateTable[VK_MBUTTON] = MouseButtonsStates[1] << 8;
AsyncKeyStateTable[VK_RBUTTON]= KeyStateTable[VK_RBUTTON] = MouseButtonsStates[2] << 8;
SetCursorPos(tmpMsg->paramL,tmpMsg->paramH);
lParam=MAKELONG(tmpMsg->paramL,tmpMsg->paramH);
wParam=0;
if (MouseButtonsStates[0]) wParam |= MK_LBUTTON;
if (MouseButtonsStates[1]) wParam |= MK_MBUTTON;
if (MouseButtonsStates[2]) wParam |= MK_RBUTTON;
hardware_event( tmpMsg->message, wParam, lParam,
tmpMsg->paramL, tmpMsg->paramH, tmpMsg->time, 0 );
}
}
HOOK_CallHooks( WH_JOURNALPLAYBACK, HC_SKIP, 0, (LPARAM)SEGPTR_GET(tmpMsg));
}
else
result= QS_MOUSE | QS_KEY;
SEGPTR_FREE(tmpMsg);
}
return result;
}
/***********************************************************************
* MSG_PeekHardwareMsg
......@@ -490,6 +598,8 @@ static BOOL MSG_PeekMessage( LPMSG16 msg, HWND hwnd, WORD first, WORD last,
break;
}
msgQueue->changeBits |= MSG_JournalPlayBackMsg();
/* Now find a hardware event */
if (((msgQueue->wakeBits & mask) & (QS_MOUSE | QS_KEY)) &&
......@@ -909,7 +1019,6 @@ void WaitMessage( void )
* This should call ToAscii but it is currently broken
*/
#define ASCII_CHAR_HACK 0x0800
BOOL TranslateMessage( LPMSG16 msg )
{
......
......@@ -219,7 +219,7 @@ void PaintRect( HWND16 hwndParent, HWND16 hwnd, HDC16 hdc,
*/
HBRUSH GetControlBrush( HWND hwnd, HDC hdc, WORD control )
{
return (HBRUSH)SendMessage32A( GetParent(hwnd), WM_CTLCOLOR+control,
return (HBRUSH)SendMessage32A( GetParent32(hwnd), WM_CTLCOLOR+control,
(WPARAM)hdc, (LPARAM)hwnd );
}
......
......@@ -145,10 +145,10 @@ void SYSCOLOR_Init(void)
/*************************************************************************
* GetSysColor (USER.180)
* GetSysColor (USER.180) (USER32.288)
*/
COLORREF GetSysColor(short nIndex)
COLORREF GetSysColor( INT32 nIndex )
{
dprintf_syscolor(stddeb,"System Color %d = %8lx\n",
nIndex, SysColors[nIndex]);
......
......@@ -1473,9 +1473,18 @@ BOOL16 IsWindow( HWND32 hwnd )
/*****************************************************************
* GetParent (USER.46)
* GetParent16 (USER.46)
*/
HWND GetParent(HWND hwnd)
HWND16 GetParent16( HWND16 hwnd )
{
return (HWND16)GetParent32( hwnd );
}
/*****************************************************************
* GetParent32 (USER32.277)
*/
HWND32 GetParent32( HWND32 hwnd )
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
if (!wndPtr) return 0;
......
......@@ -1832,7 +1832,7 @@ BOOL SetWindowPos( HWND hwnd, HWND hwndInsertAfter, INT x, INT y,
}
if ((winpos->hwnd == GetFocus()) || IsChild(winpos->hwnd, GetFocus()))
SetFocus( GetParent(winpos->hwnd) ); /* Revert focus to parent */
SetFocus( GetParent32(winpos->hwnd) ); /* Revert focus to parent */
if (winpos->hwnd == hwndActive)
{
......
......@@ -390,11 +390,8 @@ INT32 WINPROC_MapMsg32ATo32W( UINT32 msg, WPARAM32 wParam, LPARAM *plparam )
}
return 1;
case WM_ASKCBFORMATNAME:
case WM_COMPAREITEM:
case WM_DELETEITEM:
case WM_DEVMODECHANGE:
case WM_MDIACTIVATE:
case WM_MEASUREITEM:
case WM_PAINTCLIPBOARD:
case WM_SIZECLIPBOARD:
case WM_WININICHANGE:
......@@ -497,11 +494,8 @@ INT32 WINPROC_MapMsg32WTo32A( UINT32 msg, WPARAM32 wParam, LPARAM *plparam )
}
return 1;
case WM_ASKCBFORMATNAME:
case WM_COMPAREITEM:
case WM_DELETEITEM:
case WM_DEVMODECHANGE:
case WM_MDIACTIVATE:
case WM_MEASUREITEM:
case WM_PAINTCLIPBOARD:
case WM_SIZECLIPBOARD:
case WM_WININICHANGE:
......@@ -570,17 +564,67 @@ INT32 WINPROC_MapMsg16To32A( UINT16 msg16, WPARAM16 wParam16, UINT32 *pmsg32,
case WM_ACTIVATE:
case WM_CHARTOITEM:
case WM_COMMAND:
case WM_HSCROLL:
case WM_VKEYTOITEM:
case WM_VSCROLL:
*pwparam32 = MAKEWPARAM( wParam16, HIWORD(*plparam) );
*plparam = (LPARAM)(HWND32)LOWORD(*plparam);
return 0;
case WM_HSCROLL:
case WM_VSCROLL:
*pwparam32 = MAKEWPARAM( wParam16, LOWORD(*plparam) );
*plparam = (LPARAM)(HWND32)HIWORD(*plparam);
return 0;
case WM_CTLCOLOR:
*pmsg32 = WM_CTLCOLORMSGBOX + HIWORD(*plparam);
*pwparam32 = (WPARAM32)(HDC32)wParam16;
*plparam = (LPARAM)(HWND32)LOWORD(*plparam);
return 0;
case WM_COMPAREITEM:
{
COMPAREITEMSTRUCT16* cis16 = (COMPAREITEMSTRUCT16 *)PTR_SEG_TO_LIN(*plparam);
COMPAREITEMSTRUCT32 *cis = (COMPAREITEMSTRUCT32 *)
HeapAlloc(SystemHeap, 0, sizeof(*cis));
if (!cis) return -1;
cis->CtlType = cis16->CtlType;
cis->CtlID = cis16->CtlID;
cis->hwndItem = cis16->hwndItem;
cis->itemID1 = cis16->itemID1;
cis->itemData1 = cis16->itemData1;
cis->itemID2 = cis16->itemID2;
cis->itemData2 = cis16->itemData2;
cis->dwLocaleId = 0; /* FIXME */
*plparam = (LPARAM)cis;
}
return 1;
case WM_DELETEITEM:
{
DELETEITEMSTRUCT16* dis16 = (DELETEITEMSTRUCT16 *)PTR_SEG_TO_LIN(*plparam);
DELETEITEMSTRUCT32 *dis = (DELETEITEMSTRUCT32 *)
HeapAlloc(SystemHeap, 0, sizeof(*dis));
if (!dis) return -1;
dis->CtlType = dis16->CtlType;
dis->CtlID = dis16->CtlID;
dis->hwndItem = dis16->hwndItem;
dis->itemData = dis16->itemData;
*plparam = (LPARAM)dis;
}
return 1;
case WM_MEASUREITEM:
{
MEASUREITEMSTRUCT16* mis16 = (MEASUREITEMSTRUCT16 *)PTR_SEG_TO_LIN(*plparam);
MEASUREITEMSTRUCT32 *mis = (MEASUREITEMSTRUCT32 *)
HeapAlloc(SystemHeap, 0,
sizeof(*mis) + sizeof(LPARAM));
if (!mis) return -1;
mis->CtlType = mis16->CtlType;
mis->CtlID = mis16->CtlID;
mis->itemID = mis16->itemID;
mis->itemWidth = mis16->itemWidth;
mis->itemHeight = mis16->itemHeight;
mis->itemData = mis16->itemData;
*(LPARAM *)(mis + 1) = *plparam; /* Store the previous lParam */
*plparam = (LPARAM)mis;
}
return 1;
case WM_DRAWITEM:
{
DRAWITEMSTRUCT16* dis16 = (DRAWITEMSTRUCT16 *)PTR_SEG_TO_LIN(*plparam);
......@@ -696,11 +740,8 @@ INT32 WINPROC_MapMsg16To32A( UINT16 msg16, WPARAM16 wParam16, UINT32 *pmsg32,
}
return 1;
case WM_ASKCBFORMATNAME:
case WM_COMPAREITEM:
case WM_DELETEITEM:
case WM_DEVMODECHANGE:
case WM_MDIACTIVATE:
case WM_MEASUREITEM:
case WM_PAINTCLIPBOARD:
case WM_SIZECLIPBOARD:
case WM_WININICHANGE:
......@@ -723,9 +764,22 @@ void WINPROC_UnmapMsg16To32A( UINT32 msg, WPARAM32 wParam, LPARAM lParam )
{
switch(msg)
{
case WM_COMPAREITEM:
case WM_DELETEITEM:
case WM_DRAWITEM:
HeapFree( SystemHeap, 0, (LPVOID)lParam );
break;
case WM_MEASUREITEM:
{
MEASUREITEMSTRUCT16 *mis16;
MEASUREITEMSTRUCT32 *mis = (MEASUREITEMSTRUCT32 *)lParam;
lParam = *(LPARAM *)(mis + 1);
mis16 = (MEASUREITEMSTRUCT16 *)PTR_SEG_TO_LIN(lParam);
mis16->itemWidth = (UINT16)mis->itemWidth;
mis16->itemHeight = (UINT16)mis->itemHeight;
HeapFree( SystemHeap, 0, mis );
}
break;
case WM_GETMINMAXINFO:
{
MINMAXINFO32 *mmi = (MINMAXINFO32 *)lParam;
......@@ -931,6 +985,34 @@ INT32 WINPROC_MapMsg32ATo16( UINT32 msg32, WPARAM32 wParam32, UINT16 *pmsg16,
*plparam = MAKELPARAM( (HWND16)*plparam,
(WORD)msg32 - WM_CTLCOLORMSGBOX );
return 0;
case WM_COMPAREITEM:
{
COMPAREITEMSTRUCT32 *cis32 = (COMPAREITEMSTRUCT32 *)*plparam;
COMPAREITEMSTRUCT16 *cis = SEGPTR_NEW(COMPAREITEMSTRUCT16);
if (!cis) return -1;
cis->CtlType = (UINT16)cis32->CtlType;
cis->CtlID = (UINT16)cis32->CtlID;
cis->hwndItem = (HWND16)cis32->hwndItem;
cis->itemID1 = (UINT16)cis32->itemID1;
cis->itemData1 = cis32->itemData1;
cis->itemID2 = (UINT16)cis32->itemID2;
cis->itemData2 = cis32->itemData2;
*plparam = (LPARAM)SEGPTR_GET(cis);
}
return 1;
case WM_DELETEITEM:
{
DELETEITEMSTRUCT32 *dis32 = (DELETEITEMSTRUCT32 *)*plparam;
DELETEITEMSTRUCT16 *dis = SEGPTR_NEW(DELETEITEMSTRUCT16);
if (!dis) return -1;
dis->CtlType = (UINT16)dis32->CtlType;
dis->CtlID = (UINT16)dis32->CtlID;
dis->itemID = (UINT16)dis32->itemID;
dis->hwndItem = (HWND16)dis32->hwndItem;
dis->itemData = dis32->itemData;
*plparam = (LPARAM)SEGPTR_GET(dis);
}
return 1;
case WM_DRAWITEM:
{
DRAWITEMSTRUCT32 *dis32 = (DRAWITEMSTRUCT32 *)*plparam;
......@@ -948,6 +1030,22 @@ INT32 WINPROC_MapMsg32ATo16( UINT32 msg32, WPARAM32 wParam32, UINT16 *pmsg16,
*plparam = (LPARAM)SEGPTR_GET(dis);
}
return 1;
case WM_MEASUREITEM:
{
MEASUREITEMSTRUCT32 *mis32 = (MEASUREITEMSTRUCT32 *)*plparam;
MEASUREITEMSTRUCT16 *mis = (MEASUREITEMSTRUCT16 *)
SEGPTR_ALLOC(sizeof(*mis)+sizeof(LPARAM));
if (!mis) return -1;
mis->CtlType = (UINT16)mis32->CtlType;
mis->CtlID = (UINT16)mis32->CtlID;
mis->itemID = (UINT16)mis32->itemID;
mis->itemWidth = (UINT16)mis32->itemWidth;
mis->itemHeight = (UINT16)mis32->itemHeight;
mis->itemData = mis32->itemData;
*(LPARAM *)(mis + 1) = *plparam; /* Store the previous lParam */
*plparam = (LPARAM)SEGPTR_GET(mis);
}
return 1;
case WM_GETMINMAXINFO:
{
MINMAXINFO16 *mmi = (MINMAXINFO16 *)SEGPTR_ALLOC( sizeof(*mmi) +
......@@ -1055,11 +1153,8 @@ INT32 WINPROC_MapMsg32ATo16( UINT32 msg32, WPARAM32 wParam32, UINT16 *pmsg16,
}
return 1;
case WM_ASKCBFORMATNAME:
case WM_COMPAREITEM:
case WM_DELETEITEM:
case WM_DEVMODECHANGE:
case WM_MDIACTIVATE:
case WM_MEASUREITEM:
case WM_PAINTCLIPBOARD:
case WM_SIZECLIPBOARD:
case WM_WININICHANGE:
......@@ -1082,9 +1177,20 @@ void WINPROC_UnmapMsg32ATo16( UINT16 msg, WPARAM16 wParam, LPARAM lParam )
{
switch(msg)
{
case WM_COMPAREITEM:
case WM_DELETEITEM:
case WM_DRAWITEM:
SEGPTR_FREE( PTR_SEG_TO_LIN(lParam) );
break;
case WM_MEASUREITEM:
{
MEASUREITEMSTRUCT16 *mis = (MEASUREITEMSTRUCT16 *)PTR_SEG_TO_LIN(lParam);
MEASUREITEMSTRUCT32 *mis32 = *(MEASUREITEMSTRUCT32 **)(mis + 1);
mis32->itemWidth = mis->itemWidth;
mis32->itemHeight = mis->itemHeight;
SEGPTR_FREE(mis);
}
break;
case WM_GETMINMAXINFO:
{
MINMAXINFO16 *mmi = (MINMAXINFO16 *)PTR_SEG_TO_LIN(lParam);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment