Release 960902 wine-960902
authorAlexandre Julliard <julliard@winehq.org>
Mon, 2 Sep 1996 16:46:30 +0000 (16:46 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 2 Sep 1996 16:46:30 +0000 (16:46 +0000)
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.

49 files changed:
ANNOUNCE
ChangeLog
controls/button.c
controls/combo.c
controls/listbox.c
controls/scroll.c
controls/static.c
controls/status.c
files/drive.c
files/profile.c
if1632/commdlg.spec
if1632/crtdll.spec
if1632/kernel.spec
if1632/user.spec
if1632/user32.spec
if1632/wsock32.spec
include/commdlg.h
include/dc.h
include/windows.h
ipc/dde_proc.c
loader/ne_image.c
loader/pe_image.c
memory/string.c
misc/commdlg.c
misc/crtdll.c
misc/ole2nls.c
misc/spy.c
misc/winsocket.c
multimedia/audio.c
multimedia/mcianim.c
multimedia/mcicda.c
multimedia/mcistring.c
multimedia/midi.c
objects/bitmap.c
objects/clipping.c
objects/dc.c
objects/font.c
objects/metafile.c
objects/text.c
win32/error.c
windows/defwnd.c
windows/event.c
windows/mdi.c
windows/message.c
windows/painting.c
windows/syscolor.c
windows/win.c
windows/winpos.c
windows/winproc.c

index 627612c52a56421a6a8dd360f7803a522c7ed567..4e63740cc351a31c8211221e6f52c82ab0510a81 100644 (file)
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,13 +1,13 @@
-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.
 
index e30e7a8bf16b11b7e9c97eecf3f6a81169d13bd3..d3a1b81b972c0d06bab36338d73df2f63e87b879 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,55 @@
+----------------------------------------------------------------------
+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>
 
index c0aca7e7cee49f54234d5102bd342d9cf71a7d75..99300f2f4e20f2ef05b062c80712ac98c2f9f5a2 100644 (file)
@@ -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 );
 }
index aac742ed47b6a5fb5da875dd0ee152fce65e3c48..80a016b460d819b73f5c8ea3fd8939344247f005 100644 (file)
@@ -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);
          }
 
index 7b81deab6075cdca74ea36a5ea4b7c31562ec628..8bf7c36f82363584b4da31943db7d7c35e50b8fa 100644 (file)
@@ -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;
         }
     }
 
index 4bc72d6ed4cfbca6e5bcb4ad8e00bf575792f25e..d198bbbacf4943f717db95e3438ea09d843b7c1e 100644 (file)
@@ -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)
index 7763ce2c7ae8fb9569ce1a17e024ff1d79ebbb98..8f91c6f208944d4f2d007f97098332eae73a1310 100644 (file)
@@ -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 );
index 0b6eb80d008d163c980c2e1b035ea76ca3ac6b2d..3217b2bf894692f31303e8aafffe067c680e97f6 100644 (file)
@@ -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;
index d6350c65e81a237c9b8a018b42f7ab741295137d..8695320d4d47a198c45ae91052d484e2ac176306 100644 (file)
@@ -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;
index 63a302807e32d3a0e6b8dd50aff10faed7037b94..b7c059549ddd99dbd628c9c5113d509a28aef8fb 100644 (file)
@@ -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;
 }
index 7f85c1d2818aa6db02e29af8654bab99db6296d3..5eb618148db298a2c0ad125ee3f510460f66745b 100644 (file)
@@ -1,22 +1,22 @@
 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
index 733d4051b89d443bbd2790208a66fff495d776e5..b290cb0ca9bb81bb13d38cb9321b9ee9d0c3da70 100644 (file)
@@ -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
index bc5e6168d5ffbb07e3f415ea3a1986dbf2707596..e6f943a50a0cee0e4c155635f1bb18a0d495cd13 100644 (file)
@@ -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
index 4819c688576bc6eb48c32ae2b6a1aa7daa6d0c26..a74189b96a4481c624be14149ecaa1f4d175942e 100644 (file)
@@ -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
index faff16a94683df5c0e4a1dabefe96dca87da27ea..a55b91f9bddf0655b49c734f8c8f04ad9e5ad710 100644 (file)
@@ -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
index 67c7908dcfc8bf16326dcb8f9e04b9f8ac862d6f..7d5a520cf6ceaa2efd0f796f53fd9b306a19f0a1 100644 (file)
@@ -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
index 1a01a7c8b57ecaefc2dfd74bf7a7dda0aba5c7e8..83f794edee6244dbc155479b66d04b478349761b 100644 (file)
@@ -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);
index 6356a6b3775eedc4412ea709b0afc35005a5740b..8f98b9c0f158df402beb06499dbb1f58bf4af58c 100644 (file)
 
 #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 );
index 988d8d73d58292f6b2456faa511bc825ef8d7186..96798f25b945f6750020f7b0fa6554294b7a2ed3 100644 (file)
@@ -2572,39 +2572,117 @@ DECL_WINELIB_TYPE(LPSCROLLINFO);
 #define LBS_STANDARD          (LBS_NOTIFY | LBS_SORT | WS_VSCROLL | WS_BORDER)
 
 /* Listbox messages */
