ReactOS 0.4.17-dev-357-ga8f14ff
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
 

Enumerations

enum  parse_state {
  STATE_NONE , STATE_OK , STATE_MULTILINE , STATE_DONE ,
  STATE_ASSEMBLY_BINDING , STATE_ROOT , STATE_CONFIGURATION , STATE_PROBING ,
  STATE_RUNTIME , 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.

Enumeration Type Documentation

◆ parse_state

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

Definition at line 38 of file pop3transport.c.

39{
44};
@ STATE_MULTILINE
Definition: pop3transport.c:42
@ STATE_DONE
Definition: pop3transport.c:43
@ STATE_NONE
Definition: pop3transport.c:40
@ STATE_OK
Definition: pop3transport.c:41

Function Documentation

◆ CreatePOP3Transport()

HRESULT WINAPI CreatePOP3Transport ( IPOP3Transport **  ppTransport)

Definition at line 1116 of file pop3transport.c.

1117{
1118 HRESULT hr;
1119 POP3Transport *This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
1120 if (!This)
1121 return E_OUTOFMEMORY;
1122
1123 This->InetTransport.u.vtblPOP3 = &POP3TransportVtbl;
1124 This->refs = 0;
1125 hr = InternetTransport_Init(&This->InetTransport);
1126 if (FAILED(hr))
1127 {
1129 return hr;
1130 }
1131
1132 *ppTransport = (IPOP3Transport *)&This->InetTransport.u.vtblPOP3;
1133 IPOP3Transport_AddRef(*ppTransport);
1134
1135 return S_OK;
1136}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
HRESULT hr
Definition: delayimp.cpp:582
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
HRESULT InternetTransport_Init(InternetTransport *This)
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
static const IPOP3TransportVtbl POP3TransportVtbl

Referenced by POP3TransportCF_CreateInstance().

◆ init_parser()

◆ parse_dele_response()

static HRESULT parse_dele_response ( POP3Transport This,
DWORD dwPopId 
)
static

Definition at line 206 of file pop3transport.c.

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

Referenced by POP3Transport_ParseResponse().

◆ parse_list_response()

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

Definition at line 160 of file pop3transport.c.

161{
162 char *p;
163
164 list->dwPopId = 0;
165 list->cbSize = 0;
166 switch (This->state)
167 {
168 case STATE_OK:
169 if (This->type == POP3CMD_GET_POPID)
170 {
171 if ((p = strchr(This->ptr, ' ')))
172 {
173 while (*p == ' ') p++;
174 sscanf(p, "%lu %lu", &list->dwPopId, &list->cbSize);
175 This->valid_info = TRUE;
176 }
177 This->state = STATE_DONE;
178 return S_OK;
179 }
180 This->state = STATE_MULTILINE;
181 return S_OK;
182
183 case STATE_MULTILINE:
184 if (This->response[0] == '.' && !This->response[1])
185 {
186 This->valid_info = FALSE;
187 This->state = STATE_DONE;
188 return S_OK;
189 }
190 sscanf(This->response, "%lu", &list->dwPopId);
191 if ((p = strchr(This->response, ' ')))
192 {
193 while (*p == ' ') p++;
194 sscanf(p, "%lu", &list->cbSize);
195 This->valid_info = TRUE;
196 return S_OK;
197 }
198
199 default:
200 WARN("parse error\n");
201 This->state = STATE_DONE;
202 return S_FALSE;
203 }
204}
Definition: list.h:37
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
_ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl sscanf(const char *, const char *,...) __WINE_CRT_SCANF_ATTR(2
_ACRTIMP char *__cdecl strchr(const char *, int)
Definition: string.c:3291
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by POP3Transport_ParseResponse().

◆ parse_response()

static HRESULT parse_response ( POP3Transport This)
static

Definition at line 60 of file pop3transport.c.

61{
62 switch (This->state)
63 {
64 case STATE_NONE:
65 if (strlen(This->response) < 3)
66 {
67 WARN("parse error\n");
68 This->state = STATE_DONE;
69 return S_FALSE;
70 }
71 if (!memcmp(This->response, "+OK", 3))
72 {
73 This->ptr = This->response + 3;
74 This->state = STATE_OK;
75 return S_OK;
76 }
77 This->state = STATE_DONE;
78 return S_FALSE;
79
80 default: return S_OK;
81 }
82}
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2807
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1597

Referenced by POP3Transport_ParseResponse().

◆ parse_retr_response()

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

Definition at line 222 of file pop3transport.c.

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

Referenced by POP3Transport_ParseResponse().

◆ parse_stat_response()

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

Definition at line 135 of file pop3transport.c.

136{
137 char *p;
138
139 stat->cMessages = 0;
140 stat->cbMessages = 0;
141 switch (This->state)
142 {
143 case STATE_OK:
144 if ((p = strchr(This->ptr, ' ')))
145 {
146 while (*p == ' ') p++;
147 sscanf(p, "%lu %lu", &stat->cMessages, &stat->cbMessages);
148 This->valid_info = TRUE;
149 This->state = STATE_DONE;
150 return S_OK;
151 }
152
153 default:
154 WARN("parse error\n");
155 This->state = STATE_DONE;
156 return S_FALSE;
157 }
158}
Definition: stat.h:66

Referenced by POP3Transport_ParseResponse().

◆ parse_top_response()

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

Definition at line 267 of file pop3transport.c.

268{
269 switch (This->state)
270 {
271 case STATE_OK:
272 top->fHeader = FALSE;
273 top->fBody = FALSE;
274 top->dwPopId = This->msgid;
275 top->cPreviewLines = This->preview_lines;
276 top->cbSoFar = 0;
277 top->pszLines = This->response;
278 top->cbLines = 0;
279
280 This->state = STATE_MULTILINE;
281 This->valid_info = FALSE;
282 return S_OK;
283
284 case STATE_MULTILINE:
285 {
286 int len;
287
288 if (This->response[0] == '.' && !This->response[1])
289 {
290 top->cbLines = top->cbSoFar;
291 This->state = STATE_DONE;
292 return S_OK;
293 }
294 top->fHeader = TRUE;
295 if (!This->response[0]) top->fBody = TRUE;
296
297 len = strlen(This->response);
298 top->cbSoFar += len;
299 top->pszLines = This->response;
300 top->cbLines = len;
301
302 This->valid_info = TRUE;
303 return S_OK;
304 }
305
306 default:
307 WARN("parse error\n");
308 This->state = STATE_DONE;
309 return S_FALSE;
310 }
311}
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 84 of file pop3transport.c.

85{
86 char *p;
87
88 uidl->dwPopId = 0;
89 uidl->pszUidl = NULL;
90 switch (This->state)
91 {
92 case STATE_OK:
93 if (This->type == POP3CMD_GET_POPID)
94 {
95 if ((p = strchr(This->ptr, ' ')))
96 {
97 while (*p == ' ') p++;
98 sscanf(p, "%lu", &uidl->dwPopId);
99 if ((p = strchr(p, ' ')))
100 {
101 while (*p == ' ') p++;
102 uidl->pszUidl = p;
103 This->valid_info = TRUE;
104 }
105 }
106 This->state = STATE_DONE;
107 return S_OK;
108 }
109 This->state = STATE_MULTILINE;
110 return S_OK;
111
112 case STATE_MULTILINE:
113 if (This->response[0] == '.' && !This->response[1])
114 {
115 This->valid_info = FALSE;
116 This->state = STATE_DONE;
117 return S_OK;
118 }
119 sscanf(This->response, "%lu", &uidl->dwPopId);
120 if ((p = strchr(This->response, ' ')))
121 {
122 while (*p == ' ') p++;
123 uidl->pszUidl = p;
124 This->valid_info = TRUE;
125 return S_OK;
126 }
127
128 default:
129 WARN("parse error\n");
130 This->state = STATE_DONE;
131 return S_FALSE;
132 }
133}
#define NULL
Definition: types.h:112

Referenced by POP3Transport_ParseResponse().

◆ POP3Transport_AddRef()

static ULONG WINAPI POP3Transport_AddRef ( IPOP3Transport iface)
static

Definition at line 738 of file pop3transport.c.

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

◆ POP3Transport_CallbackProcessDELEResp()

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

Definition at line 364 of file pop3transport.c.

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

Referenced by POP3Transport_CallbackRecvDELEResp().

◆ POP3Transport_CallbackProcessLISTResp()

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

Definition at line 510 of file pop3transport.c.

511{
512 POP3Transport *This = (POP3Transport *)iface;
513 POP3RESPONSE response;
514 HRESULT hr;
515
516 TRACE("\n");
517
519 if (FAILED(hr))
520 {
521 /* FIXME: handle error */
522 return;
523 }
524
525 IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
526
527 if (!response.fDone)
528 {
530 return;
531 }
532
533 IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
534}
HRESULT InternetTransport_ReadLine(InternetTransport *This, INETXPORT_COMPLETION_FUNCTION fnCompletion)
static void POP3Transport_CallbackProcessLISTResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)

Referenced by POP3Transport_CallbackProcessLISTResp(), and POP3Transport_CallbackRecvLISTResp().

◆ POP3Transport_CallbackProcessNOOPResp()

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

Definition at line 390 of file pop3transport.c.

391{
392 POP3Transport *This = (POP3Transport *)iface;
393 POP3RESPONSE response;
394 HRESULT hr;
395
396 TRACE("\n");
397
399 if (FAILED(hr))
400 {
401 /* FIXME: handle error */
402 return;
403 }
404
405 IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
406}

Referenced by POP3Transport_CallbackRecvNOOPResp().

◆ POP3Transport_CallbackProcessPASSResp()

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

Definition at line 604 of file pop3transport.c.

605{
606 POP3Transport *This = (POP3Transport *)iface;
607 POP3RESPONSE response;
608 HRESULT hr;
609
610 TRACE("\n");
611
613 if (FAILED(hr))
614 {
615 /* FIXME: handle error */
616 return;
617 }
618
621
622 IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
623}
@ IXP_CONNECTED
Definition: imnxport.idl:248
@ IXP_AUTHORIZED
Definition: imnxport.idl:251
HRESULT InternetTransport_ChangeStatus(InternetTransport *This, IXPSTATUS Status)

Referenced by POP3Transport_CallbackRecvPASSResp().

◆ POP3Transport_CallbackProcessQUITResponse()

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

Definition at line 694 of file pop3transport.c.

695{
696 POP3Transport *This = (POP3Transport *)iface;
697 POP3RESPONSE response;
698 HRESULT hr;
699
700 TRACE("%s\n", debugstr_an(pBuffer, cbBuffer));
701
703 if (FAILED(hr))
704 {
705 /* FIXME: handle error */
706 return;
707 }
708
709 IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
710 InternetTransport_DropConnection(&This->InetTransport);
711}
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:55
HRESULT InternetTransport_DropConnection(InternetTransport *This)

Referenced by POP3Transport_CallbackRecvQUITResp().

◆ POP3Transport_CallbackProcessRETRResp()

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

Definition at line 442 of file pop3transport.c.

443{
444 POP3Transport *This = (POP3Transport *)iface;
445 POP3RESPONSE response;
446 HRESULT hr;
447
448 TRACE("\n");
449
451 if (FAILED(hr))
452 {
453 /* FIXME: handle error */
454 return;
455 }
456
457 IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
458
459 if (!response.fDone)
460 {
462 return;
463 }
464
465 IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
466}
static void POP3Transport_CallbackProcessRETRResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)

