Rev 81 | Rev 83 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 81 | Rev 82 | ||
---|---|---|---|
Line 141... | Line 141... | ||
141 | wCategory: UD2_STATUSCAT_FAILED; |
141 | wCategory: UD2_STATUSCAT_FAILED; |
142 | grAuthority: UD2_STATUSAUTH_GENERIC_; |
142 | grAuthority: UD2_STATUSAUTH_GENERIC_; |
143 | dwMessage: 3; |
143 | dwMessage: 3; |
144 | dwExtraInfo: 0 |
144 | dwExtraInfo: 0 |
145 | ); |
145 | ); |
- | 146 | UD2_STATUS_FAILURE_NO_RETURNED_VALUE: UD2_STATUS = ( |
|
- | 147 | cbSize: SizeOf(UD2_STATUS); |
|
- | 148 | bReserved: 0; |
|
- | 149 | wCategory: UD2_STATUSCAT_FAILED; |
|
- | 150 | grAuthority: UD2_STATUSAUTH_GENERIC_; |
|
- | 151 | dwMessage: 4; |
|
- | 152 | dwExtraInfo: 0 |
|
- | 153 | ); |
|
- | 154 | UD2_STATUS_FAILURE_CATCHED_EXCEPTION: UD2_STATUS = ( |
|
- | 155 | cbSize: SizeOf(UD2_STATUS); |
|
- | 156 | bReserved: 0; |
|
- | 157 | wCategory: UD2_STATUSCAT_FAILED; |
|
- | 158 | grAuthority: UD2_STATUSAUTH_GENERIC_; |
|
- | 159 | dwMessage: 5; |
|
- | 160 | dwExtraInfo: 0 |
|
- | 161 | ); |
|
146 | 162 | ||
147 | function UD2_STATUS_FormatStatusCode(grStatus: UD2_STATUS): string; |
163 | function UD2_STATUS_FormatStatusCode(grStatus: UD2_STATUS): string; |
148 | function UD2_STATUS_Equal(grStatus1, grStatus2: UD2_STATUS; compareExtraInfo: boolean): boolean; |
164 | function UD2_STATUS_Equal(grStatus1, grStatus2: UD2_STATUS; compareExtraInfo: boolean): boolean; |
149 | function UD2_STATUS_OSError(OSError: DWORD): UD2_STATUS; |
165 | function UD2_STATUS_OSError(OSError: DWORD): UD2_STATUS; |
- | 166 | function UD2_STATUS_HandleException(E: Exception): UD2_STATUS; |
|
150 | 167 | ||
151 | implementation |
168 | implementation |
152 | 169 | ||
153 | function UD2_STATUS_FormatStatusCode(grStatus: UD2_STATUS): string; |
170 | function UD2_STATUS_FormatStatusCode(grStatus: UD2_STATUS): string; |
154 | begin |
171 | begin |
Line 174... | Line 191... | ||
174 | begin |
191 | begin |
175 | result := UD2_STATUS_NOTAVAIL_WINAPI_CALL_FAILURE; |
192 | result := UD2_STATUS_NOTAVAIL_WINAPI_CALL_FAILURE; |
176 | result.dwExtraInfo := OSError; |
193 | result.dwExtraInfo := OSError; |
177 | end; |
194 | end; |
178 | 195 | ||
- | 196 | function UD2_STATUS_HandleException(E: Exception): UD2_STATUS; |
|
- | 197 | begin |
|
- | 198 | if E is EOSError then |
|
- | 199 | begin |
|
- | 200 | result := UD2_STATUS_OSError(EOSError(E).ErrorCode); |
|
- | 201 | end |
|
- | 202 | else |
|
- | 203 | begin |
|
- | 204 | result := UD2_STATUS_FAILURE_CATCHED_EXCEPTION; |
|
- | 205 | end; |
|
- | 206 | end; |
|
- | 207 | ||
179 | end. |
208 | end. |