-#define LB_ADDSTRING           (WM_USER+1)
-#define LB_INSERTSTRING        (WM_USER+2)
-#define LB_DELETESTRING        (WM_USER+3)
-#define LB_RESETCONTENT        (WM_USER+5)
-#define LB_SETSEL              (WM_USER+6)
-#define LB_SETCURSEL           (WM_USER+7)
-#define LB_GETSEL              (WM_USER+8)
-#define LB_GETCURSEL           (WM_USER+9)
-#define LB_GETTEXT             (WM_USER+10)
-#define LB_GETTEXTLEN          (WM_USER+11)
-#define LB_GETCOUNT            (WM_USER+12)
-#define LB_SELECTSTRING        (WM_USER+13)
-#define LB_DIR                 (WM_USER+14)
-#define LB_GETTOPINDEX         (WM_USER+15)
-#define LB_FINDSTRING          (WM_USER+16)
-#define LB_GETSELCOUNT         (WM_USER+17)
-#define LB_GETSELITEMS         (WM_USER+18)
-#define LB_SETTABSTOPS         (WM_USER+19)
-#define LB_GETHORIZONTALEXTENT (WM_USER+20)
-#define LB_SETHORIZONTALEXTENT (WM_USER+21)
-#define LB_SETCOLUMNWIDTH      (WM_USER+22)
-#define LB_SETTOPINDEX         (WM_USER+24)
-#define LB_GETITEMRECT         (WM_USER+25)
-#define LB_GETITEMDATA         (WM_USER+26)
-#define LB_SETITEMDATA         (WM_USER+27)
-#define LB_SELITEMRANGE        (WM_USER+28)
-#define LB_SETANCHORINDEX      (WM_USER+29) /* undoc. - for LBS_EXTENDEDSEL */
-#define LB_GETANCHORINDEX      (WM_USER+30) /* - * - */
-#define LB_SETCARETINDEX       (WM_USER+31)
-#define LB_GETCARETINDEX       (WM_USER+32)
-#define LB_SETITEMHEIGHT       (WM_USER+33)
-#define LB_GETITEMHEIGHT       (WM_USER+34)
-#define LB_FINDSTRINGEXACT     (WM_USER+35)
+#define LB_ADDSTRING16           (WM_USER+1)
+#define LB_ADDSTRING32           0x0180
+#define LB_ADDSTRING             WINELIB_NAME(LB_ADDSTRING)
+#define LB_INSERTSTRING16        (WM_USER+2)
+#define LB_INSERTSTRING32        0x0181
+#define LB_INSERTSTRING          WINELIB_NAME(LB_INSERTSTRING)
+#define LB_DELETESTRING16        (WM_USER+3)
+#define LB_DELETESTRING32        0x0182
+#define LB_DELETESTRING          WINELIB_NAME(LB_DELETESTRING)
+#define LB_SELITEMRANGEEX16      (WM_USER+4)
+#define LB_SELITEMRANGEEX32      0x0183
+#define LB_SELITEMRANGEEX        WINELIB_NAME(LB_SELITEMRANGEEX)
+#define LB_RESETCONTENT16        (WM_USER+5)
+#define LB_RESETCONTENT32        0x0184
+#define LB_RESETCONTENT          WINELIB_NAME(LB_RESETCONTENT)
+#define LB_SETSEL16              (WM_USER+6)
+#define LB_SETSEL32              0x0185
+#define LB_SETSEL                WINELIB_NAME(LB_SETSEL)
+#define LB_SETCURSEL16           (WM_USER+7)
+#define LB_SETCURSEL32           0x0186
+#define LB_SETCURSEL             WINELIB_NAME(LB_SETCURSEL)
+#define LB_GETSEL16              (WM_USER+8)
+#define LB_GETSEL32              0x0187
+#define LB_GETSEL                WINELIB_NAME(LB_GETSEL)
+#define LB_GETCURSEL16           (WM_USER+9)
+#define LB_GETCURSEL32           0x0188
+#define LB_GETCURSEL             WINELIB_NAME(LB_GETCURSEL)
+#define LB_GETTEXT16             (WM_USER+10)
+#define LB_GETTEXT32             0x0189
+#define LB_GETTEXT               WINELIB_NAME(LB_GETTEXT)
+#define LB_GETTEXTLEN16          (WM_USER+11)
+#define LB_GETTEXTLEN32          0x018a
+#define LB_GETTEXTLEN            WINELIB_NAME(LB_GETTEXTLEN)
+#define LB_GETCOUNT16            (WM_USER+12)
+#define LB_GETCOUNT32            0x018b
+#define LB_GETCOUNT              WINELIB_NAME(LB_GETCOUNT)
+#define LB_SELECTSTRING16        (WM_USER+13)
+#define LB_SELECTSTRING32        0x018c
+#define LB_SELECTSTRING          WINELIB_NAME(LB_SELECTSTRING)
+#define LB_DIR16                 (WM_USER+14)
+#define LB_DIR32                 0x018d
+#define LB_DIR                   WINELIB_NAME(LB_DIR)
+#define LB_GETTOPINDEX16         (WM_USER+15)
+#define LB_GETTOPINDEX32         0x018e
+#define LB_GETTOPINDEX           WINELIB_NAME(LB_GETTOPINDEX)
+#define LB_FINDSTRING16          (WM_USER+16)
+#define LB_FINDSTRING32          0x018f
+#define LB_FINDSTRING            WINELIB_NAME(LB_FINDSTRING)
+#define LB_GETSELCOUNT16         (WM_USER+17)
+#define LB_GETSELCOUNT32         0x0190
+#define LB_GETSELCOUNT           WINELIB_NAME(LB_GETSELCOUNT)
+#define LB_GETSELITEMS16         (WM_USER+18)
+#define LB_GETSELITEMS32         0x0191
+#define LB_GETSELITEMS           WINELIB_NAME(LB_GETSELITEMS)
+#define LB_SETTABSTOPS16         (WM_USER+19)
+#define LB_SETTABSTOPS32         0x0192
+#define LB_SETTABSTOPS           WINELIB_NAME(LB_SETTABSTOPS)
+#define LB_GETHORIZONTALEXTENT16 (WM_USER+20)
+#define LB_GETHORIZONTALEXTENT32 0x0193
+#define LB_GETHORIZONTALEXTENT   WINELIB_NAME(LB_GETHORIZONTALEXTENT)
+#define LB_SETHORIZONTALEXTENT16 (WM_USER+21)
+#define LB_SETHORIZONTALEXTENT32 0x0194
+#define LB_SETHORIZONTALEXTENT   WINELIB_NAME(LB_SETHORIZONTALEXTENT)
+#define LB_SETCOLUMNWIDTH16      (WM_USER+22)
+#define LB_SETCOLUMNWIDTH32      0x0195
+#define LB_SETCOLUMNWIDTH        WINELIB_NAME(LB_SETCOLUMNWIDTH)
+#define LB_ADDFILE16             (WM_USER+23)
+#define LB_ADDFILE32             0x0196
+#define LB_ADDFILE               WINELIB_NAME(LB_ADDFILE)
+#define LB_SETTOPINDEX16         (WM_USER+24)
+#define LB_SETTOPINDEX32         0x0197
+#define LB_SETTOPINDEX           WINELIB_NAME(LB_SETTOPINDEX)
+#define LB_GETITEMRECT16         (WM_USER+25)
+#define LB_GETITEMRECT32         0x0198
+#define LB_GETITEMRECT           WINELIB_NAME(LB_GETITEMRECT)
+#define LB_GETITEMDATA16         (WM_USER+26)
+#define LB_GETITEMDATA32         0x0199
+#define LB_GETITEMDATA           WINELIB_NAME(LB_GETITEMDATA)
+#define LB_SETITEMDATA16         (WM_USER+27)
+#define LB_SETITEMDATA32         0x019a
+#define LB_SETITEMDATA           WINELIB_NAME(LB_SETITEMDATA)
+#define LB_SELITEMRANGE16        (WM_USER+28)
+#define LB_SELITEMRANGE32        0x019b
+#define LB_SELITEMRANGE          WINELIB_NAME(LB_SELITEMRANGE)
+#define LB_SETANCHORINDEX16      (WM_USER+29)
+#define LB_SETANCHORINDEX32      0x019c
+#define LB_SETANCHORINDEX        WINELIB_NAME(LB_SETANCHORINDEX)
+#define LB_GETANCHORINDEX16      (WM_USER+30)
+#define LB_GETANCHORINDEX32      0x019d
+#define LB_GETANCHORINDEX        WINELIB_NAME(LB_GETANCHORINDEX)
+#define LB_SETCARETINDEX16       (WM_USER+31)
+#define LB_SETCARETINDEX32       0x019e
+#define LB_SETCARETINDEX         WINELIB_NAME(LB_SETCARETINDEX)
+#define LB_GETCARETINDEX16       (WM_USER+32)
+#define LB_GETCARETINDEX32       0x019f
+#define LB_GETCARETINDEX         WINELIB_NAME(LB_GETCARETINDEX)
+#define LB_SETITEMHEIGHT16       (WM_USER+33)
+#define LB_SETITEMHEIGHT32       0x01a0
+#define LB_SETITEMHEIGHT         WINELIB_NAME(LB_SETITEMHEIGHT)
+#define LB_GETITEMHEIGHT16       (WM_USER+34)
+#define LB_GETITEMHEIGHT32       0x01a1
+#define LB_GETITEMHEIGHT         WINELIB_NAME(LB_GETITEMHEIGHT)
+#define LB_FINDSTRINGEXACT16     (WM_USER+35)
+#define LB_FINDSTRINGEXACT32     0x01a2
+#define LB_FINDSTRINGEXACT       WINELIB_NAME(LB_FINDSTRINGEXACT)
+
+#define LB_SETLOCALE32           0x01a5
+#define LB_GETLOCALE32           0x01a6
+#define LB_SETCOUNT32            0x01a7
+#define LB_INITSTORAGE32         0x01a8
+#define LB_ITEMFROMPOINT32       0x01a9
 
 /* Listbox notification codes */
 #define LBN_ERRSPACE        (-2)
@@ -3587,6 +3665,8 @@ DWORD      GetAppCompatFlags(HTASK32);
 LONG       GetBitmapBits(HBITMAP32,LONG,LPVOID);
 WORD       GetClassWord(HWND32,INT32);
 INT16      GetDlgCtrlID(HWND32);
+DWORD      GetLastError(void);
+COLORREF   GetSysColor(INT32);
 DWORD      GetTickCount(void);
 INT16      GetUpdateRgn(HWND32,HRGN32,BOOL32);
 WORD       GetWindowWord(HWND32,INT32);
@@ -3605,14 +3685,16 @@ UINT16     RealizePalette(HDC32);
 DWORD      RegCloseKey(HKEY);
 DWORD      RegFlushKey(HKEY);
 LONG       SetBitmapBits(HBITMAP32,LONG,LPCVOID);
+COLORREF   SetBkColor(HDC32,COLORREF);
 BOOL16     SetCaretBlinkTime(UINT32);
 BOOL16     SetCaretPos(INT32,INT32);
 WORD       SetClassWord(HWND32,INT32,WORD);
 INT16      SetDIBits(HDC32,HBITMAP32,UINT32,UINT32,LPCVOID,const BITMAPINFO*,UINT32);
 INT16      SetDIBitsToDevice(HDC32,INT32,INT32,DWORD,DWORD,INT32,INT32,UINT32,UINT32,LPCVOID,const BITMAPINFO*,UINT32);
-VOID       SetLastError(DWORD); /* FIXME: not 100% sure it's only in win32 */
+VOID       SetLastError(DWORD);
 VOID       SetLastErrorEx(DWORD,DWORD);
 VOID       SetRectRgn(HRGN32,INT32,INT32,INT32,INT32);
+COLORREF   SetTextColor(HDC32,COLORREF);
 WORD       SetWindowWord(HWND32,INT32,WORD);
 BOOL16     ShowCaret(HWND32);
 HWND16     WindowFromDC(HDC32);
@@ -3970,6 +4052,9 @@ INT16      GetObject16(HANDLE16,INT16,LPVOID);
 INT32      GetObject32A(HANDLE32,INT32,LPVOID);
 INT32      GetObject32W(HANDLE32,INT32,LPVOID);
 #define    GetObject WINELIB_NAME_AW(GetObject)
+HWND16     GetParent16(HWND16);
+HWND32     GetParent32(HWND32);
+#define    GetParent WINELIB_NAME(GetParent)
 FARPROC16  GetProcAddress16(HMODULE16,SEGPTR);
 FARPROC32  GetProcAddress32(HMODULE32,LPCSTR);
 #define    GetProcAddress WINELIB_NAME(GetProcAddress)
@@ -4741,7 +4826,6 @@ HWND       GetNextWindow(HWND,WORD);
 WORD       GetNumTasks(void);
 HWND       GetOpenClipboardWindow(void);
 WORD       GetPaletteEntries(HPALETTE16,WORD,WORD,LPPALETTEENTRY);
-HWND       GetParent(HWND);
 DWORD      GetPixel(HDC,short,short);
 WORD       GetPolyFillMode(HDC);
 int        GetPriorityClipboardFormat(WORD*,short);
@@ -4760,7 +4844,6 @@ DWORD      GetSelectorLimit(WORD);
 HANDLE     GetStockObject(int);
 WORD       GetStretchBltMode(HDC);
 HMENU      GetSubMenu(HMENU,short);
-COLORREF   GetSysColor(short);
 HMENU      GetSystemMenu(HWND,BOOL);
 int        GetSystemMetrics(WORD);
 WORD       GetSystemPaletteEntries(HDC,WORD,WORD,LPPALETTEENTRY);
@@ -4891,7 +4974,6 @@ HPALETTE16 SelectPalette(HDC,HPALETTE16,BOOL);
 int        SelectVisRgn(HDC,HRGN);
 WORD       SelectorAccessRights(WORD,WORD,WORD);
 HWND       SetActiveWindow(HWND);
-COLORREF   SetBkColor(HDC,COLORREF);
 WORD       SetBkMode(HDC,WORD);
 HWND       SetCapture(HWND);
 HANDLE     SetClipboardData(WORD,HANDLE);
@@ -4939,7 +5021,6 @@ BOOL       SetSystemTime(const SYSTEMTIME*);
 HQUEUE16   SetTaskQueue(HTASK16,HQUEUE16);
 WORD       SetTextAlign(HDC,WORD);
 short      SetTextCharacterExtra(HDC,short);
