PageRenderTime 24ms CodeModel.GetById 20ms app.highlight 1ms 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
17#region Using directives
18using System;
19using System.Runtime.InteropServices;
20using System.Text;
21#endregion
22
23
24/// <summary>
25/// Native methods
26/// </summary>
27internal class NativeMethod
28{
29    /// <summary>
30    /// Get current thread ID.
31    /// </summary>
32    /// <returns></returns>
33    [DllImport("kernel32.dll")]
34    internal static extern uint GetCurrentThreadId();
35
36    /// <summary>
37    /// Get current process ID.
38    /// </summary>
39    [DllImport("kernel32.dll")]
40    internal static extern uint GetCurrentProcessId();
41}