Referenced by POP3Transport_CallbackProcessRETRResp(), and POP3Transport_CallbackRecvRETRResp().

◆ POP3Transport_CallbackProcessRSETResp()

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

Definition at line 416 of file pop3transport.c.

417{
418 POP3Transport *This = (POP3Transport *)iface;
419 POP3RESPONSE response;
420 HRESULT hr;
421
422 TRACE("\n");
423
425 if (FAILED(hr))
426 {
427 /* FIXME: handle error */
428 return;
429 }
430
431 IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
432}

Referenced by POP3Transport_CallbackRecvRSETResp().

◆ POP3Transport_CallbackProcessSTATResp()

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

Definition at line 578 of file pop3transport.c.

579{
580 POP3Transport *This = (POP3Transport *)iface;
581 POP3RESPONSE response;
582 HRESULT hr;
583
584 TRACE("\n");
585
587 if (FAILED(hr))
588 {
589 /* FIXME: handle error */
590 return;
591 }
592
593 IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
594}

Referenced by POP3Transport_CallbackRecvSTATResp().

◆ POP3Transport_CallbackProcessTOPResp()

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

Definition at line 476 of file pop3transport.c.

477{
478 POP3Transport *This = (POP3Transport *)iface;
479 POP3RESPONSE response;
480 HRESULT hr;
481
482 TRACE("\n");
483
485 if (FAILED(hr))
486 {
487 /* FIXME: handle error */
488 return;
489 }
490
491 IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
492
493 if (!response.fDone)
494 {
496 return;
497 }
498
499 IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
500}
static void POP3Transport_CallbackProcessTOPResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)

