ReactOS 0.4.16-dev-334-g4d9f67c
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}

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}
void print_list_(const CSimpleArray< message > &input, const char *file, int line)
#define PTR_VALUE
const char * msg2str(UINT uMsg)
#define ok_(x1, x2)
Definition: atltest.h:61
GLenum GLenum GLenum input
Definition: glext.h:9031
#define cmp(status, error)
Definition: error.c:114
long LONG
Definition: pedump.c:60
LONG winetest_get_failures(void)
Definition: bug.cpp:8
Definition: fci.c:127
Definition: parser.c:49
LONG_PTR LPARAM
Definition: windef.h:208

◆ 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_UNMERGEFROMMENU
#define SFVM_GETCOMMANDDIR
#define SFVM_MEASUREMENUITEM
#define DUM_MSG_BrowseObject
#define DUM_MSG_GetWindow
#define DUM_MSG_SetToolbarItems
#define SFVM_EXITMENULOOP
#define SFVM_CANSELECTALL
#define SFVM_COPYHOOKCALLBACK
#define DUM_MSG_ContextSensitiveHelp
#define SFVM_ISCHILDOBJECT
#define SFVM_GETCOLUMNSTREAM
#define SFVM_WINDOWFOCUSED
#define SFVM_REGISTERCOPYHOOK
#define SFVM_GET_CUSTOMVIEWINFO
#define DUM_MSG_TranslateAcceleratorSB
#define SFVM_ISSTRICTREFRESH
#define DUM_MSG_GetControlWindow
#define DUM_MSG_QueryActiveShellView
#define SFVM_GET_WEBVIEW_CONTENT
#define SFVM_GET_VIEW_DATA
#define SFVM_GETEXTVIEWS
#define DUM_MSG_OnViewWindowActive
#define DUM_MSG_SetStatusTextSB
#define SFVM_GETNAMELENGTH
#define DUM_MSG_RemoveMenusSB
#define DUM_MSG_EnableModelessSB
#define DUM_MSG_SetMenuSB
#define SFVM_VIEWRELEASE
#define SFVM_ADDINGOBJECT
#define SFVM_ENUMERATEDITEMS
#define SFVM_GETDEFERREDVIEWSETTINGS
#define SFVM_REMOVINGOBJECT
#define SFVM_LISTREFRESHED
#define DUM_MSG_InsertMenusSB
#define SFVM_GET_WEBVIEW_THEME
#define DUM_MSG_SendControlMsg
#define SFVM_WINDOWCLOSING
#define SFVM_SELECTIONCHANGED
#define SFVM_GET_WEBVIEW_TASKS
#define SFVM_DRAWMENUITEM
#define SFVM_GET_WEBVIEW_LAYOUT
#define DUM_MSG_GetViewStateStream
#define index(s, c)
Definition: various.h:29
GLuint index
Definition: glext.h:6031
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define sprintf(buf, format,...)
Definition: sprintf.c:55
#define SFVM_GETPANE
Definition: shlobj.h:1341
#define SFVM_UPDATESTATUSBAR
Definition: shlobj.h:1322
#define SFVM_GETHELPTOPIC
Definition: shlobj.h:1342
#define SFVM_INITMENUPOPUP
Definition: shlobj.h:1300
#define SFVM_DEFITEMCOUNT
Definition: shlobj.h:1317
#define SFVM_DEFVIEWMODE
Definition: shlobj.h:1318
#define SFVM_GETDETAILSOF
Definition: shlobj.h:1314
#define SFVM_WINDOWCREATED
Definition: shlobj.h:1308
#define SFVM_GETZONE
Definition: shlobj.h:1340
#define SFVM_BACKGROUNDENUM
Definition: shlobj.h:1323
#define SFVM_SIZE
Definition: shlobj.h:1339
#define SFVM_GETHELPTEXT
Definition: shlobj.h:1296
#define SFVM_BACKGROUNDENUMDONE
Definition: shlobj.h:1336
#define SFVM_THISIDLIST
Definition: shlobj.h:1332
#define SFVM_GETTOOLTIPTEXT
Definition: shlobj.h:1297
#define SFVM_MERGEMENU
Definition: shlobj.h:1294
#define SFVM_GETBUTTONINFO
Definition: shlobj.h:1298
#define SFVM_COLUMNCLICK
Definition: shlobj.h:1315
#define SFVM_ADDPROPERTYPAGES
Definition: shlobj.h:1335
#define SFVM_GETSORTDEFAULTS
Definition: shlobj.h:1338
#define SFVM_GETBUTTONS
Definition: shlobj.h:1299
#define SFVM_FSNOTIFY
Definition: shlobj.h:1307
#define SFVM_GETANIMATION
Definition: shlobj.h:1343
#define SFVM_INVOKECOMMAND
Definition: shlobj.h:1295
#define SFVM_QUERYFSNOTIFY
Definition: shlobj.h:1316
#define SFVM_DIDDRAGDROP
Definition: shlobj.h:1327
#define SFVM_GETNOTIFY
Definition: shlobj.h:1337
#define SFVM_SETISFV
Definition: shlobj.h:1330

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 msg(x)
Definition: auth_time.c:54
GLdouble n
Definition: glext.h:7729
#define trace_(file, line,...)
Definition: kmt_test.h:223

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 };
468 hr = psv->CreateViewWindow(NULL, &fs, &dum, &rc, &wnd);
469
470
471 static message init_list[] =
472 {
473 /* ... */
475 /* Some unknown messages here, and multiple SFVM_GET_WEBVIEW_THEME + SFVM_GETSORTDEFAULTS + SFVM_GETCOLUMNSTREAM */
476 message(SFVM_SIZE, 0, 0),
477 /* ... */
481 /* ... */
483 /* ... */
484
488
489 message(0, 0, 0)
490 };
491
492
493 static message init_list_vista[] =
494 {
495 /* Some unknown messages here */
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 */
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
531
532 message(0, 0, 0)
533 };
534
535 static message refresh_list_vista[] =
536 {
538
545 /* Some messages here, like SFVM_GET_WEBVIEW_THEME, SFVM_GETSORTDEFAULTS, SFVM_GETCOLUMNSTREAM */
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 {
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 {
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}
CDumExe dum
Definition: CComObject.cpp:71
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:4663
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
LONG g_Release
LONG g_AddRef
static DWORD g_WinVersion
#define WINVER_VISTA
void clear_list()
#define compare_list(cmp)
#define ok_hex(expression, result)
Definition: atltest.h:94
#define ok(value,...)
Definition: atltest.h:57
#define ok_int(expression, result)
Definition: atltest.h:134
#define NULL
Definition: types.h:112
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
HRESULT CreateViewWindow([in] IShellView *psvPrevious, [in] LPCFOLDERSETTINGS lpfs, [in] IShellBrowser *psb, [out] RECT *prcView, [out] HWND *phWnd)
HRESULT DestroyViewWindow()
HRESULT Refresh()
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
ULONG Release()
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
HRESULT hr
Definition: shlfolder.c:183
@ FVM_DETAILS
Definition: shobjidl.idl:683
ULONG dwMajorVersion
Definition: rtltypes.h:270
ULONG dwMinorVersion
Definition: rtltypes.h:271
IShellFolderViewCB * psfvcb
Definition: shlobj.h:1360
Definition: ffs.h:70
#define __stdcall
Definition: typedefs.h:25
uint32_t ULONG
Definition: typedefs.h:59
#define IID_PPV_ARG(Itype, ppType)

◆ 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 {
289 return 0;
290 }
292}
#define DefWindowProc
Definition: ros2win.h:31
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_DESTROY
Definition: winuser.h:1612

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().