ServerAgent.CloseHandle
The CloseHandle method closes an open Microsoft Windows object handle.
Syntax
[C#]
Copy Code | |
---|---|
public static int CloseHandle( System.IntPtr hObject ); |
Syntax
[Visual Basic .NET]
Copy Code | |
---|---|
Public Shared Function CloseHandle( _ ByVal hObject As System.IntPtr _ ) As int |
Parameters
Return Values
If the function succeeds, the return value is nonzero. Otherwise, it returns zero (0). To get the specific Windows error code, create a new instance of Win32Exception, which will obtain the corresponding Windows error code, as demonstrated in the following code example.
Copy Code | |
---|---|
if (ServerAgent.CloseHandle(mySecurityToken) == 0) { Win32Exception e = new Win32Exception(); Console.WriteLine("Windows Error {0}: {1}", e.ErrorCode, e.Message); } |
A list of Windows error codes can be found in Winerror.h, which ships with the Microsoft Windows Platform SDK.
Remarks
Calling this method is identical to calling the Windows CloseHandle function in kernel32.lib (defined in Windows.h).
Requirements
Redistributable: Requires Microsoft Lync Server 2010
Namespace:Microsoft.Rtc.Sip
Assembly: ServerAgent (in ServerAgent.dll)