Referenced by POP3Transport_CallbackProcessTOPResp(), and POP3Transport_CallbackRecvTOPResp().

◆ POP3Transport_CallbackProcessUIDLResp()

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

Definition at line 544 of file pop3transport.c.

545{
546 POP3Transport *This = (POP3Transport *)iface;
547 POP3RESPONSE response;
548 HRESULT hr;
549
550 TRACE("\n");
551
553 if (FAILED(hr))
554 {
555 /* FIXME: handle error */
556 return;
557 }
558
559 IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
560
561 if (!response.fDone)
562 {
564 return;
565 }
566
567 IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
568}
static void POP3Transport_CallbackProcessUIDLResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)

Referenced by POP3Transport_CallbackProcessUIDLResp(), and POP3Transport_CallbackRecvUIDLResp().

◆ POP3Transport_CallbackProcessUSERResp()

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

Definition at line 633 of file pop3transport.c.

634{
635 static const char pass[] = "PASS ";
636 POP3Transport *This = (POP3Transport *)iface;
637 POP3RESPONSE response;
638 char *command;
639 int len;
640 HRESULT hr;
641
642 TRACE("\n");
643
645 if (FAILED(hr))
646 {
647 /* FIXME: handle error */
648 return;
649 }
650
651 IPOP3Callback_OnResponse((IPOP3Callback *)This->InetTransport.pCallback, &response);
652
653 len = sizeof(pass) + strlen(This->InetTransport.ServerInfo.szPassword) + 2; /* "\r\n" */
655
657 strcat(command, This->InetTransport.ServerInfo.szPassword);
658 strcat(command, "\r\n");
659
660 init_parser(This, POP3_PASS);
661
664}
HRESULT InternetTransport_DoCommand(InternetTransport *This, LPCSTR pszCommand, INETXPORT_COMPLETION_FUNCTION fnCompletion)
static void init_parser(POP3Transport *This, POP3COMMAND command)
static void POP3Transport_CallbackRecvPASSResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
strcat
Definition: string.h:92
strcpy
Definition: string.h:131
pass
Definition: typegen.h:25

