Release 980503

Thu Apr 30 16:28:12 1998  James Juran <jrj120@psu.edu>

	* [scheduler/process.c]
	Implemented GetExitCodeProcess.  The code is a direct translation
	of GetExitCodeThread.

Mon Apr 27 22:20:25 1998  Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>

	* [loader/pe_image.c]
	Unload dummy module when PE_LoadLibraryEx32A fails with
	PE_LoadImage (makes Encarta 98 installer proceed).

	* [files/drive.c]
	Make GetDriveType16 return DRIVE_REMOVABLE for TYPE_CDROM.
	Make GetCurrentDirectory32 behave like the code does and not
	like the help describes.

	* [files/profile.c]
	Revoke recent change in PROFILE_GetSection and try better 
	handling of special case.

	* [include/windows.h]
	Change definition of ACCEL32.

	* [misc/commdlg.c]
	Replace the GetXXXFilename32 macros by normal code.
	Fix two reported bugs in my changes to commdlg.

	* [windows/win.c]
	Add a hook to catch bogus WM_SIZE messages by emitting a warning
	in the appropriate case.

	* [objects/bitmap.c]
	Reject unreasonbable large size arguments in
	CreateCompatibleBitmap32 and add an fixme for that situation.

Sun Apr 26 18:30:07 1998  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [include/ldt.h] [debugger/*.c] [miscemu/instr.c]
	Added IS_SELECTOR_SYSTEM and IS_SELECTOR_32BIT macros.
	Make instruction emulation support system selectors.

	* [loader/*.c]
	Started moving NE specific functions to the new loader/ne
	directory.

	* [memory/environ.c]
	Enforce the 127 chars limit only when creating the environment of
	a Win16 process.

Sun Apr 26 12:22:23 1998  Andreas Mohr <100.30936@germany.net>

	* [files/file.c]
	Fixed an incredible typo in CopyFile32A that made it unusable
	since a rewrite in 970112 (!!).

	* [files/directory.c]
	Fixed GetTempPath32A/W to include trailing backslash.

	* [misc/ver.c]
	Make find_pe_resource "work" with corrupt files.

	* [misc/wsprintf.c]
	Altered WPRINTF_ParseFormatA/W to treat invalid format chars
	as normal output, too.

	* [msdos/dpmi.c]
	Implemented "Allocate/Free real mode callback" (0x0303/0x0304).
	Cross your fingers if you need to use it ;) (completely untested)
	Implemented "Call real mode proc with far return" (0x0301, tested).

	* [msdos/int21.c]
	Fixed ioctlGenericBlkDevReq/0x60.

	* [relay32/dplayx.spec] [relay32/builtin32.c] [relay32/Makefile.in]
	Added built-in DPLAYX.DLL. 

	* [windows/win.c]
	Fixed GetWindowWord()/GWW_HWNDPARENT to return the window's owner
	if it has no parent (SDK).

Sat Apr 25 15:09:53 1998  M.T.Fortescue  <mark@mtfhpc.demon.co.uk>

	* [debugger/db_disasm.c]
	Fixed disassemble bug for no-display option and 'lock',
	'repne' and 'repe' prefixes.

	* [debugger/registers.c]
	Added textual flag description output on 'info regs'.

Sat Apr 25 14:18:26 1998  Matthew Becker <mbecker@glasscity.net>

	* [*/*.c]
	Added stubs and/or documentation for the following functions: 
	LookupPrivilegeValue, OpenService, ControlService, RegGetKeySecurity, 
	StartService, SetComputerName, DeleteService, CloseServiceHandle, 
	OpenProcessToken, OpenSCManager, DeregisterEventSource, 
	WaitForDebugEvent, WaitForInputIdle, RegisterEventSource,
	SetDebugErrorLevel, SetConsoleCursorPosition, ChoosePixelFormat,
	SetPixelFormat, GetPixelFormat, DescribePixelFormat, SwapBuffers,
	PolyBezier, AbortPath, DestroyAcceleratorTable, HeapWalk,
	DdeInitialize, DdeUninitialize, DdeConnectList, DdeDisconnectList,
	DdeCreateStringHandle, DdePostAdvise, DdeGetData, DdeNameService,
	DdeGetLastError, WNetGetDirectoryType, EnumPrinters, RegFlushKey,
	RegGetKeySecurity, DllGetClassObject, DllCanUnloadNow, CreateBitmap,
	CreateCompatibleBitmap, CreateBitmapIndirect, GetBitmapBits,
	SetBitmapBits, LoadImage, CopyImage, LoadBitmap, DrawIcon,
	CreateDiscardableBitmap, SetDIBits, GetCharABCWidths, LoadTypeLib,
	SetConsoleCtrlHandler, CreateConsoleScreenBuffer, ReadConsoleInput,
	GetConsoleCursorInfo, SetConsoleCursorInfo, SetConsoleWindowInfo,
	SetConsoleTextAttribute, SetConsoleScreenBufferSize,
	FillConsoleOutputCharacter, FillConsoleOutputAttribute,
	CreateMailslot, GetMailslotInfo, GetCompressedFileSize,
	GetProcessWindowStation, GetThreadDesktop, SetDebugErrorLevel,
	WaitForDebugEvent, SetComputerName, CreateMDIWindow.

Thu Apr 23 23:54:04 1998  Douglas Ridgway  <ridgway@winehq.com>

	* [include/windows.h] [objects/enhmetafile.c] [relay32/gdi32.spec]
	Implement CopyEnhMetaFile, Get/SetEnhMetaFileBits, other fixes.

	* [include/windows.h] [objects/metafile.c] [relay32/gdi32.spec]
	32-bit metafile fixes, implement EnumMetaFile32, GetMetaFileBitsEx.

	* [objects/font.c] [graphics/x11drv/xfont.c] [graphics/x11drv/text.c]
	Some rotated text support for X11R6 displays.

	* [win32/newfns.c] [ole/ole2nls.c]
	Moved GetNumberFormat32A.

Wed Apr 22 17:38:20 1998  David Lee Lambert <lamber45@egr.msu.edu>

	* [ole/ole2nls.c] [misc/network.c]
	Changed some function documentation to the new style.

	* [misc/network.c] [include/windows.h] [if1632/user.spec]
	  [relay32/mpr.spec] [misc/mpr.c]
	Added stubs for some Win32 network functions;  renamed some 
	16-bit ones with 32-bit counterparts,  as well as
	WNetGetDirectoryType;  moved the stubs in misc/mpr.c (three of
	them!) to misc/network.c.

	* [ole/compobj.c] [ole/storage.c] [ole/ole2disp.c] 
	  [ole/ole2nls.c] [ole/folders.c] [ole/moniker.c] [ole/ole2.c]
	  [graphics/fontengine.c] [graphics/ddraw.c] [graphics/env.c]
	  [graphics/driver.c] [graphics/escape.c]
	Changed fprintf's to proper debug-macros.

	* [include/winnls.h]
	Added some flags (for internal use).

	* [ole/ole2nls.c] 
	Added the Unicode core function, and worked out a way to hide
	the commonality of the core.

	* [relay32/kernel32.spec]
	Added support for GetDate/Time32A/W.

Wed Apr 22 09:16:03 1998  Gordon Chaffee  <chaffee@cs.berkeley.edu>

	* [win32/code_page.c]
	Fixed problem with MultiByteToWideChar that was introduced in
	last release.  Made MultiByteToWideChar more compatible with Win32.

	* [graphics/x11drv/graphics.c]
	Fixed problem with drawing arcs.

Tue Apr 21 11:24:58 1998  Constantine Sapuntzakis  <csapuntz@tma-1.lcs.mit.edu>

	*  [ole/ole2nls.c]
	Move stuff from 0x409 case to Lang_En. 

	*  [relay32/user32.spec] [windows/winpos.c]
	Added stubs for GetWindowRgn32 and SetWindowRgn32. Makes Office
	Paperclip happy.

