Removed some of the calls to HEAP_strdup* functions.

diff --git a/dlls/ddraw/main.c b/dlls/ddraw/main.c
index 54af188..d309d9b 100644
--- a/dlls/ddraw/main.c
+++ b/dlls/ddraw/main.c
@@ -14,15 +14,15 @@
 #include <string.h>
 #include <stdlib.h>
 
+#include "winnls.h"
 #include "winerror.h"
-#include "debugtools.h"
-#include "heap.h"
 
 #include "ddraw.h"
 #include "d3d.h"
 
 /* This for all the enumeration and creation of D3D-related objects */
 #include "ddraw_private.h"
+#include "debugtools.h"
 
 #define MAX_DDRAW_DRIVERS 3
 static const ddraw_driver* DDRAW_drivers[MAX_DDRAW_DRIVERS];
@@ -93,14 +93,21 @@
     GUID *lpGUID, LPSTR lpDriverDescription, LPSTR lpDriverName, 
     LPVOID lpContext, HMONITOR hm)
 {
+    INT len;
+    BOOL bResult;
+    LPWSTR lpDriverDescriptionW, lpDriverNameW;
     DirectDrawEnumerateProcData *pEPD = (DirectDrawEnumerateProcData*)lpContext;
-    LPWSTR lpDriverDescriptionW =
-	HEAP_strdupAtoW(GetProcessHeap(), 0, lpDriverDescription);
-    LPWSTR lpDriverNameW =
-	HEAP_strdupAtoW(GetProcessHeap(), 0, lpDriverName);
 
-    BOOL bResult = (*(LPDDENUMCALLBACKEXW *) pEPD->lpCallback)(
-	lpGUID, lpDriverDescriptionW, lpDriverNameW, pEPD->lpContext, hm);
+    len = MultiByteToWideChar( CP_ACP, 0, lpDriverDescription, -1, NULL, 0 );
+    lpDriverDescriptionW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
+    MultiByteToWideChar( CP_ACP, 0, lpDriverDescription, -1, lpDriverDescriptionW, len );
+
+    len = MultiByteToWideChar( CP_ACP, 0, lpDriverName, -1, NULL, 0 );
+    lpDriverNameW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
+    MultiByteToWideChar( CP_ACP, 0, lpDriverName, -1, lpDriverNameW, len );
+
+    bResult = (*(LPDDENUMCALLBACKEXW *) pEPD->lpCallback)(lpGUID, lpDriverDescriptionW,
+                                                          lpDriverNameW, pEPD->lpContext, hm);
 
     HeapFree(GetProcessHeap(), 0, lpDriverDescriptionW);
     HeapFree(GetProcessHeap(), 0, lpDriverNameW);
diff --git a/dlls/mpr/wnet.c b/dlls/mpr/wnet.c
index 0297c08..3b7e799 100644
--- a/dlls/mpr/wnet.c
+++ b/dlls/mpr/wnet.c
@@ -9,8 +9,8 @@
 #include <unistd.h>
 
 #include "winbase.h"
+#include "winnls.h"
 #include "winnetwk.h"
-#include "heap.h"
 #include "debugtools.h"
 
 DEFAULT_DEBUG_CHANNEL(mpr);
@@ -369,9 +369,12 @@
                                  LPWSTR lpRemoteName, LPDWORD lpBufferSize )
 {
     CHAR  buf[200];
-    DWORD x = sizeof(buf);
-    LPSTR lnA = HEAP_strdupWtoA( GetProcessHeap(), 0, lpLocalName );
-    DWORD ret = WNetGetConnectionA( lnA, buf, &x );
+    DWORD ret, x = sizeof(buf);
+    INT len = WideCharToMultiByte( CP_ACP, 0, lpLocalName, -1, NULL, 0, NULL, NULL );
+    LPSTR lnA = HeapAlloc( GetProcessHeap(), 0, len );
+
+    WideCharToMultiByte( CP_ACP, 0, lpLocalName, -1, lnA, len, NULL, NULL );
+    ret = WNetGetConnectionA( lnA, buf, &x );
     HeapFree( GetProcessHeap(), 0, lnA );
     if (ret == WN_SUCCESS)
     {
diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c
index 5ec5868..6095ac5 100644
--- a/dlls/ole32/compobj.c
+++ b/dlls/ole32/compobj.c
@@ -24,7 +24,7 @@
 #include "winreg.h"
 #include "wownt32.h"
 #include "wtypes.h"
-
+#include "wine/unicode.h"
 #include "wine/obj_base.h"
 #include "wine/obj_clientserver.h"
 #include "wine/obj_misc.h"
@@ -33,7 +33,6 @@
 #include "wine/winbase16.h"
 #include "compobj_private.h"
 #include "ifs.h"
-#include "heap.h"
 
 #include "debugtools.h"
 
@@ -538,12 +537,14 @@
  */
 HRESULT WINAPI CLSIDFromString(
 	LPCOLESTR idstr,	/* [in] string representation of GUID */
-	CLSID *id		/* [out] GUID represented by above string */
-) {
-    LPOLESTR16      xid = HEAP_strdupWtoA(GetProcessHeap(),0,idstr);
-    HRESULT       ret = CLSIDFromString16(xid,id);
+	CLSID *id )		/* [out] GUID represented by above string */
+{
+    char xid[40];
+    HRESULT ret;
 
-    HeapFree(GetProcessHeap(),0,xid);
+    if (!WideCharToMultiByte( CP_ACP, 0, idstr, -1, xid, sizeof(xid), NULL, NULL ))
+        return CO_E_CLASSSTRING;
+    ret = CLSIDFromString16(xid,id);
     if(ret != S_OK) { /* It appears a ProgID is also valid */
         ret = CLSIDFromProgID(idstr, id);
     }
@@ -774,13 +775,30 @@
  */
 HRESULT WINAPI CLSIDFromProgID(
 	LPCOLESTR progid,	/* [in] program id as found in registry */
-	LPCLSID riid		/* [out] associated CLSID */
-) {
-	LPOLESTR16 pid = HEAP_strdupWtoA(GetProcessHeap(),0,progid);
-	HRESULT       ret = CLSIDFromProgID16(pid,riid);
+	LPCLSID riid )		/* [out] associated CLSID */
+{
+    static const WCHAR clsidW[] = { '\\','C','L','S','I','D',0 };
+    char buf2[80];
+    DWORD buf2len = sizeof(buf2);
+    HKEY xhkey;
 
-	HeapFree(GetProcessHeap(),0,pid);
-	return ret;
+    WCHAR *buf = HeapAlloc( GetProcessHeap(),0,(strlenW(progid)+8) * sizeof(WCHAR) );
+    strcpyW( buf, progid );
+    strcatW( buf, clsidW );
+    if (RegOpenKeyW(HKEY_CLASSES_ROOT,buf,&xhkey))
+    {
+        HeapFree(GetProcessHeap(),0,buf);
+        return CO_E_CLASSSTRING;
+    }
+    HeapFree(GetProcessHeap(),0,buf);
+
+    if (RegQueryValueA(xhkey,NULL,buf2,&buf2len))
+    {
+        RegCloseKey(xhkey);
+        return CO_E_CLASSSTRING;
+    }
+    RegCloseKey(xhkey);
+    return CLSIDFromString16(buf2,riid);
 }
 
 
diff --git a/dlls/oleaut32/hash.c b/dlls/oleaut32/hash.c
index c0adf4e..949aea8 100644
--- a/dlls/oleaut32/hash.c
+++ b/dlls/oleaut32/hash.c
@@ -10,10 +10,10 @@
 #include "winbase.h"
 #include "wingdi.h"
 #include "winuser.h"
-#include "debugtools.h"
+#include "winnls.h"
 #include "ole2.h"
 #include "olectl.h"
-#include "heap.h"
+#include "debugtools.h"
 
 DEFAULT_DEBUG_CHANNEL(ole);
 
@@ -233,9 +233,12 @@
 {
     LPSTR	strA;
     ULONG	res;
+    INT len;
 
     if (!str) return 0;
-    strA = HEAP_strdupWtoA(GetProcessHeap(), 0, str);
+    len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL );
+    strA = HeapAlloc( GetProcessHeap(), 0, len );
+    WideCharToMultiByte( CP_ACP, 0, str, -1, strA, len, NULL, NULL );
     res = LHashValOfNameSysA(skind, lcid, strA);
     HeapFree(GetProcessHeap(), 0, strA);
     return res;
diff --git a/dlls/oleaut32/olefont.c b/dlls/oleaut32/olefont.c
index 556db6c..cbab75f 100644
--- a/dlls/oleaut32/olefont.c
+++ b/dlls/oleaut32/olefont.c
@@ -20,7 +20,6 @@
 #include "ole2.h"
 #include "olectl.h"
 #include "debugtools.h"
-#include "heap.h"
 #include "connpt.h" /* for CreateConnectionPoint */
 
 DEFAULT_DEBUG_CHANNEL(ole);
@@ -1335,6 +1334,7 @@
   BYTE  bVersion;
   BYTE  bAttributes;
   BYTE  bStringSize;
+  INT len;
 
   _ICOM_THIS_From_IPersistStream(OLEFontImpl, iface);
   
@@ -1393,7 +1393,6 @@
   if (cbRead!=1)
     return E_FAIL;
 
-  memset(readBuffer, 0, 0x100);
   IStream_Read(pLoadStream, readBuffer, bStringSize, &cbRead);
 
   if (cbRead!=bStringSize)
@@ -1402,9 +1401,10 @@
   if (this->description.lpstrName!=0)
     HeapFree(GetProcessHeap(), 0, this->description.lpstrName);
 
-  this->description.lpstrName = HEAP_strdupAtoW(GetProcessHeap(), 
-						    HEAP_ZERO_MEMORY,
-						    readBuffer);
+  len = MultiByteToWideChar( CP_ACP, 0, readBuffer, bStringSize, NULL, 0 );
+  this->description.lpstrName = HeapAlloc( GetProcessHeap(), 0, (len+1) * sizeof(WCHAR) );
+  MultiByteToWideChar( CP_ACP, 0, readBuffer, bStringSize, this->description.lpstrName, len );
+  this->description.lpstrName[len] = 0;
 
   return S_OK;
 }
@@ -1482,7 +1482,8 @@
    * FontName
    */
   if (this->description.lpstrName!=0)
-    bStringSize = lstrlenW(this->description.lpstrName);
+    bStringSize = WideCharToMultiByte( CP_ACP, 0, this->description.lpstrName,
+                                       strlenW(this->description.lpstrName), NULL, 0, NULL, NULL );
   else
     bStringSize = 0;
 
@@ -1493,15 +1494,12 @@
 
   if (bStringSize!=0)
   {
-    writeBuffer = HEAP_strdupWtoA(GetProcessHeap(), 
-				  HEAP_ZERO_MEMORY,
-				  this->description.lpstrName);
-
-    if (writeBuffer==0)
-      return E_OUTOFMEMORY;
+      if (!(writeBuffer = HeapAlloc( GetProcessHeap(), 0, bStringSize ))) return E_OUTOFMEMORY;
+      WideCharToMultiByte( CP_ACP, 0, this->description.lpstrName,
+                           strlenW(this->description.lpstrName),
+                           writeBuffer, bStringSize, NULL, NULL );
 
     IStream_Write(pOutStream, writeBuffer, bStringSize, &cbWritten);
-    
     HeapFree(GetProcessHeap(), 0, writeBuffer);
 
     if (cbWritten!=bStringSize)
diff --git a/dlls/user/exticon.c b/dlls/user/exticon.c
index 1000a03..d24695d 100644
--- a/dlls/user/exticon.c
+++ b/dlls/user/exticon.c
@@ -20,7 +20,6 @@
 #include "winuser.h"
 #include "wine/winbase16.h"
 #include "cursoricon.h"
-#include "heap.h"
 #include "debugtools.h"
 
 DEFAULT_DEBUG_CHANNEL(icon);
@@ -572,8 +571,10 @@
 	DWORD y )	/* [in] NOTE: 0x80 */
 {
 	DWORD ret;
-	LPWSTR lpwstrFile = HEAP_strdupAtoW(GetProcessHeap(), 0, lpstrFile);
-	
+        INT len = MultiByteToWideChar( CP_ACP, 0, lpstrFile, -1, NULL, 0 );
+        LPWSTR lpwstrFile = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
+
+        MultiByteToWideChar( CP_ACP, 0, lpstrFile, -1, lpwstrFile, len );
 	ret = PrivateExtractIconsW(
 		lpwstrFile, nIndex, sizeX, sizeY, phicon, w, nIcons, y
 	);
@@ -649,13 +650,13 @@
 	UINT nIcons )
 {
 	DWORD ret;
-	LPWSTR lpwstrFile = HEAP_strdupAtoW(GetProcessHeap(), 0, lpstrFile);
+        INT len = MultiByteToWideChar( CP_ACP, 0, lpstrFile, -1, NULL, 0 );
+        LPWSTR lpwstrFile = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
 
-	TRACE("%s 0x%08lx %p %p 0x%08x\n",
-	lpstrFile, nIndex, phIconLarge, phIconSmall, nIcons);
+	TRACE("%s 0x%08lx %p %p 0x%08x\n", lpstrFile, nIndex, phIconLarge, phIconSmall, nIcons);
 
+        MultiByteToWideChar( CP_ACP, 0, lpstrFile, -1, lpwstrFile, len );
 	ret = PrivateExtractIconExW(lpwstrFile,nIndex,phIconLarge, phIconSmall, nIcons);
-
 	HeapFree(GetProcessHeap(), 0, lpwstrFile);
 	return ret;
 }
diff --git a/dlls/user/resource.c b/dlls/user/resource.c
index 8d819e6..6669f94 100644
--- a/dlls/user/resource.c
+++ b/dlls/user/resource.c
@@ -11,8 +11,6 @@
 #include "winnls.h"
 #include "wine/winbase16.h"
 #include "wine/winuser16.h"
-
-#include "heap.h"
 #include "debugtools.h"
 
 DEFAULT_DEBUG_CHANNEL(resource);
@@ -99,15 +97,20 @@
  */
 HACCEL WINAPI LoadAcceleratorsA(HINSTANCE instance,LPCSTR lpTableName)
 {
-	LPWSTR	 uni;
-	HACCEL result;
-	if (HIWORD(lpTableName))
-		uni = HEAP_strdupAtoW( GetProcessHeap(), 0, lpTableName );
-	else
-		uni = (LPWSTR)lpTableName;
-	result = LoadAcceleratorsW(instance,uni);
-	if (HIWORD(uni)) HeapFree( GetProcessHeap(), 0, uni);
-	return result;
+    INT len;
+    LPWSTR uni;
+    HACCEL result = 0;
+
+    if (!HIWORD(lpTableName)) return LoadAcceleratorsW( instance, (LPCWSTR)lpTableName );
+
+    len = MultiByteToWideChar( CP_ACP, 0, lpTableName, -1, NULL, 0 );
+    if ((uni = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
+    {
+        MultiByteToWideChar( CP_ACP, 0, lpTableName, -1, uni, len );
+        result = LoadAcceleratorsW(instance,uni);
+        HeapFree( GetProcessHeap(), 0, uni);
+    }
+    return result;
 }
 
 /**********************************************************************
diff --git a/files/change.c b/files/change.c
index 1137cbb..a7a4cd0 100644
--- a/files/change.c
+++ b/files/change.c
@@ -16,7 +16,6 @@
 #include <time.h>
 #include "winbase.h"
 #include "winerror.h"
-#include "heap.h"
 #include "wine/server.h"
 #include "debugtools.h"
 
@@ -49,10 +48,17 @@
                                                 BOOL bWatchSubtree,
                                                 DWORD dwNotifyFilter) 
 {
-    LPSTR nameA = HEAP_strdupWtoA( GetProcessHeap(), 0, lpPathName );
-    HANDLE ret = FindFirstChangeNotificationA( nameA, bWatchSubtree, 
-                                                          dwNotifyFilter );
-    if (nameA) HeapFree( GetProcessHeap(), 0, nameA );
+    HANDLE ret = INVALID_HANDLE_VALUE;
+
+    FIXME("this is not supported yet (non-trivial).\n");
+
+    SERVER_START_REQ( create_change_notification )
+    {
+        req->subtree = bWatchSubtree;
+        req->filter  = dwNotifyFilter;
+        if (!wine_server_call_err( req )) ret = reply->handle;
+    }
+    SERVER_END_REQ;
     return ret;
 }
 
diff --git a/graphics/enhmetafiledrv/init.c b/graphics/enhmetafiledrv/init.c
index fceee3c..2ef4444 100644
--- a/graphics/enhmetafiledrv/init.c
+++ b/graphics/enhmetafiledrv/init.c
@@ -9,7 +9,6 @@
 #include "windef.h"
 #include "wingdi.h"
 #include "gdi.h"
-#include "heap.h"
 #include "enhmetafiledrv.h"
 #include "debugtools.h"
 
@@ -212,9 +211,12 @@
     HDC hReturnDC;
     DWORD len1, len2, total;
 
-    if(filename) 
-        filenameW = HEAP_strdupAtoW( GetProcessHeap(), 0, filename );
-
+    if(filename)
+    {
+        total = MultiByteToWideChar( CP_ACP, 0, filename, -1, NULL, 0 );
+        filenameW = HeapAlloc( GetProcessHeap(), 0, total * sizeof(WCHAR) );
+        MultiByteToWideChar( CP_ACP, 0, filename, -1, filenameW, total );
+    }
     if(description) {
         len1 = strlen(description);
 	len2 = strlen(description + len1 + 1);
diff --git a/graphics/metafiledrv/init.c b/graphics/metafiledrv/init.c
index bde28d9..797a26b 100644
--- a/graphics/metafiledrv/init.c
+++ b/graphics/metafiledrv/init.c
@@ -7,7 +7,6 @@
 #include "windef.h"
 #include "wine/winbase16.h"
 #include "gdi.h"
-#include "heap.h"
 #include "metafile.h"
 #include "metafiledrv.h"
 #include "debugtools.h"
@@ -241,9 +240,12 @@
 HDC WINAPI CreateMetaFileW(LPCWSTR filename)
 {
     LPSTR filenameA;
+    DWORD len;
     HDC hReturnDC;
 
-    filenameA = HEAP_strdupWtoA( GetProcessHeap(), 0, filename );
+    len = WideCharToMultiByte( CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL );
+    filenameA = HeapAlloc( GetProcessHeap(), 0, len );
+    WideCharToMultiByte( CP_ACP, 0, filename, -1, filenameA, len, NULL, NULL );
 
     hReturnDC = CreateMetaFileA(filenameA);
 
diff --git a/loader/pe_resource.c b/loader/pe_resource.c
index 4fac376..12f1455 100644
--- a/loader/pe_resource.c
+++ b/loader/pe_resource.c
@@ -20,7 +20,6 @@
 #include "winnls.h"
 #include "winerror.h"
 #include "module.h"
-#include "heap.h"
 #include "stackframe.h"
 #include "debugtools.h"
 
@@ -143,6 +142,7 @@
 {
     const IMAGE_RESOURCE_DIRECTORY *ret = NULL;
     LPWSTR nameW;
+    INT len;
 
     if (!HIWORD(name)) return find_entry_by_id( dir, LOWORD(name), root );
     if (name[0] == '#')
@@ -150,8 +150,10 @@
         return find_entry_by_id( dir, atoi(name+1), root );
     }
 
-    if ((nameW = HEAP_strdupAtoW( GetProcessHeap(), 0, name )))
+    len = MultiByteToWideChar( CP_ACP, 0, name, -1, NULL, 0 );
+    if ((nameW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
     {
+        MultiByteToWideChar( CP_ACP, 0, name, -1, nameW, len );
         ret = find_entry_by_nameW( dir, nameW, root );
         HeapFree( GetProcessHeap(), 0, nameW );
     }
diff --git a/misc/registry.c b/misc/registry.c
index 4cfed5d..a6e397c 100644
--- a/misc/registry.c
+++ b/misc/registry.c
@@ -38,10 +38,10 @@
 #include "winreg.h"
 
 #include "wine/winbase16.h"
-#include "file.h"
-#include "heap.h"
-#include "options.h"
 #include "wine/server.h"
+#include "wine/unicode.h"
+#include "file.h"
+#include "options.h"
 
 #include "debugtools.h"
 
@@ -1604,42 +1604,6 @@
 
 
 /******************************************************************************
- * RegRestoreKeyW [ADVAPI32.@]
- *
- * PARAMS
- *    hkey    [I] Handle of key where restore begins
- *    lpFile  [I] Address of filename containing saved tree
- *    dwFlags [I] Optional flags
- */
-LONG WINAPI RegRestoreKeyW( HKEY hkey, LPCWSTR lpFile, DWORD dwFlags )
-{
-    TRACE("(%x,%s,%ld)\n",hkey,debugstr_w(lpFile),dwFlags);
-
-    /* It seems to do this check before the hkey check */
-    if (!lpFile || !*lpFile)
-        return ERROR_INVALID_PARAMETER;
-
-    FIXME("(%x,%s,%ld): stub\n",hkey,debugstr_w(lpFile),dwFlags);
-
-    /* Check for file existence */
-
-    return ERROR_SUCCESS;
-}
-
-
-/******************************************************************************
- * RegRestoreKeyA [ADVAPI32.@]
- */
-LONG WINAPI RegRestoreKeyA( HKEY hkey, LPCSTR lpFile, DWORD dwFlags )
-{
-    LPWSTR lpFileW = HEAP_strdupAtoW( GetProcessHeap(), 0, lpFile );
-    LONG ret = RegRestoreKeyW( hkey, lpFileW, dwFlags );
-    HeapFree( GetProcessHeap(), 0, lpFileW );
-    return ret;
-}
-
-
-/******************************************************************************
  * RegReplaceKeyA [ADVAPI32.@]
  */
 LONG WINAPI RegReplaceKeyA( HKEY hkey, LPCSTR lpSubKey, LPCSTR lpNewFile,
diff --git a/objects/metafile.c b/objects/metafile.c
index b6b917a..ffa003f 100644
--- a/objects/metafile.c
+++ b/objects/metafile.c
@@ -39,7 +39,6 @@
 #include "wine/wingdi16.h"
 #include "bitmap.h"
 #include "global.h"
-#include "heap.h"
 #include "metafile.h"
 
 #include "debugtools.h"
@@ -436,9 +435,16 @@
 HMETAFILE WINAPI CopyMetaFileW( HMETAFILE hSrcMetaFile,
                                     LPCWSTR lpFilename )
 {
-    LPSTR p = HEAP_strdupWtoA( GetProcessHeap(), 0, lpFilename );
-    HMETAFILE ret = CopyMetaFileA( hSrcMetaFile, p );
-    HeapFree( GetProcessHeap(), 0, p );
+    HMETAFILE ret = 0;
+    DWORD len = WideCharToMultiByte( CP_ACP, 0, lpFilename, -1, NULL, 0, NULL, NULL );
+    LPSTR p = HeapAlloc( GetProcessHeap(), 0, len );
+
+    if (p)
+    {
+        WideCharToMultiByte( CP_ACP, 0, lpFilename, -1, p, len, NULL, NULL );
+        ret = CopyMetaFileA( hSrcMetaFile, p );
+        HeapFree( GetProcessHeap(), 0, p );
+    }
     return ret;
 }
 
diff --git a/ole/ole2nls.c b/ole/ole2nls.c
index c34ecca..0f2a0f2 100644
--- a/ole/ole2nls.c
+++ b/ole/ole2nls.c
@@ -17,7 +17,6 @@
 #include "wingdi.h"
 #include "winuser.h"
 #include "wine/unicode.h"
-#include "heap.h"
 #include "options.h"
 #include "winver.h"
 #include "winnls.h"
@@ -2243,12 +2242,9 @@
       returned_len = wcstombs(src_native, srcstr_libc, src_native_len) + 1;
       if(returned_len == 0)
       {
-          LPSTR srcstr_ascii = (LPSTR)HEAP_strdupWtoA(GetProcessHeap(),
-					   0, srcstr);
-          ERR("wcstombs failed.  The string specified (%s) may contains an "
-              "invalid character.\n", srcstr_ascii);
+          ERR("wcstombs failed.  The string specified (%s) may contain an invalid character.\n",
+              debugstr_w(srcstr));
           SetLastError(ERROR_INVALID_PARAMETER);
-          if(srcstr_ascii) HeapFree(GetProcessHeap(), 0, srcstr_ascii);
           if(srcstr_libc) HeapFree(GetProcessHeap(), 0, srcstr_libc);
           if(src_native) HeapFree(GetProcessHeap(), 0, src_native);
           setlocale(LC_COLLATE, lc_collate_default);
diff --git a/win32/file.c b/win32/file.c
index c0a4591..d390be1 100644
--- a/win32/file.c
+++ b/win32/file.c
@@ -27,7 +27,6 @@
 
 #include "wine/winbase16.h"
 #include "file.h"
-#include "heap.h"
 
 #include "debugtools.h"
 
@@ -106,8 +105,12 @@
  */
 BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD attributes)
 {
-    LPSTR afn = HEAP_strdupWtoA( GetProcessHeap(), 0, lpFileName );
-    BOOL res = SetFileAttributesA( afn, attributes );
+    BOOL res;
+    DWORD len = WideCharToMultiByte( CP_ACP, 0, lpFileName, -1, NULL, 0, NULL, NULL );
+    LPSTR afn = HeapAlloc( GetProcessHeap(), 0, len );
+
+    WideCharToMultiByte( CP_ACP, 0, lpFileName, -1, afn, len, NULL, NULL );
+    res = SetFileAttributesA( afn, attributes );
     HeapFree( GetProcessHeap(), 0, afn );
     return res;
 }
diff --git a/win32/newfns.c b/win32/newfns.c
index ea50508..8b92062 100644
--- a/win32/newfns.c
+++ b/win32/newfns.c
@@ -12,8 +12,9 @@
 #include <sys/time.h>
 #include <unistd.h>
 #include "windef.h"
+#include "winbase.h"
+#include "winnls.h"
 #include "winerror.h"
-#include "heap.h"
 #include "debugtools.h"
 
 DEFAULT_DEBUG_CHANNEL(win32);
@@ -268,9 +269,13 @@
  */
 BOOL WINAPI SetComputerNameA( LPCSTR lpComputerName )
 {
-    LPWSTR lpComputerNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpComputerName);
-    BOOL ret = SetComputerNameW(lpComputerNameW);
-    HeapFree(GetProcessHeap(),0,lpComputerNameW);
+    BOOL ret;
+    DWORD len = MultiByteToWideChar( CP_ACP, 0, lpComputerName, -1, NULL, 0 );
+    LPWSTR nameW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
+
+    MultiByteToWideChar( CP_ACP, 0, lpComputerName, -1, nameW, len );
+    ret = SetComputerNameW( nameW );
+    HeapFree( GetProcessHeap(), 0, nameW );
     return ret;
 }
 
diff --git a/windows/cursoricon.c b/windows/cursoricon.c
index df082e1..86a692c 100644
--- a/windows/cursoricon.c
+++ b/windows/cursoricon.c
@@ -37,7 +37,6 @@
 #include "wine/winbase16.h"
 #include "wine/winuser16.h"
 #include "wine/exception.h"
-#include "heap.h"
 #include "palette.h"
 #include "bitmap.h"
 #include "cursoricon.h"
@@ -2191,9 +2190,13 @@
     HANDLE res;
     LPWSTR u_name;
 
+    if (!HIWORD(name))
+        return LoadImageW(hinst, (LPWSTR)name, type, desiredx, desiredy, loadflags);
+
     __TRY {
-	if (HIWORD(name)) u_name = HEAP_strdupAtoW(GetProcessHeap(), 0, name);
-	else u_name=(LPWSTR)name;
+        DWORD len = MultiByteToWideChar( CP_ACP, 0, name, -1, NULL, 0 );
+        u_name = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
+        MultiByteToWideChar( CP_ACP, 0, name, -1, u_name, len );
     }
     __EXCEPT(page_fault) {
 	SetLastError( ERROR_INVALID_PARAMETER );
@@ -2201,7 +2204,7 @@
     }
     __ENDTRY
     res = LoadImageW(hinst, u_name, type, desiredx, desiredy, loadflags);
-    if (HIWORD(name)) HeapFree(GetProcessHeap(), 0, u_name);
+    HeapFree(GetProcessHeap(), 0, u_name);
     return res;
 }
 
diff --git a/windows/mdi.c b/windows/mdi.c
index db2137e..ba54a2b 100644
--- a/windows/mdi.c
+++ b/windows/mdi.c
@@ -77,7 +77,6 @@
 #include "winuser.h"
 #include "wine/unicode.h"
 #include "win.h"
-#include "heap.h"
 #include "nonclient.h"
 #include "controls.h"
 #include "user.h"
@@ -1459,7 +1458,9 @@
 	{
         case WM_SETTEXT:
             {
-                LPWSTR text = HEAP_strdupAtoW( GetProcessHeap(), 0, (LPSTR)lParam );
+                DWORD len = MultiByteToWideChar( CP_ACP, 0, (LPSTR)lParam, -1, NULL, 0 );
+                LPWSTR text = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
+                MultiByteToWideChar( CP_ACP, 0, (LPSTR)lParam, -1, text, len );
                 MDI_UpdateFrameText(hwnd, hwndMDIClient, MDI_REPAINTFRAME, text );
                 HeapFree( GetProcessHeap(), 0, text );
             }
diff --git a/windows/nonclient.c b/windows/nonclient.c
index ac89529..36bcc8f 100644
--- a/windows/nonclient.c
+++ b/windows/nonclient.c
@@ -11,7 +11,6 @@
 #include "version.h"
 #include "win.h"
 #include "user.h"
-#include "heap.h"
 #include "dce.h"
 #include "controls.h"
 #include "cursoricon.h"
@@ -259,22 +258,38 @@
 
 /***********************************************************************
  *		DrawCaptionTempA (USER32.@)
- *
- * PARAMS
- *
- * RETURNS
- *     Success:
- *     Failure:
  */
+BOOL WINAPI DrawCaptionTempA (HWND hwnd, HDC hdc, const RECT *rect, HFONT hFont,
+                              HICON hIcon, LPCSTR str, UINT uFlags)
+{
+    LPWSTR strW;
+    INT len;
+    BOOL ret = FALSE;
 
-BOOL WINAPI
-DrawCaptionTempA (HWND hwnd, HDC hdc, const RECT *rect, HFONT hFont,
-		    HICON hIcon, LPCSTR str, UINT uFlags)
+    if (!(uFlags & DC_TEXT) || !str)
+        return DrawCaptionTempW( hwnd, hdc, rect, hFont, hIcon, NULL, uFlags );
+
+    len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
+    if ((strW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
+    {
+        MultiByteToWideChar( CP_ACP, 0, str, -1, strW, len );
+        ret = DrawCaptionTempW (hwnd, hdc, rect, hFont, hIcon, strW, uFlags);
+        HeapFree( GetProcessHeap (), 0, strW );
+    }
+    return ret;
+}
+
+
+/***********************************************************************
+ *		DrawCaptionTempW (USER32.@)
+ */
+BOOL WINAPI DrawCaptionTempW (HWND hwnd, HDC hdc, const RECT *rect, HFONT hFont,
+                              HICON hIcon, LPCWSTR str, UINT uFlags)
 {
     RECT   rc = *rect;
 
-    TRACE("(%08x,%08x,%p,%08x,%08x,\"%s\",%08x)\n",
-          hwnd, hdc, rect, hFont, hIcon, str, uFlags);
+    TRACE("(%08x,%08x,%p,%08x,%08x,%s,%08x)\n",
+          hwnd, hdc, rect, hFont, hIcon, debugstr_w(str), uFlags);
 
     /* drawing background */
     if (uFlags & DC_INBUTTON) {
@@ -332,13 +347,13 @@
 	}
 
 	if (str)
-	    DrawTextA (hdc, str, -1, &rc,
+	    DrawTextW (hdc, str, -1, &rc,
 			 DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_LEFT);
 	else {
-	    CHAR szText[128];
+	    WCHAR szText[128];
 	    INT nLen;
-	    nLen = GetWindowTextA (hwnd, szText, 128);
-	    DrawTextA (hdc, szText, nLen, &rc,
+	    nLen = GetWindowTextW (hwnd, szText, 128);
+	    DrawTextW (hdc, szText, nLen, &rc,
 			 DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_LEFT);
 	}
 
@@ -357,27 +372,6 @@
 
 
 /***********************************************************************
- *		DrawCaptionTempW (USER32.@)
- *
- * PARAMS
- *
- * RETURNS
- *     Success:
- *     Failure:
- */
-
-BOOL WINAPI
-DrawCaptionTempW (HWND hwnd, HDC hdc, const RECT *rect, HFONT hFont,
-		    HICON hIcon, LPCWSTR str, UINT uFlags)
-{
-    LPSTR p = HEAP_strdupWtoA (GetProcessHeap (), 0, str);
-    BOOL res = DrawCaptionTempA (hwnd, hdc, rect, hFont, hIcon, p, uFlags);
-    HeapFree (GetProcessHeap (), 0, p);
-    return res;
-}
-
-
-/***********************************************************************
  *		AdjustWindowRect (USER.102)
  */
 BOOL16 WINAPI AdjustWindowRect16( LPRECT16 rect, DWORD style, BOOL16 menu )
diff --git a/windows/user.c b/windows/user.c
index 32441f5..7385dd0 100644
--- a/windows/user.c
+++ b/windows/user.c
@@ -12,7 +12,6 @@
 #include "wingdi.h"
 #include "winuser.h"
 #include "wine/winuser16.h"
-#include "heap.h"
 #include "user.h"
 #include "win.h"
 #include "controls.h"
@@ -364,21 +363,26 @@
 /***********************************************************************
  *		EnumDisplaySettingsW (USER32.@)
  */
-BOOL WINAPI EnumDisplaySettingsW(LPCWSTR name,DWORD n,LPDEVMODEW devmode) {
-	LPSTR nameA = HEAP_strdupWtoA(GetProcessHeap(),0,name);
-	DEVMODEA	devmodeA; 
-	BOOL ret = EnumDisplaySettingsA(nameA,n,&devmodeA); 
+BOOL WINAPI EnumDisplaySettingsW(LPCWSTR name,DWORD n,LPDEVMODEW devmode)
+{
+    DEVMODEA devmodeA;
+    BOOL ret;
+    DWORD len = WideCharToMultiByte( CP_ACP, 0, name, -1, NULL, 0, NULL, NULL );
+    LPSTR nameA = HeapAlloc( GetProcessHeap(), 0, len );
 
-	if (ret) {
-		devmode->dmBitsPerPel		 = devmodeA.dmBitsPerPel;
-		devmode->dmPelsHeight		 = devmodeA.dmPelsHeight;
-		devmode->dmPelsWidth	   	 = devmodeA.dmPelsWidth;
-		devmode->dmDisplayFlags	    = devmodeA.dmDisplayFlags;
-		devmode->dmDisplayFrequency = devmodeA.dmDisplayFrequency;
-		/* FIXME: convert rest too, if they are ever returned */
-	}
-	HeapFree(GetProcessHeap(),0,nameA);
-	return ret;
+    WideCharToMultiByte( CP_ACP, 0, name, -1, nameA, len, NULL, NULL );
+    ret = EnumDisplaySettingsA(nameA,n,&devmodeA);
+    if (ret)
+    {
+        devmode->dmBitsPerPel       = devmodeA.dmBitsPerPel;
+        devmode->dmPelsHeight       = devmodeA.dmPelsHeight;
+        devmode->dmPelsWidth        = devmodeA.dmPelsWidth;
+        devmode->dmDisplayFlags     = devmodeA.dmDisplayFlags;
+        devmode->dmDisplayFrequency = devmodeA.dmDisplayFrequency;
+        /* FIXME: convert rest too, if they are ever returned */
+    }
+    HeapFree(GetProcessHeap(),0,nameA);
+    return ret;
 }
 
 /***********************************************************************
diff --git a/windows/win.c b/windows/win.c
index 8f84044..6348963 100644
--- a/windows/win.c
+++ b/windows/win.c
@@ -13,7 +13,6 @@
 #include "wine/server.h"
 #include "wine/unicode.h"
 #include "win.h"
-#include "heap.h"
 #include "user.h"
 #include "dce.h"
 #include "controls.h"
@@ -1602,6 +1601,7 @@
     ATOM atom = 0;
     LPWSTR buffer;
     HWND hwnd;
+    INT len;
 
     if (className)
     {
@@ -1613,8 +1613,11 @@
             return 0;
         }
     }
+    if (!title) return WIN_FindWindow( parent, child, atom, NULL );
 
-    buffer = HEAP_strdupAtoW( GetProcessHeap(), 0, title );
+    len = MultiByteToWideChar( CP_ACP, 0, title, -1, NULL, 0 );
+    if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return 0;
+    MultiByteToWideChar( CP_ACP, 0, title, -1, buffer, len );
     hwnd = WIN_FindWindow( parent, child, atom, buffer );
     HeapFree( GetProcessHeap(), 0, buffer );
     return hwnd;
diff --git a/windows/winhelp.c b/windows/winhelp.c
index c0e2d66..009e21a 100644
--- a/windows/winhelp.c
+++ b/windows/winhelp.c
@@ -12,7 +12,6 @@
 #include "wine/winuser16.h"
 #include "wine/winbase16.h"
 #include "win.h"
-#include "heap.h"
 
 DEFAULT_DEBUG_CHANNEL(win);
 
@@ -144,11 +143,20 @@
 /**********************************************************************
  *		WinHelpW (USER32.@)
  */
-BOOL WINAPI WinHelpW( HWND hWnd, LPCWSTR helpFile, UINT command,
-                          DWORD dwData )
+BOOL WINAPI WinHelpW( HWND hWnd, LPCWSTR helpFile, UINT command, DWORD dwData )
 {
-    LPSTR file = HEAP_strdupWtoA( GetProcessHeap(), 0, helpFile );
-    BOOL ret = WinHelpA( hWnd, file, command, dwData );
-    HeapFree( GetProcessHeap(), 0, file );
+    INT len;
+    LPSTR file;
+    BOOL ret = FALSE;
+
+    if (!helpFile) return WinHelpA( hWnd, NULL, command, dwData );
+
+    len = WideCharToMultiByte( CP_ACP, 0, helpFile, -1, NULL, 0, NULL, NULL );
+    if ((file = HeapAlloc( GetProcessHeap(), 0, len )))
+    {
+        WideCharToMultiByte( CP_ACP, 0, helpFile, -1, file, len, NULL, NULL );
+        ret = WinHelpA( hWnd, file, command, dwData );
+        HeapFree( GetProcessHeap(), 0, file );
+    }
     return ret;
 }