Index: trunk/src/shlwapi/makefile
===================================================================
--- trunk/src/shlwapi/makefile	(revision 4080)
+++ trunk/src/shlwapi/makefile	(revision 4081)
@@ -1,3 +1,3 @@
-# $Id: makefile,v 1.17 2000-07-19 19:05:22 sandervl Exp $
+# $Id: makefile,v 1.18 2000-08-24 09:32:42 sandervl Exp $
 
 #
@@ -27,7 +27,10 @@
 $(OBJDIR)\shlstub.obj \
 $(OBJDIR)\url.obj \
+$(OBJDIR)\reg_odin.obj \
 $(OBJDIR)\reg.obj \
+$(OBJDIR)\regstream.obj \
 $(OBJDIR)\pathcpp.obj \
 $(OBJDIR)\path.obj \
+$(OBJDIR)\string_odin.obj \
 $(OBJDIR)\string.obj \
 $(OBJDIR)\shlwapirsrc.obj \
Index: trunk/src/shlwapi/ordinal.cpp
===================================================================
--- trunk/src/shlwapi/ordinal.cpp	(revision 4080)
+++ trunk/src/shlwapi/ordinal.cpp	(revision 4081)
@@ -1,3 +1,3 @@
-/* $Id: ordinal.cpp,v 1.4 2000-08-02 20:18:23 bird Exp $ */
+/* $Id: ordinal.cpp,v 1.5 2000-08-24 09:32:42 sandervl Exp $ */
 
 /*
@@ -58,4 +58,5 @@
 
 #include "shlwapi.h"
+#include "shlwapi_odin.h"
 
 
@@ -1634,2 +1635,11 @@
   return flagIsLowMemoryMachine;
 }
+
+/*************************************************************************
+ *      SHCreateShellPalette	[SHLWAPI.@]
+ */
+HPALETTE WINAPI SHCreateShellPalette(HDC hdc)
+{
+	FIXME("stub\n");
+	return CreateHalftonePalette(hdc);
+}
Index: trunk/src/shlwapi/path.c
===================================================================
--- trunk/src/shlwapi/path.c	(revision 4080)
+++ trunk/src/shlwapi/path.c	(revision 4081)
@@ -1,29 +1,9 @@
-/* $Id: path.c,v 1.8 2000-08-21 18:33:53 sandervl Exp $ */
-
 /*
  * Path Functions
  *
- * Project Odin Software License can be found in LICENSE.TXT
- *
- * 
- * NOTE: SHGetSpecialFolderPathA: StartMenu changed in 'Start Menu'
- *
- *
- * Copyright 1997 Marcus Meissner
- *
- * WINE 20000430 level
- */
-
-/*****************************************************************************
- * Remark                                                                    *
- *****************************************************************************
-
- */
-
-
-/*****************************************************************************
- * Includes                                                                  *
- *****************************************************************************/
-
+ * Note: Odin changes marked by #ifdef __WIN32OS2__
+ */
+
+#ifdef __WIN32OS2__
 #include <odin.h>
 #include <odinwrap.h>
@@ -31,31 +11,27 @@
 
 #include <string.h>
-#include <ctype.h>
 #include <wctype.h>
 #include <wcstr.h>
 #define HAVE_WCTYPE_H
-
+#include <win\shlwapi.h>
+
+#include <heapstring.h>
+#endif
+
+#include <ctype.h>
+#include <string.h>
+
+#include "winerror.h"
+#include "wine/unicode.h"
+#include "wine/undocshell.h"
+#include "shlwapi.h"
 #include "debugtools.h"
 
-#include <winreg.h>
-
-#include <heapstring.h>
-#include <misc.h>
-#include <win\shell.h>
-#include <win\winerror.h>
-#include <win\crtdll.h>
-#include <win\winversion.h>
-#include <winuser.h>
-
-#include <win\shlwapi.h>
-#include <win\shlobj.h>
-#include <win\wine\undocshell.h>
-
-#define strncasecmp	lstrncmpA
-#define strcasecmp	lstrcmpA
-
-
-ODINDEBUGCHANNEL(SHLWAPI-PATH)
-
+DEFAULT_DEBUG_CHANNEL(shell);
+
+#define isSlash(x) ((x)=='\\' || (x)=='/')
+/*
+	########## Combining and Constructing paths ##########
+*/
 
 /*************************************************************************
@@ -68,5 +44,5 @@
  *  the resulting path is also canonicalized
  */
-LPSTR WINAPI PathAppendA(
+BOOL WINAPI PathAppendA(
 	LPSTR lpszPath1,
 	LPCSTR lpszPath2) 
@@ -74,5 +50,6 @@
 	TRACE("%s %s\n",lpszPath1, lpszPath2);
 	while (lpszPath2[0]=='\\') lpszPath2++;
-	return PathCombineA(lpszPath1,lpszPath1,lpszPath2);
+	PathCombineA(lpszPath1,lpszPath1,lpszPath2);
+	return TRUE;
 }
 
@@ -80,22 +57,12 @@
  * PathAppendW		[SHLWAPI.@]
  */
-LPSTR WINAPI PathAppendW(
+BOOL WINAPI PathAppendW(
 	LPWSTR lpszPath1,
 	LPCWSTR lpszPath2) 
 {
-	FIXME("%s %s\n",debugstr_w(lpszPath1), debugstr_w(lpszPath2));
-	return NULL;
-}
-
-/*************************************************************************
- * PathAppendAW		[SHELL32.36]
- */
-LPVOID WINAPI PathAppendAW(
-	LPVOID lpszPath1,
-	LPCVOID lpszPath2)
-{
-	if (VERSION_OsIsUnicode())
-	  return PathAppendW(lpszPath1, lpszPath2);
-	return PathAppendA(lpszPath1, lpszPath2);
+	TRACE("%s %s\n",debugstr_w(lpszPath1), debugstr_w(lpszPath2));
+	while (lpszPath2[0]=='\\') lpszPath2++;
+	PathCombineW(lpszPath1,lpszPath1,lpszPath2);
+	return TRUE;
 }
 
@@ -109,6 +76,4 @@
  * FIXME
  *  the resulting path is also canonicalized
- *  If lpszSrcPath2 starts with a backslash it is appended 
- *  to the root of lpszSrcPath1.
  */
 LPSTR WINAPI PathCombineA(
@@ -128,7 +93,14 @@
 
 	/*  if lpszFile is a complete path don't care about lpszDir */
-	if (PathIsRootA(lpszFile))
+	if (PathGetDriveNumberA(lpszFile) != -1)
 	{
 	  strcpy(szDest,lpszFile);
+	}
+	else if (lpszFile[0] == '\\' )
+	{
+	  strcpy(sTemp,lpszDir);
+	  PathStripToRootA(sTemp);
+	  strcat(sTemp,lpszFile);
+	  strcpy(szDest,sTemp);
 	}
 	else
@@ -157,34 +129,28 @@
 	if (!lpszFile || !lpszFile[0] || (lpszFile[0]==(WCHAR)'.' && !lpszFile[1]) ) 
 	{
-	  CRTDLL_wcscpy(szDest,lpszDir);
+          strcpyW(szDest,lpszDir);
 	  return szDest;
 	}
 
 	/*  if lpszFile is a complete path don't care about lpszDir */
-	if (PathIsRootW(lpszFile))
-	{
-	  CRTDLL_wcscpy(szDest,lpszFile);
+	if (PathGetDriveNumberW(lpszFile) != -1)
+	{
+            strcpyW(szDest,lpszFile);
+	}
+	else if (lpszFile[0] == (WCHAR)'\\' )
+	{
+	  strcpyW(sTemp,lpszDir);
+	  PathStripToRootW(sTemp);
+	  strcatW(sTemp,lpszFile);
+	  strcpyW(szDest,sTemp);
 	}
 	else
 	{
-	  CRTDLL_wcscpy(sTemp,lpszDir);
+	  strcpyW(sTemp,lpszDir);
 	  PathAddBackslashW(sTemp);
-	  CRTDLL_wcscat(sTemp,lpszFile);
-	  CRTDLL_wcscpy(szDest,sTemp);
+	  strcatW(sTemp,lpszFile);
+	  strcpyW(szDest,sTemp);
 	}
 	return szDest;
-}
-
-/*************************************************************************
- * PathCombineAW	 [SHELL32.37]
- */
-LPVOID WINAPI PathCombineAW(
-	LPVOID szDest,
-	LPCVOID lpszDir,
-	LPCVOID lpszFile) 
-{
-	if (VERSION_OsIsUnicode())
-	  return PathCombineW( szDest, lpszDir, lpszFile );
-	return PathCombineA( szDest, lpszDir, lpszFile );
 }
 
@@ -218,5 +184,5 @@
 	TRACE("%p->%s\n",lpszPath,debugstr_w(lpszPath));
 
-	len = CRTDLL_wcslen(lpszPath);
+	len = strlenW(lpszPath);
 	if (len && lpszPath[len-1]!=(WCHAR)'\\') 
 	{
@@ -229,14 +195,4 @@
 
 /*************************************************************************
- * PathAddBackslashAW		[SHELL32.32]
- */
-LPVOID WINAPI PathAddBackslashAW(LPVOID lpszPath)
-{
-	if(VERSION_OsIsUnicode())
-	  return PathAddBackslashW(lpszPath);
-	return PathAddBackslashA(lpszPath);
-}
-
-/*************************************************************************
  * PathBuildRootA		[SHLWAPI.@]
  */
@@ -262,14 +218,4 @@
 }
 
-/*************************************************************************
- * PathBuildRootAW		[SHELL32.30]
- */
-LPVOID WINAPI PathBuildRootAW(LPVOID lpszPath, int drive)
-{
-	if(VERSION_OsIsUnicode())
-	  return PathBuildRootW(lpszPath, drive);
-	return PathBuildRootA(lpszPath, drive);
-}
-
 /*
 	Extracting Component Parts
@@ -281,15 +227,14 @@
 LPSTR WINAPI PathFindFileNameA(LPCSTR lpszPath)
 {
-	LPCSTR aslash;
-	aslash = lpszPath;
-
-	TRACE("%s\n",aslash);
-	while (lpszPath[0]) 
-	{
-	  if (((lpszPath[0]=='\\') || (lpszPath[0]==':')) && lpszPath[1] && lpszPath[1]!='\\')
-	      aslash = lpszPath+1;
-	  lpszPath++;
-	}
-	return (LPSTR)aslash;
+	LPCSTR lastSlash = lpszPath;
+
+	TRACE("%s\n",lpszPath);
+	while (*lpszPath) 
+	{
+	  if ( isSlash(lpszPath[0]) && lpszPath[1])
+	      lastSlash = lpszPath+1;
+	  lpszPath = CharNextA(lpszPath);
+	}
+	return (LPSTR)lastSlash;
 
 }
@@ -308,17 +253,7 @@
 	  if (((lpszPath[0]=='\\') || (lpszPath[0]==':')) && lpszPath[1] && lpszPath[1]!='\\')
 	    wslash = lpszPath+1;
-	  lpszPath++;
+	  lpszPath = CharNextW(lpszPath);
 	}
 	return (LPWSTR)wslash;	
-}
-
-/*************************************************************************
- * PathFindFileNameAW	[SHELL32.34]
- */
-LPVOID WINAPI PathFindFileNameAW(LPCVOID lpszPath)
-{
-	if(VERSION_OsIsUnicode())
-	  return PathFindFileNameW(lpszPath);
-	return PathFindFileNameA(lpszPath);
 }
 
@@ -342,5 +277,5 @@
 	  if (*lpszPath=='.')
 	    lastpoint=lpszPath;
-	  lpszPath++;
+	  lpszPath = CharNextA(lpszPath);
 	}
 	return (LPSTR)(lastpoint?lastpoint:lpszPath);
@@ -362,54 +297,7 @@
 	  if (*lpszPath==(WCHAR)'.')
 	    lastpoint=lpszPath;
-	  lpszPath++;
+	  lpszPath = CharNextW(lpszPath);
 	}
 	return (LPWSTR)(lastpoint?lastpoint:lpszPath);
-}
-
-/*************************************************************************
- * PathFindExtensionAW		[SHELL32.31]
- */
-LPVOID WINAPI PathFindExtensionAW(LPCVOID lpszPath) 
-{
-	if (VERSION_OsIsUnicode())
-	  return PathFindExtensionW(lpszPath);
-	return PathFindExtensionA(lpszPath);
-
-}
-
-/*************************************************************************
- * PathGetExtensionA		[internal]
- *
- * NOTES
- *  exported by ordinal
- *  return value points to the first char after the dot
- */
-LPSTR WINAPI PathGetExtensionA(LPCSTR lpszPath)
-{
-	TRACE("(%s)\n",lpszPath);
-
-	lpszPath = PathFindExtensionA(lpszPath);
-	return (LPSTR)(*lpszPath?(lpszPath+1):lpszPath);
-}
-
-/*************************************************************************
- * PathGetExtensionW		[internal]
- */
-LPWSTR WINAPI PathGetExtensionW(LPCWSTR lpszPath)
-{
-	TRACE("(%s)\n",debugstr_w(lpszPath));
-
-	lpszPath = PathFindExtensionW(lpszPath);
-	return (LPWSTR)(*lpszPath?(lpszPath+1):lpszPath);
-}
-
-/*************************************************************************
- * PathGetExtensionAW		[SHELL32.158]
- */
-LPVOID WINAPI PathGetExtensionAW(LPCVOID lpszPath) 
-{
-	if (VERSION_OsIsUnicode())
-	  return PathGetExtensionW(lpszPath);
-	return PathGetExtensionA(lpszPath);
 }
 
@@ -436,8 +324,7 @@
 	  if (*lpszPath=='"')
 	    qflag=!qflag;
-	  lpszPath++;
+	  lpszPath = CharNextA(lpszPath);
 	}
 	return (LPSTR)lpszPath;
-
 }
 
@@ -457,17 +344,7 @@
 	  if (*lpszPath=='"')
 	    qflag=!qflag;
-	  lpszPath++;
+	  lpszPath = CharNextW(lpszPath);
 	}
 	return (LPWSTR)lpszPath;
-}
-
-/*************************************************************************
- * PathGetArgsAW	[SHELL32.52]
- */
-LPVOID WINAPI PathGetArgsAW(LPVOID lpszPath) 
-{
-	if (VERSION_OsIsUnicode())
-	  return PathGetArgsW(lpszPath);
-	return PathGetArgsA(lpszPath);
 }
 
@@ -490,20 +367,10 @@
 int WINAPI PathGetDriveNumberW(LPCWSTR lpszPath)
 {
-	int chr = towlower(lpszPath[0]);
+	int chr = tolowerW(lpszPath[0]);
 	
 	TRACE ("%s\n",debugstr_w(lpszPath));
 
 	if (!lpszPath || lpszPath[1]!=':' || chr < 'a' || chr > 'z') return -1;
-	return tolower(lpszPath[0]) - 'a' ;
-}
-
-/*************************************************************************
- * PathGetDriveNumber	[SHELL32.57]
- */
-int WINAPI PathGetDriveNumberAW(LPVOID lpszPath) 
-{
-	if (VERSION_OsIsUnicode())
-	  return PathGetDriveNumberW(lpszPath);
-	return PathGetDriveNumberA(lpszPath);
+	return tolowerW(lpszPath[0]) - 'a' ;
 }
 
@@ -520,25 +387,31 @@
 BOOL WINAPI PathRemoveFileSpecA(LPSTR lpszPath)
 {
-	LPSTR cutplace;
-
+	LPSTR cutplace = lpszPath;
+	BOOL ret = FALSE;
+	
 	TRACE("%s\n",lpszPath);
 
-	if (!lpszPath[0]) return 0;
-
-	cutplace = PathFindFileNameA(lpszPath);
-	if (cutplace)
-	{
-	  *cutplace='\0';
-	  if (PathIsRootA(lpszPath))
-	  {
-	    PathAddBackslashA(lpszPath);
-	  }
-	  else
-	  {
-	    PathRemoveBackslashA(lpszPath);
-	  }
-	  return TRUE;
-	}
-	return FALSE;
+	if(lpszPath)
+	{
+	  while (*lpszPath == '\\') cutplace = ++lpszPath;
+	  
+	  while (*lpszPath)
+	  {
+	    if(lpszPath[0] == '\\') cutplace = lpszPath;
+	  
+	    if(lpszPath[0] == ':')
+	    {
+	      cutplace = lpszPath + 1;
+	      if (lpszPath[1] == '\\') cutplace++;
+	      lpszPath++;
+	    }
+	    lpszPath = CharNextA(lpszPath);
+	    if (!lpszPath) break;
+	  }
+	  
+	  ret = (*cutplace!='\0');
+	  *cutplace = '\0';
+	}
+	return ret;
 }
 
@@ -548,34 +421,31 @@
 BOOL WINAPI PathRemoveFileSpecW(LPWSTR lpszPath)
 {
-	LPWSTR cutplace;
+	LPWSTR cutplace = lpszPath;
+	BOOL ret = FALSE;
 
 	TRACE("%s\n",debugstr_w(lpszPath));
 
-	if (!lpszPath[0]) return 0;
-	cutplace = PathFindFileNameW(lpszPath);
-	if (cutplace)
-	{
-	  *cutplace='\0';
-	  if (PathIsRootW(lpszPath))
-	  {
-	    PathAddBackslashW(lpszPath);
-	  }
-	  else
-	  {
-	    PathRemoveBackslashW(lpszPath);
-	  }
-	  return TRUE;
-	}
-	return FALSE;
-}
-
-/*************************************************************************
- * PathRemoveFileSpec [SHELL32.35]
- */
-BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath) 
-{
-	if (VERSION_OsIsUnicode())
-	  return PathRemoveFileSpecW(lpszPath);
-	return PathRemoveFileSpecA(lpszPath);
+	if(lpszPath)
+	{
+	  while (*lpszPath == '\\') cutplace = ++lpszPath;
+	  
+	  while (*lpszPath)
+	  {
+	    if(lpszPath[0] == '\\') cutplace = lpszPath;
+	  
+	    if(lpszPath[0] == ':')
+	    {
+	      cutplace = lpszPath + 1;
+	      if (lpszPath[1] == '\\') cutplace++;
+	      lpszPath++;
+	    }
+	    lpszPath = CharNextW(lpszPath);
+	    if (!lpszPath) break;
+	  }
+	  
+	  ret = (*cutplace!='\0');
+	  *cutplace = '\0';
+	}
+	return ret;
 }
 
@@ -593,5 +463,5 @@
 
 	if(lpszFileName)
-	  RtlMoveMemory(lpszPath, lpszFileName, strlen(lpszFileName)); 
+	  RtlMoveMemory(lpszPath, lpszFileName, strlen(lpszFileName)+1); 
 }
 
@@ -605,15 +475,5 @@
 	TRACE("%s\n", debugstr_w(lpszPath));
 	if(lpszFileName)
-	  RtlMoveMemory(lpszPath, lpszFileName, lstrlenW(lpszFileName)*sizeof(WCHAR)); 
-}
-
-/*************************************************************************
- * PathStripPathAW	[SHELL32.38]
- */
-void WINAPI PathStripPathAW(LPVOID lpszPath) 
-{
-	if (VERSION_OsIsUnicode())
-	  PathStripPathW(lpszPath);
-	PathStripPathA(lpszPath);
+	  RtlMoveMemory(lpszPath, lpszFileName, (strlenW(lpszFileName)+1)*sizeof(WCHAR)); 
 }
 
@@ -625,36 +485,8 @@
 	TRACE("%s\n", lpszPath);
 
-	/* X:\ */
-	if (lpszPath[1]==':' && lpszPath[2]=='\\')
-	{
-	  lpszPath[3]='\0';
-	  return TRUE;
-	}
-
-	/* "\" */
-	if (lpszPath[0]=='\\')
-	{
-	  lpszPath[1]='\0';
-	  return TRUE;
-	}
-
-	/* UNC "\\<computer>\<share>" */
-	if (lpszPath[0]=='\\' && lpszPath[1]=='\\')		
-	{
-	  int foundbackslash = 0;
-	  lpszPath += 2;
-	  while (*lpszPath)
-	  {
-	    if (*lpszPath=='\\') foundbackslash++;
-	    if (foundbackslash==2)
-	    {
-	      *lpszPath = '\0';
-	      return TRUE;
-	    }
-	    lpszPath++;
-	  }
-	}
-
-	return FALSE;
+	if (!lpszPath) return FALSE;
+	while(!PathIsRootA(lpszPath))
+	  if (!PathRemoveFileSpecA(lpszPath)) return FALSE;
+	return TRUE;
 }
 
@@ -666,114 +498,69 @@
 	TRACE("%s\n", debugstr_w(lpszPath));
 
-	/* X:\ */
-	if (lpszPath[1]==':' && lpszPath[2]=='\\')
-	{
-	  lpszPath[3]='\0';
-	  return TRUE;
-	}
-
-	/* "\" */
-	if (lpszPath[0]=='\\')
-	{
-	  lpszPath[1]='\0';
-	  return TRUE;
-	}
-
-	/* UNC "\\<computer>\<share>" */
-	if (lpszPath[0]=='\\' && lpszPath[1]=='\\')		
-	{
-	  int foundbackslash = 0;
-	  lpszPath += 2;
-	  while (*lpszPath)
-	  {
-	    if (*lpszPath=='\\') foundbackslash++;
-	    if (foundbackslash==2)
-	    {
-	      *lpszPath = '\0';
-	      return TRUE;
-	    }
-	    lpszPath++;
-	  }
-	}
-
-	return FALSE;
-}
-
-/*************************************************************************
- * PathStripToRootAW	[SHELL32.50]
- */
-BOOL WINAPI PathStripToRootAW(LPVOID lpszPath) 
-{
-	if (VERSION_OsIsUnicode())
-	  return PathStripToRootW(lpszPath);
-	return PathStripToRootA(lpszPath);
+	if (!lpszPath) return FALSE;
+	while(!PathIsRootW(lpszPath))
+	  if (!PathRemoveFileSpecW(lpszPath)) return FALSE;
+	return TRUE;
 }
 
 /*************************************************************************
  * PathRemoveArgsA	[SHLWAPI.@]
+ *
  */
 void WINAPI PathRemoveArgsA(LPSTR lpszPath)
 {
-	LPSTR lpszArgs = PathGetArgsA(lpszPath);
+	TRACE("%s\n",lpszPath);
+	
+	if(lpszPath)
+	{
+	  LPSTR lpszArgs = PathGetArgsA(lpszPath);
+	  if (!*lpszArgs)
+	  {
+	    LPSTR lpszLastChar = CharPrevA(lpszPath, lpszArgs);
+	    if(*lpszLastChar==' ') *lpszLastChar = '\0';
+	  }
+	}
+}
+
+/*************************************************************************
+ * PathRemoveArgsW	[SHLWAPI.@]
+ */
+void WINAPI PathRemoveArgsW(LPWSTR lpszPath)
+{
+	TRACE("%s\n", debugstr_w(lpszPath));
+
+	if(lpszPath)
+	{
+	  LPWSTR lpszArgs = PathGetArgsW(lpszPath);
+	  if (!*lpszArgs)
+	  {
+	    LPWSTR lpszLastChar = CharPrevW(lpszPath, lpszArgs);
+	    if(*lpszLastChar==' ') *lpszLastChar = '\0';
+	  }
+	}
+}
+
+/*************************************************************************
+ * PathRemoveExtensionA		[SHLWAPI.@]
+ */
+void WINAPI PathRemoveExtensionA(LPSTR lpszPath)
+{
+	LPSTR lpszExtension = PathFindExtensionA(lpszPath);
 
 	TRACE("%s\n", lpszPath);
 
-	if (lpszArgs) *(--lpszArgs)='\0';
-}
-
-/*************************************************************************
- * PathRemoveArgsW	[SHLWAPI.@]
- */
-void WINAPI PathRemoveArgsW(LPWSTR lpszPath)
-{
-	LPWSTR lpszArgs = PathGetArgsW(lpszPath);
+	if (lpszExtension) *lpszExtension='\0';
+}
+
+/*************************************************************************
+ * PathRemoveExtensionW		[SHLWAPI.@]
+ */
+void WINAPI PathRemoveExtensionW(LPWSTR lpszPath)
+{
+	LPWSTR lpszExtension = PathFindExtensionW(lpszPath);
 
 	TRACE("%s\n", debugstr_w(lpszPath));
 
-	if (lpszArgs) *(--lpszArgs)='\0';
-}
-
-/*************************************************************************
- * PathRemoveArgsAW	[SHELL32.251]
- */
-void WINAPI PathRemoveArgsAW(LPVOID lpszPath) 
-{
-	if (VERSION_OsIsUnicode())
-	  PathRemoveArgsW(lpszPath);
-	PathRemoveArgsA(lpszPath);
-}
-
-/*************************************************************************
- * PathRemoveExtensionA		[SHLWAPI.@]
- */
-void WINAPI PathRemoveExtensionA(LPSTR lpszPath)
-{
-	LPSTR lpszExtension = PathFindExtensionA(lpszPath);
-
-	TRACE("%s\n", lpszPath);
-
 	if (lpszExtension) *lpszExtension='\0';
-}
-
-/*************************************************************************
- * PathRemoveExtensionW		[SHLWAPI.@]
- */
-void WINAPI PathRemoveExtensionW(LPWSTR lpszPath)
-{
-	LPWSTR lpszExtension = PathFindExtensionW(lpszPath);
-
-	TRACE("%s\n", debugstr_w(lpszPath));
-
-	if (lpszExtension) *lpszExtension='\0';
-}
-
-/*************************************************************************
- * PathRemoveExtensionAW	[SHELL32.250]
- */
-void WINAPI PathRemoveExtensionAW(LPVOID lpszPath) 
-{
-	if (VERSION_OsIsUnicode())
-	  PathRemoveExtensionW(lpszPath);
-	PathRemoveExtensionA(lpszPath);
 }
 
