ServerAgent.CloseHandle(System.IntPtr) method

 
Communications Server 2007 Server SDK Documentation

ServerAgent.CloseHandle

The CloseHandle method closes an open Windows object handle.

[C#]
public static int CloseHandle(
System.IntPtr hObject
);
FakePre-877109407d5f41fa82fe0c34e5f4cc37-e44684e3efce4b02a4649c115fae2643

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 Communications Server 2007.
Namespace: Microsoft.Rtc.Sip
Assembly: ServerAgent (in ServerAgent.dll)

See Also

ServerAgent

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