ReactOS  0.4.15-dev-1207-g698a8e6
IShellFolderViewCB.cpp File Reference
#include "shelltest.h"
#include <atlsimpcoll.h>
#include <stdio.h>
#include <shellutils.h>
Include dependency graph for IShellFolderViewCB.cpp:

Go to the source code of this file.

Classes

struct  message
 
class  CFolderViewCB
 
class  CDummyShellBrowser
 

Macros

#define WINVER_VISTA   0x0600
 
#define SFVM_SELECTIONCHANGED   8 /* undocumented */
 
#define SFVM_DRAWMENUITEM   9 /* undocumented */
 
#define SFVM_MEASUREMENUITEM   10 /* undocumented */
 
#define SFVM_EXITMENULOOP   11 /* undocumented */
 
#define SFVM_VIEWRELEASE   12 /* undocumented */
 
#define SFVM_GETNAMELENGTH   13 /* undocumented */
 
#define SFVM_WINDOWCLOSING   16 /* undocumented */
 
#define SFVM_LISTREFRESHED   17 /* undocumented */
 
#define SFVM_WINDOWFOCUSED   18 /* undocumented */
 
#define SFVM_REGISTERCOPYHOOK   20 /* undocumented */
 
#define SFVM_COPYHOOKCALLBACK   21 /* undocumented */
 
#define SFVM_UNMERGEFROMMENU   28 /* undocumented */
 
#define SFVM_ADDINGOBJECT   29 /* undocumented */
 
#define SFVM_REMOVINGOBJECT   30 /* undocumented */
 
#define SFVM_GETCOMMANDDIR   33 /* undocumented */
 
#define SFVM_GETCOLUMNSTREAM   34 /* undocumented */
 
#define SFVM_CANSELECTALL   35 /* undocumented */
 
#define SFVM_ISSTRICTREFRESH   37 /* undocumented */
 
#define SFVM_ISCHILDOBJECT   38 /* undocumented */
 
#define SFVM_GETEXTVIEWS   40 /* undocumented */
 
#define SFVM_GET_CUSTOMVIEWINFO   77 /* undocumented */
 
#define SFVM_ENUMERATEDITEMS   79 /* undocumented */
 
#define SFVM_GET_VIEW_DATA   80 /* undocumented */
 
#define SFVM_GET_WEBVIEW_LAYOUT   82 /* undocumented */
 
#define SFVM_GET_WEBVIEW_CONTENT   83 /* undocumented */
 
#define SFVM_GET_WEBVIEW_TASKS   84 /* undocumented */
 
#define SFVM_GET_WEBVIEW_THEME   86 /* undocumented */
 
#define SFVM_GETDEFERREDVIEWSETTINGS   92 /* undocumented */
 
#define DUM_MSG_GetWindow   400
 
#define DUM_MSG_ContextSensitiveHelp   401
 
#define DUM_MSG_InsertMenusSB   402
 
#define DUM_MSG_SetMenuSB   403
 
#define DUM_MSG_RemoveMenusSB   404
 
#define DUM_MSG_SetStatusTextSB   405
 
#define DUM_MSG_EnableModelessSB   406
 
#define DUM_MSG_TranslateAcceleratorSB   407
 
#define DUM_MSG_BrowseObject   408
 
#define DUM_MSG_GetViewStateStream   409
 
#define DUM_MSG_GetControlWindow   410
 
#define DUM_MSG_SendControlMsg   411
 
#define DUM_MSG_QueryActiveShellView   412
 
#define DUM_MSG_OnViewWindowActive   413
 
#define DUM_MSG_SetToolbarItems   414
 
#define PTR_VALUE   0xf7f7f7f7
 
#define compare_list(cmp)   compare_list_(g_Received, cmp, __FILE__, __LINE__)
 
#define print_list()   print_list_(g_Received, __FILE__, __LINE__)
 

Functions

const charmsg2str (UINT uMsg)
 
void clear_list ()
 
void add_msg (UINT uMsg, WPARAM wParam, LPARAM lParam)
 
void print_list_ (const CSimpleArray< message > &input, const char *file, int line)
 
void compare_list_ (const CSimpleArray< message > &input, const message *compare, const char *file, int line)
 
static LRESULT CALLBACK WndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
 START_TEST (IShellFolderViewCB)
 

Variables

static DWORD g_WinVersion
 
CSimpleArray< messageg_Received
 
LONG g_AddRef = 0
 
LONG g_Release = 0
 

Macro Definition Documentation

◆ compare_list

#define compare_list (   cmp)    compare_list_(g_Received, cmp, __FILE__, __LINE__)

Definition at line 238 of file IShellFolderViewCB.cpp.

◆ DUM_MSG_BrowseObject

#define DUM_MSG_BrowseObject   408

