Release 970824

Sat Aug 23 00:05:23 1997  Andreas Mohr <100.30936@germany.net>

	* [if1632/kernel.spec] [if1632/mmsystem.spec]
	Added some stubs.

	* [include/neexe.h] [loader/module.c]
	Added warning for OS/2 executables.

	* [multimedia/midi.c]
	Shortened MIDIOUT driver version string to be less than 31 chars.

	* [objects/gdiobj.c]
	Fixed DeleteObject32() to react properly when called with stock object.

Fri Aug 22 18:03:26 1997  Dimitrie O. Paun <dimi@cs.toronto.edu>

	* [controls/updown.c] [include/updown.h]
	First attempt at implementiong the UpDown class.

	* [controls/widgets.c]
	Added the UpDown class to be initialized by InitCommonControls().

Wed Aug 20 18:01:33 1997  Doug Ridgway <ridgway@routh.UCSD.EDU>

	* [graphics/*] [objects/*] [include/gdi.h]
	Made all GDI objects (except DCs) moveable.

Mon Aug 18 03:25:30 1997  Alex Korobka <alex@trantor.pharm.sunysb.edu>

	* [windows/event.c] [misc/winsock.c] [misc/winsock_dns.c]
	Removed IPC communication to speed up winsock services
	(tested only with 16-bit netscape 3.03).

	* [graphics/x11drv/xfont.c] [documentation/fonts]
	Miscellaneous improvements. Updated docs.

Sun Aug 17 20:39:55 1997  Ingo Schneider <schneidi@informatik.tu-muenchen.de>

	* [misc/comm.c]
	A couple of bug fixes.

Sun Aug 17 19:29:22 1997  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [debugger/dbg.y]
	Display next instruction after stepi/nexti.

	* [if1632/relay.c] [include/callback.h] [tools/build.c]
	Replaced CallTo32_LargeStack with the CALL_LARGE_STACK macro for
	better Winelib support.

	* [include/sigcontext.h]
	Renamed to sig_context.h to avoid conflicts with libc.

	* [*/*]
	All API functions are now prefixed with WINAPI in prevision of
	future Winelib integration.

	* [loader/signal.c] [memory/ldt.c]
	Fixed assembly code to be -fPIC compatible.

Thu Aug 14 14:38:15 1997  Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>

	* [if1632/crtdll.spec][win32/except.c]
	_global_unwind, _local_unwind stub added.

	* [objects/dib.c]	
	Don't read memory you don't even need for the target bitmap (fixes
	one 'lazy' program).

	* [if1632/relay.c][if1632/thunk.c][if1632/kernel32.spec]
	  [win32/ordinals.c][memory/selector.c][memory/global.c]
	  [include/callback.h]
	Added/moved some more win95 ordinal stuff. Implemented QT_Thunk
	(not 100% correct yet) and some friends.

	* [loader/pe_image.c]
	Add possibility to break at the DLL entrypoint.

	* [controls/static.c][misc/commdlg.c][scheduler/thread.c]
	Misc bugfixes and additions.

	* [misc/registry.c]
	The registry seems to be case-preserving but case-insensitive.

	* [memory/global.c]	
	Adapted to new /proc/meminfo format.

	* [objects/font.c][graphics/x11drv/xfont.c]
	FONT_SelectObject and GetTextMetrics* get passed ranges in logical
 	and not device points (thanks to Marion Reyzl for pointing this
 	out).

	* [windows/caret.c]
	Use the windows own DC if present (The caret coordinates are
	logical coordinates based on it). Fixes another AMIPRO problem.

Wed Aug  6 18:22:22 1997  Morten Welinder  <terra@diku.dk>

	* [controls/menu.c]
	General clean-up and Win32 work: split item_flags into fType and
	fState; split item_id into wID and hSubMenu.  Improved
	debug-printing.  Implemented InsertMenuItem32[AW],
	SetMenuDefaultItem32, and SetMenuItemInfo32[AW].  Fixed
	GetMenuItemInfo32[AW].

	* [if1632/user32.spec]
	Define above new functions.

	* [include/windows.h]
	Define MF_DEFAULT and MF_RIGHTJUSTIFY.  Prototype above functions.

	* [include/menu.h]
	Don't prototype now-static MENU_InitSysMenuPopup.

	* [include/comm.h]
	Reduce MAX_PORTS to 9 (which the profile code can handle).

