NewDev

NewDev

  • NA
  • 1
  • 0

Cluster Management APIs in C Sharp

Aug 2 2006 2:44 AM
 
Hello All,

Im Coding cluster Management functions in C# using the APIs. When I am trying to DLLImport for the API GetClusterGroupState as

I get an System.AccessViolationException that protected memory is accesses. Let me know the How shoud I use this API in c#. Here is my code.

[DllImport("clusapi.dll", EntryPoint = "GetClusterGroupState", SetLastError = true,
CharSet = CharSet.Unicode, ExactSpelling = false, CallingConvention = CallingConvention.StdCall),
SuppressUnmanagedCodeSecurityAttribute()]
internal static extern int GetClusterGroupState(
IntPtr hClusGroup,
out string strOwnerNode,
[MarshalAs(UnmanagedType.I4)] int nNodeNamebuf);

Thanks