From 704b69f83ff1934ca1823f7cb26d89b46621a7b5 Mon Sep 17 00:00:00 2001 From: The Wine Synchronizer Date: Tue, 7 Aug 2007 07:27:43 +0000 Subject: [PATCH] Autosyncing with Wine HEAD svn path=/trunk/; revision=28215 --- reactos/dll/win32/shlwapi/Makefile.in | 35 - reactos/dll/win32/shlwapi/assoc.c | 44 +- reactos/dll/win32/shlwapi/clist.c | 144 ++-- reactos/dll/win32/shlwapi/istream.c | 34 +- reactos/dll/win32/shlwapi/msgbox.c | 19 +- reactos/dll/win32/shlwapi/ordinal.c | 865 ++++++++++++--------- reactos/dll/win32/shlwapi/path.c | 172 ++-- reactos/dll/win32/shlwapi/reg.c | 172 ++-- reactos/dll/win32/shlwapi/regstream.c | 18 +- reactos/dll/win32/shlwapi/resource.h | 7 +- reactos/dll/win32/shlwapi/shlwapi.rbuild | 28 +- reactos/dll/win32/shlwapi/shlwapi.rc | 9 +- reactos/dll/win32/shlwapi/shlwapi.spec | 40 +- reactos/dll/win32/shlwapi/shlwapi_De.rc | 10 +- reactos/dll/win32/shlwapi/shlwapi_En.rc | 12 +- reactos/dll/win32/shlwapi/shlwapi_Eo.rc | 43 + reactos/dll/win32/shlwapi/shlwapi_Es.rc | 10 +- reactos/dll/win32/shlwapi/shlwapi_Fi.rc | 10 +- reactos/dll/win32/shlwapi/shlwapi_Fr.rc | 43 + reactos/dll/win32/shlwapi/shlwapi_Hu.rc | 16 +- reactos/dll/win32/shlwapi/shlwapi_It.rc | 10 +- reactos/dll/win32/shlwapi/shlwapi_Ja.rc | 14 +- reactos/dll/win32/shlwapi/shlwapi_Ko.rc | 13 +- reactos/dll/win32/shlwapi/shlwapi_Nl.rc | 10 +- reactos/dll/win32/shlwapi/shlwapi_No.rc | 14 +- reactos/dll/win32/shlwapi/shlwapi_Pl.rc | 17 +- reactos/dll/win32/shlwapi/shlwapi_Pt.rc | 38 +- reactos/dll/win32/shlwapi/shlwapi_Ru.rc | 8 + reactos/dll/win32/shlwapi/shlwapi_Sv.rc | 8 + reactos/dll/win32/shlwapi/shlwapi_Tr.rc | 43 + reactos/dll/win32/shlwapi/shlwapi_Uk.rc | 8 + reactos/dll/win32/shlwapi/shlwapi_main.c | 34 +- reactos/dll/win32/shlwapi/shlwapi_ros.diff | 131 +++- reactos/dll/win32/shlwapi/stopwatch.c | 14 +- reactos/dll/win32/shlwapi/string.c | 516 ++++++------ reactos/dll/win32/shlwapi/thread.c | 37 +- reactos/dll/win32/shlwapi/url.c | 580 +++++++------- reactos/dll/win32/shlwapi/version.rc | 2 +- reactos/dll/win32/shlwapi/wsprintf.c | 2 +- 39 files changed, 1810 insertions(+), 1420 deletions(-) delete mode 100644 reactos/dll/win32/shlwapi/Makefile.in create mode 100644 reactos/dll/win32/shlwapi/shlwapi_Eo.rc create mode 100644 reactos/dll/win32/shlwapi/shlwapi_Fr.rc create mode 100644 reactos/dll/win32/shlwapi/shlwapi_Tr.rc diff --git a/reactos/dll/win32/shlwapi/Makefile.in b/reactos/dll/win32/shlwapi/Makefile.in deleted file mode 100644 index 4dbb8d20565..00000000000 --- a/reactos/dll/win32/shlwapi/Makefile.in +++ /dev/null @@ -1,35 +0,0 @@ -EXTRADEFS = -D_SHLWAPI_ -TOPSRCDIR = @top_srcdir@ -TOPOBJDIR = ../.. -SRCDIR = @srcdir@ -VPATH = @srcdir@ -MODULE = shlwapi.dll -IMPORTLIB = libshlwapi.$(IMPLIBEXT) -IMPORTS = ole32 user32 gdi32 advapi32 kernel32 ntdll -DELAYIMPORTS = oleaut32 -EXTRALIBS = -luuid $(LIBUNICODE) - -C_SRCS = \ - assoc.c \ - clist.c \ - istream.c \ - msgbox.c \ - ordinal.c \ - path.c \ - reg.c \ - regstream.c \ - shlwapi_main.c \ - stopwatch.c \ - string.c \ - thread.c \ - url.c \ - wsprintf.c - -RC_SRCS = \ - shlwapi.rc - -SUBDIRS = tests - -@MAKE_DLL_RULES@ - -### Dependencies: diff --git a/reactos/dll/win32/shlwapi/assoc.c b/reactos/dll/win32/shlwapi/assoc.c index 7394c20db1b..caac8279a9b 100644 --- a/reactos/dll/win32/shlwapi/assoc.c +++ b/reactos/dll/win32/shlwapi/assoc.c @@ -15,7 +15,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include @@ -170,7 +170,7 @@ HRESULT WINAPI AssocQueryKeyW(ASSOCF cfFlags, ASSOCKEY assockey, LPCWSTR pszAsso HRESULT hRet; IQueryAssociations* lpAssoc; - TRACE("(0x%8lx,0x%8x,%s,%s,%p)\n", cfFlags, assockey, debugstr_w(pszAssoc), + TRACE("(0x%8x,0x%8x,%s,%s,%p)\n", cfFlags, assockey, debugstr_w(pszAssoc), debugstr_w(pszExtra), phkeyOut); lpAssoc = IQueryAssociations_Constructor(); @@ -211,7 +211,7 @@ HRESULT WINAPI AssocQueryKeyA(ASSOCF cfFlags, ASSOCKEY assockey, LPCSTR pszAssoc WCHAR szExtraW[MAX_PATH], *lpszExtraW = NULL; HRESULT hRet = E_OUTOFMEMORY; - TRACE("(0x%8lx,0x%8x,%s,%s,%p)\n", cfFlags, assockey, debugstr_a(pszAssoc), + TRACE("(0x%8x,0x%8x,%s,%s,%p)\n", cfFlags, assockey, debugstr_a(pszAssoc), debugstr_a(pszExtra), phkeyOut); if (SHLWAPI_ParamAToW(pszAssoc, szAssocW, MAX_PATH, &lpszAssocW) && @@ -220,10 +220,10 @@ HRESULT WINAPI AssocQueryKeyA(ASSOCF cfFlags, ASSOCKEY assockey, LPCSTR pszAssoc hRet = AssocQueryKeyW(cfFlags, assockey, lpszAssocW, lpszExtraW, phkeyOut); } - if (lpszAssocW && lpszAssocW != szAssocW) + if (lpszAssocW != szAssocW) HeapFree(GetProcessHeap(), 0, lpszAssocW); - if (lpszExtraW && lpszExtraW != szExtraW) + if (lpszExtraW != szExtraW) HeapFree(GetProcessHeap(), 0, lpszExtraW); return hRet; @@ -240,7 +240,7 @@ HRESULT WINAPI AssocQueryStringW(ASSOCF cfFlags, ASSOCSTR str, LPCWSTR pszAssoc, HRESULT hRet; IQueryAssociations* lpAssoc; - TRACE("(0x%8lx,0x%8x,%s,%s,%p,%p)\n", cfFlags, str, debugstr_w(pszAssoc), + TRACE("(0x%8x,0x%8x,%s,%s,%p,%p)\n", cfFlags, str, debugstr_w(pszAssoc), debugstr_w(pszExtra), pszOut, pcchOut); if (!pcchOut) @@ -286,7 +286,7 @@ HRESULT WINAPI AssocQueryStringA(ASSOCF cfFlags, ASSOCSTR str, LPCSTR pszAssoc, WCHAR szExtraW[MAX_PATH], *lpszExtraW = NULL; HRESULT hRet = E_OUTOFMEMORY; - TRACE("(0x%8lx,0x%8x,%s,%s,%p,%p)\n", cfFlags, str, debugstr_a(pszAssoc), + TRACE("(0x%8x,0x%8x,%s,%s,%p,%p)\n", cfFlags, str, debugstr_a(pszAssoc), debugstr_a(pszExtra), pszOut, pcchOut); if (!pcchOut) @@ -312,14 +312,14 @@ HRESULT WINAPI AssocQueryStringA(ASSOCF cfFlags, ASSOCSTR str, LPCSTR pszAssoc, WideCharToMultiByte(CP_ACP,0,szReturnW,-1,pszOut,dwLenOut,0,0); *pcchOut = dwLenOut; - if (lpszReturnW && lpszReturnW != szReturnW) + if (lpszReturnW != szReturnW) HeapFree(GetProcessHeap(), 0, lpszReturnW); } } - if (lpszAssocW && lpszAssocW != szAssocW) + if (lpszAssocW != szAssocW) HeapFree(GetProcessHeap(), 0, lpszAssocW); - if (lpszExtraW && lpszExtraW != szExtraW) + if (lpszExtraW != szExtraW) HeapFree(GetProcessHeap(), 0, lpszExtraW); return hRet; } @@ -336,7 +336,7 @@ HRESULT WINAPI AssocQueryStringByKeyW(ASSOCF cfFlags, ASSOCSTR str, HKEY hkAssoc HRESULT hRet; IQueryAssociations* lpAssoc; - TRACE("(0x%8lx,0x%8x,%p,%s,%p,%p)\n", cfFlags, str, hkAssoc, + TRACE("(0x%8x,0x%8x,%p,%s,%p,%p)\n", cfFlags, str, hkAssoc, debugstr_w(pszExtra), pszOut, pcchOut); lpAssoc = IQueryAssociations_Constructor(); @@ -376,11 +376,11 @@ HRESULT WINAPI AssocQueryStringByKeyA(ASSOCF cfFlags, ASSOCSTR str, HKEY hkAssoc LPCSTR pszExtra, LPSTR pszOut, DWORD *pcchOut) { - WCHAR szExtraW[MAX_PATH], *lpszExtraW; + WCHAR szExtraW[MAX_PATH], *lpszExtraW = szExtraW; WCHAR szReturnW[MAX_PATH], *lpszReturnW = szReturnW; HRESULT hRet = E_OUTOFMEMORY; - TRACE("(0x%8lx,0x%8x,%p,%s,%p,%p)\n", cfFlags, str, hkAssoc, + TRACE("(0x%8x,0x%8x,%p,%s,%p,%p)\n", cfFlags, str, hkAssoc, debugstr_a(pszExtra), pszOut, pcchOut); if (!pcchOut) @@ -406,7 +406,7 @@ HRESULT WINAPI AssocQueryStringByKeyA(ASSOCF cfFlags, ASSOCSTR str, HKEY hkAssoc } } - if (lpszExtraW && lpszExtraW != szExtraW) + if (lpszExtraW != szExtraW) HeapFree(GetProcessHeap(), 0, lpszExtraW); return hRet; } @@ -469,7 +469,7 @@ static ULONG WINAPI IQueryAssociations_fnAddRef(IQueryAssociations *iface) IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; ULONG refCount = InterlockedIncrement(&This->ref); - TRACE("(%p)->(ref before=%lu)\n",This, refCount - 1); + TRACE("(%p)->(ref before=%u)\n",This, refCount - 1); return refCount; } @@ -484,7 +484,7 @@ static ULONG WINAPI IQueryAssociations_fnRelease(IQueryAssociations *iface) IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; ULONG refCount = InterlockedDecrement(&This->ref); - TRACE("(%p)->(ref before=%lu)\n",This, refCount + 1); + TRACE("(%p)->(ref before=%u)\n",This, refCount + 1); if (!refCount) { @@ -522,7 +522,7 @@ static HRESULT WINAPI IQueryAssociations_fnInit( IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; HRESULT hr; - TRACE("(%p)->(%ld,%s,%p,%p)\n", iface, + TRACE("(%p)->(%d,%s,%p,%p)\n", iface, cfFlags, debugstr_w(pszAssoc), hkeyProgid, @@ -530,7 +530,7 @@ static HRESULT WINAPI IQueryAssociations_fnInit( if (hWnd != NULL) FIXME("hwnd != NULL not supported\n"); if (cfFlags != 0) - FIXME("unsupported flags: %lx\n", cfFlags); + FIXME("unsupported flags: %x\n", cfFlags); if (pszAssoc != NULL) { hr = RegOpenKeyExW(HKEY_CLASSES_ROOT, @@ -591,7 +591,7 @@ static HRESULT WINAPI IQueryAssociations_fnGetString( { IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; - FIXME("(%p,0x%8lx,0x%8x,%s,%p,%p)-stub!\n", This, cfFlags, str, + FIXME("(%p,0x%8x,0x%8x,%s,%p,%p)-stub!\n", This, cfFlags, str, debugstr_w(pszExtra), pszOut, pcchOut); return E_NOTIMPL; } @@ -621,7 +621,7 @@ static HRESULT WINAPI IQueryAssociations_fnGetKey( { IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; - FIXME("(%p,0x%8lx,0x%8x,%s,%p)-stub!\n", This, cfFlags, assockey, + FIXME("(%p,0x%8x,0x%8x,%s,%p)-stub!\n", This, cfFlags, assockey, debugstr_w(pszExtra), phkeyOut); return E_NOTIMPL; } @@ -653,7 +653,7 @@ static HRESULT WINAPI IQueryAssociations_fnGetData( { IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; - FIXME("(%p,0x%8lx,0x%8x,%s,%p,%p)-stub!\n", This, cfFlags, assocdata, + FIXME("(%p,0x%8x,0x%8x,%s,%p,%p)-stub!\n", This, cfFlags, assocdata, debugstr_w(pszExtra), pvOut, pcbOut); return E_NOTIMPL; } @@ -688,7 +688,7 @@ static HRESULT WINAPI IQueryAssociations_fnGetEnum( { IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; - FIXME("(%p,0x%8lx,0x%8x,%s,%s,%p)-stub!\n", This, cfFlags, assocenum, + FIXME("(%p,0x%8x,0x%8x,%s,%s,%p)-stub!\n", This, cfFlags, assocenum, debugstr_w(pszExtra), debugstr_guid(riid), ppvOut); return E_NOTIMPL; } diff --git a/reactos/dll/win32/shlwapi/clist.c b/reactos/dll/win32/shlwapi/clist.c index b39c247d4fd..29028bf2e85 100644 --- a/reactos/dll/win32/shlwapi/clist.c +++ b/reactos/dll/win32/shlwapi/clist.c @@ -15,7 +15,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include @@ -24,36 +24,28 @@ #include "windef.h" #include "winbase.h" +#include "winuser.h" #include "objbase.h" +#include "shlobj.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(shell); -/* DataBlock list element (ordinals 17-22) */ -typedef struct tagSHLWAPI_CLIST -{ - ULONG ulSize; /* Size of this list element and its data */ - ULONG ulId; /* If 0xFFFFFFFF, The real element follows */ - /* Item data (or a contained SHLWAPI_CLIST) follows... */ -} SHLWAPI_CLIST, *LPSHLWAPI_CLIST; - -typedef const SHLWAPI_CLIST* LPCSHLWAPI_CLIST; - -/* ulId for contained SHLWAPI_CLIST items */ +/* dwSignature for contained DATABLOCK_HEADER items */ #define CLIST_ID_CONTAINER (~0U) -HRESULT WINAPI SHAddDataBlock(LPSHLWAPI_CLIST*,LPCSHLWAPI_CLIST); +HRESULT WINAPI SHAddDataBlock(LPDBLIST*,const DATABLOCK_HEADER*); /************************************************************************* * NextItem * * Internal helper: move a DataBlock pointer to the next item. */ -inline static LPSHLWAPI_CLIST NextItem(LPCSHLWAPI_CLIST lpList) +static inline LPDATABLOCK_HEADER NextItem(LPDBLIST lpList) { - const char* address = (const char*)lpList; - address += lpList->ulSize; - return (LPSHLWAPI_CLIST)address; + char* address = (char*)lpList; + address += lpList->cbSize; + return (LPDATABLOCK_HEADER)address; } /************************************************************************* @@ -93,27 +85,27 @@ inline static LPSHLWAPI_CLIST NextItem(LPCSHLWAPI_CLIST lpList) * * These functions are slow for large objects and long lists. */ -HRESULT WINAPI SHWriteDataBlockList(IStream* lpStream, LPSHLWAPI_CLIST lpList) +HRESULT WINAPI SHWriteDataBlockList(IStream* lpStream, LPDBLIST lpList) { ULONG ulSize; - HRESULT hRet = E_FAIL; + HRESULT hRet = S_OK; TRACE("(%p,%p)\n", lpStream, lpList); if(lpList) { - while (lpList->ulSize) + while (lpList->cbSize) { - LPSHLWAPI_CLIST lpItem = lpList; + LPDATABLOCK_HEADER lpItem = lpList; - if(lpList->ulId == CLIST_ID_CONTAINER) + if(lpList->dwSignature == CLIST_ID_CONTAINER) lpItem++; - hRet = IStream_Write(lpStream,lpItem,lpItem->ulSize,&ulSize); + hRet = IStream_Write(lpStream,lpItem,lpItem->cbSize,&ulSize); if (FAILED(hRet)) return hRet; - if(lpItem->ulSize != ulSize) + if(lpItem->cbSize != ulSize) return STG_E_MEDIUMFULL; lpList = NextItem(lpList); @@ -149,11 +141,11 @@ HRESULT WINAPI SHWriteDataBlockList(IStream* lpStream, LPSHLWAPI_CLIST lpList) * When read from a file, list objects are limited in size to 64k. * See SHWriteDataBlockList. */ -HRESULT WINAPI SHReadDataBlockList(IStream* lpStream, LPSHLWAPI_CLIST* lppList) +HRESULT WINAPI SHReadDataBlockList(IStream* lpStream, LPDBLIST* lppList) { - SHLWAPI_CLIST bBuff[128]; /* Temporary storage for new list item */ + DATABLOCK_HEADER bBuff[128]; /* Temporary storage for new list item */ ULONG ulBuffSize = sizeof(bBuff); - LPSHLWAPI_CLIST pItem = bBuff; + LPDATABLOCK_HEADER pItem = bBuff; ULONG ulRead, ulSize; HRESULT hRet = S_OK; @@ -189,18 +181,18 @@ HRESULT WINAPI SHReadDataBlockList(IStream* lpStream, LPSHLWAPI_CLIST* lppList) } break; } - else if (ulSize >= sizeof(SHLWAPI_CLIST)) + else if (ulSize >= sizeof(DATABLOCK_HEADER)) { /* Add this new item to the list */ if(ulSize > ulBuffSize) { /* We need more buffer space, allocate it */ - LPSHLWAPI_CLIST lpTemp; + LPDATABLOCK_HEADER lpTemp; if (pItem == bBuff) - lpTemp = (LPSHLWAPI_CLIST)LocalAlloc(LMEM_ZEROINIT, ulSize); + lpTemp = (LPDATABLOCK_HEADER)LocalAlloc(LMEM_ZEROINIT, ulSize); else - lpTemp = (LPSHLWAPI_CLIST)LocalReAlloc((HLOCAL)pItem, ulSize, + lpTemp = (LPDATABLOCK_HEADER)LocalReAlloc((HLOCAL)pItem, ulSize, LMEM_ZEROINIT|LMEM_MOVEABLE); if(!lpTemp) @@ -212,11 +204,11 @@ HRESULT WINAPI SHReadDataBlockList(IStream* lpStream, LPSHLWAPI_CLIST* lppList) pItem = lpTemp; } - pItem->ulSize = ulSize; - ulSize -= sizeof(pItem->ulSize); /* already read this member */ + pItem->cbSize = ulSize; + ulSize -= sizeof(pItem->cbSize); /* already read this member */ /* Read the item Id and data */ - hRet = IStream_Read(lpStream, &pItem->ulId, ulSize, &ulRead); + hRet = IStream_Read(lpStream, &pItem->dwSignature, ulSize, &ulRead); if(FAILED(hRet) || ulRead != ulSize) break; @@ -246,7 +238,7 @@ HRESULT WINAPI SHReadDataBlockList(IStream* lpStream, LPSHLWAPI_CLIST* lppList) * NOTES * See SHWriteDataBlockList. */ -VOID WINAPI SHFreeDataBlockList(LPSHLWAPI_CLIST lpList) +VOID WINAPI SHFreeDataBlockList(LPDBLIST lpList) { TRACE("(%p)\n", lpList); @@ -269,13 +261,13 @@ VOID WINAPI SHFreeDataBlockList(LPSHLWAPI_CLIST lpList) * * NOTES * If the size of the element to be inserted is less than the size of a - * SHLWAPI_CLIST node, or the Id for the item is CLIST_ID_CONTAINER, + * DATABLOCK_HEADER node, or the Id for the item is CLIST_ID_CONTAINER, * the call returns S_OK but does not actually add the element. * See SHWriteDataBlockList. */ -HRESULT WINAPI SHAddDataBlock(LPSHLWAPI_CLIST* lppList, LPCSHLWAPI_CLIST lpNewItem) +HRESULT WINAPI SHAddDataBlock(LPDBLIST* lppList, const DATABLOCK_HEADER *lpNewItem) { - LPSHLWAPI_CLIST lpInsertAt = NULL; + LPDATABLOCK_HEADER lpInsertAt = NULL; ULONG ulSize; TRACE("(%p,%p)\n", lppList, lpNewItem); @@ -283,23 +275,23 @@ HRESULT WINAPI SHAddDataBlock(LPSHLWAPI_CLIST* lppList, LPCSHLWAPI_CLIST lpNewIt if(!lppList || !lpNewItem ) return E_INVALIDARG; - if (lpNewItem->ulSize < sizeof(SHLWAPI_CLIST) || - lpNewItem->ulId == CLIST_ID_CONTAINER) + if (lpNewItem->cbSize < sizeof(DATABLOCK_HEADER) || + lpNewItem->dwSignature == CLIST_ID_CONTAINER) return S_OK; - ulSize = lpNewItem->ulSize; + ulSize = lpNewItem->cbSize; if(ulSize & 0x3) { /* Tune size to a ULONG boundary, add space for container element */ - ulSize = ((ulSize + 0x3) & 0xFFFFFFFC) + sizeof(SHLWAPI_CLIST); - TRACE("Creating container item, new size = %ld\n", ulSize); + ulSize = ((ulSize + 0x3) & 0xFFFFFFFC) + sizeof(DATABLOCK_HEADER); + TRACE("Creating container item, new size = %d\n", ulSize); } if(!*lppList) { /* An empty list. Allocate space for terminal ulSize also */ - *lppList = (LPSHLWAPI_CLIST)LocalAlloc(LMEM_ZEROINIT, + *lppList = (LPDATABLOCK_HEADER)LocalAlloc(LMEM_ZEROINIT, ulSize + sizeof(ULONG)); lpInsertAt = *lppList; } @@ -307,44 +299,44 @@ HRESULT WINAPI SHAddDataBlock(LPSHLWAPI_CLIST* lppList, LPCSHLWAPI_CLIST lpNewIt { /* Append to the end of the list */ ULONG ulTotalSize = 0; - LPSHLWAPI_CLIST lpIter = *lppList; + LPDATABLOCK_HEADER lpIter = *lppList; /* Iterate to the end of the list, calculating the total size */ - while (lpIter->ulSize) + while (lpIter->cbSize) { - ulTotalSize += lpIter->ulSize; + ulTotalSize += lpIter->cbSize; lpIter = NextItem(lpIter); } /* Increase the size of the list */ - lpIter = (LPSHLWAPI_CLIST)LocalReAlloc((HLOCAL)*lppList, + lpIter = (LPDATABLOCK_HEADER)LocalReAlloc((HLOCAL)*lppList, ulTotalSize + ulSize+sizeof(ULONG), LMEM_ZEROINIT | LMEM_MOVEABLE); if(lpIter) { *lppList = lpIter; - lpInsertAt = (LPSHLWAPI_CLIST)((char*)lpIter + ulTotalSize); /* At end */ + lpInsertAt = (LPDATABLOCK_HEADER)((char*)lpIter + ulTotalSize); /* At end */ } } if(lpInsertAt) { /* Copy in the new item */ - LPSHLWAPI_CLIST lpDest = lpInsertAt; + LPDATABLOCK_HEADER lpDest = lpInsertAt; - if(ulSize != lpNewItem->ulSize) + if(ulSize != lpNewItem->cbSize) { - lpInsertAt->ulSize = ulSize; - lpInsertAt->ulId = CLIST_ID_CONTAINER; + lpInsertAt->cbSize = ulSize; + lpInsertAt->dwSignature = CLIST_ID_CONTAINER; lpDest++; } - memcpy(lpDest, lpNewItem, lpNewItem->ulSize); + memcpy(lpDest, lpNewItem, lpNewItem->cbSize); /* Terminate the list */ lpInsertAt = NextItem(lpInsertAt); - lpInsertAt->ulSize = 0; + lpInsertAt->cbSize = 0; - return lpNewItem->ulSize; + return lpNewItem->cbSize; } return S_OK; } @@ -355,8 +347,8 @@ HRESULT WINAPI SHAddDataBlock(LPSHLWAPI_CLIST* lppList, LPCSHLWAPI_CLIST lpNewIt * Remove an item from a DataBlock list. * * PARAMS - * lppList [O] List to remove the item from - * ulId [I] Id of item to remove + * lppList [O] List to remove the item from + * dwSignature [I] Id of item to remove * * RETURNS * Success: TRUE. @@ -365,22 +357,22 @@ HRESULT WINAPI SHAddDataBlock(LPSHLWAPI_CLIST* lppList, LPCSHLWAPI_CLIST lpNewIt * NOTES * See SHWriteDataBlockList. */ -BOOL WINAPI SHRemoveDataBlock(LPSHLWAPI_CLIST* lppList, ULONG ulId) +BOOL WINAPI SHRemoveDataBlock(LPDBLIST* lppList, DWORD dwSignature) { - LPSHLWAPI_CLIST lpList = 0; - LPSHLWAPI_CLIST lpItem = NULL; - LPSHLWAPI_CLIST lpNext; + LPDATABLOCK_HEADER lpList = 0; + LPDATABLOCK_HEADER lpItem = NULL; + LPDATABLOCK_HEADER lpNext; ULONG ulNewSize; - TRACE("(%p,%ld)\n", lppList, ulId); + TRACE("(%p,%d)\n", lppList, dwSignature); if(lppList && (lpList = *lppList)) { /* Search for item in list */ - while (lpList->ulSize) + while (lpList->cbSize) { - if(lpList->ulId == ulId || - (lpList->ulId == CLIST_ID_CONTAINER && lpList[1].ulId == ulId)) + if(lpList->dwSignature == dwSignature || + (lpList->dwSignature == CLIST_ID_CONTAINER && lpList[1].dwSignature == dwSignature)) { lpItem = lpList; /* Found */ break; @@ -395,11 +387,11 @@ BOOL WINAPI SHRemoveDataBlock(LPSHLWAPI_CLIST* lppList, ULONG ulId) lpList = lpNext = NextItem(lpItem); /* Locate the end of the list */ - while (lpList->ulSize) + while (lpList->cbSize) lpList = NextItem(lpList); /* Resize the list */ - ulNewSize = LocalSize((HLOCAL)*lppList) - lpItem->ulSize; + ulNewSize = LocalSize((HLOCAL)*lppList) - lpItem->cbSize; /* Copy following elements over lpItem */ memmove(lpItem, lpNext, (char *)lpList - (char *)lpNext + sizeof(ULONG)); @@ -411,7 +403,7 @@ BOOL WINAPI SHRemoveDataBlock(LPSHLWAPI_CLIST* lppList, ULONG ulId) } else { - lpList = (LPSHLWAPI_CLIST)LocalReAlloc((HLOCAL)*lppList, ulNewSize, + lpList = (LPDATABLOCK_HEADER)LocalReAlloc((HLOCAL)*lppList, ulNewSize, LMEM_ZEROINIT|LMEM_MOVEABLE); if(lpList) *lppList = lpList; @@ -425,8 +417,8 @@ BOOL WINAPI SHRemoveDataBlock(LPSHLWAPI_CLIST* lppList, ULONG ulId) * Find an item in a DataBlock list. * * PARAMS - * lpList [I] List to search - * ulId [I] Id of item to find + * lpList [I] List to search + * dwSignature [I] Id of item to find * * RETURNS * Success: A pointer to the list item found @@ -435,17 +427,17 @@ BOOL WINAPI SHRemoveDataBlock(LPSHLWAPI_CLIST* lppList, ULONG ulId) * NOTES * See SHWriteDataBlockList. */ -LPSHLWAPI_CLIST WINAPI SHFindDataBlock(LPSHLWAPI_CLIST lpList, ULONG ulId) +LPDATABLOCK_HEADER WINAPI SHFindDataBlock(LPDBLIST lpList, DWORD dwSignature) { - TRACE("(%p,%ld)\n", lpList, ulId); + TRACE("(%p,%d)\n", lpList, dwSignature); if(lpList) { - while(lpList->ulSize) + while(lpList->cbSize) { - if(lpList->ulId == ulId) + if(lpList->dwSignature == dwSignature) return lpList; /* Matched */ - else if(lpList->ulId == CLIST_ID_CONTAINER && lpList[1].ulId == ulId) + else if(lpList->dwSignature == CLIST_ID_CONTAINER && lpList[1].dwSignature == dwSignature) return lpList + 1; /* Contained item matches */ lpList = NextItem(lpList); diff --git a/reactos/dll/win32/shlwapi/istream.c b/reactos/dll/win32/shlwapi/istream.c index 43c58539370..ff93b77621f 100644 --- a/reactos/dll/win32/shlwapi/istream.c +++ b/reactos/dll/win32/shlwapi/istream.c @@ -15,7 +15,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include @@ -83,7 +83,7 @@ static ULONG WINAPI IStream_fnAddRef(IStream *iface) ISHFileStream *This = (ISHFileStream *)iface; ULONG refCount = InterlockedIncrement(&This->ref); - TRACE("(%p)->(ref before=%lu)\n",This, refCount - 1); + TRACE("(%p)->(ref before=%u)\n",This, refCount - 1); return refCount; } @@ -96,7 +96,7 @@ static ULONG WINAPI IStream_fnRelease(IStream *iface) ISHFileStream *This = (ISHFileStream *)iface; ULONG refCount = InterlockedDecrement(&This->ref); - TRACE("(%p)->(ref before=%lu)\n",This, refCount + 1); + TRACE("(%p)->(ref before=%u)\n",This, refCount + 1); if (!refCount) { @@ -117,14 +117,14 @@ static HRESULT WINAPI IStream_fnRead(IStream *iface, void* pv, ULONG cb, ULONG* ISHFileStream *This = (ISHFileStream *)iface; DWORD dwRead = 0; - TRACE("(%p,%p,0x%08lx,%p)\n", This, pv, cb, pcbRead); + TRACE("(%p,%p,0x%08x,%p)\n", This, pv, cb, pcbRead); if (!pv) return STG_E_INVALIDPOINTER; if (!ReadFile(This->hFile, pv, cb, &dwRead, NULL)) { - ERR("error %ld reading file\n", GetLastError()); + ERR("error %d reading file\n", GetLastError()); return HRESULT_FROM_WIN32(GetLastError()); } if (pcbRead) @@ -140,7 +140,7 @@ static HRESULT WINAPI IStream_fnWrite(IStream *iface, const void* pv, ULONG cb, ISHFileStream *This = (ISHFileStream *)iface; DWORD dwWritten = 0; - TRACE("(%p,%p,0x%08lx,%p)\n", This, pv, cb, pcbWritten); + TRACE("(%p,%p,0x%08x,%p)\n", This, pv, cb, pcbWritten); if (!pv) return STG_E_INVALIDPOINTER; @@ -171,7 +171,7 @@ static HRESULT WINAPI IStream_fnSeek(IStream *iface, LARGE_INTEGER dlibMove, ISHFileStream *This = (ISHFileStream *)iface; DWORD dwPos; - TRACE("(%p,%ld,%ld,%p)\n", This, dlibMove.u.LowPart, dwOrigin, pNewPos); + TRACE("(%p,%d,%d,%p)\n", This, dlibMove.u.LowPart, dwOrigin, pNewPos); IStream_fnCommit(iface, 0); /* If ever buffered, this will be needed */ dwPos = SetFilePointer(This->hFile, dlibMove.u.LowPart, NULL, dwOrigin); @@ -193,7 +193,7 @@ static HRESULT WINAPI IStream_fnSetSize(IStream *iface, ULARGE_INTEGER libNewSiz { ISHFileStream *This = (ISHFileStream *)iface; - TRACE("(%p,%ld)\n", This, libNewSize.u.LowPart); + TRACE("(%p,%d)\n", This, libNewSize.u.LowPart); IStream_fnCommit(iface, 0); /* If ever buffered, this will be needed */ if( ! SetFilePointer( This->hFile, libNewSize.QuadPart, NULL, FILE_BEGIN ) ) @@ -216,7 +216,7 @@ static HRESULT WINAPI IStream_fnCopyTo(IStream *iface, IStream* pstm, ULARGE_INT ULONGLONG ulSize; HRESULT hRet = S_OK; - TRACE("(%p,%p,%ld,%p,%p)\n", This, pstm, cb.u.LowPart, pcbRead, pcbWritten); + TRACE("(%p,%p,%d,%p,%p)\n", This, pstm, cb.u.LowPart, pcbRead, pcbWritten); if (pcbRead) pcbRead->QuadPart = 0; @@ -262,7 +262,7 @@ static HRESULT WINAPI IStream_fnCommit(IStream *iface, DWORD grfCommitFlags) { ISHFileStream *This = (ISHFileStream *)iface; - TRACE("(%p,%ld)\n", This, grfCommitFlags); + TRACE("(%p,%d)\n", This, grfCommitFlags); /* Currently unbuffered: This function is not needed */ return S_OK; } @@ -285,7 +285,7 @@ static HRESULT WINAPI IStream_fnLockUnlockRegion(IStream *iface, ULARGE_INTEGER ULARGE_INTEGER cb, DWORD dwLockType) { ISHFileStream *This = (ISHFileStream *)iface; - TRACE("(%p,%ld,%ld,%ld)\n", This, libOffset.u.LowPart, cb.u.LowPart, dwLockType); + TRACE("(%p,%d,%d,%d)\n", This, libOffset.u.LowPart, cb.u.LowPart, dwLockType); return E_NOTIMPL; } @@ -299,7 +299,7 @@ static HRESULT WINAPI IStream_fnStat(IStream *iface, STATSTG* lpStat, BY_HANDLE_FILE_INFORMATION fi; HRESULT hRet = S_OK; - TRACE("(%p,%p,%ld)\n", This, lpStat, grfStatFlag); + TRACE("(%p,%p,%d)\n", This, lpStat, grfStatFlag); if (!grfStatFlag) hRet = STG_E_INVALIDPOINTER; @@ -410,7 +410,7 @@ HRESULT WINAPI SHCreateStreamOnFileEx(LPCWSTR lpszPath, DWORD dwMode, DWORD dwAccess, dwShare, dwCreate; HANDLE hFile; - TRACE("(%s,%ld,0x%08lX,%d,%p,%p)\n", debugstr_w(lpszPath), dwMode, + TRACE("(%s,%d,0x%08X,%d,%p,%p)\n", debugstr_w(lpszPath), dwMode, dwAttributes, bCreate, lpTemplate, lppStream); if (!lpszPath || !lppStream || lpTemplate) @@ -498,7 +498,7 @@ HRESULT WINAPI SHCreateStreamOnFileEx(LPCWSTR lpszPath, DWORD dwMode, HRESULT WINAPI SHCreateStreamOnFileW(LPCWSTR lpszPath, DWORD dwMode, IStream **lppStream) { - TRACE("(%s,%ld,%p)\n", debugstr_w(lpszPath), dwMode, lppStream); + TRACE("(%s,%d,%p)\n", debugstr_w(lpszPath), dwMode, lppStream); if (!lpszPath || !lppStream) return E_INVALIDARG; @@ -525,7 +525,7 @@ HRESULT WINAPI SHCreateStreamOnFileA(LPCSTR lpszPath, DWORD dwMode, { WCHAR szPath[MAX_PATH]; - TRACE("(%s,%ld,%p)\n", debugstr_a(lpszPath), dwMode, lppStream); + TRACE("(%s,%d,%p)\n", debugstr_a(lpszPath), dwMode, lppStream); if (!lpszPath) return E_INVALIDARG; @@ -553,7 +553,7 @@ HRESULT WINAPI SHLWAPI_184(IStream *lpStream, LPVOID lpvDest, ULONG ulSize) ULONG ulRead; HRESULT hRet; - TRACE("(%p,%p,%ld)\n", lpStream, lpvDest, ulSize); + TRACE("(%p,%p,%d)\n", lpStream, lpvDest, ulSize); hRet = IStream_Read(lpStream, lpvDest, ulSize, &ulRead); @@ -625,7 +625,7 @@ HRESULT WINAPI SHLWAPI_212(IStream *lpStream, LPCVOID lpvSrc, ULONG ulSize) ULONG ulWritten; HRESULT hRet; - TRACE("(%p,%p,%ld)\n", lpStream, lpvSrc, ulSize); + TRACE("(%p,%p,%d)\n", lpStream, lpvSrc, ulSize); hRet = IStream_Write(lpStream, lpvSrc, ulSize, &ulWritten); diff --git a/reactos/dll/win32/shlwapi/msgbox.c b/reactos/dll/win32/shlwapi/msgbox.c index dbf3f70d1da..3e14860b9de 100644 --- a/reactos/dll/win32/shlwapi/msgbox.c +++ b/reactos/dll/win32/shlwapi/msgbox.c @@ -15,10 +15,9 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define COM_NO_WINDOWS_H #include "config.h" #include "wine/port.h" @@ -64,7 +63,7 @@ static INT_PTR CALLBACK SHDlgProcEx(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM { DLGDATAEX *d = (DLGDATAEX *)GetWindowLongPtrW(hDlg, DWLP_USER); - TRACE("(%p,%u,%d,%ld) data %p\n", hDlg, uMsg, wParam, lParam, d); + TRACE("(%p,%u,%ld,%ld) data %p\n", hDlg, uMsg, wParam, lParam, d); switch (uMsg) { @@ -188,14 +187,14 @@ typedef struct tagDLGDATA /* Dialogue procedure for shlwapi message boxes */ static INT_PTR CALLBACK SHDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { - TRACE("(%p,%u,%d,%ld)\n", hDlg, uMsg, wParam, lParam); + TRACE("(%p,%u,%ld,%ld)\n", hDlg, uMsg, wParam, lParam); switch (uMsg) { case WM_INITDIALOG: { DLGDATA *d = (DLGDATA *)lParam; - TRACE("WM_INITDIALOG: %p, %s,%s,%ld\n", hDlg, debugstr_w(d->lpszTitle), + TRACE("WM_INITDIALOG: %p, %s,%s,%d\n", hDlg, debugstr_w(d->lpszTitle), debugstr_w(d->lpszText), d->dwType); SetWindowTextW(hDlg, d->lpszTitle); @@ -205,15 +204,15 @@ static INT_PTR CALLBACK SHDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lP switch (d->dwType) { case 0: - ShowWindow(GetDlgItem(hDlg, IDCANCEL), FALSE); + ShowWindow(GetDlgItem(hDlg, IDCANCEL), SW_HIDE); /* FIXME: Move OK button to position of the Cancel button (cosmetic) */ case 1: - ShowWindow(GetDlgItem(hDlg, IDYES), FALSE); - ShowWindow(GetDlgItem(hDlg, IDNO), FALSE); + ShowWindow(GetDlgItem(hDlg, IDYES), SW_HIDE); + ShowWindow(GetDlgItem(hDlg, IDNO), SW_HIDE); break; default: - ShowWindow(GetDlgItem(hDlg, IDOK), FALSE); - ShowWindow(GetDlgItem(hDlg, IDCANCEL), FALSE); + ShowWindow(GetDlgItem(hDlg, IDOK), SW_HIDE); + ShowWindow(GetDlgItem(hDlg, IDCANCEL), SW_HIDE); break; } return TRUE; diff --git a/reactos/dll/win32/shlwapi/ordinal.c b/reactos/dll/win32/shlwapi/ordinal.c index 001be01cc06..6ebabfaf2e3 100644 --- a/reactos/dll/win32/shlwapi/ordinal.c +++ b/reactos/dll/win32/shlwapi/ordinal.c @@ -17,10 +17,9 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define COM_NO_WINDOWS_H #include "config.h" #include "wine/port.h" @@ -34,99 +33,30 @@ #include "windef.h" #include "winbase.h" -#include "winuser.h" -#include "winnls.h" -#include "objbase.h" -#include "docobj.h" -#include "exdisp.h" -#include "shlguid.h" +#include "winreg.h" #include "wingdi.h" +#include "winuser.h" +#include "winver.h" +#include "winnetwk.h" +#include "mmsystem.h" +#include "objbase.h" +#include "exdisp.h" #include "shlobj.h" +#include "shlwapi.h" #include "shellapi.h" #include "commdlg.h" #include "wine/unicode.h" -#include "winreg.h" #include "wine/debug.h" -#include "shlwapi.h" WINE_DEFAULT_DEBUG_CHANNEL(shell); -/* Get a function pointer from a DLL handle */ -#define GET_FUNC(func, module, name, fail) \ - do { \ - if (!func) { \ - if (!SHLWAPI_h##module && !(SHLWAPI_h##module = LoadLibraryA(#module ".dll"))) return fail; \ - func = (fn##func)GetProcAddress(SHLWAPI_h##module, name); \ - if (!func) return fail; \ - } \ - } while (0) - /* DLL handles for late bound calls */ extern HINSTANCE shlwapi_hInstance; -extern HMODULE SHLWAPI_hshell32; -extern HMODULE SHLWAPI_hwinmm; -extern HMODULE SHLWAPI_hcomdlg32; -extern HMODULE SHLWAPI_hcomctl32; -extern HMODULE SHLWAPI_hmpr; -extern HMODULE SHLWAPI_hurlmon; -extern HMODULE SHLWAPI_hversion; - extern DWORD SHLWAPI_ThreadRef_index; -/* Function pointers for GET_FUNC macro; these need to be global because of gcc bug */ -typedef LPITEMIDLIST (WINAPI *fnpSHBrowseForFolderW)(LPBROWSEINFOW); -static fnpSHBrowseForFolderW pSHBrowseForFolderW; -typedef BOOL (WINAPI *fnpPlaySoundW)(LPCWSTR, HMODULE, DWORD); -static fnpPlaySoundW pPlaySoundW; -typedef DWORD (WINAPI *fnpSHGetFileInfoW)(LPCWSTR,DWORD,SHFILEINFOW*,UINT,UINT); -static fnpSHGetFileInfoW pSHGetFileInfoW; -typedef UINT (WINAPI *fnpDragQueryFileW)(HDROP, UINT, LPWSTR, UINT); -static fnpDragQueryFileW pDragQueryFileW; -typedef BOOL (WINAPI *fnpSHGetPathFromIDListW)(LPCITEMIDLIST, LPWSTR); -static fnpSHGetPathFromIDListW pSHGetPathFromIDListW; -typedef BOOL (WINAPI *fnpShellExecuteExW)(LPSHELLEXECUTEINFOW); -static fnpShellExecuteExW pShellExecuteExW; -typedef HICON (WINAPI *fnpSHFileOperationW)(LPSHFILEOPSTRUCTW); -static fnpSHFileOperationW pSHFileOperationW; -typedef UINT (WINAPI *fnpExtractIconExW)(LPCWSTR, INT,HICON *,HICON *, UINT); -static fnpExtractIconExW pExtractIconExW; -typedef BOOL (WINAPI *fnpSHGetNewLinkInfoW)(LPCWSTR, LPCWSTR, LPCWSTR, BOOL*, UINT); -static fnpSHGetNewLinkInfoW pSHGetNewLinkInfoW; -typedef HRESULT (WINAPI *fnpSHDefExtractIconW)(LPCWSTR, int, UINT, HICON*, HICON*, UINT); -static fnpSHDefExtractIconW pSHDefExtractIconW; -typedef HICON (WINAPI *fnpExtractIconW)(HINSTANCE, LPCWSTR, UINT); -static fnpExtractIconW pExtractIconW; -typedef BOOL (WINAPI *fnpGetSaveFileNameW)(LPOPENFILENAMEW); -static fnpGetSaveFileNameW pGetSaveFileNameW; -typedef DWORD (WINAPI *fnpWNetRestoreConnectionW)(HWND, LPWSTR); -static fnpWNetRestoreConnectionW pWNetRestoreConnectionW; -typedef DWORD (WINAPI *fnpWNetGetLastErrorW)(LPDWORD, LPWSTR, DWORD, LPWSTR, DWORD); -static fnpWNetGetLastErrorW pWNetGetLastErrorW; -typedef BOOL (WINAPI *fnpPageSetupDlgW)(LPPAGESETUPDLGW); -static fnpPageSetupDlgW pPageSetupDlgW; -typedef BOOL (WINAPI *fnpPrintDlgW)(LPPRINTDLGW); -static fnpPrintDlgW pPrintDlgW; -typedef BOOL (WINAPI *fnpGetOpenFileNameW)(LPOPENFILENAMEW); -static fnpGetOpenFileNameW pGetOpenFileNameW; -typedef DWORD (WINAPI *fnpGetFileVersionInfoSizeW)(LPCWSTR,LPDWORD); -static fnpGetFileVersionInfoSizeW pGetFileVersionInfoSizeW; -typedef BOOL (WINAPI *fnpGetFileVersionInfoW)(LPCWSTR,DWORD,DWORD,LPVOID); -static fnpGetFileVersionInfoW pGetFileVersionInfoW; -typedef WORD (WINAPI *fnpVerQueryValueW)(LPVOID,LPCWSTR,LPVOID*,UINT*); -static fnpVerQueryValueW pVerQueryValueW; -typedef BOOL (WINAPI *fnpCOMCTL32_417)(HDC,INT,INT,UINT,const RECT*,LPCWSTR,UINT,const INT*); -static fnpCOMCTL32_417 pCOMCTL32_417; -typedef HRESULT (WINAPI *fnpDllGetVersion)(DLLVERSIONINFO*); -static fnpDllGetVersion pDllGetVersion; -typedef HRESULT (WINAPI *fnpCreateFormatEnumerator)(UINT,FORMATETC*,IEnumFORMATETC**); -static fnpCreateFormatEnumerator pCreateFormatEnumerator; -typedef HRESULT (WINAPI *fnpRegisterFormatEnumerator)(LPBC,IEnumFORMATETC*,DWORD); -static fnpRegisterFormatEnumerator pRegisterFormatEnumerator; - HRESULT WINAPI IUnknown_QueryService(IUnknown*,REFGUID,REFIID,LPVOID*); HRESULT WINAPI SHInvokeCommand(HWND,IShellFolder*,LPCITEMIDLIST,BOOL); -HRESULT WINAPI CLSIDFromStringWrap(LPCWSTR,CLSID*); BOOL WINAPI SHAboutInfoW(LPWSTR,DWORD); /* @@ -153,7 +83,7 @@ HANDLE WINAPI SHLWAPI_DupSharedHandle(HANDLE hShared, DWORD dwDstProcId, DWORD dwMyProcId = GetCurrentProcessId(); HANDLE hRet = NULL; - TRACE("(%p,%ld,%ld,%08lx,%08lx)\n", hShared, dwDstProcId, dwSrcProcId, + TRACE("(%p,%d,%d,%08x,%08x)\n", hShared, dwDstProcId, dwSrcProcId, dwAccess, dwOptions); /* Get dest process handle */ @@ -217,7 +147,7 @@ HANDLE WINAPI SHAllocShared(LPCVOID lpvData, DWORD dwSize, DWORD dwProcId) LPVOID pMapped; HANDLE hRet = NULL; - TRACE("(%p,%ld,%ld)\n", lpvData, dwSize, dwProcId); + TRACE("(%p,%d,%d)\n", lpvData, dwSize, dwProcId); /* Create file mapping of the correct length */ hMap = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, FILE_MAP_READ, 0, @@ -265,7 +195,7 @@ PVOID WINAPI SHLockShared(HANDLE hShared, DWORD dwProcId) HANDLE hDup; LPVOID pMapped; - TRACE("(%p %ld)\n", hShared, dwProcId); + TRACE("(%p %d)\n", hShared, dwProcId); /* Get handle to shared memory for current process */ hDup = SHLWAPI_DupSharedHandle(hShared, dwProcId, GetCurrentProcessId(), @@ -316,7 +246,7 @@ BOOL WINAPI SHFreeShared(HANDLE hShared, DWORD dwProcId) { HANDLE hClose; - TRACE("(%p %ld)\n", hShared, dwProcId); + TRACE("(%p %d)\n", hShared, dwProcId); /* Get a copy of the handle for our process, closing the source handle */ hClose = SHLWAPI_DupSharedHandle(hShared, dwProcId, GetCurrentProcessId(), @@ -374,6 +304,7 @@ HRESULT WINAPI RegisterDefaultAcceptHeaders(LPBC lpBC, IUnknown *lpUnknown) static const WCHAR szProperty[] = { '{','D','0','F','C','A','4','2','0', '-','D','3','F','5','-','1','1','C','F', '-','B','2','1','1','-','0', '0','A','A','0','0','4','A','E','8','3','7','}','\0' }; + BSTR property; IEnumFORMATETC* pIEnumFormatEtc = NULL; VARIANTARG var; HRESULT hRet; @@ -389,7 +320,9 @@ HRESULT WINAPI RegisterDefaultAcceptHeaders(LPBC lpBC, IUnknown *lpUnknown) V_VT(&var) = VT_EMPTY; /* The property we get is the browsers clipboard enumerator */ - hRet = IWebBrowserApp_GetProperty(pBrowser, (BSTR)szProperty, &var); + property = SysAllocString(szProperty); + hRet = IWebBrowserApp_GetProperty(pBrowser, property, &var); + SysFreeString(property); if (FAILED(hRet)) return hRet; @@ -458,8 +391,7 @@ HRESULT WINAPI RegisterDefaultAcceptHeaders(LPBC lpBC, IUnknown *lpUnknown) format->tymed = -1; /* Create a clipboard enumerator */ - GET_FUNC(pCreateFormatEnumerator, urlmon, "CreateFormatEnumerator", E_FAIL); - hRet = pCreateFormatEnumerator(dwNumValues, formatList, &pIEnumFormatEtc); + hRet = CreateFormatEnumerator(dwNumValues, formatList, &pIEnumFormatEtc); if (FAILED(hRet) || !pIEnumFormatEtc) return hRet; @@ -494,8 +426,7 @@ HRESULT WINAPI RegisterDefaultAcceptHeaders(LPBC lpBC, IUnknown *lpUnknown) hRet = IEnumFORMATETC_Clone(pIEnumFormatEtc, &pClone); if (!hRet && pClone) { - GET_FUNC(pRegisterFormatEnumerator, urlmon, "RegisterFormatEnumerator", E_FAIL); - pRegisterFormatEnumerator(lpBC, pClone, 0); + RegisterFormatEnumerator(lpBC, pClone, 0); IEnumFORMATETC_Release(pClone); } @@ -627,7 +558,7 @@ INT WINAPI SHStringFromGUIDA(REFGUID guid, LPSTR lpszDest, INT cchMax) TRACE("(%s,%p,%d)\n", debugstr_guid(guid), lpszDest, cchMax); - sprintf(xguid, "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", + sprintf(xguid, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]); @@ -796,7 +727,7 @@ BOOL WINAPI IsCharXDigitW(WCHAR wc) */ BOOL WINAPI GetStringType3ExW(LPWSTR lpszStr, DWORD dwLen, LPVOID p3) { - FIXME("(%s,0x%08lx,%p): stub\n", debugstr_w(lpszStr), dwLen, p3); + FIXME("(%s,0x%08x,%p): stub\n", debugstr_w(lpszStr), dwLen, p3); return TRUE; } @@ -821,32 +752,6 @@ BOOL WINAPI AppendMenuWrapW(HMENU hMenu, UINT flags, UINT id, LPCWSTR str) return InsertMenuW(hMenu, -1, flags | MF_BITMAP, id, str); } -/************************************************************************* - * @ [SHLWAPI.74] - * - * Get the text from a given dialog item. - * - * PARAMS - * hWnd [I] Handle of dialog - * nItem [I] Index of item - * lpsDest [O] Buffer for receiving window text - * nDestLen [I] Length of buffer. - * - * RETURNS - * Success: The length of the returned text. - * Failure: 0. - */ -INT WINAPI GetDlgItemTextWrapW(HWND hWnd, INT nItem, LPWSTR lpsDest,INT nDestLen) -{ - HWND hItem = GetDlgItem(hWnd, nItem); - - if (hItem) - return GetWindowTextW(hItem, lpsDest, nDestLen); - if (nDestLen) - *lpsDest = (WCHAR)'\0'; - return 0; -} - /************************************************************************* * @ [SHLWAPI.138] * @@ -1000,7 +905,7 @@ BOOL WINAPI SHAboutInfoA(LPSTR lpszDest, DWORD dwDestLen) { WCHAR buff[2084]; - TRACE("(%p,%ld)\n", lpszDest, dwDestLen); + TRACE("(%p,%d)\n", lpszDest, dwDestLen); if (lpszDest && SHAboutInfoW(buff, dwDestLen)) { @@ -1046,7 +951,7 @@ BOOL WINAPI SHAboutInfoW(LPWSTR lpszDest, DWORD dwDestLen) HKEY hReg; DWORD dwType, dwLen; - TRACE("(%p,%ld)\n", lpszDest, dwDestLen); + TRACE("(%p,%d)\n", lpszDest, dwDestLen); if (!lpszDest) return FALSE; @@ -1134,7 +1039,7 @@ HRESULT WINAPI IUnknown_QueryStatus(IUnknown* lpUnknown, REFGUID pguidCmdGroup, { HRESULT hRet = E_FAIL; - TRACE("(%p,%p,%ld,%p,%p)\n",lpUnknown, pguidCmdGroup, cCmds, prgCmds, pCmdText); + TRACE("(%p,%p,%d,%p,%p)\n",lpUnknown, pguidCmdGroup, cCmds, prgCmds, pCmdText); if (lpUnknown) { @@ -1174,7 +1079,7 @@ HRESULT WINAPI IUnknown_Exec(IUnknown* lpUnknown, REFGUID pguidCmdGroup, { HRESULT hRet = E_FAIL; - TRACE("(%p,%p,%ld,%ld,%p,%p)\n",lpUnknown, pguidCmdGroup, nCmdID, + TRACE("(%p,%p,%d,%d,%p,%p)\n",lpUnknown, pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut); if (lpUnknown) @@ -1267,7 +1172,7 @@ HWND WINAPI SHSetParentHwnd(HWND hWnd, HWND hWndParent) * * RETURNS * Success: S_OK. If lppCP is non-NULL, it is filled with the IConnectionPoint - * that was advised. The caller is responsable for releasing it. + * that was advised. The caller is responsible for releasing it. * Failure: E_FAIL, if any arguments are invalid. * E_NOINTERFACE, if lpUnknown isn't an IConnectionPointContainer, * Or an HRESULT error code if any call fails. @@ -1472,7 +1377,7 @@ HRESULT WINAPI IUnknown_SetOwner(IUnknown *pUnk, ULONG arg) }; IMalloc *pUnk2; - TRACE("(%p,%ld)\n", pUnk, arg); + TRACE("(%p,%d)\n", pUnk, arg); /* Note: arg may not be a ULONG and pUnk2 is for sure not an IMalloc - * We use this interface as its vtable entry is compatible with the @@ -1506,21 +1411,21 @@ HRESULT WINAPI IUnknown_SetSite( if (!obj) return E_FAIL; hr = IUnknown_QueryInterface(obj, &IID_IObjectWithSite, (LPVOID *)&iobjwithsite); - TRACE("IID_IObjectWithSite QI ret=%08lx, %p\n", hr, iobjwithsite); + TRACE("IID_IObjectWithSite QI ret=%08x, %p\n", hr, iobjwithsite); if (SUCCEEDED(hr)) { hr = IObjectWithSite_SetSite(iobjwithsite, site); - TRACE("done IObjectWithSite_SetSite ret=%08lx\n", hr); + TRACE("done IObjectWithSite_SetSite ret=%08x\n", hr); IUnknown_Release(iobjwithsite); } else { hr = IUnknown_QueryInterface(obj, &IID_IInternetSecurityManager, (LPVOID *)&isecmgr); - TRACE("IID_IInternetSecurityManager QI ret=%08lx, %p\n", hr, isecmgr); + TRACE("IID_IInternetSecurityManager QI ret=%08x, %p\n", hr, isecmgr); if (FAILED(hr)) return hr; hr = IInternetSecurityManager_SetSecuritySite(isecmgr, (IInternetSecurityMgrSite *)site); - TRACE("done IInternetSecurityManager_SetSecuritySite ret=%08lx\n", hr); + TRACE("done IInternetSecurityManager_SetSecuritySite ret=%08x\n", hr); IUnknown_Release(isecmgr); } return hr; @@ -1679,7 +1584,7 @@ void WINAPI SHPropagateMessage(HWND hWnd, UINT uiMsgId, WPARAM wParam, LPARAM lP { enumWndData data; - TRACE("(%p,%u,%d,%ld,%d)\n", hWnd, uiMsgId, wParam, lParam, bSend); + TRACE("(%p,%u,%ld,%ld,%d)\n", hWnd, uiMsgId, wParam, lParam, bSend); if(hWnd) { @@ -1852,7 +1757,7 @@ HRESULT WINAPI IUnknown_TranslateAcceleratorOCS(IUnknown *lpUnknown, LPMSG lpMsg IOleControlSite* lpCSite = NULL; HRESULT hRet = E_INVALIDARG; - TRACE("(%p,%p,0x%08lx)\n", lpUnknown, lpMsg, dwModifiers); + TRACE("(%p,%p,0x%08x)\n", lpUnknown, lpMsg, dwModifiers); if (lpUnknown) { hRet = IUnknown_QueryInterface(lpUnknown, &IID_IOleControlSite, @@ -1972,7 +1877,7 @@ HMENU WINAPI SHGetMenuFromID(HMENU hMenu, UINT uID) * RETURNS * The color depth of the primary display. */ -DWORD WINAPI SHGetCurColorRes() +DWORD WINAPI SHGetCurColorRes(void) { HDC hdc; DWORD ret; @@ -2162,7 +2067,7 @@ HRESULT WINAPI MayQSForward(IUnknown* lpUnknown, PVOID lpReserved, REFGUID riidCmdGrp, ULONG cCmds, OLECMD *prgCmds, OLECMDTEXT* pCmdText) { - FIXME("(%p,%p,%p,%ld,%p,%p) - stub\n", + FIXME("(%p,%p,%p,%d,%p,%p) - stub\n", lpUnknown, lpReserved, riidCmdGrp, cCmds, prgCmds, pCmdText); /* FIXME: Calls IsQSForward & IUnknown_QueryStatus */ @@ -2177,7 +2082,7 @@ HRESULT WINAPI MayExecForward(IUnknown* lpUnknown, INT iUnk, REFGUID pguidCmdGro DWORD nCmdID, DWORD nCmdexecopt, VARIANT* pvaIn, VARIANT* pvaOut) { - FIXME("(%p,%d,%p,%ld,%ld,%p,%p) - stub!\n", lpUnknown, iUnk, pguidCmdGroup, + FIXME("(%p,%d,%p,%d,%d,%p,%p) - stub!\n", lpUnknown, iUnk, pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut); return DRAGDROP_E_NOTREGISTERED; } @@ -2188,7 +2093,7 @@ HRESULT WINAPI MayExecForward(IUnknown* lpUnknown, INT iUnk, REFGUID pguidCmdGro */ HRESULT WINAPI IsQSForward(REFGUID pguidCmdGroup,ULONG cCmds, OLECMD *prgCmds) { - FIXME("(%p,%ld,%p) - stub!\n", pguidCmdGroup, cCmds, prgCmds); + FIXME("(%p,%d,%p) - stub!\n", pguidCmdGroup, cCmds, prgCmds); return DRAGDROP_E_NOTREGISTERED; } @@ -2240,7 +2145,7 @@ typedef struct BOOL WINAPI FDSA_Initialize(DWORD block_size, DWORD inc, FDSA_info *info, void *mem, DWORD init_blocks) { - TRACE("(0x%08lx 0x%08lx %p %p 0x%08lx)\n", block_size, inc, info, mem, init_blocks); + TRACE("(0x%08x 0x%08x %p %p 0x%08x)\n", block_size, inc, info, mem, init_blocks); if(inc == 0) inc = 1; @@ -2281,9 +2186,9 @@ BOOL WINAPI FDSA_Destroy(FDSA_info *info) * * Insert element into an FDSA array */ -DWORD WINAPI FDSA_InsertItem(FDSA_info *info, DWORD where, void *block) +DWORD WINAPI FDSA_InsertItem(FDSA_info *info, DWORD where, const void *block) { - TRACE("(%p 0x%08lx %p)\n", info, where, block); + TRACE("(%p 0x%08x %p)\n", info, where, block); if(where > info->num_items) where = info->num_items; @@ -2321,7 +2226,7 @@ DWORD WINAPI FDSA_InsertItem(FDSA_info *info, DWORD where, void *block) */ BOOL WINAPI FDSA_DeleteItem(FDSA_info *info, DWORD where) { - TRACE("(%p 0x%08lx)\n", info, where); + TRACE("(%p 0x%08x)\n", info, where); if(where >= info->num_items) return FALSE; @@ -2367,7 +2272,7 @@ HRESULT WINAPI QISearch( if (ppv) { xmove = x; while (xmove->refid) { - TRACE("trying (indx %ld) %s\n", xmove->indx, debugstr_guid(xmove->refid)); + TRACE("trying (indx %d) %s\n", xmove->indx, debugstr_guid(xmove->refid)); if (IsEqualIID(riid, xmove->refid)) { a_vtbl = (IUnknown*)(xmove->indx + (LPBYTE)w); TRACE("matched, returning (%p)\n", a_vtbl); @@ -2390,7 +2295,7 @@ HRESULT WINAPI QISearch( } else ret = E_POINTER; - TRACE("-- 0x%08lx\n", ret); + TRACE("-- 0x%08x\n", ret); return ret; } @@ -2578,11 +2483,11 @@ HRESULT WINAPI IUnknown_GetSite(LPUNKNOWN lpUnknown, REFIID iid, PVOID *lppSite) HWND WINAPI SHCreateWorkerWindowA(LONG wndProc, HWND hWndParent, DWORD dwExStyle, DWORD dwStyle, HMENU hMenu, LONG z) { - static const char* szClass = "WorkerA"; + static const char szClass[] = "WorkerA"; WNDCLASSA wc; HWND hWnd; - TRACE("(0x%08lx,%p,0x%08lx,0x%08lx,%p,0x%08lx)\n", + TRACE("(0x%08x,%p,0x%08x,0x%08x,%p,0x%08x)\n", wndProc, hWndParent, dwExStyle, dwStyle, hMenu, z); /* Create Window class */ @@ -2686,7 +2591,7 @@ DWORD WINAPI SHRestrictionLookup( LPPOLICYDATA polTable, LPDWORD polArr) { - TRACE("(0x%08lx %s %p %p)\n", policy, debugstr_w(initial), polTable, polArr); + TRACE("(0x%08x %s %p %p)\n", policy, debugstr_w(initial), polTable, polArr); if (!polTable || !polArr) return 0; @@ -2704,7 +2609,7 @@ DWORD WINAPI SHRestrictionLookup( } } /* we don't know this policy, return 0 */ - TRACE("unknown policy: (%08lx)\n", policy); + TRACE("unknown policy: (%08x)\n", policy); return 0; } @@ -2737,7 +2642,7 @@ HRESULT WINAPI SHWeakQueryInterface( hret = IUnknown_QueryInterface(pInner, riid, (LPVOID*)ppv); if (SUCCEEDED(hret)) IUnknown_Release(pUnk); } - TRACE("-- 0x%08lx\n", hret); + TRACE("-- 0x%08x\n", hret); return hret; } @@ -2782,7 +2687,7 @@ BOOL WINAPI GUIDFromStringA(LPCSTR idstr, CLSID *id) { WCHAR wClsid[40]; MultiByteToWideChar(CP_ACP, 0, idstr, -1, wClsid, sizeof(wClsid)/sizeof(WCHAR)); - return SUCCEEDED(CLSIDFromStringWrap(wClsid, id)); + return SUCCEEDED(CLSIDFromString(wClsid, id)); } /************************************************************************* @@ -2792,7 +2697,7 @@ BOOL WINAPI GUIDFromStringA(LPCSTR idstr, CLSID *id) */ BOOL WINAPI GUIDFromStringW(LPCWSTR idstr, CLSID *id) { - return SUCCEEDED(CLSIDFromStringWrap(idstr, id)); + return SUCCEEDED(CLSIDFromString((LPOLESTR)idstr, id)); } /************************************************************************* @@ -2813,19 +2718,27 @@ BOOL WINAPI GUIDFromStringW(LPCWSTR idstr, CLSID *id) * either set to TRUE, or removed depending on whether the browser is deemed * to be integrated. */ -DWORD WINAPI WhichPlatform() +DWORD WINAPI WhichPlatform(void) { - static LPCSTR szIntegratedBrowser = "IntegratedBrowser"; + static const char szIntegratedBrowser[] = "IntegratedBrowser"; static DWORD dwState = 0; HKEY hKey; DWORD dwRet, dwData, dwSize; + HMODULE hshell32; if (dwState) return dwState; /* If shell32 exports DllGetVersion(), the browser is integrated */ - GET_FUNC(pDllGetVersion, shell32, "DllGetVersion", 1); - dwState = pDllGetVersion ? 2 : 1; + dwState = 1; + hshell32 = LoadLibraryA("shell32.dll"); + if (hshell32) + { + FARPROC pDllGetVersion; + pDllGetVersion = GetProcAddress(hshell32, "DllGetVersion"); + dwState = pDllGetVersion ? 2 : 1; + FreeLibrary(hshell32); + } /* Set or delete the key accordingly */ dwRet = RegOpenKeyExA(HKEY_LOCAL_MACHINE, @@ -2865,7 +2778,7 @@ HWND WINAPI SHCreateWorkerWindowW(LONG wndProc, HWND hWndParent, DWORD dwExStyle WNDCLASSW wc; HWND hWnd; - TRACE("(0x%08lx,%p,0x%08lx,0x%08lx,%p,0x%08lx)\n", + TRACE("(0x%08x,%p,0x%08x,0x%08x,%p,0x%08x)\n", wndProc, hWndParent, dwExStyle, dwStyle, hMenu, z); /* If our OS is natively ASCII, use the ASCII version */ @@ -2942,18 +2855,62 @@ HRESULT WINAPI SHPackDispParams(LPVOID w, LPVOID x, LPVOID y, LPVOID z) return E_FAIL; } +/************************************************************************* + * SHLWAPI_InvokeByIID + * + * This helper function calls IDispatch::Invoke for each sink + * which implements given iid or IDispatch. + * + */ +static HRESULT SHLWAPI_InvokeByIID( + IConnectionPoint* iCP, + REFIID iid, + DISPID dispId, + DISPPARAMS* dispParams) +{ + IEnumConnections *enumerator; + CONNECTDATA rgcd; + + HRESULT result = IConnectionPoint_EnumConnections(iCP, &enumerator); + if (FAILED(result)) + return result; + + while(IEnumConnections_Next(enumerator, 1, &rgcd, NULL)==S_OK) + { + IDispatch *dispIface; + if (SUCCEEDED(IUnknown_QueryInterface(rgcd.pUnk, iid, (LPVOID*)&dispIface)) || + SUCCEEDED(IUnknown_QueryInterface(rgcd.pUnk, &IID_IDispatch, (LPVOID*)&dispIface))) + { + IDispatch_Invoke(dispIface, dispId, &IID_NULL, 0, DISPATCH_METHOD, dispParams, NULL, NULL, NULL); + IDispatch_Release(dispIface); + } + } + + IEnumConnections_Release(enumerator); + + return S_OK; +} + /************************************************************************* * @ [SHLWAPI.284] * - * _IConnectionPoint_SimpleInvoke + * IConnectionPoint_SimpleInvoke */ -DWORD WINAPI IConnectionPoint_SimpleInvoke( - LPVOID x, - LPVOID y, - LPVOID z) +HRESULT WINAPI IConnectionPoint_SimpleInvoke( + IConnectionPoint* iCP, + DISPID dispId, + DISPPARAMS* dispParams) { - FIXME("(%p %p %p) stub\n",x,y,z); - return 0; + IID iid; + HRESULT result; + + TRACE("(%p)->(0x%x %p)\n",iCP,dispId,dispParams); + + result = IConnectionPoint_GetConnectionInterface(iCP, &iid); + if (SUCCEEDED(result)) + result = SHLWAPI_InvokeByIID(iCP, &iid, dispId, dispParams); + + return result; } /************************************************************************* @@ -2975,7 +2932,7 @@ HRESULT WINAPI IConnectionPoint_OnChanged(IConnectionPoint* lpCP, DISPID dispID) IEnumConnections *lpEnum; HRESULT hRet = E_NOINTERFACE; - TRACE("(%p,0x%8lX)\n", lpCP, dispID); + TRACE("(%p,0x%8X)\n", lpCP, dispID); /* Get an enumerator for the connections */ if (lpCP) @@ -3004,6 +2961,83 @@ HRESULT WINAPI IConnectionPoint_OnChanged(IConnectionPoint* lpCP, DISPID dispID) return hRet; } +/************************************************************************* + * @ [SHLWAPI.286] + * + * IUnknown_CPContainerInvokeParam + */ +HRESULT WINAPIV IUnknown_CPContainerInvokeParam( + IUnknown *container, + REFIID riid, + DISPID dispId, + VARIANTARG* buffer, + DWORD cParams, ...) +{ + HRESULT result; + IConnectionPoint *iCP; + IConnectionPointContainer *iCPC; + + if (!container) + return E_NOINTERFACE; + + result = IUnknown_QueryInterface(container, &IID_IConnectionPointContainer,(LPVOID*) &iCPC); + if (SUCCEEDED(result)) + { + result = IConnectionPointContainer_FindConnectionPoint(iCPC, riid, &iCP); + IConnectionPointContainer_Release(iCPC); + } + + if (SUCCEEDED(result)) + { + ULONG cnt; + VARIANTARG *curvar = buffer+cParams-1; + DISPPARAMS dispParams = {buffer, NULL, cParams, 0}; + va_list valist; + + va_start(valist, cParams); + for(cnt=cParams;cnt>0;cnt--,curvar--) /* backwards for some reason */ + { + enum VARENUM vt = va_arg(valist, enum VARENUM); + memset(curvar, 0, sizeof(*curvar)); + if (vt & VT_BYREF) + { + V_VT(curvar) = vt; + V_BYREF(curvar) = va_arg(valist, LPVOID); + } else + switch(vt) + { + case VT_BSTR: + V_VT(curvar) = vt; + V_BSTR(curvar) = va_arg(valist, BSTR); + break; + case VT_DISPATCH: + V_VT(curvar) = vt; + V_DISPATCH(curvar) = va_arg(valist, IDispatch*); + break; + case VT_BOOL: + V_VT(curvar) = vt; + V_BOOL(curvar) = va_arg(valist, int); + break; + case VT_UNKNOWN: + V_VT(curvar) = vt; + V_UNKNOWN(curvar) = va_arg(valist, IUnknown*); + break; + case VT_I4: + default: + V_VT(curvar) = VT_I4; + V_I4(curvar) = va_arg(valist, LONG); + break; + } + } + va_end(valist); + + result = SHLWAPI_InvokeByIID(iCP, riid, dispId, &dispParams); + IConnectionPoint_Release(iCP); + } + + return result; +} + /************************************************************************* * @ [SHLWAPI.287] * @@ -3023,7 +3057,7 @@ HRESULT WINAPI IUnknown_CPContainerOnChanged(IUnknown *lpUnknown, DISPID dispID) IConnectionPointContainer* lpCPC = NULL; HRESULT hRet = E_NOINTERFACE; - TRACE("(%p,0x%8lX)\n", lpUnknown, dispID); + TRACE("(%p,0x%8X)\n", lpUnknown, dispID); if (lpUnknown) hRet = IUnknown_QueryInterface(lpUnknown, &IID_IConnectionPointContainer, (void**)&lpCPC); @@ -3048,31 +3082,16 @@ HRESULT WINAPI IUnknown_CPContainerOnChanged(IUnknown *lpUnknown, DISPID dispID) */ BOOL WINAPI PlaySoundWrapW(LPCWSTR pszSound, HMODULE hmod, DWORD fdwSound) { - GET_FUNC(pPlaySoundW, winmm, "PlaySoundW", FALSE); - return pPlaySoundW(pszSound, hmod, fdwSound); + return PlaySoundW(pszSound, hmod, fdwSound); } /************************************************************************* * @ [SHLWAPI.294] */ -BOOL WINAPI SHGetIniStringW(LPSTR str1, LPSTR str2, LPSTR pStr, DWORD some_len, LPCSTR lpStr2) +BOOL WINAPI SHGetIniStringW(LPCWSTR str1, LPCWSTR str2, LPWSTR pStr, DWORD some_len, LPCWSTR lpStr2) { - /* - * str1: "I" "I" pushl esp+0x20 - * str2: "U" "I" pushl 0x77c93810 - * (is "I" and "U" "integer" and "unsigned" ??) - * - * pStr: "" "" pushl eax - * some_len: 0x824 0x104 pushl 0x824 - * lpStr2: "%l" "%l" pushl esp+0xc - * - * shlwapi. StrCpyNW(lpStr2, irrelevant_var, 0x104); - * LocalAlloc(0x00, some_len) -> irrelevant_var - * LocalAlloc(0x40, irrelevant_len) -> pStr - * shlwapi.294(str1, str2, pStr, some_len, lpStr2); - * shlwapi.PathRemoveBlanksW(pStr); - */ - FIXME("('%s', '%s', '%s', %08lx, '%s'): stub!\n", str1, str2, pStr, some_len, lpStr2); + FIXME("(%s,%s,%p,%08x,%s): stub!\n", debugstr_w(str1), debugstr_w(str2), + pStr, some_len, debugstr_w(lpStr2)); return TRUE; } @@ -3089,22 +3108,10 @@ BOOL WINAPI SHGetIniStringW(LPSTR str1, LPSTR str2, LPSTR pStr, DWORD some_len, */ BOOL WINAPI SHSetIniStringW(LPWSTR str1, LPVOID x, LPWSTR str2, LPWSTR str3) { - FIXME("('%s', %p, '%s', '%s'), stub.\n", debugstr_w(str1), x, debugstr_w(str2), debugstr_w(str3)); + FIXME("(%s, %p, %s, %s), stub.\n", debugstr_w(str1), x, debugstr_w(str2), debugstr_w(str3)); return TRUE; } -/************************************************************************* - * @ [SHLWAPI.299] - * - * See COMCTL32_417. - */ -BOOL WINAPI ExtTextOutWrapW(HDC hdc, INT x, INT y, UINT flags, const RECT *lprect, - LPCWSTR str, UINT count, const INT *lpDx) -{ - GET_FUNC(pCOMCTL32_417, comctl32, (LPCSTR)417, FALSE); - return pCOMCTL32_417(hdc, x, y, flags, lprect, str, count, lpDx); -} - /************************************************************************* * @ [SHLWAPI.313] * @@ -3113,8 +3120,7 @@ BOOL WINAPI ExtTextOutWrapW(HDC hdc, INT x, INT y, UINT flags, const RECT *lprec DWORD WINAPI SHGetFileInfoWrapW(LPCWSTR path, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags) { - GET_FUNC(pSHGetFileInfoW, shell32, "SHGetFileInfoW", 0); - return pSHGetFileInfoW(path, dwFileAttributes, psfi, sizeofpsfi, flags); + return SHGetFileInfoW(path, dwFileAttributes, psfi, sizeofpsfi, flags); } /************************************************************************* @@ -3124,8 +3130,7 @@ DWORD WINAPI SHGetFileInfoWrapW(LPCWSTR path, DWORD dwFileAttributes, */ UINT WINAPI DragQueryFileWrapW(HDROP hDrop, UINT lFile, LPWSTR lpszFile, UINT lLength) { - GET_FUNC(pDragQueryFileW, shell32, "DragQueryFileW", 0); - return pDragQueryFileW(hDrop, lFile, lpszFile, lLength); + return DragQueryFileW(hDrop, lFile, lpszFile, lLength); } /************************************************************************* @@ -3135,8 +3140,7 @@ UINT WINAPI DragQueryFileWrapW(HDROP hDrop, UINT lFile, LPWSTR lpszFile, UINT lL */ LPITEMIDLIST WINAPI SHBrowseForFolderWrapW(LPBROWSEINFOW lpBi) { - GET_FUNC(pSHBrowseForFolderW, shell32, "SHBrowseForFolderW", NULL); - return pSHBrowseForFolderW(lpBi); + return SHBrowseForFolderW(lpBi); } /************************************************************************* @@ -3146,8 +3150,7 @@ LPITEMIDLIST WINAPI SHBrowseForFolderWrapW(LPBROWSEINFOW lpBi) */ BOOL WINAPI SHGetPathFromIDListWrapW(LPCITEMIDLIST pidl,LPWSTR pszPath) { - GET_FUNC(pSHGetPathFromIDListW, shell32, "SHGetPathFromIDListW", 0); - return pSHGetPathFromIDListW(pidl, pszPath); + return SHGetPathFromIDListW(pidl, pszPath); } /************************************************************************* @@ -3157,8 +3160,7 @@ BOOL WINAPI SHGetPathFromIDListWrapW(LPCITEMIDLIST pidl,LPWSTR pszPath) */ BOOL WINAPI ShellExecuteExWrapW(LPSHELLEXECUTEINFOW lpExecInfo) { - GET_FUNC(pShellExecuteExW, shell32, "ShellExecuteExW", FALSE); - return pShellExecuteExW(lpExecInfo); + return ShellExecuteExW(lpExecInfo); } /************************************************************************* @@ -3166,31 +3168,18 @@ BOOL WINAPI ShellExecuteExWrapW(LPSHELLEXECUTEINFOW lpExecInfo) * * See SHFileOperationW. */ -HICON WINAPI SHFileOperationWrapW(LPSHFILEOPSTRUCTW lpFileOp) +INT WINAPI SHFileOperationWrapW(LPSHFILEOPSTRUCTW lpFileOp) { - GET_FUNC(pSHFileOperationW, shell32, "SHFileOperationW", 0); - return pSHFileOperationW(lpFileOp); -} - -/************************************************************************* - * @ [SHLWAPI.337] - * - * See ExtractIconExW. - */ -UINT WINAPI ExtractIconExWrapW(LPCWSTR lpszFile, INT nIconIndex, HICON *phiconLarge, - HICON *phiconSmall, UINT nIcons) -{ - GET_FUNC(pExtractIconExW, shell32, "ExtractIconExW", 0); - return pExtractIconExW(lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons); + return SHFileOperationW(lpFileOp); } /************************************************************************* * @ [SHLWAPI.342] * */ -LONG WINAPI SHInterlockedCompareExchange( PLONG dest, LONG xchg, LONG compare) +PVOID WINAPI SHInterlockedCompareExchange( PVOID *dest, PVOID xchg, PVOID compare ) { - return InterlockedCompareExchange(dest, xchg, compare); + return InterlockedCompareExchangePointer( dest, xchg, compare ); } /************************************************************************* @@ -3198,15 +3187,9 @@ LONG WINAPI SHInterlockedCompareExchange( PLONG dest, LONG xchg, LONG compare) * * See GetFileVersionInfoSizeW. */ -DWORD WINAPI GetFileVersionInfoSizeWrapW( - LPWSTR x, - LPVOID y) +DWORD WINAPI GetFileVersionInfoSizeWrapW( LPCWSTR filename, LPDWORD handle ) { - DWORD ret; - - GET_FUNC(pGetFileVersionInfoSizeW, version, "GetFileVersionInfoSizeW", 0); - ret = pGetFileVersionInfoSizeW(x, y); - return 0x208 + ret; + return GetFileVersionInfoSizeW( filename, handle ); } /************************************************************************* @@ -3214,14 +3197,10 @@ DWORD WINAPI GetFileVersionInfoSizeWrapW( * * See GetFileVersionInfoW. */ -BOOL WINAPI GetFileVersionInfoWrapW( - LPWSTR w, /* [in] path to dll */ - DWORD x, /* [in] parm 2 to GetFileVersionInfoA */ - DWORD y, /* [in] return value from SHLWAPI_350() - assume length */ - LPVOID z) /* [in/out] buffer (+0x208 sent to GetFileVersionInfoA()) */ +BOOL WINAPI GetFileVersionInfoWrapW( LPCWSTR filename, DWORD handle, + DWORD datasize, LPVOID data ) { - GET_FUNC(pGetFileVersionInfoW, version, "GetFileVersionInfoW", 0); - return pGetFileVersionInfoW(w, x, y-0x208, (char*)z+0x208); + return GetFileVersionInfoW( filename, handle, datasize, data ); } /************************************************************************* @@ -3229,14 +3208,10 @@ BOOL WINAPI GetFileVersionInfoWrapW( * * See VerQueryValueW. */ -WORD WINAPI VerQueryValueWrapW( - LPVOID w, /* [in] Buffer from SHLWAPI_351() */ - LPWSTR x, /* [in] Value to retrieve - converted and passed to VerQueryValueA() as #2 */ - LPVOID y, /* [out] Ver buffer - passed to VerQueryValueA as #3 */ - UINT* z) /* [in] Ver length - passed to VerQueryValueA as #4 */ +WORD WINAPI VerQueryValueWrapW( LPVOID pBlock, LPCWSTR lpSubBlock, + LPVOID *lplpBuffer, UINT *puLen ) { - GET_FUNC(pVerQueryValueW, version, "VerQueryValueW", 0); - return pVerQueryValueW((char*)w+0x208, x, y, z); + return VerQueryValueW( pBlock, lpSubBlock, lplpBuffer, puLen ); } #define IsIface(type) SUCCEEDED((hRet = IUnknown_QueryInterface(lpUnknown, &IID_##type, (void**)&lpObj))) @@ -3300,8 +3275,7 @@ HRESULT WINAPI IUnknown_EnableModeless(IUnknown *lpUnknown, BOOL bModeless) BOOL WINAPI SHGetNewLinkInfoWrapW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName, BOOL *pfMustCopy, UINT uFlags) { - GET_FUNC(pSHGetNewLinkInfoW, shell32, "SHGetNewLinkInfoW", FALSE); - return pSHGetNewLinkInfoW(pszLinkTo, pszDir, pszName, pfMustCopy, uFlags); + return SHGetNewLinkInfoW(pszLinkTo, pszDir, pszName, pfMustCopy, uFlags); } /************************************************************************* @@ -3312,8 +3286,7 @@ BOOL WINAPI SHGetNewLinkInfoWrapW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszN UINT WINAPI SHDefExtractIconWrapW(LPCWSTR pszIconFile, int iIndex, UINT uFlags, HICON* phiconLarge, HICON* phiconSmall, UINT nIconSize) { - GET_FUNC(pSHDefExtractIconW, shell32, "SHDefExtractIconW", 0); - return pSHDefExtractIconW(pszIconFile, iIndex, uFlags, phiconLarge, phiconSmall, nIconSize); + return SHDefExtractIconW(pszIconFile, iIndex, uFlags, phiconLarge, phiconSmall, nIconSize); } /************************************************************************* @@ -3389,20 +3362,7 @@ HRESULT WINAPI SHInvokeCommand(HWND hWnd, IShellFolder* lpFolder, LPCITEMIDLIST HICON WINAPI ExtractIconWrapW(HINSTANCE hInstance, LPCWSTR lpszExeFileName, UINT nIconIndex) { - GET_FUNC(pExtractIconW, shell32, "ExtractIconW", NULL); - return pExtractIconW(hInstance, lpszExeFileName, nIconIndex); -} - -/************************************************************************* - * @ [SHLWAPI.376] - */ -LANGID WINAPI MLGetUILanguage() -{ - FIXME("() stub\n"); - /* FIXME: This should be a forward in the .spec file to the win2k function - * kernel32.GetUserDefaultUILanguage, however that function isn't there yet. - */ - return GetUserDefaultLangID(); + return ExtractIconW(hInstance, lpszExeFileName, nIconIndex); } /************************************************************************* @@ -3411,15 +3371,15 @@ LANGID WINAPI MLGetUILanguage() * Load a library from the directory of a particular process. * * PARAMS - * new_mod [I] Library name - * inst_hwnd [I] Module whose directory is to be used - * dwFlags [I] Flags controlling the load + * new_mod [I] Library name + * inst_hwnd [I] Module whose directory is to be used + * dwCrossCodePage [I] Should be FALSE (currently ignored) * * RETURNS * Success: A handle to the loaded module * Failure: A NULL handle. */ -HMODULE WINAPI MLLoadLibraryA(LPCSTR new_mod, HMODULE inst_hwnd, BOOL bCrossCodePage) +HMODULE WINAPI MLLoadLibraryA(LPCSTR new_mod, HMODULE inst_hwnd, DWORD dwCrossCodePage) { /* FIXME: Native appears to do DPA_Create and a DPA_InsertPtr for * each call here. @@ -3443,7 +3403,7 @@ HMODULE WINAPI MLLoadLibraryA(LPCSTR new_mod, HMODULE inst_hwnd, BOOL bCrossCode LPSTR ptr; DWORD len; - FIXME("(%s,%p,0x%08lx) semi-stub!\n", debugstr_a(new_mod), inst_hwnd, bCrossCodePage); + FIXME("(%s,%p,%d) semi-stub!\n", debugstr_a(new_mod), inst_hwnd, dwCrossCodePage); len = GetModuleFileNameA(inst_hwnd, mod_path, sizeof(mod_path)); if (!len || len >= sizeof(mod_path)) return NULL; @@ -3461,13 +3421,13 @@ HMODULE WINAPI MLLoadLibraryA(LPCSTR new_mod, HMODULE inst_hwnd, BOOL bCrossCode * * Unicode version of MLLoadLibraryA. */ -HMODULE WINAPI MLLoadLibraryW(LPCWSTR new_mod, HMODULE inst_hwnd, BOOL bCrossCodePage) +HMODULE WINAPI MLLoadLibraryW(LPCWSTR new_mod, HMODULE inst_hwnd, DWORD dwCrossCodePage) { WCHAR mod_path[2*MAX_PATH]; LPWSTR ptr; DWORD len; - FIXME("(%s,%p,0x%08lx) semi-stub!\n", debugstr_w(new_mod), inst_hwnd, bCrossCodePage); + FIXME("(%s,%p,%d) semi-stub!\n", debugstr_w(new_mod), inst_hwnd, dwCrossCodePage); len = GetModuleFileNameW(inst_hwnd, mod_path, sizeof(mod_path) / sizeof(WCHAR)); if (!len || len >= sizeof(mod_path) / sizeof(WCHAR)) return NULL; @@ -3495,7 +3455,7 @@ HMODULE WINAPI MLLoadLibraryW(LPCWSTR new_mod, HMODULE inst_hwnd, BOOL bCrossCod */ COLORREF WINAPI ColorAdjustLuma(COLORREF cRGB, int dwLuma, BOOL bUnknown) { - TRACE("(0x%8lx,%d,%d)\n", cRGB, dwLuma, bUnknown); + TRACE("(0x%8x,%d,%d)\n", cRGB, dwLuma, bUnknown); if (dwLuma) { @@ -3519,8 +3479,7 @@ COLORREF WINAPI ColorAdjustLuma(COLORREF cRGB, int dwLuma, BOOL bUnknown) */ BOOL WINAPI GetSaveFileNameWrapW(LPOPENFILENAMEW ofn) { - GET_FUNC(pGetSaveFileNameW, comdlg32, "GetSaveFileNameW", FALSE); - return pGetSaveFileNameW(ofn); + return GetSaveFileNameW(ofn); } /************************************************************************* @@ -3530,8 +3489,7 @@ BOOL WINAPI GetSaveFileNameWrapW(LPOPENFILENAMEW ofn) */ DWORD WINAPI WNetRestoreConnectionWrapW(HWND hwndOwner, LPWSTR lpszDevice) { - GET_FUNC(pWNetRestoreConnectionW, mpr, "WNetRestoreConnectionW", 0); - return pWNetRestoreConnectionW(hwndOwner, lpszDevice); + return WNetRestoreConnectionW(hwndOwner, lpszDevice); } /************************************************************************* @@ -3542,8 +3500,7 @@ DWORD WINAPI WNetRestoreConnectionWrapW(HWND hwndOwner, LPWSTR lpszDevice) DWORD WINAPI WNetGetLastErrorWrapW(LPDWORD lpError, LPWSTR lpErrorBuf, DWORD nErrorBufSize, LPWSTR lpNameBuf, DWORD nNameBufSize) { - GET_FUNC(pWNetGetLastErrorW, mpr, "WNetGetLastErrorW", 0); - return pWNetGetLastErrorW(lpError, lpErrorBuf, nErrorBufSize, lpNameBuf, nNameBufSize); + return WNetGetLastErrorW(lpError, lpErrorBuf, nErrorBufSize, lpNameBuf, nNameBufSize); } /************************************************************************* @@ -3553,8 +3510,7 @@ DWORD WINAPI WNetGetLastErrorWrapW(LPDWORD lpError, LPWSTR lpErrorBuf, DWORD nEr */ BOOL WINAPI PageSetupDlgWrapW(LPPAGESETUPDLGW pagedlg) { - GET_FUNC(pPageSetupDlgW, comdlg32, "PageSetupDlgW", FALSE); - return pPageSetupDlgW(pagedlg); + return PageSetupDlgW(pagedlg); } /************************************************************************* @@ -3564,8 +3520,7 @@ BOOL WINAPI PageSetupDlgWrapW(LPPAGESETUPDLGW pagedlg) */ BOOL WINAPI PrintDlgWrapW(LPPRINTDLGW printdlg) { - GET_FUNC(pPrintDlgW, comdlg32, "PrintDlgW", FALSE); - return pPrintDlgW(printdlg); + return PrintDlgW(printdlg); } /************************************************************************* @@ -3575,8 +3530,7 @@ BOOL WINAPI PrintDlgWrapW(LPPRINTDLGW printdlg) */ BOOL WINAPI GetOpenFileNameWrapW(LPOPENFILENAMEW ofn) { - GET_FUNC(pGetOpenFileNameW, comdlg32, "GetOpenFileNameW", FALSE); - return pGetOpenFileNameW(ofn); + return GetOpenFileNameW(ofn); } /************************************************************************* @@ -3680,7 +3634,7 @@ DWORD WINAPI SHGetMachineInfo(DWORD dwFlags) { HW_PROFILE_INFOA hwInfo; - TRACE("(0x%08lx)\n", dwFlags); + TRACE("(0x%08x)\n", dwFlags); GetCurrentHwProfileA(&hwInfo); switch (hwInfo.dwDockInfo & (DOCKINFO_DOCKED|DOCKINFO_UNDOCKED)) @@ -3756,7 +3710,7 @@ DWORD WINAPI MLSetMLHInstance(HINSTANCE hInst, HANDLE hHeap) */ DWORD WINAPI MLClearMLHInstance(DWORD x) { - FIXME("(0x%08lx)stub\n", x); + FIXME("(0x%08x)stub\n", x); return 0xabba1247; } @@ -3771,99 +3725,10 @@ DWORD WINAPI MLClearMLHInstance(DWORD x) * * RETURNS * S_OK on success or E_INVALIDARG on failure - * - * NOTES - * This is really CLSIDFromString() which is exported by ole32.dll, - * however the native shlwapi.dll does *not* import ole32. Nor does - * ole32.dll import this ordinal from shlwapi. Therefore we must conclude - * that MS duplicated the code for CLSIDFromString(), and yes they did, only - * it returns an E_INVALIDARG error code on failure. - * This is a duplicate (with changes for Unicode) of CLSIDFromString16() - * in "dlls/ole32/compobj.c". */ HRESULT WINAPI CLSIDFromStringWrap(LPCWSTR idstr, CLSID *id) { - LPCWSTR s = idstr; - BYTE *p; - INT i; - WCHAR table[256]; - - if (!s) { - memset(id, 0, sizeof(CLSID)); - return S_OK; - } - else { /* validate the CLSID string */ - - if (strlenW(s) != 38) - return E_INVALIDARG; - - if ((s[0]!=L'{') || (s[9]!=L'-') || (s[14]!=L'-') || (s[19]!=L'-') || (s[24]!=L'-') || (s[37]!=L'}')) - return E_INVALIDARG; - - for (i=1; i<37; i++) - { - if ((i == 9)||(i == 14)||(i == 19)||(i == 24)) - continue; - if (!(((s[i] >= L'0') && (s[i] <= L'9')) || - ((s[i] >= L'a') && (s[i] <= L'f')) || - ((s[i] >= L'A') && (s[i] <= L'F'))) - ) - return E_INVALIDARG; - } - } - - TRACE("%s -> %p\n", debugstr_w(s), id); - - /* quick lookup table */ - memset(table, 0, 256*sizeof(WCHAR)); - - for (i = 0; i < 10; i++) { - table['0' + i] = i; - } - for (i = 0; i < 6; i++) { - table['A' + i] = i+10; - table['a' + i] = i+10; - } - - /* in form {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} */ - - p = (BYTE *) id; - - s++; /* skip leading brace */ - for (i = 0; i < 4; i++) { - p[3 - i] = table[*s]<<4 | table[*(s+1)]; - s += 2; - } - p += 4; - s++; /* skip - */ - - for (i = 0; i < 2; i++) { - p[1-i] = table[*s]<<4 | table[*(s+1)]; - s += 2; - } - p += 2; - s++; /* skip - */ - - for (i = 0; i < 2; i++) { - p[1-i] = table[*s]<<4 | table[*(s+1)]; - s += 2; - } - p += 2; - s++; /* skip - */ - - /* these are just sequential bytes */ - for (i = 0; i < 2; i++) { - *p++ = table[*s]<<4 | table[*(s+1)]; - s += 2; - } - s++; /* skip - */ - - for (i = 0; i < 6; i++) { - *p++ = table[*s]<<4 | table[*(s+1)]; - s += 2; - } - - return S_OK; + return CLSIDFromString((LPOLESTR)idstr, id); } /************************************************************************* @@ -3885,7 +3750,7 @@ BOOL WINAPI IsOS(DWORD feature) osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA); if(!GetVersionExA(&osvi)) { - ERR("GetVersionEx failed"); + ERR("GetVersionEx failed\n"); return FALSE; } @@ -3894,7 +3759,7 @@ BOOL WINAPI IsOS(DWORD feature) platform = osvi.dwPlatformId; #define ISOS_RETURN(x) \ - TRACE("(0x%lx) ret=%d\n",feature,(x)); \ + TRACE("(0x%x) ret=%d\n",feature,(x)); \ return (x); switch(feature) { @@ -3987,7 +3852,7 @@ BOOL WINAPI IsOS(DWORD feature) #undef ISOS_RETURN - WARN("(0x%lx) unknown parameter\n",feature); + WARN("(0x%x) unknown parameter\n",feature); return FALSE; } @@ -4093,7 +3958,7 @@ VOID WINAPI ColorRGBToHLS(COLORREF cRGB, LPWORD pwHue, { int wR, wG, wB, wMax, wMin, wHue, wLuminosity, wSaturation; - TRACE("(%08lx,%p,%p,%p)\n", cRGB, pwHue, pwLuminance, pwSaturation); + TRACE("(%08x,%p,%p,%p)\n", cRGB, pwHue, pwLuminance, pwSaturation); wR = GetRValue(cRGB); wG = GetGValue(cRGB); @@ -4185,7 +4050,7 @@ HRESULT WINAPI SHGetInverseCMAP(LPDWORD dest, DWORD dwSize) *dest = (DWORD)0xabba1249; return 0; } - FIXME("(%p, %#lx) stub\n", dest, dwSize); + FIXME("(%p, %#x) stub\n", dest, dwSize); return 0; } @@ -4203,7 +4068,7 @@ HRESULT WINAPI SHGetInverseCMAP(LPDWORD dest, DWORD dwSize) */ BOOL WINAPI SHIsLowMemoryMachine (DWORD x) { - FIXME("(0x%08lx) stub\n", x); + FIXME("(0x%08x) stub\n", x); return FALSE; } @@ -4266,7 +4131,7 @@ VOID WINAPI FixSlashesAndColonW(LPWSTR lpwstr) */ DWORD WINAPI SHGetAppCompatFlags(DWORD dwUnknown) { - FIXME("(0x%08lx) stub\n", dwUnknown); + FIXME("(0x%08x) stub\n", dwUnknown); return 0; } @@ -4296,7 +4161,7 @@ HRESULT WINAPI SHCoCreateInstanceAC(REFCLSID rclsid, LPUNKNOWN pUnkOuter, */ BOOL WINAPI SHSkipJunction(IBindCtx *pbc, const CLSID *pclsid) { - static const WCHAR szSkipBinding[] = { 'S','k','i','p',' ', + static WCHAR szSkipBinding[] = { 'S','k','i','p',' ', 'B','i','n','d','i','n','g',' ','C','L','S','I','D','\0' }; BOOL bRet = FALSE; @@ -4323,17 +4188,50 @@ BOOL WINAPI SHSkipJunction(IBindCtx *pbc, const CLSID *pclsid) */ DWORD WINAPI SHGetShellKey(DWORD a, DWORD b, DWORD c) { - FIXME("(%lx, %lx, %lx): stub\n", a, b, c); + FIXME("(%x, %x, %x): stub\n", a, b, c); return 0x50; } /*********************************************************************** * SHQueueUserWorkItem (SHLWAPI.@) */ -HRESULT WINAPI SHQueueUserWorkItem(DWORD a, DWORD b, DWORD c, DWORD d, DWORD e, DWORD f, DWORD g) +BOOL WINAPI SHQueueUserWorkItem(LPTHREAD_START_ROUTINE pfnCallback, + LPVOID pContext, LONG lPriority, DWORD_PTR dwTag, + DWORD_PTR *pdwId, LPCSTR pszModule, DWORD dwFlags) { - FIXME("(%lx, %lx, %lx, %lx, %lx, %lx, %lx): stub\n", a, b, c, d, e, f, g); - return E_FAIL; + TRACE("(%p, %p, %d, %lx, %p, %s, %08x)\n", pfnCallback, pContext, + lPriority, dwTag, pdwId, debugstr_a(pszModule), dwFlags); + + if(lPriority || dwTag || pdwId || pszModule || dwFlags) + FIXME("Unsupported arguments\n"); + + return QueueUserWorkItem(pfnCallback, pContext, 0); +} + +/*********************************************************************** + * SHSetTimerQueueTimer (SHLWAPI.263) + */ +HANDLE WINAPI SHSetTimerQueueTimer(HANDLE hQueue, + WAITORTIMERCALLBACK pfnCallback, LPVOID pContext, DWORD dwDueTime, + DWORD dwPeriod, LPCSTR lpszLibrary, DWORD dwFlags) +{ + HANDLE hNewTimer; + + /* SHSetTimerQueueTimer flags -> CreateTimerQueueTimer flags */ + if (dwFlags & TPS_LONGEXECTIME) { + dwFlags &= ~TPS_LONGEXECTIME; + dwFlags |= WT_EXECUTELONGFUNCTION; + } + if (dwFlags & TPS_EXECUTEIO) { + dwFlags &= ~TPS_EXECUTEIO; + dwFlags |= WT_EXECUTEINIOTHREAD; + } + + if (!CreateTimerQueueTimer(&hNewTimer, hQueue, pfnCallback, pContext, + dwDueTime, dwPeriod, dwFlags)) + return NULL; + + return hNewTimer; } /*********************************************************************** @@ -4364,7 +4262,7 @@ HRESULT WINAPI IUnknown_OnFocusChangeIS(LPUNKNOWN lpUnknown, LPUNKNOWN pFocusObj */ HRESULT WINAPI SKGetValueW(DWORD a, LPWSTR b, LPWSTR c, DWORD d, DWORD e, DWORD f) { - FIXME("(%lx, %s, %s, %lx, %lx, %lx): stub\n", a, debugstr_w(b), debugstr_w(c), d, e, f); + FIXME("(%x, %s, %s, %x, %x, %x): stub\n", a, debugstr_w(b), debugstr_w(c), d, e, f); return E_FAIL; } @@ -4395,3 +4293,204 @@ DWORD WINAPI GetUIVersion(void) } return version; } + +/*********************************************************************** + * ShellMessageBoxWrapW [SHLWAPI.388] + * + * loads a string resource for a module, displays the string in a + * message box and writes it into the logfile + * + * PARAMS + * mod [I] the module containing the string resource + * unknown1 [I] FIXME + * uId [I] the id of the string resource + * title [I] the title of the message box + * unknown2 [I] FIXME + * filename [I] name of the logfile + * + * RETURNS + * FIXME + */ +BOOL WINAPI ShellMessageBoxWrapW(HMODULE mod, DWORD unknown1, UINT uId, + LPCWSTR title, DWORD unknown2, LPCWSTR filename) +{ + FIXME("%p %x %d %s %x %s\n", + mod, unknown1, uId, debugstr_w(title), unknown2, debugstr_w(filename)); + return TRUE; +} + +HRESULT WINAPI IUnknown_QueryServiceExec(IUnknown *unk, REFIID service, REFIID clsid, + DWORD x1, DWORD x2, DWORD x3, void **ppvOut) +{ + FIXME("%p %s %s %08x %08x %08x %p\n", unk, + debugstr_guid(service), debugstr_guid(clsid), x1, x2, x3, ppvOut); + return E_NOTIMPL; +} + +HRESULT WINAPI IUnknown_ProfferService(IUnknown *unk, void *x0, void *x1, void *x2) +{ + FIXME("%p %p %p %p\n", unk, x0, x1, x2); + return E_NOTIMPL; +} + +/*********************************************************************** + * ZoneComputePaneSize [SHLWAPI.382] + */ +UINT WINAPI ZoneComputePaneSize(HWND hwnd) +{ + FIXME("\n"); + return 0x95; +} + +void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2) +{ + SHChangeNotify(wEventId, uFlags, dwItem1, dwItem2); +} + +typedef struct SHELL_USER_SID { /* according to MSDN this should be in shlobj.h... */ + SID_IDENTIFIER_AUTHORITY sidAuthority; + DWORD dwUserGroupID; + DWORD dwUserID; +} SHELL_USER_SID, *PSHELL_USER_SID; + +typedef struct SHELL_USER_PERMISSION { /* ...and this should be in shlwapi.h */ + SHELL_USER_SID susID; + DWORD dwAccessType; + BOOL fInherit; + DWORD dwAccessMask; + DWORD dwInheritMask; + DWORD dwInheritAccessMask; +} SHELL_USER_PERMISSION, *PSHELL_USER_PERMISSION; + +/*********************************************************************** + * GetShellSecurityDescriptor [SHLWAPI.475] + * + * prepares SECURITY_DESCRIPTOR from a set of ACEs + * + * PARAMS + * apUserPerm [I] array of pointers to SHELL_USER_PERMISSION structures, + * each of which describes permissions to apply + * cUserPerm [I] number of entries in apUserPerm array + * + * RETURNS + * success: pointer to SECURITY_DESCRIPTOR + * failure: NULL + * + * NOTES + * Call should free returned descriptor with LocalFree + */ +PSECURITY_DESCRIPTOR WINAPI GetShellSecurityDescriptor(PSHELL_USER_PERMISSION *apUserPerm, int cUserPerm) +{ + PSID *sidlist; + PSID cur_user = NULL; + BYTE tuUser[2000]; + DWORD acl_size; + int sid_count, i; + PSECURITY_DESCRIPTOR psd = NULL; + + TRACE("%p %d\n", apUserPerm, cUserPerm); + + if (apUserPerm == NULL || cUserPerm <= 0) + return NULL; + + sidlist = HeapAlloc(GetProcessHeap(), 0, cUserPerm * sizeof(PSID)); + if (!sidlist) + return NULL; + + acl_size = sizeof(ACL); + + for(sid_count = 0; sid_count < cUserPerm; sid_count++) + { + static SHELL_USER_SID null_sid = {{SECURITY_NULL_SID_AUTHORITY}, 0, 0}; + PSHELL_USER_PERMISSION perm = apUserPerm[sid_count]; + PSHELL_USER_SID sid = &perm->susID; + PSID pSid; + BOOL ret = TRUE; + + if (!memcmp((void*)sid, (void*)&null_sid, sizeof(SHELL_USER_SID))) + { /* current user's SID */ + if (!cur_user) + { + HANDLE Token; + DWORD bufsize = sizeof(tuUser); + + ret = OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &Token); + if (ret) + { + ret = GetTokenInformation(Token, TokenUser, (void*)tuUser, bufsize, &bufsize ); + if (ret) + cur_user = ((PTOKEN_USER)&tuUser)->User.Sid; + CloseHandle(Token); + } + } + pSid = cur_user; + } else if (sid->dwUserID==0) /* one sub-authority */ + ret = AllocateAndInitializeSid(&sid->sidAuthority, 1, sid->dwUserGroupID, 0, + 0, 0, 0, 0, 0, 0, &pSid); + else + ret = AllocateAndInitializeSid(&sid->sidAuthority, 2, sid->dwUserGroupID, sid->dwUserID, + 0, 0, 0, 0, 0, 0, &pSid); + if (!ret) + goto free_sids; + + sidlist[sid_count] = pSid; + /* increment acl_size (1 ACE for non-inheritable and 2 ACEs for inheritable records */ + acl_size += (sizeof(ACCESS_ALLOWED_ACE)-sizeof(DWORD) + GetLengthSid(pSid)) * (perm->fInherit ? 2 : 1); + } + + psd = LocalAlloc(0, sizeof(SECURITY_DESCRIPTOR) + acl_size); + + if (psd != NULL) + { + PACL pAcl = (PACL)(((BYTE*)psd)+sizeof(SECURITY_DESCRIPTOR)); + + if (!InitializeSecurityDescriptor(psd, SECURITY_DESCRIPTOR_REVISION)) + goto error; + + if (!InitializeAcl(pAcl, acl_size, ACL_REVISION)) + goto error; + + for(i = 0; i < sid_count; i++) + { + PSHELL_USER_PERMISSION sup = apUserPerm[i]; + PSID sid = sidlist[i]; + + switch(sup->dwAccessType) + { + case ACCESS_ALLOWED_ACE_TYPE: + if (!AddAccessAllowedAce(pAcl, ACL_REVISION, sup->dwAccessMask, sid)) + goto error; + if (sup->fInherit && !AddAccessAllowedAceEx(pAcl, ACL_REVISION, + (BYTE)sup->dwInheritMask, sup->dwInheritAccessMask, sid)) + goto error; + break; + case ACCESS_DENIED_ACE_TYPE: + if (!AddAccessDeniedAce(pAcl, ACL_REVISION, sup->dwAccessMask, sid)) + goto error; + if (sup->fInherit && !AddAccessDeniedAceEx(pAcl, ACL_REVISION, + (BYTE)sup->dwInheritMask, sup->dwInheritAccessMask, sid)) + goto error; + break; + default: + goto error; + } + } + + if (!SetSecurityDescriptorDacl(psd, TRUE, pAcl, FALSE)) + goto error; + } + goto free_sids; + +error: + LocalFree(psd); + psd = NULL; +free_sids: + for(i = 0; i < sid_count; i++) + { + if (!cur_user || sidlist[i] != cur_user) + FreeSid(sidlist[i]); + } + HeapFree(GetProcessHeap(), 0, sidlist); + + return psd; +} diff --git a/reactos/dll/win32/shlwapi/path.c b/reactos/dll/win32/shlwapi/path.c index 93c7fe8a135..b2005c1e787 100644 --- a/reactos/dll/win32/shlwapi/path.c +++ b/reactos/dll/win32/shlwapi/path.c @@ -16,7 +16,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include "config.h" @@ -50,7 +50,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); } while (0) /* DLL handles for late bound calls */ -extern HMODULE SHLWAPI_hshell32; +static HMODULE SHLWAPI_hshell32; /* Function pointers for GET_FUNC macro; these need to be global because of gcc bug */ typedef BOOL (WINAPI *fnpIsNetDrive)(int); @@ -131,23 +131,31 @@ BOOL WINAPI PathAppendW(LPWSTR lpszPath, LPCWSTR lpszAppend) */ LPSTR WINAPI PathCombineA(LPSTR lpszDest, LPCSTR lpszDir, LPCSTR lpszFile) { + WCHAR szDest[MAX_PATH]; + WCHAR szDir[MAX_PATH]; + WCHAR szFile[MAX_PATH]; TRACE("(%p,%s,%s)\n", lpszDest, debugstr_a(lpszDir), debugstr_a(lpszFile)); - if (!lpszDest || (!lpszDir && !lpszFile)) - return NULL; /* Invalid parameters */ - else + /* Invalid parameters */ + if (!lpszDest) + return NULL; + if (!lpszDir && !lpszFile) { - WCHAR szDest[MAX_PATH]; - WCHAR szDir[MAX_PATH]; - WCHAR szFile[MAX_PATH]; - if (lpszDir) - MultiByteToWideChar(CP_ACP,0,lpszDir,-1,szDir,MAX_PATH); - if (lpszFile) - MultiByteToWideChar(CP_ACP,0,lpszFile,-1,szFile,MAX_PATH); - PathCombineW(szDest, lpszDir ? szDir : NULL, lpszFile ? szFile : NULL); - WideCharToMultiByte(CP_ACP,0,szDest,-1,lpszDest,MAX_PATH,0,0); + lpszDest[0] = 0; + return NULL; } - return lpszDest; + + if (lpszDir) + MultiByteToWideChar(CP_ACP,0,lpszDir,-1,szDir,MAX_PATH); + if (lpszFile) + MultiByteToWideChar(CP_ACP,0,lpszFile,-1,szFile,MAX_PATH); + + if (PathCombineW(szDest, lpszDir ? szDir : NULL, lpszFile ? szFile : NULL)) + if (WideCharToMultiByte(CP_ACP,0,szDest,-1,lpszDest,MAX_PATH,0,0)) + return lpszDest; + + lpszDest[0] = 0; + return NULL; } /************************************************************************* @@ -162,10 +170,16 @@ LPWSTR WINAPI PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile) TRACE("(%p,%s,%s)\n", lpszDest, debugstr_w(lpszDir), debugstr_w(lpszFile)); - if (!lpszDest || (!lpszDir && !lpszFile)) - return lpszDest; /* Invalid parameters */ + /* Invalid parameters */ + if (!lpszDest) + return NULL; + if (!lpszDir && !lpszFile) + { + lpszDest[0] = 0; + return NULL; + } - if (!lpszFile || !*lpszFile) + if ((!lpszFile || !*lpszFile) && lpszDir) { /* Use dir only */ lstrcpynW(szTemp, lpszDir, MAX_PATH); @@ -194,10 +208,11 @@ LPWSTR WINAPI PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile) PathStripToRootW(szTemp); lpszFile++; /* Skip '\' */ } - if (!PathAddBackslashW(szTemp)) - return NULL; - if (strlenW(szTemp) + strlenW(lpszFile) >= MAX_PATH) + if (!PathAddBackslashW(szTemp) || strlenW(szTemp) + strlenW(lpszFile) >= MAX_PATH) + { + lpszDest[0] = 0; return NULL; + } strcatW(szTemp, lpszFile); } @@ -354,7 +369,7 @@ LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath) if ((*lpszPath == '\\' || *lpszPath == '/' || *lpszPath == ':') && lpszPath[1] && lpszPath[1] != '\\' && lpszPath[1] != '/') lastSlash = lpszPath + 1; - lpszPath = CharNextW(lpszPath); + lpszPath++; } return (LPWSTR)lastSlash; } @@ -410,7 +425,7 @@ LPWSTR WINAPI PathFindExtensionW( LPCWSTR lpszPath ) lastpoint = NULL; else if (*lpszPath == '.') lastpoint = lpszPath; - lpszPath = CharNextW(lpszPath); + lpszPath++; } } return (LPWSTR)(lastpoint ? lastpoint : lpszPath); @@ -469,7 +484,7 @@ LPWSTR WINAPI PathGetArgsW(LPCWSTR lpszPath) return (LPWSTR)lpszPath + 1; if (*lpszPath == '"') bSeenQuote = !bSeenQuote; - lpszPath = CharNextW(lpszPath); + lpszPath++; } } return (LPWSTR)lpszPath; @@ -506,9 +521,12 @@ int WINAPI PathGetDriveNumberW(LPCWSTR lpszPath) { TRACE ("(%s)\n",debugstr_w(lpszPath)); - if (lpszPath && lpszPath[1] == ':' && - tolowerW(*lpszPath) >= 'a' && tolowerW(*lpszPath) <= 'z') - return tolowerW(*lpszPath) - 'a'; + if (lpszPath) + { + WCHAR tl = tolowerW(lpszPath[0]); + if (tl >= 'a' && tl <= 'z' && lpszPath[1] == ':') + return tl - 'a'; + } return -1; } @@ -592,8 +610,7 @@ BOOL WINAPI PathRemoveFileSpecW(LPWSTR lpszPath) if (*lpszPath == '\\') lpszFileSpec++; } - if (!(lpszPath = CharNextW(lpszPath))) - break; + lpszPath++; } if (*lpszFileSpec) @@ -725,14 +742,8 @@ void WINAPI PathRemoveArgsW(LPWSTR lpszPath) if(lpszPath) { LPWSTR lpszArgs = PathGetArgsW(lpszPath); - if (*lpszArgs) + if (*lpszArgs || (lpszArgs > lpszPath && lpszArgs[-1] == ' ')) lpszArgs[-1] = '\0'; - else - { - LPWSTR lpszLastChar = CharPrevW(lpszPath, lpszArgs); - if(*lpszLastChar == ' ') - *lpszLastChar = '\0'; - } } } @@ -814,7 +825,8 @@ LPWSTR WINAPI PathRemoveBackslashW( LPWSTR lpszPath ) if(lpszPath) { - szTemp = CharPrevW(lpszPath, lpszPath + strlenW(lpszPath)); + szTemp = lpszPath + strlenW(lpszPath); + if (szTemp > lpszPath) szTemp--; if (!PathIsRootW(lpszPath) && *szTemp == '\\') *szTemp = '\0'; } @@ -1065,7 +1077,7 @@ BOOL WINAPI PathFileExistsDefExtW(LPWSTR lpszPath,DWORD dwWhich) { '.', 'c', 'm', 'd', 0}, { 0, 0, 0, 0, 0} }; - TRACE("(%s,%ld)\n", debugstr_w(lpszPath), dwWhich); + TRACE("(%s,%d)\n", debugstr_w(lpszPath), dwWhich); if (!lpszPath || PathIsUNCServerW(lpszPath) || PathIsUNCServerShareW(lpszPath)) return FALSE; @@ -1109,7 +1121,7 @@ BOOL WINAPI PathFileExistsDefExtW(LPWSTR lpszPath,DWORD dwWhich) * * NOTES * lpszPath is modified in place and must be at least MAX_PATH in length. - * If the function returns FALSE, the path is modified to its orginal state. + * If the function returns FALSE, the path is modified to its original state. * If the given path contains an extension or dwWhich is 0, executable * extensions are not checked. * @@ -1121,7 +1133,7 @@ BOOL WINAPI PathFileExistsDefExtA(LPSTR lpszPath,DWORD dwWhich) { BOOL bRet = FALSE; - TRACE("(%s,%ld)\n", debugstr_a(lpszPath), dwWhich); + TRACE("(%s,%d)\n", debugstr_a(lpszPath), dwWhich); if (lpszPath) { @@ -1148,7 +1160,7 @@ static BOOL WINAPI SHLWAPI_PathFindInOtherDirs(LPWSTR lpszFile, DWORD dwWhich) WCHAR *lpszPATH; WCHAR buff[MAX_PATH]; - TRACE("(%s,%08lx)\n", debugstr_w(lpszFile), dwWhich); + TRACE("(%s,%08x)\n", debugstr_w(lpszFile), dwWhich); /* Try system directories */ GetSystemDirectoryW(buff, MAX_PATH); @@ -1178,7 +1190,7 @@ static BOOL WINAPI SHLWAPI_PathFindInOtherDirs(LPWSTR lpszFile, DWORD dwWhich) /* Try dirs listed in %PATH% */ dwLenPATH = GetEnvironmentVariableW(szPath, buff, MAX_PATH); - if (!dwLenPATH || !(lpszPATH = malloc((dwLenPATH + 1) * sizeof (WCHAR)))) + if (!dwLenPATH || !(lpszPATH = HeapAlloc(GetProcessHeap(), 0, (dwLenPATH + 1) * sizeof (WCHAR)))) return FALSE; GetEnvironmentVariableW(szPath, lpszPATH, dwLenPATH + 1); @@ -1201,17 +1213,17 @@ static BOOL WINAPI SHLWAPI_PathFindInOtherDirs(LPWSTR lpszFile, DWORD dwWhich) if (!PathAppendW(buff, lpszFile)) { - free(lpszPATH); + HeapFree(GetProcessHeap(), 0, lpszPATH); return FALSE; } if (PathFileExistsDefExtW(buff, dwWhich)) { strcpyW(lpszFile, buff); - free(lpszPATH); + HeapFree(GetProcessHeap(), 0, lpszPATH); return TRUE; } } - free(lpszPATH); + HeapFree(GetProcessHeap(), 0, lpszPATH); return FALSE; } @@ -1234,7 +1246,7 @@ BOOL WINAPI PathFindOnPathExA(LPSTR lpszFile,LPCSTR *lppszOtherDirs,DWORD dwWhic WCHAR szFile[MAX_PATH]; WCHAR buff[MAX_PATH]; - TRACE("(%s,%p,%08lx)\n", debugstr_a(lpszFile), lppszOtherDirs, dwWhich); + TRACE("(%s,%p,%08x)\n", debugstr_a(lpszFile), lppszOtherDirs, dwWhich); if (!lpszFile || !PathIsFileSpecA(lpszFile)) return FALSE; @@ -1277,7 +1289,7 @@ BOOL WINAPI PathFindOnPathExW(LPWSTR lpszFile,LPCWSTR *lppszOtherDirs,DWORD dwWh { WCHAR buff[MAX_PATH]; - TRACE("(%s,%p,%08lx)\n", debugstr_w(lpszFile), lppszOtherDirs, dwWhich); + TRACE("(%s,%p,%08x)\n", debugstr_w(lpszFile), lppszOtherDirs, dwWhich); if (!lpszFile || !PathIsFileSpecW(lpszFile)) return FALSE; @@ -1362,7 +1374,7 @@ BOOL WINAPI PathCompactPathExA(LPSTR lpszDest, LPCSTR lpszPath, { BOOL bRet = FALSE; - TRACE("(%p,%s,%d,0x%08lx)\n", lpszDest, debugstr_a(lpszPath), cchMax, dwFlags); + TRACE("(%p,%s,%d,0x%08x)\n", lpszDest, debugstr_a(lpszPath), cchMax, dwFlags); if (lpszPath && lpszDest) { @@ -1389,7 +1401,7 @@ BOOL WINAPI PathCompactPathExW(LPWSTR lpszDest, LPCWSTR lpszPath, LPCWSTR lpszFile; DWORD dwLen, dwFileLen = 0; - TRACE("(%p,%s,%d,0x%08lx)\n", lpszDest, debugstr_w(lpszPath), cchMax, dwFlags); + TRACE("(%p,%s,%d,0x%08x)\n", lpszDest, debugstr_w(lpszPath), cchMax, dwFlags); if (!lpszPath) return FALSE; @@ -1588,7 +1600,7 @@ BOOL WINAPI PathIsRootW(LPCWSTR lpszPath) return FALSE; bSeenSlash = TRUE; } - lpszPath = CharNextW(lpszPath); + lpszPath++; } return TRUE; } @@ -1826,8 +1838,8 @@ static BOOL WINAPI PathMatchSingleMaskW(LPCWSTR name, LPCWSTR mask) if (toupperW(*mask) != toupperW(*name) && *mask != '?') return FALSE; - name = CharNextW(name); - mask = CharNextW(mask); + name++; + mask++; } if (!*name) { @@ -1866,18 +1878,17 @@ BOOL WINAPI PathMatchSpecA(LPCSTR lpszPath, LPCSTR lpszMask) while (*lpszMask) { + while (*lpszMask == ' ') + lpszMask++; /* Eat leading spaces */ + if (PathMatchSingleMaskA(lpszPath, lpszMask)) return TRUE; /* Matches the current mask */ while (*lpszMask && *lpszMask != ';') - lpszMask = CharNextA(lpszMask); + lpszMask = CharNextA(lpszMask); /* masks separated by ';' */ if (*lpszMask == ';') - { lpszMask++; - while (*lpszMask == ' ') - lpszMask++; /* masks may be separated by "; " */ - } } return FALSE; } @@ -1898,18 +1909,17 @@ BOOL WINAPI PathMatchSpecW(LPCWSTR lpszPath, LPCWSTR lpszMask) while (*lpszMask) { + while (*lpszMask == ' ') + lpszMask++; /* Eat leading spaces */ + if (PathMatchSingleMaskW(lpszPath, lpszMask)) return TRUE; /* Matches the current path */ while (*lpszMask && *lpszMask != ';') - lpszMask++; + lpszMask++; /* masks separated by ';' */ if (*lpszMask == ';') - { lpszMask++; - while (*lpszMask == ' ') - lpszMask++; /* Masks may be separated by "; " */ - } } return FALSE; } @@ -2068,7 +2078,7 @@ BOOL WINAPI PathIsFileSpecW(LPCWSTR lpszPath) { if (*lpszPath == '\\' || *lpszPath == ':') return FALSE; - lpszPath = CharNextW(lpszPath); + lpszPath++; } return TRUE; } @@ -2126,7 +2136,7 @@ BOOL WINAPI PathIsPrefixW(LPCWSTR lpszPrefix, LPCWSTR lpszPath) */ BOOL WINAPI PathIsSystemFolderA(LPCSTR lpszPath, DWORD dwAttrib) { - TRACE("(%s,0x%08lx)\n", debugstr_a(lpszPath), dwAttrib); + TRACE("(%s,0x%08x)\n", debugstr_a(lpszPath), dwAttrib); if (lpszPath && *lpszPath) dwAttrib = GetFileAttributesA(lpszPath); @@ -2144,7 +2154,7 @@ BOOL WINAPI PathIsSystemFolderA(LPCSTR lpszPath, DWORD dwAttrib) */ BOOL WINAPI PathIsSystemFolderW(LPCWSTR lpszPath, DWORD dwAttrib) { - TRACE("(%s,0x%08lx)\n", debugstr_w(lpszPath), dwAttrib); + TRACE("(%s,0x%08x)\n", debugstr_w(lpszPath), dwAttrib); if (lpszPath && *lpszPath) dwAttrib = GetFileAttributesW(lpszPath); @@ -2233,15 +2243,9 @@ BOOL WINAPI PathIsUNCServerW(LPCWSTR lpszPath) { TRACE("(%s)\n", debugstr_w(lpszPath)); - if (lpszPath && *lpszPath++ == '\\' && *lpszPath++ == '\\') + if (lpszPath && lpszPath[0] == '\\' && lpszPath[1] == '\\') { - while (*lpszPath) - { - if (*lpszPath == '\\') - return FALSE; - lpszPath = CharNextW(lpszPath); - } - return TRUE; + return !strchrW( lpszPath + 2, '\\' ); } return FALSE; } @@ -2305,7 +2309,7 @@ BOOL WINAPI PathIsUNCServerShareW(LPCWSTR lpszPath) return FALSE; bSeenSlash = TRUE; } - lpszPath = CharNextW(lpszPath); + lpszPath++; } return bSeenSlash; } @@ -2516,7 +2520,7 @@ LPWSTR WINAPI PathFindNextComponentW(LPCWSTR lpszPath) * RETURNS * TRUE If the path was modified, * FALSE If lpszPath or lpszExtension are invalid, lpszPath has an - * extension allready, or the new path length is too big. + * extension already, or the new path length is too big. * * FIXME * What version of shlwapi.dll adds "exe" if lpszExtension is NULL? Win2k @@ -2826,8 +2830,7 @@ BOOL WINAPI PathCompactPathW(HDC hDC, LPWSTR lpszPath, UINT dx) DWORD dwEllipsesLen = 0, dwPathLen = 0; sFile = PathFindFileNameW(lpszPath); - if (sFile != lpszPath) - sFile = CharPrevW(lpszPath, sFile); + if (sFile != lpszPath) sFile--; /* Get the size of ellipses */ GetTextExtentPointW(hDC, szEllipses, 3, &size); @@ -2855,12 +2858,11 @@ BOOL WINAPI PathCompactPathW(HDC hDC, LPWSTR lpszPath, UINT dx) dwTotalLen += size.cx; if (dwTotalLen <= dx) break; - sPath = CharPrevW(lpszPath, sPath); + sPath--; if (!bEllipses) { bEllipses = TRUE; - sPath = CharPrevW(lpszPath, sPath); - sPath = CharPrevW(lpszPath, sPath); + sPath -= 2; } } while (sPath > lpszPath); @@ -3269,7 +3271,7 @@ HRESULT WINAPI PathCreateFromUrlW(LPCWSTR pszUrl, LPWSTR pszPath, DWORD nslashes = 0; WCHAR *ptr; - TRACE("(%s,%p,%p,0x%08lx)\n", debugstr_w(pszUrl), pszPath, pcchPath, dwReserved); + TRACE("(%s,%p,%p,0x%08x)\n", debugstr_w(pszUrl), pszPath, pcchPath, dwReserved); if (!pszUrl || !pszPath || !pcchPath || !*pcchPath) return E_INVALIDARG; @@ -3360,7 +3362,7 @@ BOOL WINAPI PathRelativePathToA(LPSTR lpszPath, LPCSTR lpszFrom, DWORD dwAttrFro { BOOL bRet = FALSE; - TRACE("(%p,%s,0x%08lx,%s,0x%08lx)\n", lpszPath, debugstr_a(lpszFrom), + TRACE("(%p,%s,0x%08x,%s,0x%08x)\n", lpszPath, debugstr_a(lpszFrom), dwAttrFrom, debugstr_a(lpszTo), dwAttrTo); if(lpszPath && lpszFrom && lpszTo) @@ -3390,7 +3392,7 @@ BOOL WINAPI PathRelativePathToW(LPWSTR lpszPath, LPCWSTR lpszFrom, DWORD dwAttrF WCHAR szTo[MAX_PATH]; DWORD dwLen; - TRACE("(%p,%s,0x%08lx,%s,0x%08lx)\n", lpszPath, debugstr_w(lpszFrom), + TRACE("(%p,%s,0x%08x,%s,0x%08x)\n", lpszPath, debugstr_w(lpszFrom), dwAttrFrom, debugstr_w(lpszTo), dwAttrTo); if(!lpszPath || !lpszFrom || !lpszTo) @@ -3968,7 +3970,7 @@ HRESULT WINAPI SHGetWebFolderFilePathA(LPCSTR lpszFile, LPSTR lpszPath, DWORD dw WCHAR szFile[MAX_PATH], szPath[MAX_PATH]; HRESULT hRet; - TRACE("(%s,%p,%ld)\n", lpszFile, lpszPath, dwPathLen); + TRACE("(%s,%p,%d)\n", lpszFile, lpszPath, dwPathLen); MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, szFile, MAX_PATH); szPath[0] = '\0'; @@ -3991,7 +3993,7 @@ HRESULT WINAPI SHGetWebFolderFilePathW(LPCWSTR lpszFile, LPWSTR lpszPath, DWORD DWORD dwLen, dwFileLen; LANGID lidSystem, lidUser; - TRACE("(%s,%p,%ld)\n", debugstr_w(lpszFile), lpszPath, dwPathLen); + TRACE("(%s,%p,%d)\n", debugstr_w(lpszFile), lpszPath, dwPathLen); /* Get base directory for web content */ dwLen = GetSystemWindowsDirectoryW(lpszPath, dwPathLen); diff --git a/reactos/dll/win32/shlwapi/reg.c b/reactos/dll/win32/shlwapi/reg.c index 15d14f81b44..1f528834695 100644 --- a/reactos/dll/win32/shlwapi/reg.c +++ b/reactos/dll/win32/shlwapi/reg.c @@ -16,7 +16,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include @@ -33,16 +33,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); /* Key/Value names for MIME content types */ -static const char *lpszContentTypeA = "Content Type"; +static const char lpszContentTypeA[] = "Content Type"; static const WCHAR lpszContentTypeW[] = { 'C','o','n','t','e','n','t',' ','T','y','p','e','\0'}; -static const char *szMimeDbContentA = "MIME\\Database\\Content Type\\"; +static const char szMimeDbContentA[] = "MIME\\Database\\Content Type\\"; static const WCHAR szMimeDbContentW[] = { 'M', 'I', 'M','E','\\', 'D','a','t','a','b','a','s','e','\\','C','o','n','t','e','n','t', ' ','T','y','p','e','\\', 0 }; static const DWORD dwLenMimeDbContent = 27; /* strlen of szMimeDbContentA/W */ -static const char *szExtensionA = "Extension"; +static const char szExtensionA[] = "Extension"; static const WCHAR szExtensionW[] = { 'E', 'x', 't','e','n','s','i','o','n','\0' }; /* internal structure of what the HUSKEY points to */ @@ -54,7 +54,7 @@ typedef struct { WCHAR lpszPath[MAX_PATH]; } SHUSKEY, *LPSHUSKEY; -DWORD WINAPI SHStringFromGUIDW(REFGUID,LPWSTR,INT); +INT WINAPI SHStringFromGUIDW(REFGUID,LPWSTR,INT); HRESULT WINAPI SHRegGetCLSIDKeyW(REFGUID,LPCWSTR,BOOL,BOOL,PHKEY); @@ -126,7 +126,7 @@ LONG WINAPI SHRegOpenUSKeyW(LPCWSTR Path, REGSAM AccessType, HUSKEY hRelativeUSK LONG ret2, ret1 = ~ERROR_SUCCESS; LPSHUSKEY hKey; - TRACE("(%s,0x%lx,%p,%p,%d)\n", debugstr_w(Path),(LONG)AccessType, + TRACE("(%s,0x%x,%p,%p,%d)\n", debugstr_w(Path),(LONG)AccessType, hRelativeUSKey, phNewUSKey, fIgnoreHKCU); if (phNewUSKey) @@ -163,7 +163,7 @@ LONG WINAPI SHRegOpenUSKeyW(LPCWSTR Path, REGSAM AccessType, HUSKEY hRelativeUSK hKey->HKLMkey = 0; if (ret1 || ret2) - TRACE("one or more opens failed: HKCU=%ld HKLM=%ld\n", ret1, ret2); + TRACE("one or more opens failed: HKCU=%d HKLM=%d\n", ret1, ret2); if (ret1 && ret2) { @@ -225,7 +225,7 @@ LONG WINAPI SHRegCloseUSKey( LONG WINAPI SHRegCreateUSKeyA(LPCSTR pszPath, REGSAM samDesired, HUSKEY hRelativeUSKey, PHUSKEY phNewUSKey, DWORD dwFlags) { - FIXME("(%s, 0x%08lx, %p, %p, 0x%08lx) stub\n", debugstr_a(pszPath), samDesired, + FIXME("(%s, 0x%08x, %p, %p, 0x%08x) stub\n", debugstr_a(pszPath), samDesired, hRelativeUSKey, phNewUSKey, dwFlags); return ERROR_SUCCESS; } @@ -238,7 +238,7 @@ LONG WINAPI SHRegCreateUSKeyA(LPCSTR pszPath, REGSAM samDesired, HUSKEY hRelativ LONG WINAPI SHRegCreateUSKeyW(LPCWSTR pszPath, REGSAM samDesired, HUSKEY hRelativeUSKey, PHUSKEY phNewUSKey, DWORD dwFlags) { - FIXME("(%s, 0x%08lx, %p, %p, 0x%08lx) stub\n", debugstr_w(pszPath), samDesired, + FIXME("(%s, 0x%08x, %p, %p, 0x%08x) stub\n", debugstr_w(pszPath), samDesired, hRelativeUSKey, phNewUSKey, dwFlags); return ERROR_SUCCESS; } @@ -331,7 +331,7 @@ LONG WINAPI SHRegEnumUSValueA(HUSKEY hUSKey, DWORD dwIndex, LPSTR pszValueName, LPDWORD pcchValueNameLen, LPDWORD pdwType, LPVOID pvData, LPDWORD pcbData, SHREGENUM_FLAGS enumRegFlags) { - FIXME("(%p, 0x%08lx, %s, %p, %p, %p, %p, 0x%08x) stub\n", hUSKey, dwIndex, + FIXME("(%p, 0x%08x, %s, %p, %p, %p, %p, 0x%08x) stub\n", hUSKey, dwIndex, debugstr_a(pszValueName), pcchValueNameLen, pdwType, pvData, pcbData, enumRegFlags); return ERROR_INVALID_FUNCTION; } @@ -345,7 +345,7 @@ LONG WINAPI SHRegEnumUSValueW(HUSKEY hUSKey, DWORD dwIndex, LPWSTR pszValueName, LPDWORD pcchValueNameLen, LPDWORD pdwType, LPVOID pvData, LPDWORD pcbData, SHREGENUM_FLAGS enumRegFlags) { - FIXME("(%p, 0x%08lx, %s, %p, %p, %p, %p, 0x%08x) stub\n", hUSKey, dwIndex, + FIXME("(%p, 0x%08x, %s, %p, %p, %p, %p, 0x%08x) stub\n", hUSKey, dwIndex, debugstr_w(pszValueName), pcchValueNameLen, pdwType, pvData, pcbData, enumRegFlags); return ERROR_INVALID_FUNCTION; } @@ -378,7 +378,7 @@ LONG WINAPI SHRegQueryUSValueA( if (!fIgnoreHKCU && (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKCU))) { ret = RegQueryValueExA(dokey, pszValue, 0, pdwType, pvData, pcbData); - TRACE("HKCU RegQueryValue returned %08lx\n", ret); + TRACE("HKCU RegQueryValue returned %08x\n", ret); } /* if HKCU did not work and HKLM exists, then try it */ @@ -386,7 +386,7 @@ LONG WINAPI SHRegQueryUSValueA( (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKLM))) { ret = RegQueryValueExA(dokey, pszValue, 0, pdwType, pvData, pcbData); - TRACE("HKLM RegQueryValue returned %08lx\n", ret); + TRACE("HKLM RegQueryValue returned %08x\n", ret); } /* if neither worked, and default data exists, then use it */ @@ -429,7 +429,7 @@ LONG WINAPI SHRegQueryUSValueW( if (!fIgnoreHKCU && (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKCU))) { ret = RegQueryValueExW(dokey, pszValue, 0, pdwType, pvData, pcbData); - TRACE("HKCU RegQueryValue returned %08lx\n", ret); + TRACE("HKCU RegQueryValue returned %08x\n", ret); } /* if HKCU did not work and HKLM exists, then try it */ @@ -437,7 +437,7 @@ LONG WINAPI SHRegQueryUSValueW( (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKLM))) { ret = RegQueryValueExW(dokey, pszValue, 0, pdwType, pvData, pcbData); - TRACE("HKLM RegQueryValue returned %08lx\n", ret); + TRACE("HKLM RegQueryValue returned %08x\n", ret); } /* if neither worked, and default data exists, then use it */ @@ -481,7 +481,7 @@ LONG WINAPI SHRegGetUSValueA( LONG ret; if (!pvData || !pcbData) return ERROR_INVALID_FUNCTION; /* FIXME:wrong*/ - TRACE("key '%s', value '%s', datalen %ld, %s\n", + TRACE("key '%s', value '%s', datalen %d, %s\n", debugstr_a(pSubKey), debugstr_a(pValue), *pcbData, (flagIgnoreHKCU) ? "Ignoring HKCU" : "Tries HKCU then HKLM"); @@ -514,7 +514,7 @@ LONG WINAPI SHRegGetUSValueW( LONG ret; if (!pvData || !pcbData) return ERROR_INVALID_FUNCTION; /* FIXME:wrong*/ - TRACE("key '%s', value '%s', datalen %ld, %s\n", + TRACE("key '%s', value '%s', datalen %d, %s\n", debugstr_w(pSubKey), debugstr_w(pValue), *pcbData, (flagIgnoreHKCU) ? "Ignoring HKCU" : "Tries HKCU then HKLM"); @@ -556,7 +556,7 @@ LONG WINAPI SHRegSetUSValueA(LPCSTR pszSubKey, LPCSTR pszValue, DWORD dwType, HUSKEY hkey; LONG ret; - TRACE("(%s,%s,%ld,%p,%ld,0x%08lx\n", debugstr_a(pszSubKey), debugstr_a(pszValue), + TRACE("(%s,%s,%d,%p,%d,0x%08x\n", debugstr_a(pszSubKey), debugstr_a(pszValue), dwType, pvData, cbData, dwFlags); if (!pvData) @@ -586,7 +586,7 @@ LONG WINAPI SHRegSetUSValueW(LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwType, HUSKEY hkey; LONG ret; - TRACE("(%s,%s,%ld,%p,%ld,0x%08lx\n", debugstr_w(pszSubKey), debugstr_w(pszValue), + TRACE("(%s,%s,%d,%p,%d,0x%08x\n", debugstr_w(pszSubKey), debugstr_w(pszValue), dwType, pvData, cbData, dwFlags); if (!pvData) @@ -658,10 +658,10 @@ BOOL WINAPI SHRegGetBoolUSValueA( break; } default: - FIXME("Unsupported registry data type %ld\n", type); + FIXME("Unsupported registry data type %d\n", type); ret = FALSE; } - TRACE("got value (type=%ld), returing <%s>\n", type, + TRACE("got value (type=%d), returning <%s>\n", type, (ret) ? "TRUE" : "FALSE"); } else { @@ -703,7 +703,7 @@ BOOL WINAPI SHRegGetBoolUSValueW( /* process returned data via type into bool */ switch (type) { case REG_SZ: - data[9] = L'\0'; /* set end of string */ + data[9] = '\0'; /* set end of string */ if (lstrcmpiW(data, wYES)==0 || lstrcmpiW(data, wTRUE)==0) ret = TRUE; else if (lstrcmpiW(data, wNO)==0 || lstrcmpiW(data, wFALSE)==0) @@ -715,14 +715,14 @@ BOOL WINAPI SHRegGetBoolUSValueW( break; case REG_BINARY: if (datalen == 1) { - ret = (data[0] != L'\0'); + ret = (data[0] != '\0'); break; } default: - FIXME("Unsupported registry data type %ld\n", type); + FIXME("Unsupported registry data type %d\n", type); ret = FALSE; } - TRACE("got value (type=%ld), returing <%s>\n", type, + TRACE("got value (type=%d), returning <%s>\n", type, (ret) ? "TRUE" : "FALSE"); } else { @@ -837,7 +837,7 @@ LONG WINAPI SHRegEnumUSKeyA( { HKEY dokey; - TRACE("(%p,%ld,%p,%p(%ld),%d)\n", + TRACE("(%p,%d,%p,%p(%d),%d)\n", hUSKey, dwIndex, pszName, pcchValueNameLen, *pcchValueNameLen, enumRegFlags); @@ -872,7 +872,7 @@ LONG WINAPI SHRegEnumUSKeyW( { HKEY dokey; - TRACE("(%p,%ld,%p,%p(%ld),%d)\n", + TRACE("(%p,%d,%p,%p(%d),%d)\n", hUSKey, dwIndex, pszName, pcchValueNameLen, *pcchValueNameLen, enumRegFlags); @@ -939,7 +939,7 @@ LONG WINAPI SHRegWriteUSValueW(HUSKEY hUSKey, LPCWSTR pszValue, DWORD dwType, LPSHUSKEY hKey = (LPSHUSKEY)hUSKey; LONG ret = ERROR_SUCCESS; - TRACE("(%p,%s,%ld,%p,%ld,%ld)\n", hUSKey, debugstr_w(pszValue), + TRACE("(%p,%s,%d,%p,%d,%d)\n", hUSKey, debugstr_w(pszValue), dwType, pvData, cbData, dwFlags); if (!hUSKey || IsBadWritePtr(hUSKey, sizeof(SHUSKEY)) || @@ -952,7 +952,7 @@ LONG WINAPI SHRegWriteUSValueW(HUSKEY hUSKey, LPCWSTR pszValue, DWORD dwType, { /* Create the key */ ret = RegCreateKeyW(hKey->HKCUstart, hKey->lpszPath, &hKey->HKCUkey); - TRACE("Creating HKCU key, ret = %ld\n", ret); + TRACE("Creating HKCU key, ret = %d\n", ret); if (ret && (dwFlags & (SHREGSET_FORCE_HKCU))) { hKey->HKCUkey = 0; @@ -967,7 +967,7 @@ LONG WINAPI SHRegWriteUSValueW(HUSKEY hUSKey, LPCWSTR pszValue, DWORD dwType, { /* Doesn't exist or we are forcing: Write value */ ret = RegSetValueExW(hKey->HKCUkey, pszValue, 0, dwType, pvData, cbData); - TRACE("Writing HKCU value, ret = %ld\n", ret); + TRACE("Writing HKCU value, ret = %d\n", ret); } } } @@ -978,7 +978,7 @@ LONG WINAPI SHRegWriteUSValueW(HUSKEY hUSKey, LPCWSTR pszValue, DWORD dwType, { /* Create the key */ ret = RegCreateKeyW(hKey->HKLMstart, hKey->lpszPath, &hKey->HKLMkey); - TRACE("Creating HKLM key, ret = %ld\n", ret); + TRACE("Creating HKLM key, ret = %d\n", ret); if (ret && (dwFlags & (SHREGSET_FORCE_HKLM))) { hKey->HKLMkey = 0; @@ -993,7 +993,7 @@ LONG WINAPI SHRegWriteUSValueW(HUSKEY hUSKey, LPCWSTR pszValue, DWORD dwType, { /* Doesn't exist or we are forcing: Write value */ ret = RegSetValueExW(hKey->HKLMkey, pszValue, 0, dwType, pvData, cbData); - TRACE("Writing HKLM value, ret = %ld\n", ret); + TRACE("Writing HKLM value, ret = %d\n", ret); } } } @@ -1022,7 +1022,7 @@ DWORD WINAPI SHRegGetPathA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue, { DWORD dwSize = MAX_PATH; - TRACE("(hkey=%p,%s,%s,%p,%ld)\n", hKey, debugstr_a(lpszSubKey), + TRACE("(hkey=%p,%s,%s,%p,%d)\n", hKey, debugstr_a(lpszSubKey), debugstr_a(lpszValue), lpszPath, dwFlags); return SHGetValueA(hKey, lpszSubKey, lpszValue, 0, lpszPath, &dwSize); @@ -1038,7 +1038,7 @@ DWORD WINAPI SHRegGetPathW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, { DWORD dwSize = MAX_PATH; - TRACE("(hkey=%p,%s,%s,%p,%ld)\n", hKey, debugstr_w(lpszSubKey), + TRACE("(hkey=%p,%s,%s,%p,%d)\n", hKey, debugstr_w(lpszSubKey), debugstr_w(lpszValue), lpszPath, dwFlags); return SHGetValueW(hKey, lpszSubKey, lpszValue, 0, lpszPath, &dwSize); @@ -1066,7 +1066,7 @@ DWORD WINAPI SHRegSetPathA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue, { char szBuff[MAX_PATH]; - FIXME("(hkey=%p,%s,%s,%p,%ld) - semi-stub\n",hKey, debugstr_a(lpszSubKey), + FIXME("(hkey=%p,%s,%s,%p,%d) - semi-stub\n",hKey, debugstr_a(lpszSubKey), debugstr_a(lpszValue), lpszPath, dwFlags); lstrcpyA(szBuff, lpszPath); @@ -1087,7 +1087,7 @@ DWORD WINAPI SHRegSetPathW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, { WCHAR szBuff[MAX_PATH]; - FIXME("(hkey=%p,%s,%s,%p,%ld) - semi-stub\n",hKey, debugstr_w(lpszSubKey), + FIXME("(hkey=%p,%s,%s,%p,%d) - semi-stub\n",hKey, debugstr_w(lpszSubKey), debugstr_w(lpszValue), lpszPath, dwFlags); lstrcpyW(szBuff, lpszPath); @@ -1165,7 +1165,7 @@ DWORD WINAPI SHRegGetValueA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue, DWOR TRACE("(hkey=%p,%s,%s,%p,%p,%p)\n", hKey, debugstr_a(lpszSubKey), debugstr_a(lpszValue), pwType, pvData, pcbData); - FIXME("Semi-Stub: Find meaning and implement handling of SRFF Flags 0x%08lx\n", srrfFlags); + FIXME("Semi-Stub: Find meaning and implement handling of SRFF Flags 0x%08x\n", srrfFlags); dwRet = RegOpenKeyExA(hKey, lpszSubKey, 0, KEY_QUERY_VALUE, &hSubKey); if (! dwRet) @@ -1188,9 +1188,9 @@ DWORD WINAPI SHRegGetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, DW DWORD dwRet = 0; HKEY hSubKey = 0; - TRACE("(hkey=%p,%s,%s,0x%08lx, %p,%p,%p)\n", hKey, debugstr_w(lpszSubKey), + TRACE("(hkey=%p,%s,%s,0x%08x, %p,%p,%p)\n", hKey, debugstr_w(lpszSubKey), debugstr_w(lpszValue), srrfFlags,pwType, pvData, pcbData); - FIXME("Semi-Stub: Find meaning and implement handling of SRFF Flags 0x%08lx\n", srrfFlags); + FIXME("Semi-Stub: Find meaning and implement handling of SRFF Flags 0x%08x\n", srrfFlags); dwRet = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_QUERY_VALUE, &hSubKey); if (! dwRet) @@ -1254,7 +1254,7 @@ DWORD WINAPI SHSetValueA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue, DWORD dwRet = ERROR_SUCCESS, dwDummy; HKEY hSubKey; - TRACE("(hkey=%p,%s,%s,%ld,%p,%ld)\n", hKey, debugstr_a(lpszSubKey), + TRACE("(hkey=%p,%s,%s,%d,%p,%d)\n", hKey, debugstr_a(lpszSubKey), debugstr_a(lpszValue), dwType, pvData, cbData); if (lpszSubKey && *lpszSubKey) @@ -1282,7 +1282,7 @@ DWORD WINAPI SHSetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, DWORD dwRet = ERROR_SUCCESS, dwDummy; HKEY hSubKey; - TRACE("(hkey=%p,%s,%s,%ld,%p,%ld)\n", hKey, debugstr_w(lpszSubKey), + TRACE("(hkey=%p,%s,%s,%d,%p,%d)\n", hKey, debugstr_w(lpszSubKey), debugstr_w(lpszValue), dwType, pvData, cbData); if (lpszSubKey && *lpszSubKey) @@ -1378,7 +1378,7 @@ DWORD WINAPI SHQueryValueExA( HKEY hKey, LPCSTR lpszValue, { DWORD dwRet, dwType, dwUnExpDataLen = 0, dwExpDataLen; - TRACE("(hkey=%p,%s,%p,%p,%p,%p=%ld)\n", hKey, debugstr_a(lpszValue), + TRACE("(hkey=%p,%s,%p,%p,%p,%p=%d)\n", hKey, debugstr_a(lpszValue), lpReserved, pwType, pvData, pcbData, pcbData ? *pcbData : 0); if (pcbData) dwUnExpDataLen = *pcbData; @@ -1398,7 +1398,7 @@ DWORD WINAPI SHQueryValueExA( HKEY hKey, LPCSTR lpszValue, if ((!pvData) || (dwRet == ERROR_MORE_DATA) ) { char cNull = '\0'; - nBytesToAlloc = (!pvData || (dwRet == ERROR_MORE_DATA)) ? dwUnExpDataLen : *pcbData; + nBytesToAlloc = dwUnExpDataLen; szData = (LPSTR) LocalAlloc(LMEM_ZEROINIT, nBytesToAlloc); RegQueryValueExA (hKey, lpszValue, lpReserved, NULL, (LPBYTE)szData, &nBytesToAlloc); @@ -1437,7 +1437,7 @@ DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue, { DWORD dwRet, dwType, dwUnExpDataLen = 0, dwExpDataLen; - TRACE("(hkey=%p,%s,%p,%p,%p,%p=%ld)\n", hKey, debugstr_w(lpszValue), + TRACE("(hkey=%p,%s,%p,%p,%p,%p=%d)\n", hKey, debugstr_w(lpszValue), lpReserved, pwType, pvData, pcbData, pcbData ? *pcbData : 0); if (pcbData) dwUnExpDataLen = *pcbData; @@ -1459,7 +1459,7 @@ DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue, if ((!pvData) || (dwRet == ERROR_MORE_DATA) ) { WCHAR cNull = '\0'; - nBytesToAlloc = (!pvData || (dwRet == ERROR_MORE_DATA)) ? dwUnExpDataLen : *pcbData; + nBytesToAlloc = dwUnExpDataLen; szData = (LPWSTR) LocalAlloc(LMEM_ZEROINIT, nBytesToAlloc); RegQueryValueExW (hKey, lpszValue, lpReserved, NULL, (LPBYTE)szData, &nBytesToAlloc); @@ -1491,6 +1491,9 @@ DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue, * * Delete a registry key and any sub keys/values present * + * This function forwards to the unicode version directly, to avoid + * handling subkeys that are not representable in ASCII. + * * PARAMS * hKey [I] Handle to registry key * lpszSubKey [I] Name of sub key to delete @@ -1502,48 +1505,10 @@ DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue, */ DWORD WINAPI SHDeleteKeyA(HKEY hKey, LPCSTR lpszSubKey) { - DWORD dwRet, dwMaxSubkeyLen = 0, dwSize; - CHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf; - HKEY hSubKey = 0; + WCHAR subkeyW[MAX_PATH]; - TRACE("(hkey=%p,%s)\n", hKey, debugstr_a(lpszSubKey)); - - dwRet = RegOpenKeyExA(hKey, lpszSubKey, 0, KEY_READ, &hSubKey); - if(!dwRet) - { - /* Find the maximum subkey length so that we can allocate a buffer */ - dwRet = RegQueryInfoKeyA(hSubKey, NULL, NULL, NULL, NULL, - &dwMaxSubkeyLen, NULL, NULL, NULL, NULL, NULL, NULL); - if(!dwRet) - { - dwMaxSubkeyLen++; - if (dwMaxSubkeyLen > sizeof(szNameBuf)) - /* Name too big: alloc a buffer for it */ - lpszName = HeapAlloc(GetProcessHeap(), 0, dwMaxSubkeyLen*sizeof(CHAR)); - - if(!lpszName) - dwRet = ERROR_NOT_ENOUGH_MEMORY; - else - { - while (dwRet == ERROR_SUCCESS) - { - dwSize = dwMaxSubkeyLen; - dwRet = RegEnumKeyExA(hSubKey, 0, lpszName, &dwSize, NULL, NULL, NULL, NULL); - if (dwRet == ERROR_SUCCESS || dwRet == ERROR_MORE_DATA) - dwRet = SHDeleteKeyA(hSubKey, lpszName); - } - if (dwRet == ERROR_NO_MORE_ITEMS) - dwRet = ERROR_SUCCESS; - if (lpszName != szNameBuf) - HeapFree(GetProcessHeap(), 0, lpszName); /* Free buffer if allocated */ - } - } - - RegCloseKey(hSubKey); - if(!dwRet) - dwRet = RegDeleteKeyA(hKey, lpszSubKey); - } - return dwRet; + MultiByteToWideChar (CP_ACP, 0, lpszSubKey, -1, subkeyW, sizeof(subkeyW)/sizeof(WCHAR)); + return SHDeleteKeyW(hKey, subkeyW); } /************************************************************************* @@ -1553,7 +1518,7 @@ DWORD WINAPI SHDeleteKeyA(HKEY hKey, LPCSTR lpszSubKey) */ DWORD WINAPI SHDeleteKeyW(HKEY hKey, LPCWSTR lpszSubKey) { - DWORD dwRet, dwKeyCount = 0, dwMaxSubkeyLen = 0, dwSize, i; + DWORD dwRet, dwMaxSubkeyLen = 0, dwSize; WCHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf; HKEY hSubKey = 0; @@ -1562,8 +1527,8 @@ DWORD WINAPI SHDeleteKeyW(HKEY hKey, LPCWSTR lpszSubKey) dwRet = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_READ, &hSubKey); if(!dwRet) { - /* Find how many subkeys there are */ - dwRet = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, &dwKeyCount, + /* Find the maximum subkey length so that we can allocate a buffer */ + dwRet = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL, &dwMaxSubkeyLen, NULL, NULL, NULL, NULL, NULL, NULL); if(!dwRet) { @@ -1576,15 +1541,16 @@ DWORD WINAPI SHDeleteKeyW(HKEY hKey, LPCWSTR lpszSubKey) dwRet = ERROR_NOT_ENOUGH_MEMORY; else { - /* Recursively delete all the subkeys */ - for(i = 0; i < dwKeyCount && !dwRet; i++) + while (dwRet == ERROR_SUCCESS) { dwSize = dwMaxSubkeyLen; - dwRet = RegEnumKeyExW(hSubKey, i, lpszName, &dwSize, NULL, NULL, NULL, NULL); - if(!dwRet) + dwRet = RegEnumKeyExW(hSubKey, 0, lpszName, &dwSize, NULL, NULL, NULL, NULL); + if (dwRet == ERROR_SUCCESS || dwRet == ERROR_MORE_DATA) dwRet = SHDeleteKeyW(hSubKey, lpszName); } - + if (dwRet == ERROR_NO_MORE_ITEMS) + dwRet = ERROR_SUCCESS; + if (lpszName != szNameBuf) HeapFree(GetProcessHeap(), 0, lpszName); /* Free buffer if allocated */ } @@ -1800,7 +1766,7 @@ DWORD WINAPI SHDeleteValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue) LONG WINAPI SHEnumKeyExA(HKEY hKey, DWORD dwIndex, LPSTR lpszSubKey, LPDWORD pwLen) { - TRACE("(hkey=%p,%ld,%s,%p)\n", hKey, dwIndex, debugstr_a(lpszSubKey), pwLen); + TRACE("(hkey=%p,%d,%s,%p)\n", hKey, dwIndex, debugstr_a(lpszSubKey), pwLen); return RegEnumKeyExA(hKey, dwIndex, lpszSubKey, pwLen, NULL, NULL, NULL, NULL); } @@ -1813,7 +1779,7 @@ LONG WINAPI SHEnumKeyExA(HKEY hKey, DWORD dwIndex, LPSTR lpszSubKey, LONG WINAPI SHEnumKeyExW(HKEY hKey, DWORD dwIndex, LPWSTR lpszSubKey, LPDWORD pwLen) { - TRACE("(hkey=%p,%ld,%s,%p)\n", hKey, dwIndex, debugstr_w(lpszSubKey), pwLen); + TRACE("(hkey=%p,%d,%s,%p)\n", hKey, dwIndex, debugstr_w(lpszSubKey), pwLen); return RegEnumKeyExW(hKey, dwIndex, lpszSubKey, pwLen, NULL, NULL, NULL, NULL); } @@ -1840,7 +1806,7 @@ LONG WINAPI SHEnumValueA(HKEY hKey, DWORD dwIndex, LPSTR lpszValue, LPDWORD pwLen, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData) { - TRACE("(hkey=%p,%ld,%s,%p,%p,%p,%p)\n", hKey, dwIndex, + TRACE("(hkey=%p,%d,%s,%p,%p,%p,%p)\n", hKey, dwIndex, debugstr_a(lpszValue), pwLen, pwType, pvData, pcbData); return RegEnumValueA(hKey, dwIndex, lpszValue, pwLen, NULL, @@ -1856,7 +1822,7 @@ LONG WINAPI SHEnumValueW(HKEY hKey, DWORD dwIndex, LPWSTR lpszValue, LPDWORD pwLen, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData) { - TRACE("(hkey=%p,%ld,%s,%p,%p,%p,%p)\n", hKey, dwIndex, + TRACE("(hkey=%p,%d,%s,%p,%p,%p,%p)\n", hKey, dwIndex, debugstr_w(lpszValue), pwLen, pwType, pvData, pcbData); return RegEnumValueW(hKey, dwIndex, lpszValue, pwLen, NULL, @@ -1998,7 +1964,7 @@ BOOL WINAPI UnregisterMIMETypeForExtensionW(LPCWSTR lpszSubKey) */ BOOL WINAPI GetMIMETypeSubKeyA(LPCSTR lpszType, LPSTR lpszBuffer, DWORD dwLen) { - TRACE("(%s,%p,%ld)\n", debugstr_a(lpszType), lpszBuffer, dwLen); + TRACE("(%s,%p,%d)\n", debugstr_a(lpszType), lpszBuffer, dwLen); if (dwLen > dwLenMimeDbContent && lpszType && lpszBuffer) { @@ -2021,7 +1987,7 @@ BOOL WINAPI GetMIMETypeSubKeyA(LPCSTR lpszType, LPSTR lpszBuffer, DWORD dwLen) */ BOOL WINAPI GetMIMETypeSubKeyW(LPCWSTR lpszType, LPWSTR lpszBuffer, DWORD dwLen) { - TRACE("(%s,%p,%ld)\n", debugstr_w(lpszType), lpszBuffer, dwLen); + TRACE("(%s,%p,%d)\n", debugstr_w(lpszType), lpszBuffer, dwLen); if (dwLen > dwLenMimeDbContent && lpszType && lpszBuffer) { @@ -2260,7 +2226,7 @@ DWORD WINAPI SHCopyKeyA(HKEY hKeySrc, LPCSTR lpszSrcSubKey, HKEY hKeyDst, DWORD { WCHAR szSubKeyW[MAX_PATH]; - TRACE("(hkey=%p,%s,%p08x,%ld)\n", hKeySrc, debugstr_a(lpszSrcSubKey), hKeyDst, dwReserved); + TRACE("(hkey=%p,%s,%p08x,%d)\n", hKeySrc, debugstr_a(lpszSrcSubKey), hKeyDst, dwReserved); if (lpszSrcSubKey) MultiByteToWideChar(0, 0, lpszSrcSubKey, -1, szSubKeyW, MAX_PATH); @@ -2282,7 +2248,7 @@ DWORD WINAPI SHCopyKeyW(HKEY hKeySrc, LPCWSTR lpszSrcSubKey, HKEY hKeyDst, DWORD WCHAR szName[MAX_PATH], *lpszName = szName; DWORD dwRet = S_OK; - TRACE("hkey=%p,%s,%p08x,%ld)\n", hKeySrc, debugstr_w(lpszSrcSubKey), hKeyDst, dwReserved); + TRACE("hkey=%p,%s,%p08x,%d)\n", hKeySrc, debugstr_w(lpszSrcSubKey), hKeyDst, dwReserved); if(!hKeyDst || !hKeySrc) dwRet = ERROR_INVALID_PARAMETER; @@ -2351,7 +2317,7 @@ DWORD WINAPI SHCopyKeyW(HKEY hKeySrc, LPCWSTR lpszSrcSubKey, HKEY hKeyDst, DWORD { DWORD dwNameSize = dwMaxKeyLen, dwType, dwLen = dwMaxDataLen; - dwRet = RegEnumValueW(hKeySrc, i, lpszName, &dwNameSize, NULL, &dwType, buff, &dwLen); + dwRet = RegEnumValueW(hKeySrc, i, lpszName, &dwNameSize, NULL, &dwType, lpBuff, &dwLen); if (!dwRet) dwRet = SHSetValueW(hKeyDst, NULL, lpszName, dwType, lpBuff, dwLen); diff --git a/reactos/dll/win32/shlwapi/regstream.c b/reactos/dll/win32/shlwapi/regstream.c index b0f7117ebab..6aca8f937ef 100644 --- a/reactos/dll/win32/shlwapi/regstream.c +++ b/reactos/dll/win32/shlwapi/regstream.c @@ -16,7 +16,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include @@ -79,7 +79,7 @@ static ULONG WINAPI IStream_fnAddRef(IStream *iface) ISHRegStream *This = (ISHRegStream *)iface; ULONG refCount = InterlockedIncrement(&This->ref); - TRACE("(%p)->(ref before=%lu)\n",This, refCount - 1); + TRACE("(%p)->(ref before=%u)\n",This, refCount - 1); return refCount; } @@ -92,7 +92,7 @@ static ULONG WINAPI IStream_fnRelease(IStream *iface) ISHRegStream *This = (ISHRegStream *)iface; ULONG refCount = InterlockedDecrement(&This->ref); - TRACE("(%p)->(ref before=%lu)\n",This, refCount + 1); + TRACE("(%p)->(ref before=%u)\n",This, refCount + 1); if (!refCount) { @@ -119,7 +119,7 @@ static HRESULT WINAPI IStream_fnRead (IStream * iface, void* pv, ULONG cb, ULONG DWORD dwBytesToRead, dwBytesLeft; - TRACE("(%p)->(%p,0x%08lx,%p)\n",This, pv, cb, pcbRead); + TRACE("(%p)->(%p,0x%08x,%p)\n",This, pv, cb, pcbRead); if (!pv) return STG_E_INVALIDPOINTER; @@ -382,7 +382,7 @@ IStream * WINAPI SHOpenRegStream2A(HKEY hKey, LPCSTR pszSubkey, LPBYTE lpBuff = NULL; DWORD dwLength, dwType; - TRACE("(%p,%s,%s,0x%08lx)\n", hKey, pszSubkey, pszValue, dwMode); + TRACE("(%p,%s,%s,0x%08x)\n", hKey, pszSubkey, pszValue, dwMode); /* Open the key, read in binary data and create stream */ if (!RegOpenKeyExA (hKey, pszSubkey, 0, KEY_READ, &hStrKey) && @@ -410,7 +410,7 @@ IStream * WINAPI SHOpenRegStream2W(HKEY hKey, LPCWSTR pszSubkey, LPBYTE lpBuff = NULL; DWORD dwLength, dwType; - TRACE("(%p,%s,%s,0x%08lx)\n", hKey, debugstr_w(pszSubkey), + TRACE("(%p,%s,%s,0x%08x)\n", hKey, debugstr_w(pszSubkey), debugstr_w(pszValue), dwMode); /* Open the key, read in binary data and create stream */ @@ -448,7 +448,7 @@ IStream * WINAPI SHOpenRegStreamA(HKEY hkey, LPCSTR pszSubkey, { IStream *iStream; - TRACE("(%p,%s,%s,0x%08lx)\n", hkey, pszSubkey, pszValue, dwMode); + TRACE("(%p,%s,%s,0x%08x)\n", hkey, pszSubkey, pszValue, dwMode); iStream = SHOpenRegStream2A(hkey, pszSubkey, pszValue, dwMode); return iStream ? iStream : (IStream *)&rsDummyRegStream; @@ -464,7 +464,7 @@ IStream * WINAPI SHOpenRegStreamW(HKEY hkey, LPCWSTR pszSubkey, { IStream *iStream; - TRACE("(%p,%s,%s,0x%08lx)\n", hkey, debugstr_w(pszSubkey), + TRACE("(%p,%s,%s,0x%08x)\n", hkey, debugstr_w(pszSubkey), debugstr_w(pszValue), dwMode); iStream = SHOpenRegStream2W(hkey, pszSubkey, pszValue, dwMode); return iStream ? iStream : (IStream *)&rsDummyRegStream; @@ -491,7 +491,7 @@ IStream * WINAPI SHCreateMemStream(LPBYTE lpbData, DWORD dwDataLen) { IStream *iStrmRet = NULL; - TRACE("(%p,%ld)\n", lpbData, dwDataLen); + TRACE("(%p,%d)\n", lpbData, dwDataLen); if (lpbData) { diff --git a/reactos/dll/win32/shlwapi/resource.h b/reactos/dll/win32/shlwapi/resource.h index d922ceb3e08..7359ffe7c51 100644 --- a/reactos/dll/win32/shlwapi/resource.h +++ b/reactos/dll/win32/shlwapi/resource.h @@ -15,11 +15,16 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef WINE_SHLWAPI_RESOURCE_H #define WINE_SHLWAPI_RESOURCE_H +#define IDS_BYTES_FORMAT 64 +#define IDS_TIME_INTERVAL_HOURS 65 +#define IDS_TIME_INTERVAL_MINUTES 66 +#define IDS_TIME_INTERVAL_SECONDS 67 + /* These numbers match native ID's and shouldn't be abitrarily changed */ #define IDD_ERR_DIALOG 0x1200 #define IDS_ERR_USER_MSG 0x1201 diff --git a/reactos/dll/win32/shlwapi/shlwapi.rbuild b/reactos/dll/win32/shlwapi/shlwapi.rbuild index 4cf0b9c5339..e1a3726cade 100644 --- a/reactos/dll/win32/shlwapi/shlwapi.rbuild +++ b/reactos/dll/win32/shlwapi/shlwapi.rbuild @@ -1,26 +1,30 @@ - + . include/reactos/wine + 0x600 0x501 0x501 - - "" - -nostdlib - -lgcc wine - uuid - msvcrt - ntdll - kernel32 - advapi32 - gdi32 user32 - ole32 + gdi32 + advapi32 + kernel32 + ntdll oleaut32 + ole32 + comctl32 + comdlg32 + mpr + mlang + urlmon + shell32 + winmm + version + uuid assoc.c clist.c istream.c diff --git a/reactos/dll/win32/shlwapi/shlwapi.rc b/reactos/dll/win32/shlwapi/shlwapi.rc index 56262e8268e..f4bf6d5c70c 100644 --- a/reactos/dll/win32/shlwapi/shlwapi.rc +++ b/reactos/dll/win32/shlwapi/shlwapi.rc @@ -15,7 +15,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include "windef.h" @@ -27,16 +27,19 @@ #include "shlwapi_De.rc" #include "shlwapi_En.rc" +#include "shlwapi_Eo.rc" #include "shlwapi_Es.rc" #include "shlwapi_Fi.rc" +#include "shlwapi_Fr.rc" #include "shlwapi_Hu.rc" +#include "shlwapi_It.rc" +#include "shlwapi_Ja.rc" #include "shlwapi_Ko.rc" #include "shlwapi_Nl.rc" #include "shlwapi_No.rc" -#include "shlwapi_It.rc" -#include "shlwapi_Ja.rc" #include "shlwapi_Pl.rc" #include "shlwapi_Pt.rc" #include "shlwapi_Ru.rc" +#include "shlwapi_Tr.rc" #include "shlwapi_Sv.rc" #include "shlwapi_Uk.rc" diff --git a/reactos/dll/win32/shlwapi/shlwapi.spec b/reactos/dll/win32/shlwapi/shlwapi.spec index 4a04e0fd5e1..bca51ee6f2f 100644 --- a/reactos/dll/win32/shlwapi/shlwapi.spec +++ b/reactos/dll/win32/shlwapi/shlwapi.spec @@ -71,7 +71,7 @@ 71 stdcall @(long ptr long) user32.GetClassNameW 72 stdcall @(long ptr long) user32.GetClipboardFormatNameW 73 stdcall @(long ptr) kernel32.GetCurrentDirectoryW -74 stdcall -noname GetDlgItemTextWrapW(long long wstr long) +74 stdcall @(long long wstr long) user32.GetDlgItemTextW 75 stdcall @(wstr) kernel32.GetFileAttributesW 76 stdcall @(wstr long ptr ptr) kernel32.GetFullPathNameW 77 stdcall @(long long ptr long) kernel32.GetLocaleInfoW @@ -260,7 +260,7 @@ 260 stdcall -noname SHQueueUserWorkItem(long long long long long long long) 261 stub -noname SHCreateTimerQueue 262 stub -noname SHDeleteTimerQueue -263 stub -noname SHSetTimerQueueTimer +263 stdcall -noname SHSetTimerQueueTimer(long ptr ptr long long str long) 264 stub -noname SHChangeTimerQueueTimer 265 stub -noname SHCancelTimerQueueTimer 266 stdcall -noname SHRestrictionLookup(long wstr ptr ptr) @@ -281,9 +281,9 @@ 281 stdcall -noname SHPackDispParamsV(ptr ptr ptr ptr) 282 stdcall -noname SHPackDispParams(ptr ptr ptr ptr) 283 stub -noname IConnectionPoint_InvokeWithCancel -284 stdcall -noname IConnectionPoint_SimpleInvoke(ptr ptr ptr) +284 stdcall -noname IConnectionPoint_SimpleInvoke(ptr long ptr) 285 stdcall -noname IConnectionPoint_OnChanged(ptr long) -286 stub -noname IUnknown_CPContainerInvokeParam +286 varargs -noname IUnknown_CPContainerInvokeParam(ptr ptr long ptr long) 287 stdcall -noname IUnknown_CPContainerOnChanged(ptr long) 288 stub -noname IUnknown_CPContainerInvokeIndirect 289 stdcall -noname PlaySoundWrapW(wstr long long) @@ -291,12 +291,12 @@ 291 stdcall -noname SHMessageBoxCheckExA(ptr ptr ptr ptr ptr long str) 292 stdcall -noname SHMessageBoxCheckExW(ptr ptr ptr ptr ptr long wstr) 293 stub -noname SHCancelUserWorkItems -294 stdcall -noname SHGetIniStringW(long long long long long) +294 stdcall -noname SHGetIniStringW(wstr wstr ptr long wstr) 295 stdcall -noname SHSetIniStringW(wstr ptr wstr wstr) 296 stub -noname CreateURLFileContentsW 297 stub -noname CreateURLFileContentsA 298 stdcall @(wstr wstr wstr wstr) kernel32.WritePrivateProfileStringW -299 stdcall -noname ExtTextOutWrapW(long long long long ptr wstr long ptr) +299 stdcall @(long long long long ptr wstr long ptr) gdi32.ExtTextOutW 300 stdcall @(long long long long long long long long long long long long long wstr) gdi32.CreateFontW 301 stdcall @(long wstr long ptr long ptr) user32.DrawTextExW 302 stdcall @(long long long ptr) user32.GetMenuItemInfoW @@ -334,12 +334,12 @@ 334 stdcall -noname SHGetPathFromIDListWrapW(ptr ptr) 335 stdcall -noname ShellExecuteExWrapW(ptr) 336 stdcall -noname SHFileOperationWrapW(ptr) -337 stdcall -noname ExtractIconExWrapW(wstr long ptr ptr long) +337 stdcall @(wstr long ptr ptr long) user32.PrivateExtractIconExW 338 stdcall @(wstr long) kernel32.SetFileAttributesW 339 stdcall @(long long wstr ptr ptr long) kernel32.GetNumberFormatW 340 stdcall @(long wstr wstr long) user32.MessageBoxW 341 stdcall @(long ptr) kernel32.FindNextFileW -342 stdcall -noname SHInterlockedCompareExchange(ptr long long) +342 stdcall -noname SHInterlockedCompareExchange(ptr ptr ptr) 343 stdcall -noname SHRegGetCLSIDKeyA(ptr str long long ptr) 344 stdcall -noname SHRegGetCLSIDKeyW(ptr wstr long long ptr) 345 stdcall -noname SHAnsiToAnsi(str ptr long) @@ -348,7 +348,7 @@ 348 stub -noname SHGetFileDescriptionW 349 stub -noname SHGetFileDescriptionA 350 stdcall -noname GetFileVersionInfoSizeWrapW(wstr ptr) -351 stdcall -noname GetFileVersionInfoWrapW(wstr ptr long ptr) +351 stdcall -noname GetFileVersionInfoWrapW(wstr long long ptr) 352 stdcall -noname VerQueryValueWrapW(ptr wstr ptr ptr) 353 stub -noname SHFormatDateTimeA 354 stub -noname SHFormatDateTimeW @@ -373,31 +373,31 @@ 373 stdcall -noname DdeQueryStringWrapW(long ptr wstr long long) user32.DdeQueryStringW 374 stub -noname SHCheckDiskForMediaA 375 stub -noname SHCheckDiskForMediaW -376 stdcall -noname MLGetUILanguage() # kernel32.GetUserDefaultUILanguage +376 stdcall -noname MLGetUILanguage() kernel32.GetUserDefaultUILanguage 377 stdcall MLLoadLibraryA(str long long) 378 stdcall MLLoadLibraryW(wstr long long) 379 stub -noname Shell_GetCachedImageIndexWrapW 380 stub -noname Shell_GetCachedImageIndexWrapA 381 stub -noname AssocCopyVerbs -382 stub -noname ZoneComputePaneSize +382 stdcall -noname ZoneComputePaneSize(ptr) 383 stub -noname ZoneConfigureW 384 stub -noname SHRestrictedMessageBox 385 stub -noname SHLoadRawAccelerators 386 stub -noname SHQueryRawAccelerator 387 stub -noname SHQueryRawAcceleratorMsg -388 stub -noname ShellMessageBoxWrapW +388 stdcall -noname ShellMessageBoxWrapW(ptr long long wstr long wstr) 389 stdcall -noname GetSaveFileNameWrapW(ptr) 390 stdcall -noname WNetRestoreConnectionWrapW(long wstr) 391 stdcall -noname WNetGetLastErrorWrapW(ptr ptr long ptr long) 392 stdcall -noname EndDialogWrap(ptr ptr) user32.EndDialog 393 stdcall @(long ptr long ptr long) user32.CreateDialogIndirectParamW -394 stdcall @(long ptr long ptr long) user32.CreateDialogIndirectParamA +394 stdcall -noname SHChangeNotify(long long ptr ptr) 395 stub -noname MLWinHelpA 396 stub -noname MLHtmlHelpA 397 stub -noname MLWinHelpW 398 stub -noname MLHtmlHelpW -399 stdcall -noname StrCpyNXA(str str long) -400 stdcall -noname StrCpyNXW(wstr wstr long) +399 stdcall -noname StrCpyNXA(ptr str long) +400 stdcall -noname StrCpyNXW(ptr wstr long) 401 stdcall -noname PageSetupDlgWrapW(ptr) 402 stdcall -noname PrintDlgWrapW(ptr) 403 stdcall -noname GetOpenFileNameWrapW(ptr) @@ -432,7 +432,7 @@ 432 stub -noname SHSendMessageBroadcastA 433 stub -noname SHSendMessageBroadcastW 434 stdcall @(long long long long long long ptr) user32.SendMessageTimeoutW -435 stub -noname CLSIDFromProgIDWrap +435 stdcall -noname CLSIDFromProgIDWrap(wstr ptr) ole32.CLSIDFromProgID 436 stdcall -noname CLSIDFromStringWrap(wstr ptr) 437 stdcall -noname IsOS(long) 438 stub -noname SHLoadRegUIStringA @@ -472,7 +472,7 @@ 472 stub -noname SHCreatePropertyBagOnProfileSelections 473 stub -noname SHGetIniStringUTF7W 474 stub -noname SHSetIniStringUTF7W -475 stub -noname GetShellSecurityDescriptor +475 stdcall -noname GetShellSecurityDescriptor(ptr long) 476 stub -noname SHGetObjectCompatFlags 477 stub -noname SHCreatePropertyBagOnMemory 478 stdcall -noname IUnknown_TranslateAcceleratorIO(ptr ptr) @@ -481,7 +481,7 @@ 481 stdcall -noname IUnknown_HasFocusIO(ptr) 482 stub -noname SHMessageBoxHelpA 483 stub -noname SHMessageBoxHelpW -484 stub -noname IUnknown_QueryServiceExec +484 stdcall -noname IUnknown_QueryServiceExec(ptr ptr ptr long long long ptr) 485 stub -noname MapWin32ErrorToSTG 486 stub -noname ModeToCreateFileFlags @@ -507,7 +507,7 @@ 511 stub -noname PathFileExistsDefExtAndAttributesW 512 stub -noname IStream_ReadPidl 513 stub -noname IStream_WritePidl -514 stub -noname IUnknown_ProfferService +514 stdcall -noname IUnknown_ProfferService(ptr ptr ptr ptr) 516 stdcall -noname SKGetValueW(long wstr wstr long long long) 517 stub -noname SKSetValueW @@ -766,7 +766,7 @@ @ stdcall StrCmpNIW (wstr wstr long) @ stdcall StrCmpNW (wstr wstr long) @ stdcall StrCmpW (wstr wstr) -@ stdcall StrCpyNW (wstr wstr long) +@ stdcall StrCpyNW (ptr wstr long) @ stdcall StrCpyW (ptr wstr) @ stdcall StrDupA (str) @ stdcall StrDupW (wstr) diff --git a/reactos/dll/win32/shlwapi/shlwapi_De.rc b/reactos/dll/win32/shlwapi/shlwapi_De.rc index 1e801eaaff6..eaad902bff8 100644 --- a/reactos/dll/win32/shlwapi/shlwapi_De.rc +++ b/reactos/dll/win32/shlwapi/shlwapi_De.rc @@ -15,7 +15,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL @@ -33,3 +33,11 @@ FONT 8, "MS Shell Dlg" PUSHBUTTON L"&Ja" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON L"&Nein" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP } + +STRINGTABLE DISCARDABLE +{ + IDS_BYTES_FORMAT "%ld Bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" +} diff --git a/reactos/dll/win32/shlwapi/shlwapi_En.rc b/reactos/dll/win32/shlwapi/shlwapi_En.rc index 3995b6b2dac..5a327f0e006 100644 --- a/reactos/dll/win32/shlwapi/shlwapi_En.rc +++ b/reactos/dll/win32/shlwapi/shlwapi_En.rc @@ -15,10 +15,10 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT IDD_ERR_DIALOG DIALOG MOVEABLE DISCARDABLE 0, 0, 220, 60 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU @@ -33,3 +33,11 @@ FONT 8, "MS Shell Dlg" PUSHBUTTON L"&Yes" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON L"&No" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP } + +STRINGTABLE DISCARDABLE +{ + IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" +} diff --git a/reactos/dll/win32/shlwapi/shlwapi_Eo.rc b/reactos/dll/win32/shlwapi/shlwapi_Eo.rc new file mode 100644 index 00000000000..71b3710f6d5 --- /dev/null +++ b/reactos/dll/win32/shlwapi/shlwapi_Eo.rc @@ -0,0 +1,43 @@ +/* + * Shlwapi - Esperanto Language Support + * + * Copyright 2006 Antonio Codazzi + * + * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +LANGUAGE LANG_ESPERANTO, SUBLANG_DEFAULT + +IDD_ERR_DIALOG DIALOG MOVEABLE DISCARDABLE 0, 0, 220, 60 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Eroro!" +FONT 8, "MS Shell Dlg" +{ + LTEXT "", IDS_ERR_USER_MSG2, 15, 5, 28, 20 + LTEXT "", IDS_ERR_USER_MSG, 15, 5, 210, 8 + CHECKBOX "Ne elmontru ree &æi mesaøon", IDC_ERR_DONT_SHOW, 5, 20, 210, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Bone" IDOK, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Rezigni" IDCANCEL, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Jes" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Ne" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP +} + +STRINGTABLE DISCARDABLE +{ + IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" +} diff --git a/reactos/dll/win32/shlwapi/shlwapi_Es.rc b/reactos/dll/win32/shlwapi/shlwapi_Es.rc index b3531ed3e41..3a325db2c07 100644 --- a/reactos/dll/win32/shlwapi/shlwapi_Es.rc +++ b/reactos/dll/win32/shlwapi/shlwapi_Es.rc @@ -15,7 +15,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL @@ -33,3 +33,11 @@ FONT 8, "MS Shell Dlg" PUSHBUTTON L"&Sí" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON L"&No" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP } + +STRINGTABLE DISCARDABLE +{ + IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" +} diff --git a/reactos/dll/win32/shlwapi/shlwapi_Fi.rc b/reactos/dll/win32/shlwapi/shlwapi_Fi.rc index 6787a59a5af..ea9b3950845 100644 --- a/reactos/dll/win32/shlwapi/shlwapi_Fi.rc +++ b/reactos/dll/win32/shlwapi/shlwapi_Fi.rc @@ -15,7 +15,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT @@ -33,3 +33,11 @@ FONT 8, "MS Shell Dlg" PUSHBUTTON L"&Kyllä" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON L"&Ei" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP } + +STRINGTABLE DISCARDABLE +{ + IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" +} diff --git a/reactos/dll/win32/shlwapi/shlwapi_Fr.rc b/reactos/dll/win32/shlwapi/shlwapi_Fr.rc new file mode 100644 index 00000000000..842a67cb33e --- /dev/null +++ b/reactos/dll/win32/shlwapi/shlwapi_Fr.rc @@ -0,0 +1,43 @@ +/* + * French resources for shlwapi + * + * Copyright 2006 Jonathan Ernst + * + * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL + +IDD_ERR_DIALOG DIALOG MOVEABLE DISCARDABLE 0, 0, 220, 60 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Erreur!" +FONT 8, "MS Shell Dlg" +{ + LTEXT "", IDS_ERR_USER_MSG2, 15, 5, 28, 20 + LTEXT "", IDS_ERR_USER_MSG, 15, 5, 210, 8 + CHECKBOX "Ne plus me montrer ce message", 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"&Annuler" IDCANCEL, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Oui" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Non" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP +} + +STRINGTABLE DISCARDABLE +{ + IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" +} diff --git a/reactos/dll/win32/shlwapi/shlwapi_Hu.rc b/reactos/dll/win32/shlwapi/shlwapi_Hu.rc index 37d5243a9d1..9aa253e45ba 100644 --- a/reactos/dll/win32/shlwapi/shlwapi_Hu.rc +++ b/reactos/dll/win32/shlwapi/shlwapi_Hu.rc @@ -1,9 +1,7 @@ /* * Hungarian resources for shlwapi * - * Copyright 2004 Jon Griffiths - * Copyright 2005 Robert Horvath - Hungarian translation - talley at cubeclub.hu - * + * Copyright 2006 Andras Kovacs * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -17,7 +15,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT @@ -29,9 +27,17 @@ FONT 8, "MS Shell Dlg" { LTEXT "", IDS_ERR_USER_MSG2, 15, 5, 28, 20 LTEXT "", IDS_ERR_USER_MSG, 15, 5, 210, 8 - CHECKBOX "Ne &jelenítse meg többet ezt a hibaüznetet", IDC_ERR_DONT_SHOW, 5, 20, 210, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Ne jelení&tse meg ezt az üzenetet ismét", 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"&Mégse" IDCANCEL, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON L"&Igen" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON L"&Nem" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP } + +STRINGTABLE DISCARDABLE +{ + IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" +} diff --git a/reactos/dll/win32/shlwapi/shlwapi_It.rc b/reactos/dll/win32/shlwapi/shlwapi_It.rc index 05258c35fa5..b62f4940abd 100644 --- a/reactos/dll/win32/shlwapi/shlwapi_It.rc +++ b/reactos/dll/win32/shlwapi/shlwapi_It.rc @@ -15,7 +15,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL @@ -33,3 +33,11 @@ FONT 8, "MS Shell Dlg" PUSHBUTTON L"&Si" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON L"&No" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP } + +STRINGTABLE DISCARDABLE +{ + IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" +} diff --git a/reactos/dll/win32/shlwapi/shlwapi_Ja.rc b/reactos/dll/win32/shlwapi/shlwapi_Ja.rc index 188bf52e32a..dbcc44123ce 100644 --- a/reactos/dll/win32/shlwapi/shlwapi_Ja.rc +++ b/reactos/dll/win32/shlwapi/shlwapi_Ja.rc @@ -15,7 +15,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT @@ -27,9 +27,17 @@ FONT 9, "MS UI Gothic" { LTEXT "", IDS_ERR_USER_MSG2, 15, 5, 28, 20 LTEXT "", IDS_ERR_USER_MSG, 15, 5, 210, 8 - CHECKBOX "¡Œã‚Í‚±‚̃ƒbƒZ[ƒW‚ð•\\Ž¦‚µ‚È‚¢(&I)", IDC_ERR_DONT_SHOW, 5, 20, 210, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON L"OK (&O)" IDOK, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP + CHECKBOX "¡Œã‚Í‚±‚̃ƒbƒZ[ƒW‚ð•\Ž¦‚µ‚È‚¢(&i)", 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"ƒLƒƒƒ“ƒZƒ‹(&C)" IDCANCEL, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON L"‚Í‚¢(&Y)" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON L"‚¢‚¢‚¦(&N)" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP } + +STRINGTABLE DISCARDABLE +{ + IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" +} diff --git a/reactos/dll/win32/shlwapi/shlwapi_Ko.rc b/reactos/dll/win32/shlwapi/shlwapi_Ko.rc index a158a6a8ad8..3a9bbbeef5d 100644 --- a/reactos/dll/win32/shlwapi/shlwapi_Ko.rc +++ b/reactos/dll/win32/shlwapi/shlwapi_Ko.rc @@ -15,10 +15,10 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT +LANGUAGE LANG_KOREAN, SUBLANG_NEUTRAL IDD_ERR_DIALOG DIALOG MOVEABLE DISCARDABLE 0, 0, 220, 60 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU @@ -33,3 +33,12 @@ FONT 8, "MS Shell Dlg" PUSHBUTTON L"¿¹(&Y)" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON L"¾Æ´Ï¿À(&N)" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP } + + +STRINGTABLE DISCARDABLE +{ + IDS_BYTES_FORMAT "%ld ¹ÙÀÌÆ®" + IDS_TIME_INTERVAL_HOURS "½Ã" + IDS_TIME_INTERVAL_MINUTES " ºÐ" + IDS_TIME_INTERVAL_SECONDS " ÃÊ" +} diff --git a/reactos/dll/win32/shlwapi/shlwapi_Nl.rc b/reactos/dll/win32/shlwapi/shlwapi_Nl.rc index cba23d512ab..c7ac3e7d131 100644 --- a/reactos/dll/win32/shlwapi/shlwapi_Nl.rc +++ b/reactos/dll/win32/shlwapi/shlwapi_Nl.rc @@ -15,7 +15,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL @@ -33,3 +33,11 @@ FONT 8, "MS Shell Dlg" PUSHBUTTON L"&Ja" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON L"&Nee" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP } + +STRINGTABLE DISCARDABLE +{ + IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" +} diff --git a/reactos/dll/win32/shlwapi/shlwapi_No.rc b/reactos/dll/win32/shlwapi/shlwapi_No.rc index 7e43aebd483..4df42c87dd0 100644 --- a/reactos/dll/win32/shlwapi/shlwapi_No.rc +++ b/reactos/dll/win32/shlwapi/shlwapi_No.rc @@ -1,7 +1,7 @@ /* * Norwegian Bokmål resources for shlwapi * - * Copyright 2005 Alexander N. Sørnes + * Copyright 2005-2006 Alexander N. Sørnes * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -15,10 +15,10 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -LANGUAGE LANG_NORWEGIAN, SUBLANG_NEUTRAL +LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL IDD_ERR_DIALOG DIALOG MOVEABLE DISCARDABLE 0, 0, 220, 60 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU @@ -33,3 +33,11 @@ FONT 8, "MS Shell Dlg" PUSHBUTTON L"&Ja" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON L"&Nei" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP } + +STRINGTABLE DISCARDABLE +{ + IDS_BYTES_FORMAT "%ld byte" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" +} diff --git a/reactos/dll/win32/shlwapi/shlwapi_Pl.rc b/reactos/dll/win32/shlwapi/shlwapi_Pl.rc index 0b8e03c97ef..467ee8d1f76 100644 --- a/reactos/dll/win32/shlwapi/shlwapi_Pl.rc +++ b/reactos/dll/win32/shlwapi/shlwapi_Pl.rc @@ -1,7 +1,8 @@ /* - * Polish resources for shlwapi + * English resources for shlwapi * - * Copyright 2005 Sebastian Gasiorek + * Copyright 2004 Jon Griffiths + * Copyright 2006 Mikolaj Zalewski * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -15,7 +16,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT @@ -27,9 +28,17 @@ FONT 8, "MS Shell Dlg" { LTEXT "", IDS_ERR_USER_MSG2, 15, 5, 28, 20 LTEXT "", IDS_ERR_USER_MSG, 15, 5, 210, 8 - CHECKBOX "Ni&e pokazuj tego okna dialogowego w przysz³oœci", IDC_ERR_DONT_SHOW, 5, 20, 210, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Nie pokazuj w&iêcej tego komunikatu", 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"&Anuluj" IDCANCEL, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON L"&Tak" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON L"&Nie" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP } + +STRINGTABLE DISCARDABLE +{ + IDS_BYTES_FORMAT "%ld bajtów" + IDS_TIME_INTERVAL_HOURS " godz." + IDS_TIME_INTERVAL_MINUTES " min." + IDS_TIME_INTERVAL_SECONDS " s" +} diff --git a/reactos/dll/win32/shlwapi/shlwapi_Pt.rc b/reactos/dll/win32/shlwapi/shlwapi_Pt.rc index 1372f23d626..92914a4359d 100644 --- a/reactos/dll/win32/shlwapi/shlwapi_Pt.rc +++ b/reactos/dll/win32/shlwapi/shlwapi_Pt.rc @@ -1,7 +1,8 @@ -/* +/* * Portuguese resources for shlwapi * * Copyright 2004 Marcelo Duarte + * Copyright 2006 Américo José Melo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -15,10 +16,10 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL +LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN IDD_ERR_DIALOG DIALOG MOVEABLE DISCARDABLE 0, 0, 220, 60 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU @@ -27,9 +28,36 @@ FONT 8, "MS Shell Dlg" { LTEXT "", IDS_ERR_USER_MSG2, 15, 5, 28, 20 LTEXT "", IDS_ERR_USER_MSG, 15, 5, 210, 8 - CHECKBOX "Não &me mostre essa mensagem novamente", IDC_ERR_DONT_SHOW, 5, 20, 210, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Não &me mostre essa mensagem novamente", 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"&Cancelar" IDCANCEL, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON L"&Sim" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP - PUSHBUTTON L"&Não" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Não" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP +} + +LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE + +IDD_ERR_DIALOG DIALOG MOVEABLE DISCARDABLE 0, 0, 220, 60 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Erro!" +FONT 8, "MS Shell Dlg" +{ + LTEXT "", IDS_ERR_USER_MSG2, 15, 5, 28, 20 + LTEXT "", IDS_ERR_USER_MSG, 15, 5, 210, 8 + CHECKBOX "Não &mostre esta mensagem novamente", 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"&Cancelar" IDCANCEL, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Sim" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Não" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP +} + + +LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN + +STRINGTABLE DISCARDABLE +{ + IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" } diff --git a/reactos/dll/win32/shlwapi/shlwapi_Ru.rc b/reactos/dll/win32/shlwapi/shlwapi_Ru.rc index fea1c3904e0..59a8bee5bc7 100644 --- a/reactos/dll/win32/shlwapi/shlwapi_Ru.rc +++ b/reactos/dll/win32/shlwapi/shlwapi_Ru.rc @@ -33,3 +33,11 @@ FONT 8, "MS Shell Dlg" PUSHBUTTON L"&Äà" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON L"&Íåò" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP } + +STRINGTABLE DISCARDABLE +{ + IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" +} diff --git a/reactos/dll/win32/shlwapi/shlwapi_Sv.rc b/reactos/dll/win32/shlwapi/shlwapi_Sv.rc index 17e339f2bd7..40953a7fd38 100644 --- a/reactos/dll/win32/shlwapi/shlwapi_Sv.rc +++ b/reactos/dll/win32/shlwapi/shlwapi_Sv.rc @@ -33,3 +33,11 @@ FONT 8, "MS Shell Dlg" PUSHBUTTON L"&Ja" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON L"&Nej" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP } + +STRINGTABLE DISCARDABLE +{ + IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" +} diff --git a/reactos/dll/win32/shlwapi/shlwapi_Tr.rc b/reactos/dll/win32/shlwapi/shlwapi_Tr.rc new file mode 100644 index 00000000000..15453623df3 --- /dev/null +++ b/reactos/dll/win32/shlwapi/shlwapi_Tr.rc @@ -0,0 +1,43 @@ +/* + * Turkish resources for shlwapi + * + * Copyright 2006 Fatih Aþýcý + * + * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT + +IDD_ERR_DIALOG DIALOG MOVEABLE DISCARDABLE 0, 0, 220, 60 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Hata!" +FONT 8, "MS Shell Dlg" +{ + LTEXT "", IDS_ERR_USER_MSG2, 15, 5, 28, 20 + LTEXT "", IDS_ERR_USER_MSG, 15, 5, 210, 8 + CHECKBOX "Bu iletiyi bir daha &gösterme", IDC_ERR_DONT_SHOW, 5, 20, 210, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Tamam" IDOK, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Ýptal" IDCANCEL, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Evet" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Hayýr" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP +} + +STRINGTABLE DISCARDABLE +{ + IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" +} diff --git a/reactos/dll/win32/shlwapi/shlwapi_Uk.rc b/reactos/dll/win32/shlwapi/shlwapi_Uk.rc index 309274b3ffa..cdaa1cc3d49 100644 --- a/reactos/dll/win32/shlwapi/shlwapi_Uk.rc +++ b/reactos/dll/win32/shlwapi/shlwapi_Uk.rc @@ -21,3 +21,11 @@ FONT 8, "MS Shell Dlg" PUSHBUTTON L"&Òàê" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON L"&ͳ" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP } + +STRINGTABLE DISCARDABLE +{ + IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" +} diff --git a/reactos/dll/win32/shlwapi/shlwapi_main.c b/reactos/dll/win32/shlwapi/shlwapi_main.c index 1624f96a672..e595d5fefba 100644 --- a/reactos/dll/win32/shlwapi/shlwapi_main.c +++ b/reactos/dll/win32/shlwapi/shlwapi_main.c @@ -16,31 +16,21 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include "windef.h" #include "winbase.h" -#include "winerror.h" -#include "wine/debug.h" #define NO_SHLWAPI_REG #define NO_SHLWAPI_STREAM #include "shlwapi.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(shell); HINSTANCE shlwapi_hInstance = 0; -HMODULE SHLWAPI_hshell32 = 0; -HMODULE SHLWAPI_hwinmm = 0; -HMODULE SHLWAPI_hcomdlg32 = 0; -HMODULE SHLWAPI_hcomctl32 = 0; -HMODULE SHLWAPI_hmpr = 0; -HMODULE SHLWAPI_hmlang = 0; -HMODULE SHLWAPI_hurlmon = 0; -HMODULE SHLWAPI_hversion = 0; - DWORD SHLWAPI_ThreadRef_index = TLS_OUT_OF_INDEXES; /************************************************************************* @@ -65,7 +55,7 @@ DWORD SHLWAPI_ThreadRef_index = TLS_OUT_OF_INDEXES; */ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) { - TRACE("%p 0x%lx %p\n", hinstDLL, fdwReason, fImpLoad); + TRACE("%p 0x%x %p\n", hinstDLL, fdwReason, fImpLoad); switch (fdwReason) { case DLL_PROCESS_ATTACH: @@ -74,14 +64,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) SHLWAPI_ThreadRef_index = TlsAlloc(); break; case DLL_PROCESS_DETACH: - if (SHLWAPI_hshell32) FreeLibrary(SHLWAPI_hshell32); - if (SHLWAPI_hwinmm) FreeLibrary(SHLWAPI_hwinmm); - if (SHLWAPI_hcomdlg32) FreeLibrary(SHLWAPI_hcomdlg32); - if (SHLWAPI_hcomctl32) FreeLibrary(SHLWAPI_hcomctl32); - if (SHLWAPI_hmpr) FreeLibrary(SHLWAPI_hmpr); - if (SHLWAPI_hmlang) FreeLibrary(SHLWAPI_hmlang); - if (SHLWAPI_hurlmon) FreeLibrary(SHLWAPI_hurlmon); - if (SHLWAPI_hversion) FreeLibrary(SHLWAPI_hversion); if (SHLWAPI_ThreadRef_index != TLS_OUT_OF_INDEXES) TlsFree(SHLWAPI_ThreadRef_index); break; } @@ -115,16 +97,16 @@ HRESULT WINAPI DllGetVersion (DLLVERSIONINFO *pdvi) { case sizeof(DLLVERSIONINFO2): pdvi2->dwFlags = 0; - pdvi2->ullVersion = MAKEDLLVERULL(5, 0, 2314, 0); + pdvi2->ullVersion = MAKEDLLVERULL(6, 0, 2800, 1612); /* Fall through */ case sizeof(DLLVERSIONINFO): - pdvi2->info1.dwMajorVersion = 5; + pdvi2->info1.dwMajorVersion = 6; pdvi2->info1.dwMinorVersion = 0; - pdvi2->info1.dwBuildNumber = 2314; - pdvi2->info1.dwPlatformID = 1000; + pdvi2->info1.dwBuildNumber = 2800; + pdvi2->info1.dwPlatformID = DLLVER_PLATFORM_WINDOWS; return S_OK; } if (pdvi) - WARN("pdvi->cbSize = %ld, unhandled\n", pdvi2->info1.cbSize); + WARN("pdvi->cbSize = %d, unhandled\n", pdvi2->info1.cbSize); return E_INVALIDARG; } diff --git a/reactos/dll/win32/shlwapi/shlwapi_ros.diff b/reactos/dll/win32/shlwapi/shlwapi_ros.diff index 6a6c7f9b34a..779ba3281d5 100644 --- a/reactos/dll/win32/shlwapi/shlwapi_ros.diff +++ b/reactos/dll/win32/shlwapi/shlwapi_ros.diff @@ -2,16 +2,127 @@ Index: shlwapi.rc =================================================================== --- shlwapi.rc (revision 25691) +++ shlwapi.rc (revision 25692) -@@ -39,3 +39,4 @@ +@@ -39,4 +39,7 @@ + #include "shlwapi_No.rc" + #include "shlwapi_Pl.rc" #include "shlwapi_Pt.rc" - #include "shlwapi_Ru.rc" - #include "shlwapi_Sv.rc" ++#include "shlwapi_Ru.rc" + #include "shlwapi_Tr.rc" ++#include "shlwapi_Sv.rc" +#include "shlwapi_Uk.rc" +Index: shlwapi_Ru.rc +=================================================================== +--- shlwapi_Ru.rc (revision 25692) ++++ shlwapi_Ru.rc (working copy) +@@ -0,0 +1,43 @@ ++/* ++ * Russian resources for shlwapi ++ * ++ * Copyright 2005 Mikhail Y. Zvyozdochkin ++ * ++ * 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_RUSSIAN, SUBLANG_DEFAULT ++ ++IDD_ERR_DIALOG DIALOG MOVEABLE DISCARDABLE 0, 0, 220, 60 ++STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU ++CAPTION "Îøèáêà!" ++FONT 8, "MS Shell Dlg" ++{ ++ LTEXT "", IDS_ERR_USER_MSG2, 15, 5, 28, 20 ++ LTEXT "", IDS_ERR_USER_MSG, 15, 5, 210, 8 ++ CHECKBOX "&Áîëüøå íå ïîêàçûâàòü ýòî ñîîáùåíèå", 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"&Îòìåíà" IDCANCEL, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP ++ PUSHBUTTON L"&Äà" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP ++ PUSHBUTTON L"&Íåò" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP ++} ++ ++STRINGTABLE DISCARDABLE ++{ ++ IDS_BYTES_FORMAT "%ld bytes" ++ IDS_TIME_INTERVAL_HOURS " hr" ++ IDS_TIME_INTERVAL_MINUTES " min" ++ IDS_TIME_INTERVAL_SECONDS " sec" ++} + +Property shlwapi_Ru.rc +___________________________________________________________________ +Name: svn:eol-style + + native + +Index: shlwapi_Sv.rc +=================================================================== +--- shlwapi_Sv.rc (revision 25692) ++++ shlwapi_Sv.rc (working copy) +@@ -0,0 +1,43 @@ ++/* ++ * Swedish resources for shlwapi ++ * ++ * Copyright 2005 Andreas Bjerkeholt ++ * ++ * 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_SWEDISH, SUBLANG_NEUTRAL ++ ++IDD_ERR_DIALOG DIALOG MOVEABLE DISCARDABLE 0, 0, 220, 60 ++STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU ++CAPTION "Fel!" ++FONT 8, "MS Shell Dlg" ++{ ++ LTEXT "", IDS_ERR_USER_MSG2, 15, 5, 28, 20 ++ LTEXT "", IDS_ERR_USER_MSG, 15, 5, 210, 8 ++ CHECKBOX "&Visa inte detta meddelande igen", 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"&Avbryt" IDCANCEL, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP ++ PUSHBUTTON L"&Ja" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP ++ PUSHBUTTON L"&Nej" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP ++} ++ ++STRINGTABLE DISCARDABLE ++{ ++ IDS_BYTES_FORMAT "%ld bytes" ++ IDS_TIME_INTERVAL_HOURS " hr" ++ IDS_TIME_INTERVAL_MINUTES " min" ++ IDS_TIME_INTERVAL_SECONDS " sec" ++} + +Property shlwapi_Sv.rc +___________________________________________________________________ +Name: svn:eol-style + + native + Index: shlwapi_Uk.rc =================================================================== ---- D:/development/os/reactos/dll/win32/shlwapi/shlwapi_Uk.rc (revision 25692) -+++ D:/development/os/reactos/dll/win32/shlwapi/shlwapi_Uk.rc (working copy) -@@ -0,0 +1,23 @@ +--- shlwapi_Uk.rc (revision 25692) ++++ shlwapi_Uk.rc (working copy) +@@ -0,0 +1,31 @@ +/* + * PROJECT: Shell Light-weight Utility Library + * LICENSE: GPL - See COPYING in the top level directory @@ -35,6 +146,14 @@ Index: shlwapi_Uk.rc + PUSHBUTTON L"&Òàê" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&ͳ" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP +} ++ ++STRINGTABLE DISCARDABLE ++{ ++ IDS_BYTES_FORMAT "%ld bytes" ++ IDS_TIME_INTERVAL_HOURS " hr" ++ IDS_TIME_INTERVAL_MINUTES " min" ++ IDS_TIME_INTERVAL_SECONDS " sec" ++} Property shlwapi_Uk.rc ___________________________________________________________________ diff --git a/reactos/dll/win32/shlwapi/stopwatch.c b/reactos/dll/win32/shlwapi/stopwatch.c index 4e092a45050..7f86fded4b4 100644 --- a/reactos/dll/win32/shlwapi/stopwatch.c +++ b/reactos/dll/win32/shlwapi/stopwatch.c @@ -15,7 +15,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * NOTES * These functions probably never need to be implemented unless we @@ -55,7 +55,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); * NOTES * If this function returns 0, no further StopWatch functions should be called. */ -DWORD WINAPI StopWatchMode() +DWORD WINAPI StopWatchMode(void) { FIXME("() stub!\n"); return 0; @@ -72,7 +72,7 @@ DWORD WINAPI StopWatchMode() * RETURNS * Nothing. */ -void WINAPI StopWatchFlush() +void WINAPI StopWatchFlush(void) { FIXME("() stub!\n"); } @@ -96,7 +96,7 @@ void WINAPI StopWatchFlush() DWORD WINAPI StopWatchW(DWORD dwClass, LPCWSTR lpszStr, DWORD dwUnknown, DWORD dwMode, DWORD dwTimeStamp) { - FIXME("(%ld,%s,%ld,%ld,%ld) stub!\n", dwClass, debugstr_w(lpszStr), + FIXME("(%d,%s,%d,%d,%d) stub!\n", dwClass, debugstr_w(lpszStr), dwUnknown, dwMode, dwTimeStamp); return ERROR_SUCCESS; } @@ -174,7 +174,7 @@ void WINAPI StopWatch_MarkFrameStart(LPCSTR lpszName) */ void WINAPI StopWatch_MarkJavaStop(LPCWSTR lpszEvent, HWND hWnd, DWORD dwReserved) { - FIXME("(%s,%p,0x%08lx) stub!\n", debugstr_w(lpszEvent), hWnd, dwReserved); + FIXME("(%s,%p,0x%08x) stub!\n", debugstr_w(lpszEvent), hWnd, dwReserved); } /************************************************************************* @@ -188,7 +188,7 @@ void WINAPI StopWatch_MarkJavaStop(LPCWSTR lpszEvent, HWND hWnd, DWORD dwReserve * RETURNS * The low 32 bits of the current performance counter reading. */ -DWORD WINAPI GetPerfTime() +DWORD WINAPI GetPerfTime(void) { static LONG64 iCounterFreq = 0; LARGE_INTEGER iCounter; @@ -218,7 +218,7 @@ DWORD WINAPI GetPerfTime() */ DWORD WINAPI StopWatch_SetMsgLastLocation(DWORD dwUnknown) { - FIXME("(%ld) stub!\n", dwUnknown); + FIXME("(%d) stub!\n", dwUnknown); return dwUnknown; } diff --git a/reactos/dll/win32/shlwapi/string.c b/reactos/dll/win32/shlwapi/string.c index d3e9faa90fd..b2cd7f28e47 100644 --- a/reactos/dll/win32/shlwapi/string.c +++ b/reactos/dll/win32/shlwapi/string.c @@ -16,10 +16,9 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define COM_NO_WINDOWS_H #include "config.h" #include "wine/port.h" @@ -27,7 +26,6 @@ #include #include #include -#include #define NONAMELESSUNION #define NONAMELESSSTRUCT @@ -39,29 +37,109 @@ #include "wingdi.h" #include "winuser.h" #include "shlobj.h" +#include "mlang.h" #include "ddeml.h" #include "wine/unicode.h" #include "wine/debug.h" +#include "resource.h" + WINE_DEFAULT_DEBUG_CHANNEL(shell); -/* Get a function pointer from a DLL handle */ -#define GET_FUNC(func, module, name, fail) \ - do { \ - if (!func) { \ - if (!SHLWAPI_h##module && !(SHLWAPI_h##module = LoadLibraryA(#module ".dll"))) return fail; \ - func = (fn##func)GetProcAddress(SHLWAPI_h##module, name); \ - if (!func) return fail; \ - } \ - } while (0) +extern HINSTANCE shlwapi_hInstance; -extern HMODULE SHLWAPI_hmlang; +static HRESULT _SHStrDupAA(LPCSTR,LPSTR*); +static HRESULT _SHStrDupAW(LPCWSTR,LPSTR*); -typedef HRESULT (WINAPI *fnpConvertINetUnicodeToMultiByte)(LPDWORD,DWORD,LPCWSTR,LPINT,LPSTR,LPINT); -static fnpConvertINetUnicodeToMultiByte pConvertINetUnicodeToMultiByte; -static HRESULT WINAPI _SHStrDupAA(LPCSTR,LPSTR*); -static HRESULT WINAPI _SHStrDupAW(LPCWSTR,LPSTR*); +static void FillNumberFmt(NUMBERFMTW *fmt, LPWSTR decimal_buffer, int decimal_bufwlen, + LPWSTR thousand_buffer, int thousand_bufwlen) +{ + WCHAR grouping[64]; + WCHAR *c; + + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_ILZERO|LOCALE_RETURN_NUMBER, (LPWSTR)&fmt->LeadingZero, sizeof(fmt->LeadingZero)/sizeof(WCHAR)); + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_INEGNUMBER|LOCALE_RETURN_NUMBER, (LPWSTR)&fmt->LeadingZero, sizeof(fmt->NegativeOrder)/sizeof(WCHAR)); + fmt->NumDigits = 0; + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, decimal_buffer, decimal_bufwlen); + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, thousand_buffer, thousand_bufwlen); + fmt->lpThousandSep = thousand_buffer; + fmt->lpDecimalSep = decimal_buffer; + + /* + * Converting grouping string to number as described on + * http://blogs.msdn.com/oldnewthing/archive/2006/04/18/578251.aspx + */ + fmt->Grouping = 0; + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SGROUPING, grouping, sizeof(grouping)/sizeof(WCHAR)); + for (c = grouping; *c; c++) + if (*c >= '0' && *c < '9') + { + fmt->Grouping *= 10; + fmt->Grouping += *c - '0'; + } + + if (fmt->Grouping % 10 == 0) + fmt->Grouping /= 10; + else + fmt->Grouping *= 10; +} + +/************************************************************************* + * FormatInt [internal] + * + * Format an integer according to the current locale + * + * RETURNS + * The number of bytes written on success or 0 on failure + */ +static int FormatInt(LONGLONG qdwValue, LPWSTR pszBuf, int cchBuf) +{ + NUMBERFMTW fmt; + WCHAR decimal[8], thousand[8]; + WCHAR buf[24]; + WCHAR *c; + BOOL neg = (qdwValue < 0); + + FillNumberFmt(&fmt, decimal, sizeof decimal / sizeof (WCHAR), + thousand, sizeof thousand / sizeof (WCHAR)); + + c = &buf[24]; + *(--c) = 0; + do + { + *(--c) = '0' + (qdwValue%10); + qdwValue /= 10; + } while (qdwValue > 0); + if (neg) + *(--c) = '-'; + + return GetNumberFormatW(LOCALE_USER_DEFAULT, 0, c, &fmt, pszBuf, cchBuf); +} + +/************************************************************************* + * FormatDouble [internal] + * + * Format an integer according to the current locale. Prints the specified number of digits + * after the decimal point + * + * RETURNS + * The number of bytes written on success or 0 on failure + */ +static int FormatDouble(double value, int decimals, LPWSTR pszBuf, int cchBuf) +{ + static const WCHAR flfmt[] = {'%','f',0}; + WCHAR buf[64]; + NUMBERFMTW fmt; + WCHAR decimal[8], thousand[8]; + + snprintfW(buf, 64, flfmt, value); + + FillNumberFmt(&fmt, decimal, sizeof decimal / sizeof (WCHAR), + thousand, sizeof thousand / sizeof (WCHAR)); + fmt.NumDigits = decimals; + return GetNumberFormatW(LOCALE_USER_DEFAULT, 0, buf, &fmt, pszBuf, cchBuf); +} /************************************************************************* * SHLWAPI_ChrCmpHelperA @@ -69,14 +147,14 @@ static HRESULT WINAPI _SHStrDupAW(LPCWSTR,LPSTR*); * Internal helper for SHLWAPI_ChrCmpA/ChrCMPIA. * * NOTES - * Both this function and its Unicode counterpart are very inneficient. To + * Both this function and its Unicode counterpart are very inefficient. To * fix this, CompareString must be completely implemented and optimised * first. Then the core character test can be taken out of that function and * placed here, so that it need never be called at all. Until then, do not * attempt to optimise this code unless you are willing to test that it * still performs correctly. */ -static BOOL WINAPI SHLWAPI_ChrCmpHelperA(WORD ch1, WORD ch2, DWORD dwFlags) +static BOOL SHLWAPI_ChrCmpHelperA(WORD ch1, WORD ch2, DWORD dwFlags) { char str1[3], str2[3]; @@ -101,22 +179,6 @@ static BOOL WINAPI SHLWAPI_ChrCmpHelperA(WORD ch1, WORD ch2, DWORD dwFlags) return CompareStringA(GetThreadLocale(), dwFlags, str1, -1, str2, -1) - 2; } -/************************************************************************* - * SHLWAPI_ChrCmpHelperW - * - * Internal helper for SHLWAPI_ChrCmpW/ChrCmpIW. - */ -static BOOL WINAPI SHLWAPI_ChrCmpHelperW(WCHAR ch1, WCHAR ch2, DWORD dwFlags) -{ - WCHAR str1[2], str2[2]; - - str1[0] = ch1; - str1[1] = '\0'; - str2[0] = ch2; - str2[1] = '\0'; - return CompareStringW(GetThreadLocale(), dwFlags, str1, 2, str2, 2) - 2; -} - /************************************************************************* * SHLWAPI_ChrCmpA * @@ -147,16 +209,6 @@ BOOL WINAPI ChrCmpIA(WORD ch1, WORD ch2) return SHLWAPI_ChrCmpHelperA(ch1, ch2, NORM_IGNORECASE); } -/************************************************************************* - * SHLWAPI_ChrCmpW - * - * Internal helper function. - */ -static BOOL WINAPI SHLWAPI_ChrCmpW(WCHAR ch1, WCHAR ch2) -{ - return SHLWAPI_ChrCmpHelperW(ch1, ch2, 0); -} - /************************************************************************* * ChrCmpIW [SHLWAPI.386] * @@ -164,7 +216,7 @@ static BOOL WINAPI SHLWAPI_ChrCmpW(WCHAR ch1, WCHAR ch2) */ BOOL WINAPI ChrCmpIW(WCHAR ch1, WCHAR ch2) { - return SHLWAPI_ChrCmpHelperW(ch1, ch2, NORM_IGNORECASE); + return CompareStringW(GetThreadLocale(), NORM_IGNORECASE, &ch1, 1, &ch2, 1) - 2; } /************************************************************************* @@ -259,7 +311,7 @@ LPWSTR WINAPI StrChrIW(LPCWSTR lpszStr, WCHAR ch) { if (toupperW(*lpszStr) == ch) return (LPWSTR)lpszStr; - lpszStr = CharNextW(lpszStr); + lpszStr++; } lpszStr = NULL; } @@ -458,8 +510,8 @@ LPWSTR WINAPI StrCpyNW(LPWSTR lpszStr, LPCWSTR lpszSrc, int iLen) * * Internal implementation of StrStrA/StrStrIA */ -static LPSTR WINAPI SHLWAPI_StrStrHelperA(LPCSTR lpszStr, LPCSTR lpszSearch, - int (*pStrCmpFn)(LPCSTR,LPCSTR,size_t)) +static LPSTR SHLWAPI_StrStrHelperA(LPCSTR lpszStr, LPCSTR lpszSearch, + int (*pStrCmpFn)(LPCSTR,LPCSTR,size_t)) { size_t iLen; @@ -477,30 +529,6 @@ static LPSTR WINAPI SHLWAPI_StrStrHelperA(LPCSTR lpszStr, LPCSTR lpszSearch, return NULL; } -/************************************************************************* - * SHLWAPI_StrStrHelperW - * - * Internal implementation of StrStrW/StrStrIW - */ -static LPWSTR WINAPI SHLWAPI_StrStrHelperW(LPCWSTR lpszStr, LPCWSTR lpszSearch, - int (*pStrCmpFn)(LPCWSTR,LPCWSTR,int)) -{ - int iLen; - - if (!lpszStr || !lpszSearch || !*lpszSearch) - return NULL; - - iLen = strlenW(lpszSearch); - - while (*lpszStr) - { - if (!pStrCmpFn(lpszStr, lpszSearch, iLen)) - return (LPWSTR)lpszStr; - lpszStr = CharNextW(lpszStr); - } - return NULL; -} - /************************************************************************* * StrStrA [SHLWAPI.@] * @@ -527,9 +555,8 @@ LPSTR WINAPI StrStrA(LPCSTR lpszStr, LPCSTR lpszSearch) */ LPWSTR WINAPI StrStrW(LPCWSTR lpszStr, LPCWSTR lpszSearch) { - TRACE("(%s,%s)\n", debugstr_w(lpszStr), debugstr_w(lpszSearch)); - - return SHLWAPI_StrStrHelperW(lpszStr, lpszSearch, (int (*)(LPCWSTR,LPCWSTR,int))wcsncmp); + if (!lpszStr || !lpszSearch) return NULL; + return strstrW( lpszStr, lpszSearch ); } /************************************************************************* @@ -547,7 +574,6 @@ LPWSTR WINAPI StrStrW(LPCWSTR lpszStr, LPCWSTR lpszSearch) */ LPSTR WINAPI StrRStrIA(LPCSTR lpszStr, LPCSTR lpszEnd, LPCSTR lpszSearch) { - LPSTR lpszRet = NULL; WORD ch1, ch2; INT iLen; @@ -558,24 +584,26 @@ LPSTR WINAPI StrRStrIA(LPCSTR lpszStr, LPCSTR lpszEnd, LPCSTR lpszSearch) if (!lpszEnd) lpszEnd = lpszStr + lstrlenA(lpszStr); + if (lpszEnd == lpszStr) + return NULL; if (IsDBCSLeadByte(*lpszSearch)) - ch1 = *lpszSearch << 8 | lpszSearch[1]; + ch1 = *lpszSearch << 8 | (UCHAR)lpszSearch[1]; else ch1 = *lpszSearch; iLen = lstrlenA(lpszSearch); - while (lpszStr <= lpszEnd && *lpszStr) + do { - ch2 = IsDBCSLeadByte(*lpszStr)? *lpszStr << 8 | lpszStr[1] : *lpszStr; + lpszEnd = CharPrevA(lpszStr, lpszEnd); + ch2 = IsDBCSLeadByte(*lpszEnd)? *lpszEnd << 8 | (UCHAR)lpszEnd[1] : *lpszEnd; if (!ChrCmpIA(ch1, ch2)) { - if (!StrCmpNIA(lpszStr, lpszSearch, iLen)) - lpszRet = (LPSTR)lpszStr; + if (!StrCmpNIA(lpszEnd, lpszSearch, iLen)) + return (LPSTR)lpszEnd; } - lpszStr = CharNextA(lpszStr); - } - return lpszRet; + } while (lpszEnd > lpszStr); + return NULL; } /************************************************************************* @@ -585,7 +613,6 @@ LPSTR WINAPI StrRStrIA(LPCSTR lpszStr, LPCSTR lpszEnd, LPCSTR lpszSearch) */ LPWSTR WINAPI StrRStrIW(LPCWSTR lpszStr, LPCWSTR lpszEnd, LPCWSTR lpszSearch) { - LPWSTR lpszRet = NULL; INT iLen; TRACE("(%s,%s)\n", debugstr_w(lpszStr), debugstr_w(lpszSearch)); @@ -598,16 +625,13 @@ LPWSTR WINAPI StrRStrIW(LPCWSTR lpszStr, LPCWSTR lpszEnd, LPCWSTR lpszSearch) iLen = strlenW(lpszSearch); - while (lpszStr <= lpszEnd && *lpszStr) + while (lpszEnd > lpszStr) { - if (!ChrCmpIW(*lpszSearch, *lpszStr)) - { - if (!StrCmpNIW(lpszStr, lpszSearch, iLen)) - lpszRet = (LPWSTR)lpszStr; - } - lpszStr = CharNextW(lpszStr); + lpszEnd--; + if (!StrCmpNIW(lpszEnd, lpszSearch, iLen)) + return (LPWSTR)lpszEnd; } - return lpszRet; + return NULL; } /************************************************************************* @@ -636,9 +660,22 @@ LPSTR WINAPI StrStrIA(LPCSTR lpszStr, LPCSTR lpszSearch) */ LPWSTR WINAPI StrStrIW(LPCWSTR lpszStr, LPCWSTR lpszSearch) { + int iLen; + TRACE("(%s,%s)\n", debugstr_w(lpszStr), debugstr_w(lpszSearch)); - return SHLWAPI_StrStrHelperW(lpszStr, lpszSearch, (int (*)(LPCWSTR,LPCWSTR,int))_wcsnicmp); + if (!lpszStr || !lpszSearch || !*lpszSearch) + return NULL; + + iLen = strlenW(lpszSearch); + + while (*lpszStr) + { + if (!StrCmpNIW(lpszStr, lpszSearch, iLen)) + return (LPWSTR)lpszStr; + lpszStr++; + } + return NULL; } /************************************************************************* @@ -721,7 +758,7 @@ BOOL WINAPI StrToIntExA(LPCSTR lpszStr, DWORD dwFlags, LPINT lpiRet) BOOL bNegative = FALSE; int iRet = 0; - TRACE("(%s,%08lX,%p)\n", debugstr_a(lpszStr), dwFlags, lpiRet); + TRACE("(%s,%08X,%p)\n", debugstr_a(lpszStr), dwFlags, lpiRet); if (!lpszStr || !lpiRet) { @@ -791,7 +828,7 @@ BOOL WINAPI StrToIntExW(LPCWSTR lpszStr, DWORD dwFlags, LPINT lpiRet) BOOL bNegative = FALSE; int iRet = 0; - TRACE("(%s,%08lX,%p)\n", debugstr_w(lpszStr), dwFlags, lpiRet); + TRACE("(%s,%08X,%p)\n", debugstr_w(lpszStr), dwFlags, lpiRet); if (!lpszStr || !lpiRet) { @@ -804,8 +841,7 @@ BOOL WINAPI StrToIntExW(LPCWSTR lpszStr, DWORD dwFlags, LPINT lpiRet) } /* Skip leading space, '+', '-' */ - while (isspaceW(*lpszStr)) - lpszStr = CharNextW(lpszStr); + while (isspaceW(*lpszStr)) lpszStr++; if (*lpszStr == '-') { @@ -917,9 +953,9 @@ LPWSTR WINAPI StrDupW(LPCWSTR lpszStr) * * Internal implementation of StrSpnA/StrCSpnA/StrCSpnIA */ -static int WINAPI SHLWAPI_StrSpnHelperA(LPCSTR lpszStr, LPCSTR lpszMatch, - LPSTR (WINAPI *pStrChrFn)(LPCSTR,WORD), - BOOL bInvert) +static int SHLWAPI_StrSpnHelperA(LPCSTR lpszStr, LPCSTR lpszMatch, + LPSTR (WINAPI *pStrChrFn)(LPCSTR,WORD), + BOOL bInvert) { LPCSTR lpszRead = lpszStr; if (lpszStr && *lpszStr && lpszMatch) @@ -938,32 +974,6 @@ static int WINAPI SHLWAPI_StrSpnHelperA(LPCSTR lpszStr, LPCSTR lpszMatch, return lpszRead - lpszStr; } -/************************************************************************* - * SHLWAPI_StrSpnHelperW - * - * Internal implementation of StrSpnW/StrCSpnW/StrCSpnIW - */ -static int WINAPI SHLWAPI_StrSpnHelperW(LPCWSTR lpszStr, LPCWSTR lpszMatch, - LPWSTR (WINAPI *pStrChrFn)(LPCWSTR,WCHAR), - BOOL bInvert) -{ - LPCWSTR lpszRead = lpszStr; - if (lpszStr && *lpszStr && lpszMatch) - { - while (*lpszRead) - { - LPCWSTR lpszTest = pStrChrFn(lpszMatch, *lpszRead); - - if (!bInvert && !lpszTest) - break; - if (bInvert && lpszTest) - break; - lpszRead = CharNextW(lpszRead); - }; - } - return lpszRead - lpszStr; -} - /************************************************************************* * StrSpnA [SHLWAPI.@] * @@ -992,9 +1002,8 @@ int WINAPI StrSpnA(LPCSTR lpszStr, LPCSTR lpszMatch) */ int WINAPI StrSpnW(LPCWSTR lpszStr, LPCWSTR lpszMatch) { - TRACE("(%s,%s)\n",debugstr_w(lpszStr), debugstr_w(lpszMatch)); - - return SHLWAPI_StrSpnHelperW(lpszStr, lpszMatch, StrChrW, FALSE); + if (!lpszStr || !lpszMatch) return 0; + return strspnW( lpszStr, lpszMatch ); } /************************************************************************* @@ -1025,9 +1034,8 @@ int WINAPI StrCSpnA(LPCSTR lpszStr, LPCSTR lpszMatch) */ int WINAPI StrCSpnW(LPCWSTR lpszStr, LPCWSTR lpszMatch) { - TRACE("(%s,%s)\n",debugstr_w(lpszStr), debugstr_w(lpszMatch)); - - return SHLWAPI_StrSpnHelperW(lpszStr, lpszMatch, StrChrW, TRUE); + if (!lpszStr || !lpszMatch) return 0; + return strcspnW( lpszStr, lpszMatch ); } /************************************************************************* @@ -1058,9 +1066,19 @@ int WINAPI StrCSpnIA(LPCSTR lpszStr, LPCSTR lpszMatch) */ int WINAPI StrCSpnIW(LPCWSTR lpszStr, LPCWSTR lpszMatch) { + LPCWSTR lpszRead = lpszStr; + TRACE("(%s,%s)\n",debugstr_w(lpszStr), debugstr_w(lpszMatch)); - return SHLWAPI_StrSpnHelperW(lpszStr, lpszMatch, StrChrIW, TRUE); + if (lpszStr && *lpszStr && lpszMatch) + { + while (*lpszRead) + { + if (StrChrIW(lpszMatch, *lpszRead)) break; + lpszRead++; + } + } + return lpszRead - lpszStr; } /************************************************************************* @@ -1099,18 +1117,8 @@ LPSTR WINAPI StrPBrkA(LPCSTR lpszStr, LPCSTR lpszMatch) */ LPWSTR WINAPI StrPBrkW(LPCWSTR lpszStr, LPCWSTR lpszMatch) { - TRACE("(%s,%s)\n",debugstr_w(lpszStr), debugstr_w(lpszMatch)); - - if (lpszStr && lpszMatch && *lpszMatch) - { - while (*lpszStr) - { - if (StrChrW(lpszMatch, *lpszStr)) - return (LPWSTR)lpszStr; - lpszStr = CharNextW(lpszStr); - } - } - return NULL; + if (!lpszStr || !lpszMatch) return NULL; + return strpbrkW( lpszStr, lpszMatch ); } /************************************************************************* @@ -1118,9 +1126,9 @@ LPWSTR WINAPI StrPBrkW(LPCWSTR lpszStr, LPCWSTR lpszMatch) * * Internal implementation of StrRChrA/StrRChrIA. */ -static LPSTR WINAPI SHLWAPI_StrRChrHelperA(LPCSTR lpszStr, - LPCSTR lpszEnd, WORD ch, - BOOL (WINAPI *pChrCmpFn)(WORD,WORD)) +static LPSTR SHLWAPI_StrRChrHelperA(LPCSTR lpszStr, + LPCSTR lpszEnd, WORD ch, + BOOL (WINAPI *pChrCmpFn)(WORD,WORD)) { LPCSTR lpszRet = NULL; @@ -1143,32 +1151,6 @@ static LPSTR WINAPI SHLWAPI_StrRChrHelperA(LPCSTR lpszStr, return (LPSTR)lpszRet; } -/************************************************************************* - * SHLWAPI_StrRChrHelperW - * - * Internal implementation of StrRChrW/StrRChrIW. - */ -static LPWSTR WINAPI SHLWAPI_StrRChrHelperW(LPCWSTR lpszStr, - LPCWSTR lpszEnd, WCHAR ch, - BOOL (WINAPI *pChrCmpFn)(WCHAR,WCHAR)) -{ - LPCWSTR lpszRet = NULL; - - if (lpszStr) - { - if (!lpszEnd) - lpszEnd = lpszStr + strlenW(lpszStr); - - while (*lpszStr && lpszStr <= lpszEnd) - { - if (!pChrCmpFn(ch, *lpszStr)) - lpszRet = lpszStr; - lpszStr = CharNextW(lpszStr); - } - } - return (LPWSTR)lpszRet; -} - /************************************************************************** * StrRChrA [SHLWAPI.@] * @@ -1196,11 +1178,18 @@ LPSTR WINAPI StrRChrA(LPCSTR lpszStr, LPCSTR lpszEnd, WORD ch) * * See StrRChrA. */ -LPWSTR WINAPI StrRChrW(LPCWSTR lpszStr, LPCWSTR lpszEnd, WORD ch) +LPWSTR WINAPI StrRChrW(LPCWSTR str, LPCWSTR end, WORD ch) { - TRACE("(%s,%s,%x)\n", debugstr_w(lpszStr), debugstr_w(lpszEnd), ch); + WCHAR *ret = NULL; - return SHLWAPI_StrRChrHelperW(lpszStr, lpszEnd, ch, SHLWAPI_ChrCmpW); + if (!str) return NULL; + if (!end) end = str + strlenW(str); + while (str < end) + { + if (*str == ch) ret = (WCHAR *)str; + str++; + } + return ret; } /************************************************************************** @@ -1230,11 +1219,18 @@ LPSTR WINAPI StrRChrIA(LPCSTR lpszStr, LPCSTR lpszEnd, WORD ch) * * See StrRChrIA. */ -LPWSTR WINAPI StrRChrIW(LPCWSTR lpszStr, LPCWSTR lpszEnd, WORD ch) +LPWSTR WINAPI StrRChrIW(LPCWSTR str, LPCWSTR end, WORD ch) { - TRACE("(%s,%s,%x)\n", debugstr_w(lpszStr), debugstr_w(lpszEnd), ch); + WCHAR *ret = NULL; - return SHLWAPI_StrRChrHelperW(lpszStr, lpszEnd, ch, ChrCmpIW); + if (!str) return NULL; + if (!end) end = str + strlenW(str); + while (str < end) + { + if (!ChrCmpIW(*str, ch)) ret = (WCHAR *)str; + str++; + } + return ret; } /************************************************************************* @@ -1561,24 +1557,12 @@ HRESULT WINAPI StrRetToBSTR(STRRET *lpStrRet, LPCITEMIDLIST pidl, BSTR* pBstrOut */ LPSTR WINAPI StrFormatKBSizeA(LONGLONG llBytes, LPSTR lpszDest, UINT cchMax) { - char szBuff[256], *szOut = szBuff + sizeof(szBuff) - 1; - LONGLONG ulKB = (llBytes + 1023) >> 10; - - TRACE("(%lld,%p,%d)\n", llBytes, lpszDest, cchMax); - - *szOut-- = '\0'; - *szOut-- = 'B'; - *szOut-- = 'K'; - *szOut-- = ' '; - - do - { - LONGLONG ulNextDigit = ulKB % 10; - *szOut-- = '0' + ulNextDigit; - ulKB = (ulKB - ulNextDigit) / 10; - } while (ulKB > 0); - - lstrcpynA(lpszDest, szOut + 1, cchMax); + WCHAR wszBuf[256]; + + if (!StrFormatKBSizeW(llBytes, wszBuf, 256)) + return NULL; + if (!WideCharToMultiByte(CP_ACP, 0, wszBuf, -1, lpszDest, cchMax, NULL, NULL)) + return NULL; return lpszDest; } @@ -1589,24 +1573,19 @@ LPSTR WINAPI StrFormatKBSizeA(LONGLONG llBytes, LPSTR lpszDest, UINT cchMax) */ LPWSTR WINAPI StrFormatKBSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax) { - WCHAR szBuff[256], *szOut = szBuff + sizeof(szBuff)/sizeof(WCHAR) - 1; - LONGLONG ulKB = (llBytes + 1023) >> 10; + static const WCHAR kb[] = {' ','K','B',0}; + LONGLONG llKB = (llBytes + 1023) >> 10; + int len; - TRACE("(%lld,%p,%d)\n", llBytes, lpszDest, cchMax); + TRACE("(0x%s,%p,%d)\n", wine_dbgstr_longlong(llBytes), lpszDest, cchMax); - *szOut-- = '\0'; - *szOut-- = 'B'; - *szOut-- = 'K'; - *szOut-- = ' '; + if (!FormatInt(llKB, lpszDest, cchMax)) + return NULL; - do - { - LONGLONG ulNextDigit = ulKB % 10; - *szOut-- = '0' + ulNextDigit; - ulKB = (ulKB - ulNextDigit) / 10; - } while (ulKB > 0); - - lstrcpynW(lpszDest, szOut + 1, cchMax); + len = lstrlenW(lpszDest); + if (cchMax - len < 4) + return NULL; + lstrcatW(lpszDest, kb); return lpszDest; } @@ -1728,8 +1707,7 @@ BOOL WINAPI StrTrimW(LPWSTR lpszStr, LPCWSTR lpszTrim) if (lpszRead && *lpszRead) { - while (*lpszRead && StrChrW(lpszTrim, *lpszRead)) - lpszRead = CharNextW(lpszRead); /* Skip leading matches */ + while (*lpszRead && StrChrW(lpszTrim, *lpszRead)) lpszRead++; dwLen = strlenW(lpszRead); @@ -1742,7 +1720,7 @@ BOOL WINAPI StrTrimW(LPWSTR lpszStr, LPCWSTR lpszTrim) { lpszRead = lpszStr + dwLen; while (StrChrW(lpszTrim, lpszRead[-1])) - lpszRead = CharPrevW(lpszStr, lpszRead); /* Skip trailing matches */ + lpszRead--; /* Skip trailing matches */ if (lpszRead != lpszStr + dwLen) { @@ -1759,7 +1737,7 @@ BOOL WINAPI StrTrimW(LPWSTR lpszStr, LPCWSTR lpszTrim) * * Duplicates a ASCII string to ASCII. The destination buffer is allocated. */ -static HRESULT WINAPI _SHStrDupAA(LPCSTR src, LPSTR * dest) +static HRESULT _SHStrDupAA(LPCSTR src, LPSTR * dest) { HRESULT hr; int len = 0; @@ -1826,7 +1804,7 @@ HRESULT WINAPI SHStrDupA(LPCSTR lpszStr, LPWSTR * lppszDest) * * Duplicates a UNICODE to a ASCII string. The destination buffer is allocated. */ -static HRESULT WINAPI _SHStrDupAW(LPCWSTR src, LPSTR * dest) +static HRESULT _SHStrDupAW(LPCWSTR src, LPSTR * dest) { HRESULT hr; int len = 0; @@ -1882,7 +1860,7 @@ HRESULT WINAPI SHStrDupW(LPCWSTR src, LPWSTR * dest) * * Internal helper for SHLWAPI_WriteTimeClass. */ -inline static LPWSTR SHLWAPI_WriteReverseNum(LPWSTR lpszOut, DWORD dwNum) +static inline LPWSTR SHLWAPI_WriteReverseNum(LPWSTR lpszOut, DWORD dwNum) { *lpszOut-- = '\0'; @@ -1902,7 +1880,7 @@ inline static LPWSTR SHLWAPI_WriteReverseNum(LPWSTR lpszOut, DWORD dwNum) * * Internal helper for SHLWAPI_WriteTimeClass. */ -inline static int SHLWAPI_FormatSignificant(LPWSTR lpszNum, int dwDigits) +static inline int SHLWAPI_FormatSignificant(LPWSTR lpszNum, int dwDigits) { /* Zero non significant digits, return remaining significant digits */ while (*lpszNum) @@ -1923,15 +1901,15 @@ inline static int SHLWAPI_FormatSignificant(LPWSTR lpszNum, int dwDigits) * * Internal helper for StrFromTimeIntervalW. */ -static int WINAPI SHLWAPI_WriteTimeClass(LPWSTR lpszOut, DWORD dwValue, - LPCWSTR lpszClass, int iDigits) +static int SHLWAPI_WriteTimeClass(LPWSTR lpszOut, DWORD dwValue, + UINT uClassStringId, int iDigits) { WCHAR szBuff[64], *szOut = szBuff + 32; szOut = SHLWAPI_WriteReverseNum(szOut, dwValue); iDigits = SHLWAPI_FormatSignificant(szOut + 1, iDigits); *szOut = ' '; - strcpyW(szBuff + 32, lpszClass); + LoadStringW(shlwapi_hInstance, uClassStringId, szBuff + 32, 32); strcatW(lpszOut, szOut); return iDigits; } @@ -1972,7 +1950,7 @@ INT WINAPI StrFromTimeIntervalA(LPSTR lpszStr, UINT cchMax, DWORD dwMS, { INT iRet = 0; - TRACE("(%p,%d,%ld,%d)\n", lpszStr, cchMax, dwMS, iDigits); + TRACE("(%p,%d,%d,%d)\n", lpszStr, cchMax, dwMS, iDigits); if (lpszStr && cchMax) { @@ -1992,12 +1970,9 @@ INT WINAPI StrFromTimeIntervalA(LPSTR lpszStr, UINT cchMax, DWORD dwMS, INT WINAPI StrFromTimeIntervalW(LPWSTR lpszStr, UINT cchMax, DWORD dwMS, int iDigits) { - static const WCHAR szHr[] = {' ','h','r','\0'}; - static const WCHAR szMin[] = {' ','m','i','n','\0'}; - static const WCHAR szSec[] = {' ','s','e','c','\0'}; INT iRet = 0; - TRACE("(%p,%d,%ld,%d)\n", lpszStr, cchMax, dwMS, iDigits); + TRACE("(%p,%d,%d,%d)\n", lpszStr, cchMax, dwMS, iDigits); if (lpszStr && cchMax) { @@ -2020,13 +1995,13 @@ INT WINAPI StrFromTimeIntervalW(LPWSTR lpszStr, UINT cchMax, DWORD dwMS, szCopy[0] = '\0'; if (dwHours) - iDigits = SHLWAPI_WriteTimeClass(szCopy, dwHours, szHr, iDigits); + iDigits = SHLWAPI_WriteTimeClass(szCopy, dwHours, IDS_TIME_INTERVAL_HOURS, iDigits); if (dwMinutes && iDigits) - iDigits = SHLWAPI_WriteTimeClass(szCopy, dwMinutes, szMin, iDigits); + iDigits = SHLWAPI_WriteTimeClass(szCopy, dwMinutes, IDS_TIME_INTERVAL_MINUTES, iDigits); if (iDigits) /* Always write seconds if we have significant digits */ - SHLWAPI_WriteTimeClass(szCopy, dwMS, szSec, iDigits); + SHLWAPI_WriteTimeClass(szCopy, dwMS, IDS_TIME_INTERVAL_SECONDS, iDigits); lstrcpynW(lpszStr, szCopy, cchMax); iRet = strlenW(lpszStr); @@ -2099,7 +2074,7 @@ BOOL WINAPI StrIsIntlEqualW(BOOL bCase, LPCWSTR lpszStr, LPCWSTR lpszComp, * iLen [I] Maximum number of chars to copy * * RETURNS - * Success: A pointer to the last character written to lpszDest.. + * 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) @@ -2187,7 +2162,7 @@ INT WINAPI StrCmpLogicalW(LPCWSTR lpszStr, LPCWSTR lpszComp) return 1; else { - iDiff = SHLWAPI_ChrCmpHelperW(*lpszStr,*lpszComp,NORM_IGNORECASE); + iDiff = ChrCmpIW(*lpszStr,*lpszComp); if (iDiff > 0) return 1; else if (iDiff < 0) @@ -2209,7 +2184,7 @@ typedef struct tagSHLWAPI_BYTEFORMATS LONGLONG dLimit; double dDivisor; double dNormaliser; - LPCWSTR lpwszFormat; + int nDecimals; WCHAR wPrefix; } SHLWAPI_BYTEFORMATS; @@ -2231,11 +2206,6 @@ typedef struct tagSHLWAPI_BYTEFORMATS */ LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax) { - static const WCHAR wszBytes[] = {'%','l','d',' ','b','y','t','e','s',0}; - static const WCHAR wsz3_0[] = {'%','3','.','0','f',0}; - static const WCHAR wsz3_1[] = {'%','3','.','1','f',0}; - static const WCHAR wsz3_2[] = {'%','3','.','2','f',0}; - #define KB ((ULONGLONG)1024) #define MB (KB*KB) #define GB (KB*KB*KB) @@ -2244,36 +2214,37 @@ LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax) static const SHLWAPI_BYTEFORMATS bfFormats[] = { - { 10*KB, 10.24, 100.0, wsz3_2, 'K' }, /* 10 KB */ - { 100*KB, 102.4, 10.0, wsz3_1, 'K' }, /* 100 KB */ - { 1000*KB, 1024.0, 1.0, wsz3_0, 'K' }, /* 1000 KB */ - { 10*MB, 10485.76, 100.0, wsz3_2, 'M' }, /* 10 MB */ - { 100*MB, 104857.6, 10.0, wsz3_1, 'M' }, /* 100 MB */ - { 1000*MB, 1048576.0, 1.0, wsz3_0, 'M' }, /* 1000 MB */ - { 10*GB, 10737418.24, 100.0, wsz3_2, 'G' }, /* 10 GB */ - { 100*GB, 107374182.4, 10.0, wsz3_1, 'G' }, /* 100 GB */ - { 1000*GB, 1073741824.0, 1.0, wsz3_0, 'G' }, /* 1000 GB */ - { 10*TB, 10485.76, 100.0, wsz3_2, 'T' }, /* 10 TB */ - { 100*TB, 104857.6, 10.0, wsz3_1, 'T' }, /* 100 TB */ - { 1000*TB, 1048576.0, 1.0, wsz3_0, 'T' }, /* 1000 TB */ - { 10*PB, 10737418.24, 100.00, wsz3_2, 'P' }, /* 10 PB */ - { 100*PB, 107374182.4, 10.00, wsz3_1, 'P' }, /* 100 PB */ - { 1000*PB, 1073741824.0, 1.00, wsz3_0, 'P' }, /* 1000 PB */ - { 0, 10995116277.76, 100.00, wsz3_2, 'E' } /* EB's, catch all */ + { 10*KB, 10.24, 100.0, 2, 'K' }, /* 10 KB */ + { 100*KB, 102.4, 10.0, 1, 'K' }, /* 100 KB */ + { 1000*KB, 1024.0, 1.0, 0, 'K' }, /* 1000 KB */ + { 10*MB, 10485.76, 100.0, 2, 'M' }, /* 10 MB */ + { 100*MB, 104857.6, 10.0, 1, 'M' }, /* 100 MB */ + { 1000*MB, 1048576.0, 1.0, 0, 'M' }, /* 1000 MB */ + { 10*GB, 10737418.24, 100.0, 2, 'G' }, /* 10 GB */ + { 100*GB, 107374182.4, 10.0, 1, 'G' }, /* 100 GB */ + { 1000*GB, 1073741824.0, 1.0, 0, 'G' }, /* 1000 GB */ + { 10*TB, 10485.76, 100.0, 2, 'T' }, /* 10 TB */ + { 100*TB, 104857.6, 10.0, 1, 'T' }, /* 100 TB */ + { 1000*TB, 1048576.0, 1.0, 0, 'T' }, /* 1000 TB */ + { 10*PB, 10737418.24, 100.00, 2, 'P' }, /* 10 PB */ + { 100*PB, 107374182.4, 10.00, 1, 'P' }, /* 100 PB */ + { 1000*PB, 1073741824.0, 1.00, 0, 'P' }, /* 1000 PB */ + { 0, 10995116277.76, 100.00, 2, 'E' } /* EB's, catch all */ }; - WCHAR wszBuff[32]; WCHAR wszAdd[] = {' ','?','B',0}; double dBytes; UINT i = 0; - TRACE("(%lld,%p,%d)\n", llBytes, lpszDest, cchMax); + TRACE("(0x%s,%p,%d)\n", wine_dbgstr_longlong(llBytes), lpszDest, cchMax); if (!lpszDest || !cchMax) return lpszDest; if (llBytes < 1024) /* 1K */ { - snprintfW(lpszDest, cchMax, wszBytes, (long)llBytes); + WCHAR wszBytesFormat[64]; + LoadStringW(shlwapi_hInstance, IDS_BYTES_FORMAT, wszBytesFormat, 64); + snprintfW(lpszDest, cchMax, wszBytesFormat, (long)llBytes); return lpszDest; } @@ -2299,10 +2270,10 @@ LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax) dBytes = floor(dBytes / bfFormats[i].dDivisor) / bfFormats[i].dNormaliser; - sprintfW(wszBuff, bfFormats[i].lpwszFormat, dBytes); + if (!FormatDouble(dBytes, bfFormats[i].nDecimals, lpszDest, cchMax)) + return NULL; wszAdd[1] = bfFormats[i].wPrefix; - strcatW(wszBuff, wszAdd); - lstrcpynW(lpszDest, wszBuff, cchMax); + StrCatBuffW(lpszDest, wszAdd, cchMax); return lpszDest; } @@ -2341,7 +2312,7 @@ LPSTR WINAPI StrFormatByteSize64A(LONGLONG llBytes, LPSTR lpszDest, UINT cchMax) */ LPSTR WINAPI StrFormatByteSizeA(DWORD dwBytes, LPSTR lpszDest, UINT cchMax) { - TRACE("(%ld,%p,%d)\n", dwBytes, lpszDest, cchMax); + TRACE("(%d,%p,%d)\n", dwBytes, lpszDest, cchMax); return StrFormatByteSize64A(dwBytes, lpszDest, cchMax); } @@ -2435,7 +2406,7 @@ WCHAR WINAPI SHStripMneumonicW(LPCWSTR lpszStr) if ((lpszIter = StrChrW(lpszStr, '&'))) { - lpszTmp = CharNextW(lpszIter); + lpszTmp = lpszIter + 1; if (lpszTmp && *lpszTmp) { if (*lpszTmp != '&') @@ -2443,7 +2414,7 @@ WCHAR WINAPI SHStripMneumonicW(LPCWSTR lpszStr) while (lpszIter && *lpszIter) { - lpszTmp = CharNextW(lpszIter); + lpszTmp = lpszIter + 1; *lpszIter = *lpszTmp; lpszIter = lpszTmp; } @@ -2472,7 +2443,7 @@ DWORD WINAPI SHAnsiToUnicodeCP(DWORD dwCp, LPCSTR lpSrcStr, LPWSTR lpDstStr, int DWORD dwRet; dwRet = MultiByteToWideChar(dwCp, 0, lpSrcStr, -1, lpDstStr, iLen); - TRACE("%s->%s,ret=%ld\n", debugstr_a(lpSrcStr), debugstr_w(lpDstStr), dwRet); + TRACE("%s->%s,ret=%d\n", debugstr_a(lpSrcStr), debugstr_w(lpDstStr), dwRet); return dwRet; } @@ -2540,8 +2511,7 @@ INT WINAPI SHUnicodeToAnsiCP(UINT CodePage, LPCWSTR lpSrcStr, LPSTR lpDstStr, DWORD dwMode = 0; INT nWideCharCount = len - 1; - GET_FUNC(pConvertINetUnicodeToMultiByte, mlang, "ConvertINetUnicodeToMultiByte", 0); - if (!pConvertINetUnicodeToMultiByte(&dwMode, CodePage, lpSrcStr, &nWideCharCount, lpDstStr, + if (!ConvertINetUnicodeToMultiByte(&dwMode, CodePage, lpSrcStr, &nWideCharCount, lpDstStr, lpiLen)) return 0; @@ -2553,7 +2523,7 @@ INT WINAPI SHUnicodeToAnsiCP(UINT CodePage, LPCWSTR lpSrcStr, LPSTR lpDstStr, *lpiLen = 0; - if (pConvertINetUnicodeToMultiByte(&dwMode, CodePage, lpSrcStr, &len, mem, lpiLen)) + if (ConvertINetUnicodeToMultiByte(&dwMode, CodePage, lpSrcStr, &len, mem, lpiLen)) { SHTruncateString(mem, *lpiLen); lstrcpynA(lpDstStr, mem, *lpiLen + 1); @@ -2703,7 +2673,7 @@ BOOL WINAPI DoesStringRoundTripW(LPCWSTR lpSrcStr, LPSTR lpDst, INT iLen) /************************************************************************* * SHLoadIndirectString [SHLWAPI.@] * - * If passed a string that begins with a '@' extract the string from the + * If passed a string that begins with '@', extract the string from the * appropriate resource, otherwise do a straight copy. * */ @@ -2739,7 +2709,7 @@ HRESULT WINAPI SHLoadIndirectString(LPCWSTR src, LPWSTR dst, UINT dst_len, void hr = S_OK; } else - FIXME("can't handle non-negative indicies (%d)\n", index); + FIXME("can't handle non-negative indices (%d)\n", index); } else { @@ -2748,7 +2718,7 @@ HRESULT WINAPI SHLoadIndirectString(LPCWSTR src, LPWSTR dst, UINT dst_len, void hr = S_OK; } - TRACE("returing %s\n", debugstr_w(dst)); + TRACE("returning %s\n", debugstr_w(dst)); end: if(hmod) FreeLibrary(hmod); HeapFree(GetProcessHeap(), 0, dllname); diff --git a/reactos/dll/win32/shlwapi/thread.c b/reactos/dll/win32/shlwapi/thread.c index 67d5ba636fc..1affb79d277 100644 --- a/reactos/dll/win32/shlwapi/thread.c +++ b/reactos/dll/win32/shlwapi/thread.c @@ -16,7 +16,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include @@ -26,34 +26,21 @@ #include "windef.h" #include "winbase.h" #include "winnls.h" -#include "wine/debug.h" +#include "winuser.h" #define NO_SHLWAPI_REG #define NO_SHLWAPI_PATH #define NO_SHLWAPI_GDI #define NO_SHLWAPI_STREAM #define NO_SHLWAPI_USER #include "shlwapi.h" +#include "shlobj.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(shell); -/* Get a function pointer from a DLL handle */ -#define GET_FUNC(func, module, name, fail) \ - do { \ - if (!func) { \ - if (!SHLWAPI_h##module && !(SHLWAPI_h##module = LoadLibraryA(#module ".dll"))) return fail; \ - if (!(func = (void*)GetProcAddress(SHLWAPI_h##module, name))) return fail; \ - } \ - } while (0) - -/* DLL handles for late bound calls */ -extern HMODULE SHLWAPI_hshell32; - -/* Function pointers for GET_FUNC macro; these need to be global because of gcc bug */ -static HRESULT (WINAPI *pSHGetInstanceExplorer)(IUnknown**); - extern DWORD SHLWAPI_ThreadRef_index; /* Initialised in shlwapi_main.c */ -DWORD WINAPI SHStringFromGUIDA(REFGUID,LPSTR,INT); +INT WINAPI SHStringFromGUIDA(REFGUID,LPSTR,INT); /************************************************************************** * _CreateAllAccessSecurityAttributes [SHLWAPI.356] @@ -81,7 +68,7 @@ LPSECURITY_ATTRIBUTES WINAPI _CreateAllAccessSecurityAttributes( /* This function is used within SHLWAPI only to create security attributes * for shell semaphores. */ - TRACE("(%p,%p,%08lx)\n", lpAttr, lpSec, p3); + TRACE("(%p,%p,%08x)\n", lpAttr, lpSec, p3); if (!(GetVersion() & 0x80000000)) /* NT */ { @@ -118,9 +105,7 @@ HRESULT WINAPI _SHGetInstanceExplorer(IUnknown **lppUnknown) { /* This function is used within SHLWAPI only to hold the IE reference * for threads created with the CTF_PROCESS_REF flag set. */ - - GET_FUNC(pSHGetInstanceExplorer, shell32, "SHGetInstanceExplorer", E_FAIL); - return pSHGetInstanceExplorer(lppUnknown); + return SHGetInstanceExplorer(lppUnknown); } /* Internal thread information structure */ @@ -180,7 +165,7 @@ HRESULT WINAPI SHSetThreadRef(IUnknown *lpUnknown) { TRACE("(%p)\n", lpUnknown); - if (!lpUnknown || SHLWAPI_ThreadRef_index == 0xffffffff) + if (!lpUnknown || SHLWAPI_ThreadRef_index == TLS_OUT_OF_INDEXES) return E_NOINTERFACE; TlsSetValue(SHLWAPI_ThreadRef_index, lpUnknown); @@ -282,7 +267,7 @@ BOOL WINAPI SHCreateThread(LPTHREAD_START_ROUTINE pfnThreadProc, VOID *pData, SHLWAPI_THREAD_INFO ti; BOOL bCalled = FALSE; - TRACE("(%p,%p,0x%lX,%p)\n", pfnThreadProc, pData, dwFlags, pfnCallback); + TRACE("(%p,%p,0x%X,%p)\n", pfnThreadProc, pData, dwFlags, pfnCallback); /* Set up data to pass to the new thread (On our stack) */ ti.pfnThreadProc = pfnThreadProc; @@ -419,7 +404,7 @@ HANDLE WINAPI _SHGlobalCounterCreateNamedW(LPCWSTR lpszName, DWORD iInitial) SECURITY_ATTRIBUTES sAttr, *pSecAttr; HANDLE hRet; - TRACE("(%s,%ld)\n", debugstr_w(lpszName), iInitial); + TRACE("(%s,%d)\n", debugstr_w(lpszName), iInitial); /* Create Semaphore name */ memcpy(szBuff, szPrefix, (iPrefixLen + 1) * sizeof(WCHAR)); @@ -450,7 +435,7 @@ HANDLE WINAPI _SHGlobalCounterCreateNamedA(LPCSTR lpszName, DWORD iInitial) { WCHAR szBuff[MAX_PATH]; - TRACE("(%s,%ld)\n", debugstr_a(lpszName), iInitial); + TRACE("(%s,%d)\n", debugstr_a(lpszName), iInitial); if (lpszName) MultiByteToWideChar(0, 0, lpszName, -1, szBuff, MAX_PATH); diff --git a/reactos/dll/win32/shlwapi/url.c b/reactos/dll/win32/shlwapi/url.c index 3707e2fd824..68d93093856 100644 --- a/reactos/dll/win32/shlwapi/url.c +++ b/reactos/dll/win32/shlwapi/url.c @@ -15,7 +15,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include "config.h" @@ -23,7 +23,6 @@ #include #include #include -#include #include "windef.h" #include "winbase.h" #include "winnls.h" @@ -36,6 +35,7 @@ #include "shlwapi.h" #include "wine/debug.h" +HMODULE WINAPI MLLoadLibraryW(LPCWSTR,HMODULE,DWORD); BOOL WINAPI MLFreeLibrary(HMODULE); HRESULT WINAPI MLBuildResURLW(LPCWSTR,HMODULE,DWORD,LPCWSTR,LPWSTR,DWORD); @@ -44,31 +44,28 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); /* The following schemes were identified in the native version of * SHLWAPI.DLL version 5.50 */ -typedef struct { +static const struct { URL_SCHEME scheme_number; - LPCSTR scheme_name; -} SHL_2_inet_scheme; - -static const SHL_2_inet_scheme shlwapi_schemes[] = { - {URL_SCHEME_FTP, "ftp"}, - {URL_SCHEME_HTTP, "http"}, - {URL_SCHEME_GOPHER, "gopher"}, - {URL_SCHEME_MAILTO, "mailto"}, - {URL_SCHEME_NEWS, "news"}, - {URL_SCHEME_NNTP, "nntp"}, - {URL_SCHEME_TELNET, "telnet"}, - {URL_SCHEME_WAIS, "wais"}, - {URL_SCHEME_FILE, "file"}, - {URL_SCHEME_MK, "mk"}, - {URL_SCHEME_HTTPS, "https"}, - {URL_SCHEME_SHELL, "shell"}, - {URL_SCHEME_SNEWS, "snews"}, - {URL_SCHEME_LOCAL, "local"}, - {URL_SCHEME_JAVASCRIPT, "javascript"}, - {URL_SCHEME_VBSCRIPT, "vbscript"}, - {URL_SCHEME_ABOUT, "about"}, - {URL_SCHEME_RES, "res"}, - {0, 0} + WCHAR scheme_name[12]; +} shlwapi_schemes[] = { + {URL_SCHEME_FTP, {'f','t','p',0}}, + {URL_SCHEME_HTTP, {'h','t','t','p',0}}, + {URL_SCHEME_GOPHER, {'g','o','p','h','e','r',0}}, + {URL_SCHEME_MAILTO, {'m','a','i','l','t','o',0}}, + {URL_SCHEME_NEWS, {'n','e','w','s',0}}, + {URL_SCHEME_NNTP, {'n','n','t','p',0}}, + {URL_SCHEME_TELNET, {'t','e','l','n','e','t',0}}, + {URL_SCHEME_WAIS, {'w','a','i','s',0}}, + {URL_SCHEME_FILE, {'f','i','l','e',0}}, + {URL_SCHEME_MK, {'m','k',0}}, + {URL_SCHEME_HTTPS, {'h','t','t','p','s',0}}, + {URL_SCHEME_SHELL, {'s','h','e','l','l',0}}, + {URL_SCHEME_SNEWS, {'s','n','e','w','s',0}}, + {URL_SCHEME_LOCAL, {'l','o','c','a','l',0}}, + {URL_SCHEME_JAVASCRIPT, {'j','a','v','a','s','c','r','i','p','t',0}}, + {URL_SCHEME_VBSCRIPT, {'v','b','s','c','r','i','p','t',0}}, + {URL_SCHEME_ABOUT, {'a','b','o','u','t',0}}, + {URL_SCHEME_RES, {'r','e','s',0}}, }; typedef struct { @@ -119,14 +116,27 @@ static const unsigned char HashDataLookup[256] = { 0x25, 0x45, 0x27, 0x75, 0x92, 0xB8, 0xA3, 0xC8, 0xDE, 0xEB, 0xF8, 0xF3, 0xDB, 0x0A, 0x98, 0x83, 0x7B, 0xE5, 0xCB, 0x4C, 0x78, 0xD1 }; +static DWORD get_scheme_code(LPCWSTR scheme, DWORD scheme_len) +{ + int i; + + for(i=0; i < sizeof(shlwapi_schemes)/sizeof(shlwapi_schemes[0]); i++) { + if(scheme_len == strlenW(shlwapi_schemes[i].scheme_name) + && !memcmp(scheme, shlwapi_schemes[i].scheme_name, scheme_len*sizeof(WCHAR))) + return shlwapi_schemes[i].scheme_number; + } + + return URL_SCHEME_UNKNOWN; +} + static BOOL URL_JustLocation(LPCWSTR str) { - while(*str && (*str == L'/')) str++; + while(*str && (*str == '/')) str++; if (*str) { - while (*str && ((*str == L'-') || - (*str == L'.') || + while (*str && ((*str == '-') || + (*str == '.') || isalnumW(*str))) str++; - if (*str == L'/') return FALSE; + if (*str == '/') return FALSE; } return TRUE; } @@ -147,8 +157,8 @@ static BOOL URL_JustLocation(LPCWSTR str) */ HRESULT WINAPI ParseURLA(LPCSTR x, PARSEDURLA *y) { - DWORD cnt; - const SHL_2_inet_scheme *inet_pro; + WCHAR scheme[INTERNET_MAX_SCHEME_LENGTH]; + DWORD cnt, len; y->nScheme = URL_SCHEME_INVALID; if (y->cbSize != sizeof(*y)) return E_INVALIDARG; @@ -180,17 +190,10 @@ HRESULT WINAPI ParseURLA(LPCSTR x, PARSEDURLA *y) /* found scheme, set length of remainder */ y->cchSuffix = lstrlenA(y->pszSuffix); - /* see if known scheme and return indicator number */ - y->nScheme = URL_SCHEME_UNKNOWN; - inet_pro = shlwapi_schemes; - while (inet_pro->scheme_name) { - if (!strncasecmp(inet_pro->scheme_name, y->pszProtocol, - min(y->cchProtocol, lstrlenA(inet_pro->scheme_name)))) { - y->nScheme = inet_pro->scheme_number; - break; - } - inet_pro++; - } + len = MultiByteToWideChar(CP_ACP, 0, y->pszProtocol, y->cchProtocol, + scheme, sizeof(scheme)/sizeof(WCHAR)); + y->nScheme = get_scheme_code(scheme, len); + return S_OK; } @@ -202,21 +205,18 @@ HRESULT WINAPI ParseURLA(LPCSTR x, PARSEDURLA *y) HRESULT WINAPI ParseURLW(LPCWSTR x, PARSEDURLW *y) { DWORD cnt; - const SHL_2_inet_scheme *inet_pro; - LPSTR cmpstr; - INT len; y->nScheme = URL_SCHEME_INVALID; if (y->cbSize != sizeof(*y)) return E_INVALIDARG; /* FIXME: leading white space generates error of 0x80041001 which * is undefined */ - if (*x <= L' ') return 0x80041001; + if (*x <= ' ') return 0x80041001; cnt = 0; y->cchProtocol = 0; y->pszProtocol = x; while (*x) { - if (*x == L':') { + if (*x == ':') { y->cchProtocol = cnt; cnt = -1; y->pszSuffix = x+1; @@ -228,29 +228,15 @@ HRESULT WINAPI ParseURLW(LPCWSTR x, PARSEDURLW *y) /* check for no scheme in string start */ /* (apparently schemes *must* be larger than a single character) */ - if ((*x == L'\0') || (y->cchProtocol <= 1)) { + if ((*x == '\0') || (y->cchProtocol <= 1)) { y->pszProtocol = NULL; return 0x80041001; } /* found scheme, set length of remainder */ y->cchSuffix = lstrlenW(y->pszSuffix); + y->nScheme = get_scheme_code(y->pszProtocol, y->cchProtocol); - /* see if known scheme and return indicator number */ - len = WideCharToMultiByte(0, 0, y->pszProtocol, y->cchProtocol, 0, 0, 0, 0); - cmpstr = HeapAlloc(GetProcessHeap(), 0, len); - WideCharToMultiByte(0, 0, y->pszProtocol, y->cchProtocol, cmpstr, len, 0, 0); - y->nScheme = URL_SCHEME_UNKNOWN; - inet_pro = shlwapi_schemes; - while (inet_pro->scheme_name) { - if (!strncasecmp(inet_pro->scheme_name, cmpstr, - min(len, lstrlenA(inet_pro->scheme_name)))) { - y->nScheme = inet_pro->scheme_number; - break; - } - inet_pro++; - } - HeapFree(GetProcessHeap(), 0, cmpstr); return S_OK; } @@ -284,7 +270,7 @@ HRESULT WINAPI UrlCanonicalizeA(LPCSTR pszUrl, LPSTR pszCanonicalized, LPWSTR base, canonical; DWORD ret, len, len2; - TRACE("(%s %p %p 0x%08lx) using W version\n", + TRACE("(%s %p %p 0x%08x) using W version\n", debugstr_a(pszUrl), pszCanonicalized, pcchCanonicalized, dwFlags); @@ -330,152 +316,180 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized, LPWSTR lpszUrlCpy, wk1, wk2, mp, mp2, root; INT nByteLen, state; DWORD nLen, nWkLen; - WCHAR slash = dwFlags & URL_FILE_USE_PATHURL ? '\\' : '/'; + WCHAR slash = '/'; - TRACE("(%s %p %p 0x%08lx)\n", debugstr_w(pszUrl), pszCanonicalized, + static const WCHAR wszFile[] = {'f','i','l','e',':'}; + + TRACE("(%s %p %p 0x%08x)\n", debugstr_w(pszUrl), pszCanonicalized, pcchCanonicalized, dwFlags); if(!pszUrl || !pszCanonicalized || !pcchCanonicalized) return E_INVALIDARG; + if(!*pszUrl) { + *pszCanonicalized = 0; + return S_OK; + } + nByteLen = (lstrlenW(pszUrl) + 1) * sizeof(WCHAR); /* length in bytes */ - lpszUrlCpy = HeapAlloc(GetProcessHeap(), 0, nByteLen); + lpszUrlCpy = HeapAlloc(GetProcessHeap(), 0, INTERNET_MAX_URL_LENGTH); - if (dwFlags & URL_DONT_SIMPLIFY) - memcpy(lpszUrlCpy, pszUrl, nByteLen); - else { + if((dwFlags & URL_FILE_USE_PATHURL) && nByteLen >= sizeof(wszFile) + && !memcmp(wszFile, pszUrl, sizeof(wszFile))) + slash = '\\'; - /* - * state = - * 0 initial 1,3 - * 1 have 2[+] alnum 2,3 - * 2 have scheme (found :) 4,6,3 - * 3 failed (no location) - * 4 have // 5,3 - * 5 have 1[+] alnum 6,3 - * 6 have location (found /) save root location - */ + /* + * state = + * 0 initial 1,3 + * 1 have 2[+] alnum 2,3 + * 2 have scheme (found :) 4,6,3 + * 3 failed (no location) + * 4 have // 5,3 + * 5 have 1[+] alnum 6,3 + * 6 have location (found /) save root location + */ - wk1 = (LPWSTR)pszUrl; - wk2 = lpszUrlCpy; - state = 0; - while (*wk1) { - switch (state) { - case 0: - if (!isalnumW(*wk1)) {state = 3; break;} - *wk2++ = *wk1++; - if (!isalnumW(*wk1)) {state = 3; break;} - *wk2++ = *wk1++; - state = 1; - break; - case 1: - *wk2++ = *wk1; - if (*wk1++ == L':') state = 2; - break; - case 2: - if (*wk1 != L'/') {state = 3; break;} - *wk2++ = *wk1++; - if (*wk1 != L'/') {state = 6; break;} - *wk2++ = *wk1++; - if((dwFlags & URL_FILE_USE_PATHURL) && *wk1 == '/') - wk1++; - state = 4; - break; - case 3: - nWkLen = strlenW(wk1); - memcpy(wk2, wk1, (nWkLen + 1) * sizeof(WCHAR)); - mp = wk2; - wk1 += nWkLen; - wk2 += nWkLen; + wk1 = (LPWSTR)pszUrl; + wk2 = lpszUrlCpy; + state = 0; - while(mp < wk2) { - if(*mp == '/' || *mp == '\\') - *mp = slash; - mp++; - } - break; - case 4: - if (!isalnumW(*wk1) && (*wk1 != L'-') && (*wk1 != L'.') && (*wk1 != ':')) - {state = 3; break;} - while(isalnumW(*wk1) || (*wk1 == L'-') || (*wk1 == L'.') || (*wk1 == ':')) - *wk2++ = *wk1++; - state = 5; + if(pszUrl[1] == ':') { /* Assume path */ + static const WCHAR wszFilePrefix[] = {'f','i','l','e',':','/','/','/'}; + + memcpy(wk2, wszFilePrefix, sizeof(wszFilePrefix)); + wk2 += sizeof(wszFilePrefix)/sizeof(WCHAR); + if (dwFlags & URL_FILE_USE_PATHURL) + { + slash = '\\'; + --wk2; + } + else + dwFlags |= URL_ESCAPE_UNSAFE; + state = 5; + } + + while (*wk1) { + switch (state) { + case 0: + if (!isalnumW(*wk1)) {state = 3; break;} + *wk2++ = *wk1++; + if (!isalnumW(*wk1)) {state = 3; break;} + *wk2++ = *wk1++; + state = 1; + break; + case 1: + *wk2++ = *wk1; + if (*wk1++ == ':') state = 2; + break; + case 2: + if (*wk1 != '/') {state = 3; break;} + *wk2++ = *wk1++; + if (*wk1 != '/') {state = 6; break;} + *wk2++ = *wk1++; + if(*wk1 == '/' && (dwFlags & URL_FILE_USE_PATHURL)) + wk1++; + state = 4; + break; + case 3: + nWkLen = strlenW(wk1); + memcpy(wk2, wk1, (nWkLen + 1) * sizeof(WCHAR)); + mp = wk2; + wk1 += nWkLen; + wk2 += nWkLen; + + while(mp < wk2) { + if(*mp == '/' || *mp == '\\') + *mp = slash; + mp++; + } + break; + case 4: + if (!isalnumW(*wk1) && (*wk1 != '-') && (*wk1 != '.') && (*wk1 != ':')) + {state = 3; break;} + while(isalnumW(*wk1) || (*wk1 == '-') || (*wk1 == '.') || (*wk1 == ':')) + *wk2++ = *wk1++; + state = 5; + if (!*wk1) + *wk2++ = slash; + break; + case 5: + if (*wk1 != '/' && *wk1 != '\\') {state = 3; break;} + while(*wk1 == '/' || *wk1 == '\\') { + *wk2++ = slash; + wk1++; + } + state = 6; + break; + case 6: + if(dwFlags & URL_DONT_SIMPLIFY) { + state = 3; break; - case 5: - if (*wk1 != '/' && *wk1 != '\\') {state = 3; break;} - while(*wk1 == '/') { - *wk2++ = slash; - wk1++; + } + + /* Now at root location, cannot back up any more. */ + /* "root" will point at the '/' */ + + root = wk2-1; + while (*wk1) { + mp = strchrW(wk1, '/'); + mp2 = strchrW(wk1, '\\'); + if(mp2 && (!mp || mp2 < mp)) + mp = mp2; + if (!mp) { + nWkLen = strlenW(wk1); + memcpy(wk2, wk1, (nWkLen + 1) * sizeof(WCHAR)); + wk1 += nWkLen; + wk2 += nWkLen; + continue; } - state = 6; - break; - case 6: - /* Now at root location, cannot back up any more. */ - /* "root" will point at the '/' */ - root = wk2-1; - while (*wk1) { - TRACE("wk1=%c\n", (CHAR)*wk1); + nLen = mp - wk1; + if(nLen) { + memcpy(wk2, wk1, nLen * sizeof(WCHAR)); + wk2 += nLen; + wk1 += nLen; + } + *wk2++ = slash; + wk1++; - mp = strchrW(wk1, '/'); - mp2 = strchrW(wk1, '\\'); - if(mp2 && mp2 < mp) - mp = mp2; - if (!mp) { - nWkLen = strlenW(wk1); - memcpy(wk2, wk1, (nWkLen + 1) * sizeof(WCHAR)); - wk1 += nWkLen; - wk2 += nWkLen; - continue; - } - nLen = mp - wk1; - if(nLen) { - memcpy(wk2, wk1, nLen * sizeof(WCHAR)); - wk2 += nLen; - wk1 += nLen; + if (*wk1 == '.') { + TRACE("found '/.'\n"); + if (wk1[1] == '/' || wk1[1] == '\\') { + /* case of /./ -> skip the ./ */ + wk1 += 2; } - *wk2++ = slash; - wk1++; - - if (*wk1 == L'.') { - TRACE("found '/.'\n"); - if (wk1[1] == '/' || wk1[1] == '\\') { - /* case of /./ -> skip the ./ */ - wk1 += 2; - } - else if (wk1[1] == '.') { - /* found /.. look for next / */ - TRACE("found '/..'\n"); - if (wk1[2] == '/' || wk1[2] == '\\' ||wk1[2] == '?' - || wk1[2] == '#' || !wk1[2]) { - /* case /../ -> need to backup wk2 */ - TRACE("found '/../'\n"); - *(wk2-1) = L'\0'; /* set end of string */ - mp = strrchrW(root, slash); - if (mp && (mp >= root)) { - /* found valid backup point */ - wk2 = mp + 1; - if(wk1[2] != '/' && wk1[2] != '\\') - wk1 += 2; - else - wk1 += 3; - } - else { - /* did not find point, restore '/' */ - *(wk2-1) = slash; - } - } - } - } - } - *wk2 = L'\0'; - break; - default: - FIXME("how did we get here - state=%d\n", state); - HeapFree(GetProcessHeap(), 0, lpszUrlCpy); - return E_INVALIDARG; - } - } - *wk2 = L'\0'; + else if (wk1[1] == '.') { + /* found /.. look for next / */ + TRACE("found '/..'\n"); + if (wk1[2] == '/' || wk1[2] == '\\' ||wk1[2] == '?' + || wk1[2] == '#' || !wk1[2]) { + /* case /../ -> need to backup wk2 */ + TRACE("found '/../'\n"); + *(wk2-1) = '\0'; /* set end of string */ + mp = strrchrW(root, slash); + if (mp && (mp >= root)) { + /* found valid backup point */ + wk2 = mp + 1; + if(wk1[2] != '/' && wk1[2] != '\\') + wk1 += 2; + else + wk1 += 3; + } + else { + /* did not find point, restore '/' */ + *(wk2-1) = slash; + } + } + } + } + } + *wk2 = '\0'; + break; + default: + FIXME("how did we get here - state=%d\n", state); + HeapFree(GetProcessHeap(), 0, lpszUrlCpy); + return E_INVALIDARG; + } + *wk2 = '\0'; TRACE("Simplified, orig <%s>, simple <%s>\n", debugstr_w(pszUrl), debugstr_w(lpszUrlCpy)); } @@ -537,7 +551,7 @@ HRESULT WINAPI UrlCombineA(LPCSTR pszBase, LPCSTR pszRelative, LPWSTR base, relative, combined; DWORD ret, len, len2; - TRACE("(base %s, Relative %s, Combine size %ld, flags %08lx) using W version\n", + TRACE("(base %s, Relative %s, Combine size %d, flags %08x) using W version\n", debugstr_a(pszBase),debugstr_a(pszRelative), pcchCombined?*pcchCombined:0,dwFlags); @@ -590,7 +604,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, static const WCHAR single_slash[] = {'/','\0'}; HRESULT ret; - TRACE("(base %s, Relative %s, Combine size %ld, flags %08lx)\n", + TRACE("(base %s, Relative %s, Combine size %d, flags %08x)\n", debugstr_w(pszBase),debugstr_w(pszRelative), pcchCombined?*pcchCombined:0,dwFlags); @@ -605,7 +619,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, sizeof(WCHAR)); mbase = preliminary + INTERNET_MAX_URL_LENGTH; mrelative = mbase + INTERNET_MAX_URL_LENGTH; - *preliminary = L'\0'; + *preliminary = '\0'; /* Canonicalize the base input prior to looking for the scheme */ myflags = dwFlags & (URL_DONT_SIMPLIFY | URL_UNESCAPE); @@ -624,16 +638,31 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, process_case = 1; } else do { + /* mk is a special case */ + if(base.nScheme == URL_SCHEME_MK) { + static const WCHAR wsz[] = {':',':',0}; + + WCHAR *ptr = strstrW(base.pszSuffix, wsz); + if(ptr) { + int delta; + + ptr += 2; + delta = ptr-base.pszSuffix; + base.cchProtocol += delta; + base.pszSuffix += delta; + base.cchSuffix -= delta; + } + } /* get size of location field (if it exists) */ work = (LPWSTR)base.pszSuffix; sizeloc = 0; - if (*work++ == L'/') { - if (*work++ == L'/') { + if (*work++ == '/') { + if (*work++ == '/') { /* At this point have start of location and * it ends at next '/' or end of string. */ - while(*work && (*work != L'/')) work++; + while(*work && (*work != '/')) work++; sizeloc = (DWORD)(work - base.pszSuffix); } } @@ -641,11 +670,12 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, /* Change .sizep2 to not have the last leaf in it, * Note: we need to start after the location (if it exists) */ - work = strrchrW((base.pszSuffix+sizeloc), L'/'); + work = strrchrW((base.pszSuffix+sizeloc), '/'); if (work) { len = (DWORD)(work - base.pszSuffix + 1); base.cchSuffix = len; } + /* * At this point: * .pszSuffix points to location (starting with '//') @@ -661,7 +691,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, TRACE("no scheme detected in Relative\n"); relative.pszSuffix = mrelative; /* case 3,4,5 depends on this */ relative.cchSuffix = strlenW(mrelative); - if (*pszRelative == L':') { + if (*pszRelative == ':') { /* case that is either left alone or uses pszBase */ if (dwFlags & URL_PLUGGABLE_PROTOCOL) { process_case = 5; @@ -670,23 +700,23 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, process_case = 1; break; } - if (isalnum(*mrelative) && (*(mrelative + 1) == L':')) { + if (isalnum(*mrelative) && (*(mrelative + 1) == ':')) { /* case that becomes "file:///" */ strcpyW(preliminary, myfilestr); process_case = 1; break; } - if ((*mrelative == L'/') && (*(mrelative+1) == L'/')) { + if ((*mrelative == '/') && (*(mrelative+1) == '/')) { /* pszRelative has location and rest */ process_case = 3; break; } - if (*mrelative == L'/') { + if (*mrelative == '/') { /* case where pszRelative is root to location */ process_case = 4; break; } - process_case = (*base.pszSuffix == L'/') ? 5 : 3; + process_case = (*base.pszSuffix == '/') ? 5 : 3; break; } @@ -695,12 +725,12 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, (strncmpW(base.pszProtocol, relative.pszProtocol, base.cchProtocol) == 0)) { /* since the schemes are the same */ - if ((*relative.pszSuffix == L'/') && (*(relative.pszSuffix+1) == L'/')) { + if ((*relative.pszSuffix == '/') && (*(relative.pszSuffix+1) == '/')) { /* case where pszRelative replaces location and following */ process_case = 3; break; } - if (*relative.pszSuffix == L'/') { + if (*relative.pszSuffix == '/') { /* case where pszRelative is root to location */ process_case = 4; break; @@ -709,7 +739,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, process_case = 5; break; } - if ((*relative.pszSuffix == L'/') && (*(relative.pszSuffix+1) == L'/')) { + if ((*relative.pszSuffix == '/') && (*(relative.pszSuffix+1) == '/')) { /* case where pszRelative replaces scheme, location, * and following and handles PLUGGABLE */ @@ -761,7 +791,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, memcpy(preliminary, base.pszProtocol, (base.cchProtocol+1+sizeloc)*sizeof(WCHAR)); work = preliminary + base.cchProtocol + 1 + sizeloc; if (dwFlags & URL_PLUGGABLE_PROTOCOL) - *(work++) = L'/'; + *(work++) = '/'; strcpyW(work, relative.pszSuffix); break; @@ -772,23 +802,23 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, memcpy(preliminary, base.pszProtocol, (base.cchProtocol+1+base.cchSuffix)*sizeof(WCHAR)); work = preliminary + base.cchProtocol+1+base.cchSuffix - 1; - if (*work++ != L'/') - *(work++) = L'/'; + if (*work++ != '/') + *(work++) = '/'; strcpyW(work, relative.pszSuffix); break; default: - FIXME("How did we get here????? process_case=%ld\n", process_case); + FIXME("How did we get here????? process_case=%d\n", process_case); ret = E_INVALIDARG; } if (ret == S_OK) { /* Reuse mrelative as temp storage as its already allocated and not needed anymore */ - ret = UrlCanonicalizeW(preliminary, mrelative, pcchCombined, dwFlags); + ret = UrlCanonicalizeW(preliminary, mrelative, pcchCombined, (dwFlags & ~URL_FILE_USE_PATHURL)); if(SUCCEEDED(ret) && pszCombined) { lstrcpyW(pszCombined, mrelative); } - TRACE("return-%ld len=%ld, %s\n", + TRACE("return-%d len=%d, %s\n", process_case, *pcchCombined, debugstr_w(pszCombined)); } HeapFree(GetProcessHeap(), 0, preliminary); @@ -819,13 +849,13 @@ HRESULT WINAPI UrlEscapeA( } if(ret == S_OK) { RtlUnicodeToMultiByteSize(&lenA, escapedW, lenW * sizeof(WCHAR)); - if(*pcchEscaped > lenA) { + if(pszEscaped && *pcchEscaped > lenA) { RtlUnicodeToMultiByteN(pszEscaped, *pcchEscaped - 1, &lenA, escapedW, lenW * sizeof(WCHAR)); pszEscaped[lenA] = 0; *pcchEscaped = lenA; } else { *pcchEscaped = lenA + 1; - ret = E_POINTER; + ret = E_INVALIDARG; } } if(escapedW != bufW) HeapFree(GetProcessHeap(), 0, escapedW); @@ -945,17 +975,17 @@ HRESULT WINAPI UrlEscapeW( DWORD slashes = 0; static const WCHAR localhost[] = {'l','o','c','a','l','h','o','s','t',0}; - TRACE("(%s %p %p 0x%08lx)\n", debugstr_w(pszUrl), pszEscaped, + TRACE("(%s %p %p 0x%08x)\n", debugstr_w(pszUrl), pszEscaped, pcchEscaped, dwFlags); - if(!pszUrl || !pszEscaped || !pcchEscaped) - return E_INVALIDARG; + if(!pszUrl || !pcchEscaped) + return E_INVALIDARG; if(dwFlags & ~(URL_ESCAPE_SPACES_ONLY | URL_ESCAPE_SEGMENT_ONLY | URL_DONT_ESCAPE_EXTRA_INFO | URL_ESCAPE_PERCENT)) - FIXME("Unimplemented flags: %08lx\n", dwFlags); + FIXME("Unimplemented flags: %08x\n", dwFlags); /* fix up flags */ if (dwFlags & URL_ESCAPE_SPACES_ONLY) @@ -1053,7 +1083,7 @@ HRESULT WINAPI UrlEscapeW( if(cur == '\\' && (int_flags & WINE_URL_BASH_AS_SLASH) && !stop_escaping) cur = '/'; if(URL_NeedEscapeW(cur, dwFlags, int_flags) && stop_escaping == FALSE) { - next[0] = L'%'; + next[0] = '%'; next[1] = hexDigits[(cur >> 4) & 0xf]; next[2] = hexDigits[cur & 0xf]; len = 3; @@ -1115,10 +1145,10 @@ HRESULT WINAPI UrlUnescapeA( DWORD needed; BOOL stop_unescaping = FALSE; - TRACE("(%s, %p, %p, 0x%08lx)\n", debugstr_a(pszUrl), pszUnescaped, + TRACE("(%s, %p, %p, 0x%08x)\n", debugstr_a(pszUrl), pszUnescaped, pcchUnescaped, dwFlags); - if(!pszUrl || !pszUnescaped || !pcchUnescaped) + if(!pszUrl || (!pszUnescaped && !(dwFlags & URL_UNESCAPE_INPLACE)) || !pcchUnescaped) return E_INVALIDARG; if(dwFlags & URL_UNESCAPE_INPLACE) @@ -1182,7 +1212,7 @@ HRESULT WINAPI UrlUnescapeW( DWORD needed; BOOL stop_unescaping = FALSE; - TRACE("(%s, %p, %p, 0x%08lx)\n", debugstr_w(pszUrl), pszUnescaped, + TRACE("(%s, %p, %p, 0x%08x)\n", debugstr_w(pszUrl), pszUnescaped, pcchUnescaped, dwFlags); if(!pszUrl || (!pszUnescaped && !(dwFlags & URL_UNESCAPE_INPLACE))|| !pcchUnescaped) @@ -1195,10 +1225,10 @@ HRESULT WINAPI UrlUnescapeW( for(src = pszUrl, needed = 0; *src; src++, needed++) { if(dwFlags & URL_DONT_UNESCAPE_EXTRA_INFO && - (*src == L'#' || *src == L'?')) { + (*src == '#' || *src == '?')) { stop_unescaping = TRUE; next = *src; - } else if(*src == L'%' && isxdigitW(*(src + 1)) && isxdigitW(*(src + 2)) + } else if(*src == '%' && isxdigitW(*(src + 1)) && isxdigitW(*(src + 2)) && stop_unescaping == FALSE) { INT ih; WCHAR buf[5] = {'0','x',0}; @@ -1215,7 +1245,7 @@ HRESULT WINAPI UrlUnescapeW( } if(dwFlags & URL_UNESCAPE_INPLACE || needed < *pcchUnescaped) { - *dst = L'\0'; + *dst = '\0'; ret = S_OK; } else { needed++; /* add one for the '\0' */ @@ -1294,7 +1324,7 @@ LPCWSTR WINAPI UrlGetLocationW( if (strncmpW(base.pszProtocol, fileW, min(4,base.cchProtocol)) == 0) return NULL; /* Look for '#' and return its addr */ - return strchrW(base.pszSuffix, L'#'); + return strchrW(base.pszSuffix, '#'); } /************************************************************************* @@ -1436,7 +1466,7 @@ HRESULT WINAPI UrlHashW(LPCWSTR pszUrl, unsigned char *lpDest, DWORD nDestLen) { char szUrl[MAX_PATH]; - TRACE("(%s,%p,%ld)\n",debugstr_w(pszUrl), lpDest, nDestLen); + TRACE("(%s,%p,%d)\n",debugstr_w(pszUrl), lpDest, nDestLen); if (IsBadStringPtrW(pszUrl, -1) || IsBadWritePtr(lpDest, nDestLen)) return E_INVALIDARG; @@ -1445,7 +1475,7 @@ HRESULT WINAPI UrlHashW(LPCWSTR pszUrl, unsigned char *lpDest, DWORD nDestLen) * return the same digests for the same URL. */ WideCharToMultiByte(0, 0, pszUrl, -1, szUrl, MAX_PATH, 0, 0); - HashData((BYTE*)szUrl, (int)strlen(szUrl), lpDest, nDestLen); + HashData((const BYTE*)szUrl, (int)strlen(szUrl), lpDest, nDestLen); return S_OK; } @@ -1469,7 +1499,7 @@ HRESULT WINAPI UrlApplySchemeA(LPCSTR pszIn, LPSTR pszOut, LPDWORD pcchOut, DWOR LPWSTR in, out; DWORD ret, len, len2; - TRACE("(in %s, out size %ld, flags %08lx) using W version\n", + TRACE("(in %s, out size %d, flags %08x) using W version\n", debugstr_a(pszIn), *pcchOut, dwFlags); in = HeapAlloc(GetProcessHeap(), 0, @@ -1558,8 +1588,8 @@ static HRESULT URL_ApplyDefault(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut) -1, reg_path, MAX_PATH); RegOpenKeyExW(HKEY_LOCAL_MACHINE, reg_path, 0, 1, &newkey); data_len = MAX_PATH; - value[0] = L'@'; - value[1] = L'\0'; + value[0] = '@'; + value[1] = '\0'; RegQueryValueExW(newkey, value, 0, &dwType, (LPBYTE)data, &data_len); RegCloseKey(newkey); if (strlenW(data) + strlenW(pszIn) + 1 > *pcchOut) { @@ -1584,11 +1614,11 @@ HRESULT WINAPI UrlApplySchemeW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut, DW DWORD res1; HRESULT ret; - TRACE("(in %s, out size %ld, flags %08lx)\n", + TRACE("(in %s, out size %d, flags %08x)\n", debugstr_w(pszIn), *pcchOut, dwFlags); if (dwFlags & URL_APPLY_GUESSFILE) { - FIXME("(%s %p %p(%ld) 0x%08lx): stub URL_APPLY_GUESSFILE not implemented\n", + FIXME("(%s %p %p(%d) 0x%08x): stub URL_APPLY_GUESSFILE not implemented\n", debugstr_w(pszIn), pszOut, pcchOut, *pcchOut, dwFlags); strcpyW(pszOut, pszIn); *pcchOut = strlenW(pszOut); @@ -1615,7 +1645,7 @@ HRESULT WINAPI UrlApplySchemeW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut, DW } strcpyW(pszOut, pszIn); *pcchOut = strlenW(pszOut); - TRACE("valid scheme, returing copy\n"); + TRACE("valid scheme, returning copy\n"); return S_OK; } } @@ -1824,9 +1854,9 @@ static LPCWSTR URL_ScanID(LPCWSTR start, LPDWORD size, WINE_URL_SCAN_TYPE type) while (cont) { if ( (islowerW(*start) && isalphaW(*start)) || isdigitW(*start) || - (*start == L'+') || - (*start == L'-') || - (*start == L'.')) { + (*start == '+') || + (*start == '-') || + (*start == '.')) { start++; (*size)++; } @@ -1840,26 +1870,26 @@ static LPCWSTR URL_ScanID(LPCWSTR start, LPDWORD size, WINE_URL_SCAN_TYPE type) if ( isalphaW(*start) || isdigitW(*start) || /* user/password only characters */ - (*start == L';') || - (*start == L'?') || - (*start == L'&') || - (*start == L'=') || + (*start == ';') || + (*start == '?') || + (*start == '&') || + (*start == '=') || /* *extra* characters */ - (*start == L'!') || - (*start == L'*') || - (*start == L'\'') || - (*start == L'(') || - (*start == L')') || - (*start == L',') || + (*start == '!') || + (*start == '*') || + (*start == '\'') || + (*start == '(') || + (*start == ')') || + (*start == ',') || /* *safe* characters */ - (*start == L'$') || - (*start == L'_') || - (*start == L'+') || - (*start == L'-') || - (*start == L'.')) { + (*start == '$') || + (*start == '_') || + (*start == '+') || + (*start == '-') || + (*start == '.')) { start++; (*size)++; - } else if (*start == L'%') { + } else if (*start == '%') { if (isxdigitW(*(start+1)) && isxdigitW(*(start+2))) { start += 3; @@ -1885,8 +1915,8 @@ static LPCWSTR URL_ScanID(LPCWSTR start, LPDWORD size, WINE_URL_SCAN_TYPE type) case HOST: while (cont) { if (isalnumW(*start) || - (*start == L'-') || - (*start == L'.') ) { + (*start == '-') || + (*start == '.') ) { start++; (*size)++; } @@ -1898,7 +1928,7 @@ static LPCWSTR URL_ScanID(LPCWSTR start, LPDWORD size, WINE_URL_SCAN_TYPE type) FIXME("unknown type %d\n", type); return (LPWSTR)&alwayszero; } - /* TRACE("scanned %ld characters next char %p<%c>\n", + /* TRACE("scanned %d characters next char %p<%c>\n", *size, start, *start); */ return start; } @@ -1913,28 +1943,28 @@ static LONG URL_ParseUrl(LPCWSTR pszUrl, WINE_PARSE_URL *pl) memset(pl, 0, sizeof(WINE_PARSE_URL)); pl->pScheme = pszUrl; work = URL_ScanID(pl->pScheme, &pl->szScheme, SCHEME); - if (!*work || (*work != L':')) goto ErrorExit; + if (!*work || (*work != ':')) goto ErrorExit; work++; - if ((*work != L'/') || (*(work+1) != L'/')) goto ErrorExit; + if ((*work != '/') || (*(work+1) != '/')) goto ErrorExit; pl->pUserName = work + 2; work = URL_ScanID(pl->pUserName, &pl->szUserName, USERPASS); - if (*work == L':' ) { + if (*work == ':' ) { /* parse password */ work++; pl->pPassword = work; work = URL_ScanID(pl->pPassword, &pl->szPassword, USERPASS); - if (*work != L'@') { + if (*work != '@') { /* what we just parsed must be the hostname and port * so reset pointers and clear then let it parse */ pl->szUserName = pl->szPassword = 0; work = pl->pUserName - 1; pl->pUserName = pl->pPassword = 0; } - } else if (*work == L'@') { + } else if (*work == '@') { /* no password */ pl->szPassword = 0; pl->pPassword = 0; - } else if (!*work || (*work == L'/') || (*work == L'.')) { + } else if (!*work || (*work == '/') || (*work == '.')) { /* what was parsed was hostname, so reset pointers and let it parse */ pl->szUserName = pl->szPassword = 0; work = pl->pUserName - 1; @@ -1945,18 +1975,18 @@ static LONG URL_ParseUrl(LPCWSTR pszUrl, WINE_PARSE_URL *pl) work++; pl->pHostName = work; work = URL_ScanID(pl->pHostName, &pl->szHostName, HOST); - if (*work == L':') { + if (*work == ':') { /* parse port */ work++; pl->pPort = work; work = URL_ScanID(pl->pPort, &pl->szPort, PORT); } - if (*work == L'/') { + if (*work == '/') { /* see if query string */ - pl->pQuery = strchrW(work, L'?'); + pl->pQuery = strchrW(work, '?'); if (pl->pQuery) pl->szQuery = strlenW(pl->pQuery); } - TRACE("parse successful: scheme=%p(%ld), user=%p(%ld), pass=%p(%ld), host=%p(%ld), port=%p(%ld), query=%p(%ld)\n", + TRACE("parse successful: scheme=%p(%d), user=%p(%d), pass=%p(%d), host=%p(%d), port=%p(%d), query=%p(%d)\n", pl->pScheme, pl->szScheme, pl->pUserName, pl->szUserName, pl->pPassword, pl->szPassword, @@ -2032,7 +2062,7 @@ HRESULT WINAPI UrlGetPartW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut, DWORD size, schsize; LPCWSTR addr, schaddr; - TRACE("(%s %p %p(%ld) %08lx %08lx)\n", + TRACE("(%s %p %p(%d) %08x %08x)\n", debugstr_w(pszIn), pszOut, pcchOut, *pcchOut, dwPart, dwFlags); ret = URL_ParseUrl(pszIn, &pl); @@ -2098,7 +2128,7 @@ HRESULT WINAPI UrlGetPartW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut, pszOut[size] = 0; *pcchOut = size; } - TRACE("len=%ld %s\n", *pcchOut, debugstr_w(pszOut)); + TRACE("len=%d %s\n", *pcchOut, debugstr_w(pszOut)); } return ret; } @@ -2205,7 +2235,7 @@ HRESULT WINAPI UrlCreateFromPathW(LPCWSTR pszPath, LPWSTR pszUrl, LPDWORD pcchUr WCHAR three_slashesW[] = {'/','/','/',0}; PARSEDURLW parsed_url; - TRACE("(%s, %p, %p, 0x%08lx)\n", debugstr_w(pszPath), pszUrl, pcchUrl, dwReserved); + TRACE("(%s, %p, %p, 0x%08x)\n", debugstr_w(pszPath), pszUrl, pcchUrl, dwReserved); /* Validate arguments */ if (dwReserved != 0) @@ -2312,7 +2342,7 @@ HRESULT WINAPI MLBuildResURLW(LPCWSTR lpszLibName, HMODULE hMod, DWORD dwFlags, #define szResLen ((sizeof(szRes) - sizeof(WCHAR))/sizeof(WCHAR)) HRESULT hRet = E_FAIL; - TRACE("(%s,%p,0x%08lx,%s,%p,%ld)\n", debugstr_w(lpszLibName), hMod, dwFlags, + TRACE("(%s,%p,0x%08x,%s,%p,%d)\n", debugstr_w(lpszLibName), hMod, dwFlags, debugstr_w(lpszRes), lpszDest, dwDestLen); if (!lpszLibName || !hMod || hMod == INVALID_HANDLE_VALUE || !lpszRes || diff --git a/reactos/dll/win32/shlwapi/version.rc b/reactos/dll/win32/shlwapi/version.rc index 8bfa99805b0..98620672c72 100644 --- a/reactos/dll/win32/shlwapi/version.rc +++ b/reactos/dll/win32/shlwapi/version.rc @@ -15,7 +15,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #define WINE_FILENAME_STR "shlwapi.dll" diff --git a/reactos/dll/win32/shlwapi/wsprintf.c b/reactos/dll/win32/shlwapi/wsprintf.c index e198e8ddf6e..d10881f02df 100644 --- a/reactos/dll/win32/shlwapi/wsprintf.c +++ b/reactos/dll/win32/shlwapi/wsprintf.c @@ -15,7 +15,7 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * NOTE: * This code is duplicated in user32. If you change something here make sure