ReactOS 0.4.17-dev-357-ga8f14ff
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{
43 static IMimeInternational *international;
44
45 TRACE("(%p, %ld, %p)\n", hinstDLL, fdwReason, lpvReserved);
46
47 switch (fdwReason)
48 {
52 return FALSE;
53 MimeInternational_Construct(&international);
54 break;
56 if (lpvReserved) break;
57 IMimeInternational_Release(international);
59 break;
60 }
61 return TRUE;
62}
63
64/******************************************************************************
65 * ClassFactory
66 */
67typedef struct
68{
71} cf;
72
74{
75 return CONTAINING_RECORD(iface, cf, IClassFactory_iface);
76}
77
79{
82 {
83 IClassFactory_AddRef( iface );
84 *ppobj = iface;
85 return S_OK;
86 }
87
88 if (!IsEqualGUID(riid, &IID_IInternetProtocolInfo))
89 FIXME("interface %s not implemented\n", debugstr_guid(riid));
90 *ppobj = NULL;
91 return E_NOINTERFACE;
92}
93
95{
96 return 2;
97}
98
100{
101 return 1;
102}
103
105 REFIID riid, LPVOID *ppobj )
106{
107 cf *This = impl_from_IClassFactory( iface );
108 HRESULT r;
109 IUnknown *punk;
110
111 TRACE("%p %s %p\n", pOuter, debugstr_guid(riid), ppobj );
112
113 *ppobj = NULL;
114
115 if (pOuter && !IsEqualGUID(&IID_IUnknown, riid))
117
118 r = This->create_object( pOuter, (LPVOID*) &punk );
119 if (FAILED(r))
120 return r;
121
123 *ppobj = punk;
124 return S_OK;
125 }
126
127 r = IUnknown_QueryInterface( punk, riid, ppobj );
128 IUnknown_Release( punk );
129 return r;
130}
131
133{
134 FIXME("(%p)->(%d),stub!\n",iface,dolock);
135 return S_OK;
136}
137
138static const struct IClassFactoryVtbl cf_vtbl =
139{
141 cf_AddRef,
145};
146
153
154/***********************************************************************
155 * DllGetClassObject (INETCOMM.@)
156 */
158{
160
161 TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv );
162
163 if (IsEqualCLSID(rclsid, &CLSID_ISMTPTransport))
164 return SMTPTransportCF_Create(iid, ppv);
165
166 if (IsEqualCLSID(rclsid, &CLSID_ISMTPTransport2))
167 return SMTPTransportCF_Create(iid, ppv);
168
169 if (IsEqualCLSID(rclsid, &CLSID_IIMAPTransport))
170 return IMAPTransportCF_Create(iid, ppv);
171
172 if (IsEqualCLSID(rclsid, &CLSID_IPOP3Transport))
173 return POP3TransportCF_Create(iid, ppv);
174
175 if ( IsEqualCLSID( rclsid, &CLSID_IMimeSecurity ))
176 {
178 }
179 else if( IsEqualCLSID( rclsid, &CLSID_IMimeMessage ))
180 {
182 }
183 else if( IsEqualCLSID( rclsid, &CLSID_IMimeBody ))
184 {
186 }
187 else if( IsEqualCLSID( rclsid, &CLSID_IMimeAllocator ))
188 {
190 }
191 else if( IsEqualCLSID( rclsid, &CLSID_IVirtualStream ))
192 {
194 }
195 else if( IsEqualCLSID( rclsid, &CLSID_IMimeHtmlProtocol ))
196 {
198 }
199
200 if ( !cf )
201 {
202 FIXME("\n\tCLSID:\t%s,\n\tIID:\t%s\n",debugstr_guid(rclsid),debugstr_guid(iid));
204 }
205
206 return IClassFactory_QueryInterface( cf, iid, ppv );
207}
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
static LPVOID LPUNKNOWN
Definition: dinput.c:53
#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
static cf * impl_from_IClassFactory(IClassFactory *iface)
Definition: inetcomm_main.c:73
static cf mime_message_cf
static cf mime_allocator_cf
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
Definition: inetcomm_main.c:41
static ULONG WINAPI cf_AddRef(IClassFactory *iface)
Definition: inetcomm_main.c:94
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:78
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
static ULONG WINAPI cf_Release(IClassFactory *iface)
Definition: inetcomm_main.c:99
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
HRESULT VirtualStream_create(IUnknown *outer, void **obj)
Definition: mimeole.c:3518
HRESULT MimeInternational_Construct(IMimeInternational **internat)
Definition: mimeintl.c:524
HRESULT POP3TransportCF_Create(REFIID riid, LPVOID *ppv)
void InternetTransport_UnregisterClass(HINSTANCE hInstance)
HRESULT SMTPTransportCF_Create(REFIID riid, LPVOID *ppv)
HRESULT MimeAllocator_create(IUnknown *outer, void **obj)
Definition: mimeole.c:3505
HRESULT MimeHtmlProtocol_create(IUnknown *outer, void **obj)
Definition: protocol.c:710
HRESULT MimeMessage_create(IUnknown *outer, void **obj)
Definition: mimeole.c:3068
BOOL InternetTransport_RegisterClass(HINSTANCE hInstance)
HRESULT MimeSecurity_create(IUnknown *outer, void **obj)
Definition: mimeole.c:3293
HRESULT MimeBody_create(IUnknown *outer, void **obj)
Definition: mimeole.c:1903
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT create_object(script_ctx_t *, jsdisp_t *, jsdisp_t **)
Definition: object.c:1131
#define debugstr_guid
Definition: kernel32.h:35
static IN DWORD IN LPVOID lpvReserved
#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
_In_opt_ IUnknown * punk
Definition: shlwapi.h:158
#define TRACE(s)
Definition: solgame.cpp:4
IClassFactory IClassFactory_iface
Definition: inetcomm_main.c:69
#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 E_NOINTERFACE
Definition: winerror.h:3479
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:3771
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:3772