ReactOS 0.4.15-dev-5666-gc548b97
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

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))
122
123 r = This->create_object( pOuter, (LPVOID*) &punk );
124 if (FAILED(r))
125 return r;
126
128 *ppobj = punk;
129 return S_OK;
130 }
131
132 r = IUnknown_QueryInterface( punk, riid, ppobj );
133 IUnknown_Release( punk );
134 return r;
135}
const GUID IID_IUnknown
#define NULL
Definition: types.h:112
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
REFIID riid
Definition: atlbase.h:39
static cf * impl_from_IClassFactory(IClassFactory *iface)
Definition: inetcomm_main.c:78
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define TRACE(s)
Definition: solgame.cpp:4
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

◆ 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

◆ cf_QueryInterface()

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

Definition at line 83 of file inetcomm_main.c.

84{
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}
const GUID IID_IClassFactory
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ 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{
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}
HRESULT IMAPTransportCF_Create(REFIID riid, LPVOID *ppv)
REFIID LPVOID * ppv
Definition: atlbase.h:39
static cf mime_message_cf
static cf mime_allocator_cf
static cf mhtml_protocol_cf
static cf virtual_stream_cf
static cf mime_body_cf
static cf mime_security_cf
HRESULT SMTPTransportCF_Create(REFIID riid, LPVOID *ppv) DECLSPEC_HIDDEN
HRESULT POP3TransportCF_Create(REFIID riid, LPVOID *ppv) DECLSPEC_HIDDEN
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96
IClassFactory IClassFactory_iface
Definition: inetcomm_main.c:74
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663

◆ 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;
55 instance = hinstDLL;
57 return FALSE;
58 MimeInternational_Construct(&international);
59 break;
61 if (lpvReserved) break;
62 IMimeInternational_Release(international);
64 break;
65 }
66 return TRUE;
67}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
static HINSTANCE instance
Definition: inetcomm_main.c:41
void InternetTransport_UnregisterClass(HINSTANCE hInstance) DECLSPEC_HIDDEN
BOOL InternetTransport_RegisterClass(HINSTANCE hInstance) DECLSPEC_HIDDEN
HRESULT MimeInternational_Construct(IMimeInternational **internat) DECLSPEC_HIDDEN
Definition: mimeintl.c:525
static IN DWORD IN LPVOID lpvReserved

◆ 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

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 233 of file inetcomm_main.c.

234{
236}
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}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

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_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 HRESULT WINAPI cf_LockServer(IClassFactory *iface, BOOL dolock)
static ULONG WINAPI cf_Release(IClassFactory *iface)

Definition at line 143 of file inetcomm_main.c.

◆ 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().