Changeset 1353 for trunk/src/shell32/shellole.cpp
- Timestamp:
- Oct 19, 1999, 12:23:27 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/shell32/shellole.cpp
r1215 r1353 1 /* $Id: shellole.cpp,v 1.2 1999-10-09 11:17:05 sandervl Exp $ */ 1 /* $Id: shellole.cpp,v 1.3 1999-10-19 10:23:27 phaller Exp $ */ 2 2 3 /* 3 * handling of SHELL32.DLL OLE-Objects 4 * 5 * Copyright 1997 Marcus Meissner 6 * Copyright 1998 Juergen Schmied <juergen.schmied@metronet.de> 7 * 8 */ 4 * Win32 SHELL32 for OS/2 5 * 6 * Copyright 1999 Patrick Haller (haller@zebra.fh-weingarten.de) 7 * Project Odin Software License can be found in LICENSE.TXT 8 * 9 * handling of SHELL32.DLL OLE-Objects 10 * 11 * Copyright 1997 Marcus Meissner 12 * Copyright 1998 Juergen Schmied <juergen.schmied@metronet.de> 13 * 14 */ 15 16 17 /***************************************************************************** 18 * Includes * 19 *****************************************************************************/ 20 21 #include <odin.h> 22 #include <odinwrap.h> 23 #include <os2sel.h> 9 24 10 25 #include <stdlib.h> 11 26 #include <string.h> 12 #include <odin.h>13 27 14 28 #define ICOM_CINTERFACE 1 … … 33 47 #include <misc.h> 34 48 35 DEFAULT_DEBUG_CHANNEL(shell) 49 50 /***************************************************************************** 51 * Implementation * 52 *****************************************************************************/ 53 54 ODINDEBUGCHANNEL(SHELL32-SHELLOLE) 55 36 56 37 57 DWORD WINAPI SHCLSIDFromStringA (LPSTR clsid, CLSID *id); … … 43 63 * exported by ordinal 44 64 */ 45 LRESULT WINAPI SHCoCreateInstance( 46 LPSTR aclsid, 47 REFCLSID clsid, 48 IUnknown * unknownouter, 49 REFIID refiid, 50 LPVOID *ppv) 51 { 52 char xclsid[48], xiid[48], xuout[48]; 53 DWORD hres; 54 IID iid; 55 CLSID * myclsid = (CLSID*)clsid; 56 57 WINE_StringFromCLSID(refiid,xiid); 58 59 if (!clsid) 60 { 61 if (!aclsid) return REGDB_E_CLASSNOTREG; 62 SHCLSIDFromStringA(aclsid, &iid); 63 myclsid = &iid; 64 } 65 66 WINE_StringFromCLSID(myclsid,xclsid); 67 WINE_StringFromCLSID(refiid,xiid); 68 if (unknownouter) 69 WINE_StringFromCLSID((const CLSID*)unknownouter,xuout); 70 71 TRACE("(%p,\n\tCLSID:\t%s\n\tUOUT:\t%s\n\tIID:\t%s,%p)\n", 72 aclsid,xclsid,unknownouter?xuout:"nil",xiid,ppv); 73 74 hres = CoCreateInstance(myclsid, NULL, CLSCTX_INPROC_SERVER, refiid, ppv); 75 76 if(hres!=S_OK) 77 { 78 ERR("failed (0x%08lx) to create \n\tCLSID:\t%s\n\tIID:\t%s\n", hres, xclsid, xiid); 79 ERR("you might need to import the winedefault.reg\n"); 80 } 81 82 return hres; 65 66 ODINFUNCTION5(LRESULT, SHCoCreateInstance, LPSTR, aclsid, 67 REFCLSID, clsid, 68 IUnknown*, unknownouter, 69 REFIID, refiid, 70 LPVOID*, ppv) 71 { 72 char xclsid[48], xiid[48], xuout[48]; 73 DWORD hres; 74 IID iid; 75 CLSID * myclsid = (CLSID*)clsid; 76 77 WINE_StringFromCLSID(refiid,xiid); 78 79 if (!clsid) 80 { 81 if (!aclsid) return REGDB_E_CLASSNOTREG; 82 SHCLSIDFromStringA(aclsid, &iid); 83 myclsid = &iid; 84 } 85 86 WINE_StringFromCLSID(myclsid,xclsid); 87 WINE_StringFromCLSID(refiid,xiid); 88 if (unknownouter) 89 WINE_StringFromCLSID((const CLSID*)unknownouter,xuout); 90 91 dprintf(("SHELL32:SHCoCreateInstance (%p,CLSID:%s UOUT:%s IID:%s,%p)\n", 92 aclsid, 93 xclsid, 94 unknownouter?xuout:"nil",xiid,ppv)); 95 96 hres = CoCreateInstance(myclsid, NULL, CLSCTX_INPROC_SERVER, refiid, ppv); 97 98 if(hres!=S_OK) 99 { 100 dprintf(("SHELL32:SHCoCreateInstance failed (0x%08lx) to create CLSID:%s IID:%s\n", 101 hres, 102 xclsid, 103 xiid)); 104 dprintf(("SHELL32:SHCoCreateInstance you might need to import the winedefault.reg\n")); 105 } 106 107 return hres; 83 108 } 84 109 … … 86 111 * SHELL32_DllGetClassObject [SHELL32.128] 87 112 */ 88 HRESULT WINAPI SHELL32_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv) 89 { HRESULT hres = E_OUTOFMEMORY; 90 LPCLASSFACTORY lpclf; 91 92 char xclsid[50],xiid[50]; 93 WINE_StringFromCLSID((LPCLSID)rclsid,xclsid); 94 WINE_StringFromCLSID((LPCLSID)iid,xiid); 95 TRACE("\n\tCLSID:\t%s,\n\tIID:\t%s\n",xclsid,xiid); 96 97 *ppv = NULL; 98 99 if(IsEqualCLSID(rclsid, &CLSID_PaperBin)) 100 { 101 ERR("paper bin not implemented\n"); 102 return CLASS_E_CLASSNOTAVAILABLE; 103 } 104 if(IsEqualCLSID(rclsid, &CLSID_ShellDesktop)|| 105 IsEqualCLSID(rclsid, &CLSID_ShellLink)) 106 { 107 lpclf = IClassFactory_Constructor( rclsid ); 108 109 if(lpclf) 110 { 111 hres = IClassFactory_QueryInterface(lpclf,iid, ppv); 112 IClassFactory_Release(lpclf); 113 } 114 } 115 else 116 { 117 WARN("-- CLSID not found\n"); 118 hres = CLASS_E_CLASSNOTAVAILABLE; 119 } 120 TRACE("-- pointer to class factory: %p\n",*ppv); 121 return hres; 113 114 ODINFUNCTION3(HRESULT, SHELL32_DllGetClassObject, REFCLSID, rclsid, 115 REFIID, iid, 116 LPVOID*, ppv) 117 { 118 HRESULT hres = E_OUTOFMEMORY; 119 LPCLASSFACTORY lpclf; 120 121 char xclsid[50],xiid[50]; 122 WINE_StringFromCLSID((LPCLSID)rclsid,xclsid); 123 WINE_StringFromCLSID((LPCLSID)iid,xiid); 124 dprintf(("SHELL32:SHELL32_DllGetClassObject CLSID:%s, IID:%s\n", 125 xclsid, 126 xiid)); 127 128 *ppv = NULL; 129 130 if(IsEqualCLSID(rclsid, &CLSID_PaperBin)) 131 { 132 dprintf(("SHELL32:SHELL32_DllGetClassObject paper bin not implemented\n")); 133 return CLASS_E_CLASSNOTAVAILABLE; 134 } 135 if(IsEqualCLSID(rclsid, &CLSID_ShellDesktop)|| 136 IsEqualCLSID(rclsid, &CLSID_ShellLink)) 137 { 138 lpclf = IClassFactory_Constructor( rclsid ); 139 140 if(lpclf) 141 { 142 hres = IClassFactory_QueryInterface(lpclf,iid, ppv); 143 IClassFactory_Release(lpclf); 144 } 145 } 146 else 147 { 148 dprintf(("SHELL32:SHELL32_DllGetClassObject -- CLSID not found\n")); 149 hres = CLASS_E_CLASSNOTAVAILABLE; 150 } 151 dprintf(("SHELL32:SHELL32_DllGetClassObject -- pointer to class factory: %p\n", 152 *ppv)); 153 return hres; 122 154 } 123 155 124 156 /************************************************************************* 125 * SHCLSIDFromString 157 * SHCLSIDFromString [SHELL32.147] 126 158 * 127 159 * NOTES 128 160 * exported by ordinal 129 161 */ 130 DWORD WINAPI SHCLSIDFromStringA (LPSTR clsid, CLSID *id) 131 { 132 TRACE("(%p(%s) %p)\n", clsid, clsid, id); 133 return CLSIDFromStringA(clsid, id); 134 } 135 DWORD WINAPI SHCLSIDFromStringW (LPWSTR clsid, CLSID *id) 136 { 137 TRACE("(%p(%s) %p)\n", clsid, debugstr_w(clsid), id); 138 return CLSIDFromString(clsid, id); 139 } 140 DWORD WINAPI SHCLSIDFromStringAW (LPVOID clsid, CLSID *id) 141 { 142 if (VERSION_OsIsUnicode()) 143 return SHCLSIDFromStringW ((LPWSTR)clsid, id); 144 return SHCLSIDFromStringA ((LPSTR)clsid, id); 145 } 162 ODINFUNCTION2(DWORD, SHCLSIDFromStringA, LPSTR, clsid, 163 CLSID*, id) 164 { 165 return CLSIDFromStringA(clsid, id); 166 } 167 168 169 ODINFUNCTION2(DWORD, SHCLSIDFromStringW, LPWSTR, clsid, 170 CLSID*, id) 171 { 172 return CLSIDFromString(clsid, id); 173 } 174 175 176 ODINFUNCTION2(DWORD, SHCLSIDFromStringAW, LPVOID, clsid, 177 CLSID*, id) 178 { 179 if (VERSION_OsIsUnicode()) 180 return SHCLSIDFromStringW ((LPWSTR)clsid, id); 181 return SHCLSIDFromStringA ((LPSTR)clsid, id); 182 } 183 146 184 147 185 /************************************************************************* 148 * SHGetMalloc[SHELL32.220]186 * SHGetMalloc [SHELL32.220] 149 187 * returns the interface to shell malloc. 150 188 * … … 155 193 * heap (ProcessHeap). 156 194 */ 157 DWORD WINAPI SHGetMalloc(LPMALLOC *lpmal) 158 { 159 TRACE("(%p)\n", lpmal); 160 return CoGetMalloc(0,lpmal); 161 } 195 196 ODINFUNCTION1(DWORD, SHGetMalloc, LPMALLOC*, lpmal) 197 { 198 return CoGetMalloc(0,lpmal); 199 } 200 162 201 163 202 /************************************************************************* 164 * SHGetDesktopFolder 203 * SHGetDesktopFolder [SHELL32.216] 165 204 */ 166 205 LPSHELLFOLDER pdesktopfolder=NULL; 167 206 168 DWORD WINAPI SHGetDesktopFolder(IShellFolder **psf)169 { 170 HRESULThres = S_OK;171 172 TRACE_(shell)("%p->(%p)\n",psf,*psf);173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 TRACE_(shell)("-- %p->(%p)\n",psf, *psf);194 207 ODINFUNCTION1(DWORD, SHGetDesktopFolder, IShellFolder**, psf) 208 { 209 HRESULT hres = S_OK; 210 LPCLASSFACTORY lpclf; 211 dprintf(("SHELL32: SHGetDesktopFolder %p->(%p)\n",psf,*psf)); 212 213 *psf=NULL; 214 215 if (!pdesktopfolder) 216 { 217 lpclf = IClassFactory_Constructor(&CLSID_ShellDesktop); 218 if(lpclf) 219 { 220 hres = IClassFactory_CreateInstance(lpclf,NULL,(REFIID)&IID_IShellFolder, (LPVOID*)&pdesktopfolder); 221 IClassFactory_Release(lpclf); 222 } 223 } 224 225 if (pdesktopfolder) 226 { 227 /* even if we create the folder, add a ref so the application canŽt destroy the folder*/ 228 IShellFolder_AddRef(pdesktopfolder); 229 *psf = pdesktopfolder; 230 } 231 232 dprintf(("SHELL32: SHGetDesktopFolder-- %p->(%p)\n",psf, *psf)); 233 return hres; 195 234 } 196 235 … … 204 243 ICOM_VTABLE(IClassFactory)* lpvtbl; 205 244 DWORD ref; 206 CLSID 245 CLSID *rclsid; 207 246 } IClassFactoryImpl; 208 247 … … 215 254 LPCLASSFACTORY iface, REFIID riid, LPVOID *ppvObj) 216 255 { 217 ICOM_THIS(IClassFactoryImpl,iface); 218 char xriid[50]; 219 WINE_StringFromCLSID((LPCLSID)riid,xriid); 220 TRACE("(%p)->(\n\tIID:\t%s)\n",This,xriid); 221 222 *ppvObj = NULL; 223 224 if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ 225 { *ppvObj = This; 226 } 227 else if(IsEqualIID(riid, &IID_IClassFactory)) /*IClassFactory*/ 228 { *ppvObj = (IClassFactory*)This; 229 } 230 231 if(*ppvObj) 232 { IUnknown_AddRef((LPUNKNOWN)*ppvObj); 233 TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); 234 return S_OK; 235 } 236 TRACE("-- Interface: %s E_NOINTERFACE\n", xriid); 237 return E_NOINTERFACE; 256 ICOM_THIS(IClassFactoryImpl,iface); 257 char xriid[50]; 258 WINE_StringFromCLSID((LPCLSID)riid,xriid); 259 260 dprintf(("SHELL32: IClassFactory_fnQueryInterface (%p)->(\n\tIID:\t%s)\n",This,xriid)); 261 262 *ppvObj = NULL; 263 264 if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ 265 { *ppvObj = This; 266 } 267 else if(IsEqualIID(riid, &IID_IClassFactory)) /*IClassFactory*/ 268 { *ppvObj = (IClassFactory*)This; 269 } 270 271 if(*ppvObj) 272 { IUnknown_AddRef((LPUNKNOWN)*ppvObj); 273 dprintf(("SHELL32: IClassFactory_fnQueryInterface -- Interface: (%p)->(%p)\n",ppvObj,*ppvObj)); 274 return S_OK; 275 } 276 dprintf(("SHELL32: IClassFactory_fnQueryInterface -- Interface: %s E_NOINTERFACE\n", xriid)); 277 return E_NOINTERFACE; 238 278 } 239 279 /****************************************************************************** … … 242 282 static ULONG WINAPI IClassFactory_fnAddRef(LPCLASSFACTORY iface) 243 283 { 244 245 TRACE("(%p)->(count=%lu)\n",This,This->ref);246 247 248 284 ICOM_THIS(IClassFactoryImpl,iface); 285 dprintf(("SHELL32: IClassFactory_fnAddRef (%p)->(count=%lu)\n",This,This->ref)); 286 287 shell32_ObjCount++; 288 return ++(This->ref); 249 289 } 250 290 /****************************************************************************** … … 253 293 static ULONG WINAPI IClassFactory_fnRelease(LPCLASSFACTORY iface) 254 294 { 255 256 TRACE("(%p)->(count=%lu)\n",This,This->ref);257 258 259 260 { TRACE("-- destroying IClassFactory(%p)\n",This);261 262 263 264 295 ICOM_THIS(IClassFactoryImpl,iface); 296 dprintf(("SHELL32: IClassFactory_fnRelease (%p)->(count=%lu)\n",This,This->ref)); 297 298 shell32_ObjCount--; 299 if (!--(This->ref)) 300 { dprintf(("SHELL32: IClassFactory_fnRelease -- destroying IClassFactory(%p)\n",This)); 301 HeapFree(GetProcessHeap(),0,This); 302 return 0; 303 } 304 return This->ref; 265 305 } 266 306 /****************************************************************************** … … 270 310 LPCLASSFACTORY iface, LPUNKNOWN pUnknown, REFIID riid, LPVOID *ppObject) 271 311 { 272 273 274 275 charxriid[50];276 277 278 TRACE("%p->(%p,\n\tIID:\t%s,%p)\n",This,pUnknown,xriid,ppObject);279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 ERR("unknown IID requested\n\tIID:\t%s\n",xriid);298 299 300 301 302 303 304 305 306 307 308 309 TRACE("-- Object created: (%p)->%p\n",This,*ppObject);310 311 312 ICOM_THIS(IClassFactoryImpl,iface); 313 IUnknown *pObj = NULL; 314 HRESULT hres; 315 char xriid[50]; 316 317 WINE_StringFromCLSID((LPCLSID)riid,xriid); 318 dprintf(("SHELL32: IClassFactory_fnCreateInstance %p->(%p,\n\tIID:\t%s,%p)\n",This,pUnknown,xriid,ppObject)); 319 320 *ppObject = NULL; 321 322 if(pUnknown) 323 { 324 return(CLASS_E_NOAGGREGATION); 325 } 326 327 if (IsEqualCLSID(This->rclsid, &CLSID_ShellDesktop)) 328 { 329 pObj = (IUnknown *)ISF_Desktop_Constructor(); 330 } 331 else if (IsEqualCLSID(This->rclsid, &CLSID_ShellLink)) 332 { 333 pObj = (IUnknown *)IShellLink_Constructor(FALSE); 334 } 335 else 336 { 337 dprintf(("SHELL32: IClassFactory_fnCreateInstance unknown IID requested\n\tIID:\t%s\n",xriid)); 338 return(E_NOINTERFACE); 339 } 340 341 if (!pObj) 342 { 343 return(E_OUTOFMEMORY); 344 } 345 346 hres = IUnknown_QueryInterface(pObj,riid, ppObject); 347 IUnknown_Release(pObj); 348 349 dprintf(("SHELL32: IClassFactory_fnCreateInstance -- Object created: (%p)->%p\n",This,*ppObject)); 350 351 return hres; 312 352 } 313 353 /****************************************************************************** … … 316 356 static HRESULT WINAPI IClassFactory_fnLockServer(LPCLASSFACTORY iface, BOOL fLock) 317 357 { 318 319 TRACE("%p->(0x%x), not implemented\n",This, fLock);320 358 ICOM_THIS(IClassFactoryImpl,iface); 359 dprintf(("SHELL32: IClassFactory_fnLockServer %p->(0x%x), not implemented\n",This, fLock)); 360 return E_NOTIMPL; 321 361 } 322 362 … … 337 377 LPCLASSFACTORY IClassFactory_Constructor(REFCLSID rclsid) 338 378 { 339 340 341 342 343 344 345 346 TRACE("(%p)->()\n",lpclf);347 348 379 IClassFactoryImpl* lpclf; 380 381 lpclf= (IClassFactoryImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IClassFactoryImpl)); 382 lpclf->ref = 1; 383 lpclf->lpvtbl = &clfvt; 384 lpclf->rclsid = (CLSID*)rclsid; 385 386 dprintf(("SHELL32: IClassFactory_Constructor (%p)->()\n",lpclf)); 387 shell32_ObjCount++; 388 return (LPCLASSFACTORY)lpclf; 349 389 } 350 390 … … 366 406 ICOM_VTABLE(IClassFactory)* lpvtbl; 367 407 DWORD ref; 368 CLSID 369 LPFNCREATEINSTANCE 370 const IID * 371 UINT * 408 CLSID *rclsid; 409 LPFNCREATEINSTANCE lpfnCI; 410 const IID * riidInst; 411 UINT * pcRefDll; /* pointer to refcounter in external dll (ugrrr...) */ 372 412 } IDefClFImpl; 373 413 … … 380 420 LPCLASSFACTORY iface, REFIID riid, LPVOID *ppvObj) 381 421 { 382 383 charxriid[50];384 385 TRACE("(%p)->(\n\tIID:\t%s)\n",This,xriid);386 387 388 389 390 391 392 393 394 395 396 397 { IUnknown_AddRef((LPUNKNOWN)*ppvObj); 398 TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);399 400 401 TRACE("-- Interface: %s E_NOINTERFACE\n", xriid);402 422 ICOM_THIS(IDefClFImpl,iface); 423 char xriid[50]; 424 WINE_StringFromCLSID((LPCLSID)riid,xriid); 425 dprintf(("SHELL32: IDefClF_fnQueryInterface (%p)->(\n\tIID:\t%s)\n",This,xriid)); 426 427 *ppvObj = NULL; 428 429 if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ 430 { *ppvObj = This; 431 } 432 else if(IsEqualIID(riid, &IID_IClassFactory)) /*IClassFactory*/ 433 { *ppvObj = (IClassFactory*)This; 434 } 435 436 if(*ppvObj) 437 { IUnknown_AddRef((LPUNKNOWN)*ppvObj); 438 dprintf(("SHELL32: IDefClF_fnQueryInterface -- Interface: (%p)->(%p)\n",ppvObj,*ppvObj)); 439 return S_OK; 440 } 441 dprintf(("SHELL32: IDefClF_fnQueryInterface -- Interface: %s E_NOINTERFACE\n", xriid)); 442 return E_NOINTERFACE; 403 443 } 404 444 /****************************************************************************** … … 407 447 static ULONG WINAPI IDefClF_fnAddRef(LPCLASSFACTORY iface) 408 448 { 409 410 TRACE("(%p)->(count=%lu)\n",This,This->ref);411 412 413 414 449 ICOM_THIS(IDefClFImpl,iface); 450 dprintf(("SHELL32: IDefClF_fnAddRef (%p)->(count=%lu)\n",This,This->ref)); 451 452 shell32_ObjCount++; 453 454 return ++(This->ref); 415 455 } 416 456 /****************************************************************************** … … 419 459 static ULONG WINAPI IDefClF_fnRelease(LPCLASSFACTORY iface) 420 460 { 421 422 TRACE("(%p)->(count=%lu)\n",This,This->ref);423 424 425 426 427 428 429 430 431 TRACE("-- destroying IClassFactory(%p)\n",This);432 433 434 435 461 ICOM_THIS(IDefClFImpl,iface); 462 dprintf(("SHELL32: IDefClF_fnRelease (%p)->(count=%lu)\n",This,This->ref)); 463 464 shell32_ObjCount--; 465 466 if (!--(This->ref)) 467 { 468 if (This->pcRefDll) 469 (*This->pcRefDll)--; 470 471 dprintf(("SHELL32: IDefClF_fn -- destroying IClassFactory(%p)\n",This)); 472 HeapFree(GetProcessHeap(),0,This); 473 return 0; 474 } 475 return This->ref; 436 476 } 437 477 /****************************************************************************** … … 441 481 LPCLASSFACTORY iface, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject) 442 482 { 443 444 charxriid[50];445 446 447 TRACE("%p->(%p,\n\tIID:\t%s,%p)\n",This,pUnkOuter,xriid,ppvObject);448 449 450 451 452 453 454 455 456 457 458 459 460 461 ERR("unknown IID requested\n\tIID:\t%s\n",xriid);462 483 ICOM_THIS(IDefClFImpl,iface); 484 char xriid[50]; 485 486 WINE_StringFromCLSID((LPCLSID)riid,xriid); 487 dprintf(("SHELL32: IDefClF_fnCreateInterface %p->(%p,\n\tIID:\t%s,%p)\n",This,pUnkOuter,xriid,ppvObject)); 488 489 *ppvObject = NULL; 490 491 if(pUnkOuter) 492 return(CLASS_E_NOAGGREGATION); 493 494 if ( This->riidInst==NULL || 495 IsEqualCLSID(riid, This->riidInst) || 496 IsEqualCLSID(riid, &IID_IUnknown) ) 497 { 498 return This->lpfnCI(pUnkOuter, riid, ppvObject); 499 } 500 501 dprintf(("SHELL32: IDefClF_fn unknown IID requested\n\tIID:\t%s\n",xriid)); 502 return E_NOINTERFACE; 463 503 } 464 504 /****************************************************************************** … … 467 507 static HRESULT WINAPI IDefClF_fnLockServer(LPCLASSFACTORY iface, BOOL fLock) 468 508 { 469 470 TRACE("%p->(0x%x), not implemented\n",This, fLock);471 509 ICOM_THIS(IDefClFImpl,iface); 510 dprintf(("SHELL32: IDefClF_fnLockServer %p->(0x%x), not implemented\n",This, fLock)); 511 return E_NOTIMPL; 472 512 } 473 513 … … 488 528 IClassFactory * IDefClF_fnConstructor(LPFNCREATEINSTANCE lpfnCI, UINT * pcRefDll, REFIID riidInst) 489 529 { 490 491 charxriidInst[50];492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 TRACE("(%p)\n\tIID:\t%s\n",lpclf, xriidInst);507 508 509 } 510 511 512 /****************************************************************************** 513 * SHCreateDefClassObject 514 */ 515 HRESULT WINAPI SHCreateDefClassObject( 516 REFIID riid, 517 LPVOID* ppv, 518 LPFNCREATEINSTANCE lpfnCI, /* create instance callback entry */ 519 UINT *pcRefDll, /* ref count of the dll */ 520 REFIID riidInst) /* optional interface to the instance */ 521 { 522 523 524 525 526 527 TRACE("\n\tIID:\t%s %p %p %p \n\tIIDIns:\t%s\n",528 xriid, ppv, lpfnCI, pcRefDll, xriidInst);529 530 531 532 533 534 535 536 537 538 539 540 541 } 542 530 IDefClFImpl* lpclf; 531 char xriidInst[50]; 532 533 WINE_StringFromCLSID((LPCLSID)riidInst,xriidInst); 534 535 lpclf = (IDefClFImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IDefClFImpl)); 536 lpclf->ref = 1; 537 lpclf->lpvtbl = &dclfvt; 538 lpclf->lpfnCI = lpfnCI; 539 lpclf->pcRefDll = pcRefDll; 540 541 if (pcRefDll) 542 (*pcRefDll)++; 543 544 lpclf->riidInst = riidInst; 545 546 dprintf(("SHELL32: IDefClF_fnConstructor (%p)\n\tIID:\t%s\n",lpclf, xriidInst)); 547 shell32_ObjCount++; 548 return (LPCLASSFACTORY)lpclf; 549 } 550 551 552 /****************************************************************************** 553 * SHCreateDefClassObject [SHELL32.70] 554 */ 555 556 ODINFUNCTION5(HRESULT, SHCreateDefClassObject, REFIID, riid, 557 LPVOID*, ppv, 558 LPFNCREATEINSTANCE,lpfnCI, 559 UINT*, pcRefDll, 560 REFIID, riidInst) 561 { 562 563 char xriid[50],xriidInst[50]; 564 WINE_StringFromCLSID((LPCLSID)riid,xriid); 565 WINE_StringFromCLSID((LPCLSID)riidInst,xriidInst); 566 567 dprintf(("SHELL32: SHCreateDefClassObject \n\tIID:\t%s %p %p %p \n\tIIDIns:\t%s\n", 568 xriid, ppv, lpfnCI, pcRefDll, xriidInst)); 569 570 if ( IsEqualCLSID(riid, &IID_IClassFactory) ) 571 { 572 IClassFactory * pcf = IDefClF_fnConstructor(lpfnCI, pcRefDll, riidInst); 573 if (pcf) 574 { 575 *ppv = pcf; 576 return NOERROR; 577 } 578 return E_OUTOFMEMORY; 579 } 580 return E_NOINTERFACE; 581 } 582
Note:
See TracChangeset
for help on using the changeset viewer.