-DWORD      SetTextColor(HDC,DWORD);
 short      SetTextJustification(HDC,short,short);
 int        SetVoiceAccent(int,int,int,int,int);
 int        SetVoiceEnvelope(int,int,int);
index 36ca350dd9a3f8b2440e72ea967c82d2cacdde73..b78482d25a7ef1067846781a804db77c66514fd7 100644 (file)
@@ -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)
index a900e83e38b61677e5044fb02fcdfb6a54ab5330..720ba8991a9302bd679cc07dd5fbab3c28d8fe14 100644 (file)
@@ -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)
index 87fc649a90518b1a24c8640e873a56f9177c1a80..d4b4f13ac99802ddc230e9bf805f657d78ed0fc3 100644 (file)
@@ -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) );
 }
index 8dd57a2686aa597ebaeb34215fc4ad0ac8bce71f..8d492230c95b9173b326cb69ede6d51ea1916d1d 100644 (file)
@@ -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);
 }
 
index d35ec4883e5ef25eaa9fdb2722461faa811dbb9d..84432c07f570c85f1e0e817a7bc8bcc2aebc18dd 100644 (file)
@@ -56,12 +56,13 @@ static BOOL FileDlg_Init()
 /***********************************************************************
  *           GetOpenFileName   (COMMDLG.1)
  */
