ReactOS  0.4.15-dev-1374-g8d3e80e
SHChangeNotify.cpp File Reference
#include "shelltest.h"
#include <shlwapi.h>
#include <stdio.h>
#include "SHChangeNotify.h"
Include dependency graph for SHChangeNotify.cpp:

Go to the source code of this file.

Classes

struct  TEST_ENTRY
 

Macros

#define DONT_SEND   0x24242424
 
#define s_TestEntriesMode1   s_TestEntriesMode0
 
#define s_TestEntriesMode2   s_TestEntriesMode0
 

Typedefs

typedef void(* ACTION) (void)
 
typedef struct TEST_ENTRY TEST_ENTRY
 

Functions

static BOOL DoCreateEmptyFile (LPCWSTR pszFileName)
 
static void DoAction1 (void)
 
static void DoAction2 (void)
 
static void DoAction3 (void)
 
static void DoAction4 (void)
 
static void DoAction5 (void)
 
static void DoAction6 (void)
 
static void DoAction7 (void)
 
static void DoAction8 (void)
 
LPCSTR PatternFromFlags (DWORD flags)
 
static BOOL DoGetPaths (LPWSTR pszPath1, LPWSTR pszPath2)
 
static void DoTestEntry (const TEST_ENTRY *entry)
 
static BOOL DoInit (void)
 
static void DoEnd (HWND hwnd)
 
static BOOL GetSubProgramPath (void)
 
static void JustDoIt (INT nMode)
 
 START_TEST (SHChangeNotify)
 

Variables

static HWND s_hwnd = NULL
 
static const WCHAR s_szName [] = L"SHChangeNotify testcase"
 
static WCHAR s_szSubProgram [MAX_PATH]
 
static const TEST_ENTRY s_TestEntriesMode0 []
 
static const TEST_ENTRY s_TestEntriesMode3 []
 
static const TEST_ENTRY s_TestEntriesMode4 []
 
static const TEST_ENTRY s_TestEntriesMode5 []
 

Macro Definition Documentation

◆ DONT_SEND

#define DONT_SEND   0x24242424

Definition at line 15 of file SHChangeNotify.cpp.

◆ s_TestEntriesMode1

#define s_TestEntriesMode1   s_TestEntriesMode0

Definition at line 121 of file SHChangeNotify.cpp.

◆ s_TestEntriesMode2

#define s_TestEntriesMode2   s_TestEntriesMode0

Definition at line 122 of file SHChangeNotify.cpp.

Typedef Documentation

◆ ACTION

typedef void(* ACTION) (void)

Definition at line 21 of file SHChangeNotify.cpp.

◆ TEST_ENTRY

Function Documentation

◆ DoAction1()

static void DoAction1 ( void  )
static

Definition at line 44 of file SHChangeNotify.cpp.

45 {
47 }
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
#define TRUE
Definition: types.h:120
static WCHAR s_dir2[MAX_PATH]
#define ok_int(expression, result)
Definition: atltest.h:134
#define NULL
Definition: types.h:112

◆ DoAction2()

static void DoAction2 ( void  )
static

Definition at line 50 of file SHChangeNotify.cpp.

51 {
53 }
#define TRUE
Definition: types.h:120
static WCHAR s_dir2[MAX_PATH]
#define ok_int(expression, result)
Definition: atltest.h:134
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
Definition: dir.c:732

◆ DoAction3()

static void DoAction3 ( void  )
static

Definition at line 56 of file SHChangeNotify.cpp.

57 {
59 }
static WCHAR s_dir3[MAX_PATH]
#define MOVEFILE_REPLACE_EXISTING
Definition: filesup.h:28
#define TRUE
Definition: types.h:120
#define MOVEFILE_COPY_ALLOWED
Definition: filesup.h:29
static WCHAR s_dir2[MAX_PATH]
#define ok_int(expression, result)
Definition: atltest.h:134
BOOL WINAPI MoveFileExW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName OPTIONAL, IN DWORD dwFlags)
Definition: move.c:1060

