[HEADERS]

- Move definitions for DrawCaptionTemp to userundoc.h as it shouldn't be defined in the psdk
- Add browseui_undoc.h and move there the undocumented definitions for browseui
- Add comctl32_undoc.h and move there the undocumented definitions for comctl32
- Move undocumented definitions for shlwapi to shlwapi_undoc.h
- Add shellutils.h to contain helper macros and definitions that are nor per se undocumented.
- Cleanup internal definitions of explorer. Remove several temporary hacks. They were added at a time that these features were not implemented at all.

svn path=/trunk/; revision=65507
This commit is contained in:
Giannis Adamopoulos 2014-11-27 20:27:19 +00:00
parent 4f8f6087e3
commit 98669c13f1
21 changed files with 942 additions and 958 deletions

View file

@ -1,50 +0,0 @@
#pragma once
/*
******************************************************************************
* This header is for easier generation of IUnknown interfaces for inherited *
* classes and for casts from the interface to the implementation and vice *
* versa. *
******************************************************************************
*/
/* Generates a Iiface::AddRef() method that forwards to Iimpl::AddRef() */
#define METHOD_IUNKNOWN_INHERITED_ADDREF_NAME(iface,impl) impl##Impl_##iface##_AddRef
#define METHOD_IUNKNOWN_INHERITED_ADDREF(iface,impl) \
static ULONG STDMETHODCALLTYPE \
impl##Impl_##iface##_AddRef(IN OUT iface *ifc) { \
impl##Impl *This = impl##Impl_from_##iface (ifc); \
impl *baseiface = impl##_from_##impl##Impl(This); \
return impl##Impl_AddRef(baseiface); \
}
/* Generates a Iiface::Release() method that forwards to Iimpl::Release() */
#define METHOD_IUNKNOWN_INHERITED_RELEASE_NAME(iface,impl) impl##Impl_##iface##_Release
#define METHOD_IUNKNOWN_INHERITED_RELEASE(iface,impl) \
static ULONG STDMETHODCALLTYPE \
impl##Impl_##iface##_Release(IN OUT iface *ifc) { \
impl##Impl *This = impl##Impl_from_##iface (ifc); \
impl *baseiface = impl##_from_##impl##Impl(This); \
return impl##Impl_AddRef(baseiface); \
}
/* Generates a Iiface::QueryInterface() method that forwards to Iimpl::QueryInterface() */
#define METHOD_IUNKNOWN_INHERITED_QUERYINTERFACE_NAME(iface,impl) impl##Impl_##iface##_QueryInterface
#define METHOD_IUNKNOWN_INHERITED_QUERYINTERFACE(iface,impl) \
static HRESULT STDMETHODCALLTYPE \
impl##Impl_##iface##_QueryInterface(IN OUT iface *ifc, IN REFIID riid, OUT VOID **ppvObject) { \
impl##Impl *This = impl##Impl_from_##iface (ifc); \
impl *baseiface = impl##_from_##impl##Impl(This); \
return impl##Impl_QueryInterface(baseiface, riid, ppvObject); \
}
/* Generates a Ixxx_from_IxxxImpl() and a IxxxImpl_from_Ixxx() inline function */
#define IMPL_CASTS(iface,impl,vtbl) \
static __inline iface * \
iface##_from_##impl##Impl (impl##Impl *This) { \
return (iface *)&This->vtbl; \
} \
static __inline impl##Impl * \
impl##Impl_from_##iface (iface *ifc) { \
return (impl##Impl *)((ULONG_PTR)ifc - FIELD_OFFSET(impl##Impl, vtbl)); \
}

View file

@ -19,7 +19,7 @@
*/
#include "precomp.h"
#include <shlwapi_undoc.h>
#include <browseui_undoc.h>
DWORD WINAPI _WinList_Init(void);
void WINAPI _ShellDDEInit(BOOL bInit);

View file

@ -23,18 +23,20 @@
#include <atlwin.h>
#include <shellapi.h>
#include <shlobj.h>
#include <shlobj_undoc.h>
#include <shlwapi.h>
#include <shlguid_undoc.h>
#include <uxtheme.h>
#include <strsafe.h>
#include <undocuser.h>
#include <shlobj_undoc.h>
#include <shlguid_undoc.h>
#include <undocshell.h>
#include <rosctrls.h>
#include <shellutils.h>
#include "tmschema.h"
#include "resource.h"
#include "comcsup.h"
#include <wine/debug.h>

View file

@ -22,8 +22,6 @@
#include <shdeprecated.h>
#include "undoc.h"
/*****************************************************************************
** ITrayBandSite ************************************************************
*****************************************************************************/
@ -79,7 +77,7 @@ public:
if (ppvObj == NULL)
return E_POINTER;
if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_IBandSiteStreamCallback))
if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_IBandSiteHelper))
{
// return IBandSiteStreamCallback's IUnknown
*ppvObj = static_cast<IBandSiteStreamCallback*>(this);
@ -296,8 +294,8 @@ public:
if (ContextMenu == NULL)
{
/* Cache the context menu so we don't need to CoCreateInstance all the time... */
hRet = CoCreateInstance(CLSID_IShellBandSiteMenu, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IShellService, &pSs));
TRACE("CoCreateInstance(CLSID_IShellBandSiteMenu) for IShellService returned: 0x%x\n", hRet);
hRet = CoCreateInstance(CLSID_BandSiteMenu, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IShellService, &pSs));
TRACE("CoCreateInstance(CLSID_BandSiteMenu) for IShellService returned: 0x%x\n", hRet);
if (!SUCCEEDED(hRet))
return hRet;

View file

@ -1,11 +0,0 @@
#pragma once
/* FIXME: Ugly hack!!! FIX ASAP! Move to uuid! */
static const GUID VID_HACK_LargeIcons = {0x0057D0E0, 0x3573, 0x11CF, {0xAE, 0x69, 0x08, 0x00, 0x2B, 0x2E, 0x12, 0x62}};
#define VID_LargeIcons VID_HACK_LargeIcons
static const GUID IID_HACK_IDeskBar = {0xEB0FE173, 0x1A3A, 0x11D0, {0x89, 0xB3, 0x00, 0xA0, 0xC9, 0x0A, 0x90, 0xAC}};
#define IID_IDeskBar IID_HACK_IDeskBar
static const GUID SID_HACK_SMenuPopup = {0xD1E7AFEB,0x6A2E,0x11D0,{0x8C,0x78,0x00,0xC0,0x4F,0xD9,0x18,0xB4}};
#define SID_SMenuPopup SID_HACK_SMenuPopup

View file

@ -1,54 +0,0 @@
#pragma once
/*
* Undocumented stuff
*/
/* IMenuDeskBar provides the band site toolbars menu */
static const CLSID CLSID_HACK_IShellBandSiteMenu = {0xECD4FC4E,0x521C,0x11D0,{0xB7,0x92,0x00,0xA0,0xC9,0x03,0x12,0xE1}};
#define CLSID_IShellBandSiteMenu CLSID_HACK_IShellBandSiteMenu
static const GUID IID_HACK_IBandSiteStreamCallback = {0xD1E7AFEA,0x6A2E,0x11D0,{0x8C,0x78,0x00,0xC0,0x4F,0xD9,0x18,0xB4}};
#define IID_IBandSiteStreamCallback IID_HACK_IBandSiteStreamCallback
static const GUID CLSID_HACK_StartMenu = {0x4622AD11,0xFF23,0x11D0,{0x8D,0x34,0x00,0xA0,0xC9,0x0F,0x27,0x19}};
#define CLSID_StartMenu CLSID_HACK_StartMenu
static const GUID CLSID_HACK_PersonalStartMenu = {0x3F6953F0,0x5359,0x47FC,{0xBD,0x99,0x9F,0x2C,0xB9,0x5A,0x62,0xFD}};
#define CLSID_PersonalStartMenu CLSID_HACK_PersonalStartMenu
static const GUID IID_HACK_IMenuBand = {0x568804CD,0xCBD7,0x11D0,{0x98,0x16,0x00,0xC0,0x4F,0xD9,0x19,0x72}};
#define IID_IMenuBand IID_HACK_IMenuBand
#define WM_GETISHELLBROWSER (WM_USER+7)
BOOL WINAPI SetShellWindow(HWND);
BOOL WINAPI SetShellWindowEx(HWND, HWND);
BOOL WINAPI RegisterShellHook(HWND, DWORD);
IStream* WINAPI SHGetViewStream(LPCITEMIDLIST, DWORD, LPCTSTR, LPCTSTR, LPCTSTR);
BOOL WINAPI SHIsEmptyStream(IStream*);
#define MRU_BINARY 0x1
#define MRU_CACHEWRITE 0x2
HANDLE WINAPI CreateMRUListW(LPCREATEMRULISTW);
HANDLE WINAPI CreateMRUListA(LPCREATEMRULISTA);
INT WINAPI AddMRUData(HANDLE,LPCVOID,DWORD);
INT WINAPI FindMRUData(HANDLE,LPCVOID,DWORD,LPINT);
VOID WINAPI FreeMRUList(HANDLE);
#define DC_NOSENDMSG 0x2000
BOOL WINAPI DrawCaptionTempA(HWND,HDC,const RECT*,HFONT,HICON,LPCSTR,UINT);
BOOL WINAPI DrawCaptionTempW(HWND,HDC,const RECT*,HFONT,HICON,LPCWSTR,UINT);
#ifdef UNICODE
#define CreateMRUList CreateMRUListW
#define DrawCaptionTemp DrawCaptionTempW
#else
#define CreateMRUList CreateMRUListA
#define DrawCaptionTemp DrawCaptionTempA
#endif
EXTERN_C const GUID CLSID_RebarBandSite;
HRESULT WINAPI SHInvokeDefaultCommand(HWND,IShellFolder*,LPCITEMIDLIST);
HRESULT WINAPI SHPropertyBag_ReadPOINTL(IPropertyBag*,LPCWSTR,POINTL*);

View file

