ReactOS 0.4.17-dev-1218-gfae4549
shdocvw_undoc.h File Reference
#include <exdisp.h>
Include dependency graph for shdocvw_undoc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

BOOL WINAPI IEILIsEqual (_In_ LPCITEMIDLIST pidl1, _In_ LPCITEMIDLIST pidl2, _In_ BOOL bUnknown)
 
HRESULT WINAPI AddUrlToFavorites (_In_ HWND hwnd, _In_ LPCWSTR pszUrlW, _In_ LPCWSTR pszTitleW, _In_ BOOL NoUI)
 
BOOL WINAPI WinList_Init (VOID)
 
VOID WINAPI WinList_Terminate (VOID)
 
HRESULT WINAPI WinList_Revoke (_In_ LONG lCookie)
 
IShellWindows *WINAPI WinList_GetShellWindows (_In_ BOOL bCreate)
 
HRESULT WINAPI WinList_NotifyNewLocation (_In_ IShellWindows *pShellWindows, _In_ LONG lCookie, _In_ LPCITEMIDLIST pidl)
 
HRESULT WINAPI WinList_FindFolderWindow (_In_ LPCITEMIDLIST pidl, _In_ DWORD dwUnused, _Out_opt_ PLONG phwnd, _Out_opt_ IWebBrowserApp **ppWebBrowserApp)
 
HRESULT WINAPI WinList_RegisterPending (_In_ DWORD dwThreadId, _In_ LPCITEMIDLIST pidl, _In_ DWORD dwUnused, _Out_ PLONG plCookie)
 

Function Documentation

◆ AddUrlToFavorites()

HRESULT WINAPI AddUrlToFavorites ( _In_ HWND  hwnd,
_In_ LPCWSTR  pszUrlW,
_In_ LPCWSTR  pszTitleW,
_In_ BOOL  NoUI 
)

Definition at line 276 of file utility.cpp.

281{
282 TRACE("%p, %s, %s, %d\n", hwnd, wine_dbgstr_w(pszUrlW), wine_dbgstr_w(pszTitleW), NoUI);
283
284 if (!pszUrlW || !pszTitleW)
285 return E_INVALIDARG;
286
287 CCoInit CoInit;
288 HRESULT hr = S_OK;
289 BOOL IsUrl = PathIsURLW(pszUrlW);
290 PCWSTR pszExt = IsUrl ? L".url" : L".lnk";
293
294 WCHAR szDir[MAX_PATH];
296 return E_FAIL;
297
298 if (!NoUI)
299 {
300 PCWSTR pszText = IsUrl ? pszUrlW : PathFindFileNameW(pszUrlW);
301 if ((hr = AddFavoriteDialog(hwnd, szDir, szTitle, pszText)) == S_FALSE)
302 return hr;
303 }
305
306 WCHAR szLnk[MAX_PATH * 2];
307 if (SUCCEEDED(hr))
308 hr = StringCchPrintfW(szLnk, _countof(szLnk), L"%s\\%s%s", szDir, szTitle, pszExt);
309
310 if (IsUrl && SUCCEEDED(hr))
311 {
312 // TODO: For the !NoUI case, we should ask the user if they want to overwrite if the file already exists
313 hr = WritePrivateProfileStringW(L"InternetShortcut", L"URL", pszUrlW, szLnk) ? S_OK : E_FAIL;
314 }
315 else if (SUCCEEDED(hr))
316 {
317 BOOL bMustCopy;
318 if (NoUI)
319 hr = SHGetNewLinkInfoW(pszUrlW, szDir, szLnk, &bMustCopy, 0) ? S_OK : E_FAIL;
320
321 CComHeapPtr<ITEMIDLIST> pidl;
323 hr = SHParseDisplayName(pszUrlW, NULL, &pidl, 0, NULL);
325 hr = SHDOCVW_CreateShortcut(szLnk, pidl, NULL);
326 }
327
328 if (FAILED(hr) && !NoUI)
330 return hr;
331}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_FAIL
Definition: ddrawi.h:102
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define MAX_PATH
Definition: compat.h:34
BOOL WINAPI WritePrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR string, LPCWSTR filename)
Definition: profile.c:1453
WCHAR *WINAPI PathFindFileNameW(const WCHAR *path)
Definition: path.c:1677
BOOL WINAPI PathIsURLW(const WCHAR *path)
Definition: path.c:3214
BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate)
Definition: shellpath.c:4394
#define FAILED_UNEXPECTEDLY
Definition: utils.cpp:33
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define wine_dbgstr_w
Definition: kernel32.h:34
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
short WCHAR
Definition: pedump.c:58
HRESULT WINAPI SHParseDisplayName(LPCWSTR pszName, IBindCtx *pbc, LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut)
Definition: pidl.c:1548
BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName, BOOL *pfMustCopy, UINT uFlags)
Definition: shellord.c:2735
#define SHELL_ErrorBox
Definition: shellutils.h:126
#define CSIDL_FAVORITES
Definition: shlobj.h:2226
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
const uint16_t * PCWSTR
Definition: typedefs.h:57
static HRESULT AddFavoriteDialog(_In_ HWND hwnd, _Inout_ PWSTR pszDir, _Inout_ PWSTR pszTitle, _In_ PCWSTR pszText)
Definition: utility.cpp:249
static HRESULT SHDOCVW_CreateShortcut(_In_ LPCWSTR pszLnkFileName, _In_ PCIDLIST_ABSOLUTE pidlTarget, _In_opt_ LPCWSTR pszDescription)
Definition: utility.cpp:162
static VOID SHDOCVW_PathDeleteInvalidChars(LPWSTR pszDisplayName)
Definition: utility.cpp:146
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define S_FALSE
Definition: winerror.h:3451