◆ DoAction4()

static void DoAction4 ( void  )
static

Definition at line 62 of file SHChangeNotify.cpp.

63 {
65 }
static WCHAR s_file1[MAX_PATH]
static BOOL DoCreateEmptyFile(LPCWSTR pszFileName)
#define TRUE
Definition: types.h:120
#define ok_int(expression, result)
Definition: atltest.h:134

◆ DoAction5()

static void DoAction5 ( void  )
static

Definition at line 68 of file SHChangeNotify.cpp.

69 {
71 }
static WCHAR s_file1[MAX_PATH]
#define MOVEFILE_REPLACE_EXISTING
Definition: filesup.h:28
#define TRUE
Definition: types.h:120
#define MOVEFILE_COPY_ALLOWED
Definition: filesup.h:29
#define ok_int(expression, result)
Definition: atltest.h:134
static WCHAR s_file2[MAX_PATH]
BOOL WINAPI MoveFileExW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName OPTIONAL, IN DWORD dwFlags)
Definition: move.c:1060

◆ DoAction6()

static void DoAction6 ( void  )
static

Definition at line 74 of file SHChangeNotify.cpp.

75 {
77 }
#define TRUE
Definition: types.h:120
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
#define ok_int(expression, result)
Definition: atltest.h:134
static WCHAR s_file2[MAX_PATH]

◆ DoAction7()

static void DoAction7 ( void  )
static

Definition at line 80 of file SHChangeNotify.cpp.

81 {
85 }
static WCHAR s_file1[MAX_PATH]
static WCHAR s_dir3[MAX_PATH]
#define TRUE
Definition: types.h:120
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
#define ok_int(expression, result)
Definition: atltest.h:134
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
Definition: dir.c:732
static WCHAR s_file2[MAX_PATH]

◆ DoAction8()

static void DoAction8 ( void  )
static

Definition at line 88 of file SHChangeNotify.cpp.

89 {
91  ok(ret, "RemoveDirectoryW failed. GetLastError() == %ld\n", GetLastError());
92 }
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
static WCHAR s_dir1[MAX_PATH]
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
Definition: dir.c:732
int ret
#define ok(value,...)
Definition: atltest.h:57

◆ DoCreateEmptyFile()

static BOOL DoCreateEmptyFile ( LPCWSTR  pszFileName)
static

Definition at line 36 of file SHChangeNotify.cpp.

37 {
38  FILE *fp = _wfopen(pszFileName, L"wb");
39  fclose(fp);
40  return fp != NULL;
41 }
_Check_return_ _CRTIMP FILE *__cdecl _wfopen(_In_z_ const wchar_t *_Filename, _In_z_ const wchar_t *_Mode)
WORD WORD PSZ PSZ pszFileName
Definition: vdmdbg.h:41
static const WCHAR L[]
Definition: oid.c:1250
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
#define NULL
Definition: types.h:112

Referenced by DoAction4().

◆ DoEnd()

static void DoEnd ( HWND  hwnd)
static

Definition at line 308 of file SHChangeNotify.cpp.

309 {
316 
318 }
static WCHAR s_file1[MAX_PATH]
#define IDOK
Definition: winuser.h:824
static WCHAR s_dir3[MAX_PATH]
static WCHAR s_dir2[MAX_PATH]
static WCHAR s_dir1[MAX_PATH]
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
Definition: dir.c:732
#define WM_COMMAND
Definition: winuser.h:1722
static WCHAR s_file2[MAX_PATH]
#define TEMP_FILE
Definition: SHChangeNotify.h:3
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static HWND s_hwnd

Referenced by JustDoIt().

◆ DoGetPaths()

static BOOL DoGetPaths ( LPWSTR  pszPath1,
LPWSTR  pszPath2 
)
static

Definition at line 205 of file SHChangeNotify.cpp.

