Index: trunk/src/comctl32/comctl32.c
===================================================================
--- trunk/src/comctl32/comctl32.c	(revision 7333)
+++ trunk/src/comctl32/comctl32.c	(revision 7334)
@@ -441,7 +441,14 @@
 DrawStatusTextW (HDC hdc, LPRECT lprc, LPCWSTR text, UINT style)
 {
+#ifdef __WIN32OS2__
+    LPSTR p;
+    STACK_strdupWtoA(text, p)
+#else
     LPSTR p = HEAP_strdupWtoA (GetProcessHeap (), 0, text);
+#endif
     DrawStatusTextA (hdc, lprc, p, style);
+#ifndef __WIN32OS2__
     HeapFree (GetProcessHeap (), 0, p );
+#endif
 }
 
Index: trunk/src/comctl32/listview.c
===================================================================
--- trunk/src/comctl32/listview.c	(revision 7333)
+++ trunk/src/comctl32/listview.c	(revision 7334)
@@ -6763,11 +6763,22 @@
       lvca.pszText = LPSTR_TEXTCALLBACKA;
     else
+#ifdef __WIN32OS2__
+    {
+      LPSTR pszText;
+      STACK_strdupWtoA(lpColumn->pszText, pszText)
+      lvca.pszText = pszText;
+    }
+#else
       lvca.pszText = HEAP_strdupWtoA(GetProcessHeap(),0,lpColumn->pszText);
+#endif
   }
   lres = LISTVIEW_InsertColumnA(hwnd,nColumn,&lvca);
+
+#ifndef __WIN32OS2__
   if (lpColumn->mask & LVCF_TEXT) {
     if (lpColumn->pszText != LPSTR_TEXTCALLBACKW)
       HeapFree(GetProcessHeap(),0,lvca.pszText);
   }
+#endif
   return lres;
 }
@@ -6946,11 +6957,21 @@
       lvia.pszText = LPSTR_TEXTCALLBACKA;
     else
+#ifdef __WIN32OS2__
+    {
+      LPSTR pszText;
+      STACK_strdupWtoA(lpLVItem->pszText, pszText)
+      lvia.pszText = pszText;
+    }
+#else
       lvia.pszText = HEAP_strdupWtoA(GetProcessHeap(),0,lpLVItem->pszText);
+#endif
   }
   lres = LISTVIEW_InsertItemA(hwnd, &lvia);
+#ifndef __WIN32OS2__
   if (lvia.mask & LVIF_TEXT) {
     if (lpLVItem->pszText != LPSTR_TEXTCALLBACKW)
       HeapFree(GetProcessHeap(),0,lvia.pszText);
   }
+#endif
   return lres;
 }
