1 | <?php |
---|
2 | /* |
---|
3 | * Copyright 2005 - 2012 Zarafa B.V. |
---|
4 | * |
---|
5 | * This program is free software: you can redistribute it and/or modify |
---|
6 | * it under the terms of the GNU Affero General Public License, version 3, |
---|
7 | * as published by the Free Software Foundation with the following additional |
---|
8 | * term according to sec. 7: |
---|
9 | * |
---|
10 | * According to sec. 7 of the GNU Affero General Public License, version |
---|
11 | * 3, the terms of the AGPL are supplemented with the following terms: |
---|
12 | * |
---|
13 | * "Zarafa" is a registered trademark of Zarafa B.V. The licensing of |
---|
14 | * the Program under the AGPL does not imply a trademark license. |
---|
15 | * Therefore any rights, title and interest in our trademarks remain |
---|
16 | * entirely with us. |
---|
17 | * |
---|
18 | * However, if you propagate an unmodified version of the Program you are |
---|
19 | * allowed to use the term "Zarafa" to indicate that you distribute the |
---|
20 | * Program. Furthermore you may use our trademarks where it is necessary |
---|
21 | * to indicate the intended purpose of a product or service provided you |
---|
22 | * use it in accordance with honest practices in industrial or commercial |
---|
23 | * matters. If you want to propagate modified versions of the Program |
---|
24 | * under the name "Zarafa" or "Zarafa Server", you may only do so if you |
---|
25 | * have a written permission by Zarafa B.V. (to acquire a permission |
---|
26 | * please contact Zarafa at trademark@zarafa.com). |
---|
27 | * |
---|
28 | * The interactive user interface of the software displays an attribution |
---|
29 | * notice containing the term "Zarafa" and/or the logo of Zarafa. |
---|
30 | * Interactive user interfaces of unmodified and modified versions must |
---|
31 | * display Appropriate Legal Notices according to sec. 5 of the GNU |
---|
32 | * Affero General Public License, version 3, when you propagate |
---|
33 | * unmodified or modified versions of the Program. In accordance with |
---|
34 | * sec. 7 b) of the GNU Affero General Public License, version 3, these |
---|
35 | * Appropriate Legal Notices must retain the logo of Zarafa or display |
---|
36 | * the words "Initial Development by Zarafa" if the display of the logo |
---|
37 | * is not reasonably feasible for technical reasons. The use of the logo |
---|
38 | * of Zarafa in Legal Notices is allowed for unmodified and modified |
---|
39 | * versions of the software. |
---|
40 | * |
---|
41 | * This program is distributed in the hope that it will be useful, |
---|
42 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
43 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
44 | * GNU Affero General Public License for more details. |
---|
45 | * |
---|
46 | * You should have received a copy of the GNU Affero General Public License |
---|
47 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
48 | * |
---|
49 | */ |
---|
50 | |
---|
51 | |
---|
52 | /** |
---|
53 | * Status codes returned by MAPI functions |
---|
54 | * |
---|
55 | * |
---|
56 | */ |
---|
57 | |
---|
58 | /* From winerror.h */ |
---|
59 | // |
---|
60 | // Success codes |
---|
61 | // |
---|
62 | define('S_OK', 0x00000000); |
---|
63 | define('S_FALSE', 0x00000001); |
---|
64 | define('SEVERITY_ERROR', 1); |
---|
65 | |
---|
66 | /* from winerror.h */ |
---|
67 | |
---|
68 | /** |
---|
69 | * Function to make a error |
---|
70 | */ |
---|
71 | function make_mapi_e($code) |
---|
72 | { |
---|
73 | return (int) mapi_make_scode(1, $code); |
---|
74 | } |
---|
75 | |
---|
76 | |
---|
77 | /** |
---|
78 | * Function to make an warning |
---|
79 | */ |
---|
80 | function make_mapi_s($code) |
---|
81 | { |
---|
82 | return (int) mapi_make_scode(0, $code); |
---|
83 | } |
---|
84 | |
---|
85 | /* From mapicode.h */ |
---|
86 | /* |
---|
87 | * On Windows NT 3.5 and Windows 95, scodes are 32-bit values |
---|
88 | * laid out as follows: |
---|
89 | * |
---|
90 | * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 |
---|
91 | * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 |
---|
92 | * +-+-+-+-+-+---------------------+-------------------------------+ |
---|
93 | * |S|R|C|N|r| Facility | Code | |
---|
94 | * +-+-+-+-+-+---------------------+-------------------------------+ |
---|
95 | * |
---|
96 | * where |
---|
97 | * |
---|
98 | * S - Severity - indicates success/fail |
---|
99 | * |
---|
100 | * 0 - Success |
---|
101 | * 1 - Fail (COERROR) |
---|
102 | * |
---|
103 | * R - reserved portion of the facility code, corresponds to NT's |
---|
104 | * second severity bit. |
---|
105 | * |
---|
106 | * C - reserved portion of the facility code, corresponds to NT's |
---|
107 | * C field. |
---|
108 | * |
---|
109 | * N - reserved portion of the facility code. Used to indicate a |
---|
110 | * mapped NT status value. |
---|
111 | * |
---|
112 | * r - reserved portion of the facility code. Reserved for internal |
---|
113 | * use. Used to indicate HRESULT values that are not status |
---|
114 | * values, but are instead message ids for display strings. |
---|
115 | * |
---|
116 | * Facility - is the facility code |
---|
117 | * FACILITY_NULL 0x0 |
---|
118 | * FACILITY_RPC 0x1 |
---|
119 | * FACILITY_DISPATCH 0x2 |
---|
120 | * FACILITY_STORAGE 0x3 |
---|
121 | * FACILITY_ITF 0x4 |
---|
122 | * FACILITY_WIN32 0x7 |
---|
123 | * FACILITY_WINDOWS 0x8 |
---|
124 | * |
---|
125 | * Code - is the facility's status code |
---|
126 | * |
---|
127 | */ |
---|
128 | define('NOERROR' ,0); |
---|
129 | |
---|
130 | define('MAPI_E_CALL_FAILED' ,(int) 0x80004005); |
---|
131 | define('MAPI_E_NOT_ENOUGH_MEMORY' ,(int) 0x8007000E); |
---|
132 | define('MAPI_E_INVALID_PARAMETER' ,(int) 0x80070057); |
---|
133 | define('MAPI_E_INTERFACE_NOT_SUPPORTED' ,(int) 0x80004002); |
---|
134 | define('MAPI_E_NO_ACCESS' ,(int) 0x80070005); |
---|
135 | |
---|
136 | define('MAPI_E_NO_SUPPORT' ,make_mapi_e(0x102)); |
---|
137 | define('MAPI_E_BAD_CHARWIDTH' ,make_mapi_e(0x103)); |
---|
138 | define('MAPI_E_STRING_TOO_LONG' ,make_mapi_e(0x105)); |
---|
139 | define('MAPI_E_UNKNOWN_FLAGS' ,make_mapi_e(0x106)); |
---|
140 | define('MAPI_E_INVALID_ENTRYID' ,make_mapi_e(0x107)); |
---|
141 | define('MAPI_E_INVALID_OBJECT' ,make_mapi_e(0x108)); |
---|
142 | define('MAPI_E_OBJECT_CHANGED' ,make_mapi_e(0x109)); |
---|
143 | define('MAPI_E_OBJECT_DELETED' ,make_mapi_e(0x10A)); |
---|
144 | define('MAPI_E_BUSY' ,make_mapi_e(0x10B)); |
---|
145 | define('MAPI_E_NOT_ENOUGH_DISK' ,make_mapi_e(0x10D)); |
---|
146 | define('MAPI_E_NOT_ENOUGH_RESOURCES' ,make_mapi_e(0x10E)); |
---|
147 | define('MAPI_E_NOT_FOUND' ,make_mapi_e(0x10F)); |
---|
148 | define('MAPI_E_VERSION' ,make_mapi_e(0x110)); |
---|
149 | define('MAPI_E_LOGON_FAILED' ,make_mapi_e(0x111)); |
---|
150 | define('MAPI_E_SESSION_LIMIT' ,make_mapi_e(0x112)); |
---|
151 | define('MAPI_E_USER_CANCEL' ,make_mapi_e(0x113)); |
---|
152 | define('MAPI_E_UNABLE_TO_ABORT' ,make_mapi_e(0x114)); |
---|
153 | define('MAPI_E_NETWORK_ERROR' ,make_mapi_e(0x115)); |
---|
154 | define('MAPI_E_DISK_ERROR' ,make_mapi_e(0x116)); |
---|
155 | define('MAPI_E_TOO_COMPLEX' ,make_mapi_e(0x117)); |
---|
156 | define('MAPI_E_BAD_COLUMN' ,make_mapi_e(0x118)); |
---|
157 | define('MAPI_E_EXTENDED_ERROR' ,make_mapi_e(0x119)); |
---|
158 | define('MAPI_E_COMPUTED' ,make_mapi_e(0x11A)); |
---|
159 | define('MAPI_E_CORRUPT_DATA' ,make_mapi_e(0x11B)); |
---|
160 | define('MAPI_E_UNCONFIGURED' ,make_mapi_e(0x11C)); |
---|
161 | define('MAPI_E_FAILONEPROVIDER' ,make_mapi_e(0x11D)); |
---|
162 | define('MAPI_E_UNKNOWN_CPID' ,make_mapi_e(0x11E)); |
---|
163 | define('MAPI_E_UNKNOWN_LCID' ,make_mapi_e(0x11F)); |
---|
164 | |
---|
165 | /* Flavors of E_ACCESSDENIED, used at logon */ |
---|
166 | |
---|
167 | define('MAPI_E_PASSWORD_CHANGE_REQUIRED' ,make_mapi_e(0x120)); |
---|
168 | define('MAPI_E_PASSWORD_EXPIRED' ,make_mapi_e(0x121)); |
---|
169 | define('MAPI_E_INVALID_WORKSTATION_ACCOUNT' ,make_mapi_e(0x122)); |
---|
170 | define('MAPI_E_INVALID_ACCESS_TIME' ,make_mapi_e(0x123)); |
---|
171 | define('MAPI_E_ACCOUNT_DISABLED' ,make_mapi_e(0x124)); |
---|
172 | |
---|
173 | /* MAPI base function and status object specific errors and warnings */ |
---|
174 | |
---|
175 | define('MAPI_E_END_OF_SESSION' ,make_mapi_e(0x200)); |
---|
176 | define('MAPI_E_UNKNOWN_ENTRYID' ,make_mapi_e(0x201)); |
---|
177 | define('MAPI_E_MISSING_REQUIRED_COLUMN' ,make_mapi_e(0x202)); |
---|
178 | define('MAPI_W_NO_SERVICE' ,make_mapi_s(0x203)); |
---|
179 | |
---|
180 | /* Property specific errors and warnings */ |
---|
181 | |
---|
182 | define('MAPI_E_BAD_VALUE' ,make_mapi_e(0x301)); |
---|
183 | define('MAPI_E_INVALID_TYPE' ,make_mapi_e(0x302)); |
---|
184 | define('MAPI_E_TYPE_NO_SUPPORT' ,make_mapi_e(0x303)); |
---|
185 | define('MAPI_E_UNEXPECTED_TYPE' ,make_mapi_e(0x304)); |
---|
186 | define('MAPI_E_TOO_BIG' ,make_mapi_e(0x305)); |
---|
187 | define('MAPI_E_DECLINE_COPY' ,make_mapi_e(0x306)); |
---|
188 | define('MAPI_E_UNEXPECTED_ID' ,make_mapi_e(0x307)); |
---|
189 | |
---|
190 | define('MAPI_W_ERRORS_RETURNED' ,make_mapi_s(0x380)); |
---|
191 | |
---|
192 | /* Table specific errors and warnings */ |
---|
193 | |
---|
194 | define('MAPI_E_UNABLE_TO_COMPLETE' ,make_mapi_e(0x400)); |
---|
195 | define('MAPI_E_TIMEOUT' ,make_mapi_e(0x401)); |
---|
196 | define('MAPI_E_TABLE_EMPTY' ,make_mapi_e(0x402)); |
---|
197 | define('MAPI_E_TABLE_TOO_BIG' ,make_mapi_e(0x403)); |
---|
198 | |
---|
199 | define('MAPI_E_INVALID_BOOKMARK' ,make_mapi_e(0x405)); |
---|
200 | |
---|
201 | define('MAPI_W_POSITION_CHANGED' ,make_mapi_s(0x481)); |
---|
202 | define('MAPI_W_APPROX_COUNT' ,make_mapi_s(0x482)); |
---|
203 | |
---|
204 | /* Transport specific errors and warnings */ |
---|
205 | |
---|
206 | define('MAPI_E_WAIT' ,make_mapi_e(0x500)); |
---|
207 | define('MAPI_E_CANCEL' ,make_mapi_e(0x501)); |
---|
208 | define('MAPI_E_NOT_ME' ,make_mapi_e(0x502)); |
---|
209 | |
---|
210 | define('MAPI_W_CANCEL_MESSAGE' ,make_mapi_s(0x580)); |
---|
211 | |
---|
212 | /* Message Store, Folder, and Message specific errors and warnings */ |
---|
213 | |
---|
214 | define('MAPI_E_CORRUPT_STORE' ,make_mapi_e(0x600)); |
---|
215 | define('MAPI_E_NOT_IN_QUEUE' ,make_mapi_e(0x601)); |
---|
216 | define('MAPI_E_NO_SUPPRESS' ,make_mapi_e(0x602)); |
---|
217 | define('MAPI_E_COLLISION' ,make_mapi_e(0x604)); |
---|
218 | define('MAPI_E_NOT_INITIALIZED' ,make_mapi_e(0x605)); |
---|
219 | define('MAPI_E_NON_STANDARD' ,make_mapi_e(0x606)); |
---|
220 | define('MAPI_E_NO_RECIPIENTS' ,make_mapi_e(0x607)); |
---|
221 | define('MAPI_E_SUBMITTED' ,make_mapi_e(0x608)); |
---|
222 | define('MAPI_E_HAS_FOLDERS' ,make_mapi_e(0x609)); |
---|
223 | define('MAPI_E_HAS_MESSAGES' ,make_mapi_e(0x60A)); |
---|
224 | define('MAPI_E_FOLDER_CYCLE' ,make_mapi_e(0x60B)); |
---|
225 | define('MAPI_E_STORE_FULL' ,make_mapi_e(0x60C)); |
---|
226 | |
---|
227 | define('MAPI_W_PARTIAL_COMPLETION' ,make_mapi_s(0x680)); |
---|
228 | |
---|
229 | /* Address Book specific errors and warnings */ |
---|
230 | |
---|
231 | define('MAPI_E_AMBIGUOUS_RECIP' ,make_mapi_e(0x700)); |
---|
232 | |
---|
233 | /* ICS errors and warnings */ |
---|
234 | |
---|
235 | define('SYNC_E_UNKNOWN_FLAGS', MAPI_E_UNKNOWN_FLAGS); |
---|
236 | define('SYNC_E_INVALID_PARAMETER', MAPI_E_INVALID_PARAMETER); |
---|
237 | define('SYNC_E_ERROR', MAPI_E_CALL_FAILED); |
---|
238 | define('SYNC_E_OBJECT_DELETED', make_mapi_e(0x800)); |
---|
239 | define('SYNC_E_IGNORE', make_mapi_e(0x801)); |
---|
240 | define('SYNC_E_CONFLICT', make_mapi_e(0x802)); |
---|
241 | define('SYNC_E_NO_PARENT', make_mapi_e(0x803)); |
---|
242 | define('SYNC_E_INCEST', make_mapi_e(0x804)); |
---|
243 | define('SYNC_E_UNSYNCHRONIZED', make_mapi_e(0x805)); |
---|
244 | |
---|
245 | define('SYNC_W_PROGRESS', make_mapi_s(0x820)); |
---|
246 | define('SYNC_W_CLIENT_CHANGE_NEWER', make_mapi_s(0x821)); |
---|
247 | |
---|
248 | |
---|
249 | |
---|
250 | ?> |
---|