Referenced by POP3Transport_CallbackRecvUSERResp().

◆ POP3Transport_CallbackRecvDELEResp()

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

Definition at line 382 of file pop3transport.c.

383{
384 POP3Transport *This = (POP3Transport *)iface;
385
386 TRACE("\n");
388}
static void POP3Transport_CallbackProcessDELEResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)

Referenced by POP3Transport_CommandDELE().

◆ POP3Transport_CallbackRecvLISTResp()

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

Definition at line 536 of file pop3transport.c.

537{
538 POP3Transport *This = (POP3Transport *)iface;
539
540 TRACE("\n");
542}

Referenced by POP3Transport_CommandLIST().

◆ POP3Transport_CallbackRecvNOOPResp()

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

Definition at line 408 of file pop3transport.c.

409{
410 POP3Transport *This = (POP3Transport *)iface;
411
412 TRACE("\n");
414}
static void POP3Transport_CallbackProcessNOOPResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)

Referenced by POP3Transport_CommandNOOP().

◆ POP3Transport_CallbackRecvPASSResp()

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

Definition at line 625 of file pop3transport.c.

626{
627 POP3Transport *This = (POP3Transport *)iface;
628
629 TRACE("\n");
631}
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 713 of file pop3transport.c.

714{
715 POP3Transport *This = (POP3Transport *)iface;
716
717 TRACE("\n");
719}
static void POP3Transport_CallbackProcessQUITResponse(IInternetTransport *iface, char *pBuffer, int cbBuffer)

Referenced by POP3Transport_CommandQUIT().

◆ POP3Transport_CallbackRecvRETRResp()

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

Definition at line 468 of file pop3transport.c.

469{
470 POP3Transport *This = (POP3Transport *)iface;
471
472 TRACE("\n");
474}

Referenced by POP3Transport_CommandRETR().

◆ POP3Transport_CallbackRecvRSETResp()

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

Definition at line 434 of file pop3transport.c.

435{
436 POP3Transport *This = (POP3Transport *)iface;
437
438 TRACE("\n");
440}
static void POP3Transport_CallbackProcessRSETResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)

Referenced by POP3Transport_CommandRSET().

◆ POP3Transport_CallbackRecvSTATResp()

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

Definition at line 596 of file pop3transport.c.

597{
598 POP3Transport *This = (POP3Transport *)iface;
599
600 TRACE("\n");
602}
static void POP3Transport_CallbackProcessSTATResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)

Referenced by POP3Transport_CommandSTAT().

◆ POP3Transport_CallbackRecvTOPResp()

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

Definition at line 502 of file pop3transport.c.

503{
504 POP3Transport *This = (POP3Transport *)iface;
505
506 TRACE("\n");
508}

Referenced by POP3Transport_CommandTOP().

◆ POP3Transport_CallbackRecvUIDLResp()

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

Definition at line 570 of file pop3transport.c.

571{
572 POP3Transport *This = (POP3Transport *)iface;
573
574 TRACE("\n");
576}

Referenced by POP3Transport_CommandUIDL().

◆ POP3Transport_CallbackRecvUSERResp()

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

Definition at line 666 of file pop3transport.c.

667{
668 POP3Transport *This = (POP3Transport *)iface;
669
670 TRACE("\n");
672}
static void POP3Transport_CallbackProcessUSERResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)

Referenced by POP3Transport_CallbackSendUSERCmd(), and POP3Transport_CommandUSER().

◆ POP3Transport_CallbackSendUSERCmd()

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

Definition at line 674 of file pop3transport.c.

675{
676 static const char user[] = "USER ";
677 POP3Transport *This = (POP3Transport *)iface;
678 char *command;
679 int len;
680
681 TRACE("\n");
682
683 len = sizeof(user) + strlen(This->InetTransport.ServerInfo.szUserName) + 2; /* "\r\n" */
685
687 strcat(command, This->InetTransport.ServerInfo.szUserName);
688 strcat(command, "\r\n");
690
692}
void user(int argc, const char *argv[])
Definition: cmds.c:1350
static void POP3Transport_CallbackRecvUSERResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)

Referenced by POP3Transport_Connect().