Referenced by AddItemToFavorites().

◆ IEILIsEqual()

BOOL WINAPI IEILIsEqual ( _In_ LPCITEMIDLIST  pidl1,
_In_ LPCITEMIDLIST  pidl2,
_In_ BOOL  bUnknown 
)

Definition at line 132 of file utility.cpp.

136{
137 UINT cb1 = ILGetSize(pidl1), cb2 = ILGetSize(pidl2);
138 if (cb1 == cb2 && memcmp(pidl1, pidl2, cb1) == 0)
139 return TRUE;
140
141 FIXME("%p, %p\n", pidl1, pidl2);
142 return FALSE;
143}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define FALSE
Definition: types.h:117
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2807
unsigned int UINT
Definition: sysinfo.c:13
UINT WINAPI ILGetSize(LPCITEMIDLIST pidl)
Definition: pidl.c:941

Referenced by CMruBase::_IsEqual().

◆ WinList_FindFolderWindow()

HRESULT WINAPI WinList_FindFolderWindow ( _In_ LPCITEMIDLIST  pidl,
_In_ DWORD  dwUnused,
_Out_opt_ PLONG  phwnd,
_Out_opt_ IWebBrowserApp **  ppWebBrowserApp 
)

Definition at line 151 of file winlist.cpp.

156{
157 UNREFERENCED_PARAMETER(dwUnused);
158
159 TRACE("(%p, %ld, %p, %p)\n", pidl, dwUnused, phwnd, ppWebBrowserApp);
160
161 if (ppWebBrowserApp)
162 *ppWebBrowserApp = NULL;
163
164 if (phwnd)
165 *phwnd = 0;
166
167 if (!pidl)
168 {
169 ERR("!pidl\n");
170 return E_UNEXPECTED;
171 }
172
173 CComPtr<IShellWindows> pShellWindows(WinList_GetShellWindows(ppWebBrowserApp != NULL));
174 if (!pShellWindows)
175 {
176 ERR("!pShellWindows\n");
177 return E_UNEXPECTED;
178 }
179
180 VARIANTARG varg;
181 HRESULT hr = InitVariantFromIDList(&varg, pidl);
183 return hr;
184
185 CComPtr<IDispatch> pDispatch;
186 const INT options = SWFO_INCLUDEPENDING | (ppWebBrowserApp ? SWFO_NEEDDISPATCH : 0);
187 hr = pShellWindows->FindWindowSW(&varg, &s_vaEmpty, SWC_BROWSER, phwnd, options, &pDispatch);
188 if (pDispatch && ppWebBrowserApp)
189 hr = pDispatch->QueryInterface(IID_PPV_ARG(IWebBrowserApp, ppWebBrowserApp));
190
191 VariantClearLazy(&varg);
192 return hr;
193}
#define IID_PPV_ARG(Itype, ppType)
#define ERR(fmt,...)
Definition: precomp.h:57
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
@ SWFO_NEEDDISPATCH
Definition: exdisp.idl:556
@ SWFO_INCLUDEPENDING
Definition: exdisp.idl:557
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
int32_t INT
Definition: typedefs.h:58
#define E_UNEXPECTED
Definition: winerror.h:3528
static HRESULT InitVariantFromIDList(_Out_ LPVARIANTARG pvarg, _In_ LPCITEMIDLIST pidl)
Definition: winlist.cpp:37
static HRESULT VariantClearLazy(_Inout_ LPVARIANTARG pvarg)
Definition: winlist.cpp:45
EXTERN_C IShellWindows *WINAPI WinList_GetShellWindows(_In_ BOOL bCreate)
Definition: winlist.cpp:105
static VARIANT s_vaEmpty
Definition: winlist.cpp:13

