[SHLWAPI] Sync with Wine Staging 3.3. CORE-14434
authorAmine Khaldi <amine.khaldi@reactos.org>
Sun, 4 Mar 2018 12:17:11 +0000 (13:17 +0100)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sun, 4 Mar 2018 12:17:11 +0000 (13:17 +0100)
17 files changed:
dll/win32/shlwapi/assoc.c
dll/win32/shlwapi/clist.c
dll/win32/shlwapi/istream.c
dll/win32/shlwapi/msgbox.c
dll/win32/shlwapi/ordinal.c
dll/win32/shlwapi/path.c
dll/win32/shlwapi/precomp.h
dll/win32/shlwapi/reg.c
dll/win32/shlwapi/regstream.c
dll/win32/shlwapi/resource.h
dll/win32/shlwapi/shlwapi_main.c
dll/win32/shlwapi/stopwatch.c
dll/win32/shlwapi/string.c
dll/win32/shlwapi/thread.c
dll/win32/shlwapi/url.c
dll/win32/shlwapi/wsprintf.c
media/doc/README.WINE

index a6d03a1..a5cb4b1 100644 (file)
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
-
-#include "precomp.h"
+#include <stdarg.h>
+#include <assert.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "winnls.h"
+#include "winreg.h"
+#include "objbase.h"
+#include "shlguid.h"
+#include "shlobj.h"
+#include "shlwapi.h"
+#include "wine/unicode.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
 /* Default IQueryAssociations::Init() flags */
 #define SHLWAPI_DEF_ASSOCF (ASSOCF_INIT_BYEXENAME|ASSOCF_INIT_DEFAULTTOSTAR| \
@@ -89,7 +102,6 @@ HRESULT WINAPI AssocCreate(CLSID clsid, REFIID refiid, void **lpInterface)
   return SHCoCreateInstance( NULL, &clsid, NULL, refiid, lpInterface );
 }
 
-#ifdef __REACTOS__
 
 struct AssocPerceivedInfo
 {
@@ -257,8 +269,6 @@ static const struct AssocPerceivedInfo* AssocFindByType(LPCWSTR pszType)
     return NULL;
 }
 
-#endif
-
 
 /*************************************************************************
  * AssocGetPerceivedType  [SHLWAPI.@]
@@ -281,26 +291,10 @@ static const struct AssocPerceivedInfo* AssocFindByType(LPCWSTR pszType)
  *  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.
- *
-#ifndef __REACTOS__
- * BUGS
- *   Unimplemented.
-#endif
  */
 HRESULT WINAPI AssocGetPerceivedType(LPCWSTR lpszExt, PERCEIVED *lpType,
                                      INT *lpFlag, LPWSTR *lppszType)
 {
-#ifndef __REACTOS__
-
-  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;
-
-#else
-
     static const WCHAR PerceivedTypeKey[] = {'P','e','r','c','e','i','v','e','d','T','y','p','e',0};
     static const WCHAR SystemFileAssociationsKey[] = {'S','y','s','t','e','m','F','i','l','e',
         'A','s','s','o','c','i','a','t','i','o','n','s','\\','%','s',0};
@@ -355,8 +349,6 @@ HRESULT WINAPI AssocGetPerceivedType(LPCWSTR lpszExt, PERCEIVED *lpType,
         *lpFlag = 0;
     }
     return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
-
-#endif
 }
 
 /*************************************************************************
index 52c5f61..77917b3 100644 (file)
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+#include <stdarg.h>
+#include <string.h>
 
-#include "precomp.h"
+#define COBJMACROS
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "objbase.h"
+#include "shlobj.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
 /* dwSignature for contained DATABLOCK_HEADER items */
 #define CLIST_ID_CONTAINER (~0U)
@@ -45,13 +56,8 @@ static inline LPDATABLOCK_HEADER NextItem(LPDBLIST lpList)
  *  lpNewItem [I] The new item to add to the list
  *
  * RETURNS
-#ifndef __REACTOS__
  *  Success: S_OK. The item is added to the list.
  *  Failure: An HRESULT error code.
-#else
- *  Success: TRUE. The item is added to the list.
- *  Failure: FALSE.
-#endif
  *
  * NOTES
  *  If the size of the element to be inserted is less than the size of a
@@ -59,32 +65,19 @@ static inline LPDATABLOCK_HEADER NextItem(LPDBLIST lpList)
  *  the call returns S_OK but does not actually add the element.
  *  See SHWriteDataBlockList.
  */