Index: trunk/src/kernel32/Fileio.cpp
===================================================================
--- trunk/src/kernel32/Fileio.cpp	(revision 7333)
+++ trunk/src/kernel32/Fileio.cpp	(revision 7334)
@@ -1,3 +1,3 @@
-/* $Id: Fileio.cpp,v 1.53 2001-08-31 19:53:11 phaller Exp $ */
+/* $Id: Fileio.cpp,v 1.54 2001-11-14 12:30:35 phaller Exp $ */
 
 /*
@@ -531,18 +531,27 @@
                            DWORD              dwCopyFlags)
 {
-    LPSTR sourceA = HEAP_strdupWtoA( GetProcessHeap(), 0, lpExistingFileName );
-    LPSTR destA   = HEAP_strdupWtoA( GetProcessHeap(), 0, lpNewFileName );
-
-    BOOL ret = CopyFileExA(sourceA,
-                           destA,
-                           lpProgressRoutine,
-                           lpData,
-                           pbCancel,
-                           dwCopyFlags);
-
-    HeapFree( GetProcessHeap(), 0, sourceA );
-    HeapFree( GetProcessHeap(), 0, destA );
-
-    return ret;
+#ifdef __WIN32OS2__
+  LPSTR sourceA;
+  LPSTR destA;
+  STACK_strdupWtoA(lpExistingFileName, sourceA)
+  STACK_strdupWtoA(lpNewFileName, destA)
+#else
+  LPSTR sourceA = HEAP_strdupWtoA( GetProcessHeap(), 0, lpExistingFileName );
+  LPSTR destA   = HEAP_strdupWtoA( GetProcessHeap(), 0, lpNewFileName );
+#endif
+  
+  BOOL ret = CopyFileExA(sourceA,
+                         destA,
+                         lpProgressRoutine,
+                         lpData,
+                         pbCancel,
+                         dwCopyFlags);
+  
+#ifndef __WIN32OS2__
+  HeapFree( GetProcessHeap(), 0, sourceA );
+  HeapFree( GetProcessHeap(), 0, destA );
+#endif
+  
+  return ret;
 }
 //******************************************************************************
@@ -1383,7 +1392,16 @@
               LPVOID, lpFileInformation)
 {
+#ifdef __WIN32OS2__
+  LPSTR nameA;
+  STACK_strdupWtoA(lpFileName, nameA)
+#else
   LPSTR nameA = HEAP_strdupWtoA( GetProcessHeap(), 0, lpFileName );
+#endif
+  
   BOOL res = GetFileAttributesExA( nameA, fInfoLevelId, lpFileInformation);
+  
+#ifndef __WIN32OS2__
   HeapFree( GetProcessHeap(), 0, nameA );
+#endif
   return res;
 }
Index: trunk/src/kernel32/directory.cpp
===================================================================
--- trunk/src/kernel32/directory.cpp	(revision 7333)
+++ trunk/src/kernel32/directory.cpp	(revision 7334)
@@ -1,3 +1,3 @@
-/* $Id: directory.cpp,v 1.40 2001-10-15 17:10:54 sandervl Exp $ */
+/* $Id: directory.cpp,v 1.41 2001-11-14 12:30:30 phaller Exp $ */
 
 /*
@@ -350,10 +350,11 @@
  *****************************************************************************/
 
