Commit in reactos/lib/shlwapi on MAIN
shlwapi_Nl.rc+35added 1.1
assoc.c+8-91.7 -> 1.8
istream.c+13-141.7 -> 1.8
ordinal.c+48-381.11 -> 1.12
path.c+32-271.6 -> 1.7
reg.c+711.10 -> 1.11
regstream.c+15-171.3 -> 1.4
shlwapi.rc+11.3 -> 1.4
shlwapi.spec+5-51.10 -> 1.11
string.c+45-31.9 -> 1.10
url.c+18-51.9 -> 1.10
+291-118
1 added + 10 modified, total 11 files
Sync to Wine-20040914:
Hans Leidekker <hans@it.vu.nl>
- Dutch resource translation.
Alexandre Julliard
- Removed some uses of the non-standard ICOM_THIS macro.
- Get rid of the no longer used ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
  macro.
Mike McCormack <mike@codeweavers.com>
- Fix some -Wsigned-compare warnings.
- Don't read past end of table in PathFileExistsDefExtW.
- Use the ACP define in MB/WC conversion functions.
Jon Griffiths <jon_p_griffiths@yahoo.com>
- Implement SHSimulateDrop, MIME_GetExtensionA/W, StrCpyNXA/W,
  SHAnsiToAnsi, SHUnicodeToUnicode.
Francois Gouget <fgouget@free.fr>
- Don't export the shell32 SHAllocShared functions by name.
- Implement them by calling out their shlwapi equivalent (which had a
  much more complete implementation anyway).
- Fix the prototype of shlwapi's SHAllocShared().
- Don't crash if lpvData is NULL in SHAllocShared().
- Add a conformance test to shlwapi.
- Assorted spelling fixes.
Diego Petten= <dgp85@users.sourceforge.net>
- Add support for file:/// urls in PathCreateFromUrl.
- Add support in UrlIs() for URLIS_DIRECTORY and URLIS_FILEURL flags.
James Hawkins <truiken@gmail.com>
- Fix buffer overflow in PathSetDlgItemPathW that led to a trashed
  stack.