Definition at line 56 of file IShellFolderViewCB.cpp.

◆ DUM_MSG_ContextSensitiveHelp

#define DUM_MSG_ContextSensitiveHelp   401

Definition at line 49 of file IShellFolderViewCB.cpp.

◆ DUM_MSG_EnableModelessSB

#define DUM_MSG_EnableModelessSB   406

Definition at line 54 of file IShellFolderViewCB.cpp.

◆ DUM_MSG_GetControlWindow

#define DUM_MSG_GetControlWindow   410

Definition at line 58 of file IShellFolderViewCB.cpp.

◆ DUM_MSG_GetViewStateStream

#define DUM_MSG_GetViewStateStream   409

Definition at line 57 of file IShellFolderViewCB.cpp.

◆ DUM_MSG_GetWindow

#define DUM_MSG_GetWindow   400

Definition at line 48 of file IShellFolderViewCB.cpp.

◆ DUM_MSG_InsertMenusSB

#define DUM_MSG_InsertMenusSB   402

Definition at line 50 of file IShellFolderViewCB.cpp.

◆ DUM_MSG_OnViewWindowActive

#define DUM_MSG_OnViewWindowActive   413

Definition at line 61 of file IShellFolderViewCB.cpp.

◆ DUM_MSG_QueryActiveShellView

#define DUM_MSG_QueryActiveShellView   412

Definition at line 60 of file IShellFolderViewCB.cpp.

◆ DUM_MSG_RemoveMenusSB

#define DUM_MSG_RemoveMenusSB   404

Definition at line 52 of file IShellFolderViewCB.cpp.

◆ DUM_MSG_SendControlMsg

#define DUM_MSG_SendControlMsg   411

Definition at line 59 of file IShellFolderViewCB.cpp.

◆ DUM_MSG_SetMenuSB

#define DUM_MSG_SetMenuSB   403

Definition at line 51 of file IShellFolderViewCB.cpp.

◆ DUM_MSG_SetStatusTextSB

#define DUM_MSG_SetStatusTextSB   405

Definition at line 53 of file IShellFolderViewCB.cpp.

◆ DUM_MSG_SetToolbarItems

#define DUM_MSG_SetToolbarItems   414

Definition at line 62 of file IShellFolderViewCB.cpp.

◆ DUM_MSG_TranslateAcceleratorSB

#define DUM_MSG_TranslateAcceleratorSB   407

Definition at line 55 of file IShellFolderViewCB.cpp.

◆ print_list

#define print_list ( )    print_list_(g_Received, __FILE__, __LINE__)

Definition at line 239 of file IShellFolderViewCB.cpp.

◆ PTR_VALUE

#define PTR_VALUE   0xf7f7f7f7

Definition at line 152 of file IShellFolderViewCB.cpp.

◆ SFVM_ADDINGOBJECT

#define SFVM_ADDINGOBJECT   29 /* undocumented */

Definition at line 30 of file IShellFolderViewCB.cpp.

◆ SFVM_CANSELECTALL

#define SFVM_CANSELECTALL   35 /* undocumented */

Definition at line 34 of file IShellFolderViewCB.cpp.

◆ SFVM_COPYHOOKCALLBACK

#define SFVM_COPYHOOKCALLBACK   21 /* undocumented */

Definition at line 28 of file IShellFolderViewCB.cpp.

◆ SFVM_DRAWMENUITEM

#define SFVM_DRAWMENUITEM   9 /* undocumented */

Definition at line 19 of file IShellFolderViewCB.cpp.

◆ SFVM_ENUMERATEDITEMS

#define SFVM_ENUMERATEDITEMS   79 /* undocumented */

Definition at line 39 of file IShellFolderViewCB.cpp.

◆ SFVM_EXITMENULOOP

#define SFVM_EXITMENULOOP   11 /* undocumented */

Definition at line 21 of file IShellFolderViewCB.cpp.

◆ SFVM_GET_CUSTOMVIEWINFO

#define SFVM_GET_CUSTOMVIEWINFO   77 /* undocumented */

Definition at line 38 of file IShellFolderViewCB.cpp.

◆ SFVM_GET_VIEW_DATA

#define SFVM_GET_VIEW_DATA   80 /* undocumented */

Definition at line 40 of file IShellFolderViewCB.cpp.

◆ SFVM_GET_WEBVIEW_CONTENT

#define SFVM_GET_WEBVIEW_CONTENT   83 /* undocumented */

Definition at line 42 of file IShellFolderViewCB.cpp.

◆ SFVM_GET_WEBVIEW_LAYOUT

#define SFVM_GET_WEBVIEW_LAYOUT   82 /* undocumented */

Definition at line 41 of file IShellFolderViewCB.cpp.

