| 1 | /* $Id: shell32.cpp,v 1.2 1999-06-01 08:05:42 phaller Exp $ */
|
|---|
| 2 |
|
|---|
| 3 | /*
|
|---|
| 4 | * Win32 SHELL32 for OS/2
|
|---|
| 5 | *
|
|---|
| 6 | * 1998/06/15 Patrick Haller (haller@zebra.fh-weingarten.de)
|
|---|
| 7 | *
|
|---|
| 8 | * @(#) shell32.c 1.0.0 1998/06/15 PH Merge WINE/SHELLORD.C
|
|---|
| 9 | *
|
|---|
| 10 | *
|
|---|
| 11 | * Copyright 1997 Marcus Meissner
|
|---|
| 12 | * Copyright 1988 Patrick Haller (adapted for win32os2)
|
|---|
| 13 | *
|
|---|
| 14 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 15 | *
|
|---|
| 16 | */
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 | /*****************************************************************************
|
|---|
| 20 | * Includes *
|
|---|
| 21 | *****************************************************************************/
|
|---|
| 22 |
|
|---|
| 23 | #include <os2win.h>
|
|---|
| 24 | #include <shellapi.h>
|
|---|
| 25 | #include <winreg.h>
|
|---|
| 26 | #include "shell32.h"
|
|---|
| 27 |
|
|---|
| 28 | #include <stdarg.h>
|
|---|
| 29 | //#include <builtin.h>
|
|---|
| 30 | #include <stdio.h>
|
|---|
| 31 | #include <stdlib.h>
|
|---|
| 32 | #include <string.h>
|
|---|
| 33 |
|
|---|
| 34 | #include <misc.h>
|
|---|
| 35 | #include <nameid.h>
|
|---|
| 36 | #include <unicode.h>
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 | //static const char* lpstrMsgWndCreated = "OTHERWINDOWCREATED";
|
|---|
| 40 | //static const char* lpstrMsgWndDestroyed = "OTHERWINDOWDESTROYED";
|
|---|
| 41 | //static const char* lpstrMsgShellActivate = "ACTIVATESHELLWINDOW";
|
|---|
| 42 |
|
|---|
| 43 | //static HWND SHELL_hWnd = 0;
|
|---|
| 44 | //static HHOOK SHELL_hHook = 0;
|
|---|
| 45 | //static USHORT uMsgWndCreated = 0;
|
|---|
| 46 | //static USHORT uMsgWndDestroyed = 0;
|
|---|
| 47 | //static USHORT uMsgShellActivate = 0;
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 | /*****************************************************************************
|
|---|
| 52 | * Types & Defines *
|
|---|
| 53 | *****************************************************************************/
|
|---|
| 54 |
|
|---|
| 55 | //******************************************************************************
|
|---|
| 56 | //******************************************************************************
|
|---|
| 57 | VOID WIN32API DragAcceptFiles(HWND hwnd,
|
|---|
| 58 | BOOL fAccept)
|
|---|
| 59 | {
|
|---|
| 60 | dprintf(("SHELL32: DragAcceptFiles (%0uxh, %08xh) not implemented.\n",
|
|---|
| 61 | hwnd,
|
|---|
| 62 | fAccept));
|
|---|
| 63 | }
|
|---|
| 64 | //******************************************************************************
|
|---|
| 65 | //******************************************************************************
|
|---|
| 66 | VOID WIN32API DragFinish(HDROP hDrop)
|
|---|
| 67 | {
|
|---|
| 68 | dprintf(("SHELL32: DragFinish(%08xh) not implemented.\n",
|
|---|
| 69 | hDrop));
|
|---|
| 70 | }
|
|---|
| 71 | //******************************************************************************
|
|---|
| 72 | //******************************************************************************
|
|---|
| 73 | UINT WIN32API DragQueryFileA(HDROP hDrop,
|
|---|
| 74 | UINT iFile,
|
|---|
| 75 | LPTSTR lpszFile,
|
|---|
| 76 | UINT cch)
|
|---|
| 77 | {
|
|---|
| 78 | dprintf(("SHELL32: DragQueryFileA(%08xh,%08xh,%s,%08xh) not implemented.\n",
|
|---|
| 79 | hDrop,
|
|---|
| 80 | iFile,
|
|---|
| 81 | lpszFile,
|
|---|
| 82 | cch));
|
|---|
| 83 |
|
|---|
| 84 | return(0);
|
|---|
| 85 | }
|
|---|
| 86 | //******************************************************************************
|
|---|
| 87 | //******************************************************************************
|
|---|
| 88 | UINT WIN32API DragQueryFileAorW(HDROP hDrop,
|
|---|
| 89 | UINT iFile,
|
|---|
| 90 | LPTSTR lpszFile,
|
|---|
| 91 | UINT cch)
|
|---|
| 92 | {
|
|---|
| 93 | dprintf(("SHELL32: DragQueryFileAorW(%08xh,%08xh,%s,%08xh) not implemented.\n",
|
|---|
| 94 | hDrop,
|
|---|
| 95 | iFile,
|
|---|
| 96 | lpszFile,
|
|---|
| 97 | cch));
|
|---|
| 98 |
|
|---|
| 99 | return(0);
|
|---|
| 100 | }
|
|---|
| 101 | //******************************************************************************
|
|---|
| 102 | //******************************************************************************
|
|---|
| 103 | UINT WIN32API DragQueryFileW(HDROP hDrop,
|
|---|
| 104 | UINT iFile,
|
|---|
| 105 | LPWSTR lpszFile,
|
|---|
| 106 | UINT cch)
|
|---|
| 107 | {
|
|---|
| 108 | dprintf(("SHELL32: DragQueryFileW(%08xh,%08xh,%s,%08xh) not implemented.\n",
|
|---|
| 109 | hDrop,
|
|---|
| 110 | iFile,
|
|---|
| 111 | lpszFile,
|
|---|
| 112 | cch));
|
|---|
| 113 |
|
|---|
| 114 | return(0);
|
|---|
| 115 | }
|
|---|
| 116 | //******************************************************************************
|
|---|
| 117 | //******************************************************************************
|
|---|
| 118 | BOOL WIN32API DragQueryPoint(HDROP hDrop,
|
|---|
| 119 | LPPOINT lppt)
|
|---|
| 120 | {
|
|---|
| 121 | dprintf(("SHELL32: DragQueryPoint (%08xh,%08xh) not implemented.\n",
|
|---|
| 122 | hDrop,
|
|---|
| 123 | lppt));
|
|---|
| 124 |
|
|---|
| 125 | return(FALSE);
|
|---|
| 126 | }
|
|---|
| 127 | //******************************************************************************
|
|---|
| 128 | //******************************************************************************
|
|---|
| 129 | //******************************************************************************
|
|---|
| 130 | //******************************************************************************
|
|---|
| 131 | HINSTANCE WIN32API ShellExecuteA(HWND hwnd,
|
|---|
| 132 | LPCTSTR lpOperation,
|
|---|
| 133 | LPCTSTR lpFile,
|
|---|
| 134 | LPCTSTR lpParameters,
|
|---|
| 135 | LPCTSTR lpDirectory,
|
|---|
| 136 | INT nShowCmd)
|
|---|
| 137 | {
|
|---|
| 138 | dprintf (("SHELL32: ShellExecuteA(%08xh,%s,%s,%s,%s,%08xh) not implemented.\n",
|
|---|
| 139 | hwnd,
|
|---|
| 140 | lpOperation,
|
|---|
| 141 | lpFile,
|
|---|
| 142 | lpParameters,
|
|---|
| 143 | lpDirectory,
|
|---|
| 144 | nShowCmd));
|
|---|
| 145 |
|
|---|
| 146 | return(0); //out of memory
|
|---|
| 147 | }
|
|---|
| 148 | //******************************************************************************
|
|---|
| 149 | //TODO: Make nice dialog window
|
|---|
| 150 | //******************************************************************************
|
|---|
| 151 | int WIN32API ShellAboutA(HWND hwnd,
|
|---|
| 152 | LPCTSTR szApp,
|
|---|
| 153 | LPCTSTR szOtherStuff,
|
|---|
| 154 | HICON hIcon)
|
|---|
| 155 | {
|
|---|
| 156 | dprintf(("SHELL32: ShellAboutA(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
|
|---|
| 157 | hwnd,
|
|---|
| 158 | szApp,
|
|---|
| 159 | szOtherStuff,
|
|---|
| 160 | hIcon));
|
|---|
| 161 |
|
|---|
| 162 | /* @@@PH 98/06/07 */
|
|---|
| 163 | if (szOtherStuff == NULL) szOtherStuff = "";
|
|---|
| 164 | if (szApp == NULL) szApp = "";
|
|---|
| 165 |
|
|---|
| 166 | MessageBoxA(NULL,
|
|---|
| 167 | szOtherStuff,
|
|---|
| 168 | szApp,
|
|---|
| 169 | MB_OK); /*PLF Sun 97-11-23 22:58:49*/
|
|---|
| 170 |
|
|---|
| 171 | return(TRUE);
|
|---|
| 172 | }
|
|---|
| 173 | //******************************************************************************
|
|---|
| 174 | //******************************************************************************
|
|---|
| 175 | int WIN32API ShellAboutW(HWND hwnd,
|
|---|
| 176 | LPCWSTR szApp,
|
|---|
| 177 | LPCWSTR szOtherStuff,
|
|---|
| 178 | HICON hIcon)
|
|---|
| 179 | {
|
|---|
| 180 | dprintf(("SHELL32: ShellAboutW(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
|
|---|
| 181 | hwnd,
|
|---|
| 182 | szApp,
|
|---|
| 183 | szOtherStuff,
|
|---|
| 184 | hIcon));
|
|---|
| 185 |
|
|---|
| 186 | return(TRUE);
|
|---|
| 187 | }
|
|---|
| 188 | //******************************************************************************
|
|---|
| 189 | //Borrowed from Wine
|
|---|
| 190 | //******************************************************************************
|
|---|
| 191 | LPWSTR * WIN32API CommandLineToArgvW(LPCWSTR lpCmdLine,
|
|---|
| 192 | int *pNumArgs)
|
|---|
| 193 | {
|
|---|
| 194 | LPWSTR *argv, s, t;
|
|---|
| 195 | int i;
|
|---|
| 196 |
|
|---|
| 197 | dprintf(("SHELL32: CommandLineToArgvW(%s,%08xh)\n",
|
|---|
| 198 | lpCmdLine,
|
|---|
| 199 | pNumArgs));
|
|---|
| 200 |
|
|---|
| 201 | s = (LPWSTR)lpCmdLine;
|
|---|
| 202 | i = 0;
|
|---|
| 203 | while (*s) {
|
|---|
| 204 | /* space */
|
|---|
| 205 | if (*s==0x0020) {
|
|---|
| 206 | i++;
|
|---|
| 207 | s++;
|
|---|
| 208 | while (*s && *s==0x0020)
|
|---|
| 209 | s++;
|
|---|
| 210 | continue;
|
|---|
| 211 | }
|
|---|
| 212 | s++;
|
|---|
| 213 | }
|
|---|
| 214 | argv = (LPWSTR *)LocalAlloc(LPTR, sizeof(LPWSTR)*(i+1));
|
|---|
| 215 | s = t = (LPWSTR)lpCmdLine;
|
|---|
| 216 | i = 0;
|
|---|
| 217 | while(*s) {
|
|---|
| 218 | if (*s==0x0020) {
|
|---|
| 219 | *s=0;
|
|---|
| 220 | argv[i++] = t;
|
|---|
| 221 | *s=0x0020;
|
|---|
| 222 | while (*s && *s==0x0020)
|
|---|
| 223 | s++;
|
|---|
| 224 | if(*s)
|
|---|
| 225 | t=s+1;
|
|---|
| 226 | else t=s;
|
|---|
| 227 | continue;
|
|---|
| 228 | }
|
|---|
| 229 | s++;
|
|---|
| 230 | }
|
|---|
| 231 | if(*t)
|
|---|
| 232 | argv[i++] = t;
|
|---|
| 233 |
|
|---|
| 234 | argv[i]=NULL;
|
|---|
| 235 | *pNumArgs = i;
|
|---|
| 236 | return argv;
|
|---|
| 237 | }
|
|---|
| 238 | //******************************************************************************
|
|---|
| 239 | //******************************************************************************
|
|---|
| 240 | HICON WIN32API ExtractIconA(HINSTANCE hInst,
|
|---|
| 241 | LPCSTR lpszExeFileName,
|
|---|
| 242 | UINT nIconIndex)
|
|---|
| 243 | {
|
|---|
| 244 | dprintf(("SHELL32: ExtractIconA(%08xh,%s,%08xh) not implemented.\n",
|
|---|
| 245 | hInst,
|
|---|
| 246 | lpszExeFileName,
|
|---|
| 247 | nIconIndex));
|
|---|
| 248 |
|
|---|
| 249 | return(NULL);
|
|---|
| 250 | }
|
|---|
| 251 | //******************************************************************************
|
|---|
| 252 | //******************************************************************************
|
|---|
| 253 | HICON WIN32API ExtractIconW(HINSTANCE hInst,
|
|---|
| 254 | LPCWSTR lpszExeFileName,
|
|---|
| 255 | UINT nIconIndex)
|
|---|
| 256 | {
|
|---|
| 257 | HICON hicon = NULL;
|
|---|
| 258 | char *astring = UnicodeToAsciiString((LPWSTR)lpszExeFileName);
|
|---|
| 259 |
|
|---|
| 260 | dprintf(("SHELL32: ExtractIconW(%08xh,%s,%08xh) not implemented.\n",
|
|---|
| 261 | hInst,
|
|---|
| 262 | lpszExeFileName,
|
|---|
| 263 | nIconIndex));
|
|---|
| 264 |
|
|---|
| 265 |
|
|---|
| 266 | FreeAsciiString(astring);
|
|---|
| 267 | return(hicon);
|
|---|
| 268 | }
|
|---|
| 269 | /*****************************************************************************
|
|---|
| 270 | * Name : UINT WIN32API ExtractIconExA
|
|---|
| 271 | * Purpose :
|
|---|
| 272 | * Parameters:
|
|---|
| 273 | * Variables :
|
|---|
| 274 | * Result :
|
|---|
| 275 | * Remark :
|
|---|
| 276 | * Status : UNTESTED STUB
|
|---|
| 277 | *
|
|---|
| 278 | * Author : Patrick Haller [Sat, 1998/07/11 11:55]
|
|---|
| 279 | *****************************************************************************/
|
|---|
| 280 |
|
|---|
| 281 | DWORD WIN32API ExtractIconExA(LPCSTR lpszFile,
|
|---|
| 282 | int nIconIndex,
|
|---|
| 283 | HICON *phiconLarge,
|
|---|
| 284 | HICON *phiconSmall,
|
|---|
| 285 | UINT nIcons)
|
|---|
| 286 | {
|
|---|
| 287 | dprintf(("SHELL32: ExtractIconExA(%s,%08xh,%08xh,%08xh,%u) not implemented.\n",
|
|---|
| 288 | lpszFile,
|
|---|
| 289 | nIconIndex,
|
|---|
| 290 | phiconLarge,
|
|---|
| 291 | phiconSmall,
|
|---|
| 292 | nIcons));
|
|---|
| 293 |
|
|---|
| 294 | return (0);
|
|---|
| 295 | }
|
|---|
| 296 |
|
|---|
| 297 |
|
|---|
| 298 | /*****************************************************************************
|
|---|
| 299 | * Name : UINT WIN32API ExtractIconExW
|
|---|
| 300 | * Purpose :
|
|---|
| 301 | * Parameters:
|
|---|
| 302 | * Variables :
|
|---|
| 303 | * Result :
|
|---|
| 304 | * Remark :
|
|---|
| 305 | * Status : UNTESTED STUB
|
|---|
| 306 | *
|
|---|
| 307 | * Author : Patrick Haller [Sat, 1998/07/11 11:55]
|
|---|
| 308 | *****************************************************************************/
|
|---|
| 309 |
|
|---|
| 310 | DWORD WIN32API ExtractIconExW(LPCWSTR lpszFile,
|
|---|
| 311 | int nIconIndex,
|
|---|
| 312 | HICON *phiconLarge,
|
|---|
| 313 | HICON *phiconSmall,
|
|---|
| 314 | UINT nIcons)
|
|---|
| 315 | {
|
|---|
| 316 | dprintf(("SHELL32: ExtractIconExW(%s,%08xh,%08xh,%08xh,%u) not implemented.\n",
|
|---|
| 317 | lpszFile,
|
|---|
| 318 | nIconIndex,
|
|---|
| 319 | phiconLarge,
|
|---|
| 320 | phiconSmall,
|
|---|
| 321 | nIcons));
|
|---|
| 322 |
|
|---|
| 323 | return (0);
|
|---|
| 324 | }
|
|---|
| 325 |
|
|---|
| 326 |
|
|---|
| 327 | //******************************************************************************
|
|---|
| 328 | HINSTANCE WIN32API FindExecutableA(LPCSTR lpszFile,
|
|---|
| 329 | LPCSTR lpszDir,
|
|---|
| 330 | LPTSTR lpszResult)
|
|---|
| 331 | {
|
|---|
| 332 | dprintf(("SHELL32: FindExecutableA (%s,%s,%s) not implemented.\n",
|
|---|
| 333 | lpszFile,
|
|---|
| 334 | lpszDir,
|
|---|
| 335 | lpszResult));
|
|---|
| 336 |
|
|---|
| 337 | return(NULL);
|
|---|
| 338 | }
|
|---|
| 339 | //******************************************************************************
|
|---|
| 340 | //******************************************************************************
|
|---|
| 341 | HINSTANCE WIN32API FindExecutableW(LPCWSTR lpszFile,
|
|---|
| 342 | LPCWSTR lpszDir,
|
|---|
| 343 | LPWSTR lpszResult)
|
|---|
| 344 | {
|
|---|
| 345 | dprintf(("SHELL32: FindExecutableW (%s,%s,%s) not implemented.\n",
|
|---|
| 346 | lpszFile,
|
|---|
| 347 | lpszDir,
|
|---|
| 348 | lpszResult));
|
|---|
| 349 |
|
|---|
| 350 | return(NULL);
|
|---|
| 351 | }
|
|---|
| 352 | //******************************************************************************
|
|---|
| 353 | //******************************************************************************
|
|---|
| 354 | HRESULT WIN32API SHGetMalloc(LPMALLOC *ppMalloc)
|
|---|
| 355 | {
|
|---|
| 356 | dprintf(("SHELL32: SHGetMalloc(%08xh) not implemented.\n",
|
|---|
| 357 | ppMalloc));
|
|---|
| 358 |
|
|---|
| 359 | return(0);
|
|---|
| 360 | }
|
|---|
| 361 | //******************************************************************************
|
|---|
| 362 | //******************************************************************************
|
|---|
| 363 | DWORD WIN32API SHGetFileInfoA(LPCSTR pszPath,
|
|---|
| 364 | DWORD dwFileAttributes,
|
|---|
| 365 | SHFILEINFOA *psfi,
|
|---|
| 366 | UINT cbFileInfo,
|
|---|
| 367 | UINT uFlags)
|
|---|
| 368 | {
|
|---|
| 369 | dprintf(("SHELL32: SHGetFileInfoA (%s,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
|
|---|
| 370 | pszPath,
|
|---|
| 371 | dwFileAttributes,
|
|---|
| 372 | psfi,
|
|---|
| 373 | cbFileInfo,
|
|---|
| 374 | uFlags));
|
|---|
| 375 |
|
|---|
| 376 | return(0);
|
|---|
| 377 | }
|
|---|
| 378 | //******************************************************************************
|
|---|
| 379 | //******************************************************************************
|
|---|
| 380 | DWORD WIN32API SHGetFileInfoW(LPCWSTR pszPath,
|
|---|
| 381 | DWORD dwFileAttributes,
|
|---|
| 382 | SHFILEINFOW *psfi,
|
|---|
| 383 | UINT cbFileInfo,
|
|---|
| 384 | UINT uFlags)
|
|---|
| 385 | {
|
|---|
| 386 | char *astring = UnicodeToAsciiString((LPWSTR)pszPath);
|
|---|
| 387 |
|
|---|
| 388 | dprintf(("SHELL32: SHGetFileInfoW (%s,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
|
|---|
| 389 | astring,
|
|---|
| 390 | dwFileAttributes,
|
|---|
| 391 | psfi,
|
|---|
| 392 | cbFileInfo,
|
|---|
| 393 | uFlags));
|
|---|
| 394 |
|
|---|
| 395 | FreeAsciiString(astring);
|
|---|
| 396 | return(0);
|
|---|
| 397 | }
|
|---|
| 398 | //******************************************************************************
|
|---|
| 399 | //******************************************************************************
|
|---|
| 400 | HRESULT WIN32API SHGetDesktopFolder(LPSHELLFOLDER *ppshf)
|
|---|
| 401 | {
|
|---|
| 402 | dprintf(("SHELL32: SHGetDesktopFolder(%08xh) not implemented.\n",
|
|---|
| 403 | ppshf));
|
|---|
| 404 |
|
|---|
| 405 | return(1);
|
|---|
| 406 | }
|
|---|
| 407 | //******************************************************************************
|
|---|
| 408 | //******************************************************************************
|
|---|
| 409 | void WIN32API SHAddToRecentDocs(UINT uFlags, LPCVOID pv)
|
|---|
| 410 | {
|
|---|
| 411 | dprintf(("SHELL32: SHAddToRecentDocs(%08xh,%08xh) not implemented.\n",
|
|---|
| 412 | uFlags,
|
|---|
| 413 | pv));
|
|---|
| 414 | }
|
|---|
| 415 | //******************************************************************************
|
|---|
| 416 | //******************************************************************************
|
|---|
| 417 | void WIN32API SHChangeNotify(LONG wEventId,
|
|---|
| 418 | UINT uFlags,
|
|---|
| 419 | LPCVOID dwItem1,
|
|---|
| 420 | LPCVOID dwItem2)
|
|---|
| 421 | {
|
|---|
| 422 | dprintf(("SHELL32: SHChangeNotify(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
|
|---|
| 423 | wEventId,
|
|---|
| 424 | uFlags,
|
|---|
| 425 | dwItem1,
|
|---|
| 426 | dwItem2));
|
|---|
| 427 | }
|
|---|
| 428 | //******************************************************************************
|
|---|
| 429 | //******************************************************************************
|
|---|
| 430 | DWORD WIN32API SHFileOperationA(LPSHFILEOPSTRUCTA lpFileOp)
|
|---|
| 431 | {
|
|---|
| 432 | dprintf(("SHELL32: SHFileOperationA(%08xh) not implemented.\n",
|
|---|
| 433 | lpFileOp));
|
|---|
| 434 |
|
|---|
| 435 | return(0);
|
|---|
| 436 | }
|
|---|
| 437 | //******************************************************************************
|
|---|
| 438 |
|
|---|
| 439 | //******************************************************************************
|
|---|
| 440 | DWORD WIN32API SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
|
|---|
| 441 | {
|
|---|
| 442 | dprintf(("SHELL32: SHFileOperationW(%08xh) not implemented.\n",
|
|---|
| 443 | lpFileOp));
|
|---|
| 444 |
|
|---|
| 445 | return(0);
|
|---|
| 446 | }
|
|---|
| 447 | //******************************************************************************
|
|---|
| 448 |
|
|---|
| 449 | //******************************************************************************
|
|---|
| 450 | BOOL WIN32API SHGetPathFromIDListA(LPCITEMIDLIST pidl,
|
|---|
| 451 | LPSTR pszPath)
|
|---|
| 452 | {
|
|---|
| 453 | dprintf(("SHELL32: SHGetPathFromIDListA(%08xh,%s) not implemented.\n",
|
|---|
| 454 | pidl,
|
|---|
| 455 | pszPath));
|
|---|
| 456 |
|
|---|
| 457 | return(FALSE);
|
|---|
| 458 | }
|
|---|
| 459 | //******************************************************************************
|
|---|
| 460 | //******************************************************************************
|
|---|
| 461 | HRESULT WIN32API SHGetSpecialFolderLocation(HWND hwndOwner,
|
|---|
| 462 | int nFolder,
|
|---|
| 463 | LPITEMIDLIST * ppidl)
|
|---|
| 464 | {
|
|---|
| 465 | dprintf(("SHELL32: SHGetSpecialFolderLocation(%08xh,%08xh,%08xh) not implemented.\n",
|
|---|
| 466 | hwndOwner,
|
|---|
| 467 | nFolder,
|
|---|
| 468 | ppidl));
|
|---|
| 469 |
|
|---|
| 470 | return(1);
|
|---|
| 471 | }
|
|---|
| 472 | //******************************************************************************
|
|---|
| 473 | //******************************************************************************
|
|---|
| 474 | LPITEMIDLIST WIN32API SHBrowseForFolder(LPBROWSEINFOA lpbi)
|
|---|
| 475 | {
|
|---|
| 476 | dprintf(("SHELL32: SHBrowseForFolder(%08xh) not implemented.\n",
|
|---|
| 477 | lpbi));
|
|---|
| 478 |
|
|---|
| 479 | return(NULL);
|
|---|
| 480 | }
|
|---|
| 481 | //******************************************************************************
|
|---|
| 482 |
|
|---|
| 483 |
|
|---|
| 484 | /*************************************************************************
|
|---|
| 485 | * Shell_NotifyIcon [SHELL32.240]
|
|---|
| 486 | * FIXME
|
|---|
| 487 | * This function is supposed to deal with the systray.
|
|---|
| 488 | * Any ideas on how this is to be implimented?
|
|---|
| 489 | */
|
|---|
| 490 | BOOL WIN32API Shell_NotifyIconA(DWORD dwMessage,
|
|---|
| 491 | PNOTIFYICONDATAA pnid )
|
|---|
| 492 | {
|
|---|
| 493 | dprintf(("SHELL32: Shell_NotifyIconA(%08xh,%08xh) not implemented.\n",
|
|---|
| 494 | dwMessage,
|
|---|
| 495 | pnid));
|
|---|
| 496 |
|
|---|
| 497 | return FALSE;
|
|---|
| 498 | }
|
|---|
| 499 |
|
|---|
| 500 |
|
|---|
| 501 | /*************************************************************************
|
|---|
| 502 | * Shell_NotifyIcon [SHELL32.240]
|
|---|
| 503 | * FIXME
|
|---|
| 504 | * This function is supposed to deal with the systray.
|
|---|
| 505 | * Any ideas on how this is to be implimented?
|
|---|
| 506 | */
|
|---|
| 507 | BOOL WIN32API Shell_NotifyIconW(DWORD dwMessage,
|
|---|
| 508 | PNOTIFYICONDATAW pnid )
|
|---|
| 509 | {
|
|---|
| 510 | dprintf(("SHELL32: Shell_NotifyIconW(%08xh,%08xh) not implemented.\n",
|
|---|
| 511 | dwMessage,
|
|---|
| 512 | pnid));
|
|---|
| 513 |
|
|---|
| 514 | return FALSE;
|
|---|
| 515 | }
|
|---|
| 516 |
|
|---|
| 517 |
|
|---|
| 518 | /*****************************************************************************
|
|---|
| 519 | *
|
|---|
| 520 | * Code merged from WINE
|
|---|
| 521 | *
|
|---|
| 522 | * Patrick Haller 98/06/15
|
|---|
| 523 | *
|
|---|
| 524 | *****************************************************************************/
|
|---|
| 525 |
|
|---|
| 526 |
|
|---|
| 527 | /*************************************************************************
|
|---|
| 528 | * SHELL32_2 [SHELL32.2]
|
|---|
| 529 | */
|
|---|
| 530 | DWORD WIN32API SHELL32_2(HWND hwnd,
|
|---|
| 531 | DWORD x2,
|
|---|
| 532 | DWORD x3,
|
|---|
| 533 | DWORD x4,
|
|---|
| 534 | DWORD x5,
|
|---|
| 535 | DWORD x6)
|
|---|
| 536 | {
|
|---|
| 537 | dprintf(("SHELL32: .2 (0x%04x,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx) not implemented.\n",
|
|---|
| 538 | hwnd,
|
|---|
| 539 | x2,
|
|---|
| 540 | x3,
|
|---|
| 541 | x4,
|
|---|
| 542 | x5,
|
|---|
| 543 | x6));
|
|---|
| 544 | return 0;
|
|---|
| 545 | }
|
|---|
| 546 |
|
|---|
| 547 |
|
|---|
| 548 | /*************************************************************************
|
|---|
| 549 | * SHELL32_16 [SHELL32.16]
|
|---|
| 550 | * find_lastitem_in_itemidlist()
|
|---|
| 551 | */
|
|---|
| 552 | LPSHITEMID WIN32API SHELL32_16(LPITEMIDLIST iil)
|
|---|
| 553 | {
|
|---|
| 554 | LPSHITEMID lastsii,
|
|---|
| 555 | sii;
|
|---|
| 556 |
|
|---|
| 557 | dprintf(("SHELL32: .16 (%08xh)\n",
|
|---|
| 558 | iil));
|
|---|
| 559 |
|
|---|
| 560 | if (!iil)
|
|---|
| 561 | return NULL;
|
|---|
| 562 |
|
|---|
| 563 | sii = &(iil->mkid);
|
|---|
| 564 | lastsii = sii;
|
|---|
| 565 |
|
|---|
| 566 | while (sii->cb)
|
|---|
| 567 | {
|
|---|
| 568 | lastsii = sii;
|
|---|
| 569 | sii = (LPSHITEMID)(((char*)sii)+sii->cb);
|
|---|
| 570 | }
|
|---|
| 571 |
|
|---|
| 572 | return lastsii;
|
|---|
| 573 | }
|
|---|
| 574 |
|
|---|
| 575 |
|
|---|
| 576 | /*************************************************************************
|
|---|
| 577 | * SHELL32_29 [SHELL32.29]
|
|---|
| 578 | * is_rootdir(const char*path)
|
|---|
| 579 | */
|
|---|
| 580 | BOOL WIN32API SHELL32_29(LPCSTR x)
|
|---|
| 581 | {
|
|---|
| 582 | dprintf(("SHELL32: .29 (%s)\n",
|
|---|
| 583 | x));
|
|---|
| 584 |
|
|---|
| 585 |
|
|---|
| 586 | if (!lstrcmpA(x+1,":\\")) /* "X:\" */
|
|---|
| 587 | return 1;
|
|---|
| 588 |
|
|---|
| 589 | if (!lstrcmpA(x,"\\")) /* "\" */
|
|---|
| 590 | return 1;
|
|---|
| 591 |
|
|---|
| 592 | if (x[0]=='\\' && x[1]=='\\')
|
|---|
| 593 | { /* UNC "\\<xx>\" */
|
|---|
| 594 | int foundbackslash = 0;
|
|---|
| 595 |
|
|---|
| 596 | x=x+2;
|
|---|
| 597 | while (*x)
|
|---|
| 598 | {
|
|---|
| 599 | if (*x++=='\\')
|
|---|
| 600 | foundbackslash++;
|
|---|
| 601 | }
|
|---|
| 602 |
|
|---|
| 603 | if (foundbackslash<=1) /* max 1 \ more ... */
|
|---|
| 604 | return 1;
|
|---|
| 605 | }
|
|---|
| 606 | return 0;
|
|---|
| 607 | }
|
|---|
| 608 |
|
|---|
| 609 |
|
|---|
| 610 | /*************************************************************************
|
|---|
| 611 | * SHELL32_30 [SHELL32.30]
|
|---|
| 612 | * get_rootdir(char*path,int drive)
|
|---|
| 613 | */
|
|---|
| 614 | LPSTR WIN32API SHELL32_30(LPSTR root,
|
|---|
| 615 | BYTE drive)
|
|---|
| 616 | {
|
|---|
| 617 | dprintf(("SHELL32: .30 (%s, %u)\n",
|
|---|
| 618 | root,
|
|---|
| 619 | drive));
|
|---|
| 620 |
|
|---|
| 621 |
|
|---|
| 622 | strcpy(root,
|
|---|
| 623 | "A:\\");
|
|---|
| 624 | root[0]+=drive;
|
|---|
| 625 |
|
|---|
| 626 | return root;
|
|---|
| 627 | }
|
|---|
| 628 |
|
|---|
| 629 |
|
|---|
| 630 | /*************************************************************************
|
|---|
| 631 | * SHELL32_31 [SHELL32.31]
|
|---|
| 632 | * returns pointer to last . in last pathcomponent or at \0.
|
|---|
| 633 | */
|
|---|
| 634 | LPSTR WIN32API SHELL32_31(LPSTR path)
|
|---|
| 635 | {
|
|---|
| 636 | LPSTR lastpoint = NULL;
|
|---|
| 637 |
|
|---|
| 638 | dprintf(("SHELL32: .31 (%s)\n",
|
|---|
| 639 | path));
|
|---|
| 640 |
|
|---|
| 641 |
|
|---|
| 642 | while (*path)
|
|---|
| 643 | {
|
|---|
| 644 | if (*path=='\\'||*path==' ')
|
|---|
| 645 | lastpoint=NULL;
|
|---|
| 646 |
|
|---|
| 647 | if (*path=='.')
|
|---|
| 648 | lastpoint=path;
|
|---|
| 649 |
|
|---|
| 650 | path++;
|
|---|
| 651 | }
|
|---|
| 652 |
|
|---|
| 653 | return lastpoint ? lastpoint : path;
|
|---|
| 654 | }
|
|---|
| 655 |
|
|---|
| 656 |
|
|---|
| 657 | /*************************************************************************
|
|---|
| 658 | * SHELL32_32 [SHELL32.32]
|
|---|
| 659 | * append \ if there is none
|
|---|
| 660 | */
|
|---|
| 661 | LPSTR WIN32API SHELL32_32(LPSTR path)
|
|---|
| 662 | {
|
|---|
| 663 | int len;
|
|---|
| 664 |
|
|---|
| 665 | dprintf(("SHELL32: .31 (%s)\n",
|
|---|
| 666 | path));
|
|---|
| 667 |
|
|---|
| 668 |
|
|---|
| 669 | len = lstrlenA(path);
|
|---|
| 670 |
|
|---|
| 671 | if (len && path[len-1]!='\\')
|
|---|
| 672 | {
|
|---|
| 673 | path[len+0]='\\';
|
|---|
| 674 | path[len+1]='\0';
|
|---|
| 675 | return path+len+1;
|
|---|
| 676 | }
|
|---|
| 677 | else
|
|---|
| 678 | return path+len;
|
|---|
| 679 | }
|
|---|
| 680 |
|
|---|
| 681 |
|
|---|
| 682 | /*************************************************************************
|
|---|
| 683 | * SHELL32_33 [SHELL32.33]
|
|---|
| 684 | * remove spaces from beginning and end of passed string
|
|---|
| 685 | */
|
|---|
| 686 | LPSTR WIN32API SHELL32_33(LPSTR str)
|
|---|
| 687 | {
|
|---|
| 688 | LPSTR x = str;
|
|---|
| 689 |
|
|---|
| 690 | dprintf(("SHELL32: .33 (%s)\n",
|
|---|
| 691 | str));
|
|---|
| 692 |
|
|---|
| 693 |
|
|---|
| 694 | while (*x==' ')
|
|---|
| 695 | x++;
|
|---|
| 696 |
|
|---|
| 697 | if (x!=str)
|
|---|
| 698 | lstrcpyA(str,
|
|---|
| 699 | x);
|
|---|
| 700 |
|
|---|
| 701 | if (!*str)
|
|---|
| 702 | return str;
|
|---|
| 703 |
|
|---|
| 704 | x=str+strlen(str)-1;
|
|---|
| 705 |
|
|---|
| 706 | while (*x==' ')
|
|---|
| 707 | x--;
|
|---|
| 708 |
|
|---|
| 709 | if (*x==' ')
|
|---|
| 710 | *x='\0';
|
|---|
| 711 |
|
|---|
| 712 | return x;
|
|---|
| 713 | }
|
|---|
| 714 |
|
|---|
| 715 |
|
|---|
| 716 | /*************************************************************************
|
|---|
| 717 | * SHELL32_34 [SHELL32.34]
|
|---|
| 718 | * basename(char *fn);
|
|---|
| 719 | */
|
|---|
| 720 | LPSTR WIN32API SHELL32_34(LPSTR fn)
|
|---|
| 721 | {
|
|---|
| 722 | LPSTR basefn;
|
|---|
| 723 |
|
|---|
| 724 | dprintf(("SHELL32: .34 (%s)\n",
|
|---|
| 725 | fn));
|
|---|
| 726 |
|
|---|
| 727 |
|
|---|
| 728 | basefn = fn;
|
|---|
| 729 | while (fn[0])
|
|---|
| 730 | {
|
|---|
| 731 | if (( (fn[0]=='\\') ||
|
|---|
| 732 | (fn[0]==':')) && fn[1] && fn[1]!='\\')
|
|---|
| 733 | basefn = fn+1;
|
|---|
| 734 |
|
|---|
| 735 | fn++;
|
|---|
| 736 | }
|
|---|
| 737 |
|
|---|
| 738 | return basefn;
|
|---|
| 739 | }
|
|---|
| 740 |
|
|---|
| 741 | /*************************************************************************
|
|---|
| 742 | * SHELL32_35 [SHELL32.35]
|
|---|
| 743 | * bool getpath(char *pathname); truncates passed argument to a valid path
|
|---|
| 744 | * returns if the string was modified or not.
|
|---|
| 745 | * "\foo\xx\foo"-> "\foo\xx"
|
|---|
| 746 | * "\" -> "\"
|
|---|
| 747 | * "a:\foo" -> "a:\"
|
|---|
| 748 | */
|
|---|
| 749 | DWORD WIN32API SHELL32_35(LPSTR fn)
|
|---|
| 750 | {
|
|---|
| 751 | LPSTR x,cutplace;
|
|---|
| 752 |
|
|---|
| 753 | dprintf(("SHELL32: .35 (%s)\n",
|
|---|
| 754 | fn));
|
|---|
| 755 |
|
|---|
| 756 |
|
|---|
| 757 | if (!fn[0])
|
|---|
| 758 | return 0;
|
|---|
| 759 | x=fn;
|
|---|
| 760 | cutplace = fn;
|
|---|
| 761 | while (*x) {
|
|---|
| 762 | if (*x=='\\') {
|
|---|
| 763 | cutplace=x++;
|
|---|
| 764 | continue;
|
|---|
| 765 | }
|
|---|
| 766 | if (*x==':') {
|
|---|
| 767 | x++;
|
|---|
| 768 | if (*x=='\\')
|
|---|
| 769 | cutplace=++x;
|
|---|
| 770 | continue; /* already x++ed */
|
|---|
| 771 | }
|
|---|
| 772 | x++;
|
|---|
| 773 | }
|
|---|
| 774 | if (!*cutplace)
|
|---|
| 775 | return 0;
|
|---|
| 776 | if (cutplace==fn) {
|
|---|
| 777 | if (fn[0]=='\\') {
|
|---|
| 778 | if (!fn[1])
|
|---|
| 779 | return 0;
|
|---|
| 780 | fn[0]='\0';
|
|---|
| 781 | return 1;
|
|---|
| 782 | }
|
|---|
| 783 | }
|
|---|
| 784 | *cutplace='\0';
|
|---|
| 785 | return 1;
|
|---|
| 786 | }
|
|---|
| 787 |
|
|---|
| 788 | /*************************************************************************
|
|---|
| 789 | * SHELL32_37 [SHELL32.37]
|
|---|
| 790 | * concat_paths(char*target,const char*add);
|
|---|
| 791 | * concats "target\\add" and writes them to target
|
|---|
| 792 | */
|
|---|
| 793 | LPSTR WIN32API SHELL32_37(LPSTR target,
|
|---|
| 794 | LPSTR x1,
|
|---|
| 795 | LPSTR x2)
|
|---|
| 796 | {
|
|---|
| 797 | char buf[260];
|
|---|
| 798 |
|
|---|
| 799 | dprintf(("SHELL32: .37 (%s, %s, %s)\n",
|
|---|
| 800 | target,
|
|---|
| 801 | x1,
|
|---|
| 802 | x2));
|
|---|
| 803 |
|
|---|
| 804 |
|
|---|
| 805 | if (!x2 || !x2[0])
|
|---|
| 806 | {
|
|---|
| 807 | lstrcpyA(target,x1);
|
|---|
| 808 |
|
|---|
| 809 | return target;
|
|---|
| 810 | }
|
|---|
| 811 |
|
|---|
| 812 | lstrcpyA(buf,x1);
|
|---|
| 813 | SHELL32_32(buf); /* append \ if not there */
|
|---|
| 814 | lstrcatA(buf,x2);
|
|---|
| 815 | lstrcpyA(target,buf);
|
|---|
| 816 |
|
|---|
| 817 | return target;
|
|---|
| 818 | }
|
|---|
| 819 |
|
|---|
| 820 | /*************************************************************************
|
|---|
| 821 | * SHELL32_36 [SHELL32.36]
|
|---|
| 822 | * concat_paths(char*target,const char*add);
|
|---|
| 823 | * concats "target\\add" and writes them to target
|
|---|
| 824 | */
|
|---|
| 825 | LPSTR WIN32API SHELL32_36(LPSTR x1,
|
|---|
| 826 | LPSTR x2)
|
|---|
| 827 | {
|
|---|
| 828 | dprintf(("SHELL32: .36 (%s, %s)\n",
|
|---|
| 829 | x1,
|
|---|
| 830 | x2));
|
|---|
| 831 |
|
|---|
| 832 |
|
|---|
| 833 | while (x2[0]=='\\')
|
|---|
| 834 | x2++;
|
|---|
| 835 |
|
|---|
| 836 | return SHELL32_37(x1,
|
|---|
| 837 | x1,
|
|---|
| 838 | x2);
|
|---|
| 839 | }
|
|---|
| 840 |
|
|---|
| 841 | /*************************************************************************
|
|---|
| 842 | * SHELL32_39 [SHELL32.39]
|
|---|
| 843 | * isUNC(const char*path);
|
|---|
| 844 | */
|
|---|
| 845 | BOOL WIN32API SHELL32_39(LPCSTR path)
|
|---|
| 846 | {
|
|---|
| 847 | dprintf (("SHELL32: .39 (%s)\n",
|
|---|
| 848 | path));
|
|---|
| 849 |
|
|---|
| 850 |
|
|---|
| 851 | if ((path[0]=='\\') &&
|
|---|
| 852 | (path[1]=='\\'))
|
|---|
| 853 | return TRUE;
|
|---|
| 854 |
|
|---|
| 855 | return FALSE;
|
|---|
| 856 | }
|
|---|
| 857 |
|
|---|
| 858 |
|
|---|
| 859 | /*************************************************************************
|
|---|
| 860 | * SHELL32_45 [SHELL32.45]
|
|---|
| 861 | * file_exists(char *fn);
|
|---|
| 862 | */
|
|---|
| 863 | BOOL WIN32API SHELL32_45(LPSTR fn)
|
|---|
| 864 | {
|
|---|
| 865 | dprintf(("SHELL32: .45 (%s)\n",
|
|---|
| 866 | fn));
|
|---|
| 867 |
|
|---|
| 868 |
|
|---|
| 869 | if (GetFileAttributesA(fn)==-1)
|
|---|
| 870 | return FALSE;
|
|---|
| 871 | else
|
|---|
| 872 | return TRUE;
|
|---|
| 873 | }
|
|---|
| 874 |
|
|---|
| 875 | /*************************************************************************
|
|---|
| 876 | * SHELL32_52 [SHELL32.52]
|
|---|
| 877 | * look for next arg in string. handle "quoted" strings
|
|---|
| 878 | * returns pointer to argument *AFTER* the space. Or to the \0.
|
|---|
| 879 | */
|
|---|
| 880 | LPSTR WIN32API SHELL32_52(LPSTR cmdline)
|
|---|
| 881 | {
|
|---|
| 882 | BOOL qflag = FALSE;
|
|---|
| 883 |
|
|---|
| 884 | dprintf (("SHELL32: .52 (%s)\n",
|
|---|
| 885 | cmdline));
|
|---|
| 886 |
|
|---|
| 887 |
|
|---|
| 888 | while (*cmdline)
|
|---|
| 889 | {
|
|---|
| 890 | if ((*cmdline==' ') && !qflag)
|
|---|
| 891 | return cmdline+1;
|
|---|
| 892 |
|
|---|
| 893 | if (*cmdline=='"')
|
|---|
| 894 | qflag=!qflag;
|
|---|
| 895 |
|
|---|
| 896 | cmdline++;
|
|---|
| 897 | }
|
|---|
| 898 | return cmdline;
|
|---|
| 899 | }
|
|---|
| 900 |
|
|---|
| 901 |
|
|---|
| 902 | /*************************************************************************
|
|---|
| 903 | * SHELL32_56 [SHELL32.56]
|
|---|
| 904 | * unquote string (remove ")
|
|---|
| 905 | */
|
|---|
| 906 | VOID WIN32API SHELL32_56(LPSTR str)
|
|---|
| 907 | {
|
|---|
| 908 | DWORD len = lstrlenA(str);
|
|---|
| 909 |
|
|---|
| 910 | dprintf (("SHELL32: .56 (%s)\n",
|
|---|
| 911 | str));
|
|---|
| 912 |
|
|---|
| 913 |
|
|---|
| 914 | if (*str!='"')
|
|---|
| 915 | return;
|
|---|
| 916 |
|
|---|
| 917 | if (str[len-1]!='"')
|
|---|
| 918 | return;
|
|---|
| 919 |
|
|---|
| 920 | str[len-1]='\0';
|
|---|
| 921 | lstrcpyA(str,
|
|---|
| 922 | str+1);
|
|---|
| 923 | return;
|
|---|
| 924 | }
|
|---|
| 925 |
|
|---|
| 926 |
|
|---|
| 927 | /*************************************************************************
|
|---|
| 928 | * SHELL32_58 [SHELL32.58]
|
|---|
| 929 | */
|
|---|
| 930 | DWORD WIN32API SHELL32_58(LPCSTR src,
|
|---|
| 931 | DWORD x2,
|
|---|
| 932 | LPSTR target,
|
|---|
| 933 | DWORD pathlen)
|
|---|
| 934 | {
|
|---|
| 935 | dprintf (("SHELL32: .58 (%s, %08xh, %08xh, %08xh) not implemented\n",
|
|---|
| 936 | src,
|
|---|
| 937 | x2,
|
|---|
| 938 | target,
|
|---|
| 939 | pathlen));
|
|---|
| 940 |
|
|---|
| 941 | return 0;
|
|---|
| 942 | }
|
|---|
| 943 |
|
|---|
| 944 |
|
|---|
| 945 | /*************************************************************************
|
|---|
| 946 | * SHELL32_62 [SHELL32.62]
|
|---|
| 947 | */
|
|---|
| 948 | DWORD WIN32API SHELL32_62(DWORD x,
|
|---|
| 949 | DWORD y,
|
|---|
| 950 | DWORD z,
|
|---|
| 951 | DWORD a)
|
|---|
| 952 | {
|
|---|
| 953 | dprintf(("SHELL32: .62 (%08xh, %08xh, %08xh, %08xh) not implemented.\n",
|
|---|
| 954 | x,
|
|---|
| 955 | y,
|
|---|
| 956 | z,
|
|---|
| 957 | a));
|
|---|
| 958 |
|
|---|
| 959 | return 0xffffffff;
|
|---|
| 960 | }
|
|---|
| 961 |
|
|---|
| 962 |
|
|---|
| 963 | /*************************************************************************
|
|---|
| 964 | * SHELL32_63 [SHELL32.63]
|
|---|
| 965 | */
|
|---|
| 966 | DWORD WIN32API SHELL32_63(HWND howner,
|
|---|
| 967 | LPSTR targetbuf,
|
|---|
| 968 | DWORD len,
|
|---|
| 969 | DWORD x,
|
|---|
| 970 | LPCSTR suffix,
|
|---|
| 971 | LPCSTR y,
|
|---|
| 972 | LPCSTR cmd)
|
|---|
| 973 | {
|
|---|
| 974 | dprintf (("SHELL32: .63 (%08xh, %08x, %08xh, %08xh, %08xh, %08xh, %s) not implemented.\n",
|
|---|
| 975 | howner,
|
|---|
| 976 | targetbuf,
|
|---|
| 977 | len,
|
|---|
| 978 | x,
|
|---|
| 979 | suffix,
|
|---|
| 980 | y,
|
|---|
| 981 | cmd));
|
|---|
| 982 |
|
|---|
| 983 | /* puts up a Open Dialog and requests input into targetbuf */
|
|---|
| 984 | /* OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_FILEMUSTEXIST|OFN_unknown */
|
|---|
| 985 | lstrcpyA(targetbuf,"x:\\s3.exe");
|
|---|
| 986 | return 1;
|
|---|
| 987 | }
|
|---|
| 988 |
|
|---|
| 989 |
|
|---|
| 990 | /*************************************************************************
|
|---|
| 991 | * SHELL32_68 [SHELL32.68]
|
|---|
| 992 | */
|
|---|
| 993 | DWORD WIN32API SHELL32_68(DWORD x,
|
|---|
| 994 | DWORD y,
|
|---|
| 995 | DWORD z)
|
|---|
| 996 | {
|
|---|
| 997 | dprintf(("SHELL32: .68 (%08xh, %08xh, %08xh) not implemented.\n",
|
|---|
| 998 | x,
|
|---|
| 999 | y,
|
|---|
| 1000 | z));
|
|---|
| 1001 |
|
|---|
| 1002 | return 0;
|
|---|
| 1003 | }
|
|---|
| 1004 |
|
|---|
| 1005 |
|
|---|
| 1006 | /*************************************************************************
|
|---|
| 1007 | * SHELL32_71 [SHELL32.71]
|
|---|
| 1008 | * returns internal shell values in the passed pointers
|
|---|
| 1009 | */
|
|---|
| 1010 | BOOL WIN32API SHELL32_71(LPDWORD x,
|
|---|
| 1011 | LPDWORD y)
|
|---|
| 1012 | {
|
|---|
| 1013 | dprintf(("SHELL32: .71 (%08xh, %08xh) not implemented.\n",
|
|---|
| 1014 | x,
|
|---|
| 1015 | y));
|
|---|
| 1016 |
|
|---|
| 1017 | return TRUE;
|
|---|
| 1018 | }
|
|---|
| 1019 |
|
|---|
| 1020 |
|
|---|
| 1021 | /*************************************************************************
|
|---|
| 1022 | * SHELL32_72 [SHELL32.72]
|
|---|
| 1023 | * dunno. something with icons
|
|---|
| 1024 | */
|
|---|
| 1025 | void WIN32API SHELL32_72(LPSTR x,
|
|---|
| 1026 | DWORD y,
|
|---|
| 1027 | DWORD z)
|
|---|
| 1028 | {
|
|---|
| 1029 | dprintf (("SHELL32: .27 (%08xh, %08xh, %08xh) not implemented.\n",
|
|---|
| 1030 | x,
|
|---|
| 1031 | y,
|
|---|
| 1032 | z));
|
|---|
| 1033 | }
|
|---|
| 1034 |
|
|---|
| 1035 |
|
|---|
| 1036 | /*************************************************************************
|
|---|
| 1037 | * SHELL32_89 [SHELL32.89]
|
|---|
| 1038 | */
|
|---|
| 1039 | DWORD WIN32API SHELL32_89(DWORD x1,
|
|---|
| 1040 | DWORD x2,
|
|---|
| 1041 | DWORD x3)
|
|---|
| 1042 | {
|
|---|
| 1043 | dprintf(("SHELL32: .89 (%08xh, %08xh, %08xh) not implemented.\n",
|
|---|
| 1044 | x1,
|
|---|
| 1045 | x2,
|
|---|
| 1046 | x3));
|
|---|
| 1047 |
|
|---|
| 1048 | return 0;
|
|---|
| 1049 | }
|
|---|
| 1050 |
|
|---|
| 1051 |
|
|---|
| 1052 | /*************************************************************************
|
|---|
| 1053 | * SHELL32_119 [SHELL32.119]
|
|---|
| 1054 | * unknown
|
|---|
| 1055 | */
|
|---|
| 1056 | void WIN32API SHELL32_119(LPVOID x)
|
|---|
| 1057 | {
|
|---|
| 1058 | dprintf(("SHELL32: .119 (%08xh) not implemented.\n",
|
|---|
| 1059 | x));
|
|---|
| 1060 | }
|
|---|
| 1061 |
|
|---|
| 1062 |
|
|---|
| 1063 | /*************************************************************************
|
|---|
| 1064 | * SHELL32_175 [SHELL32.175]
|
|---|
| 1065 | * unknown
|
|---|
| 1066 | */
|
|---|
| 1067 | void WIN32API SHELL32_175(DWORD x1,
|
|---|
| 1068 | DWORD x2,
|
|---|
| 1069 | DWORD x3,
|
|---|
| 1070 | DWORD x4)
|
|---|
| 1071 | {
|
|---|
| 1072 | dprintf (("SHELL32: .175 (%08x, %08xh, %08xh, %08xh not implemented.\n",
|
|---|
| 1073 | x1,
|
|---|
| 1074 | x2,
|
|---|
| 1075 | x3,
|
|---|
| 1076 | x4));
|
|---|
| 1077 | }
|
|---|
| 1078 |
|
|---|
| 1079 |
|
|---|
| 1080 | /*************************************************************************
|
|---|
| 1081 | * SHELL32_181 [SHELL32.181]
|
|---|
| 1082 | * unknown
|
|---|
| 1083 | */
|
|---|
| 1084 | void WIN32API SHELL32_181(DWORD x,
|
|---|
| 1085 | DWORD y)
|
|---|
| 1086 | {
|
|---|
| 1087 | dprintf(("SHELL32: .181 (%08xh, %08xh) not implemented.\n",
|
|---|
| 1088 | x,
|
|---|
| 1089 | y));
|
|---|
| 1090 | }
|
|---|
| 1091 |
|
|---|
| 1092 |
|
|---|
| 1093 | /*************************************************************************
|
|---|
| 1094 | * SHELL32_75 [SHELL32.75]
|
|---|
| 1095 | * unknown
|
|---|
| 1096 | */
|
|---|
| 1097 | BOOL WIN32API SHELL32_75(LPDWORD x,
|
|---|
| 1098 | LPDWORD y)
|
|---|
| 1099 | {
|
|---|
| 1100 | dprintf(("SHELL32: .75 (%08xh, %08xh) not implemented.\n",
|
|---|
| 1101 | x,
|
|---|
| 1102 | y));
|
|---|
| 1103 |
|
|---|
| 1104 | return TRUE;
|
|---|
| 1105 | }
|
|---|
| 1106 |
|
|---|
| 1107 |
|
|---|
| 1108 | /*************************************************************************
|
|---|
| 1109 | * SHELL32_77 [SHELL32.77]
|
|---|
| 1110 | */
|
|---|
| 1111 | DWORD WIN32API SHELL32_77(DWORD x,
|
|---|
| 1112 | DWORD y,
|
|---|
| 1113 | DWORD z)
|
|---|
| 1114 | {
|
|---|
| 1115 | dprintf(("SHELL32: .77 (%08xh, %08xh, %08xh) not implemented.\n",
|
|---|
| 1116 | x,
|
|---|
| 1117 | y,
|
|---|
| 1118 | z));
|
|---|
| 1119 |
|
|---|
| 1120 | return 0;
|
|---|
| 1121 | }
|
|---|
| 1122 |
|
|---|
| 1123 |
|
|---|
| 1124 | /*************************************************************************
|
|---|
| 1125 | * SHELL32_79 [SHELL32.79]
|
|---|
| 1126 | * create_directory_and_notify(...)
|
|---|
| 1127 | */
|
|---|
| 1128 | DWORD WIN32API SHELL32_79(LPCSTR dir,
|
|---|
| 1129 | LPVOID xvoid)
|
|---|
| 1130 | {
|
|---|
| 1131 | dprintf(("SHELL32: .79 (%s, %08xh)\n",
|
|---|
| 1132 | dir,
|
|---|
| 1133 | xvoid));
|
|---|
| 1134 |
|
|---|
| 1135 | if (!CreateDirectoryA(dir,
|
|---|
| 1136 | (PSECURITY_ATTRIBUTES)xvoid))
|
|---|
| 1137 | return FALSE;
|
|---|
| 1138 |
|
|---|
| 1139 | /* @@@PH: SHChangeNotify(8,1,dir,0); */
|
|---|
| 1140 | return TRUE;
|
|---|
| 1141 | }
|
|---|
| 1142 |
|
|---|
| 1143 |
|
|---|
| 1144 | /*************************************************************************
|
|---|
| 1145 | * SHELL32_100 [SHELL32.100]
|
|---|
| 1146 | * walks through policy table, queries <app> key, <type> value, returns
|
|---|
| 1147 | * queried (DWORD) value.
|
|---|
| 1148 | * {0x00001,Explorer,NoRun}
|
|---|
| 1149 | * {0x00002,Explorer,NoClose}
|
|---|
| 1150 | * {0x00004,Explorer,NoSaveSettings}
|
|---|
| 1151 | * {0x00008,Explorer,NoFileMenu}
|
|---|
| 1152 | * {0x00010,Explorer,NoSetFolders}
|
|---|
| 1153 | * {0x00020,Explorer,NoSetTaskbar}
|
|---|
| 1154 | * {0x00040,Explorer,NoDesktop}
|
|---|
| 1155 | * {0x00080,Explorer,NoFind}
|
|---|
| 1156 | * {0x00100,Explorer,NoDrives}
|
|---|
| 1157 | * {0x00200,Explorer,NoDriveAutoRun}
|
|---|
| 1158 | * {0x00400,Explorer,NoDriveTypeAutoRun}
|
|---|
| 1159 | * {0x00800,Explorer,NoNetHood}
|
|---|
| 1160 | * {0x01000,Explorer,NoStartBanner}
|
|---|
| 1161 | * {0x02000,Explorer,RestrictRun}
|
|---|
| 1162 | * {0x04000,Explorer,NoPrinterTabs}
|
|---|
| 1163 | * {0x08000,Explorer,NoDeletePrinter}
|
|---|
| 1164 | * {0x10000,Explorer,NoAddPrinter}
|
|---|
| 1165 | * {0x20000,Explorer,NoStartMenuSubFolders}
|
|---|
| 1166 | * {0x40000,Explorer,MyDocsOnNet}
|
|---|
| 1167 | * {0x80000,WinOldApp,NoRealMode}
|
|---|
| 1168 | */
|
|---|
| 1169 | DWORD WIN32API SHELL32_100(DWORD pol)
|
|---|
| 1170 | {
|
|---|
| 1171 | HKEY xhkey;
|
|---|
| 1172 |
|
|---|
| 1173 | dprintf (("SHELL32: .100 (%08xh) not implemented.\n",
|
|---|
| 1174 | pol));
|
|---|
| 1175 |
|
|---|
| 1176 | if (RegOpenKeyA((HKEY)HKEY_CURRENT_USER,
|
|---|
| 1177 | "Software\\Microsoft\\Windows\\CurrentVersion\\Policies",
|
|---|
| 1178 | &xhkey))
|
|---|
| 1179 | return 0;
|
|---|
| 1180 |
|
|---|
| 1181 | /* FIXME: do nothing for now, just return 0 (== "allowed") */
|
|---|
| 1182 | RegCloseKey(xhkey);
|
|---|
| 1183 |
|
|---|
| 1184 | return 0;
|
|---|
| 1185 | }
|
|---|
| 1186 |
|
|---|
| 1187 |
|
|---|
| 1188 | /*************************************************************************
|
|---|
| 1189 | * SHELL32_152 [SHELL32.152]
|
|---|
| 1190 | * itemlist_length
|
|---|
| 1191 | */
|
|---|
| 1192 | DWORD WIN32API SHELL32_152(LPITEMIDLIST iil)
|
|---|
| 1193 | {
|
|---|
| 1194 | LPSHITEMID si;
|
|---|
| 1195 | DWORD len;
|
|---|
| 1196 |
|
|---|
| 1197 | dprintf(("SHELL32: .152 (%08xh)\n",
|
|---|
| 1198 | iil));
|
|---|
| 1199 |
|
|---|
| 1200 |
|
|---|
| 1201 | si = &(iil->mkid);
|
|---|
| 1202 | len = 2;
|
|---|
| 1203 |
|
|---|
| 1204 | while (si->cb)
|
|---|
| 1205 | {
|
|---|
| 1206 | len += si->cb;
|
|---|
| 1207 | si = (LPSHITEMID)(((char*)si)+si->cb);
|
|---|
| 1208 | }
|
|---|
| 1209 |
|
|---|
| 1210 | return len;
|
|---|
| 1211 | }
|
|---|
| 1212 |
|
|---|
| 1213 |
|
|---|
| 1214 | /*************************************************************************
|
|---|
| 1215 | * SHELL32_158 [SHELL32.158]
|
|---|
| 1216 | */
|
|---|
| 1217 | LPSTR WIN32API SHELL32_158(LPSTR path,
|
|---|
| 1218 | DWORD y,
|
|---|
| 1219 | DWORD z)
|
|---|
| 1220 | {
|
|---|
| 1221 | dprintf(("SHELL32: .158 (%s, %08xh, %08xh)\n",
|
|---|
| 1222 | path,
|
|---|
| 1223 | y,
|
|---|
| 1224 | z));
|
|---|
| 1225 |
|
|---|
| 1226 | path = SHELL32_31(path);
|
|---|
| 1227 |
|
|---|
| 1228 | return *path ? (path+1) : path;
|
|---|
| 1229 | }
|
|---|
| 1230 |
|
|---|
| 1231 |
|
|---|
| 1232 | /*************************************************************************
|
|---|
| 1233 | * SHELL32_165 [SHELL32.165]
|
|---|
| 1234 | * create_path_and_notify(...)
|
|---|
| 1235 | */
|
|---|
| 1236 | DWORD WIN32API SHELL32_165(DWORD x,
|
|---|
| 1237 | LPCSTR path)
|
|---|
| 1238 | {
|
|---|
| 1239 | dprintf (("SHELL32 .165 (%08x, %08xh) not implemented.\n",
|
|---|
| 1240 | x,
|
|---|
| 1241 | path));
|
|---|
| 1242 |
|
|---|
| 1243 | if (SHELL32_79(path,
|
|---|
| 1244 | (LPVOID)x))
|
|---|
| 1245 | return 0;
|
|---|
| 1246 |
|
|---|
| 1247 | return 0;
|
|---|
| 1248 | }
|
|---|
| 1249 |
|
|---|
| 1250 |
|
|---|
| 1251 | /*************************************************************************
|
|---|
| 1252 | * SHELL32_195 [SHELL32.195]
|
|---|
| 1253 | * free_ptr() - frees memory using IMalloc
|
|---|
| 1254 | */
|
|---|
| 1255 | DWORD WIN32API SHELL32_195(LPVOID x)
|
|---|
| 1256 | {
|
|---|
| 1257 | dprintf (("SHELL32: .195 (%08xh) (LocalFree)\n",
|
|---|
| 1258 | x));
|
|---|
| 1259 |
|
|---|
| 1260 | return (DWORD)LocalFree((HLOCAL)x);
|
|---|
| 1261 | }
|
|---|
| 1262 |
|
|---|
| 1263 |
|
|---|
| 1264 | /*************************************************************************
|
|---|
| 1265 | * SHELL32_196 [SHELL32.196]
|
|---|
| 1266 | * void *task_alloc(DWORD len), uses SHMalloc allocator
|
|---|
| 1267 | */
|
|---|
| 1268 | LPVOID WIN32API SHELL32_196(DWORD len)
|
|---|
| 1269 | {
|
|---|
| 1270 | dprintf(("SHELL32: .196 (%08xh) (LocalAlloc)\n",
|
|---|
| 1271 | len));
|
|---|
| 1272 |
|
|---|
| 1273 | return (LPVOID)LocalAlloc(len,
|
|---|
| 1274 | LMEM_ZEROINIT); /* FIXME */
|
|---|
| 1275 | }
|
|---|
| 1276 |
|
|---|
| 1277 |
|
|---|
| 1278 | /*************************************************************************
|
|---|
| 1279 | * SHELL32_18 [SHELL32.18]
|
|---|
| 1280 | * copy_itemidlist()
|
|---|
| 1281 | */
|
|---|
| 1282 | LPITEMIDLIST WIN32API SHELL32_18(LPITEMIDLIST iil)
|
|---|
| 1283 | {
|
|---|
| 1284 | DWORD len;
|
|---|
| 1285 | LPITEMIDLIST newiil;
|
|---|
| 1286 |
|
|---|
| 1287 | dprintf(("SHELL32: .18 (%08xh)\n",
|
|---|
| 1288 | iil));
|
|---|
| 1289 |
|
|---|
| 1290 |
|
|---|
| 1291 | len = SHELL32_152(iil);
|
|---|
| 1292 | newiil = (LPITEMIDLIST)SHELL32_196(len);
|
|---|
| 1293 | memcpy(newiil,
|
|---|
| 1294 | iil,
|
|---|
| 1295 | len);
|
|---|
| 1296 |
|
|---|
| 1297 | return newiil;
|
|---|
| 1298 | }
|
|---|
| 1299 |
|
|---|
| 1300 |
|
|---|
| 1301 | /*************************************************************************
|
|---|
| 1302 | * SHELL32_25 [SHELL32.25]
|
|---|
| 1303 | * merge_itemidlist()
|
|---|
| 1304 | */
|
|---|
| 1305 | LPITEMIDLIST WIN32API SHELL32_25(LPITEMIDLIST iil1,
|
|---|
| 1306 | LPITEMIDLIST iil2)
|
|---|
| 1307 | {
|
|---|
| 1308 | DWORD len1,len2;
|
|---|
| 1309 | LPITEMIDLIST newiil;
|
|---|
| 1310 |
|
|---|
| 1311 | dprintf(("SHELL32: .25 (%08xh, %08xh)\n",
|
|---|
| 1312 | iil1,
|
|---|
| 1313 | iil2));
|
|---|
| 1314 |
|
|---|
| 1315 |
|
|---|
| 1316 | len1 = SHELL32_152(iil1)-2;
|
|---|
| 1317 | len2 = SHELL32_152(iil2);
|
|---|
| 1318 | newiil = (LPITEMIDLIST)SHELL32_196(len1+len2);
|
|---|
| 1319 |
|
|---|
| 1320 | memcpy(newiil,
|
|---|
| 1321 | iil1,
|
|---|
| 1322 | len1);
|
|---|
| 1323 |
|
|---|
| 1324 | memcpy(((char*)newiil)+len1,
|
|---|
| 1325 | iil2,
|
|---|
| 1326 | len2);
|
|---|
| 1327 |
|
|---|
| 1328 | return newiil;
|
|---|
| 1329 | }
|
|---|
| 1330 |
|
|---|
| 1331 |
|
|---|
| 1332 | /*************************************************************************
|
|---|
| 1333 | * SHELL32_155 [SHELL32.155]
|
|---|
| 1334 | * free_check_ptr - frees memory (if not NULL) allocated by SHMalloc allocator
|
|---|
| 1335 | */
|
|---|
| 1336 | DWORD WIN32API SHELL32_155(LPVOID x)
|
|---|
| 1337 | {
|
|---|
| 1338 | dprintf(("SHELL32: .155 (%08xh)\n",
|
|---|
| 1339 | x));
|
|---|
| 1340 |
|
|---|
| 1341 | if (!x)
|
|---|
| 1342 | return 0;
|
|---|
| 1343 |
|
|---|
| 1344 | return SHELL32_195(x);
|
|---|
| 1345 | }
|
|---|
| 1346 |
|
|---|
| 1347 |
|
|---|
| 1348 | /*************************************************************************
|
|---|
| 1349 | * SHELL32_85 [SHELL32.85]
|
|---|
| 1350 | * unknown
|
|---|
| 1351 | */
|
|---|
| 1352 | DWORD WIN32API SHELL32_85(DWORD x1,
|
|---|
| 1353 | DWORD x2,
|
|---|
| 1354 | DWORD x3,
|
|---|
| 1355 | DWORD x4)
|
|---|
| 1356 | {
|
|---|
| 1357 | dprintf(("SHELL32: .85 (%08x, %08xh, %08xh, %08xh) not implemented.\n",
|
|---|
| 1358 | x1,
|
|---|
| 1359 | x2,
|
|---|
| 1360 | x3,
|
|---|
| 1361 | x4));
|
|---|
| 1362 |
|
|---|
| 1363 | return 0;
|
|---|
| 1364 | }
|
|---|
| 1365 |
|
|---|
| 1366 |
|
|---|
| 1367 | /*****************************************************************************
|
|---|
| 1368 | * Name : .4
|
|---|
| 1369 | * Purpose :
|
|---|
| 1370 | * Parameters:
|
|---|
| 1371 | * Variables :
|
|---|
| 1372 | * Result :
|
|---|
| 1373 | * Remark : unknown
|
|---|
| 1374 | * Status : UNTESTED UNKNOWN STUB
|
|---|
| 1375 | *
|
|---|
| 1376 | * Author : Patrick Haller [Tue, 1998/06/15 03:00]
|
|---|
| 1377 | *****************************************************************************/
|
|---|
| 1378 |
|
|---|
| 1379 | DWORD WIN32API SHELL32_4(DWORD x1)
|
|---|
| 1380 | {
|
|---|
| 1381 | dprintf(("SHELL32: .4 (%08xh) not implemented.\n",
|
|---|
| 1382 | x1));
|
|---|
| 1383 |
|
|---|
| 1384 | return (0);
|
|---|
| 1385 | }
|
|---|
| 1386 |
|
|---|
| 1387 |
|
|---|
| 1388 | /*****************************************************************************
|
|---|
| 1389 | * Name : .59
|
|---|
| 1390 | * Purpose :
|
|---|
| 1391 | * Parameters:
|
|---|
| 1392 | * Variables :
|
|---|
| 1393 | * Result :
|
|---|
| 1394 | * Remark : unknown
|
|---|
| 1395 | * Status : UNTESTED UNKNOWN STUB
|
|---|
| 1396 | *
|
|---|
| 1397 | * Author : Patrick Haller [Tue, 1998/06/15 03:00]
|
|---|
| 1398 | *****************************************************************************/
|
|---|
| 1399 |
|
|---|
| 1400 | DWORD WIN32API SHELL32_59(void)
|
|---|
| 1401 | {
|
|---|
| 1402 | dprintf(("SHELL32: .59 () not implemented.\n"));
|
|---|
| 1403 |
|
|---|
| 1404 | return (0);
|
|---|
| 1405 | }
|
|---|
| 1406 |
|
|---|
| 1407 |
|
|---|
| 1408 | /*****************************************************************************
|
|---|
| 1409 | * Name : .162
|
|---|
| 1410 | * Purpose :
|
|---|
| 1411 | * Parameters:
|
|---|
| 1412 | * Variables :
|
|---|
| 1413 | * Result :
|
|---|
| 1414 | * Remark : unknown
|
|---|
| 1415 | * Status : UNTESTED UNKNOWN STUB
|
|---|
| 1416 | *
|
|---|
| 1417 | * Author : Patrick Haller [Tue, 1998/06/15 03:00]
|
|---|
| 1418 | *****************************************************************************/
|
|---|
| 1419 |
|
|---|
| 1420 | DWORD WIN32API SHELL32_162(DWORD x1)
|
|---|
| 1421 | {
|
|---|
| 1422 | dprintf(("SHELL32: .162 (%08xh) not implemented.\n",
|
|---|
| 1423 | x1));
|
|---|
| 1424 |
|
|---|
| 1425 | return (0);
|
|---|
| 1426 | }
|
|---|
| 1427 |
|
|---|
| 1428 |
|
|---|
| 1429 | /*****************************************************************************
|
|---|
| 1430 | * Name : .145
|
|---|
| 1431 | * Purpose :
|
|---|
| 1432 | * Parameters:
|
|---|
| 1433 | * Variables :
|
|---|
| 1434 | * Result :
|
|---|
| 1435 | * Remark : unknown
|
|---|
| 1436 | * Status : UNTESTED UNKNOWN STUB
|
|---|
| 1437 | *
|
|---|
| 1438 | * Author : Patrick Haller [Tue, 1998/06/15 03:00]
|
|---|
| 1439 | *****************************************************************************/
|
|---|
| 1440 |
|
|---|
| 1441 | DWORD WIN32API SHELL32_145(DWORD x1,
|
|---|
| 1442 | DWORD x2)
|
|---|
| 1443 | {
|
|---|
| 1444 | dprintf(("SHELL32: .145 (%08xh, %08xh) not implemented.\n",
|
|---|
| 1445 | x1,
|
|---|
| 1446 | x2));
|
|---|
| 1447 |
|
|---|
| 1448 | return (0);
|
|---|
| 1449 | }
|
|---|
| 1450 |
|
|---|
| 1451 |
|
|---|
| 1452 | /*****************************************************************************
|
|---|
| 1453 | * Name : .43
|
|---|
| 1454 | * Purpose :
|
|---|
| 1455 | * Parameters:
|
|---|
| 1456 | * Variables :
|
|---|
| 1457 | * Result :
|
|---|
| 1458 | * Remark : unknown
|
|---|
| 1459 | * Status : UNTESTED UNKNOWN STUB
|
|---|
| 1460 | *
|
|---|
| 1461 | * Author : Patrick Haller [Tue, 1998/06/15 03:00]
|
|---|
| 1462 | *****************************************************************************/
|
|---|
| 1463 |
|
|---|
| 1464 | DWORD WIN32API SHELL32_43(DWORD x1)
|
|---|
| 1465 | {
|
|---|
| 1466 | dprintf(("SHELL32: .43 (%08xh) not implemented.\n",
|
|---|
| 1467 | x1));
|
|---|
| 1468 |
|
|---|
| 1469 | return (0);
|
|---|
| 1470 | }
|
|---|
| 1471 |
|
|---|
| 1472 |
|
|---|
| 1473 | /*****************************************************************************
|
|---|
| 1474 | * Name : .51
|
|---|
| 1475 | * Purpose :
|
|---|
| 1476 | * Parameters:
|
|---|
| 1477 | * Variables :
|
|---|
| 1478 | * Result :
|
|---|
| 1479 | * Remark : unknown
|
|---|
| 1480 | * Status : UNTESTED UNKNOWN STUB
|
|---|
| 1481 | *
|
|---|
| 1482 | * Author : Patrick Haller [Tue, 1998/06/15 03:00]
|
|---|
| 1483 | *****************************************************************************/
|
|---|
| 1484 |
|
|---|
| 1485 | DWORD WIN32API SHELL32_51(DWORD x1,
|
|---|
| 1486 | DWORD x2,
|
|---|
| 1487 | DWORD x3)
|
|---|
| 1488 | {
|
|---|
| 1489 | dprintf(("SHELL32: .51 (%08xh, %08xh, %08xh) not implemented.\n",
|
|---|
| 1490 | x1,
|
|---|
| 1491 | x2,
|
|---|
| 1492 | x3));
|
|---|
| 1493 |
|
|---|
| 1494 | return (0);
|
|---|
| 1495 | }
|
|---|
| 1496 |
|
|---|
| 1497 |
|
|---|
| 1498 | /*****************************************************************************
|
|---|
| 1499 | * Name : .55
|
|---|
| 1500 | * Purpose :
|
|---|
| 1501 | * Parameters:
|
|---|
| 1502 | * Variables :
|
|---|
| 1503 | * Result :
|
|---|
| 1504 | * Remark : unknown
|
|---|
| 1505 | * Status : UNTESTED UNKNOWN STUB
|
|---|
| 1506 | *
|
|---|
| 1507 | * Author : Patrick Haller [Tue, 1998/06/15 03:00]
|
|---|
| 1508 | *****************************************************************************/
|
|---|
| 1509 |
|
|---|
| 1510 | DWORD WIN32API SHELL32_55(DWORD x1)
|
|---|
| 1511 | {
|
|---|
| 1512 | dprintf(("SHELL32: .55 (%08xh) not implemented.\n",
|
|---|
| 1513 | x1));
|
|---|
| 1514 |
|
|---|
| 1515 | return (0);
|
|---|
| 1516 | }
|
|---|
| 1517 |
|
|---|
| 1518 |
|
|---|
| 1519 | /*****************************************************************************
|
|---|
| 1520 | * Name : .102
|
|---|
| 1521 | * Purpose :
|
|---|
| 1522 | * Parameters:
|
|---|
| 1523 | * Variables :
|
|---|
| 1524 | * Result :
|
|---|
| 1525 | * Remark : unknown
|
|---|
| 1526 | * Status : UNTESTED UNKNOWN STUB
|
|---|
| 1527 | *
|
|---|
| 1528 | * Author : Patrick Haller [Tue, 1998/06/15 03:00]
|
|---|
| 1529 | *****************************************************************************/
|
|---|
| 1530 |
|
|---|
| 1531 | DWORD WIN32API SHELL32_102(DWORD x1,
|
|---|
| 1532 | DWORD x2,
|
|---|
| 1533 | DWORD x3,
|
|---|
| 1534 | DWORD x4,
|
|---|
| 1535 | DWORD x5)
|
|---|
| 1536 | {
|
|---|
| 1537 | dprintf(("SHELL32: .102 (%08xh, %08xh, %08xh, %08xh, %08xh) not implemented.\n",
|
|---|
| 1538 | x1,
|
|---|
| 1539 | x2,
|
|---|
| 1540 | x3,
|
|---|
| 1541 | x4,
|
|---|
| 1542 | x5));
|
|---|
| 1543 |
|
|---|
| 1544 | return (0);
|
|---|
| 1545 | }
|
|---|
| 1546 |
|
|---|
| 1547 |
|
|---|
| 1548 | /*****************************************************************************
|
|---|
| 1549 | * Name : BOOL ShellExecuteEx
|
|---|
| 1550 | * Purpose :
|
|---|
| 1551 | * Parameters:
|
|---|
| 1552 | * Variables :
|
|---|
| 1553 | * Result :
|
|---|
| 1554 | * Remark :
|
|---|
| 1555 | * Status : UNTESTED STUB
|
|---|
| 1556 | *
|
|---|
| 1557 | * Author : Patrick Haller [Tue, 1998/06/15 03:00]
|
|---|
| 1558 | *****************************************************************************/
|
|---|
| 1559 |
|
|---|
| 1560 | BOOL WIN32API ShellExecuteEx(LPSHELLEXECUTEINFOA lpExecInfo)
|
|---|
| 1561 | {
|
|---|
| 1562 | dprintf(("SHELL32: ShellExecuteEx (%08xh) not implemented.\n",
|
|---|
| 1563 | lpExecInfo));
|
|---|
| 1564 |
|
|---|
| 1565 | return (0);
|
|---|
| 1566 | }
|
|---|
| 1567 |
|
|---|
| 1568 |
|
|---|
| 1569 |
|
|---|
| 1570 | /*****************************************************************************
|
|---|
| 1571 | * Name : BOOL ShellExecuteExA
|
|---|
| 1572 | * Purpose :
|
|---|
| 1573 | * Parameters:
|
|---|
| 1574 | * Variables :
|
|---|
| 1575 | * Result :
|
|---|
| 1576 | * Remark :
|
|---|
| 1577 | * Status : UNTESTED STUB
|
|---|
| 1578 | *
|
|---|
| 1579 | * Author : Patrick Haller [Tue, 1998/06/15 03:00]
|
|---|
| 1580 | *****************************************************************************/
|
|---|
| 1581 |
|
|---|
| 1582 | BOOL WIN32API ShellExecuteExA(LPSHELLEXECUTEINFOA lpExecInfo)
|
|---|
| 1583 | {
|
|---|
| 1584 | dprintf(("SHELL32: ShellExecuteExA (%08xh) not implemented.\n",
|
|---|
| 1585 | lpExecInfo));
|
|---|
| 1586 |
|
|---|
| 1587 | return (0);
|
|---|
| 1588 | }
|
|---|
| 1589 |
|
|---|
| 1590 |
|
|---|
| 1591 | /*****************************************************************************
|
|---|
| 1592 | * Name : BOOL ShellExecuteExW
|
|---|
| 1593 | * Purpose :
|
|---|
| 1594 | * Parameters:
|
|---|
| 1595 | * Variables :
|
|---|
| 1596 | * Result :
|
|---|
| 1597 | * Remark :
|
|---|
| 1598 | * Status : UNTESTED STUB
|
|---|
| 1599 | *
|
|---|
| 1600 | * Author : Patrick Haller [Tue, 1998/06/15 03:00]
|
|---|
| 1601 | *****************************************************************************/
|
|---|
| 1602 |
|
|---|
| 1603 | BOOL WIN32API ShellExecuteExW(LPSHELLEXECUTEINFOW lpExecInfo)
|
|---|
| 1604 | {
|
|---|
| 1605 | dprintf(("SHELL32: ShellExecuteExW (%08xh) not implemented.\n",
|
|---|
| 1606 | lpExecInfo));
|
|---|
| 1607 |
|
|---|
| 1608 | return (0);
|
|---|
| 1609 | }
|
|---|
| 1610 |
|
|---|
| 1611 |
|
|---|
| 1612 | /*****************************************************************************
|
|---|
| 1613 | * Name : DWORD ShellMessageBoxW
|
|---|
| 1614 | * Purpose : display a messagebox, retrieve message text from resources
|
|---|
| 1615 | * Parameters: HMODULE hmod
|
|---|
| 1616 | * HWND hwnd
|
|---|
| 1617 | * DWORD idText
|
|---|
| 1618 | * DWORD idTitle
|
|---|
| 1619 | * DWORD uType
|
|---|
| 1620 | * LPCVOID arglist
|
|---|
| 1621 | * Variables :
|
|---|
| 1622 | * Result :
|
|---|
| 1623 | * Remark : SHELL32.182
|
|---|
| 1624 | * Status : UNTESTED STUB
|
|---|
| 1625 | *
|
|---|
| 1626 | * Author : Patrick Haller [Tue, 1999/06/01 09:00]
|
|---|
| 1627 | *****************************************************************************/
|
|---|
| 1628 |
|
|---|
| 1629 | DWORD WIN32API ShellMessageBoxW(HMODULE hmod,
|
|---|
| 1630 | HWND hwnd,
|
|---|
| 1631 | DWORD idText,
|
|---|
| 1632 | DWORD idTitle,
|
|---|
| 1633 | DWORD uType,
|
|---|
| 1634 | LPCVOID arglist)
|
|---|
| 1635 | {
|
|---|
| 1636 | WCHAR szText[100],
|
|---|
| 1637 | szTitle[100],
|
|---|
| 1638 | szTemp[256];
|
|---|
| 1639 | LPWSTR pszText = &szText[0],
|
|---|
| 1640 | pszTitle = &szTitle[0];
|
|---|
| 1641 | LPVOID args = &arglist;
|
|---|
| 1642 |
|
|---|
| 1643 | dprintf(("SHELL32: ShellMessageBoxW(%08lx,%08lx,%08lx,%08lx,%08lx,%p)\n",
|
|---|
| 1644 | hmod,
|
|---|
| 1645 | hwnd,
|
|---|
| 1646 | idText,
|
|---|
| 1647 | idTitle,
|
|---|
| 1648 | uType,
|
|---|
| 1649 | arglist));
|
|---|
| 1650 |
|
|---|
| 1651 | if (!HIWORD (idTitle))
|
|---|
| 1652 | LoadStringW(hmod,
|
|---|
| 1653 | idTitle,
|
|---|
| 1654 | pszTitle,
|
|---|
| 1655 | 100);
|
|---|
| 1656 | else
|
|---|
| 1657 | pszTitle = (LPWSTR)idTitle;
|
|---|
| 1658 |
|
|---|
| 1659 | if (! HIWORD (idText))
|
|---|
| 1660 | LoadStringW(hmod,idText,pszText,100);
|
|---|
| 1661 | else
|
|---|
| 1662 | pszText = (LPWSTR)idText;
|
|---|
| 1663 |
|
|---|
| 1664 | FormatMessageW(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY,
|
|---|
| 1665 | szText,
|
|---|
| 1666 | 0,
|
|---|
| 1667 | 0,
|
|---|
| 1668 | szTemp,
|
|---|
| 1669 | 256,
|
|---|
| 1670 | (LPDWORD)args);
|
|---|
| 1671 |
|
|---|
| 1672 | return MessageBoxW(hwnd,
|
|---|
| 1673 | szTemp,
|
|---|
| 1674 | szTitle,
|
|---|
| 1675 | uType);
|
|---|
| 1676 | }
|
|---|
| 1677 |
|
|---|
| 1678 | /*****************************************************************************
|
|---|
| 1679 | * Name : DWORD ShellMessageBoxA
|
|---|
| 1680 | * Purpose : display a messagebox, retrieve message text from resources
|
|---|
| 1681 | * Parameters: HMODULE hmod
|
|---|
| 1682 | * HWND hwnd
|
|---|
| 1683 | * DWORD idText
|
|---|
| 1684 | * DWORD idTitle
|
|---|
| 1685 | * DWORD uType
|
|---|
| 1686 | * LPCVOID arglist
|
|---|
| 1687 | * Variables :
|
|---|
| 1688 | * Result :
|
|---|
| 1689 | * Remark : SHELL32.183
|
|---|
| 1690 | * Status : UNTESTED STUB
|
|---|
| 1691 | *
|
|---|
| 1692 | * Author : Patrick Haller [Tue, 1999/06/01 09:00]
|
|---|
| 1693 | *****************************************************************************/
|
|---|
| 1694 |
|
|---|
| 1695 | DWORD WIN32API ShellMessageBoxA(HMODULE hmod,
|
|---|
| 1696 | HWND hwnd,
|
|---|
| 1697 | DWORD idText,
|
|---|
| 1698 | DWORD idTitle,
|
|---|
| 1699 | DWORD uType,
|
|---|
| 1700 | LPCVOID arglist)
|
|---|
| 1701 | {
|
|---|
| 1702 | char szText[100],
|
|---|
| 1703 | szTitle[100],
|
|---|
| 1704 | szTemp[256];
|
|---|
| 1705 | LPSTR pszText = &szText[0],
|
|---|
| 1706 | pszTitle = &szTitle[0];
|
|---|
| 1707 | LPVOID args = &arglist;
|
|---|
| 1708 |
|
|---|
| 1709 | dprintf(("SHELL32: ShellMessageBoxA (%08lx,%08lx,%08lx,%08lx,%08lx,%p)\n",
|
|---|
| 1710 | hmod,
|
|---|
| 1711 | hwnd,
|
|---|
| 1712 | idText,
|
|---|
| 1713 | idTitle,
|
|---|
| 1714 | uType,
|
|---|
| 1715 | arglist));
|
|---|
| 1716 |
|
|---|
| 1717 | if (!HIWORD (idTitle))
|
|---|
| 1718 | LoadStringA(hmod,idTitle,pszTitle,100);
|
|---|
| 1719 | else
|
|---|
| 1720 | pszTitle = (LPSTR)idTitle;
|
|---|
| 1721 |
|
|---|
| 1722 | if (! HIWORD (idText))
|
|---|
| 1723 | LoadStringA(hmod,idText,pszText,100);
|
|---|
| 1724 | else
|
|---|
| 1725 | pszText = (LPSTR)idText;
|
|---|
| 1726 |
|
|---|
| 1727 | FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY,
|
|---|
| 1728 | pszText,
|
|---|
| 1729 | 0,
|
|---|
| 1730 | 0,
|
|---|
| 1731 | szTemp,
|
|---|
| 1732 | 256,
|
|---|
| 1733 | (LPDWORD)args);
|
|---|
| 1734 |
|
|---|
| 1735 | return MessageBoxA(hwnd,
|
|---|
| 1736 | szTemp,
|
|---|
| 1737 | pszTitle,
|
|---|
| 1738 | uType);
|
|---|
| 1739 | }
|
|---|
| 1740 |
|
|---|
| 1741 |
|
|---|
| 1742 |
|
|---|
| 1743 |
|
|---|
| 1744 |
|
|---|
| 1745 | #if 0
|
|---|
| 1746 | typedef DWORD (* WIN32API GetClassPtr)(REFCLSID,REFIID,LPVOID);
|
|---|
| 1747 |
|
|---|
| 1748 | static GetClassPtr SH_find_moduleproc(LPSTR dllname,
|
|---|
| 1749 | HMODULE *xhmod,
|
|---|
| 1750 | LPSTR name)
|
|---|
| 1751 | {
|
|---|
| 1752 | HMODULE hmod;
|
|---|
| 1753 | FARPROC dllunload,
|
|---|
| 1754 | nameproc;
|
|---|
| 1755 |
|
|---|
| 1756 | if (xhmod)
|
|---|
| 1757 | *xhmod = 0;
|
|---|
| 1758 |
|
|---|
| 1759 | if (!lstrcmpi32A(SHELL32_34(dllname),
|
|---|
| 1760 | "shell32.dll"))
|
|---|
| 1761 | return (GetClassPtr)SHELL32_DllGetClassObject;
|
|---|
| 1762 |
|
|---|
| 1763 | hmod = LoadLibraryEx32A(dllname,
|
|---|
| 1764 | 0,
|
|---|
| 1765 | LOAD_WITH_ALTERED_SEARCH_PATH);
|
|---|
| 1766 | if (!hmod)
|
|---|
| 1767 | return NULL;
|
|---|
| 1768 |
|
|---|
| 1769 | dllunload = GetProcAddress32(hmod,
|
|---|
| 1770 | "DllCanUnloadNow");
|
|---|
| 1771 | if (!dllunload)
|
|---|
| 1772 | if (xhmod)
|
|---|
| 1773 | *xhmod = hmod;
|
|---|
| 1774 |
|
|---|
| 1775 | nameproc = GetProcAddress32(hmod,
|
|---|
| 1776 | name);
|
|---|
| 1777 | if (!nameproc)
|
|---|
| 1778 | {
|
|---|
| 1779 | FreeLibrary32(hmod);
|
|---|
| 1780 | return NULL;
|
|---|
| 1781 | }
|
|---|
| 1782 |
|
|---|
| 1783 | /* register unloadable dll with unloadproc ... */
|
|---|
| 1784 | return (GetClassPtr)nameproc;
|
|---|
| 1785 | }
|
|---|
| 1786 |
|
|---|
| 1787 |
|
|---|
| 1788 | static DWORD SH_get_instance(REFCLSID clsid,
|
|---|
| 1789 | LPSTR dllname,
|
|---|
| 1790 | LPVOID unknownouter,
|
|---|
| 1791 | REFIID refiid,
|
|---|
| 1792 | LPVOID inst)
|
|---|
| 1793 | {
|
|---|
| 1794 | GetClassPtr dllgetclassob;
|
|---|
| 1795 | DWORD hres;
|
|---|
| 1796 | LPCLASSFACTORY classfac;
|
|---|
| 1797 |
|
|---|
| 1798 | dllgetclassob = SH_find_moduleproc(dllname,
|
|---|
| 1799 | NULL,
|
|---|
| 1800 | "DllGetClassObject");
|
|---|
| 1801 | if (!dllgetclassob)
|
|---|
| 1802 | return 0x80070000|GetLastError();
|
|---|
| 1803 |
|
|---|
| 1804 | /* FIXME */
|
|---|
| 1805 | /*
|
|---|
| 1806 | hres = (*dllgetclassob)(clsid,(REFIID)&IID_IClassFactory,inst);
|
|---|
| 1807 | if (hres<0)
|
|---|
| 1808 | return hres;
|
|---|
| 1809 |
|
|---|
| 1810 | */
|
|---|
| 1811 | hres = (*dllgetclassob)(clsid,
|
|---|
| 1812 | (REFIID)&IID_IClassFactory,
|
|---|
| 1813 | &classfac);
|
|---|
| 1814 | if (hres<0)
|
|---|
| 1815 | return hres;
|
|---|
| 1816 |
|
|---|
| 1817 | classfac->lpvtbl->fnCreateInstance(classfac,
|
|---|
| 1818 | unknownouter,
|
|---|
| 1819 | refiid,
|
|---|
| 1820 | inst);
|
|---|
| 1821 | classfac->lpvtbl->fnRelease(classfac);
|
|---|
| 1822 |
|
|---|
| 1823 | return 0;
|
|---|
| 1824 | }
|
|---|
| 1825 |
|
|---|
| 1826 |
|
|---|
| 1827 | /*************************************************************************
|
|---|
| 1828 | * SHELL32_102 [SHELL32.102]
|
|---|
| 1829 | * unknown
|
|---|
| 1830 | */
|
|---|
| 1831 | LRESULT WIN32API SHELL32_102(LPSTR aclsid,
|
|---|
| 1832 | CLSID *clsid,
|
|---|
| 1833 | LPUNKNOWN unknownouter,
|
|---|
| 1834 | REFIID refiid,
|
|---|
| 1835 | LPVOID inst)
|
|---|
| 1836 | {
|
|---|
| 1837 | char buffer[256],
|
|---|
| 1838 | xclsid[48],
|
|---|
| 1839 | xiid[48],
|
|---|
| 1840 | path[260],
|
|---|
| 1841 | tmodel[100];
|
|---|
| 1842 | HKEY inprockey;
|
|---|
| 1843 | DWORD pathlen,
|
|---|
| 1844 | type,
|
|---|
| 1845 | tmodellen;
|
|---|
| 1846 | DWORD hres;
|
|---|
| 1847 |
|
|---|
| 1848 |
|
|---|
| 1849 | WINE_StringFromCLSID(refiid,
|
|---|
| 1850 | xiid);
|
|---|
| 1851 |
|
|---|
| 1852 | if (clsid)
|
|---|
| 1853 | WINE_StringFromCLSID(clsid,
|
|---|
| 1854 | xclsid);
|
|---|
| 1855 | else
|
|---|
| 1856 | {
|
|---|
| 1857 | if (!aclsid)
|
|---|
| 1858 | return 0x80040154;
|
|---|
| 1859 |
|
|---|
| 1860 | strcpy(xclsid,
|
|---|
| 1861 | aclsid);
|
|---|
| 1862 | }
|
|---|
| 1863 |
|
|---|
| 1864 | dprintf(("SHELL32: .102 (%s. %08xh, %08xh, %08x, %08xh)\n",
|
|---|
| 1865 | aclsid,
|
|---|
| 1866 | clsid,
|
|---|
| 1867 | unknownouter,
|
|---|
| 1868 | refiid,
|
|---|
| 1869 | inst));
|
|---|
| 1870 |
|
|---|
| 1871 |
|
|---|
| 1872 | sprintf(buffer,
|
|---|
| 1873 | "CLSID\\%s\\InProcServer32",
|
|---|
| 1874 | xclsid);
|
|---|
| 1875 |
|
|---|
| 1876 | if (RegOpenKeyEx32A(HKEY_CLASSES_ROOT,
|
|---|
| 1877 | buffer,
|
|---|
| 1878 | 0,
|
|---|
| 1879 | 0x02000000,
|
|---|
| 1880 | &inprockey))
|
|---|
| 1881 | return SH_get_instance(clsid,
|
|---|
| 1882 | "shell32.dll",
|
|---|
| 1883 | unknownouter,
|
|---|
| 1884 | refiid,
|
|---|
| 1885 | inst);
|
|---|
| 1886 |
|
|---|
| 1887 | pathlen=sizeof(path);
|
|---|
| 1888 | if (RegQueryValue32A(inprockey,
|
|---|
| 1889 | NULL,
|
|---|
| 1890 | path,
|
|---|
| 1891 | &pathlen))
|
|---|
| 1892 | {
|
|---|
| 1893 | RegCloseKey(inprockey);
|
|---|
| 1894 | return SH_get_instance(clsid,
|
|---|
| 1895 | "shell32.dll",
|
|---|
| 1896 | unknownouter,
|
|---|
| 1897 | refiid,
|
|---|
| 1898 | inst);
|
|---|
| 1899 | }
|
|---|
| 1900 |
|
|---|
| 1901 | dprintf (("SHELL32: .102 Server dll is %s\n",
|
|---|
| 1902 | path));
|
|---|
| 1903 |
|
|---|
| 1904 | tmodellen=sizeof(tmodel);
|
|---|
| 1905 | type=REG_SZ;
|
|---|
| 1906 |
|
|---|
| 1907 | if (RegQueryValueEx32A(inprockey,
|
|---|
| 1908 | "ThreadingModel",
|
|---|
| 1909 | NULL,
|
|---|
| 1910 | &type,
|
|---|
| 1911 | tmodel,
|
|---|
| 1912 | &tmodellen))
|
|---|
| 1913 | {
|
|---|
| 1914 | RegCloseKey(inprockey);
|
|---|
| 1915 | return SH_get_instance(clsid,
|
|---|
| 1916 | "shell32.dll",
|
|---|
| 1917 | unknownouter,
|
|---|
| 1918 | refiid,
|
|---|
| 1919 | inst);
|
|---|
| 1920 | }
|
|---|
| 1921 |
|
|---|
| 1922 |
|
|---|
| 1923 | dprintf (("SHELL32: .102 Threading model is %s\n",
|
|---|
| 1924 | tmodel));
|
|---|
| 1925 |
|
|---|
| 1926 | hres=SH_get_instance(clsid,
|
|---|
| 1927 | path,
|
|---|
| 1928 | unknownouter,
|
|---|
| 1929 | refiid,
|
|---|
| 1930 | inst);
|
|---|
| 1931 | if (hres<0)
|
|---|
| 1932 | hres=SH_get_instance(clsid,
|
|---|
| 1933 | "shell32.dll",
|
|---|
| 1934 | unknownouter,
|
|---|
| 1935 | refiid,
|
|---|
| 1936 | inst);
|
|---|
| 1937 |
|
|---|
| 1938 | RegCloseKey(inprockey);
|
|---|
| 1939 |
|
|---|
| 1940 | return hres;
|
|---|
| 1941 | }
|
|---|
| 1942 |
|
|---|
| 1943 |
|
|---|
| 1944 | /*************************************************************************
|
|---|
| 1945 | * SHELL_FindExecutable
|
|---|
| 1946 | * Utility for code sharing between FindExecutable and ShellExecute
|
|---|
| 1947 | */
|
|---|
| 1948 | static HINSTANCE32 SHELL_FindExecutable( LPCSTR lpFile,
|
|---|
| 1949 | LPCSTR lpOperation,
|
|---|
| 1950 | LPSTR lpResult)
|
|---|
| 1951 | {
|
|---|
| 1952 | char *extension = NULL; /* pointer to file extension */
|
|---|
| 1953 | char tmpext[5]; /* local copy to mung as we please */
|
|---|
| 1954 | char filetype[256]; /* registry name for this filetype */
|
|---|
| 1955 | LONG filetypelen=256; /* length of above */
|
|---|
| 1956 | char command[256]; /* command from registry */
|
|---|
| 1957 | LONG commandlen=256; /* This is the most DOS can handle :) */
|
|---|
| 1958 | char buffer[256]; /* Used to GetProfileString */
|
|---|
| 1959 | HINSTANCE32 retval=31; /* default - 'No association was found' */
|
|---|
| 1960 | char *tok; /* token pointer */
|
|---|
| 1961 | int i; /* random counter */
|
|---|
| 1962 | char xlpFile[256]; /* result of SearchPath */
|
|---|
| 1963 |
|
|---|
| 1964 | TRACE(exec, "%s\n",
|
|---|
| 1965 | (lpFile != NULL?lpFile:"-") );
|
|---|
| 1966 | lpResult[0]='\0'; /* Start off with an empty return string */
|
|---|
| 1967 |
|
|---|
| 1968 | /* trap NULL parameters on entry */
|
|---|
| 1969 | if (( lpFile == NULL ) || ( lpResult == NULL ) || ( lpOperation == NULL ))
|
|---|
| 1970 | {
|
|---|
| 1971 | /* FIXME - should throw a warning, perhaps! */
|
|---|
| 1972 | return 2; /* File not found. Close enough, I guess. */
|
|---|
| 1973 | }
|
|---|
| 1974 |
|
|---|
| 1975 | if (SearchPath32A( NULL, lpFile,".exe",sizeof(xlpFile),xlpFile,NULL))
|
|---|
| 1976 | lpFile = xlpFile;
|
|---|
| 1977 |
|
|---|
| 1978 | /* First thing we need is the file's extension */
|
|---|
| 1979 | extension = strrchr( xlpFile, '.' ); /* Assume last "." is the one; */
|
|---|
| 1980 | /* File->Run in progman uses */
|
|---|
| 1981 | /* .\FILE.EXE :( */
|
|---|
| 1982 | if ((extension == NULL) || (extension == &xlpFile[strlen(xlpFile)]))
|
|---|
| 1983 | {
|
|---|
| 1984 | return 31; /* no association */
|
|---|
| 1985 | }
|
|---|
| 1986 |
|
|---|
| 1987 | /* Make local copy & lowercase it for reg & 'programs=' lookup */
|
|---|
| 1988 | lstrcpyn32A( tmpext, extension, 5 );
|
|---|
| 1989 | CharLower32A( tmpext );
|
|---|
| 1990 | TRACE(exec, "%s file\n", tmpext);
|
|---|
| 1991 |
|
|---|
| 1992 | /* Three places to check: */
|
|---|
| 1993 | /* 1. win.ini, [windows], programs (NB no leading '.') */
|
|---|
| 1994 | /* 2. Registry, HKEY_CLASS_ROOT\<filetype>\shell\open\command */
|
|---|
| 1995 | /* 3. win.ini, [extensions], extension (NB no leading '.' */
|
|---|
| 1996 | /* All I know of the order is that registry is checked before */
|
|---|
| 1997 | /* extensions; however, it'd make sense to check the programs */
|
|---|
| 1998 | /* section first, so that's what happens here. */
|
|---|
| 1999 |
|
|---|
| 2000 | /* See if it's a program - if GetProfileString fails, we skip this
|
|---|
| 2001 | * section. Actually, if GetProfileString fails, we've probably
|
|---|
| 2002 | * got a lot more to worry about than running a program... */
|
|---|
| 2003 | if ( GetProfileString32A("windows", "programs", "exe pif bat com",
|
|---|
| 2004 | buffer, sizeof(buffer)) > 0 )
|
|---|
| 2005 | {
|
|---|
| 2006 | for (i=0;i<strlen(buffer); i++) buffer[i]=tolower(buffer[i]);
|
|---|
| 2007 |
|
|---|
| 2008 | tok = strtok(buffer, " \t"); /* ? */
|
|---|
| 2009 | while( tok!= NULL)
|
|---|
| 2010 | {
|
|---|
| 2011 | if (strcmp(tok, &tmpext[1])==0) /* have to skip the leading "." */
|
|---|
| 2012 | {
|
|---|
| 2013 | strcpy(lpResult, xlpFile);
|
|---|
| 2014 | /* Need to perhaps check that the file has a path
|
|---|
| 2015 | * attached */
|
|---|
| 2016 | TRACE(exec, "found %s\n",
|
|---|
| 2017 | lpResult);
|
|---|
| 2018 | return 33;
|
|---|
| 2019 |
|
|---|
| 2020 | /* Greater than 32 to indicate success FIXME According to the
|
|---|
| 2021 | * docs, I should be returning a handle for the
|
|---|
| 2022 | * executable. Does this mean I'm supposed to open the
|
|---|
| 2023 | * executable file or something? More RTFM, I guess... */
|
|---|
| 2024 | }
|
|---|
| 2025 | tok=strtok(NULL, " \t");
|
|---|
| 2026 | }
|
|---|
| 2027 | }
|
|---|
| 2028 |
|
|---|
| 2029 | /* Check registry */
|
|---|
| 2030 | if (RegQueryValue16( (HKEY)HKEY_CLASSES_ROOT, tmpext, filetype,
|
|---|
| 2031 | &filetypelen ) == SHELL_ERROR_SUCCESS )
|
|---|
| 2032 | {
|
|---|
| 2033 | filetype[filetypelen]='\0';
|
|---|
| 2034 | TRACE(exec, "File type: %s\n",
|
|---|
| 2035 | filetype);
|
|---|
| 2036 |
|
|---|
| 2037 | /* Looking for ...buffer\shell\lpOperation\command */
|
|---|
| 2038 | strcat( filetype, "\\shell\\" );
|
|---|
| 2039 | strcat( filetype, lpOperation );
|
|---|
| 2040 | strcat( filetype, "\\command" );
|
|---|
| 2041 |
|
|---|
| 2042 | if (RegQueryValue16( (HKEY)HKEY_CLASSES_ROOT, filetype, command,
|
|---|
| 2043 | &commandlen ) == SHELL_ERROR_SUCCESS )
|
|---|
| 2044 | {
|
|---|
| 2045 | /* Is there a replace() function anywhere? */
|
|---|
| 2046 | command[commandlen]='\0';
|
|---|
| 2047 | strcpy( lpResult, command );
|
|---|
| 2048 | tok=strstr( lpResult, "%1" );
|
|---|
| 2049 | if (tok != NULL)
|
|---|
| 2050 | {
|
|---|
| 2051 | tok[0]='\0'; /* truncate string at the percent */
|
|---|
| 2052 | strcat( lpResult, xlpFile ); /* what if no dir in xlpFile? */
|
|---|
| 2053 | tok=strstr( command, "%1" );
|
|---|
| 2054 | if ((tok!=NULL) && (strlen(tok)>2))
|
|---|
| 2055 | {
|
|---|
| 2056 | strcat( lpResult, &tok[2] );
|
|---|
| 2057 | }
|
|---|
| 2058 | }
|
|---|
| 2059 | retval=33; /* FIXME see above */
|
|---|
| 2060 | }
|
|---|
| 2061 | }
|
|---|
| 2062 | else /* Check win.ini */
|
|---|
| 2063 | {
|
|---|
| 2064 | /* Toss the leading dot */
|
|---|
| 2065 | extension++;
|
|---|
| 2066 | if ( GetProfileString32A( "extensions", extension, "", command,
|
|---|
| 2067 | sizeof(command)) > 0)
|
|---|
| 2068 | {
|
|---|
| 2069 | if (strlen(command)!=0)
|
|---|
| 2070 | {
|
|---|
| 2071 | strcpy( lpResult, command );
|
|---|
| 2072 | tok=strstr( lpResult, "^" ); /* should be ^.extension? */
|
|---|
| 2073 | if (tok != NULL)
|
|---|
| 2074 | {
|
|---|
| 2075 | tok[0]='\0';
|
|---|
| 2076 | strcat( lpResult, xlpFile ); /* what if no dir in xlpFile? */
|
|---|
| 2077 | tok=strstr( command, "^" ); /* see above */
|
|---|
| 2078 | if ((tok != NULL) && (strlen(tok)>5))
|
|---|
| 2079 | {
|
|---|
| 2080 | strcat( lpResult, &tok[5]);
|
|---|
| 2081 | }
|
|---|
| 2082 | }
|
|---|
| 2083 | retval=33; /* FIXME - see above */
|
|---|
| 2084 | }
|
|---|
| 2085 | }
|
|---|
| 2086 | }
|
|---|
| 2087 |
|
|---|
| 2088 | TRACE(exec, "returning %s\n", lpResult);
|
|---|
| 2089 | return retval;
|
|---|
| 2090 | }
|
|---|
| 2091 |
|
|---|
| 2092 | /*************************************************************************
|
|---|
| 2093 | * ShellExecute16 [SHELL.20]
|
|---|
| 2094 | */
|
|---|
| 2095 | HINSTANCE16 WIN32API ShellExecute16( HWND16 hWnd, LPCSTR lpOperation,
|
|---|
| 2096 | LPCSTR lpFile, LPCSTR lpParameters,
|
|---|
| 2097 | LPCSTR lpDirectory, INT16 iShowCmd )
|
|---|
| 2098 | {
|
|---|
| 2099 | HINSTANCE16 retval=31;
|
|---|
| 2100 | char old_dir[1024];
|
|---|
| 2101 | char cmd[256];
|
|---|
| 2102 |
|
|---|
| 2103 | TRACE(exec, "(%04x,'%s','%s','%s','%s',%x)\n",
|
|---|
| 2104 | hWnd, lpOperation ? lpOperation:"<null>", lpFile ? lpFile:"<null>",
|
|---|
| 2105 | lpParameters ? lpParameters : "<null>",
|
|---|
| 2106 | lpDirectory ? lpDirectory : "<null>", iShowCmd);
|
|---|
| 2107 |
|
|---|
| 2108 | if (lpFile==NULL) return 0; /* should not happen */
|
|---|
| 2109 | if (lpOperation==NULL) /* default is open */
|
|---|
| 2110 | lpOperation="open";
|
|---|
| 2111 |
|
|---|
| 2112 | if (lpDirectory)
|
|---|
| 2113 | {
|
|---|
| 2114 | GetCurrentDirectory32A( sizeof(old_dir), old_dir );
|
|---|
| 2115 | SetCurrentDirectory32A( lpDirectory );
|
|---|
| 2116 | }
|
|---|
| 2117 |
|
|---|
| 2118 | retval = SHELL_FindExecutable( lpFile, lpOperation, cmd );
|
|---|
| 2119 |
|
|---|
| 2120 | if (retval > 32) /* Found */
|
|---|
| 2121 | {
|
|---|
| 2122 | if (lpParameters)
|
|---|
| 2123 | {
|
|---|
| 2124 | strcat(cmd," ");
|
|---|
| 2125 | strcat(cmd,lpParameters);
|
|---|
| 2126 | }
|
|---|
| 2127 |
|
|---|
| 2128 | TRACE(exec,"starting %s\n",cmd);
|
|---|
| 2129 | retval = WinExec32( cmd, iShowCmd );
|
|---|
| 2130 | }
|
|---|
| 2131 | if (lpDirectory) SetCurrentDirectory32A( old_dir );
|
|---|
| 2132 | return retval;
|
|---|
| 2133 | }
|
|---|
| 2134 |
|
|---|
| 2135 |
|
|---|
| 2136 | /*************************************************************************
|
|---|
| 2137 | * ShellExecute32A (SHELL32.245)
|
|---|
| 2138 | */
|
|---|
| 2139 | HINSTANCE32 WIN32API ShellExecute32A( HWND hWnd, LPCSTR lpOperation,
|
|---|
| 2140 | LPCSTR lpFile, LPCSTR lpParameters,
|
|---|
| 2141 | LPCSTR lpDirectory, INT32 iShowCmd )
|
|---|
| 2142 | {
|
|---|
| 2143 | return ShellExecute16( hWnd, lpOperation, lpFile, lpParameters,
|
|---|
| 2144 | lpDirectory, iShowCmd );
|
|---|
| 2145 | }
|
|---|
| 2146 |
|
|---|
| 2147 |
|
|---|
| 2148 | /*************************************************************************
|
|---|
| 2149 | * FindExecutable32A (SHELL32.184)
|
|---|
| 2150 | */
|
|---|
| 2151 | HINSTANCE32 WIN32API FindExecutable32A( LPCSTR lpFile, LPCSTR lpDirectory,
|
|---|
| 2152 | LPSTR lpResult )
|
|---|
| 2153 | {
|
|---|
| 2154 | HINSTANCE32 retval=31; /* default - 'No association was found' */
|
|---|
| 2155 | char old_dir[1024];
|
|---|
| 2156 |
|
|---|
| 2157 | TRACE(exec, "File %s, Dir %s\n",
|
|---|
| 2158 | (lpFile != NULL?lpFile:"-"),
|
|---|
| 2159 | (lpDirectory != NULL?lpDirectory:"-"));
|
|---|
| 2160 |
|
|---|
| 2161 | lpResult[0]='\0'; /* Start off with an empty return string */
|
|---|
| 2162 |
|
|---|
| 2163 | /* trap NULL parameters on entry */
|
|---|
| 2164 | if (( lpFile == NULL ) || ( lpResult == NULL ))
|
|---|
| 2165 | {
|
|---|
| 2166 | /* FIXME - should throw a warning, perhaps! */
|
|---|
| 2167 | return 2; /* File not found. Close enough, I guess. */
|
|---|
| 2168 | }
|
|---|
| 2169 |
|
|---|
| 2170 | if (lpDirectory)
|
|---|
| 2171 | {
|
|---|
| 2172 | GetCurrentDirectory32A( sizeof(old_dir), old_dir );
|
|---|
| 2173 | SetCurrentDirectory32A( lpDirectory );
|
|---|
| 2174 | }
|
|---|
| 2175 |
|
|---|
| 2176 | retval = SHELL_FindExecutable( lpFile, "open", lpResult );
|
|---|
| 2177 |
|
|---|
| 2178 | TRACE(exec, "returning %s\n", lpResult);
|
|---|
| 2179 | if (lpDirectory) SetCurrentDirectory32A( old_dir );
|
|---|
| 2180 | return retval;
|
|---|
| 2181 | }
|
|---|
| 2182 |
|
|---|
| 2183 |
|
|---|
| 2184 |
|
|---|
| 2185 |
|
|---|
| 2186 |
|
|---|
| 2187 | /*************************************************************************
|
|---|
| 2188 | * ExtractIcon32A (SHELL32.133)
|
|---|
| 2189 | */
|
|---|
| 2190 | HICON32 WIN32API ExtractIcon32A( HINSTANCE32 hInstance, LPCSTR lpszExeFileName,
|
|---|
| 2191 | UINT32 nIconIndex )
|
|---|
| 2192 | {
|
|---|
| 2193 | HGLOBAL16 handle = InternalExtractIcon(hInstance,lpszExeFileName,nIconIndex, 1);
|
|---|
| 2194 |
|
|---|
| 2195 | if( handle )
|
|---|
| 2196 | {
|
|---|
| 2197 | HICON16* ptr = (HICON16*)GlobalLock16(handle);
|
|---|
| 2198 | HICON16 hIcon = *ptr;
|
|---|
| 2199 |
|
|---|
| 2200 | GlobalFree16(handle);
|
|---|
| 2201 | return hIcon;
|
|---|
| 2202 | }
|
|---|
| 2203 | return 0;
|
|---|
| 2204 | }
|
|---|
| 2205 |
|
|---|
| 2206 | /*************************************************************************
|
|---|
| 2207 | * ExtractIcon32W (SHELL32.180)
|
|---|
| 2208 | */
|
|---|
| 2209 | HICON32 WIN32API ExtractIcon32W( HINSTANCE32 hInstance, LPCWSTR lpszExeFileName,
|
|---|
| 2210 | UINT32 nIconIndex )
|
|---|
| 2211 | {
|
|---|
| 2212 | LPSTR exefn = HEAP_strdupWtoA(GetProcessHeap(),0,lpszExeFileName);
|
|---|
| 2213 | HICON32 ret = ExtractIcon32A(hInstance,exefn,nIconIndex);
|
|---|
| 2214 |
|
|---|
| 2215 | HeapFree(GetProcessHeap(),0,exefn);
|
|---|
| 2216 | return ret;
|
|---|
| 2217 | }
|
|---|
| 2218 |
|
|---|
| 2219 |
|
|---|
| 2220 | /*************************************************************************
|
|---|
| 2221 | * ExtractAssociatedIcon [SHELL.36]
|
|---|
| 2222 | *
|
|---|
| 2223 | * Return icon for given file (either from file itself or from associated
|
|---|
| 2224 | * executable) and patch parameters if needed.
|
|---|
| 2225 | */
|
|---|
| 2226 | HICON32 WIN32API ExtractAssociatedIcon32A(HINSTANCE32 hInst,LPSTR lpIconPath,
|
|---|
| 2227 | LPWORD lpiIcon)
|
|---|
| 2228 | {
|
|---|
| 2229 | return ExtractAssociatedIcon16(hInst,lpIconPath,lpiIcon);
|
|---|
| 2230 | }
|
|---|
| 2231 |
|
|---|
| 2232 | HICON16 WIN32API ExtractAssociatedIcon16(HINSTANCE16 hInst,LPSTR lpIconPath,
|
|---|
| 2233 | LPWORD lpiIcon)
|
|---|
| 2234 | {
|
|---|
| 2235 | HICON16 hIcon = ExtractIcon16(hInst, lpIconPath, *lpiIcon);
|
|---|
| 2236 |
|
|---|
| 2237 | if( hIcon < 2 )
|
|---|
| 2238 | {
|
|---|
| 2239 |
|
|---|
| 2240 | if( hIcon == 1 ) /* no icons found in given file */
|
|---|
| 2241 | {
|
|---|
| 2242 | char tempPath[0x80];
|
|---|
| 2243 | USHORT uRet = FindExecutable16(lpIconPath,NULL,tempPath);
|
|---|
| 2244 |
|
|---|
| 2245 | if( uRet > 32 && tempPath[0] )
|
|---|
| 2246 | {
|
|---|
| 2247 | strcpy(lpIconPath,tempPath);
|
|---|
| 2248 | hIcon = ExtractIcon16(hInst, lpIconPath, *lpiIcon);
|
|---|
| 2249 |
|
|---|
| 2250 | if( hIcon > 2 ) return hIcon;
|
|---|
| 2251 | }
|
|---|
| 2252 | else hIcon = 0;
|
|---|
| 2253 | }
|
|---|
| 2254 |
|
|---|
| 2255 | if( hIcon == 1 )
|
|---|
| 2256 | *lpiIcon = 2; /* MSDOS icon - we found .exe but no icons in it */
|
|---|
| 2257 | else
|
|---|
| 2258 | *lpiIcon = 6; /* generic icon - found nothing */
|
|---|
| 2259 |
|
|---|
| 2260 | GetModuleFileName16(hInst, lpIconPath, 0x80);
|
|---|
| 2261 | hIcon = LoadIcon16( hInst, MAKEINTRESOURCE16(*lpiIcon));
|
|---|
| 2262 | }
|
|---|
| 2263 |
|
|---|
| 2264 | return hIcon;
|
|---|
| 2265 | }
|
|---|
| 2266 |
|
|---|
| 2267 | /*************************************************************************
|
|---|
| 2268 | * FindEnvironmentString [SHELL.38]
|
|---|
| 2269 | *
|
|---|
| 2270 | * Returns a pointer into the DOS environment... Ugh.
|
|---|
| 2271 | */
|
|---|
| 2272 | LPSTR SHELL_FindString(LPSTR lpEnv, LPCSTR entry)
|
|---|
| 2273 | {
|
|---|
| 2274 | USHORT l = strlen(entry);
|
|---|
| 2275 | for( ; *lpEnv ; lpEnv+=strlen(lpEnv)+1 )
|
|---|
| 2276 | {
|
|---|
| 2277 | if( lstrncmpi32A(lpEnv, entry, l) ) continue;
|
|---|
| 2278 |
|
|---|
| 2279 | if( !*(lpEnv+l) )
|
|---|
| 2280 | return (lpEnv + l); /* empty entry */
|
|---|
| 2281 | else if ( *(lpEnv+l)== '=' )
|
|---|
| 2282 | return (lpEnv + l + 1);
|
|---|
| 2283 | }
|
|---|
| 2284 | return NULL;
|
|---|
| 2285 | }
|
|---|
| 2286 |
|
|---|
| 2287 | SEGPTR WIN32API FindEnvironmentString(LPSTR str)
|
|---|
| 2288 | {
|
|---|
| 2289 | SEGPTR spEnv = GetDOSEnvironment();
|
|---|
| 2290 | LPSTR lpEnv = (LPSTR)PTR_SEG_TO_LIN(spEnv);
|
|---|
| 2291 |
|
|---|
| 2292 | LPSTR lpString = (spEnv)?SHELL_FindString(lpEnv, str):NULL;
|
|---|
| 2293 |
|
|---|
| 2294 | if( lpString ) /* offset should be small enough */
|
|---|
| 2295 | return spEnv + (lpString - lpEnv);
|
|---|
| 2296 |
|
|---|
| 2297 | return (SEGPTR)NULL;
|
|---|
| 2298 | }
|
|---|
| 2299 |
|
|---|
| 2300 | /*************************************************************************
|
|---|
| 2301 | * DoEnvironmentSubst [SHELL.37]
|
|---|
| 2302 | *
|
|---|
| 2303 | * Replace %KEYWORD% in the str with the value of variable KEYWORD
|
|---|
| 2304 | * from "DOS" environment.
|
|---|
| 2305 | */
|
|---|
| 2306 | DWORD WIN32API DoEnvironmentSubst(LPSTR str,WORD length)
|
|---|
| 2307 | {
|
|---|
| 2308 | LPSTR lpEnv = (LPSTR)PTR_SEG_TO_LIN(GetDOSEnvironment());
|
|---|
| 2309 | LPSTR lpBuffer = (LPSTR)HeapAlloc( GetProcessHeap(), 0, length);
|
|---|
| 2310 | LPSTR lpstr = str;
|
|---|
| 2311 | LPSTR lpbstr = lpBuffer;
|
|---|
| 2312 |
|
|---|
| 2313 | CharToOem32A(str,str);
|
|---|
| 2314 |
|
|---|
| 2315 | TRACE(reg,"accept %s\n", str);
|
|---|
| 2316 |
|
|---|
| 2317 | while( *lpstr && lpbstr - lpBuffer < length )
|
|---|
| 2318 | {
|
|---|
| 2319 | LPSTR lpend = lpstr;
|
|---|
| 2320 |
|
|---|
| 2321 | if( *lpstr == '%' )
|
|---|
| 2322 | {
|
|---|
| 2323 | do { lpend++; } while( *lpend && *lpend != '%' );
|
|---|
| 2324 | if( *lpend == '%' && lpend - lpstr > 1 ) /* found key */
|
|---|
| 2325 | {
|
|---|
| 2326 | LPSTR lpKey;
|
|---|
| 2327 | *lpend = '\0';
|
|---|
| 2328 | lpKey = SHELL_FindString(lpEnv, lpstr+1);
|
|---|
| 2329 | if( lpKey ) /* found key value */
|
|---|
| 2330 | {
|
|---|
| 2331 | int l = strlen(lpKey);
|
|---|
| 2332 |
|
|---|
| 2333 | if( l > length - (lpbstr - lpBuffer) - 1 )
|
|---|
| 2334 | {
|
|---|
| 2335 | WARN(reg,"Env subst aborted - string too short\n");
|
|---|
| 2336 | *lpend = '%';
|
|---|
| 2337 | break;
|
|---|
| 2338 | }
|
|---|
| 2339 | strcpy(lpbstr, lpKey);
|
|---|
| 2340 | lpbstr += l;
|
|---|
| 2341 | }
|
|---|
| 2342 | else break;
|
|---|
| 2343 | *lpend = '%';
|
|---|
| 2344 | lpstr = lpend + 1;
|
|---|
| 2345 | }
|
|---|
| 2346 | else break; /* back off and whine */
|
|---|
| 2347 |
|
|---|
| 2348 | continue;
|
|---|
| 2349 | }
|
|---|
| 2350 |
|
|---|
| 2351 | *lpbstr++ = *lpstr++;
|
|---|
| 2352 | }
|
|---|
| 2353 |
|
|---|
| 2354 | *lpbstr = '\0';
|
|---|
| 2355 | if( lpstr - str == strlen(str) )
|
|---|
| 2356 | {
|
|---|
| 2357 | strncpy(str, lpBuffer, length);
|
|---|
| 2358 | length = 1;
|
|---|
| 2359 | }
|
|---|
| 2360 | else
|
|---|
| 2361 | length = 0;
|
|---|
| 2362 |
|
|---|
| 2363 | TRACE(reg," return %s\n", str);
|
|---|
| 2364 |
|
|---|
| 2365 | OemToChar32A(str,str);
|
|---|
| 2366 | HeapFree( GetProcessHeap(), 0, lpBuffer);
|
|---|
| 2367 |
|
|---|
| 2368 | /* Return str length in the LOWORD
|
|---|
| 2369 | * and 1 in HIWORD if subst was successful.
|
|---|
| 2370 | */
|
|---|
| 2371 | return (DWORD)MAKELONG(strlen(str), length);
|
|---|
| 2372 | }
|
|---|
| 2373 |
|
|---|
| 2374 | /*************************************************************************
|
|---|
| 2375 | * ShellHookProc [SHELL.103]
|
|---|
| 2376 | * System-wide WH_SHELL hook.
|
|---|
| 2377 | */
|
|---|
| 2378 | LRESULT WIN32API ShellHookProc(INT16 code, WPARAM16 wParam, LPARAM lParam)
|
|---|
| 2379 | {
|
|---|
| 2380 | TRACE(reg,"%i, %04x, %08x\n", code, wParam,
|
|---|
| 2381 | (unsigned)lParam );
|
|---|
| 2382 | if( SHELL_hHook && SHELL_hWnd )
|
|---|
| 2383 | {
|
|---|
| 2384 | USHORT uMsg = 0;
|
|---|
| 2385 | switch( code )
|
|---|
| 2386 | {
|
|---|
| 2387 | case HSHELL_WINDOWCREATED: uMsg = uMsgWndCreated; break;
|
|---|
| 2388 | case HSHELL_WINDOWDESTROYED: uMsg = uMsgWndDestroyed; break;
|
|---|
| 2389 | case HSHELL_ACTIVATESHELLWINDOW: uMsg = uMsgShellActivate;
|
|---|
| 2390 | }
|
|---|
| 2391 | PostMessage16( SHELL_hWnd, uMsg, wParam, 0 );
|
|---|
| 2392 | }
|
|---|
| 2393 | return CallNextHookEx16( WH_SHELL, code, wParam, lParam );
|
|---|
| 2394 | }
|
|---|
| 2395 |
|
|---|
| 2396 | /*************************************************************************
|
|---|
| 2397 | * RegisterShellHook [SHELL.102]
|
|---|
| 2398 | */
|
|---|
| 2399 | BOOL WIN32API RegisterShellHook(HWND16 hWnd, USHORT uAction)
|
|---|
| 2400 | {
|
|---|
| 2401 | TRACE(reg,"%04x [%u]\n", hWnd, uAction );
|
|---|
| 2402 |
|
|---|
| 2403 | switch( uAction )
|
|---|
| 2404 | {
|
|---|
| 2405 | case 2: /* register hWnd as a shell window */
|
|---|
| 2406 |
|
|---|
| 2407 | if( !SHELL_hHook )
|
|---|
| 2408 | {
|
|---|
| 2409 | HMODULE16 hShell = GetModuleHandle16( "SHELL" );
|
|---|
| 2410 |
|
|---|
| 2411 | SHELL_hHook = SetWindowsHookEx16( WH_SHELL, ShellHookProc,
|
|---|
| 2412 | hShell, 0 );
|
|---|
| 2413 | if( SHELL_hHook )
|
|---|
| 2414 | {
|
|---|
| 2415 | uMsgWndCreated = RegisterWindowMessage32A( lpstrMsgWndCreated );
|
|---|
| 2416 | uMsgWndDestroyed = RegisterWindowMessage32A( lpstrMsgWndDestroyed );
|
|---|
| 2417 | uMsgShellActivate = RegisterWindowMessage32A( lpstrMsgShellActivate );
|
|---|
| 2418 | }
|
|---|
| 2419 | else WARN(reg, "unable to install ShellHookProc()!\n");
|
|---|
| 2420 | }
|
|---|
| 2421 |
|
|---|
| 2422 | if( SHELL_hHook ) return ((SHELL_hWnd = hWnd) != 0);
|
|---|
| 2423 | break;
|
|---|
| 2424 |
|
|---|
| 2425 | default:
|
|---|
| 2426 |
|
|---|
| 2427 | WARN(reg, "unknown code %i\n", uAction );
|
|---|
| 2428 |
|
|---|
| 2429 | /* just in case */
|
|---|
| 2430 |
|
|---|
| 2431 | SHELL_hWnd = 0;
|
|---|
| 2432 | }
|
|---|
| 2433 | return FALSE;
|
|---|
| 2434 | }
|
|---|
| 2435 |
|
|---|
| 2436 |
|
|---|
| 2437 | /*************************************************************************
|
|---|
| 2438 | * SHAppBarMessage32 [SHELL32.207]
|
|---|
| 2439 | */
|
|---|
| 2440 | UINT32 WIN32API SHAppBarMessage32(DWORD msg, PAPPBARDATA data)
|
|---|
| 2441 | {
|
|---|
| 2442 | FIXME(shell,"(0x%08lx,%p): stub\n", msg, data);
|
|---|
| 2443 | #if 0
|
|---|
| 2444 | switch (msg) {
|
|---|
| 2445 | case ABM_ACTIVATE:
|
|---|
| 2446 | case ABM_GETAUTOHIDEBAR:
|
|---|
| 2447 | case ABM_GETSTATE:
|
|---|
| 2448 | case ABM_GETTASKBARPOS:
|
|---|
| 2449 | case ABM_NEW:
|
|---|
| 2450 | case ABM_QUERYPOS:
|
|---|
| 2451 | case ABM_REMOVE:
|
|---|
| 2452 | case ABM_SETAUTOHIDEBAR:
|
|---|
| 2453 | case ABM_SETPOS:
|
|---|
| 2454 | case ABM_WINDOWPOSCHANGED:
|
|---|
| 2455 | ;
|
|---|
| 2456 | }
|
|---|
| 2457 | #endif
|
|---|
| 2458 | return 0;
|
|---|
| 2459 | }
|
|---|
| 2460 |
|
|---|
| 2461 |
|
|---|
| 2462 | /*************************************************************************
|
|---|
| 2463 | * Control_RunDLL [SHELL32.12]
|
|---|
| 2464 | *
|
|---|
| 2465 | * Wild speculation in the following!
|
|---|
| 2466 | *
|
|---|
| 2467 | * http://premium.microsoft.com/msdn/library/techart/msdn193.htm
|
|---|
| 2468 | */
|
|---|
| 2469 |
|
|---|
| 2470 | void WIN32API Control_RunDLL (HWND hwnd, LPCVOID code, LPCSTR cmd, DWORD arg4)
|
|---|
| 2471 | {
|
|---|
| 2472 | TRACE(exec, "(%08x, %p, \"%s\", %08lx)\n",
|
|---|
| 2473 | hwnd, code ? code : "(null)", cmd ? cmd : "(null)", arg4);
|
|---|
| 2474 | }
|
|---|
| 2475 |
|
|---|
| 2476 | /*************************************************************************
|
|---|
| 2477 | */
|
|---|
| 2478 |
|
|---|
| 2479 | void WIN32API FreeIconList( DWORD dw )
|
|---|
| 2480 | {
|
|---|
| 2481 | FIXME(reg, "empty stub\n" );
|
|---|
| 2482 | }
|
|---|
| 2483 |
|
|---|
| 2484 | /*************************************************************************
|
|---|
| 2485 | * SHELL32_DllGetClassObject [SHELL32.14]
|
|---|
| 2486 | *
|
|---|
| 2487 | * http://premium.microsoft.com/msdn/library/sdkdoc/api2_48fo.htm
|
|---|
| 2488 | */
|
|---|
| 2489 | DWORD WIN32API SHELL32_DllGetClassObject(REFCLSID rclsid,REFIID iid,LPVOID *ppv)
|
|---|
| 2490 | {
|
|---|
| 2491 | char xclsid[50],xiid[50];
|
|---|
| 2492 | HRESULT hres = E_OUTOFMEMORY;
|
|---|
| 2493 |
|
|---|
| 2494 |
|
|---|
| 2495 | WINE_StringFromCLSID((LPCLSID)rclsid,xclsid);
|
|---|
| 2496 | WINE_StringFromCLSID((LPCLSID)iid,xiid);
|
|---|
| 2497 | TRACE(shell,"(%s,%s,%p)\n",xclsid,xiid,ppv);
|
|---|
| 2498 |
|
|---|
| 2499 | *ppv = NULL;
|
|---|
| 2500 | /* SDK example code looks like this:
|
|---|
| 2501 | *
|
|---|
| 2502 | HRESULT hres = E_OUTOFMEMORY;
|
|---|
| 2503 |
|
|---|
| 2504 | *ppv = NULL;
|
|---|
| 2505 | CClassFactory *pClassFactory = new CClassFactory(rclsid);
|
|---|
| 2506 |
|
|---|
| 2507 | if (pClassFactory) {
|
|---|
| 2508 | hRes = pClassFactory->QueryInterface(riid,ppv);
|
|---|
| 2509 | pClassFactory->Release();
|
|---|
| 2510 | }
|
|---|
| 2511 | return hRes;
|
|---|
| 2512 | *
|
|---|
| 2513 | * The magic of the whole stuff is still unclear to me, so just hack together
|
|---|
| 2514 | * something.
|
|---|
| 2515 | */
|
|---|
| 2516 |
|
|---|
| 2517 | if (!memcmp(rclsid,&CLSID_ShellDesktop,sizeof(CLSID_ShellDesktop))) {
|
|---|
| 2518 | TRACE(shell," requested CLSID_ShellDesktop, creating it.\n");
|
|---|
| 2519 | *ppv = IShellFolder_Constructor();
|
|---|
| 2520 | FIXME(shell,"Initialize this folder to be the shell desktop folder\n");
|
|---|
| 2521 | return 0;
|
|---|
| 2522 | }
|
|---|
| 2523 |
|
|---|
| 2524 | FIXME(shell, " -> clsid not found. returning E_OUTOFMEMORY.\n");
|
|---|
| 2525 | return hres;
|
|---|
| 2526 | }
|
|---|
| 2527 |
|
|---|
| 2528 | #endif
|
|---|
| 2529 |
|
|---|
| 2530 |
|
|---|
| 2531 |
|
|---|
| 2532 |
|
|---|
| 2533 | #if 0
|
|---|
| 2534 |
|
|---|
| 2535 | WINSHELLAPI HICON APIENTRY DuplicateIcon(HINSTANCE hInst, HICON hIcon);
|
|---|
| 2536 | WINSHELLAPI HICON APIENTRY ExtractAssociatedIconA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD lpiIcon);
|
|---|
| 2537 | WINSHELLAPI HICON APIENTRY ExtractAssociatedIconW(HINSTANCE hInst, LPWSTR lpIconPath, LPWORD lpiIcon);
|
|---|
| 2538 | WINSHELLAPI UINT APIENTRY SHAppBarMessage(DWORD dwMessage, PAPPBARDATA pData);
|
|---|
| 2539 | WINSHELLAPI DWORD APIENTRY DoEnvironmentSubstA(LPSTR szString, UINT cbString);
|
|---|
| 2540 | WINSHELLAPI DWORD APIENTRY DoEnvironmentSubstW(LPWSTR szString, UINT cbString);
|
|---|
| 2541 | WINSHELLAPI LPSTR APIENTRY FindEnvironmentStringA(LPSTR szEnvVar);
|
|---|
| 2542 | WINSHELLAPI LPWSTR APIENTRY FindEnvironmentStringW(LPWSTR szEnvVar);
|
|---|
| 2543 | WINSHELLAPI void WINAPI SHFreeNameMappings(HANDLE hNameMappings);
|
|---|
| 2544 | WINSHELLAPI void WINAPI WinExecErrorA(HWND hwnd, int error, LPCSTR lpstrFileName, LPCSTR lpstrTitle);
|
|---|
| 2545 | WINSHELLAPI void WINAPI WinExecErrorW(HWND hwnd, int error, LPCWSTR lpstrFileName, LPCWSTR lpstrTitle);
|
|---|
| 2546 | WINSHELLAPI BOOL WINAPI SHGetNewLinkInfoA(LPCSTR pszLinkTo, LPCSTR pszDir, LPSTR pszName,
|
|---|
| 2547 | BOOL FAR * pfMustCopy, UINT uFlags);
|
|---|
| 2548 | WINSHELLAPI BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName,
|
|---|
| 2549 | BOOL FAR * pfMustCopy, UINT uFlags);
|
|---|
| 2550 |
|
|---|
| 2551 | #endif
|
|---|
| 2552 |
|
|---|