dplayx: Merge the IDirectPlay4_SendEx helper.
[wine] / include / shlobj.h
index a5c9b8a..450aba0 100644 (file)
@@ -13,7 +13,7 @@
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
 #ifndef __WINE_SHLOBJ_H
 #include <commctrl.h>
 #include <prsht.h>
 #include <shlguid.h>
+#include <shtypes.h>
+#include <shobjidl.h>
+
+#ifdef WINE_NO_UNICODE_MACROS
+#undef GetObject
+#endif
 
 #ifdef __cplusplus
 extern "C" {
 #endif /* defined(__cplusplus) */
 
+/* Except for specific structs, this header is byte packed */
 #include <pshpack1.h>
 
-#include <shtypes.h>
-#include <shobjidl.h>
+#ifndef HPSXA_DEFINED
+#define HPSXA_DEFINED
+DECLARE_HANDLE(HPSXA);
+#endif
 
-LPVOID       WINAPI SHAlloc(ULONG);
+UINT         WINAPI SHAddFromPropSheetExtArray(HPSXA,LPFNADDPROPSHEETPAGE,LPARAM);
+LPVOID       WINAPI SHAlloc(ULONG) __WINE_ALLOC_SIZE(1);
 HRESULT      WINAPI SHCoCreateInstance(LPCWSTR,const CLSID*,IUnknown*,REFIID,LPVOID*);
+HPSXA        WINAPI SHCreatePropSheetExtArray(HKEY,LPCWSTR,UINT);
+HPSXA        WINAPI SHCreatePropSheetExtArrayEx(HKEY,LPCWSTR,UINT,IDataObject*);
+HRESULT      WINAPI SHCreateShellItem(LPCITEMIDLIST,IShellFolder*,LPCITEMIDLIST,IShellItem**);
+DWORD        WINAPI SHCLSIDFromStringA(LPCSTR,CLSID*);
+DWORD        WINAPI SHCLSIDFromStringW(LPCWSTR,CLSID*);
+#define             SHCLSIDFromString WINELIB_NAME_AW(SHCLSIDFromString)
 HRESULT      WINAPI SHCreateStdEnumFmtEtc(DWORD,const FORMATETC *,IEnumFORMATETC**);
+void         WINAPI SHDestroyPropSheetExtArray(HPSXA);
 BOOL         WINAPI SHFindFiles(LPCITEMIDLIST,LPCITEMIDLIST);
+DWORD        WINAPI SHFormatDrive(HWND,UINT,UINT,UINT);
 void         WINAPI SHFree(LPVOID);
-BOOL         WINAPI SHGetPathFromIDListA(LPCITEMIDLIST pidl,LPSTR pszPath);
-BOOL         WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl,LPWSTR pszPath);
+BOOL         WINAPI GetFileNameFromBrowse(HWND,LPWSTR,DWORD,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR);
+HRESULT      WINAPI SHGetInstanceExplorer(IUnknown**);
+HRESULT      WINAPI SHGetFolderPathAndSubDirA(HWND,int,HANDLE,DWORD,LPCSTR,LPSTR);
+HRESULT      WINAPI SHGetFolderPathAndSubDirW(HWND,int,HANDLE,DWORD,LPCWSTR,LPWSTR);
+#define             SHGetFolderPathAndSubDir WINELIB_NAME_AW(SHGetFolderPathAndSubDir);
+HRESULT      WINAPI SHGetKnownFolderPath(REFKNOWNFOLDERID,DWORD,HANDLE,PWSTR*);
+BOOL         WINAPI SHGetPathFromIDListA(LPCITEMIDLIST,LPSTR);
+BOOL         WINAPI SHGetPathFromIDListW(LPCITEMIDLIST,LPWSTR);
 #define             SHGetPathFromIDList WINELIB_NAME_AW(SHGetPathFromIDList)
+INT          WINAPI SHHandleUpdateImage(LPCITEMIDLIST);
 HRESULT      WINAPI SHILCreateFromPath(LPCWSTR,LPITEMIDLIST*,DWORD*);
+HRESULT      WINAPI SHLoadOLE(LPARAM);
+HRESULT      WINAPI SHParseDisplayName(LPCWSTR,IBindCtx*,LPITEMIDLIST*,SFGAOF,SFGAOF*);
+HRESULT      WINAPI SHPathPrepareForWriteA(HWND,IUnknown*,LPCSTR,DWORD);
+HRESULT      WINAPI SHPathPrepareForWriteW(HWND,IUnknown*,LPCWSTR,DWORD);
+#define             SHPathPrepareForWrite WINELIB_NAME_AW(SHPathPrepareForWrite);
+UINT         WINAPI SHReplaceFromPropSheetExtArray(HPSXA,UINT,LPFNADDPROPSHEETPAGE,LPARAM);
 LPITEMIDLIST WINAPI SHSimpleIDListFromPath(LPCWSTR);
+BOOL         WINAPI SHRunControlPanel(LPCWSTR, HWND);
 int          WINAPI SHMapPIDLToSystemImageListIndex(IShellFolder*,LPCITEMIDLIST,int*);
-
+HRESULT      WINAPI SHStartNetConnectionDialog(HWND,LPCSTR,DWORD);
+VOID         WINAPI SHUpdateImageA(LPCSTR,INT,UINT,INT);
+VOID         WINAPI SHUpdateImageW(LPCWSTR,INT,UINT,INT);
+#define             SHUpdateImage WINELIB_NAME_AW(SHUpdateImage)
+int          WINAPI RestartDialog(HWND,LPCWSTR,DWORD);
+int          WINAPI RestartDialogEx(HWND,LPCWSTR,DWORD,DWORD);
+int          WINAPI DriveType(int);
+int          WINAPI RealDriveType(int, BOOL);
+int          WINAPI IsNetDrive(int);
+BOOL         WINAPI IsUserAnAdmin(void);
+UINT         WINAPI Shell_MergeMenus(HMENU,HMENU,UINT,UINT,UINT,ULONG);
+BOOL         WINAPI Shell_GetImageLists(HIMAGELIST*,HIMAGELIST*);
+BOOL         WINAPI SignalFileOpen(PCIDLIST_ABSOLUTE);
+BOOL         WINAPI ImportPrivacySettings(LPCWSTR, BOOL*, BOOL*);
+
+#define KF_FLAG_SIMPLE_IDLIST       0x00000100
+#define KF_FLAG_NOT_PARENT_RELATIVE 0x00000200
+#define KF_FLAG_DEFAULT_PATH        0x00000400
+#define KF_FLAG_INIT                0x00000800
+#define KF_FLAG_NO_ALIAS            0x00001000
+#define KF_FLAG_DONT_UNEXPAND       0x00002000
+#define KF_FLAG_DONT_VERIFY         0x00004000
+#define KF_FLAG_CREATE              0x00008000
+
+#define SHFMT_ERROR     __MSABI_LONG(0xFFFFFFFF)  /* Error on last format, drive may be formattable */
+#define SHFMT_CANCEL    __MSABI_LONG(0xFFFFFFFE)  /* Last format was cancelled */
+#define SHFMT_NOFORMAT  __MSABI_LONG(0xFFFFFFFD)  /* Drive is not formattable */
+
+/* SHFormatDrive flags */
+#define SHFMT_ID_DEFAULT       0xFFFF
+#define SHFMT_OPT_FULL         1
+#define SHFMT_OPT_SYSONLY      2
+
+/* SHPathPrepareForWrite flags */
+#define SHPPFW_NONE             0x00000000
+#define SHPPFW_DIRCREATE        0x00000001
+#define SHPPFW_DEFAULT          SHPPFW_DIRCREATE
+#define SHPPFW_ASKDIRCREATE     0x00000002
+#define SHPPFW_IGNOREFILENAME   0x00000004
+#define SHPPFW_NOWRITECHECK     0x00000008
+#define SHPPFW_MEDIACHECKONLY   0x00000010
 
 /* SHObjectProperties flags */
 #define SHOP_PRINTERNAME 0x01
 #define SHOP_FILEPATH    0x02
 #define SHOP_VOLUMEGUID  0x04
 
-BOOL WINAPI SHObjectProperties(HWND,UINT,LPCWSTR,LPCWSTR);
+BOOL WINAPI SHObjectProperties(HWND,DWORD,LPCWSTR,LPCWSTR);
 
+#define PCS_FATAL           0x80000000
+#define PCS_REPLACEDCHAR    0x00000001
+#define PCS_REMOVEDCHAR     0x00000002
+#define PCS_TRUNCATED       0x00000004
+#define PCS_PATHTOOLONG     0x00000008
 
-/*****************************************************************************
- * Predeclare interfaces
- */
-typedef struct IShellIcon IShellIcon, *LPSHELLICON;
+int WINAPI PathCleanupSpec(LPCWSTR,LPWSTR);
 
+/* Shell_MergeMenus flags */
+#define MM_ADDSEPARATOR     0x00000001
+#define MM_SUBMENUSHAVEIDS  0x00000002
+#define MM_DONTREMOVESEPS   0x00000004
 
 /*****************************************************************************
  * IContextMenu interface
@@ -66,49 +144,168 @@ typedef struct IShellIcon IShellIcon, *LPSHELLICON;
 
 
 /* DATAOBJECT_InitShellIDList*/