Tue Apr 21 11:16:16 1998  Constantine Sapuntzakis  <csapuntz@tma-1.lcs.mit.edu>

	*  [loader/pe_image.c]
	If image is relocated, TLS addresses need to be adjusted.

	* [debugger/*.c]
	Generalized tests for 32-bit segments.

Tue Apr 21 02:04:59 1998  James Juran  <jrj120@psu.edu>
	
	* [misc/*.c] [miscemu/*.c] [msdos/*.c] [if1632/*.c] 
	  [include/*.h] [loader/*.c] [memory/*.c] [multimedia/*.c] 
	  [objects/*.c]
	Almost all fprintf statements converted to appropriate 
	debug messages.

	* [README]
	Updated "GETTING MORE INFORMATION" section to include WineHQ.

	* [documentation/debugger]
	Fixed typo.

	* [windows/defwnd.c]
	Added function documentation.

Sun Apr 19 16:30:58 1998  Marcus Meissner <marcus@mud.de>

	* [Make.rules.in]
	Added lint target (using lclint).

	* [relay32/oleaut32.spec][relay32/Makefile.in][ole/typelib.c]
	  [ole/ole2disp.c]
	Added oleaut32 spec, added some SysString functions.

	* [if1632/signal.c]
	Added printing of faultaddress in Linux (using CR2 debug register).

	* [configure.in]
	Added <sys/types.h> for statfs checks.

	* [loader/*.c][debugger/break.c][debugger/hash.c]
	Started to split win32/win16 module handling, preparing support
	for other binary formats (like ELF).

Sat Apr 18 10:07:41 1998  Rein Klazes <rklazes@casema.net>

	* [misc/registry.c]
	Fixed a bug that made RegQueryValuexxx returning
	incorrect registry values.

Fri Apr 17 22:59:22 1998  Alexander V. Lukyanov <lav@long.yar.ru>

	* [misc/lstr.c]
	FormatMessage32*: remove linefeed when nolinefeed set;
	check for target underflow.

Fri Apr 17 00:38:14 1998  Alexander V. Lukyanov <lav@long.yar.ru>

	* [misc/crtdll.c]
	Implement xlat_file_ptr for CRT stdin/stdout/stderr address
	translation.

Wed Apr 15 20:43:56 1998  Jim Peterson <jspeter@birch.ee.vt.edu>

	* [controls/menu.c]
	Added 'odaction' parameter to MENU_DrawMenuItem() and redirected
	WM_DRAWITEM messages to GetWindow(hwnd,GW_OWNER).

Tue Apr 14 16:17:55 1998  Berend Reitsma <berend@united-info.com>

	* [graphics/metafiledrv/init.c]	[graphics/painting.c] 
	  [graphics/win16drv/init.c] [graphics/x11drv/graphics.c]
	  [graphics/x11drv/init.c] [include/gdi.h] [include/x11drv.h]
	  [relay32/gdi32.spec]
	Added PolyPolyline routine.

	* [windows/winproc.c]
	Changed WINPROC_GetProc() to return proc instead of &(jmp proc).
diff --git a/win32/advapi.c b/win32/advapi.c
index d84a2f1..cee2675 100644
--- a/win32/advapi.c
+++ b/win32/advapi.c
@@ -35,16 +35,26 @@
 }
 
 
-/***********************************************************************
- *           OpenProcessToken   [ADVAPI32.197]
+/******************************************************************************
+ * OpenProcessToken [ADVAPI32.109]
+ * Opens the access token associated with a process
+ *
+ * PARAMS
+ *    ProcessHandle [I] Handle to process
+ *    DesiredAccess [I] Desired access to process
+ *    TokenHandle   [O] Pointer to handle of open access token
+ *
+ * RETURNS STD
  */
-BOOL32 WINAPI OpenProcessToken(HANDLE32 process,DWORD desiredaccess,
-                               HANDLE32 *thandle)
+BOOL32 WINAPI OpenProcessToken( HANDLE32 ProcessHandle, DWORD DesiredAccess,
+                                HANDLE32 *TokenHandle )
 {
-	FIXME(advapi,"(%08x,%08lx,%p):stub!\n",process,desiredaccess,thandle);
-	return TRUE;
+    FIXME(advapi,"(%08x,%08lx,%p): stub\n",ProcessHandle,DesiredAccess,
+          TokenHandle);
+    return TRUE;
 }
 
+
 /***********************************************************************
  *           OpenThreadToken		[ADVAPI32.114]
  */
@@ -56,15 +66,45 @@
 	return TRUE;
 }
 
-/***********************************************************************
- *           LookupPrivilegeValueA   [ADVAPI32.90]
+
+/******************************************************************************
+ * LookupPrivilegeValue32A                                        [ADVAPI32.92]
  */
-BOOL32 WINAPI LookupPrivilegeValue32A(LPCSTR system,LPCSTR name,LPVOID bla)
+BOOL32 WINAPI LookupPrivilegeValue32A( LPCSTR lpSystemName, 
+                                       LPCSTR lpName, LPVOID lpLuid)
 {
-	FIXME(advapi,"(%s,%s,%p): stub\n",system,name,bla);
-	return TRUE;
+    LPWSTR lpSystemNameW = HEAP_strdupAtoW(GetProcessHeap(), 0, lpSystemName);
+    LPWSTR lpNameW = HEAP_strdupAtoW(GetProcessHeap(), 0, lpName);
+    BOOL32 ret = LookupPrivilegeValue32W( lpSystemNameW, lpNameW, lpLuid);
+    HeapFree(GetProcessHeap(), 0, lpNameW);
+    HeapFree(GetProcessHeap(), 0, lpSystemNameW);
+    return ret;
 }
 
+
+/******************************************************************************
+ * LookupPrivilegeValue32W                                        [ADVAPI32.93]
+ * Retrieves LUID used on a system to represent the privilege name.
+ *
+ * NOTES
+ *    lpLuid should be PLUID
+ *
+ * PARAMS
+ *    lpSystemName [I] Address of string specifying the system
+ *    lpName       [I] Address of string specifying the privilege
+ *    lpLuid       [I] Address of locally unique identifier
+ *
+ * RETURNS STD
+ */
+BOOL32 WINAPI LookupPrivilegeValue32W( LPCWSTR lpSystemName,
+                                       LPCWSTR lpName, LPVOID lpLuid )
+{
+    FIXME(advapi,"(%s,%s,%p): stub\n",debugstr_w(lpSystemName), 
+                  debugstr_w(lpName), lpLuid);
+    return TRUE;
+}
+
+
 /***********************************************************************
  *           AdjustTokenPrivileges   [ADVAPI32.10]
  */
@@ -87,25 +127,245 @@
 	return TRUE;
 }
 
-/*SC_HANDLE*/
-DWORD WINAPI OpenSCManagerA(LPCSTR machine,LPCSTR dbname,DWORD desiredaccess)
+
+/******************************************************************************
+ * OpenSCManager32A [ADVAPI32.110]
+ */
+HANDLE32 WINAPI OpenSCManager32A( LPCSTR lpMachineName, LPCSTR lpDatabaseName,
+                                  DWORD dwDesiredAccess )
 {
-	FIXME(advapi,"(%s,%s,%08lx): stub\n",machine,dbname,desiredaccess);
-	return 0;
+    LPWSTR lpMachineNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpMachineName);
+    LPWSTR lpDatabaseNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpDatabaseName);
+    DWORD ret = OpenSCManager32W(lpMachineNameW,lpDatabaseNameW,
+                                 dwDesiredAccess);
+    HeapFree(GetProcessHeap(),0,lpDatabaseNameW);
+    HeapFree(GetProcessHeap(),0,lpMachineNameW);
+    return ret;
 }
 