◆ WinList_GetShellWindows()

IShellWindows *WINAPI WinList_GetShellWindows ( _In_ BOOL  bCreate)

Definition at line 105 of file winlist.cpp.

107{
108 FIXME("(%d)\n", bCreate);
109 return NULL;
110}
_In_ int _In_ BOOL bCreate
Definition: shlobj.h:1565

Referenced by WinList_FindFolderWindow(), WinList_RegisterPending(), and WinList_Revoke().

◆ WinList_Init()

BOOL WINAPI WinList_Init ( VOID  )

Definition at line 246 of file shdocvw_main.c.

247{
248 FIXME("(), stub!\n");
249 return 0x0deadfeed;
250}

◆ WinList_NotifyNewLocation()

HRESULT WINAPI WinList_NotifyNewLocation ( _In_ IShellWindows *  pShellWindows,
_In_ LONG  lCookie,
_In_ LPCITEMIDLIST  pidl 
)

Definition at line 120 of file winlist.cpp.

124{
125 TRACE("(%p, %ld, %p)\n", pShellWindows, lCookie, pidl);
126
127 if (!pidl)
128 {
129 ERR("!pidl\n");
130 return E_UNEXPECTED;
131 }
132
133 VARIANTARG varg;
134 HRESULT hr = InitVariantFromIDList(&varg, pidl);
136 return hr;
137
138 hr = pShellWindows->OnNavigate(lCookie, &varg);
139 VariantClearLazy(&varg);
140 return hr;
141}

◆ WinList_RegisterPending()

HRESULT WINAPI WinList_RegisterPending ( _In_ DWORD  dwThreadId,
_In_ LPCITEMIDLIST  pidl,
_In_ DWORD  dwUnused,
_Out_ PLONG  plCookie 
)

Definition at line 203 of file winlist.cpp.

208{
209 TRACE("(%ld, %p, %ld, %p)\n", dwThreadId, pidl, dwUnused, plCookie);
210
211 if (!pidl)
212 {
213 ERR("!pidl\n");
214 return E_UNEXPECTED;
215 }
216
217 CComPtr<IShellWindows> pShellWindows(WinList_GetShellWindows(FALSE));
218 if (!pShellWindows)
219 {
220 ERR("!pShellWindows\n");
221 return E_UNEXPECTED;
222 }
223
224 VARIANTARG varg;
225 HRESULT hr = InitVariantFromIDList(&varg, pidl);
227 return hr;
228
229 hr = pShellWindows->RegisterPending(dwThreadId, &varg, &s_vaEmpty, SWC_BROWSER, plCookie);
230 VariantClearLazy(&varg);
231 return hr;
232}
DWORD dwThreadId
Definition: fdebug.c:31

◆ WinList_Revoke()

HRESULT WINAPI WinList_Revoke ( _In_ LONG  lCookie)

Definition at line 242 of file winlist.cpp.

244{
245 TRACE("(%ld)\n", lCookie);
246
247 CComPtr<IShellWindows> pShellWindows(WinList_GetShellWindows(TRUE));
248 if (!pShellWindows)
249 {
250 ERR("!pShellWindows\n");
251 return E_FAIL;
252 }
253
254 return pShellWindows->Revoke(lCookie);
255}

◆ WinList_Terminate()

VOID WINAPI WinList_Terminate ( VOID  )

Definition at line 92 of file winlist.cpp.

93{
94 FIXME("()\n");
95}