ReactOS 0.4.16-dev-2206-gc56950d
changenotify.cpp File Reference
#include "precomp.h"
Include dependency graph for changenotify.cpp:

Go to the source code of this file.

Classes

class  CChangeNotifyBroker
 
struct  ALIAS_PIDL
 

Macros

#define DUMPEV(x)   ,( event & SHCNE_##x )? #x " " : ""
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shcn)
 
static HWND GetNotificationServer (BOOL bCreate)
 
EXTERN_C void InitChangeNotifications (void)
 
EXTERN_C void FreeChangeNotifications (void)
 
static HRESULT Shell_ParsePrinterName (_In_ LPCWSTR pszName, _Out_ LPITEMIDLIST *ppidl, _In_ IBindCtx *pBindCtx)
 
static HWND CreateNotificationBroker (HWND hwnd, UINT wMsg)
 
static HANDLE CreateNotificationParam (LONG wEventId, UINT uFlags, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2, DWORD dwOwnerPID, DWORD dwTick)
 
static LPHANDBAG DoGetHandbagFromTicket (HANDLE hTicket, DWORD dwOwnerPID)
 
static HANDLE CreateRegistrationParam (ULONG nRegID, HWND hwnd, UINT wMsg, INT fSources, LONG fEvents, LONG fRecursive, LPCITEMIDLIST pidl, DWORD dwOwnerPID, HWND hwndBroker)
 
static void CreateNotificationParamAndSend (LONG wEventId, UINT uFlags, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2, DWORD dwTick)
 
static VOID DoInitAliasPIDLs (void)
 
static BOOL DoGetAliasPIDLs (LPITEMIDLIST apidls[2], PCIDLIST_ABSOLUTE pidl)
 
EXTERN_C ULONG WINAPI SHChangeNotifyRegister (HWND hwnd, INT fSources, LONG wEventMask, UINT uMsg, INT cItems, SHChangeNotifyEntry *lpItems)
 
EXTERN_C BOOL WINAPI SHChangeNotifyDeregister (ULONG hNotify)
 
EXTERN_C BOOL WINAPI SHChangeNotifyUpdateEntryList (DWORD unknown1, DWORD unknown2, DWORD unknown3, DWORD unknown4)
 
static LPCSTR DumpEvent (LONG event)
 
EXTERN_C BOOL WINAPI SHChangeRegistrationReceive (LPVOID lpUnknown1, DWORD dwUnknown2)
 
EXTERN_C VOID WINAPI SHChangeNotifyReceiveEx (LONG lEvent, UINT uFlags, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2, DWORD dwTick)
 
