PageRenderTime 45ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/Visual Studio 2008/CSDllCOMServer/NativeMethod.cs

#
C# | 41 lines | 12 code | 4 blank | 25 comment | 0 complexity | 60001f0dca07a0f2ad35a39d3b1a3ecd MD5 | raw file
  1. /****************************** Module Header ******************************\
  2. * Module Name: NativeMethod.cs
  3. * Project: CSDllCOMServer
  4. * Copyright (c) Microsoft Corporation.
  5. *
  6. * The P/Invoke signatures of some native APIs.
  7. *
  8. * This source is subject to the Microsoft Public License.
  9. * See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
  10. * All other rights reserved.
  11. *
  12. * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
  13. * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
  15. \***************************************************************************/
  16. #region Using directives
  17. using System;
  18. using System.Runtime.InteropServices;
  19. using System.Text;
  20. #endregion
  21. /// <summary>
  22. /// Native methods
  23. /// </summary>
  24. internal class NativeMethod
  25. {
  26. /// <summary>
  27. /// Get current thread ID.
  28. /// </summary>
  29. /// <returns></returns>
  30. [DllImport("kernel32.dll")]
  31. internal static extern uint GetCurrentThreadId();
  32. /// <summary>
  33. /// Get current process ID.
  34. /// </summary>
  35. [DllImport("kernel32.dll")]
  36. internal static extern uint GetCurrentProcessId();
  37. }