@@ -786,12 +573,22 @@
  * the address of the last character is returned.
  *
+ * FIXME
+ *  "c:\": keep backslash
  */
 LPSTR WINAPI PathRemoveBackslashA( LPSTR lpszPath )
 {
-	LPSTR p = lpszPath;
-	
-	while (*lpszPath) p = lpszPath++;
-	if ( *p == (CHAR)'\\') *p = (CHAR)'\0';
-	return p;
+	int len;
+	LPSTR szTemp = NULL;
+	
+	if(lpszPath)
+	{
+	  len = strlen(lpszPath);
+	  szTemp = CharPrevA(lpszPath, lpszPath+len);
+	  if (! PathIsRootA(lpszPath))
+	  {
+	    if (*szTemp == '\\') *szTemp = '\0';
+	  }
+	}
+	return szTemp;
 }
 
@@ -801,42 +598,23 @@
 LPWSTR WINAPI PathRemoveBackslashW( LPWSTR lpszPath )
 {
-	LPWSTR p = lpszPath;
-	
-	while (*lpszPath); p = lpszPath++;
-	if ( *p == (WCHAR)'\\') *p = (WCHAR)'\0';
-	return p;
-}
+	int len;
+	LPWSTR szTemp = NULL;
+	
+	if(lpszPath)
+	{
+	  len = strlenW(lpszPath);
+	  szTemp = CharPrevW(lpszPath, lpszPath+len);
+	  if (! PathIsRootW(lpszPath))
+	  {
+	    if (*szTemp == '\\') *szTemp = '\0';
+	  }
+	}
+	return szTemp;
+}
+
 
 /*
 	Path Manipulations
 */
-
-/*************************************************************************
- * PathGetShortPathA [internal]
- */
-LPSTR WINAPI PathGetShortPathA(LPSTR lpszPath)
-{
-	FIXME("%s stub\n", lpszPath);
-	return NULL;
-}
-
-/*************************************************************************
- * PathGetShortPathW [internal]
- */
-LPWSTR WINAPI PathGetShortPathW(LPWSTR lpszPath)
-{
-	FIXME("%s stub\n", debugstr_w(lpszPath));
-	return NULL;
-}
-
-/*************************************************************************
- * PathGetShortPathAW [SHELL32.92]
- */
-LPVOID WINAPI PathGetShortPathAW(LPVOID lpszPath)
-{
-	if(VERSION_OsIsUnicode())
-	  return PathGetShortPathW(lpszPath);
-	return PathGetShortPathA(lpszPath);
-}
 
 /*************************************************************************
@@ -846,5 +624,5 @@
  *     remove spaces from beginning and end of passed string
  */
-LPSTR WINAPI PathRemoveBlanksA(LPSTR str)
+void WINAPI PathRemoveBlanksA(LPSTR str)
 {
 	LPSTR x = str;
@@ -852,15 +630,12 @@
 	TRACE("%s\n",str);
 
-	while (*x==' ') x++;
-	if (x!=str)
-	  strcpy(str,x);
-	if (!*str)
-	  return str;
-	x=str+strlen(str)-1;
-	while (*x==' ')
-	  x--;
-	if (*x==' ')
-	  *x='\0';
-	return x;
+	if(str)
+	{
+	  while (*x==' ') x = CharNextA(x);
+	  if (x!=str) strcpy(str,x);
+	  x=str+strlen(str)-1;
+	  while (*x==' ') x = CharPrevA(str, x);
+	  if (*x==' ') *x='\0';
+	}
 }
 
@@ -868,5 +643,5 @@
  * PathRemoveBlanksW [SHLWAPI.@]
  */
-LPWSTR WINAPI PathRemoveBlanksW(LPWSTR str)
+void WINAPI PathRemoveBlanksW(LPWSTR str)
 {
 	LPWSTR x = str;
@@ -874,25 +649,12 @@
 	TRACE("%s\n",debugstr_w(str));
 
-	while (*x==' ') x++;
-	if (x!=str)
-	  CRTDLL_wcscpy(str,x);
-	if (!*str)
-	  return str;
-	x=str+CRTDLL_wcslen(str)-1;
-	while (*x==' ')
-	  x--;
-	if (*x==' ')
-	  *x='\0';
-	return x;
-}
-
-/*************************************************************************
- * PathRemoveBlanksAW [SHELL32.33]
- */
-LPVOID WINAPI PathRemoveBlanksAW(LPVOID str)
-{
-	if(VERSION_OsIsUnicode())
-	  return PathRemoveBlanksW(str);
-	return PathRemoveBlanksA(str);
+	if(str)
+	{
+	  while (*x==' ') x = CharNextW(x);
+	  if (x!=str) strcpyW(str,x);
+	  x=str+strlenW(str)-1;
+	  while (*x==' ') x = CharPrevW(str, x);
+	  if (*x==' ') *x='\0';
+	}
 }
 
@@ -900,9 +662,19 @@
  * PathQuoteSpacesA [SHLWAPI.@]
  * 
- * NOTES
  */
 LPSTR WINAPI PathQuoteSpacesA(LPSTR lpszPath)
 {
-	FIXME("%s\n",lpszPath);
+	TRACE("%s\n",lpszPath);
+
+	if(StrChrA(lpszPath,' '))
+	{
+	  int len = strlen(lpszPath);
+	  RtlMoveMemory(lpszPath+1, lpszPath, len);
+	  *(lpszPath++) = '"';
+	  lpszPath += len;
+	  *(lpszPath++) = '"';
+	  *(lpszPath) = '\0';
+	  return --lpszPath;
+	}
 	return 0;
 }
@@ -913,16 +685,17 @@
 LPWSTR WINAPI PathQuoteSpacesW(LPWSTR lpszPath)
 {
-	FIXME("%s\n",debugstr_w(lpszPath));
-	return 0;	
-}
-
-/*************************************************************************
- * PathQuoteSpacesAW [SHELL32.55]
- */
-LPVOID WINAPI PathQuoteSpacesAW (LPVOID lpszPath)
-{
-	if(VERSION_OsIsUnicode())
-	  return PathQuoteSpacesW(lpszPath);
-	return PathQuoteSpacesA(lpszPath);
+	TRACE("%s\n",debugstr_w(lpszPath));
+
+	if(StrChrW(lpszPath,' '))
+	{
+	  int len = strlenW(lpszPath);
+	  RtlMoveMemory(lpszPath+1, lpszPath, len*sizeof(WCHAR));
+	  *(lpszPath++) = '"';
+	  lpszPath += len;
+	  *(lpszPath++) = '"';
+	  *(lpszPath) = '\0';
+	  return --lpszPath;
+	}
+	return 0;
 }
 
@@ -935,5 +708,5 @@
 VOID WINAPI PathUnquoteSpacesA(LPSTR str) 
 {
-	DWORD len = lstrlenA(str);
+	DWORD len = strlen(str);
 
 	TRACE("%s\n",str);
@@ -944,5 +717,5 @@
 	  return;
 	str[len-1]='\0';
-	lstrcpyA(str,str+1);
+	strcpy(str,str+1);
 	return;
 }
@@ -953,5 +726,5 @@
 VOID WINAPI PathUnquoteSpacesW(LPWSTR str) 
 {
-	DWORD len = CRTDLL_wcslen(str);
+	DWORD len = strlenW(str);
 
 	TRACE("%s\n",debugstr_w(str));
@@ -962,17 +735,6 @@
 	  return;
 	str[len-1]='\0';
-	CRTDLL_wcscpy(str,str+1);
+	strcpyW(str,str+1);
 	return;
-}
-
-/*************************************************************************
- * PathUnquoteSpacesAW [SHELL32.56]
- */
-VOID WINAPI PathUnquoteSpacesAW(LPVOID str) 
-{
-	if(VERSION_OsIsUnicode())
-	  PathUnquoteSpacesW(str);
-	else
-	  PathUnquoteSpacesA(str);
 }
 
@@ -991,4 +753,6 @@
 /*	  return atoi(&lpstrComma[1]);	FIXME */
 	}
+	
+	PathUnquoteSpacesA(lpszPath);
 	return 0;
 }
@@ -999,5 +763,5 @@
 int WINAPI PathParseIconLocationW(LPWSTR lpszPath)
 {
-	LPWSTR lpstrComma = CRTDLL_wcschr(lpszPath, ',');
+	LPWSTR lpstrComma = strchrW(lpszPath, ',');
 	
 	FIXME("%s stub\n", debugstr_w(lpszPath));
@@ -1008,20 +772,60 @@
 /*	  return _wtoi(&lpstrComma[1]);	FIXME */
 	}
+	PathUnquoteSpacesW(lpszPath);
 	return 0;
 }
 
-/*************************************************************************
- * PathParseIconLocationAW	[SHELL32.249]
- */
-int WINAPI PathParseIconLocationAW (LPVOID lpszPath)
-{
-	if(VERSION_OsIsUnicode())
-	  return PathParseIconLocationW(lpszPath);
-	return PathParseIconLocationA(lpszPath);
-}
-
 /*
-	Path Testing
+	########## cleaning and resolving paths ##########
+ */
+
+/*************************************************************************
+ * PathFindOnPathA	[SHLWAPI.@]
+ */
+BOOL WINAPI PathFindOnPathA(LPSTR sFile, LPCSTR sOtherDirs)
+{
+	FIXME("%s %s\n",sFile, sOtherDirs);
+	return FALSE;
+}
+
+/*************************************************************************
+ * PathFindOnPathW	[SHLWAPI.@]
+ */
+BOOL WINAPI PathFindOnPathW(LPWSTR sFile, LPCWSTR sOtherDirs)
+{
+	FIXME("%s %s\n",debugstr_w(sFile), debugstr_w(sOtherDirs));
+	return FALSE;
+}
+
+/*************************************************************************
+ *	PathCompactPathExA   [SHLWAPI.@]
+ */
+BOOL WINAPI PathCompactPathExA(
+	LPSTR pszOut,
+	LPCSTR pszSrc,
+	UINT cchMax,
+	DWORD dwFlags)
+{
+	FIXME("%p %s 0x%08x 0x%08lx\n", pszOut, pszSrc, cchMax, dwFlags);
+	return FALSE;
+}
+
+/*************************************************************************
+ *	PathCompactPathExW   [SHLWAPI.@]
+ */
+BOOL WINAPI PathCompactPathExW(
+	LPWSTR pszOut,
+	LPCWSTR pszSrc,
+	UINT cchMax,
+	DWORD dwFlags)
+{
+	FIXME("%p %s 0x%08x 0x%08lx\n", pszOut, debugstr_w(pszSrc), cchMax, dwFlags);
+	return FALSE;
+}
+
+/*
+	########## Path Testing ##########
 */
+
 /*************************************************************************
  * PathIsUNCA		[SHLWAPI.@]
@@ -1048,14 +852,4 @@
 
 /*************************************************************************
- * PathIsUNCAW		[SHELL32.39]
- */
-BOOL WINAPI PathIsUNCAW (LPCVOID lpszPath)
-{
-	if (VERSION_OsIsUnicode())
-	  return PathIsUNCW( lpszPath );
-	return PathIsUNCA( lpszPath );  
-}
-
-/*************************************************************************
  *  PathIsRelativeA	[SHLWAPI.@]
  */
@@ -1075,14 +869,4 @@
 
 	return (lpszPath && (lpszPath[0]!='\\' && lpszPath[1]!=':'));
-}
-
-/*************************************************************************
- *  PathIsRelativeAW	[SHELL32.40]
- */
-BOOL WINAPI PathIsRelativeAW (LPCVOID lpszPath)
-{
-	if (VERSION_OsIsUnicode())
-	  return PathIsRelativeW( lpszPath );
-	return PathIsRelativeA( lpszPath );  
 }
 
@@ -1112,7 +896,8 @@
 	  while (*lpszPath)
 	  {
-	    if (*(lpszPath++)=='\\') foundbackslash++;
-	  }
-	  if (foundbackslash==1)
+	    if (*lpszPath=='\\') foundbackslash++;
+	    lpszPath = CharNextA(lpszPath);
+	  }
+	  if (foundbackslash <= 1)
 	    return TRUE;
 	}
@@ -1142,7 +927,8 @@
 	  while (*lpszPath)
 	  {
-	    if (*(lpszPath++)=='\\') foundbackslash++;
-	  }
-	  if (foundbackslash==1)
+	    if (*lpszPath=='\\') foundbackslash++;
+	    lpszPath = CharNextW(lpszPath);
+	  }
+	  if (foundbackslash <= 1)
 	    return TRUE;
 	}
@@ -1152,78 +938,14 @@
 
 /*************************************************************************
- * PathIsRootAW		[SHELL32.29]
- */
-BOOL WINAPI PathIsRootAW(LPCVOID lpszPath) 
-{
-	if (VERSION_OsIsUnicode())
-	  return PathIsRootW(lpszPath);
-	return PathIsRootA(lpszPath);
-}
-
-/*************************************************************************
- *  PathIsExeA		[internal]
- */
-BOOL WINAPI PathIsExeA (LPCSTR lpszPath)
-{
-	LPCSTR lpszExtension = PathGetExtensionA(lpszPath);
-	int i = 0;
-	static char * lpszExtensions[6] = {"exe", "com", "pid", "cmd", "bat", NULL };
-	
-	TRACE("path=%s\n",lpszPath);
-
-	for(i=0; lpszExtensions[i]; i++)
-	  if (!strcasecmp(lpszExtension,lpszExtensions[i])) return TRUE;
-	  
-	return FALSE;
-}
-
-/*************************************************************************
- *  PathIsExeW		[internal]
- */
-BOOL WINAPI PathIsExeW (LPCWSTR lpszPath)
-{
-	LPCWSTR lpszExtension = PathGetExtensionW(lpszPath);
-	int i = 0;
-	static WCHAR lpszExtensions[6][4] =
-	  {{'e','x','e','\0'}, {'c','o','m','\0'}, {'p','i','d','\0'},
-	   {'c','m','d','\0'}, {'b','a','t','\0'}, {'\0'} };
-	
-	TRACE("path=%s\n",debugstr_w(lpszPath));
-
-	for(i=0; lpszExtensions[i]; i++)
-	  if (!CRTDLL__wcsicmp(lpszExtension,lpszExtensions[i])) return TRUE;
-	  
-	return FALSE;
-}
-
-/*************************************************************************
- *  PathIsExeAW		[SHELL32.43]
- */
-BOOL WINAPI PathIsExeAW (LPCVOID path)
-{
-	if (VERSION_OsIsUnicode())
-	  return PathIsExeW (path);
-	return PathIsExeA(path);
-}
-
-/*************************************************************************
  * PathIsDirectoryA	[SHLWAPI.@]
  */
 BOOL WINAPI PathIsDirectoryA(LPCSTR lpszPath)
 {
-	HANDLE hFile;
-	WIN32_FIND_DATAA stffile;
-	
+	DWORD dwAttr;
+
 	TRACE("%s\n", debugstr_a(lpszPath));
 
-	hFile = FindFirstFileA(lpszPath, &stffile);
-
-	if ( hFile != INVALID_HANDLE_VALUE )
-	{
-	  FindClose (hFile);
-          return (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
-	}
-
-	return FALSE;	
+	dwAttr = GetFileAttributesA(lpszPath);
+	return  (dwAttr != -1) ? dwAttr & FILE_ATTRIBUTE_DIRECTORY : 0;
 }
 
@@ -1233,28 +955,10 @@
 BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
 {
-	HANDLE hFile;
-	WIN32_FIND_DATAW stffile;
+	DWORD dwAttr;
 	
 	TRACE("%s\n", debugstr_w(lpszPath));
 
-	hFile = FindFirstFileW(lpszPath, &stffile);
-
-	if ( hFile != INVALID_HANDLE_VALUE )
-	{
-	  FindClose (hFile);
-          return (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
-	}
-
-	return FALSE;	
-}
-
-/*************************************************************************
- * PathIsDirectoryAW	[SHELL32.159]
- */
-BOOL WINAPI PathIsDirectoryAW (LPCVOID lpszPath)
-{
-	if (VERSION_OsIsUnicode())
-	  return PathIsDirectoryW (lpszPath);
-	return PathIsDirectoryA (lpszPath);
+	dwAttr = GetFileAttributesW(lpszPath);
+	return  (dwAttr != -1) ? dwAttr & FILE_ATTRIBUTE_DIRECTORY : 0;
 }
 
@@ -1278,14 +982,4 @@
 	TRACE("%s\n",debugstr_w(lpszPath));
 	return  (GetFileAttributesW(lpszPath)!=-1);
-}
-
-/*************************************************************************
- * PathFileExistsAW	[SHELL32.45]
- */ 
-BOOL WINAPI PathFileExistsAW (LPCVOID lpszPath)
-{
-	if (VERSION_OsIsUnicode())
-	  return PathFileExistsW (lpszPath);
-	return PathFileExistsA (lpszPath);
 }
 
@@ -1309,6 +1003,6 @@
 	  }
 	  if (toupper(*mask)!=toupper(*name) && *mask!='?') return 0;
-	  name++;
-	  mask++;
+	  name = CharNextA(name);
+	  mask = CharNextA(mask);
 	}
 	if (!*name) 
@@ -1335,7 +1029,7 @@
 	    return 0;
 	  }
-	  if (towupper(*mask)!=towupper(*name) && *mask!='?') return 0;
-	  name++;
-	  mask++;
+	  if (toupperW(*mask)!=toupperW(*name) && *mask!='?') return 0;
+	  name = CharNextW(name);
+	  mask = CharNextW(mask);
 	}
 	if (!*name) 
@@ -1361,5 +1055,5 @@
 	{
 	  if (PathMatchSingleMaskA(name,mask)) return 1;    /* helper function */
-	  while (*mask && *mask!=';') mask++;
+	  while (*mask && *mask!=';') mask = CharNextA(mask);
 	  if (*mask==';') 
 	  {
@@ -1385,5 +1079,5 @@
 	{
 	  if (PathMatchSingleMaskW(name,mask)) return 1;    /* helper function */
-	  while (*mask && *mask!=';') mask++;
+	  while (*mask && *mask!=';') mask = CharNextW(mask);
 	  if (*mask==';') 
 	  {
@@ -1393,14 +1087,4 @@
 	}
 	return 0;
-}
-
-/*************************************************************************
- * PathMatchSpecAW	[SHELL32.46]
- */
-BOOL WINAPI PathMatchSpecAW(LPVOID name, LPVOID mask) 
-{
-	if (VERSION_OsIsUnicode())
-	  return PathMatchSpecW( name, mask );
-	return PathMatchSpecA( name, mask );
 }
 
@@ -1433,5 +1117,5 @@
 	    if (lpszPath1[pos]=='\\') bsfound++;
 	    if (bsfound == 2) return TRUE;
-	    pos++;
+	    pos++; /* fixme: use CharNext*/
 	  }
 	  return (lpszPath1[pos] == lpszPath2[pos]);
@@ -1450,5 +1134,5 @@
 
 	/* usual path */
-	if ( towupper(lpszPath1[0])==towupper(lpszPath2[0]) &&
+	if ( toupperW(lpszPath1[0])==toupperW(lpszPath2[0]) &&
 	     lpszPath1[1]==':' && lpszPath2[1]==':' &&
 	     lpszPath1[2]=='\\' && lpszPath2[2]=='\\')
@@ -1465,19 +1149,9 @@
 	    if (lpszPath1[pos]=='\\') bsfound++;
 	    if (bsfound == 2) return TRUE;
-	    pos++;
+	    pos++;/* fixme: use CharNext*/
 	  }
 	  return (lpszPath1[pos] == lpszPath2[pos]);
 	}
 	return FALSE;
-}
-
-/*************************************************************************
- * PathIsSameRootAW	[SHELL32.650]
- */
-BOOL WINAPI PathIsSameRootAW(LPCVOID lpszPath1, LPCVOID lpszPath2)
-{
-	if (VERSION_OsIsUnicode())
-	  return PathIsSameRootW(lpszPath1, lpszPath2);
-	return PathIsSameRootA(lpszPath1, lpszPath2);
 }
 
