GetClusterNodeId

The GetClusterNodeId function returns the unique identifier of a cluster node.

DWORD WINAPI GetClusterNodeId(
  HNODE hNode,        
  LPWSTR lpszNodeId,  
  LPDWORD lpcchNodeId 
);
 

Parameters

hNode
[in] Handle to the node with the identifier to be returned or NULL. If hNode is set to NULL, the node identifier for the node on which the application is running is returned in the contents of lpszNodeId.
lpszNodeId
[out] Pointer to the unique identifier of the node represented by hNode.
lpcchNodeId
[in, out] On input, pointer to the count of characters in the buffer pointed to by the lpszNodeId parameter, including the NULL terminator. On output, pointer to the count of characters stored in the buffer excluding the NULL terminator.

Return Values

ERROR_SUCCESS
The operation was successful.
ERROR_MORE_DATA
The buffer pointed to by lpszNodeId is not long enough to hold the required number of characters. GetClusterNodeId sets the contents of lpcchNodeId to the required length.

If the operation was unsuccessful, GetClusterNodeId returns a Win32 error value.

Remarks

If hNode is set to NULL and the caller is running on an active cluster node, GetClusterNodeId returns the identifier of the node on which the application is running. Setting hNode to NULL is a convenient way for resource DLLs to determine the node identifier of the node they are running on.

A cluster node identifier is a unique identifier that does not change if the node's name is changed.

QuickInfo

  Version: Use Windows NT Server Enterprise Edition 4.0.
  Windows CE: Unsupported.
  Header: Declared in clusapi.h.