@ -24,9 +24,10 @@
#include <shobjidl.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <shlwapi_undoc.h>
#include <stdio.h>
#include <browseui_undoc.h>
int _tmain(int argc, _TCHAR* argv[])
{
EXPLORER_CMDLINE_PARSE_RESULTS parseResults = { 0 };

View file

@ -22,8 +22,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(desktop);
BOOL WINAPI SetShellWindowEx(HWND, HWND);
#define SHDESK_TAG 0x4b534544
static const WCHAR szProgmanClassName [] = L"Progman";

View file

@ -60,7 +60,9 @@
#include <atlcom.h>
#include <atlwin.h>
#include <undocshell.h>
#include <undocuser.h>
#include <shellutils.h>
#include <rosctrls.h>
#include <wine/debug.h>

View file

@ -24,6 +24,8 @@
#include <shlwapi.h>
#include <shlwapi_undoc.h>
#include <undocshell.h>
#include <shellutils.h>
#include <browseui_undoc.h>
#include <wine/debug.h>
#include "resource.h"

View file

@ -22,8 +22,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(desktop);
BOOL WINAPI SetShellWindowEx(HWND, HWND);
#define SHDESK_TAG 0x4b534544
static const WCHAR szProgmanClassName [] = L"Progman";

View file

@ -21,7 +21,6 @@
#include "precomp.h"
#include <ddeml.h>
#include <strsafe.h>
#include <shlwapi_undoc.h>
WINE_DEFAULT_DEBUG_CHANNEL(shelldde);

View file

@ -17,11 +17,8 @@
#include <wincon.h>
#include <commdlg.h>
#include <ddeml.h>
#include <shlguid_undoc.h>
#include <shlwapi.h>
#include <shlobj.h>
#include <shlobj_undoc.h>
#include <shlwapi_undoc.h>
#include <recyclebin.h>
#include <ndk/rtlfuncs.h>
#include <fmifs/fmifs.h>
@ -30,13 +27,18 @@
#include <atlbase.h>
#include <atlcom.h>
#include <powrprof.h>
#include <undocshell.h>
//#include "base/shell/explorer-new/todo.h"
//#include "dlgs.h"
#include <comctl32_undoc.h>
#include <shlguid_undoc.h>
#include <shlobj_undoc.h>
#include <shlwapi_undoc.h>
#include <undocshell.h>
#include <browseui_undoc.h>
#include <shellutils.h>
#include "wine/pidl.h"
#include "debughlp.h"
#include "undocshell.h"
#include "wine/shell32_main.h"
#include "shresdef.h"
#include "cpanel.h"

View file

@ -4280,8 +4280,6 @@ BOOL WINAPI DragDetect(_In_ HWND, _In_ POINT);
DWORD WINAPI DragObject(_In_ HWND, _In_ HWND, _In_ UINT, _In_ ULONG_PTR, _In_opt_ HCURSOR);
BOOL WINAPI DrawAnimatedRects(_In_opt_ HWND, _In_ int, _In_ LPCRECT, _In_ LPCRECT);
BOOL WINAPI DrawCaption(_In_ HWND, _In_ HDC, _In_ LPCRECT, _In_ UINT);
BOOL WINAPI DrawCaptionTempA(HWND,HDC,const RECT*,HFONT,HICON,LPCSTR,UINT);
BOOL WINAPI DrawCaptionTempW(HWND,HDC,const RECT*,HFONT,HICON,LPCWSTR,UINT);
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT);
BOOL WINAPI DrawFocusRect(_In_ HDC, _In_ LPCRECT);
BOOL WINAPI DrawFrameControl(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT);

View file

@ -0,0 +1,136 @@
/*
* ReactOS shlwapi
*
* Copyright 2009 Andrew Hill <ash77 at domain reactos.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __BROWSEUI_UNDOC_H
#define __BROWSEUI_UNDOC_H
#ifdef __cplusplus
extern "C" {
#endif /* defined(__cplusplus) */
typedef struct IEThreadParamBlock
{
long offset0;
DWORD dwFlags;
long offset8;
IUnknown * offsetC;
long offset10;
IUnknown * offset14;
LPITEMIDLIST directoryPIDL; // 0x18
char offset1C[0x70-0x1C]; // unknown contents -- 0x1C..0x6c
IUnknown * offset70;
long offset74; // unknown contents
IUnknown * offset78;
LPITEMIDLIST offset7C;
LPITEMIDLIST offset80;
LONG offset84;
LONG offset88;
LONG offset8C;
LONG offset90;
LONG offset94;
LONG offset98;
LONG offset9C;
LONG offsetA0;
char offsetA4[0xD8-0xA4]; // unknown contents -- 0xA4..0xD8
LONG offsetD8;
char offsetDC[0xF8-0xDC]; // unknown contents -- 0xDC..0xF8
IUnknown * offsetF8; // instance explorer
LONG offsetFC; // unknown contents
} IE_THREAD_PARAM_BLOCK, *PIE_THREAD_PARAM_BLOCK;
typedef struct ExplorerCommandLineParseResults
{
LPWSTR strPath;
LPITEMIDLIST pidlPath;
DWORD dwFlags;
DWORD offsetC;
DWORD offset10;
DWORD offset14;
DWORD offset18;
DWORD offset1C;
LPITEMIDLIST pidlRoot;
DWORD offset24;
DWORD offset28;
DWORD offset2C;
DWORD offset30;
GUID guidInproc;
} EXPLORER_CMDLINE_PARSE_RESULTS, *PEXPLORER_CMDLINE_PARSE_RESULTS;
#define SH_EXPLORER_CMDLINE_FLAG_ONE 0x00000001
#define SH_EXPLORER_CMDLINE_FLAG_S 0x00000002
// unknown/unused 0x00000004
#define SH_EXPLORER_CMDLINE_FLAG_E 0x00000008
// unknown/unused 0x00000010
// unknown/unused 0x00000020
#define SH_EXPLORER_CMDLINE_FLAG_SELECT 0x00000040
#define SH_EXPLORER_CMDLINE_FLAG_EMBED 0x00000080
// unknown/unused 0x00000100
#define SH_EXPLORER_CMDLINE_FLAG_IDLIST 0x00000200
#define SH_EXPLORER_CMDLINE_FLAG_INPROC 0x00000400
// unknown/unused 0x00000800
#define SH_EXPLORER_CMDLINE_FLAG_NOUI 0x00001000
// unknown/unused 0x00002000
#define SH_EXPLORER_CMDLINE_FLAG_N 0x00004000
// unknown/unused 0x00008000
// unknown/unused 0x00010000
#define SH_EXPLORER_CMDLINE_FLAG_SEPARATE 0x00020000
// unknown/unused 0x00040000
// unknown/unused 0x00080000
// unknown/unused 0x00100000
// unknown/unused 0x00200000
// unknown/unused 0x00400000
// unknown/unused 0x00800000
// unknown/unused 0x01000000
#define SH_EXPLORER_CMDLINE_FLAG_STRING 0x02000000
#define WM_EXPLORER_OPEN_NEW_WINDOW (WM_USER+11)
#define WM_EXPLORER_1037 (WM_USER+13)
void WINAPI InitOCHostClass(long param8);
long WINAPI SHOpenFolderWindow(PIE_THREAD_PARAM_BLOCK parameters);
void WINAPI SHCreateSavedWindows(void);
BOOL WINAPI SHCreateFromDesktop(PEXPLORER_CMDLINE_PARSE_RESULTS parseResults);
UINT WINAPI SHExplorerParseCmdLine(PEXPLORER_CMDLINE_PARSE_RESULTS pParseResults);
void WINAPI UEMRegisterNotify(long param8, long paramC);
HRESULT WINAPI SHCreateBandForPidl(LPCITEMIDLIST param8, IUnknown *paramC, BOOL param10);
HRESULT WINAPI SHPidlFromDataObject(IDataObject *param8, long *paramC, long param10, FILEDESCRIPTORW *param14);
long WINAPI IDataObject_GetDeskBandState(long param8);
PIE_THREAD_PARAM_BLOCK WINAPI SHCreateIETHREADPARAM(long param8, long paramC, IUnknown *param10, IUnknown *param14);
PIE_THREAD_PARAM_BLOCK WINAPI SHCloneIETHREADPARAM(PIE_THREAD_PARAM_BLOCK param);
long WINAPI SHParseIECommandLine(long param8, long paramC);
void WINAPI SHDestroyIETHREADPARAM(PIE_THREAD_PARAM_BLOCK param);
BOOL WINAPI SHOnCWMCommandLine(HANDLE hSharedInfo);
LPITEMIDLIST WINAPI Channel_GetFolderPidl(void);
IUnknown *WINAPI ChannelBand_Create(LPITEMIDLIST pidl);
HRESULT WINAPI Channels_SetBandInfoSFB(IUnknown *param8);
HRESULT WINAPI IUnknown_SetBandInfoSFB(IUnknown *param8, long paramC);
HRESULT WINAPI Channel_QuickLaunch(void);
HRESULT WINAPI SHGetNavigateTarget(long param8, long paramC, long param10, long param14);
HRESULT WINAPI GetInfoTip(IUnknown *param8, long paramC, LPTSTR *param10, long cchMax);
HRESULT WINAPI SHEnumClassesOfCategories(long param8, long paramC, long param10, long param14, long param18);
HRESULT WINAPI SHWriteClassesOfCategories(long param8, long paramC, long param10, long param14, long param18, long param1C, long param20);
BOOL WINAPI SHIsExplorerBrowser();
HRESULT WINAPI SHOpenNewFrame(LPITEMIDLIST pidl, IUnknown *paramC, long param10, DWORD dwFlags);
#ifdef __cplusplus
} /* extern "C" */
#endif /* defined(__cplusplus) */
#endif /* __BROWSEUI_UNDOC_H */

View file

