ReactOS  0.4.13-dev-92-gf251225
cdlg32.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "objbase.h"
#include "rpcproxy.h"
#include "commdlg.h"
#include "cderr.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "cdlg.h"
Include dependency graph for cdlg32.c:

Go to the source code of this file.

Classes

struct  IClassFactoryImpl
 

Macros

#define COBJMACROS
 
#define GPA(dest, hinst, name)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (commdlg)
 
 LPITEMIDLIST (WINAPI *COMDLG32_SHSimpleIDListFromPathAW)(LPCVOID) DECLSPEC_HIDDEN
 
BOOL WINAPI DllMain (HINSTANCE hInstance, DWORD Reason, LPVOID Reserved)
 
voidCOMDLG32_AllocMem (int size)
 
void COMDLG32_SetCommDlgExtendedError (DWORD err)
 
DWORD WINAPI CommDlgExtendedError (void)
 
static IClassFactoryImplimpl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI CDLGCF_QueryInterface (IClassFactory *iface, REFIID riid, void **ppobj)
 
static ULONG WINAPI CDLGCF_AddRef (IClassFactory *iface)
 
static ULONG WINAPI CDLGCF_Release (IClassFactory *iface)
 
static HRESULT WINAPI CDLGCF_CreateInstance (IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppobj)
 
static HRESULT WINAPI CDLGCF_LockServer (IClassFactory *iface, BOOL dolock)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, void **ppv)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 

Variables

DECLSPEC_HIDDEN HINSTANCE COMDLG32_hInstance = 0
 
static DWORD COMDLG32_TlsIndex = TLS_OUT_OF_INDEXES
 
static HINSTANCE SHELL32_hInstance
 
static const char GPA_string [] = "Failed to get entry point %s for hinst = %p\n"
 
static const IClassFactoryVtbl CDLGCF_Vtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 24 of file cdlg32.c.

◆ GPA

#define GPA (   dest,
  hinst,
  name 
)
Value:
if(!(dest = (void*)GetProcAddress(hinst,name)))\
{ \
return FALSE; \
}
#define debugstr_a
Definition: kernel32.h:31
static const char GPA_string[]
Definition: cdlg32.c:60
Definition: name.c:36
static HINSTANCE hinst
Definition: edit.c:551
#define GetProcAddress(x, y)
Definition: compat.h:410
static char * dest
Definition: rtl.c:135

Definition at line 61 of file cdlg32.c.

Function Documentation

◆ CDLGCF_AddRef()

static ULONG WINAPI CDLGCF_AddRef ( IClassFactory iface)
static

Definition at line 193 of file cdlg32.c.

194 {
195  return 2; /* non-heap based object */
196 }

◆ CDLGCF_CreateInstance()

static HRESULT WINAPI CDLGCF_CreateInstance ( IClassFactory iface,
IUnknown pOuter,
REFIID  riid,
void **  ppobj 
)
static

Definition at line 209 of file cdlg32.c.

211 {
213  return This->cf(pOuter, riid, ppobj);
214 }
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: cdlg32.c:161
REFIID riid
Definition: precomp.h:44

◆ CDLGCF_LockServer()

static HRESULT WINAPI CDLGCF_LockServer ( IClassFactory iface,
BOOL  dolock 
)
static

Definition at line 219 of file cdlg32.c.