◆ POP3Transport_CommandAUTH()

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

Definition at line 864 of file pop3transport.c.

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

◆ POP3Transport_CommandDELE()

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

Definition at line 1042 of file pop3transport.c.

1044{
1045 static const char dele[] = "DELE %lu\r\n";
1046 POP3Transport *This = (POP3Transport *)iface;
1047 char *command;
1048 int len;
1049
1050 TRACE("(%u, %lu)\n", cmdtype, dwPopId);
1051
1052 len = sizeof(dele) + 10 + 2; /* "4294967296" + "\r\n" */
1053 if (!(command = HeapAlloc(GetProcessHeap(), 0, len))) return S_FALSE;
1054 sprintf(command, dele, dwPopId);
1055
1056 init_parser(This, POP3_DELE);
1057 This->type = cmdtype;
1059
1061 return S_OK;
1062}
#define sprintf
Definition: sprintf.c:45
static void POP3Transport_CallbackRecvDELEResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)

◆ POP3Transport_CommandLIST()

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

Definition at line 916 of file pop3transport.c.

918{
919 static const char list[] = "LIST %lu\r\n";
920 static char list_all[] = "LIST\r\n";
921 POP3Transport *This = (POP3Transport *)iface;
922 char *command;
923 int len;
924
925 TRACE("(%u, %lu)\n", cmdtype, dwPopId);
926
927 if (dwPopId)
928 {
929 len = sizeof(list) + 10 + 2; /* "4294967296" + "\r\n" */
930 if (!(command = HeapAlloc(GetProcessHeap(), 0, len))) return S_FALSE;
931 sprintf(command, list, dwPopId);
932 }
933 else command = list_all;
934
935 init_parser(This, POP3_LIST);
936 This->type = cmdtype;
938
939 if (dwPopId) HeapFree(GetProcessHeap(), 0, command);
940 return S_OK;
941}
static void POP3Transport_CallbackRecvLISTResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
#define list
Definition: rosglue.h:35

◆ POP3Transport_CommandNOOP()

static HRESULT WINAPI POP3Transport_CommandNOOP ( IPOP3Transport iface)
static

Definition at line 991 of file pop3transport.c.

992{
993 static const char noop[] = "NOOP\r\n";
994 POP3Transport *This = (POP3Transport *)iface;
995
996 TRACE("\n");
997
998 init_parser(This, POP3_NOOP);
1000 return S_OK;
1001}
static void POP3Transport_CallbackRecvNOOPResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)

◆ POP3Transport_CommandPASS()

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

Definition at line 893 of file pop3transport.c.

894{
895 static const char pass[] = "PASS ";
896 POP3Transport *This = (POP3Transport *)iface;
897 char *command;
898 int len;
899
900 TRACE("(%p)\n", password);
901
902 len = sizeof(pass) + strlen(password) + 2; /* "\r\n" */
903 if (!(command = HeapAlloc(GetProcessHeap(), 0, len))) return S_FALSE;
904
907 strcat(command, "\r\n");
908
909 init_parser(This, POP3_PASS);
911
913 return S_OK;
914}
static WCHAR password[]
Definition: url.c:33

◆ POP3Transport_CommandQUIT()

static HRESULT WINAPI POP3Transport_CommandQUIT ( IPOP3Transport iface)
static

Definition at line 966 of file pop3transport.c.

967{
968 static const char command[] = "QUIT\r\n";
969 POP3Transport *This = (POP3Transport *)iface;
970
971 TRACE("()\n");
972
974
975 init_parser(This, POP3_QUIT);
977}
@ IXP_DISCONNECTING
Definition: imnxport.idl:252
static void POP3Transport_CallbackRecvQUITResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)

◆ POP3Transport_CommandRETR()

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

Definition at line 1064 of file pop3transport.c.

1066{
1067 static const char retr[] = "RETR %lu\r\n";
1068 POP3Transport *This = (POP3Transport *)iface;
1069 char *command;
1070 int len;
1071
1072 TRACE("(%u, %lu)\n", cmdtype, dwPopId);
1073
1074 len = sizeof(retr) + 10 + 2; /* "4294967296" + "\r\n" */
1075 if (!(command = HeapAlloc(GetProcessHeap(), 0, len))) return S_FALSE;
1076 sprintf(command, retr, dwPopId);
1077
1078 init_parser(This, POP3_RETR);
1079 This->type = cmdtype;
1081
1083 return S_OK;
1084}
static void POP3Transport_CallbackRecvRETRResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)

◆ POP3Transport_CommandRSET()

static HRESULT WINAPI POP3Transport_CommandRSET ( IPOP3Transport iface)
static

Definition at line 1003 of file pop3transport.c.

1004{
1005 static const char rset[] = "RSET\r\n";
1006 POP3Transport *This = (POP3Transport *)iface;
1007
1008 TRACE("\n");
1009
1010 init_parser(This, POP3_RSET);
1012 return S_OK;
1013}
static void POP3Transport_CallbackRecvRSETResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)

