4 // Part of managed C#/.NET library System.Data.OracleClient.dll
6 // Part of the Mono class libraries at
7 // mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci
9 // Assembly: System.Data.OracleClient.dll
10 // Namespace: System.Data.OracleClient.Oci
13 // Tim Coleman <tim@timcoleman.com>
15 // Copyright (C) Tim Coleman, 2003
19 using System
.Runtime
.InteropServices
;
21 namespace System
.Data
.OracleClient
.Oci
{
22 internal sealed class OciErrorHandle
: OciHandle
, IDisposable
26 bool disposed
= false;
32 public OciErrorHandle (OciHandle parent
, IntPtr newHandle
)
33 : base (OciHandleType
.Error
, parent
, newHandle
)
37 #endregion // Constructors
41 protected override void Dispose (bool disposing
)
45 base.Dispose (disposing
);
49 public OciErrorInfo
HandleError ()
53 info
.ErrorMessage
= String
.Empty
;
56 IntPtr errbuf
= Marshal
.AllocHGlobal (errbufSize
);
58 OciCalls
.OCIErrorGet (this,
66 object err
= Marshal
.PtrToStringAnsi (errbuf
);
68 string errmsg
= (string) err
;
69 info
.ErrorMessage
= String
.Copy (errmsg
);
70 Marshal
.FreeHGlobal (errbuf
);