@ -0,0 +1,84 @@
/*
* ReactOS undocumented shell interface
*
* Copyright 2009 Andrew Hill <ash77 at domain reactos.org>
* Copyright 2013 Dominik Hornung
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __COMCTL32_UNDOC__H
#define __COMCTL32_UNDOC__H
#ifdef __cplusplus
extern "C" {
#endif /* defined(__cplusplus) */
typedef struct tagCREATEMRULISTA
{
DWORD cbSize;
DWORD nMaxItems;
DWORD dwFlags;
HKEY hKey;
LPCSTR lpszSubKey;
PROC lpfnCompare;
} CREATEMRULISTA, *LPCREATEMRULISTA;
typedef struct tagCREATEMRULISTW
{
DWORD cbSize;
DWORD nMaxItems;
DWORD dwFlags;
HKEY hKey;
LPCWSTR lpszSubKey;
PROC lpfnCompare;
} CREATEMRULISTW, *LPCREATEMRULISTW;
#define MRU_STRING 0x0
#define MRU_BINARY 0x1
#define MRU_CACHEWRITE 0x2
HANDLE WINAPI CreateMRUListW(LPCREATEMRULISTW);
HANDLE WINAPI CreateMRUListA(LPCREATEMRULISTA);
INT WINAPI AddMRUData(HANDLE,LPCVOID,DWORD);
INT WINAPI FindMRUData(HANDLE,LPCVOID,DWORD,LPINT);
VOID WINAPI FreeMRUList(HANDLE);
INT WINAPI AddMRUStringW(HANDLE hList, LPCWSTR lpszString);
INT WINAPI AddMRUStringA(HANDLE hList, LPCSTR lpszString);
BOOL WINAPI DelMRUString(HANDLE hList, INT nItemPos);
INT WINAPI FindMRUStringW(HANDLE hList, LPCWSTR lpszString, LPINT lpRegNum);
INT WINAPI FindMRUStringA(HANDLE hList, LPCSTR lpszString, LPINT lpRegNum);
HANDLE WINAPI CreateMRUListLazyW(const CREATEMRULISTW *lpcml, DWORD dwParam2,
DWORD dwParam3, DWORD dwParam4);
HANDLE WINAPI CreateMRUListLazyA(const CREATEMRULISTA *lpcml, DWORD dwParam2,
DWORD dwParam3, DWORD dwParam4);
INT WINAPI EnumMRUListW(HANDLE hList, INT nItemPos, LPVOID lpBuffer,
DWORD nBufferSize);
INT WINAPI EnumMRUListA(HANDLE hList, INT nItemPos, LPVOID lpBuffer,
DWORD nBufferSize);
#ifdef UNICODE
typedef CREATEMRULISTW CREATEMRULIST, *PCREATEMRULIST;
#define CreateMRUList CreateMRUListW
#else
typedef CREATEMRULISTA CREATEMRULIST, *PCREATEMRULIST;
#define CreateMRUList CreateMRUListA
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif /* defined(__cplusplus) */
#endif // __COMCTL32_UNDOC__H

View file

@ -0,0 +1,397 @@
/*
* Copyright 1999, 2000 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __ROS_SHELL_UTILS_H
#define __ROS_SHELL_UTILS_H
#ifdef __cplusplus
extern "C" {
#endif /* defined(__cplusplus) */
#ifdef __cplusplus
# define IID_PPV_ARG(Itype, ppType) IID_##Itype, reinterpret_cast<void**>((static_cast<Itype**>(ppType)))
# define IID_NULL_PPV_ARG(Itype, ppType) IID_##Itype, NULL, reinterpret_cast<void**>((static_cast<Itype**>(ppType)))
#else
# define IID_PPV_ARG(Itype, ppType) IID_##Itype, (void**)(ppType)
# define IID_NULL_PPV_ARG(Itype, ppType) IID_##Itype, NULL, (void**)(ppType)
#endif
#if 1
#define FAILED_UNEXPECTEDLY(hr) (FAILED(hr) && (DbgPrint("Unexpected failure %08x.\n", hr), TRUE))
#else
#define FAILED_UNEXPECTEDLY(hr) FAILED(hr)
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif /* defined(__cplusplus) */
#ifdef __cplusplus
template <class Base>
class CComDebugObject : public Base
{
public:
CComDebugObject(void * = NULL)
{
#if DEBUG_CCOMOBJECT_CREATION
DbgPrint("%S, this=%08p\n", __FUNCTION__, static_cast<Base*>(this));
#endif
_pAtlModule->Lock();
}
virtual ~CComDebugObject()
{
this->FinalRelease();
_pAtlModule->Unlock();
}
STDMETHOD_(ULONG, AddRef)()
{
int rc = this->InternalAddRef();
#if DEBUG_CCOMOBJECT_REFCOUNTING
DbgPrint("%s, RefCount is now %d(--)! \n", __FUNCTION__, rc);
#endif
return rc;
}
STDMETHOD_(ULONG, Release)()
{
int rc = this->InternalRelease();
#if DEBUG_CCOMOBJECT_REFCOUNTING
DbgPrint("%s, RefCount is now %d(--)! \n", __FUNCTION__, rc);
#endif
if (rc == 0)
{
#if DEBUG_CCOMOBJECT_DESTRUCTION
DbgPrint("%s, RefCount reached 0 Deleting!\n", __FUNCTION__);
#endif
delete this;
}
return rc;
}
STDMETHOD(QueryInterface)(REFIID iid, void **ppvObject)
{
return this->_InternalQueryInterface(iid, ppvObject);
}
static HRESULT WINAPI CreateInstance(CComDebugObject<Base> **pp)
{
CComDebugObject<Base> *newInstance;
HRESULT hResult;
ATLASSERT(pp != NULL);
if (pp == NULL)
return E_POINTER;
hResult = E_OUTOFMEMORY;
newInstance = NULL;
ATLTRY(newInstance = new CComDebugObject<Base>());
if (newInstance != NULL)
{
newInstance->SetVoid(NULL);
newInstance->InternalFinalConstructAddRef();
hResult = newInstance->_AtlInitialConstruct();
if (SUCCEEDED(hResult))
hResult = newInstance->FinalConstruct();
if (SUCCEEDED(hResult))
hResult = newInstance->_AtlFinalConstruct();
newInstance->InternalFinalConstructRelease();
if (hResult != S_OK)
{
delete newInstance;
newInstance = NULL;
}
}
*pp = newInstance;
return hResult;
}
};
#ifdef DEBUG_CCOMOBJECT
# define _CComObject CComDebugObject
#else
# define _CComObject CComObject
#endif
template<class T>
void ReleaseCComPtrExpectZero(CComPtr<T>& cptr, BOOL forceRelease = FALSE)
{
if (cptr.p != NULL)
{
int nrc = cptr->Release();
if (nrc > 0)
{
DbgPrint("WARNING: Unexpected RefCount > 0 (%d)!\n", nrc);
if (forceRelease)
{
while (nrc > 0)
{
nrc = cptr->Release();
}
}
}
cptr.Detach();
}
}
template<class T, class R>
HRESULT inline ShellDebugObjectCreator(REFIID riid, R ** ppv)
{
CComPtr<T> obj;
HRESULT hResult;
if (ppv == NULL)
return E_POINTER;
*ppv = NULL;
ATLTRY(obj = new CComDebugObject<T>);
if (obj.p == NULL)
return E_OUTOFMEMORY;
hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(ppv));
if (FAILED(hResult))
return hResult;
return S_OK;
}
template<class T, class R>
HRESULT inline ShellObjectCreator(REFIID riid, R ** ppv)
{
CComPtr<T> obj;
HRESULT hResult;
if (ppv == NULL)
return E_POINTER;
*ppv = NULL;
ATLTRY(obj = new _CComObject<T>);
if (obj.p == NULL)
return E_OUTOFMEMORY;
hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(ppv));
if (FAILED(hResult))
return hResult;
return S_OK;
}
template<class T, class R>
HRESULT inline ShellObjectCreatorInit(REFIID riid, R ** ppv)
{
CComPtr<T> obj;
CComPtr<R> result;
HRESULT hResult;
if (ppv == NULL)
return E_POINTER;
*ppv = NULL;
ATLTRY(obj = new _CComObject<T>);
if (obj.p == NULL)
return E_OUTOFMEMORY;
hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result));
if (FAILED(hResult))
return hResult;
hResult = obj->Initialize();
if (FAILED(hResult))
return hResult;
*ppv = result.Detach();
return S_OK;
}
template<class T>
HRESULT inline ShellObjectCreatorInit(REFIID riid, void ** ppv)
{
CComPtr<T> obj;
CComPtr<IUnknown> result;
HRESULT hResult;
if (ppv == NULL)
return E_POINTER;
*ppv = NULL;
ATLTRY(obj = new _CComObject<T>);
if (obj.p == NULL)
return E_OUTOFMEMORY;
hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result));
if (FAILED(hResult))
return hResult;
hResult = obj->Initialize();
if (FAILED(hResult))
return hResult;
*ppv = result.Detach();
return S_OK;
}
template<class T, class T1>
HRESULT inline ShellObjectCreatorInit(T1 initArg1, REFIID riid, void ** ppv)
{
CComPtr<T> obj;
HRESULT hResult;
if (ppv == NULL)
return E_POINTER;
*ppv = NULL;
ATLTRY(obj = new _CComObject<T>);
if (obj.p == NULL)
return E_OUTOFMEMORY;
hResult = obj->QueryInterface(riid, ppv);
if (FAILED(hResult))
return hResult;
hResult = obj->Initialize(initArg1);
if (FAILED(hResult))
return hResult;
return S_OK;
}
template<class T, class T1, class R>
HRESULT inline ShellObjectCreatorInit(T1 initArg1, REFIID riid, R ** ppv)
{
CComPtr<T> obj;
CComPtr<R> result;
HRESULT hResult;
if (ppv == NULL)
return E_POINTER;
*ppv = NULL;
ATLTRY(obj = new _CComObject<T>);
if (obj.p == NULL)
return E_OUTOFMEMORY;
hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result));
if (FAILED(hResult))
return hResult;
hResult = obj->Initialize(initArg1);
if (FAILED(hResult))
return hResult;
*ppv = result.Detach();
return S_OK;
}
template<class T, class T1, class T2, class R>
HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, REFIID riid, R ** ppv)
{
CComPtr<T> obj;
CComPtr<R> result;
HRESULT hResult;
if (ppv == NULL)
return E_POINTER;
*ppv = NULL;
ATLTRY(obj = new _CComObject<T>);
if (obj.p == NULL)
return E_OUTOFMEMORY;
hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result));
if (FAILED(hResult))
return hResult;
hResult = obj->Initialize(initArg1, initArg2);
if (FAILED(hResult))
return hResult;
*ppv = result.Detach();
return S_OK;
}
template<class T, class T1, class T2, class T3, class R>
HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, REFIID riid, R ** ppv)
{
CComPtr<T> obj;
CComPtr<R> result;
HRESULT hResult;
if (ppv == NULL)
return E_POINTER;
*ppv = NULL;
ATLTRY(obj = new _CComObject<T>);
if (obj.p == NULL)
return E_OUTOFMEMORY;
hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result));
if (FAILED(hResult))
return hResult;
hResult = obj->Initialize(initArg1, initArg2, initArg3);
if (FAILED(hResult))
return hResult;
*ppv = result.Detach();
return S_OK;
}
template<class T, class T1, class T2, class T3, class T4, class R>
HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, T4 initArg4, REFIID riid, R ** ppv)
{
CComPtr<T> obj;
CComPtr<R> result;
HRESULT hResult;
if (ppv == NULL)
return E_POINTER;
*ppv = NULL;
ATLTRY(obj = new _CComObject<T>);
if (obj.p == NULL)
return E_OUTOFMEMORY;
hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result));
if (FAILED(hResult))
return hResult;
hResult = obj->Initialize(initArg1, initArg2, initArg3, initArg4);
if (FAILED(hResult))
return hResult;
*ppv = result.Detach();
return S_OK;
}
template<class T, class T1, class T2, class T3, class T4, class T5, class R>
HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, T4 initArg4, T5 initArg5, REFIID riid, R ** ppv)
{
CComPtr<T> obj;
CComPtr<R> result;
HRESULT hResult;
if (ppv == NULL)
return E_POINTER;
*ppv = NULL;
ATLTRY(obj = new _CComObject<T>);
if (obj.p == NULL)
return E_OUTOFMEMORY;
hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result));
if (FAILED(hResult))
return hResult;
hResult = obj->Initialize(initArg1, initArg2, initArg3, initArg4, initArg5);
if (FAILED(hResult))
return hResult;
*ppv = result.Detach();
return S_OK;
}
#endif /* __cplusplus */
#endif /* __ROS_SHELL_UTILS_H */

