ReactOS  0.4.15-dev-1384-g878186b
inetcomm_main.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winnt.h"
#include "winuser.h"
#include "ole2.h"
#include "ocidl.h"
#include "rpcproxy.h"
#include "initguid.h"
#include "mimeole.h"
#include "inetcomm_private.h"
#include "wine/debug.h"
Include dependency graph for inetcomm_main.c:

Go to the source code of this file.

Classes

struct  cf
 

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (inetcomm)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 
static cfimpl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI cf_QueryInterface (IClassFactory *iface, REFIID riid, LPVOID *ppobj)
 
static ULONG WINAPI cf_AddRef (IClassFactory *iface)
 
static ULONG WINAPI cf_Release (IClassFactory *iface)
 
static HRESULT WINAPI cf_CreateInstance (IClassFactory *iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
 
static HRESULT WINAPI cf_LockServer (IClassFactory *iface, BOOL dolock)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID iid, LPVOID *ppv)
 
HRESULT WINAPI DllCanUnloadNow (void)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 

Variables

typedef helpstring
 
static HINSTANCE instance
 
static const struct IClassFactoryVtbl cf_vtbl
 
static cf mime_body_cf = { { &cf_vtbl }, MimeBody_create }
 
static cf mime_allocator_cf = { { &cf_vtbl }, MimeAllocator_create }
 
static cf mime_message_cf = { { &cf_vtbl }, MimeMessage_create }
 
static cf mime_security_cf = { { &cf_vtbl }, MimeSecurity_create }
 
static cf virtual_stream_cf = { { &cf_vtbl }, VirtualStream_create }
 
static cf mhtml_protocol_cf = { { &cf_vtbl }, MimeHtmlProtocol_create }
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file inetcomm_main.c.

Function Documentation

◆ cf_AddRef()

static ULONG WINAPI cf_AddRef ( IClassFactory iface)
static

Definition at line 99 of file inetcomm_main.c.

100 {
101  return 2;
102 }

◆ cf_CreateInstance()

