ReactOS  0.4.15-dev-313-g8fde48b
pop3transport.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "winnt.h"
#include "winuser.h"
#include "objbase.h"
#include "mimeole.h"
#include "wine/debug.h"
#include "inetcomm_private.h"
Include dependency graph for pop3transport.c:

Go to the source code of this file.

Classes

struct  POP3Transport
 

Macros

#define COBJMACROS
 
#define NONAMELESSUNION
 

Enumerations

enum  parse_state {
  STATE_NONE, STATE_OK, STATE_MULTILINE, STATE_DONE,
  STATE_ROOT, STATE_CONFIGURATION, STATE_STARTUP, STATE_UNKNOWN,
  state_whitespace, state_token, state_quote
}
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (inetcomm)
 
static HRESULT parse_response (POP3Transport *This)
 
static HRESULT parse_uidl_response (POP3Transport *This, POP3UIDL *uidl)
 
static HRESULT parse_stat_response (POP3Transport *This, POP3STAT *stat)
 
static HRESULT parse_list_response (POP3Transport *This, POP3LIST *list)
 
static HRESULT parse_dele_response (POP3Transport *This, DWORD *dwPopId)
 
static HRESULT parse_retr_response (POP3Transport *This, POP3RETR *retr)
 
static HRESULT parse_top_response (POP3Transport *This, POP3TOP *top)
 
static void init_parser (POP3Transport *This, POP3COMMAND command)
 
static HRESULT POP3Transport_ParseResponse (POP3Transport *This, char *pszResponse, POP3RESPONSE *pResponse)
 
static void POP3Transport_CallbackProcessDELEResp (IInternetTransport *iface, char *pBuffer, int cbBuffer)
 
static void POP3Transport_CallbackRecvDELEResp (IInternetTransport *iface, char *pBuffer, int cbBuffer)
 
static void POP3Transport_CallbackProcessNOOPResp (IInternetTransport *iface, char *pBuffer, int cbBuffer)
 
static void POP3Transport_CallbackRecvNOOPResp (IInternetTransport *iface, char *pBuffer, int cbBuffer)
 
static void POP3Transport_CallbackProcessRSETResp (IInternetTransport *iface, char *pBuffer, int cbBuffer)
 
static void POP3Transport_CallbackRecvRSETResp (IInternetTransport *iface, char *pBuffer, int cbBuffer)
 
static void POP3Transport_CallbackProcessRETRResp (IInternetTransport *iface, char *pBuffer, int cbBuffer)
 
static void POP3Transport_CallbackRecvRETRResp (IInternetTransport *iface, char *pBuffer, int cbBuffer)
 
static void POP3Transport_CallbackProcessTOPResp (IInternetTransport *iface, char *pBuffer, int cbBuffer)
 
static void POP3Transport_CallbackRecvTOPResp (IInternetTransport *iface, char *pBuffer, int cbBuffer)
 
static void POP3Transport_CallbackProcessLISTResp (IInternetTransport *iface, char *pBuffer, int cbBuffer)
 
static void POP3Transport_CallbackRecvLISTResp (IInternetTransport *iface, char *pBuffer, int cbBuffer)
 
static void POP3Transport_CallbackProcessUIDLResp (IInternetTransport *iface, char *pBuffer, int cbBuffer)
 
static void POP3Transport_CallbackRecvUIDLResp (IInternetTransport *iface, char *pBuffer, int cbBuffer)
 
static void POP3Transport_CallbackProcessSTATResp (IInternetTransport *iface, char *pBuffer, int cbBuffer)
 
static void POP3Transport_CallbackRecvSTATResp (IInternetTransport *iface, char *pBuffer, int cbBuffer)
 
static void POP3Transport_CallbackProcessPASSResp (IInternetTransport *iface, char *pBuffer, int cbBuffer)
 
static void POP3Transport_CallbackRecvPASSResp (IInternetTransport *iface, char *pBuffer, int cbBuffer)
 
static void POP3Transport_CallbackProcessUSERResp (IInternetTransport *iface, char *pBuffer, int cbBuffer)
 
static void POP3Transport_CallbackRecvUSERResp (IInternetTransport *iface, char *pBuffer, int cbBuffer)
 
static void POP3Transport_CallbackSendUSERCmd (IInternetTransport *iface, char *pBuffer, int cbBuffer)
 
static void POP3Transport_CallbackProcessQUITResponse (IInternetTransport *iface, char *pBuffer, int cbBuffer)
 
static void POP3Transport_CallbackRecvQUITResp (IInternetTransport *iface, char *pBuffer, int cbBuffer)
 