-#ifndef __REACTOS__
-HRESULT
-#else
-BOOL
-#endif
-WINAPI SHAddDataBlock(LPDBLIST* lppList, const DATABLOCK_HEADER *lpNewItem)
+BOOL WINAPI SHAddDataBlock(LPDBLIST* lppList, const DATABLOCK_HEADER *lpNewItem)
 {
   LPDATABLOCK_HEADER lpInsertAt = NULL;
   ULONG ulSize;
 
   TRACE("(%p,%p)\n", lppList, lpNewItem);
 
-  if(!lppList || !lpNewItem )
-#ifndef __REACTOS__
-    return E_INVALIDARG;
-#else
+  if(!lppList || !lpNewItem)
     return FALSE;
-#endif
 
   if (lpNewItem->cbSize < sizeof(DATABLOCK_HEADER) ||
       lpNewItem->dwSignature == CLIST_ID_CONTAINER)
-#ifndef __REACTOS__
-    return S_OK;
-#else
     return FALSE;
-#endif
 
   ulSize = lpNewItem->cbSize;
 
@@ -141,17 +134,9 @@ WINAPI SHAddDataBlock(LPDBLIST* lppList, const DATABLOCK_HEADER *lpNewItem)
     lpInsertAt = NextItem(lpInsertAt);
     lpInsertAt->cbSize = 0;
 
-#ifndef __REACTOS__
-    return lpNewItem->cbSize;
-#else
     return TRUE;
-#endif
   }
-#ifndef __REACTOS__
-  return S_OK;
-#else
   return FALSE;