@@ -1502,5 +1176,5 @@
 	{
 	  if (iSize == strlen(SupportedProtocol[i]))
-	    if(!strncasecmp(lpstrPath, SupportedProtocol[i], iSize));
+	    if(!strncasecmp(lpstrPath, SupportedProtocol[i], iSize))
 	      return TRUE;
 	  i++;
@@ -1525,5 +1199,5 @@
 
 	/* get protocol        */
-	lpstrRes = CRTDLL_wcschr(lpstrPath,':');
+	lpstrRes = strchrW(lpstrPath,':');
 	if(!lpstrRes) return FALSE;
 	iSize = lpstrRes - lpstrPath;
@@ -1531,6 +1205,6 @@
 	while(SupportedProtocol[i])
 	{
-	  if (iSize == CRTDLL_wcslen(SupportedProtocol[i]))
-	    if(!CRTDLL__wcsnicmp(lpstrPath, SupportedProtocol[i], iSize));
+	  if (iSize == strlenW(SupportedProtocol[i]))
+	    if(!strncmpiW(lpstrPath, SupportedProtocol[i], iSize))
 	      return TRUE;
 	  i++;
@@ -1540,550 +1214,122 @@
 }  
 
-/*************************************************************************
- * IsLFNDriveA		[SHELL32.119]
- * 
- * NOTES
- *     exported by ordinal Name
- */
-BOOL WINAPI IsLFNDriveA(LPCSTR lpszPath) 
-{
-    DWORD	fnlen;
-
-    if (!GetVolumeInformationA(lpszPath,NULL,0,NULL,&fnlen,NULL,NULL,0))
-	return FALSE;
-    return fnlen>12;
-}
-
-/*
-	Creating Something Unique
-*/
-/*************************************************************************
- * PathMakeUniqueNameA	[internal]
- */
-BOOL WINAPI PathMakeUniqueNameA(
-	LPSTR lpszBuffer,
-	DWORD dwBuffSize, 
-	LPCSTR lpszShortName,
-	LPCSTR lpszLongName,
-	LPCSTR lpszPathName)
-{
-	FIXME("%p %lu %s %s %s stub\n",
-	 lpszBuffer, dwBuffSize, debugstr_a(lpszShortName),
-	 debugstr_a(lpszLongName), debugstr_a(lpszPathName));
-	return TRUE;
-}
-
-/*************************************************************************
- * PathMakeUniqueNameW	[internal]
- */
-BOOL WINAPI PathMakeUniqueNameW(
-	LPWSTR lpszBuffer,
-	DWORD dwBuffSize, 
-	LPCWSTR lpszShortName,
-	LPCWSTR lpszLongName,
-	LPCWSTR lpszPathName)
-{
-	FIXME("%p %lu %s %s %s stub\n",
-	 lpszBuffer, dwBuffSize, debugstr_w(lpszShortName),
-	 debugstr_w(lpszLongName), debugstr_w(lpszPathName));
-	return TRUE;
-}
-
-/*************************************************************************
- * PathMakeUniqueNameAW	[SHELL32.47]
- */
-BOOL WINAPI PathMakeUniqueNameAW(
-	LPVOID lpszBuffer,
-	DWORD dwBuffSize, 
-	LPCVOID lpszShortName,
-	LPCVOID lpszLongName,
-	LPCVOID lpszPathName)
-{
-	if (VERSION_OsIsUnicode())
-	  return PathMakeUniqueNameW(lpszBuffer,dwBuffSize, lpszShortName,lpszLongName,lpszPathName);
-	return PathMakeUniqueNameA(lpszBuffer,dwBuffSize, lpszShortName,lpszLongName,lpszPathName);
-}
-
-/*************************************************************************
- * PathYetAnotherMakeUniqueNameA [SHELL32.75]
- * 
- * NOTES
- *     exported by ordinal
- */
-BOOL WINAPI PathYetAnotherMakeUniqueNameA(
-	LPSTR lpszBuffer,
-	LPCSTR lpszPathName,
-	LPCSTR lpszShortName,
-	LPCSTR lpszLongName)
-{
-    FIXME("(%p,%p, %p ,%p):stub.\n",
-     lpszBuffer, lpszPathName, lpszShortName, lpszLongName);
-    return TRUE;
-}
-
-/*************************************************************************
- * PathYetAnotherMakeUniqueNameA [SHELL32.75]
- * 
- * NOTES
- *     exported by ordinal
- */
-BOOL WINAPI PathYetAnotherMakeUniqueNameW(
-	LPWSTR lpszBuffer,
-	LPCWSTR lpszPathName,
-	LPCWSTR lpszShortName,
-	LPCWSTR lpszLongName)
-{
-    FIXME("(%p,%p, %p ,%p):stub.\n",
-     lpszBuffer, lpszPathName, lpszShortName, lpszLongName);
-    return TRUE;
-}
-
-BOOL WINAPI PathYetAnotherMakeUniqueNameAW(
-	LPSTR lpszBuffer,
-	LPCSTR lpszPathName,
-	LPCSTR lpszShortName,
-	LPCSTR lpszLongName)
-{
-	if (VERSION_OsIsUnicode())
-	  return PathYetAnotherMakeUniqueNameW((LPWSTR)lpszBuffer,(LPCWSTR)lpszPathName, (LPCWSTR)lpszShortName,(LPCWSTR)lpszLongName);
-	return PathYetAnotherMakeUniqueNameA(lpszBuffer, lpszPathName, lpszShortName,lpszLongName);
-}
-
-
-/*
-	cleaning and resolving paths 
- */
-
-/*************************************************************************
- * PathFindOnPathA	[SHELL32.479]
- */
-BOOL WINAPI PathFindOnPathA(LPSTR sFile, LPCSTR sOtherDirs)
-{
-	FIXME("%s %s\n",sFile, sOtherDirs);
-	return FALSE;
-}
-
-/*************************************************************************
- * PathFindOnPathW	[SHELL32]
- */
-BOOL WINAPI PathFindOnPathW(LPWSTR sFile, LPCWSTR sOtherDirs)
-{
-	FIXME("%s %s\n",debugstr_w(sFile), debugstr_w(sOtherDirs));
-	return FALSE;
-}
-
-/*************************************************************************
- * PathFindOnPathAW	[SHELL32]
- */
-BOOL WINAPI PathFindOnPathAW(LPVOID sFile, LPCVOID sOtherDirs)
-{
-	if (VERSION_OsIsUnicode())
-	  return PathFindOnPathW(sFile, sOtherDirs);
-	return PathFindOnPathA(sFile, sOtherDirs);
-}
-
-/*************************************************************************
- * PathCleanupSpecA	[SHELL32.171]
- */
-DWORD WINAPI PathCleanupSpecA(LPSTR x, LPSTR y)
-{
-	FIXME("(%p %s, %p %s) stub\n",x,debugstr_a(x),y,debugstr_a(y));
-	return TRUE;
-}
-
-/*************************************************************************
- * PathCleanupSpecA	[SHELL32]
- */
-DWORD WINAPI PathCleanupSpecW(LPWSTR x, LPWSTR y)
-{
-	FIXME("(%p %s, %p %s) stub\n",x,debugstr_w(x),y,debugstr_w(y));
-	return TRUE;
-}
-
-/*************************************************************************
- * PathCleanupSpecAW	[SHELL32]
- */
-DWORD WINAPI PathCleanupSpecAW (LPVOID x, LPVOID y)
-{
-	if (VERSION_OsIsUnicode())
-	  return PathCleanupSpecW(x,y);
-	return PathCleanupSpecA(x,y);
-}
-
-/*************************************************************************
- * PathQualifyA		[SHELL32]
- */
-BOOL WINAPI PathQualifyA(LPCSTR pszPath) 
-{
-	FIXME("%s\n",pszPath);
-	return 0;
-}
-
-/*************************************************************************
- * PathQualifyW		[SHELL32]
- */
-BOOL WINAPI PathQualifyW(LPCWSTR pszPath) 
-{
-	FIXME("%s\n",debugstr_w(pszPath));
-	return 0;
-}
-
-/*************************************************************************
- * PathQualifyAW	[SHELL32]
- */
-BOOL WINAPI PathQualifyAW(LPCVOID pszPath) 
-{
-	if (VERSION_OsIsUnicode())
-	  return PathQualifyW(pszPath);
-	return PathQualifyA(pszPath);
-}
-
-/*************************************************************************
- * PathResolveA [SHELL32.51]
- */
-BOOL WINAPI PathResolveA(
-	LPSTR lpszPath,
-	LPCSTR *alpszPaths, 
-	DWORD dwFlags)
-{
-	FIXME("(%s,%p,0x%08lx),stub!\n",
-	  lpszPath, *alpszPaths, dwFlags);
-	return 0;
-}
-
-/*************************************************************************
- * PathResolveW [SHELL32]
- */
-BOOL WINAPI PathResolveW(
-	LPWSTR lpszPath,
-	LPCWSTR *alpszPaths, 
-	DWORD dwFlags)
-{
-	FIXME("(%s,%p,0x%08lx),stub!\n",
-	  debugstr_w(lpszPath), debugstr_w(*alpszPaths), dwFlags);
-	return 0;
-}
-
-/*************************************************************************
- * PathResolveAW [SHELL32]
- */
-BOOL WINAPI PathResolveAW(
-	LPVOID lpszPath,
-	LPCVOID *alpszPaths, 
-	DWORD dwFlags)
-{
-	if (VERSION_OsIsUnicode())
-	  return PathResolveW(lpszPath, (LPCWSTR*)alpszPaths, dwFlags);
-	return PathResolveA(lpszPath, (LPCSTR*)alpszPaths, dwFlags);
-}
-
-/*************************************************************************
-*	PathProcessCommandA	[SHELL32.653]
-*/
-HRESULT WINAPI PathProcessCommandA (
-	LPCSTR lpszPath,
-	LPSTR lpszBuff,
-	DWORD dwBuffSize,
-	DWORD dwFlags)
-{
-	FIXME("%s %p 0x%04lx 0x%04lx stub\n",
-	lpszPath, lpszBuff, dwBuffSize, dwFlags);
-	lstrcpyA(lpszBuff, lpszPath);
-	return 0;
-}
-
-/*************************************************************************
-*	PathProcessCommandW
-*/
-HRESULT WINAPI PathProcessCommandW (
-	LPCWSTR lpszPath,
-	LPWSTR lpszBuff,
-	DWORD dwBuffSize,
-	DWORD dwFlags)
-{
-	FIXME("(%s, %p, 0x%04lx, 0x%04lx) stub\n",
-	debugstr_w(lpszPath), lpszBuff, dwBuffSize, dwFlags);
-	lstrcpyW(lpszBuff, lpszPath);
-	return 0;
-}
-
-/*************************************************************************
-*	PathProcessCommandAW
-*/
-HRESULT WINAPI PathProcessCommandAW (
-	LPCVOID lpszPath,
-	LPVOID lpszBuff,
-	DWORD dwBuffSize,
-	DWORD dwFlags)
-{
-	if (VERSION_OsIsUnicode())
-	  return PathProcessCommandW(lpszPath, lpszBuff, dwBuffSize, dwFlags);
-	return PathProcessCommandA(lpszPath, lpszBuff, dwBuffSize, dwFlags);
-}
-
-/*
-	special
-*/
-
-/*************************************************************************
- * PathSetDlgItemPathA
- *
- * NOTES
- *  use PathCompactPath to make sure, the path fits into the control
- */
-BOOL WINAPI PathSetDlgItemPathA(HWND hDlg, int id, LPCSTR pszPath) 
-{	TRACE("%x %x %s\n",hDlg, id, pszPath);
-	return SetDlgItemTextA(hDlg, id, pszPath);
-}
-
-/*************************************************************************
- * PathSetDlgItemPathW
- */
-BOOL WINAPI PathSetDlgItemPathW(HWND hDlg, int id, LPCWSTR pszPath) 
-{	TRACE("%x %x %s\n",hDlg, id, debugstr_w(pszPath));
-	return SetDlgItemTextW(hDlg, id, pszPath);
-}
-
-/*************************************************************************
- * PathSetDlgItemPathAW
- */
-BOOL WINAPI PathSetDlgItemPathAW(HWND hDlg, int id, LPCVOID pszPath) 
-{	if (VERSION_OsIsUnicode())
-	  return PathSetDlgItemPathW(hDlg, id, pszPath);
-	return PathSetDlgItemPathA(hDlg, id, pszPath);
-}
-
-
-/*************************************************************************
- * SHGetSpecialFolderPathA [SHELL32.175]
- * 
- * converts csidl to path
- * 
- */
- 
-static char * szSHFolders = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders";
-static char * szSHUserFolders = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders";
-
-BOOL WINAPI SHGetSpecialFolderPathA (
-	HWND hwndOwner,
-	LPSTR szPath,
-	DWORD csidl,
-	BOOL bCreate)
-{
-	CHAR	szValueName[MAX_PATH], szDefaultPath[MAX_PATH];
-	HKEY	hRootKey, hKey;
-	BOOL	bRelative = TRUE;
-	DWORD	dwType, dwDisp, dwPathLen = MAX_PATH;
-
-	TRACE("0x%04x,%p,csidl=%lu,0x%04x\n", hwndOwner,szPath,csidl,bCreate);
-
-	/* build default values */
-	switch(csidl)
-	{
-	  case CSIDL_APPDATA:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy (szValueName, "AppData");
-	    strcpy (szDefaultPath, "AppData");
-	    break;
-
-	  case CSIDL_COOKIES:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy (szValueName, "Cookies");
-	    strcpy(szDefaultPath, "Cookies");
-	    break;
-
-	  case CSIDL_DESKTOPDIRECTORY:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "Desktop");
-	    strcpy(szDefaultPath, "Desktop");
-	    break;
-
-	  case CSIDL_COMMON_DESKTOPDIRECTORY:
-	    hRootKey = HKEY_LOCAL_MACHINE;
-	    strcpy(szValueName, "Common Desktop");
-	    strcpy(szDefaultPath, "Desktop");
-	    break;
-
-	  case CSIDL_FAVORITES:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "Favorites");
-	    strcpy(szDefaultPath, "Favorites");
-	    break;
-
-	  case CSIDL_FONTS:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "Fonts");
-	    strcpy(szDefaultPath, "Fonts");
-	    break;
-
-	  case CSIDL_HISTORY:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "History");
-	    strcpy(szDefaultPath, "History");
-	    break;
-
-	  case CSIDL_NETHOOD:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "NetHood");
-	    strcpy(szDefaultPath, "NetHood");
-	    break;
-
-	  case CSIDL_INTERNET_CACHE:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "Cache");
-	    strcpy(szDefaultPath, "Temporary Internet Files");
-	    break;
-
-	  case CSIDL_PERSONAL:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "Personal");
-	    strcpy(szDefaultPath, "My Own Files");
-	    bRelative = FALSE;
-	    break;
-
-	  case CSIDL_PRINTHOOD:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "PrintHood");
-	    strcpy(szDefaultPath, "PrintHood");
-	    break;
-
-	  case CSIDL_PROGRAMS:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "Programs");
-	    strcpy(szDefaultPath, "Start Menu\\Programs");
-	    break;
-
-	  case CSIDL_COMMON_PROGRAMS:
-	    hRootKey = HKEY_LOCAL_MACHINE;
-	    strcpy(szValueName, "Common Programs");
-	    strcpy(szDefaultPath, "");
-	    break;
-
-	  case CSIDL_RECENT:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "Recent");
-	    strcpy(szDefaultPath, "Recent");
-	    break;
-
-	  case CSIDL_SENDTO:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "SendTo");
-	    strcpy(szDefaultPath, "SendTo");
-	    break;
-
-	  case CSIDL_STARTMENU:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "Start Menu");
-	    strcpy(szDefaultPath, "Start Menu");
-	    break;
-
-	  case CSIDL_COMMON_STARTMENU:
-	    hRootKey = HKEY_LOCAL_MACHINE;
-	    strcpy(szValueName, "Common StartMenu"); //TODO: Start Menu?
-	    strcpy(szDefaultPath, "Start Menu");
-	    break;
-
-	  case CSIDL_STARTUP:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "Startup");
-	    strcpy(szDefaultPath, "Start Menu\\Programs\\Startup");
-	    break;
-
-	  case CSIDL_COMMON_STARTUP:
-	    hRootKey = HKEY_LOCAL_MACHINE;
-	    strcpy(szValueName, "Common Startup");
-	    strcpy(szDefaultPath, "Start Menu\\Programs\\Startup");
-	    break;
-
-	  case CSIDL_TEMPLATES:
-	    hRootKey = HKEY_CURRENT_USER;
-	    strcpy(szValueName, "Templates");
-	    strcpy(szDefaultPath, "ShellNew");
-	    break;
-
-	  default:
-	    ERR("folder unknown or not allowed\n");
-	    return FALSE;
-	}
-
-	/* user shell folders */
-	if (RegCreateKeyExA(hRootKey,szSHUserFolders,0,NULL,0,KEY_ALL_ACCESS,NULL,&hKey,&dwDisp)) return FALSE;
-
-	if (RegQueryValueExA(hKey,szValueName,NULL,&dwType,(LPBYTE)szPath,&dwPathLen))
-	{
-	  RegCloseKey(hKey);
-
-	  /* shell folders */
-	  if (RegCreateKeyExA(hRootKey,szSHFolders,0,NULL,0,KEY_ALL_ACCESS,NULL,&hKey,&dwDisp)) return FALSE;
-
-	  if (RegQueryValueExA(hKey,szValueName,NULL,&dwType,(LPBYTE)szPath,&dwPathLen))
-	  {
-
-	    /* value not existing */
-	    if (bRelative)
-	    {
-	      GetWindowsDirectoryA(szPath, MAX_PATH);
-	      PathAddBackslashA(szPath);
-	      strcat(szPath, szDefaultPath);
-	    }
-	    else
-	    {
-	      strcpy(szPath, "C:\\");	/* fixme ??? */
-	      strcat(szPath, szDefaultPath);
-	    }
-	    RegSetValueExA(hKey,szValueName,0,REG_SZ,(LPBYTE)szPath,strlen(szPath)+1);
-	  }
-	}
-	RegCloseKey(hKey);
-
-	if (bCreate && CreateDirectoryA(szPath,NULL))
-	{
-	    MESSAGE("Created not existing system directory '%s'\n", szPath);
-	}
-
-	return TRUE;
-}
-
-/*************************************************************************
- * SHGetSpecialFolderPathW
- */
-BOOL WINAPI SHGetSpecialFolderPathW (
-	HWND hwndOwner,
-	LPWSTR szPath,
-	DWORD csidl,
-	BOOL bCreate)
-{
-	char szTemp[MAX_PATH];
-	
-	if (SHGetSpecialFolderPathA(hwndOwner, szTemp, csidl, bCreate))
-	{
-	  lstrcpynAtoW(szPath, szTemp, MAX_PATH);
-	}
-
-	TRACE("0x%04x,%p,csidl=%lu,0x%04x\n", hwndOwner,szPath,csidl,bCreate);
-
-	return TRUE;
-}
-
-/*************************************************************************
- * SHGetSpecialFolderPathAW
- */
-BOOL WINAPI SHGetSpecialFolderPathAW (
-	HWND hwndOwner,
-	LPVOID szPath,
-	DWORD csidl,
-	BOOL bCreate)
-
-{
-	if (VERSION_OsIsUnicode())
-	  return SHGetSpecialFolderPathW (hwndOwner, szPath, csidl, bCreate);
-	return SHGetSpecialFolderPathA (hwndOwner, szPath, csidl, bCreate);
-}
-
-/*************************************************************************
- * PathCanonicalizeA
+
+/*************************************************************************
+ *	PathIsContentTypeA   [SHLWAPI.@]
+ */
+BOOL WINAPI PathIsContentTypeA(LPCSTR pszPath, LPCSTR pszContentType)
+{
+	FIXME("%s %s\n", pszPath, pszContentType);
+	return FALSE;
+}
+
+/*************************************************************************
+ *	PathIsContentTypeW   [SHLWAPI.@]
+ */
+BOOL WINAPI PathIsContentTypeW(LPCWSTR pszPath, LPCWSTR pszContentType)
+{
+	FIXME("%s %s\n", debugstr_w(pszPath), debugstr_w(pszContentType));
+	return FALSE;
+}
+
+/*************************************************************************
+ *	PathIsFileSpecA   [SHLWAPI.@]
+ */
+BOOL WINAPI PathIsFileSpecA(LPCSTR pszPath)
+{
+	FIXME("%s\n", pszPath);
+	return FALSE;
+}
+
+/*************************************************************************
+ *	PathIsFileSpecW   [SHLWAPI.@]
+ */
+BOOL WINAPI PathIsFileSpecW(LPCWSTR pszPath)
+{
+	FIXME("%s\n", debugstr_w(pszPath));
+	return FALSE;
+}
+
+/*************************************************************************
+ *	PathIsPrefixA   [SHLWAPI.@]
+ */
+BOOL WINAPI PathIsPrefixA(LPCSTR pszPrefix, LPCSTR pszPath)
+{
+	FIXME("%s %s\n", pszPrefix, pszPath);
+	return FALSE;
+}
+
+/*************************************************************************
+ *	PathIsPrefixW   [SHLWAPI.@]
+ */
+BOOL WINAPI PathIsPrefixW(LPCWSTR pszPrefix, LPCWSTR pszPath)
+{
+	FIXME("%s %s\n", debugstr_w(pszPrefix), debugstr_w(pszPath));
+	return FALSE;
+}
+
+/*************************************************************************
+ *	PathIsSystemFolderA   [SHLWAPI.@]
+ */
+BOOL WINAPI PathIsSystemFolderA(LPCSTR pszPath, DWORD dwAttrb)
+{
+	FIXME("%s 0x%08lx\n", pszPath, dwAttrb);
+	return FALSE;
+}
+
+/*************************************************************************
+ *	PathIsSystemFolderW   [SHLWAPI.@]
+ */
+BOOL WINAPI PathIsSystemFolderW(LPCWSTR pszPath, DWORD dwAttrb)
+{
+	FIXME("%s 0x%08lx\n", debugstr_w(pszPath), dwAttrb);
+	return FALSE;
+}
+
+/*************************************************************************
+ *	PathIsUNCServerA   [SHLWAPI.@]
+ */
+BOOL WINAPI PathIsUNCServerA(
+	LPCSTR pszPath)
+{
+	FIXME("%s\n", pszPath);
+	return FALSE;
+}
+
+/*************************************************************************
+ *	PathIsUNCServerW   [SHLWAPI.@]
+ */
+BOOL WINAPI PathIsUNCServerW(
+	LPCWSTR pszPath)
+{
+	FIXME("%s\n", debugstr_w(pszPath));
+	return FALSE;
+}
+
+/*************************************************************************
+ *	PathIsUNCServerShareA   [SHLWAPI.@]
+ */
+BOOL WINAPI PathIsUNCServerShareA(
+	LPCSTR pszPath)
+{
+	FIXME("%s\n", pszPath);
+	return FALSE;
+}
+
+/*************************************************************************
+ *	PathIsUNCServerShareW   [SHLWAPI.@]
+ */
+BOOL WINAPI PathIsUNCServerShareW(
+	LPCWSTR pszPath)
+{
+	FIXME("%s\n", debugstr_w(pszPath));
+	return FALSE;
+}
+
+/*************************************************************************
+ * PathCanonicalizeA   [SHLWAPI.@]
  *
  *  FIXME
- *   returnvalue
+ *   returnvalue, use CharNext
  */
  
