(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / class / System.Data.OracleClient / System.Data.OracleClient.Oci / OciErrorHandle.cs
blob3238c93d1419b3974294dae2162d46de48af1f00
1 //
2 // OciErrorHandle.cs
3 //
4 // Part of managed C#/.NET library System.Data.OracleClient.dll
5 //
6 // Part of the Mono class libraries at
7 // mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci
8 //
9 // Assembly: System.Data.OracleClient.dll
10 // Namespace: System.Data.OracleClient.Oci
11 //
12 // Author:
13 // Tim Coleman <tim@timcoleman.com>
14 //
15 // Copyright (C) Tim Coleman, 2003
16 //
18 using System;
19 using System.Runtime.InteropServices;
21 namespace System.Data.OracleClient.Oci {
22 internal sealed class OciErrorHandle : OciHandle, IDisposable
24 #region Fields
26 bool disposed = false;
28 #endregion // Fields
30 #region Constructors
32 public OciErrorHandle (OciHandle parent, IntPtr newHandle)
33 : base (OciHandleType.Error, parent, newHandle)
37 #endregion // Constructors
39 #region Methods
41 protected override void Dispose (bool disposing)
43 if (!disposed) {
44 disposed = true;
45 base.Dispose (disposing);
49 public OciErrorInfo HandleError ()
51 OciErrorInfo info;
52 info.ErrorCode = 0;
53 info.ErrorMessage = String.Empty;
55 int errbufSize = 512;
56 IntPtr errbuf = Marshal.AllocHGlobal (errbufSize);
58 OciCalls.OCIErrorGet (this,
60 IntPtr.Zero,
61 out info.ErrorCode,
62 errbuf,
63 (uint) errbufSize,
64 OciHandleType.Error);
66 object err = Marshal.PtrToStringAnsi (errbuf);
67 if (err != null) {
68 string errmsg = (string) err;
69 info.ErrorMessage = String.Copy (errmsg);
70 Marshal.FreeHGlobal (errbuf);
73 return info;
76 #endregion // Methods