-#define CFSTR_SHELLIDLIST       "Shell IDList Array"      /* CF_IDLIST */
+#define CFSTR_SHELLIDLISTA           "Shell IDList Array"   /* CF_IDLIST */
+#define CFSTR_SHELLIDLISTOFFSETA     "Shell Object Offsets" /* CF_OBJECTPOSITIONS */
+#define CFSTR_NETRESOURCESA          "Net Resource"         /* CF_NETRESOURCE */
+/* DATAOBJECT_InitFileGroupDesc */
+#define CFSTR_FILEDESCRIPTORA        "FileGroupDescriptor"  /* CF_FILEGROUPDESCRIPTORA */
+/* DATAOBJECT_InitFileContents*/
+#define CFSTR_FILECONTENTSA          "FileContents"         /* CF_FILECONTENTS */
+#define CFSTR_FILENAMEA              "FileName"             /* CF_FILENAMEA */
+#define CFSTR_FILENAMEMAPA           "FileNameMap"          /* CF_FILENAMEMAPA */
+#define CFSTR_PRINTERGROUPA          "PrinterFriendlyName"  /* CF_PRINTERS */
+#define CFSTR_SHELLURLA              "UniformResourceLocator"
+#define CFSTR_INETURLA               CFSTR_SHELLURLA
+#define CFSTR_PREFERREDDROPEFFECTA   "Preferred DropEffect"
+#define CFSTR_PERFORMEDDROPEFFECTA   "Performed DropEffect"
+#define CFSTR_PASTESUCCEEDEDA        "Paste Succeeded"
+#define CFSTR_INDRAGLOOPA            "InShellDragLoop"
+#define CFSTR_DRAGCONTEXTA           "DragContext"
+#define CFSTR_MOUNTEDVOLUMEA         "MountedVolume"
+#define CFSTR_PERSISTEDDATAOBJECTA   "PersistedDataObject"
+#define CFSTR_TARGETCLSIDA           "TargetCLSID"
+#define CFSTR_AUTOPLAY_SHELLIDLISTSA "Autoplay Enumerated IDList Array"
+#define CFSTR_LOGICALPERFORMEDDROPEFFECTA "Logical Performed DropEffect"
+
+#if defined(__GNUC__)
+# define CFSTR_SHELLIDLISTW \
+    (const WCHAR []){ 'S','h','e','l','l',' ','I','D','L','i','s','t',' ','A','r','r','a','y',0 }
+# define CFSTR_SHELLIDLISTOFFSETW \
+    (const WCHAR []){ 'S','h','e','l','l',' ','O','b','j','e','c','t',' ','O','f','f','s','e','t','s',0 }
+# define CFSTR_NETRESOURCESW \
+    (const WCHAR []){ 'N','e','t',' ','R','e','s','o','u','r','c','e',0 }
+# define CFSTR_FILEDESCRIPTORW \
+    (const WCHAR []){ 'F','i','l','e','G','r','o','u','p','D','e','s','c','r','i','p','t','o','r','W',0 }
+# define CFSTR_FILECONTENTSW \
+    (const WCHAR []){ 'F','i','l','e','C','o','n','t','e','n','t','s',0 }
+# define CFSTR_FILENAMEW \
+    (const WCHAR []){ 'F','i','l','e','N','a','m','e','W',0 }
+# define CFSTR_FILENAMEMAPW \
+    (const WCHAR []){ 'F','i','l','e','N','a','m','e','M','a','p','W',0 }
+# define CFSTR_PRINTERGROUPW \
+    (const WCHAR []){ 'P','r','i','n','t','e','r','F','r','i','e','n','d','l','y','N','a','m','e',0 }
+# define CFSTR_SHELLURLW \
+    (const WCHAR []){ 'U','n','i','f','o','r','m','R','e','s','o','u','r','c','e','L','o','c','a','t','o','r',0 }
+# define CFSTR_INETURLW \
+    (const WCHAR []){ 'U','n','i','f','o','r','m','R','e','s','o','u','r','c','e','L','o','c','a','t','o','r','W',0 }
+# define CFSTR_PREFERREDDROPEFFECTW \
+    (const WCHAR []){ 'P','r','e','f','e','r','r','e','d',' ','D','r','o','p','E','f','f','e','c','t',0 }
+# define CFSTR_PERFORMEDDROPEFFECTW \
+    (const WCHAR []){ 'P','e','r','f','o','r','m','e','d',' ','D','r','o','p','E','f','f','e','c','t',0 }
+# define CFSTR_PASTESUCCEEDEDW \
+    (const WCHAR []){ 'P','a','s','t','e',' ','S','u','c','c','e','e','d','e','d',0 }
+# define CFSTR_INDRAGLOOPW \
+    (const WCHAR []){ 'I','n','S','h','e','l','l','D','r','a','g','L','o','o','p',0 }
+# define CFSTR_DRAGCONTEXTW \
+    (const WCHAR []){ 'D','r','a','g','C','o','n','t','e','x','t',0 }
+# define CFSTR_MOUNTEDVOLUMEW \
+    (const WCHAR []){ 'M','o','u','n','t','e','d','V','o','l','u','m','e',0 }
+# define CFSTR_PERSISTEDDATAOBJECTW \
+    (const WCHAR []){ 'P','e','r','s','i','s','t','e','d','D','a','t','a','O','b','j','e','c','t',0 }
+# define CFSTR_TARGETCLSIDW \
+    (const WCHAR []){ 'T','a','r','g','e','t','C','L','S','I','D',0 }
+# define CFSTR_AUTOPLAY_SHELLIDLISTSW \
+    (const WCHAR []){ 'A','u','t','o','p','l','a','y',' ','E','n','u','m','e','r','a','t','e','d',\
+                      ' ','I','D','L','i','s','t',' ','A','r','r','a','y',0 }
+# define CFSTR_LOGICALPERFORMEDDROPEFFECTW \
+    (const WCHAR []){ 'L','o','g','i','c','a','l',' ','P','e','r','f','o','r','m','e','d',\
+                      ' ','D','r','o','p','E','f','f','e','c','t',0 }
+#elif defined(_MSC_VER)
+# define CFSTR_SHELLIDLISTW           L"Shell IDList Array"
+# define CFSTR_SHELLIDLISTOFFSETW     L"Shell Object Offsets"
+# define CFSTR_NETRESOURCESW          L"Net Resource"
+# define CFSTR_FILEDESCRIPTORW        L"FileGroupDescriptorW"
+# define CFSTR_FILECONTENTSW          L"FileContents"
+# define CFSTR_FILENAMEW              L"FileNameW"
+# define CFSTR_FILENAMEMAPW           L"FileNameMapW"
+# define CFSTR_PRINTERGROUPW          L"PrinterFriendlyName"
+# define CFSTR_SHELLURLW              L"UniformResourceLocator"
+# define CFSTR_INETURLW               L"UniformResourceLocatorW"
+# define CFSTR_PREFERREDDROPEFFECTW   L"Preferred DropEffect"
+# define CFSTR_PERFORMEDDROPEFFECTW   L"Performed DropEffect"
+# define CFSTR_PASTESUCCEEDEDW        L"Paste Succeeded"
+# define CFSTR_INDRAGLOOPW            L"InShellDragLoop"
+# define CFSTR_DRAGCONTEXTW           L"DragContext"
+# define CFSTR_MOUNTEDVOLUMEW         L"MountedVolume"
+# define CFSTR_PERSISTEDDATAOBJECTW   L"PersistedDataObject"
+# define CFSTR_TARGETCLSIDW           L"TargetCLSID"
+# define CFSTR_AUTOPLAY_SHELLIDLISTSW L"Autoplay Enumerated IDList Array"
+# define CFSTR_LOGICALPERFORMEDDROPEFFECTW L"Logical Performed DropEffect"
+#else
+static const WCHAR CFSTR_SHELLIDLISTW[] =
+    { 'S','h','e','l','l',' ','I','D','L','i','s','t',' ','A','r','r','a','y',0 };
+static const WCHAR CFSTR_SHELLIDLISTOFFSETW[] =
+    { 'S','h','e','l','l',' ','O','b','j','e','c','t',' ','O','f','f','s','e','t','s',0 };
+static const WCHAR CFSTR_NETRESOURCESW[] =
+    { 'N','e','t',' ','R','e','s','o','u','r','c','e',0 };
+static const WCHAR CFSTR_FILEDESCRIPTORW[] =
+    { 'F','i','l','e','G','r','o','u','p','D','e','s','c','r','i','p','t','o','r','W',0 };
+static const WCHAR CFSTR_FILECONTENTSW[] =
+    { 'F','i','l','e','C','o','n','t','e','n','t','s',0 };
+static const WCHAR CFSTR_FILENAMEW[] =
+    { 'F','i','l','e','N','a','m','e','W',0 };
+static const WCHAR CFSTR_FILENAMEMAPW[] =
+    { 'F','i','l','e','N','a','m','e','M','a','p','W',0 };
+static const WCHAR CFSTR_PRINTERGROUPW[] =
+    { 'P','r','i','n','t','e','r','F','r','i','e','n','d','l','y','N','a','m','e',0 };
+static const WCHAR CFSTR_SHELLURLW[] =
+    { 'U','n','i','f','o','r','m','R','e','s','o','u','r','c','e','L','o','c','a','t','o','r',0 };
+static const WCHAR CFSTR_INETURLW[] =
+    { 'U','n','i','f','o','r','m','R','e','s','o','u','r','c','e','L','o','c','a','t','o','r','W',0 };
+static const WCHAR CFSTR_PREFERREDDROPEFFECTW[] =
+    { 'P','r','e','f','e','r','r','e','d',' ','D','r','o','p','E','f','f','e','c','t',0 };
+static const WCHAR CFSTR_PERFORMEDDROPEFFECTW[] =
+    { 'P','e','r','f','o','r','m','e','d',' ','D','r','o','p','E','f','f','e','c','t',0 };
+static const WCHAR CFSTR_PASTESUCCEEDEDW[] =
+    { 'P','a','s','t','e',' ','S','u','c','c','e','e','d','e','d',0 };
+static const WCHAR CFSTR_INDRAGLOOPW[] =
+    { 'I','n','S','h','e','l','l','D','r','a','g','L','o','o','p',0 };
+static const WCHAR CFSTR_DRAGCONTEXTW[] =
+    { 'D','r','a','g','C','o','n','t','e','x','t',0 };
+static const WCHAR CFSTR_MOUNTEDVOLUMEW[] =
+    { 'M','o','u','n','t','e','d','V','o','l','u','m','e',0 };
+static const WCHAR CFSTR_PERSISTEDDATAOBJECTW[] =
+    { 'P','e','r','s','i','s','t','e','d','D','a','t','a','O','b','j','e','c','t',0 };
+static const WCHAR CFSTR_TARGETCLSIDW[] =
+    { 'T','a','r','g','e','t','C','L','S','I','D',0 };
+static const WCHAR CFSTR_AUTOPLAY_SHELLIDLISTSW[] =
+    { 'A','u','t','o','p','l','a','y',' ','E','n','u','m','e','r','a','t','e','d',
+      ' ','I','D','L','i','s','t',' ','A','r','r','a','y',0 };
+static const WCHAR CFSTR_LOGICALPERFORMEDDROPEFFECTW[] =
+    { 'L','o','g','i','c','a','l',' ','P','e','r','f','o','r','m','e','d',
+      ' ','D','r','o','p','E','f','f','e','c','t',0 };
+#endif
 
