| 1 | /*++ |
| 2 | |
| 3 | Copyright (c) Microsoft. All rights reserved. |
| 4 | |
| 5 | Module Name: |
| 6 | |
| 7 | ProcessCrashInformation.cpp |
| 8 | |
| 9 | Abstract: |
| 10 | |
| 11 | This file contains the implementation of the WinRT wrapper for the WSLC SDK ProcessCrashInformation class. |
| 12 | |
| 13 | --*/ |
| 14 | |
| 15 | #include "precomp.h" |
| 16 | #include "ProcessCrashInformation.h" |
| 17 | #include "Microsoft.WSL.Containers.ProcessCrashInformation.g.cpp" |
| 18 | |
| 19 | namespace winrt::Microsoft::WSL::Containers::implementation { |
| 20 | ProcessCrashInformation::ProcessCrashInformation(const WslcSessionCrashDumpInfo* info) |
| 21 | { |
| 22 | m_dumpPath = info->dumpPath; |
| 23 | m_processName = winrt::to_hstring(info->processName); |
| 24 | m_pid = info->pid; |
| 25 | m_signal = info->signal; |
| 26 | m_timestamp = winrt::clock::from_time_t(static_cast<time_t>(info->timestamp)); |
| 27 | } |
| 28 | |
| 29 | hstring ProcessCrashInformation::DumpPath() const |
| 30 | { |
| 31 | return m_dumpPath; |
| 32 | } |
| 33 | |
| 34 | hstring ProcessCrashInformation::ProcessName() const |
| 35 | { |
| 36 | return m_processName; |
| 37 | } |
| 38 | |
| 39 | uint32_t ProcessCrashInformation::Pid() const |
| 40 | { |
| 41 | return m_pid; |
| 42 | } |
| 43 | |
| 44 | uint32_t ProcessCrashInformation::Signal() const |
| 45 | { |
| 46 | return m_signal; |
| 47 | } |
| 48 | |
| 49 | winrt::Windows::Foundation::DateTime ProcessCrashInformation::Timestamp() const |
| 50 | { |
| 51 | return m_timestamp; |
| 52 | } |
| 53 | } // namespace winrt::Microsoft::WSL::Containers::implementation |