-DWORD WINAPI OpenSCManagerW(LPCWSTR machine,LPCWSTR dbname,DWORD desiredaccess)
+
+/******************************************************************************
+ * OpenSCManager32W [ADVAPI32.111]
+ * Establishes a connection to the service control manager and opens database
+ *
+ * NOTES
+ *    This should return a SC_HANDLE
+ *
+ * PARAMS
+ *    lpMachineName   [I] Pointer to machine name string
+ *    lpDatabaseName  [I] Pointer to database name string
+ *    dwDesiredAccess [I] Type of access
+ *
+ * RETURNS
+ *    Success: Handle to service control manager database
+ *    Failure: NULL
+ */
+HANDLE32 WINAPI OpenSCManager32W( LPCWSTR lpMachineName, LPCWSTR lpDatabaseName,
+                                  DWORD dwDesiredAccess )
 {
-	LPSTR	machineA = HEAP_strdupWtoA(GetProcessHeap(),0,machine);
-	LPSTR	dbnameA = HEAP_strdupWtoA(GetProcessHeap(),0,dbname);
-	FIXME(advapi,"(%s,%s,%08lx): stub\n",machineA,dbnameA,desiredaccess);
-	HeapFree(GetProcessHeap(),0,machineA);
-	HeapFree(GetProcessHeap(),0,dbnameA);
-	return 0;
+    FIXME(advapi,"(%s,%s,%08lx): stub\n", debugstr_w(lpMachineName), 
+          debugstr_w(lpDatabaseName), dwDesiredAccess);
+    return 1;
 }
 
+
 BOOL32 WINAPI AllocateLocallyUniqueId(LPLUID lpluid) {
 	lpluid->LowPart = time(NULL);
 	lpluid->HighPart = 0;
 	return TRUE;
 }
+
+
+/******************************************************************************
+ * ControlService [ADVAPI32.23]
+ * Sends a control code to a Win32-based service.
+ *
+ * NOTES
+ *    hService should be SC_HANDLE
+ *
+ * RETURNS STD
+ */
+BOOL32 WINAPI ControlService( HANDLE32 hService, DWORD dwControl, 
+                              LPSERVICE_STATUS lpServiceStatus )
+{
+    FIXME(advapi, "(%d,%ld,%p): stub\n",hService,dwControl,lpServiceStatus);
+    return TRUE;
+}
+
+
+/******************************************************************************
+ * CloseServiceHandle [ADVAPI32.22]
+ * Close handle to service or service control manager
+ *
+ * PARAMS
+ *    hSCObject [I] Handle to service or service control manager database
+ *
+ * NOTES
+ *    hSCObject should be SC_HANDLE
+ *
+ * RETURNS STD
+ */
+BOOL32 WINAPI CloseServiceHandle( HANDLE32 hSCObject )
+{
+    FIXME(advapi, "(%d): stub\n", hSCObject);
+    return TRUE;
+}
+
+
+/******************************************************************************
+ * OpenService32A [ADVAPI32.112]
+ */
+HANDLE32 WINAPI OpenService32A( HANDLE32 hSCManager, LPCSTR lpServiceName,
+                                DWORD dwDesiredAccess )
+{
+    LPWSTR lpServiceNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpServiceName);
+    DWORD ret = OpenService32W( hSCManager, lpServiceNameW, dwDesiredAccess);
+    HeapFree(GetProcessHeap(),0,lpServiceNameW);
+    return ret;
+}
+
+
+/******************************************************************************
+ * OpenService32W [ADVAPI32.113]
+ * Opens a handle to an existing service
+ *
+ * NOTES
+ *    The return value should be SC_HANDLE
+ *    hSCManager should be SC_HANDLE
+ *
+ * RETURNS
+ *    Success: Handle to the service
+ *    Failure: NULL
+ */
+HANDLE32 WINAPI OpenService32W( HANDLE32 hSCManager, LPCWSTR lpServiceName,
+                                DWORD dwDesiredAccess )
+{
+    FIXME(advapi, "(%d,%p,%ld): stub\n",hSCManager, lpServiceName,
+          dwDesiredAccess);
+    return 1;
+}
+
+
+/******************************************************************************
+ * CreateServiceA [ADVAPI32.28]
+ */
+DWORD WINAPI CreateServiceA( DWORD hSCManager, LPCSTR lpServiceName,
+                             LPCSTR lpDisplayName, DWORD dwDesiredAccess, 
+                             DWORD dwServiceType, DWORD dwStartType, 
+                             DWORD dwErrorControl, LPCSTR lpBinaryPathName,
+                             LPCSTR lpLoadOrderGroup, LPDWORD lpdwTagId, 
+                             LPCSTR lpDependencies, LPCSTR lpServiceStartName, 
+                             LPCSTR lpPassword )
+{
+    FIXME(advapi, "(%ld,%s,%s,...): stub\n", 
+          hSCManager, debugstr_a(lpServiceName), debugstr_a(lpDisplayName));
+    return 1;
+}
+
+
+/******************************************************************************
+ * DeleteService [ADVAPI32.31]
+ *
+ * PARAMS
+ *    hService [I] Handle to service
+ *
+ * RETURNS STD
+ *
+ * NOTES
+ *    hService should be SC_HANDLE
+ */
+BOOL32 WINAPI DeleteService( HANDLE32 hService )
+{
+    FIXME(advapi, "(%d): stub\n",hService);
+    return TRUE;
+}
+
+
+/******************************************************************************
+ * StartService32A [ADVAPI32.195]
+ *
+ * NOTES
+ *    How do we convert lpServiceArgVectors to use the 32W version?
+ */
+BOOL32 WINAPI StartService32A( HANDLE32 hService, DWORD dwNumServiceArgs,
+                               LPCSTR *lpServiceArgVectors )
+{
+    FIXME(advapi, "(%d,%ld,%p): stub\n",hService,dwNumServiceArgs,lpServiceArgVectors);
+    return TRUE;
+}
+
+
+/******************************************************************************
+ * StartService32W [ADVAPI32.198]
+ * Starts a service
+ *
+ * PARAMS
+ *    hService            [I] Handle of service
+ *    dwNumServiceArgs    [I] Number of arguments
+ *    lpServiceArgVectors [I] Address of array of argument string pointers
+ *
+ * RETURNS STD
+ *
+ * NOTES
+ *    hService should be SC_HANDLE
+ */
+BOOL32 WINAPI StartService32W( HANDLE32 hService, DWORD dwNumServiceArgs,
+                               LPCWSTR *lpServiceArgVectors )
+{
+    FIXME(advapi, "(%d,%ld,%p): stub\n",hService,dwNumServiceArgs,
+          lpServiceArgVectors);
+    return TRUE;
+}
+
+
+/******************************************************************************
+ * DeregisterEventSource [ADVAPI32.32]
+ * Closes a handle to the specified event log
+ *
+ * PARAMS
+ *    hEventLog [I] Handle to event log
+ *
+ * RETURNS STD
+ */
+BOOL32 WINAPI DeregisterEventSource( HANDLE32 hEventLog )
+{
+    FIXME(advapi, "(%d): stub\n",hEventLog);
+    return TRUE;
+}
+
+
+/******************************************************************************
+ * RegisterEventSource32A [ADVAPI32.174]
+ */
+HANDLE32 WINAPI RegisterEventSource32A( LPCSTR lpUNCServerName, 
+                                        LPCSTR lpSourceName )
+{
+    LPWSTR lpUNCServerNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpUNCServerName);
+    LPWSTR lpSourceNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpSourceName);
+    HANDLE32 ret = RegisterEventSource32W(lpUNCServerNameW,lpSourceNameW);
+    HeapFree(GetProcessHeap(),0,lpSourceNameW);
+    HeapFree(GetProcessHeap(),0,lpUNCServerNameW);
+    return ret;
+}
+
+
+/******************************************************************************
+ * RegisterEventSource32W [ADVAPI32.175]
+ * Returns a registered handle to an event log
+ *
+ * PARAMS
+ *    lpUNCServerName [I] Server name for source
+ *    lpSourceName    [I] Source name for registered handle
+ *
+ * RETURNS
+ *    Success: Handle
+ *    Failure: NULL
+ */
+HANDLE32 WINAPI RegisterEventSource32W( LPCWSTR lpUNCServerName, 
+                                        LPCWSTR lpSourceName )
+{
+    FIXME(advapi, "(%s,%s): stub\n", debugstr_w(lpUNCServerName),
+          debugstr_w(lpSourceName));
+    return 1;
+}
+
diff --git a/win32/code_page.c b/win32/code_page.c
index a43c226..f730121 100644
--- a/win32/code_page.c
+++ b/win32/code_page.c
@@ -13,14 +13,20 @@
 #include "debug.h"
 
 