@@ -2155,12 +1401,12 @@
 
 /*************************************************************************
- * PathCanonicalizeW
+ * PathCanonicalizeW   [SHLWAPI.@]
  *
  *  FIXME
- *   returnvalue
+ *   returnvalue, use CharNext
  */
 BOOL WINAPI PathCanonicalizeW(LPWSTR pszBuf, LPCWSTR pszPath)
 {
-	int OffsetMin = 0, OffsetSrc = 0, OffsetDst = 0, LenSrc = lstrlenW(pszPath);
+	int OffsetMin = 0, OffsetSrc = 0, OffsetDst = 0, LenSrc = strlenW(pszPath);
 	BOOL bModifyed = FALSE;
 
@@ -2226,27 +1472,352 @@
 
 /*************************************************************************
- * PathFindNextComponentA
- */
+ * PathFindNextComponentA   [SHLWAPI.@]
+ *
+ * NOTES
+ * special cases:
+ *	""              null
+ *	aa              "" (pointer to traling NULL)
+ *	aa\             "" (pointer to traling NULL)
+ *	aa\\            "" (pointer to traling NULL)
+ *	aa\\bb          bb
+ *	aa\\\bb         \bb
+ *	c:\aa\          "aa\"
+ *	\\aa            aa
+ *	\\aa\b          aa\b
+*/
 LPSTR WINAPI PathFindNextComponentA(LPCSTR pszPath)
 {
-	while( *pszPath )
-	{
-	  if(*pszPath++=='\\')
-	    return (LPSTR)((*pszPath)? pszPath : NULL);
-	}
-	return NULL;
-}
-
-/*************************************************************************
- * PathFindNextComponentW
+	LPSTR pos;
+
+	TRACE("%s\n", pszPath);
+
+	if(!pszPath || !*pszPath) return NULL;
+	if(!(pos = StrChrA(pszPath, '\\')))
+	  return (LPSTR) pszPath + strlen(pszPath);
+	pos++;
+	if(pos[0] == '\\') pos++;
+	return pos;
+}
+
+/*************************************************************************
+ * PathFindNextComponentW   [SHLWAPI.@]
  */
 LPWSTR WINAPI PathFindNextComponentW(LPCWSTR pszPath)
 {
-	while( *pszPath )
-	{
-	  if(*pszPath++=='\\')
-	    return (LPWSTR)((*pszPath)? pszPath : NULL);
-	}
-	return NULL;
-}
-
+	LPWSTR pos;
+
+	TRACE("%s\n", debugstr_w(pszPath));
+	
+	if(!pszPath || !*pszPath) return NULL;
+	if (!(pos = StrChrW(pszPath, '\\')))
+	  return (LPWSTR) pszPath + strlenW(pszPath);
+	pos++;
+	if(pos[0] == '\\') pos++;
+	return pos;
+}
+
+/*************************************************************************
+ * PathAddExtensionA   [SHLWAPI.@]
+ *
+ * NOTES
+ *  it adds never a dot
+ */
+ 
+BOOL WINAPI PathAddExtensionA(
+	LPSTR  pszPath,
+	LPCSTR pszExtension)
+{
+	if (*pszPath)
+	{
+	  if (*(PathFindExtensionA(pszPath))) return FALSE;
+
+	  if (!pszExtension || *pszExtension=='\0')
+	    strcat(pszPath, "exe");
+	  else
+	    strcat(pszPath, pszExtension);
+	}
+
+	return TRUE;
+}
+
+/*************************************************************************
+ *	PathAddExtensionW   [SHLWAPI.@]
+ */
+BOOL WINAPI PathAddExtensionW(
+	LPWSTR  pszPath,
+	LPCWSTR pszExtension)
+{
+	static const WCHAR ext[] = { 'e','x','e',0 };
+
+	if (*pszPath)
+	{
+	  if (*(PathFindExtensionW(pszPath))) return FALSE;
+
+	  if (!pszExtension || *pszExtension=='\0')
+	    strcatW(pszPath, ext);
+	  else
+	    strcatW(pszPath, pszExtension);
+	}
+	return TRUE;
+
+}
+
+/*************************************************************************
+ *	PathMakePrettyA   [SHLWAPI.@]
+ */
+BOOL WINAPI PathMakePrettyA(
+	LPSTR lpPath)
+{
+	FIXME("%s\n", lpPath);
+	return TRUE;
+}
+
+/*************************************************************************
+ *	PathMakePrettyW   [SHLWAPI.@]
+ */
+BOOL WINAPI PathMakePrettyW(
+	LPWSTR lpPath)
+{
+	FIXME("%s\n", debugstr_w(lpPath));
+	return TRUE;
+
+}
+
+/*************************************************************************
+ *	PathCommonPrefixA   [SHLWAPI.@]
+ */
+int WINAPI PathCommonPrefixA(
+	LPCSTR pszFile1,
+	LPCSTR pszFile2,
+	LPSTR achPath)
+{
+	FIXME("%s %s %p\n", pszFile1, pszFile2, achPath);
+	return 0;
+}
+
+/*************************************************************************
+ *	PathCommonPrefixW   [SHLWAPI.@]
+ */
+int WINAPI PathCommonPrefixW(
+	LPCWSTR pszFile1,
+	LPCWSTR pszFile2,
+	LPWSTR achPath)
+{
+	FIXME("%s %s %p\n", debugstr_w(pszFile1), debugstr_w(pszFile2),achPath );
+	return 0;
+}
+
+/*************************************************************************
+ *	PathCompactPathA   [SHLWAPI.@]
+ */
+BOOL WINAPI PathCompactPathA(HDC hDC, LPSTR pszPath, UINT dx)
+{
+	FIXME("0x%08x %s 0x%08x\n", hDC, pszPath, dx);
+	return FALSE;
+}
+
+/*************************************************************************
+ *	PathCompactPathW   [SHLWAPI.@]
+ */
+BOOL WINAPI PathCompactPathW(HDC hDC, LPWSTR pszPath, UINT dx)
+{
+	FIXME("0x%08x %s 0x%08x\n", hDC, debugstr_w(pszPath), dx);
+	return FALSE;
+}
+
+/*************************************************************************
+ *	PathGetCharTypeA   [SHLWAPI.@]
+ */
+UINT WINAPI PathGetCharTypeA(UCHAR ch)
+{
+	FIXME("%c\n", ch);
+	return 0;
+}
+
+/*************************************************************************
+ *	PathGetCharTypeW   [SHLWAPI.@]
+ */
+UINT WINAPI PathGetCharTypeW(WCHAR ch)
+{
+	FIXME("%c\n", ch);
+	return 0;
+}
+
+/*************************************************************************
+ *	PathMakeSystemFolderA   [SHLWAPI.@]
+ */
+BOOL WINAPI PathMakeSystemFolderA(LPCSTR pszPath)
+{
+	FIXME("%s\n", pszPath);
+	return FALSE;
+}
+
+/*************************************************************************
+ *	PathMakeSystemFolderW   [SHLWAPI.@]
+ */
+BOOL WINAPI PathMakeSystemFolderW(LPCWSTR pszPath)
+{
+	FIXME("%s\n", debugstr_w(pszPath));
+	return FALSE;
+}
+
+/*************************************************************************
+ *	PathRenameExtensionA   [SHLWAPI.@]
+ */
+BOOL WINAPI PathRenameExtensionA(LPSTR pszPath, LPCSTR pszExt)
+{
+	FIXME("%s %s\n", pszPath, pszExt);
+	return FALSE;
+}
+
+/*************************************************************************
+ *	PathRenameExtensionW   [SHLWAPI.@]
+ */
+BOOL WINAPI PathRenameExtensionW(LPWSTR pszPath, LPCWSTR pszExt)
+{
+	FIXME("%s %s\n", debugstr_w(pszPath), debugstr_w(pszExt));
+	return FALSE;
+}
+
+/*************************************************************************
+ *	PathSearchAndQualifyA   [SHLWAPI.@]
+ */
+BOOL WINAPI PathSearchAndQualifyA(
+	LPCSTR pszPath,
+	LPSTR pszBuf,
+	UINT cchBuf)
+{
+	FIXME("%s %s 0x%08x\n", pszPath, pszBuf, cchBuf);
+	return FALSE;
+}
+
+/*************************************************************************
+ *	PathSearchAndQualifyW   [SHLWAPI.@]
+ */
+BOOL WINAPI PathSearchAndQualifyW(
+	LPCWSTR pszPath,
+	LPWSTR pszBuf,
+	UINT cchBuf)
+{
+	FIXME("%s %s 0x%08x\n", debugstr_w(pszPath), debugstr_w(pszBuf), cchBuf);
+	return FALSE;
+}
+
+#ifndef __WIN32OS2__
+/*************************************************************************
+ *	PathSkipRootA   [SHLWAPI.@]
+ */
+LPSTR WINAPI PathSkipRootA(LPCSTR pszPath)
+{
+	FIXME("%s\n", pszPath);
+	return (LPSTR)pszPath;
+}
+
+/*************************************************************************
+ *	PathSkipRootW   [SHLWAPI.@]
+ */
+LPWSTR WINAPI PathSkipRootW(LPCWSTR pszPath)
+{
+	FIXME("%s\n", debugstr_w(pszPath));
+	return (LPWSTR)pszPath;
+}
+#endif
+
+/*************************************************************************
+ *	PathCreateFromUrlA   [SHLWAPI.@]
+ */
+HRESULT WINAPI PathCreateFromUrlA(
+	LPCSTR pszUrl,
+	LPSTR pszPath,
+	LPDWORD pcchPath,
+	DWORD dwFlags)
+{
+	FIXME("%s %p %p 0x%08lx\n",
+	  pszUrl, pszPath, pcchPath, dwFlags);
+	return S_OK;
+}
+
+/*************************************************************************
+ *	PathCreateFromUrlW   [SHLWAPI.@]
+ */
+HRESULT WINAPI PathCreateFromUrlW(
+	LPCWSTR pszUrl,
+	LPWSTR pszPath,
+	LPDWORD pcchPath,
+	DWORD dwFlags)
+{
+	FIXME("%s %p %p 0x%08lx\n",
+	  debugstr_w(pszUrl), pszPath, pcchPath, dwFlags);
+	return S_OK;
+}
+
+/*************************************************************************
+ *	PathRelativePathToA   [SHLWAPI.@]
+ */
+BOOL WINAPI PathRelativePathToA(
+	LPSTR pszPath,
+	LPCSTR pszFrom,
+	DWORD dwAttrFrom,
+	LPCSTR pszTo,
+	DWORD dwAttrTo)
+{
+	FIXME("%s %s 0x%08lx %s 0x%08lx\n",
+	  pszPath, pszFrom, dwAttrFrom, pszTo, dwAttrTo);
+	return FALSE;
+}
+
+/*************************************************************************
+ *	PathRelativePathToW   [SHLWAPI.@]
+ */
+BOOL WINAPI PathRelativePathToW(
+	LPWSTR pszPath,
+	LPCWSTR pszFrom,
+	DWORD dwAttrFrom,
+	LPCWSTR pszTo,
+	DWORD dwAttrTo)
+{
+	FIXME("%s %s 0x%08lx %s 0x%08lx\n",
+	  debugstr_w(pszPath), debugstr_w(pszFrom), dwAttrFrom, debugstr_w(pszTo), dwAttrTo);
+	return FALSE;
+}
+
+/*************************************************************************
+ *	PathUnmakeSystemFolderA   [SHLWAPI.@]
+ */
+BOOL WINAPI PathUnmakeSystemFolderA(LPCSTR pszPath)
+{
+	FIXME("%s\n", pszPath);
+	return FALSE;
+}
+
+/*************************************************************************
+ *	PathUnmakeSystemFolderW   [SHLWAPI.@]
+ */
+BOOL WINAPI PathUnmakeSystemFolderW(LPCWSTR pszPath)
+{
+	FIXME("%s\n", debugstr_w(pszPath));
+	return FALSE;
+}
+
+/*
+	########## special ##########
+*/
+
+/*************************************************************************
+ * PathSetDlgItemPathA   [SHLWAPI.@]
+ *
+ * NOTES
+ *  use PathCompactPath to make sure, the path fits into the control
+ */
+BOOL WINAPI PathSetDlgItemPathA(HWND hDlg, int id, LPCSTR pszPath) 
+{	TRACE("%x %x %s\n",hDlg, id, pszPath);
+	return SetDlgItemTextA(hDlg, id, pszPath);
+}
+
+/*************************************************************************
+ * PathSetDlgItemPathW   [SHLWAPI.@]
+ */
+BOOL WINAPI PathSetDlgItemPathW(HWND hDlg, int id, LPCWSTR pszPath) 
+{	TRACE("%x %x %s\n",hDlg, id, debugstr_w(pszPath));
+	return SetDlgItemTextW(hDlg, id, pszPath);
+}
Index: trunk/src/shlwapi/pathcpp.cpp
===================================================================
--- trunk/src/shlwapi/pathcpp.cpp	(revision 4080)
+++ trunk/src/shlwapi/pathcpp.cpp	(revision 4081)
@@ -1,3 +1,3 @@
-/* $Id: pathcpp.cpp,v 1.3 2000-08-02 20:18:23 bird Exp $ */
+/* $Id: pathcpp.cpp,v 1.4 2000-08-24 09:32:42 sandervl Exp $ */
 
 /*
@@ -98,16 +98,2 @@
   return (LPWSTR)pszPath;
 }
-
-//SvL: NT seems to concatenate both strings (not tested very well)
-ODINFUNCTION2(BOOL, PathAddExtensionA, LPSTR, pszPath, LPSTR, pszExtension)
-{
-  lstrcatA(pszPath, pszExtension);
-  return 1;
-}
-
-ODINFUNCTION2(BOOL, PathAddExtensionW, LPWSTR, pszPath, LPWSTR, pszExtension)
-{
-  lstrcatW(pszPath, pszExtension);
-  return 1;
-}
-
Index: trunk/src/shlwapi/reg.c
===================================================================
--- trunk/src/shlwapi/reg.c	(revision 4081)
+++ trunk/src/shlwapi/reg.c	(revision 4081)
@@ -0,0 +1,247 @@
+/*
+ * SHLWAPI registry functions
+ * Note: Odin changes marked by __WIN32OS2__
+ */
+
+#include "windef.h"
+#include "winerror.h"
+#include "winreg.h"
+#include "wine/undocshell.h"
+#include "debugtools.h"
+
+DEFAULT_DEBUG_CHANNEL(shell);
+
+/*************************************************************************
+ * SHRegGetUSValueA	[SHLWAPI.@]
+ *
+ * Gets a user-specific registry value
+ */
+LONG WINAPI SHRegGetUSValueA(
+	LPCSTR   pSubKey,
+	LPCSTR   pValue,
+	LPDWORD  pwType,
+	LPVOID   pvData,
+	LPDWORD  pbData,
+	BOOL     fIgnoreHKCU,
+	LPVOID   pDefaultData,
+	DWORD    wDefaultDataSize)
+{
+	FIXME("(%p),stub!\n", pSubKey);
+	return ERROR_SUCCESS;  /* return success */
+}
+
+/*************************************************************************
+ * SHRegGetUSValueW	[SHLWAPI.@]
+ *
+ * Gets a user-specific registry value
+ */
+LONG WINAPI SHRegGetUSValueW(
+	LPCWSTR  pSubKey,
+	LPCWSTR  pValue,
+	LPDWORD  pwType,
+	LPVOID   pvData,
+	LPDWORD  pbData,
+	BOOL     flagIgnoreHKCU,
+	LPVOID   pDefaultData,
+	DWORD    wDefaultDataSize)
+{
+	FIXME("(%p),stub!\n", pSubKey);
+	return ERROR_SUCCESS;  /* return success */
+}
+
+#ifndef __WIN32OS2__
+/*************************************************************************
+ * SHRegGetBoolUSValueA   [SHLWAPI.@]
+ */
+BOOL WINAPI SHRegGetBoolUSValueA(
+	LPCSTR pszSubKey,
+	LPCSTR pszValue,
+	BOOL fIgnoreHKCU,
+	BOOL fDefault)
+{
+	FIXME("%s %s\n", pszSubKey,pszValue);
+	return fDefault;
+}
+
+/*************************************************************************
+ * SHRegGetBoolUSValueW	  [SHLWAPI.@]
+ */
+BOOL WINAPI SHRegGetBoolUSValueW(
+	LPCWSTR pszSubKey,
+	LPCWSTR pszValue,
+	BOOL fIgnoreHKCU,
+	BOOL fDefault)
+{
+	FIXME("%s %s\n", debugstr_w(pszSubKey),debugstr_w(pszValue));
+	return fDefault;
+}
+#endif
+
+/*************************************************************************
+ *      SHRegQueryUSValueA	[SHLWAPI]
+ */
+LONG WINAPI SHRegQueryUSValueA(
+	HKEY/*HUSKEY*/ hUSKey,
+	LPCSTR pszValue,
+	LPDWORD pdwType,
+	void *pvData,
+	LPDWORD pcbData,
+	BOOL fIgnoreHKCU,
+	void *pvDefaultData,
+	DWORD dwDefaultDataSize)
+{
+	FIXME("%s stub\n",pszValue);
+	return 1;
+}
+
+/*************************************************************************
+ * SHRegGetPathA   [SHLWAPI.@]
+ */
+DWORD WINAPI SHRegGetPathA(
+	HKEY hKey,
+	LPCSTR pcszSubKey,
+	LPCSTR pcszValue,
+	LPSTR pszPath,
+	DWORD dwFlags)
+{
+	FIXME("%s %s\n", pcszSubKey, pcszValue);
+	return 0;
+}
+
+/*************************************************************************
+ * SHRegGetPathW   [SHLWAPI.@]
+ */
+DWORD WINAPI SHRegGetPathW(
+	HKEY hKey,
+	LPCWSTR pcszSubKey,
+	LPCWSTR pcszValue,
+	LPWSTR pszPath,
+	DWORD dwFlags)
+{
+	FIXME("%s %s\n", debugstr_w(pcszSubKey), debugstr_w(pcszValue));
+	return 0;
+}
+
+/*************************************************************************
+ * SHGetValueA   [SHLWAPI.@]
+ *
+ * Gets a value from the registry
+ */
+DWORD WINAPI SHGetValueA(
+	HKEY     hkey,
+	LPCSTR   pSubKey,
+	LPCSTR   pValue,
+	LPDWORD  pwType,
+	LPVOID   pvData,
+	LPDWORD  pbData)
+{
+	HKEY hSubKey;
+	DWORD res;
+	
+	TRACE("(%s %s)\n", pSubKey, pValue);
+	
+	if((res = RegOpenKeyA(hkey, pSubKey, &hSubKey))) return res;
+	res = RegQueryValueExA(hSubKey, pValue, 0, pwType, pvData, pbData);
+	RegCloseKey( hSubKey );
+	
+	return res;
+}
+
+/*************************************************************************
+ * SHGetValueW   [SHLWAPI.@]
+ *
+ * Gets a value from the registry
+ */
+DWORD WINAPI SHGetValueW(
+	HKEY     hkey,
+	LPCWSTR  pSubKey,
+	LPCWSTR  pValue,
+	LPDWORD  pwType,
+	LPVOID   pvData,
+	LPDWORD  pbData)
+{
+	HKEY hSubKey;
+	DWORD res;
+	
+	TRACE("(%s %s)\n", debugstr_w(pSubKey), debugstr_w(pValue));
+	
+	if((res = RegOpenKeyW(hkey, pSubKey, &hSubKey))) return res;
+	res = RegQueryValueExW(hSubKey, pValue, 0, pwType, pvData, pbData);
+	RegCloseKey( hSubKey );
+	
+	return res;
+}
+
+/*************************************************************************
+ *      SHSetValueA   [SHLWAPI.@]
+ */
+DWORD WINAPI SHSetValueA(
+	HKEY hkey,
+	LPCSTR pszSubKey,
+	LPCSTR pszValue,
+	DWORD dwType,
+	LPCVOID pvData,
+	DWORD cbData)
+{
+	FIXME("(%s %s)stub\n",pszSubKey, pszValue);
+	return 1;
+}
+
+/*************************************************************************
+ * SHQueryValueExA		[SHLWAPI.@]
+ *
+ */
+HRESULT WINAPI SHQueryValueExA(
+	HKEY hkey,
+	LPSTR lpValueName,
+	LPDWORD lpReserved,
+	LPDWORD lpType,
+	LPBYTE lpData,
+	LPDWORD lpcbData)
+{
+	TRACE("0x%04x %s %p %p %p %p\n", hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
+	return RegQueryValueExA (hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
+}
+
+
+/*************************************************************************
+ * SHQueryValueExW   [SHLWAPI.@]
+ *
+ * FIXME 
+ *  if the datatype REG_EXPAND_SZ then expand the string and change
+ *  *pdwType to REG_SZ. 
+ */
+HRESULT WINAPI SHQueryValueExW (
+	HKEY hkey,
+	LPWSTR pszValue,
+	LPDWORD pdwReserved,
+	LPDWORD pdwType,
+	LPVOID pvData,
+	LPDWORD pcbData)
+{
+	WARN("0x%04x %s %p %p %p %p semi-stub\n",
+             hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData);
+	return RegQueryValueExW ( hkey, pszValue, pdwReserved, pdwType, pvData, pcbData);
+}
+
+/*************************************************************************
+ * SHDeleteKeyA   [SHLWAPI.@]
+ */
+HRESULT WINAPI SHDeleteKeyA(
+	HKEY hkey,
+	LPCSTR pszSubKey)
+{
+	FIXME("hkey=0x%08x, %s\n", hkey, debugstr_a(pszSubKey));
+	return 0;
+}
+
+/*************************************************************************
+ * SHDeleteKeyW   [SHLWAPI.@]
+ */
+HRESULT WINAPI SHDeleteKeyW(
+	HKEY hkey,
+	LPCWSTR pszSubKey)
+{
+	FIXME("hkey=0x%08x, %s\n", hkey, debugstr_w(pszSubKey));
+	return 0;
+}
Index: trunk/src/shlwapi/reg.cpp
===================================================================
--- trunk/src/shlwapi/reg.cpp	(revision 4080)
+++ 	(revision )
@@ -1,342 +1,0 @@
-/* $Id: reg.cpp,v 1.4 2000-08-02 20:18:23 bird Exp $ */
-
-/*
- * Win32 URL-handling APIs for OS/2
- *
- * Copyright 1999      Patrick Haller <phaller@gmx.net>
- *
- * Project Odin Software License can be found in LICENSE.TXT
- *
- * Copyright 1996,1998 Marcus Meissner
- * Copyright 1996 Jukka Iivonen
- * Copyright 1997 Uwe Bonnes
- * Copyright 1999 Jens Wiessner
- */
-
-
-#include <odin.h>
-#include <odinwrap.h>
-#include <os2sel.h>
-
-#include <string.h>
-#include <ctype.h>
-#include <wctype.h>
-#define HAVE_WCTYPE_H
-#include <odin.h>
-
-#include "debugtools.h"
-#include "winnls.h"
-#include "winversion.h"
-#include "winreg.h"
-
-#include <heapstring.h>
-#include <misc.h>
-#include <win\winerror.h>
-#include "shlwapi.h"
-
-
-ODINDEBUGCHANNEL(SHLWAPI-REG)
-
-
-/*****************************************************************************
- * Name      : DWORD SHRegCreateUSKeyA
- * Purpose   :
- * Parameters:
- * Variables :
- * Result    :
- * Remark    : SHLWAPI.594 SHLWAPI.SHRegCreateUSKeyA
- * Status    : STUB UNTESTED
- *
- * Author    : Patrick Haller [Wed, 1999/12/29 23:02]
- *****************************************************************************/
-
-ODINFUNCTION5(DWORD,  SHRegCreateUSKeyA,
-              LPSTR,  lpszKeyName,
-              DWORD,  arg1,
-              DWORD,  arg2,
-              DWORD,  arg3,
-              DWORD,  arg4)
-{
-  dprintf(("not implemented\n"));
-  return 0;
-}
-
-
-/*****************************************************************************
- * Name      : DWORD SHRegCreateUSKeyW
- * Purpose   :
- * Parameters:
- * Variables :
- * Result    :
- * Remark    : SHLWAPI.595 SHLWAPI.SHRegCreateUSKeyW
- * Status    : STUB UNTESTED
- *
- * Author    : Patrick Haller [Wed, 1999/12/29 23:02]
- *****************************************************************************/
-
-ODINFUNCTION5(DWORD,  SHRegCreateUSKeyW,
-              LPWSTR, lpszKeyName,
-              DWORD,  arg1,
-              DWORD,  arg2,
-              DWORD,  arg3,
-              DWORD,  arg4)
-{
-  char szBuffer[256];
-
-  // convert unicode to ascii
-  if (0 == WideCharToMultiByte(0,
-                               0,
-                               lpszKeyName,
-                               -1,
-                               szBuffer,
-                               sizeof(szBuffer),
-                               0,
-                               0))
-    return GetLastError();
-
-  return SHRegCreateUSKeyA(szBuffer,
-                         arg1,
-                         arg2,
-                         arg3,
-                         arg4);
-}
-
-
-
-/*
-   shlwapi functions that have found their way in because most of
-   shlwapi is unimplemented and doesn't have a home.
-
-   FIXME: move to a more appropriate file( when one exists )
-*/
-
- /* SHGetValue: Gets a value from the registry */
-
-ODINFUNCTION6(DWORD,SHGetValueA,HKEY,     hkey,
-                                LPCSTR,   pSubKey,
-                                LPCSTR,   pValue,
-                                LPDWORD,  pwType,
-                                LPVOID,   pvData,
-                                LPDWORD,  pbData)
-{
-    dprintf(("(%p),stub!\n", pSubKey));
-
-        return ERROR_SUCCESS;  /* return success */
-}
-
-ODINFUNCTION6(DWORD,SHGetValueW,HKEY,     hkey,
-                                LPCWSTR,  pSubKey,
-                                LPCWSTR,  pValue,
-                                LPDWORD,  pwType,
-                                LPVOID,   pvData,
-                                LPDWORD,  pbData)
-{
-    dprintf(("(%p),stub!\n", pSubKey));
-
-        return ERROR_SUCCESS;  /* return success */
-}
-
-/* gets a user-specific registry value. */
-
-ODINFUNCTION8(LONG,SHRegGetUSValueA,LPCSTR,   pSubKey,
-                                    LPCSTR,   pValue,
-                                    LPDWORD,  pwType,
-                                    LPVOID,   pvData,
-                                    LPDWORD,  pbData,
-                                    BOOL,     fIgnoreHKCU,
-                                    LPVOID,   pDefaultData,
-                                    DWORD,    wDefaultDataSize)
-{
-    FIXME("(%p),stub!\n", pSubKey);
-
-        return ERROR_SUCCESS;  /* return success */
-}
-
-ODINFUNCTION8(LONG,SHRegGetUSValueW,LPCWSTR, pSubKey,
-                                    LPCWSTR, pValue,
-                                    LPDWORD, pwType,
-                                    LPVOID,  pvData,
-                                    LPDWORD, pbData,
-                                    BOOL,    flagIgnoreHKCU,
-                                    LPVOID,  pDefaultData,
-                                    DWORD,   wDefaultDataSize)
-{
-    dprintf(("(%p),stub!\n", pSubKey));
-
-        return ERROR_SUCCESS;  /* return success */
-}
-
-
-/*****************************************************************************
- * Name      : DWORD SHRegGetBoolUSValueA
- * Purpose   : unknown
- * Parameters: unknown
- * Variables :
- * Result    : unknown
- * Remark    : SHLWAPI.SHRegGetBoolUSValueA
- * Status    : COMPLETELY IMPLEMENTED ? UNTESTED
- *
- * Author    : Patrick Haller [Wed, 1999/12/29 23:02]
- *****************************************************************************/
-
-ODINFUNCTION4(BOOL,    SHRegGetBoolUSValueA,
-              LPCSTR,  pszSubKey,
-              LPCSTR,  pszValue,
-              BOOL,    fIgnoreHKCU,
-              BOOL,    fDefault)
-{
-  char  szBuffer[260];
-  DWORD dwLength = sizeof(szBuffer);
-  LONG  rc;
-
-  dprintf(("subkey=%s, value=%s\n",
-           pszSubKey,
-           pszValue));
-
-  rc = SHRegGetUSValueA(pszSubKey,
-                        pszValue,
-                        &fDefault,
-                        szBuffer,
-                        &dwLength,
-                        fIgnoreHKCU,
-                        fDefault ? "YES" : "NO",
-                        fDefault ? 4 : 3);
-  if (rc != ERROR_SUCCESS)
-    return rc;
-
-  if (lstrcmpiA("YES",
-                szBuffer) == 0)
-    return 1;
-  else
-  if (lstrcmpiA("TRUE",
-                szBuffer) == 0)
-    return 1;
-  else
-  if (lstrcmpiA("NO",
-                szBuffer) == 0)
-    return 0;
-  else
-  if (lstrcmpiA("FALSE",
-                szBuffer) == 0)
-    return 0;
-
-
-  return ERROR_SUCCESS;  /* return success */
-}
-
-
-/*****************************************************************************
- * Name      : DWORD SHRegGetBoolUSValueW
- * Purpose   : unknown
- * Parameters: unknown
- * Variables :
- * Result    : unknown
- * Remark    : SHLWAPI.SHRegGetBoolUSValueW
- * Status    : STUB UNTESTED
- *
- * Author    : Patrick Haller [Wed, 1999/12/29 23:02]
- *****************************************************************************/
-
-ODINFUNCTION4(BOOL,    SHRegGetBoolUSValueW,
-              LPCWSTR, pszSubKey,
-              LPCWSTR, pszValue,
-              BOOL,    fIgnoreHKCU,
-              BOOL,    fDefault)
-{
-  char  szBuffer[264];
-  int   iLength;
-
-  dprintf(("(%p),stub!\n", pszSubKey));
-
-  return ERROR_SUCCESS;  /* return success */
-}
-
-
-/*****************************************************************************
- * Name      : DWORD SHRegSetUSValueA
- * Purpose   :
- * Parameters:
- * Variables :
- * Result    :
- * Remark    : SHLWAPI.SHRegSetUSValueA SHLWAPI.615
- * Status    : STUB UNTESTED
- *
- * Author    : Patrick Haller [Wed, 1999/12/29 23:02]
- *****************************************************************************/
-
-ODINFUNCTION6(LONG,    SHRegSetUSValueA,
-              HKEY,    hKey,
-              DWORD,   arg2,
-              DWORD,   arg3,
-              DWORD,   arg4,
-              DWORD,   arg5,
-              DWORD,   arg6)
-{
-  LONG rc;
-
-#if 0
-  rc = SHRegCreateUSKeyA(hKey,
-                         3,
-                         0,
-                         &hKey);
-  if (rc == ERROR_SUCCESS)
-  {
-    rc = SHRegWriteUSValueA(hKey,
-                            arg2,
-                            arg3,
-                            arg4,
-                            arg5,
-                            arg6);
-    SHRegCloseUSKey(hKey);
-  }
-#endif
-
-  return rc;
-}
-
-
-
-
-/*****************************************************************************
- * Name      : DWORD SHRegSetUSValueW
- * Purpose   :
- * Parameters:
- * Variables :
- * Result    :
- * Remark    : SHLWAPI.SHRegSetUSValueW SHLWAPI.616
- * Status    : STUB UNTESTED
- *
- * Author    : Patrick Haller [Wed, 1999/12/29 23:02]
- *****************************************************************************/
-
-ODINFUNCTION6(LONG,    SHRegSetUSValueW,
-              HKEY,    hKey,
-              DWORD,   arg2,
-              DWORD,   arg3,
-              DWORD,   arg4,
-              DWORD,   arg5,
-              DWORD,   arg6)
-{
-  LONG rc;
-
-#if 0
-  rc = SHRegCreateUSKeyW(hKey,
-                         3,
-                         0,
-                         &hKey);
-  if (rc == ERROR_SUCCESS)
-  {
-    rc = SHRegWriteUSValueW(hKey,
-                            arg2,
-                            arg3,
-                            arg4,
-                            arg5,
-                            arg6);
-    SHRegCloseUSKey(hKey);
-  }
-#endif
-
-  return rc;
-}
-
-
Index: trunk/src/shlwapi/reg_odin.cpp
===================================================================
--- trunk/src/shlwapi/reg_odin.cpp	(revision 4081)
+++ trunk/src/shlwapi/reg_odin.cpp	(revision 4081)
@@ -0,0 +1,288 @@
+/* $Id: reg_odin.cpp,v 1.1 2000-08-24 09:32:43 sandervl Exp $ */
+
+/*
+ * Win32 URL-handling APIs for OS/2
+ *
+ * Copyright 1999      Patrick Haller <phaller@gmx.net>
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ * Copyright 1996,1998 Marcus Meissner
+ * Copyright 1996 Jukka Iivonen
+ * Copyright 1997 Uwe Bonnes
+ * Copyright 1999 Jens Wiessner
+ */
+
+
+#include <odin.h>
+#include <odinwrap.h>
+#include <os2sel.h>
+
+#include <string.h>
+#include <ctype.h>
+#include <wctype.h>
+#define HAVE_WCTYPE_H
+
+#include "debugtools.h"
+#include "winnls.h"
+#include "winversion.h"
+#include "winreg.h"
+
+#include <heapstring.h>
+#include <misc.h>
+#include <win\winerror.h>
+#include "shlwapi_odin.h"
+
+
+ODINDEBUGCHANNEL(SHLWAPI-REG)
+
+
+/*****************************************************************************
+ * Name      : DWORD SHRegCreateUSKeyA
+ * Purpose   :
+ * Parameters:
+ * Variables :
+ * Result    :
+ * Remark    : SHLWAPI.594 SHLWAPI.SHRegCreateUSKeyA
+ * Status    : STUB UNTESTED
+ *
+ * Author    : Patrick Haller [Wed, 1999/12/29 23:02]
+ *****************************************************************************/
+
+ODINFUNCTION5(DWORD,  SHRegCreateUSKeyA,
+              LPSTR,  lpszKeyName,
+              DWORD,  arg1,
+              DWORD,  arg2,
+              DWORD,  arg3,
+              DWORD,  arg4)
+{
+  dprintf(("not implemented\n"));
+  return 0;
+}
+
+
+/*****************************************************************************
+ * Name      : DWORD SHRegCreateUSKeyW
+ * Purpose   :
+ * Parameters:
+ * Variables :
+ * Result    :
+ * Remark    : SHLWAPI.595 SHLWAPI.SHRegCreateUSKeyW
+ * Status    : STUB UNTESTED
+ *
+ * Author    : Patrick Haller [Wed, 1999/12/29 23:02]
+ *****************************************************************************/
+
+ODINFUNCTION5(DWORD,  SHRegCreateUSKeyW,
+              LPWSTR, lpszKeyName,
+              DWORD,  arg1,
+              DWORD,  arg2,
+              DWORD,  arg3,
+              DWORD,  arg4)
+{
+  char szBuffer[256];
+
+  // convert unicode to ascii
+  if (0 == WideCharToMultiByte(0,
+                               0,
+                               lpszKeyName,
+                               -1,
+                               szBuffer,
+                               sizeof(szBuffer),
+                               0,
+                               0))
+    return GetLastError();
+
+  return SHRegCreateUSKeyA(szBuffer,
+                         arg1,
+                         arg2,
+                         arg3,
+                         arg4);
+}
+
+
+
+/*
+   shlwapi functions that have found their way in because most of
+   shlwapi is unimplemented and doesn't have a home.
+
+   FIXME: move to a more appropriate file( when one exists )
+*/
+
+
+/* gets a user-specific registry value. */
+
+
+/*****************************************************************************
+ * Name      : DWORD SHRegGetBoolUSValueA
+ * Purpose   : unknown
+ * Parameters: unknown
+ * Variables :
+ * Result    : unknown
+ * Remark    : SHLWAPI.SHRegGetBoolUSValueA
+ * Status    : COMPLETELY IMPLEMENTED ? UNTESTED
+ *
+ * Author    : Patrick Haller [Wed, 1999/12/29 23:02]
+ *****************************************************************************/
+
+ODINFUNCTION4(BOOL,    SHRegGetBoolUSValueA,
+              LPCSTR,  pszSubKey,
+              LPCSTR,  pszValue,
+              BOOL,    fIgnoreHKCU,
+              BOOL,    fDefault)
+{
+  char  szBuffer[260];
+  DWORD dwLength = sizeof(szBuffer);
+  LONG  rc;
+
+  dprintf(("subkey=%s, value=%s\n",
+           pszSubKey,
+           pszValue));
+
+  rc = SHRegGetUSValueA(pszSubKey,
+                        pszValue,
+                        &fDefault,
+                        szBuffer,
+                        &dwLength,
+                        fIgnoreHKCU,
+                        fDefault ? "YES" : "NO",
+                        fDefault ? 4 : 3);
+  if (rc != ERROR_SUCCESS)
+    return rc;
+
+  if (lstrcmpiA("YES",
+                szBuffer) == 0)
+    return 1;
+  else
+  if (lstrcmpiA("TRUE",
+                szBuffer) == 0)
+    return 1;
+  else
+  if (lstrcmpiA("NO",
+                szBuffer) == 0)
+    return 0;
+  else
+  if (lstrcmpiA("FALSE",
+                szBuffer) == 0)
+    return 0;
+
+
+  return ERROR_SUCCESS;  /* return success */
+}
+
+
+/*****************************************************************************
+ * Name      : DWORD SHRegGetBoolUSValueW
+ * Purpose   : unknown
+ * Parameters: unknown
+ * Variables :
+ * Result    : unknown
+ * Remark    : SHLWAPI.SHRegGetBoolUSValueW
+ * Status    : STUB UNTESTED
+ *
+ * Author    : Patrick Haller [Wed, 1999/12/29 23:02]
+ *****************************************************************************/
+
+ODINFUNCTION4(BOOL,    SHRegGetBoolUSValueW,
+              LPCWSTR, pszSubKey,
+              LPCWSTR, pszValue,
+              BOOL,    fIgnoreHKCU,
+              BOOL,    fDefault)
+{
+  char  szBuffer[264];
+  int   iLength;
+
+  dprintf(("(%p),stub!\n", pszSubKey));
+
+  return ERROR_SUCCESS;  /* return success */
+}
+
+
+/*****************************************************************************
+ * Name      : DWORD SHRegSetUSValueA
+ * Purpose   :
+ * Parameters:
+ * Variables :
+ * Result    :
+ * Remark    : SHLWAPI.SHRegSetUSValueA SHLWAPI.615
+ * Status    : STUB UNTESTED
+ *
+ * Author    : Patrick Haller [Wed, 1999/12/29 23:02]
+ *****************************************************************************/
+
+ODINFUNCTION6(LONG,    SHRegSetUSValueA,
+              HKEY,    hKey,
+              DWORD,   arg2,
+              DWORD,   arg3,
+              DWORD,   arg4,
+              DWORD,   arg5,
+              DWORD,   arg6)
+{
+  LONG rc;
+
+#if 0
+  rc = SHRegCreateUSKeyA(hKey,
+                         3,
+                         0,
+                         &hKey);
+  if (rc == ERROR_SUCCESS)
+  {
+    rc = SHRegWriteUSValueA(hKey,
+                            arg2,
+                            arg3,
+                            arg4,
+                            arg5,
+                            arg6);
+    SHRegCloseUSKey(hKey);
+  }
+#endif
+
+  return rc;
+}
+
+
+
+
+/*****************************************************************************
+ * Name      : DWORD SHRegSetUSValueW
+ * Purpose   :
+ * Parameters:
+ * Variables :
+ * Result    :
+ * Remark    : SHLWAPI.SHRegSetUSValueW SHLWAPI.616
+ * Status    : STUB UNTESTED
+ *
+ * Author    : Patrick Haller [Wed, 1999/12/29 23:02]
+ *****************************************************************************/
+
+ODINFUNCTION6(LONG,    SHRegSetUSValueW,
+              HKEY,    hKey,
+              DWORD,   arg2,
+              DWORD,   arg3,
+              DWORD,   arg4,
+              DWORD,   arg5,
+              DWORD,   arg6)
+{
+  LONG rc;
+
+#if 0
+  rc = SHRegCreateUSKeyW(hKey,
+                         3,
+                         0,
+                         &hKey);
+  if (rc == ERROR_SUCCESS)
+  {
+    rc = SHRegWriteUSValueW(hKey,
+                            arg2,
+                            arg3,
+                            arg4,
+                            arg5,
+                            arg6);
+    SHRegCloseUSKey(hKey);
+  }
+#endif
+
+  return rc;
+}
+
+
Index: trunk/src/shlwapi/regstream.c
===================================================================
--- trunk/src/shlwapi/regstream.c	(revision 4081)
+++ trunk/src/shlwapi/regstream.c	(revision 4081)
@@ -0,0 +1,336 @@
+/*
+ *	SHRegOpenStream
+ */
+#ifdef __WIN32OS2__
+#include <odin.h>
+#include <odinwrap.h>
+#include <os2sel.h>
+
+#include <string.h>
+#include <ctype.h>
+#include <wctype.h>
+#define HAVE_WCTYPE_H
+
+#define ICOM_CINTERFACE 1
+#define CINTERFACE 1
+#define INITGUID
+
+#endif
+
+#include <string.h>
+
+#include "winerror.h"
+#include "winreg.h"
+#include "wine/obj_storage.h"
+
+#include "heap.h"
+#include "debugtools.h"
+
+DEFAULT_DEBUG_CHANNEL(shell);
+
+typedef struct 
+{	ICOM_VFIELD(IStream);
+	DWORD		ref;
+	HKEY		hKey;
+	LPBYTE		pbBuffer;
+	DWORD		dwLength;
+	DWORD		dwPos;
+} ISHRegStream;
+
+static struct ICOM_VTABLE(IStream) rstvt;
+
+/**************************************************************************
+*   IStream_ConstructorA	[internal]
+*/
+static IStream *IStream_ConstructorA(HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue, DWORD grfMode)
+{
+	ISHRegStream*	rstr;
+	DWORD		dwType;
+	
+	rstr = (ISHRegStream*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ISHRegStream));
+
+	ICOM_VTBL(rstr)=&rstvt;
+	rstr->ref = 1;
+
+	if (!(RegOpenKeyExA (hKey, pszSubKey, 0, KEY_READ, &(rstr->hKey))))
+	{
+	  if (!(RegQueryValueExA(rstr->hKey, pszValue,0,0,0,&(rstr->dwLength))))
+	  { 
+	    /* read the binary data into the buffer */
+	    if((rstr->pbBuffer = HeapAlloc(GetProcessHeap(),0,rstr->dwLength)))
+	    {
+	      if (!(RegQueryValueExA(rstr->hKey, pszValue,0,&dwType,rstr->pbBuffer,&(rstr->dwLength))))
+	      {
+	        if (dwType == REG_BINARY )
+	        {
+	          TRACE ("%p\n", rstr);
+	          return (IStream*)rstr;
+	        }
+	      }
+	      HeapFree (GetProcessHeap(),0,rstr->pbBuffer);
+	    }
+	  }
+	  RegCloseKey(rstr->hKey);
+	}
+	HeapFree (GetProcessHeap(),0,rstr);
+	return NULL;
+}
+
+/**************************************************************************
+*   IStream_ConstructorW	[internal]
+*/
+static IStream *IStream_ConstructorW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD grfMode)
+{
+	ISHRegStream*	rstr;
+	DWORD		dwType;
+	
+	rstr = (ISHRegStream*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ISHRegStream));
+
+	ICOM_VTBL(rstr)=&rstvt;
+	rstr->ref = 1;
+
+	if (!(RegOpenKeyExW (hKey, pszSubKey, 0, KEY_READ, &(rstr->hKey))))
+	{
+	  if (!(RegQueryValueExW(rstr->hKey, pszValue,0,0,0,&(rstr->dwLength))))
+	  { 
+	    /* read the binary data into the buffer */
+	    if((rstr->pbBuffer = HeapAlloc(GetProcessHeap(),0,rstr->dwLength)))
+	    {
+	      if (!(RegQueryValueExW(rstr->hKey, pszValue,0,&dwType,rstr->pbBuffer,&(rstr->dwLength))))
+	      {
+	        if (dwType == REG_BINARY )
+	        {
+	          TRACE ("%p\n", rstr);
+	          return (IStream*)rstr;
+	        }
+	      }
+	      HeapFree (GetProcessHeap(),0,rstr->pbBuffer);
+	    }
+	  }
+	  RegCloseKey(rstr->hKey);
+	}
+	HeapFree (GetProcessHeap(),0,rstr);
+	return NULL;
+}
+
+/**************************************************************************
+*  IStream_fnQueryInterface
+*/
+static HRESULT WINAPI IStream_fnQueryInterface(IStream *iface, REFIID riid, LPVOID *ppvObj)
+{
+	ICOM_THIS(ISHRegStream, iface);
+
+////	TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj);
+
+	*ppvObj = NULL;
+
+	if(IsEqualIID(riid, &IID_IUnknown))	/*IUnknown*/
+	{ *ppvObj = This; 
+	}
+	else if(IsEqualIID(riid, &IID_IStream))	/*IStream*/
+	{ *ppvObj = This;
+	}   
+
+	if(*ppvObj)
+	{ 
+	  IStream_AddRef((IStream*)*ppvObj);      
+	  TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
+	  return S_OK;
+	}
+	TRACE("-- Interface: E_NOINTERFACE\n");
+	return E_NOINTERFACE;
+}
+
+/**************************************************************************
+*  IStream_fnAddRef
+*/
+static ULONG WINAPI IStream_fnAddRef(IStream *iface)
+{
+	ICOM_THIS(ISHRegStream, iface);
+
+	TRACE("(%p)->(count=%lu)\n",This, This->ref);
+
+	return ++(This->ref);
+}
+
+/**************************************************************************
+*  IStream_fnRelease
+*/
+static ULONG WINAPI IStream_fnRelease(IStream *iface)
+{
+	ICOM_THIS(ISHRegStream, iface);
+
+	TRACE("(%p)->()\n",This);
+
+	if (!--(This->ref)) 
+	{ TRACE(" destroying SHReg IStream (%p)\n",This);
+
+	  if (This->pbBuffer)
+	    HeapFree(GetProcessHeap(),0,This->pbBuffer);
+
+	  if (This->hKey)
+	    RegCloseKey(This->hKey);
+
+	  HeapFree(GetProcessHeap(),0,This);
+	  return 0;
+	}
+	return This->ref;
+}
+
+static HRESULT WINAPI IStream_fnRead (IStream * iface, void* pv, ULONG cb, ULONG* pcbRead)
+{
+	ICOM_THIS(ISHRegStream, iface);
+
+	DWORD dwBytesToRead, dwBytesLeft;
+	
+	TRACE("(%p)->(%p,0x%08lx,%p)\n",This, pv, cb, pcbRead);
+	
+	if ( !pv )
+	  return STG_E_INVALIDPOINTER;
+	  
+	dwBytesLeft = This->dwLength - This->dwPos;
+
+	if ( 0 >= dwBytesLeft )						/* end of buffer */
+	  return S_FALSE;
+	
+	dwBytesToRead = ( cb > dwBytesLeft) ? dwBytesLeft : cb;
+
+	memmove ( pv, (This->pbBuffer) + (This->dwPos), dwBytesToRead);
+	
+	This->dwPos += dwBytesToRead;					/* adjust pointer */
+
+	if (pcbRead)
+	  *pcbRead = dwBytesToRead;
+
+	return S_OK;
+}
+static HRESULT WINAPI IStream_fnWrite (IStream * iface, const void* pv, ULONG cb, ULONG* pcbWritten)
+{
+	ICOM_THIS(ISHRegStream, iface);
+
+	TRACE("(%p)\n",This);
+
+	return E_NOTIMPL;
+}
+static HRESULT WINAPI IStream_fnSeek (IStream * iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition)
+{
+	ICOM_THIS(ISHRegStream, iface);
+
+	TRACE("(%p)\n",This);
+
+	return E_NOTIMPL;
+}
+static HRESULT WINAPI IStream_fnSetSize (IStream * iface, ULARGE_INTEGER libNewSize)
+{
+	ICOM_THIS(ISHRegStream, iface);
+
+	TRACE("(%p)\n",This);
+
+	return E_NOTIMPL;
+}
+static HRESULT WINAPI IStream_fnCopyTo (IStream * iface, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten)
+{
+	ICOM_THIS(ISHRegStream, iface);
+
+	TRACE("(%p)\n",This);
+
+	return E_NOTIMPL;
+}
+static HRESULT WINAPI IStream_fnCommit (IStream * iface, DWORD grfCommitFlags)
+{
+	ICOM_THIS(ISHRegStream, iface);
+
+	TRACE("(%p)\n",This);
+
+	return E_NOTIMPL;
+}
+static HRESULT WINAPI IStream_fnRevert (IStream * iface)
+{
+	ICOM_THIS(ISHRegStream, iface);
+
+	TRACE("(%p)\n",This);
+
+	return E_NOTIMPL;
+}
+static HRESULT WINAPI IStream_fnLockRegion (IStream * iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
+{
+	ICOM_THIS(ISHRegStream, iface);
+
+	TRACE("(%p)\n",This);
+
+	return E_NOTIMPL;
+}
+static HRESULT WINAPI IStream_fnUnlockRegion (IStream * iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
+{
+	ICOM_THIS(ISHRegStream, iface);
+
+	TRACE("(%p)\n",This);
+
+	return E_NOTIMPL;
+}
+static HRESULT WINAPI IStream_fnStat (IStream * iface, STATSTG*   pstatstg, DWORD grfStatFlag)
+{
+	ICOM_THIS(ISHRegStream, iface);
+
+	TRACE("(%p)\n",This);
+
+	return E_NOTIMPL;
+}
+static HRESULT WINAPI IStream_fnClone (IStream * iface, IStream** ppstm)
+{
+	ICOM_THIS(ISHRegStream, iface);
+
+	TRACE("(%p)\n",This);
+
+	return E_NOTIMPL;
+}
+
+static struct ICOM_VTABLE(IStream) rstvt = 
+{	
+	ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
+	IStream_fnQueryInterface,
+	IStream_fnAddRef,
+	IStream_fnRelease,
+	IStream_fnRead,
+	IStream_fnWrite,
+	IStream_fnSeek,
+	IStream_fnSetSize,
+	IStream_fnCopyTo,
+	IStream_fnCommit,
+	IStream_fnRevert,
+	IStream_fnLockRegion,
+	IStream_fnUnlockRegion,
+	IStream_fnStat,
+	IStream_fnClone
+	
+};
+
+/*************************************************************************
+ * SHOpenRegStreamA				[SHLWAPI.@]
+ */
+IStream * WINAPI SHOpenRegStreamA(
+	HKEY hkey,
+	LPCSTR pszSubkey,
+	LPCSTR pszValue,
+	DWORD grfMode)
+{
+	TRACE("(0x%08x,%s,%s,0x%08lx)\n",
+	hkey, pszSubkey, pszValue, grfMode);
+
+	return IStream_ConstructorA(hkey, pszSubkey, pszValue, grfMode);
+}
+
+/*************************************************************************
+ * SHOpenRegStreamW				[SHLWAPI.@]
+ */
+IStream * WINAPI SHOpenRegStreamW(
+	HKEY hkey,
+	LPCWSTR pszSubkey,
+	LPCWSTR pszValue,
+	DWORD grfMode)
+{
+	TRACE("(0x%08x,%s,%s,0x%08lx)\n",
+	hkey, debugstr_w(pszSubkey), debugstr_w(pszValue), grfMode);
+
+	return IStream_ConstructorW(hkey, pszSubkey, pszValue, grfMode);
+}
Index: trunk/src/shlwapi/shlwapi.def
===================================================================
--- trunk/src/shlwapi/shlwapi.def	(revision 4080)
+++ trunk/src/shlwapi/shlwapi.def	(revision 4081)
@@ -1,3 +1,3 @@
-; $Id: shlwapi.def,v 1.17 2000-06-12 11:35:14 phaller Exp $
+; $Id: shlwapi.def,v 1.18 2000-08-24 09:32:43 sandervl Exp $
 
 ; updated export ordinals to NT4 SP6 version of SHLWAPI.DLL
@@ -106,5 +106,5 @@
                              _GetWindowTextLengthW@4              @96
                              _GetWindowsDirectoryW@8              @97
-                             _InsertMenuW@20                      @98 ; @@@PH imcomplete
+                             _InsertMenuW@20                      @98 ; @@@PH incomplete
                              _IsDialogMessageW@8                  @99
                              _LoadAcceleratorsW@8                 @100
@@ -219,12 +219,12 @@
     PathCombineA           = _PathCombineA@12                     @461
     PathCombineW           = _PathCombineW@12                     @462
-  ; PathCommonPrefixA      = _PathCommonPrefixA@12                @463
-  ; PathCommonPrefixW      = _PathCommonPrefixW@?                 @464
-  ; PathCompactPathA       = _PathCompactPathA@12                 @465
-  ; PathCompactPathExA     = _PathCompactPathExA@12               @466
-  ; PathCompactPathExW     = _PathCompactPathExW@12               @467
-  ; PathCompactPathW       = _PathCompactPathW@12                 @468
-  ; PathCreateFromUrlA     = _PathCreateFromUrlA@?                @469
-  ; PathCreateFromUrlW     = _PathCreateFromUrlW@?                @470
+    PathCommonPrefixA      = _PathCommonPrefixA@12                @463
+    PathCommonPrefixW      = _PathCommonPrefixW@12                @464
+    PathCompactPathA       = _PathCompactPathA@12                 @465
+    PathCompactPathExA     = _PathCompactPathExA@16               @466
+    PathCompactPathExW     = _PathCompactPathExW@16               @467
+    PathCompactPathW       = _PathCompactPathW@12                 @468
+    PathCreateFromUrlA     = _PathCreateFromUrlA@16               @469
+    PathCreateFromUrlW     = _PathCreateFromUrlW@16               @470
     PathFileExistsA        = _PathFileExistsA@4                   @471
     PathFileExistsW        = _PathFileExistsW@4                   @472
@@ -241,22 +241,22 @@
     PathGetArgsA           = _PathGetArgsA@4                      @483
     PathGetArgsW           = _PathGetArgsW@4                      @484
-  ; PathGetCharTypeA       = _PathGetCharTypeA@?                  @485
-  ; PathGetCharTypeW       = _PathGetCharTypeW@?                  @486
+    PathGetCharTypeA       = _PathGetCharTypeA@4                  @485
+    PathGetCharTypeW       = _PathGetCharTypeW@4                  @486
     PathGetDriveNumberA    = _PathGetDriveNumberA@4               @487
     PathGetDriveNumberW    = _PathGetDriveNumberW@4               @488
-  ; PathIsContentTypeA     = _PathIsContentTypeA@8                @489
-  ; PathIsContentTypeW     = _PathIsContentTypeW@8                @490
+    PathIsContentTypeA     = _PathIsContentTypeA@8                @489
+    PathIsContentTypeW     = _PathIsContentTypeW@8                @490
     PathIsDirectoryA       = _PathIsDirectoryA@4                  @491
 ;   PathIsDirectoryEmptyA  = _PathIsDirectoryEmptyA@4             @492
 ;   PathIsDirectoryEmptyW  = _PathIsDirectoryEmptyW@4             @493
-  ; PathIsDirectoryW       = _PathIsDirectoryW@?                  @494
-  ; PathIsFileSpecA        = _PathIsFileSpecA@?                   @495
-  ; PathIsFileSpecW        = _PathIsFileSpecW@?                   @496
+    PathIsDirectoryW       = _PathIsDirectoryW@4                  @494
+    PathIsFileSpecA        = _PathIsFileSpecA@4                   @495
+    PathIsFileSpecW        = _PathIsFileSpecW@4                   @496
 ;   PathIsLFNFileSpecA     = _PathIsLFNFileSpecA@4                @497
 ;   PathIsLFNFileSpecW     = _PathIsLFNFileSpecW@4                @498
 ;   PathIsNetworkPathA     = _PathIsNetworkPathA@4                @499
 ;   PathIsNetworkPathW     = _PathIsNetworkPathW@4                @500
-  ; PathIsPrefixA          = _PathIsPrefixA@8                     @501
-  ; PathIsPrefixW          = _PathIsPrefixW@?                     @502
+    PathIsPrefixA          = _PathIsPrefixA@8                     @501
+    PathIsPrefixW          = _PathIsPrefixW@8                     @502
     PathIsRelativeA        = _PathIsRelativeA@4                   @503
     PathIsRelativeW        = _PathIsRelativeW@4                   @504
@@ -265,18 +265,18 @@
     PathIsSameRootA        = _PathIsSameRootA@8                   @507
     PathIsSameRootW        = _PathIsSameRootW@8                   @508
-  ; PathIsSystemFolderA    = _PathIsSystemFolderA@8               @509
-  ; PathIsSystemFolderW    = _PathIsSystemFolderW@8               @510
+    PathIsSystemFolderA    = _PathIsSystemFolderA@8               @509
+    PathIsSystemFolderW    = _PathIsSystemFolderW@8               @510
     PathIsUNCA             = _PathIsUNCA@4                        @511
-  ; PathIsUNCServerA       = _PathIsUNCServerA@?                  @512
-  ; PathIsUNCServerShareA  = _PathIsUNCServerShareA@?             @513
-  ; PathIsUNCServerShareW  = _PathIsUNCServerShareW@?             @514
-  ; PathIsUNCServerW       = _PathIsUNCServerW@?                  @515
+    PathIsUNCServerA       = _PathIsUNCServerA@4                  @512
+    PathIsUNCServerShareA  = _PathIsUNCServerShareA@4             @513
+    PathIsUNCServerShareW  = _PathIsUNCServerShareW@4             @514
+    PathIsUNCServerW       = _PathIsUNCServerW@4                  @515
     PathIsUNCW             = _PathIsUNCW@4                        @516
     PathIsURLA             = _PathIsURLA@4                        @517
     PathIsURLW             = _PathIsURLW@4                        @518
-  ; PathMakePrettyA        = _PathMakePrettyA@?                   @519
-  ; PathMakePrettyW        = _PathMakePrettyW@?                   @520
-  ; PathMakeSystemFolderA  = _PathMakeSystemFolderA@4             @521
-  ; PathMakeSystemFolderW  = _PathMakeSystemFolderW@4             @522
+    PathMakePrettyA        = _PathMakePrettyA@4                   @519
+    PathMakePrettyW        = _PathMakePrettyW@4                   @520
+    PathMakeSystemFolderA  = _PathMakeSystemFolderA@4             @521
+    PathMakeSystemFolderW  = _PathMakeSystemFolderW@4             @522
     PathMatchSpecA         = _PathMatchSpecA@8                    @523
     PathMatchSpecW         = _PathMatchSpecW@8                    @524
@@ -285,6 +285,6 @@
     PathQuoteSpacesA       = _PathQuoteSpacesA@4                  @527
     PathQuoteSpacesW       = _PathQuoteSpacesW@4                  @528
-  ; PathRelativePathToA    = _PathRelativePathToA@?               @529
-  ; PathRelativePathToW    = _PathRelativePathToW@?               @530
+    PathRelativePathToA    = _PathRelativePathToA@20              @529
+    PathRelativePathToW    = _PathRelativePathToW@20              @530
     PathRemoveArgsA        = _PathRemoveArgsA@4                   @531
     PathRemoveArgsW        = _PathRemoveArgsW@4                   @532
@@ -297,8 +297,8 @@
     PathRemoveFileSpecA    = _PathRemoveFileSpecA@4               @539
     PathRemoveFileSpecW    = _PathRemoveFileSpecW@4               @540
-  ; PathRenameExtensionA   = _PathRenameExtensionA@@8             @541
-  ; PathRenameExtensionW   = _PathRenameExtensionW@?              @542
-  ; PathSearchAndQualifyA  = _PathSearchAndQualifyA@12            @543
-  ; PathSearchAndQualifyW  = _PathSearchAndQualifyW@12            @544
+    PathRenameExtensionA   = _PathRenameExtensionA@8              @541
+    PathRenameExtensionW   = _PathRenameExtensionW@8              @542
+    PathSearchAndQualifyA  = _PathSearchAndQualifyA@12            @543
+    PathSearchAndQualifyW  = _PathSearchAndQualifyW@12            @544
     PathSetDlgItemPathA    = _PathSetDlgItemPathA@12              @545
     PathSetDlgItemPathW    = _PathSetDlgItemPathW@12              @546
@@ -311,6 +311,6 @@
 ;   PathUndecorateA        = _PathUndecorateA@4                   @553
 ;   PathUndecorateW        = _PathUndecorateW@4                   @554
-  ; PathUnmakeSystemFolderA= _PathUnmakeSystemFolderA@4           @555
-  ; PathUnmakeSystemFolderW= _PathUnmakeSystemFolderW@4           @556
+    PathUnmakeSystemFolderA= _PathUnmakeSystemFolderA@4           @555
+    PathUnmakeSystemFolderW= _PathUnmakeSystemFolderW@4           @556
     PathUnquoteSpacesA     = _PathUnquoteSpacesA@4                @557
     PathUnquoteSpacesW     = _PathUnquoteSpacesW@4                @558
@@ -319,5 +319,5 @@
   ; SHCopyKeyA             = _SHCopyKeyA@?                        @560
   ; SHCopyKeyW             = _SHCopyKeyW@?                        @561
-  ; SHCreateShellPalette   = _SHCreateShellPalette@?              @562
+    SHCreateShellPalette   = _SHCreateShellPalette@4              @562
   ; SHCreateStreamOnFileA  = _SHCreateStreamOnFileA@?             @563
   ; SHCreateStreamOnFileW  = _SHCreateStreamOnFileW@?             @564
@@ -326,6 +326,6 @@
   ; SHDeleteEmptyKeyA      = _SHDeleteEmptyKeyA@?                 @567
   ; SHDeleteEmptyKeyW      = _SHDeleteEmptyKeyW@?                 @568
-  ; SHDeleteKeyA           = _SHDeleteKeyA@?                      @569
-  ; SHDeleteKeyW           = _SHDeleteKeyW@?                      @570
+    SHDeleteKeyA           = _SHDeleteKeyA@8                      @569
+    SHDeleteKeyW           = _SHDeleteKeyW@8                      @570
   ; SHDeleteOrphanKeyA     = _SHDeleteOrphanKeyA@?                @571
   ; SHDeleteOrphanKeyW     = _SHDeleteOrphanKeyW@?                @572
@@ -342,12 +342,12 @@
     SHGetValueW            = _SHGetValueW@24                      @583
     SHIsLowMemoryMachine   = _SHIsLowMemoryMachine@4              @584
-  ; SHOpenRegStream2A      = _SHOpenRegStream2A@?                 @585
-  ; SHOpenRegStream2W      = _SHOpenRegStream2W@?                 @586
-  ; SHOpenRegStreamA       = _SHOpenRegStreamA@?                  @587
-  ; SHOpenRegStreamW       = _SHOpenRegStreamW@?                  @588
+    SHOpenRegStream2A      = _SHOpenRegStreamA@16                 @585
+    SHOpenRegStream2W      = _SHOpenRegStreamW@16                 @586
+    SHOpenRegStreamA       = _SHOpenRegStreamA@16                 @587
+    SHOpenRegStreamW       = _SHOpenRegStreamW@16                 @588
   ; SHQueryInfoKeyA        = _SHQueryInfoKeyA@?                   @589
   ; SHQueryInfoKeyW        = _SHQueryInfoKeyW@?                   @590
-  ; SHQueryValueExA        = _SHQueryValueExA@?                   @591
-  ; SHQueryValueExW        = _SHQueryValueExW@?                   @592
+    SHQueryValueExA        = _SHQueryValueExA@24                  @591
+    SHQueryValueExW        = _SHQueryValueExW@24                  @592
   ; SHRegCloseUSKey        = _SHRegCloseUSKey@?                   @593
     SHRegCreateUSKeyA      = _SHRegCreateUSKeyA@20                @594
@@ -377,15 +377,15 @@
 ;   SHRegWriteUSValueW     = _SHRegWriteUSValueW@?                @618
 ;   SHSetSetThreadRef      = _SHSetThreadRef@?                    @619
-;   SHSetValueA            = _SHSetValueA@?                       @620
+    SHSetValueA            = _SHSetValueA@24                      @620
 ;   SHSetValueW            = _SHSetValueW@?                       @621
 ;   SHSkipJunction         = _SHSkipJunction@8                    @622
 ;   SHStrDupA              = _SHStrDupA@?                         @623
 ;   SHStrDupW              = _SHStrDUpW@?                         @624
-  ; StrCSpnA               = _StrCSpnA@?                          @625
+    StrCSpnA               = _StrCSpnA@8                          @625
   ; StrCSpnIA              = _StrCSpnIA@?                         @626
   ; StrCSpnIW              = _StrCSpnIW@?                         @627
-  ; StrCSpnW               = _StrCSpnW@?                          @628
-;   StrCatBuffA            = _StrCatBuffA@?                       @629
-;   StrCatBuffW            = _StrCatBuffW@?                       @630
+    StrCSpnW               = _StrCSpnW@8                          @628
+    StrCatBuffA            = _StrCatBuffA@12                      @629
+    StrCatBuffW            = _StrCatBuffW@12                      @630
   ; StrCatA                = _StrCatA@?                                 ; not exported ?
   ; StrCatW                = _StrCatW@?                           @631
@@ -394,11 +394,11 @@
     StrChrIW               = _StrChrIW@8                          @634
     StrChrW                = _StrChrW@8                           @635
-  ; StrCmpIW               = _StrCmpIW@?                          @636
-  ; StrCmpNA               = _StrCmpNA@12                         @637
+    StrCmpIW               = _lstrcmpiW@8                         @636
+    StrCmpNA               = _StrCmpNA@12                         @637
     StrCmpNIA              = _StrCmpNIA@12                        @638
     StrCmpNIW              = _StrCmpNIW@12                        @639
-  ; StrCmpNW               = _StrCmpNW@12                         @640
-  ; StrCmpW                = _StrCmpW@?                           @641
-  ; StrCpyNW               = _StrCpyNW@?                          @642
+    StrCmpNW               = _StrCmpNW@12                         @640
+    StrCmpW                = _lstrcmpW@8                          @641
+    StrCpyNW               = _lstrcpynW@12                        @642
     StrCpyA                = _StrCpyA@8                                 ; not exported ?
     StrCpyW                = _StrCpyW@8                           @643
@@ -430,8 +430,8 @@
   ; StrSpnA                = _StrSpnA@?                           @669
   ; StrSpnW                = _StrSpnW@?                           @670
-  ; StrStrA                = _StrStrA@8                           @671
+    StrStrA                = _StrStrA@8                           @671
     StrStrIA               = _StrStrIA@8                          @672
     StrStrIW               = _StrStrIW@8                          @673
-  ; StrStrW                = _StrStrW@8                           @674
+    StrStrW                = _StrStrW@8                           @674
     StrToIntA              = _StrToIntA@4                         @675
   ; StrToIntExA            = _StrToIntExA@?                       @676
@@ -466,52 +466,13 @@
     UrlUnescapeA           = _UrlUnescapeA@16                     @705
     UrlUnescapeW           = _UrlUnescapeW@16                     @706
-;   wnsprintfA             = _wnsprintfA@16                       @707
-;   wnsprintfW             = _wnsprintfW@16                       @708
+    wnsprintfA             = _wnsprintfA                          @707
+    wnsprintfW             = _wnsprintfW                          @708
 ;   wvnsprintfA            = _wvnsprintfA@16                      @709
 ;   wvnsprintfW            = _wvnsprintfW@16                      @710
 
-; ------------------------------
-; Export for SHELL32 to catch up
-; ------------------------------
-
-   _PathIsRootAW@4                      @1000
-   _PathBuildRootAW@8			@1001
-   _PathFindExtensionAW@4		@1002
-   _PathAddBackslashAW@4		@1003
-   _PathRemoveBlanksAW@4		@1004
-   _PathFindFileNameAW@4		@1005
-   _PathRemoveFileSpecAW@4		@1006
-   _PathAppendAW@8			@1007
-   _PathCombineAW@12			@1008
-   _PathStripPathAW@4			@1009
-   _PathIsUNCAW@4			@1010
-   _PathIsRelativeAW@4			@1011
-   _PathProcessCommandAW@16          	@1012
-   _PathParseIconLocationAW@4           @1013
-   _PathResolveAW@12                    @1014
-   _PathQualifyAW@4                     @1015
-   _PathGetArgsAW@4                     @1016
-   _PathMatchSpecAW@8                   @1017
-   _PathRemoveArgsAW@4                  @1018
-   _PathFindOnPathAW@8           	@1019
-   _PathIsSameRootAW@8 			@1020
-   _PathCleanupSpecAW@8 		@1021
-   _PathIsDirectoryAW@4                 @1022
-   _PathQuoteSpacesAW@4                 @1023
-   _PathGetExtensionAW@4                @1024
-   _PathGetShortPathAW@4		@1025
-   _PathStripToRootAW@4                 @1026
-   _PathUnquoteSpacesAW@4               @1027
-   _PathMakeUniqueNameAW@20             @1028
-   _PathSetDlgItemPathAW@12             @1029
-   _PathGetDriveNumberAW@4              @1030
-   _PathYetAnotherMakeUniqueNameAW@16   @1031
-   _PathIsExeAW@4                       @1032
-   _PathRemoveExtensionAW@4             @1033
-
-   _SHGetSpecialFolderPathAW@16         @1050
-   _SHGetSpecialFolderPathA@16          @1051
-   _SHGetSpecialFolderPathW@16          @1052
-
-   _IsLFNDriveA@4                       @1070
-
+;which ordinals??
+    StrRetToBufA           = _StrRetToBufA@16                     @800
+    StrRetToBufW           = _StrRetToBufW@16                     @801
+
+    SHRegGetPathA          = _SHRegGetPathA@20                    @802
+    SHRegGetPathW          = _SHRegGetPathW@20                    @803
Index: trunk/src/shlwapi/shlwapi.h
===================================================================
--- trunk/src/shlwapi/shlwapi.h	(revision 4080)
+++ 	(revision )
@@ -1,67 +1,0 @@
-/* $Id: shlwapi.h,v 1.4 2000-06-13 18:14:20 phaller Exp $ */
-
-/*
- * Win32 Lightweight SHELL32 for OS/2
- *
- * Copyright 2000 Patrick Haller
- * Project Odin Software License can be found in LICENSE.TXT
- *
- */
-
-/*
- *      internal Shell32 Library definitions
- */
-
-#ifndef _SHLWAPI_H_
-#define _SHLWAPI_H_
-
-
-/*****************************************************************************
- * Includes                                                                  *
- *****************************************************************************/
-
-
-#ifdef __cplusplus
-  extern "C" {
-#endif /* defined(__cplusplus) */
-
-    
-/*****************************************************************************
- * Prototypes                                                                *
- *****************************************************************************/
-    
-// REG.CPP
-BOOL WIN32API SHRegGetBoolUSValueA(LPCSTR pszSubKey,
-                                   LPCSTR pszValue,
-                                   BOOL   fIgnoreHKCU,
-                                   BOOL   fDefault);
-    
-BOOL WIN32API SHRegGetBoolUSValueW(LPCWSTR pszSubKey,
-                                   LPCWSTR pszValue,
-                                   BOOL    fIgnoreHKCU,
-                                   BOOL    fDefault);
-    
-LONG WIN32API SHRegGetUSValueA(LPCSTR   pSubKey,
-                               LPCSTR   pValue,
-                               LPDWORD  pwType,
-                               LPVOID   pvData,
-                               LPDWORD  pbData,
-                               BOOL     fIgnoreHKCU,
-                               LPVOID   pDefaultData,
-                               DWORD    wDefaultDataSize);
-    
-// PATH.CPP
-BOOL  WIN32API PathRemoveFileSpecA(LPSTR lpszPath);
-LPSTR WIN32API PathAppendA(LPSTR  lpstrPath,
-                           LPCSTR lpstrAppend);
-    
-// STRING.CPP
-LPSTR WIN32API StrStrIA(LPCSTR lpFirst, LPCSTR lpSrch);
-    
-
-#ifdef __cplusplus
-  }
-#endif /* defined(__cplusplus) */
-
-
-#endif
Index: trunk/src/shlwapi/shlwapi_odin.h
===================================================================
--- trunk/src/shlwapi/shlwapi_odin.h	(revision 4081)
+++ trunk/src/shlwapi/shlwapi_odin.h	(revision 4081)
@@ -0,0 +1,66 @@
+/* $Id: shlwapi_odin.h,v 1.1 2000-08-24 09:32:44 sandervl Exp $ */
+
+/*
+ * Win32 Lightweight SHELL32 for OS/2
+ *
+ * Copyright 2000 Patrick Haller
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+
+/*
+ *      internal Shell32 Library definitions
+ */
+
+#ifndef _SHLWAPI_H_
+#define _SHLWAPI_H_
+
+
+/*****************************************************************************
+ * Includes                                                                  *
+ *****************************************************************************/
+
+
+#ifdef __cplusplus
+  extern "C" {
+#endif /* defined(__cplusplus) */
+
+    
+/*****************************************************************************
+ * Prototypes                                                                *
+ *****************************************************************************/
+    
+// REG.CPP
+BOOL WIN32API SHRegGetBoolUSValueA(LPCSTR pszSubKey,
+                                   LPCSTR pszValue,
+                                   BOOL   fIgnoreHKCU,
+                                   BOOL   fDefault);
+    
+BOOL WIN32API SHRegGetBoolUSValueW(LPCWSTR pszSubKey,
+                                   LPCWSTR pszValue,
+                                   BOOL    fIgnoreHKCU,
+                                   BOOL    fDefault);
+    
+LONG WIN32API SHRegGetUSValueA(LPCSTR   pSubKey,
+                               LPCSTR   pValue,
+                               LPDWORD  pwType,
+                               LPVOID   pvData,
+                               LPDWORD  pbData,
+                               BOOL     fIgnoreHKCU,
+                               LPVOID   pDefaultData,
+                               DWORD    wDefaultDataSize);
+    
+   
+// STRING.CPP
+LPSTR WIN32API StrStrIA(LPCSTR lpFirst, LPCSTR lpSrch);
+
+int WINAPI StrCmpNIA ( LPCSTR str1, LPCSTR str2, int len);
+int WINAPI StrCmpNIW ( LPCWSTR wstr1, LPCWSTR wstr2, int len);
+    
+
+#ifdef __cplusplus
+  }
+#endif /* defined(__cplusplus) */
+
+
+#endif
Index: trunk/src/shlwapi/string.c
===================================================================
--- trunk/src/shlwapi/string.c	(revision 4081)
+++ trunk/src/shlwapi/string.c	(revision 4081)
@@ -0,0 +1,490 @@
+//Note: Odin changes marked by #ifdef __WIN32OS2__!
+#ifdef __WIN32OS2__
+#include <odin.h>
+#include <odinwrap.h>
+#include <os2sel.h>
+
+#include <string.h>
+#include <wctype.h>
+#include <wcstr.h>
+#define HAVE_WCTYPE_H
+#include <win\shlwapi.h>
+
+#include <heapstring.h>
+#include <winnls.h>
+#endif
+
+#include <ctype.h>
+#include <stdlib.h> 
+#include <stdio.h>
+#include <string.h>
+
+#include "winerror.h"
+#include "wine/undocshell.h"
+#include "wine/unicode.h"
+#include "heap.h"
+#include "debugtools.h"
+
+DEFAULT_DEBUG_CHANNEL(shell);
+
+/*************************************************************************
+ * StrChrA					[SHLWAPI]
+ */
+LPSTR WINAPI StrChrA (LPCSTR str, WORD c)
+{
+	TRACE("%s %i\n", str,c);
+	return strchr(str, c);
+}
+
+/*************************************************************************
+ * StrChrW					[SHLWAPI]
+ *
+ */
+LPWSTR WINAPI StrChrW (LPCWSTR str, WCHAR x )
+{
+	TRACE("%s 0x%04x\n",debugstr_w(str),x);
+	return strchrW(str, x);
+}
+
+/*************************************************************************
+ * StrCmpNA					[SHLWAPI]
+ */
+INT WINAPI StrCmpNA ( LPCSTR str1, LPCSTR str2, INT len)
+{
+	TRACE("%s %s %i stub\n", str1,str2,len);
+	return strncmp(str1, str2, len);
+}
+
+/*************************************************************************
+ * StrCmpNW					[SHLWAPI]
+ */
+INT WINAPI StrCmpNW ( LPCWSTR wstr1, LPCWSTR wstr2, INT len)
+{
+	TRACE("%s %s %i stub\n", debugstr_w(wstr1),debugstr_w(wstr2),len);
+	return strncmpW(wstr1, wstr2, len);
+}
+
+/*************************************************************************
+ * StrCmpNIA					[SHLWAPI]
+ */
+int WINAPI StrCmpNIA ( LPCSTR str1, LPCSTR str2, int len)
+{
+	TRACE("%s %s %i stub\n", str1,str2,len);
+	return strncasecmp(str1, str2, len);
+}
+
+/*************************************************************************
+ * StrCmpNIW					[SHLWAPI]
+ */
+int WINAPI StrCmpNIW ( LPCWSTR wstr1, LPCWSTR wstr2, int len)
+{
+	TRACE("%s %s %i stub\n", debugstr_w(wstr1),debugstr_w(wstr2),len);
+	return strncmpiW(wstr1, wstr2, len);
+}
+
+/*************************************************************************
+ * StrCatW					[SHLWAPI]
+ */
+LPWSTR WINAPI StrCatW( LPWSTR wstr1, LPCWSTR wstr2 )
+{
+    return strcatW( wstr1, wstr2 );
+}
+
+
+/*************************************************************************
+ * StrCpyW					[SHLWAPI]
+ */
+LPWSTR WINAPI StrCpyW( LPWSTR wstr1, LPCWSTR wstr2 )
+{
+    return strcpyW( wstr1, wstr2 );
+}
+
+
+/*************************************************************************
+ * StrStrA					[SHLWAPI]
+ */
+LPSTR WINAPI StrStrA(LPCSTR lpFirst, LPCSTR lpSrch)
+{
+    while (*lpFirst)
+    {
+        LPCSTR p1 = lpFirst, p2 = lpSrch;
+        while (*p1 && *p2 && *p1 == *p2) { p1++; p2++; }
+        if (!*p2) return (LPSTR)lpFirst;
+        lpFirst++;
+    }
+    return NULL;
+}
+
+/*************************************************************************
+ * StrStrW					[SHLWAPI]
+ */
+LPWSTR WINAPI StrStrW(LPCWSTR lpFirst, LPCWSTR lpSrch)
+{
+    while (*lpFirst)
+    {
+        LPCWSTR p1 = lpFirst, p2 = lpSrch;
+        while (*p1 && *p2 && *p1 == *p2) { p1++; p2++; }
+        if (!*p2) return (LPWSTR)lpFirst;
+        lpFirst++;
+    }
+    return NULL;
+}
+
+#ifndef __WIN32OS2__
+/*************************************************************************
+ * StrStrIA					[SHLWAPI]
+ */
+LPSTR WINAPI StrStrIA(LPCSTR lpFirst, LPCSTR lpSrch)
+{
+    while (*lpFirst)
+    {
+        LPCSTR p1 = lpFirst, p2 = lpSrch;
+        while (*p1 && *p2 && toupper(*p1) == toupper(*p2)) { p1++; p2++; }
+        if (!*p2) return (LPSTR)lpFirst;
+        lpFirst++;
+    }
+    return NULL;
+}
+
+/*************************************************************************
+ * StrStrIW					[SHLWAPI]
+ */
+LPWSTR WINAPI StrStrIW(LPCWSTR lpFirst, LPCWSTR lpSrch)
+{
+    while (*lpFirst)
+    {
+        LPCWSTR p1 = lpFirst, p2 = lpSrch;
+        while (*p1 && *p2 && toupperW(*p1) == toupperW(*p2)) { p1++; p2++; }
+        if (!*p2) return (LPWSTR)lpFirst;
+        lpFirst++;
+    }
+    return NULL;
+}
+#endif
+
+/*************************************************************************
+ *	StrToIntA			[SHLWAPI]
+ */
+int WINAPI StrToIntA(LPCSTR lpSrc)
+{
+	TRACE("%s\n", lpSrc);
+	return atol(lpSrc);
+}
+
+/*************************************************************************
+ *	StrToIntW			[SHLWAPI]
+ */
+int WINAPI StrToIntW(LPCWSTR lpSrc)
+{
+	int ret;
+	LPSTR lpStr =  HEAP_strdupWtoA(GetProcessHeap(),0,lpSrc);
+
+	TRACE("%s\n", debugstr_w(lpSrc));
+
+	ret = atol(lpStr);
+	HeapFree(GetProcessHeap(),0,lpStr);
+	return ret;
+}
+
+/*************************************************************************
+ *	StrDupA			[SHLWAPI]
+ */
+LPSTR WINAPI StrDupA (LPCSTR lpSrc)
+{
+	int len = strlen(lpSrc);
+	LPSTR lpDest = (LPSTR) LocalAlloc(LMEM_FIXED, len+1);
+	
+	TRACE("%s\n", lpSrc);
+
+	if (lpDest) strcpy(lpDest, lpSrc);
+	return lpDest;
+}
+
+/*************************************************************************
+ *	StrDupW			[SHLWAPI]
+ */
+LPWSTR WINAPI StrDupW (LPCWSTR lpSrc)
+{
+	int len = strlenW(lpSrc);
+	LPWSTR lpDest = (LPWSTR) LocalAlloc(LMEM_FIXED, sizeof(WCHAR) * (len+1));
+	
+	TRACE("%s\n", debugstr_w(lpSrc));
+
+	if (lpDest) strcpyW(lpDest, lpSrc);
+	return lpDest;
+}
+
+/*************************************************************************
+ *	StrCSpnA		[SHLWAPI]
+ */
+int WINAPI StrCSpnA (LPCSTR lpStr, LPCSTR lpSet)
+{
+	int i,j, pos = strlen(lpStr);
+
+	TRACE("(%p %s  %p %s)\n",
+	   lpStr, debugstr_a(lpStr), lpSet, debugstr_a(lpSet));
+
+	for (i=0; i < strlen(lpSet) ; i++ )
+	{
+	  for (j = 0; j < pos;j++)
+	  {
+	    if (lpStr[j] == lpSet[i])
+	    {
+	      pos = j;
+	    }
+	  }
+	}      
+	TRACE("-- %u\n", pos);
+	return pos;	
+}
+
+/*************************************************************************
+ *	StrCSpnW		[SHLWAPI]
+ */
+int WINAPI StrCSpnW (LPCWSTR lpStr, LPCWSTR lpSet)
+{
+	int i,j, pos = strlenW(lpStr);
+
+	TRACE("(%p %s %p %s)\n",
+	   lpStr, debugstr_w(lpStr), lpSet, debugstr_w(lpSet));
+
+	for (i=0; i < strlenW(lpSet) ; i++ )
+	{
+	  for (j = 0; j < pos;j++)
+	  {
+	    if (lpStr[j] == lpSet[i])
+	    {
+	      pos = j;
+	    }
+	  }
+	}      
+	TRACE("-- %u\n", pos);
+	return pos;	
+}
+
+/**************************************************************************
+ * StrRChrA [SHLWAPI.@]
+ *
+ */
+LPSTR WINAPI StrRChrA( LPCSTR lpStart, LPCSTR lpEnd, WORD wMatch )
+{
+    LPCSTR lpGotIt = NULL;
+    BOOL dbcs = IsDBCSLeadByte( LOBYTE(wMatch) );
+
+    TRACE("(%p, %p, %x)\n", lpStart, lpEnd, wMatch);
+
+    if (!lpEnd) lpEnd = lpStart + strlen(lpStart);
+
+    for(; lpStart < lpEnd; lpStart = CharNextA(lpStart))
+    {
+        if (*lpStart != LOBYTE(wMatch)) continue;
+        if (dbcs && lpStart[1] != HIBYTE(wMatch)) continue;
+        lpGotIt = lpStart;
+    }    
+    return (LPSTR)lpGotIt;
+}
+
+
+/**************************************************************************
+ * StrRChrW [SHLWAPI.@]
+ *
+ */
+LPWSTR WINAPI StrRChrW( LPCWSTR lpStart, LPCWSTR lpEnd, WORD wMatch)
+{
+    LPCWSTR lpGotIt = NULL;
+
+    TRACE("(%p, %p, %x)\n", lpStart, lpEnd, wMatch);
+    if (!lpEnd) lpEnd = lpStart + strlenW(lpStart);
+
+    for(; lpStart < lpEnd; lpStart = CharNextW(lpStart))
+        if (*lpStart == wMatch) lpGotIt = lpStart;
+
+    return (LPWSTR)lpGotIt;
+}
+
+
+/*************************************************************************
+ *	StrCatBuffA		[SHLWAPI]
+ *
+ * Appends back onto front, stopping when front is size-1 characters long.
+ * Returns front.
+ *
+ */
+LPSTR WINAPI StrCatBuffA(LPSTR front, LPCSTR back, INT size)
+{
+    LPSTR dst = front + strlen(front);
+    LPCSTR src = back, end = front + size - 1;
+
+    while(dst < end && *src)
+        *dst++ = *src++;
+    *dst = '\0';
+    return front;
+}
+
+/*************************************************************************
+ *	StrCatBuffW		[SHLWAPI]
+ *
+ * Appends back onto front, stopping when front is size-1 characters long.
+ * Returns front.
+ *
+ */
+LPWSTR WINAPI StrCatBuffW(LPWSTR front, LPCWSTR back, INT size)
+{
+    LPWSTR dst = front + strlenW(front);
+    LPCWSTR src = back, end = front + size - 1;
+
+    while(dst < end && *src)
+        *dst++ = *src++;
+    *dst = '\0';
+    return front;
+}
+
+/*************************************************************************
+ * StrRetToBufA					[SHLWAPI.@]
+ * 
+ * converts a STRRET to a normal string
+ *
+ * NOTES
+ *  the pidl is for STRRET OFFSET
+ */
+HRESULT WINAPI StrRetToBufA (LPSTRRET src, LPITEMIDLIST pidl, LPSTR dest, DWORD len)
+{
+	TRACE("dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl);
+
+	switch (src->uType)
+	{
+	  case STRRET_WSTR:
+	    WideCharToMultiByte(CP_ACP, 0, src->u.pOleStr, -1, (LPSTR)dest, len, NULL, NULL);
+/*	    SHFree(src->u.pOleStr);  FIXME: is this right? */
+	    break;
+
+	  case STRRET_CSTRA:
+	    lstrcpynA((LPSTR)dest, src->u.cStr, len);
+	    break;
+
+	  case STRRET_OFFSETA:
+	    lstrcpynA((LPSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
+	    break;
+
+	  default:
+	    FIXME("unknown type!\n");
+	    if (len)
+	    {
+	      *(LPSTR)dest = '\0';
+	    }
+	    return(FALSE);
+	}
+	return S_OK;
+}
+
+/*************************************************************************
+ * StrRetToBufW					[SHLWAPI.@]
+ * 
+ * converts a STRRET to a normal string
+ *
+ * NOTES
+ *  the pidl is for STRRET OFFSET
+ */
+HRESULT WINAPI StrRetToBufW (LPSTRRET src, LPITEMIDLIST pidl, LPWSTR dest, DWORD len)
+{
+	TRACE("dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl);
+
+	switch (src->uType)
+	{
+	  case STRRET_WSTR:
+	    lstrcpynW((LPWSTR)dest, src->u.pOleStr, len);
+/*	    SHFree(src->u.pOleStr);  FIXME: is this right? */
+	    break;
+
+	  case STRRET_CSTRA:
+	    lstrcpynAtoW((LPWSTR)dest, src->u.cStr, len);
+	    break;
+
+	  case STRRET_OFFSETA:
+	    if (pidl)
+	    {
+	      lstrcpynAtoW((LPWSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
+	    }
+	    break;
+
+	  default:
+	    FIXME("unknown type!\n");
+	    if (len)
+	    { *(LPSTR)dest = '\0';
+	    }
+	    return(FALSE);
+	}
+	return S_OK;
+}
+
+/*************************************************************************
+ * StrFormatByteSizeA				[SHLWAPI]
+ */
+LPSTR WINAPI StrFormatByteSizeA ( DWORD dw, LPSTR pszBuf, UINT cchBuf )
+{	char buf[64];
+	TRACE("%lx %p %i\n", dw, pszBuf, cchBuf);
+	if ( dw<1024L )
+	{ sprintf (buf,"%3.1f bytes", (FLOAT)dw);
+	}
+	else if ( dw<1048576L)
+	{ sprintf (buf,"%3.1f KB", (FLOAT)dw/1024);
+	}
+	else if ( dw < 1073741824L)
+	{ sprintf (buf,"%3.1f MB", (FLOAT)dw/1048576L);
+	}
+	else
+	{ sprintf (buf,"%3.1f GB", (FLOAT)dw/1073741824L);
+	}
+	lstrcpynA (pszBuf, buf, cchBuf);
+	return pszBuf;	
+}
+
+/*************************************************************************
+ * StrFormatByteSizeW				[SHLWAPI]
+ */
+LPWSTR WINAPI StrFormatByteSizeW ( DWORD dw, LPWSTR pszBuf, UINT cchBuf )
+{	char buf[64];
+	TRACE("%lx %p %i\n", dw, pszBuf, cchBuf);
+	if ( dw<1024L )
+	{ sprintf (buf,"%3.1f bytes", (FLOAT)dw);
+	}
+	else if ( dw<1048576L)
+	{ sprintf (buf,"%3.1f KB", (FLOAT)dw/1024);
+	}
+	else if ( dw < 1073741824L)
+	{ sprintf (buf,"%3.1f MB", (FLOAT)dw/1048576L);
+	}
+	else
+	{ sprintf (buf,"%3.1f GB", (FLOAT)dw/1073741824L);
+	}
+	lstrcpynAtoW (pszBuf, buf, cchBuf);
+	return pszBuf;	
+}
+
+/*************************************************************************
+ *      wnsprintfA	[SHLWAPI]
+ */
+int WINAPIV wnsprintfA(LPSTR lpOut, int cchLimitIn, LPCSTR lpFmt, ...)
+{
+    va_list valist;
+    INT res;
+
+    va_start( valist, lpFmt );
+    res = wvsnprintfA( lpOut, cchLimitIn, lpFmt, valist );
+    va_end( valist );
+    return res;
+}
+
+/*************************************************************************
+ *      wnsprintfW	[SHLWAPI]
+ */
+int WINAPIV wnsprintfW(LPWSTR lpOut, int cchLimitIn, LPCWSTR lpFmt, ...)
+{
+    va_list valist;
+    INT res;
+
+    va_start( valist, lpFmt );
+    res = wvsnprintfW( lpOut, cchLimitIn, lpFmt, valist );
+    va_end( valist );
+    return res;
+}
Index: trunk/src/shlwapi/string.cpp
===================================================================
--- trunk/src/shlwapi/string.cpp	(revision 4080)
+++ 	(revision )
@@ -1,697 +1,0 @@
- /* $Id: string.cpp,v 1.6 2000-08-02 20:18:24 bird Exp $ */
-
-/*
- * Win32 Lightweight SHELL32 for OS/2
- *
- * Copyright 1997 Marcus Meissner
- * Copyright 1999 Patrick Haller (haller@zebra.fh-weingarten.de)
- * Project Odin Software License can be found in LICENSE.TXT
- *
- * Path Functions
- *
- * Many of this functions are in SHLWAPI.DLL also
- *
- * Corel WINE 20000324 level (without CRTDLL_* calls)
- */
-
-/*****************************************************************************
- * Remark                                                                    *
- *****************************************************************************
-
- */
-
-
-/*****************************************************************************
- * Includes                                                                  *
- *****************************************************************************/
-
-#include <odin.h>
-#include <odinwrap.h>
-#include <os2sel.h>
-
-#include <string.h>
-#include <ctype.h>
-#include <wctype.h>
-#include <wcstr.h>
-#define HAVE_WCTYPE_H
-
-#include "debugtools.h"
-
-#include <winreg.h>
-
-#include <heapstring.h>
-#include <misc.h>
-#include <win\shell.h>
-#include <win\winerror.h>
-#include <winversion.h>
-#include <winuser.h>
-
-
-#define ICOM_CINTERFACE 1
-#define CINTERFACE 1
-
-#include "winerror.h"
-#include "winnls.h"
-#include "winversion.h"
-#include "heap.h"
-
-#include "shellapi.h"
-#include "shlobj.h"
-#include "wine/undocshell.h"
-
-#include "shlwapi.h"
-
-/*****************************************************************************
- * Local Variables                                                           *
- *****************************************************************************/
-
-ODINDEBUGCHANNEL(SHLWAPI-STRING)
-
-
-/*****************************************************************************
- * Name      : ChrCmpIA
- * Purpose   :
- * Parameters:
- * Variables :
- * Result    :
- * Remark    :
- * Status    : PARTIALLY IMPLEMENTED UNTESTED
- *
- * Author    : Patrick Haller [Wed, 1999/12/29 09:00]
- *****************************************************************************/
-
-ODINFUNCTION2(INT,    ChrCmpIA,
-              INT,    ch1,
-              INT,    ch2)
-{
-  // Note: IsDBCSLeadByte ignored !
-
-  if ( (ch1 >= 'A') && (ch1 <= 'Z') ) ch1 |= 0x20;
-  if ( (ch2 >= 'A') && (ch2 <= 'Z') ) ch2 |= 0x20;
-
-  return ch1 - ch2;
-}
-
-
-/*************************************************************************
- * OleStrToStrN                                 [SHELL32.78]
- */
-BOOL WINAPI OleStrToStrNA (LPSTR lpStr, INT nStr, LPCWSTR lpOle, INT nOle)
-{
-        TRACE("%p %x %s %x\n", lpStr, nStr, debugstr_w(lpOle), nOle);
-        return WideCharToMultiByte (0, 0, lpOle, nOle, lpStr, nStr, NULL, NULL);
-}
-
-BOOL WINAPI OleStrToStrNW (LPWSTR lpwStr, INT nwStr, LPCWSTR lpOle, INT nOle)
-{
-        TRACE("%p %x %s %x\n", lpwStr, nwStr, debugstr_w(lpOle), nOle);
-
-        if (lstrcpynW ( lpwStr, lpOle, nwStr))
-        { return lstrlenW (lpwStr);
-        }
-        return 0;
-}
-
-BOOL WINAPI OleStrToStrNAW (LPVOID lpOut, INT nOut, LPCVOID lpIn, INT nIn)
-{
-        if (VERSION_OsIsUnicode())
-          return OleStrToStrNW ((LPWSTR)lpOut, nOut, (LPCWSTR)lpIn, nIn);
-        return OleStrToStrNA ((LPSTR)lpOut, nOut, (LPCWSTR)lpIn, nIn);
-}
-
-/*************************************************************************
- * StrToOleStrN                                 [SHELL32.79]
- *  lpMulti, nMulti, nWide [IN]
- *  lpWide [OUT]
- */
-BOOL WINAPI StrToOleStrNA (LPWSTR lpWide, INT nWide, LPCSTR lpStrA, INT nStr)
-{
-        TRACE("%p %x %s %x\n", lpWide, nWide, lpStrA, nStr);
-        return MultiByteToWideChar (0, 0, lpStrA, nStr, lpWide, nWide);
-}
-BOOL WINAPI StrToOleStrNW (LPWSTR lpWide, INT nWide, LPCWSTR lpStrW, INT nStr)
-{
-        TRACE("%p %x %s %x\n", lpWide, nWide, debugstr_w(lpStrW), nStr);
-
-        if (lstrcpynW (lpWide, lpStrW, nWide))
-        { return lstrlenW (lpWide);
-        }
-        return 0;
-}
-
-BOOL WINAPI StrToOleStrNAW (LPWSTR lpWide, INT nWide, LPCVOID lpStr, INT nStr)
-{
-        if (VERSION_OsIsUnicode())
-          return StrToOleStrNW (lpWide, nWide, (LPWSTR)lpStr, nStr);
-        return StrToOleStrNA (lpWide, nWide, (LPSTR)lpStr, nStr);
-}
-
-
-/*************************************************************************
- * StrRetToStrN                                 [SHELL32.96]
- *
- * converts a STRRET to a normal string
- *
- * NOTES
- *  the pidl is for STRRET OFFSET
- */
-HRESULT WINAPI StrRetToBufA (LPSTRRET src, LPITEMIDLIST pidl, LPSTR dest, DWORD len)
-{
-        return StrRetToStrNA(dest, len, src, pidl);
-}
-
-HRESULT WINAPI StrRetToStrNA (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)
-{
-        TRACE("dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl);
-
-        switch (src->uType)
-        {
-          case STRRET_WSTR:
-            WideCharToMultiByte(CP_ACP, 0, src->u.pOleStr, -1, (LPSTR)dest, len, NULL, NULL);
-            //SHFree(src->u.pOleStr);
-            HeapFree( GetProcessHeap(), 0, src->u.pOleStr);
-            break;
-
-          case STRRET_CSTRA:
-            lstrcpynA((LPSTR)dest, src->u.cStr, len);
-            break;
-
-          case STRRET_OFFSETA:
-            lstrcpynA((LPSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
-            break;
-
-          default:
-            FIXME("unknown type!\n");
-            if (len)
-            {
-              *(LPSTR)dest = '\0';
-            }
-            return(FALSE);
-        }
-        return S_OK;
-}
-
-HRESULT WINAPI StrRetToBufW (LPSTRRET src, LPITEMIDLIST pidl, LPWSTR dest, DWORD len)
-{
-        return StrRetToStrNW(dest, len, src, pidl);
-}
-
-HRESULT WINAPI StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)
-{
-        TRACE("dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl);
-
-        switch (src->uType)
-        {
-          case STRRET_WSTR:
-            lstrcpynW((LPWSTR)dest, src->u.pOleStr, len);
-            //SHFree(src->u.pOleStr);
-            HeapFree( GetProcessHeap(), 0, src->u.pOleStr);
-            break;
-
-          case STRRET_CSTRA:
-            lstrcpynAtoW((LPWSTR)dest, src->u.cStr, len);
-            break;
-
-          case STRRET_OFFSETA:
-            if (pidl)
-            {
-              lstrcpynAtoW((LPWSTR)dest, ((LPSTR)&pidl->mkid)+src->u.uOffset, len);
-            }
-            break;
-
-          default:
-            FIXME("unknown type!\n");
-            if (len)
-            { *(LPSTR)dest = '\0';
-            }
-            return(FALSE);
-        }
-        return S_OK;
-}
-HRESULT WINAPI StrRetToStrNAW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)
-{
-        if(VERSION_OsIsUnicode())
-          return StrRetToStrNW (dest, len, src, pidl);
-        return StrRetToStrNA (dest, len, src, pidl);
-}
-
-/*************************************************************************
- * StrChrA                                      [NT 4.0:SHELL32.651]
- *
- */
-LPSTR WINAPI StrChrA (LPSTR str, CHAR x )
-{       LPSTR ptr=str;
-
-        do
-        {  if (*ptr==x)
-           { return ptr;
-           }
-           ptr++;
-        } while (*ptr);
-        return NULL;
-}
-
-/*************************************************************************
- * StrChrW                                      [NT 4.0:SHELL32.651]
- *
- */
-LPWSTR WINAPI StrChrW (LPWSTR str, WCHAR x )
-{       LPWSTR ptr=str;
-
-        TRACE("%s 0x%04x\n",debugstr_w(str),x);
-        do
-        {  if (*ptr==x)
-           { return ptr;
-           }
-           ptr++;
-        } while (*ptr);
-        return NULL;
-}
-
-/*************************************************************************
- * StrCmpNIW                                    [NT 4.0:SHELL32.*]
- *
- */
-INT WINAPI StrCmpNIW ( LPWSTR wstr1, LPWSTR wstr2, INT len)
-{       FIXME("%s %s %i stub\n", debugstr_w(wstr1),debugstr_w(wstr2),len);
-        return 0;
-}
-
-/*************************************************************************
- * StrCmpNIA                                    [NT 4.0:SHELL32.*]
- *
- */
-INT WINAPI StrCmpNIA ( LPSTR wstr1, LPSTR wstr2, INT len)
-{       FIXME("%s %s %i stub\n", wstr1,wstr2,len);
-        return 0;
-}
-
-
-/*************************************************************************
- * StrRChrA                                     [SHELL32.346]
- *
- */
-LPSTR WINAPI StrRChrA(LPCSTR lpStart, LPCSTR lpEnd, DWORD wMatch)
-{
-        if (!lpStart)
-            return NULL;
-
-        /* if the end not given, search*/
-        if (!lpEnd)
-        { lpEnd=lpStart;
-          while (*lpEnd)
-            lpEnd++;
-        }
-
-        for (--lpEnd;lpStart <= lpEnd; lpEnd--)
-            if (*lpEnd==(char)wMatch)
-                return (LPSTR)lpEnd;
-
-        return NULL;
-}
-/*************************************************************************
- * StrRChrW                                     [SHELL32.320]
- *
- */
-LPWSTR WINAPI StrRChrW(LPWSTR lpStart, LPWSTR lpEnd, DWORD wMatch)
-{       LPWSTR wptr=NULL;
-        TRACE("%s %s 0x%04x\n",debugstr_w(lpStart),debugstr_w(lpEnd), (WCHAR)wMatch );
-
-        /* if the end not given, search*/
-        if (!lpEnd)
-        { lpEnd=lpStart;
-          while (*lpEnd)
-            lpEnd++;
-        }
-
-        do
-        { if (*lpStart==(WCHAR)wMatch)
-            wptr = lpStart;
-          lpStart++;
-        } while ( lpStart<=lpEnd );
-        return wptr;
-}
-
-/************************************************************************
- *      StrToOleStr                     [SHELL32.163]
- *
- */
-int WINAPI StrToOleStrA (LPWSTR lpWideCharStr, LPCSTR lpMultiByteString)
-{
-        TRACE("%p %p(%s)\n",
-        lpWideCharStr, lpMultiByteString, lpMultiByteString);
-
-        return MultiByteToWideChar(0, 0, lpMultiByteString, -1, lpWideCharStr, MAX_PATH);
-
-}
-int WINAPI StrToOleStrW (LPWSTR lpWideCharStr, LPCWSTR lpWString)
-{
-        TRACE("%p %p(%s)\n",
-        lpWideCharStr, lpWString, debugstr_w(lpWString));
-
-        if (lstrcpyW (lpWideCharStr, lpWString ))
-        { return lstrlenW (lpWideCharStr);
-        }
-        return 0;
-}
-
-BOOL WINAPI StrToOleStrAW (LPWSTR lpWideCharStr, LPCVOID lpString)
-{
-        if (VERSION_OsIsUnicode())
-          return StrToOleStrW (lpWideCharStr, (LPCWSTR)lpString);
-        return StrToOleStrA (lpWideCharStr, (LPCSTR)lpString);
-}
-
-
-
-/*****************************************************************************
- * Name      : StrChrIA
- * Purpose   : Searches a string for the first occurrence of a character that
- *             matches the specified character. The comparison is not case sensitive.
- * Parameters: LPCSTR lpStart Address of the string to be searched.
- *             TCHAR  wMatch  Character to be used for comparison.
- * Variables :
- * Result    : Returns the address of the first occurrence of the character in
- *             the string if successful, or NULL otherwise.
- * Remark    : SHELL32.
- * Status    : COMPLETELY IMPLEMENTED UNTESTED UNKNOWN
- *
- * Author    : Patrick Haller [Wed, 1999/12/29 09:00]
- *****************************************************************************/
-
-ODINFUNCTION2(LPSTR,  StrChrIA,
-              LPCSTR, lpStart,
-              CHAR,   wMatch)
-{
-  LPSTR lpRes;
-
-  wMatch = tolower(wMatch);
-  lpRes = strchr(lpStart, wMatch);    // lower case comparsion
-  if (NULL == lpRes)
-  {
-    wMatch = toupper(wMatch);
-    lpRes = strchr(lpStart, wMatch);  // upper case comparsion
-  }
-
-  return lpRes;
-}
-
-
-/*****************************************************************************
- * Name      : StrChrIW
- * Purpose   : Searches a string for the first occurrence of a character that
- *             matches the specified character. The comparison is not case sensitive.
- * Parameters: LPCSTR lpStart Address of the string to be searched.
- *             TCHAR  wMatch  Character to be used for comparison.
- * Variables :
- * Result    : Returns the address of the first occurrence of the character in
- *             the string if successful, or NULL otherwise.
- * Remark    : SHELL32.
- * Status    : COMPLETELY IMPLEMENTED UNTESTED UNKNOWN
- *
- * Author    : Patrick Haller [Wed, 1999/12/29 09:00]
- *****************************************************************************/
-
-ODINFUNCTION2(LPWSTR,   StrChrIW,
-              LPCWSTR, lpStart,
-              WCHAR,    wMatch)
-{
-  LPWSTR lpRes;
-
-  wMatch = towlower(wMatch);
-  lpRes = (WCHAR*)wcschr((const wchar_t*)lpStart, wMatch);    // lower case comparsion
-  if (NULL == lpRes)
-  {
-    wMatch = towupper(wMatch);
-    lpRes = (WCHAR*)wcschr((const wchar_t*)lpStart, wMatch);  // upper case comparsion
-  }
-
-  return lpRes;
-}
-
-
-/*****************************************************************************
- * Name      : StrStrIA
- * Purpose   : Finds the first occurrence of a substring within a string. The
- *             comparison is not case sensitive.
- * Parameters: LPCSTR lpFirst
- *             LPCSTR lpSrch
- * Variables :
- * Result    : Returns the address of the first occurrence of the matching
- *             substring if successful, or NULL otherwise.
- * Remark    : SHELL32.
- * Status    : COMPLETELY IMPLEMENTED UNTESTED UNKNOWN
- *
- * Author    : Patrick Haller [Wed, 1999/12/29 09:00]
- *****************************************************************************/
-
-ODINFUNCTION2(LPSTR,  StrStrIA,
-              LPCSTR, lpFirst,
-              LPCSTR, lpSrch)
-{
-  char  ch = lpSrch[0];          // look for 1st character
-  LONG  lLen = lstrlenA(lpSrch); // length of search string
-  int   iRes;                    // comparsion result
-
-  do
-  {
-    lpFirst = StrChrIA(lpFirst, // find first matching character
-                       ch);
-    if (NULL == lpFirst)        // not found
-      return NULL;
-
-    iRes   = StrCmpNIA((LPSTR)lpFirst, // compare search string
-                       (LPSTR)lpSrch,
-                       lLen);
-
-    if (0 == iRes)              // Found!
-      return (LPSTR)lpFirst;
-
-    lpFirst = CharNextA(lpFirst); // skip to next character
-  }
-  while (*lpFirst != 0);        // safe termination
-
-  return NULL;                  // default result
-}
-
-
-
-/*****************************************************************************
- * Name      : StrStrIW
- * Purpose   : Finds the first occurrence of a substring within a string. The
- *             comparison is not case sensitive.
- * Parameters: LPCWSTR lpFirst
- *             LPCWSTR lpSrch
- * Variables :
- * Result    : Returns the address of the first occurrence of the matching
- *             substring if successful, or NULL otherwise.
- * Remark    : SHELL32.
- * Status    : COMPLETELY IMPLEMENTED UNTESTED UNKNOWN
- *
- * Author    : Patrick Haller [Wed, 1999/12/29 09:00]
- *****************************************************************************/
-
-ODINFUNCTION2(LPWSTR,  StrStrIW,
-              LPCWSTR, lpFirst,
-              LPCWSTR, lpSrch)
-{
-  WCHAR  ch = lpSrch[0];          // look for 1st character
-  LONG   lLen = lstrlenW(lpSrch); // length of search string
-  int   iRes;                    // comparsion result
-
-  do
-  {
-    lpFirst = StrChrIW(lpFirst, // find first matching character
-                       ch);
-    if (NULL == lpFirst)        // not found
-      return NULL;
-
-    iRes   = StrCmpNIW((LPWSTR)lpFirst, // compare search string
-                       (LPWSTR)lpSrch,
-                       lLen);
-
-    if (0 == iRes)              // Found!
-      return (LPWSTR)lpFirst;
-
-    lpFirst = CharNextW(lpFirst); // skip to next character
-  }
-  while (*lpFirst != 0);        // safe termination
-
-  return NULL;                  // default result
-}
-
-
-
-/*****************************************************************************
- * Name      : StrToIntA
- * Purpose   : convert string to integer (used by explorer.exe)
- * Parameters: Unknown (wrong)
- * Variables :
- * Result    : Unknown
- * Remark    : SHLWAPI.675
- * Status    : UNTESTED STUB
- *
- * Author    : Christoph Bratschi [Wed, 2000/03/29 19:47]
- *****************************************************************************/
-
-ODINFUNCTION1(INT,StrToIntA,LPSTR,pszPath)
-{
-  dprintf(("not implemented"));
-
-  return NULL;
-}
-
-
-/*************************************************************************
-*      StrToIntW                       [SHLWAPI]ú
-*/
-int WINAPI StrToIntW(LPCWSTR lpSrc)
-{
-  int ret;
-  LPSTR lpStr =  HEAP_strdupWtoA(GetProcessHeap(),0,lpSrc);
-
-  TRACE("%s\n", debugstr_w(lpSrc));
-
-  ret = atol(lpStr);
-  HeapFree(GetProcessHeap(),0,lpStr);
-  return ret;
-}
-
-
-/*************************************************************************
- * StrFormatByteSizeA				[SHLWAPI]
- */
-ODINFUNCTION3(LPSTR, StrFormatByteSizeA, DWORD, dw, LPSTR, pszBuf, UINT, cchBuf )
-{	char buf[64];
-	TRACE("%lx %p %i\n", dw, pszBuf, cchBuf);
-	if ( dw<1024L )
-	{ sprintf (buf,"%3.1f bytes", (FLOAT)dw);
-	}
-	else if ( dw<1048576L)
-	{ sprintf (buf,"%3.1f KB", (FLOAT)dw/1024);
-	}
-	else if ( dw < 1073741824L)
-	{ sprintf (buf,"%3.1f MB", (FLOAT)dw/1048576L);
-	}
-	else
-	{ sprintf (buf,"%3.1f GB", (FLOAT)dw/1073741824L);
-	}
-	lstrcpynA (pszBuf, buf, cchBuf);
-	return pszBuf;
-}
-
-/*************************************************************************
- * StrFormatByteSizeW				[SHLWAPI]
- */
-ODINFUNCTION3(LPWSTR, StrFormatByteSizeW, DWORD, dw, LPWSTR, pszBuf, UINT, cchBuf)
-{	char buf[64];
-	TRACE("%lx %p %i\n", dw, pszBuf, cchBuf);
-	if ( dw<1024L )
-	{ sprintf (buf,"%3.1f bytes", (FLOAT)dw);
-	}
-	else if ( dw<1048576L)
-	{ sprintf (buf,"%3.1f KB", (FLOAT)dw/1024);
-	}
-	else if ( dw < 1073741824L)
-	{ sprintf (buf,"%3.1f MB", (FLOAT)dw/1048576L);
-	}
-	else
-	{ sprintf (buf,"%3.1f GB", (FLOAT)dw/1073741824L);
-	}
-	lstrcpynAtoW (pszBuf, buf, cchBuf);
-	return pszBuf;
-}
-
-
-/*****************************************************************************
- * Name      : StrCpyA
- * Purpose   : copy a string
- * Parameters:
- * Variables :
- * Result    :
- * Remark    : not exported ?
- * Status    : UNTESTED
- *
- * Author    :
- *****************************************************************************/
-
-ODINFUNCTION2(LPSTR,  StrCpyA,
-              LPSTR,  lpDest,
-              LPCSTR, lpSource)
-{
-  return lstrcpyA(lpDest,
-                  lpSource);
-}
-
-
-/*****************************************************************************
- * Name      : StrCpyW
- * Purpose   : copy a wide-character string
- * Parameters:
- * Variables :
- * Result    :
- * Remark    : SHLWAPI.642
- * Status    : COMPLETELY IMPLEMENTED UNTESTED
- *
- * Author    :
- *****************************************************************************/
-
-ODINFUNCTION2(LPWSTR,  StrCpyW,
-              LPWSTR,  lpDest,
-              LPCWSTR, lpSource)
-{
-  return lstrcpyW(lpDest,
-                  lpSource);
-}
-
-
-/*****************************************************************************
- * Name      : StrDupA
- * Purpose   : duplicate a string on the local heap
- * Parameters:
- * Variables :
- * Result    :
- * Remark    : SHLWAPI.644
- * Status    : COMPLETELY IMPLEMENTED UNTESTED
- *
- * Author    :
- *****************************************************************************/
-
-ODINFUNCTION1(LPSTR,  StrDupA,
-              LPCSTR, lpStr)
-{
-  int    iLength = lstrlenA(lpStr) + 1;
-  HLOCAL hLocal  = LocalAlloc(LMEM_ZEROINIT,
-                              iLength);
-  if (hLocal != NULL)
-    StrCpyA((LPSTR)hLocal,
-            lpStr);
-
-  return (LPSTR)hLocal;
-}
-
-
-/*****************************************************************************
- * Name      : StrDupW
- * Purpose   : duplicate a wide-characters string on the local heap
- * Parameters:
- * Variables :
- * Result    :
- * Remark    : SHLWAPI.645
- * Status    : COMPLETELY IMPLEMENTED UNTESTED
- *
- * Author    :
- *****************************************************************************/
-
-ODINFUNCTION1(LPWSTR,  StrDupW,
-              LPCWSTR, lpStr)
-{
-  int    iLength = lstrlenW(lpStr) << 1 + 2;
-  HLOCAL hLocal  = LocalAlloc(LMEM_ZEROINIT,
-                              iLength);
-  if (hLocal != NULL)
-    StrCpyW((LPWSTR)hLocal,
-            lpStr);
-
-  return (LPWSTR)hLocal;
-}
Index: trunk/src/shlwapi/string_odin.cpp
===================================================================
--- trunk/src/shlwapi/string_odin.cpp	(revision 4081)
+++ trunk/src/shlwapi/string_odin.cpp	(revision 4081)
@@ -0,0 +1,368 @@
+ /* $Id: string_odin.cpp,v 1.1 2000-08-24 09:32:44 sandervl Exp $ */
+
+/*
+ * Win32 Lightweight SHELL32 for OS/2
+ *
+ * Copyright 1997 Marcus Meissner
+ * Copyright 1999 Patrick Haller (haller@zebra.fh-weingarten.de)
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ * Path Functions
+ *
+ * Many of this functions are in SHLWAPI.DLL also
+ *
+ * Corel WINE 20000324 level (without CRTDLL_* calls)
+ */
+
+/*****************************************************************************
+ * Remark                                                                    *
+ *****************************************************************************
+
+ */
+
+
+/*****************************************************************************
+ * Includes                                                                  *
+ *****************************************************************************/
+
+#include <odin.h>
+#include <odinwrap.h>
+#include <os2sel.h>
+
+#include <string.h>
+#include <ctype.h>
+#include <wctype.h>
+#include <wcstr.h>
+#define HAVE_WCTYPE_H
+
+#include "debugtools.h"
+
+#include <winreg.h>
+
+#include <heapstring.h>
+#include <misc.h>
+#include <win\shell.h>
+#include <win\winerror.h>
+#include <winversion.h>
+#include <winuser.h>
+
+
+#define ICOM_CINTERFACE 1
+#define CINTERFACE 1
+
+#include "winerror.h"
+#include "winnls.h"
+#include "winversion.h"
+#include "heap.h"
+
+#include "shellapi.h"
+#include "shlobj.h"
+#include "wine/undocshell.h"
+
+#include "shlwapi_odin.h"
+#include "shlwapi.h"
+
+/*****************************************************************************
+ * Local Variables                                                           *
+ *****************************************************************************/
+
+ODINDEBUGCHANNEL(SHLWAPI-STRING)
+
+
+/*****************************************************************************
+ * Name      : ChrCmpIA
+ * Purpose   :
+ * Parameters:
+ * Variables :
+ * Result    :
+ * Remark    :
+ * Status    : PARTIALLY IMPLEMENTED UNTESTED
+ *
+ * Author    : Patrick Haller [Wed, 1999/12/29 09:00]
+ *****************************************************************************/
+
+ODINFUNCTION2(INT,    ChrCmpIA,
+              INT,    ch1,
+              INT,    ch2)
+{
+  // Note: IsDBCSLeadByte ignored !
+
+  if ( (ch1 >= 'A') && (ch1 <= 'Z') ) ch1 |= 0x20;
+  if ( (ch2 >= 'A') && (ch2 <= 'Z') ) ch2 |= 0x20;
+
+  return ch1 - ch2;
+}
+
+
+/*************************************************************************
+ * OleStrToStrN                                 [SHELL32.78]
+ */
+BOOL WINAPI OleStrToStrNA (LPSTR lpStr, INT nStr, LPCWSTR lpOle, INT nOle)
+{
+        TRACE("%p %x %s %x\n", lpStr, nStr, debugstr_w(lpOle), nOle);
+        return WideCharToMultiByte (0, 0, lpOle, nOle, lpStr, nStr, NULL, NULL);
+}
+
+BOOL WINAPI OleStrToStrNW (LPWSTR lpwStr, INT nwStr, LPCWSTR lpOle, INT nOle)
+{
+        TRACE("%p %x %s %x\n", lpwStr, nwStr, debugstr_w(lpOle), nOle);
+
+        if (lstrcpynW ( lpwStr, lpOle, nwStr))
+        { return lstrlenW (lpwStr);
+        }
+        return 0;
+}
+
+BOOL WINAPI OleStrToStrNAW (LPVOID lpOut, INT nOut, LPCVOID lpIn, INT nIn)
+{
+        if (VERSION_OsIsUnicode())
+          return OleStrToStrNW ((LPWSTR)lpOut, nOut, (LPCWSTR)lpIn, nIn);
+        return OleStrToStrNA ((LPSTR)lpOut, nOut, (LPCWSTR)lpIn, nIn);
+}
+
+/*************************************************************************
+ * StrToOleStrN                                 [SHELL32.79]
+ *  lpMulti, nMulti, nWide [IN]
+ *  lpWide [OUT]
+ */
+BOOL WINAPI StrToOleStrNA (LPWSTR lpWide, INT nWide, LPCSTR lpStrA, INT nStr)
+{
+        TRACE("%p %x %s %x\n", lpWide, nWide, lpStrA, nStr);
+        return MultiByteToWideChar (0, 0, lpStrA, nStr, lpWide, nWide);
+}
+BOOL WINAPI StrToOleStrNW (LPWSTR lpWide, INT nWide, LPCWSTR lpStrW, INT nStr)
+{
+        TRACE("%p %x %s %x\n", lpWide, nWide, debugstr_w(lpStrW), nStr);
+
+        if (lstrcpynW (lpWide, lpStrW, nWide))
+        { return lstrlenW (lpWide);
+        }
+        return 0;
+}
+
+BOOL WINAPI StrToOleStrNAW (LPWSTR lpWide, INT nWide, LPCVOID lpStr, INT nStr)
+{
+        if (VERSION_OsIsUnicode())
+          return StrToOleStrNW (lpWide, nWide, (LPWSTR)lpStr, nStr);
+        return StrToOleStrNA (lpWide, nWide, (LPSTR)lpStr, nStr);
+}
+
+
+
+
+/************************************************************************
+ *      StrToOleStr                     [SHELL32.163]
+ *
+ */
+int WINAPI StrToOleStrA (LPWSTR lpWideCharStr, LPCSTR lpMultiByteString)
+{
+        TRACE("%p %p(%s)\n",
+        lpWideCharStr, lpMultiByteString, lpMultiByteString);
+
+        return MultiByteToWideChar(0, 0, lpMultiByteString, -1, lpWideCharStr, MAX_PATH);
+
+}
+int WINAPI StrToOleStrW (LPWSTR lpWideCharStr, LPCWSTR lpWString)
+{
+        TRACE("%p %p(%s)\n",
+        lpWideCharStr, lpWString, debugstr_w(lpWString));
+
+        if (lstrcpyW (lpWideCharStr, lpWString ))
+        { return lstrlenW (lpWideCharStr);
+        }
+        return 0;
+}
+
+BOOL WINAPI StrToOleStrAW (LPWSTR lpWideCharStr, LPCVOID lpString)
+{
+        if (VERSION_OsIsUnicode())
+          return StrToOleStrW (lpWideCharStr, (LPCWSTR)lpString);
+        return StrToOleStrA (lpWideCharStr, (LPCSTR)lpString);
+}
+
+
+
+/*****************************************************************************
+ * Name      : StrChrIA
+ * Purpose   : Searches a string for the first occurrence of a character that
+ *             matches the specified character. The comparison is not case sensitive.
+ * Parameters: LPCSTR lpStart Address of the string to be searched.
+ *             TCHAR  wMatch  Character to be used for comparison.
+ * Variables :
+ * Result    : Returns the address of the first occurrence of the character in
+ *             the string if successful, or NULL otherwise.
+ * Remark    : SHELL32.
+ * Status    : COMPLETELY IMPLEMENTED UNTESTED UNKNOWN
+ *
+ * Author    : Patrick Haller [Wed, 1999/12/29 09:00]
+ *****************************************************************************/
+
+ODINFUNCTION2(LPSTR,  StrChrIA,
+              LPCSTR, lpStart,
+              CHAR,   wMatch)
+{
+  LPSTR lpRes;
+
+  wMatch = tolower(wMatch);
+  lpRes = strchr(lpStart, wMatch);    // lower case comparsion
+  if (NULL == lpRes)
+  {
+    wMatch = toupper(wMatch);
+    lpRes = strchr(lpStart, wMatch);  // upper case comparsion
+  }
+
+  return lpRes;
+}
+
+
+/*****************************************************************************
+ * Name      : StrChrIW
+ * Purpose   : Searches a string for the first occurrence of a character that
+ *             matches the specified character. The comparison is not case sensitive.
+ * Parameters: LPCSTR lpStart Address of the string to be searched.
+ *             TCHAR  wMatch  Character to be used for comparison.
+ * Variables :
+ * Result    : Returns the address of the first occurrence of the character in
+ *             the string if successful, or NULL otherwise.
+ * Remark    : SHELL32.
+ * Status    : COMPLETELY IMPLEMENTED UNTESTED UNKNOWN
+ *
+ * Author    : Patrick Haller [Wed, 1999/12/29 09:00]
+ *****************************************************************************/
+
+ODINFUNCTION2(LPWSTR,   StrChrIW,
+              LPCWSTR, lpStart,
+              WCHAR,    wMatch)
+{
+  LPWSTR lpRes;
+
+  wMatch = towlower(wMatch);
+  lpRes = (WCHAR*)wcschr((const wchar_t*)lpStart, wMatch);    // lower case comparsion
+  if (NULL == lpRes)
+  {
+    wMatch = towupper(wMatch);
+    lpRes = (WCHAR*)wcschr((const wchar_t*)lpStart, wMatch);  // upper case comparsion
+  }
+
+  return lpRes;
+}
+
+
+/*****************************************************************************
+ * Name      : StrStrIA
+ * Purpose   : Finds the first occurrence of a substring within a string. The
+ *             comparison is not case sensitive.
+ * Parameters: LPCSTR lpFirst
+ *             LPCSTR lpSrch
+ * Variables :
+ * Result    : Returns the address of the first occurrence of the matching
+ *             substring if successful, or NULL otherwise.
+ * Remark    : SHELL32.
+ * Status    : COMPLETELY IMPLEMENTED UNTESTED UNKNOWN
+ *
+ * Author    : Patrick Haller [Wed, 1999/12/29 09:00]
+ *****************************************************************************/
+
+ODINFUNCTION2(LPSTR,  StrStrIA,
+              LPCSTR, lpFirst,
+              LPCSTR, lpSrch)
+{
+  char  ch = lpSrch[0];          // look for 1st character
+  LONG  lLen = lstrlenA(lpSrch); // length of search string
+  int   iRes;                    // comparsion result
+
+  do
+  {
+    lpFirst = StrChrIA(lpFirst, // find first matching character
+                       ch);
+    if (NULL == lpFirst)        // not found
+      return NULL;
+
+    iRes   = StrCmpNIA((LPSTR)lpFirst, // compare search string
+                       (LPSTR)lpSrch,
+                       lLen);
+
+    if (0 == iRes)              // Found!
+      return (LPSTR)lpFirst;
+
+    lpFirst = CharNextA(lpFirst); // skip to next character
+  }
+  while (*lpFirst != 0);        // safe termination
+
+  return NULL;                  // default result
+}
+
+
+
+/*****************************************************************************
+ * Name      : StrStrIW
+ * Purpose   : Finds the first occurrence of a substring within a string. The
+ *             comparison is not case sensitive.
+ * Parameters: LPCWSTR lpFirst
+ *             LPCWSTR lpSrch
+ * Variables :
+ * Result    : Returns the address of the first occurrence of the matching
+ *             substring if successful, or NULL otherwise.
+ * Remark    : SHELL32.
+ * Status    : COMPLETELY IMPLEMENTED UNTESTED UNKNOWN
+ *
+ * Author    : Patrick Haller [Wed, 1999/12/29 09:00]
+ *****************************************************************************/
+
+ODINFUNCTION2(LPWSTR,  StrStrIW,
+              LPCWSTR, lpFirst,
+              LPCWSTR, lpSrch)
+{
+  WCHAR  ch = lpSrch[0];          // look for 1st character
+  LONG   lLen = lstrlenW(lpSrch); // length of search string
+  int   iRes;                    // comparsion result
+
+  do
+  {
+    lpFirst = StrChrIW(lpFirst, // find first matching character
+                       ch);
+    if (NULL == lpFirst)        // not found
+      return NULL;
+
+    iRes   = StrCmpNIW((LPWSTR)lpFirst, // compare search string
+                       (LPWSTR)lpSrch,
+                       lLen);
+
+    if (0 == iRes)              // Found!
+      return (LPWSTR)lpFirst;
+
+    lpFirst = CharNextW(lpFirst); // skip to next character
+  }
+  while (*lpFirst != 0);        // safe termination
+
+  return NULL;                  // default result
+}
+
+
+
+
+
+
+/*****************************************************************************
+ * Name      : StrCpyA
+ * Purpose   : copy a string
+ * Parameters:
+ * Variables :
+ * Result    :
+ * Remark    : not exported ?
+ * Status    : UNTESTED
+ *
+ * Author    :
+ *****************************************************************************/
+
+ODINFUNCTIONNODBG2(LPSTR,  StrCpyA,
+              LPSTR,  lpDest,
+              LPCSTR, lpSource)
+{
+  return lstrcpyA(lpDest,
+                  lpSource);
+}
+
+
+
+
Index: trunk/src/shlwapi/url.cpp
===================================================================
--- trunk/src/shlwapi/url.cpp	(revision 4080)
+++ trunk/src/shlwapi/url.cpp	(revision 4081)
@@ -1,3 +1,3 @@
-/* $Id: url.cpp,v 1.5 2000-08-02 20:18:24 bird Exp $ */
+/* $Id: url.cpp,v 1.6 2000-08-24 09:32:45 sandervl Exp $ */
 
 /*
@@ -38,5 +38,5 @@
 #include <win\winerror.h>
 
-#include "shlwapi.h"
+#include "shlwapi_odin.h"
 
 ODINDEBUGCHANNEL(SHLWAPI-URL)