EXTERN_C VOID WINAPI SHChangeNotifyReceive (LONG lEvent, UINT uFlags, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
 
EXTERN_C VOID WINAPI SHChangeNotifyTransmit (LONG lEvent, UINT uFlags, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2, DWORD dwTick)
 
EXTERN_C void WINAPI SHChangeNotify (LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
 
EXTERN_C ULONG WINAPI NTSHChangeNotifyRegister (HWND hwnd, INT fSources, LONG fEvents, UINT msg, INT count, SHChangeNotifyEntry *idlist)
 
EXTERN_C HANDLE WINAPI SHChangeNotification_Lock (HANDLE hTicket, DWORD dwOwnerPID, LPITEMIDLIST **lppidls, LPLONG lpwEventId)
 
EXTERN_C BOOL WINAPI SHChangeNotification_Unlock (HANDLE hLock)
 
EXTERN_C DWORD WINAPI NTSHChangeNotifyDeregister (ULONG hNotify)
 
EXTERN_C BOOL WINAPI SHChangeNotifySuspendResume (BOOL bSuspend, LPITEMIDLIST pidl, BOOL bRecursive, DWORD dwReserved)
 

Variables

CRITICAL_SECTION SHELL32_ChangenotifyCS
 
static ALIAS_PIDL AliasPIDLs []
 

Macro Definition Documentation

◆ DUMPEV

#define DUMPEV (   x)    ,( event & SHCNE_##x )? #x " " : ""

Function Documentation

◆ CreateNotificationBroker()

static HWND CreateNotificationBroker ( HWND  hwnd,
UINT  wMsg 
)
static

Definition at line 153 of file changenotify.cpp.

154{
155 // Create a new broker. It will be freed when the window gets destroyed
156 CChangeNotifyBroker* pBroker = new CChangeNotifyBroker(hwnd, wMsg);
157 if (pBroker == NULL)
158 {
159 ERR("Out of memory\n");
160 return NULL;
161 }
162
163 HWND hwndBroker = SHCreateDefaultWorkerWindow();
164 if (hwndBroker == NULL)
165 {
166 ERR("hwndBroker == NULL\n");
167 delete pBroker;
168 return NULL;
169 }
170
171 pBroker->SubclassWindow(hwndBroker);
172 return hwndBroker;
173}
HWND SHCreateDefaultWorkerWindow(VOID)
#define ERR(fmt,...)
Definition: precomp.h:57
BOOL SubclassWindow(HWND hWnd)
Definition: atlwin.h:1552
#define NULL
Definition: types.h:112
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by SHChangeNotifyRegister().

◆ CreateNotificationParam()

static HANDLE CreateNotificationParam ( LONG  wEventId,
UINT  uFlags,
LPCITEMIDLIST  pidl1,
LPCITEMIDLIST  pidl2,
DWORD  dwOwnerPID,
DWORD  dwTick 
)
static

Definition at line 178 of file changenotify.cpp.

180{
181 // pidl1 and pidl2 have variable length. To store them into the delivery ticket,
182 // we have to consider the offsets and the sizes of pidl1 and pidl2.
183 DWORD cbPidl1 = 0, cbPidl2 = 0, ibOffset1 = 0, ibOffset2 = 0;
184 if (pidl1)
185 {
186 cbPidl1 = ILGetSize(pidl1);
187 ibOffset1 = DWORD_ALIGNMENT(sizeof(DELITICKET));
188 }
189 if (pidl2)
190 {
191 cbPidl2 = ILGetSize(pidl2);
192 ibOffset2 = DWORD_ALIGNMENT(ibOffset1 + cbPidl1);
193 }
194
195 // allocate the delivery ticket
196 DWORD cbSize = ibOffset2 + cbPidl2;
197 HANDLE hTicket = SHAllocShared(NULL, cbSize, dwOwnerPID);
198 if (hTicket == NULL)
199 {
200 ERR("Out of memory\n");
201 return NULL;
202 }
203
204 // lock the ticket
205 LPDELITICKET pTicket = (LPDELITICKET)SHLockSharedEx(hTicket, dwOwnerPID, TRUE);
206 if (pTicket == NULL)
207 {
208 ERR("SHLockSharedEx failed\n");
209 SHFreeShared(hTicket, dwOwnerPID);
210 return NULL;
211 }
212
213 // populate the ticket
214 pTicket->dwMagic = DELITICKET_MAGIC;
215 pTicket->wEventId = wEventId;
216 pTicket->uFlags = uFlags;
217 pTicket->ibOffset1 = ibOffset1;
218 pTicket->ibOffset2 = ibOffset2;
219 if (pidl1)
220 memcpy((LPBYTE)pTicket + ibOffset1, pidl1, cbPidl1);
221 if (pidl2)
222 memcpy((LPBYTE)pTicket + ibOffset2, pidl2, cbPidl2);
223
224 // unlock the ticket and return
225 SHUnlockShared(pTicket);
226 return hTicket;
227}
struct DELITICKET * LPDELITICKET
#define DELITICKET_MAGIC
#define DWORD_ALIGNMENT(offset)
#define TRUE
Definition: types.h:120
UINT uFlags
Definition: api.c:59
HANDLE WINAPI SHAllocShared(LPCVOID lpvData, DWORD dwSize, DWORD dwProcId)
Definition: ordinal.c:169
BOOL WINAPI SHFreeShared(HANDLE hShared, DWORD dwProcId)
Definition: ordinal.c:315
BOOL WINAPI SHUnlockShared(LPVOID lpView)
Definition: ordinal.c:295
unsigned long DWORD
Definition: ntddk_ex.h:95
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ILGetSize
Definition: shellclasses.h:638
PVOID WINAPI SHLockSharedEx(HANDLE hData, DWORD dwProcessId, BOOL bWriteAccess)
unsigned char * LPBYTE
Definition: typedefs.h:53

Referenced by CreateNotificationParamAndSend().

◆ CreateNotificationParamAndSend()

static void CreateNotificationParamAndSend ( LONG  wEventId,
UINT  uFlags,
LPCITEMIDLIST  pidl1,
LPCITEMIDLIST  pidl2,
DWORD  dwTick 
)
static

Definition at line 320 of file changenotify.cpp.

322{
323 // get server window
324 HWND hwndServer = GetNotificationServer(FALSE);
325 if (hwndServer == NULL)
326 return;
327
328 // the ticket owner is the process of the notification server
329 DWORD pid;
330 GetWindowThreadProcessId(hwndServer, &pid);
331
332 // create a delivery ticket
333 HANDLE hTicket = CreateNotificationParam(wEventId, uFlags, pidl1, pidl2, pid, dwTick);
334 if (hTicket == NULL)
335 return;
336
337 // Create alias PIDLs
338 CComHeapPtr<ITEMIDLIST> pidl1Alias, pidl2Alias;
339 if (pidl1)
340 SHELL32_AliasTranslatePidl(pidl1, &pidl1Alias, ALIAS_ANY);
341 if (pidl2)
342 SHELL32_AliasTranslatePidl(pidl2, &pidl2Alias, ALIAS_ANY);
343
344 HANDLE hTicket2 = NULL;
345 if (((pidl1 && pidl1Alias && !ILIsEqual(pidl1, pidl1Alias)) ||
346 (pidl2 && pidl2Alias && !ILIsEqual(pidl2, pidl2Alias))))
347 {
348 hTicket2 = CreateNotificationParam(wEventId, uFlags, pidl1Alias, pidl2Alias,
349 pid, dwTick);
350 if (!hTicket2)
351 {
352 SHFreeShared(hTicket, pid);
353 return;
354 }
355 }
356
357 TRACE("hTicket:%p, hTicket2:%p, pid:0x%lx\n", hTicket, hTicket2, pid);
358
359 // send the ticket by using CN_DELIVER_NOTIFICATION
360 if (pid != GetCurrentProcessId() ||
362 {
363 SendMessageW(hwndServer, CN_DELIVER_NOTIFICATION, (WPARAM)hTicket, pid);
364 if (hTicket2)
365 SendMessageW(hwndServer, CN_DELIVER_NOTIFICATION, (WPARAM)hTicket2, pid);
366 }
367 else
368 {
370 if (hTicket2)
371 SendNotifyMessageW(hwndServer, CN_DELIVER_NOTIFICATION, (WPARAM)hTicket2, pid);
372 }
373}
#define CN_DELIVER_NOTIFICATION
static HWND GetNotificationServer(BOOL bCreate)
static HANDLE CreateNotificationParam(LONG wEventId, UINT uFlags, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2, DWORD dwOwnerPID, DWORD dwTick)
#define FALSE
Definition: types.h:117
EXTERN_C HRESULT SHELL32_AliasTranslatePidl(_In_ LPCITEMIDLIST pidl, _Out_ LPITEMIDLIST *ppidlNew, _In_ DWORD dwFlags)
Translate a PIDL to an "alias" PIDL.
Definition: utils.cpp:2185
UINT_PTR WPARAM
Definition: minwindef.h:174
BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:583
#define ALIAS_ANY
Definition: shell32_main.h:121
#define SHCNF_FLUSH
Definition: shlobj.h:1934
#define SHCNF_FLUSHNOWAIT
Definition: shlobj.h:1935
#define TRACE(s)
Definition: solgame.cpp:4
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1158
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3837
BOOL WINAPI SendNotifyMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by SHChangeNotifyReceiveEx().

◆ CreateRegistrationParam()

static HANDLE CreateRegistrationParam ( ULONG  nRegID,
HWND  hwnd,
UINT  wMsg,
INT  fSources,
LONG  fEvents,
LONG  fRecursive,
LPCITEMIDLIST  pidl,
DWORD  dwOwnerPID,
HWND  hwndBroker 
)
static

Definition at line 269 of file changenotify.cpp.

272{
273 // pidl has variable length. To store it into the registration entry,
274 // we have to consider the length of pidl.
275 DWORD cbPidl = ILGetSize(pidl);
276 DWORD ibPidl = DWORD_ALIGNMENT(sizeof(REGENTRY));
277 DWORD cbSize = ibPidl + cbPidl;
278
279 // create the registration entry and lock it
280 HANDLE hRegEntry = SHAllocShared(NULL, cbSize, dwOwnerPID);
281 if (hRegEntry == NULL)
282 {
283 ERR("Out of memory\n");
284 return NULL;
285 }
286 LPREGENTRY pRegEntry = (LPREGENTRY)SHLockSharedEx(hRegEntry, dwOwnerPID, TRUE);
287 if (pRegEntry == NULL)
288 {
289 ERR("SHLockSharedEx failed\n");
290 SHFreeShared(hRegEntry, dwOwnerPID);
291 return NULL;
292 }
293
294 // populate the registration entry
295 pRegEntry->dwMagic = REGENTRY_MAGIC;
296 pRegEntry->cbSize = cbSize;
297 pRegEntry->nRegID = nRegID;
298 pRegEntry->hwnd = hwnd;
299 pRegEntry->uMsg = wMsg;
300 pRegEntry->fSources = fSources;
301 pRegEntry->fEvents = fEvents;
302 pRegEntry->fRecursive = fRecursive;
303 pRegEntry->hwndBroker = hwndBroker;
304 pRegEntry->ibPidl = 0;
305 if (pidl)
306 {
307 pRegEntry->ibPidl = ibPidl;
308 memcpy((LPBYTE)pRegEntry + ibPidl, pidl, cbPidl);
309 }
310
311 // unlock and return
312 SHUnlockShared(pRegEntry);
313 return hRegEntry;
314}
#define REGENTRY_MAGIC
struct REGENTRY * LPREGENTRY

Referenced by SHChangeNotifyRegister().

◆ DoGetAliasPIDLs()

static BOOL DoGetAliasPIDLs ( LPITEMIDLIST  apidls[2],
PCIDLIST_ABSOLUTE  pidl 
)
static

Definition at line 411 of file changenotify.cpp.

412{
414
415 apidls[0] = apidls[1] = NULL;
416
417 INT k = 0;
418 for (SIZE_T i = 0; i < _countof(AliasPIDLs); ++i)
419 {
420 const ALIAS_PIDL *alias = &AliasPIDLs[i];
421 if (ILIsEqual(pidl, alias->pidl1))
422 {
423 if (alias->csidl1 == alias->csidl2)
424 {
425 apidls[k++] = ILCreateFromPathW(alias->szPath2);
426 }
427 else
428 {
429 apidls[k++] = ILClone(alias->pidl2);
430 }
431 if (k >= 2)
432 break;
433 }
434 }
435
436 return k > 0;
437}
const WCHAR * alias
Definition: main.c:67
static VOID DoInitAliasPIDLs(void)
static ALIAS_PIDL AliasPIDLs[]
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
int k
Definition: mpi.c:3369
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:238
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
Definition: pidl.c:1108
#define _countof(array)
Definition: sndvol32.h:70
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int32_t INT
Definition: typedefs.h:58

Referenced by SHChangeNotifyRegister().

◆ DoGetHandbagFromTicket()

static LPHANDBAG DoGetHandbagFromTicket ( HANDLE  hTicket,
DWORD  dwOwnerPID 
)
static

Definition at line 234 of file changenotify.cpp.

235{
236 // lock and validate the delivery ticket
237 LPDELITICKET pTicket = (LPDELITICKET)SHLockSharedEx(hTicket, dwOwnerPID, FALSE);
238 if (pTicket == NULL || pTicket->dwMagic != DELITICKET_MAGIC)
239 {
240 ERR("pTicket is invalid\n");
241 SHUnlockShared(pTicket);
242 return NULL;
243 }
244
245 // allocate the handbag
246 LPHANDBAG pHandbag = (LPHANDBAG)LocalAlloc(LMEM_FIXED, sizeof(HANDBAG));
247 if (pHandbag == NULL)
248 {
249 ERR("Out of memory\n");
250 SHUnlockShared(pTicket);
251 return NULL;
252 }
253
254 // populate the handbag
255 pHandbag->dwMagic = HANDBAG_MAGIC;
256 pHandbag->pTicket = pTicket;
257
258 pHandbag->pidls[0] = pHandbag->pidls[1] = NULL;
259 if (pTicket->ibOffset1)
260 pHandbag->pidls[0] = (LPITEMIDLIST)((LPBYTE)pTicket + pTicket->ibOffset1);
261 if (pTicket->ibOffset2)
262 pHandbag->pidls[1] = (LPITEMIDLIST)((LPBYTE)pTicket + pTicket->ibOffset2);
263
264 return pHandbag;
265}
#define HANDBAG_MAGIC
struct HANDBAG * LPHANDBAG
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
#define LMEM_FIXED
Definition: minwinbase.h:81
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
LPDELITICKET pTicket
LPITEMIDLIST pidls[2]

Referenced by SHChangeNotification_Lock().

◆ DoInitAliasPIDLs()

static VOID DoInitAliasPIDLs ( void  )
static

Definition at line 392 of file changenotify.cpp.

393{
394 static BOOL s_bInit = FALSE;
395 if (!s_bInit)
396 {
397 for (SIZE_T i = 0; i < _countof(AliasPIDLs); ++i)
398 {
400
401 SHGetSpecialFolderLocation(NULL, alias->csidl1, &alias->pidl1);
402 SHGetPathFromIDListW(alias->pidl1, alias->szPath1);
403
404 SHGetSpecialFolderLocation(NULL, alias->csidl2, &alias->pidl2);
405 SHGetPathFromIDListW(alias->pidl2, alias->szPath2);
406 }
407 s_bInit = TRUE;
408 }
409}
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
Definition: shellpath.c:3384
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1496

Referenced by DoGetAliasPIDLs().

◆ DumpEvent()

static LPCSTR DumpEvent ( LONG  event)
static

Definition at line 607 of file changenotify.cpp.

608{
609 if (event == SHCNE_ALLEVENTS)
610 return "SHCNE_ALLEVENTS";
611#define DUMPEV(x) ,( event & SHCNE_##x )? #x " " : ""
612 return wine_dbg_sprintf( "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s"
613 DUMPEV(RENAMEITEM)
614 DUMPEV(CREATE)
617 DUMPEV(RMDIR)
618 DUMPEV(MEDIAINSERTED)
619 DUMPEV(MEDIAREMOVED)
620 DUMPEV(DRIVEREMOVED)
621 DUMPEV(DRIVEADD)
622 DUMPEV(NETSHARE)
623 DUMPEV(NETUNSHARE)
624 DUMPEV(ATTRIBUTES)
625 DUMPEV(UPDATEDIR)
626 DUMPEV(UPDATEITEM)
627 DUMPEV(SERVERDISCONNECT)
628 DUMPEV(UPDATEIMAGE)
629 DUMPEV(DRIVEADDGUI)
630 DUMPEV(RENAMEFOLDER)
631 DUMPEV(FREESPACE)
632 DUMPEV(EXTENDED_EVENT)
633 DUMPEV(ASSOCCHANGED)
634 DUMPEV(INTERRUPT)
635 );
636#undef DUMPEV
637}
#define DUMPEV(x)
const char * wine_dbg_sprintf(const char *format,...)
Definition: compat.c:296
struct _cl_event * event
Definition: glext.h:7739
#define DELETE
Definition: nt_native.h:57
#define MKDIR(d)
Definition: compat.h:27
#define SHCNE_ALLEVENTS
Definition: shlobj.h:1919

Referenced by SHChangeNotify().

◆ FreeChangeNotifications()

EXTERN_C void FreeChangeNotifications ( void  )

Definition at line 52 of file changenotify.cpp.

53{
54 HWND hwndServer = GetNotificationServer(FALSE);
55 if (hwndServer)
58}
#define CN_UNREGISTER_PROCESS
CRITICAL_SECTION SHELL32_ChangenotifyCS
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)

◆ GetNotificationServer()

static HWND GetNotificationServer ( BOOL  bCreate)
static

Definition at line 16 of file changenotify.cpp.

17{
18 static HWND s_hwndServer = NULL;
19
20 // use cache if any
21 if (s_hwndServer && IsWindow(s_hwndServer))
22 return s_hwndServer;
23
24 // get the shell window
25 HWND hwndShell = GetShellWindow();
26 if (hwndShell == NULL)
27 {
28 TRACE("GetShellWindow() returned NULL\n");
29 return NULL;
30 }
31
32 // Get the window of the notification server that runs in explorer
33 HWND hwndServer = (HWND)SendMessageW(hwndShell, WM_DESKTOP_GET_CNOTIFY_SERVER, bCreate, 0);
34 if (!IsWindow(hwndServer))
35 {
36 ERR("Unable to get server window\n");
37 hwndServer = NULL;
38 }
39
40 // save and return
41 s_hwndServer = hwndServer;
42 return hwndServer;
43}
#define WM_DESKTOP_GET_CNOTIFY_SERVER
HANDLE HWND
Definition: compat.h:19
_In_ int _In_ BOOL bCreate
Definition: shlobj.h:1525
HWND WINAPI GetShellWindow(void)
Definition: input.c:974
BOOL WINAPI IsWindow(_In_opt_ HWND)

Referenced by CreateNotificationParamAndSend(), FreeChangeNotifications(), SHChangeNotify(), SHChangeNotifyDeregister(), and SHChangeNotifyRegister().

◆ InitChangeNotifications()

EXTERN_C void InitChangeNotifications ( void  )

Definition at line 46 of file changenotify.cpp.

47{
49}
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751

Referenced by if().

◆ NTSHChangeNotifyDeregister()

EXTERN_C DWORD WINAPI NTSHChangeNotifyDeregister ( ULONG  hNotify)

Definition at line 880 of file changenotify.cpp.

881{
882 FIXME("(0x%08x):semi stub.\n", hNotify);
883 return SHChangeNotifyDeregister(hNotify);
884}
#define FIXME(fmt,...)
Definition: precomp.h:53
EXTERN_C BOOL WINAPI SHChangeNotifyDeregister(ULONG hNotify)

◆ NTSHChangeNotifyRegister()

EXTERN_C ULONG WINAPI NTSHChangeNotifyRegister ( HWND  hwnd,
INT  fSources,
LONG  fEvents,
UINT  msg,
INT  count,
SHChangeNotifyEntry idlist 
)

Definition at line 820 of file changenotify.cpp.

822{
824 fEvents, msg, count, idlist);
825}
#define msg(x)
Definition: auth_time.c:54
EXTERN_C ULONG WINAPI SHChangeNotifyRegister(HWND hwnd, INT fSources, LONG wEventMask, UINT uMsg, INT cItems, SHChangeNotifyEntry *lpItems)
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define SHCNRF_NewDelivery
Definition: shlobj.h:1944

◆ SHChangeNotification_Lock()

EXTERN_C HANDLE WINAPI SHChangeNotification_Lock ( HANDLE  hTicket,
DWORD  dwOwnerPID,
LPITEMIDLIST **  lppidls,
LPLONG  lpwEventId 
)

Definition at line 831 of file changenotify.cpp.

833{
834 TRACE("%p %08x %p %p\n", hTicket, dwOwnerPID, lppidls, lpwEventId);
835
836 // create a handbag from the ticket
837 LPHANDBAG pHandbag = DoGetHandbagFromTicket(hTicket, dwOwnerPID);
838 if (pHandbag == NULL || pHandbag->dwMagic != HANDBAG_MAGIC)
839 {
840 ERR("pHandbag is invalid\n");
841 return NULL;
842 }
843
844 // populate parameters from the handbag
845 if (lppidls)
846 *lppidls = pHandbag->pidls;
847 if (lpwEventId)
848 *lpwEventId = (pHandbag->pTicket->wEventId & ~SHCNE_INTERRUPT);
849
850 // return the handbag
851 return pHandbag;
852}
static LPHANDBAG DoGetHandbagFromTicket(HANDLE hTicket, DWORD dwOwnerPID)

Referenced by BrFolder_OnChange(), CChangeNotifyBroker::BrokerNotification(), CDefView::OnChangeNotify(), OnShellNotify(), and testwindow_wndproc().

◆ SHChangeNotification_Unlock()

EXTERN_C BOOL WINAPI SHChangeNotification_Unlock ( HANDLE  hLock)

Definition at line 858 of file changenotify.cpp.

859{
860 TRACE("%p\n", hLock);
861
862 // validate the handbag
863 LPHANDBAG pHandbag = (LPHANDBAG)hLock;
864 if (pHandbag == NULL || pHandbag->dwMagic != HANDBAG_MAGIC)
865 {
866 ERR("pHandbag is invalid\n");
867 return FALSE;
868 }
869
870 // free the handbag
871 BOOL ret = SHUnlockShared(pHandbag->pTicket);
872 LocalFree(hLock);
873 return ret;
874}
return ret
Definition: mutex.c:146
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594

Referenced by BrFolder_OnChange(), CChangeNotifyBroker::BrokerNotification(), CDefView::OnChangeNotify(), OnShellNotify(), and testwindow_wndproc().

◆ SHChangeNotify()

EXTERN_C void WINAPI SHChangeNotify ( LONG  wEventId,
UINT  uFlags,
LPCVOID  dwItem1,
LPCVOID  dwItem2 
)

Definition at line 676 of file changenotify.cpp.

677{
678 TRACE("(0x%08x,0x%08x,%p,%p)\n", wEventId, uFlags, dwItem1, dwItem2);
679
681 return;
682
683 DWORD dwTick = GetTickCount();
684
685 WCHAR szPath1[MAX_PATH], szPath2[MAX_PATH];
686 LPITEMIDLIST pidl1 = NULL, pidl2 = NULL;
687 LPWSTR psz1, psz2;
689 DWORD dwType;
690
691Retry:
692 dwType = (uFlags & SHCNF_TYPE);
693 switch (dwType)
694 {
695 case SHCNF_IDLIST:
696 {
697 if (wEventId == SHCNE_FREESPACE)
698 {
699 szPath1[0] = szPath2[0] = UNICODE_NULL;
700 if (dwItem1)
701 SHGetPathFromIDList((LPCITEMIDLIST)dwItem1, szPath1);
702 if (dwItem2)
703 SHGetPathFromIDList((LPCITEMIDLIST)dwItem2, szPath2);
704
706 dwItem1 = (szPath1[0] ? szPath1 : NULL);
707 dwItem2 = (szPath2[0] ? szPath2 : NULL);
708 goto Retry;
709 }
710
711 pidl1 = (LPITEMIDLIST)dwItem1;
712 pidl2 = (LPITEMIDLIST)dwItem2;
713 break;
714 }
715 case SHCNF_PATHA:
716 case SHCNF_PRINTERA:
717 {
718 psz1 = psz2 = NULL;
719 szPath1[0] = szPath2[0] = UNICODE_NULL;
720 if (dwItem1)
721 {
722 SHAnsiToUnicode((LPCSTR)dwItem1, szPath1, _countof(szPath1));
723 psz1 = szPath1;
724 }
725 if (dwItem2)
726 {
727 SHAnsiToUnicode((LPCSTR)dwItem2, szPath2, _countof(szPath2));
728 psz2 = szPath2;
729 }
730
732 dwItem1 = psz1;
733 dwItem2 = psz2;
734 goto Retry;
735 }
736 case SHCNF_PATHW:
737 {
738 if (wEventId == SHCNE_FREESPACE)
739 {
740 INT iDrive1 = -1, iDrive2 = -1;
741 if (dwItem1)
742 iDrive1 = PathGetDriveNumberW((LPCWSTR)dwItem1);
743 if (dwItem2)
744 iDrive2 = PathGetDriveNumberW((LPCWSTR)dwItem2);
745
746 DWORD dwValue = 0;
747 if (iDrive1 >= 0)
748 dwValue |= (1 << iDrive1);
749 if (iDrive2 >= 0)
750 dwValue |= (1 << iDrive2);
751
752 if (!dwValue)
753 return;
754
756 dwItem1 = UlongToPtr(dwValue);
757 dwItem2 = NULL;
758 goto Retry;
759 }
760
761 if (dwItem1)
762 pidl1 = SHSimpleIDListFromPathW((LPCWSTR)dwItem1);
763 if (dwItem2)
764 pidl2 = SHSimpleIDListFromPathW((LPCWSTR)dwItem2);
765 break;
766 }
767 case SHCNF_PRINTERW:
768 {
769 if (dwItem1)
770 {
771 HRESULT hr = Shell_ParsePrinterName((LPCWSTR)dwItem1, &pidl1, NULL);
773 return;
774 }
775
776 if (dwItem2)
777 {
778 HRESULT hr = Shell_ParsePrinterName((LPCWSTR)dwItem2, &pidl2, NULL);
780 {
781 ILFree(pidl1);
782 return;
783 }
784 }
785 break;
786 }
787 case SHCNF_DWORD:
788 {
789 dwidl.cb = offsetof(SHChangeDWORDAsIDList, cbZero);
790 dwidl.dwItem1 = PtrToUlong(dwItem1);
791 dwidl.dwItem2 = PtrToUlong(dwItem2);
792 dwidl.cbZero = 0;
793 pidl1 = (LPITEMIDLIST)&dwidl;
794 break;
795 }
796 default:
797 {
798 FIXME("Unknown type: 0x%X\n", dwType);
799 return;
800 }
801 }
802
803 if (pidl1 || !wEventId || (wEventId & SHCNE_ASSOCCHANGED))
804 {
805 TRACE("notifying event %s(%x)\n", DumpEvent(wEventId), wEventId);
806 SHChangeNotifyTransmit(wEventId, uFlags, pidl1, pidl2, dwTick);
807 }
808
809 if ((dwType == SHCNF_PATHW) || (dwType == SHCNF_PRINTERW))
810 {
811 ILFree(pidl1);
812 ILFree(pidl2);
813 }
814}
EXTERN_C VOID WINAPI SHChangeNotifyTransmit(LONG lEvent, UINT uFlags, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2, DWORD dwTick)
static HRESULT Shell_ParsePrinterName(_In_ LPCWSTR pszName, _Out_ LPITEMIDLIST *ppidl, _In_ IBindCtx *pBindCtx)
static LPCSTR DumpEvent(LONG event)
_In_ PSCSI_REQUEST_BLOCK _Out_ NTSTATUS _Inout_ BOOLEAN * Retry
Definition: classpnp.h:312
#define MAX_PATH
Definition: compat.h:34
int WINAPI PathGetDriveNumberW(const WCHAR *path)
Definition: path.c:1810
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
Definition: sync.c:182
DWORD WINAPI SHAnsiToUnicode(LPCSTR lpSrcStr, LPWSTR lpDstStr, int iLen)
Definition: string.c:2803
#define FAILED_UNEXPECTEDLY
Definition: utils.cpp:30
#define UlongToPtr(u)
Definition: config.h:106
#define PtrToUlong(u)
Definition: config.h:107
#define UNICODE_NULL
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:1051
LPITEMIDLIST WINAPI SHSimpleIDListFromPathW(LPCWSTR lpszPath)
Definition: pidl.c:1245
#define offsetof(TYPE, MEMBER)
HRESULT hr
Definition: shlfolder.c:183
#define SHCNF_PRINTERW
Definition: shlobj.h:1932
#define SHCNF_PATHA
Definition: shlobj.h:1928
#define SHCNF_PRINTERA
Definition: shlobj.h:1929
#define SHCNF_TYPE
Definition: shlobj.h:1933
#define SHCNF_DWORD
Definition: shlobj.h:1930
#define SHCNE_ASSOCCHANGED
Definition: shlobj.h:1916
#define SHCNF_PATHW
Definition: shlobj.h:1931
#define SHCNE_FREESPACE
Definition: shlobj.h:1913
#define SHGetPathFromIDList
Definition: shlobj.h:244
#define SHCNF_IDLIST
Definition: shlobj.h:1927
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
const char * LPCSTR
Definition: xmlstorage.h:183
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by CFSDropTarget::_DoDrop(), COpenWithDialog::Accept(), CRecycleBin_ChangeNotifyBBItem(), delete_files(), DeleteExt(), CDefaultContextMenu::DoCreateNewFolder(), DoInstallFontFile(), DrivesContextMenuCallback(), EditTypeDlg_OnOK(), FinishDlgProc(), FormatDriveThread(), HandleDesktopIniOp(), CZipCreatorImpl::JustDoIt(), NotifyFileSystemChange(), CLayerUIPropPage::OnApply(), CDesktopBrowser::OnDeviceChange(), CShellLink::OnNotify(), CShellLink::Save(), CNewMenu::SelectNewItem(), CDrivesFolder::SetDriveLabel(), CRegFolder::SetNameOf(), SHChangeNotifyWrap(), SHNotifyCopyFileW(), SHNotifyCreateDirectoryW(), SHNotifyDeleteFileW(), SHNotifyMoveFileW(), SHNotifyRemoveDirectoryW(), SHUpdateRecycleBinIcon(), StageThreadFunc(), test_SHChangeNotify(), VfdCloseImage(), VfdOpenImage(), WelcomeDlgProc(), and CIniPropertyBag::Write().

◆ SHChangeNotifyDeregister()

EXTERN_C BOOL WINAPI SHChangeNotifyDeregister ( ULONG  hNotify)

Definition at line 577 of file changenotify.cpp.

578{
579 TRACE("(0x%08x)\n", hNotify);
580
581 // get the server window
582 HWND hwndServer = GetNotificationServer(FALSE);
583 if (hwndServer == NULL)
584 return FALSE;
585
586 // send CN_UNREGISTER message and try to unregister
587 BOOL ret = (BOOL)SendMessageW(hwndServer, CN_UNREGISTER, hNotify, 0);
588 if (!ret)
589 ERR("CN_UNREGISTER failed\n");
590
591 return ret;
592}
#define CN_UNREGISTER
#define BOOL
Definition: nt_native.h:43

Referenced by BrFolder_OnDestroy(), NTSHChangeNotifyDeregister(), CDefView::OnDestroy(), CISFBand::RegisterChangeNotify(), test_SHChangeNotify(), UnInitSHCN(), and CRecycleBinFolderViewCB::~CRecycleBinFolderViewCB().

◆ SHChangeNotifyReceive()

EXTERN_C VOID WINAPI SHChangeNotifyReceive ( LONG  lEvent,
UINT  uFlags,
LPCITEMIDLIST  pidl1,
LPCITEMIDLIST  pidl2 
)

Definition at line 661 of file changenotify.cpp.

662{
664}
EXTERN_C VOID WINAPI SHChangeNotifyReceiveEx(LONG lEvent, UINT uFlags, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2, DWORD dwTick)
HANDLE lEvent
Definition: tftpd.cpp:56

◆ SHChangeNotifyReceiveEx()

EXTERN_C VOID WINAPI SHChangeNotifyReceiveEx ( LONG  lEvent,
UINT  uFlags,
LPCITEMIDLIST  pidl1,
LPCITEMIDLIST  pidl2,
DWORD  dwTick 
)

Definition at line 650 of file changenotify.cpp.

652{
653 // TODO: Queueing notifications
654 CreateNotificationParamAndSend(lEvent, uFlags, pidl1, pidl2, dwTick);
655}
static void CreateNotificationParamAndSend(LONG wEventId, UINT uFlags, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2, DWORD dwTick)

Referenced by SHChangeNotifyReceive(), and SHChangeNotifyTransmit().

◆ SHChangeNotifyRegister()

EXTERN_C ULONG WINAPI SHChangeNotifyRegister ( HWND  hwnd,
INT  fSources,
LONG  wEventMask,
UINT  uMsg,
INT  cItems,
SHChangeNotifyEntry lpItems 
)

Definition at line 443 of file changenotify.cpp.

445{
446 HWND hwndServer, hwndBroker = NULL;
447 HANDLE hRegEntry;
448 INT iItem;
449 ULONG nRegID = INVALID_REG_ID;
450 DWORD dwOwnerPID;
451 LPREGENTRY pRegEntry;
452
453 TRACE("(%p,0x%08x,0x%08x,0x%08x,%d,%p)\n",
454 hwnd, fSources, wEventMask, uMsg, cItems, lpItems);
455
456 // sanity check
457 if (wEventMask == 0 || cItems <= 0 || cItems > 0x7FFF || lpItems == NULL ||
458 hwnd == NULL || !IsWindow(hwnd))
459 {
460 return INVALID_REG_ID;
461 }
462
463 // request the window of the server
464 hwndServer = GetNotificationServer(TRUE);
465 if (hwndServer == NULL)
466 return INVALID_REG_ID;
467
468 // disable recursive interrupt in specific condition
469 if ((fSources & SHCNRF_RecursiveInterrupt) && !(fSources & SHCNRF_InterruptLevel))
470 {
471 fSources &= ~SHCNRF_RecursiveInterrupt;
472 }
473
474 // if it is old delivery method, then create a broker window
475 if ((fSources & SHCNRF_NewDelivery) == 0)
476 {
477 hwndBroker = hwnd = CreateNotificationBroker(hwnd, uMsg);
479 }
480
481 // The owner PID is the process ID of the server
482 GetWindowThreadProcessId(hwndServer, &dwOwnerPID);
483
485 for (iItem = 0; iItem < cItems; ++iItem)
486 {
487 // create a registration entry
488 hRegEntry = CreateRegistrationParam(nRegID, hwnd, uMsg, fSources, wEventMask,
489 lpItems[iItem].fRecursive, lpItems[iItem].pidl,
490 dwOwnerPID, hwndBroker);
491 if (hRegEntry)
492 {
493 TRACE("CN_REGISTER: hwnd:%p, hRegEntry:%p, pid:0x%lx\n",
494 hwndServer, hRegEntry, dwOwnerPID);
495
496 // send CN_REGISTER to the server
497 SendMessageW(hwndServer, CN_REGISTER, (WPARAM)hRegEntry, dwOwnerPID);
498
499 // update nRegID
500 pRegEntry = (LPREGENTRY)SHLockSharedEx(hRegEntry, dwOwnerPID, FALSE);
501 if (pRegEntry)
502 {
503 nRegID = pRegEntry->nRegID;
504 SHUnlockShared(pRegEntry);
505 }
506
507 // free registration entry
508 SHFreeShared(hRegEntry, dwOwnerPID);
509 }
510
511 if (nRegID == INVALID_REG_ID)
512 {
513 ERR("Delivery failed\n");
514
515 if (hwndBroker)
516 {
517 // destroy the broker
518 DestroyWindow(hwndBroker);
519 }
520 break;
521 }
522
523 // PIDL alias
524 LPITEMIDLIST apidlAlias[2];
525 if (DoGetAliasPIDLs(apidlAlias, lpItems[iItem].pidl))
526 {
527 if (apidlAlias[0])
528 {
529 // create another registration entry
530 hRegEntry = CreateRegistrationParam(nRegID, hwnd, uMsg, fSources, wEventMask,
531 lpItems[iItem].fRecursive, apidlAlias[0],
532 dwOwnerPID, hwndBroker);
533 if (hRegEntry)
534 {
535 TRACE("CN_REGISTER: hwnd:%p, hRegEntry:%p, pid:0x%lx\n",
536 hwndServer, hRegEntry, dwOwnerPID);
537
538 // send CN_REGISTER to the server
539 SendMessageW(hwndServer, CN_REGISTER, (WPARAM)hRegEntry, dwOwnerPID);
540
541 // free registration entry
542 SHFreeShared(hRegEntry, dwOwnerPID);
543 }
544 ILFree(apidlAlias[0]);
545 }
546
547 if (apidlAlias[1])
548 {
549 // create another registration entry
550 hRegEntry = CreateRegistrationParam(nRegID, hwnd, uMsg, fSources, wEventMask,
551 lpItems[iItem].fRecursive, apidlAlias[1],
552 dwOwnerPID, hwndBroker);
553 if (hRegEntry)
554 {
555 TRACE("CN_REGISTER: hwnd:%p, hRegEntry:%p, pid:0x%lx\n",
556 hwndServer, hRegEntry, dwOwnerPID);
557
558 // send CN_REGISTER to the server
559 SendMessageW(hwndServer, CN_REGISTER, (WPARAM)hRegEntry, dwOwnerPID);
560
561 // free registration entry
562 SHFreeShared(hRegEntry, dwOwnerPID);
563 }
564 ILFree(apidlAlias[1]);
565 }
566 }
567 }
569
570 return nRegID;
571}
#define CN_REGISTER
#define WM_BROKER_NOTIFICATION
#define INVALID_REG_ID
static HWND CreateNotificationBroker(HWND hwnd, UINT wMsg)
static BOOL DoGetAliasPIDLs(LPITEMIDLIST apidls[2], PCIDLIST_ABSOLUTE pidl)
static HANDLE CreateRegistrationParam(ULONG nRegID, HWND hwnd, UINT wMsg, INT fSources, LONG fEvents, LONG fRecursive, LPCITEMIDLIST pidl, DWORD dwOwnerPID, HWND hwndBroker)
#define SHCNRF_RecursiveInterrupt
Definition: shlobj.h:1943
#define SHCNRF_InterruptLevel
Definition: shlobj.h:1941
uint32_t ULONG
Definition: typedefs.h:59
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by BrFolder_OnInitDialog(), InitSHCN(), NTSHChangeNotifyRegister(), CDefView::OnCreate(), CISFBand::RegisterChangeNotify(), CRecycleBinFolderViewCB::RegisterChangeNotify(), and test_SHChangeNotify().

◆ SHChangeNotifySuspendResume()

EXTERN_C BOOL WINAPI SHChangeNotifySuspendResume ( BOOL  bSuspend,
LPITEMIDLIST  pidl,
BOOL  bRecursive,
DWORD  dwReserved 
)

Definition at line 891 of file changenotify.cpp.

895{
896 FIXME("SHChangeNotifySuspendResume() stub\n");
897 return FALSE;
898}

◆ SHChangeNotifyTransmit()

EXTERN_C VOID WINAPI SHChangeNotifyTransmit ( LONG  lEvent,
UINT  uFlags,
LPCITEMIDLIST  pidl1,
LPCITEMIDLIST  pidl2,
DWORD  dwTick 
)

Definition at line 667 of file changenotify.cpp.

668{
669 SHChangeNotifyReceiveEx(lEvent, uFlags, pidl1, pidl2, dwTick);
670}

Referenced by SHChangeNotify().

◆ SHChangeNotifyUpdateEntryList()

EXTERN_C BOOL WINAPI SHChangeNotifyUpdateEntryList ( DWORD  unknown1,
DWORD  unknown2,
DWORD  unknown3,
DWORD  unknown4 
)

Definition at line 598 of file changenotify.cpp.

600{
601 FIXME("(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
602 unknown1, unknown2, unknown3, unknown4);
603 return TRUE;
604}

◆ SHChangeRegistrationReceive()

EXTERN_C BOOL WINAPI SHChangeRegistrationReceive ( LPVOID  lpUnknown1,
DWORD  dwUnknown2 
)

Definition at line 643 of file changenotify.cpp.

644{
645 TRACE("\n");
646 return FALSE; /* Just return FALSE */
647}

◆ Shell_ParsePrinterName()

static HRESULT Shell_ParsePrinterName ( _In_ LPCWSTR  pszName,
_Out_ LPITEMIDLIST ppidl,
_In_ IBindCtx pBindCtx 
)
static

Definition at line 61 of file changenotify.cpp.

65{
66 *ppidl = NULL;
67
68 CComHeapPtr<ITEMIDLIST> pidlPrinters;
71 return hr;
72
74 hr = SHBindToObject(NULL, pidlPrinters, IID_PPV_ARG(IShellFolder, &pFolder));
76 return hr;
77
79 hr = pFolder->ParseDisplayName(NULL, pBindCtx, (LPWSTR)pszName, NULL, &pidlTemp, NULL);
81 return hr;
82
83 return SHILCombine(pidlPrinters, pidlTemp, ppidl);
84}
EXTERN_C HRESULT SHBindToObject(_In_opt_ IShellFolder *psf, _In_ LPCITEMIDLIST pidl, _In_ REFIID riid, _Out_ void **ppvObj)
Definition: utils.cpp:360
#define CSIDL_PRINTERS
Definition: shlobj.h:2183
#define IID_PPV_ARG(Itype, ppType)

Referenced by SHChangeNotify().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shcn  )

Variable Documentation

◆ AliasPIDLs

ALIAS_PIDL AliasPIDLs[]
static
Initial value:
=
{
}
#define CSIDL_COMMON_DESKTOPDIRECTORY
Definition: shlobj.h:2203
#define CSIDL_DESKTOPDIRECTORY
Definition: shlobj.h:2194
#define CSIDL_PERSONAL
Definition: shlobj.h:2184
#define CSIDL_DESKTOP
Definition: shlobj.h:2179

Definition at line 385 of file changenotify.cpp.

Referenced by DoGetAliasPIDLs(), and DoInitAliasPIDLs().

◆ SHELL32_ChangenotifyCS

CRITICAL_SECTION SHELL32_ChangenotifyCS