-/***********************************************************************
- *           GetACP               (KERNEL32.148)
+/******************************************************************************
+ * GetACP [KERNEL32.276]  Gets current ANSI code-page identifier.
+ *
+ * RETURNS
+ *    Current ANSI code-page identifier, default if no current defined
  */
 UINT32 WINAPI GetACP(void)
 {
+    /* This introduces too many messages */
+/*    FIXME(win32, "(void): stub\n"); */
     return 1252;    /* Windows 3.1 ISO Latin */
 }
 
+
 /***********************************************************************
  *           GetCPInfo            (KERNEL32.154)
  */
@@ -82,7 +88,34 @@
 
 
 /***********************************************************************
- *              MultiByteToWideChar                (KERNEL32.392)
+ *              MultiByteToWideChar                (KERNEL32.534)
+ *
+ * PARAMS
+ *   page [in]   Codepage character set to convert from
+ *   flags [in]  Character mapping flags
+ *   src [in]     Source string buffer
+ *   srclen [in]  Length of source string buffer
+ *   dst [in]     Destination buffer
+ *   dstlen [in]  Length of destination buffer
+ *
+ * NOTES
+ *   The returned length includes the null terminator character.
+ *
+ * RETURNS
+ *   Success: If dstlen > 0, number of characters written to destination
+ *            buffer.  If dstlen == 0, number of characters needed to do
+ *            conversion.
+ *   Failure: 0. Occurs if not enough space is available.
+ *
+ * ERRORS
+ *   ERROR_INSUFFICIENT_BUFFER
+ *   ERROR_INVALID_FLAGS (not yet implemented)
+ *   ERROR_INVALID_PARAMETER (not yet implemented)
+ *
+ * BUGS
+ *   Does not properly handle codepage conversions.
+ *   Does not properly handle flags.
+ *
  */
 INT32 WINAPI MultiByteToWideChar(UINT32 page, DWORD flags,
 			         LPCSTR src, INT32 srclen,
@@ -91,25 +124,56 @@
     int ret;
 
     if (srclen == -1)
-	srclen = lstrlen32A(src);
+	srclen = lstrlen32A(src)+1;
     if (!dstlen || !dst)
 	return srclen;
 
     ret = srclen;
-    while (srclen > 0 && dstlen > 0) {
+    while (srclen && dstlen) {
 	*dst = (WCHAR)(unsigned char)*src;
-	if (!*src)
-	    return ret;
 	dst++;    src++;
 	dstlen--; srclen--;
     }
-    if ((dstlen == 0) && *src) {
+    if (!dstlen && srclen) {
 	SetLastError(ERROR_INSUFFICIENT_BUFFER);
 	return 0;
     }
     return ret;
 }
 
+/***********************************************************************
+ *              WideCharToMultiByte                (KERNEL32.727)
+ *
+ * PARAMS
+ *   page [in]    Codepage character set to convert to
+ *   flags [in]   Character mapping flags
+ *   src [in]     Source string buffer
+ *   srclen [in]  Length of source string buffer
+ *   dst [in]     Destination buffer
+ *   dstlen [in]  Length of destination buffer
+ *   defchar [in] Default character to use for conversion if no exact
+ *		    conversion can be made
+ *   used [out]   Set if default character was used in the conversion
+ *
+ * NOTES
+ *   The returned length includes the null terminator character.
+ *
+ * RETURNS
+ *   Success: If dstlen > 0, number of characters written to destination
+ *            buffer.  If dstlen == 0, number of characters needed to do
+ *            conversion.
+ *   Failure: 0. Occurs if not enough space is available.
+ *
+ * ERRORS
+ *   ERROR_INSUFFICIENT_BUFFER
+ *   ERROR_INVALID_FLAGS (not yet implemented)
+ *   ERROR_INVALID_PARAMETER (not yet implemented)
+ *
+ * BUGS
+ *   Does not properly handle codepage conversions.
+ *   Does not properly handle flags.
+ *
+ */
 INT32 WINAPI WideCharToMultiByte(UINT32 page, DWORD flags, LPCWSTR src,
 				 INT32 srclen,LPSTR dst, INT32 dstlen,
 				 LPCSTR defchar, BOOL32 *used)
diff --git a/win32/console.c b/win32/console.c
index 1ab7d84..89d70dc 100644
--- a/win32/console.c
+++ b/win32/console.c
@@ -48,6 +48,14 @@
 } CONSOLE;
 
 
+/* This probably belongs somewhere else */
+typedef struct _CONSOLE_CURSOR_INFO {
+    DWORD  dwSize;   /* Between 1 & 100 for percentage of cell filled */
+    BOOL32 bVisible; /* Visibility of cursor */
+} CONSOLE_CURSOR_INFO, *LPCONSOLE_CURSOR_INFO;
+
+
+
 static void CONSOLE_Destroy( K32OBJ *obj );
 static BOOL32 CONSOLE_Write(K32OBJ *ptr, LPCVOID lpBuffer, 
 			    DWORD nNumberOfChars,  LPDWORD lpNumberOfChars, 
@@ -72,7 +80,9 @@
 
 
 
-
+/***********************************************************************
+ * CONSOLE_Destroy
+ */
 static void CONSOLE_Destroy(K32OBJ *obj)
 {
 	CONSOLE *console = (CONSOLE *)obj;
@@ -91,7 +101,12 @@
 }
 
 
-/* lpOverlapped is ignored */
+/***********************************************************************
+ * CONSOLE_Read
+ *
+ * NOTES
+ *    lpOverlapped is ignored
+ */
 static BOOL32 CONSOLE_Read(K32OBJ *ptr, LPVOID lpBuffer, DWORD nNumberOfChars,
 			LPDWORD lpNumberOfChars, LPOVERLAPPED lpOverlapped)
 {
@@ -112,7 +127,12 @@
 }
 
 
-/* lpOverlapped is ignored */
+/***********************************************************************
+ * CONSOLE_Write
+ *
+ * NOTES
+ *    lpOverlapped is ignored
+ */
 static BOOL32 CONSOLE_Write(K32OBJ *ptr, LPCVOID lpBuffer, 
 			    DWORD nNumberOfChars,
 			    LPDWORD lpNumberOfChars, LPOVERLAPPED lpOverlapped)
@@ -145,29 +165,51 @@
 }
 
 
-
-
-/***********************************************************************
- *           SetConsoleCtrlHandler               (KERNEL32.459)
+/******************************************************************************
+ * SetConsoleCtrlHandler [KERNEL32.459]  Adds function to calling process list
+ *
+ * PARAMS
+ *    func [I] Address of handler function
+ *    add  [I] Handler to add or remove
+ *
+ * RETURNS
+ *    Success: TRUE
+ *    Failure: FALSE
  */
-BOOL32 WINAPI SetConsoleCtrlHandler(HANDLER_ROUTINE * func,  BOOL32 a)
+BOOL32 WINAPI SetConsoleCtrlHandler( HANDLER_ROUTINE *func, BOOL32 add )
 {
-	return 0;
+    FIXME(console, "(%p,%i): stub\n",func,add);
+    return TRUE;
 }
 
-/***********************************************************************
- *           CreateConsoleScreenBuffer   (KERNEL32.151)
+
+/******************************************************************************
+ * CreateConsoleScreenBuffer [KERNEL32.151]  Creates a console screen buffer
+ *
+ * PARAMS
+ *    dwDesiredAccess    [I] Access flag
+ *    dwShareMode        [I] Buffer share mode
+ *    sa                 [I] Security attributes
+ *    dwFlags            [I] Type of buffer to create
+ *    lpScreenBufferData [I] Reserved
+ *
+ * NOTES
+ *    Should call SetLastError
+ *
+ * RETURNS
+ *    Success: Handle to new console screen buffer
+ *    Failure: INVALID_HANDLE_VALUE
  */
 HANDLE32 WINAPI CreateConsoleScreenBuffer( DWORD dwDesiredAccess,
-                                           DWORD dwShareMode,
-                                           LPSECURITY_ATTRIBUTES lpSecurityAttributes,
-                                           DWORD dwFlags,
-                                           LPVOID lpScreenBufferData)
+                DWORD dwShareMode, LPSECURITY_ATTRIBUTES sa,
+                DWORD dwFlags, LPVOID lpScreenBufferData )
 {
-	FIXME(console, "(...): stub !\n");
-	return INVALID_HANDLE_VALUE32;
+    FIXME(console, "(%ld,%ld,%p,%ld,%p): stub\n",dwDesiredAccess,
+          dwShareMode, sa, dwFlags, lpScreenBufferData);
+    return 1;
 }
 
