ReactOS  0.4.14-dev-77-gd9e7c48
shellole.c File Reference
#include <wine/config.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <windef.h>
#include <winbase.h>
#include <shellapi.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <debughlp.h>
#include <wine/debug.h>
#include <wine/unicode.h>
#include "shell32_main.h"
Include dependency graph for shellole.c:

Go to the source code of this file.

Classes

struct  IDefClFImpl
 

Macros

#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COBJMACROS
 
#define NONAMELESSUNION
 

Typedefs

typedef HRESULT(CALLBACKLPFNCREATEINSTANCE) (IUnknown *pUnkOuter, REFIID riid, LPVOID *ppvObject)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
INT WINAPI SHStringFromGUIDW (REFGUID guid, LPWSTR lpszDest, INT cchMax)
 
static IClassFactoryIDefClF_fnConstructor (LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, REFIID riidInst)
 
HRESULT WINAPI SHCoCreateInstance (LPCWSTR aclsid, const CLSID *clsid, LPUNKNOWN pUnkOuter, REFIID refiid, LPVOID *ppv)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID iid, LPVOID *ppv)
 
DWORD WINAPI SHCLSIDFromStringA (LPCSTR clsid, CLSID *id)
 
DWORD WINAPI SHCLSIDFromStringW (LPCWSTR clsid, CLSID *id)
 
DWORD WINAPI SHCLSIDFromStringAW (LPCVOID clsid, CLSID *id)
 
HRESULT WINAPI SHGetMalloc (LPMALLOC *lpmal)
 
LPVOID WINAPI SHAlloc (SIZE_T len)
 
void WINAPI SHFree (LPVOID pv)
 
HRESULT WINAPI SHGetDesktopFolder (IShellFolder **psf)
 
static IDefClFImplimpl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI IDefClF_fnQueryInterface (LPCLASSFACTORY iface, REFIID riid, LPVOID *ppvObj)
 
static ULONG WINAPI IDefClF_fnAddRef (LPCLASSFACTORY iface)
 
static ULONG WINAPI IDefClF_fnRelease (LPCLASSFACTORY iface)
 
static HRESULT WINAPI IDefClF_fnCreateInstance (LPCLASSFACTORY iface, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject)
 
static HRESULT WINAPI IDefClF_fnLockServer (LPCLASSFACTORY iface, BOOL fLock)
 
HRESULT WINAPI SHCreateDefClassObject (REFIID riid, LPVOID *ppv, LPFNCREATEINSTANCE lpfnCI, LPDWORD pcRefDll, REFIID riidInst)
 
void WINAPI DragAcceptFiles (HWND hWnd, BOOL b)
 
void WINAPI DragFinish (HDROP h)
 
BOOL WINAPI DragQueryPoint (HDROP hDrop, POINT *p)
 
UINT WINAPI DragQueryFileA (HDROP hDrop, UINT lFile, LPSTR lpszFile, UINT lLength)
 
UINT WINAPI DragQueryFileW (HDROP hDrop, UINT lFile, LPWSTR lpszwFile, UINT lLength)
 
HRESULT WINAPI SHPropStgCreate (IPropertySetStorage *psstg, REFFMTID fmtid, const CLSID *pclsid, DWORD grfFlags, DWORD grfMode, DWORD dwDisposition, IPropertyStorage **ppstg, UINT *puCodePage)
 
HRESULT WINAPI SHPropStgReadMultiple (IPropertyStorage *pps, UINT uCodePage, ULONG cpspec, const PROPSPEC *rgpspec, PROPVARIANT *rgvar)
 
HRESULT WINAPI SHPropStgWriteMultiple (IPropertyStorage *pps, UINT *uCodePage, ULONG cpspec, const PROPSPEC *rgpspec, PROPVARIANT *rgvar, PROPID propidNameFirst)
 
HRESULT WINAPI SHCreateQueryCancelAutoPlayMoniker (IMoniker **moniker)
 

Variables

struct {
   REFIID   clsid
 
   LPFNCREATEINSTANCE   lpfnCI
 
InterfaceTable []
 
static const IClassFactoryVtbl dclfvt
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 29 of file shellole.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 30 of file shellole.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 31 of file shellole.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 28 of file shellole.c.

Typedef Documentation

◆ LPFNCREATEINSTANCE

typedef HRESULT(CALLBACK * LPFNCREATEINSTANCE) (IUnknown *pUnkOuter, REFIID riid, LPVOID *ppvObject)

Definition at line 52 of file shellole.c.

Function Documentation

◆ DllGetClassObject()

HRESULT WINAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  iid,
LPVOID ppv 
)

Definition at line 206 of file shellole.c.

207 {
208  IClassFactory * pcf = NULL;
209  HRESULT hres;
210  int i;
211 
212  TRACE("CLSID:%s,IID:%s\n",shdebugstr_guid(rclsid),shdebugstr_guid(iid));
213 
214  if (!ppv) return E_INVALIDARG;
215  *ppv = NULL;
216 
217  /* search our internal interface table */
218  for(i=0;InterfaceTable[i].clsid;i++) {
219  if(IsEqualIID(InterfaceTable[i].clsid, rclsid)) {
220  TRACE("index[%u]\n", i);
222  break;
223  }
224  }
225 
226  if (!pcf) {
227  FIXME("failed for CLSID=%s\n", shdebugstr_guid(rclsid));
229  }
230 
231  hres = IClassFactory_QueryInterface(pcf, iid, ppv);
232  IClassFactory_Release(pcf);
233 
234  TRACE("-- pointer to class factory: %p\n",*ppv);
235  return hres;
236 }
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * shdebugstr_guid(const struct _GUID *id)
Definition: debughlp.cpp:414
LPFNCREATEINSTANCE lpfnCI
Definition: shellole.c:61
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
REFIID clsid
Definition: shellole.c:60
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static IClassFactory * IDefClF_fnConstructor(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, REFIID riidInst)
Definition: shellole.c:391
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static const struct @528 InterfaceTable[]
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

