Changeset 5618 for trunk/src/shell32
- Timestamp:
- Apr 28, 2001, 3:33:49 PM (24 years ago)
- Location:
- trunk/src/shell32
- Files:
-
- 1 added
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/shell32/brsfolder.c
r4121 r5618 1 /* $Id: brsfolder.c,v 1.1 2000-08-30 13:52:50 sandervl Exp $ */2 #ifdef __WIN32OS2__3 #define ICOM_CINTERFACE 14 #include <odin.h>5 #endif6 1 #include <stdlib.h> 7 2 #include <string.h> … … 15 10 #include "shresdef.h" 16 11 17 DEFAULT_DEBUG_CHANNEL(shell) 12 DEFAULT_DEBUG_CHANNEL(shell); 18 13 19 14 static HWND hwndTreeView; -
trunk/src/shell32/dialogs.c
r4121 r5618 1 /* $Id: dialogs.c,v 1. 1 2000-08-30 13:52:51sandervl Exp $ */1 /* $Id: dialogs.c,v 1.2 2001-04-28 13:33:43 sandervl Exp $ */ 2 2 /* 3 3 * common shell dialogs … … 62 62 { 63 63 TRACE("(0x%08x)\n", hWndOwner); 64 #ifdef __WIN32OS2__ 65 if (MessageBoxA( hWndOwner, "Do you want to exit Odin?", "Shutdown", MB_YESNO|MB_ICONQUESTION) == IDOK) 66 #else 64 67 if (MessageBoxA( hWndOwner, "Do you want to exit WINE?", "Shutdown", MB_YESNO|MB_ICONQUESTION) == IDOK) 68 #endif 65 69 { 66 70 SendMessageA ( hWndOwner, WM_QUIT, 0, 0); -
trunk/src/shell32/folders.c
r4706 r5618 1 /* $Id: folders.c,v 1. 7 2000-11-28 11:00:47sandervl Exp $ */1 /* $Id: folders.c,v 1.8 2001-04-28 13:33:44 sandervl Exp $ */ 2 2 /* 3 3 * Copyright 1997 Marcus Meissner … … 410 410 411 411 if (phiconLarge) 412 *phiconLarge = pImageList_GetIcon(ShellBigIconList, nIconIndex, ILD_TRANSPARENT);412 *phiconLarge = ImageList_GetIcon(ShellBigIconList, nIconIndex, ILD_TRANSPARENT); 413 413 414 414 if (phiconSmall) 415 *phiconSmall = pImageList_GetIcon(ShellSmallIconList, nIconIndex, ILD_TRANSPARENT);415 *phiconSmall = ImageList_GetIcon(ShellSmallIconList, nIconIndex, ILD_TRANSPARENT); 416 416 417 417 return S_OK; -
trunk/src/shell32/iconcache.c
r4691 r5618 1 /* $Id: iconcache.c,v 1. 3 2000-11-24 13:19:12sandervl Exp $ */1 /* $Id: iconcache.c,v 1.4 2001-04-28 13:33:44 sandervl Exp $ */ 2 2 /* 3 3 * shell icon cache (SIC) … … 790 790 else 791 791 { 792 index = pImageList_AddIcon (ShellSmallIconList, hSmallIcon);793 index1= pImageList_AddIcon (ShellBigIconList, hBigIcon);792 index = ImageList_AddIcon (ShellSmallIconList, hSmallIcon); 793 index1= ImageList_AddIcon (ShellBigIconList, hBigIcon); 794 794 795 795 if (index!=index1) … … 884 884 885 885 if (bSmallIcon) 886 return pImageList_GetIcon(ShellSmallIconList, index, ILD_NORMAL);887 return pImageList_GetIcon(ShellBigIconList, index, ILD_NORMAL);886 return ImageList_GetIcon(ShellSmallIconList, index, ILD_NORMAL); 887 return ImageList_GetIcon(ShellBigIconList, index, ILD_NORMAL); 888 888 889 889 } … … 912 912 } 913 913 914 ShellSmallIconList = pImageList_Create(16,16,ILC_COLORDDB | ILC_MASK,0,0x20);915 ShellBigIconList = pImageList_Create(32,32,ILC_COLORDDB | ILC_MASK,0,0x20);916 917 pImageList_SetBkColor(ShellSmallIconList, GetSysColor(COLOR_WINDOW));918 pImageList_SetBkColor(ShellBigIconList, GetSysColor(COLOR_WINDOW));914 ShellSmallIconList = ImageList_Create(16,16,ILC_COLORDDB | ILC_MASK,0,0x20); 915 ShellBigIconList = ImageList_Create(32,32,ILC_COLORDDB | ILC_MASK,0,0x20); 916 917 ImageList_SetBkColor(ShellSmallIconList, GetSysColor(COLOR_WINDOW)); 918 ImageList_SetBkColor(ShellBigIconList, GetSysColor(COLOR_WINDOW)); 919 919 920 920 for (index=1; index<46; index++) -
trunk/src/shell32/makefile
r4719 r5618 1 # $Id: makefile,v 1.3 2 2000-12-02 23:57:22 birdExp $1 # $Id: makefile,v 1.33 2001-04-28 13:33:44 sandervl Exp $ 2 2 3 3 # … … 54 54 $(OBJDIR)\shv_item_cmenu.obj \ 55 55 $(OBJDIR)\unknown.obj \ 56 $(OBJDIR)\control.obj \ 56 57 $(OBJDIR)\misc.obj \ 57 58 $(OBJDIR)\she.obj \ -
trunk/src/shell32/memorystream.c
r4121 r5618 1 /* $Id: memorystream.c,v 1.1 2000-08-30 13:52:52 sandervl Exp $ */2 1 /* 3 2 * this class implements a pure IStream object … … 10 9 * access in a IStream to. 11 10 */ 12 #ifdef __WIN32OS2__13 #define ICOM_CINTERFACE 114 #include <odin.h>15 #endif16 11 17 12 #include <string.h> 18 13 19 #include "wine/obj_storage.h" 14 #include "winbase.h" 15 #include "winerror.h" 16 #include "shlobj.h" 17 #include "debugtools.h" 20 18 #include "heap.h" 21 #include "winerror.h"22 #include "debugtools.h"23 19 #include "shell32_main.h" 24 20 25 DEFAULT_DEBUG_CHANNEL(shell) 21 DEFAULT_DEBUG_CHANNEL(shell); 26 22 27 23 static HRESULT WINAPI IStream_fnQueryInterface(IStream *iface, REFIID riid, LPVOID *ppvObj); -
trunk/src/shell32/pidl.c
r4125 r5618 1 /* $Id: pidl.c,v 1.2 2000-08-30 14:18:47 sandervl Exp $ */2 1 /* 3 2 * pidl Handling … … 9 8 * 10 9 */ 11 #ifdef __WIN32OS2__12 #define ICOM_CINTERFACE 113 #include <odin.h>14 #endif15 10 16 11 #include <ctype.h> … … 19 14 #include "winbase.h" 20 15 #include "debugtools.h" 21 #include "shell.h"22 16 #include "shlguid.h" 23 17 #include "winerror.h" 24 18 #include "winnls.h" 19 #include "wine/undocshell.h" 25 20 #include "shell32_main.h" 26 21 #include "shellapi.h" 22 #include "shlwapi.h" 27 23 28 24 #include "pidl.h" 29 #include "wine/undocshell.h"30 25 31 26 DEFAULT_DEBUG_CHANNEL(pidl); 32 27 DECLARE_DEBUG_CHANNEL(shell); 33 28 34 #ifdef __WIN32OS2__ 35 #ifdef DEBUG 29 #if defined( __WIN32OS2__) && defined(DEBUG) 36 30 void pdump (LPCITEMIDLIST pidl) 37 31 { … … 44 38 /* silence the sub-functions */ 45 39 bIsShellDebug = TRACE_ON(shell); 46 __SET_DEBUGGING(__DBCL_TRACE, dbch_shell, FALSE);47 __SET_DEBUGGING(__DBCL_TRACE, dbch_pidl, FALSE);40 __SET_DEBUGGING(__DBCL_TRACE, __wine_dbch_shell, FALSE); 41 __SET_DEBUGGING(__DBCL_TRACE, __wine_dbch_pidl, FALSE); 48 42 49 43 if (! pidltemp) … … 85 79 } 86 80 87 __SET_DEBUGGING(__DBCL_TRACE, dbch_shell, bIsShellDebug); 88 __SET_DEBUGGING(__DBCL_TRACE, dbch_pidl, TRUE); 89 90 } 91 #endif //DEBUG 92 #else 93 void pdump (LPCITEMIDLIST pidl) 94 { 95 BOOL bIsShellDebug; 96 97 LPITEMIDLIST pidltemp = pidl; 98 if (!TRACE_ON(pidl)) 99 return; 100 101 /* silence the sub-functions */ 102 bIsShellDebug = TRACE_ON(shell); 103 __SET_DEBUGGING(__DBCL_TRACE, dbch_shell, FALSE); 104 __SET_DEBUGGING(__DBCL_TRACE, dbch_pidl, FALSE); 105 106 if (! pidltemp) 107 { 108 MESSAGE ("-------- pidl=NULL (Desktop)\n"); 109 } 110 else 111 { 112 MESSAGE ("-------- pidl=%p\n", pidl); 113 if (pidltemp->mkid.cb) 114 { 115 do 116 { 117 DWORD dwAttrib = 0; 118 LPPIDLDATA pData = _ILGetDataPointer(pidltemp); 119 DWORD type = pData->type; 120 LPSTR szLongName = _ILGetTextPointer(pidltemp); 121 LPSTR szShortName = _ILGetSTextPointer(pidltemp); 122 char szName[MAX_PATH]; 123 124 _ILSimpleGetText(pidltemp, szName, MAX_PATH); 125 if( PT_FOLDER == type) 126 dwAttrib = pData->u.folder.uFileAttribs; 127 else if( PT_VALUE == type) 128 dwAttrib = pData->u.file.uFileAttribs; 129 130 MESSAGE ("-- pidl=%p size=%u type=%lx attr=0x%08lx name=%s (%s,%s)\n", 131 pidltemp, pidltemp->mkid.cb,type,dwAttrib,szName,debugstr_a(szLongName), debugstr_a(szShortName)); 132 133 pidltemp = ILGetNext(pidltemp); 134 135 } while (pidltemp->mkid.cb); 136 } 137 else 138 { 139 MESSAGE ("empty pidl (Desktop)\n"); 140 } 141 pcheck(pidl); 142 } 143 144 __SET_DEBUGGING(__DBCL_TRACE, dbch_shell, bIsShellDebug); 145 __SET_DEBUGGING(__DBCL_TRACE, dbch_pidl, TRUE); 146 147 } 148 #endif //__WIN32OS2__ 149 81 __SET_DEBUGGING(__DBCL_TRACE, __wine_dbch_shell, bIsShellDebug); 82 __SET_DEBUGGING(__DBCL_TRACE, __wine_dbch_pidl, TRUE); 83 84 } 85 #endif 150 86 #define BYTES_PRINTED 32 151 87 BOOL pcheck (LPCITEMIDLIST pidl) … … 156 92 157 93 bIsPidlDebug = TRACE_ON(shell); 158 __SET_DEBUGGING(__DBCL_TRACE, dbch_pidl, FALSE);94 __SET_DEBUGGING(__DBCL_TRACE, __wine_dbch_pidl, FALSE); 159 95 160 96 if (pidltemp && pidltemp->mkid.cb) … … 175 111 case PT_COMP: 176 112 case PT_NETWORK: 113 case PT_IESPECIAL1: 114 case PT_IESPECIAL2: 177 115 case PT_SHARE: 178 case PT_IESPECIAL:179 116 break; 180 117 default: … … 202 139 } while (pidltemp->mkid.cb); 203 140 } 204 __SET_DEBUGGING(__DBCL_TRACE, dbch_pidl, bIsPidlDebug);141 __SET_DEBUGGING(__DBCL_TRACE, __wine_dbch_pidl, bIsPidlDebug); 205 142 return ret; 206 143 } … … 300 237 return pidlNew; 301 238 } 239 302 240 /************************************************************************* 303 241 * ILLoadFromStream … … 332 270 } 333 271 334 /* we are not jet fully compatible */272 /* we are not yet fully compatible */ 335 273 if (!pcheck(*ppPidl)) 336 274 { SHFree(*ppPidl); … … 343 281 return ret; 344 282 } 283 284 /************************************************************************* 285 * ILSaveToStream 286 * 287 * NOTES 288 * the first two bytes are the len, the pidl is following then 289 */ 290 HRESULT WINAPI ILSaveToStream (IStream * pStream, LPCITEMIDLIST pPidl) 291 { 292 LPITEMIDLIST pidl; 293 WORD wLen = 0; 294 HRESULT ret = E_FAIL; 295 296 TRACE_(shell)("%p %p\n", pStream, pPidl); 297 298 IStream_AddRef (pStream); 299 300 pidl = pPidl; 301 while (pidl->mkid.cb) 302 { 303 wLen += sizeof(WORD) + pidl->mkid.cb; 304 pidl = ILGetNext(pidl); 305 } 306 307 if (SUCCEEDED(IStream_Write(pStream, (LPVOID)&wLen, 2, NULL))) 308 { 309 if (SUCCEEDED(IStream_Write(pStream, pPidl, wLen, NULL))) 310 { ret = S_OK; 311 } 312 } 313 314 315 IStream_Release (pStream); 316 317 return ret; 318 } 319 345 320 /************************************************************************* 346 321 * SHILCreateFromPath [SHELL32.28] … … 357 332 TRACE_(shell)("%s %p 0x%08lx\n",path,ppidl,attributes?*attributes:0); 358 333 359 lstrcpynAtoW(lpszDisplayName, path, MAX_PATH); 334 if (!MultiByteToWideChar( CP_ACP, 0, path, -1, lpszDisplayName, MAX_PATH )) 335 lpszDisplayName[MAX_PATH-1] = 0; 360 336 361 337 if (SUCCEEDED (SHGetDesktopFolder(&sf))) … … 831 807 TRACE("path=%s\n",debugstr_w(lpszPath)); 832 808 833 lstrcpynWtoA(lpszTemp, lpszPath, MAX_PATH); 809 if (!WideCharToMultiByte( CP_ACP, 0, lpszPath, -1, lpszTemp, sizeof(lpszTemp), NULL, NULL )) 810 lpszTemp[sizeof(lpszTemp)-1] = 0; 834 811 835 812 return SHSimpleIDListFromPathA (lpszTemp); … … 994 971 pfd->dwFileAttributes = _ILGetFileAttributes(pidl, NULL, 0); 995 972 pfd->nFileSizeLow = _ILGetFileSize ( pidl, NULL, 0); 996 lstrcpynAtoW(pfd->cFileName,_ILGetTextPointer(pidl), MAX_PATH); 997 lstrcpynAtoW(pfd->cAlternateFileName,_ILGetSTextPointer(pidl), 14); 973 if (!MultiByteToWideChar( CP_ACP, 0, _ILGetTextPointer(pidl), -1, 974 pfd->cFileName, MAX_PATH )) 975 pfd->cFileName[MAX_PATH-1] = 0; 976 if (!MultiByteToWideChar( CP_ACP, 0, _ILGetSTextPointer(pidl), -1, 977 pfd->cAlternateFileName, 14 )) 978 pfd->cFileName[13] = 0; 998 979 } 999 980 return NOERROR; … … 1069 1050 1070 1051 SHGetPathFromIDListA (pidl, sTemp); 1071 lstrcpyAtoW(pszPath, sTemp);1052 MultiByteToWideChar( CP_ACP, 0, sTemp, -1, pszPath, MAX_PATH ); 1072 1053 1073 1054 TRACE_(shell)("-- (%s)\n",debugstr_w(pszPath)); … … 1292 1273 */ 1293 1274 1294 LPITEMIDLIST _ILCreate(PIDLTYPE type, LPCVOID pIn, UINT 16uInSize)1275 LPITEMIDLIST _ILCreate(PIDLTYPE type, LPCVOID pIn, UINT uInSize) 1295 1276 { 1296 1277 LPITEMIDLIST pidlOut = NULL, pidlTemp = NULL; 1297 1278 LPPIDLDATA pData; 1298 UINT 16uSize = 0;1279 UINT uSize = 0; 1299 1280 LPSTR pszDest; 1300 1281 … … 1374 1355 * strlen (lpszText) 1375 1356 */ 1376 DWORD _ILGetDrive(LPCITEMIDLIST pidl,LPSTR pOut, UINT 16uSize)1357 DWORD _ILGetDrive(LPCITEMIDLIST pidl,LPSTR pOut, UINT uSize) 1377 1358 { TRACE("(%p,%p,%u)\n",pidl,pOut,uSize); 1378 1359 … … 1474 1455 * gets the text for the first item in the pidl (eg. simple pidl) 1475 1456 * 1476 * returns the leng htof the string1457 * returns the length of the string 1477 1458 */ 1478 1459 DWORD _ILSimpleGetText (LPCITEMIDLIST pidl, LPSTR szOut, UINT uOutSize) … … 1569 1550 case PT_FOLDER1: 1570 1551 case PT_VALUE: 1571 case PT_IESPECIAL: 1552 case PT_IESPECIAL1: 1553 case PT_IESPECIAL2: 1572 1554 return (LPSTR)&(pdata->u.file.szNames); 1573 1555 … … 1597 1579 case PT_FOLDER: 1598 1580 case PT_VALUE: 1599 case PT_IESPECIAL: 1581 case PT_IESPECIAL1: 1582 case PT_IESPECIAL2: 1600 1583 return (LPSTR)(pdata->u.file.szNames + strlen (pdata->u.file.szNames) + 1); 1601 1584 -
trunk/src/shell32/pidl.h
r4121 r5618 1 /* $Id: pidl.h,v 1.6 2000-08-30 13:50:55 sandervl Exp $ */2 1 /* 3 2 * internal pidl functions … … 76 75 #define PT_COMP 0x42 77 76 #define PT_NETWORK 0x47 78 #define PT_IESPECIAL 0xb1 77 #define PT_IESPECIAL1 0x61 78 #define PT_IESPECIAL2 0xb1 79 79 #define PT_SHARE 0xc3 80 80 … … 129 129 130 130 BOOL _ILGetFileDateTime (LPCITEMIDLIST pidl, FILETIME *ft); 131 DWORD _ILGetDrive (LPCITEMIDLIST, LPSTR, UINT 16);131 DWORD _ILGetDrive (LPCITEMIDLIST, LPSTR, UINT); 132 132 133 133 /* … … 145 145 * simple pidls from strings 146 146 */ 147 LPITEMIDLIST _ILCreate (PIDLTYPE,LPCVOID,UINT 16);147 LPITEMIDLIST _ILCreate (PIDLTYPE,LPCVOID,UINT); 148 148 149 149 LPITEMIDLIST _ILCreateDesktop (void); … … 170 170 * debug helper 171 171 */ 172 #ifdef __WIN32OS2__173 #ifdef DEBUG174 void pdump (LPCITEMIDLIST pidl);175 #else176 #define pdump(pidl)177 #endif178 //CB: needed in release build179 BOOL pcheck (LPCITEMIDLIST pidl);180 #else181 172 void pdump (LPCITEMIDLIST pidl); 182 173 BOOL pcheck (LPCITEMIDLIST pidl); 183 #endif184 174 185 175 /* -
trunk/src/shell32/sh.cpp
r4032 r5618 1 /* $Id: sh.cpp,v 1.1 1 2000-08-18 02:01:18 phallerExp $ */1 /* $Id: sh.cpp,v 1.12 2001-04-28 13:33:45 sandervl Exp $ */ 2 2 3 3 /* … … 320 320 } 321 321 322 323 /*****************************************************************************324 * Name : HRESULT SHRegDeleteKeyA325 * Purpose :326 * Parameters:327 * Variables :328 * Result :329 * Remark : SHELL32.513330 * Status : UNTESTED STUB331 *332 * Author : Patrick Haller [Tue, 1999/06/09 20:02]333 *****************************************************************************/334 335 ODINFUNCTION2(HRESULT, SHRegDeleteKeyA,336 HKEY, hkey,337 LPSTR, lpszKey)338 {339 return RegDeleteKeyA(hkey,340 lpszKey);341 }342 -
trunk/src/shell32/shell32.def
r4809 r5618 1 ; $Id: shell32.def,v 1.3 4 2000-12-16 22:53:43 birdExp $1 ; $Id: shell32.def,v 1.35 2001-04-28 13:33:45 sandervl Exp $ 2 2 3 3 ; Based on Windows 95 … … 80 80 Shell_GetImageList = _Shell_GetImageList@8 @71 81 81 Shell_GetCachedImageIndex = _Shell_GetCachedImageIndexAW@12 @72 82 Shell_GetCachedImageIndexW = _Shell_GetCachedImageIndexW@12 83 Shell_GetCachedImageIndexA = _Shell_GetCachedImageIndexA@12 82 Shell_GetCachedImageIndexW = _Shell_GetCachedImageIndexW@12 @1572 83 Shell_GetCachedImageIndexA = _Shell_GetCachedImageIndexA@12 @1573 84 84 SHShellFolderView_Message = _SHShellFolderView_Message@12 @73 85 85 SHCreateStdEnumFmtEtc = _SHCreateStdEnumFmtEtc@12 @74 … … 176 176 SHCreateDirectory = _SHCreateDirectory@8 @165 177 177 ; CallCPLEntry16 = _CallCPLEntry16@? @166 178 ; SHAddFromPropSheetExtArray = _SHAddFromPropSheetExtArray@?@167179 ; SHCreatePropSheetExtArray = _SHCreatePropSheetExtArray@?@168180 ; SHDestroyPropSheetExtArray = _SHDestroyPropSheetExtArray@?@169181 ; SHReplaceFromPropSheetExtArray = _SHReplaceFromPropSheetExtArray@?@170178 SHAddFromPropSheetExtArray = _SHAddFromPropSheetExtArray@12 @167 179 SHCreatePropSheetExtArray = _SHCreatePropSheetExtArray@12 @168 180 SHDestroyPropSheetExtArray = _SHDestroyPropSheetExtArray@4 @169 181 SHReplaceFromPropSheetExtArray = _SHReplaceFromPropSheetExtArray@16 @170 182 182 PathCleanupSpec = _PathCleanupSpecAW@8 @171 183 183 ; SHCreateLinks = _SHCreateLinks@? @172 … … 320 320 StrCpyNA = _lstrcpynA@12 @309 321 321 StrCpyNW = _lstrcpynW@12 @310 322 ; StrNCmpA = _StrNCmpA@?@311323 ; StrNCmpIA = _StrNCmpIA@?@312324 ; StrNCmpIW = _StrNCmpIW@?@313325 ; StrNCmpW = _StrNCmpW@?@314322 StrNCmpA = _StrCmpNA@12 @311 323 StrNCmpIA = _StrCmpNIA@12 @312 324 StrNCmpIW = _StrCmpNIW@12 @313 325 StrNCmpW = _StrCmpNW@12 @314 326 326 StrNCpyA = _lstrcpynA@12 @315 327 327 StrNCpyW = _lstrcpynW@12 @316 328 328 StrRChrA = _StrRChrA@12 @317 329 ; StrRChrIA = _StrRChrIA@?@318330 ; StrRChrIW = _StrRChrIW@?@319329 ; StrRChrIA = _StrRChrIA@8 @318 330 ; StrRChrIW = _StrRChrIW@8 @319 331 331 StrRChrW = _StrRChrW@12 @320 332 332 ; StrRStrA = _StrRStrA@? @321 333 ; StrRStrIA = _StrRStrIA@?@322334 ; StrRStrIW = _StrRStrIW@?@323333 ; StrRStrIA = _StrRStrIA@8 @322 334 ; StrRStrIW = _StrRStrIW@8 @323 335 335 ; StrRStrW = _StrRStrW@? @324 336 336 StrStrA = _StrStrA@8 @325 … … 349 349 SHRegDeleteKeyA = _SHRegDeleteKeyA@8 @513 ;? 350 350 SHAllocShared = _SHAllocShared@12 @520 351 SHInitRestricted = _SHInitRestricted@8 351 SHInitRestricted = _SHInitRestricted@8 @1521 352 352 SHLockShared = _SHLockShared@8 @521 353 353 SHUnlockShared = _SHUnlockShared@4 @522 … … 377 377 SHGetSpecialFolderPathA = _SHGetSpecialFolderPathA@16 @690 378 378 379 SHGetSettings = _SHGetSettings@ 12@691379 SHGetSettings = _SHGetSettings@8 @691 380 380 381 381 ; … … 390 390 391 391 DllGetVersion = _SHELL32_DllGetVersion@4 @1220 392 DllCanUnloadNow = _SHELL32_DllCanUnloadNow@0 @1221 392 393 393 394 _StrFormatByteSizeA@12 @1041 -
trunk/src/shell32/shell32_main.c
r4121 r5618 1 /* $Id: shell32_main.c,v 1. 1 2000-08-30 13:52:54sandervl Exp $ */1 /* $Id: shell32_main.c,v 1.2 2001-04-28 13:33:45 sandervl Exp $ */ 2 2 /* 3 3 * Shell basics … … 89 89 } 90 90 91 /*************************************************************************92 * Control_RunDLL [SHELL32.12]93 *94 * Wild speculation in the following!95 *96 * http://premium.microsoft.com/msdn/library/techart/msdn193.htm97 */98 99 void WINAPI Control_RunDLL( HWND hwnd, LPCVOID code, LPCSTR cmd, DWORD arg4 )100 {101 FIXME("(0x%08x, %p, %s, 0x%08lx): stub\n", hwnd, code,102 debugstr_a(cmd), arg4);103 }104 91 105 92 /************************************************************************* … … 130 117 psfi->szTypeName[0] = '\0'; 131 118 psfi->iIcon = 0; 119 120 if (flags & SHGFI_EXETYPE) { 121 BOOL status = FALSE; 122 HANDLE hfile; 123 DWORD BinaryType; 124 IMAGE_DOS_HEADER mz_header; 125 IMAGE_NT_HEADERS nt; 126 DWORD len; 127 char magic[4]; 128 129 if (flags != SHGFI_EXETYPE) return 0; 130 131 status = GetBinaryTypeA (path, &BinaryType); 132 if (!status) return 0; 133 if ((BinaryType == SCS_DOS_BINARY) 134 || (BinaryType == SCS_PIF_BINARY)) return 0x4d5a; 135 136 hfile = CreateFileA( path, GENERIC_READ, FILE_SHARE_READ, 137 NULL, OPEN_EXISTING, 0, 0 ); 138 if ( hfile == INVALID_HANDLE_VALUE ) return 0; 139 140 /* The next section is adapted from MODULE_GetBinaryType, as we need 141 * to examine the image header to get OS and version information. We 142 * know from calling GetBinaryTypeA that the image is valid and either 143 * an NE or PE, so much error handling can be omitted. 144 * Seek to the start of the file and read the header information. 145 */ 146 147 SetFilePointer( hfile, 0, NULL, SEEK_SET ); 148 ReadFile( hfile, &mz_header, sizeof(mz_header), &len, NULL ); 149 150 SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET ); 151 ReadFile( hfile, magic, sizeof(magic), &len, NULL ); 152 if ( *(DWORD*)magic == IMAGE_NT_SIGNATURE ) 153 { 154 SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET ); 155 ReadFile( hfile, &nt, sizeof(nt), &len, NULL ); 156 CloseHandle( hfile ); 157 if (nt.OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI) { 158 return IMAGE_NT_SIGNATURE 159 | (nt.OptionalHeader.MajorSubsystemVersion << 24) 160 | (nt.OptionalHeader.MinorSubsystemVersion << 16); 161 } 162 return IMAGE_NT_SIGNATURE; 163 } 164 else if ( *(WORD*)magic == IMAGE_OS2_SIGNATURE ) 165 { 166 IMAGE_OS2_HEADER ne; 167 SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET ); 168 ReadFile( hfile, &ne, sizeof(ne), &len, NULL ); 169 CloseHandle( hfile ); 170 if (ne.ne_exetyp == 2) return IMAGE_OS2_SIGNATURE 171 | (ne.ne_expver << 16); 172 return 0; 173 } 174 CloseHandle( hfile ); 175 return 0; 176 } 177 132 178 133 179 /* translate the path into a pidl only when SHGFI_USEFILEATTRIBUTES in not specified … … 259 305 /* icon handle */ 260 306 if (SUCCEEDED(hr) && (flags & SHGFI_ICON)) 261 psfi->hIcon = pImageList_GetIcon((flags & SHGFI_LARGEICON) ? ShellBigIconList:ShellSmallIconList, psfi->iIcon, ILD_NORMAL); 262 263 264 if (flags & SHGFI_EXETYPE) 265 FIXME("type of executable, stub\n"); 307 psfi->hIcon = ImageList_GetIcon((flags & SHGFI_LARGEICON) ? ShellBigIconList:ShellSmallIconList, psfi->iIcon, ILD_NORMAL); 266 308 267 309 if (flags & (SHGFI_UNKNOWN1 | SHGFI_UNKNOWN2 | SHGFI_UNKNOWN3)) … … 280 322 #endif 281 323 return ret; 282 } 283 324 } 284 325 /************************************************************************* 285 326 * SHGetFileInfoW [SHELL32.@] … … 289 330 SHFILEINFOW *psfi, UINT sizeofpsfi, 290 331 UINT flags ) 291 { FIXME("(%s,0x%lx,%p,0x%x,0x%x)\n", 292 debugstr_w(path),dwFileAttributes,psfi,sizeofpsfi,flags); 293 return 0; 332 { 333 INT len; 334 LPSTR temppath; 335 DWORD ret; 336 SHFILEINFOA temppsfi; 337 338 len = WideCharToMultiByte(CP_ACP, 0, path, -1, NULL, 0, NULL, NULL); 339 temppath = HeapAlloc(GetProcessHeap(), 0, len); 340 WideCharToMultiByte(CP_ACP, 0, path, -1, temppath, len, NULL, NULL); 341 342 WideCharToMultiByte(CP_ACP, 0, psfi->szDisplayName, -1, temppsfi.szDisplayName, 343 sizeof(temppsfi.szDisplayName), NULL, NULL); 344 WideCharToMultiByte(CP_ACP, 0, psfi->szTypeName, -1, temppsfi.szTypeName, 345 sizeof(temppsfi.szTypeName), NULL, NULL); 346 347 ret = SHGetFileInfoA(temppath, dwFileAttributes, &temppsfi, sizeof(temppsfi), flags); 348 349 HeapFree(GetProcessHeap(), 0, temppath); 350 351 return ret; 294 352 } 295 353 … … 808 866 * 809 867 */ 810 void (* WINAPI pDLLInitComctl)(LPVOID); 811 INT (* WINAPI pImageList_AddIcon) (HIMAGELIST himl, HICON hIcon); 812 INT (* WINAPI pImageList_ReplaceIcon) (HIMAGELIST, INT, HICON); 813 HIMAGELIST (* WINAPI pImageList_Create) (INT,INT,UINT,INT,INT); 814 BOOL (* WINAPI pImageList_Draw) (HIMAGELIST himl, int i, HDC hdcDest, int x, int y, UINT fStyle); 815 HICON (* WINAPI pImageList_GetIcon) (HIMAGELIST, INT, UINT); 816 INT (* WINAPI pImageList_GetImageCount)(HIMAGELIST); 817 COLORREF (* WINAPI pImageList_SetBkColor)(HIMAGELIST, COLORREF); 868 void (* WINAPI pDLLInitComctl)(LPVOID); 818 869 819 870 LPVOID (* WINAPI pCOMCTL32_Alloc) (INT); 820 871 BOOL (* WINAPI pCOMCTL32_Free) (LPVOID); 821 872 822 HDPA (* WINAPI pDPA_Create) (INT);823 INT (* WINAPI pDPA_InsertPtr) (const HDPA, INT, LPVOID);824 BOOL (* WINAPI pDPA_Sort) (const HDPA, PFNDPACOMPARE, LPARAM);825 LPVOID (* WINAPI pDPA_GetPtr) (const HDPA, INT);826 BOOL (* WINAPI pDPA_Destroy) (const HDPA);827 INT (* WINAPI pDPA_Search) (const HDPA, LPVOID, INT, PFNDPACOMPARE, LPARAM, UINT);828 LPVOID (* WINAPI pDPA_DeletePtr) (const HDPA hdpa, INT i);829 830 /* user32 */831 HICON (* WINAPI pLookupIconIdFromDirectoryEx)(LPBYTE dir, BOOL bIcon, INT width, INT height, UINT cFlag);832 HICON (* WINAPI pCreateIconFromResourceEx)(LPBYTE bits,UINT cbSize, BOOL bIcon, DWORD dwVersion, INT width, INT height,UINT cFlag);833 834 873 static HINSTANCE hComctl32; 835 874 static INT shell32_RefCount = 0; … … 837 876 LONG shell32_ObjCount = 0; 838 877 HINSTANCE shell32_hInstance = 0; 839 HMODULE huser32 = 0;840 878 HIMAGELIST ShellSmallIconList = 0; 841 879 HIMAGELIST ShellBigIconList = 0; … … 861 899 shell32_hInstance = hinstDLL; 862 900 hComctl32 = GetModuleHandleA("COMCTL32.DLL"); 863 if(!huser32) huser32 = GetModuleHandleA("USER32.DLL");864 901 DisableThreadLibraryCalls(shell32_hInstance); 865 902 866 if (!hComctl32 || !huser32)903 if (!hComctl32) 867 904 { 868 905 ERR("P A N I C SHELL32 loading failed\n"); … … 871 908 872 909 /* comctl32 */ 873 pDLLInitComctl=(void*)GetProcAddress(hComctl32,"InitCommonControlsEx");874 pImageList_Create=(void*)GetProcAddress(hComctl32,"ImageList_Create");875 pImageList_AddIcon=(void*)GetProcAddress(hComctl32,"ImageList_AddIcon");876 pImageList_ReplaceIcon=(void*)GetProcAddress(hComctl32,"ImageList_ReplaceIcon");877 pImageList_GetIcon=(void*)GetProcAddress(hComctl32,"ImageList_GetIcon");878 pImageList_GetImageCount=(void*)GetProcAddress(hComctl32,"ImageList_GetImageCount");879 pImageList_Draw=(void*)GetProcAddress(hComctl32,"ImageList_Draw");880 pImageList_SetBkColor=(void*)GetProcAddress(hComctl32,"ImageList_SetBkColor");881 910 pCOMCTL32_Alloc=(void*)GetProcAddress(hComctl32, (LPCSTR)71L); 882 911 pCOMCTL32_Free=(void*)GetProcAddress(hComctl32, (LPCSTR)73L); 883 pDPA_Create=(void*)GetProcAddress(hComctl32, (LPCSTR)328L);884 pDPA_Destroy=(void*)GetProcAddress(hComctl32, (LPCSTR)329L);885 pDPA_GetPtr=(void*)GetProcAddress(hComctl32, (LPCSTR)332L);886 pDPA_InsertPtr=(void*)GetProcAddress(hComctl32, (LPCSTR)334L);887 pDPA_DeletePtr=(void*)GetProcAddress(hComctl32, (LPCSTR)336L);888 pDPA_Sort=(void*)GetProcAddress(hComctl32, (LPCSTR)338L);889 pDPA_Search=(void*)GetProcAddress(hComctl32, (LPCSTR)339L);890 /* user32 */891 pLookupIconIdFromDirectoryEx=(void*)GetProcAddress(huser32,"LookupIconIdFromDirectoryEx");892 pCreateIconFromResourceEx=(void*)GetProcAddress(huser32,"CreateIconFromResourceEx");893 912 894 913 /* initialize the common controls */ 895 if (pDLLInitComctl) 896 { 897 pDLLInitComctl(NULL); 898 } 914 InitCommonControlsEx(NULL); 899 915 900 916 SIC_Initialize(); -
trunk/src/shell32/shell32_main.h
r5576 r5618 1 /* $Id: shell32_main.h,v 1. 8 2001-04-23 10:47:23sandervl Exp $ */1 /* $Id: shell32_main.h,v 1.9 2001-04-28 13:33:45 sandervl Exp $ */ 2 2 /* 3 3 * internal Shell32 Library definitions … … 17 17 #include "wine/obj_shelllink.h" 18 18 #include "wine/obj_extracticon.h" 19 #include "wine/obj_oleview.h" 19 20 #ifdef __WIN32OS2__ 20 21 #include <heapstring.h> … … 35 36 * pointer to functions dynamically loaded 36 37 */ 37 extern void (* WINAPI pDLLInitComctl)(LPVOID);38 extern INT (* WINAPI pImageList_AddIcon) (HIMAGELIST himl, HICON hIcon);39 extern INT (* WINAPI pImageList_ReplaceIcon) (HIMAGELIST, INT, HICON);40 extern HIMAGELIST (* WINAPI pImageList_Create) (INT,INT,UINT,INT,INT);41 extern BOOL (* WINAPI pImageList_Draw) (HIMAGELIST himl, int i, HDC hdcDest, int x, int y, UINT fStyle);42 extern HICON (* WINAPI pImageList_GetIcon) (HIMAGELIST, INT, UINT);43 extern INT (* WINAPI pImageList_GetImageCount)(HIMAGELIST);44 extern COLORREF (* WINAPI pImageList_SetBkColor)(HIMAGELIST, COLORREF);45 46 38 extern LPVOID (* WINAPI pCOMCTL32_Alloc) (INT); 47 39 extern BOOL (* WINAPI pCOMCTL32_Free) (LPVOID); 48 40 49 extern HDPA (* WINAPI pDPA_Create) (INT); 50 extern INT (* WINAPI pDPA_InsertPtr) (const HDPA, INT, LPVOID); 51 extern BOOL (* WINAPI pDPA_Sort) (const HDPA, PFNDPACOMPARE, LPARAM); 52 extern LPVOID (* WINAPI pDPA_GetPtr) (const HDPA, INT); 53 extern BOOL (* WINAPI pDPA_Destroy) (const HDPA); 54 extern INT (* WINAPI pDPA_Search) (const HDPA, LPVOID, INT, PFNDPACOMPARE, LPARAM, UINT); 55 extern LPVOID (* WINAPI pDPA_DeletePtr) (const HDPA hdpa, INT i); 41 #define pDPA_Create DPA_Create 42 #define pDPA_InsertPtr DPA_InsertPtr 43 #define pDPA_Sort DPA_Sort 44 #define pDPA_GetPtr DPA_GetPtr 45 #define pDPA_Destroy DPA_Destroy 46 #define pDPA_Search DPA_Search 47 #define pDPA_DeletePtr DPA_DeletePtr 48 56 49 #define pDPA_GetPtrCount(hdpa) (*(INT*)(hdpa)) 57 50 58 extern HICON (* WINAPI pLookupIconIdFromDirectoryEx)(LPBYTE dir, BOOL bIcon, INT width, INT height, UINT cFlag); 59 extern HICON (* WINAPI pCreateIconFromResourceEx)(LPBYTE bits,UINT cbSize, BOOL bIcon, DWORD dwVersion, INT width, INT height,UINT cFlag); 51 #define pLookupIconIdFromDirectoryEx LookupIconIdFromDirectoryEx 52 #define pCreateIconFromResourceEx CreateIconFromResourceEx 60 53 61 54 /* ole2 */ … … 68 61 */ 69 62 BOOL WINAPI Shell_GetImageList(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList); 70 71 HRESULT WINAPI StrRetToStrNA (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl);72 HRESULT WINAPI StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl);73 HRESULT WINAPI StrRetToStrN (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl);74 63 75 64 /* Iconcache */ -
trunk/src/shell32/shellfolder.h
r4121 r5618 1 /* $Id: shellfolder.h,v 1.2 2000-08-30 13:50:58 sandervl Exp $ */2 1 /* 3 2 * defines helperfunctions to manipulate the contents of a IShellFolder … … 9 8 10 9 #include "winbase.h" 11 #include "shell.h"12 10 13 11 #include "wine/obj_base.h" -
trunk/src/shell32/shellguid.c
r4121 r5618 1 /* $Id: shellguid.c,v 1. 1 2000-08-30 13:52:55sandervl Exp $ */1 /* $Id: shellguid.c,v 1.2 2001-04-28 13:33:46 sandervl Exp $ */ 2 2 /* 3 3 * Shell UID … … 22 22 #include "shlobj.h" 23 23 #include "docobj.h" 24 #include "shellfolder.h" -
trunk/src/shell32/shelllink.c
r4561 r5618 1 /* $Id: shelllink.c,v 1.2 2000-11-06 10:20:56 sandervl Exp $ */2 1 /* 3 2 * … … 6 5 * 7 6 */ 8 #ifdef __WIN32OS2__ 9 #define ICOM_CINTERFACE 1 10 #include <odin.h> 11 #endif 7 8 #include "config.h" 12 9 13 10 #include <string.h> … … 18 15 #endif 19 16 #include <errno.h> 20 #if ndef __WIN32OS2__21 # include <sys/wait.h>17 #ifdef HAVE_SYS_WAIT_H 18 # include <sys/wait.h> 22 19 #endif 23 24 20 #include "debugtools.h" 25 21 #include "winerror.h" 26 22 #include "winbase.h" 27 23 #include "winnls.h" 24 #include "winreg.h" 28 25 29 26 #include "shlobj.h" 30 #include "wine/winestring.h"31 27 #include "wine/undocshell.h" 32 28 #ifndef __WIN32OS2__ … … 38 34 #include "shell32_main.h" 39 35 #include "shlguid.h" 40 #include "file.h"41 #include "options.h"42 36 43 37 DEFAULT_DEBUG_CHANNEL(shell); … … 355 349 356 350 if (!(hModule = LoadLibraryExA(szFileName, 0, LOAD_LIBRARY_AS_DATAFILE))) 351 { 352 TRACE("LoadLibraryExA (%s) failed, error %ld\n", szFileName, GetLastError()); 357 353 goto error1; 354 } 358 355 359 356 if (nIndex) 357 { 360 358 hResInfo = FindResourceA(hModule, MAKEINTRESOURCEA(nIndex), RT_GROUP_ICONA); 359 TRACE("FindResourceA (%s) called, return 0x%x, error %ld\n", szFileName, hResInfo, GetLastError()); 360 } 361 361 else 362 362 if (EnumResourceNamesA(hModule, RT_GROUP_ICONA, &EnumResNameProc, (LONG) &hResInfo)) 363 { 364 TRACE("EnumResourceNamesA failed, error %ld\n", GetLastError()); 363 365 goto error2; 366 } 364 367 365 368 if (!hResInfo) 369 { 370 TRACE("ExtractFromEXEDLL failed, error %ld\n", GetLastError()); 366 371 goto error2; 372 } 367 373 368 374 if (!(hResData = LoadResource(hModule, hResInfo))) 375 { 376 TRACE("LoadResource failed, error %ld\n", GetLastError()); 369 377 goto error2; 378 } 370 379 if (!(pIconDir = LockResource(hResData))) 380 { 381 TRACE("LockResource failed, error %ld\n", GetLastError()); 371 382 goto error3; 383 } 372 384 373 385 for (i = 0; i < pIconDir->idCount; i++) … … 381 393 382 394 if (!(hResInfo = FindResourceA(hModule, lpName, RT_ICONA))) 395 { 396 TRACE("Second FindResourceA failed, error %ld\n", GetLastError()); 383 397 goto error2; 398 } 384 399 if (!(hResData = LoadResource(hModule, hResInfo))) 400 { 401 TRACE("Second LoadResource failed, error %ld\n", GetLastError()); 385 402 goto error2; 403 } 386 404 if (!(pIcon = LockResource(hResData))) 405 { 406 TRACE("Second LockResource failed, error %ld\n", GetLastError()); 387 407 goto error3; 408 } 388 409 389 410 if(!SaveIconResAsXPM(pIcon, szXPMFileName)) 411 { 412 TRACE("Failed saving icon as XPM, error %ld\n", GetLastError()); 390 413 goto error3; 414 } 391 415 392 416 FreeResource(hResData); … … 461 485 inline static char *get_unix_file_name( const char *dos ) 462 486 { 463 DOS_FULL_NAME path;464 465 if (! DOSFS_GetFullName( dos, FALSE, &path)) return NULL;466 return HEAP_strdupA( GetProcessHeap(), 0, path.long_name);487 char buffer[MAX_PATH]; 488 489 if (!wine_get_unix_file_name( dos, buffer, sizeof(buffer) )) return NULL; 490 return HEAP_strdupA( GetProcessHeap(), 0, buffer ); 467 491 } 468 492 … … 491 515 return NULL; 492 516 } 493 #endif //#ifndef __WIN32OS2__ 494 517 #endif //__WIN32OS2__ 495 518 496 519 static HRESULT WINAPI IPersistFile_fnSave(IPersistFile* iface, LPCOLESTR pszFileName, BOOL fRemember) … … 505 528 char *work_dir = NULL; 506 529 BOOL bDesktop; 530 HKEY hkey; 507 531 508 532 _ICOM_THIS_From_IPersistFile(IShellLinkImpl, iface); … … 522 546 return NOERROR; 523 547 #else 524 PROFILE_GetWineIniString( "wine", "ShellLinker", "", buffer, sizeof(buffer) ); 548 buffer[0] = 0; 549 if (!RegOpenKeyExA( HKEY_LOCAL_MACHINE, "Software\\Wine\\Wine\\Config\\Wine", 550 0, KEY_ALL_ACCESS, &hkey )) 551 { 552 DWORD type, count = sizeof(buffer); 553 if (RegQueryValueExA( hkey, "ShellLinker", 0, &type, buffer, &count )) buffer[0] = 0; 554 RegCloseKey( hkey ); 555 } 525 556 if (!*buffer) return NOERROR; 526 557 shell_link_app = HEAP_strdupA( GetProcessHeap(), 0, buffer ); … … 571 602 572 603 /* extract the icon */ 573 if (!(icon_name = extract_icon( This->sIcoPath ? This->sIcoPath : This->sPath, 574 This->iIcoNdx ))) goto done; 604 if (!(icon_name = extract_icon( This->sIcoPath && strlen(This->sIcoPath) ? 605 This->sIcoPath : This->sPath, 606 This->iIcoNdx ))) goto done; 607 575 608 576 609 TRACE("linker app='%s' link='%s' mode=%s path='%s' args='%s' icon='%s' workdir='%s' descr='%s'\n", … … 590 623 argv[pos++] = path_name; 591 624 argv[pos++] = bDesktop ? "--desktop" : "--menu"; 592 if (This->sArgs )625 if (This->sArgs && strlen(This->sArgs)) 593 626 { 594 627 argv[pos++] = "--args"; … … 600 633 argv[pos++] = icon_name; 601 634 } 602 if (This->sWorkDir )635 if (This->sWorkDir && strlen(This->sWorkDir)) 603 636 { 604 637 argv[pos++] = "--workdir"; 605 638 argv[pos++] = This->sWorkDir; 606 639 } 607 if (This->sDescription )640 if (This->sDescription && strlen(This->sDescription)) 608 641 { 609 642 argv[pos++] = "--descr"; … … 633 666 HeapFree( GetProcessHeap(), 0, work_dir ); 634 667 return ret; 635 #endif //__WIN32OS2__668 #endif 636 669 } 637 670 … … 1020 1053 ICOM_THIS(IShellLinkImpl, iface); 1021 1054 1022 FIXME("(%p)->()\n",This); 1023 lstrcpynA(pszDir,"c:\\", cchMaxPath); 1055 TRACE("(%p)->(%p len=%u)\n", This, pszDir, cchMaxPath); 1056 1057 lstrcpynA( pszDir, This->sWorkDir ? This->sWorkDir : "", cchMaxPath ); 1058 1024 1059 return NOERROR; 1025 1060 } … … 1041 1076 ICOM_THIS(IShellLinkImpl, iface); 1042 1077 1043 FIXME("(%p)->(%p len=%u)\n",This, pszArgs, cchMaxPath); 1044 lstrcpynA(pszArgs, "", cchMaxPath); 1078 TRACE("(%p)->(%p len=%u)\n", This, pszArgs, cchMaxPath); 1079 1080 lstrcpynA( pszArgs, This->sArgs ? This->sArgs : "", cchMaxPath ); 1081 1045 1082 return NOERROR; 1046 1083 } … … 1097 1134 ICOM_THIS(IShellLinkImpl, iface); 1098 1135 1099 FIXME("(%p)->(%p len=%u iicon=%p)\n",This, pszIconPath, cchIconPath, piIcon); 1100 lstrcpynA(pszIconPath,"shell32.dll",cchIconPath); 1101 *piIcon=1; 1136 TRACE("(%p)->(%p len=%u iicon=%p)\n", This, pszIconPath, cchIconPath, piIcon); 1137 1138 lstrcpynA( pszIconPath, This->sIcoPath ? This->sIcoPath : "", cchIconPath ); 1139 *piIcon = This->iIcoNdx; 1140 1102 1141 return NOERROR; 1103 1142 } … … 1215 1254 1216 1255 FIXME("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)\n",This, pszFile, cchMaxPath, pfd, fFlags); 1217 lstrcpynAtoW(pszFile,"c:\\foo.bar", cchMaxPath);1256 MultiByteToWideChar( CP_ACP, 0, "c:\\foo.bar", -1, pszFile, cchMaxPath ); 1218 1257 return NOERROR; 1219 1258 } … … 1241 1280 1242 1281 FIXME("(%p)->(%p len=%u)\n",This, pszName, cchMaxName); 1243 lstrcpynAtoW(pszName,"Description, FIXME",cchMaxName);1282 MultiByteToWideChar( CP_ACP, 0, "Description, FIXME", -1, pszName, cchMaxName ); 1244 1283 return NOERROR; 1245 1284 } … … 1263 1302 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1264 1303 1265 FIXME("(%p)->()\n",This); 1266 lstrcpynAtoW(pszDir,"c:\\", cchMaxPath); 1304 TRACE("(%p)->(%p len %u)\n", This, pszDir, cchMaxPath); 1305 1306 MultiByteToWideChar( CP_ACP, 0, This->sWorkDir ? This->sWorkDir : "", -1, pszDir, cchMaxPath ); 1307 1267 1308 return NOERROR; 1268 1309 } … … 1286 1327 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1287 1328 1288 FIXME("(%p)->(%p len=%u)\n",This, pszArgs, cchMaxPath); 1289 lstrcpynAtoW(pszArgs, "", cchMaxPath); 1329 TRACE("(%p)->(%p len=%u)\n", This, pszArgs, cchMaxPath); 1330 1331 MultiByteToWideChar( CP_ACP, 0, This->sArgs ? This->sArgs : "", -1, pszArgs, cchMaxPath ); 1332 1290 1333 return NOERROR; 1291 1334 } … … 1343 1386 _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); 1344 1387 1345 FIXME("(%p)->(%p len=%u iicon=%p)\n",This, pszIconPath, cchIconPath, piIcon); 1346 lstrcpynAtoW(pszIconPath,"shell32.dll",cchIconPath); 1347 *piIcon=1; 1388 TRACE("(%p)->(%p len=%u iicon=%p)\n", This, pszIconPath, cchIconPath, piIcon); 1389 1390 MultiByteToWideChar( CP_ACP, 0, This->sIcoPath ? This->sIcoPath : "", -1, pszIconPath, cchIconPath ); 1391 *piIcon = This->iIcoNdx; 1392 1348 1393 return NOERROR; 1349 1394 } -
trunk/src/shell32/shellole.c
r4121 r5618 1 /* $Id: shellole.c,v 1.1 2000-08-30 13:52:56 sandervl Exp $ */2 1 /* 3 2 * handling of SHELL32.DLL OLE-Objects … … 7 6 * 8 7 */ 9 #ifdef __WIN32OS2__10 #define ICOM_CINTERFACE 111 #include <odin.h>12 #include <winnls.h>13 #endif14 8 15 9 #include <stdlib.h> 16 10 #include <string.h> 17 11 18 #include "wine/obj_base.h" 19 #include "wine/obj_shelllink.h" 20 #include "wine/obj_shellfolder.h" 21 #include "wine/obj_shellbrowser.h" 22 #include "wine/obj_contextmenu.h" 23 #include "wine/obj_shellextinit.h" 24 #include "wine/obj_extracticon.h" 25 12 #include "shlobj.h" 13 #include "shellapi.h" 26 14 #include "shlguid.h" 27 15 #include "winreg.h" 16 #include "wine/unicode.h" 28 17 #include "winerror.h" 29 18 #include "debugtools.h" … … 159 148 { 160 149 TRACE("(%p)\n", lpmal); 161 return CoGetMalloc( 0,lpmal);150 return CoGetMalloc(MEMCTX_TASK, lpmal); 162 151 } 163 152 … … 359 348 typedef HRESULT (* CALLBACK LPFNCREATEINSTANCE)(IUnknown* pUnkOuter, REFIID riid, LPVOID* ppvObject); 360 349 #else 361 typedef HRESULT (CALLBACK *LPFNCREATEINSTANCE)(IUnknown* pUnkOuter, REFIID riid, LPVOID* ppvObject);350 typedef HRESULT CALLBACK (*LPFNCREATEINSTANCE)(IUnknown* pUnkOuter, REFIID riid, LPVOID* ppvObject); 362 351 #endif 363 352 … … 504 493 REFIID riid, 505 494 LPVOID* ppv, 506 LPFNCREATEINSTANCE lpfnCI, /* create instance callback entry */507 PLONG pcRefDll, /* ref count of the dll */508 REFIID riidInst) /* optional interface to the instance */495 LPFNCREATEINSTANCE lpfnCI, /* [in] create instance callback entry */ 496 PLONG pcRefDll, /* [in/out] ref count of the dll */ 497 REFIID riidInst) /* [in] optional interface to the instance */ 509 498 { 510 499 TRACE("\n\tIID:\t%s %p %p %p \n\tIIDIns:\t%s\n", … … 554 543 BOOL WINAPI DragQueryPoint(HDROP hDrop, POINT *p) 555 544 { 556 LPDROPFILESTRUCT lpDropFileStruct; 545 DROPFILES *lpDropFileStruct; 557 546 BOOL bRet; 558 547 559 548 TRACE("\n"); 560 549 561 lpDropFileStruct = ( LPDROPFILESTRUCT) GlobalLock(hDrop);562 563 memcpy(p,&lpDropFileStruct->ptMousePos,sizeof(POINT));564 bRet = lpDropFileStruct->f InNonClientArea;550 lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop); 551 552 *p = lpDropFileStruct->pt; 553 bRet = lpDropFileStruct->fNC; 565 554 566 555 GlobalUnlock(hDrop); … … 579 568 LPSTR lpDrop; 580 569 UINT i = 0; 581 LPDROPFILESTRUCT lpDropFileStruct = (LPDROPFILESTRUCT) GlobalLock(hDrop);570 DROPFILES *lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop); 582 571 583 572 TRACE("(%08x, %x, %p, %u)\n", hDrop,lFile,lpszFile,lLength); … … 585 574 if(!lpDropFileStruct) goto end; 586 575 587 lpDrop = (LPSTR) lpDropFileStruct + lpDropFileStruct-> lSize;576 lpDrop = (LPSTR) lpDropFileStruct + lpDropFileStruct->pFiles; 588 577 589 578 while (i++ < lFile) … … 618 607 LPWSTR lpwDrop; 619 608 UINT i = 0; 620 LPDROPFILESTRUCT lpDropFileStruct = (LPDROPFILESTRUCT) GlobalLock(hDrop);609 DROPFILES *lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop); 621 610 622 611 TRACE("(%08x, %x, %p, %u)\n", hDrop,lFile,lpszwFile,lLength); … … 624 613 if(!lpDropFileStruct) goto end; 625 614 626 lpwDrop = (LPWSTR) lpDropFileStruct + lpDropFileStruct-> lSize;615 lpwDrop = (LPWSTR) lpDropFileStruct + lpDropFileStruct->pFiles; 627 616 628 617 i = 0; … … 637 626 } 638 627 639 i = lstrlenW(lpwDrop);628 i = strlenW(lpwDrop); 640 629 i++; 641 630 if ( !lpszwFile) goto end; /* needed buffer size */ -
trunk/src/shell32/shellord.c
r4561 r5618 1 /* $Id: shellord.c,v 1.2 2000-11-06 10:20:56 sandervl Exp $ */2 1 /* 3 2 * The parameters of many functions changes between different OS versions … … 7 6 * 1998 Jürgen Schmied 8 7 */ 9 #ifdef __WIN32OS2__10 #define ICOM_CINTERFACE 111 #include <odin.h>12 #endif13 8 #include <string.h> 14 9 #include <stdio.h> … … 122 117 * the registry path are for win98 (tested) 123 118 * and possibly are the same in nt40 124 */ 125 void WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask, DWORD dwx) 119 * 120 */ 121 VOID WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask) 126 122 { 127 123 HKEY hKey; … … 129 125 DWORD dwDataSize = sizeof (DWORD); 130 126 131 TRACE("(%p 0x%08lx 0x%08lx)\n",lpsfs,dwMask, dwx);127 TRACE("(%p 0x%08lx)\n",lpsfs,dwMask); 132 128 133 129 if (RegCreateKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", … … 232 228 ...) 233 229 { 234 WCHAR szText[100],szTitle[100] ,szTemp[256];235 LPCWSTR pszText = szText, pszTitle = szTitle;230 WCHAR szText[100],szTitle[100]; 231 LPCWSTR pszText = szText, pszTitle = szTitle, pszTemp; 236 232 va_list args; 233 int ret; 234 237 235 va_start(args, uType); 238 236 /* wvsprintfA(buf,fmt, args); */ … … 242 240 243 241 if (!HIWORD(lpCaption)) 244 LoadStringW(hInstance, (DWORD)lpCaption, szTitle, 100);242 LoadStringW(hInstance, (DWORD)lpCaption, szTitle, sizeof(szTitle)/sizeof(szTitle[0])); 245 243 else 246 244 pszTitle = lpCaption; 247 245 248 246 if (!HIWORD(lpText)) 249 LoadStringW(hInstance, (DWORD)lpText, szText, 100);247 LoadStringW(hInstance, (DWORD)lpText, szText, sizeof(szText)/sizeof(szText[0])); 250 248 else 251 249 pszText = lpText; 252 250 253 FormatMessageW(FORMAT_MESSAGE_ FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY,254 szText, 0, 0, szTemp, 256, (LPDWORD)args);251 FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING, 252 pszText, 0, 0, (LPWSTR)&pszTemp, 0, &args); 255 253 256 254 va_end(args); 257 255 258 return MessageBoxW(hWnd,szTemp,szTitle,uType); 256 ret = MessageBoxW(hWnd,pszTemp,pszTitle,uType); 257 LocalFree((HLOCAL)pszTemp); 258 return ret; 259 259 } 260 260 … … 270 270 ...) 271 271 { 272 char szText[100],szTitle[100] ,szTemp[256];273 LPCSTR pszText = szText, pszTitle = szTitle;272 char szText[100],szTitle[100]; 273 LPCSTR pszText = szText, pszTitle = szTitle, pszTemp; 274 274 va_list args; 275 int ret; 276 275 277 va_start(args, uType); 276 278 /* wvsprintfA(buf,fmt, args); */ … … 280 282 281 283 if (!HIWORD(lpCaption)) 282 LoadStringA(hInstance, (DWORD)lpCaption, szTitle, 100);284 LoadStringA(hInstance, (DWORD)lpCaption, szTitle, sizeof(szTitle)); 283 285 else 284 286 pszTitle = lpCaption; 285 287 286 288 if (!HIWORD(lpText)) 287 LoadStringA(hInstance, (DWORD)lpText, szText, 100);289 LoadStringA(hInstance, (DWORD)lpText, szText, sizeof(szText)); 288 290 else 289 291 pszText = lpText; 290 292 291 FormatMessageA(FORMAT_MESSAGE_ FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY,292 szText, 0, 0, szTemp, 256, (LPDWORD)args);293 FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING, 294 pszText, 0, 0, (LPSTR)&pszTemp, 0, &args); 293 295 294 296 va_end(args); 295 297 296 return MessageBoxA(hWnd,szTemp,szTitle,uType); 298 ret = MessageBoxA(hWnd,pszTemp,pszTitle,uType); 299 LocalFree((HLOCAL)pszTemp); 300 return ret; 297 301 } 298 302 … … 456 460 */ 457 461 HRESULT WINAPI SHCreateShellFolderViewEx( 458 LPCSHELLFOLDERVIEWINFO psvcbi, /* [in ] shelltemplate struct*/459 LPSHELLVIEW* ppv) /* [out] IShellView pointer*/462 LPCSHELLFOLDERVIEWINFO psvcbi, /* [in] shelltemplate struct */ 463 LPSHELLVIEW* ppv) /* [out] IShellView pointer */ 460 464 { 461 465 IShellView * psf; … … 878 882 return 0; 879 883 } 880 /*************************************************************************881 * Control_FillCache_RunDLL [SHELL32.8]882 *883 */884 HRESULT WINAPI Control_FillCache_RunDLL(HWND hWnd, HANDLE hModule, DWORD w, DWORD x)885 { FIXME("0x%04x 0x%04x 0x%04lx 0x%04lx stub\n",hWnd, hModule,w,x);886 return 0;887 }888 /*************************************************************************889 * RunDLL_CallEntry16 [SHELL32.122]890 * the name is propably wrong891 */892 HRESULT WINAPI RunDLL_CallEntry16(DWORD v, DWORD w, DWORD x, DWORD y, DWORD z)893 { FIXME("0x%04lx 0x%04lx 0x%04lx 0x%04lx 0x%04lx stub\n",v,w,x,y,z);894 return 0;895 }896 884 897 885 /************************************************************************ … … 980 968 return 0; 981 969 } 970 971 /************************************************************************* 972 * SHAddFromPropSheetExtArray [SHELL32] 973 */ 974 DWORD WINAPI SHAddFromPropSheetExtArray(DWORD a, DWORD b, DWORD c) 975 { 976 FIXME("(%08lx,%08lx,%08lx)stub\n", a, b, c); 977 return 0; 978 } 979 980 /************************************************************************* 981 * SHCreatePropSheetExtArray [SHELL32] 982 */ 983 DWORD WINAPI SHCreatePropSheetExtArray(DWORD a, LPCSTR b, DWORD c) 984 { 985 FIXME("(%08lx,%s,%08lx)stub\n", a, debugstr_a(b), c); 986 return 0; 987 } 988 989 /************************************************************************* 990 * SHReplaceFromPropSheetExtArray [SHELL] 991 */ 992 DWORD WINAPI SHReplaceFromPropSheetExtArray(DWORD a, DWORD b, DWORD c, DWORD d) 993 { 994 FIXME("(%08lx,%08lx,%08lx,%08lx)stub\n", a, b, c, d); 995 return 0; 996 } 997 998 /************************************************************************* 999 * SHDestroyPropSheetExtArray [SHELL32] 1000 */ 1001 DWORD WINAPI SHDestroyPropSheetExtArray(DWORD a) 1002 { 1003 FIXME("(%08lx)stub\n", a); 1004 return 0; 1005 } -
trunk/src/shell32/shellpath.c
r5461 r5618 1 /* $Id: shellpath.c,v 1.4 2001-04-03 18:42:42 sandervl Exp $ */2 1 /* 3 2 * Path Functions … … 6 5 * 7 6 */ 8 #ifdef __WIN32OS2__9 #define ICOM_CINTERFACE 110 #include <odin.h>11 #endif12 13 7 #include <string.h> 14 8 #include <ctype.h> 15 9 #include "debugtools.h" 10 #include "windef.h" 16 11 #include "winnls.h" 17 12 #include "winreg.h" … … 19 14 #include "shlobj.h" 20 15 #include "shell32_main.h" 21 #include "windef.h"22 #include "options.h"23 #include "wine/winestring.h"24 16 #include "wine/undocshell.h" 25 17 #include "wine/unicode.h" … … 28 20 DEFAULT_DEBUG_CHANNEL(shell); 29 21 30 #define isSlash(x) ((x)=='\\' || (x)=='/')31 22 /* 32 23 ########## Combining and Constructing paths ########## … … 347 338 348 339 for(i=0; lpszExtensions[i]; i++) 340 #ifdef __WIN32OS2__ 349 341 if (!lstrcmpiW(lpszExtension,lpszExtensions[i])) return TRUE; 350 342 #else 343 if (!strcmpiW(lpszExtension,lpszExtensions[i])) return TRUE; 344 #endif 351 345 return FALSE; 352 346 } … … 485 479 486 480 #ifdef __WIN32OS2__ 487 /************************************************************************* 488 * PathYetAnotherMakeUniqueNameA [SHELL32.75] 489 * 490 * NOTES 491 * exported by ordinal 492 */ 481 493 482 BOOL WINAPI PathYetAnotherMakeUniqueNameW( 494 483 LPWSTR lpszBuffer, … … 497 486 LPCWSTR lpszLongName) 498 487 { 499 FIXME(" (%p,%p, %p ,%p):stub.\n",488 FIXME("PathYetAnotherMakeUniqueNameW (%p,%p, %p ,%p):stub.\n", 500 489 lpszBuffer, lpszPathName, lpszShortName, lpszLongName); 501 490 return TRUE; … … 514 503 #endif 515 504 505 516 506 /* 517 507 ########## cleaning and resolving paths ########## … … 531 521 * PathCleanupSpecAW [SHELL32] 532 522 */ 533 DWORD WINAPI PathCleanupSpecAW (LP VOID x, LPVOID y)523 DWORD WINAPI PathCleanupSpecAW (LPCVOID x, LPVOID y) 534 524 { 535 525 FIXME("(%p, %p) stub\n",x,y); … … 668 658 */ 669 659 670 static char * szSHFolders = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"; 671 static char * szSHUserFolders = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders"; 660 static const char * const szSHFolders = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"; 661 static const char * const szSHUserFolders = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders"; 662 static const char * const szSetup = "Software\\Microsoft\\Windows\\CurrentVersion\\Setup"; 663 static const char * const szCurrentVersion = "Software\\Microsoft\\Windows\\CurrentVersion"; 672 664 #if 0 673 static c har *szEnvUserProfile = "%USERPROFILE%";674 static c har *szEnvSystemRoot = "%SYSTEMROOT%";665 static const char * const szEnvUserProfile = "%USERPROFILE%"; 666 static const char * const szEnvSystemRoot = "%SYSTEMROOT%"; 675 667 #endif 668 669 typedef struct 670 { 671 DWORD dwFlags; 672 HKEY hRootKey; 673 LPCSTR szValueName; 674 LPCSTR szDefaultPath; /* fallback string; sub dir of windows directory */ 675 } CSIDL_DATA; 676 677 #define CSIDL_MYFLAG_SHFOLDER 1 678 #define CSIDL_MYFLAG_SETUP 2 679 #define CSIDL_MYFLAG_CURRVER 4 680 #define CSIDL_MYFLAG_RELATIVE 8 681 682 #define HKLM HKEY_LOCAL_MACHINE 683 #define HKCU HKEY_CURRENT_USER 684 static const CSIDL_DATA CSIDL_Data[] = 685 { 686 { /* CSIDL_DESKTOP */ 687 9, HKCU, 688 "Desktop", 689 "Desktop" 690 }, 691 { /* CSIDL_INTERNET (??) */ 692 0, 1, /* FIXME */ 693 NULL, 694 NULL, 695 }, 696 { /* CSIDL_PROGRAMS */ 697 9, HKCU, 698 "Programs", 699 "Start Menu\\Programs" 700 }, 701 { /* CSIDL_CONTROLS (.CPL files) */ 702 10, HKLM, 703 "SysDir", 704 "SYSTEM" 705 }, 706 { /* CSIDL_PRINTERS */ 707 10, HKLM, 708 "SysDir", 709 "SYSTEM" 710 }, 711 { /* CSIDL_PERSONAL */ 712 1, HKCU, 713 "Personal", 714 "My Documents" 715 }, 716 { /* CSIDL_FAVORITES */ 717 9, HKCU, 718 "Favorites", 719 "Favorites" 720 }, 721 { /* CSIDL_STARTUP */ 722 9, HKCU, 723 "StartUp", 724 "Start Menu\\Programs\\StartUp" 725 }, 726 { /* CSIDL_RECENT */ 727 9, HKCU, 728 "Recent", 729 "Recent" 730 }, 731 { /* CSIDL_SENDTO */ 732 9, HKCU, 733 "SendTo", 734 "SendTo" 735 }, 736 { /* CSIDL_BITBUCKET (is this c:\recycled ?) */ 737 0, 1, /* FIXME */ 738 NULL, 739 "recycled" 740 }, 741 { /* CSIDL_STARTMENU */ 742 9, HKCU, 743 "Start Menu", 744 "Start Menu" 745 }, 746 { /* not known */ 747 0, 0, 748 NULL, 749 NULL, 750 }, 751 { /* not known */ 752 0, 0, 753 NULL, 754 NULL, 755 }, 756 { /* not known */ 757 0, 0, 758 NULL, 759 NULL, 760 }, 761 { /* not known */ 762 0, 0, 763 NULL, 764 NULL, 765 }, 766 { /* CSIDL_DESKTOPDIRECTORY */ 767 9, HKCU, 768 "Desktop", 769 "Desktop" 770 }, 771 { /* CSIDL_DRIVES */ 772 0, 1, /* FIXME */ 773 NULL, 774 "My Computer" 775 }, 776 { /* CSIDL_NETWORK */ 777 0, 1, /* FIXME */ 778 NULL, 779 "Network Neighborhood" 780 }, 781 { /* CSIDL_NETHOOD */ 782 9, HKCU, 783 "NetHood", 784 "NetHood" 785 }, 786 { /* CSIDL_FONTS */ 787 9, HKCU, 788 "Fonts", 789 "Fonts" 790 }, 791 { /* CSIDL_TEMPLATES */ 792 9, HKCU, 793 "Templates", 794 "ShellNew" 795 }, 796 { /* CSIDL_COMMON_STARTMENU */ 797 9, HKLM, 798 "Common Start Menu", 799 "Start Menu" 800 }, 801 { /* CSIDL_COMMON_PROGRAMS */ 802 9, HKLM, 803 "Common Programs", 804 "" 805 }, 806 { /* CSIDL_COMMON_STARTUP */ 807 9, HKLM, 808 "Common StartUp", 809 "All Users\\Start Menu\\Programs\\StartUp" 810 }, 811 { /* CSIDL_COMMON_DESKTOPDIRECTORY */ 812 9, HKLM, 813 "Common Desktop", 814 "Desktop" 815 }, 816 { /* CSIDL_APPDATA */ 817 9, HKCU, 818 "AppData", 819 "Application Data" 820 }, 821 { /* CSIDL_PRINTHOOD */ 822 9, HKCU, 823 "PrintHood", 824 "PrintHood" 825 }, 826 { /* not known */ 827 0, 0, 828 NULL, 829 NULL, 830 }, 831 { /* CSIDL_ALTSTARTUP */ 832 0, 1, /* FIXME */ 833 NULL, 834 NULL 835 }, 836 { /* CSIDL_COMMON_ALTSTARTUP */ 837 0, 1, /* FIXME */ 838 NULL, 839 NULL 840 }, 841 { /* CSIDL_COMMON_FAVORITES */ 842 9, HKCU, 843 "Favorites", 844 "Favorites" 845 }, 846 { /* CSIDL_INTERNET_CACHE */ 847 9, HKCU, 848 "Cache", 849 "Temporary Internet Files" 850 }, 851 { /* CSIDL_COOKIES */ 852 9, HKCU, 853 "Cookies", 854 "Cookies" 855 }, 856 { /* CSIDL_HISTORY */ 857 9, HKCU, 858 "History", 859 "History" 860 }, 861 { /* CSIDL_COMMON_APPDATA */ 862 9, HKLM, 863 "Common AppData", 864 "All Users\\Application Data" 865 }, 866 { /* CSIDL_WINDOWS */ 867 2, HKLM, 868 "WinDir", 869 "Windows" 870 }, 871 { /* CSIDL_SYSTEM */ 872 10, HKLM, 873 "SysDir", 874 "SYSTEM" 875 }, 876 { /* CSIDL_PROGRAM_FILES */ 877 4, HKLM, 878 "ProgramFilesDir", 879 "Program Files" 880 }, 881 { /* CSIDL_MYPICTURES */ 882 1, HKCU, 883 "My Pictures", 884 "My Documents\\My Pictures" 885 }, 886 { /* CSIDL_PROFILE */ 887 10, HKLM, 888 "WinDir", /* correct ? */ 889 "" 890 }, 891 { /* CSIDL_SYSTEMX86 */ 892 10, HKLM, 893 "SysDir", 894 "SYSTEM" 895 }, 896 { /* CSIDL_PROGRAM_FILESX86 */ 897 4, HKLM, 898 "ProgramFilesDir", 899 "Program Files" 900 }, 901 { /* CSIDL_PROGRAM_FILES_COMMON */ 902 4, HKLM, 903 "CommonFilesDir", 904 "Program Files\\Common Files" /* ? */ 905 }, 906 { /* CSIDL_PROGRAM_FILES_COMMONX86 */ 907 4, HKLM, 908 "CommonFilesDir", 909 "Program Files\\Common Files" /* ? */ 910 }, 911 { /* CSIDL_COMMON_TEMPLATES */ 912 0, 1, /* FIXME */ 913 NULL, 914 NULL 915 }, 916 { /* CSIDL_COMMON_DOCUMENTS */ 917 0, 1, /* FIXME */ 918 NULL, 919 NULL 920 }, 921 { /* CSIDL_COMMON_ADMINTOOLS */ 922 0, 1, /* FIXME */ 923 NULL, 924 NULL 925 }, 926 { /* CSIDL_ADMINTOOLS */ 927 9, HKCU, 928 "Administrative Tools", 929 "Start Menu\\Programs\\Administrative Tools" 930 }, 931 { /* CSIDL_CONNECTIONS */ 932 0, 1, /* FIXME */ 933 NULL, 934 NULL 935 } 936 }; 937 #undef HKCU 938 #undef HKLM 939 940 /**********************************************************************/ 676 941 677 942 BOOL WINAPI SHGetSpecialFolderPathA ( … … 681 946 BOOL bCreate) 682 947 { 683 CHAR szValueName[MAX_PATH], szDefaultPath[MAX_PATH] ;948 CHAR szValueName[MAX_PATH], szDefaultPath[MAX_PATH], szBuildPath[MAX_PATH]; 684 949 HKEY hRootKey, hKey; 685 BOOL bRelative = TRUE;950 DWORD dwFlags; 686 951 DWORD dwType, dwDisp, dwPathLen = MAX_PATH; 952 DWORD folder = csidl & CSIDL_FOLDER_MASK; 953 CHAR *p; 687 954 688 955 TRACE("0x%04x,%p,csidl=%lu,0x%04x\n", hwndOwner,szPath,csidl,bCreate); 689 956 690 /* build default values */ 691 switch(csidl) 957 if ((folder > CSIDL_CONNECTIONS) || (CSIDL_Data[folder].hRootKey == 0)) 692 958 { 693 case CSIDL_APPDATA:694 hRootKey = HKEY_CURRENT_USER;695 strcpy (szValueName, "AppData");696 strcpy (szDefaultPath, "AppData");697 break;698 699 case CSIDL_COOKIES:700 hRootKey = HKEY_CURRENT_USER;701 strcpy (szValueName, "Cookies");702 strcpy(szDefaultPath, "Cookies");703 break;704 705 case CSIDL_DESKTOPDIRECTORY:706 hRootKey = HKEY_CURRENT_USER;707 strcpy(szValueName, "Desktop");708 strcpy(szDefaultPath, "Desktop");709 break;710 711 case CSIDL_COMMON_DESKTOPDIRECTORY:712 hRootKey = HKEY_LOCAL_MACHINE;713 strcpy(szValueName, "Common Desktop");714 strcpy(szDefaultPath, "Desktop");715 break;716 717 case CSIDL_FAVORITES:718 hRootKey = HKEY_CURRENT_USER;719 strcpy(szValueName, "Favorites");720 strcpy(szDefaultPath, "Favorites");721 break;722 723 case CSIDL_FONTS:724 hRootKey = HKEY_CURRENT_USER;725 strcpy(szValueName, "Fonts");726 strcpy(szDefaultPath, "Fonts");727 break;728 729 case CSIDL_HISTORY:730 hRootKey = HKEY_CURRENT_USER;731 strcpy(szValueName, "History");732 strcpy(szDefaultPath, "History");733 break;734 735 case CSIDL_NETHOOD:736 hRootKey = HKEY_CURRENT_USER;737 strcpy(szValueName, "NetHood");738 strcpy(szDefaultPath, "NetHood");739 break;740 741 case CSIDL_INTERNET_CACHE:742 hRootKey = HKEY_CURRENT_USER;743 strcpy(szValueName, "Cache");744 strcpy(szDefaultPath, "Temporary Internet Files");745 break;746 747 case CSIDL_PERSONAL:748 hRootKey = HKEY_CURRENT_USER;749 strcpy(szValueName, "Personal");750 strcpy(szDefaultPath, "My Own Files");751 bRelative = FALSE;752 break;753 754 case CSIDL_PRINTHOOD:755 hRootKey = HKEY_CURRENT_USER;756 strcpy(szValueName, "PrintHood");757 strcpy(szDefaultPath, "PrintHood");758 break;759 760 case CSIDL_PROGRAMS:761 hRootKey = HKEY_CURRENT_USER;762 strcpy(szValueName, "Programs");763 strcpy(szDefaultPath, "Start Menu\\Programs");764 break;765 766 case CSIDL_COMMON_PROGRAMS:767 hRootKey = HKEY_LOCAL_MACHINE;768 strcpy(szValueName, "Common Programs");769 strcpy(szDefaultPath, "");770 break;771 772 case CSIDL_RECENT:773 hRootKey = HKEY_CURRENT_USER;774 strcpy(szValueName, "Recent");775 strcpy(szDefaultPath, "Recent");776 break;777 778 case CSIDL_SENDTO:779 hRootKey = HKEY_CURRENT_USER;780 strcpy(szValueName, "SendTo");781 strcpy(szDefaultPath, "SendTo");782 break;783 784 case CSIDL_STARTMENU:785 hRootKey = HKEY_CURRENT_USER;786 strcpy(szValueName, "Start Menu");787 strcpy(szDefaultPath, "Start Menu");788 break;789 790 case CSIDL_COMMON_STARTMENU:791 hRootKey = HKEY_LOCAL_MACHINE;792 strcpy(szValueName, "Common Start Menu");793 strcpy(szDefaultPath, "Start Menu");794 break;795 796 case CSIDL_STARTUP:797 hRootKey = HKEY_CURRENT_USER;798 strcpy(szValueName, "StartUp");799 strcpy(szDefaultPath, "Start Menu\\Programs\\StartUp");800 break;801 802 case CSIDL_COMMON_STARTUP:803 hRootKey = HKEY_LOCAL_MACHINE;804 strcpy(szValueName, "Common StartUp");805 strcpy(szDefaultPath, "Start Menu\\Programs\\StartUp");806 break;807 808 case CSIDL_TEMPLATES:809 hRootKey = HKEY_CURRENT_USER;810 strcpy(szValueName, "Templates");811 strcpy(szDefaultPath, "ShellNew");812 break;813 814 default:815 959 ERR("folder unknown or not allowed\n"); 816 960 return FALSE; 817 961 } 818 819 /* user shell folders */ 820 if (RegCreateKeyExA(hRootKey,szSHUserFolders,0,NULL,0,KEY_ALL_ACCESS,NULL,&hKey,&dwDisp)) return FALSE; 821 822 if (RegQueryValueExA(hKey,szValueName,NULL,&dwType,(LPBYTE)szPath,&dwPathLen)) 962 if (CSIDL_Data[folder].hRootKey == 1) 823 963 { 964 FIXME("folder unknown, please add.\n"); 965 return FALSE; 966 } 967 968 dwFlags = CSIDL_Data[folder].dwFlags; 969 hRootKey = CSIDL_Data[folder].hRootKey; 970 strcpy(szValueName, CSIDL_Data[folder].szValueName); 971 strcpy(szDefaultPath, CSIDL_Data[folder].szDefaultPath); 972 973 if (dwFlags & CSIDL_MYFLAG_SHFOLDER) 974 { 975 /* user shell folders */ 976 if (RegCreateKeyExA(hRootKey,szSHUserFolders,0,NULL,0,KEY_ALL_ACCESS,NULL,&hKey,&dwDisp)) return FALSE; 977 978 if (RegQueryValueExA(hKey,szValueName,NULL,&dwType,(LPBYTE)szPath,&dwPathLen)) 979 { 980 RegCloseKey(hKey); 981 982 /* shell folders */ 983 if (RegCreateKeyExA(hRootKey,szSHFolders,0,NULL,0,KEY_ALL_ACCESS,NULL,&hKey,&dwDisp)) return FALSE; 984 985 if (RegQueryValueExA(hKey,szValueName,NULL,&dwType,(LPBYTE)szPath,&dwPathLen)) 986 { 987 988 /* value not existing */ 989 if (dwFlags & CSIDL_MYFLAG_RELATIVE) 990 { 991 GetWindowsDirectoryA(szPath, MAX_PATH); 992 PathAddBackslashA(szPath); 993 strcat(szPath, szDefaultPath); 994 } 995 else 996 { 997 strcpy(szPath, "C:\\"); /* FIXME ??? */ 998 strcat(szPath, szDefaultPath); 999 } 1000 RegSetValueExA(hKey,szValueName,0,REG_SZ,(LPBYTE)szPath,strlen(szPath)+1); 1001 } 1002 } 824 1003 RegCloseKey(hKey); 825 826 /* shell folders */ 827 if (RegCreateKeyExA(hRootKey,szSHFolders,0,NULL,0,KEY_ALL_ACCESS,NULL,&hKey,&dwDisp)) return FALSE; 828 829 if (RegQueryValueExA(hKey,szValueName,NULL,&dwType,(LPBYTE)szPath,&dwPathLen)) 1004 } 1005 else 1006 { 1007 LPCSTR pRegPath; 1008 1009 if (dwFlags & CSIDL_MYFLAG_SETUP) 1010 pRegPath = szSetup; 1011 else 1012 if (dwFlags & CSIDL_MYFLAG_CURRVER) 1013 pRegPath = szCurrentVersion; 1014 else 830 1015 { 831 1016 ERR("folder settings broken, please correct !\n"); 1017 return FALSE; 1018 } 1019 1020 if (RegCreateKeyExA(hRootKey,pRegPath,0,NULL,0,KEY_ALL_ACCESS,NULL,&hKey,&dwDisp)) return FALSE; 1021 1022 if (RegQueryValueExA(hKey,szValueName,NULL,&dwType,(LPBYTE)szPath,&dwPathLen)) 1023 { 832 1024 /* value not existing */ 833 if ( bRelative)1025 if (dwFlags & CSIDL_MYFLAG_RELATIVE) 834 1026 { 835 1027 GetWindowsDirectoryA(szPath, MAX_PATH); … … 839 1031 else 840 1032 { 841 strcpy(szPath, "C:\\"); /* fixme??? */1033 strcpy(szPath, "C:\\"); /* FIXME ??? */ 842 1034 strcat(szPath, szDefaultPath); 843 1035 } 844 1036 RegSetValueExA(hKey,szValueName,0,REG_SZ,(LPBYTE)szPath,strlen(szPath)+1); 845 1037 } 1038 RegCloseKey(hKey); 846 1039 } 847 RegCloseKey(hKey);848 1040 849 1041 /* expand paths like %USERPROFILE% */ … … 854 1046 } 855 1047 856 /* if we don't care about existing director ys we are ready */1048 /* if we don't care about existing directories we are ready */ 857 1049 if(csidl & CSIDL_FLAG_DONT_VERIFY) return TRUE; 858 1050 859 1051 if (PathFileExistsA(szPath)) return TRUE; 860 1052 861 /* not existing but we not allowed to create it */1053 /* not existing but we are not allowed to create it */ 862 1054 if (!bCreate) return FALSE; 863 864 if (!CreateDirectoryA(szPath,NULL)) 1055 1056 /* create directory/directories */ 1057 strcpy(szBuildPath, szPath); 1058 p = strchr(szBuildPath, '\\'); 1059 while (p) 865 1060 { 866 ERR("Failed to create directory '%s'.\n", szPath); 867 return FALSE; 1061 *p = 0; 1062 if (!PathFileExistsA(szBuildPath)) 1063 { 1064 if (!CreateDirectoryA(szBuildPath,NULL)) 1065 { 1066 ERR("Failed to create directory '%s'.\n", szPath); 1067 return FALSE; 1068 } 1069 } 1070 *p = '\\'; 1071 p = strchr(p+1, '\\'); 868 1072 } 869 1073 … … 885 1089 if (SHGetSpecialFolderPathA(hwndOwner, szTemp, csidl, bCreate)) 886 1090 { 887 lstrcpynAtoW(szPath, szTemp, MAX_PATH); 888 } 1091 if (!MultiByteToWideChar( CP_ACP, 0, szTemp, -1, szPath, MAX_PATH )) 1092 szPath[MAX_PATH-1] = 0; 1093 } 889 1094 890 1095 TRACE("0x%04x,%p,csidl=%lu,0x%04x\n", hwndOwner,szPath,csidl,bCreate); … … 914 1119 HWND hwndOwner, 915 1120 int nFolder, 916 HANDLE hToken, /* FIXME: get paths for specific user */917 DWORD dwFlags, /* FIXME: SHGFP_TYPE_CURRENT|SHGFP_TYPE_DEFAULT */1121 HANDLE hToken, /* [in] FIXME: get paths for specific user */ 1122 DWORD dwFlags, /* [in] FIXME: SHGFP_TYPE_CURRENT|SHGFP_TYPE_DEFAULT */ 918 1123 LPSTR pszPath) 919 1124 { -
trunk/src/shell32/shellreg.c
r4121 r5618 1 /* $Id: shellreg.c,v 1.1 2000-08-30 13:52:56 sandervl Exp $ */2 1 /* 3 2 Shell Registry Access 4 3 */ 5 #ifdef __WIN32OS2__6 #define ICOM_CINTERFACE 17 #include <odin.h>8 #endif9 4 #include <string.h> 10 5 #include <stdio.h> … … 13 8 #include "debugtools.h" 14 9 #include "winnls.h" 15 #include "heap.h"16 10 17 11 #include "shellapi.h" … … 101 95 } 102 96 103 #ifndef __WIN32OS2__104 97 /************************************************************************* 105 98 * SHRegDeleteKeyA [SHELL32] … … 110 103 { 111 104 FIXME("hkey=0x%08x, %s\n", hkey, debugstr_a(pszSubKey)); 105 #ifdef __WIN32OS2__ 106 return RegDeleteKeyA(hkey,pszSubKey); 107 #else 112 108 return 0; 113 }114 109 #endif 110 } 115 111 116 112 /************************************************************************* … … 122 118 { 123 119 FIXME("hkey=0x%08x, %s\n", hkey, debugstr_w(pszSubKey)); 120 #ifdef __WIN32OS2__ 121 return RegDeleteKeyW(hkey,pszSubKey); 122 #else 124 123 return 0; 124 #endif 125 125 } 126 126 … … 134 134 return RegCloseKey( hkey ); 135 135 } 136 137 #ifndef __WIN32OS2__ 138 139 /* 16-bit functions */ 140 141 /* 0 and 1 are valid rootkeys in win16 shell.dll and are used by 142 * some programs. Do not remove those cases. -MM 143 */ 144 static inline void fix_win16_hkey( HKEY *hkey ) 145 { 146 if (*hkey == 0 || *hkey == 1) *hkey = HKEY_CLASSES_ROOT; 147 } 148 149 /****************************************************************************** 150 * RegOpenKey16 [SHELL.1] 151 */ 152 DWORD WINAPI RegOpenKey16( HKEY hkey, LPCSTR name, LPHKEY retkey ) 153 { 154 fix_win16_hkey( &hkey ); 155 return RegOpenKeyA( hkey, name, retkey ); 156 } 157 158 /****************************************************************************** 159 * RegCreateKey16 [SHELL.2] 160 */ 161 DWORD WINAPI RegCreateKey16( HKEY hkey, LPCSTR name, LPHKEY retkey ) 162 { 163 fix_win16_hkey( &hkey ); 164 return RegCreateKeyA( hkey, name, retkey ); 165 } 166 167 /****************************************************************************** 168 * RegCloseKey16 [SHELL.3] 169 */ 170 DWORD WINAPI RegCloseKey16( HKEY hkey ) 171 { 172 fix_win16_hkey( &hkey ); 173 return RegCloseKey( hkey ); 174 } 175 176 /****************************************************************************** 177 * RegDeleteKey16 [SHELL.4] 178 */ 179 DWORD WINAPI RegDeleteKey16( HKEY hkey, LPCSTR name ) 180 { 181 fix_win16_hkey( &hkey ); 182 return RegDeleteKeyA( hkey, name ); 183 } 184 185 /****************************************************************************** 186 * RegSetValue16 [SHELL.5] 187 */ 188 DWORD WINAPI RegSetValue16( HKEY hkey, LPCSTR name, DWORD type, LPCSTR data, DWORD count ) 189 { 190 fix_win16_hkey( &hkey ); 191 return RegSetValueA( hkey, name, type, data, count ); 192 } 193 194 /****************************************************************************** 195 * RegQueryValue16 [SHELL.6] 196 * 197 * NOTES 198 * Is this HACK still applicable? 199 * 200 * HACK 201 * The 16bit RegQueryValue doesn't handle selectorblocks anyway, so we just 202 * mask out the high 16 bit. This (not so much incidently) hopefully fixes 203 * Aldus FH4) 204 */ 205 DWORD WINAPI RegQueryValue16( HKEY hkey, LPCSTR name, LPSTR data, LPDWORD count ) 206 { 207 fix_win16_hkey( &hkey ); 208 if (count) *count &= 0xffff; 209 return RegQueryValueA( hkey, name, data, count ); 210 } 211 212 /****************************************************************************** 213 * RegEnumKey16 [SHELL.7] 214 */ 215 DWORD WINAPI RegEnumKey16( HKEY hkey, DWORD index, LPSTR name, DWORD name_len ) 216 { 217 fix_win16_hkey( &hkey ); 218 return RegEnumKeyA( hkey, index, name, name_len ); 219 } 220 #endif //__WIN32OS2__ -
trunk/src/shell32/shellstring.c
r4121 r5618 1 /* $Id: shellstring.c,v 1.1 2000-08-30 13:52:56 sandervl Exp $ */2 #ifdef __WIN32OS2__3 #define ICOM_CINTERFACE 14 #include <odin.h>5 #endif6 1 #include <string.h> 7 2 #include <stdio.h> … … 14 9 #include "heap.h" 15 10 11 #include "shlobj.h" 12 #include "shlwapi.h" 16 13 #include "shellapi.h" 17 14 #include "shell32_main.h" … … 31 28 * the pidl is for STRRET OFFSET 32 29 */ 33 HRESULT WINAPI StrRetToStrNA (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLISTpidl)30 HRESULT WINAPI StrRetToStrNA (LPVOID dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl) 34 31 { 35 32 return StrRetToBufA( src, pidl, dest, len ); 36 33 } 37 34 38 HRESULT WINAPI StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLISTpidl)35 HRESULT WINAPI StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl) 39 36 { 40 37 return StrRetToBufW( src, pidl, dest, len ); 41 38 } 42 39 43 HRESULT WINAPI StrRetToStrNAW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLISTpidl)40 HRESULT WINAPI StrRetToStrNAW (LPVOID dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl) 44 41 { 45 42 if(SHELL_OsIsUnicode()) -
trunk/src/shell32/shellstub.cpp
r5544 r5618 1 /* $Id: shellstub.cpp,v 1. 2 2001-04-19 08:32:18sandervl Exp $ */1 /* $Id: shellstub.cpp,v 1.3 2001-04-28 13:33:47 sandervl Exp $ */ 2 2 3 3 /* … … 100 100 } 101 101 102 ODINFUNCTION2(DWORD, ILSaveToStream, DWORD, x1, DWORD, x2)103 {104 dprintf(("STUB!"));105 return 0;106 }107 108 102 ODINFUNCTION1(DWORD, InvalidateDriveType, DWORD, x1) 109 103 { -
trunk/src/shell32/shlfolder.c
r4121 r5618 1 /* $Id: shlfolder.c,v 1.1 2000-08-30 13:52:57 sandervl Exp $ */2 1 /* 3 2 * Shell Folder stuff … … 10 9 */ 11 10 #ifdef __WIN32OS2__ 12 #define ICOM_CINTERFACE 113 # include <odin.h>11 #define WINE_LARGE_INTEGER 12 #define snprintf(a,b,c,d) sprintf(a,c,d) 14 13 #endif 15 16 14 #include <stdlib.h> 17 15 #include <string.h> … … 20 18 #include "debugtools.h" 21 19 #include "winerror.h" 20 #include "winbase.h" 22 21 23 22 #include "oleidl.h" … … 32 31 #include "shresdef.h" 33 32 #include "shlwapi.h" 34 35 #define INITGUID36 #include "initguid.h"37 33 #include "shellfolder.h" 38 34 39 40 DEFAULT_DEBUG_CHANNEL(shell) 35 DEFAULT_DEBUG_CHANNEL(shell); 41 36 42 37 … … 347 342 348 343 /************************************************************************** 349 * we need a sep erate IUnknown to handle aggregation344 * we need a separate IUnknown to handle aggregation 350 345 * (inner IUnknown) 351 346 */ … … 616 611 * 617 612 * NOTES 618 * every folder tr ys to parse only it's own (the leftmost) pidl and creates a613 * every folder tries to parse only its own (the leftmost) pidl and creates a 619 614 * subfolder to evaluate the remaining parts 620 615 * now we can parse into namespaces implemented by shell extensions … … 658 653 659 654 /* build the full pathname to the element */ 660 lstrcpynWtoA(szTempA, szElement, lstrlenW(szElement) + 1);655 WideCharToMultiByte( CP_ACP, 0, szElement, -1, szTempA, MAX_PATH, NULL, NULL ); 661 656 strcpy(szPath, This->sMyPath); 662 657 PathAddBackslashA(szPath); … … 691 686 } 692 687 693 *ppidl = pidlTemp; 688 if (!hr) 689 *ppidl = pidlTemp; 690 else 691 *ppidl = NULL; 694 692 695 693 TRACE("(%p)->(-- pidl=%p ret=0x%08lx)\n", This, ppidl? *ppidl:0, hr); … … 1188 1186 PathAddBackslashA(szDest); 1189 1187 len = strlen (szDest); 1190 lstrcpynWtoA(szDest+len, lpName, MAX_PATH-len);1191 1188 WideCharToMultiByte( CP_ACP, 0, lpName, -1, szDest+len, MAX_PATH-len, NULL, NULL ); 1189 szDest[MAX_PATH-1] = 0; 1192 1190 TRACE("src=%s dest=%s\n", szSrc, szDest); 1193 1191 if ( MoveFileA(szSrc, szDest) ) … … 1498 1496 int i; 1499 1497 char szPath[MAX_PATH]; 1498 BOOL bConfirm = TRUE; 1500 1499 1501 1500 TRACE("(%p)(%u %p)\n", This, cidl, apidl); 1502 1501 1502 /* deleting multiple items so give a slightly different warning */ 1503 if(cidl != 1) 1504 { 1505 char tmp[8]; 1506 snprintf(tmp, sizeof(tmp), "%d", cidl); 1507 if(!SHELL_WarnItemDelete(ASK_DELETE_MULTIPLE_ITEM, tmp)) 1508 return E_FAIL; 1509 bConfirm = FALSE; 1510 } 1511 1503 1512 for(i=0; i< cidl; i++) 1504 1513 { … … 1510 1519 { 1511 1520 LPITEMIDLIST pidl; 1512 1513 MESSAGE("delete %s\n", szPath); 1514 if (! SHELL_DeleteDirectoryA(szPath, TRUE)) return E_FAIL; 1521 TRACE("delete %s\n", szPath); 1522 if (! SHELL_DeleteDirectoryA(szPath, bConfirm)) 1523 { 1524 TRACE("delete %s failed, bConfirm=%d", szPath, bConfirm); 1525 return E_FAIL; 1526 } 1515 1527 pidl = ILCombine(This->absPidl, apidl[i]); 1516 1528 SHChangeNotifyA(SHCNE_RMDIR, SHCNF_IDLIST, pidl, NULL); … … 1521 1533 LPITEMIDLIST pidl; 1522 1534 1523 MESSAGE("delete %s\n", szPath); 1524 if (! DeleteFileA(szPath)) return E_FAIL; 1535 TRACE("delete %s\n", szPath); 1536 if (! SHELL_DeleteFileA(szPath, bConfirm)) 1537 { 1538 TRACE("delete %s failed, bConfirm=%d", szPath, bConfirm); 1539 return E_FAIL; 1540 } 1525 1541 pidl = ILCombine(This->absPidl, apidl[i]); 1526 1542 SHChangeNotifyA(SHCNE_DELETE, SHCNF_IDLIST, pidl, NULL); … … 2133 2149 { 2134 2150 szNext = GetNextElementW(lpszDisplayName, szElement, MAX_PATH); 2135 lstrcpynWtoA(szTempA, szElement, lstrlenW(szElement) + 1);2151 WideCharToMultiByte( CP_ACP, 0, szElement, -1, szTempA, MAX_PATH, NULL, NULL ); 2136 2152 pidlTemp = _ILCreateDrive(szTempA); 2137 2153 … … 2498 2514 _ILSimpleGetText(pidl, szPath, MAX_PATH); 2499 2515 GetDiskFreeSpaceExA(szPath, NULL, &ulBytes, NULL); 2500 #ifdef __WIN32OS2__2501 StrFormatByteSizeA(ulBytes.LowPart, psd->str.u.cStr, MAX_PATH);2502 #else2503 2516 StrFormatByteSizeA(ulBytes.s.LowPart, psd->str.u.cStr, MAX_PATH); 2504 #endif2505 2517 } 2506 2518 break; … … 2510 2522 _ILSimpleGetText(pidl, szPath, MAX_PATH); 2511 2523 GetDiskFreeSpaceExA(szPath, &ulBytes, NULL, NULL); 2512 #ifdef __WIN32OS2__2513 StrFormatByteSizeA(ulBytes.LowPart, psd->str.u.cStr, MAX_PATH);2514 #else2515 2524 StrFormatByteSizeA(ulBytes.s.LowPart, psd->str.u.cStr, MAX_PATH); 2516 #endif2517 2525 } 2518 2526 break; -
trunk/src/shell32/shlmenu.c
r4121 r5618 1 /* $Id: shlmenu.c,v 1.1 2000-08-30 13:52:59 sandervl Exp $ */2 1 /* 3 2 * see www.geocities.com/SiliconValley/4942/filemenu.html 4 3 */ 5 #ifdef __WIN32OS2__6 #define ICOM_CINTERFACE 17 #include <odin.h>8 #endif9 4 #include <string.h> 10 5 6 #include "shlobj.h" 11 7 #include "wine/obj_base.h" 12 8 #include "wine/obj_enumidlist.h" 13 9 #include "wine/obj_shellfolder.h" 14 10 #include "wine/undocshell.h" 15 11 #include "shlwapi.h" 16 12 #include "heap.h" 17 13 #include "debugtools.h" … … 52 48 #define CCH_MAXITEMTEXT 256 53 49 54 DEFAULT_DEBUG_CHANNEL(shell) 50 DEFAULT_DEBUG_CHANNEL(shell); 55 51 56 52 LPFMINFO FM_GetMenuInfo(HMENU hmenu) … … 359 355 360 356 } 357 358 /**********************************************************************/ 359 361 360 BOOL WINAPI FileMenu_AppendItemAW( 362 361 HMENU hMenu, … … 603 602 604 603 Shell_GetImageList(0, &hImageList); 605 pImageList_Draw(hImageList, pMyItem->iIconIndex, lpdis->hDC, xi, yi, ILD_NORMAL);604 ImageList_Draw(hImageList, pMyItem->iIconIndex, lpdis->hDC, xi, yi, ILD_NORMAL); 606 605 607 606 TRACE("-- 0x%04x 0x%04x 0x%04x 0x%04x\n", TextRect.left, TextRect.top, TextRect.right, TextRect.bottom); … … 691 690 692 691 GetMenuItemInfoA(hMenu, uID, FALSE, &mii ); 693 if ( mii.hSubMenu ); 692 if ( mii.hSubMenu ) 693 { 694 /* FIXME: Do what? */ 695 } 694 696 695 697 DeleteMenu(hMenu, MF_BYCOMMAND, uID); … … 711 713 712 714 GetMenuItemInfoA(hMenu, uPos, TRUE, &mii ); 713 if ( mii.hSubMenu ); 715 if ( mii.hSubMenu ) 716 { 717 /* FIXME: Do what? */ 718 } 714 719 715 720 DeleteMenu(hMenu, MF_BYPOSITION, uPos); … … 820 825 return(FALSE); 821 826 } 827 828 /**********************************************************************/ 822 829 823 830 HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags) -
trunk/src/shell32/shlview.c
r4121 r5618 1 /* $Id: shlview.c,v 1.1 2000-08-30 13:52:59 sandervl Exp $ */2 1 /* 3 2 * ShellView … … 23 22 * Release() ??? 24 23 */ 25 #ifdef __WIN32OS2__26 #define ICOM_CINTERFACE 127 #include <odin.h>28 #endif29 24 30 25 #include <stdlib.h> 31 26 #include <string.h> 32 27 28 #include "windef.h" 29 #include "winerror.h" 30 #include "winnls.h" 33 31 #include "servprov.h" 34 32 #include "shlguid.h" 35 #include "wine/obj_base.h" 36 #include "wine/obj_shellfolder.h" 37 #include "wine/obj_shellview.h" 38 #include "wine/obj_oleview.h" 39 #include "wine/obj_commdlgbrowser.h" 40 #include "wine/obj_shellbrowser.h" 41 #include "wine/obj_dockingwindowframe.h" 42 #include "wine/obj_extracticon.h" 43 #include "wine/obj_dragdrop.h" 33 #include "shlobj.h" 44 34 #include "wine/undocshell.h" 45 35 #include "shresdef.h" 46 36 #include "debugtools.h" 47 #include "winerror.h"48 #include "wine/winestring.h"49 37 50 38 #include "docobj.h" 51 39 #include "pidl.h" 52 40 #include "shell32_main.h" 41 #include "shellfolder.h" 53 42 54 43 DEFAULT_DEBUG_CHANNEL(shell); … … 118 107 #define SHV_CHANGE_NOTIFY WM_USER + 0x1111 119 108 120 #define TOOLBAR_ID (L"SHELLDLL_DefView")121 109 /*windowsx.h */ 122 110 #define GET_WM_COMMAND_ID(wp, lp) LOWORD(wp) 123 111 #define GET_WM_COMMAND_HWND(wp, lp) (HWND)(lp) 124 112 #define GET_WM_COMMAND_CMD(wp, lp) HIWORD(wp) 125 /* winuser.h */ 126 #define WM_SETTINGCHANGE WM_WININICHANGE 113 127 114 extern void WINAPI _InsertMenuItem (HMENU hmenu, UINT indexMenu, BOOL fByPosition, 128 115 UINT wID, UINT fType, LPSTR dwTypeData, UINT fState); … … 152 139 typedef void (* CALLBACK PFNSHGETSETTINGSPROC)(LPSHELLFLAGSTATE lpsfs, DWORD dwMask); 153 140 #else 154 typedef void (CALLBACK*PFNSHGETSETTINGSPROC)(LPSHELLFLAGSTATE lpsfs, DWORD dwMask);141 typedef void CALLBACK (*PFNSHGETSETTINGSPROC)(LPSHELLFLAGSTATE lpsfs, DWORD dwMask); 155 142 #endif 156 143 … … 1259 1246 1260 1247 pidl = (LPITEMIDLIST)lpdi->item.lParam; 1261 lstrcpynAtoW(wszNewName, lpdi->item.pszText, MAX_PATH); 1248 if (!MultiByteToWideChar( CP_ACP, 0, lpdi->item.pszText, -1, wszNewName, MAX_PATH )) 1249 wszNewName[MAX_PATH-1] = 0; 1262 1250 hr = IShellFolder_SetNameOf(This->pSFParent, 0, pidl, wszNewName, SHGDN_INFOLDER, &pidl); 1263 1251 … … 1285 1273 1286 1274 LPNMLVKEYDOWN plvKeyDown = (LPNMLVKEYDOWN) lpnmh; 1275 1276 /* initiate a rename of the selected file or directory */ 1277 if(plvKeyDown->wVKey == VK_F2) 1278 { 1279 /* see how many files are selected */ 1280 int i = ListView_GetSelectedCount(This->hWndList); 1281 1282 /* get selected item */ 1283 if(i == 1) 1284 { 1285 /* get selected item */ 1286 i = ListView_GetNextItem(This->hWndList, -1, 1287 LVNI_SELECTED); 1288 1289 ListView_EnsureVisible(This->hWndList, i, 0); 1290 ListView_EditLabelA(This->hWndList, i); 1291 } 1292 } 1287 1293 #if 0 1288 1294 TranslateAccelerator(This->hWnd, This->hAccel, &msg) 1289 1295 #endif 1290 FIXME("LVN_KEYDOWN key=0x%08x\n",plvKeyDown->wVKey); 1296 else if(plvKeyDown->wVKey == VK_DELETE) 1297 { 1298 int i, item_index; 1299 LVITEMA item; 1300 LPITEMIDLIST* pItems; 1301 ISFHelper *psfhlp; 1302 1303 IShellFolder_QueryInterface(This->pSFParent, &IID_ISFHelper, 1304 (LPVOID*)&psfhlp); 1305 1306 if(!(i = ListView_GetSelectedCount(This->hWndList))) 1307 break; 1308 1309 /* allocate memory for the pidl array */ 1310 pItems = HeapAlloc(GetProcessHeap(), 0, 1311 sizeof(LPITEMIDLIST) * i); 1312 1313 /* retrieve all selected items */ 1314 i = 0; 1315 item_index = -1; 1316 while(ListView_GetSelectedCount(This->hWndList) > i) 1317 { 1318 /* get selected item */ 1319 item_index = ListView_GetNextItem(This->hWndList, 1320 item_index, LVNI_SELECTED); 1321 item.iItem = item_index; 1322 ListView_GetItemA(This->hWndList, &item); 1323 1324 /* get item pidl */ 1325 pItems[i] = (LPITEMIDLIST)item.lParam; 1326 1327 i++; 1328 } 1329 1330 /* perform the item deletion */ 1331 ISFHelper_DeleteItems(psfhlp, i, pItems); 1332 1333 /* free pidl array memory */ 1334 HeapFree(GetProcessHeap(), 0, pItems); 1335 } 1336 else 1337 FIXME("LVN_KEYDOWN key=0x%08x\n",plvKeyDown->wVKey); 1291 1338 } 1292 1339 break; 1340 1293 1341 default: 1294 1342 TRACE("-- %p WM_COMMAND %x unhandled\n", This, lpnmh->code); -
trunk/src/shell32/shpolicy.c
r4121 r5618 1 /* $Id: shpolicy.c,v 1.1 2000-08-30 13:53:00 sandervl Exp $ */2 1 /* 3 2 * shpolicy.c - Data for shell/system policies. … … 14 13 * Up to date as of SHELL32 v4.72 (Win98, Win95 with MSIE 5) 15 14 */ 16 #ifdef __WIN32OS2__17 #define ICOM_CINTERFACE 118 #include <odin.h>19 #endif20 15 21 16 #include <stdlib.h> -
trunk/src/shell32/shpolicy.h
r4121 r5618 1 /* $Id: shpolicy.h,v 1.3 2000-08-30 13:51:08 sandervl Exp $ */ 2 /* 1 /* 3 2 * shpolicy.h - contains defs of policy data for SHRestricted 4 * 3 * 5 4 * Created 1999 by Ian Schmidt, <ischmidt@cfl.rr.com> 6 5 * Up to date as of SHELL32 v4.72 (Win98, Win95 with MSIE 5) 7 *8 * Corel WINE 20000324 level9 6 */ 10 7 -
trunk/src/shell32/shres.orc
r5576 r5618 1 /* $Id: shres.orc,v 1.1 2 2001-04-23 10:47:23sandervl Exp $ */1 /* $Id: shres.orc,v 1.13 2001-04-28 13:33:48 sandervl Exp $ */ 2 2 /* 3 3 * Top level resource file for Common Dialogs … … 104 104 DEFPUSHBUTTON "OK", 1, 80, 176, 50, 12, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP 105 105 PUSHBUTTON "Cancel", 2, 134, 176, 50, 12, WS_GROUP | WS_TABSTOP 106 LTEXT "", IDD_TITLE, 4, 4, 18 , 12107 LTEXT "", IDD_STATUS, 4, 25, 18 , 12106 LTEXT "", IDD_TITLE, 4, 4, 180, 12 107 LTEXT "", IDD_STATUS, 4, 25, 180, 12 108 108 CONTROL "Tree1",IDD_TREEVIEW,"SysTreeView32", 109 109 TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | 110 WS_BORDER | WS_TABSTOP, 110 WS_BORDER | WS_TABSTOP, 111 111 4, 40, 180, 120 112 112 } 113 113 114 114 115 /* -
trunk/src/shell32/shv_bg_cmenu.c
r4121 r5618 1 /* $Id: shv_bg_cmenu.c,v 1.1 2000-08-30 13:53:00 sandervl Exp $ */2 1 /* 3 2 * IContextMenu … … 6 5 * Copyright 1999 Juergen Schmied <juergen.schmied@metronet.de> 7 6 */ 8 #ifdef __WIN32OS2__9 #define ICOM_CINTERFACE 110 #include <odin.h>11 #endif12 7 #include <string.h> 13 8 … … 22 17 #include "shell32_main.h" 23 18 #include "shellfolder.h" 24 #include "shell.h" /* DROPFILESTRUCT */25 19 #include "wine/undocshell.h" 26 20 27 DEFAULT_DEBUG_CHANNEL(shell) 21 DEFAULT_DEBUG_CHANNEL(shell); 28 22 29 23 /************************************************************************** … … 201 195 TRACE("\n"); 202 196 203 if(SUCCEEDED(pOleGetClipboard(&pda))) ;197 if(SUCCEEDED(pOleGetClipboard(&pda))) 204 198 { 205 199 STGMEDIUM medium; … … 370 364 TRACE("(%p)->(idcom=%x flags=%x %p name=%p len=%x)\n",This, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen); 371 365 372 /* test the exist ance of the menu items, the file dialog enables366 /* test the existence of the menu items, the file dialog enables 373 367 the buttons according to this */ 374 368 if (uFlags == GCS_VALIDATEA) -
trunk/src/shell32/shv_item_cmenu.c
r4121 r5618 1 /* $Id: shv_item_cmenu.c,v 1.1 2000-08-30 13:53:01 sandervl Exp $ */2 1 /* 3 2 * IContextMenu for items in the shellview … … 5 4 * 1998, 2000 Juergen Schmied <juergen.schmied@debitel.net> 6 5 */ 7 #ifdef __WIN32OS2__8 #define ICOM_CINTERFACE 19 #include <odin.h>10 #endif11 6 #include <string.h> 12 7 … … 24 19 #include "shell32_main.h" 25 20 #include "shellfolder.h" 26 #include "shell.h" /* DROPFILESTRUCT */ 27 28 DEFAULT_DEBUG_CHANNEL(shell) 21 22 DEFAULT_DEBUG_CHANNEL(shell); 29 23 30 24 /************************************************************************** … … 491 485 switch(idCommand) 492 486 { case FCIDM_SHVIEW_RENAME: 493 lstrcpyAtoW((LPWSTR)lpszName, "rename");487 MultiByteToWideChar( CP_ACP, 0, "rename", -1, (LPWSTR)lpszName, uMaxNameLen ); 494 488 hr = NOERROR; 495 489 break; -
trunk/src/shell32/systray.c
r4121 r5618 1 /* $Id: systray.c,v 1.1 2000-08-30 13:53:01 sandervl Exp $ */2 1 /* 3 2 * Systray … … 10 9 * 11 10 */ 12 #ifdef __WIN32OS2__ 13 #define ICOM_CINTERFACE 1 14 #include <odin.h> 15 #else 11 12 #ifndef __WIN32OS2__ 16 13 #include <unistd.h> 17 14 #endif … … 19 16 #include <string.h> 20 17 21 #ifndef __WIN32OS2__ 22 #include "heap.h" 23 #endif 18 #include "winnls.h" 19 #include "shlobj.h" 24 20 #include "shellapi.h" 25 21 #include "shell32_main.h" 26 #include "windows.h"27 22 #include "commctrl.h" 28 23 #include "debugtools.h" 24 #include "heap.h" 29 25 #include "config.h" 30 26 31 DEFAULT_DEBUG_CHANNEL(shell) 27 DEFAULT_DEBUG_CHANNEL(shell); 32 28 33 29 typedef struct SystrayItem { … … 186 182 return FALSE; 187 183 #else 184 188 185 /* Initialize the window size. */ 189 186 rect.left = 0; … … 215 212 } 216 213 return TRUE; 217 #endif //__WIN32OS2__214 #endif 218 215 } 219 216 … … 221 218 static void SYSTRAY_ItemTerm(SystrayItem *ptrayItem) 222 219 { 220 if(ptrayItem->notifyIcon.hIcon) 221 DestroyIcon(ptrayItem->notifyIcon.hIcon); 223 222 if(ptrayItem->hWndToolTip) 224 223 DestroyWindow(ptrayItem->hWndToolTip); … … 237 236 void SYSTRAY_ItemSetIcon(SystrayItem *ptrayItem, HICON hIcon) 238 237 { 239 ptrayItem->notifyIcon.hIcon = hIcon; /* do we need a copy? */238 ptrayItem->notifyIcon.hIcon = CopyIcon(hIcon); 240 239 InvalidateRect(ptrayItem->hWnd, NULL, TRUE); 241 240 } … … 346 345 347 346 /************************************************************************* 348 * Shell_NotifyIconA [SHELL32.297] 347 * Shell_NotifyIconA [SHELL32.297][SHELL32.296] 349 348 */ 350 349 BOOL WINAPI Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATAA pnid ) … … 368 367 369 368 /************************************************************************* 370 * Shell_NotifyIconW [SHELL32.29 7]369 * Shell_NotifyIconW [SHELL32.298] 371 370 */ 372 371 BOOL WINAPI Shell_NotifyIconW (DWORD dwMessage, PNOTIFYICONDATAW pnid ) … … 376 375 PNOTIFYICONDATAA p = HeapAlloc(GetProcessHeap(),0,sizeof(NOTIFYICONDATAA)); 377 376 memcpy(p, pnid, sizeof(NOTIFYICONDATAA)); 378 if (*(pnid->szTip)) 379 lstrcpynWtoA (p->szTip, pnid->szTip, 64 );377 WideCharToMultiByte( CP_ACP, 0, pnid->szTip, -1, p->szTip, sizeof(p->szTip), NULL, NULL ); 378 p->szTip[sizeof(p->szTip)-1] = 0; 380 379 381 380 ret = Shell_NotifyIconA(dwMessage, p ); … … 384 383 return ret; 385 384 } 386 387 /*************************************************************************388 * Shell_NotifyIcon [SHELL32.296]389 */390 BOOL WINAPI Shell_NotifyIcon(DWORD dwMessage, PNOTIFYICONDATAA pnid)391 {392 return Shell_NotifyIconA(dwMessage, pnid);393 }
Note:
See TracChangeset
for help on using the changeset viewer.