blob: a14c6e570bb1150d538dd5963fb2e2f52636f8a1 [file] [log] [blame]
Alexandre Julliarde658d821997-11-30 17:45:40 +00001/*
Juergen Schmiedba28ba11999-01-23 14:12:48 +00002 * The parameters of many functions changes between different OS versions
3 * (NT uses Unicode strings, 95 uses ASCII strings)
Alexandre Julliarde658d821997-11-30 17:45:40 +00004 *
Alexandre Julliarde658d821997-11-30 17:45:40 +00005 * Copyright 1997 Marcus Meissner
Alexandre Julliard767e6f61998-08-09 12:47:43 +00006 * 1998 Jürgen Schmied
Alexandre Julliarde658d821997-11-30 17:45:40 +00007 */
Alexandre Julliarde658d821997-11-30 17:45:40 +00008#include <string.h>
Alexandre Julliard383da682000-02-10 22:15:21 +00009#include <stdio.h>
Alexandre Julliarda845b881998-06-01 10:44:35 +000010#include "winerror.h"
Marcus Meissner317af321999-02-17 13:51:06 +000011#include "winreg.h"
Alexandre Julliarda099a551999-06-12 15:45:58 +000012#include "debugtools.h"
Juergen Schmiede8d281d1998-10-24 09:22:57 +000013#include "winnls.h"
Juergen Schmiedba28ba11999-01-23 14:12:48 +000014#include "heap.h"
15
Juergen Schmied28613d31999-04-22 10:11:04 +000016#include "shellapi.h"
Alexandre Julliardb08cb172000-08-03 04:19:24 +000017#include "shlguid.h"
Juergen Schmiedba28ba11999-01-23 14:12:48 +000018#include "shlobj.h"
Alexandre Julliard85ed45e1998-08-22 19:03:56 +000019#include "shell32_main.h"
Juergen Schmied43577ec1999-07-25 12:22:57 +000020#include "wine/undocshell.h"
Alexandre Julliarde658d821997-11-30 17:45:40 +000021
Alexandre Julliard383da682000-02-10 22:15:21 +000022DEFAULT_DEBUG_CHANNEL(shell);
Patrik Stridvallb4b9fae1999-04-19 14:56:29 +000023
Alexandre Julliarde658d821997-11-30 17:45:40 +000024/*************************************************************************
Juergen Schmied85b92932000-04-28 20:21:49 +000025 * ParseFieldA [internal]
Alexandre Julliard642d3131998-07-12 19:29:36 +000026 *
Juergen Schmiedeabe82b2000-02-26 18:45:09 +000027 * copys a field from a ',' delimited string
28 *
29 * first field is nField = 1
Alexandre Julliard44ed71f1997-12-21 19:17:50 +000030 */
Juergen Schmied85b92932000-04-28 20:21:49 +000031DWORD WINAPI ParseFieldA(
32 LPCSTR src,
33 DWORD nField,
34 LPSTR dst,
35 DWORD len)
Juergen Schmiedeabe82b2000-02-26 18:45:09 +000036{
37 WARN("('%s',0x%08lx,%p,%ld) semi-stub.\n",src,nField,dst,len);
Juergen Schmied07e0d941998-12-01 08:55:13 +000038
39 if (!src || !src[0] || !dst || !len)
40 return 0;
41
Juergen Schmiedeabe82b2000-02-26 18:45:09 +000042 /* skip n fields delimited by ',' */
43 while (nField > 1)
44 {
45 if (*src=='\0') return FALSE;
46 if (*(src++)==',') nField--;
Juergen Schmied07e0d941998-12-01 08:55:13 +000047 }
48
Juergen Schmiedeabe82b2000-02-26 18:45:09 +000049 /* copy part till the next ',' to dst */
50 while ( *src!='\0' && *src!=',' && (len--)>0 ) *(dst++)=*(src++);
51
52 /* finalize the string */
Juergen Schmied07e0d941998-12-01 08:55:13 +000053 *dst=0x0;
54
55 return TRUE;
Alexandre Julliard44ed71f1997-12-21 19:17:50 +000056}
57
58/*************************************************************************
Juergen Schmied85b92932000-04-28 20:21:49 +000059 * ParseFieldW [internal]
60 *
61 * copys a field from a ',' delimited string
Alexandre Julliard642d3131998-07-12 19:29:36 +000062 *
Juergen Schmied85b92932000-04-28 20:21:49 +000063 * first field is nField = 1
Alexandre Julliard44ed71f1997-12-21 19:17:50 +000064 */
Juergen Schmied85b92932000-04-28 20:21:49 +000065DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len)
66{
67 FIXME("('%s',0x%08lx,%p,%ld) stub.\n",
68 debugstr_w(src), nField, dst, len);
69 return FALSE;
70}
71
72/*************************************************************************
73 * ParseFieldAW [SHELL32.58]
74 */
75DWORD WINAPI ParseFieldAW(LPCVOID src, DWORD nField, LPVOID dst, DWORD len)
76{
Alexandre Julliardd586dc92000-08-14 14:35:01 +000077 if (SHELL_OsIsUnicode())
Juergen Schmied85b92932000-04-28 20:21:49 +000078 return ParseFieldW(src, nField, dst, len);
79 return ParseFieldA(src, nField, dst, len);
Alexandre Julliard44ed71f1997-12-21 19:17:50 +000080}
81
82/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +000083 * GetFileNameFromBrowse [SHELL32.63]
Alexandre Julliard642d3131998-07-12 19:29:36 +000084 *
Alexandre Julliard44ed71f1997-12-21 19:17:50 +000085 */
Juergen Schmied85b92932000-04-28 20:21:49 +000086BOOL WINAPI GetFileNameFromBrowse(
87 HWND hwndOwner,
88 LPSTR lpstrFile,
89 DWORD nMaxFile,
90 LPCSTR lpstrInitialDir,
91 LPCSTR lpstrDefExt,
92 LPCSTR lpstrFilter,
93 LPCSTR lpstrTitle)
94{
95 FIXME("(%04x,%s,%ld,%s,%s,%s,%s):stub.\n",
96 hwndOwner, lpstrFile, nMaxFile, lpstrInitialDir, lpstrDefExt,
97 lpstrFilter, lpstrTitle);
98
Alexandre Julliard44ed71f1997-12-21 19:17:50 +000099 /* puts up a Open Dialog and requests input into targetbuf */
100 /* OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_FILEMUSTEXIST|OFN_unknown */
Alexandre Julliardd586dc92000-08-14 14:35:01 +0000101 strcpy(lpstrFile,"x:\\dummy.exe");
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000102 return 1;
103}
104
105/*************************************************************************
Juergen Schmiedfa9d4e42000-11-01 21:36:11 +0000106 * SHGetSetSettings [SHELL32.68]
107 */
108VOID WINAPI SHGetSetSettings(DWORD x, DWORD y, DWORD z)
109{
110 FIXME("0x%08lx 0x%08lx 0x%08lx\n", x, y, z);
111}
112
113/*************************************************************************
114 * SHGetSettings [SHELL32.@]
Alexandre Julliard642d3131998-07-12 19:29:36 +0000115 *
Juergen Schmiedae2d9a71999-04-10 16:41:50 +0000116 * NOTES
117 * the registry path are for win98 (tested)
118 * and possibly are the same in nt40
Juergen Schmiedfa9d4e42000-11-01 21:36:11 +0000119 *
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000120 */
Mike McCormack46bc5342000-09-18 01:40:13 +0000121VOID WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask)
Juergen Schmiedae2d9a71999-04-10 16:41:50 +0000122{
123 HKEY hKey;
124 DWORD dwData;
125 DWORD dwDataSize = sizeof (DWORD);
126
Mike McCormack46bc5342000-09-18 01:40:13 +0000127 TRACE("(%p 0x%08lx)\n",lpsfs,dwMask);
Juergen Schmiedae2d9a71999-04-10 16:41:50 +0000128
Juergen Schmied55c0bca1999-04-22 09:18:33 +0000129 if (RegCreateKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
Juergen Schmiedae2d9a71999-04-10 16:41:50 +0000130 0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0))
131 return;
132
133 if ( (SSF_SHOWEXTENSIONS & dwMask) && !RegQueryValueExA(hKey, "HideFileExt", 0, 0, (LPBYTE)&dwData, &dwDataSize))
134 lpsfs->fShowExtensions = ((dwData == 0) ? 0 : 1);
135
136 if ( (SSF_SHOWINFOTIP & dwMask) && !RegQueryValueExA(hKey, "ShowInfoTip", 0, 0, (LPBYTE)&dwData, &dwDataSize))
137 lpsfs->fShowInfoTip = ((dwData == 0) ? 0 : 1);
138
139 if ( (SSF_DONTPRETTYPATH & dwMask) && !RegQueryValueExA(hKey, "DontPrettyPath", 0, 0, (LPBYTE)&dwData, &dwDataSize))
140 lpsfs->fDontPrettyPath = ((dwData == 0) ? 0 : 1);
141
142 if ( (SSF_HIDEICONS & dwMask) && !RegQueryValueExA(hKey, "HideIcons", 0, 0, (LPBYTE)&dwData, &dwDataSize))
143 lpsfs->fHideIcons = ((dwData == 0) ? 0 : 1);
144
145 if ( (SSF_MAPNETDRVBUTTON & dwMask) && !RegQueryValueExA(hKey, "MapNetDrvBtn", 0, 0, (LPBYTE)&dwData, &dwDataSize))
146 lpsfs->fMapNetDrvBtn = ((dwData == 0) ? 0 : 1);
147
148 if ( (SSF_SHOWATTRIBCOL & dwMask) && !RegQueryValueExA(hKey, "ShowAttribCol", 0, 0, (LPBYTE)&dwData, &dwDataSize))
149 lpsfs->fShowAttribCol = ((dwData == 0) ? 0 : 1);
150
151 if (((SSF_SHOWALLOBJECTS | SSF_SHOWSYSFILES) & dwMask) && !RegQueryValueExA(hKey, "Hidden", 0, 0, (LPBYTE)&dwData, &dwDataSize))
152 { if (dwData == 0)
153 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
154 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
155 }
156 else if (dwData == 1)
157 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 1;
158 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 0;
159 }
160 else if (dwData == 2)
161 { if (SSF_SHOWALLOBJECTS & dwMask) lpsfs->fShowAllObjects = 0;
162 if (SSF_SHOWSYSFILES & dwMask) lpsfs->fShowSysFiles = 1;
163 }
164 }
165 RegCloseKey (hKey);
166
Alexandre Julliarda099a551999-06-12 15:45:58 +0000167 TRACE("-- 0x%04x\n", *(WORD*)lpsfs);
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000168}
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000169
170/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000171 * SHShellFolderView_Message [SHELL32.73]
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000172 *
173 * PARAMETERS
174 * hwndCabinet defines the explorer cabinet window that contains the
175 * shellview you need to communicate with
176 * uMsg identifying the SFVM enum to perform
177 * lParam
178 *
Alexandre Julliard829fe321998-07-26 14:27:39 +0000179 * NOTES
180 * Message SFVM_REARRANGE = 1
181 * This message gets sent when a column gets clicked to instruct the
182 * shell view to re-sort the item list. lParam identifies the column
183 * that was clicked.
184 */
Juergen Schmied85b92932000-04-28 20:21:49 +0000185int WINAPI SHShellFolderView_Message(
186 HWND hwndCabinet,
187 DWORD dwMessage,
188 DWORD dwParam)
189{
190 FIXME("%04x %08lx %08lx stub\n",hwndCabinet, dwMessage, dwParam);
191 return 0;
Alexandre Julliarde658d821997-11-30 17:45:40 +0000192}
193
194/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000195 * RegisterShellHook [SHELL32.181]
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000196 *
197 * PARAMS
198 * hwnd [I] window handle
199 * y [I] flag ????
200 *
201 * NOTES
202 * exported by ordinal
203 */
Juergen Schmied85b92932000-04-28 20:21:49 +0000204BOOL WINAPI RegisterShellHook(
205 HWND hWnd,
206 DWORD dwType)
207{
208 FIXME("(0x%08x,0x%08lx):stub.\n",hWnd, dwType);
209 return TRUE;
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000210}
Alexandre Julliard8da12c41999-01-17 16:55:11 +0000211/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000212 * ShellMessageBoxW [SHELL32.182]
Alexandre Julliard8da12c41999-01-17 16:55:11 +0000213 *
214 * Format and output errormessage.
215 *
Juergen Schmied879a6fe1999-02-09 14:16:44 +0000216 * idText resource ID of title or LPSTR
217 * idTitle resource ID of title or LPSTR
218 *
Alexandre Julliard8da12c41999-01-17 16:55:11 +0000219 * NOTES
220 * exported by ordinal
221 */
Juergen Schmied85b92932000-04-28 20:21:49 +0000222int WINAPIV ShellMessageBoxW(
223 HINSTANCE hInstance,
224 HWND hWnd,
225 LPCWSTR lpText,
226 LPCWSTR lpCaption,
227 UINT uType,
228 ...)
229{
Eric Pouech353962d2000-10-15 00:31:23 +0000230 WCHAR szText[100],szTitle[100];
231 LPCWSTR pszText = szText, pszTitle = szTitle, pszTemp;
Juergen Schmied85b92932000-04-28 20:21:49 +0000232 va_list args;
Eric Pouech353962d2000-10-15 00:31:23 +0000233 int ret;
234
Juergen Schmied85b92932000-04-28 20:21:49 +0000235 va_start(args, uType);
236 /* wvsprintfA(buf,fmt, args); */
Alexandre Julliard8da12c41999-01-17 16:55:11 +0000237
Juergen Schmied85b92932000-04-28 20:21:49 +0000238 TRACE("(%08lx,%08lx,%p,%p,%08x)\n",
239 (DWORD)hInstance,(DWORD)hWnd,lpText,lpCaption,uType);
Alexandre Julliard8da12c41999-01-17 16:55:11 +0000240
Juergen Schmied85b92932000-04-28 20:21:49 +0000241 if (!HIWORD(lpCaption))
Eric Pouech353962d2000-10-15 00:31:23 +0000242 LoadStringW(hInstance, (DWORD)lpCaption, szTitle, sizeof(szTitle)/sizeof(szTitle[0]));
Juergen Schmied879a6fe1999-02-09 14:16:44 +0000243 else
Juergen Schmied85b92932000-04-28 20:21:49 +0000244 pszTitle = lpCaption;
Juergen Schmied879a6fe1999-02-09 14:16:44 +0000245
Juergen Schmied85b92932000-04-28 20:21:49 +0000246 if (!HIWORD(lpText))
Eric Pouech353962d2000-10-15 00:31:23 +0000247 LoadStringW(hInstance, (DWORD)lpText, szText, sizeof(szText)/sizeof(szText[0]));
Juergen Schmied879a6fe1999-02-09 14:16:44 +0000248 else
Juergen Schmied85b92932000-04-28 20:21:49 +0000249 pszText = lpText;
Juergen Schmied879a6fe1999-02-09 14:16:44 +0000250
Eric Pouech353962d2000-10-15 00:31:23 +0000251 FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
252 pszText, 0, 0, (LPWSTR)&pszTemp, 0, &args);
Patrik Stridvall95bcd512000-04-29 14:29:05 +0000253
254 va_end(args);
255
Eric Pouech353962d2000-10-15 00:31:23 +0000256 ret = MessageBoxW(hWnd,pszTemp,pszTitle,uType);
257 LocalFree((HLOCAL)pszTemp);
258 return ret;
Alexandre Julliard8da12c41999-01-17 16:55:11 +0000259}
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000260
261/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000262 * ShellMessageBoxA [SHELL32.183]
Alexandre Julliarde658d821997-11-30 17:45:40 +0000263 */
Juergen Schmied85b92932000-04-28 20:21:49 +0000264int WINAPIV ShellMessageBoxA(
265 HINSTANCE hInstance,
266 HWND hWnd,
267 LPCSTR lpText,
268 LPCSTR lpCaption,
269 UINT uType,
270 ...)
Ian Schmidtcdff5431999-09-28 13:04:58 +0000271{
Eric Pouech353962d2000-10-15 00:31:23 +0000272 char szText[100],szTitle[100];
273 LPCSTR pszText = szText, pszTitle = szTitle, pszTemp;
Juergen Schmied85b92932000-04-28 20:21:49 +0000274 va_list args;
Eric Pouech353962d2000-10-15 00:31:23 +0000275 int ret;
276
Juergen Schmied85b92932000-04-28 20:21:49 +0000277 va_start(args, uType);
278 /* wvsprintfA(buf,fmt, args); */
Ian Schmidtcdff5431999-09-28 13:04:58 +0000279
Juergen Schmied85b92932000-04-28 20:21:49 +0000280 TRACE("(%08lx,%08lx,%p,%p,%08x)\n",
281 (DWORD)hInstance,(DWORD)hWnd,lpText,lpCaption,uType);
Ian Schmidtcdff5431999-09-28 13:04:58 +0000282
Juergen Schmied85b92932000-04-28 20:21:49 +0000283 if (!HIWORD(lpCaption))
Eric Pouech353962d2000-10-15 00:31:23 +0000284 LoadStringA(hInstance, (DWORD)lpCaption, szTitle, sizeof(szTitle));
Juergen Schmied85b92932000-04-28 20:21:49 +0000285 else
286 pszTitle = lpCaption;
Ian Schmidtcdff5431999-09-28 13:04:58 +0000287
Juergen Schmied85b92932000-04-28 20:21:49 +0000288 if (!HIWORD(lpText))
Eric Pouech353962d2000-10-15 00:31:23 +0000289 LoadStringA(hInstance, (DWORD)lpText, szText, sizeof(szText));
Juergen Schmied85b92932000-04-28 20:21:49 +0000290 else
291 pszText = lpText;
Ian Schmidtcdff5431999-09-28 13:04:58 +0000292
Eric Pouech353962d2000-10-15 00:31:23 +0000293 FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
294 pszText, 0, 0, (LPSTR)&pszTemp, 0, &args);
Patrik Stridvall95bcd512000-04-29 14:29:05 +0000295
296 va_end(args);
297
Eric Pouech353962d2000-10-15 00:31:23 +0000298 ret = MessageBoxA(hWnd,pszTemp,pszTitle,uType);
299 LocalFree((HLOCAL)pszTemp);
300 return ret;
Ian Schmidtcdff5431999-09-28 13:04:58 +0000301}
302
303/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000304 * SHFree [SHELL32.195]
Alexandre Julliardebfc0fe1998-06-28 18:40:26 +0000305 *
306 * NOTES
Alexandre Julliard642d3131998-07-12 19:29:36 +0000307 * free_ptr() - frees memory using IMalloc
308 * exported by ordinal
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000309 */
Juergen Schmied0d18aad2000-06-01 23:25:44 +0000310#define MEM_DEBUG 0
Juergen Schmied85b92932000-04-28 20:21:49 +0000311void WINAPI SHFree(LPVOID x)
Juergen Schmied43577ec1999-07-25 12:22:57 +0000312{
Juergen Schmiedafe53ed1999-11-23 22:31:18 +0000313#if MEM_DEBUG
Patrik Stridvall0ee98cc2000-02-26 13:17:55 +0000314 WORD len = *(LPWORD)((LPBYTE)x-2);
Juergen Schmied43577ec1999-07-25 12:22:57 +0000315
Patrik Stridvall0ee98cc2000-02-26 13:17:55 +0000316 if ( *(LPWORD)((LPBYTE)x+len) != 0x7384)
Juergen Schmied43577ec1999-07-25 12:22:57 +0000317 ERR("MAGIC2!\n");
Juergen Schmiedeac255c1999-08-15 14:31:36 +0000318
Patrik Stridvall0ee98cc2000-02-26 13:17:55 +0000319 if ( (*(LPWORD)((LPBYTE)x-4)) != 0x8271)
Juergen Schmiedeac255c1999-08-15 14:31:36 +0000320 ERR("MAGIC1!\n");
321 else
Patrik Stridvall0ee98cc2000-02-26 13:17:55 +0000322 memset((LPBYTE)x-4, 0xde, len+6);
Juergen Schmiedeac255c1999-08-15 14:31:36 +0000323
324 TRACE("%p len=%u\n",x, len);
325
Patrik Stridvall0ee98cc2000-02-26 13:17:55 +0000326 x = (LPBYTE) x - 4;
Juergen Schmiedeac255c1999-08-15 14:31:36 +0000327#else
328 TRACE("%p\n",x);
Juergen Schmied43577ec1999-07-25 12:22:57 +0000329#endif
Juergen Schmied85b92932000-04-28 20:21:49 +0000330 HeapFree(GetProcessHeap(), 0, x);
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000331}
332
333/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000334 * SHAlloc [SHELL32.196]
Alexandre Julliard642d3131998-07-12 19:29:36 +0000335 *
336 * NOTES
337 * void *task_alloc(DWORD len), uses SHMalloc allocator
338 * exported by ordinal
Alexandre Julliarde658d821997-11-30 17:45:40 +0000339 */
Juergen Schmied43577ec1999-07-25 12:22:57 +0000340LPVOID WINAPI SHAlloc(DWORD len)
341{
Juergen Schmiedeac255c1999-08-15 14:31:36 +0000342 LPBYTE ret;
343
Juergen Schmiedafe53ed1999-11-23 22:31:18 +0000344#if MEM_DEBUG
Juergen Schmiedeac255c1999-08-15 14:31:36 +0000345 ret = (LPVOID) HeapAlloc(GetProcessHeap(),0,len+6);
346#else
347 ret = (LPVOID) HeapAlloc(GetProcessHeap(),0,len);
Juergen Schmied43577ec1999-07-25 12:22:57 +0000348#endif
349
Juergen Schmiedafe53ed1999-11-23 22:31:18 +0000350#if MEM_DEBUG
Juergen Schmiedeac255c1999-08-15 14:31:36 +0000351 *(LPWORD)(ret) = 0x8271;
352 *(LPWORD)(ret+2) = (WORD)len;
353 *(LPWORD)(ret+4+len) = 0x7384;
354 ret += 4;
355 memset(ret, 0xdf, len);
356#endif
Juergen Schmied43577ec1999-07-25 12:22:57 +0000357 TRACE("%lu bytes at %p\n",len, ret);
358 return (LPVOID)ret;
Alexandre Julliarde658d821997-11-30 17:45:40 +0000359}
360
Alexandre Julliarddadf78f1998-05-17 17:13:43 +0000361/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000362 * SHRegisterDragDrop [SHELL32.86]
Alexandre Julliardebfc0fe1998-06-28 18:40:26 +0000363 *
364 * NOTES
Alexandre Julliard642d3131998-07-12 19:29:36 +0000365 * exported by ordinal
Alexandre Julliarda845b881998-06-01 10:44:35 +0000366 */
Juergen Schmied85b92932000-04-28 20:21:49 +0000367HRESULT WINAPI SHRegisterDragDrop(
368 HWND hWnd,
369 LPDROPTARGET pDropTarget)
Juergen Schmiedb18f3d61999-04-01 10:23:09 +0000370{
Alexandre Julliarda099a551999-06-12 15:45:58 +0000371 FIXME("(0x%08x,%p):stub.\n", hWnd, pDropTarget);
Alexandre Julliarde1e75372000-04-24 17:17:49 +0000372 if (GetShellOle()) return pRegisterDragDrop(hWnd, pDropTarget);
373 return 0;
Alexandre Julliarda845b881998-06-01 10:44:35 +0000374}
375
376/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000377 * SHRevokeDragDrop [SHELL32.87]
Alexandre Julliardebfc0fe1998-06-28 18:40:26 +0000378 *
379 * NOTES
Alexandre Julliard642d3131998-07-12 19:29:36 +0000380 * exported by ordinal
Alexandre Julliarda845b881998-06-01 10:44:35 +0000381 */
Juergen Schmied85b92932000-04-28 20:21:49 +0000382HRESULT WINAPI SHRevokeDragDrop(HWND hWnd)
383{
384 FIXME("(0x%08x):stub.\n",hWnd);
Alexandre Julliarda845b881998-06-01 10:44:35 +0000385 return 0;
386}
387
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000388/*************************************************************************
Eric Kohl45f88861999-06-26 11:55:15 +0000389 * SHDoDragDrop [SHELL32.88]
390 *
391 * NOTES
392 * exported by ordinal
393 */
Juergen Schmied85b92932000-04-28 20:21:49 +0000394HRESULT WINAPI SHDoDragDrop(
395 HWND hWnd,
396 LPDATAOBJECT lpDataObject,
397 LPDROPSOURCE lpDropSource,
398 DWORD dwOKEffect,
399 LPDWORD pdwEffect)
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000400{
Juergen Schmied85b92932000-04-28 20:21:49 +0000401 FIXME("(0x%04x %p %p 0x%08lx %p):stub.\n",
402 hWnd, lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000403 return 0;
404}
405
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000406/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000407 * ArrangeWindows [SHELL32.184]
Alexandre Julliard642d3131998-07-12 19:29:36 +0000408 *
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000409 */
Juergen Schmied85b92932000-04-28 20:21:49 +0000410WORD WINAPI ArrangeWindows(
411 HWND hwndParent,
412 DWORD dwReserved,
413 LPCRECT lpRect,
414 WORD cKids,
415 CONST HWND * lpKids)
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000416{
Juergen Schmied85b92932000-04-28 20:21:49 +0000417 FIXME("(0x%08x 0x%08lx %p 0x%04x %p):stub.\n",
418 hwndParent, dwReserved, lpRect, cKids, lpKids);
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000419 return 0;
420}
421
Alexandre Julliardebfc0fe1998-06-28 18:40:26 +0000422/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000423 * SignalFileOpen [SHELL32.103]
Alexandre Julliard642d3131998-07-12 19:29:36 +0000424 *
425 * NOTES
426 * exported by ordinal
427 */
428DWORD WINAPI
429SignalFileOpen (DWORD dwParam1)
430{
Alexandre Julliarda099a551999-06-12 15:45:58 +0000431 FIXME("(0x%08lx):stub.\n", dwParam1);
Alexandre Julliard642d3131998-07-12 19:29:36 +0000432
Alexandre Julliardebfc0fe1998-06-28 18:40:26 +0000433 return 0;
434}
435
Alexandre Julliard829fe321998-07-26 14:27:39 +0000436/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000437 * SHAddToRecentDocs [SHELL32.234]
Alexandre Julliard829fe321998-07-26 14:27:39 +0000438 *
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000439 * PARAMETERS
440 * uFlags [IN] SHARD_PATH or SHARD_PIDL
441 * pv [IN] string or pidl, NULL clears the list
442 *
Alexandre Julliard829fe321998-07-26 14:27:39 +0000443 * NOTES
444 * exported by name
445 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000446DWORD WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv)
Alexandre Julliard829fe321998-07-26 14:27:39 +0000447{ if (SHARD_PIDL==uFlags)
Alexandre Julliarda099a551999-06-12 15:45:58 +0000448 { FIXME("(0x%08x,pidl=%p):stub.\n", uFlags,pv);
Alexandre Julliard829fe321998-07-26 14:27:39 +0000449 }
450 else
Alexandre Julliarda099a551999-06-12 15:45:58 +0000451 { FIXME("(0x%08x,%s):stub.\n", uFlags,(char*)pv);
Alexandre Julliard829fe321998-07-26 14:27:39 +0000452 }
453 return 0;
454}
Juergen Schmied6acd0591998-10-11 15:50:14 +0000455/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000456 * SHCreateShellFolderViewEx [SHELL32.174]
Alexandre Julliard829fe321998-07-26 14:27:39 +0000457 *
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000458 * NOTES
459 * see IShellFolder::CreateViewObject
Alexandre Julliard829fe321998-07-26 14:27:39 +0000460 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000461HRESULT WINAPI SHCreateShellFolderViewEx(
Patrik Stridvall2b3aa612000-12-01 23:58:28 +0000462 LPCSHELLFOLDERVIEWINFO psvcbi, /* [in] shelltemplate struct */
463 LPSHELLVIEW* ppv) /* [out] IShellView pointer */
Juergen Schmied43577ec1999-07-25 12:22:57 +0000464{
465 IShellView * psf;
466 HRESULT hRes;
467
Juergen Schmied85b92932000-04-28 20:21:49 +0000468 TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=0x%08lx\n",
469 psvcbi->pshf, psvcbi->pidlFolder, psvcbi->lpfnCallback,
470 psvcbi->uViewMode, psvcbi->dwUser);
Juergen Schmied43577ec1999-07-25 12:22:57 +0000471
Juergen Schmied85b92932000-04-28 20:21:49 +0000472 psf = IShellView_Constructor(psvcbi->pshf);
Juergen Schmied43577ec1999-07-25 12:22:57 +0000473
474 if (!psf)
475 return E_OUTOFMEMORY;
476
477 IShellView_AddRef(psf);
478 hRes = IShellView_QueryInterface(psf, &IID_IShellView, (LPVOID *)ppv);
479 IShellView_Release(psf);
480
481 return hRes;
Alexandre Julliard829fe321998-07-26 14:27:39 +0000482}
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000483/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000484 * SHWinHelp [SHELL32.127]
Alexandre Julliarda0d77311998-09-13 16:32:00 +0000485 *
486 */
487HRESULT WINAPI SHWinHelp (DWORD v, DWORD w, DWORD x, DWORD z)
Alexandre Julliarda099a551999-06-12 15:45:58 +0000488{ FIXME("0x%08lx 0x%08lx 0x%08lx 0x%08lx stub\n",v,w,x,z);
Alexandre Julliarda0d77311998-09-13 16:32:00 +0000489 return 0;
490}
491/*************************************************************************
Eric Kohla8ea46b1998-10-11 13:25:51 +0000492 * SHRunControlPanel [SHELL32.161]
Alexandre Julliarda0d77311998-09-13 16:32:00 +0000493 *
494 */
Eric Kohla8ea46b1998-10-11 13:25:51 +0000495HRESULT WINAPI SHRunControlPanel (DWORD x, DWORD z)
Alexandre Julliarda099a551999-06-12 15:45:58 +0000496{ FIXME("0x%08lx 0x%08lx stub\n",x,z);
Alexandre Julliarda0d77311998-09-13 16:32:00 +0000497 return 0;
498}
499/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000500 * ShellExecuteEx [SHELL32.291]
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000501 *
502 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000503BOOL WINAPI ShellExecuteExAW (LPVOID sei)
Alexandre Julliardd586dc92000-08-14 14:35:01 +0000504{ if (SHELL_OsIsUnicode())
Alexandre Julliarda3960291999-02-26 11:11:13 +0000505 return ShellExecuteExW (sei);
506 return ShellExecuteExA (sei);
Juergen Schmied72b76d11998-11-15 13:28:00 +0000507}
508/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000509 * ShellExecuteExA [SHELL32.292]
Juergen Schmied72b76d11998-11-15 13:28:00 +0000510 *
Juergen Schmiedeabe82b2000-02-26 18:45:09 +0000511 * placeholder in the commandline:
512 * %1 file
513 * %2 printer
514 * %3 driver
515 * %4 port
516 * %I adress of a global item ID (explorer switch /idlist)
517 * %L ??? path/url/current file ???
518 * %S ???
519 * %* all following parameters (see batfile)
Juergen Schmied72b76d11998-11-15 13:28:00 +0000520 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000521BOOL WINAPI ShellExecuteExA (LPSHELLEXECUTEINFOA sei)
Juergen Schmied98f6cf01998-12-11 10:58:48 +0000522{ CHAR szApplicationName[MAX_PATH],szCommandline[MAX_PATH],szPidl[20];
523 LPSTR pos;
524 int gap, len;
Juergen Schmiedeabe82b2000-02-26 18:45:09 +0000525 STARTUPINFOA startup;
526 PROCESS_INFORMATION info;
Juergen Schmied98f6cf01998-12-11 10:58:48 +0000527
Juergen Schmied37fe75b1999-07-10 11:54:17 +0000528 WARN("mask=0x%08lx hwnd=0x%04x verb=%s file=%s parm=%s dir=%s show=0x%08x class=%s incomplete\n",
Juergen Schmied98f6cf01998-12-11 10:58:48 +0000529 sei->fMask, sei->hwnd, sei->lpVerb, sei->lpFile,
Juergen Schmied37fe75b1999-07-10 11:54:17 +0000530 sei->lpParameters, sei->lpDirectory, sei->nShow,
531 (sei->fMask & SEE_MASK_CLASSNAME) ? sei->lpClass : "not used");
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000532
Juergen Schmied98f6cf01998-12-11 10:58:48 +0000533 ZeroMemory(szApplicationName,MAX_PATH);
534 if (sei->lpFile)
535 strcpy(szApplicationName, sei->lpFile);
536
537 ZeroMemory(szCommandline,MAX_PATH);
538 if (sei->lpParameters)
539 strcpy(szCommandline, sei->lpParameters);
540
541 if (sei->fMask & (SEE_MASK_CLASSKEY | SEE_MASK_INVOKEIDLIST | SEE_MASK_ICON | SEE_MASK_HOTKEY |
Juergen Schmiedeabe82b2000-02-26 18:45:09 +0000542 SEE_MASK_CONNECTNETDRV | SEE_MASK_FLAG_DDEWAIT |
Juergen Schmied98f6cf01998-12-11 10:58:48 +0000543 SEE_MASK_DOENVSUBST | SEE_MASK_FLAG_NO_UI | SEE_MASK_UNICODE |
544 SEE_MASK_NO_CONSOLE | SEE_MASK_ASYNCOK | SEE_MASK_HMONITOR ))
Juergen Schmiedeabe82b2000-02-26 18:45:09 +0000545 {
546 FIXME("flags ignored: 0x%08lx\n", sei->fMask);
Alexandre Julliarda0d77311998-09-13 16:32:00 +0000547 }
Juergen Schmiedeabe82b2000-02-26 18:45:09 +0000548
549 /* launch a document by fileclass like 'Wordpad.Document.1' */
Alexandre Julliarda0d77311998-09-13 16:32:00 +0000550 if (sei->fMask & SEE_MASK_CLASSNAME)
Juergen Schmiedeabe82b2000-02-26 18:45:09 +0000551 {
552 /* the commandline contains 'c:\Path\wordpad.exe "%1"' */
553 HCR_GetExecuteCommand(sei->lpClass, (sei->lpVerb) ? sei->lpVerb : "open", szCommandline, 256);
554 /* fixme: get the extension of lpFile, check if it fits to the lpClass */
555 TRACE("SEE_MASK_CLASSNAME->'%s'\n", szCommandline);
Alexandre Julliarda0d77311998-09-13 16:32:00 +0000556 }
Juergen Schmied98f6cf01998-12-11 10:58:48 +0000557
558 /* process the IDList */
559 if ( (sei->fMask & SEE_MASK_INVOKEIDLIST) == SEE_MASK_INVOKEIDLIST) /*0x0c*/
Juergen Schmiedeabe82b2000-02-26 18:45:09 +0000560 {
561 SHGetPathFromIDListA (sei->lpIDList,szApplicationName);
Alexandre Julliarda099a551999-06-12 15:45:58 +0000562 TRACE("-- idlist=%p (%s)\n", sei->lpIDList, szApplicationName);
Alexandre Julliarda0d77311998-09-13 16:32:00 +0000563 }
Juergen Schmied98f6cf01998-12-11 10:58:48 +0000564 else
Juergen Schmiedeabe82b2000-02-26 18:45:09 +0000565 {
566 if (sei->fMask & SEE_MASK_IDLIST )
567 {
Juergen Schmied98f6cf01998-12-11 10:58:48 +0000568 pos = strstr(szCommandline, "%I");
569 if (pos)
Juergen Schmiedeabe82b2000-02-26 18:45:09 +0000570 {
Juergen Schmied85b92932000-04-28 20:21:49 +0000571 LPVOID pv;
Juergen Schmiedeabe82b2000-02-26 18:45:09 +0000572 HGLOBAL hmem = SHAllocShared ( sei->lpIDList, ILGetSize(sei->lpIDList), 0);
Juergen Schmied85b92932000-04-28 20:21:49 +0000573 pv = SHLockShared(hmem,0);
574 sprintf(szPidl,":%p",pv );
575 SHUnlockShared(pv);
Juergen Schmied98f6cf01998-12-11 10:58:48 +0000576
577 gap = strlen(szPidl);
578 len = strlen(pos)-2;
579 memmove(pos+gap,pos+2,len);
580 memcpy(pos,szPidl,gap);
581
582 }
583 }
584 }
585
Juergen Schmiedeabe82b2000-02-26 18:45:09 +0000586 TRACE("execute:'%s','%s'\n",szApplicationName, szCommandline);
587
588 strcat(szApplicationName, " ");
589 strcat(szApplicationName, szCommandline);
590
591 ZeroMemory(&startup,sizeof(STARTUPINFOA));
592 startup.cb = sizeof(STARTUPINFOA);
593
594 if (! CreateProcessA(NULL, szApplicationName,
595 NULL, NULL, FALSE, 0,
596 NULL, NULL, &startup, &info))
597 {
598 sei->hInstApp = GetLastError();
599 return FALSE;
Juergen Schmied98f6cf01998-12-11 10:58:48 +0000600 }
601
Juergen Schmiedeabe82b2000-02-26 18:45:09 +0000602 sei->hInstApp = 33;
Alexandre Julliarda0d77311998-09-13 16:32:00 +0000603
Juergen Schmiedeabe82b2000-02-26 18:45:09 +0000604 /* Give 30 seconds to the app to come up */
605 if ( WaitForInputIdle ( info.hProcess, 30000 ) == 0xFFFFFFFF )
606 ERR("WaitForInputIdle failed: Error %ld\n", GetLastError() );
607
608 if(sei->fMask & SEE_MASK_NOCLOSEPROCESS)
609 sei->hProcess = info.hProcess;
610 else
611 CloseHandle( info.hProcess );
612 CloseHandle( info.hThread );
613 return TRUE;
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000614}
615/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000616 * ShellExecuteExW [SHELL32.293]
Juergen Schmied72b76d11998-11-15 13:28:00 +0000617 *
618 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000619BOOL WINAPI ShellExecuteExW (LPSHELLEXECUTEINFOW sei)
620{ SHELLEXECUTEINFOA seiA;
Juergen Schmiedba28ba11999-01-23 14:12:48 +0000621 DWORD ret;
Juergen Schmied72b76d11998-11-15 13:28:00 +0000622
Alexandre Julliarda099a551999-06-12 15:45:58 +0000623 TRACE("%p\n", sei);
Juergen Schmied72b76d11998-11-15 13:28:00 +0000624
Alexandre Julliarda3960291999-02-26 11:11:13 +0000625 memcpy(&seiA, sei, sizeof(SHELLEXECUTEINFOA));
Juergen Schmied72b76d11998-11-15 13:28:00 +0000626
Juergen Schmiedba28ba11999-01-23 14:12:48 +0000627 if (sei->lpVerb)
628 seiA.lpVerb = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpVerb);
629
630 if (sei->lpFile)
631 seiA.lpFile = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpFile);
632
633 if (sei->lpParameters)
634 seiA.lpParameters = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpParameters);
635
636 if (sei->lpDirectory)
637 seiA.lpDirectory = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpDirectory);
638
639 if ((sei->fMask & SEE_MASK_CLASSNAME) && sei->lpClass)
640 seiA.lpClass = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpClass);
641 else
642 seiA.lpClass = NULL;
643
Alexandre Julliarda3960291999-02-26 11:11:13 +0000644 ret = ShellExecuteExA(&seiA);
Juergen Schmiedba28ba11999-01-23 14:12:48 +0000645
646 if (seiA.lpVerb) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpVerb );
647 if (seiA.lpFile) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpFile );
648 if (seiA.lpParameters) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpParameters );
649 if (seiA.lpDirectory) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpDirectory );
650 if (seiA.lpClass) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpClass );
651
652 return ret;
Juergen Schmied72b76d11998-11-15 13:28:00 +0000653}
Juergen Schmiedba28ba11999-01-23 14:12:48 +0000654
Juergen Schmied07e0d941998-12-01 08:55:13 +0000655static LPUNKNOWN SHELL32_IExplorerInterface=0;
Juergen Schmied72b76d11998-11-15 13:28:00 +0000656/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000657 * SHSetInstanceExplorer [SHELL32.176]
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000658 *
Juergen Schmied07e0d941998-12-01 08:55:13 +0000659 * NOTES
660 * Sets the interface
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000661 */
Juergen Schmied07e0d941998-12-01 08:55:13 +0000662HRESULT WINAPI SHSetInstanceExplorer (LPUNKNOWN lpUnknown)
Alexandre Julliarda099a551999-06-12 15:45:58 +0000663{ TRACE("%p\n", lpUnknown);
Juergen Schmied07e0d941998-12-01 08:55:13 +0000664 SHELL32_IExplorerInterface = lpUnknown;
665 return (HRESULT) lpUnknown;
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000666}
667/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000668 * SHGetInstanceExplorer [SHELL32.256]
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000669 *
670 * NOTES
Juergen Schmied07e0d941998-12-01 08:55:13 +0000671 * gets the interface pointer of the explorer and a reference
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000672 */
Juergen Schmied07e0d941998-12-01 08:55:13 +0000673HRESULT WINAPI SHGetInstanceExplorer (LPUNKNOWN * lpUnknown)
Alexandre Julliarda099a551999-06-12 15:45:58 +0000674{ TRACE("%p\n", lpUnknown);
Juergen Schmied07e0d941998-12-01 08:55:13 +0000675
676 *lpUnknown = SHELL32_IExplorerInterface;
677
678 if (!SHELL32_IExplorerInterface)
679 return E_FAIL;
680
Francois Gouget6e74ec01999-10-13 14:01:40 +0000681 IUnknown_AddRef(SHELL32_IExplorerInterface);
Juergen Schmied07e0d941998-12-01 08:55:13 +0000682 return NOERROR;
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000683}
684/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000685 * SHFreeUnusedLibraries [SHELL32.123]
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000686 *
687 * NOTES
688 * exported by name
689 */
Juergen Schmied85b92932000-04-28 20:21:49 +0000690void WINAPI SHFreeUnusedLibraries (void)
691{
692 FIXME("stub\n");
Alexandre Julliarda0d77311998-09-13 16:32:00 +0000693}
694/*************************************************************************
Eric Kohl8d8a1231999-07-31 13:06:39 +0000695 * DAD_SetDragImage [SHELL32.136]
696 *
697 * NOTES
698 * exported by name
699 */
Juergen Schmied85b92932000-04-28 20:21:49 +0000700BOOL WINAPI DAD_SetDragImage(
701 HIMAGELIST himlTrack,
702 LPPOINT lppt)
703{
704 FIXME("%p %p stub\n",himlTrack, lppt);
Eric Kohl8d8a1231999-07-31 13:06:39 +0000705 return 0;
706}
707/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000708 * DAD_ShowDragImage [SHELL32.137]
Alexandre Julliarda0d77311998-09-13 16:32:00 +0000709 *
710 * NOTES
711 * exported by name
712 */
Juergen Schmied85b92932000-04-28 20:21:49 +0000713BOOL WINAPI DAD_ShowDragImage(BOOL bShow)
714{
715 FIXME("0x%08x stub\n",bShow);
716 return 0;
Alexandre Julliard767e6f61998-08-09 12:47:43 +0000717}
Alexandre Julliarda0d77311998-09-13 16:32:00 +0000718/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000719 * ReadCabinetState [NT 4.0:SHELL32.651]
Juergen Schmied6acd0591998-10-11 15:50:14 +0000720 *
721 */
722HRESULT WINAPI ReadCabinetState(DWORD u, DWORD v)
Alexandre Julliarda099a551999-06-12 15:45:58 +0000723{ FIXME("0x%04lx 0x%04lx stub\n",u,v);
Juergen Schmied6acd0591998-10-11 15:50:14 +0000724 return 0;
725}
726/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000727 * WriteCabinetState [NT 4.0:SHELL32.652]
Juergen Schmied6acd0591998-10-11 15:50:14 +0000728 *
729 */
730HRESULT WINAPI WriteCabinetState(DWORD u)
Alexandre Julliarda099a551999-06-12 15:45:58 +0000731{ FIXME("0x%04lx stub\n",u);
Juergen Schmied6acd0591998-10-11 15:50:14 +0000732 return 0;
733}
734/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000735 * FileIconInit [SHELL32.660]
Petter Reinholdtsen5a17c031998-10-13 12:49:40 +0000736 *
737 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000738BOOL WINAPI FileIconInit(BOOL bFullInit)
Alexandre Julliarda099a551999-06-12 15:45:58 +0000739{ FIXME("(%s)\n", bFullInit ? "true" : "false");
Petter Reinholdtsen5a17c031998-10-13 12:49:40 +0000740 return 0;
741}
742/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000743 * IsUserAdmin [NT 4.0:SHELL32.680]
Juergen Schmied6acd0591998-10-11 15:50:14 +0000744 *
745 */
Juergen Schmied72b76d11998-11-15 13:28:00 +0000746HRESULT WINAPI IsUserAdmin(void)
Alexandre Julliarda099a551999-06-12 15:45:58 +0000747{ FIXME("stub\n");
Juergen Schmied6acd0591998-10-11 15:50:14 +0000748 return TRUE;
Alexandre Julliarda0d77311998-09-13 16:32:00 +0000749}
Patrik Stridvallfcfacb92000-03-24 20:46:04 +0000750
Eric Kohla8ea46b1998-10-11 13:25:51 +0000751/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000752 * SHAllocShared [SHELL32.520]
Juergen Schmied61013241998-10-16 15:40:20 +0000753 *
754 * NOTES
755 * parameter1 is return value from HeapAlloc
756 * parameter2 is equal to the size allocated with HeapAlloc
757 * parameter3 is return value from GetCurrentProcessId
758 *
759 * the return value is posted as lParam with 0x402 (WM_USER+2) to somewhere
760 * WM_USER+2 could be the undocumented CWM_SETPATH
761 * the allocated memory contains a pidl
762 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000763HGLOBAL WINAPI SHAllocShared(LPVOID psrc, DWORD size, DWORD procID)
764{ HGLOBAL hmem;
Juergen Schmied61013241998-10-16 15:40:20 +0000765 LPVOID pmem;
766
Alexandre Julliarda099a551999-06-12 15:45:58 +0000767 TRACE("ptr=%p size=0x%04lx procID=0x%04lx\n",psrc,size,procID);
Alexandre Julliarda3960291999-02-26 11:11:13 +0000768 hmem = GlobalAlloc(GMEM_FIXED, size);
Juergen Schmied61013241998-10-16 15:40:20 +0000769 if (!hmem)
770 return 0;
771
Alexandre Julliarda3960291999-02-26 11:11:13 +0000772 pmem = GlobalLock (hmem);
Juergen Schmied61013241998-10-16 15:40:20 +0000773
774 if (! pmem)
775 return 0;
776
777 memcpy (pmem, psrc, size);
Alexandre Julliarda3960291999-02-26 11:11:13 +0000778 GlobalUnlock(hmem);
Juergen Schmied61013241998-10-16 15:40:20 +0000779 return hmem;
780}
781/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000782 * SHLockShared [SHELL32.521]
Juergen Schmied61013241998-10-16 15:40:20 +0000783 *
784 * NOTES
785 * parameter1 is return value from SHAllocShared
786 * parameter2 is return value from GetCurrentProcessId
787 * the receiver of (WM_USER+2) trys to lock the HANDLE (?)
788 * the returnvalue seems to be a memoryadress
789 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000790LPVOID WINAPI SHLockShared(HANDLE hmem, DWORD procID)
Alexandre Julliarda099a551999-06-12 15:45:58 +0000791{ TRACE("handle=0x%04x procID=0x%04lx\n",hmem,procID);
Alexandre Julliarda3960291999-02-26 11:11:13 +0000792 return GlobalLock(hmem);
Juergen Schmied61013241998-10-16 15:40:20 +0000793}
794/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000795 * SHUnlockShared [SHELL32.522]
Juergen Schmied61013241998-10-16 15:40:20 +0000796 *
797 * NOTES
798 * parameter1 is return value from SHLockShared
799 */
Juergen Schmied85b92932000-04-28 20:21:49 +0000800BOOL WINAPI SHUnlockShared(LPVOID pv)
801{
802 TRACE("%p\n",pv);
803 return GlobalUnlock((HANDLE)pv);
Juergen Schmied61013241998-10-16 15:40:20 +0000804}
805/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000806 * SHFreeShared [SHELL32.523]
Juergen Schmied61013241998-10-16 15:40:20 +0000807 *
808 * NOTES
809 * parameter1 is return value from SHAllocShared
810 * parameter2 is return value from GetCurrentProcessId
811 */
Juergen Schmied85b92932000-04-28 20:21:49 +0000812BOOL WINAPI SHFreeShared(
813 HANDLE hMem,
814 DWORD pid)
815{
816 TRACE("handle=0x%04x 0x%04lx\n",hMem,pid);
817 return GlobalFree(hMem);
Juergen Schmied61013241998-10-16 15:40:20 +0000818}
819
820/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000821 * SetAppStartingCursor [SHELL32.99]
Juergen Schmied61013241998-10-16 15:40:20 +0000822 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000823HRESULT WINAPI SetAppStartingCursor(HWND u, DWORD v)
Alexandre Julliarda099a551999-06-12 15:45:58 +0000824{ FIXME("hwnd=0x%04x 0x%04lx stub\n",u,v );
Juergen Schmied61013241998-10-16 15:40:20 +0000825 return 0;
826}
827/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000828 * SHLoadOLE [SHELL32.151]
Juergen Schmied61013241998-10-16 15:40:20 +0000829 *
830 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000831HRESULT WINAPI SHLoadOLE(DWORD u)
Alexandre Julliarda099a551999-06-12 15:45:58 +0000832{ FIXME("0x%04lx stub\n",u);
Juergen Schmied61013241998-10-16 15:40:20 +0000833 return S_OK;
834}
835/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000836 * DriveType [SHELL32.64]
Juergen Schmied61013241998-10-16 15:40:20 +0000837 *
838 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000839HRESULT WINAPI DriveType(DWORD u)
Alexandre Julliarda099a551999-06-12 15:45:58 +0000840{ FIXME("0x%04lx stub\n",u);
Juergen Schmied61013241998-10-16 15:40:20 +0000841 return 0;
842}
843/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000844 * SHAbortInvokeCommand [SHELL32.198]
Juergen Schmied61013241998-10-16 15:40:20 +0000845 *
846 */
Juergen Schmied72b76d11998-11-15 13:28:00 +0000847HRESULT WINAPI SHAbortInvokeCommand(void)
Alexandre Julliarda099a551999-06-12 15:45:58 +0000848{ FIXME("stub\n");
Juergen Schmied61013241998-10-16 15:40:20 +0000849 return 1;
850}
851/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000852 * SHOutOfMemoryMessageBox [SHELL32.126]
Juergen Schmied61013241998-10-16 15:40:20 +0000853 *
854 */
Juergen Schmied85b92932000-04-28 20:21:49 +0000855int WINAPI SHOutOfMemoryMessageBox(
856 HWND hwndOwner,
857 LPCSTR lpCaption,
858 UINT uType)
859{
860 FIXME("0x%04x %s 0x%08x stub\n",hwndOwner, lpCaption, uType);
Juergen Schmied61013241998-10-16 15:40:20 +0000861 return 0;
862}
863/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000864 * SHFlushClipboard [SHELL32.121]
Eric Kohla8ea46b1998-10-11 13:25:51 +0000865 *
866 */
Juergen Schmied72b76d11998-11-15 13:28:00 +0000867HRESULT WINAPI SHFlushClipboard(void)
Alexandre Julliarda099a551999-06-12 15:45:58 +0000868{ FIXME("stub\n");
Juergen Schmied61013241998-10-16 15:40:20 +0000869 return 1;
Eric Kohla8ea46b1998-10-11 13:25:51 +0000870}
Ulrich Czekallac8a3f7a1999-10-23 16:50:58 +0000871
Juergen Schmied72b76d11998-11-15 13:28:00 +0000872/*************************************************************************
Juergen Schmieddd153f11999-03-13 17:10:36 +0000873 * SHWaitForFileToOpen [SHELL32.97]
Juergen Schmied07e0d941998-12-01 08:55:13 +0000874 *
875 */
Juergen Schmied85b92932000-04-28 20:21:49 +0000876BOOL WINAPI SHWaitForFileToOpen(
877 LPCITEMIDLIST pidl,
878 DWORD dwFlags,
879 DWORD dwTimeout)
880{
881 FIXME("%p 0x%08lx 0x%08lx stub\n", pidl, dwFlags, dwTimeout);
Juergen Schmied07e0d941998-12-01 08:55:13 +0000882 return 0;
883}
Juergen Schmiedddecd8a1999-03-25 10:55:43 +0000884
Juergen Schmiedb18f3d61999-04-01 10:23:09 +0000885/************************************************************************
886 * shell32_654 [SHELL32.654]
887 *
Juergen Schmied37fe75b1999-07-10 11:54:17 +0000888 * NOTES: first parameter seems to be a pointer (same as passed to WriteCabinetState)
889 * second one could be a size (0x0c). The size is the same as the structure saved to
890 * HCU\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState
891 * I'm (js) guessing: this one is just ReadCabinetState ;-)
Juergen Schmiedb18f3d61999-04-01 10:23:09 +0000892 */
Ian Schmidtbeed9831999-05-23 09:28:52 +0000893HRESULT WINAPI shell32_654 (DWORD x, DWORD y)
Alexandre Julliarda099a551999-06-12 15:45:58 +0000894{ FIXME("0x%08lx 0x%08lx stub\n",x,y);
Juergen Schmiedddecd8a1999-03-25 10:55:43 +0000895 return 0;
896}
Juergen Schmiedb18f3d61999-04-01 10:23:09 +0000897
898/************************************************************************
899 * RLBuildListOfPaths [SHELL32.146]
900 *
901 * NOTES
902 * builds a DPA
903 */
Juergen Schmied43577ec1999-07-25 12:22:57 +0000904DWORD WINAPI RLBuildListOfPaths (void)
Alexandre Julliarda099a551999-06-12 15:45:58 +0000905{ FIXME("stub\n");
Juergen Schmiedb18f3d61999-04-01 10:23:09 +0000906 return 0;
907}
908/************************************************************************
Juergen Schmied55c0bca1999-04-22 09:18:33 +0000909 * SHValidateUNC [SHELL32.173]
910 *
911 */
Ian Schmidt38aeff01999-05-29 10:52:00 +0000912HRESULT WINAPI SHValidateUNC (DWORD x, DWORD y, DWORD z)
Juergen Schmied37fe75b1999-07-10 11:54:17 +0000913{
914 FIXME("0x%08lx 0x%08lx 0x%08lx stub\n",x,y,z);
Juergen Schmied55c0bca1999-04-22 09:18:33 +0000915 return 0;
916}
Juergen Schmied37fe75b1999-07-10 11:54:17 +0000917
918/************************************************************************
Patrik Stridvallfcfacb92000-03-24 20:46:04 +0000919 * DoEnvironmentSubstA [SHELL32.1222]
Juergen Schmied37fe75b1999-07-10 11:54:17 +0000920 *
921 */
922HRESULT WINAPI DoEnvironmentSubstA(LPSTR x, LPSTR y)
923{
Patrik Stridvallb9050232000-05-11 21:48:28 +0000924 FIXME("(%s, %s) stub\n", debugstr_a(x), debugstr_a(y));
Juergen Schmied37fe75b1999-07-10 11:54:17 +0000925 return 0;
926}
927
Patrik Stridvallfcfacb92000-03-24 20:46:04 +0000928/************************************************************************
929 * DoEnvironmentSubstW [SHELL32.1223]
930 *
931 */
Juergen Schmied37fe75b1999-07-10 11:54:17 +0000932HRESULT WINAPI DoEnvironmentSubstW(LPWSTR x, LPWSTR y)
933{
Patrik Stridvallb9050232000-05-11 21:48:28 +0000934 FIXME("(%s, %s): stub\n", debugstr_w(x), debugstr_w(y));
Juergen Schmied37fe75b1999-07-10 11:54:17 +0000935 return 0;
936}
937
Patrik Stridvallfcfacb92000-03-24 20:46:04 +0000938/************************************************************************
939 * DoEnvironmentSubst [SHELL32.53]
940 *
941 */
Juergen Schmied37fe75b1999-07-10 11:54:17 +0000942HRESULT WINAPI DoEnvironmentSubstAW(LPVOID x, LPVOID y)
943{
Alexandre Julliardd586dc92000-08-14 14:35:01 +0000944 if (SHELL_OsIsUnicode())
Juergen Schmied37fe75b1999-07-10 11:54:17 +0000945 return DoEnvironmentSubstW(x, y);
946 return DoEnvironmentSubstA(x, y);
947}
Eric Kohl8d8a1231999-07-31 13:06:39 +0000948
Ian Schmidtcdff5431999-09-28 13:04:58 +0000949/*************************************************************************
950 * shell32_243 [SHELL32.243]
951 *
952 * Win98+ by-ordinal routine. In Win98 this routine returns zero and
953 * does nothing else. Possibly this does something in NT or SHELL32 5.0?
954 *
955 */
956
957BOOL WINAPI shell32_243(DWORD a, DWORD b)
958{
959 return FALSE;
960}
Ian Schmidtace09a71999-10-25 15:36:39 +0000961
Juergen Schmied0d18aad2000-06-01 23:25:44 +0000962/*************************************************************************
Juergen Schmied0d18aad2000-06-01 23:25:44 +0000963 * SHELL32_714 [SHELL32]
964 */
965DWORD WINAPI SHELL32_714(LPVOID x)
966{
967 FIXME("(%s)stub\n", debugstr_w(x));
968 return 0;
969}
Eric Pouech92b23182001-02-23 01:12:26 +0000970
971/*************************************************************************
972 * SHAddFromPropSheetExtArray [SHELL32]
973 */
974DWORD WINAPI SHAddFromPropSheetExtArray(DWORD a, DWORD b, DWORD c)
975{
976 FIXME("(%08lx,%08lx,%08lx)stub\n", a, b, c);
977 return 0;
978}
979
980/*************************************************************************
981 * SHCreatePropSheetExtArray [SHELL32]
982 */
983DWORD WINAPI SHCreatePropSheetExtArray(DWORD a, LPCSTR b, DWORD c)
984{
985 FIXME("(%08lx,%s,%08lx)stub\n", a, debugstr_a(b), c);
986 return 0;
987}
988
989/*************************************************************************
990 * SHReplaceFromPropSheetExtArray [SHELL]
991 */
992DWORD WINAPI SHReplaceFromPropSheetExtArray(DWORD a, DWORD b, DWORD c, DWORD d)
993{
994 FIXME("(%08lx,%08lx,%08lx,%08lx)stub\n", a, b, c, d);
995 return 0;
996}
997
998/*************************************************************************
999 * SHDestroyPropSheetExtArray [SHELL32]
1000 */
1001DWORD WINAPI SHDestroyPropSheetExtArray(DWORD a)
1002{
1003 FIXME("(%08lx)stub\n", a);
1004 return 0;
1005}