+
 /***********************************************************************
  *           GetConsoleScreenBufferInfo   (KERNEL32.190)
  */
@@ -188,15 +230,22 @@
     return TRUE;
 }
 
-/***********************************************************************
- *           SetConsoleActiveScreenBuffer   (KERNEL32.623)
+
+/******************************************************************************
+ * SetConsoleActiveScreenBuffer [KERNEL32.623]  Sets buffer to current console
+ *
+ * RETURNS
+ *    Success: TRUE
+ *    Failure: FALSE
  */
-BOOL32 WINAPI SetConsoleActiveScreenBuffer(HANDLE32 hConsoleOutput)
+BOOL32 WINAPI SetConsoleActiveScreenBuffer(
+    HANDLE32 hConsoleOutput) /* [in] Handle to console screen buffer */
 {
-	FIXME(console, "(%x): stub!\n", hConsoleOutput);
-	return 0;
+    FIXME(console, "(%x): stub\n", hConsoleOutput);
+    return FALSE;
 }
 
+
 /***********************************************************************
  *            GetLargestConsoleWindowSize   (KERNEL32.226)
  */
@@ -433,14 +482,18 @@
 }
 
 
-/***********************************************************************
- *            GetConsoleCP   (KERNEL32.226)
+/******************************************************************************
+ * GetConsoleCP [KERNEL32.295]  Returns the OEM code page for the console
+ *
+ * RETURNS
+ *    Code page code
  */
 UINT32 WINAPI GetConsoleCP(VOID)
 {
     return GetACP();
 }
 
+
 /***********************************************************************
  *            GetConsoleOutputCP   (KERNEL32.189)
  */
@@ -460,15 +513,25 @@
 	return TRUE;
 }
 
-/***********************************************************************
- *            SetConsoleMode   (KERNEL32.628)
+
+/******************************************************************************
+ * SetConsoleMode [KERNEL32.628]  Sets input mode of console's input buffer
+ *
+ * PARAMS
+ *    hcon [I] Handle to console input or screen buffer
+ *    mode [I] Input or output mode to set
+ *
+ * RETURNS
+ *    Success: TRUE
+ *    Failure: FALSE
  */
-BOOL32 WINAPI SetConsoleMode(HANDLE32 hcon,DWORD mode)
+BOOL32 WINAPI SetConsoleMode( HANDLE32 hcon, DWORD mode )
 {
-	FIXME(console,"(%08x,%08lx): stub\n",hcon,mode);
-	return TRUE;
+    FIXME(console,"(%08x,%08lx): stub\n",hcon,mode);
+    return TRUE;
 }
 
+
 /***********************************************************************
  *            GetConsoleTitleA   (KERNEL32.191)
  */
@@ -485,21 +548,31 @@
 	return 0;
 }
 
-/***********************************************************************
- *            GetConsoleTitleW   (KERNEL32.192)
+
+/******************************************************************************
+ * GetConsoleTitle32W [KERNEL32.192]  Retrieves title string for console
+ *
+ * PARAMS
+ *    title [O] Address of buffer for title
+ *    size  [I] Size of buffer
+ *
+ * RETURNS
+ *    Success: Length of string copied
+ *    Failure: 0
  */
-DWORD WINAPI GetConsoleTitle32W(LPWSTR title,DWORD size)
+DWORD WINAPI GetConsoleTitle32W( LPWSTR title, DWORD size )
 {
-	PDB32 *pdb = PROCESS_Current();
-	CONSOLE *console= (CONSOLE *)pdb->console;
-	if(console && console->title) 
-	  {
-	    lstrcpynAtoW(title,console->title,size);
-	    return (lstrlen32W(title));
-	  }
-	return 0;
+    PDB32 *pdb = PROCESS_Current();
+    CONSOLE *console= (CONSOLE *)pdb->console;
+    if(console && console->title) 
+    {
+        lstrcpynAtoW(title,console->title,size);
+        return (lstrlen32W(title));
+    }
+    return 0;
 }
 
+
 /***********************************************************************
  *            WriteConsoleA   (KERNEL32.729)
  */
@@ -514,6 +587,7 @@
 			 lpNumberOfCharsWritten, NULL);
 }
 
+
 /***********************************************************************
  *            WriteConsoleOutputA   (KERNEL32.732)
  */
@@ -523,7 +597,8 @@
                                      COORD dwBufferCoord,
                                      LPSMALL_RECT lpWriteRegion)
 {
-	return FALSE;
+    FIXME(console, "(...):stub\n");
+    return FALSE;
 }
 
 /***********************************************************************
@@ -545,9 +620,9 @@
 			 lpNumberOfCharsWritten, NULL);
 	HeapFree( GetProcessHeap(), 0, xstring );
 	return ret;
-
 }
 
+
 /***********************************************************************
  *            ReadConsoleA   (KERNEL32.419)
  */
@@ -610,6 +685,31 @@
 
 }
 
+
+/******************************************************************************
+ * ReadConsoleInputA [KERNEL32.569]  Reads data from a console
+ *
+ * PARAMS
+ *    hConsoleInput        [I] Handle to console input buffer
+ *    lpBuffer             [O] Address of buffer for read data
+ *    nLength              [I] Number of records to read
+ *    lpNumberOfEventsRead [O] Address of number of records read
+ *
+ * RETURNS
+ *    Success: TRUE
+ *    Failure: FALSE
+ */
+BOOL32 WINAPI ReadConsoleInputA( HANDLE32 hConsoleInput,
+                                 LPINPUT_RECORD lpBuffer,
+                                 DWORD nLength, LPDWORD lpNumberOfEventsRead)
+{
+    FIXME(console, "(%d,%p,%ld,%p): stub\n",hConsoleInput, lpBuffer, nLength,
+          lpNumberOfEventsRead);
+    return ReadConsole32A(hConsoleInput, lpBuffer, nLength, 
+                          lpNumberOfEventsRead, 0);
+}
+
+
 /***********************************************************************
  *            SetConsoleTitle32A   (KERNEL32.476)
  */