static HRESULT WINAPI POP3Transport_QueryInterface (IPOP3Transport *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI POP3Transport_AddRef (IPOP3Transport *iface)
 
static ULONG WINAPI POP3Transport_Release (IPOP3Transport *iface)
 
static HRESULT WINAPI POP3Transport_GetServerInfo (IPOP3Transport *iface, LPINETSERVER pInetServer)
 
static IXPTYPE WINAPI POP3Transport_GetIXPType (IPOP3Transport *iface)
 
static HRESULT WINAPI POP3Transport_IsState (IPOP3Transport *iface, IXPISSTATE isstate)
 
static HRESULT WINAPI POP3Transport_InetServerFromAccount (IPOP3Transport *iface, IImnAccount *pAccount, LPINETSERVER pInetServer)
 
static HRESULT WINAPI POP3Transport_Connect (IPOP3Transport *iface, LPINETSERVER pInetServer, boolean fAuthenticate, boolean fCommandLogging)
 
static HRESULT WINAPI POP3Transport_HandsOffCallback (IPOP3Transport *iface)
 
static HRESULT WINAPI POP3Transport_Disconnect (IPOP3Transport *iface)
 
static HRESULT WINAPI POP3Transport_DropConnection (IPOP3Transport *iface)
 
static HRESULT WINAPI POP3Transport_GetStatus (IPOP3Transport *iface, IXPSTATUS *pCurrentStatus)
 
static HRESULT WINAPI POP3Transport_InitNew (IPOP3Transport *iface, LPSTR pszLogFilePath, IPOP3Callback *pCallback)
 
static HRESULT WINAPI POP3Transport_MarkItem (IPOP3Transport *iface, POP3MARKTYPE marktype, DWORD dwPopId, boolean fMarked)
 
static HRESULT WINAPI POP3Transport_CommandAUTH (IPOP3Transport *iface, LPSTR pszAuthType)
 
static HRESULT WINAPI POP3Transport_CommandUSER (IPOP3Transport *iface, LPSTR username)
 
static HRESULT WINAPI POP3Transport_CommandPASS (IPOP3Transport *iface, LPSTR password)
 
static HRESULT WINAPI POP3Transport_CommandLIST (IPOP3Transport *iface, POP3CMDTYPE cmdtype, DWORD dwPopId)
 
static HRESULT WINAPI POP3Transport_CommandTOP (IPOP3Transport *iface, POP3CMDTYPE cmdtype, DWORD dwPopId, DWORD cPreviewLines)
 
static HRESULT WINAPI POP3Transport_CommandQUIT (IPOP3Transport *iface)
 
static HRESULT WINAPI POP3Transport_CommandSTAT (IPOP3Transport *iface)
 
static HRESULT WINAPI POP3Transport_CommandNOOP (IPOP3Transport *iface)
 
static HRESULT WINAPI POP3Transport_CommandRSET (IPOP3Transport *iface)
 
static HRESULT WINAPI POP3Transport_CommandUIDL (IPOP3Transport *iface, POP3CMDTYPE cmdtype, DWORD dwPopId)
 
static HRESULT WINAPI POP3Transport_CommandDELE (IPOP3Transport *iface, POP3CMDTYPE cmdtype, DWORD dwPopId)
 
static HRESULT WINAPI POP3Transport_CommandRETR (IPOP3Transport *iface, POP3CMDTYPE cmdtype, DWORD dwPopId)
 
HRESULT WINAPI CreatePOP3Transport (IPOP3Transport **ppTransport)
 
static HRESULT WINAPI POP3TransportCF_QueryInterface (LPCLASSFACTORY iface, REFIID riid, LPVOID *ppv)
 
static ULONG WINAPI POP3TransportCF_AddRef (LPCLASSFACTORY iface)
 
static ULONG WINAPI POP3TransportCF_Release (LPCLASSFACTORY iface)
 
static HRESULT WINAPI POP3TransportCF_CreateInstance (LPCLASSFACTORY iface, LPUNKNOWN pUnk, REFIID riid, LPVOID *ppv)
 
static HRESULT WINAPI POP3TransportCF_LockServer (LPCLASSFACTORY iface, BOOL fLock)
 
HRESULT POP3TransportCF_Create (REFIID riid, LPVOID *ppv)
 

Variables

static const IPOP3TransportVtbl POP3TransportVtbl
 
static const IClassFactoryVtbl POP3TransportCFVtbl
 
static const IClassFactoryVtbl * POP3TransportCF = &POP3TransportCFVtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file pop3transport.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 22 of file pop3transport.c.

Enumeration Type Documentation

◆ parse_state

Enumerator
STATE_NONE 
STATE_OK 
STATE_MULTILINE 
STATE_DONE 
STATE_ROOT 
STATE_CONFIGURATION 
STATE_STARTUP 
STATE_UNKNOWN 
state_whitespace 
state_token 
state_quote 

Definition at line 39 of file pop3transport.c.

Function Documentation

◆ CreatePOP3Transport()

HRESULT WINAPI CreatePOP3Transport ( IPOP3Transport **  ppTransport)

Definition at line 1117 of file pop3transport.c.

1118 {
1119  HRESULT hr;
1120  POP3Transport *This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
1121  if (!This)
1122  return E_OUTOFMEMORY;
1123 
1124  This->InetTransport.u.vtblPOP3 = &POP3TransportVtbl;
1125  This->refs = 0;
1126  hr = InternetTransport_Init(&This->InetTransport);
1127  if (FAILED(hr))
1128  {
1129  HeapFree(GetProcessHeap(), 0, This);
1130  return hr;
1131  }
1132 
1133  *ppTransport = (IPOP3Transport *)&This->InetTransport.u.vtblPOP3;
1134  IPOP3Transport_AddRef(*ppTransport);
1135 
1136  return S_OK;
1137 }
HRESULT hr
Definition: shlfolder.c:183
static const IPOP3TransportVtbl POP3TransportVtbl
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:78
#define S_OK
Definition: intsafe.h:59
HRESULT InternetTransport_Init(InternetTransport *This) DECLSPEC_HIDDEN
#define HeapFree(x, y, z)
Definition: compat.h:403

Referenced by POP3TransportCF_CreateInstance().

◆ init_parser()

◆ parse_dele_response()

static HRESULT parse_dele_response ( POP3Transport This,
DWORD dwPopId 
)
static

Definition at line 207 of file pop3transport.c.

208 {
209  switch (This->state)
210  {
211  case STATE_OK:
212  *dwPopId = 0; /* FIXME */
213  This->state = STATE_DONE;
214  return S_OK;
215 
216  default:
217  WARN("parse error\n");
218  This->state = STATE_DONE;
219  return S_FALSE;
220  }
221 }
#define WARN(fmt,...)
Definition: debug.h:112
#define S_FALSE
Definition: winerror.h:2357
#define S_OK
Definition: intsafe.h:59

Referenced by POP3Transport_ParseResponse().

◆ parse_list_response()

static HRESULT parse_list_response ( POP3Transport This,
POP3LIST *  list 
)
static

Definition at line 161 of file pop3transport.c.

162 {
163  char *p;
164 
165  list->dwPopId = 0;
166  list->cbSize = 0;
167  switch (This->state)
168  {
169  case STATE_OK:
170  if (This->type == POP3CMD_GET_POPID)
171  {
172  if ((p = strchr(This->ptr, ' ')))
173  {
174  while (*p == ' ') p++;
175  sscanf(p, "%u %u", &list->dwPopId, &list->cbSize);
176  This->valid_info = TRUE;
177  }
178  This->state = STATE_DONE;
179  return S_OK;
180  }
181  This->state = STATE_MULTILINE;
182  return S_OK;
183 
184  case STATE_MULTILINE:
185  if (This->response[0] == '.' && !This->response[1])
186  {
187  This->valid_info = FALSE;
188  This->state = STATE_DONE;
189  return S_OK;
190  }
191  sscanf(This->response, "%u", &list->dwPopId);
192  if ((p = strchr(This->response, ' ')))
193  {
194  while (*p == ' ') p++;
195  sscanf(p, "%u", &list->cbSize);
196  This->valid_info = TRUE;
197  return S_OK;
198  }
199 
200  default:
201  WARN("parse error\n");
202  This->state = STATE_DONE;
203  return S_FALSE;
204  }
205 }
#define TRUE
Definition: types.h:120
#define WARN(fmt,...)
Definition: debug.h:112
#define S_FALSE
Definition: winerror.h:2357
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
Definition: _list.h:228
#define S_OK
Definition: intsafe.h:59
char * strchr(const char *String, int ch)
Definition: utclib.c:501
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by POP3Transport_ParseResponse().

◆ parse_response()

static HRESULT parse_response ( POP3Transport This)
static

Definition at line 61 of file pop3transport.c.

62 {
63  switch (This->state)
64  {
65  case STATE_NONE:
66  if (strlen(This->response) < 3)
67  {
68  WARN("parse error\n");
69  This->state = STATE_DONE;
70  return S_FALSE;
71  }
72  if (!memcmp(This->response, "+OK", 3))
73  {
74  This->ptr = This->response + 3;
75  This->state = STATE_OK;
76  return S_OK;
77  }
78  This->state = STATE_DONE;
79  return S_FALSE;
80 
81  default: return S_OK;
82  }
83 }
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define WARN(fmt,...)
Definition: debug.h:112
#define S_FALSE
Definition: winerror.h:2357
#define S_OK
Definition: intsafe.h:59

Referenced by POP3Transport_ParseResponse().

◆ parse_retr_response()

static HRESULT parse_retr_response ( POP3Transport This,
POP3RETR *  retr 
)
static

Definition at line 223 of file pop3transport.c.

224 {
225  switch (This->state)
226  {
227  case STATE_OK:
228  retr->fHeader = FALSE;
229  retr->fBody = FALSE;
230  retr->dwPopId = This->msgid;
231  retr->cbSoFar = 0;
232  retr->pszLines = This->response;
233  retr->cbLines = 0;
234 
235  This->state = STATE_MULTILINE;
236  This->valid_info = FALSE;
237  return S_OK;
238 
239  case STATE_MULTILINE:
240  {
241  int len;
242 
243  if (This->response[0] == '.' && !This->response[1])
244  {
245  retr->cbLines = retr->cbSoFar;
246  This->state = STATE_DONE;
247  return S_OK;
248  }
249  retr->fHeader = TRUE;
250  if (!This->response[0]) retr->fBody = TRUE;
251 
252  len = strlen(This->response);
253  retr->cbSoFar += len;
254  retr->pszLines = This->response;
255  retr->cbLines = len;
256 
257  This->valid_info = TRUE;
258  return S_OK;
259  }
260 
261  default:
262  WARN("parse error\n");
263  This->state = STATE_DONE;
264  return S_FALSE;
265  }
266 }
#define TRUE
Definition: types.h:120
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define WARN(fmt,...)
Definition: debug.h:112
#define S_FALSE
Definition: winerror.h:2357
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:59

Referenced by POP3Transport_ParseResponse().

◆ parse_stat_response()

static HRESULT parse_stat_response ( POP3Transport This,
POP3STAT *  stat 
)
static

Definition at line 136 of file pop3transport.c.

137 {
138  char *p;
139 
140  stat->cMessages = 0;
141  stat->cbMessages = 0;
142  switch (This->state)
143  {
144  case STATE_OK:
145  if ((p = strchr(This->ptr, ' ')))
146  {
147  while (*p == ' ') p++;
148  sscanf(p, "%u %u", &stat->cMessages, &stat->cbMessages);
149  This->valid_info = TRUE;
150  This->state = STATE_DONE;
151  return S_OK;
152  }
153 
154  default:
155  WARN("parse error\n");
156  This->state = STATE_DONE;
157  return S_FALSE;
158  }
159 }
#define TRUE
Definition: types.h:120
#define WARN(fmt,...)
Definition: debug.h:112
#define S_FALSE
Definition: winerror.h:2357
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
Definition: stat.h:55
#define S_OK
Definition: intsafe.h:59
char * strchr(const char *String, int ch)
Definition: utclib.c:501
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by POP3Transport_ParseResponse().

◆ parse_top_response()

static HRESULT parse_top_response ( POP3Transport This,
POP3TOP *  top 
)
static

Definition at line 268 of file pop3transport.c.

269 {
270  switch (This->state)
271  {
272  case STATE_OK:
273  top->fHeader = FALSE;
274  top->fBody = FALSE;
275  top->dwPopId = This->msgid;
276  top->cPreviewLines = This->preview_lines;
277  top->cbSoFar = 0;
278  top->pszLines = This->response;
279  top->cbLines = 0;
280 
281  This->state = STATE_MULTILINE;
282  This->valid_info = FALSE;
283  return S_OK;
284 
285  case STATE_MULTILINE:
286  {
287  int len;
288 
289  if (This->response[0] == '.' && !This->response[1])
290  {
291  top->cbLines = top->cbSoFar;
292  This->state = STATE_DONE;
293  return S_OK;
294  }
295  top->fHeader = TRUE;
296  if (!This->response[0]) top->fBody = TRUE;
297 
298  len = strlen(This->response);
299  top->cbSoFar += len;
300  top->pszLines = This->response;
301  top->cbLines = len;
302 
303  This->valid_info = TRUE;
304  return S_OK;
305  }
306 
307  default:
308  WARN("parse error\n");
309  This->state = STATE_DONE;
310  return S_FALSE;
311  }
312 }
#define TRUE
Definition: types.h:120
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define WARN(fmt,...)
Definition: debug.h:112
#define S_FALSE
Definition: winerror.h:2357
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:59
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

Referenced by POP3Transport_ParseResponse().

◆ parse_uidl_response()

static HRESULT parse_uidl_response ( POP3Transport This,
POP3UIDL *  uidl 
)
static

Definition at line 85 of file pop3transport.c.

86 {
87  char *p;
88 
89  uidl->dwPopId = 0;
90  uidl->pszUidl = NULL;
91  switch (This->state)
92  {
93  case STATE_OK:
94  if (This->type == POP3CMD_GET_POPID)
95  {
96  if ((p = strchr(This->ptr, ' ')))
97  {
98  while (*p == ' ') p++;
99  sscanf(p, "%u", &uidl->dwPopId);
100  if ((p = strchr(p, ' ')))
101  {
102  while (*p == ' ') p++;
103  uidl->pszUidl = p;
104  This->valid_info = TRUE;
105  }
106  }
107  This->state = STATE_DONE;
108  return S_OK;
109  }
110  This->state = STATE_MULTILINE;
111  return S_OK;
112 
113  case STATE_MULTILINE:
114  if (This->response[0] == '.' && !This->response[1])
115  {
116  This->valid_info = FALSE;
117  This->state = STATE_DONE;
118  return S_OK;
119  }
120  sscanf(This->response, "%u", &uidl->dwPopId);
121  if ((p = strchr(This->response, ' ')))
122  {
123  while (*p == ' ') p++;
124  uidl->pszUidl = p;
125  This->valid_info = TRUE;
126  return S_OK;
127  }
128 
129  default:
130  WARN("parse error\n");
131  This->state = STATE_DONE;
132  return S_FALSE;
133  }
134 }
#define TRUE
Definition: types.h:120
#define WARN(fmt,...)
Definition: debug.h:112
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
#define S_OK
Definition: intsafe.h:59
char * strchr(const char *String, int ch)
Definition: utclib.c:501
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by POP3Transport_ParseResponse().

◆ POP3Transport_AddRef()

static ULONG WINAPI POP3Transport_AddRef ( IPOP3Transport iface)
static

Definition at line 739 of file pop3transport.c.

740 {
741  POP3Transport *This = (POP3Transport *)iface;
742  return InterlockedIncrement((LONG *)&This->refs);
743 }
long LONG
Definition: pedump.c:60
#define InterlockedIncrement
Definition: armddk.h:53

◆ POP3Transport_CallbackProcessDELEResp()

static void POP3Transport_CallbackProcessDELEResp ( IInternetTransport iface,
char pBuffer,
int  cbBuffer 
)
static

Definition at line 365 of file pop3transport.c.

366 {
367  POP3Transport *This = (POP3Transport *)iface;
368  POP3RESPONSE response;
369  HRESULT hr;
370 
371  TRACE("\n");
372 
374  if (FAILED(hr))
375  {
376  /* FIXME: handle error */
377  return;
378  }
379 
380  IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
381 }
HRESULT hr
Definition: shlfolder.c:183
static HRESULT POP3Transport_ParseResponse(POP3Transport *This, char *pszResponse, POP3RESPONSE *pResponse)
PVOID pBuffer
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78

Referenced by POP3Transport_CallbackRecvDELEResp().

◆ POP3Transport_CallbackProcessLISTResp()

static void POP3Transport_CallbackProcessLISTResp ( IInternetTransport iface,
char pBuffer,
int  cbBuffer 
)
static

Definition at line 511 of file pop3transport.c.

512 {
513  POP3Transport *This = (POP3Transport *)iface;
514  POP3RESPONSE response;
515  HRESULT hr;
516 
517  TRACE("\n");
518 
520  if (FAILED(hr))
521  {
522  /* FIXME: handle error */
523  return;
524  }
525 
526  IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
527 
528  if (!response.fDone)
529  {
531  return;
532  }
533 
534  IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
535 }
HRESULT hr
Definition: shlfolder.c:183
static HRESULT POP3Transport_ParseResponse(POP3Transport *This, char *pszResponse, POP3RESPONSE *pResponse)
PVOID pBuffer
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
static void POP3Transport_CallbackProcessLISTResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
HRESULT InternetTransport_ReadLine(InternetTransport *This, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN

Referenced by POP3Transport_CallbackRecvLISTResp().

◆ POP3Transport_CallbackProcessNOOPResp()

static void POP3Transport_CallbackProcessNOOPResp ( IInternetTransport iface,
char pBuffer,
int  cbBuffer 
)
static

Definition at line 391 of file pop3transport.c.

392 {
393  POP3Transport *This = (POP3Transport *)iface;
394  POP3RESPONSE response;
395  HRESULT hr;
396 
397  TRACE("\n");
398 
400  if (FAILED(hr))
401  {
402  /* FIXME: handle error */
403  return;
404  }
405 
406  IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
407 }
HRESULT hr
Definition: shlfolder.c:183
static HRESULT POP3Transport_ParseResponse(POP3Transport *This, char *pszResponse, POP3RESPONSE *pResponse)
PVOID pBuffer
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78

Referenced by POP3Transport_CallbackRecvNOOPResp().

◆ POP3Transport_CallbackProcessPASSResp()

static void POP3Transport_CallbackProcessPASSResp ( IInternetTransport iface,
char pBuffer,
int  cbBuffer 
)
static

Definition at line 605 of file pop3transport.c.

606 {
607  POP3Transport *This = (POP3Transport *)iface;
608  POP3RESPONSE response;
609  HRESULT hr;
610 
611  TRACE("\n");
612 
614  if (FAILED(hr))
615  {
616  /* FIXME: handle error */
617  return;
618  }
619 
622 
623  IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
624 }
HRESULT hr
Definition: shlfolder.c:183
HRESULT InternetTransport_ChangeStatus(InternetTransport *This, IXPSTATUS Status) DECLSPEC_HIDDEN
static HRESULT POP3Transport_ParseResponse(POP3Transport *This, char *pszResponse, POP3RESPONSE *pResponse)
PVOID pBuffer
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78

Referenced by POP3Transport_CallbackRecvPASSResp().

◆ POP3Transport_CallbackProcessQUITResponse()

static void POP3Transport_CallbackProcessQUITResponse ( IInternetTransport iface,
char pBuffer,
int  cbBuffer 
)
static

Definition at line 695 of file pop3transport.c.

696 {
697  POP3Transport *This = (POP3Transport *)iface;
698  POP3RESPONSE response;
699  HRESULT hr;
700 
701  TRACE("%s\n", debugstr_an(pBuffer, cbBuffer));
702 
704  if (FAILED(hr))
705  {
706  /* FIXME: handle error */
707  return;
708  }
709 
710  IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
711  InternetTransport_DropConnection(&This->InetTransport);
712 }
HRESULT hr
Definition: shlfolder.c:183
static HRESULT POP3Transport_ParseResponse(POP3Transport *This, char *pszResponse, POP3RESPONSE *pResponse)
PVOID pBuffer
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:47
HRESULT InternetTransport_DropConnection(InternetTransport *This) DECLSPEC_HIDDEN

Referenced by POP3Transport_CallbackRecvQUITResp().

◆ POP3Transport_CallbackProcessRETRResp()

static void POP3Transport_CallbackProcessRETRResp ( IInternetTransport iface,
char pBuffer,
int  cbBuffer 
)
static

Definition at line 443 of file pop3transport.c.

444 {
445  POP3Transport *This = (POP3Transport *)iface;
446  POP3RESPONSE response;
447  HRESULT hr;
448 
449  TRACE("\n");
450 
452  if (FAILED(hr))
453  {
454  /* FIXME: handle error */
455  return;
456  }
457 
458  IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
459 
460  if (!response.fDone)
461  {
463  return;
464  }
465 
466  IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
467 }
HRESULT hr
Definition: shlfolder.c:183
static HRESULT POP3Transport_ParseResponse(POP3Transport *This, char *pszResponse, POP3RESPONSE *pResponse)
PVOID pBuffer
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
static void POP3Transport_CallbackProcessRETRResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
HRESULT InternetTransport_ReadLine(InternetTransport *This, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN

Referenced by POP3Transport_CallbackRecvRETRResp().

◆ POP3Transport_CallbackProcessRSETResp()

static void POP3Transport_CallbackProcessRSETResp ( IInternetTransport iface,
char pBuffer,
int  cbBuffer 
)
static

Definition at line 417 of file pop3transport.c.

418 {
419  POP3Transport *This = (POP3Transport *)iface;
420  POP3RESPONSE response;
421  HRESULT hr;
422 
423  TRACE("\n");
424 
426  if (FAILED(hr))
427  {
428  /* FIXME: handle error */
429  return;
430  }
431 
432  IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
433 }
HRESULT hr
Definition: shlfolder.c:183
static HRESULT POP3Transport_ParseResponse(POP3Transport *This, char *pszResponse, POP3RESPONSE *pResponse)
PVOID pBuffer
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78

Referenced by POP3Transport_CallbackRecvRSETResp().

◆ POP3Transport_CallbackProcessSTATResp()

static void POP3Transport_CallbackProcessSTATResp ( IInternetTransport iface,
char pBuffer,
int  cbBuffer 
)
static

Definition at line 579 of file pop3transport.c.

580 {
581  POP3Transport *This = (POP3Transport *)iface;
582  POP3RESPONSE response;
583  HRESULT hr;
584 
585  TRACE("\n");
586 
588  if (FAILED(hr))
589  {
590  /* FIXME: handle error */
591  return;
592  }
593 
594  IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
595 }
HRESULT hr
Definition: shlfolder.c:183
static HRESULT POP3Transport_ParseResponse(POP3Transport *This, char *pszResponse, POP3RESPONSE *pResponse)
PVOID pBuffer
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78

Referenced by POP3Transport_CallbackRecvSTATResp().

◆ POP3Transport_CallbackProcessTOPResp()

static void POP3Transport_CallbackProcessTOPResp ( IInternetTransport iface,
char pBuffer,
int  cbBuffer 
)
static

Definition at line 477 of file pop3transport.c.

478 {
479  POP3Transport *This = (POP3Transport *)iface;
480  POP3RESPONSE response;
481  HRESULT hr;
482 
483  TRACE("\n");
484 
486  if (FAILED(hr))
487  {
488  /* FIXME: handle error */
489  return;
490  }
491 
492  IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
493 
494  if (!response.fDone)
495  {
497  return;
498  }
499 
500  IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
501 }
HRESULT hr
Definition: shlfolder.c:183
static void POP3Transport_CallbackProcessTOPResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static HRESULT POP3Transport_ParseResponse(POP3Transport *This, char *pszResponse, POP3RESPONSE *pResponse)
PVOID pBuffer
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
HRESULT InternetTransport_ReadLine(InternetTransport *This, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN

Referenced by POP3Transport_CallbackRecvTOPResp().

◆ POP3Transport_CallbackProcessUIDLResp()

static void POP3Transport_CallbackProcessUIDLResp ( IInternetTransport iface,
char pBuffer,
int  cbBuffer 
)
static

Definition at line 545 of file pop3transport.c.

546 {
547  POP3Transport *This = (POP3Transport *)iface;
548  POP3RESPONSE response;
549  HRESULT hr;
550 
551  TRACE("\n");
552 
554  if (FAILED(hr))
555  {
556  /* FIXME: handle error */
557  return;
558  }
559 
560  IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
561 
562  if (!response.fDone)
563  {
565  return;
566  }
567 
568  IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
569 }
HRESULT hr
Definition: shlfolder.c:183
static HRESULT POP3Transport_ParseResponse(POP3Transport *This, char *pszResponse, POP3RESPONSE *pResponse)
PVOID pBuffer
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
static void POP3Transport_CallbackProcessUIDLResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
HRESULT InternetTransport_ReadLine(InternetTransport *This, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN

Referenced by POP3Transport_CallbackRecvUIDLResp().

◆ POP3Transport_CallbackProcessUSERResp()

static void POP3Transport_CallbackProcessUSERResp ( IInternetTransport iface,
char pBuffer,
int  cbBuffer 
)
static

Definition at line 634 of file pop3transport.c.

635 {
636  static const char pass[] = "PASS ";
637  POP3Transport *This = (POP3Transport *)iface;
638  POP3RESPONSE response;
639  char *command;
640  int len;
641  HRESULT hr;
642 
643  TRACE("\n");
644 
646  if (FAILED(hr))
647  {
648  /* FIXME: handle error */
649  return;
650  }
651 
652  IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
653 
654  len = sizeof(pass) + strlen(This->InetTransport.ServerInfo.szPassword) + 2; /* "\r\n" */
656 
657  strcpy(command, pass);
658  strcat(command, This->InetTransport.ServerInfo.szPassword);
659  strcat(command, "\r\n");
660 
661  init_parser(This, POP3_PASS);
662 
665 }
HRESULT hr
Definition: shlfolder.c:183
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
pass
Definition: typegen.h:24
static void init_parser(POP3Transport *This, POP3COMMAND command)
static HRESULT POP3Transport_ParseResponse(POP3Transport *This, char *pszResponse, POP3RESPONSE *pResponse)
PVOID pBuffer
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:78
GLenum GLsizei len
Definition: glext.h:6722
HRESULT InternetTransport_DoCommand(InternetTransport *This, LPCSTR pszCommand, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN
int command(const char *fmt,...)
Definition: ftp.c:266
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
static void POP3Transport_CallbackRecvPASSResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
#define HeapFree(x, y, z)
Definition: compat.h:403

Referenced by POP3Transport_CallbackRecvUSERResp().

◆ POP3Transport_CallbackRecvDELEResp()

static void POP3Transport_CallbackRecvDELEResp ( IInternetTransport iface,
char pBuffer,
int  cbBuffer 
)
static

Definition at line 383 of file pop3transport.c.

384 {
385  POP3Transport *This = (POP3Transport *)iface;
386 
387  TRACE("\n");
389 }
static void POP3Transport_CallbackProcessDELEResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT InternetTransport_ReadLine(InternetTransport *This, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN

Referenced by POP3Transport_CommandDELE().

◆ POP3Transport_CallbackRecvLISTResp()

static void POP3Transport_CallbackRecvLISTResp ( IInternetTransport iface,
char pBuffer,
int  cbBuffer 
)
static

Definition at line 537 of file pop3transport.c.

538 {
539  POP3Transport *This = (POP3Transport *)iface;
540 
541  TRACE("\n");
543 }
#define TRACE(s)
Definition: solgame.cpp:4
static void POP3Transport_CallbackProcessLISTResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
HRESULT InternetTransport_ReadLine(InternetTransport *This, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN

Referenced by POP3Transport_CommandLIST().

◆ POP3Transport_CallbackRecvNOOPResp()

static void POP3Transport_CallbackRecvNOOPResp ( IInternetTransport iface,
char pBuffer,
int  cbBuffer 
)
static

Definition at line 409 of file pop3transport.c.

410 {
411  POP3Transport *This = (POP3Transport *)iface;
412 
413  TRACE("\n");
415 }
#define TRACE(s)
Definition: solgame.cpp:4
static void POP3Transport_CallbackProcessNOOPResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
HRESULT InternetTransport_ReadLine(InternetTransport *This, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN

Referenced by POP3Transport_CommandNOOP().

◆ POP3Transport_CallbackRecvPASSResp()

static void POP3Transport_CallbackRecvPASSResp ( IInternetTransport iface,
char pBuffer,
int  cbBuffer 
)
static

Definition at line 626 of file pop3transport.c.

627 {
628  POP3Transport *This = (POP3Transport *)iface;
629 
630  TRACE("\n");
632 }
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT InternetTransport_ReadLine(InternetTransport *This, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN
static void POP3Transport_CallbackProcessPASSResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)

Referenced by POP3Transport_CallbackProcessUSERResp(), and POP3Transport_CommandPASS().

◆ POP3Transport_CallbackRecvQUITResp()

static void POP3Transport_CallbackRecvQUITResp ( IInternetTransport iface,
char pBuffer,
int  cbBuffer 
)
static

Definition at line 714 of file pop3transport.c.

715 {
716  POP3Transport *This = (POP3Transport *)iface;
717 
718  TRACE("\n");
720 }
#define TRACE(s)
Definition: solgame.cpp:4
static void POP3Transport_CallbackProcessQUITResponse(IInternetTransport *iface, char *pBuffer, int cbBuffer)
HRESULT InternetTransport_ReadLine(InternetTransport *This, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN

Referenced by POP3Transport_CommandQUIT().

◆ POP3Transport_CallbackRecvRETRResp()

static void POP3Transport_CallbackRecvRETRResp ( IInternetTransport iface,
char pBuffer,
int  cbBuffer 
)
static

Definition at line 469 of file pop3transport.c.

470 {
471  POP3Transport *This = (POP3Transport *)iface;
472 
473  TRACE("\n");
475 }
#define TRACE(s)
Definition: solgame.cpp:4
static void POP3Transport_CallbackProcessRETRResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
HRESULT InternetTransport_ReadLine(InternetTransport *This, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN

Referenced by POP3Transport_CommandRETR().

◆ POP3Transport_CallbackRecvRSETResp()

static void POP3Transport_CallbackRecvRSETResp ( IInternetTransport iface,
char pBuffer,
int  cbBuffer 
)
static

Definition at line 435 of file pop3transport.c.

436 {
437  POP3Transport *This = (POP3Transport *)iface;
438 
439  TRACE("\n");
441 }
#define TRACE(s)
Definition: solgame.cpp:4
static void POP3Transport_CallbackProcessRSETResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
HRESULT InternetTransport_ReadLine(InternetTransport *This, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN

Referenced by POP3Transport_CommandRSET().

◆ POP3Transport_CallbackRecvSTATResp()

static void POP3Transport_CallbackRecvSTATResp ( IInternetTransport iface,
char pBuffer,
int  cbBuffer 
)
static

Definition at line 597 of file pop3transport.c.

598 {
599  POP3Transport *This = (POP3Transport *)iface;
600 
601  TRACE("\n");
603 }
#define TRACE(s)
Definition: solgame.cpp:4
static void POP3Transport_CallbackProcessSTATResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
HRESULT InternetTransport_ReadLine(InternetTransport *This, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN

Referenced by POP3Transport_CommandSTAT().

◆ POP3Transport_CallbackRecvTOPResp()

static void POP3Transport_CallbackRecvTOPResp ( IInternetTransport iface,
char pBuffer,
int  cbBuffer 
)
static

Definition at line 503 of file pop3transport.c.

504 {
505  POP3Transport *This = (POP3Transport *)iface;
506 
507  TRACE("\n");
509 }
static void POP3Transport_CallbackProcessTOPResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT InternetTransport_ReadLine(InternetTransport *This, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN

Referenced by POP3Transport_CommandTOP().

◆ POP3Transport_CallbackRecvUIDLResp()

static void POP3Transport_CallbackRecvUIDLResp ( IInternetTransport iface,
char pBuffer,
int  cbBuffer 
)
static

Definition at line 571 of file pop3transport.c.

572 {
573  POP3Transport *This = (POP3Transport *)iface;
574 
575  TRACE("\n");
577 }
#define TRACE(s)
Definition: solgame.cpp:4
static void POP3Transport_CallbackProcessUIDLResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
HRESULT InternetTransport_ReadLine(InternetTransport *This, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN

Referenced by POP3Transport_CommandUIDL().

◆ POP3Transport_CallbackRecvUSERResp()

static void POP3Transport_CallbackRecvUSERResp ( IInternetTransport iface,
char pBuffer,
int  cbBuffer 
)
static

Definition at line 667 of file pop3transport.c.

668 {
669  POP3Transport *This = (POP3Transport *)iface;
670 
671  TRACE("\n");
673 }
#define TRACE(s)
Definition: solgame.cpp:4
static void POP3Transport_CallbackProcessUSERResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
HRESULT InternetTransport_ReadLine(InternetTransport *This, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN

Referenced by POP3Transport_CallbackSendUSERCmd(), and POP3Transport_CommandUSER().

◆ POP3Transport_CallbackSendUSERCmd()

static void POP3Transport_CallbackSendUSERCmd ( IInternetTransport iface,
char pBuffer,
int  cbBuffer 
)
static

Definition at line 675 of file pop3transport.c.

676 {
677  static const char user[] = "USER ";
678  POP3Transport *This = (POP3Transport *)iface;
679  char *command;
680  int len;
681 
682  TRACE("\n");
683 
684  len = sizeof(user) + strlen(This->InetTransport.ServerInfo.szUserName) + 2; /* "\r\n" */
686 
687  strcpy(command, user);
688  strcat(command, This->InetTransport.ServerInfo.szUserName);
689  strcat(command, "\r\n");
691 
693 }
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static void POP3Transport_CallbackRecvUSERResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
GLenum GLsizei len
Definition: glext.h:6722
HRESULT InternetTransport_DoCommand(InternetTransport *This, LPCSTR pszCommand, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN
int command(const char *fmt,...)
Definition: ftp.c:266
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
void user(int argc, const char *argv[])
Definition: cmds.c:1350
#define HeapFree(x, y, z)
Definition: compat.h:403

Referenced by POP3Transport_Connect().

◆ POP3Transport_CommandAUTH()

static HRESULT WINAPI POP3Transport_CommandAUTH ( IPOP3Transport iface,
LPSTR  pszAuthType 
)
static

Definition at line 865 of file pop3transport.c.

866 {
867  FIXME("(%s)\n", pszAuthType);
868  return E_NOTIMPL;
869 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ POP3Transport_CommandDELE()

static HRESULT WINAPI POP3Transport_CommandDELE ( IPOP3Transport iface,
POP3CMDTYPE  cmdtype,
DWORD  dwPopId 
)
static

Definition at line 1043 of file pop3transport.c.

1045 {
1046  static const char dele[] = "DELE %u\r\n";
1047  POP3Transport *This = (POP3Transport *)iface;
1048  char *command;
1049  int len;
1050 
1051  TRACE("(%u, %u)\n", cmdtype, dwPopId);
1052 
1053  len = sizeof(dele) + 10 + 2; /* "4294967296" + "\r\n" */
1054  if (!(command = HeapAlloc(GetProcessHeap(), 0, len))) return S_FALSE;
1055  sprintf(command, dele, dwPopId);
1056 
1057  init_parser(This, POP3_DELE);
1058  This->type = cmdtype;
1060 
1062  return S_OK;
1063 }
static void POP3Transport_CallbackRecvDELEResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
#define sprintf(buf, format,...)
Definition: sprintf.c:55
static void init_parser(POP3Transport *This, POP3COMMAND command)
#define S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
GLenum GLsizei len
Definition: glext.h:6722
HRESULT InternetTransport_DoCommand(InternetTransport *This, LPCSTR pszCommand, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN
#define S_OK
Definition: intsafe.h:59
int command(const char *fmt,...)
Definition: ftp.c:266
#define HeapFree(x, y, z)
Definition: compat.h:403

◆ POP3Transport_CommandLIST()

static HRESULT WINAPI POP3Transport_CommandLIST ( IPOP3Transport iface,
POP3CMDTYPE  cmdtype,
DWORD  dwPopId 
)
static

Definition at line 917 of file pop3transport.c.

919 {
920  static const char list[] = "LIST %u\r\n";
921  static char list_all[] = "LIST\r\n";
922  POP3Transport *This = (POP3Transport *)iface;
923  char *command;
924  int len;
925 
926  TRACE("(%u, %u)\n", cmdtype, dwPopId);
927 
928  if (dwPopId)
929  {
930  len = sizeof(list) + 10 + 2; /* "4294967296" + "\r\n" */
931  if (!(command = HeapAlloc(GetProcessHeap(), 0, len))) return S_FALSE;
932  sprintf(command, list, dwPopId);
933  }
934  else command = list_all;
935 
936  init_parser(This, POP3_LIST);
937  This->type = cmdtype;
939 
940  if (dwPopId) HeapFree(GetProcessHeap(), 0, command);
941  return S_OK;
942 }
static void POP3Transport_CallbackRecvLISTResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
#define sprintf(buf, format,...)
Definition: sprintf.c:55
static void init_parser(POP3Transport *This, POP3COMMAND command)
#define S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
GLenum GLsizei len
Definition: glext.h:6722
Definition: _list.h:228
HRESULT InternetTransport_DoCommand(InternetTransport *This, LPCSTR pszCommand, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN
#define S_OK
Definition: intsafe.h:59
#define list
Definition: rosglue.h:35
int command(const char *fmt,...)
Definition: ftp.c:266
#define HeapFree(x, y, z)
Definition: compat.h:403

◆ POP3Transport_CommandNOOP()

static HRESULT WINAPI POP3Transport_CommandNOOP ( IPOP3Transport iface)
static

Definition at line 992 of file pop3transport.c.

993 {
994  static const char noop[] = "NOOP\r\n";
995  POP3Transport *This = (POP3Transport *)iface;
996 
997  TRACE("\n");
998 
999  init_parser(This, POP3_NOOP);
1001  return S_OK;
1002 }
static void init_parser(POP3Transport *This, POP3COMMAND command)
static void POP3Transport_CallbackRecvNOOPResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT InternetTransport_DoCommand(InternetTransport *This, LPCSTR pszCommand, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN
#define S_OK
Definition: intsafe.h:59

◆ POP3Transport_CommandPASS()

static HRESULT WINAPI POP3Transport_CommandPASS ( IPOP3Transport iface,
LPSTR  password 
)
static

Definition at line 894 of file pop3transport.c.

895 {
896  static const char pass[] = "PASS ";
897  POP3Transport *This = (POP3Transport *)iface;
898  char *command;
899  int len;
900 
901  TRACE("(%p)\n", password);
902 
903  len = sizeof(pass) + strlen(password) + 2; /* "\r\n" */
904  if (!(command = HeapAlloc(GetProcessHeap(), 0, len))) return S_FALSE;
905 
906  strcpy(command, pass);
908  strcat(command, "\r\n");
909 
910  init_parser(This, POP3_PASS);
912 
914  return S_OK;
915 }
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
pass
Definition: typegen.h:24
static void init_parser(POP3Transport *This, POP3COMMAND command)
#define S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
T1_FIELD_DICT_PRIVATE password
Definition: t1tokens.h:64
GLenum GLsizei len
Definition: glext.h:6722
HRESULT InternetTransport_DoCommand(InternetTransport *This, LPCSTR pszCommand, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN
#define S_OK
Definition: intsafe.h:59
int command(const char *fmt,...)
Definition: ftp.c:266
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
static void POP3Transport_CallbackRecvPASSResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
#define HeapFree(x, y, z)
Definition: compat.h:403

◆ POP3Transport_CommandQUIT()

static HRESULT WINAPI POP3Transport_CommandQUIT ( IPOP3Transport iface)
static

Definition at line 967 of file pop3transport.c.

968 {
969  static const char command[] = "QUIT\r\n";
970  POP3Transport *This = (POP3Transport *)iface;
971 
972  TRACE("()\n");
973 
975 
976  init_parser(This, POP3_QUIT);
978 }
HRESULT InternetTransport_ChangeStatus(InternetTransport *This, IXPSTATUS Status) DECLSPEC_HIDDEN
static void init_parser(POP3Transport *This, POP3COMMAND command)
#define TRACE(s)
Definition: solgame.cpp:4
static void POP3Transport_CallbackRecvQUITResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
HRESULT InternetTransport_DoCommand(InternetTransport *This, LPCSTR pszCommand, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN

◆ POP3Transport_CommandRETR()

static HRESULT WINAPI POP3Transport_CommandRETR ( IPOP3Transport iface,
POP3CMDTYPE  cmdtype,
DWORD  dwPopId 
)
static

Definition at line 1065 of file pop3transport.c.

1067 {
1068  static const char retr[] = "RETR %u\r\n";
1069  POP3Transport *This = (POP3Transport *)iface;
1070  char *command;
1071  int len;
1072 
1073  TRACE("(%u, %u)\n", cmdtype, dwPopId);
1074 
1075  len = sizeof(retr) + 10 + 2; /* "4294967296" + "\r\n" */
1076  if (!(command = HeapAlloc(GetProcessHeap(), 0, len))) return S_FALSE;
1077  sprintf(command, retr, dwPopId);
1078 
1079  init_parser(This, POP3_RETR);
1080  This->type = cmdtype;
1082 
1084  return S_OK;
1085 }
#define sprintf(buf, format,...)
Definition: sprintf.c:55
static void init_parser(POP3Transport *This, POP3COMMAND command)
#define S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
GLenum GLsizei len
Definition: glext.h:6722
static void POP3Transport_CallbackRecvRETRResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
HRESULT InternetTransport_DoCommand(InternetTransport *This, LPCSTR pszCommand, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN
#define S_OK
Definition: intsafe.h:59
int command(const char *fmt,...)
Definition: ftp.c:266
#define HeapFree(x, y, z)
Definition: compat.h:403

◆ POP3Transport_CommandRSET()

static HRESULT WINAPI POP3Transport_CommandRSET ( IPOP3Transport iface)
static

Definition at line 1004 of file pop3transport.c.

1005 {
1006  static const char rset[] = "RSET\r\n";
1007  POP3Transport *This = (POP3Transport *)iface;
1008 
1009  TRACE("\n");
1010 
1011  init_parser(This, POP3_RSET);
1013  return S_OK;
1014 }
static void POP3Transport_CallbackRecvRSETResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static void init_parser(POP3Transport *This, POP3COMMAND command)
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT InternetTransport_DoCommand(InternetTransport *This, LPCSTR pszCommand, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN
#define S_OK
Definition: intsafe.h:59

◆ POP3Transport_CommandSTAT()

static HRESULT WINAPI POP3Transport_CommandSTAT ( IPOP3Transport iface)
static

Definition at line 980 of file pop3transport.c.

981 {
982  static const char stat[] = "STAT\r\n";
983  POP3Transport *This = (POP3Transport *)iface;
984 
985  TRACE("\n");
986 
987  init_parser(This, POP3_STAT);
989  return S_OK;
990 }
static void init_parser(POP3Transport *This, POP3COMMAND command)
#define TRACE(s)
Definition: solgame.cpp:4
Definition: stat.h:55
static void POP3Transport_CallbackRecvSTATResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
HRESULT InternetTransport_DoCommand(InternetTransport *This, LPCSTR pszCommand, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN
#define S_OK
Definition: intsafe.h:59

◆ POP3Transport_CommandTOP()

static HRESULT WINAPI POP3Transport_CommandTOP ( IPOP3Transport iface,
POP3CMDTYPE  cmdtype,
DWORD  dwPopId,
DWORD  cPreviewLines 
)
static

Definition at line 944 of file pop3transport.c.

946 {
947  static const char top[] = "TOP %u %u\r\n";
948  POP3Transport *This = (POP3Transport *)iface;
949  char *command;
950  int len;
951 
952  TRACE("(%u, %u, %u)\n", cmdtype, dwPopId, cPreviewLines);
953 
954  len = sizeof(top) + 20 + 2; /* 2 * "4294967296" + "\r\n" */
955  if (!(command = HeapAlloc(GetProcessHeap(), 0, len))) return S_FALSE;
956  sprintf(command, top, dwPopId, cPreviewLines);
957 
958  This->preview_lines = cPreviewLines;
959  init_parser(This, POP3_TOP);
960  This->type = cmdtype;
962 
964  return S_OK;
965 }
#define sprintf(buf, format,...)
Definition: sprintf.c:55
static void init_parser(POP3Transport *This, POP3COMMAND command)
#define S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static void POP3Transport_CallbackRecvTOPResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
GLenum GLsizei len
Definition: glext.h:6722
HRESULT InternetTransport_DoCommand(InternetTransport *This, LPCSTR pszCommand, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN
#define S_OK
Definition: intsafe.h:59
int command(const char *fmt,...)
Definition: ftp.c:266
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
#define HeapFree(x, y, z)
Definition: compat.h:403

◆ POP3Transport_CommandUIDL()

static HRESULT WINAPI POP3Transport_CommandUIDL ( IPOP3Transport iface,
POP3CMDTYPE  cmdtype,
DWORD  dwPopId 
)
static

Definition at line 1016 of file pop3transport.c.

1018 {
1019  static const char uidl[] = "UIDL %u\r\n";
1020  static char uidl_all[] = "UIDL\r\n";
1021  POP3Transport *This = (POP3Transport *)iface;
1022  char *command;
1023  int len;
1024 
1025  TRACE("(%u, %u)\n", cmdtype, dwPopId);
1026 
1027  if (dwPopId)
1028  {
1029  len = sizeof(uidl) + 10 + 2; /* "4294967296" + "\r\n" */
1030  if (!(command = HeapAlloc(GetProcessHeap(), 0, len))) return S_FALSE;
1031  sprintf(command, uidl, dwPopId);
1032  }
1033  else command = uidl_all;
1034 
1035  init_parser(This, POP3_UIDL);
1036  This->type = cmdtype;
1038 
1039  if (dwPopId) HeapFree(GetProcessHeap(), 0, command);
1040  return S_OK;
1041 }
static void POP3Transport_CallbackRecvUIDLResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
#define sprintf(buf, format,...)
Definition: sprintf.c:55
static void init_parser(POP3Transport *This, POP3COMMAND command)
#define S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
GLenum GLsizei len
Definition: glext.h:6722
HRESULT InternetTransport_DoCommand(InternetTransport *This, LPCSTR pszCommand, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN
#define S_OK
Definition: intsafe.h:59
int command(const char *fmt,...)
Definition: ftp.c:266
#define HeapFree(x, y, z)
Definition: compat.h:403

◆ POP3Transport_CommandUSER()

static HRESULT WINAPI POP3Transport_CommandUSER ( IPOP3Transport iface,
LPSTR  username 
)
static

Definition at line 871 of file pop3transport.c.

872 {
873  static const char user[] = "USER ";
874  POP3Transport *This = (POP3Transport *)iface;
875  char *command;
876  int len;
877 
878  TRACE("(%s)\n", username);
879 
880  len = sizeof(user) + strlen(username) + 2; /* "\r\n" */
881  if (!(command = HeapAlloc(GetProcessHeap(), 0, len))) return S_FALSE;
882 
883  strcpy(command, user);
885  strcat(command, "\r\n");
886 
887  init_parser(This, POP3_USER);
889 
891  return S_OK;
892 }
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static void POP3Transport_CallbackRecvUSERResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static void init_parser(POP3Transport *This, POP3COMMAND command)
#define S_FALSE
Definition: winerror.h:2357
static WCHAR username[]
Definition: url.c:32
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
GLenum GLsizei len
Definition: glext.h:6722
HRESULT InternetTransport_DoCommand(InternetTransport *This, LPCSTR pszCommand, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN
#define S_OK
Definition: intsafe.h:59
int command(const char *fmt,...)
Definition: ftp.c:266
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
void user(int argc, const char *argv[])
Definition: cmds.c:1350
#define HeapFree(x, y, z)
Definition: compat.h:403

◆ POP3Transport_Connect()

static HRESULT WINAPI POP3Transport_Connect ( IPOP3Transport iface,
LPINETSERVER  pInetServer,
boolean  fAuthenticate,
boolean  fCommandLogging 
)
static

Definition at line 790 of file pop3transport.c.

792 {
793  POP3Transport *This = (POP3Transport *)iface;
794  HRESULT hr;
795 
796  TRACE("(%p, %s, %s)\n", pInetServer, fAuthenticate ? "TRUE" : "FALSE", fCommandLogging ? "TRUE" : "FALSE");
797 
798  hr = InternetTransport_Connect(&This->InetTransport, pInetServer, fAuthenticate, fCommandLogging);
799  if (FAILED(hr))
800  return hr;
801 
802  init_parser(This, POP3_USER);
804 }
HRESULT hr
Definition: shlfolder.c:183
static void init_parser(POP3Transport *This, POP3COMMAND command)
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT InternetTransport_Connect(InternetTransport *This, LPINETSERVER pInetServer, boolean fAuthenticate, boolean fCommandLogging) DECLSPEC_HIDDEN
LONG HRESULT
Definition: typedefs.h:78
static void POP3Transport_CallbackSendUSERCmd(IInternetTransport *iface, char *pBuffer, int cbBuffer)
HRESULT InternetTransport_ReadLine(InternetTransport *This, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN

◆ POP3Transport_Disconnect()

static HRESULT WINAPI POP3Transport_Disconnect ( IPOP3Transport iface)
static

Definition at line 814 of file pop3transport.c.

815 {
816  TRACE("()\n");
817  return IPOP3Transport_CommandQUIT(iface);
818 }
#define TRACE(s)
Definition: solgame.cpp:4

◆ POP3Transport_DropConnection()

static HRESULT WINAPI POP3Transport_DropConnection ( IPOP3Transport iface)
static

Definition at line 820 of file pop3transport.c.

821 {
822  POP3Transport *This = (POP3Transport *)iface;
823 
824  TRACE("()\n");
825  return InternetTransport_DropConnection(&This->InetTransport);
826 }
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT InternetTransport_DropConnection(InternetTransport *This) DECLSPEC_HIDDEN

◆ POP3Transport_GetIXPType()

static IXPTYPE WINAPI POP3Transport_GetIXPType ( IPOP3Transport iface)
static

Definition at line 769 of file pop3transport.c.

770 {
771  TRACE("()\n");
772  return IXP_POP3;
773 }
#define TRACE(s)
Definition: solgame.cpp:4

◆ POP3Transport_GetServerInfo()

static HRESULT WINAPI POP3Transport_GetServerInfo ( IPOP3Transport iface,
LPINETSERVER  pInetServer 
)
static

Definition at line 760 of file pop3transport.c.

762 {
763  POP3Transport *This = (POP3Transport *)iface;
764 
765  TRACE("(%p)\n", pInetServer);
766  return InternetTransport_GetServerInfo(&This->InetTransport, pInetServer);
767 }
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT InternetTransport_GetServerInfo(InternetTransport *This, LPINETSERVER pInetServer) DECLSPEC_HIDDEN

◆ POP3Transport_GetStatus()

static HRESULT WINAPI POP3Transport_GetStatus ( IPOP3Transport iface,
IXPSTATUS pCurrentStatus 
)
static

Definition at line 828 of file pop3transport.c.

830 {
831  POP3Transport *This = (POP3Transport *)iface;
832 
833  TRACE("()\n");
834  return InternetTransport_GetStatus(&This->InetTransport, pCurrentStatus);
835 }
HRESULT InternetTransport_GetStatus(InternetTransport *This, IXPSTATUS *pCurrentStatus) DECLSPEC_HIDDEN
#define TRACE(s)
Definition: solgame.cpp:4

◆ POP3Transport_HandsOffCallback()

static HRESULT WINAPI POP3Transport_HandsOffCallback ( IPOP3Transport iface)
static

Definition at line 806 of file pop3transport.c.

807 {
808  POP3Transport *This = (POP3Transport *)iface;
809 
810  TRACE("()\n");
811  return InternetTransport_HandsOffCallback(&This->InetTransport);
812 }
HRESULT InternetTransport_HandsOffCallback(InternetTransport *This) DECLSPEC_HIDDEN
#define TRACE(s)
Definition: solgame.cpp:4

◆ POP3Transport_InetServerFromAccount()

static HRESULT WINAPI POP3Transport_InetServerFromAccount ( IPOP3Transport iface,
IImnAccount pAccount,
LPINETSERVER  pInetServer 
)
static

Definition at line 781 of file pop3transport.c.

783 {
784  POP3Transport *This = (POP3Transport *)iface;
785 
786  TRACE("(%p, %p)\n", pAccount, pInetServer);
787  return InternetTransport_InetServerFromAccount(&This->InetTransport, pAccount, pInetServer);
788 }
HRESULT InternetTransport_InetServerFromAccount(InternetTransport *This, IImnAccount *pAccount, LPINETSERVER pInetServer) DECLSPEC_HIDDEN
#define TRACE(s)
Definition: solgame.cpp:4

◆ POP3Transport_InitNew()

static HRESULT WINAPI POP3Transport_InitNew ( IPOP3Transport iface,
LPSTR  pszLogFilePath,
IPOP3Callback pCallback 
)
static

Definition at line 837 of file pop3transport.c.

839 {
840  POP3Transport *This = (POP3Transport *)iface;
841 
842  TRACE("(%s, %p)\n", debugstr_a(pszLogFilePath), pCallback);
843 
844  if (!pCallback)
845  return E_INVALIDARG;
846 
847  if (pszLogFilePath)
848  FIXME("not using log file of %s, use Wine debug logging instead\n",
849  debugstr_a(pszLogFilePath));
850 
851  IPOP3Callback_AddRef(pCallback);
852  This->InetTransport.pCallback = (ITransportCallback *)pCallback;
853  This->InetTransport.fInitialised = TRUE;
854 
855  return S_OK;
856 }
#define TRUE
Definition: types.h:120
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
#define S_OK
Definition: intsafe.h:59

◆ POP3Transport_IsState()

static HRESULT WINAPI POP3Transport_IsState ( IPOP3Transport iface,
IXPISSTATE  isstate 
)
static

Definition at line 775 of file pop3transport.c.

776 {
777  FIXME("(%u)\n", isstate);
778  return E_NOTIMPL;
779 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ POP3Transport_MarkItem()

static HRESULT WINAPI POP3Transport_MarkItem ( IPOP3Transport iface,
POP3MARKTYPE  marktype,
DWORD  dwPopId,
boolean  fMarked 
)
static

Definition at line 858 of file pop3transport.c.

860 {
861  FIXME("(%u, %u, %d)\n", marktype, dwPopId, fMarked);
862  return E_NOTIMPL;
863 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ POP3Transport_ParseResponse()

static HRESULT POP3Transport_ParseResponse ( POP3Transport This,
char pszResponse,
POP3RESPONSE *  pResponse 
)
static

Definition at line 320 of file pop3transport.c.

321 {
322  HRESULT hr;
323 
324  TRACE("response: %s\n", debugstr_a(pszResponse));
325 
326  This->response = pszResponse;
327  This->valid_info = FALSE;
328  TRACE("state %u\n", This->state);
329 
330  if (SUCCEEDED((hr = parse_response(This))))
331  {
332  switch (This->command)
333  {
334  case POP3_UIDL: hr = parse_uidl_response(This, &pResponse->u.rUidlInfo); break;
335  case POP3_STAT: hr = parse_stat_response(This, &pResponse->u.rStatInfo); break;
336  case POP3_LIST: hr = parse_list_response(This, &pResponse->u.rListInfo); break;
337  case POP3_DELE: hr = parse_dele_response(This, &pResponse->u.dwPopId); break;
338  case POP3_RETR: hr = parse_retr_response(This, &pResponse->u.rRetrInfo); break;
339  case POP3_TOP: hr = parse_top_response(This, &pResponse->u.rTopInfo); break;
340  default:
341  This->state = STATE_DONE;
342  break;
343  }
344  }
345  pResponse->command = This->command;
346  pResponse->fDone = (This->state == STATE_DONE);
347  pResponse->fValidInfo = This->valid_info;
348  pResponse->rIxpResult.hrResult = hr;
349  pResponse->rIxpResult.pszResponse = pszResponse;
350  pResponse->rIxpResult.uiServerError = 0;
351  pResponse->rIxpResult.hrServerError = pResponse->rIxpResult.hrResult;
352  pResponse->rIxpResult.dwSocketError = WSAGetLastError();
353  pResponse->rIxpResult.pszProblem = NULL;
354  pResponse->pTransport = (IPOP3Transport *)&This->InetTransport.u.vtblPOP3;
355 
356  if (This->InetTransport.pCallback && This->InetTransport.fCommandLogging)
357  {
358  ITransportCallback_OnCommand(This->InetTransport.pCallback, CMD_RESP,
359  pResponse->rIxpResult.pszResponse, pResponse->rIxpResult.hrServerError,
360  (IInternetTransport *)&This->InetTransport.u.vtbl);
361  }
362  return S_OK;
363 }
HRESULT hr
Definition: shlfolder.c:183
static HRESULT parse_stat_response(POP3Transport *This, POP3STAT *stat)
static HRESULT parse_response(POP3Transport *This)
Definition: pop3transport.c:61
static HRESULT parse_list_response(POP3Transport *This, POP3LIST *list)
static HRESULT parse_dele_response(POP3Transport *This, DWORD *dwPopId)
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
INT WSAAPI WSAGetLastError(VOID)
Definition: dllmain.c:112
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:78
#define S_OK
Definition: intsafe.h:59
static HRESULT parse_retr_response(POP3Transport *This, POP3RETR *retr)
static HRESULT parse_top_response(POP3Transport *This, POP3TOP *top)
static HRESULT parse_uidl_response(POP3Transport *This, POP3UIDL *uidl)
Definition: pop3transport.c:85
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by POP3Transport_CallbackProcessDELEResp(), POP3Transport_CallbackProcessLISTResp(), POP3Transport_CallbackProcessNOOPResp(), POP3Transport_CallbackProcessPASSResp(), POP3Transport_CallbackProcessQUITResponse(), POP3Transport_CallbackProcessRETRResp(), POP3Transport_CallbackProcessRSETResp(), POP3Transport_CallbackProcessSTATResp(), POP3Transport_CallbackProcessTOPResp(), POP3Transport_CallbackProcessUIDLResp(), and POP3Transport_CallbackProcessUSERResp().

◆ POP3Transport_QueryInterface()

static HRESULT WINAPI POP3Transport_QueryInterface ( IPOP3Transport iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 722 of file pop3transport.c.

723 {
724  TRACE("(%s, %p)\n", debugstr_guid(riid), ppv);
725 
726  if (IsEqualIID(riid, &IID_IUnknown) ||
727  IsEqualIID(riid, &IID_IInternetTransport) ||
728  IsEqualIID(riid, &IID_IPOP3Transport))
729  {
730  *ppv = iface;
731  IPOP3Transport_AddRef(iface);
732  return S_OK;
733  }
734  *ppv = NULL;
735  FIXME("no interface for %s\n", debugstr_guid(riid));
736  return E_NOINTERFACE;
737 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define FIXME(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ POP3Transport_Release()

static ULONG WINAPI POP3Transport_Release ( IPOP3Transport iface)
static

Definition at line 745 of file pop3transport.c.

746 {
747  POP3Transport *This = (POP3Transport *)iface;
748  ULONG refs = InterlockedDecrement((LONG *)&This->refs);
749  if (!refs)
750  {
751  TRACE("destroying %p\n", This);
752  if (This->InetTransport.Status != IXP_DISCONNECTED)
753  InternetTransport_DropConnection(&This->InetTransport);
754  if (This->InetTransport.pCallback) ITransportCallback_Release(This->InetTransport.pCallback);
756  }
757  return refs;
758 }
long LONG
Definition: pedump.c:60
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:404
#define InterlockedDecrement
Definition: armddk.h:52
HRESULT InternetTransport_DropConnection(InternetTransport *This) DECLSPEC_HIDDEN
unsigned int ULONG
Definition: retypes.h:1
#define HeapFree(x, y, z)
Definition: compat.h:403

◆ POP3TransportCF_AddRef()

static ULONG WINAPI POP3TransportCF_AddRef ( LPCLASSFACTORY  iface)
static

Definition at line 1152 of file pop3transport.c.

1153 {
1154  return 2; /* non-heap based object */
1155 }

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

◆ POP3TransportCF_CreateInstance()

static HRESULT WINAPI POP3TransportCF_CreateInstance ( LPCLASSFACTORY  iface,
LPUNKNOWN  pUnk,
REFIID  riid,
LPVOID ppv 
)
static

Definition at line 1162 of file pop3transport.c.

1164 {
1165  HRESULT hr;
1166  IPOP3Transport *pPop3Transport;
1167 
1168  TRACE("(%p, %s, %p)\n", pUnk, debugstr_guid(riid), ppv);
1169 
1170  *ppv = NULL;
1171 
1172  if (pUnk)
1173  return CLASS_E_NOAGGREGATION;
1174 
1175  hr = CreatePOP3Transport(&pPop3Transport);
1176  if (FAILED(hr))
1177  return hr;
1178 
1179  hr = IPOP3Transport_QueryInterface(pPop3Transport, riid, ppv);
1180  IPOP3Transport_Release(pPop3Transport);
1181 
1182  return hr;
1183 }
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:78
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
HRESULT WINAPI CreatePOP3Transport(IPOP3Transport **ppTransport)
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30

◆ POP3TransportCF_LockServer()

static HRESULT WINAPI POP3TransportCF_LockServer ( LPCLASSFACTORY  iface,
BOOL  fLock 
)
static

Definition at line 1185 of file pop3transport.c.

1186 {
1187  FIXME("(%d)\n",fLock);
1188  return S_OK;
1189 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define S_OK
Definition: intsafe.h:59

◆ POP3TransportCF_QueryInterface()

static HRESULT WINAPI POP3TransportCF_QueryInterface ( LPCLASSFACTORY  iface,
REFIID  riid,
LPVOID ppv 
)
static

Definition at line 1139 of file pop3transport.c.

1141 {
1142  *ppv = NULL;
1144  {
1145  *ppv = iface;
1146  IClassFactory_AddRef(iface);
1147  return S_OK;
1148  }
1149  return E_NOINTERFACE;
1150 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
const GUID IID_IClassFactory
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ POP3TransportCF_Release()

static ULONG WINAPI POP3TransportCF_Release ( LPCLASSFACTORY  iface)
static

Definition at line 1157 of file pop3transport.c.

1158 {
1159  return 1; /* non-heap based object */
1160 }

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( inetcomm  )

Variable Documentation

◆ POP3TransportCF

const IClassFactoryVtbl* POP3TransportCF = &POP3TransportCFVtbl
static

Definition at line 1199 of file pop3transport.c.

Referenced by POP3TransportCF_Create().

◆ POP3TransportCFVtbl

const IClassFactoryVtbl POP3TransportCFVtbl
static
Initial value:
=
{
}
static HRESULT WINAPI POP3TransportCF_LockServer(LPCLASSFACTORY iface, BOOL fLock)
static HRESULT WINAPI POP3TransportCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pUnk, REFIID riid, LPVOID *ppv)
static ULONG WINAPI POP3TransportCF_AddRef(LPCLASSFACTORY iface)
static HRESULT WINAPI POP3TransportCF_QueryInterface(LPCLASSFACTORY iface, REFIID riid, LPVOID *ppv)
static ULONG WINAPI POP3TransportCF_Release(LPCLASSFACTORY iface)

Definition at line 1191 of file pop3transport.c.

◆ POP3TransportVtbl

const IPOP3TransportVtbl POP3TransportVtbl
static
Initial value:
=
{
}
static HRESULT WINAPI POP3Transport_Disconnect(IPOP3Transport *iface)
static HRESULT WINAPI POP3Transport_InitNew(IPOP3Transport *iface, LPSTR pszLogFilePath, IPOP3Callback *pCallback)
static HRESULT WINAPI POP3Transport_Connect(IPOP3Transport *iface, LPINETSERVER pInetServer, boolean fAuthenticate, boolean fCommandLogging)
static HRESULT WINAPI POP3Transport_CommandTOP(IPOP3Transport *iface, POP3CMDTYPE cmdtype, DWORD dwPopId, DWORD cPreviewLines)
static HRESULT WINAPI POP3Transport_QueryInterface(IPOP3Transport *iface, REFIID riid, void **ppv)
static HRESULT WINAPI POP3Transport_CommandRETR(IPOP3Transport *iface, POP3CMDTYPE cmdtype, DWORD dwPopId)
static HRESULT WINAPI POP3Transport_CommandUIDL(IPOP3Transport *iface, POP3CMDTYPE cmdtype, DWORD dwPopId)
static IXPTYPE WINAPI POP3Transport_GetIXPType(IPOP3Transport *iface)
static HRESULT WINAPI POP3Transport_GetStatus(IPOP3Transport *iface, IXPSTATUS *pCurrentStatus)
static HRESULT WINAPI POP3Transport_InetServerFromAccount(IPOP3Transport *iface, IImnAccount *pAccount, LPINETSERVER pInetServer)
static HRESULT WINAPI POP3Transport_DropConnection(IPOP3Transport *iface)
static ULONG WINAPI POP3Transport_AddRef(IPOP3Transport *iface)
static HRESULT WINAPI POP3Transport_CommandNOOP(IPOP3Transport *iface)
static HRESULT WINAPI POP3Transport_CommandUSER(IPOP3Transport *iface, LPSTR username)
static HRESULT WINAPI POP3Transport_CommandLIST(IPOP3Transport *iface, POP3CMDTYPE cmdtype, DWORD dwPopId)
static HRESULT WINAPI POP3Transport_IsState(IPOP3Transport *iface, IXPISSTATE isstate)
static HRESULT WINAPI POP3Transport_CommandPASS(IPOP3Transport *iface, LPSTR password)
static HRESULT WINAPI POP3Transport_GetServerInfo(IPOP3Transport *iface, LPINETSERVER pInetServer)
static HRESULT WINAPI POP3Transport_MarkItem(IPOP3Transport *iface, POP3MARKTYPE marktype, DWORD dwPopId, boolean fMarked)
static ULONG WINAPI POP3Transport_Release(IPOP3Transport *iface)
static HRESULT WINAPI POP3Transport_CommandDELE(IPOP3Transport *iface, POP3CMDTYPE cmdtype, DWORD dwPopId)
static HRESULT WINAPI POP3Transport_CommandAUTH(IPOP3Transport *iface, LPSTR pszAuthType)
static HRESULT WINAPI POP3Transport_CommandRSET(IPOP3Transport *iface)
static HRESULT WINAPI POP3Transport_CommandQUIT(IPOP3Transport *iface)
static HRESULT WINAPI POP3Transport_CommandSTAT(IPOP3Transport *iface)
static HRESULT WINAPI POP3Transport_HandsOffCallback(IPOP3Transport *iface)

Definition at line 1087 of file pop3transport.c.

Referenced by CreatePOP3Transport().