View file

@ -26,14 +26,6 @@
extern "C" {
#endif /* defined(__cplusplus) */
#ifdef __cplusplus
# define IID_PPV_ARG(Itype, ppType) IID_##Itype, reinterpret_cast<void**>((static_cast<Itype**>(ppType)))
# define IID_NULL_PPV_ARG(Itype, ppType) IID_##Itype, NULL, reinterpret_cast<void**>((static_cast<Itype**>(ppType)))
#else
# define IID_PPV_ARG(Itype, ppType) IID_##Itype, (void**)(ppType)
# define IID_NULL_PPV_ARG(Itype, ppType) IID_##Itype, NULL, (void**)(ppType)
#endif
/*****************************************************************************
* New shellstate structure
*/
@ -717,353 +709,9 @@ DECLARE_INTERFACE_(ITrayPriv, IUnknown)
#define ITrayPriv_AppendMenu(T,a) (T)->lpVtbl->AppendMenu(T,a)
#endif
/*****************************************************************************
* Shell32 resources
*/
// these resources are in shell32.dll
#define IDB_GOBUTTON_NORMAL 0x0e6
#define IDB_GOBUTTON_HOT 0x0e7
// band ids in internet toolbar
#define ITBBID_MENUBAND 1
#define ITBBID_BRANDBAND 5
#define ITBBID_TOOLSBAND 2
#define ITBBID_ADDRESSBAND 4
// commands in the CGID_PrivCITCommands command group handled by the internet toolbar
// there seems to be some support for hiding the menubar and an auto hide feature that are
// unavailable in the UI
#define ITID_TEXTLABELS 3
#define ITID_TOOLBARBANDSHOWN 4
#define ITID_ADDRESSBANDSHOWN 5
#define ITID_LINKSBANDSHOWN 6
#define ITID_MENUBANDSHOWN 12
#define ITID_AUTOHIDEENABLED 13
#define ITID_CUSTOMIZEENABLED 20
#define ITID_TOOLBARLOCKED 27
// commands in the CGID_BrandCmdGroup command group handled by the brand band
#define BBID_STARTANIMATION 1
#define BBID_STOPANIMATION 2
// undocumented flags for IShellMenu::SetShellFolder
#define SMSET_UNKNOWN08 0x08
#define SMSET_UNKNOWN10 0x10
BOOL WINAPI ILGetDisplayNameEx(IShellFolder *psf, LPCITEMIDLIST pidl, LPVOID path, DWORD type);
/* type parameter for ILGetDisplayNameEx() */
#define ILGDN_FORPARSING 0
#define ILGDN_NORMAL 1
#define ILGDN_INFOLDER 2
BOOL WINAPI FileIconInit(BOOL bFullInit);
void WINAPI ShellDDEInit(BOOL bInit);
DWORD WINAPI WinList_Init(void);
HANDLE WINAPI SHCreateDesktop(IShellDesktopTray*);
BOOL WINAPI SHDesktopMessageLoop(HANDLE);
#define WM_GETISHELLBROWSER (WM_USER+7)
BOOL WINAPI SetShellWindow(HWND);
BOOL WINAPI SetShellWindowEx(HWND, HWND);
BOOL WINAPI RegisterShellHook(HWND, DWORD);
IStream* WINAPI SHGetViewStream(LPCITEMIDLIST, DWORD, LPCTSTR, LPCTSTR, LPCTSTR);
BOOL WINAPI SHIsEmptyStream(IStream*);
typedef struct tagCREATEMRULISTA
{
DWORD cbSize;
DWORD nMaxItems;
DWORD dwFlags;
HKEY hKey;
LPCSTR lpszSubKey;
PROC lpfnCompare;
} CREATEMRULISTA, *LPCREATEMRULISTA;
typedef struct tagCREATEMRULISTW
{
DWORD cbSize;
DWORD nMaxItems;
DWORD dwFlags;
HKEY hKey;
LPCWSTR lpszSubKey;
PROC lpfnCompare;
} CREATEMRULISTW, *LPCREATEMRULISTW;
#define MRU_STRING 0x0
#define MRU_BINARY 0x1
#define MRU_CACHEWRITE 0x2
HANDLE WINAPI CreateMRUListW(LPCREATEMRULISTW);
HANDLE WINAPI CreateMRUListA(LPCREATEMRULISTA);
INT WINAPI AddMRUData(HANDLE,LPCVOID,DWORD);
INT WINAPI FindMRUData(HANDLE,LPCVOID,DWORD,LPINT);
VOID WINAPI FreeMRUList(HANDLE);
INT WINAPI AddMRUStringW(HANDLE hList, LPCWSTR lpszString);
INT WINAPI AddMRUStringA(HANDLE hList, LPCSTR lpszString);
BOOL WINAPI DelMRUString(HANDLE hList, INT nItemPos);
INT WINAPI FindMRUStringW(HANDLE hList, LPCWSTR lpszString, LPINT lpRegNum);
INT WINAPI FindMRUStringA(HANDLE hList, LPCSTR lpszString, LPINT lpRegNum);
HANDLE WINAPI CreateMRUListLazyW(const CREATEMRULISTW *lpcml, DWORD dwParam2,
DWORD dwParam3, DWORD dwParam4);
HANDLE WINAPI CreateMRUListLazyA(const CREATEMRULISTA *lpcml, DWORD dwParam2,
DWORD dwParam3, DWORD dwParam4);
INT WINAPI EnumMRUListW(HANDLE hList, INT nItemPos, LPVOID lpBuffer,
DWORD nBufferSize);
INT WINAPI EnumMRUListA(HANDLE hList, INT nItemPos, LPVOID lpBuffer,
DWORD nBufferSize);
#define DC_NOSENDMSG 0x2000
BOOL WINAPI DrawCaptionTempA(HWND,HDC,const RECT*,HFONT,HICON,LPCSTR,UINT);
BOOL WINAPI DrawCaptionTempW(HWND,HDC,const RECT*,HFONT,HICON,LPCWSTR,UINT);
#ifdef UNICODE
typedef CREATEMRULISTW CREATEMRULIST, *PCREATEMRULIST;
#define CreateMRUList CreateMRUListW
#define DrawCaptionTemp DrawCaptionTempW
#else
typedef CREATEMRULISTA CREATEMRULIST, *PCREATEMRULIST;
#define CreateMRUList CreateMRUListA
#define DrawCaptionTemp DrawCaptionTempA
#endif
HRESULT WINAPI SHInvokeDefaultCommand(HWND,IShellFolder*,LPCITEMIDLIST);
HRESULT WINAPI SHPropertyBag_ReadPOINTL(IPropertyBag*,LPCWSTR,POINTL*);
HRESULT WINAPI SHGetPerScreenResName(OUT LPWSTR lpResName,
IN INT cchResName,
IN DWORD dwReserved);
HRESULT WINAPI SHPropertyBag_ReadStream(IPropertyBag*,LPCWSTR,IStream**);
HWND WINAPI SHCreateWorkerWindowA(LONG wndProc, HWND hWndParent, DWORD dwExStyle,
DWORD dwStyle, HMENU hMenu, LONG z);
HWND WINAPI SHCreateWorkerWindowW(LONG wndProc, HWND hWndParent, DWORD dwExStyle,
DWORD dwStyle, HMENU hMenu, LONG z);
#ifdef UNICODE
#define SHCreateWorkerWindow SHCreateWorkerWindowW
#else
#define SHCreateWorkerWindow SHCreateWorkerWindowA
#endif
/*****************************************************************************
* Shell Link
*/
#include <pshpack1.h>
typedef struct tagSHELL_LINK_HEADER
{
/* The size of this structure (always 0x0000004C) */
DWORD dwSize;
/* CLSID = class identifier (always 00021401-0000-0000-C000-000000000046) */
CLSID clsid;
/* Flags (SHELL_LINK_DATA_FLAGS) */
DWORD dwFlags;
/* Informations about the link target: */
DWORD dwFileAttributes;
FILETIME ftCreationTime;
FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime;
DWORD nFileSizeLow; /* only the least significant 32 bits */
/* The index of an icon (signed?) */
DWORD nIconIndex;
/* The expected window state of an application launched by the link */
DWORD nShowCommand;
/* The keystrokes used to launch the application */
WORD wHotKey;
/* Reserved (must be zero) */
WORD wReserved1;
DWORD dwReserved2;
DWORD dwReserved3;
} SHELL_LINK_HEADER, *LPSHELL_LINK_HEADER;
/*****************************************************************************
* SHELL_LINK_INFOA/W
* If cbHeaderSize == 0x0000001C then use SHELL_LINK_INFOA
* If cbHeaderSize >= 0x00000024 then use SHELL_LINK_INFOW
*/
typedef struct tagSHELL_LINK_INFOA
{
/* Size of the link info data */
DWORD cbSize;
/* Size of this structure (ANSI: = 0x0000001C) */
DWORD cbHeaderSize;
/* Specifies which fields are present/populated (SLI_*) */
DWORD dwFlags;
/* Offset of the VolumeID field (SHELL_LINK_INFO_VOLUME_ID) */
DWORD cbVolumeIDOffset;
/* Offset of the LocalBasePath field (ANSI, NULL-terminated string) */
DWORD cbLocalBasePathOffset;
/* Offset of the CommonNetworkRelativeLink field (SHELL_LINK_INFO_CNR_LINK) */
DWORD cbCommonNetworkRelativeLinkOffset;
/* Offset of the CommonPathSuffix field (ANSI, NULL-terminated string) */
DWORD cbCommonPathSuffixOffset;
} SHELL_LINK_INFOA, *LPSHELL_LINK_INFOA;
typedef struct tagSHELL_LINK_INFOW
{
/* Size of the link info data */
DWORD cbSize;
/* Size of this structure (Unicode: >= 0x00000024) */
DWORD cbHeaderSize;
/* Specifies which fields are present/populated (SLI_*) */
DWORD dwFlags;
/* Offset of the VolumeID field (SHELL_LINK_INFO_VOLUME_ID) */
DWORD cbVolumeIDOffset;
/* Offset of the LocalBasePath field (ANSI, NULL-terminated string) */
DWORD cbLocalBasePathOffset;
/* Offset of the CommonNetworkRelativeLink field (SHELL_LINK_INFO_CNR_LINK) */
DWORD cbCommonNetworkRelativeLinkOffset;
/* Offset of the CommonPathSuffix field (ANSI, NULL-terminated string) */
DWORD cbCommonPathSuffixOffset;
/* Offset of the LocalBasePathUnicode field (Unicode, NULL-terminated string) */
DWORD cbLocalBasePathUnicodeOffset;
/* Offset of the CommonPathSuffixUnicode field (Unicode, NULL-terminated string) */
DWORD cbCommonPathSuffixUnicodeOffset;
} SHELL_LINK_INFOW, *LPSHELL_LINK_INFOW;
/* VolumeID, LocalBasePath, LocalBasePathUnicode(cbHeaderSize >= 0x24) are present */
#define SLI_VALID_LOCAL 0x00000001
/* CommonNetworkRelativeLink is present */
#define SLI_VALID_NETWORK 0x00000002
/*****************************************************************************
* SHELL_LINK_INFO_VOLUME_IDA/W
* If cbVolumeLabelOffset != 0x00000014 (should be 0x00000010) then use
* SHELL_LINK_INFO_VOLUME_IDA
* If cbVolumeLabelOffset == 0x00000014 then use SHELL_LINK_INFO_VOLUME_IDW
*/
typedef struct tagSHELL_LINK_INFO_VOLUME_IDA
{
/* Size of the VolumeID field (> 0x00000010) */
DWORD cbSize;
/* Drive type of the drive the link target is stored on (DRIVE_*) */
DWORD dwDriveType;
/* Serial number of the volume the link target is stored on */
DWORD nDriveSerialNumber;
/* Offset of the volume label (ANSI, NULL-terminated string).
Must be != 0x00000014 (see tagSHELL_LINK_INFO_VOLUME_IDW) */
DWORD cbVolumeLabelOffset;
} SHELL_LINK_INFO_VOLUME_IDA, *LPSHELL_LINK_INFO_VOLUME_IDA;
typedef struct tagSHELL_LINK_INFO_VOLUME_IDW
{
/* Size of the VolumeID field (> 0x00000010) */
DWORD cbSize;
/* Drive type of the drive the link target is stored on (DRIVE_*) */
DWORD dwDriveType;
/* Serial number of the volume the link target is stored on */
DWORD nDriveSerialNumber;
/* Offset of the volume label (ANSI, NULL-terminated string).
If the value of this field is 0x00000014, ignore it and use
cbVolumeLabelUnicodeOffset! */
DWORD cbVolumeLabelOffset;
/* Offset of the volume label (Unicode, NULL-terminated string).
If the value of the VolumeLabelOffset field is not 0x00000014,
this field must be ignored (==> it doesn't exists ==> ANSI). */
DWORD cbVolumeLabelUnicodeOffset;
} SHELL_LINK_INFO_VOLUME_IDW, *LPSHELL_LINK_INFO_VOLUME_IDW;
/*****************************************************************************
* SHELL_LINK_INFO_CNR_LINKA/W (CNR = Common Network Relative)
* If cbNetNameOffset == 0x00000014 then use SHELL_LINK_INFO_CNR_LINKA
* If cbNetNameOffset > 0x00000014 then use SHELL_LINK_INFO_CNR_LINKW
*/
typedef struct tagSHELL_LINK_INFO_CNR_LINKA
{
/* Size of the CommonNetworkRelativeLink field (>= 0x00000014) */
DWORD cbSize;
/* Specifies which fields are present/populated (SLI_CNR_*) */
DWORD dwFlags;
/* Offset of the NetName field (ANSI, NULLterminated string) */
DWORD cbNetNameOffset;
/* Offset of the DeviceName field (ANSI, NULLterminated string) */
DWORD cbDeviceNameOffset;
/* Type of the network provider (WNNC_NET_* defined in winnetwk.h) */
DWORD dwNetworkProviderType;
} SHELL_LINK_INFO_CNR_LINKA, *LPSHELL_LINK_INFO_CNR_LINKA;
typedef struct tagSHELL_LINK_INFO_CNR_LINKW
{
/* Size of the CommonNetworkRelativeLink field (>= 0x00000014) */
DWORD cbSize;
/* Specifies which fields are present/populated (SLI_CNR_*) */
DWORD dwFlags;
/* Offset of the NetName field (ANSI, NULLterminated string) */
DWORD cbNetNameOffset;
/* Offset of the DeviceName field (ANSI, NULLterminated string) */
DWORD cbDeviceNameOffset;
/* Type of the network provider (WNNC_NET_* defined in winnetwk.h) */
DWORD dwNetworkProviderType;
/* Offset of the NetNameUnicode field (Unicode, NULLterminated string) */
DWORD cbNetNameUnicodeOffset;
/* Offset of the DeviceNameUnicode field (Unicode, NULLterminated string) */
DWORD cbDeviceNameUnicodeOffset;
} SHELL_LINK_INFO_CNR_LINKW, *LPSHELL_LINK_INFO_CNR_LINKW;
/* DeviceName is present */
#define SLI_CNR_VALID_DEVICE 0x00000001
/* NetworkProviderType is present */
#define SLI_CNR_VALID_NET_TYPE 0x00000002
/*****************************************************************************
* Shell Link Extra Data (IShellLinkDataList)
*/
typedef struct tagEXP_TRACKER
{
/* .cbSize = 0x00000060, .dwSignature = 0xa0000003 */
DATABLOCK_HEADER dbh;
/* Length >= 0x00000058 */
DWORD nLength;
/* Must be 0x00000000 */
DWORD nVersion;
/* NetBIOS name (ANSI, unused bytes are set to zero) */
CHAR szMachineID[16]; /* "variable" >= 16 (?) */
/* Some GUIDs for the Link Tracking service (from the FS?) */
GUID guidDroidVolume;
GUID guidDroidObject;
GUID guidDroidBirthVolume;
GUID guidDroidBirthObject;
} EXP_TRACKER, *LPEXP_TRACKER;
typedef struct tagEXP_SHIM
{
/* .cbSize >= 0x00000088, .dwSignature = 0xa0000008 */
DATABLOCK_HEADER dbh;
/* Name of a shim layer to apply (Unicode, unused bytes are set to zero) */
WCHAR szwLayerName[64]; /* "variable" >= 64 */
} EXP_SHIM, *LPEXP_SHIM;
typedef struct tagEXP_KNOWN_FOLDER
{
/* .cbSize = 0x0000001c, .dwSignature = 0xa000000b */
DATABLOCK_HEADER dbh;
/* A GUID value that identifies a known folder */
GUID guidKnownFolder;
/* Specifies the location of the ItemID of the first child
segment of the IDList specified by guidKnownFolder */
DWORD cbOffset;
} EXP_KNOWN_FOLDER, *LPEXP_KNOWN_FOLDER;
typedef struct tagEXP_VISTA_ID_LIST
{
/* .cbSize >= 0x0000000a, .dwSignature = 0xa000000c */
DATABLOCK_HEADER dbh;
/* Specifies an alternate IDList that can be used instead
of the "normal" IDList (SLDF_HAS_ID_LIST) */
/* LPITEMIDLIST pIDList; (variable) */
} EXP_VISTA_ID_LIST, *LPEXP_VISTA_ID_LIST;
#define EXP_TRACKER_SIG 0xa0000003
#define EXP_SHIM_SIG 0xa0000008
#define EXP_KNOWN_FOLDER_SIG 0xa000000b
#define EXP_VISTA_ID_LIST_SIG 0xa000000c
#include <poppack.h>
#ifdef __cplusplus
} /* extern "C" */
#endif /* defined(__cplusplus) */

