Author: akhaldi
Date: Sat Sep 29 13:14:20 2012
New Revision: 57427
URL:
http://svn.reactos.org/svn/reactos?rev=57427&view=rev
Log:
[SHLWAPI]: Sync to Wine 1.5.13.
CORE-6415
CORE-5759 #resolve #comment Fixed in r57427.
Modified:
trunk/reactos/dll/win32/shlwapi/CMakeLists.txt
trunk/reactos/dll/win32/shlwapi/assoc.c
trunk/reactos/dll/win32/shlwapi/istream.c
trunk/reactos/dll/win32/shlwapi/ordinal.c
trunk/reactos/dll/win32/shlwapi/path.c
trunk/reactos/dll/win32/shlwapi/reg.c
trunk/reactos/dll/win32/shlwapi/regstream.c
trunk/reactos/dll/win32/shlwapi/resource.h
trunk/reactos/dll/win32/shlwapi/shlwapi.spec
trunk/reactos/dll/win32/shlwapi/shlwapi_main.c
trunk/reactos/dll/win32/shlwapi/string.c
trunk/reactos/dll/win32/shlwapi/thread.c
trunk/reactos/dll/win32/shlwapi/url.c
trunk/reactos/dll/win32/shlwapi/wsprintf.c
trunk/reactos/include/psdk/shlwapi.h
trunk/reactos/include/psdk/shtypes.idl
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/shlwapi/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/CMakeLis…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/CMakeLists.txt [iso-8859-1] Sat Sep 29 13:14:20 2012
@@ -1,6 +1,8 @@
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
-add_definitions(-D__WINESRC__)
+add_definitions(
+ -D__WINESRC__
+ -D_SHLWAPI_)
remove_definitions(-D_WIN32_WINNT=0x502)
add_definitions(-D_WIN32_WINNT=0x600)
Modified: trunk/reactos/dll/win32/shlwapi/assoc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/assoc.c?…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/assoc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/assoc.c [iso-8859-1] Sat Sep 29 13:14:20 2012
@@ -103,6 +103,42 @@
}
/*************************************************************************
+ * AssocGetPerceivedType [SHLWAPI.@]
+ *
+ * Detect the type of a file by inspecting its extension
+ *
+ * PARAMS
+ * lpszExt [I] File extension to evaluate.
+ * lpType [O] Pointer to perceived type
+ * lpFlag [O] Pointer to perceived type flag
+ * lppszType [O] Address to pointer for perceived type text
+ *
+ * RETURNS
+ * Success: S_OK. lpType and lpFlag contain the perceived type and
+ * its information. If lppszType is not NULL, it will point
+ * to a string with perceived type text.
+ * Failure: An HRESULT error code indicating the error.
+ *
+ * NOTES
+ * lppszType is optional and it can be NULL.
+ * if lpType or lpFlag are NULL, the function will crash.
+ * if lpszExt is NULL, an error is returned.
+ *
+ * BUGS
+ * Unimplemented.
+ */
+HRESULT WINAPI AssocGetPerceivedType(LPCWSTR lpszExt, PERCEIVED *lpType,
+ INT *lpFlag, LPWSTR *lppszType)
+{
+ FIXME("(%s, %p, %p, %p) not supported\n", debugstr_w(lpszExt), lpType,
lpFlag, lppszType);
+
+ if (lpszExt == NULL)
+ return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
+
+ return E_NOTIMPL;
+}
+
+/*************************************************************************
* AssocQueryKeyW [SHLWAPI.@]
*
* See AssocQueryKeyA.
@@ -113,7 +149,7 @@
HRESULT hRet;
IQueryAssociations* lpAssoc;
- TRACE("(0x%8x,0x%8x,%s,%s,%p)\n", cfFlags, assockey, debugstr_w(pszAssoc),
+ TRACE("(0x%x,%d,%s,%s,%p)\n", cfFlags, assockey, debugstr_w(pszAssoc),
debugstr_w(pszExtra), phkeyOut);
hRet = AssocCreate( CLSID_QueryAssociations, &IID_IQueryAssociations, (void
**)&lpAssoc );
@@ -152,7 +188,7 @@
WCHAR szExtraW[MAX_PATH], *lpszExtraW = NULL;
HRESULT hRet = E_OUTOFMEMORY;
- TRACE("(0x%8x,0x%8x,%s,%s,%p)\n", cfFlags, assockey, debugstr_a(pszAssoc),
+ TRACE("(0x%x,%d,%s,%s,%p)\n", cfFlags, assockey, debugstr_a(pszAssoc),
debugstr_a(pszExtra), phkeyOut);
if (SHLWAPI_ParamAToW(pszAssoc, szAssocW, MAX_PATH, &lpszAssocW) &&
@@ -181,7 +217,7 @@
HRESULT hRet;
IQueryAssociations* lpAssoc;
- TRACE("(0x%8x,0x%8x,%s,%s,%p,%p)\n", cfFlags, str, debugstr_w(pszAssoc),
+ TRACE("(0x%x,%d,%s,%s,%p,%p)\n", cfFlags, str, debugstr_w(pszAssoc),
debugstr_w(pszExtra), pszOut, pcchOut);
if (!pcchOut)
@@ -225,7 +261,7 @@
WCHAR szExtraW[MAX_PATH], *lpszExtraW = NULL;
HRESULT hRet = E_OUTOFMEMORY;
- TRACE("(0x%8x,0x%8x,%s,%s,%p,%p)\n", cfFlags, str, debugstr_a(pszAssoc),
+ TRACE("(0x%x,0x%d,%s,%s,%p,%p)\n", cfFlags, str, debugstr_a(pszAssoc),
debugstr_a(pszExtra), pszOut, pcchOut);
if (!pcchOut)
@@ -278,7 +314,7 @@
HRESULT hRet;
IQueryAssociations* lpAssoc;
- TRACE("(0x%8x,0x%8x,%p,%s,%p,%p)\n", cfFlags, str, hkAssoc,
+ TRACE("(0x%x,0x%d,%p,%s,%p,%p)\n", cfFlags, str, hkAssoc,
debugstr_w(pszExtra), pszOut, pcchOut);
hRet = AssocCreate( CLSID_QueryAssociations, &IID_IQueryAssociations, (void
**)&lpAssoc );
@@ -320,7 +356,7 @@
WCHAR szReturnW[MAX_PATH], *lpszReturnW = szReturnW;
HRESULT hRet = E_OUTOFMEMORY;
- TRACE("(0x%8x,0x%8x,%p,%s,%p,%p)\n", cfFlags, str, hkAssoc,
+ TRACE("(0x%x,0x%d,%p,%s,%p,%p)\n", cfFlags, str, hkAssoc,
debugstr_a(pszExtra), pszOut, pcchOut);
if (!pcchOut)
Modified: trunk/reactos/dll/win32/shlwapi/istream.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/istream.…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/istream.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/istream.c [iso-8859-1] Sat Sep 29 13:14:20 2012
@@ -42,7 +42,7 @@
/* Layout of ISHFileStream object */
typedef struct
{
- const IStreamVtbl *lpVtbl;
+ IStream IStream_iface;
LONG ref;
HANDLE hFile;
DWORD dwMode;
@@ -51,6 +51,11 @@
DWORD grfStateBits;
} ISHFileStream;
+static inline ISHFileStream *impl_from_IStream(IStream *iface)
+{
+ return CONTAINING_RECORD(iface, ISHFileStream, IStream_iface);
+}
+
static HRESULT WINAPI IStream_fnCommit(IStream*,DWORD);
@@ -59,7 +64,7 @@
*/
static HRESULT WINAPI IStream_fnQueryInterface(IStream *iface, REFIID riid, LPVOID
*ppvObj)
{
- ISHFileStream *This = (ISHFileStream *)iface;
+ ISHFileStream *This = impl_from_IStream(iface);
TRACE("(%p,%s,%p)\n", This, debugstr_guid(riid), ppvObj);
@@ -80,7 +85,7 @@
*/
static ULONG WINAPI IStream_fnAddRef(IStream *iface)
{
- ISHFileStream *This = (ISHFileStream *)iface;
+ ISHFileStream *This = impl_from_IStream(iface);
ULONG refCount = InterlockedIncrement(&This->ref);
TRACE("(%p)->(ref before=%u)\n",This, refCount - 1);
@@ -93,7 +98,7 @@
*/
static ULONG WINAPI IStream_fnRelease(IStream *iface)
{
- ISHFileStream *This = (ISHFileStream *)iface;
+ ISHFileStream *This = impl_from_IStream(iface);
ULONG refCount = InterlockedDecrement(&This->ref);
TRACE("(%p)->(ref before=%u)\n",This, refCount + 1);
@@ -114,7 +119,7 @@
*/
static HRESULT WINAPI IStream_fnRead(IStream *iface, void* pv, ULONG cb, ULONG* pcbRead)
{
- ISHFileStream *This = (ISHFileStream *)iface;
+ ISHFileStream *This = impl_from_IStream(iface);
DWORD dwRead = 0;
TRACE("(%p,%p,0x%08x,%p)\n", This, pv, cb, pcbRead);
@@ -134,7 +139,7 @@
*/
static HRESULT WINAPI IStream_fnWrite(IStream *iface, const void* pv, ULONG cb, ULONG*
pcbWritten)
{
- ISHFileStream *This = (ISHFileStream *)iface;
+ ISHFileStream *This = impl_from_IStream(iface);
DWORD dwWritten = 0;
TRACE("(%p,%p,0x%08x,%p)\n", This, pv, cb, pcbWritten);
@@ -162,7 +167,7 @@
static HRESULT WINAPI IStream_fnSeek(IStream *iface, LARGE_INTEGER dlibMove,
DWORD dwOrigin, ULARGE_INTEGER* pNewPos)
{
- ISHFileStream *This = (ISHFileStream *)iface;
+ ISHFileStream *This = impl_from_IStream(iface);
DWORD dwPos;
TRACE("(%p,%d,%d,%p)\n", This, dlibMove.u.LowPart, dwOrigin, pNewPos);
@@ -185,7 +190,7 @@
*/
static HRESULT WINAPI IStream_fnSetSize(IStream *iface, ULARGE_INTEGER libNewSize)
{
- ISHFileStream *This = (ISHFileStream *)iface;
+ ISHFileStream *This = impl_from_IStream(iface);
TRACE("(%p,%d)\n", This, libNewSize.u.LowPart);
@@ -205,7 +210,7 @@
static HRESULT WINAPI IStream_fnCopyTo(IStream *iface, IStream* pstm, ULARGE_INTEGER cb,
ULARGE_INTEGER* pcbRead, ULARGE_INTEGER*
pcbWritten)
{
- ISHFileStream *This = (ISHFileStream *)iface;
+ ISHFileStream *This = impl_from_IStream(iface);
char copyBuff[1024];
ULONGLONG ulSize;
HRESULT hRet = S_OK;
@@ -254,7 +259,7 @@
*/
static HRESULT WINAPI IStream_fnCommit(IStream *iface, DWORD grfCommitFlags)
{
- ISHFileStream *This = (ISHFileStream *)iface;
+ ISHFileStream *This = impl_from_IStream(iface);
TRACE("(%p,%d)\n", This, grfCommitFlags);
/* Currently unbuffered: This function is not needed */
@@ -266,7 +271,7 @@
*/
static HRESULT WINAPI IStream_fnRevert(IStream *iface)
{
- ISHFileStream *This = (ISHFileStream *)iface;
+ ISHFileStream *This = impl_from_IStream(iface);
TRACE("(%p)\n", This);
return E_NOTIMPL;
@@ -278,7 +283,7 @@
static HRESULT WINAPI IStream_fnLockUnlockRegion(IStream *iface, ULARGE_INTEGER
libOffset,
ULARGE_INTEGER cb, DWORD dwLockType)
{
- ISHFileStream *This = (ISHFileStream *)iface;
+ ISHFileStream *This = impl_from_IStream(iface);
TRACE("(%p,%d,%d,%d)\n", This, libOffset.u.LowPart, cb.u.LowPart,
dwLockType);
return E_NOTIMPL;
}
@@ -289,7 +294,7 @@
static HRESULT WINAPI IStream_fnStat(IStream *iface, STATSTG* lpStat,
DWORD grfStatFlag)
{
- ISHFileStream *This = (ISHFileStream *)iface;
+ ISHFileStream *This = impl_from_IStream(iface);
BY_HANDLE_FILE_INFORMATION fi;
HRESULT hRet = S_OK;
@@ -326,7 +331,7 @@
*/
static HRESULT WINAPI IStream_fnClone(IStream *iface, IStream** ppstm)
{
- ISHFileStream *This = (ISHFileStream *)iface;
+ ISHFileStream *This = impl_from_IStream(iface);
TRACE("(%p)\n",This);
if (ppstm)
@@ -365,7 +370,7 @@
if (fileStream)
{
- fileStream->lpVtbl = &SHLWAPI_fsVTable;
+ fileStream->IStream_iface.lpVtbl = &SHLWAPI_fsVTable;
fileStream->ref = 1;
fileStream->hFile = hFile;
fileStream->dwMode = dwMode;
@@ -374,7 +379,7 @@
fileStream->grfStateBits = 0; /* FIXME */
}
TRACE ("Returning %p\n", fileStream);
- return (IStream *)fileStream;
+ return &fileStream->IStream_iface;
}
/*************************************************************************
Modified: trunk/reactos/dll/win32/shlwapi/ordinal.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/ordinal.…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/ordinal.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/ordinal.c [iso-8859-1] Sat Sep 29 13:14:20 2012
@@ -76,7 +76,7 @@
/*************************************************************************
* SHLWAPI_DupSharedHandle
*
- * Internal implemetation of SHLWAPI_11.
+ * Internal implementation of SHLWAPI_11.
*/
static HANDLE SHLWAPI_DupSharedHandle(HANDLE hShared, DWORD dwDstProcId,
DWORD dwSrcProcId, DWORD dwAccess,
@@ -144,7 +144,7 @@
* the view pointer returned by this size.
*
*/
-HANDLE WINAPI SHAllocShared(LPVOID lpvData, ULONG dwSize, DWORD dwProcId)
+HANDLE WINAPI SHAllocShared(LPCVOID lpvData, DWORD dwSize, DWORD dwProcId)
{
HANDLE hMap;
LPVOID pMapped;
@@ -446,7 +446,7 @@
IEnumFORMATETC_Release(pClone);
}
- IEnumFORMATETC_Release(pIUnknown);
+ IUnknown_Release(pIUnknown);
}
IUnknown_Release(V_UNKNOWN(&var));
}
@@ -1136,14 +1136,14 @@
TRACE("%p, %p\n", hWnd, hWndParent);
if(GetParent(hWnd) == hWndParent)
- return 0;
+ return NULL;
if(hWndParent)
- SHSetWindowBits(hWnd, GWL_STYLE, WS_CHILD, WS_CHILD);
+ SHSetWindowBits(hWnd, GWL_STYLE, WS_CHILD | WS_POPUP, WS_CHILD);
else
- SHSetWindowBits(hWnd, GWL_STYLE, WS_POPUP, WS_POPUP);
-
- return SetParent(hWnd, hWndParent);
+ SHSetWindowBits(hWnd, GWL_STYLE, WS_CHILD | WS_POPUP, WS_POPUP);
+
+ return hWndParent ? SetParent(hWnd, hWndParent) : NULL;
}
/*************************************************************************
@@ -1202,7 +1202,7 @@
IConnectionPoint_Release(lpCP); /* Release it */
}
- IUnknown_Release(lpContainer);
+ IConnectionPointContainer_Release(lpContainer);
}
return hRet;
}
@@ -1334,7 +1334,7 @@
if (SUCCEEDED(hRet))
{
- /* Lazyness here - Since GetWindow() is the first method for the above 3
+ /* Laziness here - Since GetWindow() is the first method for the above 3
* interfaces, we use the same call for them all.
*/
hRet = IOleWindow_GetWindow((IOleWindow*)lpOle, lphWnd);
@@ -1400,7 +1400,7 @@
{
hr = IObjectWithSite_SetSite(iobjwithsite, site);
TRACE("done IObjectWithSite_SetSite ret=%08x\n", hr);
- IUnknown_Release(iobjwithsite);
+ IObjectWithSite_Release(iobjwithsite);
}
else
{
@@ -1410,7 +1410,7 @@
hr = IInternetSecurityManager_SetSecuritySite(isecmgr, (IInternetSecurityMgrSite
*)site);
TRACE("done IInternetSecurityManager_SetSecuritySite ret=%08x\n", hr);
- IUnknown_Release(isecmgr);
+ IInternetSecurityManager_Release(isecmgr);
}
return hr;
}
@@ -1435,7 +1435,7 @@
IPersist* lpPersist;
HRESULT hRet = E_FAIL;
- TRACE("(%p,%p)\n", lpUnknown, debugstr_guid(lpClassId));
+ TRACE("(%p,%s)\n", lpUnknown, debugstr_guid(lpClassId));
if (lpUnknown)
{
@@ -1493,7 +1493,7 @@
TRACE("(IServiceProvider*)%p returned (IUnknown*)%p\n", pService,
*lppOut);
- IUnknown_Release(pService);
+ IServiceProvider_Release(pService);
}
return hRet;
}
@@ -1571,7 +1571,10 @@
if (pService)
hr = IProfferService_ProfferService(proffer, service, pService, pCookie);
else
+ {
hr = IProfferService_RevokeService(proffer, *pCookie);
+ *pCookie = 0;
+ }
IProfferService_Release(proffer);
}
@@ -1610,7 +1613,7 @@
if (ret == S_OK)
{
ret = IInputObject_UIActivateIO(object, activate, msg);
- IUnknown_Release(object);
+ IInputObject_Release(object);
}
return ret;
@@ -3735,7 +3738,6 @@
/*************************************************************************
* @ [SHLWAPI.404]
*/
-#if 1
HRESULT WINAPI SHIShellFolder_EnumObjects(LPSHELLFOLDER lpFolder, HWND hwnd, SHCONTF
flags, IEnumIDList **ppenum)
{
/* Windows attempts to get an IPersist interface and, if that fails, an
@@ -3752,29 +3754,6 @@
return IShellFolder_EnumObjects(lpFolder, hwnd, flags, ppenum);
}
-#else
-HRESULT WINAPI SHIShellFolder_EnumObjects(LPSHELLFOLDER lpFolder, HWND hwnd, SHCONTF
flags, IEnumIDList **ppenum)
-{
- IPersist *persist;
- HRESULT hr;
-
- hr = IShellFolder_QueryInterface(lpFolder, &IID_IPersist, (LPVOID)&persist);
- if(SUCCEEDED(hr))
- {
- CLSID clsid;
- hr = IPersist_GetClassID(persist, &clsid);
- if(SUCCEEDED(hr))
- {
- if(IsEqualCLSID(&clsid, &CLSID_ShellFSFolder))
- hr = IShellFolder_EnumObjects(lpFolder, hwnd, flags, ppenum);
- else
- hr = E_FAIL;
- }
- IPersist_Release(persist);
- }
- return hr;
-}
-#endif
/* INTERNAL: Map from HLS color space to RGB */
static WORD ConvertHue(int wHue, WORD wMid1, WORD wMid2)
@@ -3863,6 +3842,28 @@
default:
return 0;
}
+}
+
+/*************************************************************************
+ * @ [SHLWAPI.416]
+ *
+ */
+DWORD WINAPI SHWinHelpOnDemandW(HWND hwnd, LPCWSTR helpfile, DWORD flags1, VOID *ptr1,
DWORD flags2)
+{
+
+ FIXME("(%p, %s, 0x%x, %p, %d)\n", hwnd, debugstr_w(helpfile), flags1, ptr1,
flags2);
+ return 0;
+}
+
+/*************************************************************************
+ * @ [SHLWAPI.417]
+ *
+ */
+DWORD WINAPI SHWinHelpOnDemandA(HWND hwnd, LPCSTR helpfile, DWORD flags1, VOID *ptr1,
DWORD flags2)
+{
+
+ FIXME("(%p, %s, 0x%x, %p, %d)\n", hwnd, debugstr_a(helpfile), flags1, ptr1,
flags2);
+ return 0;
}
/*************************************************************************
@@ -4062,8 +4063,11 @@
case OS_ANYSERVER:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT)
case OS_WOW6432:
- FIXME("(OS_WOW6432) Should we check this?\n");
- return FALSE;
+ {
+ BOOL is_wow64;
+ IsWow64Process(GetCurrentProcess(), &is_wow64);
+ return is_wow64;
+ }
case OS_WEBSERVER:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT)
case OS_SMALLBUSINESSSERVER:
@@ -4425,12 +4429,141 @@
}
/***********************************************************************
- * SHGetShellKey (SHLWAPI.@)
+ * SHGetShellKey (SHLWAPI.491)
*/
HKEY WINAPI SHGetShellKey(DWORD flags, LPCWSTR sub_key, BOOL create)
{
- FIXME("(0x%08x, %s, %d): stub\n", flags, debugstr_w(sub_key), create);
- return (HKEY)0x50;
+ enum _shellkey_flags {
+ SHKEY_Root_HKCU = 0x1,
+ SHKEY_Root_HKLM = 0x2,
+ SHKEY_Key_Explorer = 0x00,
+ SHKEY_Key_Shell = 0x10,
+ SHKEY_Key_ShellNoRoam = 0x20,
+ SHKEY_Key_Classes = 0x30,
+ SHKEY_Subkey_Default = 0x0000,
+ SHKEY_Subkey_ResourceName = 0x1000,
+ SHKEY_Subkey_Handlers = 0x2000,
+ SHKEY_Subkey_Associations = 0x3000,
+ SHKEY_Subkey_Volatile = 0x4000,
+ SHKEY_Subkey_MUICache = 0x5000,
+ SHKEY_Subkey_FileExts = 0x6000
+ };
+
+ static const WCHAR explorerW[] =
{'S','o','f','t','w','a','r','e','\\',
+
'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\',
+
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
+
'E','x','p','l','o','r','e','r','\\'};
+ static const WCHAR shellW[] =
{'S','o','f','t','w','a','r','e','\\',
+
'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\',
+ 'S','h','e','l','l','\\'};
+ static const WCHAR shell_no_roamW[] =
{'S','o','f','t','w','a','r','e','\\',
+
'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\',
+
'S','h','e','l','l','N','o','R','o','a','m','\\'};
+ static const WCHAR classesW[] =
{'S','o','f','t','w','a','r','e','\\',
+
'C','l','a','s','s','e','s','\\'};
+
+ static const WCHAR localized_resource_nameW[] =
{'L','o','c','a','l','i','z','e','d',
+
'R','e','s','o','u','r','c','e','N','a','m','e','\\'};
+ static const WCHAR handlersW[] =
{'H','a','n','d','l','e','r','s','\\'};
+ static const WCHAR associationsW[] =
{'A','s','s','o','c','i','a','t','i','o','n','s','\\'};
+ static const WCHAR volatileW[] =
{'V','o','l','a','t','i','l','e','\\'};
+ static const WCHAR mui_cacheW[] =
{'M','U','I','C','a','c','h','e','\\'};
+ static const WCHAR file_extsW[] =
{'F','i','l','e','E','x','t','s','\\'};
+
+ WCHAR *path;
+ const WCHAR *key, *subkey;
+ int size_key, size_subkey, size_user;
+ HKEY hkey = NULL;
+
+ TRACE("(0x%08x, %s, %d)\n", flags, debugstr_w(sub_key), create);
+
+ /* For compatibility with Vista+ */
+ if(flags == 0x1ffff)
+ flags = 0x21;
+
+ switch(flags&0xff0) {
+ case SHKEY_Key_Explorer:
+ key = explorerW;
+ size_key = sizeof(explorerW);
+ break;
+ case SHKEY_Key_Shell:
+ key = shellW;
+ size_key = sizeof(shellW);
+ break;
+ case SHKEY_Key_ShellNoRoam:
+ key = shell_no_roamW;
+ size_key = sizeof(shell_no_roamW);
+ break;
+ case SHKEY_Key_Classes:
+ key = classesW;
+ size_key = sizeof(classesW);
+ break;
+ default:
+ FIXME("unsupported flags (0x%08x)\n", flags);
+ return NULL;
+ }
+
+ switch(flags&0xff000) {
+ case SHKEY_Subkey_Default:
+ subkey = NULL;
+ size_subkey = 0;
+ break;
+ case SHKEY_Subkey_ResourceName:
+ subkey = localized_resource_nameW;
+ size_subkey = sizeof(localized_resource_nameW);
+ break;
+ case SHKEY_Subkey_Handlers:
+ subkey = handlersW;
+ size_subkey = sizeof(handlersW);
+ break;
+ case SHKEY_Subkey_Associations:
+ subkey = associationsW;
+ size_subkey = sizeof(associationsW);
+ break;
+ case SHKEY_Subkey_Volatile:
+ subkey = volatileW;
+ size_subkey = sizeof(volatileW);
+ break;
+ case SHKEY_Subkey_MUICache:
+ subkey = mui_cacheW;
+ size_subkey = sizeof(mui_cacheW);
+ break;
+ case SHKEY_Subkey_FileExts:
+ subkey = file_extsW;
+ size_subkey = sizeof(file_extsW);
+ break;
+ default:
+ FIXME("unsupported flags (0x%08x)\n", flags);
+ return NULL;
+ }
+
+ if(sub_key)
+ size_user = lstrlenW(sub_key)*sizeof(WCHAR);
+ else
+ size_user = 0;
+
+ path = HeapAlloc(GetProcessHeap(), 0, size_key+size_subkey+size_user+sizeof(WCHAR));
+ if(!path) {
+ ERR("Out of memory\n");
+ return NULL;
+ }
+
+ memcpy(path, key, size_key);
+ if(subkey)
+ memcpy(path+size_key/sizeof(WCHAR), subkey, size_subkey);
+ if(sub_key)
+ memcpy(path+(size_key+size_subkey)/sizeof(WCHAR), sub_key, size_user);
+ path[(size_key+size_subkey+size_user)/sizeof(WCHAR)] = '\0';
+
+ if(create)
+
RegCreateKeyExW((flags&0xf)==SHKEY_Root_HKLM?HKEY_LOCAL_MACHINE:HKEY_CURRENT_USER,
+ path, 0, NULL, 0, MAXIMUM_ALLOWED, NULL, &hkey, NULL);
+ else
+
RegOpenKeyExW((flags&0xf)==SHKEY_Root_HKLM?HKEY_LOCAL_MACHINE:HKEY_CURRENT_USER,
+ path, 0, MAXIMUM_ALLOWED, &hkey);
+
+ HeapFree(GetProcessHeap(), 0, path);
+ return hkey;
}
/***********************************************************************
@@ -4499,12 +4632,104 @@
}
/***********************************************************************
- * SHGetValueW (SHLWAPI.@)
- */
-HRESULT WINAPI SKGetValueW(DWORD a, LPWSTR b, LPWSTR c, DWORD d, DWORD e, DWORD f)
-{
- FIXME("(%x, %s, %s, %x, %x, %x): stub\n", a, debugstr_w(b), debugstr_w(c),
d, e, f);
- return E_FAIL;
+ * SKAllocValueW (SHLWAPI.519)
+ */
+HRESULT WINAPI SKAllocValueW(DWORD flags, LPCWSTR subkey, LPCWSTR value, DWORD *type,
+ LPVOID *data, DWORD *count)
+{
+ DWORD ret, size;
+ HKEY hkey;
+
+ TRACE("(0x%x, %s, %s, %p, %p, %p)\n", flags, debugstr_w(subkey),
+ debugstr_w(value), type, data, count);
+
+ hkey = SHGetShellKey(flags, subkey, FALSE);
+ if (!hkey)
+ return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
+
+ ret = SHQueryValueExW(hkey, value, NULL, type, NULL, &size);
+ if (ret) {
+ RegCloseKey(hkey);
+ return HRESULT_FROM_WIN32(ret);
+ }
+
+ size += 2;
+ *data = LocalAlloc(0, size);
+ if (!*data) {
+ RegCloseKey(hkey);
+ return E_OUTOFMEMORY;
+ }
+
+ ret = SHQueryValueExW(hkey, value, NULL, type, *data, &size);
+ if (count)
+ *count = size;
+
+ RegCloseKey(hkey);
+ return HRESULT_FROM_WIN32(ret);
+}
+
+/***********************************************************************
+ * SKDeleteValueW (SHLWAPI.518)
+ */
+HRESULT WINAPI SKDeleteValueW(DWORD flags, LPCWSTR subkey, LPCWSTR value)
+{
+ DWORD ret;
+ HKEY hkey;
+
+ TRACE("(0x%x, %s %s)\n", flags, debugstr_w(subkey), debugstr_w(value));
+
+ hkey = SHGetShellKey(flags, subkey, FALSE);
+ if (!hkey)
+ return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
+
+ ret = RegDeleteValueW(hkey, value);
+
+ RegCloseKey(hkey);
+ return HRESULT_FROM_WIN32(ret);
+}
+
+/***********************************************************************
+ * SKGetValueW (SHLWAPI.516)
+ */
+HRESULT WINAPI SKGetValueW(DWORD flags, LPCWSTR subkey, LPCWSTR value, DWORD *type,
+ void *data, DWORD *count)
+{
+ DWORD ret;
+ HKEY hkey;
+
+ TRACE("(0x%x, %s, %s, %p, %p, %p)\n", flags, debugstr_w(subkey),
+ debugstr_w(value), type, data, count);
+
+ hkey = SHGetShellKey(flags, subkey, FALSE);
+ if (!hkey)
+ return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
+
+ ret = SHQueryValueExW(hkey, value, NULL, type, data, count);
+
+ RegCloseKey(hkey);
+ return HRESULT_FROM_WIN32(ret);
+}
+
+/***********************************************************************
+ * SKSetValueW (SHLWAPI.516)
+ */
+HRESULT WINAPI SKSetValueW(DWORD flags, LPCWSTR subkey, LPCWSTR value,
+ DWORD type, void *data, DWORD count)
+{
+ DWORD ret;
+ HKEY hkey;
+
+ TRACE("(0x%x, %s, %s, %x, %p, %d)\n", flags, debugstr_w(subkey),
+ debugstr_w(value), type, data, count);
+
+ hkey = SHGetShellKey(flags, subkey, TRUE);
+ if (!hkey)
+ return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
+
+ ret = RegSetValueExW(hkey, value, 0, type, data, count);
+
+ RegCloseKey(hkey);
+ return HRESULT_FROM_WIN32(ret);
}
typedef HRESULT (WINAPI *DllGetVersion_func)(DLLVERSIONINFO *);
Modified: trunk/reactos/dll/win32/shlwapi/path.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/path.c?r…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/path.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/path.c [iso-8859-1] Sat Sep 29 13:14:20 2012
@@ -760,6 +760,10 @@
* PARAMS
* lpszPath [I/O] Path to remove the extension from
*
+ * NOTES
+ * The NUL terminator must be written only if extension exists
+ * and if the pointed character is not already NUL.
+ *
* RETURNS
* Nothing.
*/
@@ -770,7 +774,8 @@
if (lpszPath)
{
lpszPath = PathFindExtensionA(lpszPath);
- *lpszPath = '\0';
+ if (lpszPath && *lpszPath != '\0')
+ *lpszPath = '\0';
}
}
@@ -786,7 +791,8 @@
if (lpszPath)
{
lpszPath = PathFindExtensionW(lpszPath);
- *lpszPath = '\0';
+ if (lpszPath && *lpszPath != '\0')
+ *lpszPath = '\0';
}
}
@@ -1074,7 +1080,7 @@
*/
BOOL WINAPI PathFileExistsDefExtW(LPWSTR lpszPath,DWORD dwWhich)
{
- static const WCHAR pszExts[7][5] = { { '.', 'p', 'i',
'f', 0},
+ static const WCHAR pszExts[][5] = { { '.', 'p', 'i',
'f', 0},
{ '.', 'c', 'o',
'm', 0},
{ '.', 'e', 'x',
'e', 0},
{ '.', 'b', 'a',
't', 0},
@@ -1708,7 +1714,7 @@
iPrevErrMode = SetErrorMode(SEM_FAILCRITICALERRORS);
dwAttr = GetFileAttributesA(lpszPath);
SetErrorMode(iPrevErrMode);
- return dwAttr == INVALID_FILE_ATTRIBUTES ? FALSE : TRUE;
+ return dwAttr != INVALID_FILE_ATTRIBUTES;
}
/*************************************************************************
@@ -1729,7 +1735,7 @@
iPrevErrMode = SetErrorMode(SEM_FAILCRITICALERRORS);
dwAttr = GetFileAttributesW(lpszPath);
SetErrorMode(iPrevErrMode);
- return dwAttr == INVALID_FILE_ATTRIBUTES ? FALSE : TRUE;
+ return dwAttr != INVALID_FILE_ATTRIBUTES;
}
/*************************************************************************
@@ -2416,7 +2422,7 @@
else if (lpszSrc[1] == '.' && (lpszDst == lpszBuf || lpszDst[-1] ==
'\\'))
{
/* \.. backs up a directory, over the root if it has no \ following X:.
- * .. is ignored if it would remove a UNC server name or inital \\
+ * .. is ignored if it would remove a UNC server name or initial \\
*/
if (lpszDst != lpszBuf)
{
@@ -2974,7 +2980,7 @@
{
if (ch < 126)
{
- if ((ch & 0x1 && ch != ';') || !ch || isalnum(ch) || ch ==
'$' || ch == '&' || ch == '(' ||
+ if (((ch & 0x1) && ch != ';') || !ch || isalnum(ch) || ch ==
'$' || ch == '&' || ch == '(' ||
ch == '.' || ch == '@' || ch == '^' ||
ch == '\'' || ch == 130 || ch == '`')
flags |= GCT_SHORTCHAR; /* All these are valid for DOS */
Modified: trunk/reactos/dll/win32/shlwapi/reg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/reg.c?re…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/reg.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/reg.c [iso-8859-1] Sat Sep 29 13:14:20 2012
@@ -235,12 +235,49 @@
*
* See SHRegCreateUSKeyA.
*/
-LONG WINAPI SHRegCreateUSKeyW(LPCWSTR pszPath, REGSAM samDesired, HUSKEY hRelativeUSKey,
- PHUSKEY phNewUSKey, DWORD dwFlags)
-{
- FIXME("(%s, 0x%08x, %p, %p, 0x%08x) stub\n", debugstr_w(pszPath),
samDesired,
- hRelativeUSKey, phNewUSKey, dwFlags);
- return ERROR_SUCCESS;
+LONG WINAPI SHRegCreateUSKeyW(LPCWSTR path, REGSAM samDesired, HUSKEY relative_key,
+ PHUSKEY new_uskey, DWORD flags)
+{
+ LONG ret = ERROR_CALL_NOT_IMPLEMENTED;
+ SHUSKEY *ret_key;
+
+ TRACE("(%s, 0x%08x, %p, %p, 0x%08x)\n", debugstr_w(path), samDesired,
+ relative_key, new_uskey, flags);
+
+ if (!new_uskey) return ERROR_INVALID_PARAMETER;
+
+ *new_uskey = NULL;
+
+ if (flags & ~SHREGSET_FORCE_HKCU)
+ {
+ FIXME("unsupported flags 0x%08x\n", flags);
+ return ERROR_SUCCESS;
+ }
+
+ ret_key = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ret_key));
+ lstrcpynW(ret_key->lpszPath, path, sizeof(ret_key->lpszPath)/sizeof(WCHAR));
+
+ if (relative_key)
+ {
+ ret_key->HKCUstart = SHRegDuplicateHKey(REG_GetHKEYFromHUSKEY(relative_key,
REG_HKCU));
+ ret_key->HKLMstart = SHRegDuplicateHKey(REG_GetHKEYFromHUSKEY(relative_key,
REG_HKLM));
+ }
+ else
+ {
+ ret_key->HKCUstart = HKEY_CURRENT_USER;
+ ret_key->HKLMstart = HKEY_LOCAL_MACHINE;
+ }
+
+ if (flags & SHREGSET_FORCE_HKCU)
+ {
+ ret = RegCreateKeyExW(ret_key->HKCUstart, path, 0, NULL, 0, samDesired, NULL,
&ret_key->HKCUkey, NULL);
+ if (ret == ERROR_SUCCESS)
+ *new_uskey = ret_key;
+ else
+ HeapFree(GetProcessHeap(), 0, ret_key);
+ }
+
+ return ret;
}
/*************************************************************************
@@ -1853,17 +1890,14 @@
*/
BOOL WINAPI RegisterMIMETypeForExtensionA(LPCSTR lpszSubKey, LPCSTR lpszValue)
{
- DWORD dwRet;
-
if (!lpszValue)
{
WARN("Invalid lpszValue would crash under Win32!\n");
return FALSE;
}
- dwRet = SHSetValueA(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeA,
+ return !SHSetValueA(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeA,
REG_SZ, lpszValue, strlen(lpszValue));
- return dwRet ? FALSE : TRUE;
}
/*************************************************************************
@@ -1873,17 +1907,14 @@
*/
BOOL WINAPI RegisterMIMETypeForExtensionW(LPCWSTR lpszSubKey, LPCWSTR lpszValue)
{
- DWORD dwRet;
-
if (!lpszValue)
{
WARN("Invalid lpszValue would crash under Win32!\n");
return FALSE;
}
- dwRet = SHSetValueW(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeW,
+ return !SHSetValueW(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeW,
REG_SZ, lpszValue, strlenW(lpszValue));
- return dwRet ? FALSE : TRUE;
}
/*************************************************************************
@@ -1900,8 +1931,7 @@
*/
BOOL WINAPI UnregisterMIMETypeForExtensionA(LPCSTR lpszSubKey)
{
- HRESULT ret = SHDeleteValueA(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeA);
- return ret ? FALSE : TRUE;
+ return !SHDeleteValueA(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeA);
}
/*************************************************************************
@@ -1911,8 +1941,7 @@
*/
BOOL WINAPI UnregisterMIMETypeForExtensionW(LPCWSTR lpszSubKey)
{
- HRESULT ret = SHDeleteValueW(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeW);
- return ret ? FALSE : TRUE;
+ return !SHDeleteValueW(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeW);
}
/*************************************************************************
Modified: trunk/reactos/dll/win32/shlwapi/regstream.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/regstrea…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/regstream.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/regstream.c [iso-8859-1] Sat Sep 29 13:14:20 2012
@@ -37,7 +37,7 @@
typedef struct
{
- const IStreamVtbl *lpVtbl;
+ IStream IStream_iface;
LONG ref;
HKEY hKey;
LPBYTE pbBuffer;
@@ -51,12 +51,17 @@
BOOL bUnicode;
} ISHRegStream;
+static inline ISHRegStream *impl_from_IStream(IStream *iface)
+{
+ return CONTAINING_RECORD(iface, ISHRegStream, IStream_iface);
+}
+
/**************************************************************************
* IStream_fnQueryInterface
*/
static HRESULT WINAPI IStream_fnQueryInterface(IStream *iface, REFIID riid, LPVOID
*ppvObj)
{
- ISHRegStream *This = (ISHRegStream *)iface;
+ ISHRegStream *This = impl_from_IStream(iface);
TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj);
@@ -82,7 +87,7 @@
*/
static ULONG WINAPI IStream_fnAddRef(IStream *iface)
{
- ISHRegStream *This = (ISHRegStream *)iface;
+ ISHRegStream *This = impl_from_IStream(iface);
ULONG refCount = InterlockedIncrement(&This->ref);
TRACE("(%p)->(ref before=%u)\n",This, refCount - 1);
@@ -95,7 +100,7 @@
*/
static ULONG WINAPI IStream_fnRelease(IStream *iface)
{
- ISHRegStream *This = (ISHRegStream *)iface;
+ ISHRegStream *This = impl_from_IStream(iface);
ULONG refCount = InterlockedDecrement(&This->ref);
TRACE("(%p)->(ref before=%u)\n",This, refCount + 1);
@@ -144,7 +149,7 @@
*/
static HRESULT WINAPI IStream_fnRead (IStream * iface, void* pv, ULONG cb, ULONG*
pcbRead)
{
- ISHRegStream *This = (ISHRegStream *)iface;
+ ISHRegStream *This = impl_from_IStream(iface);
DWORD dwBytesToRead;
TRACE("(%p)->(%p,0x%08x,%p)\n",This, pv, cb, pcbRead);
@@ -172,7 +177,7 @@
*/
static HRESULT WINAPI IStream_fnWrite (IStream * iface, const void* pv, ULONG cb, ULONG*
pcbWritten)
{
- ISHRegStream *This = (ISHRegStream *)iface;
+ ISHRegStream *This = impl_from_IStream(iface);
DWORD newLen = This->dwPos + cb;
TRACE("(%p, %p, %d, %p)\n",This, pv, cb, pcbWritten);
@@ -203,7 +208,7 @@
*/
static HRESULT WINAPI IStream_fnSeek (IStream * iface, LARGE_INTEGER dlibMove, DWORD
dwOrigin, ULARGE_INTEGER* plibNewPosition)
{
- ISHRegStream *This = (ISHRegStream *)iface;
+ ISHRegStream *This = impl_from_IStream(iface);
LARGE_INTEGER tmp;
TRACE("(%p, %s, %d %p)\n", This,
wine_dbgstr_longlong(dlibMove.QuadPart), dwOrigin, plibNewPosition);
@@ -233,7 +238,7 @@
*/
static HRESULT WINAPI IStream_fnSetSize (IStream * iface, ULARGE_INTEGER libNewSize)
{
- ISHRegStream *This = (ISHRegStream *)iface;
+ ISHRegStream *This = impl_from_IStream(iface);
DWORD newLen;
LPBYTE newBuf;
@@ -256,7 +261,7 @@
*/
static HRESULT WINAPI IStream_fnCopyTo (IStream * iface, IStream* pstm, ULARGE_INTEGER
cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten)
{
- ISHRegStream *This = (ISHRegStream *)iface;
+ ISHRegStream *This = impl_from_IStream(iface);
TRACE("(%p)\n",This);
if (pcbRead)
@@ -273,7 +278,7 @@
*/
static HRESULT WINAPI IStream_fnCommit (IStream * iface, DWORD grfCommitFlags)
{
- ISHRegStream *This = (ISHRegStream *)iface;
+ ISHRegStream *This = impl_from_IStream(iface);
TRACE("(%p)\n",This);
@@ -286,7 +291,7 @@
*/
static HRESULT WINAPI IStream_fnRevert (IStream * iface)
{
- ISHRegStream *This = (ISHRegStream *)iface;
+ ISHRegStream *This = impl_from_IStream(iface);
TRACE("(%p)\n",This);
@@ -299,7 +304,7 @@
*/
static HRESULT WINAPI IStream_fnLockUnlockRegion (IStream * iface, ULARGE_INTEGER
libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
{
- ISHRegStream *This = (ISHRegStream *)iface;
+ ISHRegStream *This = impl_from_IStream(iface);
TRACE("(%p)\n",This);
@@ -312,7 +317,7 @@
*/
static HRESULT WINAPI IStream_fnStat (IStream * iface, STATSTG* pstatstg, DWORD
grfStatFlag)
{
- ISHRegStream *This = (ISHRegStream *)iface;
+ ISHRegStream *This = impl_from_IStream(iface);
TRACE("(%p, %p, %d)\n",This,pstatstg,grfStatFlag);
@@ -339,7 +344,7 @@
*/
static HRESULT WINAPI IStream_fnClone (IStream * iface, IStream** ppstm)
{
- ISHRegStream *This = (ISHRegStream *)iface;
+ ISHRegStream *This = impl_from_IStream(iface);
TRACE("(%p)\n",This);
*ppstm = NULL;
@@ -373,7 +378,7 @@
*/
static ULONG WINAPI IStream_fnAddRefDummy(IStream *iface)
{
- ISHRegStream *This = (ISHRegStream *)iface;
+ ISHRegStream *This = impl_from_IStream(iface);
TRACE("(%p)\n", This);
return 2;
}
@@ -383,7 +388,7 @@
*/
static ULONG WINAPI IStream_fnReleaseDummy(IStream *iface)
{
- ISHRegStream *This = (ISHRegStream *)iface;
+ ISHRegStream *This = impl_from_IStream(iface);
TRACE("(%p)\n", This);
return 1;
}
@@ -419,7 +424,7 @@
/* Dummy registry stream object */
static ISHRegStream rsDummyRegStream =
{
- &DummyRegStreamVTable,
+ { &DummyRegStreamVTable },
1,
NULL,
NULL,
@@ -443,7 +448,7 @@
if (regStream)
{
- regStream->lpVtbl = &rstvt;
+ regStream->IStream_iface.lpVtbl = &rstvt;
regStream->ref = 1;
regStream->hKey = hKey;
regStream->pbBuffer = pbBuffer;
@@ -516,7 +521,7 @@
tmp->dwMode = dwMode;
tmp->bUnicode = FALSE;
- return (IStream *)tmp;
+ return &tmp->IStream_iface;
}
}
@@ -576,7 +581,7 @@
tmp->dwMode = dwMode;
tmp->bUnicode = TRUE;
- return (IStream *)tmp;
+ return &tmp->IStream_iface;
}
}
@@ -610,7 +615,7 @@
TRACE("(%p,%s,%s,0x%08x)\n", hkey, pszSubkey, pszValue, dwMode);
iStream = SHOpenRegStream2A(hkey, pszSubkey, pszValue, dwMode);
- return iStream ? iStream : (IStream *)&rsDummyRegStream;
+ return iStream ? iStream : &rsDummyRegStream.IStream_iface;
}
/*************************************************************************
@@ -626,7 +631,7 @@
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;
+ return iStream ? iStream : &rsDummyRegStream.IStream_iface;
}
/*************************************************************************
@@ -648,7 +653,7 @@
*/
IStream * WINAPI SHCreateMemStream(const BYTE *lpbData, UINT dwDataLen)
{
- IStream *iStrmRet = NULL;
+ ISHRegStream *strm = NULL;
LPBYTE lpbDup;
TRACE("(%p,%d)\n", lpbData, dwDataLen);
@@ -661,12 +666,12 @@
if (lpbDup)
{
memcpy(lpbDup, lpbData, dwDataLen);
- iStrmRet = (IStream *)IStream_Create(NULL, lpbDup, dwDataLen);
-
- if (!iStrmRet)
+ strm = IStream_Create(NULL, lpbDup, dwDataLen);
+
+ if (!strm)
HeapFree(GetProcessHeap(), 0, lpbDup);
}
- return iStrmRet;
+ return &strm->IStream_iface;
}
/*************************************************************************
@@ -691,7 +696,7 @@
HRESULT WINAPI SHCreateStreamWrapper(LPBYTE lpbData, DWORD dwDataLen,
DWORD dwReserved, IStream **lppStream)
{
- IStream* lpStream;
+ ISHRegStream *strm;
if (lppStream)
*lppStream = NULL;
@@ -699,12 +704,12 @@
if(dwReserved || !lppStream)
return E_INVALIDARG;
- lpStream = (IStream *)IStream_Create(NULL, lpbData, dwDataLen);
-
- if(!lpStream)
+ strm = IStream_Create(NULL, lpbData, dwDataLen);
+
+ if(!strm)
return E_OUTOFMEMORY;
- IStream_QueryInterface(lpStream, &IID_IStream, (void**)lppStream);
- IStream_Release(lpStream);
+ IStream_QueryInterface(&strm->IStream_iface, &IID_IStream,
(void**)lppStream);
+ IStream_Release(&strm->IStream_iface);
return S_OK;
}
Modified: trunk/reactos/dll/win32/shlwapi/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/resource…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/resource.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/resource.h [iso-8859-1] Sat Sep 29 13:14:20 2012
@@ -28,7 +28,7 @@
#define IDS_TIME_INTERVAL_MINUTES 66
#define IDS_TIME_INTERVAL_SECONDS 67
-/* These numbers match native ID's and shouldn't be arbitrarily changed */
+/* These numbers match native IDs and shouldn't be arbitrarily changed */
#define IDD_ERR_DIALOG 0x1200
#define IDS_ERR_USER_MSG 0x1201
#define IDC_ERR_DONT_SHOW 0x1202
Modified: trunk/reactos/dll/win32/shlwapi/shlwapi.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi.…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/shlwapi.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/shlwapi.spec [iso-8859-1] Sat Sep 29 13:14:20 2012
@@ -1,19 +1,19 @@
-1 stdcall -noname ParseURLA(str ptr)
-2 stdcall -noname ParseURLW(wstr ptr)
+1 stdcall -ordinal ParseURLA(str ptr)
+2 stdcall -ordinal ParseURLW(wstr ptr)
3 stdcall -noname PathFileExistsDefExtA(str long)
4 stdcall -noname PathFileExistsDefExtW(wstr long)
5 stdcall -noname PathFindOnPathExA(str ptr long)
6 stdcall -noname PathFindOnPathExW(wstr ptr long)
-7 stdcall -noname SHAllocShared(ptr long long)
-8 stdcall -noname SHLockShared(long long)
-9 stdcall -noname SHUnlockShared(ptr)
-10 stdcall -noname SHFreeShared(long long)
+7 stdcall -ordinal SHAllocShared(ptr long long)
+8 stdcall -ordinal SHLockShared(long long)
+9 stdcall -ordinal SHUnlockShared(ptr)
+10 stdcall -ordinal SHFreeShared(long long)
11 stdcall -noname SHMapHandle(long long long long long)
-12 stdcall -noname SHCreateMemStream(ptr long)
+12 stdcall -ordinal SHCreateMemStream(ptr long)
13 stdcall -noname RegisterDefaultAcceptHeaders(ptr ptr)
-14 stdcall -noname GetAcceptLanguagesA(ptr ptr)
-15 stdcall -noname GetAcceptLanguagesW(ptr ptr)
-16 stdcall -noname SHCreateThread(ptr ptr long ptr)
+14 stdcall -ordinal GetAcceptLanguagesA(ptr ptr)
+15 stdcall -ordinal GetAcceptLanguagesW(ptr ptr)
+16 stdcall -ordinal SHCreateThread(ptr ptr long ptr)
17 stdcall -noname SHWriteDataBlockList(ptr ptr)
18 stdcall -noname SHReadDataBlockList(ptr ptr)
19 stdcall -noname SHFreeDataBlockList(ptr)
@@ -26,7 +26,7 @@
26 stdcall -noname IsCharUpperWrapW(long) user32.IsCharUpperW
27 stdcall -noname IsCharLowerWrapW(long) user32.IsCharLowerW
28 stdcall -noname IsCharAlphaNumericWrapW(long) user32.IsCharAlphaNumericW
-29 stdcall -noname IsCharSpaceW(long)
+29 stdcall -ordinal IsCharSpaceW(long)
30 stdcall -noname IsCharBlankW(long)
31 stdcall -noname IsCharPunctW(long)
32 stdcall -noname IsCharCntrlW(ptr)
@@ -148,14 +148,14 @@
148 stdcall -noname VkKeyScanWrapW(long) user32.VkKeyScanW
149 stdcall -noname WinHelpWrapW(long wstr long long) user32.WinHelpW
150 stdcall -noname wvsprintfWrapW(ptr wstr ptr) user32.wvsprintfW
-151 stdcall -noname StrCmpNCA(str ptr long)
-152 stdcall -noname StrCmpNCW(wstr wstr long)
-153 stdcall -noname StrCmpNICA(long long long)
-154 stdcall -noname StrCmpNICW(wstr wstr long)
-155 stdcall -noname StrCmpCA(str str)
-156 stdcall -noname StrCmpCW(wstr wstr)
-157 stdcall -noname StrCmpICA(str str)
-158 stdcall -noname StrCmpICW(wstr wstr)
+151 stdcall -ordinal StrCmpNCA(str ptr long)
+152 stdcall -ordinal StrCmpNCW(wstr wstr long)
+153 stdcall -ordinal StrCmpNICA(long long long)
+154 stdcall -ordinal StrCmpNICW(wstr wstr long)
+155 stdcall -ordinal StrCmpCA(str str)
+156 stdcall -ordinal StrCmpCW(wstr wstr)
+157 stdcall -ordinal StrCmpICA(str str)
+158 stdcall -ordinal StrCmpICW(wstr wstr)
159 stdcall -noname CompareStringAltW(long long wstr long wstr long)
kernel32.CompareStringW
160 stdcall -noname SHAboutInfoA(ptr long)
161 stdcall -noname SHAboutInfoW(ptr long)
@@ -165,15 +165,15 @@
165 stdcall -noname SHSetWindowBits(long long long long)
166 stdcall -noname SHIsEmptyStream(ptr)
167 stdcall -noname SHSetParentHwnd(long ptr)
-168 stdcall -noname ConnectToConnectionPoint(ptr ptr long ptr ptr ptr)
-169 stdcall -noname IUnknown_AtomicRelease(long)
+168 stdcall -ordinal ConnectToConnectionPoint(ptr ptr long ptr ptr ptr)
+169 stdcall -ordinal IUnknown_AtomicRelease(long)
170 stdcall -noname PathSkipLeadingSlashesA(str)
171 stdcall -noname SHIsSameObject(ptr ptr)
-172 stdcall -noname IUnknown_GetWindow(ptr ptr)
+172 stdcall -ordinal IUnknown_GetWindow(ptr ptr)
173 stdcall -noname IUnknown_SetOwner(ptr ptr)
-174 stdcall -noname IUnknown_SetSite(ptr ptr)
+174 stdcall -ordinal IUnknown_SetSite(ptr ptr)
175 stdcall -noname IUnknown_GetClassID(ptr ptr)
-176 stdcall -noname IUnknown_QueryService(ptr ptr ptr ptr)
+176 stdcall -ordinal IUnknown_QueryService(ptr ptr ptr ptr)
177 stdcall -noname SHLoadMenuPopup(ptr wstr)
178 stdcall -noname SHPropagateMessage(ptr long long long long)
179 stdcall -noname SHMenuIndexFromID(long long)
@@ -181,14 +181,14 @@
181 stdcall -noname SHEnableMenuItem(long long long)
182 stdcall -noname SHCheckMenuItem(long long long)
183 stdcall -noname SHRegisterClassA(ptr)
-184 stdcall -noname IStream_Read(ptr ptr long) SHIStream_Read
-185 stdcall -noname SHMessageBoxCheckA(ptr str str long long str)
+184 stdcall -ordinal IStream_Read(ptr ptr long) SHIStream_Read
+185 stdcall -ordinal SHMessageBoxCheckA(ptr str str long long str)
186 stdcall -noname SHSimulateDrop(ptr ptr long ptr ptr)
187 stdcall -noname SHLoadFromPropertyBag(ptr ptr)
188 stdcall -noname IUnknown_TranslateAcceleratorOCS(ptr ptr long)
189 stdcall -noname IUnknown_OnFocusOCS(ptr ptr)
190 stdcall -noname IUnknown_HandleIRestrict(ptr ptr ptr ptr ptr)
-191 stdcall -noname SHMessageBoxCheckW(ptr wstr wstr long long wstr)
+191 stdcall -ordinal SHMessageBoxCheckW(ptr wstr wstr long long wstr)
192 stdcall -noname SHGetMenuFromID(ptr long)
193 stdcall -noname SHGetCurColorRes()
194 stdcall -noname SHWaitForSendMessageThread(ptr long)
@@ -196,12 +196,12 @@
196 stdcall -noname SHVerbExistsNA(str ptr ptr long)
197 stdcall -noname SHFillRectClr(long ptr long)
198 stdcall -noname SHSearchMapInt(ptr ptr long long)
-199 stdcall -noname IUnknown_Set(ptr ptr)
+199 stdcall -ordinal IUnknown_Set(ptr ptr)
200 stdcall -noname MayQSForward(ptr ptr ptr long ptr ptr)
201 stdcall -noname MayExecForward(ptr long ptr long long ptr ptr)
202 stdcall -noname IsQSForward(ptr long ptr)
-203 stdcall -noname SHStripMneumonicA(str)
-204 stdcall -noname SHIsChildOrSelf(long long)
+203 stdcall -ordinal SHStripMneumonicA(str)
+204 stdcall -ordinal SHIsChildOrSelf(long long)
205 stdcall -noname SHGetValueGoodBootA(long str str ptr ptr ptr)
206 stdcall -noname SHGetValueGoodBootW(long wstr wstr ptr ptr ptr)
207 stub -noname IContextMenu_Invoke
@@ -209,12 +209,12 @@
209 stdcall -noname FDSA_Destroy(ptr)
210 stdcall -noname FDSA_InsertItem(ptr long ptr)
211 stdcall -noname FDSA_DeleteItem(ptr long)
-212 stdcall -noname IStream_Write(ptr ptr long) SHIStream_Write
-213 stdcall -noname IStream_Reset(ptr)
-214 stdcall -noname IStream_Size(ptr ptr)
-215 stdcall -noname SHAnsiToUnicode(str ptr long)
+212 stdcall -ordinal IStream_Write(ptr ptr long) SHIStream_Write
+213 stdcall -ordinal IStream_Reset(ptr)
+214 stdcall -ordinal IStream_Size(ptr ptr)
+215 stdcall -ordinal SHAnsiToUnicode(str ptr long)
216 stdcall -noname SHAnsiToUnicodeCP(long str ptr long)
-217 stdcall -noname SHUnicodeToAnsi(wstr ptr ptr)
+217 stdcall -ordinal SHUnicodeToAnsi(wstr ptr ptr)
218 stdcall -noname SHUnicodeToAnsiCP(long wstr ptr long)
219 stdcall QISearch(long long long long)
220 stdcall -noname SHSetDefaultDialogFont(ptr long)
@@ -222,7 +222,7 @@
222 stdcall -noname SHGlobalCounterCreate(long)
223 stdcall -noname SHGlobalCounterGetValue(long)
224 stdcall -noname SHGlobalCounterIncrement(long)
-225 stdcall -noname SHStripMneumonicW(wstr)
+225 stdcall -ordinal SHStripMneumonicW(wstr)
226 stub -noname ZoneCheckPathA
227 stub -noname ZoneCheckPathW
228 stub -noname ZoneCheckUrlA
@@ -253,7 +253,7 @@
253 stub -noname StopWatchExA
254 stub -noname StopWatchExW
255 stub -noname EventTraceHandler
-256 stdcall -noname IUnknown_GetSite(ptr ptr ptr)
+256 stdcall -ordinal IUnknown_GetSite(ptr ptr ptr)
257 stdcall -noname SHCreateWorkerWindowA(long ptr long long ptr long)
258 stub -noname SHRegisterWaitForSingleObject
259 stub -noname SHUnregisterWait
@@ -273,11 +273,11 @@
273 stub -noname SHTerminateThreadPool
274 stub -noname RegisterGlobalHotkeyW
275 stub -noname RegisterGlobalHotkeyA
-276 stdcall -noname WhichPlatform()
+276 stdcall -ordinal WhichPlatform()
277 stub -noname SHDialogBox
278 stdcall -noname SHCreateWorkerWindowW(long long long long long long)
279 stdcall -noname SHInvokeDefaultCommand(ptr ptr ptr)
-280 stdcall -noname SHRegGetIntW(ptr wstr long)
+280 stdcall -ordinal SHRegGetIntW(ptr wstr long)
281 stdcall -noname SHPackDispParamsV(ptr ptr long ptr)
282 varargs -noname SHPackDispParams(ptr ptr long)
283 stdcall -noname IConnectionPoint_InvokeWithCancel(ptr long long long long)
@@ -342,16 +342,16 @@
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)
-346 stdcall -noname SHUnicodeToUnicode(wstr ptr long)
+345 stdcall -ordinal SHAnsiToAnsi(str ptr long)
+346 stdcall -ordinal SHUnicodeToUnicode(wstr ptr long)
347 stdcall -noname RegDeleteValueWrapW(long wstr) advapi32.RegDeleteValueW
348 stub -noname SHGetFileDescriptionW
349 stub -noname SHGetFileDescriptionA
350 stdcall -noname GetFileVersionInfoSizeWrapW(wstr ptr)
351 stdcall -noname GetFileVersionInfoWrapW(wstr long long ptr)
352 stdcall -noname VerQueryValueWrapW(ptr wstr ptr ptr)
-353 stdcall -noname SHFormatDateTimeA(ptr ptr str long)
-354 stdcall -noname SHFormatDateTimeW(ptr ptr wstr long)
+353 stdcall -ordinal SHFormatDateTimeA(ptr ptr str long)
+354 stdcall -ordinal SHFormatDateTimeW(ptr ptr wstr long)
355 stdcall -noname IUnknown_EnableModeless(ptr long)
356 stdcall -noname CreateAllAccessSecurityAttributes(ptr ptr long)
357 stdcall -noname SHGetNewLinkInfoWrapW(wstr wstr wstr long long)
@@ -374,8 +374,8 @@
374 stub -noname SHCheckDiskForMediaA
375 stub -noname SHCheckDiskForMediaW
376 stdcall -noname MLGetUILanguage() kernel32.GetUserDefaultUILanguage
-377 stdcall -noname MLLoadLibraryA(str long long)
-378 stdcall -noname MLLoadLibraryW(wstr long long)
+377 stdcall -ordinal MLLoadLibraryA(str long long)
+378 stdcall -ordinal MLLoadLibraryW(wstr long long)
379 stub -noname Shell_GetCachedImageIndexWrapW
380 stub -noname Shell_GetCachedImageIndexWrapA
381 stub -noname AssocCopyVerbs
@@ -385,7 +385,7 @@
385 stub -noname SHLoadRawAccelerators
386 stub -noname SHQueryRawAccelerator
387 stub -noname SHQueryRawAcceleratorMsg
-388 varargs -noname ShellMessageBoxWrapW(long long wstr wstr long)
+388 varargs -ordinal ShellMessageBoxWrapW(long long wstr wstr long)
389 stdcall -noname GetSaveFileNameWrapW(ptr)
390 stdcall -noname WNetRestoreConnectionWrapW(long wstr)
391 stdcall -noname WNetGetLastErrorWrapW(ptr ptr long ptr long)
@@ -413,9 +413,9 @@
413 stdcall -noname SHGetMachineInfo(long)
414 stub -noname SHHtmlHelpOnDemandW
415 stub -noname SHHtmlHelpOnDemandA
-416 stub -noname SHWinHelpOnDemandW
-417 stub -noname SHWinHelpOnDemandA
-418 stdcall -noname MLFreeLibrary(long)
+416 stdcall -noname SHWinHelpOnDemandW(long wstr long ptr long)
+417 stdcall -noname SHWinHelpOnDemandA(long str long ptr long)
+418 stdcall -ordinal MLFreeLibrary(long)
419 stdcall -noname SHFlushSFCacheWrap()
420 stub SHLWAPI_420 # CMemStream::Commit
421 stub -noname SHLoadPersistedDataObject
@@ -429,12 +429,12 @@
429 stdcall -noname MLIsMLHInstance(long)
430 stdcall -noname MLSetMLHInstance(long long)
431 stdcall -noname MLClearMLHInstance(long)
-432 stdcall -noname SHSendMessageBroadcastA(long long long)
-433 stdcall -noname SHSendMessageBroadcastW(long long long)
+432 stdcall -ordinal SHSendMessageBroadcastA(long long long)
+433 stdcall -ordinal SHSendMessageBroadcastW(long long long)
434 stdcall -noname SendMessageTimeoutWrapW(long long long long long long ptr)
user32.SendMessageTimeoutW
435 stdcall -noname CLSIDFromProgIDWrap(wstr ptr) ole32.CLSIDFromProgID
436 stdcall -noname CLSIDFromStringWrap(wstr ptr)
-437 stdcall -noname IsOS(long)
+437 stdcall -ordinal IsOS(long)
438 stub -noname SHLoadRegUIStringA
439 stdcall -noname SHLoadRegUIStringW(ptr wstr ptr long)
440 stdcall -noname SHGetWebFolderFilePathA(str ptr long)
@@ -459,12 +459,12 @@
459 stdcall -noname SHExpandEnvironmentStringsA(str ptr long)
kernel32.ExpandEnvironmentStringsA
460 stdcall -noname SHExpandEnvironmentStringsW(wstr ptr long)
kernel32.ExpandEnvironmentStringsW
461 stdcall -noname SHGetAppCompatFlags(long)
-462 stdcall -noname UrlFixupW(wstr wstr long)
+462 stdcall -ordinal UrlFixupW(wstr wstr long)
463 stdcall -noname SHExpandEnvironmentStringsForUserA(ptr str ptr long)
userenv.ExpandEnvironmentStringsForUserA
464 stdcall -noname SHExpandEnvironmentStringsForUserW(ptr wstr ptr long)
userenv.ExpandEnvironmentStringsForUserW
465 stub -noname PathUnExpandEnvStringsForUserA
466 stub -noname PathUnExpandEnvStringsForUserW
-467 stub -noname SHRunIndirectRegClientCommand
+467 stub -ordinal SHRunIndirectRegClientCommand
468 stub -noname RunIndirectRegCommand
469 stub -noname RunRegCommand
470 stub -noname IUnknown_ProfferServiceOld
@@ -484,7 +484,7 @@
484 stdcall -noname IUnknown_QueryServiceExec(ptr ptr ptr long long long ptr)
485 stub -noname MapWin32ErrorToSTG
486 stub -noname ModeToCreateFileFlags
-487 stdcall -noname SHLoadIndirectString(wstr ptr long ptr)
+487 stdcall -ordinal SHLoadIndirectString(wstr ptr long ptr)
488 stub -noname SHConvertGraphicsFile
489 stdcall -noname GlobalAddAtomWrapW(wstr) kernel32.GlobalAddAtomW
490 stdcall -noname GlobalFindAtomWrapW(wstr) kernel32.GlobalFindAtomW
@@ -505,14 +505,14 @@
509 stdcall -noname IUnknown_OnFocusChangeIS(ptr ptr long)
510 stub -noname SHLockSharedEx
511 stub -noname PathFileExistsDefExtAndAttributesW
-512 stub -noname IStream_ReadPidl
-513 stub -noname IStream_WritePidl
+512 stub -ordinal IStream_ReadPidl
+513 stub -ordinal IStream_WritePidl
514 stdcall -noname IUnknown_ProfferService(ptr ptr ptr ptr)
-515 stdcall -noname SHGetViewStatePropertyBag(ptr wstr long ptr ptr)
-516 stdcall -noname SKGetValueW(long wstr wstr long long long)
-517 stub -noname SKSetValueW
-518 stub -noname SKDeleteValueW
-519 stub -noname SKAllocValueW
+515 stdcall -ordinal SHGetViewStatePropertyBag(ptr wstr long ptr ptr)
+516 stdcall -noname SKGetValueW(long wstr wstr ptr ptr ptr)
+517 stdcall -noname SKSetValueW(long wstr wstr long ptr long)
+518 stdcall -noname SKDeleteValueW(long wstr wstr)
+519 stdcall -noname SKAllocValueW(long wstr wstr ptr ptr ptr)
520 stub -noname SHPropertyBag_ReadBSTR
521 stub -noname SHPropertyBag_ReadPOINTL
522 stub -noname SHPropertyBag_WritePOINTL
@@ -547,6 +547,7 @@
551 stub -noname IShellFolder_CompareIDs
@ stdcall AssocCreate(double double ptr ptr)
+@ stdcall AssocGetPerceivedType(wstr ptr ptr ptr)
@ stdcall AssocIsDangerous(long)
@ stdcall AssocQueryKeyA(long long str ptr ptr)
@ stdcall AssocQueryKeyW(long long wstr ptr ptr)
@@ -772,11 +773,11 @@
@ stdcall StrCpyW (ptr wstr)
@ stdcall StrDupA (str)
@ stdcall StrDupW (wstr)
-@ stdcall StrFormatByteSize64A(double ptr long)
+@ stdcall StrFormatByteSize64A(int64 ptr long)
@ stdcall StrFormatByteSizeA(long ptr long)
-@ stdcall StrFormatByteSizeW(double ptr long)
-@ stdcall StrFormatKBSizeA(double str long)
-@ stdcall StrFormatKBSizeW(double wstr long)
+@ stdcall StrFormatByteSizeW(int64 ptr long)
+@ stdcall StrFormatKBSizeA(int64 str long)
+@ stdcall StrFormatKBSizeW(int64 wstr long)
@ stdcall StrFromTimeIntervalA(ptr long long long)
@ stdcall StrFromTimeIntervalW(ptr long long long)
@ stdcall StrIsIntlEqualA(long str str long)
@@ -804,6 +805,8 @@
@ stdcall StrStrNW(wstr wstr long)
@ stdcall StrStrNIW(wstr wstr long)
@ stdcall StrStrW(wstr wstr)
+@ stdcall StrToInt64ExA(str long ptr)
+@ stdcall StrToInt64ExW(wstr long ptr)
@ stdcall StrToIntA(str)
@ stdcall StrToIntExA(str long ptr)
@ stdcall StrToIntExW(wstr long ptr)
Modified: trunk/reactos/dll/win32/shlwapi/shlwapi_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi_…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/shlwapi_main.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/shlwapi_main.c [iso-8859-1] Sat Sep 29 13:14:20 2012
@@ -30,13 +30,13 @@
WINE_DEFAULT_DEBUG_CHANNEL(shell);
-HINSTANCE shlwapi_hInstance = 0;
-DWORD SHLWAPI_ThreadRef_index = TLS_OUT_OF_INDEXES;
+DECLSPEC_HIDDEN HINSTANCE shlwapi_hInstance = 0;
+DECLSPEC_HIDDEN DWORD SHLWAPI_ThreadRef_index = TLS_OUT_OF_INDEXES;
/*************************************************************************
* SHLWAPI {SHLWAPI}
*
- * The Shell Light-Weight Api dll provides a large number of utility functions
+ * The Shell Light-Weight API dll provides a large number of utility functions
* which are commonly required by Win32 programs. Originally distributed with
* Internet Explorer as a free download, it became a core part of Windows when
* Internet Explorer was 'integrated' into the O/S with the release of Win98.
@@ -51,7 +51,7 @@
* SHLWAPI DllMain
*
* NOTES
- * calling oleinitialize here breaks sone apps.
+ * calling oleinitialize here breaks some apps.
*/
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
{
Modified: trunk/reactos/dll/win32/shlwapi/string.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/string.c…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/string.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/string.c [iso-8859-1] Sat Sep 29 13:14:20 2012
@@ -176,7 +176,7 @@
else
str2[1] = '\0';
- return CompareStringA(GetThreadLocale(), dwFlags, str1, -1, str2, -1) - 2;
+ return CompareStringA(GetThreadLocale(), dwFlags, str1, -1, str2, -1) - CSTR_EQUAL;
}
/*************************************************************************
@@ -216,7 +216,7 @@
*/
BOOL WINAPI ChrCmpIW(WCHAR ch1, WCHAR ch2)
{
- return CompareStringW(GetThreadLocale(), NORM_IGNORECASE, &ch1, 1, &ch2, 1) -
2;
+ return CompareStringW(GetThreadLocale(), NORM_IGNORECASE, &ch1, 1, &ch2, 1) -
CSTR_EQUAL;
}
/*************************************************************************
@@ -352,12 +352,8 @@
*/
int WINAPI StrCmpIW(LPCWSTR lpszStr, LPCWSTR lpszComp)
{
- int iRet;
-
TRACE("(%s,%s)\n", debugstr_w(lpszStr),debugstr_w(lpszComp));
-
- iRet = CompareStringW(GetThreadLocale(), NORM_IGNORECASE, lpszStr, -1, lpszComp, -1);
- return iRet == CSTR_LESS_THAN ? -1 : iRet == CSTR_GREATER_THAN ? 1 : 0;
+ return CompareStringW(GetThreadLocale(), NORM_IGNORECASE, lpszStr, -1, lpszComp, -1) -
CSTR_EQUAL;
}
/*************************************************************************
@@ -376,12 +372,8 @@
*/
INT WINAPI StrCmpNA(LPCSTR lpszStr, LPCSTR lpszComp, INT iLen)
{
- INT iRet;
-
TRACE("(%s,%s,%i)\n", debugstr_a(lpszStr), debugstr_a(lpszComp), iLen);
-
- iRet = CompareStringA(GetThreadLocale(), 0, lpszStr, iLen, lpszComp, iLen);
- return iRet == CSTR_LESS_THAN ? -1 : iRet == CSTR_GREATER_THAN ? 1 : 0;
+ return CompareStringA(GetThreadLocale(), 0, lpszStr, iLen, lpszComp, iLen) -
CSTR_EQUAL;
}
/*************************************************************************
@@ -391,12 +383,8 @@
*/
INT WINAPI StrCmpNW(LPCWSTR lpszStr, LPCWSTR lpszComp, INT iLen)
{
- INT iRet;
-
TRACE("(%s,%s,%i)\n", debugstr_w(lpszStr), debugstr_w(lpszComp), iLen);
-
- iRet = CompareStringW(GetThreadLocale(), 0, lpszStr, iLen, lpszComp, iLen);
- return iRet == CSTR_LESS_THAN ? -1 : iRet == CSTR_GREATER_THAN ? 1 : 0;
+ return CompareStringW(GetThreadLocale(), 0, lpszStr, iLen, lpszComp, iLen) -
CSTR_EQUAL;
}
/*************************************************************************
@@ -415,12 +403,8 @@
*/
int WINAPI StrCmpNIA(LPCSTR lpszStr, LPCSTR lpszComp, int iLen)
{
- INT iRet;
-
TRACE("(%s,%s,%i)\n", debugstr_a(lpszStr), debugstr_a(lpszComp), iLen);
-
- iRet = CompareStringA(GetThreadLocale(), NORM_IGNORECASE, lpszStr, iLen, lpszComp,
iLen);
- return iRet == CSTR_LESS_THAN ? -1 : iRet == CSTR_GREATER_THAN ? 1 : 0;
+ return CompareStringA(GetThreadLocale(), NORM_IGNORECASE, lpszStr, iLen, lpszComp,
iLen) - CSTR_EQUAL;
}
/*************************************************************************
@@ -430,12 +414,8 @@
*/
INT WINAPI StrCmpNIW(LPCWSTR lpszStr, LPCWSTR lpszComp, int iLen)
{
- INT iRet;
-
TRACE("(%s,%s,%i)\n", debugstr_w(lpszStr), debugstr_w(lpszComp), iLen);
-
- iRet = CompareStringW(GetThreadLocale(), NORM_IGNORECASE, lpszStr, iLen, lpszComp,
iLen);
- return iRet == CSTR_LESS_THAN ? -1 : iRet == CSTR_GREATER_THAN ? 1 : 0;
+ return CompareStringW(GetThreadLocale(), NORM_IGNORECASE, lpszStr, iLen, lpszComp,
iLen) - CSTR_EQUAL;
}
/*************************************************************************
@@ -453,12 +433,8 @@
*/
int WINAPI StrCmpW(LPCWSTR lpszStr, LPCWSTR lpszComp)
{
- INT iRet;
-
TRACE("(%s,%s)\n", debugstr_w(lpszStr), debugstr_w(lpszComp));
-
- iRet = CompareStringW(GetThreadLocale(), 0, lpszStr, -1, lpszComp, -1);
- return iRet == CSTR_LESS_THAN ? -1 : iRet == CSTR_GREATER_THAN ? 1 : 0;
+ return CompareStringW(GetThreadLocale(), 0, lpszStr, -1, lpszComp, -1) - CSTR_EQUAL;
}
/*************************************************************************
@@ -477,7 +453,8 @@
{
TRACE("(%s,%s)\n", debugstr_w(lpszStr), debugstr_w(lpszSrc));
- strcatW(lpszStr, lpszSrc);
+ if (lpszStr && lpszSrc)
+ strcatW(lpszStr, lpszSrc);
return lpszStr;
}
@@ -497,7 +474,8 @@
{
TRACE("(%p,%s)\n", lpszStr, debugstr_w(lpszSrc));
- strcpyW(lpszStr, lpszSrc);
+ if (lpszStr && lpszSrc)
+ strcpyW(lpszStr, lpszSrc);
return lpszStr;
}
@@ -855,8 +833,25 @@
*/
BOOL WINAPI StrToIntExA(LPCSTR lpszStr, DWORD dwFlags, LPINT lpiRet)
{
+ LONGLONG li;
+ BOOL bRes;
+
+ TRACE("(%s,%08X,%p)\n", debugstr_a(lpszStr), dwFlags, lpiRet);
+
+ bRes = StrToInt64ExA(lpszStr, dwFlags, &li);
+ if (bRes) *lpiRet = li;
+ return bRes;
+}
+
+/*************************************************************************
+ * StrToInt64ExA [SHLWAPI.@]
+ *
+ * See StrToIntExA.
+ */
+BOOL WINAPI StrToInt64ExA(LPCSTR lpszStr, DWORD dwFlags, LONGLONG *lpiRet)
+{
BOOL bNegative = FALSE;
- int iRet = 0;
+ LONGLONG iRet = 0;
TRACE("(%s,%08X,%p)\n", debugstr_a(lpszStr), dwFlags, lpiRet);
@@ -865,10 +860,7 @@
WARN("Invalid parameter would crash under Win32!\n");
return FALSE;
}
- if (dwFlags > STIF_SUPPORT_HEX)
- {
- WARN("Unknown flags (%08lX)!\n", dwFlags & ~STIF_SUPPORT_HEX);
- }
+ if (dwFlags > STIF_SUPPORT_HEX) WARN("Unknown flags %08x\n", dwFlags);
/* Skip leading space, '+', '-' */
while (isspace(*lpszStr))
@@ -925,8 +917,25 @@
*/
BOOL WINAPI StrToIntExW(LPCWSTR lpszStr, DWORD dwFlags, LPINT lpiRet)
{
+ LONGLONG li;
+ BOOL bRes;
+
+ TRACE("(%s,%08X,%p)\n", debugstr_w(lpszStr), dwFlags, lpiRet);
+
+ bRes = StrToInt64ExW(lpszStr, dwFlags, &li);
+ if (bRes) *lpiRet = li;
+ return bRes;
+}
+
+/*************************************************************************
+ * StrToInt64ExW [SHLWAPI.@]
+ *
+ * See StrToIntExA.
+ */
+BOOL WINAPI StrToInt64ExW(LPCWSTR lpszStr, DWORD dwFlags, LONGLONG *lpiRet)
+{
BOOL bNegative = FALSE;
- int iRet = 0;
+ LONGLONG iRet = 0;
TRACE("(%s,%08X,%p)\n", debugstr_w(lpszStr), dwFlags, lpiRet);
@@ -935,10 +944,7 @@
WARN("Invalid parameter would crash under Win32!\n");
return FALSE;
}
- if (dwFlags > STIF_SUPPORT_HEX)
- {
- WARN("Unknown flags (%08lX)!\n", dwFlags & ~STIF_SUPPORT_HEX);
- }
+ if (dwFlags > STIF_SUPPORT_HEX) WARN("Unknown flags %08x\n", dwFlags);
/* Skip leading space, '+', '-' */
while (isspaceW(*lpszStr)) lpszStr++;
@@ -1419,7 +1425,7 @@
* It was duplicated because not every version of Shlwapi.dll exports
* StrRetToBufA. If you change one routine, change them both.
*/
- TRACE("dest=%p len=0x%x strret=%p pidl=%p stub\n",dest,len,src,pidl);
+ TRACE("dest=%p len=0x%x strret=%p pidl=%p\n", dest, len, src, pidl);
if (!src)
{
@@ -1463,7 +1469,7 @@
*/
HRESULT WINAPI StrRetToBufW (LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, UINT
len)
{
- TRACE("dest=%p len=0x%x strret=%p pidl=%p stub\n",dest,len,src,pidl);
+ TRACE("dest=%p len=0x%x strret=%p pidl=%p\n", dest, len, src, pidl);
if (!src)
{
@@ -2344,7 +2350,7 @@
{
WCHAR wszBytesFormat[64];
LoadStringW(shlwapi_hInstance, IDS_BYTES_FORMAT, wszBytesFormat, 64);
- snprintfW(lpszDest, cchMax, wszBytesFormat, (long)llBytes);
+ snprintfW(lpszDest, cchMax, wszBytesFormat, (int)llBytes);
return lpszDest;
}
@@ -2364,7 +2370,7 @@
* counts that lie exactly on a 1024 byte boundary.
*/
if (i > 8)
- dBytes = (double)(llBytes >> 20) + 0.001; /* Scale down by I MB */
+ dBytes = (double)(llBytes >> 20) + 0.001; /* Scale down by 1 MB */
else
dBytes = (double)llBytes + 0.00001;
@@ -2473,17 +2479,12 @@
if ((lpszIter = StrChrA(lpszStr, '&')))
{
lpszTmp = CharNextA(lpszIter);
- if (lpszTmp && *lpszTmp)
+ if (*lpszTmp)
{
if (*lpszTmp != '&')
ch = *lpszTmp;
- while (lpszIter && *lpszIter)
- {
- lpszTmp = CharNextA(lpszIter);
- *lpszIter = *lpszTmp;
- lpszIter = lpszTmp;
- }
+ memmove( lpszIter, lpszTmp, strlen(lpszTmp) + 1 );
}
}
@@ -2507,17 +2508,12 @@
if ((lpszIter = StrChrW(lpszStr, '&')))
{
lpszTmp = lpszIter + 1;
- if (lpszTmp && *lpszTmp)
+ if (*lpszTmp)
{
if (*lpszTmp != '&')
ch = *lpszTmp;
- while (lpszIter && *lpszIter)
- {
- lpszTmp = lpszIter + 1;
- *lpszIter = *lpszTmp;
- lpszIter = lpszTmp;
- }
+ memmove( lpszIter, lpszTmp, (strlenW(lpszTmp) + 1) * sizeof(WCHAR) );
}
}
Modified: trunk/reactos/dll/win32/shlwapi/thread.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/thread.c…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/thread.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/thread.c [iso-8859-1] Sat Sep 29 13:14:20 2012
@@ -122,13 +122,18 @@
typedef struct
{
- const IUnknownVtbl* lpVtbl;
+ IUnknown IUnknown_iface;
LONG *ref;
} threadref;
+static inline threadref *impl_from_IUnknown(IUnknown *iface)
+{
+ return CONTAINING_RECORD(iface, threadref, IUnknown_iface);
+}
+
static HRESULT WINAPI threadref_QueryInterface(IUnknown *iface, REFIID riid, LPVOID
*ppvObj)
{
- threadref * This = (threadref *)iface;
+ threadref * This = impl_from_IUnknown(iface);
TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppvObj);
@@ -149,7 +154,7 @@
static ULONG WINAPI threadref_AddRef(IUnknown *iface)
{
- threadref * This = (threadref *)iface;
+ threadref * This = impl_from_IUnknown(iface);
TRACE("(%p)\n", This);
return InterlockedIncrement(This->ref);
@@ -158,7 +163,7 @@
static ULONG WINAPI threadref_Release(IUnknown *iface)
{
LONG refcount;
- threadref * This = (threadref *)iface;
+ threadref * This = impl_from_IUnknown(iface);
TRACE("(%p)\n", This);
@@ -199,11 +204,11 @@
return E_INVALIDARG;
This = HeapAlloc(GetProcessHeap(), 0, sizeof(threadref));
- This->lpVtbl = &threadref_vt;
+ This->IUnknown_iface.lpVtbl = &threadref_vt;
This->ref = lprefcount;
*lprefcount = 1;
- *lppUnknown = (IUnknown *) This;
+ *lppUnknown = &This->IUnknown_iface;
TRACE("=> returning S_OK with %p\n", This);
return S_OK;
}
@@ -360,7 +365,7 @@
ti.pfnThreadProc = pfnThreadProc;
ti.pfnCallback = pfnCallback;
ti.pData = pData;
- ti.bInitCom = dwFlags & CTF_COINIT ? TRUE : FALSE;
+ ti.bInitCom = (dwFlags & CTF_COINIT) != 0;
ti.hEvent = CreateEventW(NULL,FALSE,FALSE,NULL);
/* Hold references to the current thread and IE process, if desired */
Modified: trunk/reactos/dll/win32/shlwapi/url.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/url.c?re…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/url.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/url.c [iso-8859-1] Sat Sep 29 13:14:20 2012
@@ -41,6 +41,21 @@
HRESULT WINAPI MLBuildResURLW(LPCWSTR,HMODULE,DWORD,LPCWSTR,LPWSTR,DWORD);
WINE_DEFAULT_DEBUG_CHANNEL(shell);
+
+static inline WCHAR *heap_strdupAtoW(const char *str)
+{
+ LPWSTR ret = NULL;
+
+ if(str) {
+ DWORD len;
+
+ len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
+ ret = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
+ MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
+ }
+
+ return ret;
+}
/* The following schemes were identified in the native version of
* SHLWAPI.DLL version 5.50
@@ -234,7 +249,6 @@
{
LPWSTR url, canonical;
HRESULT ret;
- DWORD len;
TRACE("(%s, %p, %p, 0x%08x) *pcchCanonicalized: %d\n", debugstr_a(pszUrl),
pszCanonicalized,
pcchCanonicalized, dwFlags, pcchCanonicalized ? *pcchCanonicalized : -1);
@@ -242,8 +256,7 @@
if(!pszUrl || !pszCanonicalized || !pcchCanonicalized || !*pcchCanonicalized)
return E_INVALIDARG;
- len = strlen(pszUrl)+1;
- url = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
+ url = heap_strdupAtoW(pszUrl);
canonical = HeapAlloc(GetProcessHeap(), 0, *pcchCanonicalized*sizeof(WCHAR));
if(!url || !canonical) {
HeapFree(GetProcessHeap(), 0, url);
@@ -251,13 +264,12 @@
return E_OUTOFMEMORY;
}
- MultiByteToWideChar(0, 0, pszUrl, -1, url, len);
-
ret = UrlCanonicalizeW(url, canonical, pcchCanonicalized, dwFlags);
if(ret == S_OK)
WideCharToMultiByte(0, 0, canonical, -1, pszCanonicalized,
*pcchCanonicalized+1, 0, 0);
+ HeapFree(GetProcessHeap(), 0, url);
HeapFree(GetProcessHeap(), 0, canonical);
return ret;
}
@@ -273,9 +285,10 @@
HRESULT hr = S_OK;
DWORD EscapeFlags;
LPCWSTR wk1, root;
- LPWSTR lpszUrlCpy, wk2, mp, mp2;
+ LPWSTR lpszUrlCpy, url, wk2, mp, mp2;
INT state;
DWORD nByteLen, nLen, nWkLen;
+ BOOL is_file_url;
WCHAR slash = '\0';
static const WCHAR wszFile[] =
{'f','i','l','e',':'};
@@ -295,22 +308,39 @@
return S_OK;
}
+ /* Remove '\t' characters from URL */
nByteLen = (strlenW(pszUrl) + 1) * sizeof(WCHAR); /* length in bytes */
+ url = HeapAlloc(GetProcessHeap(), 0, nByteLen);
+ if(!url)
+ return E_OUTOFMEMORY;
+
+ wk1 = pszUrl;
+ wk2 = url;
+ do {
+ while(*wk1 == '\t')
+ wk1++;
+ *wk2++ = *wk1;
+ } while(*wk1++);
+
/* Allocate memory for simplified URL (before escaping) */
+ nByteLen = (wk2-url)*sizeof(WCHAR);
lpszUrlCpy = HeapAlloc(GetProcessHeap(), 0,
nByteLen+sizeof(wszFilePrefix)+sizeof(WCHAR));
+ if(!lpszUrlCpy) {
+ HeapFree(GetProcessHeap(), 0, url);
+ return E_OUTOFMEMORY;
+ }
+
+ is_file_url = !strncmpW(wszFile, url, sizeof(wszFile)/sizeof(WCHAR));
if ((nByteLen >= sizeof(wszHttp) &&
- !memcmp(wszHttp, pszUrl, sizeof(wszHttp))) ||
- (nByteLen >= sizeof(wszFile) &&
- !memcmp(wszFile, pszUrl, sizeof(wszFile))))
+ !memcmp(wszHttp, url, sizeof(wszHttp))) || is_file_url)
slash = '/';
- if((dwFlags & URL_FILE_USE_PATHURL) && nByteLen >= sizeof(wszFile)
- && !memcmp(wszFile, pszUrl, sizeof(wszFile)))
+ if((dwFlags & (URL_FILE_USE_PATHURL | URL_WININET_COMPATIBILITY)) &&
is_file_url)
slash = '\\';
- if(nByteLen >= sizeof(wszRes) && !memcmp(wszRes, pszUrl, sizeof(wszRes)))
{
+ if(nByteLen >= sizeof(wszRes) && !memcmp(wszRes, url, sizeof(wszRes))) {
dwFlags &= ~URL_FILE_USE_PATHURL;
slash = '\0';
}
@@ -326,14 +356,14 @@
* 6 have location (found /) save root location
*/
- wk1 = pszUrl;
+ wk1 = url;
wk2 = lpszUrlCpy;
state = 0;
- if(pszUrl[1] == ':') { /* Assume path */
+ if(url[1] == ':') { /* Assume path */
memcpy(wk2, wszFilePrefix, sizeof(wszFilePrefix));
wk2 += sizeof(wszFilePrefix)/sizeof(WCHAR);
- if (dwFlags & URL_FILE_USE_PATHURL)
+ if (dwFlags & (URL_FILE_USE_PATHURL | URL_WININET_COMPATIBILITY))
{
slash = '\\';
--wk2;
@@ -341,6 +371,7 @@
else
dwFlags |= URL_ESCAPE_UNSAFE;
state = 5;
+ is_file_url = TRUE;
}
while (*wk1) {
@@ -361,14 +392,47 @@
if (*wk1 != '/') {state = 6; break;}
*wk2++ = *wk1++;
if((dwFlags & URL_FILE_USE_PATHURL) && nByteLen >=
sizeof(wszLocalhost)
- && !strncmpW(wszFile, pszUrl,
sizeof(wszFile)/sizeof(WCHAR))
+ && is_file_url
&& !memcmp(wszLocalhost, wk1, sizeof(wszLocalhost))){
wk1 += sizeof(wszLocalhost)/sizeof(WCHAR);
while(*wk1 == '\\' && (dwFlags &
URL_FILE_USE_PATHURL))
wk1++;
}
- if(*wk1 == '/' && (dwFlags & URL_FILE_USE_PATHURL))
+
+ if(*wk1 == '/' && (dwFlags & URL_FILE_USE_PATHURL)){
wk1++;
+ }else if(is_file_url){
+ const WCHAR *body = wk1;
+
+ while(*body == '/')
+ ++body;
+
+ if(isalnumW(*body) && *(body+1) == ':'){
+ if(!(dwFlags & (URL_WININET_COMPATIBILITY |
URL_FILE_USE_PATHURL))){
+ if(slash)
+ *wk2++ = slash;
+ else
+ *wk2++ = '/';
+ }
+ }else{
+ if(dwFlags & URL_WININET_COMPATIBILITY){
+ if(*wk1 == '/' && *(wk1+1) != '/'){
+ *wk2++ = '\\';
+ }else{
+ *wk2++ = '\\';
+ *wk2++ = '\\';
+ }
+ }else{
+ if(*wk1 == '/' && *(wk1+1) != '/'){
+ if(slash)
+ *wk2++ = slash;
+ else
+ *wk2++ = '/';
+ }
+ }
+ }
+ wk1 = body;
+ }
state = 4;
break;
case 3:
@@ -483,6 +547,7 @@
default:
FIXME("how did we get here - state=%d\n", state);
HeapFree(GetProcessHeap(), 0, lpszUrlCpy);
+ HeapFree(GetProcessHeap(), 0, url);
return E_INVALIDARG;
}
*wk2 = '\0';
@@ -495,7 +560,7 @@
if((dwFlags & URL_UNESCAPE) ||
((dwFlags & URL_FILE_USE_PATHURL) && nByteLen >= sizeof(wszFile)
- && !memcmp(wszFile, pszUrl, sizeof(wszFile))))
+ && !memcmp(wszFile, url, sizeof(wszFile))))
UrlUnescapeW(lpszUrlCpy, NULL, &nLen, URL_UNESCAPE_INPLACE);
if((EscapeFlags = dwFlags & (URL_ESCAPE_UNSAFE |
@@ -518,6 +583,7 @@
}
HeapFree(GetProcessHeap(), 0, lpszUrlCpy);
+ HeapFree(GetProcessHeap(), 0, url);
if (hr == S_OK)
TRACE("result %s\n", debugstr_w(pszCanonicalized));
@@ -596,7 +662,7 @@
{
PARSEDURLW base, relative;
DWORD myflags, sizeloc = 0;
- DWORD len, res1, res2, process_case = 0;
+ DWORD i, len, res1, res2, process_case = 0;
LPWSTR work, preliminary, mbase, mrelative;
static const WCHAR myfilestr[] =
{'f','i','l','e',':','/','/','/','\0'};
HRESULT ret;
@@ -636,6 +702,10 @@
}
else do {
BOOL manual_search = FALSE;
+
+ work = (LPWSTR)base.pszProtocol;
+ for(i=0; i<base.cchProtocol; i++)
+ work[i] = tolowerW(work[i]);
/* mk is a special case */
if(base.nScheme == URL_SCHEME_MK) {
@@ -676,7 +746,9 @@
const WCHAR htmW[] = {'.','h','t','m',0};
const int len_htmW = 4;
- if (work - base.pszSuffix > len_htmW * sizeof(WCHAR)) {
+ if (base.nScheme == URL_SCHEME_HTTP || base.nScheme == URL_SCHEME_HTTPS)
+ manual_search = TRUE;
+ else if (work - base.pszSuffix > len_htmW) {
work -= len_htmW;
if (strncmpiW(work, htmW, len_htmW) == 0)
manual_search = TRUE;
@@ -684,7 +756,7 @@
}
if (!manual_search &&
- work - base.pszSuffix > len_htmlW * sizeof(WCHAR)) {
+ work - base.pszSuffix > len_htmlW) {
work -= len_htmlW;
if (strncmpiW(work, htmlW, len_htmlW) == 0)
manual_search = TRUE;
@@ -696,15 +768,15 @@
/* search backwards starting from the current position */
while (*work != '/' && work > base.pszSuffix + sizeloc)
--work;
- if (work > base.pszSuffix + sizeloc)
- base.cchSuffix = work - base.pszSuffix + 1;
+ base.cchSuffix = work - base.pszSuffix + 1;
}else {
/* search backwards starting from the end of the string */
work = strrchrW((base.pszSuffix+sizeloc), '/');
if (work) {
len = (DWORD)(work - base.pszSuffix + 1);
base.cchSuffix = len;
- }
+ }else
+ base.cchSuffix = sizeloc;
}
/*
@@ -747,9 +819,22 @@
process_case = 4;
break;
}
+ if (*mrelative == '#') {
+ if(!(work = strchrW(base.pszSuffix+base.cchSuffix, '#')))
+ work = (LPWSTR)base.pszSuffix + strlenW(base.pszSuffix);
+
+ memcpy(preliminary, base.pszProtocol,
(work-base.pszProtocol)*sizeof(WCHAR));
+ preliminary[work-base.pszProtocol] = '\0';
+ process_case = 1;
+ break;
+ }
process_case = (*base.pszSuffix == '/' || base.nScheme ==
URL_SCHEME_MK) ? 5 : 3;
break;
- }
+ }else {
+ work = (LPWSTR)relative.pszProtocol;
+ for(i=0; i<relative.cchProtocol; i++)
+ work[i] = tolowerW(work[i]);
+ }
/* handle cases where pszRelative has scheme */
if ((base.cchProtocol == relative.cchProtocol) &&
@@ -995,15 +1080,15 @@
LPCWSTR src;
DWORD needed = 0, ret;
BOOL stop_escaping = FALSE;
- WCHAR next[5], *dst = pszEscaped;
+ WCHAR next[5], *dst, *dst_ptr;
INT len;
PARSEDURLW parsed_url;
DWORD int_flags;
DWORD slashes = 0;
static const WCHAR localhost[] =
{'l','o','c','a','l','h','o','s','t',0};
- TRACE("(%s %p %p 0x%08x)\n", debugstr_w(pszUrl), pszEscaped,
- pcchEscaped, dwFlags);
+ TRACE("(%p(%s) %p %p 0x%08x)\n", pszUrl, debugstr_w(pszUrl),
+ pszEscaped, pcchEscaped, dwFlags);
if(!pszUrl || !pcchEscaped)
return E_INVALIDARG;
@@ -1013,6 +1098,10 @@
URL_DONT_ESCAPE_EXTRA_INFO |
URL_ESCAPE_PERCENT))
FIXME("Unimplemented flags: %08x\n", dwFlags);
+
+ dst_ptr = dst = HeapAlloc(GetProcessHeap(), 0, *pcchEscaped*sizeof(WCHAR));
+ if(!dst_ptr)
+ return E_OUTOFMEMORY;
/* fix up flags */
if (dwFlags & URL_ESCAPE_SPACES_ONLY)
@@ -1130,12 +1219,16 @@
if(needed < *pcchEscaped) {
*dst = '\0';
- ret = S_OK;
+ memcpy(pszEscaped, dst_ptr, (needed+1)*sizeof(WCHAR));
+
+ ret = S_OK;
} else {
needed++; /* add one for the '\0' */
- ret = E_POINTER;
+ ret = E_POINTER;
}
*pcchEscaped = needed;
+
+ HeapFree(GetProcessHeap(), 0, dst_ptr);
return ret;
}
@@ -1611,6 +1704,39 @@
return E_FAIL;
}
+static HRESULT URL_CreateFromPath(LPCWSTR pszPath, LPWSTR pszUrl, LPDWORD pcchUrl)
+{
+ DWORD needed;
+ HRESULT ret = S_OK;
+ WCHAR *pszNewUrl;
+ WCHAR file_colonW[] =
{'f','i','l','e',':',0};
+ WCHAR three_slashesW[] = {'/','/','/',0};
+ PARSEDURLW parsed_url;
+
+ parsed_url.cbSize = sizeof(parsed_url);
+ if(ParseURLW(pszPath, &parsed_url) == S_OK) {
+ if(parsed_url.nScheme != URL_SCHEME_INVALID && parsed_url.cchProtocol
> 1) {
+ needed = strlenW(pszPath);
+ if (needed >= *pcchUrl) {
+ *pcchUrl = needed + 1;
+ return E_POINTER;
+ } else {
+ *pcchUrl = needed;
+ return S_FALSE;
+ }
+ }
+ }
+
+ pszNewUrl = HeapAlloc(GetProcessHeap(), 0, (strlenW(pszPath) + 9) * sizeof(WCHAR));
/* "file:///" + pszPath_len + 1 */
+ strcpyW(pszNewUrl, file_colonW);
+ if(isalphaW(pszPath[0]) && pszPath[1] == ':')
+ strcatW(pszNewUrl, three_slashesW);
+ strcatW(pszNewUrl, pszPath);
+ ret = UrlEscapeW(pszNewUrl, pszUrl, pcchUrl, URL_ESCAPE_PERCENT);
+ HeapFree(GetProcessHeap(), 0, pszNewUrl);
+ return ret;
+}
+
static HRESULT URL_ApplyDefault(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut)
{
HKEY newkey;
@@ -1658,11 +1784,18 @@
if (!pszIn || !pszOut || !pcchOut) return E_INVALIDARG;
if (dwFlags & URL_APPLY_GUESSFILE) {
- 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);
- return S_FALSE;
+ if (*pcchOut > 1 && ':' == pszIn[1]) {
+ res1 = *pcchOut;
+ ret = URL_CreateFromPath(pszIn, pszOut, &res1);
+ if (ret == S_OK || ret == E_POINTER){
+ *pcchOut = res1;
+ return ret;
+ }
+ else if (ret == S_FALSE)
+ {
+ return ret;
+ }
+ }
}
in_scheme.cbSize = sizeof(in_scheme);
@@ -1673,20 +1806,6 @@
if (dwFlags & URL_APPLY_GUESSSCHEME) {
if ((ret = URL_GuessScheme(pszIn, pszOut, pcchOut)) != E_FAIL)
return ret;
- }
- }
- else {
- /* we have a scheme, see if valid (known scheme) */
- if (in_scheme.nScheme) {
- /* have valid scheme, so just copy and exit */
- if (strlenW(pszIn) + 1 > *pcchOut) {
- *pcchOut = strlenW(pszIn) + 1;
- return E_POINTER;
- }
- strcpyW(pszOut, pszIn);
- *pcchOut = strlenW(pszOut);
- TRACE("valid scheme, returning copy\n");
- return S_OK;
}
}
@@ -1901,6 +2020,10 @@
else
cont = FALSE;
}
+
+ if(*start != ':')
+ *size = 0;
+
break;
case USERPASS:
@@ -1956,7 +2079,8 @@
if (isalnumW(*start) ||
(*start == '-') ||
(*start == '.') ||
- (*start == ' ') ) {
+ (*start == ' ') ||
+ (*start == '*') ) {
start++;
(*size)++;
}
@@ -2124,7 +2248,7 @@
switch (dwPart) {
case URL_PART_SCHEME:
- if (!pl.szScheme || scheme == URL_SCHEME_UNKNOWN) {
+ if (!pl.szScheme) {
*pcchOut = 0;
return S_FALSE;
}
@@ -2328,12 +2452,7 @@
*/
HRESULT WINAPI UrlCreateFromPathW(LPCWSTR pszPath, LPWSTR pszUrl, LPDWORD pcchUrl, DWORD
dwReserved)
{
- DWORD needed;
HRESULT ret;
- WCHAR *pszNewUrl;
- WCHAR file_colonW[] =
{'f','i','l','e',':',0};
- WCHAR three_slashesW[] = {'/','/','/',0};
- PARSEDURLW parsed_url;
TRACE("(%s, %p, %p, 0x%08x)\n", debugstr_w(pszPath), pszUrl, pcchUrl,
dwReserved);
@@ -2343,30 +2462,11 @@
if (!pszUrl || !pcchUrl)
return E_INVALIDARG;
-
- parsed_url.cbSize = sizeof(parsed_url);
- if(ParseURLW(pszPath, &parsed_url) == S_OK) {
- if(parsed_url.nScheme != URL_SCHEME_INVALID && parsed_url.cchProtocol
> 1) {
- needed = strlenW(pszPath);
- if (needed >= *pcchUrl) {
- *pcchUrl = needed + 1;
- return E_POINTER;
- } else {
- *pcchUrl = needed;
- strcpyW(pszUrl, pszPath);
- return S_FALSE;
- }
- }
- }
-
- pszNewUrl = HeapAlloc(GetProcessHeap(), 0, (strlenW(pszPath) + 9) * sizeof(WCHAR));
/* "file:///" + pszPath_len + 1 */
- strcpyW(pszNewUrl, file_colonW);
- if(isalphaW(pszPath[0]) && pszPath[1] == ':')
- strcatW(pszNewUrl, three_slashesW);
- strcatW(pszNewUrl, pszPath);
- ret = UrlEscapeW(pszNewUrl, pszUrl, pcchUrl, URL_ESCAPE_PERCENT);
-
- HeapFree(GetProcessHeap(), 0, pszNewUrl);
+ ret = URL_CreateFromPath(pszPath, pszUrl, pcchUrl);
+
+ if (S_FALSE == ret)
+ strcpyW(pszUrl, pszPath);
+
return ret;
}
Modified: trunk/reactos/dll/win32/shlwapi/wsprintf.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/wsprintf…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/wsprintf.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/wsprintf.c [iso-8859-1] Sat Sep 29 13:14:20 2012
@@ -43,6 +43,8 @@
#define WPRINTF_SHORT 0x0010 /* Short arg ('h' prefix) */
#define WPRINTF_UPPER_HEX 0x0020 /* Upper-case hex ('X' specifier) */
#define WPRINTF_WIDE 0x0040 /* Wide arg ('w' prefix) */
+#define WPRINTF_INTPTR 0x0080 /* Pointer-size arg ('I' prefix) */
+#define WPRINTF_I64 0x0100 /* 64-bit arg ('I64' prefix) */
typedef enum
{
@@ -65,11 +67,11 @@
} WPRINTF_FORMAT;
typedef union {
- WCHAR wchar_view;
- CHAR char_view;
- LPCSTR lpcstr_view;
- LPCWSTR lpcwstr_view;
- INT int_view;
+ WCHAR wchar_view;
+ CHAR char_view;
+ LPCSTR lpcstr_view;
+ LPCWSTR lpcwstr_view;
+ LONGLONG int_view;
} WPRINTF_DATA;
static const CHAR null_stringA[] = "(null)";
@@ -111,6 +113,12 @@
if (*p == 'l') { res->flags |= WPRINTF_LONG; p++; }
else if (*p == 'h') { res->flags |= WPRINTF_SHORT; p++; }
else if (*p == 'w') { res->flags |= WPRINTF_WIDE; p++; }
+ else if (*p == 'I')
+ {
+ if (p[1] == '6' && p[2] == '4') { res->flags |=
WPRINTF_I64; p += 3; }
+ else if (p[1] == '3' && p[2] == '2') p += 3;
+ else { res->flags |= WPRINTF_INTPTR; p++; }
+ }
switch(*p)
{
case 'c':
@@ -132,6 +140,10 @@
case 'u':
res->type = WPR_UNSIGNED;
break;
+ case 'p':
+ res->width = 2 * sizeof(void *);
+ res->flags |= WPRINTF_ZEROPAD | WPRINTF_INTPTR;
+ /* fall through */
case 'X':
res->flags |= WPRINTF_UPPER_HEX;
/* fall through */
@@ -183,7 +195,13 @@
if (*p == 'l') { res->flags |= WPRINTF_LONG; p++; }
else if (*p == 'h') { res->flags |= WPRINTF_SHORT; p++; }
else if (*p == 'w') { res->flags |= WPRINTF_WIDE; p++; }
- switch((CHAR)*p)
+ else if (*p == 'I')
+ {
+ if (p[1] == '6' && p[2] == '4') { res->flags |=
WPRINTF_I64; p += 3; }
+ else if (p[1] == '3' && p[2] == '2') p += 3;
+ else { res->flags |= WPRINTF_INTPTR; p++; }
+ }
+ switch(*p)
{
case 'c':
res->type = (res->flags & WPRINTF_SHORT) ? WPR_CHAR : WPR_WCHAR;
@@ -204,6 +222,10 @@
case 'u':
res->type = WPR_UNSIGNED;
break;
+ case 'p':
+ res->width = 2 * sizeof(void *);
+ res->flags |= WPRINTF_ZEROPAD | WPRINTF_INTPTR;
+ /* fall through */
case 'X':
res->flags |= WPRINTF_UPPER_HEX;
/* fall through */
@@ -247,16 +269,32 @@
if (len > maxlen) len = maxlen;
return (format->precision = len);
case WPR_SIGNED:
- len = sprintf( number, "%d", arg->int_view );
- break;
case WPR_UNSIGNED:
- len = sprintf( number, "%u", (UINT)arg->int_view );
- break;
case WPR_HEXA:
- len = sprintf( number,
- (format->flags & WPRINTF_UPPER_HEX) ? "%X" :
"%x",
- (UINT)arg->int_view);
- break;
+ {
+ const char *digits = (format->flags & WPRINTF_UPPER_HEX) ?
"0123456789ABCDEF" : "0123456789abcdef";
+ ULONGLONG num = arg->int_view;
+ int base = format->type == WPR_HEXA ? 16 : 10;
+ char buffer[20], *p = buffer, *dst = number;
+
+ if (format->type == WPR_SIGNED && arg->int_view < 0)
+ {
+ *dst++ = '-';
+ num = -arg->int_view;
+ }
+ if (format->flags & WPRINTF_INTPTR) num = (UINT_PTR)num;
+ else if (!(format->flags & WPRINTF_I64)) num = (UINT)num;
+
+ do
+ {
+ *p++ = digits[num % base];
+ num /= base;
+ } while (num);
+ while (p > buffer) *dst++ = *(--p);
+ *dst = 0;
+ len = dst - number;
+ break;
+ }
default:
return 0;
}
@@ -318,7 +356,9 @@
case WPR_HEXA:
case WPR_SIGNED:
case WPR_UNSIGNED:
- argData.int_view = va_arg( args, INT );
+ if (format.flags & WPRINTF_INTPTR) argData.int_view = va_arg(args,
INT_PTR);
+ else if (format.flags & WPRINTF_I64) argData.int_view = va_arg(args,
LONGLONG);
+ else argData.int_view = va_arg(args, INT);
break;
default:
argData.wchar_view = 0;
@@ -423,7 +463,9 @@
case WPR_HEXA:
case WPR_SIGNED:
case WPR_UNSIGNED:
- argData.int_view = va_arg( args, INT );
+ if (format.flags & WPRINTF_INTPTR) argData.int_view = va_arg(args,
INT_PTR);
+ else if (format.flags & WPRINTF_I64) argData.int_view = va_arg(args,
LONGLONG);
+ else argData.int_view = va_arg(args, INT);
break;
default:
argData.wchar_view = 0;
@@ -446,7 +488,7 @@
case WPR_STRING:
{
LPCSTR ptr = argData.lpcstr_view;
- for (i = 0; i < len; i++) *p++ = (WCHAR)*ptr++;
+ for (i = 0; i < len; i++) *p++ = (BYTE)*ptr++;
}
break;
case WPR_WSTRING:
@@ -472,7 +514,7 @@
/* fall through */
case WPR_UNSIGNED:
for (i = len; i < format.precision; i++, maxlen--) *p++ = '0';
- for (i = sign; i < len; i++) *p++ = (WCHAR)number[i];
+ for (i = sign; i < len; i++) *p++ = (BYTE)number[i];
break;
case WPR_UNKNOWN:
continue;
Modified: trunk/reactos/include/psdk/shlwapi.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/shlwapi.h?rev…
==============================================================================
--- trunk/reactos/include/psdk/shlwapi.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/shlwapi.h [iso-8859-1] Sat Sep 29 13:14:20 2012
@@ -1119,11 +1119,6 @@
HRESULT WINAPI QISearch(void* base, const QITAB *pqit, REFIID riid, void **ppv);
-HANDLE WINAPI SHAllocShared(LPVOID pv, ULONG cb, DWORD pid);
-BOOL WINAPI SHFreeShared(HANDLE hMem, DWORD pid);
-LPVOID WINAPI SHLockShared(HANDLE hMem, DWORD pid);
-BOOL WINAPI SHUnlockShared(LPVOID pv);
-
#include <poppack.h>
#ifdef __cplusplus
Modified: trunk/reactos/include/psdk/shtypes.idl
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/shtypes.idl?r…
==============================================================================
--- trunk/reactos/include/psdk/shtypes.idl [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/shtypes.idl [iso-8859-1] Sat Sep 29 13:14:20 2012
@@ -66,7 +66,7 @@
{
[case(STRRET_WSTR)][string] LPWSTR pOleStr; /* OLESTR that will be freed
*/
[case(STRRET_OFFSET)] UINT uOffset; /* Offset into SHITEMID (ANSI)
*/
- [case(STRRET_CSTR)] CHAR cStr[MAX_PATH]; /* ANSI Buffer */
+ [case(STRRET_CSTR)] char cStr[MAX_PATH]; /* ANSI Buffer */
} DUMMYUNIONNAME;
} STRRET, *LPSTRRET;
cpp_quote("#include <poppack.h>")
@@ -135,3 +135,28 @@
cpp_quote("#else")
cpp_quote("#define REFFOLDERTYPEID const FOLDERTYPEID * __MIDL_CONST")
cpp_quote("#endif")
+
+typedef [v1_enum] enum tagPERCEIVED {
+ PERCEIVED_TYPE_CUSTOM = -3,
+ PERCEIVED_TYPE_UNSPECIFIED = -2,
+ PERCEIVED_TYPE_FOLDER = -1,
+ PERCEIVED_TYPE_UNKNOWN = 0,
+ PERCEIVED_TYPE_TEXT = 1,
+ PERCEIVED_TYPE_IMAGE = 2,
+ PERCEIVED_TYPE_AUDIO = 3,
+ PERCEIVED_TYPE_VIDEO = 4,
+ PERCEIVED_TYPE_COMPRESSED = 5,
+ PERCEIVED_TYPE_DOCUMENT = 6,
+ PERCEIVED_TYPE_SYSTEM = 7,
+ PERCEIVED_TYPE_APPLICATION = 8,
+ PERCEIVED_TYPE_GAMEMEDIA = 9,
+ PERCEIVED_TYPE_CONTACTS = 10
+} PERCEIVED;
+
+cpp_quote("#define PERCEIVEDFLAG_UNDEFINED 0x0000")
+cpp_quote("#define PERCEIVEDFLAG_SOFTCODED 0x0001")
+cpp_quote("#define PERCEIVEDFLAG_HARDCODED 0x0002")
+cpp_quote("#define PERCEIVEDFLAG_NATIVESUPPORT 0x0004")
+cpp_quote("#define PERCEIVEDFLAG_GDIPLUS 0x0010")
+cpp_quote("#define PERCEIVEDFLAG_WMSDK 0x0020")
+cpp_quote("#define PERCEIVEDFLAG_ZIPFOLDER 0x0040")
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Sep 29 13:14:20 2012
@@ -162,7 +162,7 @@
reactos/dll/win32/shdocvw # Autosync
reactos/dll/win32/shell32 # Forked at Wine-20071011
reactos/dll/win32/shfolder # Autosync
-reactos/dll/win32/shlwapi # Autosync
+reactos/dll/win32/shlwapi # Synced to Wine-1.5.13
reactos/dll/win32/slbcsp # Synced to Wine-1.5.4
reactos/dll/win32/snmpapi # Synced to Wine-1.5.4
reactos/dll/win32/softpub # Synced to Wine-1.5.4