206 {
207  pszPath1[0] = pszPath2[0] = 0;
208 
209  WCHAR szText[MAX_PATH * 2];
210  szText[0] = 0;
211  if (FILE *fp = fopen(TEMP_FILE, "rb"))
212  {
213  fread(szText, 1, sizeof(szText), fp);
214  fclose(fp);
215  }
216 
217  LPWSTR pch = wcschr(szText, L'|');
218  if (pch == NULL)
219  return FALSE;
220 
221  *pch = 0;
222  lstrcpynW(pszPath1, szText, MAX_PATH);
223  lstrcpynW(pszPath2, pch + 1, MAX_PATH);
224  return TRUE;
225 }
#define TRUE
Definition: types.h:120
#define pch(ap)
Definition: match.c:418
#define lstrcpynW
Definition: compat.h:597
_Check_return_opt_ _CRTIMP size_t __cdecl fread(_Out_writes_bytes_(_ElementSize *_Count) void *_DstBuf, _In_ size_t _ElementSize, _In_ size_t _Count, _Inout_ FILE *_File)
#define FALSE
Definition: types.h:117
static const WCHAR szText[]
Definition: dialog.c:139
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
static const WCHAR L[]
Definition: oid.c:1250
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
#define TEMP_FILE
Definition: SHChangeNotify.h:3
#define NULL
Definition: types.h:112
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by DoTestEntry().

◆ DoInit()

static BOOL DoInit ( void  )
static

Definition at line 284 of file SHChangeNotify.cpp.

285 {
286  DoInitPaths();
287 
289 
290  // close Explorer before tests
291  INT i, nCount = 50;
292  for (i = 0; i < nCount; ++i)
293  {
294  HWND hwnd = FindWindowW(L"CabinetWClass", NULL);
295  if (hwnd == NULL)
296  break;
297 
298  PostMessage(hwnd, WM_CLOSE, 0, 0);
299  Sleep(100);
300  }
301  if (i == nCount)
302  skip("Unable to close Explorer cabinet\n");
303 
304  return PathIsDirectoryW(s_dir1);
305 }
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:1702
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
void DoInitPaths(void)
static WCHAR s_dir1[MAX_PATH]
int32_t INT
Definition: typedefs.h:58
#define PostMessage
Definition: winuser.h:5807
HWND WINAPI FindWindowW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR)
#define WM_CLOSE
Definition: winuser.h:1603
static const WCHAR L[]
Definition: oid.c:1250
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
#define NULL
Definition: types.h:112
#define skip(...)
Definition: atltest.h:64

Referenced by ExpAllocateHandleTableEntrySlow(), ExpAllocateLowLevelTable(), ExpAllocateMidLevelTable(), and JustDoIt().

◆ DoTestEntry()

static void DoTestEntry ( const TEST_ENTRY entry)
static

Definition at line 228 of file SHChangeNotify.cpp.