220 {
221  TRACE("%p (%d)\n", iface, dolock);
222  return S_OK;
223 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ CDLGCF_QueryInterface()

static HRESULT WINAPI CDLGCF_QueryInterface ( IClassFactory iface,
REFIID  riid,
void **  ppobj 
)
static

Definition at line 169 of file cdlg32.c.

171 {
172  TRACE("%p (%s %p)\n", iface, debugstr_guid(riid), ppobj);
173 
174  if(!ppobj)
175  return E_POINTER;
176 
178  {
179  *ppobj = iface;
180  IClassFactory_AddRef(iface);
181  return S_OK;
182  }
183 
184  WARN("Interface not supported.\n");
185 
186  *ppobj = NULL;
187  return E_NOINTERFACE;
188 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define E_POINTER
Definition: winerror.h:2365
const GUID IID_IClassFactory

◆ CDLGCF_Release()

static ULONG WINAPI CDLGCF_Release ( IClassFactory iface)
static

Definition at line 201 of file cdlg32.c.

202 {
203  return 1; /* non-heap based object */
204 }

◆ COMDLG32_AllocMem()

void* COMDLG32_AllocMem ( int  size)

Definition at line 100 of file cdlg32.c.

101 {
102  void *ptr = heap_alloc_zero(size);
103 
104  if (!ptr)
105  {
107  return NULL;
108  }
109 
110  return ptr;
111 }
void COMDLG32_SetCommDlgExtendedError(DWORD err)
Definition: cdlg32.c:119
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
#define CDERR_MEMALLOCFAILURE
Definition: cderr.h:14

Referenced by FindTextA(), FindTextW(), ReplaceTextA(), and ReplaceTextW().

◆ COMDLG32_SetCommDlgExtendedError()

void COMDLG32_SetCommDlgExtendedError ( DWORD  err)

Definition at line 119 of file cdlg32.c.

120 {
121  TRACE("(%08x)\n", err);
126  else
127  FIXME("No Tls Space\n");
128 }
static DWORD COMDLG32_TlsIndex
Definition: cdlg32.c:44
BOOL WINAPI TlsSetValue(IN DWORD Index, IN LPVOID Value)
Definition: thread.c:1199
#define FIXME(fmt,...)
Definition: debug.h:110
#define TRACE(s)
Definition: solgame.cpp:4
DWORD WINAPI TlsAlloc(VOID)
Definition: thread.c:1023
#define TLS_OUT_OF_INDEXES
Definition: winbase.h:530
#define err(...)
uint32_t DWORD_PTR
Definition: typedefs.h:63

Referenced by ChooseColorW(), ChooseFontA(), ChooseFontW(), COMDLG32_AllocMem(), COMDLG32_FR_CheckPartial(), COMDLG32_FR_DoFindReplace(), CreateTemplateDialog(), FD31_GetTemplate(), FILEDLG95_OnOpen(), GetFileName95(), GetOpenFileNameA(), GetOpenFileNameW(), GetSaveFileNameA(), GetSaveFileNameW(), init_filedlg_infoW(), pagesetup_common(), PRINTDLG_WMInitDialog(), PRINTDLG_WMInitDialogW(), PrintDlgA(), PrintDlgExA(), PrintDlgExW(), and PrintDlgW().

◆ CommDlgExtendedError()

DWORD WINAPI CommDlgExtendedError ( void  )

Definition at line 139 of file cdlg32.c.

140 {
143  else
144  return 0; /* we never set an error, so there isn't one */
145 }
static DWORD COMDLG32_TlsIndex
Definition: cdlg32.c:44
#define TLS_OUT_OF_INDEXES
Definition: winbase.h:530
uint32_t DWORD_PTR
Definition: typedefs.h:63
LPVOID WINAPI TlsGetValue(IN DWORD Index)
Definition: thread.c:1163

Referenced by CheckCommDlgError(), choose_font(), DoOpenFile(), DoSaveFile(), ExportFile(), MountFloppy(), test_arrange(), test_create_view_template(), test_create_view_window2(), test_DialogCancel(), test_extension_helper(), test_getfolderpath(), test_mru(), test_null_filename(), test_ok(), test_PageSetupDlgA(), test_PrintDlgA(), test_PrintDlgExW(), test_resizable2(), and test_resize().

◆ DllGetClassObject()

HRESULT WINAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  riid,
void **  ppv 
)

Definition at line 237 of file cdlg32.c.

238 {
239  static IClassFactoryImpl FileOpenDlgClassFactory = {{&CDLGCF_Vtbl}, FileOpenDialog_Constructor};
240  static IClassFactoryImpl FileSaveDlgClassFactory = {{&CDLGCF_Vtbl}, FileSaveDialog_Constructor};
241 
242  TRACE("%s, %s, %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
243 
244  if(IsEqualGUID(&CLSID_FileOpenDialog, rclsid))
245  return IClassFactory_QueryInterface(&FileOpenDlgClassFactory.IClassFactory_iface, riid, ppv);
246 
247  if(IsEqualGUID(&CLSID_FileSaveDialog, rclsid))
248  return IClassFactory_QueryInterface(&FileSaveDlgClassFactory.IClassFactory_iface, riid, ppv);
249 
251 }
HRESULT FileOpenDialog_Constructor(IUnknown *pUnkOuter, REFIID riid, void **ppv) DECLSPEC_HIDDEN
Definition: itemdlg.c:4664
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
#define debugstr_guid
Definition: kernel32.h:35
HRESULT FileSaveDialog_Constructor(IUnknown *pUnkOuter, REFIID riid, void **ppv) DECLSPEC_HIDDEN
Definition: itemdlg.c:4669
#define TRACE(s)
Definition: solgame.cpp:4
static const IClassFactoryVtbl CDLGCF_Vtbl
Definition: cdlg32.c:225
IClassFactory IClassFactory_iface
Definition: main.c:58
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hInstance,
DWORD  Reason,
LPVOID  Reserved 
)

Definition at line 68 of file cdlg32.c.

69 {
70  TRACE("(%p, %d, %p)\n", hInstance, Reason, Reserved);
71 
72  switch(Reason)
73  {
74  case DLL_PROCESS_ATTACH:
77 
78  SHELL32_hInstance = GetModuleHandleA("SHELL32.DLL");
79 
80  /* SHELL */
81  GPA(COMDLG32_SHSimpleIDListFromPathAW, SHELL32_hInstance, (LPCSTR)162);
82  break;
83 
84  case DLL_PROCESS_DETACH:
85  if (Reserved) break;
87  break;
88  }
89  return TRUE;
90 }
static DWORD COMDLG32_TlsIndex
Definition: cdlg32.c:44
#define TRUE
Definition: types.h:120
DECLSPEC_HIDDEN HINSTANCE COMDLG32_hInstance
Definition: cdlg32.c:42
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
HINSTANCE hInstance
Definition: charmap.c:20
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
const char * LPCSTR
Definition: xmlstorage.h:183
#define GPA(dest, hinst, name)
Definition: cdlg32.c:61
#define DLL_PROCESS_DETACH
Definition: compat.h:119
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI TlsFree(IN DWORD Index)
Definition: thread.c:1089
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:819
#define TLS_OUT_OF_INDEXES
Definition: winbase.h:530
static HINSTANCE SHELL32_hInstance
Definition: cdlg32.c:46
PVOID PVOID PWCHAR PVOID USHORT PULONG Reason
Definition: env.c:45

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 256 of file cdlg32.c.

257 {
258 #ifdef __REACTOS__
259  return E_FAIL; // FIXME: __wine_register_resources(COMDLG32_hInstance);
260 #else
262 #endif
263 }
DECLSPEC_HIDDEN HINSTANCE COMDLG32_hInstance
Definition: cdlg32.c:42
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
#define E_FAIL
Definition: ddrawi.h:102

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 268 of file cdlg32.c.

269 {
270 #ifdef __REACTOS__
271  return E_FAIL; // FIXME: __wine_unregister_resources(COMDLG32_hInstance);
272 #else
274 #endif
275 }
DECLSPEC_HIDDEN HINSTANCE COMDLG32_hInstance
Definition: cdlg32.c:42
#define E_FAIL
Definition: ddrawi.h:102
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110

◆ impl_from_IClassFactory()

static IClassFactoryImpl* impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 161 of file cdlg32.c.

162 {
163  return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
164 }
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 CDLGCF_CreateInstance().

◆ LPITEMIDLIST()

LPITEMIDLIST ( WINAPI COMDLG32_SHSimpleIDListFromPathAW)

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( commdlg  )

Variable Documentation

◆ CDLGCF_Vtbl

const IClassFactoryVtbl CDLGCF_Vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI CDLGCF_LockServer(IClassFactory *iface, BOOL dolock)
Definition: cdlg32.c:219
static HRESULT WINAPI CDLGCF_CreateInstance(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppobj)
Definition: cdlg32.c:209
static ULONG WINAPI CDLGCF_Release(IClassFactory *iface)
Definition: cdlg32.c:201
static ULONG WINAPI CDLGCF_AddRef(IClassFactory *iface)
Definition: cdlg32.c:193
static HRESULT WINAPI CDLGCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppobj)
Definition: cdlg32.c:169

Definition at line 225 of file cdlg32.c.

Referenced by DllGetClassObject().

◆ COMDLG32_hInstance

◆ COMDLG32_TlsIndex

DWORD COMDLG32_TlsIndex = TLS_OUT_OF_INDEXES
static

Definition at line 44 of file cdlg32.c.

Referenced by COMDLG32_SetCommDlgExtendedError(), CommDlgExtendedError(), and DllMain().

◆ GPA_string

const char GPA_string[] = "Failed to get entry point %s for hinst = %p\n"
static

Definition at line 60 of file cdlg32.c.

◆ SHELL32_hInstance

HINSTANCE SHELL32_hInstance
static

Definition at line 46 of file cdlg32.c.

Referenced by DllMain().