◆ POP3Transport_CommandSTAT()

static HRESULT WINAPI POP3Transport_CommandSTAT ( IPOP3Transport iface)
static

Definition at line 979 of file pop3transport.c.

980{
981 static const char stat[] = "STAT\r\n";
982 POP3Transport *This = (POP3Transport *)iface;
983
984 TRACE("\n");
985
986 init_parser(This, POP3_STAT);
988 return S_OK;
989}
static void POP3Transport_CallbackRecvSTATResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)

◆ POP3Transport_CommandTOP()

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

Definition at line 943 of file pop3transport.c.

945{
946 static const char top[] = "TOP %lu %lu\r\n";
947 POP3Transport *This = (POP3Transport *)iface;
948 char *command;
949 int len;
950
951 TRACE("(%u, %lu, %lu)\n", cmdtype, dwPopId, cPreviewLines);
952
953 len = sizeof(top) + 20 + 2; /* 2 * "4294967296" + "\r\n" */
954 if (!(command = HeapAlloc(GetProcessHeap(), 0, len))) return S_FALSE;
955 sprintf(command, top, dwPopId, cPreviewLines);
956
957 This->preview_lines = cPreviewLines;
958 init_parser(This, POP3_TOP);
959 This->type = cmdtype;
961
963 return S_OK;
964}
static void POP3Transport_CallbackRecvTOPResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)

◆ POP3Transport_CommandUIDL()

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

Definition at line 1015 of file pop3transport.c.

1017{
1018 static const char uidl[] = "UIDL %lu\r\n";
1019 static char uidl_all[] = "UIDL\r\n";
1020 POP3Transport *This = (POP3Transport *)iface;
1021 char *command;
1022 int len;
1023
1024 TRACE("(%u, %lu)\n", cmdtype, dwPopId);
1025
1026 if (dwPopId)
1027 {
1028 len = sizeof(uidl) + 10 + 2; /* "4294967296" + "\r\n" */
1029 if (!(command = HeapAlloc(GetProcessHeap(), 0, len))) return S_FALSE;
1030 sprintf(command, uidl, dwPopId);
1031 }
1032 else command = uidl_all;
1033
1034 init_parser(This, POP3_UIDL);
1035 This->type = cmdtype;
1037
1038 if (dwPopId) HeapFree(GetProcessHeap(), 0, command);
1039 return S_OK;
1040}
static void POP3Transport_CallbackRecvUIDLResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)

◆ POP3Transport_CommandUSER()

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

Definition at line 870 of file pop3transport.c.

871{
872 static const char user[] = "USER ";
873 POP3Transport *This = (POP3Transport *)iface;
874 char *command;
875 int len;
876
877 TRACE("(%s)\n", username);
878
879 len = sizeof(user) + strlen(username) + 2; /* "\r\n" */
880 if (!(command = HeapAlloc(GetProcessHeap(), 0, len))) return S_FALSE;
881
884 strcat(command, "\r\n");
885
886 init_parser(This, POP3_USER);
888
890 return S_OK;
891}
static WCHAR username[]
Definition: url.c:32

◆ POP3Transport_Connect()

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

Definition at line 789 of file pop3transport.c.

791{
792 POP3Transport *This = (POP3Transport *)iface;
793 HRESULT hr;
794
795 TRACE("(%p, %s, %s)\n", pInetServer, fAuthenticate ? "TRUE" : "FALSE", fCommandLogging ? "TRUE" : "FALSE");
796
797 hr = InternetTransport_Connect(&This->InetTransport, pInetServer, fAuthenticate, fCommandLogging);
798 if (FAILED(hr))
799 return hr;
800
801 init_parser(This, POP3_USER);
803}
HRESULT InternetTransport_Connect(InternetTransport *This, LPINETSERVER pInetServer, boolean fAuthenticate, boolean fCommandLogging)
static void POP3Transport_CallbackSendUSERCmd(IInternetTransport *iface, char *pBuffer, int cbBuffer)

◆ POP3Transport_Disconnect()

static HRESULT WINAPI POP3Transport_Disconnect ( IPOP3Transport iface)
static

Definition at line 813 of file pop3transport.c.

814{
815 TRACE("()\n");
816 return IPOP3Transport_CommandQUIT(iface);
817}

◆ POP3Transport_DropConnection()

static HRESULT WINAPI POP3Transport_DropConnection ( IPOP3Transport iface)
static

Definition at line 819 of file pop3transport.c.

820{
821 POP3Transport *This = (POP3Transport *)iface;
822
823 TRACE("()\n");
824 return InternetTransport_DropConnection(&This->InetTransport);
825}

◆ POP3Transport_GetIXPType()

static IXPTYPE WINAPI POP3Transport_GetIXPType ( IPOP3Transport iface)
static