229 {
230  if (entry->action)
231  {
232  (*entry->action)();
233  }
234 
235  if (entry->event != DONT_SEND)
236  {
237  SHChangeNotify(entry->event, SHCNF_PATHW | SHCNF_FLUSH, entry->item1, entry->item2);
238  }
239  else
240  {
242  }
243 
246 
247  if (entry->pattern)
248  {
249  ok(lstrcmpA(pattern, entry->pattern) == 0 ||
250  lstrcmpA(pattern, "00000100") == 0, // SHCNE_UPDATEDIR
251  "Line %d: pattern mismatch '%s'\n", entry->line, pattern);
252  }
253 
255  Sleep(50);
256 
257  WCHAR szPath1[MAX_PATH], szPath2[MAX_PATH];
258  szPath1[0] = szPath2[0] = 0;
259  BOOL bOK = DoGetPaths(szPath1, szPath2);
260 
261  if (lstrcmpA(pattern, "00000100") == 0) // SHCNE_UPDATEDIR
262  {
263  if (entry->path1)
264  ok(bOK && lstrcmpiW(s_dir1, szPath1) == 0,
265  "Line %d: path1 mismatch '%S' (%d)\n", entry->line, szPath1, bOK);
266  if (entry->path2)
267  ok(bOK && lstrcmpiW(L"", szPath2) == 0,
268  "Line %d: path2 mismatch '%S' (%d)\n", entry->line, szPath2, bOK);
269  }
270  else
271  {
272  if (entry->path1)
273  ok(bOK && lstrcmpiW(entry->path1, szPath1) == 0,
274  "Line %d: path1 mismatch '%S' (%d)\n", entry->line, szPath1, bOK);
275  if (entry->path2)
276  ok(bOK && lstrcmpiW(entry->path2, szPath2) == 0,
277  "Line %d: path2 mismatch '%S' (%d)\n", entry->line, szPath2, bOK);
278  }
279 
281 }
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:18
static BOOL DoGetPaths(LPWSTR pszPath1, LPWSTR pszPath2)
static WCHAR s_dir1[MAX_PATH]
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WM_CLEAR_FLAGS
LPCSTR PatternFromFlags(DWORD flags)
#define WM_SET_PATHS
const char * LPCSTR
Definition: xmlstorage.h:183
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
#define DONT_SEND
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WM_GET_NOTIFY_FLAGS
GLbitfield flags
Definition: glext.h:7161
EXTERN_C void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
static const WCHAR L[]
Definition: oid.c:1250
#define SHCNF_FLUSH
Definition: shlobj.h:1767
uint32_t entry
Definition: isohybrid.c:63
#define SHCNF_PATHW
Definition: shlobj.h:1764
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
static HWND s_hwnd
GLubyte * pattern
Definition: glext.h:7787

Referenced by JustDoIt().

◆ GetSubProgramPath()

static BOOL GetSubProgramPath ( void  )
static

Definition at line 321 of file SHChangeNotify.cpp.

322 {
325  PathAppendW(s_szSubProgram, L"shell-notify.exe");
326 
328  {
330  PathAppendW(s_szSubProgram, L"testdata\\shell-notify.exe");
331 
333  {
334  return FALSE;
335  }
336  }
337 
338  return TRUE;
339 }
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
BOOL WINAPI PathRemoveFileSpecW(LPWSTR lpszPath)
Definition: path.c:624
static WCHAR s_szSubProgram[MAX_PATH]
#define TRUE
Definition: types.h:120
BOOL WINAPI PathAppendW(LPWSTR lpszPath, LPCWSTR lpszAppend)
Definition: path.c:121
#define FALSE
Definition: types.h:117
BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
Definition: path.c:1756
#define _countof(array)
Definition: sndvol32.h:68
static const WCHAR L[]
Definition: oid.c:1250
#define NULL
Definition: types.h:112

Referenced by START_TEST().

◆ JustDoIt()

static void JustDoIt ( INT  nMode)
static

Definition at line 342 of file SHChangeNotify.cpp.