◆ SFVM_GET_WEBVIEW_TASKS

#define SFVM_GET_WEBVIEW_TASKS   84 /* undocumented */

Definition at line 43 of file IShellFolderViewCB.cpp.

◆ SFVM_GET_WEBVIEW_THEME

#define SFVM_GET_WEBVIEW_THEME   86 /* undocumented */

Definition at line 44 of file IShellFolderViewCB.cpp.

◆ SFVM_GETCOLUMNSTREAM

#define SFVM_GETCOLUMNSTREAM   34 /* undocumented */

Definition at line 33 of file IShellFolderViewCB.cpp.

◆ SFVM_GETCOMMANDDIR

#define SFVM_GETCOMMANDDIR   33 /* undocumented */

Definition at line 32 of file IShellFolderViewCB.cpp.

◆ SFVM_GETDEFERREDVIEWSETTINGS

#define SFVM_GETDEFERREDVIEWSETTINGS   92 /* undocumented */

Definition at line 45 of file IShellFolderViewCB.cpp.

◆ SFVM_GETEXTVIEWS

#define SFVM_GETEXTVIEWS   40 /* undocumented */

Definition at line 37 of file IShellFolderViewCB.cpp.

◆ SFVM_GETNAMELENGTH

#define SFVM_GETNAMELENGTH   13 /* undocumented */

Definition at line 23 of file IShellFolderViewCB.cpp.

◆ SFVM_ISCHILDOBJECT

#define SFVM_ISCHILDOBJECT   38 /* undocumented */

Definition at line 36 of file IShellFolderViewCB.cpp.

◆ SFVM_ISSTRICTREFRESH

#define SFVM_ISSTRICTREFRESH   37 /* undocumented */

Definition at line 35 of file IShellFolderViewCB.cpp.

◆ SFVM_LISTREFRESHED

#define SFVM_LISTREFRESHED   17 /* undocumented */

Definition at line 25 of file IShellFolderViewCB.cpp.

◆ SFVM_MEASUREMENUITEM

#define SFVM_MEASUREMENUITEM   10 /* undocumented */

Definition at line 20 of file IShellFolderViewCB.cpp.

◆ SFVM_REGISTERCOPYHOOK

#define SFVM_REGISTERCOPYHOOK   20 /* undocumented */

Definition at line 27 of file IShellFolderViewCB.cpp.

◆ SFVM_REMOVINGOBJECT

#define SFVM_REMOVINGOBJECT   30 /* undocumented */

Definition at line 31 of file IShellFolderViewCB.cpp.

◆ SFVM_SELECTIONCHANGED

#define SFVM_SELECTIONCHANGED   8 /* undocumented */

Definition at line 18 of file IShellFolderViewCB.cpp.

◆ SFVM_UNMERGEFROMMENU

#define SFVM_UNMERGEFROMMENU   28 /* undocumented */

Definition at line 29 of file IShellFolderViewCB.cpp.

◆ SFVM_VIEWRELEASE

#define SFVM_VIEWRELEASE   12 /* undocumented */

Definition at line 22 of file IShellFolderViewCB.cpp.

◆ SFVM_WINDOWCLOSING

#define SFVM_WINDOWCLOSING   16 /* undocumented */

Definition at line 24 of file IShellFolderViewCB.cpp.

◆ SFVM_WINDOWFOCUSED

#define SFVM_WINDOWFOCUSED   18 /* undocumented */

Definition at line 26 of file IShellFolderViewCB.cpp.

◆ WINVER_VISTA

#define WINVER_VISTA   0x0600

Definition at line 15 of file IShellFolderViewCB.cpp.

Function Documentation

◆ add_msg()

◆ clear_list()

void clear_list ( )

Definition at line 165 of file IShellFolderViewCB.cpp.

166 {
167  g_Received.RemoveAll();
168 }
CSimpleArray< message > g_Received

Referenced by START_TEST().

◆ compare_list_()

void compare_list_ ( const CSimpleArray< message > &  input,
const message compare,
const char file,
int  line 
)

Definition at line 186 of file IShellFolderViewCB.cpp.

