ReactOS  0.4.14-dev-49-gfb4591c
inetcomm_private.h File Reference
#include "winsock2.h"
#include "winuser.h"
#include "objbase.h"
#include "imnxport.h"
Include dependency graph for inetcomm_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  InternetTransport
 

Typedefs

typedef struct InternetTransport InternetTransport
 
typedef void(* INETXPORT_COMPLETION_FUNCTION) (IInternetTransport *, char *, int)
 

Functions

HRESULT InternetTransport_Init (InternetTransport *This) DECLSPEC_HIDDEN
 
HRESULT InternetTransport_GetServerInfo (InternetTransport *This, LPINETSERVER pInetServer) DECLSPEC_HIDDEN
 
HRESULT InternetTransport_InetServerFromAccount (InternetTransport *This, IImnAccount *pAccount, LPINETSERVER pInetServer) DECLSPEC_HIDDEN
 
HRESULT InternetTransport_Connect (InternetTransport *This, LPINETSERVER pInetServer, boolean fAuthenticate, boolean fCommandLogging) DECLSPEC_HIDDEN
 
HRESULT InternetTransport_HandsOffCallback (InternetTransport *This) DECLSPEC_HIDDEN
 
HRESULT InternetTransport_DropConnection (InternetTransport *This) DECLSPEC_HIDDEN
 
HRESULT InternetTransport_GetStatus (InternetTransport *This, IXPSTATUS *pCurrentStatus) DECLSPEC_HIDDEN
 
HRESULT InternetTransport_ChangeStatus (InternetTransport *This, IXPSTATUS Status) DECLSPEC_HIDDEN
 