343 {
344  trace("nMode: %d\n", nMode);
346 
347  if (!DoInit())
348  {
349  skip("Unable to initialize.\n");
350  return;
351  }
352 
353  WCHAR szParams[8];
354  wsprintfW(szParams, L"%u", nMode);
355 
357  if ((INT_PTR)hinst <= 32)
358  {
359  skip("Unable to run shell-notify.exe.\n");
360  return;
361  }
362 
363  for (int i = 0; i < 15; ++i)
364  {
366  if (s_hwnd)
367  break;
368 
369  Sleep(50);
370  }
371 
372  if (!s_hwnd)
373  {
374  skip("Unable to find window.\n");
375  return;
376  }
377 
378  switch (nMode)
379  {
380  case 0:
381  case 1:
382  case 2:
383  for (size_t i = 0; i < _countof(s_TestEntriesMode0); ++i)
384  {
386  }
387  break;
388  case 3:
389  for (size_t i = 0; i < _countof(s_TestEntriesMode3); ++i)
390  {
392  }
393  break;
394  case 4:
395  for (size_t i = 0; i < _countof(s_TestEntriesMode4); ++i)
396  {
398  }
399  break;
400  case 5:
401  for (size_t i = 0; i < _countof(s_TestEntriesMode5); ++i)
402  {
404  }
405  break;
406  }
407 
408  DoEnd(s_hwnd);
409 
410  for (int i = 0; i < 15; ++i)
411  {
413  if (!s_hwnd)
414  break;
415 
416  Sleep(50);
417  }
418 }
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
static WCHAR s_szSubProgram[MAX_PATH]
static const TEST_ENTRY s_TestEntriesMode4[]
static const TEST_ENTRY s_TestEntriesMode0[]
int32_t INT_PTR
Definition: typedefs.h:64
static BOOL DoInit(void)
static void DoEnd(HWND hwnd)
static const TEST_ENTRY s_TestEntriesMode3[]
#define trace
Definition: atltest.h:70
__wchar_t WCHAR
Definition: xmlstorage.h:180
HWND WINAPI FindWindowW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR)
#define _countof(array)
Definition: sndvol32.h:68
static const WCHAR s_szName[]
EXTERN_C void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
static const WCHAR L[]
Definition: oid.c:1250
#define SHCNF_FLUSH
Definition: shlobj.h:1767
static void DoTestEntry(const TEST_ENTRY *entry)
#define SW_SHOWNORMAL
Definition: winuser.h:764
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
#define NULL
Definition: types.h:112
static HWND s_hwnd
static const TEST_ENTRY s_TestEntriesMode5[]
#define skip(...)
Definition: atltest.h:64
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2274
static HINSTANCE hinst
Definition: edit.c:551

Referenced by START_TEST().

◆ PatternFromFlags()

LPCSTR PatternFromFlags ( DWORD  flags)

Definition at line 192 of file SHChangeNotify.cpp.

193 {
194  static char s_buf[TYPE_RENAMEFOLDER + 1 + 1];
195  DWORD i;
196  for (i = 0; i <= TYPE_RENAMEFOLDER; ++i)
197  {
198  s_buf[i] = (char)('0' + !!(flags & (1 << i)));
199  }
200  s_buf[i] = 0;
201  return s_buf;
202 }
unsigned char
Definition: typeof.h:29
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
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

Referenced by DoTestEntry().

◆ START_TEST()

START_TEST ( SHChangeNotify  )

Definition at line 420 of file SHChangeNotify.cpp.

421 {
422  if (!GetSubProgramPath())
423  {
424  skip("shell-notify.exe not found\n");
425  }
426 
427  JustDoIt(0);
428  JustDoIt(1);
429  JustDoIt(2);
430  JustDoIt(3);
431  JustDoIt(4);
432  JustDoIt(5);
433 }
static BOOL GetSubProgramPath(void)
#define skip(...)
Definition: atltest.h:64
static void JustDoIt(INT nMode)

Variable Documentation

◆ s_hwnd

HWND s_hwnd = NULL
static

Definition at line 17 of file SHChangeNotify.cpp.

Referenced by DoEnd(), DoTestEntry(), and JustDoIt().

◆ s_szName

const WCHAR s_szName[] = L"SHChangeNotify testcase"
static

Definition at line 18 of file SHChangeNotify.cpp.

Referenced by JustDoIt().

◆ s_szSubProgram

WCHAR s_szSubProgram[MAX_PATH]
static

Definition at line 19 of file SHChangeNotify.cpp.

Referenced by GetSubProgramPath(), and JustDoIt().

◆ s_TestEntriesMode0

