1 |
/* wptMAPI.cpp |
/* wptMAPI.cpp |
2 |
* Copyright (C) 2003, 2004 Timo Schulz |
* Copyright (C) 2003, 2004, 2005 Timo Schulz |
3 |
* |
* |
4 |
* This file is part of WinPT. |
* This file is part of WinPT. |
5 |
* |
* |
22 |
#endif |
#endif |
23 |
|
|
24 |
#include <windows.h> |
#include <windows.h> |
|
#include <windows.h> |
|
25 |
#include <stdio.h> |
#include <stdio.h> |
26 |
#include <mapi.h> |
#include <mapi.h> |
27 |
|
|
28 |
extern HINSTANCE glob_hinst; |
#include "resource.h" |
|
|
|
|
#include "../resource.h" |
|
29 |
#include "wptTypes.h" |
#include "wptTypes.h" |
30 |
#include "wptErrors.h" |
#include "wptErrors.h" |
31 |
#include "wptW32API.h" |
#include "wptW32API.h" |
32 |
#include "wptGPG.h" |
#include "wptGPG.h" |
33 |
|
#include "wptVersion.h" |
34 |
|
|
35 |
static LPMAPILOGON mapi_logon = NULL; |
static LPMAPILOGON mapi_logon = NULL; |
36 |
static LPMAPILOGOFF mapi_logoff = NULL; |
static LPMAPILOGOFF mapi_logoff = NULL; |
42 |
#define load_one_fnc(cast, hlib, name) (cast)GetProcAddress ((hlib), name) |
#define load_one_fnc(cast, hlib, name) (cast)GetProcAddress ((hlib), name) |
43 |
|
|
44 |
|
|
45 |
|
/* Load MAPI library and set function pointers. |
46 |
|
Return value: 0 on success. */ |
47 |
int |
int |
48 |
mapi_init (void) |
mapi_init (void) |
49 |
{ |
{ |
63 |
init = 1; |
init = 1; |
64 |
|
|
65 |
return 0; |
return 0; |
66 |
} /* mapi_init */ |
} |
67 |
|
|
68 |
|
|
69 |
|
/* Free library and cleanup. */ |
70 |
void |
void |
71 |
mapi_deinit (void) |
mapi_deinit (void) |
72 |
{ |
{ |
75 |
hlib = NULL; |
hlib = NULL; |
76 |
init = 0; |
init = 0; |
77 |
} |
} |
78 |
} /* mapi_deinit */ |
} |
79 |
|
|
80 |
#if 0 /* low:priority XXX port the code */ |
|
81 |
|
/* Send the file given in @ascfile via the MAPI mechanism. */ |
82 |
int |
int |
83 |
mapi_send_ascfile (char *ascfile) |
mapi_send_ascfile (char *ascfile) |
84 |
{ |
{ |
105 |
} |
} |
106 |
|
|
107 |
|
|
108 |
|
/* Send a public key stored in @keyfile with the keyid @keyid |
109 |
|
via the MAPI mechanism to a mail recipient. |
110 |
|
Return value: SUCCESS_SUCCESS on succes. */ |
111 |
int |
int |
112 |
mapi_send_pubkey (const char *keyid, char *keyfile) |
mapi_send_pubkey (const char *keyid, char *keyfile) |
113 |
{ |
{ |
139 |
mapi_logoff (hd, 0, 0, 0); |
mapi_logoff (hd, 0, 0, 0); |
140 |
free_if_alloc (keyinf); |
free_if_alloc (keyinf); |
141 |
return rc; |
return rc; |
142 |
} /* mapi_send_pubkey */ |
} |
143 |
|
|
144 |
|
|
145 |
|
#if 0 /* low:priority XXX port the code */ |
146 |
static void |
static void |
147 |
free_mapi_msg (MapiMessage * msg) |
free_mapi_msg (MapiMessage * msg) |
148 |
{ |
{ |