View file

@ -25,84 +25,6 @@
extern "C" {
#endif /* defined(__cplusplus) */
typedef struct IEThreadParamBlock
{
long offset0;
DWORD dwFlags;
long offset8;
IUnknown * offsetC;
long offset10;
IUnknown * offset14;
LPITEMIDLIST directoryPIDL; // 0x18
char offset1C[0x70-0x1C]; // unknown contents -- 0x1C..0x6c
IUnknown * offset70;
long offset74; // unknown contents
IUnknown * offset78;
LPITEMIDLIST offset7C;
LPITEMIDLIST offset80;
LONG offset84;
LONG offset88;
LONG offset8C;
LONG offset90;
LONG offset94;
LONG offset98;
LONG offset9C;
LONG offsetA0;
char offsetA4[0xD8-0xA4]; // unknown contents -- 0xA4..0xD8
LONG offsetD8;
char offsetDC[0xF8-0xDC]; // unknown contents -- 0xDC..0xF8
IUnknown * offsetF8; // instance explorer
LONG offsetFC; // unknown contents
} IE_THREAD_PARAM_BLOCK, *PIE_THREAD_PARAM_BLOCK;
typedef struct ExplorerCommandLineParseResults
{
LPWSTR strPath;
LPITEMIDLIST pidlPath;
DWORD dwFlags;
DWORD offsetC;
DWORD offset10;
DWORD offset14;
DWORD offset18;
DWORD offset1C;
LPITEMIDLIST pidlRoot;
DWORD offset24;
DWORD offset28;
DWORD offset2C;
DWORD offset30;
GUID guidInproc;
} EXPLORER_CMDLINE_PARSE_RESULTS, *PEXPLORER_CMDLINE_PARSE_RESULTS;
#define SH_EXPLORER_CMDLINE_FLAG_ONE 0x00000001
#define SH_EXPLORER_CMDLINE_FLAG_S 0x00000002
// unknown/unused 0x00000004
#define SH_EXPLORER_CMDLINE_FLAG_E 0x00000008
// unknown/unused 0x00000010
// unknown/unused 0x00000020
#define SH_EXPLORER_CMDLINE_FLAG_SELECT 0x00000040
#define SH_EXPLORER_CMDLINE_FLAG_EMBED 0x00000080
// unknown/unused 0x00000100
#define SH_EXPLORER_CMDLINE_FLAG_IDLIST 0x00000200
#define SH_EXPLORER_CMDLINE_FLAG_INPROC 0x00000400
// unknown/unused 0x00000800
#define SH_EXPLORER_CMDLINE_FLAG_NOUI 0x00001000
// unknown/unused 0x00002000
#define SH_EXPLORER_CMDLINE_FLAG_N 0x00004000
// unknown/unused 0x00008000
// unknown/unused 0x00010000
#define SH_EXPLORER_CMDLINE_FLAG_SEPARATE 0x00020000
// unknown/unused 0x00040000
// unknown/unused 0x00080000
// unknown/unused 0x00100000
// unknown/unused 0x00200000
// unknown/unused 0x00400000
// unknown/unused 0x00800000
// unknown/unused 0x01000000
#define SH_EXPLORER_CMDLINE_FLAG_STRING 0x02000000
#define WM_EXPLORER_OPEN_NEW_WINDOW (WM_USER+11)
#define WM_EXPLORER_1037 (WM_USER+13)
BOOL WINAPI SHAboutInfoA(LPSTR lpszDest, DWORD dwDestLen);
BOOL WINAPI SHAboutInfoW(LPWSTR lpszDest, DWORD dwDestLen);
HRESULT WINAPI IUnknown_QueryStatus(IUnknown *lpUnknown, REFGUID pguidCmdGroup, ULONG cCmds, OLECMD *prgCmds, OLECMDTEXT* pCmdText);
@ -140,31 +62,27 @@ HRESULT WINAPI MayExecForward(IUnknown* lpUnknown, INT iUnk, REFGUID pguidCmdGro
HRESULT WINAPI IsQSForward(REFGUID pguidCmdGroup,ULONG cCmds, OLECMD *prgCmds);
BOOL WINAPI SHIsChildOrSelf(HWND hParent, HWND hChild);
void WINAPI InitOCHostClass(long param8);
long WINAPI SHOpenFolderWindow(PIE_THREAD_PARAM_BLOCK parameters);
void WINAPI SHCreateSavedWindows(void);
BOOL WINAPI SHCreateFromDesktop(PEXPLORER_CMDLINE_PARSE_RESULTS parseResults);
UINT WINAPI SHExplorerParseCmdLine(PEXPLORER_CMDLINE_PARSE_RESULTS pParseResults);
void WINAPI UEMRegisterNotify(long param8, long paramC);
HRESULT WINAPI SHCreateBandForPidl(LPCITEMIDLIST param8, IUnknown *paramC, BOOL param10);
HRESULT WINAPI SHPidlFromDataObject(IDataObject *param8, long *paramC, long param10, FILEDESCRIPTORW *param14);
long WINAPI IDataObject_GetDeskBandState(long param8);
PIE_THREAD_PARAM_BLOCK WINAPI SHCreateIETHREADPARAM(long param8, long paramC, IUnknown *param10, IUnknown *param14);
PIE_THREAD_PARAM_BLOCK WINAPI SHCloneIETHREADPARAM(PIE_THREAD_PARAM_BLOCK param);
long WINAPI SHParseIECommandLine(long param8, long paramC);
void WINAPI SHDestroyIETHREADPARAM(PIE_THREAD_PARAM_BLOCK param);
BOOL WINAPI SHOnCWMCommandLine(HANDLE hSharedInfo);
LPITEMIDLIST WINAPI Channel_GetFolderPidl(void);
IUnknown *WINAPI ChannelBand_Create(LPITEMIDLIST pidl);
HRESULT WINAPI Channels_SetBandInfoSFB(IUnknown *param8);
HRESULT WINAPI IUnknown_SetBandInfoSFB(IUnknown *param8, long paramC);
HRESULT WINAPI Channel_QuickLaunch(void);
HRESULT WINAPI SHGetNavigateTarget(long param8, long paramC, long param10, long param14);
HRESULT WINAPI GetInfoTip(IUnknown *param8, long paramC, LPTSTR *param10, long cchMax);
HRESULT WINAPI SHEnumClassesOfCategories(long param8, long paramC, long param10, long param14, long param18);
HRESULT WINAPI SHWriteClassesOfCategories(long param8, long paramC, long param10, long param14, long param18, long param1C, long param20);
BOOL WINAPI SHIsExplorerBrowser();
HRESULT WINAPI SHOpenNewFrame(LPITEMIDLIST pidl, IUnknown *paramC, long param10, DWORD dwFlags);
BOOL WINAPI SHIsEmptyStream(IStream*);
HRESULT WINAPI SHInvokeDefaultCommand(HWND,IShellFolder*,LPCITEMIDLIST);
HRESULT WINAPI SHPropertyBag_ReadPOINTL(IPropertyBag*,LPCWSTR,POINTL*);
HRESULT WINAPI SHGetPerScreenResName(OUT LPWSTR lpResName,
IN INT cchResName,
IN DWORD dwReserved);
HRESULT WINAPI SHPropertyBag_ReadStream(IPropertyBag*,LPCWSTR,IStream**);
HWND WINAPI SHCreateWorkerWindowA(LONG wndProc, HWND hWndParent, DWORD dwExStyle,
DWORD dwStyle, HMENU hMenu, LONG z);
HWND WINAPI SHCreateWorkerWindowW(LONG wndProc, HWND hWndParent, DWORD dwExStyle,
DWORD dwStyle, HMENU hMenu, LONG z);
#ifdef UNICODE
#define SHCreateWorkerWindow SHCreateWorkerWindowW
#else
#define SHCreateWorkerWindow SHCreateWorkerWindowA
#endif
#ifdef __cplusplus
} /* extern "C" */

View file

@ -141,6 +141,8 @@ DWORD WINAPI SHNetConnectionDialog(
#define CWM_STATECHANGE (WM_USER + 10)
#define CWM_GETPATH (WM_USER + 12)
#define WM_GETISHELLBROWSER CWM_GETISHELLBROWSER
/* CWM_TESTPATH types */
#define CWTP_ISEQUAL 0
#define CWTP_ISCHILD 1
@ -522,12 +524,6 @@ DWORD WINAPI CheckEscapesW(LPWSTR string, DWORD len);
/* policy functions */
BOOL WINAPI SHInitRestricted(LPCVOID unused, LPCVOID inpRegKey);
/* Shell Desktop functions */
#define WM_GETISHELLBROWSER (WM_USER+7)
BOOL WINAPI SHDesktopMessageLoop(HANDLE);
#define CSIDL_FOLDER_MASK 0x00ff
/* Utility functions */
@ -614,367 +610,262 @@ static __inline void DbgDumpMenu(HMENU hmenu)
DbgDumpMenuInternal(hmenu, padding, 0);
}
#if 1
#define FAILED_UNEXPECTEDLY(hr) (FAILED(hr) && (DbgPrint("Unexpected failure %08x.\n", hr), TRUE))
#else
#define FAILED_UNEXPECTEDLY(hr) FAILED(hr)
#endif
/*****************************************************************************
* Shell32 resources
*/
// these resources are in shell32.dll
#define IDB_GOBUTTON_NORMAL 0x0e6
#define IDB_GOBUTTON_HOT 0x0e7
// band ids in internet toolbar
#define ITBBID_MENUBAND 1
#define ITBBID_BRANDBAND 5
#define ITBBID_TOOLSBAND 2
#define ITBBID_ADDRESSBAND 4
// commands in the CGID_PrivCITCommands command group handled by the internet toolbar
// there seems to be some support for hiding the menubar and an auto hide feature that are
// unavailable in the UI
#define ITID_TEXTLABELS 3
#define ITID_TOOLBARBANDSHOWN 4
#define ITID_ADDRESSBANDSHOWN 5
#define ITID_LINKSBANDSHOWN 6
#define ITID_MENUBANDSHOWN 12
#define ITID_AUTOHIDEENABLED 13
#define ITID_CUSTOMIZEENABLED 20
#define ITID_TOOLBARLOCKED 27
// commands in the CGID_BrandCmdGroup command group handled by the brand band
#define BBID_STARTANIMATION 1
#define BBID_STOPANIMATION 2
// undocumented flags for IShellMenu::SetShellFolder
#define SMSET_UNKNOWN08 0x08
#define SMSET_UNKNOWN10 0x10
void WINAPI ShellDDEInit(BOOL bInit);
DWORD WINAPI WinList_Init(void);
IStream* WINAPI SHGetViewStream(LPCITEMIDLIST, DWORD, LPCTSTR, LPCTSTR, LPCTSTR);
/*****************************************************************************
* Shell Link
*/
#include <pshpack1.h>
typedef struct tagSHELL_LINK_HEADER
{
/* The size of this structure (always 0x0000004C) */
DWORD dwSize;
/* CLSID = class identifier (always 00021401-0000-0000-C000-000000000046) */
CLSID clsid;
/* Flags (SHELL_LINK_DATA_FLAGS) */
DWORD dwFlags;
/* Informations about the link target: */
DWORD dwFileAttributes;
FILETIME ftCreationTime;
FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime;
DWORD nFileSizeLow; /* only the least significant 32 bits */
/* The index of an icon (signed?) */
DWORD nIconIndex;
/* The expected window state of an application launched by the link */
DWORD nShowCommand;
/* The keystrokes used to launch the application */
WORD wHotKey;
/* Reserved (must be zero) */
WORD wReserved1;
DWORD dwReserved2;
DWORD dwReserved3;
} SHELL_LINK_HEADER, *LPSHELL_LINK_HEADER;
/*****************************************************************************
* SHELL_LINK_INFOA/W
* If cbHeaderSize == 0x0000001C then use SHELL_LINK_INFOA
* If cbHeaderSize >= 0x00000024 then use SHELL_LINK_INFOW
*/
typedef struct tagSHELL_LINK_INFOA
{
/* Size of the link info data */
DWORD cbSize;
/* Size of this structure (ANSI: = 0x0000001C) */
DWORD cbHeaderSize;
/* Specifies which fields are present/populated (SLI_*) */
DWORD dwFlags;
/* Offset of the VolumeID field (SHELL_LINK_INFO_VOLUME_ID) */
DWORD cbVolumeIDOffset;
/* Offset of the LocalBasePath field (ANSI, NULL-terminated string) */
DWORD cbLocalBasePathOffset;
/* Offset of the CommonNetworkRelativeLink field (SHELL_LINK_INFO_CNR_LINK) */
DWORD cbCommonNetworkRelativeLinkOffset;
/* Offset of the CommonPathSuffix field (ANSI, NULL-terminated string) */
DWORD cbCommonPathSuffixOffset;
} SHELL_LINK_INFOA, *LPSHELL_LINK_INFOA;
typedef struct tagSHELL_LINK_INFOW
{
/* Size of the link info data */
DWORD cbSize;
/* Size of this structure (Unicode: >= 0x00000024) */
DWORD cbHeaderSize;
/* Specifies which fields are present/populated (SLI_*) */
DWORD dwFlags;
/* Offset of the VolumeID field (SHELL_LINK_INFO_VOLUME_ID) */
DWORD cbVolumeIDOffset;
/* Offset of the LocalBasePath field (ANSI, NULL-terminated string) */
DWORD cbLocalBasePathOffset;
/* Offset of the CommonNetworkRelativeLink field (SHELL_LINK_INFO_CNR_LINK) */
DWORD cbCommonNetworkRelativeLinkOffset;
/* Offset of the CommonPathSuffix field (ANSI, NULL-terminated string) */
DWORD cbCommonPathSuffixOffset;
/* Offset of the LocalBasePathUnicode field (Unicode, NULL-terminated string) */
DWORD cbLocalBasePathUnicodeOffset;
/* Offset of the CommonPathSuffixUnicode field (Unicode, NULL-terminated string) */
DWORD cbCommonPathSuffixUnicodeOffset;
} SHELL_LINK_INFOW, *LPSHELL_LINK_INFOW;
/* VolumeID, LocalBasePath, LocalBasePathUnicode(cbHeaderSize >= 0x24) are present */
#define SLI_VALID_LOCAL 0x00000001
/* CommonNetworkRelativeLink is present */
#define SLI_VALID_NETWORK 0x00000002
/*****************************************************************************
* SHELL_LINK_INFO_VOLUME_IDA/W
* If cbVolumeLabelOffset != 0x00000014 (should be 0x00000010) then use
* SHELL_LINK_INFO_VOLUME_IDA
* If cbVolumeLabelOffset == 0x00000014 then use SHELL_LINK_INFO_VOLUME_IDW
*/
typedef struct tagSHELL_LINK_INFO_VOLUME_IDA
{
/* Size of the VolumeID field (> 0x00000010) */
DWORD cbSize;
/* Drive type of the drive the link target is stored on (DRIVE_*) */
DWORD dwDriveType;
/* Serial number of the volume the link target is stored on */
DWORD nDriveSerialNumber;
/* Offset of the volume label (ANSI, NULL-terminated string).
Must be != 0x00000014 (see tagSHELL_LINK_INFO_VOLUME_IDW) */
DWORD cbVolumeLabelOffset;
} SHELL_LINK_INFO_VOLUME_IDA, *LPSHELL_LINK_INFO_VOLUME_IDA;
typedef struct tagSHELL_LINK_INFO_VOLUME_IDW
{
/* Size of the VolumeID field (> 0x00000010) */
DWORD cbSize;
/* Drive type of the drive the link target is stored on (DRIVE_*) */
DWORD dwDriveType;
/* Serial number of the volume the link target is stored on */
DWORD nDriveSerialNumber;
/* Offset of the volume label (ANSI, NULL-terminated string).
If the value of this field is 0x00000014, ignore it and use
cbVolumeLabelUnicodeOffset! */
DWORD cbVolumeLabelOffset;
/* Offset of the volume label (Unicode, NULL-terminated string).
If the value of the VolumeLabelOffset field is not 0x00000014,
this field must be ignored (==> it doesn't exists ==> ANSI). */
DWORD cbVolumeLabelUnicodeOffset;
} SHELL_LINK_INFO_VOLUME_IDW, *LPSHELL_LINK_INFO_VOLUME_IDW;
/*****************************************************************************
* SHELL_LINK_INFO_CNR_LINKA/W (CNR = Common Network Relative)
* If cbNetNameOffset == 0x00000014 then use SHELL_LINK_INFO_CNR_LINKA
* If cbNetNameOffset > 0x00000014 then use SHELL_LINK_INFO_CNR_LINKW
*/
typedef struct tagSHELL_LINK_INFO_CNR_LINKA
{
/* Size of the CommonNetworkRelativeLink field (>= 0x00000014) */
DWORD cbSize;
/* Specifies which fields are present/populated (SLI_CNR_*) */
DWORD dwFlags;
/* Offset of the NetName field (ANSI, NULLterminated string) */
DWORD cbNetNameOffset;
/* Offset of the DeviceName field (ANSI, NULLterminated string) */
DWORD cbDeviceNameOffset;
/* Type of the network provider (WNNC_NET_* defined in winnetwk.h) */
DWORD dwNetworkProviderType;
} SHELL_LINK_INFO_CNR_LINKA, *LPSHELL_LINK_INFO_CNR_LINKA;
typedef struct tagSHELL_LINK_INFO_CNR_LINKW
{
/* Size of the CommonNetworkRelativeLink field (>= 0x00000014) */
DWORD cbSize;
/* Specifies which fields are present/populated (SLI_CNR_*) */
DWORD dwFlags;
/* Offset of the NetName field (ANSI, NULLterminated string) */
DWORD cbNetNameOffset;
/* Offset of the DeviceName field (ANSI, NULLterminated string) */
DWORD cbDeviceNameOffset;
/* Type of the network provider (WNNC_NET_* defined in winnetwk.h) */
DWORD dwNetworkProviderType;
/* Offset of the NetNameUnicode field (Unicode, NULLterminated string) */
DWORD cbNetNameUnicodeOffset;
/* Offset of the DeviceNameUnicode field (Unicode, NULLterminated string) */
DWORD cbDeviceNameUnicodeOffset;
} SHELL_LINK_INFO_CNR_LINKW, *LPSHELL_LINK_INFO_CNR_LINKW;
/* DeviceName is present */
#define SLI_CNR_VALID_DEVICE 0x00000001
/* NetworkProviderType is present */
#define SLI_CNR_VALID_NET_TYPE 0x00000002
/*****************************************************************************
* Shell Link Extra Data (IShellLinkDataList)
*/
typedef struct tagEXP_TRACKER
{
/* .cbSize = 0x00000060, .dwSignature = 0xa0000003 */
DATABLOCK_HEADER dbh;
/* Length >= 0x00000058 */
DWORD nLength;
/* Must be 0x00000000 */
DWORD nVersion;
/* NetBIOS name (ANSI, unused bytes are set to zero) */
CHAR szMachineID[16]; /* "variable" >= 16 (?) */
/* Some GUIDs for the Link Tracking service (from the FS?) */
GUID guidDroidVolume;
GUID guidDroidObject;
GUID guidDroidBirthVolume;
GUID guidDroidBirthObject;
} EXP_TRACKER, *LPEXP_TRACKER;
typedef struct tagEXP_SHIM
{
/* .cbSize >= 0x00000088, .dwSignature = 0xa0000008 */
DATABLOCK_HEADER dbh;
/* Name of a shim layer to apply (Unicode, unused bytes are set to zero) */
WCHAR szwLayerName[64]; /* "variable" >= 64 */
} EXP_SHIM, *LPEXP_SHIM;
typedef struct tagEXP_KNOWN_FOLDER
{
/* .cbSize = 0x0000001c, .dwSignature = 0xa000000b */
DATABLOCK_HEADER dbh;
/* A GUID value that identifies a known folder */
GUID guidKnownFolder;
/* Specifies the location of the ItemID of the first child
segment of the IDList specified by guidKnownFolder */
DWORD cbOffset;
} EXP_KNOWN_FOLDER, *LPEXP_KNOWN_FOLDER;
typedef struct tagEXP_VISTA_ID_LIST
{
/* .cbSize >= 0x0000000a, .dwSignature = 0xa000000c */
DATABLOCK_HEADER dbh;
/* Specifies an alternate IDList that can be used instead
of the "normal" IDList (SLDF_HAS_ID_LIST) */
/* LPITEMIDLIST pIDList; (variable) */
} EXP_VISTA_ID_LIST, *LPEXP_VISTA_ID_LIST;
#define EXP_TRACKER_SIG 0xa0000003
#define EXP_SHIM_SIG 0xa0000008
#define EXP_KNOWN_FOLDER_SIG 0xa000000b
#define EXP_VISTA_ID_LIST_SIG 0xa000000c
#include <poppack.h>
#ifdef __cplusplus
} /* extern "C" */
#endif /* defined(__cplusplus) */
#ifdef __cplusplus
template <class Base>
class CComDebugObject : public Base
{
public:
CComDebugObject(void * = NULL)
{
#if DEBUG_CCOMOBJECT_CREATION
DbgPrint("%S, this=%08p\n", __FUNCTION__, static_cast<Base*>(this));
#endif
_pAtlModule->Lock();
}
virtual ~CComDebugObject()
{
this->FinalRelease();
_pAtlModule->Unlock();
}
STDMETHOD_(ULONG, AddRef)()
{
int rc = this->InternalAddRef();
#if DEBUG_CCOMOBJECT_REFCOUNTING
DbgPrint("%s, RefCount is now %d(--)! \n", __FUNCTION__, rc);
#endif
return rc;
}
STDMETHOD_(ULONG, Release)()
{
int rc = this->InternalRelease();
#if DEBUG_CCOMOBJECT_REFCOUNTING
DbgPrint("%s, RefCount is now %d(--)! \n", __FUNCTION__, rc);
#endif
if (rc == 0)
{
#if DEBUG_CCOMOBJECT_DESTRUCTION
DbgPrint("%s, RefCount reached 0 Deleting!\n", __FUNCTION__);
#endif
delete this;
}
return rc;
}
STDMETHOD(QueryInterface)(REFIID iid, void **ppvObject)
{
return this->_InternalQueryInterface(iid, ppvObject);
}
static HRESULT WINAPI CreateInstance(CComDebugObject<Base> **pp)
{
CComDebugObject<Base> *newInstance;
HRESULT hResult;
ATLASSERT(pp != NULL);
if (pp == NULL)
return E_POINTER;
hResult = E_OUTOFMEMORY;
newInstance = NULL;
ATLTRY(newInstance = new CComDebugObject<Base>());
if (newInstance != NULL)
{
newInstance->SetVoid(NULL);
newInstance->InternalFinalConstructAddRef();
hResult = newInstance->_AtlInitialConstruct();
if (SUCCEEDED(hResult))
hResult = newInstance->FinalConstruct();
if (SUCCEEDED(hResult))
hResult = newInstance->_AtlFinalConstruct();
newInstance->InternalFinalConstructRelease();
if (hResult != S_OK)
{
delete newInstance;
newInstance = NULL;
}
}
*pp = newInstance;
return hResult;
}
};
#ifdef DEBUG_CCOMOBJECT
# define _CComObject CComDebugObject
#else
# define _CComObject CComObject
#endif
template<class T>
void ReleaseCComPtrExpectZero(CComPtr<T>& cptr, BOOL forceRelease = FALSE)
{
if (cptr.p != NULL)
{
int nrc = cptr->Release();
if (nrc > 0)
{
DbgPrint("WARNING: Unexpected RefCount > 0 (%d)!\n", nrc);
if (forceRelease)
{
while (nrc > 0)
{
nrc = cptr->Release();
}
}
}
cptr.Detach();
}
}
template<class T, class R>
HRESULT inline ShellDebugObjectCreator(REFIID riid, R ** ppv)
{
CComPtr<T> obj;
HRESULT hResult;
if (ppv == NULL)
return E_POINTER;
*ppv = NULL;
ATLTRY(obj = new CComDebugObject<T>);
if (obj.p == NULL)
return E_OUTOFMEMORY;
hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(ppv));
if (FAILED(hResult))
return hResult;
return S_OK;
}
template<class T, class R>
HRESULT inline ShellObjectCreator(REFIID riid, R ** ppv)
{
CComPtr<T> obj;
HRESULT hResult;
if (ppv == NULL)
return E_POINTER;
*ppv = NULL;
ATLTRY(obj = new _CComObject<T>);
if (obj.p == NULL)
return E_OUTOFMEMORY;
hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(ppv));
if (FAILED(hResult))
return hResult;
return S_OK;
}
template<class T, class R>
HRESULT inline ShellObjectCreatorInit(REFIID riid, R ** ppv)
{
CComPtr<T> obj;
CComPtr<R> result;
HRESULT hResult;
if (ppv == NULL)
return E_POINTER;
*ppv = NULL;
ATLTRY(obj = new _CComObject<T>);
if (obj.p == NULL)
return E_OUTOFMEMORY;
hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result));
if (FAILED(hResult))
return hResult;
hResult = obj->Initialize();
if (FAILED(hResult))
return hResult;
*ppv = result.Detach();
return S_OK;
}
template<class T>
HRESULT inline ShellObjectCreatorInit(REFIID riid, void ** ppv)
{
CComPtr<T> obj;
CComPtr<IUnknown> result;
HRESULT hResult;
if (ppv == NULL)
return E_POINTER;
*ppv = NULL;
ATLTRY(obj = new _CComObject<T>);
if (obj.p == NULL)
return E_OUTOFMEMORY;
hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result));
if (FAILED(hResult))
return hResult;
hResult = obj->Initialize();
if (FAILED(hResult))
return hResult;
*ppv = result.Detach();
return S_OK;
}
template<class T, class T1>
HRESULT inline ShellObjectCreatorInit(T1 initArg1, REFIID riid, void ** ppv)
{
CComPtr<T> obj;
HRESULT hResult;
if (ppv == NULL)
return E_POINTER;
*ppv = NULL;
ATLTRY(obj = new _CComObject<T>);
if (obj.p == NULL)
return E_OUTOFMEMORY;
hResult = obj->QueryInterface(riid, ppv);
if (FAILED(hResult))
return hResult;
hResult = obj->Initialize(initArg1);
if (FAILED(hResult))
return hResult;
return S_OK;
}
template<class T, class T1, class R>
HRESULT inline ShellObjectCreatorInit(T1 initArg1, REFIID riid, R ** ppv)
{
CComPtr<T> obj;
CComPtr<R> result;
HRESULT hResult;
if (ppv == NULL)
return E_POINTER;
*ppv = NULL;
ATLTRY(obj = new _CComObject<T>);
if (obj.p == NULL)
return E_OUTOFMEMORY;
hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result));
if (FAILED(hResult))
return hResult;
hResult = obj->Initialize(initArg1);
if (FAILED(hResult))
return hResult;
*ppv = result.Detach();
return S_OK;
}
template<class T, class T1, class T2, class R>
HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, REFIID riid, R ** ppv)
{
CComPtr<T> obj;
CComPtr<R> result;
HRESULT hResult;
if (ppv == NULL)
return E_POINTER;
*ppv = NULL;
ATLTRY(obj = new _CComObject<T>);
if (obj.p == NULL)
return E_OUTOFMEMORY;
hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result));
if (FAILED(hResult))
return hResult;
hResult = obj->Initialize(initArg1, initArg2);
if (FAILED(hResult))
return hResult;
*ppv = result.Detach();
return S_OK;
}
template<class T, class T1, class T2, class T3, class R>
HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, REFIID riid, R ** ppv)
{
CComPtr<T> obj;
CComPtr<R> result;
HRESULT hResult;
if (ppv == NULL)
return E_POINTER;
*ppv = NULL;
ATLTRY(obj = new _CComObject<T>);
if (obj.p == NULL)
return E_OUTOFMEMORY;
hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result));
if (FAILED(hResult))
return hResult;
hResult = obj->Initialize(initArg1, initArg2, initArg3);
if (FAILED(hResult))
return hResult;
*ppv = result.Detach();
return S_OK;
}
template<class T, class T1, class T2, class T3, class T4, class R>
HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, T4 initArg4, REFIID riid, R ** ppv)
{
CComPtr<T> obj;
CComPtr<R> result;
HRESULT hResult;
if (ppv == NULL)
return E_POINTER;
*ppv = NULL;
ATLTRY(obj = new _CComObject<T>);
if (obj.p == NULL)
return E_OUTOFMEMORY;
hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result));
if (FAILED(hResult))
return hResult;
hResult = obj->Initialize(initArg1, initArg2, initArg3, initArg4);
if (FAILED(hResult))
return hResult;
*ppv = result.Detach();
return S_OK;
}
template<class T, class T1, class T2, class T3, class T4, class T5, class R>
HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, T4 initArg4, T5 initArg5, REFIID riid, R ** ppv)
{
CComPtr<T> obj;
CComPtr<R> result;
HRESULT hResult;
if (ppv == NULL)
return E_POINTER;
*ppv = NULL;
ATLTRY(obj = new _CComObject<T>);
if (obj.p == NULL)
return E_OUTOFMEMORY;
hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result));
if (FAILED(hResult))
return hResult;
hResult = obj->Initialize(initArg1, initArg2, initArg3, initArg4, initArg5);
if (FAILED(hResult))
return hResult;
*ppv = result.Detach();
return S_OK;
}
#endif /* __cplusplus */
#endif /* __WINE_UNDOCSHELL_H */