Referenced by SHCoCreateInstance().

◆ DragAcceptFiles()

void WINAPI DragAcceptFiles ( HWND  hWnd,
BOOL  b 
)

Definition at line 527 of file shellole.c.

528 {
529  LONG exstyle;
530 
531  if( !IsWindow(hWnd) ) return;
533  if (b)
534  exstyle |= WS_EX_ACCEPTFILES;
535  else
536  exstyle &= ~WS_EX_ACCEPTFILES;
538 }
BOOL WINAPI IsWindow(_In_opt_ HWND)
HWND hWnd
Definition: settings.c:17
#define GWL_EXSTYLE
Definition: winuser.h:845
long LONG
Definition: pedump.c:60
#define GetWindowLongPtrA
Definition: winuser.h:4729
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define SetWindowLongPtrA
Definition: winuser.h:5246
#define WS_EX_ACCEPTFILES
Definition: pedump.c:648

Referenced by _tWinMain(), drop_window_therad(), MainWndProc(), OnCreate(), and OnNcCreate().

◆ DragFinish()

void WINAPI DragFinish ( HDROP  h)

Definition at line 543 of file shellole.c.

544 {
545  TRACE("\n");
546  GlobalFree(h);
547 }
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define TRACE(s)
Definition: solgame.cpp:4
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611

Referenced by drop_window_proc(), LoadClipboardFromDrop(), MainWndDropFiles(), MainWndProc(), NOTEPAD_WndProc(), CMainWindow::OnDropFiles(), OnDropFiles(), and WndProc().

◆ DragQueryFileA()

UINT WINAPI DragQueryFileA ( HDROP  hDrop,
UINT  lFile,
LPSTR  lpszFile,
UINT  lLength 
)

Definition at line 572 of file shellole.c.

577 {
578  LPSTR lpDrop;
579  UINT i = 0;
580  DROPFILES *lpDropFileStruct = GlobalLock(hDrop);
581 
582  TRACE("(%p, %x, %p, %u)\n", hDrop,lFile,lpszFile,lLength);
583 
584  if(!lpDropFileStruct) goto end;
585 
586  lpDrop = (LPSTR) lpDropFileStruct + lpDropFileStruct->pFiles;
587 
588  if(lpDropFileStruct->fWide) {
589  LPWSTR lpszFileW = NULL;
590 
591  if(lpszFile && lFile != 0xFFFFFFFF) {
592  lpszFileW = HeapAlloc(GetProcessHeap(), 0, lLength*sizeof(WCHAR));
593  if(lpszFileW == NULL) {
594  goto end;
595  }
596  }
597  i = DragQueryFileW(hDrop, lFile, lpszFileW, lLength);
598 
599  if(lpszFileW) {
600  WideCharToMultiByte(CP_ACP, 0, lpszFileW, -1, lpszFile, lLength, 0, NULL);
601  HeapFree(GetProcessHeap(), 0, lpszFileW);
602  }
603  goto end;
604  }
605 
606  while (i++ < lFile)
607  {
608  while (*lpDrop++); /* skip filename */
609  if (!*lpDrop)
610  {
611  i = (lFile == 0xFFFFFFFF) ? i : 0;
612  goto end;
613  }
614  }
615 
616  i = strlen(lpDrop);
617  if (!lpszFile ) goto end; /* needed buffer size */
618  lstrcpynA (lpszFile, lpDrop, lLength);
619 end:
620  GlobalUnlock(hDrop);
621  return i;
622 }
#define WideCharToMultiByte
Definition: compat.h:101
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define CP_ACP
Definition: compat.h:99
GLuint GLuint end
Definition: gl.h:1545
char * LPSTR
Definition: xmlstorage.h:182
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
BOOL fWide
Definition: shlobj.h:2118
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
unsigned int UINT
Definition: ndis.h:50
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
#define lstrcpynA
Definition: compat.h:408
WCHAR * LPWSTR
Definition: xmlstorage.h:184
DWORD pFiles
Definition: shlobj.h:2115
UINT WINAPI DragQueryFileW(HDROP hDrop, UINT lFile, LPWSTR lpszwFile, UINT lLength)
Definition: shellole.c:627
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by DragQueryFileW(), and drop_window_proc().

◆ DragQueryFileW()

UINT WINAPI DragQueryFileW ( HDROP  hDrop,
UINT  lFile,
LPWSTR  lpszwFile,
UINT  lLength 
)

Definition at line 627 of file shellole.c.