-extern UINT cfShellIDList;
+#define CFSTR_SHELLIDLIST           WINELIB_NAME_AW(CFSTR_SHELLIDLIST)
+#define CFSTR_SHELLIDLISTOFFSET     WINELIB_NAME_AW(CFSTR_SHELLIDLISTOFFSET)
+#define CFSTR_NETRESOURCES          WINELIB_NAME_AW(CFSTR_NETRESOURCES)
+#define CFSTR_FILEDESCRIPTOR        WINELIB_NAME_AW(CFSTR_FILEDESCRIPTOR)
+#define CFSTR_FILECONTENTS          WINELIB_NAME_AW(CFSTR_FILECONTENTS)
+#define CFSTR_FILENAME              WINELIB_NAME_AW(CFSTR_FILENAME)
+#define CFSTR_FILENAMEMAP           WINELIB_NAME_AW(CFSTR_FILENAMEMAP)
+#define CFSTR_PRINTERGROUP          WINELIB_NAME_AW(CFSTR_PRINTERGROUP)
+#define CFSTR_SHELLURL              WINELIB_NAME_AW(CFSTR_SHELLURL)
+#define CFSTR_INETURL               WINELIB_NAME_AW(CFSTR_INETURL)
+#define CFSTR_PREFERREDDROPEFFECT   WINELIB_NAME_AW(CFSTR_PREFERREDDROPEFFECT)
+#define CFSTR_PERFORMEDDROPEFFECT   WINELIB_NAME_AW(CFSTR_PERFORMEDDROPEFFECT)
+#define CFSTR_PASTESUCCEEDED        WINELIB_NAME_AW(CFSTR_PASTESUCCEEDED)
+#define CFSTR_INDRAGLOOP            WINELIB_NAME_AW(CFSTR_INDRAGLOOP)
+#define CFSTR_DRAGCONTEXT           WINELIB_NAME_AW(CFSTR_DRAGCONTEXT)
+#define CFSTR_MOUNTEDVOLUME         WINELIB_NAME_AW(CFSTR_MOUNTEDVOLUME)
+#define CFSTR_PERSISTEDDATAOBJECT   WINELIB_NAME_AW(CFSTR_PERSISTEDDATAOBJECT)
+#define CFSTR_TARGETCLSID           WINELIB_NAME_AW(CFSTR_TARGETCLSID)
+#define CFSTR_AUTOPLAY_SHELLIDLISTS WINELIB_NAME_AW(CFSTR_AUTOPLAY_SHELLIDLISTS)
+#define CFSTR_LOGICALPERFORMEDDROPEFFECT WINELIB_NAME_AW(CFSTR_LOGICALPERFORMEDDROPEFFECT)
 
 typedef struct
 {      UINT cidl;
        UINT aoffset[1];
 } CIDA, *LPIDA;
 
-#define CFSTR_SHELLIDLISTOFFSET "Shell Object Offsets"    /* CF_OBJECTPOSITIONS */
-#define CFSTR_NETRESOURCES      "Net Resource"            /* CF_NETRESOURCE */
-
-/* DATAOBJECT_InitFileGroupDesc */
-#define CFSTR_FILEDESCRIPTORA   "FileGroupDescriptor"     /* CF_FILEGROUPDESCRIPTORA */
-extern UINT cfFileGroupDesc;
-
-#define CFSTR_FILEDESCRIPTORW   "FileGroupDescriptorW"    /* CF_FILEGROUPDESCRIPTORW */
-
-/* DATAOBJECT_InitFileContents*/
-#define CFSTR_FILECONTENTS      "FileContents"            /* CF_FILECONTENTS */
-extern UINT cfFileContents;
-
-#define CFSTR_FILENAMEA         "FileName"                /* CF_FILENAMEA */
-#define CFSTR_FILENAMEW         "FileNameW"               /* CF_FILENAMEW */
-#define CFSTR_PRINTERGROUP      "PrinterFriendlyName"     /* CF_PRINTERS */
-#define CFSTR_FILENAMEMAPA      "FileNameMap"             /* CF_FILENAMEMAPA */
-#define CFSTR_FILENAMEMAPW      "FileNameMapW"            /* CF_FILENAMEMAPW */
-#define CFSTR_SHELLURL          "UniformResourceLocator"
-#define CFSTR_PREFERREDDROPEFFECT "Preferred DropEffect"
-#define CFSTR_PERFORMEDDROPEFFECT "Performed DropEffect"
-#define CFSTR_PASTESUCCEEDED    "Paste Succeeded"
-#define CFSTR_INDRAGLOOP        "InShellDragLoop"
-
-#define CFSTR_FILENAME WINELIB_NAME_AW(CFSTR_FILENAME)
-
-
 /************************************************************************
 * IShellView interface
 */
 
-typedef GUID SHELLVIEWID;
-#define SV_CLASS_NAME   ("SHELLDLL_DefView")
-
 #define FCIDM_SHVIEWFIRST       0x0000
 /* undocumented */
 #define FCIDM_SHVIEW_ARRANGE    0x7001
@@ -171,41 +368,361 @@ typedef GUID SHELLVIEWID;
 #define FCIDM_TOOLBAR      (FCIDM_BROWSERFIRST + 0)
 #define FCIDM_STATUS       (FCIDM_BROWSERFIRST + 1)
 