View file

@ -1,6 +1,10 @@
#ifndef _UNDOCUSER_H
#define _UNDOCUSER_H
#ifdef __cplusplus
extern "C" {
#endif /* defined(__cplusplus) */
/* Built in class atoms */
#define WC_MENU (MAKEINTATOM(0x8000))
#define WC_DESKTOP (MAKEINTATOM(0x8001))
@ -103,6 +107,11 @@
#define LN_MESSAGE_BEEP 0x9
#define LN_START_SCREENSAVE 0xA
//
// Undocumented flags for DrawCaptionTemp
//
#define DC_NOSENDMSG 0x2000
#define STARTF_SCRNSAVER 0x80000000
#define CW_USEDEFAULT16 ((short)0x8000)
@ -134,6 +143,18 @@ LONG WINAPI CsrBroadcastSystemMessageExW(DWORD dwflags,
BOOL WINAPI CliImmSetHotKey(DWORD dwID, UINT uModifiers, UINT uVirtualKey, HKL hKl);
HWND WINAPI GetTaskmanWindow(VOID);
HWND WINAPI GetProgmanWindow(VOID);
BOOL WINAPI SetShellWindow(HWND);
BOOL WINAPI SetShellWindowEx(HWND, HWND);
BOOL WINAPI DrawCaptionTempA(HWND,HDC,const RECT*,HFONT,HICON,LPCSTR,UINT);
BOOL WINAPI DrawCaptionTempW(HWND,HDC,const RECT*,HFONT,HICON,LPCWSTR,UINT);
#ifdef UNICODE
#define DrawCaptionTemp DrawCaptionTempW
#else
#define DrawCaptionTemp DrawCaptionTempA
#endif
//
// User api hook
@ -205,4 +226,8 @@ BOOL WINAPI RegisterUserApiHook(PUSERAPIHOOKINFO puah);
BOOL WINAPI UnregisterUserApiHook(VOID);
#ifdef __cplusplus
} /* extern "C" */
#endif /* defined(__cplusplus) */
#endif