@@ -622,7 +722,7 @@
 	LPSTR titlestring; 
 	BOOL32 ret=FALSE;
 
-	TRACE(console,"SetConsoleTitle(%s)\n",title);
+	TRACE(console,"(%s)\n",title);
 	
 	console = (CONSOLE *)pdb->console;
 	if (!console)
@@ -645,8 +745,19 @@
 	return ret;
 }
 
-/***********************************************************************
- *            SetConsoleTitle32W   (KERNEL32.477)
+
+/******************************************************************************
+ * SetConsoleTitle32W [KERNEL32.477]  Sets title bar string for console
+ *
+ * PARAMS
+ *    title [I] Address of new title
+ *
+ * NOTES
+ *    This should not be calling the A version
+ *
+ * RETURNS
+ *    Success: TRUE
+ *    Failure: FALSE
  */
 BOOL32 WINAPI SetConsoleTitle32W( LPCWSTR title )
 {
@@ -658,6 +769,7 @@
     return ret;
 }
 
+
 /***********************************************************************
  *            FlushConsoleInputBuffer   (KERNEL32.132)
  */
@@ -667,26 +779,43 @@
     return TRUE;
 }
 
-BOOL32 WINAPI SetConsoleCursorPosition(HANDLE32 hcons,COORD c)
+
+/******************************************************************************
+ * SetConsoleCursorPosition [KERNEL32.627]
+ * Sets the cursor position in console
+ *
+ * PARAMS
+ *    hConsoleOutput   [I] Handle of console screen buffer
+ *    dwCursorPosition [I] New cursor position coordinates
+ *
+ * RETURNS STD
+ */
+BOOL32 WINAPI SetConsoleCursorPosition( HANDLE32 hConsoleOutput, 
+                                        COORD dwCursorPosition )
 {
+    TRACE(console, "%d (%d x %d)\n", hConsoleOutput, dwCursorPosition.x, 
+          dwCursorPosition.y);
     /* x are columns, y rows */
-    if (!c.y) {
+    if (!dwCursorPosition.y) {
     	fprintf(stderr,"\r");
-	if (c.x)
-		fprintf(stderr,"%c[%dC", 0x1B, c.x); /* note: 0x1b == ESC */
+	if (dwCursorPosition.x)
+            /* note: 0x1B == ESC */
+            fprintf(stderr,"%c[%dC", 0x1B, dwCursorPosition.x);
 	return TRUE;
     }
-    /* handle rest of the cases */
+    FIXME(console, "Unhandled case: y=%d\n", dwCursorPosition.y);
     return FALSE;
 }
 
+
 /***********************************************************************
  *            GetNumberOfConsoleInputEvents   (KERNEL32.246)
  */
 BOOL32 WINAPI GetNumberOfConsoleInputEvents(HANDLE32 hcon,LPDWORD nrofevents)
 {
-	*nrofevents = 0;
-	return TRUE;
+    *nrofevents = 0;
+    FIXME(console,"(%x): stub\n", hcon);
+    return TRUE;
 }
 
 /***********************************************************************
@@ -694,11 +823,12 @@
  */
 BOOL32 WINAPI GetNumberOfConsoleMouseButtons(LPDWORD nrofbuttons)
 {
+    FIXME(console,"(%p): stub\n", nrofbuttons);
     *nrofbuttons = 2;
-    FIXME(console,"(%p): STUB returning 2\n", nrofbuttons);
     return TRUE;
 }
 
+
 /***********************************************************************
  *            PeekConsoleInputA   (KERNEL32.550)
  */
@@ -710,10 +840,12 @@
     pirBuffer = NULL;
     cInRecords = 0;
     *lpcRead = 0;
-    FIXME(console,"(...): STUB returning TRUE\n");
-	return TRUE;
+    FIXME(console,"(%d,%p,%ld,%p): stub\n",hConsoleInput, pirBuffer,
+          cInRecords, lpcRead);
+    return TRUE;
 }
 
+
 /***********************************************************************
  *            PeekConsoleInputW   (KERNEL32.551)
  */
@@ -725,45 +857,169 @@
     pirBuffer = NULL;
     cInRecords = 0;
     *lpcRead = 0;
-    FIXME(console,"(...): STUB returning TRUE\n");
+    FIXME(console,"(%d,%p,%ld,%p): stub\n", hConsoleInput, pirBuffer,
+          cInRecords, lpcRead);
     return TRUE;
 }
 
-/***********************************************************************
- *            GetConsoleCursorInfo32   (KERNEL32.296)
+
+/******************************************************************************
+ * GetConsoleCursorInfo32 [KERNEL32.296]  Gets size and visibility of console
+ *
+ * PARAMS
+ *    hcon  [I] Handle to console screen buffer
+ *    cinfo [O] Address of cursor information
+ *
+ * RETURNS
+ *    Success: TRUE
+ *    Failure: FALSE
  */
-BOOL32 WINAPI GetConsoleCursorInfo32(HANDLE32 hcon, LPDWORD cinfo)
+BOOL32 WINAPI GetConsoleCursorInfo32( HANDLE32 hcon,
+                                      LPCONSOLE_CURSOR_INFO cinfo )
 {
-  cinfo[0] = 10; /* 10% of character box is cursor.  */
-  cinfo[1] = TRUE;  /* Cursor is visible.  */
-  FIXME(console, "(%x,%p): STUB!\n", hcon, cinfo);
-  return TRUE;
+    FIXME(console, "(%x,%p): stub\n", hcon, cinfo);
+    if (!cinfo) return FALSE;
+    cinfo->dwSize = 10;      /* 10% of character box is cursor.  */
+    cinfo->bVisible = TRUE;  /* Cursor is visible.  */
+    return TRUE;
 }
 
-/***********************************************************************
- *            SetConsoleCursorInfo32   (KERNEL32.626)
+
+/******************************************************************************
+ * SetConsoleCursorInfo32 [KERNEL32.626]  Sets size and visibility of cursor
+ *
+ * RETURNS
+ *    Success: TRUE
+ *    Failure: FALSE
  */
-BOOL32 WINAPI SetConsoleCursorInfo32(HANDLE32 hcon, LPDWORD cinfo)
+BOOL32 WINAPI SetConsoleCursorInfo32( 
+    HANDLE32 hcon,                /* [in] Handle to console screen buffer */
+    LPCONSOLE_CURSOR_INFO cinfo)  /* [in] Address of cursor information */
 {
-  FIXME(console, "(%#x,%p): STUB!\n", hcon, cinfo);
-  return TRUE;
+    FIXME(console, "(%x,%ld,%i): stub\n", hcon,cinfo->dwSize,cinfo->bVisible);
+    return TRUE;
 }
 
-/***********************************************************************
- *            SetConsoleWindowInfo32   (KERNEL32.634)
+
+/******************************************************************************
+ * SetConsoleWindowInfo [KERNEL32.634]  Sets size and position of console
+ *
+ * RETURNS
+ *    Success: TRUE
+ *    Failure: FALSE
  */
-BOOL32 WINAPI SetConsoleWindowInfo32(HANDLE32 hcon, BOOL32 flag, LPSMALL_RECT window)
+BOOL32 WINAPI SetConsoleWindowInfo(
+    HANDLE32 hcon,       /* [in] Handle to console screen buffer */
+    BOOL32 bAbsolute,    /* [in] Coordinate type flag */
+    LPSMALL_RECT window) /* [in] Address of new window rectangle */
 {
-  FIXME(console, "(%x,%d,%p): STUB!\n", hcon, flag, window);
-  return TRUE;
+    FIXME(console, "(%x,%d,%p): stub\n", hcon, bAbsolute, window);
+    return TRUE;
 }
 