Tue Aug  5 20:16:22 1997  Victor Schneider <vischne@ibm.net>

	* [library/winestub.c] [libtest/expand.c]
	These patches let people porting Windows apps compile them using
	the same conventions regarding global _argc and _argv as those on
	Windows C/C++ compilers.
diff --git a/windows/class.c b/windows/class.c
index 4cc7eb6..e6422e9 100644
--- a/windows/class.c
+++ b/windows/class.c
@@ -304,7 +304,7 @@
 /***********************************************************************
  *           RegisterClass16    (USER.57)
  */
-ATOM RegisterClass16( const WNDCLASS16 *wc )
+ATOM WINAPI RegisterClass16( const WNDCLASS16 *wc )
 {
     ATOM atom;
     CLASS *classPtr;
@@ -342,7 +342,7 @@
 /***********************************************************************
  *           RegisterClass32A      (USER32.426)
  */
-ATOM RegisterClass32A( const WNDCLASS32A* wc )
+ATOM WINAPI RegisterClass32A( const WNDCLASS32A* wc )
 {
     ATOM atom;
     CLASS *classPtr;
@@ -379,7 +379,7 @@
 /***********************************************************************
  *           RegisterClass32W      (USER32.429)
  */
-ATOM RegisterClass32W( const WNDCLASS32W* wc )
+ATOM WINAPI RegisterClass32W( const WNDCLASS32W* wc )
 {
     ATOM atom;
     CLASS *classPtr;
@@ -414,7 +414,7 @@
 /***********************************************************************
  *           RegisterClassEx16    (USER.397)
  */
-ATOM RegisterClassEx16( const WNDCLASSEX16 *wc )
+ATOM WINAPI RegisterClassEx16( const WNDCLASSEX16 *wc )
 {
     ATOM atom;
     CLASS *classPtr;
@@ -449,7 +449,7 @@
 /***********************************************************************
  *           RegisterClassEx32A      (USER32.427)
  */
-ATOM RegisterClassEx32A( const WNDCLASSEX32A* wc )
+ATOM WINAPI RegisterClassEx32A( const WNDCLASSEX32A* wc )
 {
     ATOM atom;
     CLASS *classPtr;
@@ -484,7 +484,7 @@
 /***********************************************************************
  *           RegisterClassEx32W      (USER32.428)
  */
-ATOM RegisterClassEx32W( const WNDCLASSEX32W* wc )
+ATOM WINAPI RegisterClassEx32W( const WNDCLASSEX32W* wc )
 {
     ATOM atom;
     CLASS *classPtr;
@@ -519,7 +519,7 @@
 /***********************************************************************
  *           UnregisterClass16    (USER.403)
  */
-BOOL16 UnregisterClass16( SEGPTR className, HINSTANCE16 hInstance )
+BOOL16 WINAPI UnregisterClass16( SEGPTR className, HINSTANCE16 hInstance )
 {
     CLASS *classPtr;
     ATOM atom;
@@ -535,7 +535,7 @@
 /***********************************************************************
  *           UnregisterClass32A    (USER32.562)
  */
-BOOL32 UnregisterClass32A( LPCSTR className, HINSTANCE32 hInstance )
+BOOL32 WINAPI UnregisterClass32A( LPCSTR className, HINSTANCE32 hInstance )
 {
     CLASS *classPtr;
     ATOM atom;
@@ -551,7 +551,7 @@
 /***********************************************************************
  *           UnregisterClass32W    (USER32.563)
  */
-BOOL32 UnregisterClass32W( LPCWSTR className, HINSTANCE32 hInstance )
+BOOL32 WINAPI UnregisterClass32W( LPCWSTR className, HINSTANCE32 hInstance )
 {
     CLASS *classPtr;
     ATOM atom;
@@ -567,7 +567,7 @@
 /***********************************************************************
  *           GetClassWord16    (USER.129)
  */
-WORD GetClassWord16( HWND16 hwnd, INT16 offset )
+WORD WINAPI GetClassWord16( HWND16 hwnd, INT16 offset )
 {
     return GetClassWord32( hwnd, offset );
 }
@@ -576,7 +576,7 @@
 /***********************************************************************
  *           GetClassWord32    (USER32.218)
  */
-WORD GetClassWord32( HWND32 hwnd, INT32 offset )
+WORD WINAPI GetClassWord32( HWND32 hwnd, INT32 offset )
 {
     WND * wndPtr;
     
@@ -607,7 +607,7 @@
 /***********************************************************************
  *           GetClassLong16    (USER.131)
  */
-LONG GetClassLong16( HWND16 hwnd, INT16 offset )
+LONG WINAPI GetClassLong16( HWND16 hwnd, INT16 offset )
 {
     WND *wndPtr;
     LONG ret;
@@ -629,7 +629,7 @@
 /***********************************************************************
  *           GetClassLong32A    (USER32.214)
  */
-LONG GetClassLong32A( HWND32 hwnd, INT32 offset )
+LONG WINAPI GetClassLong32A( HWND32 hwnd, INT32 offset )
 {
     WND * wndPtr;
     
@@ -663,7 +663,7 @@
 /***********************************************************************
  *           GetClassLong32W    (USER32.215)
  */
-LONG GetClassLong32W( HWND32 hwnd, INT32 offset )
+LONG WINAPI GetClassLong32W( HWND32 hwnd, INT32 offset )
 {
     WND * wndPtr;
 
@@ -684,7 +684,7 @@
 /***********************************************************************
  *           SetClassWord16    (USER.130)
  */
-WORD SetClassWord16( HWND16 hwnd, INT16 offset, WORD newval )
+WORD WINAPI SetClassWord16( HWND16 hwnd, INT16 offset, WORD newval )
 {
     return SetClassWord32( hwnd, offset, newval );
 }
@@ -693,7 +693,7 @@
 /***********************************************************************
  *           SetClassWord32    (USER32.468)
  */
-WORD SetClassWord32( HWND32 hwnd, INT32 offset, WORD newval )
+WORD WINAPI SetClassWord32( HWND32 hwnd, INT32 offset, WORD newval )
 {
     WND * wndPtr;
     WORD retval = 0;
@@ -737,7 +737,7 @@
 /***********************************************************************
  *           SetClassLong16    (USER.132)
  */
-LONG SetClassLong16( HWND16 hwnd, INT16 offset, LONG newval )
+LONG WINAPI SetClassLong16( HWND16 hwnd, INT16 offset, LONG newval )
 {
     WND *wndPtr;
     LONG retval;
@@ -761,7 +761,7 @@
 /***********************************************************************
  *           SetClassLong32A    (USER32.466)
  */
-LONG SetClassLong32A( HWND32 hwnd, INT32 offset, LONG newval )
+LONG WINAPI SetClassLong32A( HWND32 hwnd, INT32 offset, LONG newval )
 {
     WND * wndPtr;
     LONG retval = 0;
@@ -813,7 +813,7 @@
 /***********************************************************************
  *           SetClassLong32W    (USER32.467)
  */
-LONG SetClassLong32W( HWND32 hwnd, INT32 offset, LONG newval )
+LONG WINAPI SetClassLong32W( HWND32 hwnd, INT32 offset, LONG newval )
 {
     WND *wndPtr;
     LONG retval;
@@ -839,7 +839,7 @@
 /***********************************************************************
  *           GetClassName16      (USER.58)
  */
-INT16 GetClassName16( HWND16 hwnd, LPSTR buffer, INT16 count )
+INT16 WINAPI GetClassName16( HWND16 hwnd, LPSTR buffer, INT16 count )
 {
     WND *wndPtr;
     if (!(wndPtr = WIN_FindWndPtr(hwnd))) return 0;
@@ -850,7 +850,7 @@
 /***********************************************************************
  *           GetClassName32A      (USER32.216)
  */
-INT32 GetClassName32A( HWND32 hwnd, LPSTR buffer, INT32 count )
+INT32 WINAPI GetClassName32A( HWND32 hwnd, LPSTR buffer, INT32 count )
 {
     WND *wndPtr;
     if (!(wndPtr = WIN_FindWndPtr(hwnd))) return 0;
@@ -861,7 +861,7 @@
 /***********************************************************************
  *           GetClassName32W      (USER32.217)
  */
-INT32 GetClassName32W( HWND32 hwnd, LPWSTR buffer, INT32 count )
+INT32 WINAPI GetClassName32W( HWND32 hwnd, LPWSTR buffer, INT32 count )
 {
     WND *wndPtr;
     if (!(wndPtr = WIN_FindWndPtr(hwnd))) return 0;
@@ -872,15 +872,19 @@
 /***********************************************************************
  *           GetClassInfo16      (USER.404)
  */
-BOOL16 GetClassInfo16( HINSTANCE16 hInstance, SEGPTR name, WNDCLASS16 *wc )
+BOOL16 WINAPI GetClassInfo16( HINSTANCE16 hInstance, SEGPTR name,
+                              WNDCLASS16 *wc )
 {
     ATOM atom;
     CLASS *classPtr;
 
     hInstance = GetExePtr( hInstance );
     if (!(atom = GlobalFindAtom16( name )) ||
-        !(classPtr = CLASS_FindClassByAtom( atom, hInstance )) ||
-        (hInstance != classPtr->hInstance)) return FALSE;
+        !(classPtr = CLASS_FindClassByAtom( atom, hInstance )))
+        return FALSE;
+    if ((hInstance != classPtr->hInstance) &&
+        !(classPtr->style & CS_GLOBALCLASS)) /*BWCC likes to pass hInstance=0*/
+        return FALSE;
     wc->style         = (UINT16)classPtr->style;
     wc->lpfnWndProc   = WINPROC_GetProc( classPtr->winproc, WIN_PROC_16 );
     wc->cbClsExtra    = (INT16)classPtr->cbClsExtra;
@@ -900,7 +904,8 @@
 /***********************************************************************
  *           GetClassInfo32A      (USER32.210)
  */
-BOOL32 GetClassInfo32A( HINSTANCE32 hInstance, LPCSTR name, WNDCLASS32A *wc )
+BOOL32 WINAPI GetClassInfo32A( HINSTANCE32 hInstance, LPCSTR name,
+                               WNDCLASS32A *wc )
 {
     ATOM atom;
     CLASS *classPtr;
@@ -929,7 +934,8 @@
 /***********************************************************************
  *           GetClassInfo32W      (USER32.213)
  */
-BOOL32 GetClassInfo32W( HINSTANCE32 hInstance, LPCWSTR name, WNDCLASS32W *wc )
+BOOL32 WINAPI GetClassInfo32W( HINSTANCE32 hInstance, LPCWSTR name,
+                               WNDCLASS32W *wc )
 {
     ATOM atom;
     CLASS *classPtr;
@@ -961,7 +967,8 @@
  * FIXME: this is just a guess, I have no idea if GetClassInfoEx() is the
  * same in Win16 as in Win32. --AJ
  */
-BOOL16 GetClassInfoEx16( HINSTANCE16 hInstance, SEGPTR name, WNDCLASSEX16 *wc )
+BOOL16 WINAPI GetClassInfoEx16( HINSTANCE16 hInstance, SEGPTR name,
+                                WNDCLASSEX16 *wc )
 {
     ATOM atom;
     CLASS *classPtr;
@@ -990,8 +997,8 @@
 /***********************************************************************
  *           GetClassInfoEx32A      (USER32.211)
  */
-BOOL32 GetClassInfoEx32A( HINSTANCE32 hInstance, LPCSTR name,
-                          WNDCLASSEX32A *wc )
+BOOL32 WINAPI GetClassInfoEx32A( HINSTANCE32 hInstance, LPCSTR name,
+                                 WNDCLASSEX32A *wc )
 {
     ATOM atom;
     CLASS *classPtr;
@@ -1019,8 +1026,8 @@
 /***********************************************************************
  *           GetClassInfoEx32W      (USER32.212)
  */
-BOOL32 GetClassInfoEx32W( HINSTANCE32 hInstance, LPCWSTR name,
-                          WNDCLASSEX32W *wc )
+BOOL32 WINAPI GetClassInfoEx32W( HINSTANCE32 hInstance, LPCWSTR name,
+                                 WNDCLASSEX32W *wc )
 {
     ATOM atom;
     CLASS *classPtr;
@@ -1048,7 +1055,7 @@
 /***********************************************************************
  *           ClassFirst      (TOOLHELP.69)
  */
-BOOL16 ClassFirst( CLASSENTRY *pClassEntry )
+BOOL16 WINAPI ClassFirst( CLASSENTRY *pClassEntry )
 {
     pClassEntry->wNext = 1;
     return ClassNext( pClassEntry );
@@ -1058,7 +1065,7 @@
 /***********************************************************************
  *           ClassNext      (TOOLHELP.70)
  */
-BOOL16 ClassNext( CLASSENTRY *pClassEntry )
+BOOL16 WINAPI ClassNext( CLASSENTRY *pClassEntry )
 {
     int i;
     CLASS *class = firstClass;