187 {
188  int input_item = 0;
189  int compare_item = 0;
190  LONG old_failures = winetest_get_failures();
191  while (compare[compare_item].uMsg && input_item < input.GetSize())
192  {
193  const message& inp = input[input_item];
194  const message& cmp = compare[compare_item];
195  if (cmp.uMsg == inp.uMsg)
196  {
197  if (cmp.lParam != (LPARAM)PTR_VALUE)
198  {
199  ok_(file, line)(cmp.lParam == inp.lParam, "Expected lParam to be 0x%lx, was 0x%lx for %i(%s)\n",
200  cmp.lParam, inp.lParam, compare_item, msg2str(cmp.uMsg));
201  }
202  else
203  {
204  ok_(file, line)(inp.lParam != 0, "Expected lParam to be a pointer, was 0 for %i(%s)\n",
205  compare_item, msg2str(cmp.uMsg));
206  }
207  if (cmp.wParam != PTR_VALUE)
208  {
209  ok_(file, line)(cmp.wParam == inp.wParam, "Expected wParam to be 0x%x, was 0x%x for %i(%s)\n",
210  cmp.wParam, inp.wParam, compare_item, msg2str(cmp.uMsg));
211  }
212  else
213  {
214  ok_(file, line)(inp.wParam != 0, "Expected wParam to be a pointer, was 0 for %i(%s)\n",
215  compare_item, msg2str(cmp.uMsg));
216  }
217  compare_item++;
218  }
219  else
220  {
221  /* We skip unknown items for now */
222  }
223 
224  input_item++;
225  }
226 
227  while (compare[compare_item].uMsg)
228  {
229  ok_(file, line)(0, "Message %i(%s) not found\n", compare_item, msg2str(compare[compare_item].uMsg));
230  compare_item++;
231  }
232  if (old_failures != winetest_get_failures())
233  {
235  }
236 }
Definition: bug.cpp:7
LONG winetest_get_failures(void)
Definition: tftpd.h:59
#define cmp(status, error)
Definition: error.c:114
long LONG
Definition: pedump.c:60
#define PTR_VALUE
LONG_PTR LPARAM
Definition: windef.h:208
Definition: parser.c:48
void print_list_(const CSimpleArray< message > &input, const char *file, int line)
GLenum GLenum GLenum input
Definition: glext.h:9031
#define ok_(x1, x2)
Definition: atltest.h:61
const char * msg2str(UINT uMsg)
Definition: fci.c:126

◆ msg2str()

const char* msg2str ( UINT  uMsg)

Definition at line 65 of file IShellFolderViewCB.cpp.