632 {
633  LPWSTR lpwDrop;
634  UINT i = 0;
635  DROPFILES *lpDropFileStruct = GlobalLock(hDrop);
636 
637  TRACE("(%p, %x, %p, %u)\n", hDrop,lFile,lpszwFile,lLength);
638 
639  if(!lpDropFileStruct) goto end;
640 
641  lpwDrop = (LPWSTR) ((LPSTR)lpDropFileStruct + lpDropFileStruct->pFiles);
642 
643  if(lpDropFileStruct->fWide == FALSE) {
644  LPSTR lpszFileA = NULL;
645 
646  if(lpszwFile && lFile != 0xFFFFFFFF) {
647  lpszFileA = HeapAlloc(GetProcessHeap(), 0, lLength);
648  if(lpszFileA == NULL) {
649  goto end;
650  }
651  }
652  i = DragQueryFileA(hDrop, lFile, lpszFileA, lLength);
653 
654  if(lpszFileA) {
655  MultiByteToWideChar(CP_ACP, 0, lpszFileA, -1, lpszwFile, lLength);
656  HeapFree(GetProcessHeap(), 0, lpszFileA);
657  }
658  goto end;
659  }
660 
661  i = 0;
662  while (i++ < lFile)
663  {
664  while (*lpwDrop++); /* skip filename */
665  if (!*lpwDrop)
666  {
667  i = (lFile == 0xFFFFFFFF) ? i : 0;
668  goto end;
669  }
670  }
671 
672  i = strlenW(lpwDrop);
673  if ( !lpszwFile) goto end; /* needed buffer size */
674  lstrcpynW (lpszwFile, lpwDrop, lLength);
675 end:
676  GlobalUnlock(hDrop);
677  return i;
678 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define CP_ACP
Definition: compat.h:99
GLuint GLuint end
Definition: gl.h:1545
char * LPSTR
Definition: xmlstorage.h:182
#define lstrcpynW
Definition: compat.h:397
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
UINT WINAPI DragQueryFileA(HDROP hDrop, UINT lFile, LPSTR lpszFile, UINT lLength)
Definition: shellole.c:572
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
BOOL fWide
Definition: shlobj.h:2118
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
unsigned int UINT
Definition: ndis.h:50
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
#define MultiByteToWideChar
Definition: compat.h:100
WCHAR * LPWSTR
Definition: xmlstorage.h:184
DWORD pFiles
Definition: shlobj.h:2115
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by BtrfsPropSheet::apply_changes(), CFSDropTarget::DragEnter(), DragQueryFileA(), DragQueryFileWrapW(), CLayerUIPropPage::Initialize(), CDrvDefExt::Initialize(), BtrfsContextMenu::Initialize(), BtrfsVolPropSheet::Initialize(), CFileDefExt::Initialize(), CShellLink::Initialize(), CZipFolder::Initialize(), BtrfsContextMenu::InvokeCommand(), BtrfsPropSheet::load_file_list(), LoadClipboardFromDrop(), MainWndDropFiles(), OnDropFiles(), BtrfsPropSheet::open_as_admin(), show_reflink_paste(), and WndProc().

◆ DragQueryPoint()

BOOL WINAPI DragQueryPoint ( HDROP  hDrop,
POINT p 
)

Definition at line 552 of file shellole.c.

553 {
554  DROPFILES *lpDropFileStruct;
555  BOOL bRet;
556 
557  TRACE("\n");
558 
559  lpDropFileStruct = GlobalLock(hDrop);
560 
561  *p = lpDropFileStruct->pt;
562  bRet = lpDropFileStruct->fNC;
563 
564  GlobalUnlock(hDrop);
565  return bRet;
566 }
POINT pt
Definition: shlobj.h:2116
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL fNC
Definition: shlobj.h:2117
#define TRACE(s)
Definition: solgame.cpp:4
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
GLfloat GLfloat p
Definition: glext.h:8902

◆ IDefClF_fnAddRef()

static ULONG WINAPI IDefClF_fnAddRef ( LPCLASSFACTORY  iface)
static

Definition at line 431 of file shellole.c.

432 {
434  ULONG refCount = InterlockedIncrement(&This->ref);
435 
436  TRACE("(%p)->(count=%u)\n", This, refCount - 1);
437 
438  return refCount;
439 }
static IDefClFImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: shellole.c:380
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1

◆ IDefClF_fnConstructor()

static IClassFactory * IDefClF_fnConstructor ( LPFNCREATEINSTANCE  lpfnCI,
PLONG  pcRefDll,
REFIID  riidInst 
)
static

Definition at line 391 of file shellole.c.

392 {
393  IDefClFImpl* lpclf;
394 
395  lpclf = HeapAlloc(GetProcessHeap(),0,sizeof(IDefClFImpl));
396  lpclf->ref = 1;
397  lpclf->IClassFactory_iface.lpVtbl = &dclfvt;
398  lpclf->lpfnCI = lpfnCI;
399  lpclf->pcRefDll = pcRefDll;
400 
401  if (pcRefDll) InterlockedIncrement(pcRefDll);
402  lpclf->riidInst = riidInst;
403 
404  TRACE("(%p)%s\n",lpclf, shdebugstr_guid(riidInst));
405  return (LPCLASSFACTORY)lpclf;
406 }
IClassFactory IClassFactory_iface
Definition: shellole.c:372
static const IClassFactoryVtbl dclfvt
Definition: shellole.c:385
LONG * pcRefDll
Definition: shell32.cpp:134
const char * shdebugstr_guid(const struct _GUID *id)
Definition: debughlp.cpp:414
LPFNCREATEINSTANCE lpfnCI
Definition: shellole.c:61
LONG ref
Definition: shellole.c:373
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
const IID * riidInst
Definition: shell32.cpp:133
#define InterlockedIncrement
Definition: armddk.h:53
LPFNCREATEINSTANCE lpfnCI
Definition: shell32.cpp:132

Referenced by DllGetClassObject(), and SHCreateDefClassObject().

◆ IDefClF_fnCreateInstance()

static HRESULT WINAPI IDefClF_fnCreateInstance ( LPCLASSFACTORY  iface,
LPUNKNOWN  pUnkOuter,
REFIID  riid,
LPVOID ppvObject 
)
static

Definition at line 463 of file shellole.c.

465 {
467 
468  TRACE("%p->(%p,%s,%p)\n",This,pUnkOuter,shdebugstr_guid(riid),ppvObject);
469 
470  *ppvObject = NULL;
471 
472  if ( This->riidInst==NULL ||
473  IsEqualCLSID(riid, This->riidInst) ||
475  {
476  return This->lpfnCI(pUnkOuter, riid, ppvObject);
477  }
478 
479  ERR("unknown IID requested %s\n",shdebugstr_guid(riid));
480  return E_NOINTERFACE;
481 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
const char * shdebugstr_guid(const struct _GUID *id)
Definition: debughlp.cpp:414
static IDefClFImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: shellole.c:380
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define ERR(fmt,...)
Definition: debug.h:109
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96

◆ IDefClF_fnLockServer()

static HRESULT WINAPI IDefClF_fnLockServer ( LPCLASSFACTORY  iface,
BOOL  fLock 
)
static

Definition at line 485 of file shellole.c.

486 {
488  TRACE("%p->(0x%x), not implemented\n",This, fLock);
489  return E_NOTIMPL;
490 }
static IDefClFImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: shellole.c:380
#define TRACE(s)
Definition: solgame.cpp:4
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ IDefClF_fnQueryInterface()

static HRESULT WINAPI IDefClF_fnQueryInterface ( LPCLASSFACTORY  iface,
REFIID  riid,
LPVOID ppvObj 
)
static

Definition at line 410 of file shellole.c.

412 {
414 
415  TRACE("(%p)->(%s)\n",This,shdebugstr_guid(riid));
416 
417  *ppvObj = NULL;
418 
420  *ppvObj = This;
421  InterlockedIncrement(&This->ref);
422  return S_OK;
423  }
424 
425  TRACE("-- E_NOINTERFACE\n");
426  return E_NOINTERFACE;
427 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
const char * shdebugstr_guid(const struct _GUID *id)
Definition: debughlp.cpp:414
static IDefClFImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: shellole.c:380
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define InterlockedIncrement
Definition: armddk.h:53
const GUID IID_IClassFactory
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ IDefClF_fnRelease()

static ULONG WINAPI IDefClF_fnRelease ( LPCLASSFACTORY  iface)
static

Definition at line 443 of file shellole.c.

444 {
446  ULONG refCount = InterlockedDecrement(&This->ref);
447 
448  TRACE("(%p)->(count=%u)\n", This, refCount + 1);
449 
450  if (!refCount)
451  {
452  if (This->pcRefDll) InterlockedDecrement(This->pcRefDll);
453 
454  TRACE("-- destroying IClassFactory(%p)\n",This);
456  return 0;
457  }
458  return refCount;
459 }
static IDefClFImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: shellole.c:380
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ impl_from_IClassFactory()

static IDefClFImpl* impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 380 of file shellole.c.

381 {
382  return CONTAINING_RECORD(iface, IDefClFImpl, IClassFactory_iface);
383 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by IDefClF_fnAddRef(), IDefClF_fnCreateInstance(), IDefClF_fnLockServer(), IDefClF_fnQueryInterface(), and IDefClF_fnRelease().

◆ SHAlloc()

◆ SHCLSIDFromStringA()

DWORD WINAPI SHCLSIDFromStringA ( LPCSTR  clsid,
CLSID id 
)

Definition at line 253 of file shellole.c.

254 {
255  WCHAR buffer[40];
256  TRACE("(%p(%s) %p)\n", clsid, clsid, id);
257  if (!MultiByteToWideChar( CP_ACP, 0, clsid, -1, buffer, sizeof(buffer)/sizeof(WCHAR) ))
258  return CO_E_CLASSSTRING;
259  return CLSIDFromString( buffer, id );
260 }
#define CP_ACP
Definition: compat.h:99
GLuint buffer
Definition: glext.h:5915
REFIID clsid
Definition: shellole.c:60
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MultiByteToWideChar
Definition: compat.h:100
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2247
#define CO_E_CLASSSTRING
Definition: winerror.h:2806

Referenced by _ILCreateGuidFromStrA(), and SHCLSIDFromStringAW().

◆ SHCLSIDFromStringAW()

DWORD WINAPI SHCLSIDFromStringAW ( LPCVOID  clsid,
CLSID id 
)

Definition at line 266 of file shellole.c.

267 {
268  if (SHELL_OsIsUnicode())
269  return SHCLSIDFromStringW (clsid, id);
270  return SHCLSIDFromStringA (clsid, id);
271 }
DWORD WINAPI SHCLSIDFromStringA(LPCSTR clsid, CLSID *id)
Definition: shellole.c:253
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:130
REFIID clsid
Definition: shellole.c:60
DWORD WINAPI SHCLSIDFromStringW(LPCWSTR clsid, CLSID *id)
Definition: shellole.c:261

◆ SHCLSIDFromStringW()

DWORD WINAPI SHCLSIDFromStringW ( LPCWSTR  clsid,
CLSID id 
)

Definition at line 261 of file shellole.c.

262 {
263  TRACE("(%p(%s) %p)\n", clsid, debugstr_w(clsid), id);
264  return CLSIDFromString(clsid, id);
265 }
REFIID clsid
Definition: shellole.c:60
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2247

Referenced by _ILCreateGuidFromStrW(), SHCLSIDFromStringAW(), SHCoCreateInstance(), and SHCreatePropSheetExtArrayEx().

◆ SHCoCreateInstance()

HRESULT WINAPI SHCoCreateInstance ( LPCWSTR  aclsid,
const CLSID clsid,
LPUNKNOWN  pUnkOuter,
REFIID  refiid,
LPVOID ppv 
)

Definition at line 105 of file shellole.c.

111 {
112  DWORD hres;
113  CLSID iid;
114  const CLSID * myclsid = clsid;
115  WCHAR sKeyName[MAX_PATH];
116  static const WCHAR sCLSID[] = {'C','L','S','I','D','\\','\0'};
117  WCHAR sClassID[60];
118  static const WCHAR sInProcServer32[] = {'\\','I','n','p','r','o','c','S','e','r','v','e','r','3','2','\0'};
119  static const WCHAR sLoadWithoutCOM[] = {'L','o','a','d','W','i','t','h','o','u','t','C','O','M','\0'};
120  WCHAR sDllPath[MAX_PATH];
121  HKEY hKey = 0;
122  DWORD dwSize;
123  IClassFactory * pcf = NULL;
124 
125  if(!ppv) return E_POINTER;
126  *ppv=NULL;
127 
128  /* if the clsid is a string, convert it */
129  if (!clsid)
130  {
131  if (!aclsid) return REGDB_E_CLASSNOTREG;
132  SHCLSIDFromStringW(aclsid, &iid);
133  myclsid = &iid;
134  }
135 
136  TRACE("(%p,%s,unk:%p,%s,%p)\n",
137  aclsid,shdebugstr_guid(myclsid),pUnkOuter,shdebugstr_guid(refiid),ppv);
138 
139  if (SUCCEEDED(DllGetClassObject(myclsid, &IID_IClassFactory,(LPVOID*)&pcf)))
140  {
141  hres = IClassFactory_CreateInstance(pcf, pUnkOuter, refiid, ppv);
142  IClassFactory_Release(pcf);
143  goto end;
144  }
145 
146  /* we look up the dll path in the registry */
147  SHStringFromGUIDW(myclsid, sClassID, sizeof(sClassID)/sizeof(WCHAR));
148  lstrcpyW(sKeyName, sCLSID);
149  lstrcatW(sKeyName, sClassID);
150  lstrcatW(sKeyName, sInProcServer32);
151 
152  if (RegOpenKeyExW(HKEY_CLASSES_ROOT, sKeyName, 0, KEY_READ, &hKey))
153  return E_ACCESSDENIED;
154 
155  /* if a special registry key is set, we load a shell extension without help of OLE32 */
156  if (!SHQueryValueExW(hKey, sLoadWithoutCOM, 0, 0, 0, 0))
157  {
158  /* load an external dll without ole32 */
162 
163  dwSize = sizeof(sDllPath);
164  SHQueryValueExW(hKey, NULL, 0,0, sDllPath, &dwSize );
165 
166  if ((hLibrary = LoadLibraryExW(sDllPath, 0, LOAD_WITH_ALTERED_SEARCH_PATH)) == 0) {
167  ERR("couldn't load InprocServer32 dll %s\n", debugstr_w(sDllPath));
169  goto end;
170  } else if (!(DllGetClassObject = (DllGetClassObjectFunc)GetProcAddress(hLibrary, "DllGetClassObject"))) {
171  ERR("couldn't find function DllGetClassObject in %s\n", debugstr_w(sDllPath));
174  goto end;
175  } else if (FAILED(hres = DllGetClassObject(myclsid, &IID_IClassFactory, (LPVOID*)&pcf))) {
176  TRACE("GetClassObject failed 0x%08x\n", hres);
177  goto end;
178  }
179 
180  hres = IClassFactory_CreateInstance(pcf, pUnkOuter, refiid, ppv);
181  IClassFactory_Release(pcf);
182  } else {
183 
184  /* load an external dll in the usual way */
185  hres = CoCreateInstance(myclsid, pUnkOuter, CLSCTX_INPROC_SERVER, refiid, ppv);
186  }
187 
188 end:
189  if (hKey) RegCloseKey(hKey);
190  if(hres!=S_OK)
191  {
192  ERR("failed (0x%08x) to create CLSID:%s IID:%s\n",
193  hres, shdebugstr_guid(myclsid), shdebugstr_guid(refiid));
194  ERR("class not found in registry\n");
195  }
196 
197  TRACE("-- instance: %p\n",*ppv);
198  return hres;
199 }
#define E_ACCESSDENIED
Definition: winerror.h:2849
#define REFIID
Definition: guiddef.h:118
static HRESULT(WINAPI *pSHPropStgCreate)(IPropertySetStorage *
#define KEY_READ
Definition: nt_native.h:1023
#define REFCLSID
Definition: guiddef.h:117
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
#define CALLBACK
Definition: compat.h:27
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * shdebugstr_guid(const struct _GUID *id)
Definition: debughlp.cpp:414
HRESULT(CALLBACK * DllGetClassObjectFunc)(REFCLSID clsid, REFIID iid, LPVOID *ppv)
Definition: compobj.c:452
GLuint GLuint end
Definition: gl.h:1545
#define LOAD_WITH_ALTERED_SEARCH_PATH
Definition: winbase.h:339
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
REFIID clsid
Definition: shellole.c:60
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:405
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI SHCLSIDFromStringW(LPCWSTR clsid, CLSID *id)
Definition: shellole.c:261
DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue, LPDWORD lpReserved, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1461
HMODULE hLibrary
Definition: odbccp32.c:12
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
#define REGDB_E_CLASSNOTREG
Definition: winerror.h:2696
#define lstrcpyW
Definition: compat.h:406
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define GetProcAddress(x, y)
Definition: compat.h:410
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define E_POINTER
Definition: winerror.h:2365
const GUID IID_IClassFactory
INT WINAPI SHStringFromGUIDW(REFGUID guid, LPWSTR lpszDest, INT cchMax)
Definition: ordinal.c:608
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
#define SUCCEEDED(hr)
Definition: intsafe.h:57
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
Definition: shellole.c:206

Referenced by CFSFolder::_CreateShellExtInstance(), AssocCreate(), CFSFolder::CreateViewObject(), CDefaultContextMenu::LoadDynamicContextMenuHandler(), and SHELL32_CoCreateInitSF().

◆ SHCreateDefClassObject()

HRESULT WINAPI SHCreateDefClassObject ( REFIID  riid,
LPVOID ppv,
LPFNCREATEINSTANCE  lpfnCI,
LPDWORD  pcRefDll,
REFIID  riidInst 
)

Definition at line 504 of file shellole.c.

510 {
511  IClassFactory * pcf;
512 
513  TRACE("%s %p %p %p %s\n",
514  shdebugstr_guid(riid), ppv, lpfnCI, pcRefDll, shdebugstr_guid(riidInst));
515 
517  if (! (pcf = IDefClF_fnConstructor(lpfnCI, (PLONG)pcRefDll, riidInst))) return E_OUTOFMEMORY;
518  *ppv = pcf;
519  return S_OK;
520 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * shdebugstr_guid(const struct _GUID *id)
Definition: debughlp.cpp:414
LPFNCREATEINSTANCE lpfnCI
Definition: shellole.c:61
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static IClassFactory * IDefClF_fnConstructor(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, REFIID riidInst)
Definition: shellole.c:391
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
const GUID IID_IClassFactory
signed int * PLONG
Definition: retypes.h:5
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96

◆ SHCreateQueryCancelAutoPlayMoniker()

HRESULT WINAPI SHCreateQueryCancelAutoPlayMoniker ( IMoniker **  moniker)

Definition at line 811 of file shellole.c.

812 {
813  TRACE("%p\n", moniker);
814 
815  if (!moniker) return E_INVALIDARG;
816  return CreateClassMoniker(&CLSID_QueryCancelAutoPlay, moniker);
817 }
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
Definition: main.c:41
HRESULT WINAPI CreateClassMoniker(REFCLSID rclsid, IMoniker **ppmk)
Definition: classmoniker.c:702

◆ SHFree()

void WINAPI SHFree ( LPVOID  pv)

Definition at line 331 of file shellole.c.

332 {
333  TRACE("%p\n",pv);
334  CoTaskMemFree(pv);
335 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by _DestroyCallback(), CFSDropTarget::_DoDrop(), _ILCreateControlPanel(), _ILCreatePrinters(), _ILFreeaPidl(), CFSDropTarget::_RepositionItems(), _tmain(), CDesktopFolderEnum::AddItemsFromClassicStartMenuKey(), BrsFolder_NewFolder(), BrsFolder_OnDestroy(), BrsFolder_Treeview_Delete(), BrsFolder_Treeview_Rename(), CRecycleBinEnum::CBEnumRecycleBin(), CBSearchRecycleBin(), CPrintersEnum::CreatePrintersEnumList(), CEnumIDListBase::DeleteList(), DeleteNode(), CDefaultContextMenu::DoCreateNewFolder(), DrivesContextMenuCallback(), CAddressEditBox::Execute(), FileMenu_DeleteAllItems(), FileMenu_Destroy(), CDefView::fill_list(), CDefView::FillList(), FillTreeView(), FindExecutableA(), FM_SetMenuParameter(), CDefView::GetSelections(), ILAppendID(), ILFree(), ILLoadFromStream(), CNetworkConnections::Initialize(), CRecycleBin::Initialize(), COpenWithMenu::Initialize(), CNetFolder::Initialize(), CPrinterFolder::Initialize(), CControlPanelFolder::Initialize(), CFSFolder::Initialize(), CDesktopFolderEnum::Initialize(), CCPLItemMenu::InvokeCommand(), CDefView::LV_RenameItem(), CDefView::OnDestroy(), CDefView::OnNotify(), OpenAs_RunDLLA(), r_verify_pidl(), RegFolderContextMenuCallback(), RenderFILENAMEA(), RenderFILENAMEW(), CNewMenu::SelectNewItem(), SHBindToParent(), SHChangeNotify(), Shell_DefaultContextMenuCallBack(), ShellExecCmdLine(), ShellExecuteExA(), SHGetFileInfoW(), sic_free(), SIC_IconAppend(), CFindFolder::StartSearch(), StartWithCommandLine(), test_printers_folder(), WOWShellExecute(), CAdminToolsFolder::~CAdminToolsFolder(), CControlPanelFolder::~CControlPanelFolder(), CDefView::~CDefView(), CDrivesFolder::~CDrivesFolder(), CEnumIDList::~CEnumIDList(), CFontsFolder::~CFontsFolder(), CFSDropTarget::~CFSDropTarget(), CFSFolder::~CFSFolder(), CMyDocsFolder::~CMyDocsFolder(), CNetFolder::~CNetFolder(), CNetworkConnections::~CNetworkConnections(), CPrinterFolder::~CPrinterFolder(), and CRecycleBin::~CRecycleBin().

◆ SHGetDesktopFolder()

HRESULT WINAPI SHGetDesktopFolder ( IShellFolder **  psf)

Definition at line 341 of file shellole.c.

342 {
343  HRESULT hres;
344 
345  TRACE("(%p)\n", psf);
346 
347  if(!psf) return E_INVALIDARG;
348 
349  *psf = NULL;
350  hres = ISF_Desktop_Constructor(NULL, &IID_IShellFolder, (LPVOID*)psf);
351 
352  TRACE("-- %p->(%p) 0x%08x\n", psf, *psf, hres);
353  return hres;
354 }
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77

◆ SHGetMalloc()

HRESULT WINAPI SHGetMalloc ( LPMALLOC lpmal)

Definition at line 290 of file shellole.c.

291 {
292  TRACE("(%p)\n", lpmal);
293  return CoGetMalloc(MEMCTX_TASK, lpmal);
294 }
HRESULT WINAPI CoGetMalloc(DWORD context, IMalloc **imalloc)
Definition: ifs.c:383
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by check_lnk_(), CHSourceDlgProc(), create_lnk_(), CommonShellMalloc::init(), init_function_pointers(), loadShell32(), and SHAddToRecentDocs().

◆ SHPropStgCreate()

HRESULT WINAPI SHPropStgCreate ( IPropertySetStorage psstg,
REFFMTID  fmtid,
const CLSID pclsid,
DWORD  grfFlags,
DWORD  grfMode,
DWORD  dwDisposition,
IPropertyStorage **  ppstg,
UINT puCodePage 
)

Definition at line 683 of file shellole.c.

686 {
687  PROPSPEC prop;
688  PROPVARIANT ret;
689  HRESULT hres;
690 
691  TRACE("%p %s %s %x %x %x %p %p\n", psstg, debugstr_guid(fmtid), debugstr_guid(pclsid),
692  grfFlags, grfMode, dwDisposition, ppstg, puCodePage);
693 
694  hres = IPropertySetStorage_Open(psstg, fmtid, grfMode, ppstg);
695 
696  switch(dwDisposition) {
697  case CREATE_ALWAYS:
698  if(SUCCEEDED(hres)) {
699  IPropertyStorage_Release(*ppstg);
700  hres = IPropertySetStorage_Delete(psstg, fmtid);
701  if(FAILED(hres))
702  return hres;
703  hres = E_FAIL;
704  }
705 
706  case OPEN_ALWAYS:
707  case CREATE_NEW:
708  if(FAILED(hres))
709  hres = IPropertySetStorage_Create(psstg, fmtid, pclsid,
710  grfFlags, grfMode, ppstg);
711 
712  case OPEN_EXISTING:
713  if(FAILED(hres))
714  return hres;
715 
716  if(puCodePage) {
717  prop.ulKind = PRSPEC_PROPID;
718  prop.u.propid = PID_CODEPAGE;
719  hres = IPropertyStorage_ReadMultiple(*ppstg, 1, &prop, &ret);
720  if(FAILED(hres) || ret.vt!=VT_I2)
721  *puCodePage = 0;
722  else
723  *puCodePage = ret.u.iVal;
724  }
725  }
726 
727  return S_OK;
728 }
#define E_FAIL
Definition: ddrawi.h:102
#define PID_CODEPAGE
Definition: suminfo.c:43
#define debugstr_guid
Definition: kernel32.h:35
#define OPEN_EXISTING
Definition: compat.h:426
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define OPEN_ALWAYS
Definition: disk.h:70
int ret
#define S_OK
Definition: intsafe.h:59
#define CREATE_ALWAYS
Definition: disk.h:72
#define CREATE_NEW
Definition: disk.h:69
Definition: compat.h:1938
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ SHPropStgReadMultiple()

HRESULT WINAPI SHPropStgReadMultiple ( IPropertyStorage pps,
UINT  uCodePage,
ULONG  cpspec,
const PROPSPEC *  rgpspec,
PROPVARIANT *  rgvar 
)

Definition at line 733 of file shellole.c.

735 {
736  STATPROPSETSTG stat;
737  HRESULT hres;
738 
739  FIXME("%p %u %u %p %p\n", pps, uCodePage, cpspec, rgpspec, rgvar);
740 
741  memset(rgvar, 0, cpspec*sizeof(PROPVARIANT));
742  hres = IPropertyStorage_ReadMultiple(pps, cpspec, rgpspec, rgvar);
743  if(FAILED(hres))
744  return hres;
745 
746  if(!uCodePage) {
747  PROPSPEC prop;
748  PROPVARIANT ret;
749 
750  prop.ulKind = PRSPEC_PROPID;
751  prop.u.propid = PID_CODEPAGE;
752  hres = IPropertyStorage_ReadMultiple(pps, 1, &prop, &ret);
753  if(FAILED(hres) || ret.vt!=VT_I2)
754  return S_OK;
755 
756  uCodePage = ret.u.iVal;
757  }
758 
759  hres = IPropertyStorage_Stat(pps, &stat);
760  if(FAILED(hres))
761  return S_OK;
762 
763  /* TODO: do something with codepage and stat */
764  return S_OK;
765 }
#define PID_CODEPAGE
Definition: suminfo.c:43
#define FIXME(fmt,...)
Definition: debug.h:110
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
int ret
Definition: stat.h:55
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345
#define S_OK
Definition: intsafe.h:59
#define memset(x, y, z)
Definition: compat.h:39
Definition: compat.h:1938

◆ SHPropStgWriteMultiple()

HRESULT WINAPI SHPropStgWriteMultiple ( IPropertyStorage pps,
UINT uCodePage,
ULONG  cpspec,
const PROPSPEC *  rgpspec,
PROPVARIANT *  rgvar,
PROPID  propidNameFirst 
)

Definition at line 770 of file shellole.c.

772 {
773  STATPROPSETSTG stat;
774  UINT codepage;
775  HRESULT hres;
776 
777  FIXME("%p %p %u %p %p %d\n", pps, uCodePage, cpspec, rgpspec, rgvar, propidNameFirst);
778 
779  hres = IPropertyStorage_Stat(pps, &stat);
780  if(FAILED(hres))
781  return hres;
782 
783  if(uCodePage && *uCodePage)
784  codepage = *uCodePage;
785  else {
786  PROPSPEC prop;
787  PROPVARIANT ret;
788 
789  prop.ulKind = PRSPEC_PROPID;
790  prop.u.propid = PID_CODEPAGE;
791  hres = IPropertyStorage_ReadMultiple(pps, 1, &prop, &ret);
792  if(FAILED(hres))
793  return hres;
794  if(ret.vt!=VT_I2 || !ret.u.iVal)
795  return E_FAIL;
796 
797  codepage = ret.u.iVal;
798  if(uCodePage)
799  *uCodePage = codepage;
800  }
801 
802  /* TODO: do something with codepage and stat */
803 
804  hres = IPropertyStorage_WriteMultiple(pps, cpspec, rgpspec, rgvar, propidNameFirst);
805  return hres;
806 }
#define E_FAIL
Definition: ddrawi.h:102
#define PID_CODEPAGE
Definition: suminfo.c:43
#define FIXME(fmt,...)
Definition: debug.h:110
int codepage
Definition: win_iconv.c:156
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
int ret
Definition: stat.h:55
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345
unsigned int UINT
Definition: ndis.h:50
Definition: compat.h:1938

◆ SHStringFromGUIDW()

INT WINAPI SHStringFromGUIDW ( REFGUID  guid,
LPWSTR  lpszDest,
INT  cchMax 
)

Definition at line 608 of file ordinal.c.

609 {
610  WCHAR xguid[40];
611  INT iLen;
612  static const WCHAR wszFormat[] = {'{','%','0','8','l','X','-','%','0','4','X','-','%','0','4','X','-',
613  '%','0','2','X','%','0','2','X','-','%','0','2','X','%','0','2','X','%','0','2','X','%','0','2',
614  'X','%','0','2','X','%','0','2','X','}',0};
615 
616  TRACE("(%s,%p,%d)\n", debugstr_guid(guid), lpszDest, cchMax);
617 
618  sprintfW(xguid, wszFormat, guid->Data1, guid->Data2, guid->Data3,
619  guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
620  guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);
621 
622  iLen = strlenW(xguid) + 1;
623 
624  if (iLen > cchMax)
625  return 0;
626  memcpy(lpszDest, xguid, iLen*sizeof(WCHAR));
627  return iLen;
628 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
int32_t INT
Definition: typedefs.h:56
const GUID * guid
WCHAR lpszDest[260]
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
UINT cchMax
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define sprintfW
Definition: unicode.h:58

Referenced by SHCoCreateInstance().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )

Variable Documentation

◆ clsid

◆ dclfvt

static const IClassFactoryVtbl dclfvt
static
Initial value:
=
{
}
static ULONG WINAPI IDefClF_fnAddRef(LPCLASSFACTORY iface)
Definition: shellole.c:431
static HRESULT WINAPI IDefClF_fnLockServer(LPCLASSFACTORY iface, BOOL fLock)
Definition: shellole.c:485
static HRESULT WINAPI IDefClF_fnQueryInterface(LPCLASSFACTORY iface, REFIID riid, LPVOID *ppvObj)
Definition: shellole.c:410
static HRESULT WINAPI IDefClF_fnCreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject)
Definition: shellole.c:463
static ULONG WINAPI IDefClF_fnRelease(LPCLASSFACTORY iface)
Definition: shellole.c:443

Definition at line 385 of file shellole.c.

Referenced by IDefClF_fnConstructor().

◆ InterfaceTable

const { ... } InterfaceTable[]
Initial value:
= {
{&CLSID_ApplicationAssociationRegistration, ApplicationAssociationRegistration_Constructor},
{&CLSID_AutoComplete, IAutoComplete_Constructor},
{&CLSID_ControlPanel, IControlPanel_Constructor},
{&CLSID_DragDropHelper, IDropTargetHelper_Constructor},
{&CLSID_FolderShortcut, FolderShortcut_Constructor},
{&CLSID_MyComputer, ISF_MyComputer_Constructor},
{&CLSID_MyDocuments, MyDocuments_Constructor},
{&CLSID_NetworkPlaces, ISF_NetworkPlaces_Constructor},
{&CLSID_Printers, Printers_Constructor},
{&CLSID_QueryAssociations, QueryAssociations_Constructor},
{&CLSID_RecycleBin, RecycleBin_Constructor},
{&CLSID_ShellDesktop, ISF_Desktop_Constructor},
{&CLSID_ShellFSFolder, IFSFolder_Constructor},
{&CLSID_ShellItem, IShellItem_Constructor},
{&CLSID_ShellLink, IShellLink_Constructor},
{&CLSID_UnixDosFolder, UnixDosFolder_Constructor},
{&CLSID_UnixFolder, UnixFolder_Constructor},
{&CLSID_ExplorerBrowser,ExplorerBrowser_Constructor},
{&CLSID_KnownFolderManager, KnownFolderManager_Constructor},
{&CLSID_Shell, IShellDispatch_Constructor},
}
const GUID CLSID_UnixDosFolder
const GUID CLSID_UnixFolder
smooth NULL
Definition: ftsmooth.c:416

Referenced by DllGetClassObject().

◆ lpfnCI