Definition at line 768 of file pop3transport.c.

769{
770 TRACE("()\n");
771 return IXP_POP3;
772}
@ IXP_POP3
Definition: imnxport.idl:237

◆ POP3Transport_GetServerInfo()

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

Definition at line 759 of file pop3transport.c.

761{
762 POP3Transport *This = (POP3Transport *)iface;
763
764 TRACE("(%p)\n", pInetServer);
765 return InternetTransport_GetServerInfo(&This->InetTransport, pInetServer);
766}
HRESULT InternetTransport_GetServerInfo(InternetTransport *This, LPINETSERVER pInetServer)

◆ POP3Transport_GetStatus()

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

Definition at line 827 of file pop3transport.c.

829{
830 POP3Transport *This = (POP3Transport *)iface;
831
832 TRACE("()\n");
833 return InternetTransport_GetStatus(&This->InetTransport, pCurrentStatus);
834}
HRESULT InternetTransport_GetStatus(InternetTransport *This, IXPSTATUS *pCurrentStatus)

◆ POP3Transport_HandsOffCallback()

static HRESULT WINAPI POP3Transport_HandsOffCallback ( IPOP3Transport iface)
static

Definition at line 805 of file pop3transport.c.

806{
807 POP3Transport *This = (POP3Transport *)iface;
808
809 TRACE("()\n");
810 return InternetTransport_HandsOffCallback(&This->InetTransport);
811}
HRESULT InternetTransport_HandsOffCallback(InternetTransport *This)

◆ POP3Transport_InetServerFromAccount()

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

Definition at line 780 of file pop3transport.c.

782{
783 POP3Transport *This = (POP3Transport *)iface;
784
785 TRACE("(%p, %p)\n", pAccount, pInetServer);
786 return InternetTransport_InetServerFromAccount(&This->InetTransport, pAccount, pInetServer);
787}
HRESULT InternetTransport_InetServerFromAccount(InternetTransport *This, IImnAccount *pAccount, LPINETSERVER pInetServer)

◆ POP3Transport_InitNew()

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

Definition at line 836 of file pop3transport.c.

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

◆ POP3Transport_IsState()

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

Definition at line 774 of file pop3transport.c.

775{
776 FIXME("(%u)\n", isstate);
777 return E_NOTIMPL;
778}

◆ POP3Transport_MarkItem()

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

Definition at line 857 of file pop3transport.c.

859{
860 FIXME("(%u, %lu, %d)\n", marktype, dwPopId, fMarked);
861 return E_NOTIMPL;
862}

◆ POP3Transport_ParseResponse()

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

Definition at line 319 of file pop3transport.c.

320{
321 HRESULT hr;
322
323 TRACE("response: %s\n", debugstr_a(pszResponse));
324
325 This->response = pszResponse;
326 This->valid_info = FALSE;
327 TRACE("state %u\n", This->state);
328
330 {
331 switch (This->command)
332 {
333 case POP3_UIDL: hr = parse_uidl_response(This, &pResponse->rUidlInfo); break;
334 case POP3_STAT: hr = parse_stat_response(This, &pResponse->rStatInfo); break;
335 case POP3_LIST: hr = parse_list_response(This, &pResponse->rListInfo); break;
336 case POP3_DELE: hr = parse_dele_response(This, &pResponse->dwPopId); break;
337 case POP3_RETR: hr = parse_retr_response(This, &pResponse->rRetrInfo); break;
338 case POP3_TOP: hr = parse_top_response(This, &pResponse->rTopInfo); break;
339 default:
340 This->state = STATE_DONE;
341 break;
342 }
343 }
344 pResponse->command = This->command;
345 pResponse->fDone = (This->state == STATE_DONE);
346 pResponse->fValidInfo = This->valid_info;
347 pResponse->rIxpResult.hrResult = hr;
348 pResponse->rIxpResult.pszResponse = pszResponse;
349 pResponse->rIxpResult.uiServerError = 0;
350 pResponse->rIxpResult.hrServerError = pResponse->rIxpResult.hrResult;
351 pResponse->rIxpResult.dwSocketError = WSAGetLastError();
352 pResponse->rIxpResult.pszProblem = NULL;
353 pResponse->pTransport = (IPOP3Transport *)&This->InetTransport.u.vtblPOP3;
354
355 if (This->InetTransport.pCallback && This->InetTransport.fCommandLogging)
356 {
357 ITransportCallback_OnCommand(This->InetTransport.pCallback, CMD_RESP,
358 pResponse->rIxpResult.pszResponse, pResponse->rIxpResult.hrServerError,
359 (IInternetTransport *)&This->InetTransport.u.vtbl);
360 }
361 return S_OK;
362}
#define SUCCEEDED(hr)
Definition: intsafe.h:50
if(dx< 0)
Definition: linetemp.h:194
static HRESULT parse_dele_response(POP3Transport *This, DWORD *dwPopId)
static HRESULT parse_uidl_response(POP3Transport *This, POP3UIDL *uidl)
Definition: pop3transport.c:84
static HRESULT parse_top_response(POP3Transport *This, POP3TOP *top)
static HRESULT parse_retr_response(POP3Transport *This, POP3RETR *retr)
static HRESULT parse_list_response(POP3Transport *This, POP3LIST *list)
static HRESULT parse_response(POP3Transport *This)
Definition: pop3transport.c:60
static HRESULT parse_stat_response(POP3Transport *This, POP3STAT *stat)
int PASCAL FAR WSAGetLastError(void)
Definition: dllmain.c:131

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 721 of file pop3transport.c.