const TEST_ENTRY s_TestEntriesMode0[]
static
Initial value:
=
{
{__LINE__, SHCNE_RMDIR, s_dir2, NULL, "00001000", NULL, s_dir2, L""},
{__LINE__, SHCNE_RMDIR, s_dir2, NULL, "00001000", DoAction2, s_dir2, L""},
{__LINE__, SHCNE_MKDIR, s_dir2, NULL, "00010000", DoAction1, s_dir2, L""},
{__LINE__, SHCNE_RENAMEFOLDER, s_dir2, s_dir3, "00000001", NULL, s_dir2, s_dir3},
{__LINE__, SHCNE_RENAMEFOLDER, s_dir2, s_dir3, "00000001", DoAction3, s_dir2, s_dir3},
{__LINE__, SHCNE_CREATE, s_file1, NULL, "01000000", NULL, s_file1, L""},
{__LINE__, SHCNE_CREATE, s_file1, s_file2, "01000000", NULL, s_file1, s_file2},
{__LINE__, SHCNE_CREATE, s_file1, NULL, "01000000", DoAction4, s_file1, L""},
{__LINE__, SHCNE_RENAMEITEM, s_file1, s_file2, "10000000", NULL, s_file1, s_file2},
{__LINE__, SHCNE_RENAMEITEM, s_file1, s_file2, "10000000", DoAction5, s_file1, s_file2},
{__LINE__, SHCNE_RENAMEITEM, s_file1, s_file2, "10000000", NULL, s_file1, s_file2},
{__LINE__, SHCNE_UPDATEITEM, s_file1, NULL, "00000010", NULL, s_file1, L""},
{__LINE__, SHCNE_UPDATEITEM, s_file2, NULL, "00000010", NULL, s_file2, L""},
{__LINE__, SHCNE_DELETE, s_file1, NULL, "00100000", NULL, s_file1, L""},
{__LINE__, SHCNE_DELETE, s_file2, NULL, "00100000", NULL, s_file2, L""},
{__LINE__, SHCNE_DELETE, s_file2, NULL, "00100000", DoAction6, s_file2, L""},
{__LINE__, SHCNE_DELETE, s_file2, NULL, "00100000", NULL, s_file2, L""},
{__LINE__, SHCNE_DELETE, s_file1, NULL, "00100000", NULL, s_file1, L""},
{__LINE__, SHCNE_RMDIR, s_dir2, NULL, "00001000", NULL, s_dir2, L""},
{__LINE__, SHCNE_RMDIR, s_dir3, NULL, "00001000", DoAction7, s_dir3, L""},
{__LINE__, SHCNE_RMDIR, s_dir1, NULL, "00001000", NULL, s_dir1, L""},
{__LINE__, SHCNE_RMDIR, s_dir1, NULL, "00001000", DoAction8, s_dir1, L""},
}
#define SHCNE_MKDIR
Definition: shlobj.h:1732
static WCHAR s_file1[MAX_PATH]
#define SHCNE_RMDIR
Definition: shlobj.h:1733
static WCHAR s_dir3[MAX_PATH]
#define SHCNE_RENAMEFOLDER
Definition: shlobj.h:1746
static WCHAR s_dir2[MAX_PATH]
#define SHCNE_RENAMEITEM
Definition: shlobj.h:1729
static WCHAR s_dir1[MAX_PATH]
static void DoAction4(void)
static void DoAction2(void)
static void DoAction6(void)
static const WCHAR L[]
Definition: oid.c:1250
static void DoAction1(void)
static void DoAction7(void)
static void DoAction3(void)
static WCHAR s_file2[MAX_PATH]
#define SHCNE_DELETE
Definition: shlobj.h:1731
#define NULL
Definition: types.h:112
static void DoAction5(void)
static void DoAction8(void)
#define SHCNE_CREATE
Definition: shlobj.h:1730
#define SHCNE_UPDATEITEM
Definition: shlobj.h:1742

Definition at line 94 of file SHChangeNotify.cpp.

Referenced by JustDoIt().

◆ s_TestEntriesMode3

