OLD | NEW |
1 // Copyright (c) 2015 Google Inc. | 1 // Copyright (c) 2015 Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 15 matching lines...) Expand all Loading... |
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 | 29 |
30 // ntstatus_reason_win.h: Windows NTSTATUS code to string. | 30 // ntstatus_reason_win.h: Windows NTSTATUS code to string. |
31 // | 31 // |
32 // Provides a means to convert NTSTATUS codes to strings. | 32 // Provides a means to convert NTSTATUS codes to strings. |
33 // | 33 // |
34 // Author: Ben Wagner | 34 // Author: Ben Wagner |
35 | 35 |
36 #include <cstdio> | |
37 #include <string> | 36 #include <string> |
38 | 37 |
| 38 #include "common/stdio.h" |
39 #include "google_breakpad/common/breakpad_types.h" | 39 #include "google_breakpad/common/breakpad_types.h" |
40 #include "google_breakpad/common/minidump_exception_win32.h" | 40 #include "google_breakpad/common/minidump_exception_win32.h" |
41 #include "processor/symbolic_constants_win.h" | 41 #include "processor/symbolic_constants_win.h" |
42 | 42 |
43 namespace google_breakpad { | 43 namespace google_breakpad { |
44 | 44 |
45 std::string NTStatusToString(uint32_t ntstatus) { | 45 std::string NTStatusToString(uint32_t ntstatus) { |
46 std::string reason; | 46 std::string reason; |
47 // The content of this switch was created from ntstatus.h in the 8.1 SDK with | 47 // The content of this switch was created from ntstatus.h in the 8.1 SDK with |
48 // | 48 // |
(...skipping 6350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6399 reason = "STATUS_SPACES_INTERLEAVE_LENGTH_INVALID"; | 6399 reason = "STATUS_SPACES_INTERLEAVE_LENGTH_INVALID"; |
6400 break; | 6400 break; |
6401 case MD_NTSTATUS_WIN_STATUS_SPACES_NUMBER_OF_COLUMNS_INVALID: | 6401 case MD_NTSTATUS_WIN_STATUS_SPACES_NUMBER_OF_COLUMNS_INVALID: |
6402 reason = "STATUS_SPACES_NUMBER_OF_COLUMNS_INVALID"; | 6402 reason = "STATUS_SPACES_NUMBER_OF_COLUMNS_INVALID"; |
6403 break; | 6403 break; |
6404 case MD_NTSTATUS_WIN_STATUS_SPACES_NOT_ENOUGH_DRIVES: | 6404 case MD_NTSTATUS_WIN_STATUS_SPACES_NOT_ENOUGH_DRIVES: |
6405 reason = "STATUS_SPACES_NOT_ENOUGH_DRIVES"; | 6405 reason = "STATUS_SPACES_NOT_ENOUGH_DRIVES"; |
6406 break; | 6406 break; |
6407 default: { | 6407 default: { |
6408 char reason_string[11]; | 6408 char reason_string[11]; |
6409 std::snprintf(reason_string, sizeof(reason_string), "0x%08x", ntstatus); | 6409 snprintf(reason_string, sizeof(reason_string), "0x%08x", ntstatus); |
6410 reason = reason_string; | 6410 reason = reason_string; |
6411 break; | 6411 break; |
6412 } | 6412 } |
6413 } | 6413 } |
6414 return reason; | 6414 return reason; |
6415 } | 6415 } |
6416 | 6416 |
6417 } // namespace google_breakpad | 6417 } // namespace google_breakpad |
OLD | NEW |