HRESULT InternetTransport_ReadLine (InternetTransport *This, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN
 
HRESULT InternetTransport_Write (InternetTransport *This, const char *pvData, int cbSize, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN
 
HRESULT InternetTransport_DoCommand (InternetTransport *This, LPCSTR pszCommand, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN
 
BOOL InternetTransport_RegisterClass (HINSTANCE hInstance) DECLSPEC_HIDDEN
 
void InternetTransport_UnregisterClass (HINSTANCE hInstance) DECLSPEC_HIDDEN
 
HRESULT MimeBody_create (IUnknown *outer, void **obj) DECLSPEC_HIDDEN
 
HRESULT MimeAllocator_create (IUnknown *outer, void **obj) DECLSPEC_HIDDEN
 
HRESULT MimeMessage_create (IUnknown *outer, void **obj) DECLSPEC_HIDDEN
 
HRESULT MimeSecurity_create (IUnknown *outer, void **obj) DECLSPEC_HIDDEN
 
HRESULT VirtualStream_create (IUnknown *outer, void **obj) DECLSPEC_HIDDEN
 
HRESULT MimeHtmlProtocol_create (IUnknown *outer, void **obj) DECLSPEC_HIDDEN
 
HRESULT MimeInternational_Construct (IMimeInternational **internat) DECLSPEC_HIDDEN
 
HRESULT SMTPTransportCF_Create (REFIID riid, LPVOID *ppv) DECLSPEC_HIDDEN
 
HRESULT IMAPTransportCF_Create (REFIID riid, LPVOID *ppv) DECLSPEC_HIDDEN
 
HRESULT POP3TransportCF_Create (REFIID riid, LPVOID *ppv) DECLSPEC_HIDDEN
 

Typedef Documentation

◆ INETXPORT_COMPLETION_FUNCTION

typedef void(* INETXPORT_COMPLETION_FUNCTION) (IInternetTransport *, char *, int)

Definition at line 30 of file inetcomm_private.h.

◆ InternetTransport

Definition at line 28 of file inetcomm_private.h.

Function Documentation

◆ IMAPTransportCF_Create()

HRESULT IMAPTransportCF_Create ( REFIID  riid,
LPVOID ppv 
)

Definition at line 508 of file imaptransport.c.

509 {
510  return IClassFactory_QueryInterface((IClassFactory *)&IMAPTransportCF, riid, ppv);
511 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static const IClassFactoryVtbl * IMAPTransportCF

Referenced by DllGetClassObject().

◆ InternetTransport_ChangeStatus()

HRESULT InternetTransport_ChangeStatus ( InternetTransport This,
IXPSTATUS  Status 
)

Definition at line 192 of file internettransport.c.

193 {
194  This->Status = Status;
195  if (This->pCallback)
196  ITransportCallback_OnStatus(This->pCallback, Status,
197  (IInternetTransport *)&This->u.vtbl);
198  return S_OK;
199 }
Status
Definition: gdiplustypes.h:24
#define S_OK
Definition: intsafe.h:59

Referenced by InternetTransport_Connect(), InternetTransport_DropConnection(), POP3Transport_CallbackProcessPASSResp(), POP3Transport_CommandQUIT(), SMTPTransport_CallbackProcessHelloResp(), and SMTPTransport_CommandQUIT().

◆ InternetTransport_Connect()

HRESULT InternetTransport_Connect ( InternetTransport This,
LPINETSERVER  pInetServer,
boolean  fAuthenticate,
boolean  fCommandLogging 
)

Definition at line 71 of file internettransport.c.

73 {
74  struct addrinfo *ai;
75  struct addrinfo *ai_cur;
76  struct addrinfo hints;
77  int ret;
78  char szPort[10];
79 
80  if (This->Status != IXP_DISCONNECTED)
81  return IXP_E_ALREADY_CONNECTED;
82 
83  This->ServerInfo = *pInetServer;
84  This->fCommandLogging = fCommandLogging;
85 
86  This->hwnd = CreateWindowW(wszClassName, wszClassName, 0, 0, 0, 0, 0, NULL, NULL, NULL, 0);
87  if (!This->hwnd)
90 
91  hints.ai_flags = 0;
92  hints.ai_family = PF_UNSPEC;
93  hints.ai_socktype = SOCK_STREAM;
94  hints.ai_protocol = IPPROTO_TCP;
95  hints.ai_addrlen = 0;
96  hints.ai_addr = NULL;
97  hints.ai_canonname = NULL;
98  hints.ai_next = NULL;
99 
100  snprintf(szPort, sizeof(szPort), "%d", (unsigned short)pInetServer->dwPort);
101 
103 
104  ret = getaddrinfo(pInetServer->szServerName, szPort, &hints, &ai);
105  if (ret)
106  {
107  ERR("getaddrinfo failed: %d\n", ret);
108  return IXP_E_CANT_FIND_HOST;
109  }
110 
111  for (ai_cur = ai; ai_cur; ai_cur = ai->ai_next)
112  {
113  int so;
114 
115  if (TRACE_ON(inetcomm))
116  {
117  char host[256];
118  char service[256];
119  getnameinfo(ai_cur->ai_addr, ai_cur->ai_addrlen,
120  host, sizeof(host), service, sizeof(service),
122  TRACE("trying %s:%s\n", host, service);
123  }
124 
126 
127  so = socket(ai_cur->ai_family, ai_cur->ai_socktype, ai_cur->ai_protocol);
128  if (so == -1)
129  {
130  WARN("socket() failed\n");
131  continue;
132  }
133  This->Socket = so;
134 
135  /* FIXME: set to async */
136 
137  if (0 > connect(This->Socket, ai_cur->ai_addr, ai_cur->ai_addrlen))
138  {
139  WARN("connect() failed\n");
140  closesocket(This->Socket);
141  continue;
142  }
144 
145  /* FIXME: call WSAAsyncSelect */
146 
147  freeaddrinfo(ai);
148  TRACE("connected\n");
149  return S_OK;
150  }
151 
152  freeaddrinfo(ai);
153 
154  return IXP_E_CANT_FIND_HOST;
155 }
namespace GUID const ADDRINFOEXW * hints
Definition: sock.c:80
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
SOCKET WSAAPI socket(IN INT af, IN INT type, IN INT protocol)
Definition: socklife.c:143
#define freeaddrinfo
Definition: wspiapi.h:46
#define NI_NUMERICHOST
Definition: ws2def.h:354
#define WARN(fmt,...)
Definition: debug.h:111
char * host
Definition: whois.c:55
#define snprintf
Definition: wintirpc.h:48
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define NI_NUMERICSERV
Definition: ws2def.h:356
INT WSAAPI connect(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
Definition: sockctrl.c:23
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4217
#define closesocket
Definition: main.c:39
#define GWLP_USERDATA
Definition: treelist.c:63
static const WCHAR wszClassName[]
smooth NULL
Definition: ftsmooth.c:416
HRESULT InternetTransport_ChangeStatus(InternetTransport *This, IXPSTATUS Status)
#define TRACE(s)
Definition: solgame.cpp:4
#define PF_UNSPEC
Definition: winsock.h:371
int ret
int ai_protocol
Definition: ws2def.h:668
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
int ai_socktype
Definition: ws2def.h:667
#define getnameinfo
Definition: wspiapi.h:45
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
struct addrinfo * ai_next
Definition: ws2def.h:672
#define SetWindowLongPtrW
Definition: winuser.h:5247
size_t ai_addrlen
Definition: ws2def.h:669
#define SOCK_STREAM
Definition: tcpip.h:118
#define TRACE_ON(x)
Definition: compat.h:65
struct sockaddr * ai_addr
Definition: ws2def.h:671
#define getaddrinfo
Definition: wspiapi.h:44
int ai_family
Definition: ws2def.h:666

Referenced by IMAPTransport_Connect(), POP3Transport_Connect(), and SMTPTransport_Connect().

◆ InternetTransport_DoCommand()

HRESULT InternetTransport_DoCommand ( InternetTransport This,
LPCSTR  pszCommand,
INETXPORT_COMPLETION_FUNCTION  fnCompletion 
)

Definition at line 248 of file internettransport.c.

250 {
251  if (This->Status == IXP_DISCONNECTED)
252  return IXP_E_NOT_CONNECTED;
253 
254  if (This->fnCompletion)
255  return IXP_E_BUSY;
256 
257  if (This->pCallback && This->fCommandLogging)
258  {
259  ITransportCallback_OnCommand(This->pCallback, CMD_SEND, (LPSTR)pszCommand, 0,
260  (IInternetTransport *)&This->u.vtbl);
261  }
262  return InternetTransport_Write(This, pszCommand, strlen(pszCommand), fnCompletion);
263 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * LPSTR
Definition: xmlstorage.h:182
HRESULT InternetTransport_Write(InternetTransport *This, const char *pvData, int cbSize, INETXPORT_COMPLETION_FUNCTION fnCompletion)

Referenced by POP3Transport_CallbackProcessUSERResp(), POP3Transport_CallbackSendUSERCmd(), POP3Transport_CommandDELE(), POP3Transport_CommandLIST(), POP3Transport_CommandNOOP(), POP3Transport_CommandPASS(), POP3Transport_CommandQUIT(), POP3Transport_CommandRETR(), POP3Transport_CommandRSET(), POP3Transport_CommandSTAT(), POP3Transport_CommandTOP(), POP3Transport_CommandUIDL(), POP3Transport_CommandUSER(), SMTPTransport_CallbackMessageSendDOT(), SMTPTransport_CallbackMessageSendTo(), SMTPTransport_CallbackSendHello(), SMTPTransport_CommandAUTH(), SMTPTransport_CommandDATA(), SMTPTransport_CommandEHLO(), SMTPTransport_CommandHELO(), SMTPTransport_CommandMAIL(), SMTPTransport_CommandQUIT(), SMTPTransport_CommandRCPT(), SMTPTransport_CommandRSET(), and SMTPTransport_SendMessage().

◆ InternetTransport_DropConnection()

HRESULT InternetTransport_DropConnection ( InternetTransport This)

Definition at line 168 of file internettransport.c.

169 {
170  if (This->Status == IXP_DISCONNECTED)
171  return IXP_E_NOT_CONNECTED;
172 
173  shutdown(This->Socket, SD_BOTH);
174 
175  closesocket(This->Socket);
176 
177  DestroyWindow(This->hwnd);
178  This->hwnd = NULL;
179 
181 
182  return S_OK;
183 }
BOOL WINAPI DestroyWindow(_In_ HWND)
#define closesocket
Definition: main.c:39
smooth NULL
Definition: ftsmooth.c:416
HRESULT InternetTransport_ChangeStatus(InternetTransport *This, IXPSTATUS Status)
INT WSAAPI shutdown(IN SOCKET s, IN INT how)
Definition: sockctrl.c:506
#define S_OK
Definition: intsafe.h:59
#define SD_BOTH
Definition: winsock.h:56

Referenced by IMAPTransport_DropConnection(), IMAPTransport_Release(), POP3Transport_CallbackProcessQUITResponse(), POP3Transport_DropConnection(), POP3Transport_Release(), SMTPTransport_CallbackDisconnect(), SMTPTransport_DropConnection(), and SMTPTransport_Release().

◆ InternetTransport_GetServerInfo()

HRESULT InternetTransport_GetServerInfo ( InternetTransport This,
LPINETSERVER  pInetServer 
)

Definition at line 55 of file internettransport.c.

56 {
57  if (This->Status == IXP_DISCONNECTED)
58  return IXP_E_NOT_CONNECTED;
59 
60  *pInetServer = This->ServerInfo;
61  return S_OK;
62 }
#define S_OK
Definition: intsafe.h:59

Referenced by IMAPTransport_GetServerInfo(), POP3Transport_GetServerInfo(), and SMTPTransport_GetServerInfo().

◆ InternetTransport_GetStatus()

HRESULT InternetTransport_GetStatus ( InternetTransport This,
IXPSTATUS pCurrentStatus 
)

Definition at line 185 of file internettransport.c.

187 {
188  *pCurrentStatus = This->Status;
189  return S_OK;
190 }
#define S_OK
Definition: intsafe.h:59

Referenced by IMAPTransport_GetStatus(), POP3Transport_GetStatus(), and SMTPTransport_GetStatus().

◆ InternetTransport_HandsOffCallback()

HRESULT InternetTransport_HandsOffCallback ( InternetTransport This)

Definition at line 157 of file internettransport.c.

158 {
159  if (!This->pCallback)
160  return S_FALSE;
161 
162  ITransportCallback_Release(This->pCallback);
163  This->pCallback = NULL;
164 
165  return S_OK;
166 }
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
#define S_OK
Definition: intsafe.h:59

Referenced by IMAPTransport_HandsOffCallback(), POP3Transport_HandsOffCallback(), and SMTPTransport_HandsOffCallback().

◆ InternetTransport_InetServerFromAccount()

HRESULT InternetTransport_InetServerFromAccount ( InternetTransport This,
IImnAccount pAccount,
LPINETSERVER  pInetServer 
)

Definition at line 64 of file internettransport.c.

66 {
67  FIXME("(%p, %p): stub\n", pAccount, pInetServer);
68  return E_NOTIMPL;
69 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

Referenced by IMAPTransport_InetServerFromAccount(), POP3Transport_InetServerFromAccount(), and SMTPTransport_InetServerFromAccount().

◆ InternetTransport_Init()

HRESULT InternetTransport_Init ( InternetTransport This)

Definition at line 44 of file internettransport.c.

45 {
46  This->pCallback = NULL;
47  This->Status = IXP_DISCONNECTED;
48  This->Socket = -1;
49  This->fCommandLogging = FALSE;
50  This->fnCompletion = NULL;
51 
52  return S_OK;
53 }
smooth NULL
Definition: ftsmooth.c:416
#define S_OK
Definition: intsafe.h:59

Referenced by CreateIMAPTransport(), CreatePOP3Transport(), and CreateSMTPTransport().

◆ InternetTransport_ReadLine()

HRESULT InternetTransport_ReadLine ( InternetTransport This,
INETXPORT_COMPLETION_FUNCTION  fnCompletion 
)

Definition at line 201 of file internettransport.c.

203 {
204  if (This->Status == IXP_DISCONNECTED)
205  return IXP_E_NOT_CONNECTED;
206 
207  if (This->fnCompletion)
208  return IXP_E_BUSY;
209 
210  This->fnCompletion = fnCompletion;
211 
212  This->cbBuffer = 1024;
213  This->pBuffer = HeapAlloc(GetProcessHeap(), 0, This->cbBuffer);
214  This->iCurrentBufferOffset = 0;
215 
216  if (WSAAsyncSelect(This->Socket, This->hwnd, IX_READLINE, FD_READ) == SOCKET_ERROR)
217  {
218  ERR("WSAAsyncSelect failed with error %d\n", WSAGetLastError());
219  /* FIXME: handle error */
220  }
221  return S_OK;
222 }
#define SOCKET_ERROR
Definition: winsock.h:333
#define FD_READ
Definition: winsock.h:405
INT WSAAPI WSAAsyncSelect(IN SOCKET s, IN HWND hWnd, IN UINT wMsg, IN LONG lEvent)
Definition: select.c:134
INT WSAAPI WSAGetLastError(VOID)
Definition: dllmain.c:112
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define IX_READLINE
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59

Referenced by POP3Transport_CallbackProcessLISTResp(), POP3Transport_CallbackProcessRETRResp(), POP3Transport_CallbackProcessTOPResp(), POP3Transport_CallbackProcessUIDLResp(), POP3Transport_CallbackRecvDELEResp(), POP3Transport_CallbackRecvLISTResp(), POP3Transport_CallbackRecvNOOPResp(), POP3Transport_CallbackRecvPASSResp(), POP3Transport_CallbackRecvQUITResp(), POP3Transport_CallbackRecvRETRResp(), POP3Transport_CallbackRecvRSETResp(), POP3Transport_CallbackRecvSTATResp(), POP3Transport_CallbackRecvTOPResp(), POP3Transport_CallbackRecvUIDLResp(), POP3Transport_CallbackRecvUSERResp(), POP3Transport_Connect(), SMTPTransport_CallbackMessageReadDataResponse(), SMTPTransport_CallbackMessageReadFromResponse(), SMTPTransport_CallbackMessageReadResponse(), SMTPTransport_CallbackMessageReadToResponse(), SMTPTransport_CallbackProcessHelloResp(), SMTPTransport_CallbackReadDATAResponse(), SMTPTransport_CallbackReadMAILResponse(), SMTPTransport_CallbackReadRCPTResponse(), SMTPTransport_CallbackReadResponseDoNothing(), SMTPTransport_CallbackRecvHelloResp(), and SMTPTransport_Connect().

◆ InternetTransport_RegisterClass()

BOOL InternetTransport_RegisterClass ( HINSTANCE  hInstance)

Definition at line 367 of file internettransport.c.

368 {
369  WNDCLASSW cls;
370  WSADATA wsadata;
371 
372  if (WSAStartup(MAKEWORD(2, 2), &wsadata))
373  return FALSE;
374 
375  memset(&cls, 0, sizeof(cls));
376  cls.hInstance = hInstance;
379 
380  return RegisterClassW(&cls);
381 }
#define MAKEWORD(a, b)
Definition: typedefs.h:247
static LRESULT CALLBACK InternetTransport_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
HINSTANCE hInstance
Definition: charmap.c:20
WNDPROC lpfnWndProc
Definition: winuser.h:3151
static const WCHAR wszClassName[]
INT WINAPI WSAStartup(IN WORD wVersionRequested, OUT LPWSADATA lpWSAData)
Definition: startup.c:113
LPCWSTR lpszClassName
Definition: winuser.h:3159
HINSTANCE hInstance
Definition: winuser.h:3154
#define memset(x, y, z)
Definition: compat.h:39

Referenced by DllMain().

◆ InternetTransport_UnregisterClass()

void InternetTransport_UnregisterClass ( HINSTANCE  hInstance)

Definition at line 383 of file internettransport.c.

384 {
386  WSACleanup();
387 }
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
INT WSAAPI WSACleanup(VOID)
Definition: startup.c:60
HINSTANCE hInstance
Definition: charmap.c:20
static const WCHAR wszClassName[]

Referenced by DllMain().

◆ InternetTransport_Write()

HRESULT InternetTransport_Write ( InternetTransport This,
const char pvData,
int  cbSize,
INETXPORT_COMPLETION_FUNCTION  fnCompletion 
)

Definition at line 224 of file internettransport.c.

226 {
227  int ret;
228 
229  if (This->Status == IXP_DISCONNECTED)
230  return IXP_E_NOT_CONNECTED;
231 
232  if (This->fnCompletion)
233  return IXP_E_BUSY;
234 
235  /* FIXME: do this asynchronously */
236  ret = send(This->Socket, pvData, cbSize, 0);
237  if (ret == SOCKET_ERROR)
238  {
239  ERR("send failed with error %d\n", WSAGetLastError());
240  /* FIXME: handle error */
241  }
242 
243  fnCompletion((IInternetTransport *)&This->u.vtbl, NULL, 0);
244 
245  return S_OK;
246 }
#define SOCKET_ERROR
Definition: winsock.h:333
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3748
smooth NULL
Definition: ftsmooth.c:416
INT WSAAPI WSAGetLastError(VOID)
Definition: dllmain.c:112
INT WSAAPI send(IN SOCKET s, IN CONST CHAR FAR *buf, IN INT len, IN INT flags)
Definition: send.c:23
int ret
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59

Referenced by InternetTransport_DoCommand(), and SMTPTransport_CallbackMessageSendDataStream().

◆ MimeAllocator_create()

HRESULT MimeAllocator_create ( IUnknown outer,
void **  obj 
)

Definition at line 3522 of file mimeole.c.

3523 {
3524  if(outer) return CLASS_E_NOAGGREGATION;
3525 
3526  *obj = &mime_allocator;
3527  return S_OK;
3528 }
static IMimeAllocator mime_allocator
Definition: mimeole.c:3517
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define S_OK
Definition: intsafe.h:59

Referenced by MimeOleGetAllocator().

◆ MimeBody_create()

HRESULT MimeBody_create ( IUnknown outer,
void **  obj 
)

Definition at line 1920 of file mimeole.c.

1921 {
1922  MimeBody *mb;
1923 
1924  if(outer)
1925  return CLASS_E_NOAGGREGATION;
1926 
1927  if ((mb = mimebody_create()))
1928  {
1929  *ppv = &mb->IMimeBody_iface;
1930  return S_OK;
1931  }
1932  else
1933  {
1934  *ppv = NULL;
1935  return E_OUTOFMEMORY;
1936  }
1937 }
static MimeBody * mimebody_create(void)
Definition: mimeole.c:1892
REFIID LPVOID * ppv
Definition: atlbase.h:39
IMimeBody IMimeBody_iface
Definition: mimeole.c:158
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define S_OK
Definition: intsafe.h:59

◆ MimeHtmlProtocol_create()

HRESULT MimeHtmlProtocol_create ( IUnknown outer,
void **  obj 
)

Definition at line 730 of file protocol.c.

731 {
733 
734  protocol = heap_alloc(sizeof(*protocol));
735  if(!protocol)
736  return E_OUTOFMEMORY;
737 
738  protocol->IUnknown_inner.lpVtbl = &MimeHtmlProtocolInnerVtbl;
739  protocol->IInternetProtocol_iface.lpVtbl = &MimeHtmlProtocolVtbl;
740  protocol->IInternetProtocolInfo_iface.lpVtbl = &MimeHtmlProtocolInfoVtbl;
741  protocol->ref = 1;
742  protocol->outer_unk = outer ? outer : &protocol->IUnknown_inner;
743  protocol->location = NULL;
744  protocol->stream = NULL;
745  protocol->sink = NULL;
746 
747  *obj = &protocol->IUnknown_inner;
748  return S_OK;
749 }
static const IUnknownVtbl MimeHtmlProtocolInnerVtbl
Definition: protocol.c:430
static const IInternetProtocolVtbl MimeHtmlProtocolVtbl
Definition: protocol.c:606
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
#define S_OK
Definition: intsafe.h:59
static const IInternetProtocolInfoVtbl MimeHtmlProtocolInfoVtbl
Definition: protocol.c:720

◆ MimeInternational_Construct()

HRESULT MimeInternational_Construct ( IMimeInternational **  internat)

Definition at line 526 of file mimeintl.c.

527 {
530  global_internat->refs = 0;
532  global_internat->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": global_internat.cs");
533 
537 
539 
540  IMimeInternational_AddRef(*internat);
541  return S_OK;
542 }
#define DWORD_PTR
Definition: treelist.c:76
static internat_impl * global_internat
Definition: mimeintl.c:524
IMimeInternational IMimeInternational_iface
Definition: mimeintl.c:52
struct list charsets
Definition: mimeintl.c:56
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HCHARSET default_charset
Definition: mimeintl.c:58
PCRITICAL_SECTION_DEBUG DebugInfo
Definition: winbase.h:859
#define S_OK
Definition: intsafe.h:59
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
static IMimeInternationalVtbl mime_internat_vtbl
Definition: mimeintl.c:502
CRITICAL_SECTION cs
Definition: mimeintl.c:54
LONG next_charset_handle
Definition: mimeintl.c:57
DWORD_PTR Spare[8/sizeof(DWORD_PTR)]
Definition: winbase.h:852

Referenced by DllMain().

◆ MimeMessage_create()

HRESULT MimeMessage_create ( IUnknown outer,
void **  obj 
)

Definition at line 3085 of file mimeole.c.

3086 {
3087  MimeMessage *This;
3088  MimeBody *mime_body;
3089  body_t *root_body;
3090 
3091  TRACE("(%p, %p)\n", outer, obj);
3092 
3093  if (outer)
3094  {
3095  FIXME("outer unknown not supported yet\n");
3096  return E_NOTIMPL;
3097  }
3098 
3099  *obj = NULL;
3100 
3101  This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
3102  if (!This) return E_OUTOFMEMORY;
3103 
3104  This->IMimeMessage_iface.lpVtbl = &MimeMessageVtbl;
3105  This->ref = 1;
3106  This->stream = NULL;
3107  list_init(&This->body_tree);
3108  This->next_index = 1;
3109 
3110  mime_body = mimebody_create();
3111  root_body = new_body_entry(mime_body, This->next_index++, NULL);
3112  list_add_head(&This->body_tree, &root_body->entry);
3113 
3114  *obj = &This->IMimeMessage_iface;
3115  return S_OK;
3116 }
static MimeBody * mimebody_create(void)
Definition: mimeole.c:1892
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
Definition: list.h:96
static const IMimeMessageVtbl MimeMessageVtbl
Definition: mimeole.c:3025
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
struct list entry
Definition: mimeole.c:1941
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
static body_t * new_body_entry(MimeBody *mime_body, DWORD index, body_t *parent)
Definition: mimeole.c:2041

Referenced by load_mime_message(), and MimeOleCreateMessage().

◆ MimeSecurity_create()

HRESULT MimeSecurity_create ( IUnknown outer,
void **  obj 
)

Definition at line 3310 of file mimeole.c.

3311 {
3312  MimeSecurity *This;
3313 
3314  *obj = NULL;
3315 
3316  if (outer) return CLASS_E_NOAGGREGATION;
3317 
3318  This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
3319  if (!This) return E_OUTOFMEMORY;
3320 
3321  This->IMimeSecurity_iface.lpVtbl = &MimeSecurityVtbl;
3322  This->ref = 1;
3323 
3324  *obj = &This->IMimeSecurity_iface;
3325  return S_OK;
3326 }
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define S_OK
Definition: intsafe.h:59
static const IMimeSecurityVtbl MimeSecurityVtbl
Definition: mimeole.c:3293

Referenced by MimeOleCreateSecurity().

◆ POP3TransportCF_Create()

HRESULT POP3TransportCF_Create ( REFIID  riid,
LPVOID ppv 
)

Definition at line 1201 of file pop3transport.c.

1202 {
1203  return IClassFactory_QueryInterface((IClassFactory *)&POP3TransportCF, riid, ppv);
1204 }
static const IClassFactoryVtbl * POP3TransportCF
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39

Referenced by DllGetClassObject().

◆ SMTPTransportCF_Create()

HRESULT SMTPTransportCF_Create ( REFIID  riid,
LPVOID ppv 
)

Definition at line 1041 of file smtptransport.c.

1042 {
1043  return IClassFactory_QueryInterface((IClassFactory *)&SMTPTransportCF, riid, ppv);
1044 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static const IClassFactoryVtbl * SMTPTransportCF

Referenced by DllGetClassObject().

◆ VirtualStream_create()

HRESULT VirtualStream_create ( IUnknown outer,
void **  obj 
)

Definition at line 3535 of file mimeole.c.

3536 {
3537  FIXME("(%p, %p)\n", outer, obj);
3538 
3539  *obj = NULL;
3540  if (outer) return CLASS_E_NOAGGREGATION;
3541 
3543 }
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
HRESULT WINAPI MimeOleCreateVirtualStream(IStream **ppStream)
Definition: mimeole.c:3139