+#define INTERFACE IShellDetails
+DECLARE_INTERFACE_(IShellDetails, IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
+    STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
+    STDMETHOD_(ULONG,Release) (THIS) PURE;
+    /*** IShellDetails methods ***/
+    STDMETHOD(GetDetailsOf)(THIS_ PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *pDetails) PURE;
+    STDMETHOD(ColumnClick)(THIS_ UINT iColumn) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IShellDetails_QueryInterface(p,a,b)    (p)->lpVtbl->QueryInterface(p,a,b)
+#define IShellDetails_AddRef(p)                (p)->lpVtbl->AddRef(p)
+#define IShellDetails_Release(p)               (p)->lpVtbl->Release(p)
+/*** IShellDetails methods ***/
+#define IShellDetails_GetDetailsOf(p,a,b,c)    (p)->lpVtbl->GetDetailsOf(p,a,b,c)
+#define IShellDetails_ColumnClick(p,a)         (p)->lpVtbl->ColumnClick(p,a)
+#endif
+
+/* IQueryInfo interface */
+#define INTERFACE IQueryInfo
+DECLARE_INTERFACE_(IQueryInfo,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IQueryInfo methods ***/
+    STDMETHOD(GetInfoTip)(THIS_ DWORD dwFlags, WCHAR** lppTips) PURE;
+    STDMETHOD(GetInfoFlags)(THIS_ DWORD* lpFlags) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IQueryInfo_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
+#define IQueryInfo_AddRef(p)                  (p)->lpVtbl->AddRef(p)
+#define IQueryInfo_Release(p)                 (p)->lpVtbl->Release(p)
+/*** IQueryInfo methods ***/
+#define IQueryInfo_GetInfoTip(p,a,b)          (p)->lpVtbl->GetInfoTip(p,a,b)
+#define IQueryInfo_GetInfoFlags(p,a)          (p)->lpVtbl->GetInfoFlags(p,a)
+#endif
+
+/* IInputObject interface */
+#define INTERFACE IInputObject
+DECLARE_INTERFACE_(IInputObject,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IInputObject methods ***/
+    STDMETHOD(UIActivateIO)(THIS_ BOOL bActivating, LPMSG lpMsg) PURE;
+    STDMETHOD(HasFocusIO)(THIS) PURE;
+    STDMETHOD(TranslateAcceleratorIO)(THIS_ LPMSG lpMsg) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IInputObject_QueryInterface(p,a,b)       (p)->lpVtbl->QueryInterface(p,a,b)
+#define IInputObject_AddRef(p)                   (p)->lpVtbl->AddRef(p)
+#define IInputObject_Release(p)                  (p)->lpVtbl->Release(p)
+/*** IInputObject methods ***/
+#define IInputObject_UIActivateIO(p,a,b)         (p)->lpVtbl->UIActivateIO(p,a,b)
+#define IInputObject_HasFocusIO(p)               (p)->lpVtbl->HasFocusIO(p)
+#define IInputObject_TranslateAcceleratorIO(p,a) (p)->lpVtbl->TranslateAcceleratorIO(p,a)
+#endif
+
+/* IInputObjectSite interface */
+#define INTERFACE IInputObjectSite
+DECLARE_INTERFACE_(IInputObjectSite,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface) (THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+    STDMETHOD_(ULONG,Release) (THIS) PURE;
+    /*** IInputObjectSite methods ***/
+    STDMETHOD(OnFocusChangeIS)(THIS_ LPUNKNOWN lpUnknown, BOOL bFocus) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IInputObjectSite_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
+#define IInputObjectSite_AddRef(p)              (p)->lpVtbl->AddRef(p)
+#define IInputObjectSite_Release(p)             (p)->lpVtbl->Release(p)
+/*** IInputObject methods ***/
+#define IInputObjectSite_OnFocusChangeIS(p,a,b) (p)->lpVtbl->OnFocusChangeIS(p,a,b)
+#endif
+
+/* IObjMgr interface */
+#define INTERFACE IObjMgr
+DECLARE_INTERFACE_(IObjMgr,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface) (THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+    STDMETHOD_(ULONG,Release) (THIS) PURE;
+    /*** IObjMgr methods ***/
+    STDMETHOD(Append)(THIS_ LPUNKNOWN punk) PURE;
+    STDMETHOD(Remove)(THIS_ LPUNKNOWN punk) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IObjMgr_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
+#define IObjMgr_AddRef(p)              (p)->lpVtbl->AddRef(p)
+#define IObjMgr_Release(p)             (p)->lpVtbl->Release(p)
+/*** IObjMgr methods ***/
+#define IObjMgr_Append(p,a) (p)->lpVtbl->Append(p,a)
+#define IObjMgr_Remove(p,a) (p)->lpVtbl->Remove(p,a)
+#endif
+
+/* IACList interface */
+#define INTERFACE IACList
+DECLARE_INTERFACE_(IACList,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface) (THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+    STDMETHOD_(ULONG,Release) (THIS) PURE;
+    /*** IACList methods ***/
+    STDMETHOD(Expand)(THIS_ LPCOLESTR str) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IACList_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
+#define IACList_AddRef(p)              (p)->lpVtbl->AddRef(p)
+#define IACList_Release(p)             (p)->lpVtbl->Release(p)
+/*** IACList methods ***/
+#define IACList_Expand(p,a)             (p)->lpVtbl->Expand(p,a)
+#endif
+
+/* IACList2 interface */
+#define INTERFACE IACList2
+DECLARE_INTERFACE_(IACList2,IACList)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface) (THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+    STDMETHOD_(ULONG,Release) (THIS) PURE;
+    /*** IACList methods ***/
+    STDMETHOD(Expand)(THIS_ LPCOLESTR str) PURE;
+    /*** IACList2 methods ***/
+    STDMETHOD(SetOptions)(THIS_ DWORD dwFlag) PURE;
+    STDMETHOD(GetOptions)(THIS_ DWORD* pdwFlag) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IACList2_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
+#define IACList2_AddRef(p)              (p)->lpVtbl->AddRef(p)
+#define IACList2_Release(p)             (p)->lpVtbl->Release(p)
+/*** IACList2 methods ***/
+#define IACList2_GetOptions(p,a)        (p)->lpVtbl->GetOptions(p,a)
+#define IACList2_SetOptions(p,a)        (p)->lpVtbl->SetOptions(p,a)
+#endif
 
 /****************************************************************************
- * IShellIcon interface
+ * IShellFolderViewCB interface
  */
 
-#define INTERFACE IShellIcon
-#define IShellIcon_METHODS \
-    IUnknown_METHODS \
-    STDMETHOD(GetIconOf)(THIS_ LPCITEMIDLIST pidl, UINT flags, LPINT lpIconIndex) PURE;
-ICOM_DEFINE(IShellIcon, IUnknown)
+#define INTERFACE IShellFolderViewCB
+DECLARE_INTERFACE_(IShellFolderViewCB,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IShellFolderViewCB methods ***/
+    STDMETHOD(MessageSFVCB)(THIS_ UINT uMsg, WPARAM wParam, LPARAM lParam) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IShellFolderViewCB_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
+#define IShellFolderViewCB_AddRef(p)                  (p)->lpVtbl->AddRef(p)
+#define IShellFolderViewCB_Release(p)                 (p)->lpVtbl->Release(p)
+/*** IShellFolderViewCB methods ***/
+#define IShellFolderViewCB_MessageSFVCB(p,a,b,c)      (p)->lpVtbl->MessageSFVCB(p,a,b,c)
+#endif
+
+/****************************************************************************
+ * IShellFolderView interface
+ */
+
+#include <pshpack8.h>
+
+typedef struct _ITEMSPACING
+{
+    int cxSmall;
+    int cySmall;
+    int cxLarge;
+    int cyLarge;
+} ITEMSPACING;
+
+#include <poppack.h>
+
+#define INTERFACE IShellFolderView
+DEFINE_GUID(IID_IShellFolderView,0x37a378c0,0xf82d,0x11ce,0xae,0x65,0x08,0x00,0x2b,0x2e,0x12,0x62);
+DECLARE_INTERFACE_(IShellFolderView, IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
+    STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
+    STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+    /*** IShellFolderView methods ***/
+    STDMETHOD(Rearrange) (THIS_ LPARAM lParamSort) PURE;
+    STDMETHOD(GetArrangeParam) (THIS_ LPARAM *plParamSort) PURE;
+    STDMETHOD(ArrangeGrid) (THIS) PURE;
+    STDMETHOD(AutoArrange) (THIS) PURE;
+    STDMETHOD(GetAutoArrange) (THIS) PURE;
+    STDMETHOD(AddObject) (THIS_ PITEMID_CHILD pidl, UINT *puItem) PURE;
+    STDMETHOD(GetObject) (THIS_ PITEMID_CHILD *ppidl, UINT uItem) PURE;
+    STDMETHOD(RemoveObject) (THIS_ PITEMID_CHILD pidl, UINT *puItem) PURE;
+    STDMETHOD(GetObjectCount) (THIS_ UINT *puCount) PURE;
+    STDMETHOD(SetObjectCount) (THIS_ UINT uCount, UINT dwFlags) PURE;
+    STDMETHOD(UpdateObject) (THIS_ PITEMID_CHILD pidlOld, PITEMID_CHILD pidlNew, UINT *puItem) PURE;
+    STDMETHOD(RefreshObject) (THIS_ PITEMID_CHILD pidl, UINT *puItem) PURE;
+    STDMETHOD(SetRedraw) (THIS_ BOOL bRedraw) PURE;
+    STDMETHOD(GetSelectedCount) (THIS_ UINT *puSelected) PURE;
+    STDMETHOD(GetSelectedObjects) (THIS_ PCITEMID_CHILD **pppidl, UINT *puItems) PURE;
+    STDMETHOD(IsDropOnSource) (THIS_ IDropTarget *pDropTarget) PURE;
+    STDMETHOD(GetDragPoint) (THIS_ POINT *ppt) PURE;
+    STDMETHOD(GetDropPoint) (THIS_ POINT *ppt) PURE;
+    STDMETHOD(MoveIcons) (THIS_ IDataObject *pDataObject) PURE;
+    STDMETHOD(SetItemPos) (THIS_ PCUITEMID_CHILD pidl, POINT *ppt) PURE;
+    STDMETHOD(IsBkDropTarget) (THIS_ IDropTarget *pDropTarget) PURE;
+    STDMETHOD(SetClipboard) (THIS_ BOOL bMove) PURE;
+    STDMETHOD(SetPoints) (THIS_ IDataObject *pDataObject) PURE;
+    STDMETHOD(GetItemSpacing) (THIS_ ITEMSPACING *pSpacing) PURE;
+    STDMETHOD(SetCallback) (THIS_ IShellFolderViewCB* pNewCB, IShellFolderViewCB** ppOldCB) PURE;
+    STDMETHOD(Select) ( THIS_  UINT dwFlags ) PURE;
+    STDMETHOD(QuerySupport) (THIS_ UINT * pdwSupport ) PURE;
+    STDMETHOD(SetAutomationObject)(THIS_ IDispatch* pdisp) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IShellFolderView_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
+#define IShellFolderView_AddRef(p)                  (p)->lpVtbl->AddRef(p)
+#define IShellFolderView_Release(p)                 (p)->lpVtbl->Release(p)
+/*** IShellFolderView methods ***/
+#define IShellFolderView_Rearrange(p,a)             (p)->lpVtbl->Rearrange(p,a)
+#define IShellFolderView_GetArrangeParam(p,a)       (p)->lpVtbl->GetArrangeParam(p,a)
+#define IShellFolderView_ArrangeGrid(p)             (p)->lpVtbl->ArrangeGrid(p)
+#define IShellFolderView_AutoArrange(p)             (p)->lpVtbl->AutoArrange(p)
+#define IShellFolderView_GetAutoArrange(p)          (p)->lpVtbl->GetAutoArrange(p)
+#define IShellFolderView_AddObject(p,a,b)           (p)->lpVtbl->AddObject(p,a,b)
+#define IShellFolderView_GetObject(p,a,b)           (p)->lpVtbl->GetObject(p,a,b)
+#define IShellFolderView_RemoveObject(p,a,b)        (p)->lpVtbl->RemoveObject(p,a,b)
+#define IShellFolderView_GetObjectCount(p,a)        (p)->lpVtbl->GetObjectCount(p,a)
+#define IShellFolderView_SetObjectCount(p,a,b)      (p)->lpVtbl->SetObjectCount(p,a,b)
+#define IShellFolderView_UpdateObject(p,a,b,c)      (p)->lpVtbl->UpdateObject(p,a,b,c)
+#define IShellFolderView_RefreshObject(p,a,b)       (p)->lpVtbl->RefreshObject(p,a,b)
+#define IShellFolderView_SetRedraw(p,a)             (p)->lpVtbl->SetRedraw(p,a)
+#define IShellFolderView_GetSelectedCount(p,a)      (p)->lpVtbl->GetSelectedCount(p,a)
+#define IShellFolderView_GetSelectedObjects(p,a,b)  (p)->lpVtbl->GetSelectedObjects(p,a,b)
+#define IShellFolderView_IsDropOnSource(p,a)        (p)->lpVtbl->IsDropOnSource(p,a)
+#define IShellFolderView_GetDragPoint(p,a)          (p)->lpVtbl->GetDragPoint(p,a)
+#define IShellFolderView_GetDropPoint(p,a)          (p)->lpVtbl->GetDropPoint(p,a)
+#define IShellFolderView_MoveIcons(p,a)             (p)->lpVtbl->MoveIcons(p,a)
+#define IShellFolderView_SetItemPos(p,a,b)          (p)->lpVtbl->SetItemPos(p,a,b)
+#define IShellFolderView_DropTarget(p,a)            (p)->lpVtbl->DropTarget(p,a)
+#define IShellFolderView_SetClipboard(p,a)          (p)->lpVtbl->SetClipboard(p,a)
+#define IShellFolderView_SetPoints(p,a)             (p)->lpVtbl->SetPoints(p,a)
+#define IShellFolderView_GetItemSpacing(p,a)        (p)->lpVtbl->GetItemSpacing(p,a)
+#define IShellFolderView_SetCallback(p,a)           (p)->lpVtbl->SetCallback(p,a)
+#define IShellFolderView_Select(p,a)                (p)->lpVtbl->Select(p,a)
+#define IShellFolderView_QuerySupport(p,a)          (p)->lpVtbl->QuerySupport(p,a)
+#define IShellFolderView_SetAutomationObject(p,a)   (p)->lpVtbl->SetAutomationObject(p,a)
+#endif
+
+/* IProgressDialog interface */
+#define PROGDLG_NORMAL           0x00000000
+#define PROGDLG_MODAL            0x00000001
+#define PROGDLG_AUTOTIME         0x00000002
+#define PROGDLG_NOTIME           0x00000004
+#define PROGDLG_NOMINIMIZE       0x00000008
+#define PROGDLG_NOPROGRESSBAR    0x00000010
+#define PROGDLG_MARQUEEPROGRESS  0x00000020
+#define PROGDLG_NOCANCEL         0x00000040
+
+#define PDTIMER_RESET            0x00000001
+#define PDTIMER_PAUSE            0x00000002
+#define PDTIMER_RESUME           0x00000003
+
+#define INTERFACE IProgressDialog
+DECLARE_INTERFACE_(IProgressDialog,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface) (THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+    STDMETHOD_(ULONG,Release) (THIS) PURE;
+    /*** IProgressDialog methods ***/
+    STDMETHOD(StartProgressDialog)(THIS_ HWND hwndParent, IUnknown *punkEnableModeless, DWORD dwFlags, LPCVOID reserved) PURE;
+    STDMETHOD(StopProgressDialog)(THIS) PURE;
+    STDMETHOD(SetTitle)(THIS_ LPCWSTR pwzTitle) PURE;
+    STDMETHOD(SetAnimation)(THIS_ HINSTANCE hInstance, UINT uiResourceId) PURE;
+    STDMETHOD_(BOOL,HasUserCancelled)(THIS) PURE;
+    STDMETHOD(SetProgress)(THIS_ DWORD dwCompleted, DWORD dwTotal) PURE;
+    STDMETHOD(SetProgress64)(THIS_ ULONGLONG ullCompleted, ULONGLONG ullTotal) PURE;
+    STDMETHOD(SetLine)(THIS_ DWORD dwLineNum, LPCWSTR pwzString, BOOL bPath, LPCVOID reserved) PURE;
+    STDMETHOD(SetCancelMsg)(THIS_ LPCWSTR pwzCancelMsg, LPCVOID reserved) PURE;
+    STDMETHOD(Timer)(THIS_ DWORD dwTimerAction, LPCVOID reserved) PURE;
+};
 #undef INTERFACE
 
-#ifdef COBJMACROS
+#if !defined(__cplusplus) || defined(CINTERFACE)
 /*** IUnknown methods ***/
-#define IShellIcon_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
-#define IShellIcon_AddRef(p)                  (p)->lpVtbl->AddRef(p)
-#define IShellIcon_Release(p)                 (p)->lpVtbl->Release(p)
-/*** IShellIcon methods ***/
-#define IShellIcon_GetIconOf(p,a,b,c)         (p)->lpVtbl->GetIconOf(p,a,b,c)
+#define IProgressDialog_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
+#define IProgressDialog_AddRef(p)              (p)->lpVtbl->AddRef(p)
+#define IProgressDialog_Release(p)             (p)->lpVtbl->Release(p)
+/*** IProgressDialog methods ***/
+#define IProgressDialog_StartProgressDialog(p,a,b,c,d)    (p)->lpVtbl->StartProgressDialog(p,a,b,c,d)
+#define IProgressDialog_StopProgressDialog(p)             (p)->lpVtbl->StopProgressDialog(p)
+#define IProgressDialog_SetTitle(p,a)                     (p)->lpVtbl->SetTitle(p,a)
+#define IProgressDialog_SetAnimation(p,a,b)               (p)->lpVtbl->SetAnimation(p,a,b)
+#define IProgressDialog_HasUserCancelled(p)               (p)->lpVtbl->HasUserCancelled(p)
+#define IProgressDialog_SetProgress(p,a,b)                (p)->lpVtbl->SetProgress(p,a,b)
+#define IProgressDialog_SetProgress64(p,a,b)              (p)->lpVtbl->SetProgress64(p,a,b)
+#define IProgressDialog_SetLine(p,a,b,c,d)                (p)->lpVtbl->SetLine(p,a,b,c,d)
+#define IProgressDialog_SetCancelMsg(p,a,b)               (p)->lpVtbl->SetCancelMsg(p,a,b)
+#define IProgressDialog_Timer(p,a,b)                      (p)->lpVtbl->Timer(p,a,b)
 #endif
 
+
 /****************************************************************************
 * SHAddToRecentDocs API
 */
-#define SHARD_PIDL      0x00000001L
-#define SHARD_PATHA     0x00000002L
-#define SHARD_PATHW     0x00000003L
+#define SHARD_PIDL      __MSABI_LONG(0x00000001)
+#define SHARD_PATHA     __MSABI_LONG(0x00000002)
+#define SHARD_PATHW     __MSABI_LONG(0x00000003)
 #define SHARD_PATH WINELIB_NAME_AW(SHARD_PATH)
 
-void WINAPI SHAddToRecentDocs(UINT uFlags, LPCVOID pv);
+void WINAPI SHAddToRecentDocs(UINT,LPCVOID);
 
 /****************************************************************************
  * SHBrowseForFolder API
  */
-typedef INT (CALLBACK *BFFCALLBACK)(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
+typedef INT (CALLBACK *BFFCALLBACK)(HWND,UINT,LPARAM,LPARAM);
+
+#include <pshpack8.h>
 
 typedef struct tagBROWSEINFOA {
     HWND        hwndOwner;
@@ -233,6 +750,8 @@ typedef struct tagBROWSEINFOW {
 #define PBROWSEINFO  WINELIB_NAME_AW(PBROWSEINFO)
 #define LPBROWSEINFO WINELIB_NAME_AW(LPBROWSEINFO)
 
+#include <poppack.h>
+
 /* Browsing for directory. */
 #define BIF_RETURNONLYFSDIRS   0x0001
 #define BIF_DONTGOBELOWDOMAIN  0x0002
@@ -240,7 +759,12 @@ typedef struct tagBROWSEINFOW {
 #define BIF_RETURNFSANCESTORS  0x0008
 #define BIF_EDITBOX            0x0010
 #define BIF_VALIDATE           0x0020
-#define BIF_NEWDIALOGSTYLE     0x0040   
+#define BIF_NEWDIALOGSTYLE     0x0040
+#define BIF_USENEWUI           (BIF_NEWDIALOGSTYLE | BIF_EDITBOX)
+#define BIF_BROWSEINCLUDEURLS  0x0080
+#define BIF_UAHINT             0x0100
+#define BIF_NONEWFOLDERBUTTON  0x0200
+#define BIF_NOTRANSLATETARGETS 0x0400
 
 #define BIF_BROWSEFORCOMPUTER  0x1000
 #define BIF_BROWSEFORPRINTER   0x2000
@@ -249,8 +773,9 @@ typedef struct tagBROWSEINFOW {
 /* message from browser */
 #define BFFM_INITIALIZED        1
 #define BFFM_SELCHANGED         2
-#define BFFM_VALIDATEFAILEDA    3   /* lParam:szPath ret:1(cont),0(EndDialog) */
-#define BFFM_VALIDATEFAILEDW    4   /* lParam:wzPath ret:1(cont),0(EndDialog) */
+#define BFFM_VALIDATEFAILEDA    3
+#define BFFM_VALIDATEFAILEDW    4
+#define BFFM_IUNKNOWN           5
 
 /* messages to browser */
 #define BFFM_SETSTATUSTEXTA     (WM_USER+100)
@@ -268,6 +793,183 @@ LPITEMIDLIST WINAPI SHBrowseForFolderW(LPBROWSEINFOW lpbi);
 #define BFFM_SETSELECTION   WINELIB_NAME_AW(BFFM_SETSELECTION)
 #define BFFM_VALIDATEFAILED WINELIB_NAME_AW(BFFM_VALIDATEFAILED)
 
+/**********************************************************************
+ * SHCreateShellFolderViewEx API
+ */
+
+typedef HRESULT (CALLBACK *LPFNVIEWCALLBACK)(
+       IShellView* dwUser,
+       IShellFolder* pshf,
+       HWND hWnd,
+       UINT uMsg,
+       WPARAM wParam,
+       LPARAM lParam);
+
+#include <pshpack8.h>
+
+typedef struct _CSFV
+{
+  UINT             cbSize;
+  IShellFolder*    pshf;
+  IShellView*      psvOuter;
+  LPCITEMIDLIST    pidl;
+  LONG             lEvents;
+  LPFNVIEWCALLBACK pfnCallback;
+  FOLDERVIEWMODE   fvm;
+} CSFV, *LPCSFV;
+
+#include <poppack.h>
+
+HRESULT WINAPI SHCreateShellFolderViewEx(LPCSFV pshfvi, IShellView **ppshv);
+
+/* SHCreateShellFolderViewEx callback messages */
+#define SFVM_MERGEMENU                 1
+#define SFVM_INVOKECOMMAND             2
+#define SFVM_GETHELPTEXT               3
+#define SFVM_GETTOOLTIPTEXT            4
+#define SFVM_GETBUTTONINFO             5
+#define SFVM_GETBUTTONS                6
+#define SFVM_INITMENUPOPUP             7
+#define SFVM_SELECTIONCHANGED          8 /* undocumented */
+#define SFVM_DRAWMENUITEM              9 /* undocumented */
+#define SFVM_MEASUREMENUITEM          10 /* undocumented */
+#define SFVM_EXITMENULOOP             11 /* undocumented */
+#define SFVM_VIEWRELEASE              12 /* undocumented */
+#define SFVM_GETNAMELENGTH            13 /* undocumented */
+#define SFVM_FSNOTIFY                 14
+#define SFVM_WINDOWCREATED            15
+#define SFVM_WINDOWCLOSING            16 /* undocumented */
+#define SFVM_LISTREFRESHED            17 /* undocumented */
+#define SFVM_WINDOWFOCUSED            18 /* undocumented */
+#define SFVM_REGISTERCOPYHOOK         20 /* undocumented */
+#define SFVM_COPYHOOKCALLBACK         21 /* undocumented */
+#define SFVM_GETDETAILSOF             23
+#define SFVM_COLUMNCLICK              24
+#define SFVM_QUERYFSNOTIFY            25
+#define SFVM_DEFITEMCOUNT             26
+#define SFVM_DEFVIEWMODE              27
+#define SFVM_UNMERGEFROMMENU          28
+#define SFVM_ADDINGOBJECT             29 /* undocumented */
+#define SFVM_REMOVINGOBJECT           30 /* undocumented */
+#define SFVM_UPDATESTATUSBAR          31
+#define SFVM_BACKGROUNDENUM           32
+#define SFVM_GETCOMMANDDIR            33 /* undocumented */
+#define SFVM_GETCOLUMNSTREAM          34 /* undocumented */
+#define SFVM_CANSELECTALL             35 /* undocumented */
+#define SFVM_DIDDRAGDROP              36
+#define SFVM_ISSTRICTREFRESH          37 /* undocumented */
+#define SFVM_ISCHILDOBJECT            38 /* undocumented */
+#define SFVM_SETISFV                  39
+#define SFVM_GETEXTVIEWS              40 /* undocumented */
+#define SFVM_THISIDLIST               41
+#define SFVM_ADDPROPERTYPAGES         47
+#define SFVM_BACKGROUNDENUMDONE       48
+#define SFVM_GETNOTIFY                49
+#define SFVM_GETSORTDEFAULTS          53
+#define SFVM_SIZE                     57
+#define SFVM_GETZONE                  58
+#define SFVM_GETPANE                  59
+#define SFVM_GETHELPTOPIC             63
+#define SFVM_GETANIMATION             68
+#define SFVM_GET_CUSTOMVIEWINFO       77 /* undocumented */
+#define SFVM_ENUMERATEDITEMS          79 /* undocumented */
+#define SFVM_GET_VIEW_DATA            80 /* undocumented */
+#define SFVM_GET_WEBVIEW_LAYOUT       82 /* undocumented */
+#define SFVM_GET_WEBVIEW_CONTENT      83 /* undocumented */
+#define SFVM_GET_WEBVIEW_TASKS        84 /* undocumented */
+#define SFVM_GET_WEBVIEW_THEME        86 /* undocumented */
+#define SFVM_GETDEFERREDVIEWSETTINGS  92 /* undocumented */
+
+#include <pshpack8.h>
+
+typedef struct _SFV_CREATE
+{
+    UINT cbSize;
+    IShellFolder *pshf;
+    IShellView *psvOuter;
+    IShellFolderViewCB *psfvcb;
+} SFV_CREATE;
+
+#include <poppack.h>
+
+HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pscfv, IShellView **ppsv);
+
+/* Types and definitions for the SFM_* parameters */
+#include <pshpack8.h>
+
+#define QCMINFO_PLACE_BEFORE          0
+#define QCMINFO_PLACE_AFTER           1
+typedef struct _QCMINFO_IDMAP_PLACEMENT
+{
+    UINT id;
+    UINT fFlags;
+} QCMINFO_IDMAP_PLACEMENT;
+
+typedef struct _QCMINFO_IDMAP
+{
+    UINT nMaxIds;
+    QCMINFO_IDMAP_PLACEMENT pIdList[1];
+} QCMINFO_IDMAP;
+
+typedef struct _QCMINFO
+{
+    HMENU hmenu;
+    UINT indexMenu;
+    UINT idCmdFirst;
+    UINT idCmdLast;
+    QCMINFO_IDMAP const* pIdMap;
+} QCMINFO, *LPQCMINFO;
+
+#define TBIF_DEFAULT           0x00000000
+#define TBIF_APPEND            0x00000000
+#define TBIF_PREPEND           0x00000001
+#define TBIF_REPLACE           0x00000002
+#define TBIF_INTERNETBAR       0x00010000
+#define TBIF_STANDARDTOOLBAR   0x00020000
+#define TBIF_NOTOOLBAR         0x00030000
+
+typedef struct _TBINFO
+{
+    UINT cbuttons;
+    UINT uFlags;
+} TBINFO, *LPTBINFO;
+
+#include <poppack.h>
+
+/****************************************************************************
+*      SHShellFolderView_Message API
+*/
+
+LRESULT WINAPI SHShellFolderView_Message(
+       HWND hwndCabinet,
+       UINT uMessage,
+       LPARAM lParam);
+
+/* SHShellFolderView_Message messages */
+#define SFVM_REARRANGE          0x0001
+#define SFVM_GETARRANGECOLUMN   0x0002 /* undocumented */
+#define SFVM_ADDOBJECT          0x0003
+#define SFVM_GETITEMCOUNT       0x0004 /* undocumented */
+#define SFVM_GETITEMPIDL        0x0005 /* undocumented */
+#define SFVM_REMOVEOBJECT       0x0006
+#define SFVM_UPDATEOBJECT       0x0007
+#define SFVM_SETREDRAW          0x0008 /* undocumented */
+#define SFVM_GETSELECTEDOBJECTS 0x0009
+#define SFVM_ISDROPONSOURCE     0x000A /* undocumented */
+#define SFVM_MOVEICONS          0x000B /* undocumented */
+#define SFVM_GETDRAGPOINT       0x000C /* undocumented */
+#define SFVM_GETDROPPOINT       0x000D /* undocumented */
+#define SFVM_SETITEMPOS         0x000E
+#define SFVM_ISDROPONBACKGROUND 0x000F /* undocumented */
+#define SFVM_SETCLIPBOARD       0x0010
+#define SFVM_TOGGLEAUTOARRANGE  0x0011 /* undocumented */
+#define SFVM_LINEUPICONS        0x0012 /* undocumented */
+#define SFVM_GETAUTOARRANGE     0x0013 /* undocumented */
+#define SFVM_GETSELECTEDCOUNT   0x0014 /* undocumented */
+#define SFVM_GETITEMSPACING     0x0015 /* undocumented */
+#define SFVM_REFRESHOBJECT      0x0016 /* undocumented */
+#define SFVM_SETPOINTS          0x0017
+
 /****************************************************************************
 *      SHGetDataFromIDList API
 */
@@ -296,11 +998,15 @@ LPITEMIDLIST WINAPI SHBrowseForFolderW(LPBROWSEINFOW lpbi);
 #define SHDID_COMPUTER_AUDIO        19
 #define SHDID_COMPUTER_SHAREDDOCS   20
 
+#include <pshpack8.h>
+
 typedef struct _SHDESCRIPTIONID
 {   DWORD   dwDescriptionId;
     CLSID   clsid;
 } SHDESCRIPTIONID, *LPSHDESCRIPTIONID;
 
+#include <poppack.h>
+
 HRESULT WINAPI SHGetDataFromIDListA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int nFormat, LPVOID pv, int cb);
 HRESULT WINAPI SHGetDataFromIDListW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int nFormat, LPVOID pv, int cb);
 #define  SHGetDataFromIDList WINELIB_NAME_AW(SHGetDataFromIDList)
@@ -309,42 +1015,6 @@ BOOL WINAPI SHGetSpecialFolderPathA (HWND hwndOwner, LPSTR szPath, int nFolder,
 BOOL WINAPI SHGetSpecialFolderPathW (HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate);
 #define  SHGetSpecialFolderPath WINELIB_NAME_AW(SHGetSpecialFolderPath)
 
-/****************************************************************************
-* shlview structures
-*/
-
-/*
-* IShellFolderViewCallback Callback
-*  This "callback" is called by the shells default IShellView implementation (that
-*  we got using SHCreateShellViewEx()), to notify us of the various things that
-*  are happening to the shellview (and ask for things too).
-*
-*  You don't have to support anything here - anything you don't want to
-*  handle, the shell will do itself if you just return E_NOTIMPL. This parameters
-*  that the shell passes to this function are entirely undocumented.
-*
-*  HOWEVER, as the cabview sample as originally written used this callback, the
-*  writers implemented the callback mechanism on top of their own IShellView.
-*  Look there for some clues on what to do here.
-*/
-
-typedef HRESULT (CALLBACK *SHELLVIEWPROC)(DWORD dwUserParam,LPSHELLFOLDER psf,
-                         HWND hwnd,UINT uMsg,UINT wParam,LPARAM lParam);
-
-/* NF valid values for the "viewmode" item of the SHELLTEMPLATE*/
-#define NF_INHERITVIEW    0x0000
-#define NF_LOCALVIEW        0x0001
-
-typedef struct _SHELLVIEWDATA   /* idl */
-{ DWORD           dwSize;
-  LPSHELLFOLDER   pShellFolder;
-  DWORD           dwUserParam;
-  LPCITEMIDLIST   pidl;
-  DWORD           v3;        /* always 0 */
-  SHELLVIEWPROC   pCallBack;
-  DWORD           viewmode;  /* NF_* enum */
-} SHELLVIEWDATA, * LPSHELLVIEWDATA;
-
 HRESULT WINAPI SHGetMalloc(LPMALLOC *lpmal) ;
 
 /**********************************************************************
@@ -372,6 +1042,7 @@ typedef struct
     BOOL fShowSuperHidden : 1;
     BOOL fNoNetCrawling : 1;
 
+    UINT :15; /* Required for proper binary layout with gcc */
     DWORD dwWin95Unused;
     UINT  uWin95Unused;
     LONG   lParamSort;
@@ -382,6 +1053,7 @@ typedef struct
     BOOL fStartPanelOn: 1;
     BOOL fShowStartPage: 1;
     UINT fSpareFlags : 13;
+    UINT :15; /* Required for proper binary layout with gcc */
 } SHELLSTATE, *LPSHELLSTATE;
 
 /**********************************************************************
@@ -405,6 +1077,7 @@ typedef struct
 
        BOOL fHideIcons : 1;
        UINT fRestFlags : 3;
+       UINT :15; /* Required for proper binary layout with gcc */
 } SHELLFLAGSTATE, * LPSHELLFLAGSTATE;
 
 VOID WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask);
@@ -588,7 +1261,7 @@ typedef enum RESTRICTIONS
        REST_ALLOWUNHASHEDWEBVIEW,
        REST_ALLOWLEGACYWEBVIEW,
        REST_REVERTWEBVIEWSECURITY,
-       
+
        REST_INHERITCONSOLEHANDLES      = 0x40000086,
 
        REST_NODISCONNECT               = 0x41000001,
@@ -634,9 +1307,9 @@ typedef struct _SHChangeNotifyEntry
 #define SHCNE_ALLEVENTS                0x7FFFFFFF
 #define SHCNE_INTERRUPT                0x80000000
 
-#define SHCNEE_ORDERCHANGED    0x0002L
-#define SHCNEE_MSI_CHANGE      0x0004L
-#define SHCNEE_MSI_UNINSTALL   0x0005L
+#define SHCNEE_ORDERCHANGED     __MSABI_LONG(0x0002)
+#define SHCNEE_MSI_CHANGE       __MSABI_LONG(0x0004)
+#define SHCNEE_MSI_UNINSTALL    __MSABI_LONG(0x0005)
 
 #define SHCNF_IDLIST           0x0000
 #define SHCNF_PATHA            0x0001
@@ -646,34 +1319,85 @@ typedef struct _SHChangeNotifyEntry
 #define SHCNF_PRINTERW         0x0006
 #define SHCNF_TYPE             0x00FF
 #define SHCNF_FLUSH            0x1000
-#define SHCNF_FLUSHNOWAIT      0x2000
+#define SHCNF_FLUSHNOWAIT      0x3000
+#define SHCNF_NOTIFYRECURSIVE  0x10000
 
 #define SHCNF_PATH              WINELIB_NAME_AW(SHCNF_PATH)
 #define SHCNF_PRINTER           WINELIB_NAME_AW(SHCNF_PRINTER)
 
+#define SHCNRF_InterruptLevel 0x0001
+#define SHCNRF_ShellLevel 0x0002
+#define SHCNRF_RecursiveInterrupt 0x1000
+#define SHCNRF_NewDelivery 0x8000
+
 void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2);
 
-/*
- * IShellChangeNotify
- */
-typedef struct IShellChangeNotify IShellChangeNotify, *LPSHELLCHANGENOTIFY;
+typedef enum {
+    SLDF_HAS_ID_LIST = 0x00000001,
+    SLDF_HAS_LINK_INFO = 0x00000002,
+    SLDF_HAS_NAME = 0x00000004,
+    SLDF_HAS_RELPATH = 0x00000008,
+    SLDF_HAS_WORKINGDIR = 0x00000010,
+    SLDF_HAS_ARGS = 0x00000020,
+    SLDF_HAS_ICONLOCATION = 0x00000040,
+    SLDF_UNICODE = 0x00000080,
+    SLDF_FORCE_NO_LINKINFO = 0x00000100,
+    SLDF_HAS_EXP_SZ = 0x00000200,
+    SLDF_RUN_IN_SEPARATE = 0x00000400,
+    SLDF_HAS_LOGO3ID = 0x00000800,
+    SLDF_HAS_DARWINID = 0x00001000,
+    SLDF_RUNAS_USER = 0x00002000,
+    SLDF_HAS_EXP_ICON_SZ = 0x00004000,
+    SLDF_NO_PIDL_ALIAS = 0x00008000,
+    SLDF_FORCE_UNCNAME = 0x00010000,
+    SLDF_RUN_WITH_SHIMLAYER = 0x00020000,
+    SLDF_FORCE_NO_LINKTRACK = 0x00040000,
+    SLDF_ENABLE_TARGET_METADATA = 0x00080000,
+    SLDF_DISABLE_KNOWNFOLDER_RELATIVE_TRACKING = 0x00200000,
+    SLDF_VALID = 0x003ff7ff,
+    SLDF_RESERVED = 0x80000000,
+} SHELL_LINK_DATA_FLAGS;
+
+typedef struct tagDATABLOCKHEADER
+{
+    DWORD cbSize;
+    DWORD dwSignature;
+} DATABLOCK_HEADER, *LPDATABLOCK_HEADER, *LPDBLIST;
 
-#define INTERFACE IShellChangeNotify
-#define IShellChangeNotify_METHODS \
-    IUnknown_METHODS \
-    STDMETHOD(OnChange)(THIS_ LONG lEvent, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
+typedef struct {
+    DATABLOCK_HEADER dbh;
+    CHAR szDarwinID[MAX_PATH];
+    WCHAR szwDarwinID[MAX_PATH];
+} EXP_DARWIN_LINK, *LPEXP_DARWIN_LINK;
 
-ICOM_DEFINE(IShellChangeNotify, IUnknown)
-#undef INTERFACE
+typedef struct {
+    DWORD cbSize;
+    DWORD cbSignature;
+    CHAR szTarget[MAX_PATH];
+    WCHAR szwTarget[MAX_PATH];
+} EXP_SZ_LINK, *LPEXP_SZ_LINK;
 
-#ifdef COBJMACROS
-/*** IUnknown methods ***/
-#define IShellChangeNotify_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
-#define IShellChangeNotify_AddRef(p)                  (p)->lpVtbl->AddRef(p)
-#define IShellChangeNotify_Release(p)                 (p)->lpVtbl->Release(p)
-/*** IShellChangeNotify methods ***/
-#define IShellChangeNotify_OnChange(p,a,b,c)         (p)->lpVtbl->OnChange(p,a,b,c)
-#endif
+typedef struct {
+    DWORD cbSize;
+    DWORD dwSignature;
+    DWORD idSpecialFolder;
+    DWORD cbOffset;
+} EXP_SPECIAL_FOLDER, *LPEXP_SPECIAL_FOLDER;
+
+typedef struct {
+    DWORD cbSize;
+    DWORD dwSignature;
+    BYTE abPropertyStorage[1];
+} EXP_PROPERTYSTORAGE;
+
+#define EXP_SZ_LINK_SIG         0xa0000001
+#define NT_CONSOLE_PROPS_SIG    0xa0000002
+#define NT_FE_CONSOLE_PROPS_SIG 0xa0000004
+#define EXP_SPECIAL_FOLDER_SIG  0xa0000005
+#define EXP_DARWIN_ID_SIG       0xa0000006
+#define EXP_SZ_ICON_SIG         0xa0000007
+#define EXP_LOGO3_ID_SIG        EXP_SZ_ICON_SIG /* Old SDKs only */
+#define EXP_PROPERTYSTORAGE_SIG 0xa0000009
 
 typedef struct _SHChangeDWORDAsIDList {
     USHORT   cb;
@@ -703,6 +1427,30 @@ HRESULT WINAPI SHGetRealIDL(IShellFolder *psf, LPCITEMIDLIST pidlSimple, LPITEMI
 DWORD WINAPI SHCreateDirectory(HWND, LPCVOID);
 int WINAPI SHCreateDirectoryExA(HWND, LPCSTR, LPSECURITY_ATTRIBUTES);
 int WINAPI SHCreateDirectoryExW(HWND, LPCWSTR, LPSECURITY_ATTRIBUTES);
+#define    SHCreateDirectoryEx WINELIB_NAME_AW(SHCreateDirectoryEx)
+
+/****************************************************************************
+* SHGetSetFolderCustomSettings API
+*/
+typedef struct {
+    DWORD dwSize;
+    DWORD dwMask;
+    SHELLVIEWID *pvid;
+    LPWSTR pszWebViewTemplate;
+    DWORD cchWebViewTemplate;
+    LPWSTR pszWebViewTemplateVersion;
+    LPWSTR pszInfoTip;
+    DWORD cchInfoTip;
+    CLSID *pclsid;
+    DWORD dwFlags;
+    LPWSTR pszIconFile;
+    DWORD cchIconFile;
+    int iIconIndex;
+    LPWSTR pszLogo;
+    DWORD cchLogo;
+} SHFOLDERCUSTOMSETTINGS, *LPSHFOLDERCUSTOMSETTINGS;
+
+HRESULT WINAPI SHGetSetFolderCustomSettings(LPSHFOLDERCUSTOMSETTINGS pfcs, LPCSTR pszPath, DWORD dwReadWrite);
 
 /****************************************************************************
 * SHGetSpecialFolderLocation API
@@ -734,7 +1482,7 @@ HRESULT WINAPI SHGetFolderPathW(HWND hwnd, int nFolder, HANDLE hToken, DWORD dwF
 #define CSIDL_SENDTO           0x0009
 #define CSIDL_BITBUCKET                0x000a
 #define CSIDL_STARTMENU                0x000b
-#define CSIDL_MYDOCUMENTS      0x000c
+#define CSIDL_MYDOCUMENTS      CSIDL_PERSONAL
 #define CSIDL_MYMUSIC          0x000d
 #define CSIDL_MYVIDEO          0x000e
 #define CSIDL_DESKTOPDIRECTORY 0x0010
@@ -885,6 +1633,7 @@ typedef struct {
     BOOL fDontPrettyNames:1;
     BOOL fAdminsCreateCommonGroups:1;
     UINT fUnusedFlags:7;
+    UINT :15; /* Required for proper binary layout with gcc */
     UINT fMenuEnumFilter;
 } CABINETSTATE, *LPCABINETSTATE;
 
@@ -896,9 +1645,29 @@ BOOL WINAPI WriteCabinetState(CABINETSTATE *);
 /****************************************************************************
  * Path Manipulation Routines
  */
-VOID WINAPI PathGetShortPath(LPWSTR pszPath);
 
-#include <poppack.h>
+/* PathProcessCommand flags */
+#define PPCF_ADDQUOTES        0x01
+#define PPCF_INCLUDEARGS      0x02
+#define PPCF_ADDARGUMENTS     0x03
+#define PPCF_NODIRECTORIES    0x10
+#define PPCF_DONTRESOLVE      0x20
+#define PPCF_FORCEQUALIFY     0x40
+#define PPCF_LONGESTPOSSIBLE  0x80
+
+/* PathResolve flags */
+#define PRF_VERIFYEXISTS         0x01
+#define PRF_EXECUTABLE           0x02
+#define PRF_TRYPROGRAMEXTENSIONS 0x03
+#define PRF_FIRSTDIRDEF          0x04
+#define PRF_DONTFINDLINK         0x08
+#define PRF_REQUIREABSOLUTE      0x10
+
+VOID WINAPI PathGetShortPath(LPWSTR pszPath);
+LONG WINAPI PathProcessCommand(LPCWSTR, LPWSTR, int, DWORD);
+int  WINAPI PathResolve(LPWSTR, PZPCWSTR, UINT);
+BOOL WINAPI PathYetAnotherMakeUniqueName(LPWSTR, LPCWSTR, LPCWSTR, LPCWSTR);
+BOOL WINAPI Win32DeleteFile(LPCWSTR);
 
 /****************************************************************************
  * Drag And Drop Routines
@@ -923,82 +1692,22 @@ BOOL         WINAPI DAD_DragLeave(void);
 BOOL         WINAPI DAD_AutoScroll(HWND,AUTO_SCROLL_DATA*,LPPOINT);
 HRESULT      WINAPI SHDoDragDrop(HWND,IDataObject*,IDropSource*,DWORD,LPDWORD);
 
-/*****************************************************************************
- * IFileSystemBindData interface
+/****************************************************************************
+ * Internet shortcut properties
  */
-#ifndef __IFileSystemBindData_FWD_DEFINED__
-#define __IFileSystemBindData_FWD_DEFINED__
-typedef struct IFileSystemBindData IFileSystemBindData;
-#endif
-
-typedef IFileSystemBindData *LPFILESYSTEMBINDDATA;
-
-#ifndef __IFileSystemBindData_INTERFACE_DEFINED__
-#define __IFileSystemBindData_INTERFACE_DEFINED__
-
-DEFINE_GUID(IID_IFileSystemBindData, 0x01e18d10, 0x4d8b, 0x11d2, 0x85,0x5d, 0x00,0x60,0x08,0x05,0x93,0x67);
-#if defined(__cplusplus) && !defined(CINTERFACE)
-struct IFileSystemBindData : public IUnknown
-{
-    virtual HRESULT STDMETHODCALLTYPE GetFindData(
-        WIN32_FIND_DATAW* pfd) = 0;
-
-    virtual HRESULT STDMETHODCALLTYPE SetFindData(
-        const WIN32_FIND_DATAW* pfd) = 0;
-
-};
-#else
-typedef struct IFileSystemBindDataVtbl IFileSystemBindDataVtbl;
-struct IFileSystemBindData {
-    const IFileSystemBindDataVtbl* lpVtbl;
-};
-struct IFileSystemBindDataVtbl {
-    ICOM_MSVTABLE_COMPAT_FIELDS
-
-    /*** IUnknown methods ***/
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
-        IFileSystemBindData* This,
-        REFIID riid,
-        void** ppvObject);
-
-    ULONG (STDMETHODCALLTYPE *AddRef)(
-        IFileSystemBindData* This);
-
-    ULONG (STDMETHODCALLTYPE *Release)(
-        IFileSystemBindData* This);
-
-    /*** IFileSystemBindData methods ***/
-    HRESULT (STDMETHODCALLTYPE *GetFindData)(
-        IFileSystemBindData* This,
-        WIN32_FIND_DATAW* pfd);
-
-    HRESULT (STDMETHODCALLTYPE *SetFindData)(
-        IFileSystemBindData* This,
-        const WIN32_FIND_DATAW* pfd);
-
-};
-
-/*** IUnknown methods ***/
-#define IFileSystemBindData_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
-#define IFileSystemBindData_AddRef(p) (p)->lpVtbl->AddRef(p)
-#define IFileSystemBindData_Release(p) (p)->lpVtbl->Release(p)
-/*** IFileSystemBindData methods ***/
-#define IFileSystemBindData_GetFindData(p,a) (p)->lpVtbl->GetFindData(p,a)
-#define IFileSystemBindData_SetFindData(p,a) (p)->lpVtbl->SetFindData(p,a)
-
-#endif
 
-#define IFileSystemBindData_METHODS \
-    ICOM_MSVTABLE_COMPAT_FIELDS \
-    /*** IUnknown methods ***/ \
-    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; \
-    STDMETHOD_(ULONG,AddRef)(THIS) PURE; \
-    STDMETHOD_(ULONG,Release)(THIS) PURE; \
-    /*** IFileSystemBindData methods ***/ \
-    STDMETHOD_(HRESULT,GetFindData)(THIS_ WIN32_FIND_DATAW* pfd) PURE; \
-    STDMETHOD_(HRESULT,SetFindData)(THIS_ const WIN32_FIND_DATAW* pfd) PURE;
+#define PID_IS_URL         2
+#define PID_IS_NAME        4
+#define PID_IS_WORKINGDIR  5
+#define PID_IS_HOTKEY      6
+#define PID_IS_SHOWCMD     7
+#define PID_IS_ICONINDEX   8
+#define PID_IS_ICONFILE    9
+#define PID_IS_WHATSNEW    10
+#define PID_IS_AUTHOR      11
+#define PID_IS_DESCRIPTION 12
+#define PID_IS_COMMENT     13
 
-#endif  /* __IFileSystemBindData_INTERFACE_DEFINED__ */
 
 LPITEMIDLIST WINAPI ILAppendID(LPITEMIDLIST,LPCSHITEMID,BOOL);
 LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST);
@@ -1014,7 +1723,41 @@ LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST);
 UINT         WINAPI ILGetSize(LPCITEMIDLIST);
 BOOL         WINAPI ILIsEqual(LPCITEMIDLIST,LPCITEMIDLIST);
 BOOL         WINAPI ILIsParent(LPCITEMIDLIST,LPCITEMIDLIST,BOOL);
+HRESULT      WINAPI ILLoadFromStream(LPSTREAM,LPITEMIDLIST*);
 BOOL         WINAPI ILRemoveLastID(LPITEMIDLIST);
+HRESULT      WINAPI ILSaveToStream(LPSTREAM,LPCITEMIDLIST);
+
+static inline BOOL ILIsEmpty(LPCITEMIDLIST pidl)
+{
+    return !(pidl && pidl->mkid.cb);
+}
+
+#include <pshpack8.h>
+
+typedef struct {
+    HWND hwnd;
+    IContextMenuCB *pcmcb;
+    PCIDLIST_ABSOLUTE pidlFolder;
+    IShellFolder *psf;
+    UINT cidl;
+    PCUITEMID_CHILD_ARRAY apidl;
+    IUnknown *punkAssociationInfo;
+    UINT cKeys;
+    const HKEY *aKeys;
+} DEFCONTEXTMENU;
+
+#include <poppack.h>
+
+HRESULT WINAPI SHCreateDefaultContextMenu(const DEFCONTEXTMENU *pdcm, REFIID riid, void **ppv);
+
+typedef HRESULT (CALLBACK *LPFNDFMCALLBACK)(IShellFolder*,HWND,IDataObject*,UINT,WPARAM,LPARAM);
+
+HRESULT WINAPI CDefFolderMenu_Create2(LPCITEMIDLIST pidlFolder, HWND hwnd, UINT cidl,
+                                      LPCITEMIDLIST *apidl, IShellFolder *psf,
+                                      LPFNDFMCALLBACK lpfn, UINT nKeys, const HKEY *ahkeys,
+                                      IContextMenu **ppcm);
+
+#include <poppack.h>
 
 #ifdef __cplusplus
 } /* extern "C" */