66 {
67  static char buf[2][50];
68  static int index = 0;
69  index ^= 1;
70 
71  switch (uMsg)
72  {
73  case SFVM_MERGEMENU: return "SFVM_MERGEMENU";
74  case SFVM_INVOKECOMMAND: return "SFVM_INVOKECOMMAND";
75  case SFVM_GETHELPTEXT: return "SFVM_GETHELPTEXT";
76  case SFVM_GETTOOLTIPTEXT: return "SFVM_GETTOOLTIPTEXT";
77  case SFVM_GETBUTTONINFO: return "SFVM_GETBUTTONINFO";
78  case SFVM_GETBUTTONS: return "SFVM_GETBUTTONS";
79  case SFVM_INITMENUPOPUP: return "SFVM_INITMENUPOPUP";
80  case SFVM_SELECTIONCHANGED: return "SFVM_SELECTIONCHANGED";
81  case SFVM_DRAWMENUITEM: return "SFVM_DRAWMENUITEM";
82  case SFVM_MEASUREMENUITEM: return "SFVM_MEASUREMENUITEM";
83  case SFVM_EXITMENULOOP: return "SFVM_EXITMENULOOP";
84  case SFVM_VIEWRELEASE: return "SFVM_VIEWRELEASE";
85  case SFVM_GETNAMELENGTH: return "SFVM_GETNAMELENGTH";
86  case SFVM_FSNOTIFY: return "SFVM_FSNOTIFY";
87  case SFVM_WINDOWCREATED: return "SFVM_WINDOWCREATED";
88  case SFVM_WINDOWCLOSING: return "SFVM_WINDOWCLOSING";
89  case SFVM_LISTREFRESHED: return "SFVM_LISTREFRESHED";
90  case SFVM_WINDOWFOCUSED: return "SFVM_WINDOWFOCUSED";
91  case SFVM_REGISTERCOPYHOOK: return "SFVM_REGISTERCOPYHOOK";
92  case SFVM_COPYHOOKCALLBACK: return "SFVM_COPYHOOKCALLBACK";
93  case SFVM_GETDETAILSOF: return "SFVM_GETDETAILSOF";
94  case SFVM_COLUMNCLICK: return "SFVM_COLUMNCLICK";
95  case SFVM_QUERYFSNOTIFY: return "SFVM_QUERYFSNOTIFY";
96  case SFVM_DEFITEMCOUNT: return "SFVM_DEFITEMCOUNT";
97  case SFVM_DEFVIEWMODE: return "SFVM_DEFVIEWMODE";
98  case SFVM_UNMERGEFROMMENU: return "SFVM_UNMERGEFROMMENU";
99  case SFVM_ADDINGOBJECT: return "SFVM_ADDINGOBJECT";
100  case SFVM_REMOVINGOBJECT: return "SFVM_REMOVINGOBJECT";
101  case SFVM_UPDATESTATUSBAR: return "SFVM_UPDATESTATUSBAR";
102  case SFVM_BACKGROUNDENUM: return "SFVM_BACKGROUNDENUM";
103  case SFVM_GETCOMMANDDIR: return "SFVM_GETCOMMANDDIR";
104  case SFVM_GETCOLUMNSTREAM: return "SFVM_GETCOLUMNSTREAM";
105  case SFVM_CANSELECTALL: return "SFVM_CANSELECTALL";
106  case SFVM_DIDDRAGDROP: return "SFVM_DIDDRAGDROP";
107  case SFVM_ISSTRICTREFRESH: return "SFVM_ISSTRICTREFRESH";
108  case SFVM_ISCHILDOBJECT: return "SFVM_ISCHILDOBJECT";
109  case SFVM_SETISFV: return "SFVM_SETISFV";
110  case SFVM_GETEXTVIEWS: return "SFVM_GETEXTVIEWS";
111  case SFVM_THISIDLIST: return "SFVM_THISIDLIST";
112  case SFVM_ADDPROPERTYPAGES: return "SFVM_ADDPROPERTYPAGES";
113  case SFVM_BACKGROUNDENUMDONE: return "SFVM_BACKGROUNDENUMDONE";
114  case SFVM_GETNOTIFY: return "SFVM_GETNOTIFY";
115  case SFVM_GETSORTDEFAULTS: return "SFVM_GETSORTDEFAULTS";
116  case SFVM_SIZE: return "SFVM_SIZE";
117  case SFVM_GETZONE: return "SFVM_GETZONE";
118  case SFVM_GETPANE: return "SFVM_GETPANE";
119  case SFVM_GETHELPTOPIC: return "SFVM_GETHELPTOPIC";
120  case SFVM_GETANIMATION: return "SFVM_GETANIMATION";
121  case SFVM_GET_CUSTOMVIEWINFO: return "SFVM_GET_CUSTOMVIEWINFO";
122  case SFVM_ENUMERATEDITEMS: return "SFVM_ENUMERATEDITEMS";
123  case SFVM_GET_VIEW_DATA: return "SFVM_GET_VIEW_DATA";
124  case SFVM_GET_WEBVIEW_LAYOUT: return "SFVM_GET_WEBVIEW_LAYOUT";
125  case SFVM_GET_WEBVIEW_CONTENT: return "SFVM_GET_WEBVIEW_CONTENT";
126  case SFVM_GET_WEBVIEW_TASKS: return "SFVM_GET_WEBVIEW_TASKS";
127  case SFVM_GET_WEBVIEW_THEME: return "SFVM_GET_WEBVIEW_THEME";
128  case SFVM_GETDEFERREDVIEWSETTINGS: return "SFVM_GET_WEBVIEW_THEME";
129 
130  case DUM_MSG_GetWindow: return "|GetWindow|";
131  case DUM_MSG_ContextSensitiveHelp: return "|ContextSensitiveHelp|";
132  case DUM_MSG_InsertMenusSB: return "|InsertMenusSB|";
133  case DUM_MSG_SetMenuSB: return "|SetMenuSB|";
134  case DUM_MSG_RemoveMenusSB: return "|RemoveMenusSB|";
135  case DUM_MSG_SetStatusTextSB: return "|SetStatusTextSB|";
136  case DUM_MSG_EnableModelessSB: return "|EnableModelessSB|";
137  case DUM_MSG_TranslateAcceleratorSB: return "|TranslateAcceleratorSB|";
138  case DUM_MSG_BrowseObject: return "|BrowseObject|";
139  case DUM_MSG_GetViewStateStream: return "|GetViewStateStream|";
140  case DUM_MSG_GetControlWindow: return "|GetControlWindow|";
141  case DUM_MSG_SendControlMsg: return "|SendControlMsg|";
142  case DUM_MSG_QueryActiveShellView: return "|QueryActiveShellView|";
143  case DUM_MSG_OnViewWindowActive: return "|OnViewWindowActive|";
144  case DUM_MSG_SetToolbarItems: return "|SetToolbarItems|";
145  default:
146  sprintf(buf[index], "[%u]", uMsg);
147  return buf[index];
148  }
149 }
#define SFVM_CANSELECTALL
#define SFVM_GETNAMELENGTH
#define DUM_MSG_SetToolbarItems
#define SFVM_GET_WEBVIEW_TASKS
#define SFVM_BACKGROUNDENUMDONE
Definition: shlobj.h:1261
#define SFVM_GETHELPTEXT
Definition: shlobj.h:1223
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define SFVM_QUERYFSNOTIFY
Definition: shlobj.h:1243
#define SFVM_DIDDRAGDROP
Definition: shlobj.h:1254
#define SFVM_GETCOMMANDDIR
#define SFVM_ADDINGOBJECT
#define SFVM_GETPANE
Definition: shlobj.h:1266
#define DUM_MSG_TranslateAcceleratorSB
#define SFVM_DRAWMENUITEM
#define SFVM_GET_CUSTOMVIEWINFO
#define SFVM_COLUMNCLICK
Definition: shlobj.h:1242
#define SFVM_SIZE
Definition: shlobj.h:1264
#define SFVM_WINDOWCLOSING
#define SFVM_SETISFV
Definition: shlobj.h:1257
#define sprintf(buf, format,...)
Definition: sprintf.c:55
#define SFVM_COPYHOOKCALLBACK
#define SFVM_GET_VIEW_DATA
#define SFVM_ENUMERATEDITEMS
#define DUM_MSG_InsertMenusSB
#define SFVM_ISCHILDOBJECT
#define SFVM_LISTREFRESHED
#define DUM_MSG_GetWindow
#define SFVM_INVOKECOMMAND
Definition: shlobj.h:1222
#define SFVM_GETBUTTONINFO
Definition: shlobj.h:1225
#define SFVM_MERGEMENU
Definition: shlobj.h:1221
#define SFVM_GETANIMATION
Definition: shlobj.h:1268
#define SFVM_WINDOWFOCUSED
GLuint index
Definition: glext.h:6031
#define DUM_MSG_ContextSensitiveHelp
#define DUM_MSG_GetControlWindow
#define SFVM_REMOVINGOBJECT
#define SFVM_REGISTERCOPYHOOK
#define SFVM_UPDATESTATUSBAR
Definition: shlobj.h:1249
#define SFVM_BACKGROUNDENUM
Definition: shlobj.h:1250
#define SFVM_GETNOTIFY
Definition: shlobj.h:1262
#define SFVM_WINDOWCREATED
Definition: shlobj.h:1235
#define DUM_MSG_QueryActiveShellView
#define SFVM_GET_WEBVIEW_CONTENT
#define SFVM_UNMERGEFROMMENU
#define SFVM_GETSORTDEFAULTS
Definition: shlobj.h:1263
#define DUM_MSG_SendControlMsg
#define DUM_MSG_BrowseObject
#define SFVM_VIEWRELEASE
#define SFVM_GET_WEBVIEW_THEME
#define SFVM_FSNOTIFY
Definition: shlobj.h:1234
#define DUM_MSG_SetMenuSB
#define SFVM_DEFVIEWMODE
Definition: shlobj.h:1245
#define index(s, c)
Definition: various.h:29
#define SFVM_GETHELPTOPIC
Definition: shlobj.h:1267
#define SFVM_GETZONE
Definition: shlobj.h:1265
#define SFVM_GETDETAILSOF
Definition: shlobj.h:1241
#define SFVM_ADDPROPERTYPAGES
Definition: shlobj.h:1260
#define SFVM_DEFITEMCOUNT
Definition: shlobj.h:1244
#define SFVM_SELECTIONCHANGED
#define SFVM_GETEXTVIEWS
#define DUM_MSG_OnViewWindowActive
#define SFVM_GET_WEBVIEW_LAYOUT
#define SFVM_GETCOLUMNSTREAM
#define SFVM_GETTOOLTIPTEXT
Definition: shlobj.h:1224
#define SFVM_GETBUTTONS
Definition: shlobj.h:1226
#define DUM_MSG_RemoveMenusSB
#define SFVM_ISSTRICTREFRESH
#define DUM_MSG_EnableModelessSB
#define SFVM_INITMENUPOPUP
Definition: shlobj.h:1227
#define SFVM_GETDEFERREDVIEWSETTINGS
#define SFVM_EXITMENULOOP
#define SFVM_MEASUREMENUITEM
#define DUM_MSG_GetViewStateStream
#define DUM_MSG_SetStatusTextSB
#define SFVM_THISIDLIST
Definition: shlobj.h:1259