-BOOL WIN32API CreateDirectoryExA( LPCSTR lpTemplateDirectory,
-                                  LPCSTR lpNewDirectory,
-                                  LPSECURITY_ATTRIBUTES lpSecurityAttributes)
-{
-
-  dprintf(("KERNEL32:CreateDirectoryExA(%08x,%08x,%08x) not properly implemented\n",
+ODINFUNCTION3(BOOL, CreateDirectoryExA,
+              LPCSTR, lpTemplateDirectory,
+              LPCSTR, lpNewDirectory,
+              LPSECURITY_ATTRIBUTES, lpSecurityAttributes)
+{
+
+  dprintf(("KERNEL32:CreateDirectoryExA(%s,%s,%08xh) not properly implemented\n",
            lpTemplateDirectory,lpNewDirectory,lpSecurityAttributes
           ));
@@ -389,7 +390,8 @@
  *****************************************************************************/
 
-BOOL WIN32API CreateDirectoryExW( LPCWSTR lpTemplateDirectory,
-                                  LPCWSTR lpNewDirectory,
-                                  LPSECURITY_ATTRIBUTES lpSecurityAttributes)
+ODINFUNCTION3(BOOL, CreateDirectoryExW,
+              LPCWSTR, lpTemplateDirectory,
+              LPCWSTR, lpNewDirectory,
+              LPSECURITY_ATTRIBUTES, lpSecurityAttributes)
 {
 
@@ -721,6 +723,11 @@
  *    Should call SetLastError(but currently doesn't).
  */
-DWORD WINAPI SearchPathA(LPCSTR path, LPCSTR name, LPCSTR ext, DWORD buflen,
-                         LPSTR buffer, LPSTR *lastpart )
+ODINFUNCTION6(DWORD, SearchPathA,
+              LPCSTR, path,
+              LPCSTR, name,
+              LPCSTR, ext,
+              DWORD, buflen,
+              LPSTR, buffer,
+              LPSTR *, lastpart )
 {
     char full_name[MAX_PATHNAME_LEN];
@@ -736,16 +743,35 @@
  *           SearchPath32W   (KERNEL32.448)
  */
-DWORD WINAPI SearchPathW(LPCWSTR path, LPCWSTR name, LPCWSTR ext,
-                         DWORD buflen, LPWSTR buffer, LPWSTR *lastpart )
+ODINFUNCTION6(DWORD, SearchPathW,
+              LPCWSTR, path,
+              LPCWSTR, name,
+              LPCWSTR, ext,
+              DWORD, buflen,
+              LPWSTR, buffer,
+              LPWSTR *, lastpart )
 {
     char full_name[MAX_PATHNAME_LEN];
-
+  
+#ifdef __WIN32OS2__
+    LPSTR pathA;
+    LPSTR nameA;
+    LPSTR extA;
+    STACK_strdupWtoA(path, pathA)
+    STACK_strdupWtoA(name, nameA)
+    STACK_strdupWtoA(ext,  extA)
+#else
     LPSTR pathA = HEAP_strdupWtoA( GetProcessHeap(), 0, path );
     LPSTR nameA = HEAP_strdupWtoA( GetProcessHeap(), 0, name );
     LPSTR extA  = HEAP_strdupWtoA( GetProcessHeap(), 0, ext );
+#endif
+  
     DWORD ret = DIR_SearchPath( pathA, nameA, extA, (LPSTR)full_name );
+  
+#ifndef __WIN32OS2__
     HeapFree( GetProcessHeap(), 0, extA );
     HeapFree( GetProcessHeap(), 0, nameA );
     HeapFree( GetProcessHeap(), 0, pathA );
+#endif
+  
     if (!ret) return 0;
 
Index: trunk/src/kernel32/environ.cpp
===================================================================
--- trunk/src/kernel32/environ.cpp	(revision 7333)
+++ trunk/src/kernel32/environ.cpp	(revision 7334)
@@ -1,3 +1,3 @@
-/* $Id: environ.cpp,v 1.11 2001-04-26 17:01:58 sandervl Exp $ */
+/* $Id: environ.cpp,v 1.12 2001-11-14 12:30:34 phaller Exp $ */
 
 /*
@@ -283,5 +283,11 @@
               DWORD,   nSize)
 {
+#ifdef __WIN32OS2__
+  LPSTR srcA;
+  STACK_strdupWtoA(lpSrc, srcA)
+#else
   LPSTR srcA = HEAP_strdupWtoA( GetProcessHeap(), 0, lpSrc );
+#endif
+  
   LPSTR dstA = lpDst ? (LPSTR)HeapAlloc( GetProcessHeap(), 0, nSize ) : NULL;
 
@@ -294,5 +300,7 @@
       HeapFree( GetProcessHeap(), 0, dstA );
     }
+#ifndef __WIN32OS2__
   HeapFree( GetProcessHeap(), 0, srcA );
+#endif
   return ret;
 }
Index: trunk/src/kernel32/module.cpp
===================================================================
--- trunk/src/kernel32/module.cpp	(revision 7333)
+++ trunk/src/kernel32/module.cpp	(revision 7334)
@@ -1,3 +1,3 @@
-/* $Id: module.cpp,v 1.3 2001-09-05 12:57:59 bird Exp $
+/* $Id: module.cpp,v 1.4 2001-11-14 12:30:38 phaller Exp $
  *
  * GetBinaryTypeA/W (Wine Port)
@@ -262,5 +262,4 @@
 {
     BOOL ret = FALSE;
-    LPSTR strNew = NULL;
 
     dprintf(("KERNEL32: GetBinaryTypeW %x %x", lpApplicationName, lpBinaryType));
@@ -276,5 +275,10 @@
     /* Convert the wide string to a ascii string.
      */
-    strNew = HEAP_strdupWtoA( GetProcessHeap(), 0, lpApplicationName );
+#ifdef __WIN32OS2__
+  LPSTR strNew;
+  STACK_strdupWtoA(lpApplicationName, strNew)
+#else
+  LPSTR strNew = HEAP_strdupWtoA( GetProcessHeap(), 0, lpApplicationName );
+#endif
 
     if ( strNew != NULL )
@@ -284,5 +288,7 @@
         /* Free the allocated string.
          */
-        HeapFree( GetProcessHeap(), 0, strNew );
+#ifndef __WIN32OS2__
+      HeapFree( GetProcessHeap(), 0, strNew );
+#endif
     }
 
Index: trunk/src/kernel32/ole2nls.cpp
===================================================================
--- trunk/src/kernel32/ole2nls.cpp	(revision 7333)
+++ trunk/src/kernel32/ole2nls.cpp	(revision 7334)
@@ -1,3 +1,3 @@
-/* $Id: ole2nls.cpp,v 1.14 2001-09-05 12:57:59 bird Exp $
+/* $Id: ole2nls.cpp,v 1.15 2001-11-14 12:30:40 phaller Exp $
  *
  *  National Language Support library
@@ -442,4 +442,8 @@
     int string_num;
     int i;
+
+    /* Replace SUBLANG_NEUTRAL by SUBLANG_DEFAULT */
+    if(SUBLANGID(lang_id) == SUBLANG_NEUTRAL)
+        lang_id = MAKELANGID(PRIMARYLANGID(lang_id), SUBLANG_DEFAULT);
 
     hrsrc = FindResourceExW(hModule, RT_STRINGW, (LPCWSTR)((res_id >> 4) + 1), lang_id);
@@ -2022,4 +2026,5 @@
    * characters, we can support NORM_IGNOREKANATYPE
    */
+#ifdef DEBUG
   if (mapflags & ~LCMAPSTRINGA_SUPPORTED_FLAGS)
   {
@@ -2035,4 +2040,5 @@
      );
   }
+#endif
 
   if ( !(mapflags & LCMAP_SORTKEY) )
Index: trunk/src/kernel32/thread.cpp
===================================================================
--- trunk/src/kernel32/thread.cpp	(revision 7333)
+++ trunk/src/kernel32/thread.cpp	(revision 7334)
@@ -1,3 +1,3 @@
-/* $Id: thread.cpp,v 1.34 2001-11-12 23:04:56 phaller Exp $ */
+/* $Id: thread.cpp,v 1.35 2001-11-14 12:30:44 phaller Exp $ */
 
 /*
@@ -153,4 +153,5 @@
 char* WIN32API dbg_GetLastCallerName()
 {
+#ifdef DEBUG
   // retrieve last caller name from stack
   TEB *teb;
@@ -167,4 +168,5 @@
     }
   }
+#endif
   
   return NULL;
Index: trunk/src/kernel32/virtual.cpp
===================================================================
--- trunk/src/kernel32/virtual.cpp	(revision 7333)
+++ trunk/src/kernel32/virtual.cpp	(revision 7334)
@@ -1,3 +1,3 @@
-/* $Id: virtual.cpp,v 1.40 2001-10-09 20:25:20 sandervl Exp $ */
+/* $Id: virtual.cpp,v 1.41 2001-11-14 12:30:46 phaller Exp $ */
 
 /*
@@ -69,9 +69,18 @@
                                       DWORD size_low, LPCWSTR name )
 {
-    LPSTR nameA = HEAP_strdupWtoA( GetProcessHeap(), 0, name );
+#ifdef __WIN32OS2__
+  LPSTR nameA;
+  STACK_strdupWtoA(name, nameA)
+#else
+  LPSTR nameA = HEAP_strdupWtoA( GetProcessHeap(), 0, name );
+#endif
+  
     HANDLE ret = CreateFileMappingA( hFile, attr, protect,
-                                         size_high, size_low, nameA );
-    HeapFree( GetProcessHeap(), 0, nameA );
-    return ret;
+                                    size_high, size_low, nameA );
+  
+#ifndef __WIN32OS2__
+  HeapFree( GetProcessHeap(), 0, nameA );
+#endif
+  return ret;
 }
 
@@ -101,8 +110,17 @@
 HANDLE WINAPI OpenFileMappingW( DWORD access, BOOL inherit, LPCWSTR name)
 {
+#ifdef __WIN32OS2__
+  LPSTR nameA;
+  STACK_strdupWtoA(name, nameA)
+#else
     LPSTR nameA = HEAP_strdupWtoA( GetProcessHeap(), 0, name );
-    HANDLE ret = OpenFileMappingA( access, inherit, nameA );
-    HeapFree( GetProcessHeap(), 0, nameA );
-    return ret;
+#endif
+  
+  HANDLE ret = OpenFileMappingA( access, inherit, nameA );
+  
+#ifndef __WIN32OS2__
+  HeapFree( GetProcessHeap(), 0, nameA );
+#endif
+  return ret;
 }
 