reactos/lib/shlwapi
shlwapi_Nl.rc added at 1.1
diff -N shlwapi_Nl.rc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ shlwapi_Nl.rc	19 Sep 2004 10:46:48 -0000	1.1
@@ -0,0 +1,35 @@
+/*
+ * Dutch resources for shlwapi
+ *
+ * Copyright 2004 Hans Leidekker
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+LANGUAGE LANG_DUTCH, SUBLANG_DEFAULT
+
+IDD_ERR_DIALOG DIALOG MOVEABLE DISCARDABLE 0, 0, 220, 60
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Fout!"
+FONT 8, "MS Shell Dlg"
+{
+ LTEXT "", IDS_ERR_USER_MSG2, 15, 5, 28, 20
+ LTEXT "", IDS_ERR_USER_MSG, 15, 5, 210, 8
+ CHECKBOX "Deze boodschap &niet opnieuw tonen", IDC_ERR_DONT_SHOW, 5, 20, 210, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
+ PUSHBUTTON L"&OK" IDOK, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP
+ PUSHBUTTON L"&Annuleren" IDCANCEL, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP
+ PUSHBUTTON L"&Ja" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP
+ PUSHBUTTON L"&Nee" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP
+}

reactos/lib/shlwapi
assoc.c 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- assoc.c	14 Aug 2004 20:24:41 -0000	1.7
+++ assoc.c	19 Sep 2004 10:46:48 -0000	1.8
@@ -440,7 +440,7 @@
   REFIID riid,
   LPVOID *ppvObj)
 {
-  ICOM_THIS(IQueryAssociationsImpl, iface);
+  IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface;
 
   TRACE("(%p,%s,%p)\n",This, debugstr_guid(riid), ppvObj);
 
@@ -466,7 +466,7 @@
  */
 static ULONG WINAPI IQueryAssociations_fnAddRef(IQueryAssociations *iface)
 {
-  ICOM_THIS(IQueryAssociationsImpl,iface);
+  IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface;
 
   TRACE("(%p)->(ref before=%lu)\n",This, This->ref);
 
@@ -480,7 +480,7 @@
  */
 static ULONG WINAPI IQueryAssociations_fnRelease(IQueryAssociations *iface)
 {
-  ICOM_THIS(IQueryAssociationsImpl,iface);
+  IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface;
   ULONG ulRet;
 
   TRACE("(%p)->(ref before=%lu)\n",This, This->ref);
@@ -517,7 +517,7 @@
   HWND hWnd)
 {
     static const WCHAR szProgID[] = {'P','r','o','g','I','D',0};
-    ICOM_THIS(IQueryAssociationsImpl,iface);
+    IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface;
     HRESULT hr;
 
     TRACE("(%p)->(%ld,%s,%p,%p)\n", iface,
@@ -587,7 +587,7 @@
   LPWSTR pszOut,
   DWORD *pcchOut)
 {
-  ICOM_THIS(IQueryAssociationsImpl, iface);
+  IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface;
 
   FIXME("(%p,0x%8lx,0x%8x,%s,%p,%p)-stub!\n", This, cfFlags, str,
         debugstr_w(pszExtra), pszOut, pcchOut);
@@ -617,7 +617,7 @@
   LPCWSTR pszExtra,
   HKEY *phkeyOut)
 {
-  ICOM_THIS(IQueryAssociationsImpl, iface);
+  IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface;
 
   FIXME("(%p,0x%8lx,0x%8x,%s,%p)-stub!\n", This, cfFlags, assockey,
         debugstr_w(pszExtra), phkeyOut);
@@ -649,7 +649,7 @@
   LPVOID pvOut,
   DWORD *pcbOut)
 {
-  ICOM_THIS(IQueryAssociationsImpl, iface);
+  IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface;
 
   FIXME("(%p,0x%8lx,0x%8x,%s,%p,%p)-stub!\n", This, cfFlags, assocdata,
         debugstr_w(pszExtra), pvOut, pcbOut);
@@ -684,7 +684,7 @@
   REFIID riid,
   LPVOID *ppvOut)
 {
-  ICOM_THIS(IQueryAssociationsImpl, iface);
+  IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface;
 
   FIXME("(%p,0x%8lx,0x%8x,%s,%s,%p)-stub!\n", This, cfFlags, assocenum,
         debugstr_w(pszExtra), debugstr_guid(riid), ppvOut);
@@ -693,7 +693,6 @@
 
 static struct IQueryAssociationsVtbl IQueryAssociations_vtbl =
 {
-  ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
   IQueryAssociations_fnQueryInterface,
   IQueryAssociations_fnAddRef,
   IQueryAssociations_fnRelease,

reactos/lib/shlwapi
istream.c 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- istream.c	14 Aug 2004 20:24:41 -0000	1.7
+++ istream.c	19 Sep 2004 10:46:48 -0000	1.8
@@ -53,7 +53,7 @@
 */
 static HRESULT WINAPI IStream_fnQueryInterface(IStream *iface, REFIID riid, LPVOID *ppvObj)
 {
-  ICOM_THIS(ISHFileStream, iface);
+  ISHFileStream *This = (ISHFileStream *)iface;
 
   TRACE("(%p,%s,%p)\n", This, debugstr_guid(riid), ppvObj);
 
@@ -75,7 +75,7 @@
 */
 static ULONG WINAPI IStream_fnAddRef(IStream *iface)
 {
-  ICOM_THIS(ISHFileStream, iface);
+  ISHFileStream *This = (ISHFileStream *)iface;
 
   TRACE("(%p)\n", This);
   return InterlockedIncrement(&This->ref);
@@ -86,7 +86,7 @@
 */
 static ULONG WINAPI IStream_fnRelease(IStream *iface)
 {
-  ICOM_THIS(ISHFileStream, iface);
+  ISHFileStream *This = (ISHFileStream *)iface;
   ULONG ulRet;
 
   TRACE("(%p)\n", This);
@@ -106,7 +106,7 @@
  */
 static HRESULT WINAPI IStream_fnRead(IStream *iface, void* pv, ULONG cb, ULONG* pcbRead)
 {
-  ICOM_THIS(ISHFileStream, iface);
+  ISHFileStream *This = (ISHFileStream *)iface;
   HRESULT hRet = S_OK;
   DWORD dwRead = 0;
 
@@ -130,7 +130,7 @@
  */
 static HRESULT WINAPI IStream_fnWrite(IStream *iface, const void* pv, ULONG cb, ULONG* pcbWritten)
 {
-  ICOM_THIS(ISHFileStream, iface);
+  ISHFileStream *This = (ISHFileStream *)iface;
   HRESULT hRet = S_OK;
   DWORD dwWritten = 0;
 
@@ -157,7 +157,7 @@
 static HRESULT WINAPI IStream_fnSeek(IStream *iface, LARGE_INTEGER dlibMove,
                                      DWORD dwOrigin, ULARGE_INTEGER* pNewPos)
 {
-  ICOM_THIS(ISHFileStream, iface);
+  ISHFileStream *This = (ISHFileStream *)iface;
   DWORD dwPos;
 
   TRACE("(%p,%ld,%ld,%p)\n", This, dlibMove.u.LowPart, dwOrigin, pNewPos);
@@ -178,7 +178,7 @@
  */
 static HRESULT WINAPI IStream_fnSetSize(IStream *iface, ULARGE_INTEGER libNewSize)
 {
-  ICOM_THIS(ISHFileStream, iface);
+  ISHFileStream *This = (ISHFileStream *)iface;
 
   TRACE("(%p,%ld)\n", This, libNewSize.u.LowPart);
   IStream_fnCommit(iface, 0); /* If ever buffered, this will be needed */
@@ -191,7 +191,7 @@
 static HRESULT WINAPI IStream_fnCopyTo(IStream *iface, IStream* pstm, ULARGE_INTEGER cb,
                                        ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten)
 {
-  ICOM_THIS(ISHFileStream, iface);
+  ISHFileStream *This = (ISHFileStream *)iface;
   char copyBuff[1024];
   ULONGLONG ulSize;
   HRESULT hRet = S_OK;
@@ -240,7 +240,7 @@
  */
 static HRESULT WINAPI IStream_fnCommit(IStream *iface, DWORD grfCommitFlags)
 {
-  ICOM_THIS(ISHFileStream, iface);
+  ISHFileStream *This = (ISHFileStream *)iface;
 
   TRACE("(%p,%ld)\n", This, grfCommitFlags);
   /* Currently unbuffered: This function is not needed */
@@ -252,7 +252,7 @@
  */
 static HRESULT WINAPI IStream_fnRevert(IStream *iface)
 {
-  ICOM_THIS(ISHFileStream, iface);
+  ISHFileStream *This = (ISHFileStream *)iface;
 
   TRACE("(%p)\n", This);
   return E_NOTIMPL;
@@ -264,7 +264,7 @@
 static HRESULT WINAPI IStream_fnLockUnlockRegion(IStream *iface, ULARGE_INTEGER libOffset,
                                                  ULARGE_INTEGER cb, DWORD dwLockType)
 {
-  ICOM_THIS(ISHFileStream, iface);
+  ISHFileStream *This = (ISHFileStream *)iface;
   TRACE("(%p,%ld,%ld,%ld)\n", This, libOffset.u.LowPart, cb.u.LowPart, dwLockType);
   return E_NOTIMPL;
 }
@@ -275,7 +275,7 @@
 static HRESULT WINAPI IStream_fnStat(IStream *iface, STATSTG* lpStat,
                                      DWORD grfStatFlag)
 {
-  ICOM_THIS(ISHFileStream, iface);
+  ISHFileStream *This = (ISHFileStream *)iface;
   BY_HANDLE_FILE_INFORMATION fi;
   HRESULT hRet = S_OK;
 
@@ -312,7 +312,7 @@
  */
 static HRESULT WINAPI IStream_fnClone(IStream *iface, IStream** ppstm)
 {
-  ICOM_THIS(ISHFileStream, iface);
+  ISHFileStream *This = (ISHFileStream *)iface;
 
   TRACE("(%p)\n",This);
   if (ppstm)
@@ -322,7 +322,6 @@
 
 static struct IStreamVtbl SHLWAPI_fsVTable =
 {
-  ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
   IStream_fnQueryInterface,
   IStream_fnAddRef,
   IStream_fnRelease,

reactos/lib/shlwapi
ordinal.c 1.11 -> 1.12
diff -u -r1.11 -r1.12
--- ordinal.c	14 Aug 2004 20:24:41 -0000	1.11
+++ ordinal.c	19 Sep 2004 10:46:48 -0000	1.12
@@ -36,6 +36,7 @@
 #include "winbase.h"
 #include "winuser.h"
 #include "winnls.h"
+#include "objbase.h"
 #include "docobj.h"
 #include "exdisp.h"
 #include "shlguid.h"
@@ -76,8 +77,6 @@
 
 extern DWORD SHLWAPI_ThreadRef_index;
 
-typedef HANDLE HSHARED; /* Shared memory */
-
 /* following is GUID for IObjectWithSite::SetSite  -- see _174           */
 static DWORD id1[4] = {0xfc4801a3, 0x11cf2ba9, 0xaa0029a2, 0x52733d00};
 /* following is GUID for IPersistMoniker::GetClassID  -- see _174        */
@@ -144,7 +143,7 @@
  for unicode functions to provide these functions on systems without
  unicode functions eg. win95/win98. Since we have such functions we just
  call these. If running Wine with native DLL's, some late bound calls may
- fail. However, its better to implement the functions in the forward DLL
+ fail. However, it is better to implement the functions in the forward DLL
  and recommend the builtin rather than reimplementing the calls here!
 */
 
@@ -154,15 +153,15 @@
  * Internal implemetation of SHLWAPI_11.
  */
 static
-HSHARED WINAPI SHLWAPI_DupSharedHandle(HSHARED hShared, DWORD dwDstProcId,
+HANDLE WINAPI SHLWAPI_DupSharedHandle(HANDLE hShared, DWORD dwDstProcId,
                                        DWORD dwSrcProcId, DWORD dwAccess,
                                        DWORD dwOptions)
 {
   HANDLE hDst, hSrc;
   DWORD dwMyProcId = GetCurrentProcessId();
-  HSHARED hRet = (HSHARED)NULL;
+  HANDLE hRet = NULL;
 
-  TRACE("(%p,%ld,%ld,%08lx,%08lx)\n", (PVOID)hShared, dwDstProcId, dwSrcProcId,
+  TRACE("(%p,%ld,%ld,%08lx,%08lx)\n", hShared, dwDstProcId, dwSrcProcId,
         dwAccess, dwOptions);
 
   /* Get dest process handle */
@@ -182,9 +181,9 @@
     if (hSrc)
     {
       /* Make handle available to dest process */
-      if (!DuplicateHandle(hDst, (HANDLE)hShared, hSrc, &hRet,
+      if (!DuplicateHandle(hDst, hShared, hSrc, &hRet,
                            dwAccess, 0, dwOptions | DUPLICATE_SAME_ACCESS))
-        hRet = (HSHARED)NULL;
+        hRet = NULL;
 
       if (dwSrcProcId != dwMyProcId)
         CloseHandle(hSrc);
@@ -194,7 +193,7 @@
       CloseHandle(hDst);
   }
 
-  TRACE("Returning handle %p\n", (PVOID)hRet);
+  TRACE("Returning handle %p\n", hRet);
   return hRet;
 }
 
@@ -204,9 +203,9 @@
  * Create a block of sharable memory and initialise it with data.
  *
  * PARAMS
- * dwProcId [I] ID of process owning data
  * lpvData  [I] Pointer to data to write
  * dwSize   [I] Size of data
+ * dwProcId [I] ID of process owning data
  *
  * RETURNS
  * Success: A shared memory handle
@@ -220,13 +219,13 @@
  * the view pointer returned by this size.
  *
  */
-HSHARED WINAPI SHAllocShared(DWORD dwProcId, DWORD dwSize, LPCVOID lpvData)
+HANDLE WINAPI SHAllocShared(LPCVOID lpvData, DWORD dwSize, DWORD dwProcId)
 {
   HANDLE hMap;
   LPVOID pMapped;
-  HSHARED hRet = (HSHARED)NULL;
+  HANDLE hRet = NULL;
 
-  TRACE("(%ld,%p,%ld)\n", dwProcId, lpvData, dwSize);
+  TRACE("(%p,%ld,%ld)\n", lpvData, dwSize, dwProcId);
 
   /* Create file mapping of the correct length */
   hMap = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, FILE_MAP_READ, 0,
@@ -241,12 +240,12 @@
   {
     /* Write size of data, followed by the data, to the view */
     *((DWORD*)pMapped) = dwSize;
-    if (dwSize)
+    if (lpvData)
       memcpy((char *) pMapped + sizeof(dwSize), lpvData, dwSize);
 
     /* Release view. All further views mapped will be opaque */
     UnmapViewOfFile(pMapped);
-    hRet = SHLWAPI_DupSharedHandle((HSHARED)hMap, dwProcId,
+    hRet = SHLWAPI_DupSharedHandle(hMap, dwProcId,
                                    GetCurrentProcessId(), FILE_MAP_ALL_ACCESS,
                                    DUPLICATE_SAME_ACCESS);
   }
@@ -269,18 +268,18 @@
  * Failure: NULL
  *
  */
-PVOID WINAPI SHLockShared(HSHARED hShared, DWORD dwProcId)
+PVOID WINAPI SHLockShared(HANDLE hShared, DWORD dwProcId)
 {
-  HSHARED hDup;
+  HANDLE hDup;
   LPVOID pMapped;
 
-  TRACE("(%p %ld)\n", (PVOID)hShared, dwProcId);
+  TRACE("(%p %ld)\n", hShared, dwProcId);
 
   /* Get handle to shared memory for current process */
   hDup = SHLWAPI_DupSharedHandle(hShared, dwProcId, GetCurrentProcessId(),
                                  FILE_MAP_ALL_ACCESS, 0);
   /* Get View */
-  pMapped = MapViewOfFile((HANDLE)hDup, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0);
+  pMapped = MapViewOfFile(hDup, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0);
   CloseHandle(hDup);
 
   if (pMapped)
@@ -321,17 +320,17 @@
  * Failure: FALSE
  *
  */
-BOOL WINAPI SHFreeShared(HSHARED hShared, DWORD dwProcId)
+BOOL WINAPI SHFreeShared(HANDLE hShared, DWORD dwProcId)
 {
-  HSHARED hClose;
+  HANDLE hClose;
 
-  TRACE("(%p %ld)\n", (PVOID)hShared, dwProcId);
+  TRACE("(%p %ld)\n", hShared, dwProcId);
 
   /* Get a copy of the handle for our process, closing the source handle */
   hClose = SHLWAPI_DupSharedHandle(hShared, dwProcId, GetCurrentProcessId(),
                                    FILE_MAP_ALL_ACCESS,DUPLICATE_CLOSE_SOURCE);
   /* Close local copy */
-  return CloseHandle((HANDLE)hClose);
+  return CloseHandle(hClose);
 }
 
 /*************************************************************************
@@ -351,10 +350,10 @@
  * Failure: A NULL handle.
  *
  */
-HSHARED WINAPI SHMapHandle(HSHARED hShared, DWORD dwDstProcId, DWORD dwSrcProcId,
+HANDLE WINAPI SHMapHandle(HANDLE hShared, DWORD dwDstProcId, DWORD dwSrcProcId,
                           DWORD dwAccess, DWORD dwOptions)
 {
-  HSHARED hRet;
+  HANDLE hRet;
 
   hRet = SHLWAPI_DupSharedHandle(hShared, dwDstProcId, dwSrcProcId,
                                  dwAccess, dwOptions);
@@ -1830,6 +1829,30 @@
 }
 
 /*************************************************************************
+ *      @	[SHLWAPI.186]
+ */
+BOOL WINAPI SHSimulateDrop(IDropTarget *pDrop, IDataObject *pDataObj,
+                           DWORD grfKeyState, PPOINTL lpPt, DWORD* pdwEffect)
+{
+  DWORD dwEffect = DROPEFFECT_LINK | DROPEFFECT_MOVE | DROPEFFECT_COPY;
+  POINTL pt = { 0, 0 };
+
+  if (!lpPt)
+    lpPt = &pt;
+
+  if (!pdwEffect)
+    pdwEffect = &dwEffect;
+
+  IDropTarget_DragEnter(pDrop, pDataObj, grfKeyState, *lpPt, pdwEffect);
+
+  if (*pdwEffect)
+    return IDropTarget_Drop(pDrop, pDataObj, grfKeyState, *lpPt, pdwEffect);
+
+  IDropTarget_DragLeave(pDrop);
+  return TRUE;
+}
+
+/*************************************************************************
  *      @	[SHLWAPI.187]
  *
  * Call IPersistPropertyBag_Load() on an object.
@@ -3001,19 +3024,6 @@
 }
 
 /*************************************************************************
- *      @	[SHLWAPI.346]
- */
-DWORD WINAPI SHUnicodeToUnicode(
-	LPCWSTR src,
-	LPWSTR dest,
-	int len)
-{
-	FIXME("(%s %p 0x%08x)stub\n",debugstr_w(src),dest,len);
-	lstrcpynW(dest, src, len);
-	return lstrlenW(dest)+1;
-}
-
-/*************************************************************************
  *      @	[SHLWAPI.350]
  *
  * See GetFileVersionInfoSizeW.

reactos/lib/shlwapi
path.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- path.c	8 May 2004 13:49:05 -0000	1.6
+++ path.c	19 Sep 2004 10:46:48 -0000	1.7
@@ -141,11 +141,11 @@
     WCHAR szDir[MAX_PATH];
     WCHAR szFile[MAX_PATH];
     if (lpszDir)
-      MultiByteToWideChar(0,0,lpszDir,-1,szDir,MAX_PATH);
+      MultiByteToWideChar(CP_ACP,0,lpszDir,-1,szDir,MAX_PATH);
     if (lpszFile)
-      MultiByteToWideChar(0,0,lpszFile,-1,szFile,MAX_PATH);
+      MultiByteToWideChar(CP_ACP,0,lpszFile,-1,szFile,MAX_PATH);
     PathCombineW(szDest, lpszDir ? szDir : NULL, lpszFile ? szFile : NULL);
-    WideCharToMultiByte(0,0,szDest,-1,lpszDest,MAX_PATH,0,0);
+    WideCharToMultiByte(CP_ACP,0,szDest,-1,lpszDest,MAX_PATH,0,0);
   }
   return lpszDest;
 }
@@ -1079,7 +1079,7 @@
       int iLen = lstrlenW(lpszPath);
       if (iLen > (MAX_PATH - 5))
         return FALSE;
-      while (dwWhich & 0x1 && iChoose < sizeof(pszExts))
+      while ( (dwWhich & 0x1) && pszExts[iChoose][0] )
       {
         lstrcpyW(lpszPath + iLen, pszExts[iChoose]);
         if (PathFileExistsW(lpszPath))
@@ -1126,10 +1126,10 @@
   if (lpszPath)
   {
     WCHAR szPath[MAX_PATH];
-    MultiByteToWideChar(0,0,lpszPath,-1,szPath,MAX_PATH);
+    MultiByteToWideChar(CP_ACP,0,lpszPath,-1,szPath,MAX_PATH);
     bRet = PathFileExistsDefExtW(szPath, dwWhich);
     if (bRet)
-      WideCharToMultiByte(0,0,szPath,-1,lpszPath,MAX_PATH,0,0);
+      WideCharToMultiByte(CP_ACP,0,szPath,-1,lpszPath,MAX_PATH,0,0);
   }
   return bRet;
 }
@@ -1239,7 +1239,7 @@
   if (!lpszFile || !PathIsFileSpecA(lpszFile))
     return FALSE;
 
-  MultiByteToWideChar(0,0,lpszFile,-1,szFile,MAX_PATH);
+  MultiByteToWideChar(CP_ACP,0,lpszFile,-1,szFile,MAX_PATH);
 
   /* Search provided directories first */
   if (lppszOtherDirs && *lppszOtherDirs)
@@ -1249,11 +1249,11 @@
 
     while (lpszOtherPath && *lpszOtherPath && (*lpszOtherPath)[0])
     {
-      MultiByteToWideChar(0,0,*lpszOtherPath,-1,szOther,MAX_PATH);
+      MultiByteToWideChar(CP_ACP,0,*lpszOtherPath,-1,szOther,MAX_PATH);
       PathCombineW(buff, szOther, szFile);
       if (PathFileExistsDefExtW(buff, dwWhich))
       {
-        WideCharToMultiByte(0,0,buff,-1,lpszFile,MAX_PATH,0,0);
+        WideCharToMultiByte(CP_ACP,0,buff,-1,lpszFile,MAX_PATH,0,0);
         return TRUE;
       }
       lpszOtherPath++;
@@ -1262,7 +1262,7 @@
   /* Not found, try system and path dirs */
   if (SHLWAPI_PathFindInOtherDirs(szFile, dwWhich))
   {
-    WideCharToMultiByte(0,0,szFile,-1,lpszFile,MAX_PATH,0,0);
+    WideCharToMultiByte(CP_ACP,0,szFile,-1,lpszFile,MAX_PATH,0,0);
     return TRUE;
   }
   return FALSE;
@@ -1369,10 +1369,10 @@
     WCHAR szPath[MAX_PATH];
     WCHAR szDest[MAX_PATH];
 
-    MultiByteToWideChar(0,0,lpszPath,-1,szPath,MAX_PATH);
+    MultiByteToWideChar(CP_ACP,0,lpszPath,-1,szPath,MAX_PATH);
     szDest[0] = '\0';
     bRet = PathCompactPathExW(szDest, szPath, cchMax, dwFlags);
-    WideCharToMultiByte(0,0,szDest,-1,lpszDest,MAX_PATH,0,0);
+    WideCharToMultiByte(CP_ACP,0,szDest,-1,lpszDest,MAX_PATH,0,0);
   }
   return bRet;
 }
@@ -2339,9 +2339,9 @@
   {
     WCHAR szPath[MAX_PATH];
     WCHAR szBuff[MAX_PATH];
-    MultiByteToWideChar(0,0,lpszPath,-1,szPath,MAX_PATH);
+    MultiByteToWideChar(CP_ACP,0,lpszPath,-1,szPath,MAX_PATH);
     bRet = PathCanonicalizeW(szBuff, szPath);
-    WideCharToMultiByte(0,0,szBuff,-1,lpszBuf,MAX_PATH,0,0);
+    WideCharToMultiByte(CP_ACP,0,szBuff,-1,lpszBuf,MAX_PATH,0,0);
   }
   return bRet;
 }
@@ -2779,9 +2779,9 @@
   if (lpszPath)
   {
     WCHAR szPath[MAX_PATH];
-    MultiByteToWideChar(0,0,lpszPath,-1,szPath,MAX_PATH);
+    MultiByteToWideChar(CP_ACP,0,lpszPath,-1,szPath,MAX_PATH);
     bRet = PathCompactPathW(hDC, szPath, dx);
-    WideCharToMultiByte(0,0,szPath,-1,lpszPath,MAX_PATH,0,0);
+    WideCharToMultiByte(CP_ACP,0,szPath,-1,lpszPath,MAX_PATH,0,0);
   }
   return bRet;
 }
@@ -3011,7 +3011,7 @@
   if (lpszPath && *lpszPath)
   {
     WCHAR szPath[MAX_PATH];
-    MultiByteToWideChar(0,0,lpszPath,-1,szPath,MAX_PATH);
+    MultiByteToWideChar(CP_ACP,0,lpszPath,-1,szPath,MAX_PATH);
     bRet = PathMakeSystemFolderW(szPath);
   }
   return bRet;
@@ -3245,7 +3245,7 @@
 HRESULT WINAPI PathCreateFromUrlW(LPCWSTR lpszUrl, LPWSTR lpszPath,
                                   LPDWORD pcchPath, DWORD dwFlags)
 {
-  static const WCHAR stemp[] = { 'f','i','l','e',':','/','/',0 };
+  static const WCHAR stemp[] = { 'f','i','l','e',':','/','/','/',0 };
   LPWSTR pwszPathPart;
   HRESULT hr;
 
@@ -3254,8 +3254,13 @@
   if (!lpszUrl || !lpszPath || !pcchPath || !*pcchPath)
     return E_INVALIDARG;
 
+  /* Path of the form file:///... */
+  if (!strncmpW(lpszUrl, stemp, 8))
+  {
+    lpszUrl += 8;
+  }
   /* Path of the form file://... */
-  if (!strncmpW(lpszUrl, stemp, 7))
+  else if (!strncmpW(lpszUrl, stemp, 7))
   {
     lpszUrl += 7;
   }
@@ -3327,10 +3332,10 @@
     WCHAR szPath[MAX_PATH];
     WCHAR szFrom[MAX_PATH];
     WCHAR szTo[MAX_PATH];
-    MultiByteToWideChar(0,0,lpszFrom,-1,szFrom,MAX_PATH);
-    MultiByteToWideChar(0,0,lpszTo,-1,szTo,MAX_PATH);
+    MultiByteToWideChar(CP_ACP,0,lpszFrom,-1,szFrom,MAX_PATH);
+    MultiByteToWideChar(CP_ACP,0,lpszTo,-1,szTo,MAX_PATH);
     bRet = PathRelativePathToW(szPath,szFrom,dwAttrFrom,szTo,dwAttrTo);
-    WideCharToMultiByte(0,0,szPath,-1,lpszPath,MAX_PATH,0,0);
+    WideCharToMultiByte(CP_ACP,0,szPath,-1,lpszPath,MAX_PATH,0,0);
   }
   return bRet;
 }
@@ -3476,7 +3481,7 @@
   TRACE("(%p,%8x,%s)\n",hDlg, id, debugstr_a(lpszPath));
 
   if (lpszPath)
-    MultiByteToWideChar(0,0,lpszPath,-1,szPath,MAX_PATH);
+    MultiByteToWideChar(CP_ACP,0,lpszPath,-1,szPath,MAX_PATH);
   else
     szPath[0] = '\0';
   PathSetDlgItemPathW(hDlg, id, szPath);
@@ -3501,7 +3506,7 @@
     return;
 
   if (lpszPath)
-    strncpyW(path, lpszPath, sizeof(path));
+    lstrcpynW(path, lpszPath, sizeof(path) / sizeof(WCHAR));
   else
     path[0] = '\0';
 
@@ -3680,7 +3685,7 @@
   if (lpszPath)
   {
     WCHAR szPath[MAX_PATH];
-    MultiByteToWideChar(0,0,lpszPath,-1,szPath,MAX_PATH);
+    MultiByteToWideChar(CP_ACP,0,lpszPath,-1,szPath,MAX_PATH);
     bRet = PathIsDirectoryEmptyW(szPath);
   }
   return bRet;
@@ -3897,10 +3902,10 @@
 
   TRACE("(%s,%p,%ld)\n", lpszFile, lpszPath, dwPathLen);
 
-  MultiByteToWideChar(0, 0, lpszFile, -1, szFile, MAX_PATH);
+  MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, szFile, MAX_PATH);
   szPath[0] = '\0';
   hRet = SHGetWebFolderFilePathW(szFile, szPath, dwPathLen);
-  WideCharToMultiByte(0, 0, szPath, -1, lpszPath, dwPathLen, 0, 0);
+  WideCharToMultiByte(CP_ACP, 0, szPath, -1, lpszPath, dwPathLen, 0, 0);
   return hRet;
 }
 

reactos/lib/shlwapi
reg.c 1.10 -> 1.11
diff -u -r1.10 -r1.11
--- reg.c	8 Aug 2004 21:15:48 -0000	1.10
+++ reg.c	19 Sep 2004 10:46:48 -0000	1.11
@@ -1833,6 +1833,77 @@
 }
 
 /*************************************************************************
+ * @   [SHLWAPI.330]
+ *
+ * Get the file extension for a given Mime type.
+ *
+ * PARAMS
+ *  lpszType [I] Mime type to get the file extension for
+ *  lpExt    [O] Destination for the resulting extension
+ *  iLen     [I] Length of lpExt in characters
+ *
+ * RETURNS
+ *  Success: TRUE. lpExt contains the file extension.
+ *  Failure: FALSE, if any parameter is invalid or the extension cannot be
+ *           retrieved. If iLen > 0, lpExt is set to an empty string.
+ *
+ * NOTES
+ *  - The extension returned in lpExt always has a leading '.' character, even
+ *  if the registry Mime database entry does not.
+ *  - iLen must be long enough for the file extension for this function to succeed.
+ */
+BOOL WINAPI MIME_GetExtensionA(LPCSTR lpszType, LPSTR lpExt, INT iLen)
+{
+  char szSubKey[MAX_PATH];
+  DWORD dwlen = iLen - 1, dwType;
+  BOOL bRet = FALSE;
+
+  if (iLen > 0 && lpExt)
+    *lpExt = '\0';
+
+  if (lpszType && lpExt && iLen > 2 &&
+      GetMIMETypeSubKeyA(lpszType, szSubKey, MAX_PATH) &&
+      !SHGetValueA(HKEY_CLASSES_ROOT, szSubKey, szExtensionA, &dwType, lpExt + 1, &dwlen) &&
+      lpExt[1])
+  {
+    if (lpExt[1] == '.')
+      memmove(lpExt, lpExt + 1, strlen(lpExt + 1) + 1);
+    else
+      *lpExt = '.'; /* Supply a '.' */
+    bRet = TRUE;
+  }
+  return bRet;
+}
+
+/*************************************************************************
+ * @   [SHLWAPI.331]
+ *
+ * Unicode version of MIME_GetExtensionA.
+ */
+BOOL WINAPI MIME_GetExtensionW(LPCWSTR lpszType, LPWSTR lpExt, INT iLen)
+{
+  WCHAR szSubKey[MAX_PATH];
+  DWORD dwlen = iLen - 1, dwType;
+  BOOL bRet = FALSE;
+
+  if (iLen > 0 && lpExt)
+    *lpExt = '\0';
+
+  if (lpszType && lpExt && iLen > 2 &&
+      GetMIMETypeSubKeyW(lpszType, szSubKey, MAX_PATH) &&
+      !SHGetValueW(HKEY_CLASSES_ROOT, szSubKey, szExtensionW, &dwType, lpExt + 1, &dwlen) &&
+      lpExt[1])
+  {
+    if (lpExt[1] == '.')
+      memmove(lpExt, lpExt + 1, (strlenW(lpExt + 1) + 1) * sizeof(WCHAR));
+    else
+      *lpExt = '.'; /* Supply a '.' */
+    bRet = TRUE;
+  }
+  return bRet;
+}
+
+/*************************************************************************
  * @   [SHLWAPI.324]
  *
  * Set the file extension for a MIME content key.

reactos/lib/shlwapi
regstream.c 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- regstream.c	14 Aug 2004 20:24:42 -0000	1.3
+++ regstream.c	19 Sep 2004 10:46:48 -0000	1.4
@@ -46,7 +46,7 @@
 */
 static HRESULT WINAPI IStream_fnQueryInterface(IStream *iface, REFIID riid, LPVOID *ppvObj)
 {
-	ICOM_THIS(ISHRegStream, iface);
+	ISHRegStream *This = (ISHRegStream *)iface;
 
 	TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj);
 
@@ -72,7 +72,7 @@
 */
 static ULONG WINAPI IStream_fnAddRef(IStream *iface)
 {
-	ICOM_THIS(ISHRegStream, iface);
+	ISHRegStream *This = (ISHRegStream *)iface;
 
 	TRACE("(%p)->(count=%lu)\n",This, This->ref);
 
@@ -84,7 +84,7 @@
 */
 static ULONG WINAPI IStream_fnRelease(IStream *iface)
 {
-	ICOM_THIS(ISHRegStream, iface);
+	ISHRegStream *This = (ISHRegStream *)iface;
 
 	TRACE("(%p)->()\n",This);
 
@@ -109,7 +109,7 @@
  */
 static HRESULT WINAPI IStream_fnRead (IStream * iface, void* pv, ULONG cb, ULONG* pcbRead)
 {
-	ICOM_THIS(ISHRegStream, iface);
+	ISHRegStream *This = (ISHRegStream *)iface;
 
 	DWORD dwBytesToRead, dwBytesLeft;
 
@@ -140,7 +140,7 @@
  */
 static HRESULT WINAPI IStream_fnWrite (IStream * iface, const void* pv, ULONG cb, ULONG* pcbWritten)
 {
-	ICOM_THIS(ISHRegStream, iface);
+	ISHRegStream *This = (ISHRegStream *)iface;
 
 	TRACE("(%p)\n",This);
 
@@ -155,7 +155,7 @@
  */
 static HRESULT WINAPI IStream_fnSeek (IStream * iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition)
 {
-	ICOM_THIS(ISHRegStream, iface);
+	ISHRegStream *This = (ISHRegStream *)iface;
 
 	TRACE("(%p)\n",This);
 
@@ -169,7 +169,7 @@
  */
 static HRESULT WINAPI IStream_fnSetSize (IStream * iface, ULARGE_INTEGER libNewSize)
 {
-	ICOM_THIS(ISHRegStream, iface);
+	ISHRegStream *This = (ISHRegStream *)iface;
 
 	TRACE("(%p)\n",This);
 	return E_NOTIMPL;
@@ -180,7 +180,7 @@
  */
 static HRESULT WINAPI IStream_fnCopyTo (IStream * iface, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten)
 {
-	ICOM_THIS(ISHRegStream, iface);
+	ISHRegStream *This = (ISHRegStream *)iface;
 
 	TRACE("(%p)\n",This);
 	if (pcbRead)
@@ -195,7 +195,7 @@
  */
 static HRESULT WINAPI IStream_fnCommit (IStream * iface, DWORD grfCommitFlags)
 {
-	ICOM_THIS(ISHRegStream, iface);
+	ISHRegStream *This = (ISHRegStream *)iface;
 
 	TRACE("(%p)\n",This);
 
@@ -207,7 +207,7 @@
  */
 static HRESULT WINAPI IStream_fnRevert (IStream * iface)
 {
-	ICOM_THIS(ISHRegStream, iface);
+	ISHRegStream *This = (ISHRegStream *)iface;
 
 	TRACE("(%p)\n",This);
 
@@ -219,7 +219,7 @@
  */
 static HRESULT WINAPI IStream_fnLockUnlockRegion (IStream * iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
 {
-	ICOM_THIS(ISHRegStream, iface);
+	ISHRegStream *This = (ISHRegStream *)iface;
 
 	TRACE("(%p)\n",This);
 
@@ -231,7 +231,7 @@
  */
 static HRESULT WINAPI IStream_fnStat (IStream * iface, STATSTG*   pstatstg, DWORD grfStatFlag)
 {
-	ICOM_THIS(ISHRegStream, iface);
+	ISHRegStream *This = (ISHRegStream *)iface;
 
 	TRACE("(%p)\n",This);
 
@@ -243,7 +243,7 @@
  */
 static HRESULT WINAPI IStream_fnClone (IStream * iface, IStream** ppstm)
 {
-	ICOM_THIS(ISHRegStream, iface);
+	ISHRegStream *This = (ISHRegStream *)iface;
 
 	TRACE("(%p)\n",This);
 	if (ppstm)
@@ -253,7 +253,6 @@
 
 static struct IStreamVtbl rstvt =
 {
-	ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
 	IStream_fnQueryInterface,
 	IStream_fnAddRef,
 	IStream_fnRelease,
@@ -277,7 +276,7 @@
  */
 static ULONG WINAPI IStream_fnAddRefDummy(IStream *iface)
 {
-	ICOM_THIS(ISHRegStream, iface);
+	ISHRegStream *This = (ISHRegStream *)iface;
 	TRACE("(%p)\n", This);
 	return 2;
 }
@@ -287,7 +286,7 @@
  */
 static ULONG WINAPI IStream_fnReleaseDummy(IStream *iface)
 {
-	ICOM_THIS(ISHRegStream, iface);
+	ISHRegStream *This = (ISHRegStream *)iface;
 	TRACE("(%p)\n", This);
 	return 1;
 }
@@ -304,7 +303,6 @@
 
 static struct IStreamVtbl DummyRegStreamVTable =
 {
-  ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
   IStream_fnQueryInterface,
   IStream_fnAddRefDummy,  /* Overridden */
   IStream_fnReleaseDummy, /* Overridden */

reactos/lib/shlwapi
shlwapi.rc 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- shlwapi.rc	14 Aug 2004 20:24:42 -0000	1.3
+++ shlwapi.rc	19 Sep 2004 10:46:48 -0000	1.4
@@ -26,6 +26,7 @@
 #include "shlwapi_De.rc"
 #include "shlwapi_En.rc"
 #include "shlwapi_Es.rc"
+#include "shlwapi_Nl.rc"
 #include "shlwapi_It.rc"
 #include "shlwapi_Ja.rc"
 #include "shlwapi_Pt.rc"

reactos/lib/shlwapi
shlwapi.spec 1.10 -> 1.11
diff -u -r1.10 -r1.11
--- shlwapi.spec	20 Aug 2004 06:58:58 -0000	1.10
+++ shlwapi.spec	19 Sep 2004 10:46:48 -0000	1.11
@@ -4,7 +4,7 @@
 4   stdcall -noname PathFileExistsDefExtW(wstr long)
 5   stdcall -noname PathFindOnPathExA(str ptr long)
 6   stdcall -noname PathFindOnPathExW(wstr ptr long)
-7   stdcall -noname SHAllocShared(long long ptr)
+7   stdcall -noname SHAllocShared(ptr long long)
 8   stdcall -noname SHLockShared(long long)
 9   stdcall -noname SHUnlockShared(ptr)
 10  stdcall -noname SHFreeShared(long long)
@@ -183,7 +183,7 @@
 183 stdcall -noname SHRegisterClassA(ptr)
 184 stdcall @(ptr ptr long) SHLWAPI_184
 185 stdcall -noname SHMessageBoxCheckA(ptr str str long long str)
-186 stub -noname SHSimulateDrop
+186 stdcall -noname SHSimulateDrop(ptr ptr long ptr ptr)
 187 stdcall -noname SHLoadFromPropertyBag(ptr ptr)
 188 stub -noname IUnknown_TranslateAcceleratorOCS
 189 stdcall -noname IUnknown_OnFocusOCS(ptr ptr)
@@ -327,8 +327,8 @@
 327 stdcall -noname UnregisterExtensionForMIMETypeW(wstr)
 328 stdcall -noname GetMIMETypeSubKeyA(str ptr long)
 329 stdcall -noname GetMIMETypeSubKeyW(wstr ptr long)
-330 stub -noname MIME_GetExtensionA
-331 stub -noname MIME_GetExtensionW
+330 stdcall -noname MIME_GetExtensionA(str ptr long)
+331 stdcall -noname MIME_GetExtensionW(wstr ptr long)
 332 stdcall @(ptr long) user32.CallMsgFilterW
 333 stdcall -noname SHBrowseForFolderWrapW(ptr)
 334 stdcall -noname SHGetPathFromIDListWrapW(ptr ptr)
@@ -342,7 +342,7 @@
 342 stdcall -noname SHInterlockedCompareExchange(ptr long long)
 343 stdcall -noname SHRegGetCLSIDKeyA(ptr str long long ptr)
 344 stdcall -noname SHRegGetCLSIDKeyW(ptr wstr long long ptr)
-345 stub -noname SHAnsiToAnsi
+345 stdcall -noname SHAnsiToAnsi(str ptr long)
 346 stdcall -noname SHUnicodeToUnicode(wstr ptr long)
 347 stdcall @(long wstr) advapi32.RegDeleteValueW
 348 stub -noname SHGetFileDescriptionW

reactos/lib/shlwapi
string.c 1.9 -> 1.10
diff -u -r1.9 -r1.10
--- string.c	14 Aug 2004 20:24:42 -0000	1.9
+++ string.c	19 Sep 2004 10:46:48 -0000	1.10
@@ -710,10 +710,10 @@
  *
  * NOTES
  *  Leading whitespace, '-' and '+' are allowed before the number. If
- *  dwFlags includes STIF_SUPPORT_HEX, hexidecimal numbers are allowed, if
+ *  dwFlags includes STIF_SUPPORT_HEX, hexadecimal numbers are allowed, if
  *  preceeded by '0x'. If this flag is not set, or there is no '0x' prefix,
  *  the string is treated as a decimal string. A leading '-' is ignored for
- *  hexidecimal numbers.
+ *  hexadecimal numbers.
  */
 BOOL WINAPI StrToIntExA(LPCSTR lpszStr, DWORD dwFlags, LPINT lpiRet)
 {
@@ -2098,7 +2098,7 @@
  *  iLen     [I] Maximum number of chars to copy
  *
  * RETURNS
- *  Success: A pointer to the last character written.
+ *  Success: A pointer to the last character written to lpszDest..
  *  Failure: lpszDest, if any arguments are invalid.
  */
 LPSTR WINAPI StrCpyNXA(LPSTR lpszDest, LPCSTR lpszSrc, int iLen)
@@ -2623,6 +2623,48 @@
 }
 
 /*************************************************************************
+ *      @	[SHLWAPI.345]
+ *
+ * Copy one string to another.
+ *
+ * PARAMS
+ *  lpszSrc [I] Source string to copy
+ *  lpszDst [O] Destination for copy
+ *  iLen    [I] Length of lpszDst in characters
+ *
+ * RETURNS
+ *  The length of the copied string, including the terminating NUL. lpszDst
+ *  contains iLen characters of lpszSrc.
+ */
+DWORD WINAPI SHAnsiToAnsi(LPCSTR lpszSrc, LPSTR lpszDst, int iLen)
+{
+    LPSTR lpszRet;
+
+    TRACE("(%s,%p,0x%08x)\n", debugstr_a(lpszSrc), lpszDst, iLen);
+
+    /* Our original version used lstrncpy/lstrlen, incorrectly filling up all
+     * of lpszDst with extra NULs. This version is correct, and faster too.
+     */
+    lpszRet = StrCpyNXA(lpszDst, lpszSrc, iLen);
+    return lpszRet - lpszDst + 1;
+}
+
+/*************************************************************************
+ *      @	[SHLWAPI.346]
+ *
+ * Unicode version of SSHAnsiToAnsi.
+ */
+DWORD WINAPI SHUnicodeToUnicode(LPCWSTR lpszSrc, LPWSTR lpszDst, int iLen)
+{
+    LPWSTR lpszRet;
+
+    TRACE("(%s,%p,0x%08x)\n", debugstr_w(lpszSrc), lpszDst, iLen);
+
+    lpszRet = StrCpyNXW(lpszDst, lpszSrc, iLen);
+    return lpszRet - lpszDst + 1;
+}
+
+/*************************************************************************
  *      @	[SHLWAPI.364]
  *
  * Determine if an Ascii string converts to Unicode and back identically.

reactos/lib/shlwapi
url.c 1.9 -> 1.10
diff -u -r1.9 -r1.10
--- url.c	8 Aug 2004 21:15:48 -0000	1.9
+++ url.c	19 Sep 2004 10:46:48 -0000	1.10
@@ -1668,6 +1668,7 @@
 {
     UNKNOWN_SHLWAPI_1 base;
     DWORD res1;
+    LPCSTR last;
 
     switch (Urlis) {
 
@@ -1680,11 +1681,16 @@
 	    return FALSE;
 	return TRUE;
 
+    case URLIS_FILEURL:
+        return !StrCmpNA("file://", pszUrl, 7);
+
+    case URLIS_DIRECTORY:
+        last = pszUrl + strlen(pszUrl) - 1;
+        return (last >= pszUrl && (*last == '/' || *last == '\\' ));
+
     case URLIS_URL:
     case URLIS_NOHISTORY:
-    case URLIS_FILEURL:
     case URLIS_APPLIABLE:
-    case URLIS_DIRECTORY:
     case URLIS_HASQUERY:
     default:
 	FIXME("(%s %d): stub\n", debugstr_a(pszUrl), Urlis);
@@ -1699,8 +1705,10 @@
  */
 BOOL WINAPI UrlIsW(LPCWSTR pszUrl, URLIS Urlis)
 {
+    static const WCHAR stemp[] = { 'f','i','l','e',':','/','/',0 };
     UNKNOWN_SHLWAPI_2 base;
     DWORD res1;
+    LPCWSTR last;
 
     switch (Urlis) {
 
@@ -1708,16 +1716,21 @@
 	base.size = 24;
 	res1 = ParseURLW(pszUrl, &base);
 	if (res1) return FALSE;  /* invalid scheme */
-	if ((*base.ap2 == L'/') && (*(base.ap2+1) == L'/'))
+	if ((*base.ap2 == '/') && (*(base.ap2+1) == '/'))
 	    /* has scheme followed by 2 '/' */
 	    return FALSE;
 	return TRUE;
 
+    case URLIS_FILEURL:
+        return !strncmpW(stemp, pszUrl, 7);
+
+    case URLIS_DIRECTORY:
+        last = pszUrl + strlenW(pszUrl) - 1;
+        return (last >= pszUrl && (*last == '/' || *last == '\\'));
+
     case URLIS_URL:
     case URLIS_NOHISTORY:
-    case URLIS_FILEURL:
     case URLIS_APPLIABLE:
-    case URLIS_DIRECTORY:
     case URLIS_HASQUERY:
     default:
 	FIXME("(%s %d): stub\n", debugstr_w(pszUrl), Urlis);
CVSspam 0.2.8