Referenced by compare_list_(), and print_list_().

◆ print_list_()

void print_list_ ( const CSimpleArray< message > &  input,
const char file,
int  line 
)

Definition at line 175 of file IShellFolderViewCB.cpp.

176 {
177  trace_(file, line)("Got list:\n");
178  for (int n = 0; n < input.GetSize(); ++n)
179  {
180  const message& msg = input[n];
181  trace_(file, line)("msg: %d(%s), wParam:0x%x, lParam:0x%lx\n", msg.uMsg, msg2str(msg.uMsg), msg.wParam, msg.lParam);
182  }
183  trace_(file, line)("End of list.\n");
184 }
#define trace_(file, line,...)
Definition: kmt_test.h:221
Definition: tftpd.h:59
GLdouble n
Definition: glext.h:7729
Definition: parser.c:48
GLenum GLenum GLenum input
Definition: glext.h:9031
#define msg(x)
Definition: auth_time.c:54
const char * msg2str(UINT uMsg)
Definition: fci.c:126

Referenced by compare_list_().

◆ START_TEST()

START_TEST ( IShellFolderViewCB  )

Definition at line 429 of file IShellFolderViewCB.cpp.

430 {
431  RTL_OSVERSIONINFOEXW rtlinfo = { sizeof(rtlinfo) };
432  void (__stdcall* pRtlGetVersion)(RTL_OSVERSIONINFOEXW*);
433  pRtlGetVersion = (void (__stdcall*)(RTL_OSVERSIONINFOEXW*))GetProcAddress(GetModuleHandleA("ntdll"), "RtlGetVersion");
434  pRtlGetVersion(&rtlinfo);
435  g_WinVersion = (rtlinfo.dwMajorVersion << 8) | rtlinfo.dwMinorVersion;
436 
439 
440  CComPtr<IShellFolder> desktop;
441 
442  HRESULT hr = SHGetDesktopFolder(&desktop);
443  ok_hex(hr, S_OK);
444  if (!desktop)
445  return;
446 
447  SFV_CREATE sfvc = { sizeof(sfvc), desktop };
448  sfvc.psfvcb = &cb;
449  IShellView* psv = NULL;
450 
451  g_AddRef = 0;
452  g_Release = 0;
453 
454  hr = SHCreateShellFolderView(&sfvc, &psv);
455  ok_hex(hr, S_OK);
456  if (!SUCCEEDED(hr))
457  return;
458 
459  ok_int(g_AddRef, 1);
460  ok_int(g_Release, 0);
461 
462  clear_list();
463 
464  HWND wnd;
465  RECT rc = { 0 };
466  FOLDERSETTINGS fs = { FVM_DETAILS, 0 };
468  hr = psv->CreateViewWindow(NULL, &fs, &dum, &rc, &wnd);
469 
470 
471  static message init_list[] =
472  {
473  /* ... */
474  message(DUM_MSG_GetWindow, 0, 0),
475  /* Some unknown messages here, and multiple SFVM_GET_WEBVIEW_THEME + SFVM_GETSORTDEFAULTS + SFVM_GETCOLUMNSTREAM */
476  message(SFVM_SIZE, 0, 0),
477  /* ... */
480  message(DUM_MSG_SetMenuSB, 0, 0),
481  /* ... */
483  /* ... */
484 
488 
489  message(0, 0, 0)
490  };
491 
492 
493  static message init_list_vista[] =
494  {
495  /* Some unknown messages here */
496  message(DUM_MSG_GetWindow, 0, 0),
497  /* Some unknown messages here, and multiple SFVM_GET_WEBVIEW_THEME + SFVM_GETSORTDEFAULTS + SFVM_GETCOLUMNSTREAM */
498  message(SFVM_SIZE, 0, 0),
500  /* Some unknown messages here */
503  message(DUM_MSG_SetMenuSB, 0, 0),
504 
505  message(0, 0, 0)
506  };
507 
509  {
510  compare_list(init_list);
511  }
512  else
513  {
514  compare_list(init_list_vista);
515  }
516  clear_list();
517 
518  hr = psv->Refresh();
519  //ok_hex(hr, S_FALSE);
520 
521  static message refresh_list[] =
522  {
524 
526  message(DUM_MSG_SetMenuSB, 0, 0),
530  message(DUM_MSG_SetMenuSB, 0, 0),
531 
532  message(0, 0, 0)
533  };
534 
535  static message refresh_list_vista[] =
536  {
538 
540  message(DUM_MSG_SetMenuSB, 0, 0),
544  message(DUM_MSG_SetMenuSB, 0, 0),
545  /* Some messages here, like SFVM_GET_WEBVIEW_THEME, SFVM_GETSORTDEFAULTS, SFVM_GETCOLUMNSTREAM */
547  message(DUM_MSG_SetMenuSB, 0, 0),
551  message(DUM_MSG_SetMenuSB, 0, 0),
552 
553  message(0, 0, 0)
554  };
555 
557  {
558  compare_list(refresh_list);
559  }
560  else
561  {
562  compare_list(refresh_list_vista);
563  }
564  clear_list();
565 
566  hr = psv->DestroyViewWindow();
567 
568  static message destroy_list[] =
569  {
571  message(DUM_MSG_SetMenuSB, 0, 0),
574 
575  message(0, 0, 0)
576  };
577 
578  compare_list(destroy_list);
579  clear_list();
580 
581  CComPtr<IShellFolderView> folderView;
582  hr = psv->QueryInterface(IID_PPV_ARG(IShellFolderView, &folderView));
583  ok_hex(hr, S_OK);
584  if (SUCCEEDED(hr))
585  {
586  IShellFolderViewCB* oldPtr;
587 
588  hr = folderView->SetCallback(NULL, &oldPtr);
589  ok_int(g_AddRef, 1);
590  ok_int(g_Release, 0);
591 
592  /* Last pointer is not optional! */
593  IShellFolderViewCB* oldPtr2;
594  hr = folderView->SetCallback(oldPtr, &oldPtr2);
595  ok_int(g_AddRef, 2);
596  ok_int(g_Release, 0);
597  }
598 
599  ULONG refCount = psv->Release();
600  ok(refCount == 1, "refCount = %lu\n", refCount);
601 
602  static message release_list[] =
603  {
604  message(SFVM_VIEWRELEASE, 0, 0),
605 
606  message(0, 0, 0)
607  };
608 
609  /* Investigate why this fails */
610  if (refCount == 0)
611  {
612  compare_list(release_list);
613  }
614 }
Definition: tftpd.h:59
HRESULT Refresh()
#define DUM_MSG_SetToolbarItems
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
HRESULT CreateViewWindow([in] IShellView *psvPrevious, [in] LPCFOLDERSETTINGS lpfs, [in] IShellBrowser *psb, [out] RECT *prcView, [out] HWND *phWnd)
HRESULT hr
Definition: shlfolder.c:183
IShellFolderViewCB * psfvcb
Definition: shlobj.h:1285
ULONG dwMinorVersion
Definition: rtltypes.h:271
LONG g_Release
#define WINVER_VISTA
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glext.h:5579
Definition: fs.h:235
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:3755
#define IID_PPV_ARG(Itype, ppType)
#define ok_hex(expression, result)
Definition: atltest.h:94
#define SFVM_SIZE
Definition: shlobj.h:1264
static DWORD g_WinVersion
#define SFVM_WINDOWCLOSING
ULONG dwMajorVersion
Definition: rtltypes.h:270
#define DUM_MSG_InsertMenusSB
HRESULT DestroyViewWindow()
#define PTR_VALUE
#define compare_list(cmp)
#define SFVM_LISTREFRESHED
ULONG Release()
#define DUM_MSG_GetWindow
#define SFVM_GETBUTTONINFO
Definition: shlobj.h:1225
smooth NULL
Definition: ftsmooth.c:416
#define ok_int(expression, result)
Definition: atltest.h:134
#define SFVM_MERGEMENU
Definition: shlobj.h:1221
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
#define SFVM_WINDOWCREATED
Definition: shlobj.h:1235
LONG HRESULT
Definition: typedefs.h:79
#define SFVM_UNMERGEFROMMENU
#define __stdcall
Definition: typedefs.h:25
#define SFVM_VIEWRELEASE
#define DUM_MSG_SetMenuSB
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
void clear_list()
#define S_OK
Definition: intsafe.h:51
CDumExe dum
Definition: CComObject.cpp:71
#define ok(value,...)
Definition: atltest.h:57
#define SFVM_GETBUTTONS
Definition: shlobj.h:1226
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define DUM_MSG_RemoveMenusSB
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
unsigned int ULONG
Definition: retypes.h:1
LONG g_AddRef
#define GetProcAddress(x, y)
Definition: compat.h:612
#define SUCCEEDED(hr)
Definition: intsafe.h:49