-#endif
 }
 
 /*************************************************************************
@@ -369,11 +354,7 @@ VOID WINAPI SHFreeDataBlockList(LPDBLIST lpList)
  */
 BOOL WINAPI SHRemoveDataBlock(LPDBLIST* lppList, DWORD dwSignature)
 {
-#ifndef __REACTOS__
-  LPDATABLOCK_HEADER lpList = 0;
-#else
   LPDATABLOCK_HEADER lpList = NULL;
-#endif
   LPDATABLOCK_HEADER lpItem = NULL;
   LPDATABLOCK_HEADER lpNext;
   ULONG ulNewSize;
index d11a5f1..946d2c8 100644 (file)
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
-
-#include "precomp.h"
+#include <stdarg.h>
+#include <string.h>
+
+#define COBJMACROS
+#define NONAMELESSUNION
+
+#include "windef.h"
+#include "winbase.h"
+#include "winerror.h"
+#include "winnls.h"
+#define NO_SHLWAPI_REG
+#define NO_SHLWAPI_PATH
+#include "shlwapi.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
 #define STGM_ACCESS_MODE(stgm)   ((stgm)&0x0000f)
 #define STGM_SHARE_MODE(stgm)    ((stgm)&0x000f0)
index 31f53f9..90bbb59 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "precomp.h"
+#include "config.h"
+#include "wine/port.h"
+
+#include <stdarg.h>
+#include <string.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "winreg.h"
+#include "shlwapi.h"
+#include "wine/unicode.h"
+#include "wine/debug.h"
+#include "resource.h"
+
+
+WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
 extern HINSTANCE shlwapi_hInstance; /* in shlwapi_main.c */
 
index 61e8804..9adf962 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "precomp.h"
+#include "config.h"
+#include "wine/port.h"
 
+#include <stdarg.h>
 #include <stdio.h>
-
-#include <winver.h>
-#include <winnetwk.h>
-#include <mmsystem.h>
-#include <shdeprecated.h>
-#include <shellapi.h>
-#include <commdlg.h>
-#include <mlang.h>
-#include <mshtmhst.h>
+#include <string.h>
+
+#define COBJMACROS
+
+#include "windef.h"
+#include "winbase.h"
+#include "winnls.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 "shdeprecated.h"
+#include "shlobj.h"
+#include "shlwapi.h"
+#include "shellapi.h"
+#include "commdlg.h"
+#include "mlang.h"
+#include "mshtmhst.h"
+#include "wine/unicode.h"
+#include "wine/debug.h"
+
+
+WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
 /* DLL handles for late bound calls */
 extern HINSTANCE shlwapi_hInstance;
@@ -78,6 +98,12 @@ HANDLE WINAPI SHMapHandle(HANDLE hShared, DWORD dwSrcProcId, DWORD dwDstProcId,
   TRACE("(%p,%d,%d,%08x,%08x)\n", hShared, dwDstProcId, dwSrcProcId,
         dwAccess, dwOptions);
 
+  if (!hShared)
+  {
+    TRACE("Returning handle NULL\n");
+    return NULL;
+  }
+
   /* Get dest process handle */
   if (dwDstProcId == dwMyProcId)
     hDst = GetCurrentProcess();
index 9447258..f3149f3 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "precomp.h"
+#include "config.h"
+#include "wine/port.h"
+
+#include <stdarg.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "wine/unicode.h"
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "winreg.h"
+#include "winternl.h"
+#define NO_SHLWAPI_STREAM
+#include "shlwapi.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
 #ifdef __REACTOS__
 int WINAPI IsNetDrive(int drive);
index 90d50f7..eff450a 100644 (file)
@@ -1,3 +1,4 @@
+
 #ifndef _SHLWAPI_PCH_
 #define _SHLWAPI_PCH_
 
@@ -29,6 +30,4 @@
 
 #include "resource.h"
 
-WINE_DEFAULT_DEBUG_CHANNEL(shell);
-
-#endif /* _SHLWAPI_PCH_ */
+#endif /* !_SHLWAPI_PCH_ */
index 74c1ab8..a72f4c2 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "precomp.h"
+#include <stdarg.h>
+#include <string.h>
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "winreg.h"
+#include "wine/debug.h"
+#define NO_SHLWAPI_STREAM
+#include "shlwapi.h"
+#include "wine/unicode.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
 /* Key/Value names for MIME content types */
 static const char lpszContentTypeA[] = "Content Type";
index 4aebab7..63615d3 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "precomp.h"
+#include <stdarg.h>
+#include <string.h>
+
+#define COBJMACROS
+
+#include "winerror.h"
+#include "windef.h"
+#include "winbase.h"
+#include "objbase.h"
+#include "winreg.h"
+#include "shlwapi.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
 typedef struct
 {
index 2cc17a8..a9af2ba 100644 (file)
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
-
 #ifndef WINE_SHLWAPI_RESOURCE_H
 #define WINE_SHLWAPI_RESOURCE_H
 
+#include <windef.h>
+#include <winuser.h>
+
 #define IDS_BYTES_FORMAT 64
 #define IDS_TIME_INTERVAL_HOURS 65
 #define IDS_TIME_INTERVAL_MINUTES 66
index bf4cf72..f466bb4 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "precomp.h"
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#define NO_SHLWAPI_REG
+#define NO_SHLWAPI_STREAM
+#include "shlwapi.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
 DECLSPEC_HIDDEN HINSTANCE shlwapi_hInstance = 0;
 DECLSPEC_HIDDEN DWORD SHLWAPI_ThreadRef_index = TLS_OUT_OF_INDEXES;
index 60dc1a6..fcee075 100644 (file)
  * B) Want to use a substandard API to tune its performance.
  */
 
-#include "precomp.h"
+#include "config.h"
+#include "wine/port.h"
+
+#include <stdarg.h>
+#include <string.h>
+#include <stdlib.h>
+
+#define NONAMELESSUNION
+
+#include "windef.h"
+#include "winbase.h"
+#include "winreg.h"
+#include "winternl.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
 /*************************************************************************
  *      @      [SHLWAPI.241]
index 64a7571..0b34d43 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "precomp.h"
+#include "config.h"
+#include "wine/port.h"
 
 #include <math.h>
-#include <mlang.h>
-#include <ddeml.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+
+#define NONAMELESSUNION
+
+#include "windef.h"
+#include "winbase.h"
+#define NO_SHLWAPI_REG
+#define NO_SHLWAPI_STREAM
+#include "shlwapi.h"
+#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);
 
 extern HINSTANCE shlwapi_hInstance;
 
index 4fd0d46..eb2c35d 100644 (file)
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
-
-#include "precomp.h"
+#include <stdarg.h>
+#include <string.h>
+
+#define COBJMACROS
+
+#include "windef.h"
+#include "winbase.h"
+#include "winnls.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);
 
 extern DWORD SHLWAPI_ThreadRef_index;  /* Initialised in shlwapi_main.c */
 
index ed34aa7..c858ebd 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "precomp.h"
-
-#include <wininet.h>
-#include <intshcut.h>
+#include "config.h"
+#include "wine/port.h"
+#include <stdarg.h>
+#include <string.h>
+#include <stdlib.h>
+#include "windef.h"
+#include "winbase.h"
+#include "winnls.h"
+#include "winerror.h"
+#include "wine/unicode.h"
+#include "wininet.h"
+#include "winreg.h"
+#include "winternl.h"
+#define NO_SHLWAPI_STREAM
+#include "shlwapi.h"
+#include "intshcut.h"
+#include "wine/debug.h"
 
 HMODULE WINAPI MLLoadLibraryW(LPCWSTR,HMODULE,DWORD);
 BOOL    WINAPI MLFreeLibrary(HMODULE);
 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;
@@ -902,7 +917,10 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative,
        work = preliminary + base.cchProtocol+1+base.cchSuffix - 1;
         if (*work++ != '/')
             *(work++) = '/';
-       strcpyW(work, relative.pszSuffix);
+        if (relative.pszSuffix[0] == '.' && relative.pszSuffix[1] == 0)
+            *work = 0;
+        else
+            strcpyW(work, relative.pszSuffix);
        break;
 
     default:
index 34c7a4d..6a36b6a 100644 (file)
  * to change it in user32 too.
  */
 
-#define WIN32_NO_STATUS
-#include <wine/debug.h>
+#include <stdarg.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "windef.h"
+#include "winbase.h"
+#define NO_SHLWAPI_REG
+#include "shlwapi.h"
+
+#include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(string);
 
index d31a67f..3c8bf8d 100644 (file)
@@ -174,7 +174,7 @@ reactos/dll/win32/shdoclc             # Synced to WineStaging-2.9
 reactos/dll/win32/shdocvw             # Synced to Wine-3.0
 reactos/dll/win32/shell32             # Forked at Wine-20071011
 reactos/dll/win32/shfolder            # Synced to WineStaging-2.9
-reactos/dll/win32/shlwapi             # Synced to Wine-3.0
+reactos/dll/win32/shlwapi             # Synced to WineStaging-3.3
 reactos/dll/win32/slbcsp              # Synced to WineStaging-2.9
 reactos/dll/win32/snmpapi             # Synced to WineStaging-2.9
 reactos/dll/win32/softpub             # Synced to WineStaging-2.9