Compartilhar via


ServerAgent.CloseHandle(System.IntPtr) method

 
Microsoft Office Live Communications Server 2005 with SP1

ServerAgent.CloseHandle

The CloseHandle method closes an open Windows object handle.

[C#]
public static int CloseHandle(
System.IntPtr hObject
);

  [Visual Basic .NET]
Public Shared Function CloseHandle( _
  ByVal hObject As System.IntPtr _
) As int

Parameters

  • hObject
    Specifies the object handle to close, such as the handle to a security token.

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.

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 Office Live Communications Server 2005 with SP1.
Namespace: Microsoft.Rtc.Sip
Assembly: ServerAgent (in ServerAgent.dll)

See Also

ServerAgent

  
  What did you think of this topic?
  © 2008 Microsoft Corporation. All rights reserved.