◆ WndProc()

static LRESULT CALLBACK WndProc ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 284 of file IShellFolderViewCB.cpp.

285 {
286  if (msg == WM_DESTROY)
287  {
288  PostQuitMessage(0);
289  return 0;
290  }
291  return DefWindowProc(hwnd, msg, wParam, lParam);
292 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
WPARAM wParam
Definition: combotst.c:138
#define DefWindowProc
Definition: ros2win.h:31
#define WM_DESTROY
Definition: winuser.h:1591
#define msg(x)
Definition: auth_time.c:54
LPARAM lParam
Definition: combotst.c:139
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)

Referenced by CDummyShellBrowser::CDummyShellBrowser().

Variable Documentation

◆ g_AddRef

LONG g_AddRef = 0

Definition at line 242 of file IShellFolderViewCB.cpp.

Referenced by CFolderViewCB::AddRef(), and START_TEST().

◆ g_Received

CSimpleArray<message> g_Received

Definition at line 163 of file IShellFolderViewCB.cpp.

Referenced by add_msg(), and clear_list().

◆ g_Release

LONG g_Release = 0

Definition at line 243 of file IShellFolderViewCB.cpp.

Referenced by CFolderViewCB::Release(), and START_TEST().

◆ g_WinVersion

DWORD g_WinVersion
static

Definition at line 14 of file IShellFolderViewCB.cpp.

Referenced by START_TEST().