const TEST_ENTRY s_TestEntriesMode3[]
static
Initial value:
=
{
{__LINE__, DONT_SEND, s_dir2, NULL, "00001000", DoAction2, s_dir2, L""},
{__LINE__, DONT_SEND, s_dir2, NULL, "00010000", DoAction1, s_dir2, L""},
{__LINE__, DONT_SEND, s_dir2, s_dir3, "00000001", DoAction3, s_dir2, s_dir3},
{__LINE__, DONT_SEND, s_file1, NULL, "01000000", DoAction4, s_file1, L""},
{__LINE__, DONT_SEND, s_file1, s_file2, "10000000", DoAction5, s_file1, s_file2},
{__LINE__, DONT_SEND, s_file2, NULL, "00100000", DoAction6, s_file2, L""},
{__LINE__, DONT_SEND, s_dir3, NULL, "00001000", DoAction7, s_dir3, L""},
{__LINE__, SHCNE_MKDIR, s_dir2, NULL, "00000000", NULL, NULL, NULL},
{__LINE__, SHCNE_INTERRUPT | SHCNE_MKDIR, s_dir2, NULL, "00000000", NULL, NULL, NULL},
}
#define SHCNE_MKDIR
Definition: shlobj.h:1732
static WCHAR s_file1[MAX_PATH]
static WCHAR s_dir3[MAX_PATH]
#define SHCNE_INTERRUPT
Definition: shlobj.h:1754
static WCHAR s_dir2[MAX_PATH]
static void DoAction4(void)
static void DoAction2(void)
#define DONT_SEND
static void DoAction6(void)
static const WCHAR L[]
Definition: oid.c:1250
static void DoAction1(void)
static void DoAction7(void)
static void DoAction3(void)
static WCHAR s_file2[MAX_PATH]
#define NULL
Definition: types.h:112
static void DoAction5(void)

Definition at line 124 of file SHChangeNotify.cpp.

Referenced by JustDoIt().

◆ s_TestEntriesMode4

const TEST_ENTRY s_TestEntriesMode4[]
static
Initial value:
=
{
{__LINE__, DONT_SEND, s_dir2, NULL, "00001000", DoAction2, s_dir2, L""},
{__LINE__, DONT_SEND, s_dir2, NULL, "00010000", DoAction1, s_dir2, L""},
{__LINE__, DONT_SEND, s_dir2, s_dir3, "00000001", DoAction3, s_dir2, s_dir3},
{__LINE__, DONT_SEND, s_file1, NULL, "01000000", DoAction4, s_file1, L""},
{__LINE__, DONT_SEND, s_file1, s_file2, "10000000", DoAction5, s_file1, s_file2},
{__LINE__, DONT_SEND, s_file2, NULL, "00100000", DoAction6, s_file2, L""},
{__LINE__, DONT_SEND, s_dir3, NULL, "00001000", DoAction7, s_dir3, L""},
{__LINE__, SHCNE_MKDIR, s_dir2, NULL, "00000000", NULL, NULL, NULL},
{__LINE__, SHCNE_INTERRUPT | SHCNE_MKDIR, s_dir2, NULL, "00000000", NULL, NULL, NULL},
}
#define SHCNE_MKDIR
Definition: shlobj.h:1732
static WCHAR s_file1[MAX_PATH]
static WCHAR s_dir3[MAX_PATH]
#define SHCNE_INTERRUPT
Definition: shlobj.h:1754
static WCHAR s_dir2[MAX_PATH]
static void DoAction4(void)
static void DoAction2(void)
#define DONT_SEND
static void DoAction6(void)
static const WCHAR L[]
Definition: oid.c:1250
static void DoAction1(void)
static void DoAction7(void)
static void DoAction3(void)
static WCHAR s_file2[MAX_PATH]
#define NULL
Definition: types.h:112
static void DoAction5(void)

Definition at line 138 of file SHChangeNotify.cpp.

Referenced by JustDoIt().

◆ s_TestEntriesMode5

const TEST_ENTRY s_TestEntriesMode5[]
static

Definition at line 152 of file SHChangeNotify.cpp.

Referenced by JustDoIt().