Fix code for building with corefx
[platform/core/csapi/tizenfx.git] / Tizen.Internals / Tizen.Internals.Errors / ErrorFacts.cs
1 // Copyright 2016 by Samsung Electronics, Inc.,
2 //
3 // This software is the confidential and proprietary information
4 // of Samsung Electronics, Inc. ("Confidential Information"). You
5 // shall not disclose such Confidential Information and shall use
6 // it only in accordance with the terms of the license agreement
7 // you entered into with Samsung.
8
9 using System;
10 using System.Runtime.InteropServices;
11
12 namespace Tizen.Internals.Errors
13 {
14     /// <summary>
15     ///
16     /// </summary>
17     public static class ErrorFacts
18     {
19         /// <summary>
20         ///
21         /// </summary>
22         /// <returns></returns>
23         public static int GetLastResult()
24         {
25             return Interop.CommonError.GetLastResult();
26         }
27
28         /// <summary>
29         ///
30         /// </summary>
31         /// <param name="errorCode"></param>
32         /// <returns></returns>
33         public static string GetErrorMessage(int errorCode)
34         {
35             IntPtr errorPtr = Interop.CommonError.GetErrorMessage(errorCode);
36             return Marshal.PtrToStringAnsi(errorPtr);
37         }
38     }
39 }