722{
723 TRACE("(%s, %p)\n", debugstr_guid(riid), ppv);
724
726 IsEqualIID(riid, &IID_IInternetTransport) ||
727 IsEqualIID(riid, &IID_IPOP3Transport))
728 {
729 *ppv = iface;
730 IPOP3Transport_AddRef(iface);
731 return S_OK;
732 }
733 *ppv = NULL;
734 FIXME("no interface for %s\n", debugstr_guid(riid));
735 return E_NOINTERFACE;
736}
const GUID IID_IUnknown
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ POP3Transport_Release()

static ULONG WINAPI POP3Transport_Release ( IPOP3Transport iface)
static

Definition at line 744 of file pop3transport.c.

745{
746 POP3Transport *This = (POP3Transport *)iface;
747 ULONG refs = InterlockedDecrement((LONG *)&This->refs);
748 if (!refs)
749 {
750 TRACE("destroying %p\n", This);
751 if (This->InetTransport.Status != IXP_DISCONNECTED)
752 InternetTransport_DropConnection(&This->InetTransport);
753 if (This->InetTransport.pCallback) ITransportCallback_Release(This->InetTransport.pCallback);
755 }
756 return refs;
757}
#define InterlockedDecrement
Definition: armddk.h:52
@ IXP_DISCONNECTED
Definition: imnxport.idl:253
uint32_t ULONG
Definition: typedefs.h:59

◆ POP3TransportCF_AddRef()

static ULONG WINAPI POP3TransportCF_AddRef ( LPCLASSFACTORY  iface)
static

Definition at line 1151 of file pop3transport.c.

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

◆ POP3TransportCF_Create()

HRESULT POP3TransportCF_Create ( REFIID  riid,
LPVOID ppv 
)

Definition at line 1200 of file pop3transport.c.

1201{
1202 return IClassFactory_QueryInterface((IClassFactory *)&POP3TransportCF, riid, ppv);
1203}
static const IClassFactoryVtbl * POP3TransportCF

Referenced by DllGetClassObject().

◆ POP3TransportCF_CreateInstance()

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

Definition at line 1161 of file pop3transport.c.

1163{
1164 HRESULT hr;
1165 IPOP3Transport *pPop3Transport;
1166
1167 TRACE("(%p, %s, %p)\n", pUnk, debugstr_guid(riid), ppv);
1168
1169 *ppv = NULL;
1170
1171 if (pUnk)
1172 return CLASS_E_NOAGGREGATION;
1173
1174 hr = CreatePOP3Transport(&pPop3Transport);
1175 if (FAILED(hr))
1176 return hr;
1177
1178 hr = IPOP3Transport_QueryInterface(pPop3Transport, riid, ppv);
1179 IPOP3Transport_Release(pPop3Transport);
1180
1181 return hr;
1182}
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
HRESULT WINAPI CreatePOP3Transport(IPOP3Transport **ppTransport)
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:3771

◆ POP3TransportCF_LockServer()

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

Definition at line 1184 of file pop3transport.c.

1185{
1186 FIXME("(%d)\n",fLock);
1187 return S_OK;
1188}

◆ POP3TransportCF_QueryInterface()

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

Definition at line 1138 of file pop3transport.c.

1140{
1141 *ppv = NULL;
1143 {
1144 *ppv = iface;
1145 IClassFactory_AddRef(iface);
1146 return S_OK;
1147 }
1148 return E_NOINTERFACE;
1149}
const GUID IID_IClassFactory

◆ POP3TransportCF_Release()

static ULONG WINAPI POP3TransportCF_Release ( LPCLASSFACTORY  iface)
static

Definition at line 1156 of file pop3transport.c.

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

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( inetcomm  )

Variable Documentation

◆ POP3TransportCF

const IClassFactoryVtbl* POP3TransportCF = &POP3TransportCFVtbl
static

Definition at line 1198 of file pop3transport.c.

Referenced by POP3TransportCF_Create().

◆ POP3TransportCFVtbl

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

Definition at line 1190 of file pop3transport.c.

◆ POP3TransportVtbl

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

Definition at line 1086 of file pop3transport.c.

Referenced by CreatePOP3Transport().