OciEnvironmentHandle.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // OciEnvironmentHandle.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 <[email protected]>
  14. //
  15. // Copyright (C) Tim Coleman, 2003
  16. //
  17. using System;
  18. using System.Runtime.InteropServices;
  19. namespace System.Data.OracleClient.Oci {
  20. internal class OciEnvironmentHandle : OciHandle, IDisposable
  21. {
  22. #region Constructors
  23. public OciEnvironmentHandle ()
  24. : this (OciEnvironmentMode.Default)
  25. {
  26. }
  27. public OciEnvironmentHandle (OciEnvironmentMode mode)
  28. : base (OciHandleType.Environment, null, IntPtr.Zero)
  29. {
  30. IntPtr newHandle = IntPtr.Zero;
  31. OciCalls.OCIEnvCreate (out newHandle,
  32. mode,
  33. IntPtr.Zero,
  34. IntPtr.Zero,
  35. IntPtr.Zero,
  36. IntPtr.Zero,
  37. 0,
  38. IntPtr.Zero);
  39. SetHandle (newHandle);
  40. }
  41. #endregion // Constructors
  42. #region Methods
  43. public OciErrorInfo HandleError ()
  44. {
  45. OciErrorInfo info = OciErrorHandle.HandleError (this);
  46. return info;
  47. }
  48. #endregion // Methods
  49. }
  50. }