public static extern WindowsError NetLocalGroupEnum( string servername, uint level, out NetApiBufferHandle bufptr, uint prefmaxlen, out uint entriesread, out uint totalentries, IntPtr resumehandle);
public static extern WindowsError NetUserEnum( string servername, uint level, UserEnumFilter filter, out NetApiBufferHandle bufptr, uint prefmaxlen, out uint entriesread, out uint totalentries, IntPtr resume_handle);
private static IEnumerable <T> ReadStructsFromBuffer <T>(NetApiBufferHandle buffer, uint count) where T : struct { uint size = (uint)Marshal.SizeOf <T>(); var items = new List <T>((int)count); buffer.Initialize(numElements: count, sizeOfEachElement: size); for (uint i = 0; i < count; i++) { var current = buffer.Read <T>(i * size); items.Add(current); } return(items); }
public static extern WindowsError NetUserGetInfo( string servername, string username, uint level, out NetApiBufferHandle bufptr);