-/***********************************************************************
- *               (KERNEL32.631)
+
+/******************************************************************************
+ * SetConsoleTextAttribute32 [KERNEL32.631]  Sets colors for text
+ *
+ * Sets the foreground and background color attributes of characters
+ * written to the screen buffer.
+ *
+ * RETURNS
+ *    Success: TRUE
+ *    Failure: FALSE
  */
-BOOL32 WINAPI SetConsoleTextAttribute32(HANDLE32 hcon, DWORD attributes)
+BOOL32 WINAPI SetConsoleTextAttribute32(
+    HANDLE32 hcon,    /* [in] Handle to console screen buffer */
+    DWORD attributes) /* [in] Text and background colors */
 {
-  FIXME(console, "(%#x,%#lx): STUB!\n", hcon, attributes);
-  return TRUE;
+    FIXME(console, "(%x,%lx): stub\n", hcon, attributes);
+    return TRUE;
+}
+
+
+/******************************************************************************
+ * SetConsoleScreenBufferSize [KERNEL32.630]  Changes size of console 
+ *
+ * PARAMS
+ *    hConsoleOutput [I] Handle to console screen buffer
+ *    dwSize         [I] New size in character rows and cols
+ *
+ * RETURNS
+ *    Success: TRUE
+ *    Failure: FALSE
+ */
+BOOL32 WINAPI SetConsoleScreenBufferSize( HANDLE32 hConsoleOutput, 
+                                          COORD dwSize )
+{
+    FIXME(console, "(%d,%dx%d): stub\n",hConsoleOutput,dwSize.x,dwSize.y);
+    return TRUE;
+}
+
+
+/******************************************************************************
+ * FillConsoleOutputCharacterA [KERNEL32.242]
+ */
+BOOL32 WINAPI FillConsoleOutputCharacterA(
+    HANDLE32 hConsoleOutput,
+    CHAR cCharacter,
+    DWORD nLength,
+    COORD dwWriteCoord,
+    LPDWORD lpNumberOfCharsWritten)
+{
+    FIXME(console, "(%d,%c,%ld,%dx%d,%p): stub\n", hConsoleOutput,cCharacter,
+          nLength,dwWriteCoord.x,dwWriteCoord.y,lpNumberOfCharsWritten);
+    *lpNumberOfCharsWritten = 0;
+    return TRUE;
+}
+
+
+/******************************************************************************
+ * FillConsoleOutputCharacterW [KERNEL32.243]  Writes characters to console
+ *
+ * PARAMS
+ *    hConsoleOutput    [I] Handle to screen buffer
+ *    cCharacter        [I] Character to write
+ *    nLength           [I] Number of cells to write to
+ *    dwCoord           [I] Coords of first cell
+ *    lpNumCharsWritten [O] Pointer to number of cells written
+ *
+ * RETURNS
+ *    Success: TRUE
+ *    Failure: FALSE
+ */
+BOOL32 WINAPI FillConsoleOutputCharacterW( HANDLE32 hConsoleOutput,
+                                           WCHAR cCharacter, DWORD nLength,
+                                           COORD dwCoord, 
+                                           LPDWORD lpNumCharsWritten )
+{
+    FIXME(console, "(%d,%c,%ld,%dx%d,%p): stub\n", hConsoleOutput,
+          cCharacter,nLength,dwCoord.x,dwCoord.y,lpNumCharsWritten);
+    *lpNumCharsWritten = 0;
+    return TRUE;
+}
+
+
+/******************************************************************************
+ * FillConsoleOutputAttribute [KERNEL32.241]  Sets attributes for console
+ *
+ * PARAMS
+ *    hConsoleOutput    [I] Handle to screen buffer
+ *    wAttribute        [I] Color attribute to write
+ *    nLength           [I] Number of cells to write to
+ *    dwCoord           [I] Coords of first cell
+ *    lpNumAttrsWritten [O] Pointer to number of cells written
+ *
+ * RETURNS
+ *    Success: TRUE
+ *    Failure: FALSE
+ */
+BOOL32 WINAPI FillConsoleOutputAttribute( HANDLE32 hConsoleOutput, 
+              WORD wAttribute, DWORD nLength, COORD dwCoord, 
+              LPDWORD lpNumAttrsWritten)
+{
+    FIXME(console, "(%d,%d,%ld,%dx%d,%p): stub\n", hConsoleOutput,
+          wAttribute,nLength,dwCoord.x,dwCoord.y,lpNumAttrsWritten);
+    *lpNumAttrsWritten = nLength;
+    return TRUE;
 }
 
diff --git a/win32/file.c b/win32/file.c
index c0eb932..c999fb3 100644
--- a/win32/file.c
+++ b/win32/file.c
@@ -283,17 +283,20 @@
  */
 VOID WINAPI SetFileApisToANSI(void)
 {
-    /*FIXME(file,"(): stub!\n");*/
+    /*FIXME(file,"(): stub\n");*/
 }
 
 
-/**************************************************************************
- *              AreFileApisANSI   (KERNEL32.105)
+/******************************************************************************
+ * AreFileApisANSI [KERNEL32.105]  Determines if file functions are using ANSI
+ *
+ * RETURNS
+ *    TRUE:  Set of file functions is using ANSI code page
+ *    FALSE: Set of file functions is using OEM code page
  */
 BOOL32 WINAPI AreFileApisANSI(void)
 {
-    FIXME(file,"(): stub!\n");
+    FIXME(file,"(void): stub\n");
     return TRUE;
 }
 
-
diff --git a/win32/newfns.c b/win32/newfns.c
index 3e6b9fd..ed0aa9d 100644
--- a/win32/newfns.c
+++ b/win32/newfns.c
@@ -14,6 +14,7 @@
 #include "windows.h"
 #include "winnt.h"
 #include "winerror.h"
+#include "heap.h"
 #include "debug.h"
 
 /****************************************************************************
@@ -108,7 +109,10 @@
 				  DWORD nDafaultTimeOut,
 				  LPSECURITY_ATTRIBUTES lpSecurityAttributes)
 {
-  FIXME (win32, "CreateNamedPipeA: stub\n");
+  FIXME (win32, "(Name=%s, OpenMode=%#08x, dwPipeMode=%#08x, MaxInst=%d, OutBSize=%d, InBuffSize=%d, DefTimeOut=%d, SecAttr=%p): stub\n",
+	 debugstr_a(lpName), dwOpenMode, dwPipeMode, nMaxInstances,
+	 nOutBufferSize, nInBufferSize, nDafaultTimeOut, 
+	 lpSecurityAttributes);
   /* if (nMaxInstances > PIPE_UNLIMITED_INSTANCES) {
     SetLastError (ERROR_INVALID_PARAMETER);
     return INVALID_HANDLE_VALUE;
@@ -127,7 +131,10 @@
 				  DWORD nDafaultTimeOut,
 				  LPSECURITY_ATTRIBUTES lpSecurityAttributes)
 {
-  FIXME (win32, "CreateNamedPipeW: stub\n");
+  FIXME (win32, "(Name=%s, OpenMode=%#08x, dwPipeMode=%#08x, MaxInst=%d, OutBSize=%d, InBuffSize=%d, DefTimeOut=%d, SecAttr=%p): stub\n",
+	 debugstr_w(lpName), dwOpenMode, dwPipeMode, nMaxInstances,
+	 nOutBufferSize, nInBufferSize, nDafaultTimeOut, 
+	 lpSecurityAttributes);
 
   SetLastError (ERROR_UNKNOWN);
   return INVALID_HANDLE_VALUE32;
@@ -163,26 +170,190 @@
     return TRUE;
 }
 
-/**************************************************************************
- *              GetNumberFormat32A	(KERNEL32.355)
+
+/******************************************************************************
+ * CreateMailslot32A [KERNEL32.164]
  */
