- Timestamp:
- Sep 2, 1999, 7:25:19 PM (26 years ago)
- Location:
- trunk/src/shell32/new
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/shell32/new/pidl.cpp
r793 r795 142 142 } 143 143 144 144 145 /************************************************************************* 145 146 * ILGetDisplayName [SHELL32.15] … … 293 294 TRACE_(shell)("%s %p 0x%08lx\n",path,ppidl,attributes?*attributes:0); 294 295 295 LocalToWideChar(lpszDisplayName, path, MAX_PATH);296 LocalToWideChar(lpszDisplayName, (LPSTR)path, MAX_PATH); 296 297 297 298 if (SUCCEEDED (SHGetDesktopFolder(&sf))) -
trunk/src/shell32/new/regstream.cpp
r791 r795 17 17 #include "shell32_main.h" 18 18 19 #include <heapstring.h> 19 20 #include <misc.h> 20 21 … … 32 33 } ISHRegStream; 33 34 34 static struct ICOM_VTABLE(IStream) rstvt; 35 36 /************************************************************************** 37 * IStream_Constructor() 38 */ 39 IStream *IStream_Constructor(HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue, DWORD grfMode) 40 { ISHRegStream* rstr; 41 DWORD dwType; 42 43 rstr = (ISHRegStream*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ISHRegStream)); 44 rstr->lpvtbl=&rstvt; 45 rstr->ref = 1; 46 47 if ( ERROR_SUCCESS == RegOpenKeyExA (hKey, pszSubKey, 0, KEY_READ, &(rstr->hKey))) 48 { if ( ERROR_SUCCESS == RegQueryValueExA(rstr->hKey, (LPSTR)pszValue,0,0,0,&(rstr->dwLength))) 49 { 50 /* read the binary data into the buffer */ 51 rstr->pbBuffer = HeapAlloc(GetProcessHeap(),0,rstr->dwLength); 52 if (rstr->pbBuffer) 53 { if ( ERROR_SUCCESS == RegQueryValueExA(rstr->hKey, (LPSTR)pszValue,0,&dwType,rstr->pbBuffer,&(rstr->dwLength))) 54 { if (dwType == REG_BINARY ) 55 { rstr->pszSubKey = HEAP_strdupA (GetProcessHeap(),0, pszSubKey); 56 rstr->pszValue = HEAP_strdupA (GetProcessHeap(),0, pszValue); 57 TRACE("(%p)->0x%08x,%s,%s,0x%08lx\n", rstr, hKey, pszSubKey, pszValue, grfMode); 58 shell32_ObjCount++; 59 return (IStream*)rstr; 60 } 61 } 62 HeapFree (GetProcessHeap(),0,rstr->pbBuffer); 63 } 64 } 65 RegCloseKey(rstr->hKey); 66 67 } 68 HeapFree (GetProcessHeap(),0,rstr); 69 return NULL; 70 } 35 //static struct ICOM_VTABLE(IStream) rstvt; 36 71 37 72 38 /************************************************************************** … … 274 240 }; 275 241 242 /************************************************************************** 243 * IStream_Constructor() 244 */ 245 IStream *IStream_Constructor(HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue, DWORD grfMode) 246 { ISHRegStream* rstr; 247 DWORD dwType; 248 249 rstr = (ISHRegStream*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ISHRegStream)); 250 rstr->lpvtbl=&rstvt; 251 rstr->ref = 1; 252 253 if ( ERROR_SUCCESS == RegOpenKeyExA (hKey, pszSubKey, 0, KEY_READ, &(rstr->hKey))) 254 { if ( ERROR_SUCCESS == RegQueryValueExA(rstr->hKey, (LPSTR)pszValue,0,0,0,&(rstr->dwLength))) 255 { 256 /* read the binary data into the buffer */ 257 rstr->pbBuffer = (BYTE*)HeapAlloc(GetProcessHeap(),0,rstr->dwLength); 258 if (rstr->pbBuffer) 259 { if ( ERROR_SUCCESS == RegQueryValueExA(rstr->hKey, (LPSTR)pszValue,0,&dwType,rstr->pbBuffer,&(rstr->dwLength))) 260 { if (dwType == REG_BINARY ) 261 { rstr->pszSubKey = HEAP_strdupA (GetProcessHeap(),0, pszSubKey); 262 rstr->pszValue = HEAP_strdupA (GetProcessHeap(),0, pszValue); 263 TRACE("(%p)->0x%08x,%s,%s,0x%08lx\n", rstr, hKey, pszSubKey, pszValue, grfMode); 264 shell32_ObjCount++; 265 return (IStream*)rstr; 266 } 267 } 268 HeapFree (GetProcessHeap(),0,rstr->pbBuffer); 269 } 270 } 271 RegCloseKey(rstr->hKey); 272 273 } 274 HeapFree (GetProcessHeap(),0,rstr); 275 return NULL; 276 } 277 278 276 279 /************************************************************************* 277 280 * OpenRegStream [SHELL32.85] -
trunk/src/shell32/new/shelllink.cpp
r791 r795 26 26 #include "shlguid.h" 27 27 28 #include <heapstring.h> 28 29 #include <misc.h> 29 30 … … 67 68 #include "poppack.h" 68 69 69 static ICOM_VTABLE(IShellLink) slvt;70 static ICOM_VTABLE(IShellLinkW) slvtw;71 static ICOM_VTABLE(IPersistFile) pfvt;72 static ICOM_VTABLE(IPersistStream) psvt;70 //static ICOM_VTABLE(IShellLink) slvt; 71 //static ICOM_VTABLE(IShellLinkW) slvtw; 72 //static ICOM_VTABLE(IPersistFile) pfvt; 73 //static ICOM_VTABLE(IPersistStream) psvt; 73 74 74 75 /* IShellLink Implementation */ … … 295 296 IStream* pLoadStream) 296 297 { 297 PLINK_HEADER lpLinkHeader = HeapAlloc(GetProcessHeap(), 0, LINK_HEADER_SIZE);298 PLINK_HEADER lpLinkHeader = (PLINK_HEADER)HeapAlloc(GetProcessHeap(), 0, LINK_HEADER_SIZE); 298 299 ULONG dwBytesRead; 299 300 DWORD ret = E_FAIL; … … 316 317 if ((lpLinkHeader->MagicStr == 0x0000004CL) && IsEqualIID(&lpLinkHeader->MagicGuid, &CLSID_ShellLink)) 317 318 { 318 lpLinkHeader = HeapReAlloc(GetProcessHeap(), 0, lpLinkHeader, LINK_HEADER_SIZE+lpLinkHeader->PidlSize);319 lpLinkHeader = (PLINK_HEADER)HeapReAlloc(GetProcessHeap(), 0, lpLinkHeader, LINK_HEADER_SIZE+lpLinkHeader->PidlSize); 319 320 if (lpLinkHeader) 320 321 { … … 404 405 405 406 /************************************************************************** 406 * IShellLink_Constructor407 */408 IShellLink * IShellLink_Constructor(BOOL bUnicode)409 { IShellLinkImpl * sl;410 411 sl = (IShellLinkImpl *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IShellLinkImpl));412 sl->ref = 1;413 sl->lpvtbl = &slvt;414 sl->lpvtblw = &slvtw;415 sl->lpvtblPersistFile = &pfvt;416 sl->lpvtblPersistStream = &psvt;417 418 TRACE("(%p)->()\n",sl);419 shell32_ObjCount++;420 return bUnicode ? (IShellLink *) &(sl->lpvtblw) : (IShellLink *)sl;421 }422 423 /**************************************************************************424 407 * IShellLink_QueryInterface 425 408 */ … … 902 885 }; 903 886 887 /************************************************************************** 888 * IShellLink_Constructor 889 */ 890 IShellLink * IShellLink_Constructor(BOOL bUnicode) 891 { IShellLinkImpl * sl; 892 893 sl = (IShellLinkImpl *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IShellLinkImpl)); 894 sl->ref = 1; 895 sl->lpvtbl = &slvt; 896 sl->lpvtblw = &slvtw; 897 sl->lpvtblPersistFile = &pfvt; 898 sl->lpvtblPersistStream = &psvt; 899 900 TRACE("(%p)->()\n",sl); 901 shell32_ObjCount++; 902 return bUnicode ? (IShellLink *) &(sl->lpvtblw) : (IShellLink *)sl; 903 } 904 905 -
trunk/src/shell32/new/shellole.cpp
r791 r795 66 66 WINE_StringFromCLSID(refiid,xiid); 67 67 if (unknownouter) 68 WINE_StringFromCLSID( unknownouter,xuout);68 WINE_StringFromCLSID((const CLSID*)unknownouter,xuout); 69 69 70 70 TRACE("(%p,\n\tCLSID:\t%s\n\tUOUT:\t%s\n\tIID:\t%s,%p)\n", … … 140 140 { 141 141 if (VERSION_OsIsUnicode()) 142 return SHCLSIDFromStringW ( clsid, id);143 return SHCLSIDFromStringA ( clsid, id);142 return SHCLSIDFromStringW ((LPWSTR)clsid, id); 143 return SHCLSIDFromStringA ((LPSTR)clsid, id); 144 144 } 145 145 … … 178 178 if(lpclf) 179 179 { 180 hres = IClassFactory_CreateInstance(lpclf,NULL,(REFIID)&IID_IShellFolder, ( void*)&pdesktopfolder);180 hres = IClassFactory_CreateInstance(lpclf,NULL,(REFIID)&IID_IShellFolder, (LPVOID*)&pdesktopfolder); 181 181 IClassFactory_Release(lpclf); 182 182 } … … 206 206 } IClassFactoryImpl; 207 207 208 static ICOM_VTABLE(IClassFactory) clfvt; 209 210 /************************************************************************** 211 * IClassFactory_Constructor 212 */ 213 214 LPCLASSFACTORY IClassFactory_Constructor(REFCLSID rclsid) 215 { 216 IClassFactoryImpl* lpclf; 217 218 lpclf= (IClassFactoryImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IClassFactoryImpl)); 219 lpclf->ref = 1; 220 lpclf->lpvtbl = &clfvt; 221 lpclf->rclsid = (CLSID*)rclsid; 222 223 TRACE("(%p)->()\n",lpclf); 224 shell32_ObjCount++; 225 return (LPCLASSFACTORY)lpclf; 226 } 208 //static ICOM_VTABLE(IClassFactory) clfvt; 209 227 210 /************************************************************************** 228 211 * IClassFactory_QueryInterface … … 348 331 349 332 /************************************************************************** 333 * IClassFactory_Constructor 334 */ 335 336 LPCLASSFACTORY IClassFactory_Constructor(REFCLSID rclsid) 337 { 338 IClassFactoryImpl* lpclf; 339 340 lpclf= (IClassFactoryImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IClassFactoryImpl)); 341 lpclf->ref = 1; 342 lpclf->lpvtbl = &clfvt; 343 lpclf->rclsid = (CLSID*)rclsid; 344 345 TRACE("(%p)->()\n",lpclf); 346 shell32_ObjCount++; 347 return (LPCLASSFACTORY)lpclf; 348 } 349 350 351 /************************************************************************** 350 352 * Default ClassFactory Implementation 351 353 * … … 369 371 } IDefClFImpl; 370 372 371 static ICOM_VTABLE(IClassFactory) dclfvt; 372 373 /************************************************************************** 374 * IDefClF_fnConstructor 375 */ 376 377 IClassFactory * IDefClF_fnConstructor(LPFNCREATEINSTANCE lpfnCI, UINT * pcRefDll, REFIID riidInst) 378 { 379 IDefClFImpl* lpclf; 380 char xriidInst[50]; 381 382 WINE_StringFromCLSID((LPCLSID)riidInst,xriidInst); 383 384 lpclf = (IDefClFImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IDefClFImpl)); 385 lpclf->ref = 1; 386 lpclf->lpvtbl = &dclfvt; 387 lpclf->lpfnCI = lpfnCI; 388 lpclf->pcRefDll = pcRefDll; 389 390 if (pcRefDll) 391 (*pcRefDll)++; 392 393 lpclf->riidInst = riidInst; 394 395 TRACE("(%p)\n\tIID:\t%s\n",lpclf, xriidInst); 396 shell32_ObjCount++; 397 return (LPCLASSFACTORY)lpclf; 398 } 373 //static ICOM_VTABLE(IClassFactory) dclfvt; 374 399 375 /************************************************************************** 400 376 * IDefClF_fnQueryInterface … … 505 481 }; 506 482 483 /************************************************************************** 484 * IDefClF_fnConstructor 485 */ 486 487 IClassFactory * IDefClF_fnConstructor(LPFNCREATEINSTANCE lpfnCI, UINT * pcRefDll, REFIID riidInst) 488 { 489 IDefClFImpl* lpclf; 490 char xriidInst[50]; 491 492 WINE_StringFromCLSID((LPCLSID)riidInst,xriidInst); 493 494 lpclf = (IDefClFImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IDefClFImpl)); 495 lpclf->ref = 1; 496 lpclf->lpvtbl = &dclfvt; 497 lpclf->lpfnCI = lpfnCI; 498 lpclf->pcRefDll = pcRefDll; 499 500 if (pcRefDll) 501 (*pcRefDll)++; 502 503 lpclf->riidInst = riidInst; 504 505 TRACE("(%p)\n\tIID:\t%s\n",lpclf, xriidInst); 506 shell32_ObjCount++; 507 return (LPCLASSFACTORY)lpclf; 508 } 509 510 507 511 /****************************************************************************** 508 512 * SHCreateDefClassObject [SHELL32.70] -
trunk/src/shell32/new/shlfolder.cpp
r791 r795 29 29 #include "shell32_main.h" 30 30 31 #include <heapstring.h> 31 32 #include <misc.h> 32 33 … … 209 210 } IGenericSFImpl; 210 211 211 static struct ICOM_VTABLE(IShellFolder) sfvt;212 static struct ICOM_VTABLE(IPersistFolder) psfvt;213 static struct ICOM_VTABLE(IDropTarget) dtvt;212 //static struct ICOM_VTABLE(IShellFolder) sfvt; 213 //static struct ICOM_VTABLE(IPersistFolder) psfvt; 214 //static struct ICOM_VTABLE(IDropTarget) dtvt; 214 215 215 216 static IShellFolder * ISF_MyComputer_Constructor(void); … … 218 219 #define _ICOM_THIS_From_IPersistFolder(class, name) class* This = (class*)(((char*)name)-_IPersistFolder_Offset); 219 220 220 static struct ICOM_VTABLE(IDropTarget) dtvt;221 221 #define _IDropTarget_Offset ((int)(&(((IGenericSFImpl*)0)->lpvtblDropTarget))) 222 222 #define _ICOM_THIS_From_IDropTarget(class, name) class* This = (class*)(((char*)name)-_IDropTarget_Offset); … … 278 278 279 279 dwSize += _ILSimpleGetText(pidl,NULL,0); /* add the size of our name*/ 280 sf->sMyPath = SHAlloc(dwSize + 2); /* '\0' and backslash */280 sf->sMyPath = (char*)SHAlloc(dwSize + 2); /* '\0' and backslash */ 281 281 282 282 if(!sf->sMyPath) return NULL; … … 562 562 else 563 563 { 564 IShellFolder_BindToObject(pShellFolder, ILGetNext(pidl), NULL, &IID_IShellFolder, (LPVOID )&pSubFolder);564 IShellFolder_BindToObject(pShellFolder, ILGetNext(pidl), NULL, &IID_IShellFolder, (LPVOID*)&pSubFolder); 565 565 IShellFolder_Release(pShellFolder); 566 566 *ppvOut = pSubFolder; … … 664 664 _ILSimpleGetText(pidl1, szTemp1, MAX_PATH); 665 665 _ILSimpleGetText(pidl2, szTemp2, MAX_PATH); 666 nReturn = strc asecmp(szTemp1, szTemp2);666 nReturn = strcmp(szTemp1, szTemp2); 667 667 668 668 if (nReturn == 0) /* first pidl different ? */ … … 1178 1178 else /* go deeper */ 1179 1179 { 1180 IShellFolder_BindToObject(pShellFolder, ILGetNext(pidl), NULL, riid, (LPVOID )&pSubFolder);1180 IShellFolder_BindToObject(pShellFolder, ILGetNext(pidl), NULL, riid, (LPVOID*)&pSubFolder); 1181 1181 IShellFolder_Release(pShellFolder); 1182 1182 *ppvOut = pSubFolder; … … 1490 1490 else /* go deeper */ 1491 1491 { 1492 IShellFolder_BindToObject(pShellFolder, ILGetNext(pidl), NULL, &IID_IShellFolder, (LPVOID )&pSubFolder);1492 IShellFolder_BindToObject(pShellFolder, ILGetNext(pidl), NULL, &IID_IShellFolder, (LPVOID*)&pSubFolder); 1493 1493 IShellFolder_Release(pShellFolder); 1494 1494 *ppvOut = pSubFolder; -
trunk/src/shell32/new/shlmenu.cpp
r791 r795 21 21 #include "pidl.h" 22 22 23 #include <heapstring.h> 23 24 #include <misc.h> 24 25 … … 160 161 { 161 162 ILGetDisplayName( pidlTemp, sTemp); 162 if (! (PidlToSicIndex(lpsf, pidlTemp, FALSE, &iIcon)))163 if (! (PidlToSicIndex(lpsf, pidlTemp, FALSE, (UINT*)&iIcon))) 163 164 iIcon = FM_BLANK_ICON; 164 165 if ( SFGAO_FOLDER & ulItemAttr) … … 340 341 341 342 if (VERSION_OsIsUnicode() && (lpText!=FM_SEPARATOR)) 342 lpszText = HEAP_strdupWtoA ( GetProcessHeap(),0,lpText);343 344 ret = FileMenu_AppendItemA(hMenu, (lpszText) ? lpszText : lpText, uID, icon, hMenuPopup, nItemHeight);343 lpszText = (LPSTR)HEAP_strdupWtoA ( GetProcessHeap(),0, (LPCWSTR)lpText); 344 345 ret = FileMenu_AppendItemA(hMenu, (lpszText) ? lpszText : (LPCSTR)lpText, uID, icon, hMenuPopup, nItemHeight); 345 346 346 347 if (lpszText) -
trunk/src/shell32/new/shv_bg_cmenu.cpp
r791 r795 35 35 36 36 37 static struct ICOM_VTABLE(IContextMenu) cmvt; 38 39 /************************************************************************** 40 * ISVBgCm_Constructor() 41 */ 42 IContextMenu *ISvBgCm_Constructor(void) 43 { 44 BgCmImpl* cm; 45 46 cm = (BgCmImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(BgCmImpl)); 47 cm->lpvtbl=&cmvt; 48 cm->ref = 1; 49 50 TRACE("(%p)->()\n",cm); 51 shell32_ObjCount++; 52 return (IContextMenu*)cm; 53 } 37 //static struct ICOM_VTABLE(IContextMenu) cmvt; 54 38 55 39 /************************************************************************** … … 285 269 }; 286 270 271 /************************************************************************** 272 * ISVBgCm_Constructor() 273 */ 274 IContextMenu *ISvBgCm_Constructor(void) 275 { 276 BgCmImpl* cm; 277 278 cm = (BgCmImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(BgCmImpl)); 279 cm->lpvtbl=&cmvt; 280 cm->ref = 1; 281 282 TRACE("(%p)->()\n",cm); 283 shell32_ObjCount++; 284 return (IContextMenu*)cm; 285 } 286 287
Note:
See TracChangeset
for help on using the changeset viewer.