ReactOS 0.4.16-dev-983-g23ad936
inetcomm_main.c
Go to the documentation of this file.
1/*
2 * Internet Messaging APIs
3 *
4 * Copyright 2006 Robert Shearman for CodeWeavers
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#define COBJMACROS
22
23#include <stdarg.h>
24
25#include "windef.h"
26#include "winbase.h"
27#include "winnt.h"
28#include "winuser.h"
29#include "ole2.h"
30#include "ocidl.h"
31#include "rpcproxy.h"
32#include "initguid.h"
33#include "mimeole.h"
34
35#include "inetcomm_private.h"
36
37#include "wine/debug.h"
38
40
42
44{
45 static IMimeInternational *international;
46
47 TRACE("(%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
48
49 switch (fdwReason)
50 {
51#ifndef __REACTOS__
52 case DLL_WINE_PREATTACH:
53 return FALSE;
54#endif
57 instance = hinstDLL;
59 return FALSE;
60 MimeInternational_Construct(&international);
61 break;
63 if (lpvReserved) break;
64 IMimeInternational_Release(international);
66 break;
67 }
68 return TRUE;
69}
70
71/******************************************************************************
72 * ClassFactory
73 */
74typedef struct
75{
78} cf;
79
81{
82 return CONTAINING_RECORD(iface, cf, IClassFactory_iface);
83}
84
86{
89 {
90 IClassFactory_AddRef( iface );
91 *ppobj = iface;
92 return S_OK;
93 }
94
95 if (!IsEqualGUID(riid, &IID_IInternetProtocolInfo))
96 FIXME("interface %s not implemented\n", debugstr_guid(riid));
97 *ppobj = NULL;
98 return E_NOINTERFACE;
99}
100
102{
103 return 2;
104}
105
107{
108 return 1;
109}
110
112 REFIID riid, LPVOID *ppobj )
113{
114 cf *This = impl_from_IClassFactory( iface );
115 HRESULT r;
116 IUnknown *punk;
117
118 TRACE("%p %s %p\n", pOuter, debugstr_guid(riid), ppobj );
119
120 *ppobj = NULL;
121
122 if (pOuter && !IsEqualGUID(&IID_IUnknown, riid))
124
125 r = This->create_object( pOuter, (LPVOID*) &punk );
126 if (FAILED(r))
127 return r;
128
130 *ppobj = punk;
131 return S_OK;
132 }
133
134 r = IUnknown_QueryInterface( punk, riid, ppobj );
135 IUnknown_Release( punk );
136 return r;
137}
138
140{
141 FIXME("(%p)->(%d),stub!\n",iface,dolock);
142 return S_OK;
143}
144
145static const struct IClassFactoryVtbl cf_vtbl =
146{
148 cf_AddRef,
152};
153
160
161/***********************************************************************
162 * DllGetClassObject (INETCOMM.@)
163 */
165{
167
168 TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv );
169
170 if (IsEqualCLSID(rclsid, &CLSID_ISMTPTransport))
171 return SMTPTransportCF_Create(iid, ppv);
172
173 if (IsEqualCLSID(rclsid, &CLSID_ISMTPTransport2))
174 return SMTPTransportCF_Create(iid, ppv);
175
176 if (IsEqualCLSID(rclsid, &CLSID_IIMAPTransport))
177 return IMAPTransportCF_Create(iid, ppv);
178
179 if (IsEqualCLSID(rclsid, &CLSID_IPOP3Transport))
180 return POP3TransportCF_Create(iid, ppv);
181
182 if ( IsEqualCLSID( rclsid, &CLSID_IMimeSecurity ))
183 {
185 }
186 else if( IsEqualCLSID( rclsid, &CLSID_IMimeMessage ))
187 {
189 }
190 else if( IsEqualCLSID( rclsid, &CLSID_IMimeBody ))
191 {
193 }
194 else if( IsEqualCLSID( rclsid, &CLSID_IMimeAllocator ))
195 {
197 }
198 else if( IsEqualCLSID( rclsid, &CLSID_IVirtualStream ))
199 {
201 }
202 else if( IsEqualCLSID( rclsid, &CLSID_IMimeHtmlProtocol ))
203 {
205 }
206
207 if ( !cf )
208 {
209 FIXME("\n\tCLSID:\t%s,\n\tIID:\t%s\n",debugstr_guid(rclsid),debugstr_guid(iid));
211 }
212
213 return IClassFactory_QueryInterface( cf, iid, ppv );
214}
215
216/***********************************************************************
217 * DllCanUnloadNow (INETCOMM.@)
218 */
220{
221 return S_FALSE;
222}
223
224/***********************************************************************
225 * DllRegisterServer (INETCOMM.@)
226 */
228{
230}
231
232/***********************************************************************
233 * DllUnregisterServer (INETCOMM.@)
234 */
236{
238}
static DWORD const fdwReason
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: precomp.h:53
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define NULL
Definition: types.h:112
#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
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
HRESULT IMAPTransportCF_Create(REFIID riid, LPVOID *ppv)
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT WINAPI DllRegisterServer(void)
static cf * impl_from_IClassFactory(IClassFactory *iface)
Definition: inetcomm_main.c:80
static cf mime_message_cf
static cf mime_allocator_cf
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
Definition: inetcomm_main.c:43
static ULONG WINAPI cf_AddRef(IClassFactory *iface)
static HRESULT WINAPI cf_CreateInstance(IClassFactory *iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
static HINSTANCE instance
Definition: inetcomm_main.c:41
static HRESULT WINAPI cf_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppobj)
Definition: inetcomm_main.c:85
HRESULT WINAPI DllUnregisterServer(void)
static cf mhtml_protocol_cf
static cf virtual_stream_cf
static cf mime_body_cf
static cf mime_security_cf
static HRESULT WINAPI cf_LockServer(IClassFactory *iface, BOOL dolock)
static const struct IClassFactoryVtbl cf_vtbl
HRESULT WINAPI DllCanUnloadNow(void)
static ULONG WINAPI cf_Release(IClassFactory *iface)
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
HRESULT MimeHtmlProtocol_create(IUnknown *outer, void **obj) DECLSPEC_HIDDEN
Definition: protocol.c:729
void InternetTransport_UnregisterClass(HINSTANCE hInstance) DECLSPEC_HIDDEN
HRESULT MimeBody_create(IUnknown *outer, void **obj) DECLSPEC_HIDDEN
Definition: mimeole.c:1920
HRESULT MimeSecurity_create(IUnknown *outer, void **obj) DECLSPEC_HIDDEN
Definition: mimeole.c:3310
HRESULT MimeMessage_create(IUnknown *outer, void **obj) DECLSPEC_HIDDEN
Definition: mimeole.c:3085
HRESULT SMTPTransportCF_Create(REFIID riid, LPVOID *ppv) DECLSPEC_HIDDEN
HRESULT MimeAllocator_create(IUnknown *outer, void **obj) DECLSPEC_HIDDEN
Definition: mimeole.c:3522
BOOL InternetTransport_RegisterClass(HINSTANCE hInstance) DECLSPEC_HIDDEN
HRESULT POP3TransportCF_Create(REFIID riid, LPVOID *ppv) DECLSPEC_HIDDEN
HRESULT VirtualStream_create(IUnknown *outer, void **obj) DECLSPEC_HIDDEN
Definition: mimeole.c:3535
HRESULT MimeInternational_Construct(IMimeInternational **internat) DECLSPEC_HIDDEN
Definition: mimeintl.c:525
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT create_object(script_ctx_t *, jsdisp_t *, jsdisp_t **) DECLSPEC_HIDDEN
Definition: object.c:731
#define debugstr_guid
Definition: kernel32.h:35
static IN DWORD IN LPVOID lpvReserved
static LPUNKNOWN
Definition: ndr_ole.c:49
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
#define TRACE(s)
Definition: solgame.cpp:4
IClassFactory IClassFactory_iface
Definition: inetcomm_main.c:76
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define HRESULT
Definition: msvc.h:7
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:2357
#define E_NOINTERFACE
Definition: winerror.h:2364
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663