-INT32 WINAPI GetNumberFormat32A(LCID locale, DWORD dwflags,
-			       LPCSTR lpvalue,  char *lpFormat,
-			       LPSTR lpNumberStr, int cchNumber)
-/* NOTE: type of lpFormat should be CONST NUMBERFORMAT */
-
+HANDLE32 WINAPI CreateMailslot32A( LPCSTR lpName, DWORD nMaxMessageSize,
+                                   DWORD lReadTimeout, LPSECURITY_ATTRIBUTES sa)
 {
- int n;
-
- FIXME(file,"%s: stub, no reformating done\n",lpvalue);
-
- n = strlen(lpvalue);
- if (cchNumber) { 
-   strncpy(lpNumberStr,lpvalue,cchNumber);
-   if (cchNumber <= n) {
-     lpNumberStr[cchNumber-1] = 0;
-     n = cchNumber-1;
-   }
- }
- return n;
+    FIXME(win32, "(%s,%ld,%ld,%p): stub\n", debugstr_a(lpName),
+          nMaxMessageSize, lReadTimeout, sa);
+    return 1;
 }
+
+
+/******************************************************************************
+ * CreateMailslot32W [KERNEL32.165]  Creates a mailslot with specified name
+ * 
+ * PARAMS
+ *    lpName          [I] Pointer to string for mailslot name
+ *    nMaxMessageSize [I] Maximum message size
+ *    lReadTimeout    [I] Milliseconds before read time-out
+ *    sa              [I] Pointer to security structure
+ *
+ * RETURNS
+ *    Success: Handle to mailslot
+ *    Failure: INVALID_HANDLE_VALUE
+ */
+HANDLE32 WINAPI CreateMailslot32W( LPCWSTR lpName, DWORD nMaxMessageSize,
+                                   DWORD lReadTimeout, LPSECURITY_ATTRIBUTES sa )
+{
+    FIXME(win32, "(%s,%ld,%ld,%p): stub\n", debugstr_w(lpName), 
+          nMaxMessageSize, lReadTimeout, sa);
+    return 1;
+}
+
+
+/******************************************************************************
+ * GetMailslotInfo [KERNEL32.347]  Retrieves info about specified mailslot
+ *
+ * PARAMS
+ *    hMailslot        [I] Mailslot handle
+ *    lpMaxMessageSize [O] Address of maximum message size
+ *    lpNextSize       [O] Address of size of next message
+ *    lpMessageCount   [O] Address of number of messages
+ *    lpReadTimeout    [O] Address of read time-out
+ * 
+ * RETURNS
+ *    Success: TRUE
+ *    Failure: FALSE
+ */
+BOOL32 WINAPI GetMailslotInfo( HANDLE32 hMailslot, LPDWORD lpMaxMessageSize,
+                               LPDWORD lpNextSize, LPDWORD lpMessageCount,
+                               LPDWORD lpReadTimeout )
+{
+    FIXME(win32, "(%d): stub\n",hMailslot);
+    *lpMaxMessageSize = NULL;
+    *lpNextSize = NULL;
+    *lpMessageCount = NULL;
+    *lpReadTimeout = NULL;
+    return TRUE;
+}
+
+
+/******************************************************************************
+ * GetCompressedFileSize32A [KERNEL32.291]
+ *
+ * NOTES
+ *    This should call the W function below
+ */
+DWORD WINAPI GetCompressedFileSize32A(
+    LPCSTR lpFileName,
+    LPDWORD lpFileSizeHigh)
+{
+    FIXME(win32, "(...): stub\n");
+    return 0xffffffff;
+}
+
+
+/******************************************************************************
+ * GetCompressedFileSize32W [KERNEL32.292]  
+ * 
+ * RETURNS
+ *    Success: Low-order doubleword of number of bytes
+ *    Failure: 0xffffffff
+ */
+DWORD WINAPI GetCompressedFileSize32W(
+    LPCWSTR lpFileName,     /* [in]  Pointer to name of file */
+    LPDWORD lpFileSizeHigh) /* [out] Receives high-order doubleword of size */
+{
+    FIXME(win32, "(%s,%p): stub\n",debugstr_w(lpFileName),lpFileSizeHigh);
+    return 0xffffffff;
+}
+
+
+/******************************************************************************
+ * GetProcessWindowStation [USER32.280]  Returns handle of window station
+ *
+ * NOTES
+ *    Docs say the return value is HWINSTA
+ *
+ * RETURNS
+ *    Success: Handle to window station associated with calling process
+ *    Failure: NULL
+ */
+DWORD WINAPI GetProcessWindowStation(void)
+{
+    FIXME(win32, "(void): stub\n");
+    return 1;
+}
+
+
+/******************************************************************************
+ * GetThreadDesktop [USER32.295]  Returns handle to desktop
+ *
+ * NOTES
+ *    Docs say the return value is HDESK
+ *
+ * PARAMS
+ *    dwThreadId [I] Thread identifier
+ *
+ * RETURNS
+ *    Success: Handle to desktop associated with specified thread
+ *    Failure: NULL
+ */
+DWORD WINAPI GetThreadDesktop( DWORD dwThreadId )
+{
+    FIXME(win32, "(%ld): stub\n",dwThreadId);
+    return 1;
+}
+
+
+/******************************************************************************
+ * SetDebugErrorLevel [USER32.475]
+ * Sets the minimum error level for generating debugging events
+ *
+ * PARAMS
+ *    dwLevel [I] Debugging error level
+ */
+VOID WINAPI SetDebugErrorLevel( DWORD dwLevel )
+{
+    FIXME(win32, "(%ld): stub\n", dwLevel);
+}
+
+
+/******************************************************************************
+ * WaitForDebugEvent [KERNEL32.720]
+ * Waits for a debugging event to occur in a process being debugged
+ *
+ * PARAMS
+ *    lpDebugEvent   [I] Address of structure for event information
+ *    dwMilliseconds [I] Number of milliseconds to wait for event
+ *
+ * RETURNS STD
+ */
+BOOL32 WINAPI WaitForDebugEvent( LPDEBUG_EVENT lpDebugEvent, 
+                                 DWORD dwMilliseconds )
+{
+    FIXME(win32, "(%p,%ld): stub\n", lpDebugEvent, dwMilliseconds);
+    return TRUE;
+}
+
+
+/******************************************************************************
+ * SetComputerName32A [KERNEL32.621]  
+ */
+BOOL32 WINAPI SetComputerName32A( LPCSTR lpComputerName )
+{
+    LPWSTR lpComputerNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpComputerName);
+    BOOL32 ret = SetComputerName32W(lpComputerNameW);
+    HeapFree(GetProcessHeap(),0,lpComputerNameW);
+    return ret;
+}
+
+
+/******************************************************************************
+ * SetComputerName32W [KERNEL32.622]
+ *
+ * PARAMS
+ *    lpComputerName [I] Address of new computer name
+ * 
+ * RETURNS STD
+ */
+BOOL32 WINAPI SetComputerName32W( LPCWSTR lpComputerName )
+{
+    FIXME(win32, "(%s): stub\n", debugstr_w(lpComputerName));
+    return TRUE;
+}
+
diff --git a/win32/ordinals.c b/win32/ordinals.c
index 7d94d54..6aa184a 100644
--- a/win32/ordinals.c
+++ b/win32/ordinals.c
@@ -20,16 +20,18 @@
 static CRITICAL_SECTION Win16Mutex;
 static SEGPTR segWin16Mutex = NULL;
 
+
 /***********************************************
  *           GetPWinLock    (KERNEL32.93)
  * Return the infamous Win16Mutex.
  */
 VOID WINAPI GetPWinLock(CRITICAL_SECTION **lock)
 {
-        fprintf(stderr,"GetPWinlock(%p)\n",lock);
-        *lock = &Win16Mutex;
+    FIXME(win32, "(%p)\n",lock);
+    *lock = &Win16Mutex;
 }
 
+
 /**********************************************************************
  *           WOW32_1        (KERNEL32.88)
  */