static HRESULT WINAPI cf_CreateInstance ( IClassFactory iface,
LPUNKNOWN  pOuter,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 109 of file inetcomm_main.c.

111 {
112  cf *This = impl_from_IClassFactory( iface );
113  HRESULT r;
114  IUnknown *punk;
115 
116  TRACE("%p %s %p\n", pOuter, debugstr_guid(riid), ppobj );
117 
118  *ppobj = NULL;
119 
120  if (pOuter && !IsEqualGUID(&IID_IUnknown, riid))
121  return CLASS_E_NOAGGREGATION;
122 
123  r = This->create_object( pOuter, (LPVOID*) &punk );
124  if (FAILED(r))
125  return r;
126 
127  if (IsEqualGUID(&IID_IUnknown, riid)) {
128  *ppobj = punk;
129  return S_OK;
130  }
131 
132  r = IUnknown_QueryInterface( punk, riid, ppobj );
133  IUnknown_Release( punk );
134  return r;
135 }
REFIID riid
Definition: precomp.h:44
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
const GUID IID_IUnknown
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define S_OK
Definition: intsafe.h:51
#define NULL
Definition: types.h:112
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static cf * impl_from_IClassFactory(IClassFactory *iface)
Definition: inetcomm_main.c:78

◆ cf_LockServer()

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

Definition at line 137 of file inetcomm_main.c.

138 {
139  FIXME("(%p)->(%d),stub!\n",iface,dolock);
140  return S_OK;
141 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define S_OK
Definition: intsafe.h:51

◆ cf_QueryInterface()

static HRESULT WINAPI cf_QueryInterface ( IClassFactory iface,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 83 of file inetcomm_main.c.

84 {
85  if (IsEqualGUID(riid, &IID_IUnknown) ||
87  {
88  IClassFactory_AddRef( iface );
89  *ppobj = iface;
90  return S_OK;
91  }
92 
93  if (!IsEqualGUID(riid, &IID_IInternetProtocolInfo))
94  FIXME("interface %s not implemented\n", debugstr_guid(riid));
95  *ppobj = NULL;
96  return E_NOINTERFACE;
97 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_guid
Definition: kernel32.h:35
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:51
#define NULL
Definition: types.h:112
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
const GUID IID_IClassFactory

◆ cf_Release()

static ULONG WINAPI cf_Release ( IClassFactory iface)
static

Definition at line 104 of file inetcomm_main.c.

105 {
106  return 1;
107 }

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 217 of file inetcomm_main.c.

218 {
219  return S_FALSE;
220 }
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

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

Definition at line 162 of file inetcomm_main.c.

163 {
164  IClassFactory *cf = NULL;
165 
166  TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv );
167 
168  if (IsEqualCLSID(rclsid, &CLSID_ISMTPTransport))
169  return SMTPTransportCF_Create(iid, ppv);
170 
171  if (IsEqualCLSID(rclsid, &CLSID_ISMTPTransport2))
172  return SMTPTransportCF_Create(iid, ppv);
173 
174  if (IsEqualCLSID(rclsid, &CLSID_IIMAPTransport))
175  return IMAPTransportCF_Create(iid, ppv);
176 
177  if (IsEqualCLSID(rclsid, &CLSID_IPOP3Transport))
178  return POP3TransportCF_Create(iid, ppv);
179 
180  if ( IsEqualCLSID( rclsid, &CLSID_IMimeSecurity ))
181  {
183  }
184  else if( IsEqualCLSID( rclsid, &CLSID_IMimeMessage ))
185  {
187  }
188  else if( IsEqualCLSID( rclsid, &CLSID_IMimeBody ))
189  {
191  }
192  else if( IsEqualCLSID( rclsid, &CLSID_IMimeAllocator ))
193  {
195  }
196  else if( IsEqualCLSID( rclsid, &CLSID_IVirtualStream ))
197  {
199  }
200  else if( IsEqualCLSID( rclsid, &CLSID_IMimeHtmlProtocol ))
201  {
203  }
204 
205  if ( !cf )
206  {
207  FIXME("\n\tCLSID:\t%s,\n\tIID:\t%s\n",debugstr_guid(rclsid),debugstr_guid(iid));
209  }
210 
211  return IClassFactory_QueryInterface( cf, iid, ppv );
212 }
IClassFactory IClassFactory_iface
Definition: inetcomm_main.c:74
static cf mime_message_cf
HRESULT POP3TransportCF_Create(REFIID riid, LPVOID *ppv) DECLSPEC_HIDDEN
REFIID LPVOID * ppv
Definition: atlbase.h:39
static cf mime_security_cf
HRESULT IMAPTransportCF_Create(REFIID riid, LPVOID *ppv)
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
static cf mime_allocator_cf
#define FIXME(fmt,...)
Definition: debug.h:111
static cf mhtml_protocol_cf
#define debugstr_guid
Definition: kernel32.h:35
static cf mime_body_cf
#define TRACE(s)
Definition: solgame.cpp:4
static cf virtual_stream_cf
#define NULL
Definition: types.h:112
HRESULT SMTPTransportCF_Create(REFIID riid, LPVOID *ppv) DECLSPEC_HIDDEN
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  fdwReason,
LPVOID  lpvReserved 
)

Definition at line 43 of file inetcomm_main.c.

44 {
45  static IMimeInternational *international;
46 
47  TRACE("(%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
48 
49  switch (fdwReason)
50  {
51  case DLL_WINE_PREATTACH:
52  return FALSE;
53  case DLL_PROCESS_ATTACH:
54  DisableThreadLibraryCalls(hinstDLL);
55  instance = hinstDLL;
56  if (!InternetTransport_RegisterClass(hinstDLL))
57  return FALSE;
58  MimeInternational_Construct(&international);
59  break;
60  case DLL_PROCESS_DETACH:
61  if (lpvReserved) break;
62  IMimeInternational_Release(international);
64  break;
65  }
66  return TRUE;
67 }
#define TRUE
Definition: types.h:120
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
void InternetTransport_UnregisterClass(HINSTANCE hInstance) DECLSPEC_HIDDEN
HRESULT MimeInternational_Construct(IMimeInternational **internat) DECLSPEC_HIDDEN
Definition: mimeintl.c:525
static IN DWORD IN LPVOID lpvReserved
#define FALSE
Definition: types.h:117
static HINSTANCE instance
Definition: inetcomm_main.c:41
#define DLL_PROCESS_DETACH
Definition: compat.h:130
#define TRACE(s)
Definition: solgame.cpp:4
BOOL InternetTransport_RegisterClass(HINSTANCE hInstance) DECLSPEC_HIDDEN

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 225 of file inetcomm_main.c.

226 {
228 }
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
static HINSTANCE instance
Definition: inetcomm_main.c:41

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 233 of file inetcomm_main.c.

234 {
236 }
static HINSTANCE instance
Definition: inetcomm_main.c:41
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110

◆ impl_from_IClassFactory()

static cf* impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 78 of file inetcomm_main.c.

79 {
80  return CONTAINING_RECORD(iface, cf, IClassFactory_iface);
81 }
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 cf_CreateInstance().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( inetcomm  )

Variable Documentation

◆ cf_vtbl

const struct IClassFactoryVtbl cf_vtbl
static
Initial value:
=
{
}
static ULONG WINAPI cf_AddRef(IClassFactory *iface)
Definition: inetcomm_main.c:99
static HRESULT WINAPI cf_LockServer(IClassFactory *iface, BOOL dolock)
static HRESULT WINAPI cf_CreateInstance(IClassFactory *iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
static HRESULT WINAPI cf_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppobj)
Definition: inetcomm_main.c:83
static ULONG WINAPI cf_Release(IClassFactory *iface)

Definition at line 143 of file inetcomm_main.c.

◆ helpstring

typedef helpstring

◆ instance

HINSTANCE instance
static

Definition at line 41 of file inetcomm_main.c.

Referenced by DllMain(), DllRegisterServer(), and DllUnregisterServer().

◆ mhtml_protocol_cf

cf mhtml_protocol_cf = { { &cf_vtbl }, MimeHtmlProtocol_create }
static

Definition at line 157 of file inetcomm_main.c.

Referenced by DllGetClassObject().

◆ mime_allocator_cf

cf mime_allocator_cf = { { &cf_vtbl }, MimeAllocator_create }
static

Definition at line 153 of file inetcomm_main.c.

Referenced by DllGetClassObject().

◆ mime_body_cf

cf mime_body_cf = { { &cf_vtbl }, MimeBody_create }
static

Definition at line 152 of file inetcomm_main.c.

Referenced by DllGetClassObject().

◆ mime_message_cf

cf mime_message_cf = { { &cf_vtbl }, MimeMessage_create }
static

Definition at line 154 of file inetcomm_main.c.

Referenced by DllGetClassObject().

◆ mime_security_cf

cf mime_security_cf = { { &cf_vtbl }, MimeSecurity_create }
static

Definition at line 155 of file inetcomm_main.c.

Referenced by DllGetClassObject().

◆ virtual_stream_cf

cf virtual_stream_cf = { { &cf_vtbl }, VirtualStream_create }
static

Definition at line 156 of file inetcomm_main.c.

Referenced by DllGetClassObject().