-BOOL GetOpenFileName(LPOPENFILENAME lpofn)
+BOOL GetOpenFileName( SEGPTR ofn )
 {
     HINSTANCE hInst;
     HANDLE hDlgTmpl, hResInfo;
     BOOL bRet;
-  
+    LPOPENFILENAME lpofn = (LPOPENFILENAME)PTR_SEG_TO_LIN(ofn);
+
     if (!lpofn || !FileDlg_Init()) return FALSE;
 
     if (lpofn->Flags & OFN_ENABLETEMPLATEHANDLE) hDlgTmpl = lpofn->hInstance;
@@ -85,7 +86,7 @@ BOOL GetOpenFileName(LPOPENFILENAME lpofn)
     hInst = WIN_GetWindowInstance( lpofn->hwndOwner );
     bRet = DialogBoxIndirectParam16( hInst, hDlgTmpl, lpofn->hwndOwner,
                         (DLGPROC16)MODULE_GetWndProcEntry16("FileOpenDlgProc"),
-                        (DWORD)lpofn );
+                        ofn );
 
     if (!(lpofn->Flags & OFN_ENABLETEMPLATEHANDLE))
     {
@@ -102,11 +103,12 @@ BOOL GetOpenFileName(LPOPENFILENAME lpofn)
 /***********************************************************************
  *           GetSaveFileName   (COMMDLG.2)
  */
-BOOL GetSaveFileName(LPOPENFILENAME lpofn)
+BOOL GetSaveFileName( SEGPTR ofn)
 {
     HINSTANCE hInst;
     HANDLE hDlgTmpl, hResInfo;
     BOOL bRet;
+    LPOPENFILENAME lpofn = (LPOPENFILENAME)PTR_SEG_TO_LIN(ofn);
   
     if (!lpofn || !FileDlg_Init()) return FALSE;
 
@@ -127,7 +129,7 @@ BOOL GetSaveFileName(LPOPENFILENAME lpofn)
     hInst = WIN_GetWindowInstance( lpofn->hwndOwner );
     bRet = DialogBoxIndirectParam16( hInst, hDlgTmpl, lpofn->hwndOwner,
                         (DLGPROC16)MODULE_GetWndProcEntry16("FileSaveDlgProc"),
-                        (DWORD)lpofn); 
+                        ofn );
     if (!(lpofn->Flags & OFN_ENABLETEMPLATEHANDLE))
     {
         if (lpofn->Flags & OFN_ENABLETEMPLATE) FreeResource16( hDlgTmpl );
@@ -227,7 +229,7 @@ static LONG FILEDLG_WMDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam,int saved
        hBrush = SelectObject(lpdis->hDC, GetStockObject(LTGRAY_BRUSH));
        SelectObject(lpdis->hDC, hBrush);
        FillRect16(lpdis->hDC, &lpdis->rcItem, hBrush);
-       SendMessage16(lpdis->hwndItem, LB_GETTEXT, lpdis->itemID, 
+       SendMessage16(lpdis->hwndItem, LB_GETTEXT16, lpdis->itemID, 
                       (LPARAM)SEGPTR_GET(str));
 
        if (savedlg)       /* use _gray_ text in FileSaveDlg */
@@ -252,7 +254,7 @@ static LONG FILEDLG_WMDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam,int saved
        hBrush = SelectObject(lpdis->hDC, GetStockObject(LTGRAY_BRUSH));
        SelectObject(lpdis->hDC, hBrush);
        FillRect16(lpdis->hDC, &lpdis->rcItem, hBrush);
-       SendMessage16(lpdis->hwndItem, LB_GETTEXT, lpdis->itemID, 
+       SendMessage16(lpdis->hwndItem, LB_GETTEXT16, lpdis->itemID, 
                       (LPARAM)SEGPTR_GET(str));
 
        hBitmap = hFolder;
@@ -338,7 +340,7 @@ static LONG FILEDLG_WMInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam)
   char tmpstr[512];
   LPSTR pstr;
   SetWindowLong32A(hWnd, DWL_USER, lParam);
-  lpofn = (LPOPENFILENAME)lParam;
+  lpofn = (LPOPENFILENAME)PTR_SEG_TO_LIN(lParam);
   if (lpofn->lpstrTitle) SetWindowText16( hWnd, lpofn->lpstrTitle );
   /* read custom filter information */
   if (lpofn->lpstrCustomFilter)
@@ -440,11 +442,11 @@ static LRESULT FILEDLG_WMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
       FILEDLG_StripEditControl(hWnd);
       if (notification == LBN_DBLCLK)
        goto almost_ok;
-      lRet = SendDlgItemMessage16(hWnd, lst1, LB_GETCURSEL, 0, 0);
+      lRet = SendDlgItemMessage16(hWnd, lst1, LB_GETCURSEL16, 0, 0);
       if (lRet == LB_ERR) return TRUE;
       if ((pstr = SEGPTR_ALLOC(512)))
       {
-          SendDlgItemMessage16(hWnd, lst1, LB_GETTEXT, lRet,
+          SendDlgItemMessage16(hWnd, lst1, LB_GETTEXT16, lRet,
                                (LPARAM)SEGPTR_GET(pstr));
           SetDlgItemText32A( hWnd, edt1, pstr );
           SEGPTR_FREE(pstr);
@@ -459,10 +461,10 @@ static LRESULT FILEDLG_WMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
       FILEDLG_StripEditControl(hWnd);
       if (notification == LBN_DBLCLK)
        {
-         lRet = SendDlgItemMessage16(hWnd, lst2, LB_GETCURSEL, 0, 0);
+         lRet = SendDlgItemMessage16(hWnd, lst2, LB_GETCURSEL16, 0, 0);
          if (lRet == LB_ERR) return TRUE;
           pstr = SEGPTR_ALLOC(512);
-         SendDlgItemMessage16(hWnd, lst2, LB_GETTEXT, lRet,
+         SendDlgItemMessage16(hWnd, lst2, LB_GETTEXT16, lRet,
                             (LPARAM)SEGPTR_GET(pstr));
           strcpy( tmpstr, pstr );
           SEGPTR_FREE(pstr);
@@ -582,8 +584,8 @@ static LRESULT FILEDLG_WMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
        lpofn->nFileExtension++;
       if (PTR_SEG_TO_LIN(lpofn->lpstrFileTitle) != NULL) 
        {
-         lRet = SendDlgItemMessage16(hWnd, lst1, LB_GETCURSEL, 0, 0);
-         SendDlgItemMessage16(hWnd, lst1, LB_GETTEXT, lRet,
+         lRet = SendDlgItemMessage16(hWnd, lst1, LB_GETCURSEL16, 0, 0);
+         SendDlgItemMessage16(hWnd, lst1, LB_GETTEXT16, lRet,
                                lpofn->lpstrFileTitle );
        }
       if (FILEDLG_HookCallChk(lpofn))
@@ -702,11 +704,12 @@ LRESULT FileSaveDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam)
 /***********************************************************************
  *           FindTextDlg   (COMMDLG.11)
  */
-BOOL FindText(LPFINDREPLACE lpFind)
+BOOL FindText( SEGPTR find )
 {
     HANDLE hInst, hDlgTmpl;
     BOOL bRet;
     LPCVOID ptr;
+    LPFINDREPLACE lpFind = (LPFINDREPLACE)PTR_SEG_TO_LIN(find);
 
     /*
      * FIXME : Should respond to FR_ENABLETEMPLATE and FR_ENABLEHOOK here
@@ -721,7 +724,7 @@ BOOL FindText(LPFINDREPLACE lpFind)
     if (!(ptr = GlobalLock16( hDlgTmpl ))) return -1;
     bRet = CreateDialogIndirectParam16( hInst, ptr, lpFind->hwndOwner,
                         (DLGPROC16)MODULE_GetWndProcEntry16("FindTextDlgProc"),
-                        (DWORD)lpFind );
+                        find );
     GlobalUnlock16( hDlgTmpl );
     SYSRES_FreeResource( hDlgTmpl );
     return bRet;
@@ -731,11 +734,12 @@ BOOL FindText(LPFINDREPLACE lpFind)
 /***********************************************************************
  *           ReplaceTextDlg   (COMMDLG.12)
  */
-BOOL ReplaceText(LPFINDREPLACE lpFind)
+BOOL ReplaceText( SEGPTR find )
 {
     HANDLE hInst, hDlgTmpl;
     BOOL bRet;
     LPCVOID ptr;
+    LPFINDREPLACE lpFind = (LPFINDREPLACE)PTR_SEG_TO_LIN(find);
 
     /*
      * FIXME : Should respond to FR_ENABLETEMPLATE and FR_ENABLEHOOK here
@@ -750,7 +754,7 @@ BOOL ReplaceText(LPFINDREPLACE lpFind)
     if (!(ptr = GlobalLock16( hDlgTmpl ))) return -1;
     bRet = CreateDialogIndirectParam16( hInst, ptr, lpFind->hwndOwner,
                      (DLGPROC16)MODULE_GetWndProcEntry16("ReplaceTextDlgProc"),
-                     (DWORD)lpFind );
+                     find );
     GlobalUnlock16( hDlgTmpl );
     SYSRES_FreeResource( hDlgTmpl );
     return bRet;
@@ -765,7 +769,7 @@ static LRESULT FINDDLG_WMInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam)
     LPFINDREPLACE lpfr;
 
     SetWindowLong32A(hWnd, DWL_USER, lParam);
-    lpfr = (LPFINDREPLACE)lParam;
+    lpfr = (LPFINDREPLACE)PTR_SEG_TO_LIN(lParam);
     lpfr->Flags &= ~(FR_FINDNEXT | FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM);
     /*
      * FIXME : If the initial FindWhat string is empty, we should disable the
@@ -868,7 +872,7 @@ static LRESULT REPLACEDLG_WMInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam)
     LPFINDREPLACE lpfr;
 
     SetWindowLong32A(hWnd, DWL_USER, lParam);
-    lpfr = (LPFINDREPLACE)lParam;
+    lpfr = (LPFINDREPLACE)PTR_SEG_TO_LIN(lParam);
     lpfr->Flags &= ~(FR_FINDNEXT | FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM);
     /*
      * FIXME : If the initial FindWhat string is empty, we should disable the FinNext /
@@ -983,10 +987,11 @@ LRESULT ReplaceTextDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam)
 /***********************************************************************
  *           PrintDlg   (COMMDLG.20)
  */
-BOOL PrintDlg(LPPRINTDLG lpPrint)
+BOOL PrintDlg( SEGPTR printdlg )
 {
     HANDLE hInst, hDlgTmpl;
     BOOL bRet;
+    LPPRINTDLG lpPrint = (LPPRINTDLG)PTR_SEG_TO_LIN(printdlg);
 
     dprintf_commdlg(stddeb,"PrintDlg(%p) // Flags=%08lX\n", lpPrint, lpPrint->Flags );
 
@@ -1004,7 +1009,7 @@ BOOL PrintDlg(LPPRINTDLG lpPrint)
                                (DLGPROC16)((lpPrint->Flags & PD_PRINTSETUP) ?
                                 MODULE_GetWndProcEntry16("PrintSetupDlgProc") :
                                 MODULE_GetWndProcEntry16("PrintDlgProc")),
-                               (DWORD)lpPrint );
+                                printdlg );
     SYSRES_FreeResource( hDlgTmpl );
     return bRet;
 }
@@ -1139,7 +1144,7 @@ BOOL ChooseColor(LPCHOOSECOLOR lpChCol)
     hInst = WIN_GetWindowInstance( lpChCol->hwndOwner );
     bRet = DialogBoxIndirectParam16( hInst, hDlgTmpl, lpChCol->hwndOwner,
                            (DLGPROC16)MODULE_GetWndProcEntry16("ColorDlgProc"),
-                           (DWORD)lpChCol );
+                           (DWORD)lpChCol);
     if (!(lpChCol->Flags & CC_ENABLETEMPLATEHANDLE))
     {
         if (lpChCol->Flags & CC_ENABLETEMPLATE) FreeResource16( hDlgTmpl );
@@ -2220,7 +2225,7 @@ BOOL ChooseFont(LPCHOOSEFONT lpChFont)
     hInst = WIN_GetWindowInstance( lpChFont->hwndOwner );
     bRet = DialogBoxIndirectParam16( hInst, hDlgTmpl, lpChFont->hwndOwner,
                       (DLGPROC16)MODULE_GetWndProcEntry16("FormatCharDlgProc"),
-                      (DWORD)lpChFont );
+                      (DWORD)lpChFont);
     if (!(lpChFont->Flags & CF_ENABLETEMPLATEHANDLE))
     {
         if (lpChFont->Flags & CF_ENABLETEMPLATE) FreeResource16( hDlgTmpl );
@@ -2263,7 +2268,7 @@ INT16 FontFamilyEnumProc( SEGPTR logfont, SEGPTR metrics,
   int i;
   WORD w;
   HWND hwnd=LOWORD(lParam);
-  HWND hDlg=GetParent(hwnd);
+  HWND hDlg=GetParent16(hwnd);
   LPCHOOSEFONT lpcf=(LPCHOOSEFONT)GetWindowLong32A(hDlg, DWL_USER); 
   LOGFONT16 *lplf = (LOGFONT16 *)PTR_SEG_TO_LIN( logfont );
 
@@ -2380,7 +2385,7 @@ INT16 FontStyleEnumProc( SEGPTR logfont, SEGPTR metrics,
 {
   HWND hcmb2=LOWORD(lParam);
   HWND hcmb3=HIWORD(lParam);
-  HWND hDlg=GetParent(hcmb3);
+  HWND hDlg=GetParent16(hcmb3);
   LPCHOOSEFONT lpcf=(LPCHOOSEFONT)GetWindowLong32A(hDlg, DWL_USER); 
   LOGFONT16 *lplf = (LOGFONT16 *)PTR_SEG_TO_LIN(logfont);
   TEXTMETRIC16 *lptm = (TEXTMETRIC16 *)PTR_SEG_TO_LIN(metrics);
index c87b28db60be7e2f9d9f19be84fd324556f2ca18..1b049154f67d5925f78d37131c3184f3ca8f19c3 100644 (file)
@@ -4,6 +4,7 @@
  * Implements C run-time functionality as known from UNIX.
  *
  * Copyright 1996 Marcus Meissner
+ * Copyright 1996 Jukka Iivonen
  */
 
 #include <stdio.h>
@@ -12,6 +13,7 @@
 #include <unistd.h>
 #include <time.h>
 #include <ctype.h>
+#include <math.h>
 #include "win.h"
 #include "windows.h"
 #include "stddebug.h"
@@ -35,6 +37,10 @@ UINT32 CRTDLL_winmajor_dll;     /* CRTDLL.329 */
 UINT32 CRTDLL_winminor_dll;     /* CRTDLL.330 */
 UINT32 CRTDLL_winver_dll;       /* CRTDLL.331 */
 
+
+/*********************************************************************
+ *                  _GetMainArgs  (CRTDLL.022)
+ */
 DWORD
 CRTDLL__GetMainArgs(LPDWORD argc,LPSTR **argv,LPSTR *environ,DWORD flag)
 {
@@ -60,7 +66,6 @@ CRTDLL__GetMainArgs(LPDWORD argc,LPSTR **argv,LPSTR *environ,DWORD flag)
        CRTDLL_osminor_dll     = version & 0xFF;
        CRTDLL_osmajor_dll     = (version>>8) & 0xFF;
 
-       /* missing heapinit */
        /* missing threading init */
 
        i=0;xargv=NULL;xargc=0;afterlastspace=0;
@@ -93,8 +98,11 @@ CRTDLL__GetMainArgs(LPDWORD argc,LPSTR **argv,LPSTR *environ,DWORD flag)
 }
 
 typedef void (*_INITTERMFUN)();
-DWORD
-CRTDLL__initterm(_INITTERMFUN *start,_INITTERMFUN *end)
+
+/*********************************************************************
+ *                  _initterm     (CRTDLL.135)
+ */
+DWORD CRTDLL__initterm(_INITTERMFUN *start,_INITTERMFUN *end)
 {
        _INITTERMFUN    *current;
 
@@ -108,25 +116,37 @@ CRTDLL__initterm(_INITTERMFUN *start,_INITTERMFUN *end)
        return 0;
 }
 
-void
-CRTDLL_srand(DWORD seed) {
+/*********************************************************************
+ *                  srand         (CRTDLL.460)
+ */
+void CRTDLL_srand(DWORD seed)
+{
        /* FIXME: should of course be thread? process? local */
        srand(seed);
 }
 
-int
-CRTDLL_fprintf(DWORD *args) {
+/*********************************************************************
+ *                  fprintf       (CRTDLL.373)
+ */
+int CRTDLL_fprintf(DWORD *args)
+{
        /* FIXME: use args[0] */
        return vfprintf(stderr,(LPSTR)(args[1]),args+2);
 }
 
-int
-CRTDLL_printf(DWORD *args) {
+/*********************************************************************
+ *                  printf        (CRTDLL.440)
+ */
+int CRTDLL_printf(DWORD *args)
+{
        return vfprintf(stdout,(LPSTR)(args[0]),args+1);
 }
 
-time_t
-CRTDLL_time(time_t *timeptr) {
+/*********************************************************************
+ *                  time          (CRTDLL.488)
+ */
+time_t CRTDLL_time(time_t *timeptr)
+{
        time_t  curtime = time(NULL);
 
        if (timeptr)
@@ -134,14 +154,20 @@ CRTDLL_time(time_t *timeptr) {
        return curtime;
 }
 
-BOOL32
-CRTDLL__isatty(DWORD x) {
+/*********************************************************************
+ *                  _isatty       (CRTDLL.137)
+ */
+BOOL32 CRTDLL__isatty(DWORD x)
+{
        dprintf_crtdll(stderr,"CRTDLL__isatty(%ld)\n",x);
        return TRUE;
 }
 
-INT32
-CRTDLL__write(DWORD x,LPVOID buf,DWORD len) {
+/*********************************************************************
+ *                  _write        (CRTDLL.332)
+ */
+INT32 CRTDLL__write(DWORD x,LPVOID buf,DWORD len)
+{
        if (x<=2)
                return write(x,buf,len);
        /* hmm ... */
@@ -149,23 +175,143 @@ CRTDLL__write(DWORD x,LPVOID buf,DWORD len) {
        return len;
 }
 
-void
-CRTDLL_exit(DWORD ret) {
-       dprintf_crtdll(stderr,"CRTDLL_exit(%ld)\n",ret);
+
+/*********************************************************************
+ *                  exit          (CRTDLL.359)
+ */
+void CRTDLL_exit(DWORD ret)
+{
+        dprintf_crtdll(stderr,"CRTDLL_exit(%ld)\n",ret);
        ExitProcess(ret);
 }
 
-void
-CRTDLL_fflush(DWORD x) {
-       dprintf_crtdll(stderr,"CRTDLL_fflush(%ld)\n",x);
+
+/*********************************************************************
+ *                  fflush        (CRTDLL.365)
+ */
+void CRTDLL_fflush(DWORD x)
+{
+    dprintf_crtdll(stderr,"CRTDLL_fflush(%ld)\n",x);
+}
+
+
+/*********************************************************************
+ *                  gets          (CRTDLL.391)
+ */
+LPSTR CRTDLL_gets(LPSTR buf)
+{
+  /* BAD, for the whole WINE process blocks... just done this way to test
+   * windows95's ftp.exe.
+   */
+    return gets(buf);
+}
+
+
+/*********************************************************************
+ *                  abs           (CRTDLL.339)
+ */
+INT32 CRTDLL_abs(INT32 x)
+{
+    return abs(x);
+}
+
+
+/*********************************************************************
+ *                  acos          (CRTDLL.340)
+ */
+float CRTDLL_acos(float x)
+{
+    return acos(x);
+}
+
+
+/*********************************************************************
+ *                  asin          (CRTDLL.342)
+ */
+float CRTDLL_asin(float x)
+{
+    return asin(x);
+}
+
+
+/*********************************************************************
+ *                  atan          (CRTDLL.343)
+ */
+float CRTDLL_atan(float x)
+{
+    return atan(x);
+}
+
+
+/*********************************************************************
+ *                  atan2         (CRTDLL.344)
+ */
+float CRTDLL_atan2(float x, float y)
+{
+    return atan2(x,y);
+}
+
+
+/*********************************************************************
+ *                  atof          (CRTDLL.346)
+ */
+float CRTDLL_atof(LPCSTR x)
+{
+    return atof(x);
+}
+
+
+/*********************************************************************
+ *                  atoi          (CRTDLL.347)
+ */
+INT32 CRTDLL_atoi(LPCSTR x)
+{
+    return atoi(x);
+}
+
+
+/*********************************************************************
+ *                  atol          (CRTDLL.348)
+ */
+LONG CRTDLL_atol(LPCSTR x)
+{
+    return atol(x);
+}
+
+
+/*********************************************************************
+ *                  cos           (CRTDLL.354)
+ */
+float CRTDLL_cos(float x)
+{
+    return cos(x);
+}
+
+
+/*********************************************************************
+ *                  cosh          (CRTDLL.355)
+ */
+float CRTDLL_cosh(float x)
+{
+    return cosh(x);
+}
+
+
+/*********************************************************************
+ *                  exp           (CRTDLL.360)
+ */
+float CRTDLL_exp(float x)
+{
+    return exp(x);
 }
 
-/* BAD, for the whole WINE process blocks... just done this way to test
- * windows95's ftp.exe.
+
+/*********************************************************************
+ *                  fabs          (CRTDLL.361)
  */
-LPSTR 
-CRTDLL_gets(LPSTR buf) {
-       return gets(buf);
+float CRTDLL_fabs(float x)
+{
+    return fabs(x);
 }
 
 
@@ -259,6 +405,105 @@ CHAR CRTDLL_isupper(CHAR x)
 }
 
 
+/*********************************************************************
+ *                  isxdigit      (CRTDLL.418)
+ */
+CHAR CRTDLL_isxdigit(CHAR x)
+{
+    return isxdigit(x);
+}
+
+
+/*********************************************************************
+ *                  labs          (CRTDLL.419)
+ */
+LONG CRTDLL_labs(LONG x)
+{
+    return labs(x);
+}
+
+
+/*********************************************************************
+ *                  log           (CRTDLL.424)
+ */
+float CRTDLL_log(float x)
+{
+    return log(x);
+}
+
+
+/*********************************************************************
+ *                  log10         (CRTDLL.425)
+ */
+float CRTDLL_log10(float x)
+{
+    return log10(x);
+}
+
+
+/*********************************************************************
+ *                  pow           (CRTDLL.439)
+ */
+float CRTDLL_pow(float x, float y)
+{
+    return pow(x,y);
+}
+
+
+/*********************************************************************
+ *                  rand          (CRTDLL.446)
+ */
+INT32 CRTDLL_rand()
+{
+    return rand();
+}
+
+
+/*********************************************************************
+ *                  sin           (CRTDLL.456)
+ */
+float CRTDLL_sin(float x)
+{
+    return sin(x);
+}
+
+
+/*********************************************************************
+ *                  sinh          (CRTDLL.457)
+ */
+float CRTDLL_sinh(float x)
+{
+    return sinh(x);
+}
+
+
+/*********************************************************************
+ *                  sqrt          (CRTDLL.459)
+ */
+float CRTDLL_sqrt(float x)
+{
+    return sqrt(x);
+}
+
+
+/*********************************************************************
+ *                  tan           (CRTDLL.486)
+ */
+float CRTDLL_tan(float x)
+{
+    return tan(x);
+}
+
+
+/*********************************************************************
+ *                  tanh          (CRTDLL.487)
+ */
+float CRTDLL_tanh(float x)
+{
+    return tanh(x);
+}
+
+
 /*********************************************************************
  *                  tolower       (CRTDLL.491)
  */
@@ -271,53 +516,102 @@ CHAR CRTDLL_tolower(CHAR x)
 /*********************************************************************
  *                  toupper       (CRTDLL.492)
  */
-CHAR CRTDLL_toupper(CHAR x) {
-       return toupper(x);
+CHAR CRTDLL_toupper(CHAR x)
+{
+    return toupper(x);
 }
 
 
-void
-CRTDLL_putchar(INT32 x) {
-       putchar(x);
+/*********************************************************************
+ *                  putchar       (CRTDLL.442)
+ */
+void CRTDLL_putchar(INT32 x)
+{
+    putchar(x);
 }
 
-int
-CRTDLL__mbsicmp(unsigned char *x,unsigned char *y)
+
+/*********************************************************************
+ *                  _mbsicmp      (CRTDLL.204)
+ */
+int CRTDLL__mbsicmp(unsigned char *x,unsigned char *y)
 {
-       do {
-               if (!*x)
-                       return !!*y;
-               if (!*y)
-                       return !!*x;
-               /* FIXME: MBCS handling... */
-               if (*x!=*y)
-                       return 1;
-                x++;
-                y++;
-       } while (1);
+    do {
+       if (!*x)
+           return !!*y;
+       if (!*y)
+           return !!*x;
+       /* FIXME: MBCS handling... */
+       if (*x!=*y)
+           return 1;
+        x++;
+        y++;
+    } while (1);
 }
 
-unsigned char*
-CRTDLL__mbsinc(unsigned char *x)
+
+/*********************************************************************
+ *                  _mbsinc       (CRTDLL.205)
+ */
+unsigned char* CRTDLL__mbsinc(unsigned char *x)
 {
     /* FIXME: mbcs */
     return x++;
 }
 
-int
-CRTDLL_vsprintf(DWORD *args)
+
+/*********************************************************************
+ *                  vsprintf      (CRTDLL.500)
+ */
+int CRTDLL_vsprintf(DWORD *args)
 {
     return vsprintf((char *)args[0],(char *)args[1],args+2);
 }
 
-unsigned char*
-CRTDLL__mbscpy(unsigned char *x,unsigned char *y)
+
+/*********************************************************************
+ *                  _mbscpy       (CRTDLL.200)
+ */
+unsigned char* CRTDLL__mbscpy(unsigned char *x,unsigned char *y)
 {
     return strcpy(x,y);
 }
 
-unsigned char*
-CRTDLL__mbscat(unsigned char *x,unsigned char *y)
+
+/*********************************************************************
+ *                  _mbscat       (CRTDLL.197)
+ */
+unsigned char* CRTDLL__mbscat(unsigned char *x,unsigned char *y)
 {
     return strcat(x,y);
 }
+
+/*********************************************************************
+ *                  _strupr       (CRTDLL.300)
+ */
+CHAR* CRTDLL__strupr(CHAR *x)
+{
+       CHAR    *y=x;
+
+       while (*y) {
+               *y=toupper(*y);
+               y++;
+       }
+       return x;
+}
+
+/*********************************************************************
+ *                  malloc        (CRTDLL.427)
+ */
+VOID* CRTDLL_malloc(DWORD size)
+{
+    return HeapAlloc(GetProcessHeap(),0,size);
+}
+
+/*********************************************************************
+ *                  free          (CRTDLL.427)
+ */
+VOID CRTDLL_free(LPVOID ptr)
+{
+    HeapFree(GetProcessHeap(),0,ptr);
+}
index 297ca18d815117770f3d171ac327285da60e35b4..5690ec94ec789ef269d7016656abe073a7a89260 100644 (file)
@@ -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 */
     }
 }
 
index 1a58dd4c48c09fcf0a27bc01d627296c5cf51c61..5b13fd7d69682ce82177504ffd3644802bdd3448 100644 (file)
@@ -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];
 
index d90ff8200320f2e4424e5f23fb83ac8bf654fa25..15bc7312fd99d726194043d2b24f917cc6fff740 100644 (file)
@@ -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;
+}
index 196356f00f0df16ac99eb23d23751ab9330df6b9..4b4cbef36596cd868a139a74d84051bcc648ec9e 100644 (file)
 
 #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) {
index abfd6b0e2d2c34cc3ea458ab1aeddc0554018c19..ac22ac135c47c5971270b25e67cb4abb162b3164 100644 (file)
@@ -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;
index ed7a7f41fbf21c6ff5ba0998e3d33f3a9bcbc821..f654573462bbbdd321c664b7330144268d1d4ac0 100644 (file)
 #ifdef linux
 #include <linux/soundcard.h>
 #include <linux/cdrom.h>
+#elif __FreeBSD__
+#include <machine/soundcard.h>
+#include <sys/cdio.h>
 #endif
 
 #define SOUND_DEV "/dev/dsp"
+#ifdef __FreeBSD__
+#define CDAUDIO_DEV "/dev/rcd0c"
+#else
 #define CDAUDIO_DEV "/dev/cdrom"
+#endif
 
 #ifdef SOUND_VERSION
 #define IOCTL(a,b,c)           ioctl(a,b,&c)
@@ -44,7 +51,7 @@
 #define CDFRAMES_PERMIN        4500
 #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 */
@@ -53,7 +60,11 @@ typedef struct {
        MCI_OPEN_PARMS openParms;
        DWORD   dwTimeFormat;
        int             unixdev;
+#ifdef linux
        struct cdrom_subchnl    sc;
+#elif __FreeBSD__
+       struct cd_sub_channel_info      sc;
+#endif
        int             mode;
        UINT    nCurTrack;
        DWORD   dwCurFrame;
@@ -76,16 +87,30 @@ static LINUX_CDAUDIO        CDADev[MAX_CDAUDIODRV];
 */
 static UINT CDAUDIO_GetNumberOfTracks(UINT wDevID)
 {
+#if defined(linux) || defined(__FreeBSD__)
 #ifdef linux
        struct cdrom_tochdr     hdr;
+#elif __FreeBSD__
+       struct ioc_toc_header   hdr;
+#endif
        if (CDADev[wDevID].nTracks == 0) {
-               if (ioctl(CDADev[wDevID].unixdev, CDROMREADTOCHDR, &hdr)) {
+               if (ioctl(CDADev[wDevID].unixdev,
+#ifdef linux
+                         CDROMREADTOCHDR
+#elif __FreeBSD__
+                         CDIOREADTOCHEADER
+#endif
+                         , &hdr)) {
                        dprintf_cdaudio(stddeb,
                                "GetNumberOfTracks(%u) // Error occured !\n", 
                                wDevID);
                        return (WORD)-1;
                        }
+#ifdef linux
                CDADev[wDevID].nTracks = hdr.cdth_trk1;
+#elif __FreeBSD__
+               CDADev[wDevID].nTracks = hdr.ending_track - hdr.starting_track + 1;
+#endif
                }
        return CDADev[wDevID].nTracks;
 #else
@@ -99,11 +124,16 @@ static UINT CDAUDIO_GetNumberOfTracks(UINT wDevID)
 */
 static BOOL CDAUDIO_GetTracksInfo(UINT wDevID)
 {
-#ifdef linux
+#if defined(linux) || defined(__FreeBSD__)
        int             i, length;
        int             start, last_start = 0;
        int             total_length = 0;
+#ifdef linux
        struct cdrom_tocentry   entry;
+#elif __FreeBSD__
+       struct ioc_read_toc_entry       entry;
+       struct cd_toc_entry             toc_buffer;
+#endif
        if (CDADev[wDevID].nTracks == 0) {
                if (CDAUDIO_GetNumberOfTracks(wDevID) == (WORD)-1) return FALSE;
                }
@@ -129,18 +159,46 @@ static BOOL CDAUDIO_GetTracksInfo(UINT wDevID)
                (CDADev[wDevID].nTracks + 1) * sizeof(DWORD));
        for (i = 0; i <= CDADev[wDevID].nTracks; i++) {
                if (i == CDADev[wDevID].nTracks)
+#ifdef linux
                        entry.cdte_track = CDROM_LEADOUT;
+#elif __FreeBSD__
+#define LEADOUT 0xaa
+                       entry.starting_track = LEADOUT; /* XXX */
+#endif
                else
+#ifdef linux
                        entry.cdte_track = i + 1;
+#elif __FreeBSD__
+                       entry.starting_track = i + 1;
+#endif
+#ifdef linux
                entry.cdte_format = CDROM_MSF;
-               if (ioctl(CDADev[wDevID].unixdev, CDROMREADTOCENTRY, &entry)) {
+#elif __FreeBSD__
+               bzero((char *)&toc_buffer, sizeof(toc_buffer));
+               entry.address_format = CD_MSF_FORMAT;
+               entry.data_len = sizeof(toc_buffer);
+               entry.data = &toc_buffer;
+#endif
+               if (ioctl(CDADev[wDevID].unixdev, 
+#ifdef linux
+                         CDROMREADTOCENTRY
+#elif __FreeBSD__
+                         CDIOREADTOCENTRYS
+#endif
+                         , &entry)) {
                        dprintf_cdaudio(stddeb,
                                "CDAUDIO_GetTracksInfo // error read entry\n");
                        return FALSE;
                        }
+#ifdef linux
                start = CDFRAMES_PERSEC * (SECONDS_PERMIN * 
                        entry.cdte_addr.msf.minute + entry.cdte_addr.msf.second) + 
                        entry.cdte_addr.msf.frame;
+#elif __FreeBSD__
+               start = CDFRAMES_PERSEC * (SECONDS_PERMIN *
+                       toc_buffer.addr.msf.minute + toc_buffer.addr.msf.second) +
+                       toc_buffer.addr.msf.frame;
+#endif
                if (i == 0) {
                        last_start = start;
                        CDADev[wDevID].dwFirstOffset = start;
@@ -176,7 +234,7 @@ static BOOL CDAUDIO_GetTracksInfo(UINT wDevID)
 */
 static DWORD CDAUDIO_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS lpParms)
 {
-#ifdef linux
+#if defined(linux) || defined(__FreeBSD__)
        dprintf_cdaudio(stddeb,"CDAUDIO_mciOpen(%04X, %08lX, %p);\n", 
                                        wDevID, dwFlags, lpParms);
        if (lpParms == NULL) return MCIERR_INTERNAL;
@@ -235,7 +293,7 @@ static DWORD CDAUDIO_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS lpParm
 */
 static DWORD CDAUDIO_mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
 {
-#ifdef linux
+#if defined(linux) || defined(__FreeBSD__)
        dprintf_cdaudio(stddeb,"CDAUDIO_mciClose(%u, %08lX, %p);\n", 
                wDevID, dwParam, lpParms);
        if (CDADev[wDevID].lpdwTrackLen != NULL) free(CDADev[wDevID].lpdwTrackLen);
@@ -251,7 +309,7 @@ static DWORD CDAUDIO_mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lp
 static DWORD CDAUDIO_mciGetDevCaps(UINT wDevID, DWORD dwFlags, 
                                                LPMCI_GETDEVCAPS_PARMS lpParms)
 {
-#ifdef linux
+#if defined(linux) || defined(__FreeBSD__)
        dprintf_cdaudio(stddeb,"CDAUDIO_mciGetDevCaps(%u, %08lX, %p);\n", 
                wDevID, dwFlags, lpParms);
        if (lpParms == NULL) return MCIERR_INTERNAL;
@@ -305,7 +363,7 @@ static DWORD CDAUDIO_mciGetDevCaps(UINT wDevID, DWORD dwFlags,
 */
 static DWORD CDAUDIO_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms)
 {
-#ifdef linux
+#if defined(linux) || defined(__FreeBSD__)
        dprintf_cdaudio(stddeb,"CDAUDIO_mciInfo(%u, %08lX, %p);\n", 
                wDevID, dwFlags, lpParms);
        if (lpParms == NULL) return MCIERR_INTERNAL;
@@ -334,7 +392,7 @@ static DWORD CDAUDIO_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParm
 static DWORD CDAUDIO_CalcFrame(UINT wDevID, DWORD dwFormatType, DWORD dwTime)
 {
        DWORD   dwFrame = 0;
-#ifdef linux
+#if defined(linux) || defined(__FreeBSD__)
        UINT    wTrack;
     
        dprintf_cdaudio(stddeb,"CDAUDIO_CalcFrame(%u, %08lX, %lu);\n", 
@@ -384,45 +442,108 @@ static DWORD CDAUDIO_CalcFrame(UINT wDevID, DWORD dwFormatType, DWORD dwTime)
 */
 static BOOL CDAUDIO_GetCDStatus(UINT wDevID)
 {
-#ifdef linux
+#if defined(linux) || defined(__FreeBSD__)
        int             oldmode = CDADev[wDevID].mode;
+#ifdef __FreeBSD__
+       struct ioc_read_subchannel      read_sc;
+
+       read_sc.address_format = CD_MSF_FORMAT;
+       read_sc.data_format    = CD_CURRENT_POSITION;
+       read_sc.track          = 0;
+       read_sc.data_len       = sizeof(CDADev[wDevID].sc);
+       read_sc.data           = (struct cd_sub_channel_info *)&CDADev[wDevID].sc;
+#elif linux
        CDADev[wDevID].sc.cdsc_format = CDROM_MSF;
-       if (ioctl(CDADev[wDevID].unixdev, CDROMSUBCHNL, &CDADev[wDevID].sc)) {
+#endif
+       if (ioctl(CDADev[wDevID].unixdev,
+#ifdef linux
+                 CDROMSUBCHNL, &CDADev[wDevID].sc
+#elif __FreeBSD__
+                 CDIOCREADSUBCHANNEL, &read_sc
+#endif
+                 )) {
                dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // opened or no_media !\n");
                CDADev[wDevID].mode = MCI_MODE_NOT_READY;
                return TRUE;
                }
-       switch (CDADev[wDevID].sc.cdsc_audiostatus) {
+       switch (
+#ifdef linux
+               CDADev[wDevID].sc.cdsc_audiostatus
+#elif __FreeBSD__
+               CDADev[wDevID].sc.header.audio_status
+#endif
+               ) {
+#ifdef linux
                case CDROM_AUDIO_INVALID:
+#elif __FreeBSD__
+               case CD_AS_AUDIO_INVALID:
+#endif
                        dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // device doesn't support status, returning NOT_READY.\n");
+#ifdef linux
                        CDADev[wDevID].mode = MCI_MODE_NOT_READY;
+#elif __FreeBSD__
+                       CDADev[wDevID].mode = MCI_MODE_STOP;
+#endif
                        break;
+#ifdef linux
                case CDROM_AUDIO_NO_STATUS: 
+#elif __FreeBSD__
+               case CD_AS_NO_STATUS:
+#endif
                        CDADev[wDevID].mode = MCI_MODE_STOP;
                        dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // MCI_MODE_STOP !\n");
                        break;
+#ifdef linux
                case CDROM_AUDIO_PLAY: 
+#elif __FreeBSD__
+               case CD_AS_PLAY_IN_PROGRESS:
+#endif
                        CDADev[wDevID].mode = MCI_MODE_PLAY;
                        dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // MCI_MODE_PLAY !\n");
                        break;
+#ifdef linux
                case CDROM_AUDIO_PAUSED:
+#elif __FreeBSD__
+               case CD_AS_PLAY_PAUSED:
+#endif
                        CDADev[wDevID].mode = MCI_MODE_PAUSE;
                        dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // MCI_MODE_PAUSE !\n");
                        break;
                default:
                        dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // status=%02X !\n",
-                                       CDADev[wDevID].sc.cdsc_audiostatus);
+#ifdef linux
+                                       CDADev[wDevID].sc.cdsc_audiostatus
+#elif __FreeBSD__
+                                       CDADev[wDevID].sc.header.audio_status
+#endif
+                                       );
                }
+#ifdef linux
        CDADev[wDevID].nCurTrack = CDADev[wDevID].sc.cdsc_trk;
        CDADev[wDevID].dwCurFrame = 
                CDFRAMES_PERMIN * CDADev[wDevID].sc.cdsc_absaddr.msf.minute +
                CDFRAMES_PERSEC * CDADev[wDevID].sc.cdsc_absaddr.msf.second +
                CDADev[wDevID].sc.cdsc_absaddr.msf.frame;
+#elif __FreeBSD__
+       CDADev[wDevID].nCurTrack = CDADev[wDevID].sc.what.position.track_number;
+       CDADev[wDevID].dwCurFrame = 
+               CDFRAMES_PERMIN * CDADev[wDevID].sc.what.position.absaddr.msf.minute +
+               CDFRAMES_PERSEC * CDADev[wDevID].sc.what.position.absaddr.msf.second +
+               CDADev[wDevID].sc.what.position.absaddr.msf.frame;
+#endif
        dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // %02u-%02u:%02u:%02u \n",
+#ifdef linux
                CDADev[wDevID].sc.cdsc_trk,
                CDADev[wDevID].sc.cdsc_absaddr.msf.minute,
                CDADev[wDevID].sc.cdsc_absaddr.msf.second,
-               CDADev[wDevID].sc.cdsc_absaddr.msf.frame);
+               CDADev[wDevID].sc.cdsc_absaddr.msf.frame
+#elif __FreeBSD__
+               CDADev[wDevID].sc.what.position.track_number,
+               CDADev[wDevID].sc.what.position.absaddr.msf.minute,
+               CDADev[wDevID].sc.what.position.absaddr.msf.second,
+               CDADev[wDevID].sc.what.position.absaddr.msf.frame
+#endif
+                       );
        if (oldmode != CDADev[wDevID].mode && oldmode == MCI_MODE_OPEN) {
                if (!CDAUDIO_GetTracksInfo(wDevID)) {
             dprintf_cdaudio(stddeb,"CDAUDIO_GetCDStatus // error updating TracksInfo !\n");
@@ -442,7 +563,7 @@ static BOOL CDAUDIO_GetCDStatus(UINT wDevID)
 static DWORD CDAUDIO_CalcTime(UINT wDevID, DWORD dwFormatType, DWORD dwFrame)
 {
        DWORD   dwTime = 0;
-#ifdef linux
+#if defined(linux) || defined(__FreeBSD__)
        UINT    wTrack;
        UINT    wMinutes;
        UINT    wSeconds;
@@ -496,7 +617,7 @@ static DWORD CDAUDIO_CalcTime(UINT wDevID, DWORD dwFormatType, DWORD dwFrame)
 */
 static DWORD CDAUDIO_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
 {
-#ifdef linux
+#if defined(linux) || defined(__FreeBSD__)
        dprintf_cdaudio(stddeb,"CDAUDIO_mciStatus(%u, %08lX, %p);\n", 
                wDevID, dwFlags, lpParms);
        if (lpParms == NULL) return MCIERR_INTERNAL;
@@ -598,9 +719,13 @@ static DWORD CDAUDIO_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lp
 */
 static DWORD CDAUDIO_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
 {
-#ifdef linux
+#if defined(linux) || defined(__FreeBSD__)
        int     start, end;
+#ifdef linux
        struct  cdrom_msf       msf;
+#elif __FreeBSD__
+       struct  ioc_play_msf    msf;
+#endif
        dprintf_cdaudio(stddeb,"CDAUDIO_mciPlay(%u, %08lX, %p);\n", 
                wDevID, dwFlags, lpParms);
        if (lpParms == NULL) return MCIERR_INTERNAL;
@@ -622,23 +747,50 @@ static DWORD CDAUDIO_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParm
                }
        start += CDADev[wDevID].dwFirstOffset;  
        end += CDADev[wDevID].dwFirstOffset;
+#ifdef linux
        msf.cdmsf_min0 = start / CDFRAMES_PERMIN;
        msf.cdmsf_sec0 = (start % CDFRAMES_PERMIN) / CDFRAMES_PERSEC;
        msf.cdmsf_frame0 = start % CDFRAMES_PERSEC;
        msf.cdmsf_min1 = end / CDFRAMES_PERMIN;
        msf.cdmsf_sec1 = (end % CDFRAMES_PERMIN) / CDFRAMES_PERSEC;
        msf.cdmsf_frame1 = end % CDFRAMES_PERSEC;
-       if (ioctl(CDADev[wDevID].unixdev, CDROMSTART)) {
+#elif __FreeBSD__
+        msf.start_m     = start / CDFRAMES_PERMIN;
+        msf.start_s     = (start % CDFRAMES_PERMIN) / CDFRAMES_PERSEC;
+        msf.start_f     = start % CDFRAMES_PERSEC;
+        msf.end_m       = end / CDFRAMES_PERMIN;
+        msf.end_s       = (end % CDFRAMES_PERMIN) / CDFRAMES_PERSEC;
+        msf.end_f       = end % CDFRAMES_PERSEC;
+#endif
+       if (ioctl(CDADev[wDevID].unixdev,
+#ifdef linux
+                 CDROMSTART
+#elif __FreeBSD__
+                 CDIOCSTART
+#endif
+                 )) {
                dprintf_cdaudio(stddeb,"CDAUDIO_mciPlay // motor doesn't start !\n");
                return MCIERR_HARDWARE;
                }
-       if (ioctl(CDADev[wDevID].unixdev, CDROMPLAYMSF, &msf)) {
+       if (ioctl(CDADev[wDevID].unixdev, 
+#ifdef linux
+                 CDROMPLAYMSF
+#elif __FreeBSD__
+                 CDIOCPLAYMSF
+#endif
+                 , &msf)) {
                dprintf_cdaudio(stddeb,"CDAUDIO_mciPlay // device doesn't play !\n");
                return MCIERR_HARDWARE;
                }
        dprintf_cdaudio(stddeb,"CDAUDIO_mciPlay // msf = %d:%d:%d %d:%d:%d\n",
+#ifdef linux
                msf.cdmsf_min0, msf.cdmsf_sec0, msf.cdmsf_frame0,
-               msf.cdmsf_min1, msf.cdmsf_sec1, msf.cdmsf_frame1);
+               msf.cdmsf_min1, msf.cdmsf_sec1, msf.cdmsf_frame1
+#elif __FreeBSD__
+               msf.start_m, msf.start_s, msf.start_f,
+               msf.end_m,   msf.end_s,   msf.end_f
+#endif
+                       );
        CDADev[wDevID].mode = MCI_MODE_PLAY;
        if (dwFlags & MCI_NOTIFY) {
                dprintf_cdaudio(stddeb,
@@ -660,11 +812,17 @@ static DWORD CDAUDIO_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParm
 */
 static DWORD CDAUDIO_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
 {
-#ifdef linux
+#if defined(linux) || defined(__FreeBSD__)
        dprintf_cdaudio(stddeb,"CDAUDIO_mciStop(%u, %08lX, %p);\n", 
                wDevID, dwFlags, lpParms);
        if (lpParms == NULL) return MCIERR_INTERNAL;
-       if (ioctl(CDADev[wDevID].unixdev, CDROMSTOP)) return MCIERR_HARDWARE;
+       if (ioctl(CDADev[wDevID].unixdev,
+#ifdef linux
+                 CDROMSTOP
+#elif __FreeBSD__
+                 CDIOCSTOP
+#endif
+                 )) return MCIERR_HARDWARE;
        CDADev[wDevID].mode = MCI_MODE_STOP;
        if (dwFlags & MCI_NOTIFY) {
                dprintf_cdaudio(stddeb,
@@ -684,11 +842,17 @@ static DWORD CDAUDIO_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpP
 */
 static DWORD CDAUDIO_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
 {
-#ifdef linux
+#if defined(linux) || defined(__FreeBSD__)
        dprintf_cdaudio(stddeb,"CDAUDIO_mciPause(%u, %08lX, %p);\n", 
                wDevID, dwFlags, lpParms);
        if (lpParms == NULL) return MCIERR_INTERNAL;
-       if (ioctl(CDADev[wDevID].unixdev, CDROMPAUSE)) return MCIERR_HARDWARE;
+       if (ioctl(CDADev[wDevID].unixdev,
+#ifdef linux
+                 CDROMPAUSE
+#elif __FreeBSD__
+                 CDIOCPAUSE
+#endif
+                 )) return MCIERR_HARDWARE;
        CDADev[wDevID].mode = MCI_MODE_PAUSE;
        if (dwFlags & MCI_NOTIFY) {
         dprintf_cdaudio(stddeb,
@@ -708,11 +872,17 @@ static DWORD CDAUDIO_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lp
 */
 static DWORD CDAUDIO_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
 {
-#ifdef linux
+#if defined(linux) || defined(__FreeBSD__)
        dprintf_cdaudio(stddeb,"CDAUDIO_mciResume(%u, %08lX, %p);\n", 
                wDevID, dwFlags, lpParms);
        if (lpParms == NULL) return MCIERR_INTERNAL;
-       if (ioctl(CDADev[wDevID].unixdev, CDROMRESUME)) return MCIERR_HARDWARE;
+       if (ioctl(CDADev[wDevID].unixdev, 
+#ifdef linux
+                 CDROMRESUME
+#elif __FreeBSD__
+                 CDIOCRESUME
+#endif
+                 )) return MCIERR_HARDWARE;
        CDADev[wDevID].mode = MCI_MODE_STOP;
        if (dwFlags & MCI_NOTIFY) {
                dprintf_cdaudio(stddeb,
@@ -732,13 +902,19 @@ static DWORD CDAUDIO_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS l
 */
 static DWORD CDAUDIO_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms)
 {
-#ifdef linux
+#if defined(linux) || defined(__FreeBSD__)
        DWORD   dwRet;
        MCI_PLAY_PARMS PlayParms;
        dprintf_cdaudio(stddeb,"CDAUDIO_mciSeek(%u, %08lX, %p);\n", 
                wDevID, dwFlags, lpParms);
        if (lpParms == NULL) return MCIERR_INTERNAL;
-       if (ioctl(CDADev[wDevID].unixdev, CDROMRESUME)) {
+       if (ioctl(CDADev[wDevID].unixdev,
+#ifdef linux
+                 CDROMRESUME
+#elif __FreeBSD__
+                 CDIOCRESUME
+#endif
+                 )) {
                perror("ioctl CDROMRESUME");
                return MCIERR_HARDWARE;
        }
@@ -776,7 +952,7 @@ static DWORD CDAUDIO_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParm
 */
 static DWORD CDAUDIO_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
 {
-#ifdef linux
+#if defined(linux) || defined(__FreeBSD__)
        dprintf_cdaudio(stddeb,"CDAUDIO_mciSet(%u, %08lX, %p);\n", 
                wDevID, dwFlags, lpParms);
        if (lpParms == NULL) return MCIERR_INTERNAL;
@@ -805,13 +981,26 @@ static DWORD CDAUDIO_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
        if (dwFlags & MCI_SET_DOOR_OPEN) {
                dprintf_cdaudio(stddeb,
                        "CDAUDIO_mciSet // MCI_SET_DOOR_OPEN !\n");
+#ifdef __FreeBSD__
+               if (ioctl(CDADev[wDevID].unixdev, CDIOCALLOW)) return MCIERR_HARDWARE;
+               if (ioctl(CDADev[wDevID].unixdev, CDIOCEJECT)) return MCIERR_HARDWARE;
+               if (ioctl(CDADev[wDevID].unixdev, CDIOCPREVENT)) return MCIERR_HARDWARE;
+#elif linux
                if (ioctl(CDADev[wDevID].unixdev, CDROMEJECT)) return MCIERR_HARDWARE;
+#endif
                CDADev[wDevID].nTracks = 0;
                }
        if (dwFlags & MCI_SET_DOOR_CLOSED) {
                dprintf_cdaudio(stddeb,
                        "CDAUDIO_mciSet // MCI_SET_DOOR_CLOSED !\n");
+#ifdef __FreeBSD__
+                if (ioctl(CDADev[wDevID].unixdev, CDIOCALLOW)) return MCIERR_HARDWARE;
+                if (ioctl(CDADev[wDevID].unixdev, CDIOCCLOSE)) return MCIERR_HARDWARE;
+                if (ioctl(CDADev[wDevID].unixdev, CDIOCPREVENT)) return MCIERR_HARDWARE;
+#elif linux
                if (ioctl(CDADev[wDevID].unixdev, CDROMEJECT)) return MCIERR_HARDWARE;
+                         /* XXX should it be ",1" ??? */
+#endif
                CDADev[wDevID].nTracks = 0;
                }
        if (dwFlags & MCI_SET_VIDEO) return MCIERR_UNSUPPORTED_FUNCTION;
@@ -837,7 +1026,7 @@ static DWORD CDAUDIO_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
 LONG CDAUDIO_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;
@@ -895,12 +1084,24 @@ LONG CDAUDIO_DriverProc(DWORD dwDevID, HDRVR16 hDriv, WORD wMsg,
                case MCI_SET_DOOR_OPEN:
                        dprintf_cdaudio(stddeb,
                                "CDAUDIO_DriverProc // MCI_SET_DOOR_OPEN !\n");
+#ifdef __FreeBSD__
+                       if (ioctl(CDADev[dwDevID].unixdev, CDIOCALLOW)) return MCIERR_HARDWARE;
+                       if (ioctl(CDADev[dwDevID].unixdev, CDIOCEJECT)) return MCIERR_HARDWARE;
+                       if (ioctl(CDADev[dwDevID].unixdev, CDIOCPREVENT)) return MCIERR_HARDWARE;
+#elif linux
                        if (ioctl(CDADev[dwDevID].unixdev, CDROMEJECT)) return MCIERR_HARDWARE;
+#endif
                        CDADev[dwDevID].nTracks = 0;
                        return 0;
                case MCI_SET_DOOR_CLOSED:
                        dprintf_cdaudio(stddeb,"CDAUDIO_DriverProc // MCI_SET_DOOR_CLOSED !\n");
+#ifdef __FreeBSD__
+                       if (ioctl(CDADev[dwDevID].unixdev, CDIOCALLOW)) return MCIERR_HARDWARE;
+                       if (ioctl(CDADev[dwDevID].unixdev, CDIOCCLOSE)) return MCIERR_HARDWARE;
+                       if (ioctl(CDADev[dwDevID].unixdev, CDIOCPREVENT)) return MCIERR_HARDWARE;
+#elif linux
                        if (ioctl(CDADev[dwDevID].unixdev, CDROMEJECT, 1)) return MCIERR_HARDWARE;
+#endif
                        CDADev[dwDevID].nTracks = 0;
                        return 0;
                default:
index 514f84306f8dcb88a4291696f41624fd2bcfa293..7959c8c8e5799eef28e854e1ee3270e4ab5338b6 100644 (file)
@@ -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;
 }
 
index 2d9e67fef5f1cff58ec4b6d12627e400933e3ead..6c38c30ae1f7b800dc16a4d637f33bc910931fdd 100644 (file)
 
 #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;
index b836e20b5d073d19042a8b016de8684805731758..5b060b0a74f7c5bab642d92946f1cf63f513d00a 100644 (file)
@@ -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;
 
index 8339a42d184b2244ad4a91c85cf38ff473e2ecb6..29a5cb4a52270582602b22ac647e21ee2d6d886a 100644 (file)
@@ -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 );
 }
 
 
index f8d552fface066db1612b8a04a7af024bad2b481..db20ea80113d0cb32e97af5243c979443108848b 100644 (file)
@@ -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 );
index 615569fc5e78c36ab7d41e3e3b32562ddcdd67e5..a63275457a40a196edac421660883c0239967c4c 100644 (file)
@@ -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;
index b273a549a28d7128bfd264327ff95c7a16e08319..5efb700353c45c306fb8fc8e34306b30a23f208b 100644 (file)
@@ -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)))
index bbfb6d5082b44fcc7cb1516065010c8889b6fbaf..fbe88bca41df79beabeba066a636c01361ce4b89 100644 (file)
@@ -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;
 }
 
index 8f66793b4cf4d20b7ab131125f14c4357b48f9d1..5e8bdb86e278fec84f952ab7e278e8bc4f665a11 100644 (file)
@@ -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.
index f67c44c00729268334a6918593611dcb1c6f1a6f..b79fa4b543fe0b76167ad918a66341664c7719a1 100644 (file)
@@ -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;
        }
index c59b3789a252a9f9894c72ae5cb82ecd29025cc7..fb323632573e9a90e6cc500fd2fb8e7194ee5bb8 100644 (file)
@@ -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:
index 96307bf91202dd6231b596e2f13b085cb9ac620d..9dc0890f9d645532d1429bd7ef6c5e15e69ba01f 100644 (file)
@@ -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)
index 46244788115f207bc41d3af03ec1eafa8e5437a5..b61ecb392d9a33de4a9c305b5814ab1c37f0caf1 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <ctype.h>
 #include <sys/time.h>
 #include <sys/types.h>
 
 #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 )
 {
index 40f5dffece4aeaf5b3ea9bce9045d4dc0cd4f613..c1b3d095032f0cf3592d6758eef07add292664ed 100644 (file)
@@ -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 );
 }
 
index 3c3ddee458b1e31a565c150690e10c6be8333df3..11f1ccdb443afc12b55998a80386586d810f7a00 100644 (file)
@@ -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]);
index cbca5aa1f5e9181b7452e27d51451f36c4bd1e03..626b35f95c9e531b4228bc9ecf17761726332fb3 100644 (file)
@@ -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;
index cfbb72e5bd9127d88ab3e80f053ed10a8c3ee150..ba64e4ef26397bce3dca50e8e2f32f34341baace 100644 (file)
@@ -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)
        {
index d1c89d7eeec551560042121c91e6d4487a6e1e78..8f2cc950a154b4d5d51d8ac93202d8c353f9f4b2 100644 (file)
@@ -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);