/// <summary>
 ///  The SamrGetGroupsForUser method obtains a listing of
 ///  groups that a user is a member of. Opnum: 39 
 /// </summary>
 /// <param name="UserHandle">
 ///  An RPC context handle, as specified in section , representing
 ///  a user object.
 /// </param>
 /// <param name="Groups">
 ///  An array of RIDs of the groups that the user referenced
 ///  by UserHandle is a member of.
 /// </param>
 /// <returns>
 /// status of the function call, for example: 0 indicates STATUS_SUCCESS
 /// </returns>
 public int SamrGetGroupsForUser(System.IntPtr UserHandle, out _SAMPR_GET_GROUPS_BUFFER? Groups)
 {
     return rpc.SamrGetGroupsForUser(UserHandle, out Groups);
 }
        /// <summary>
        ///  The SamrGetGroupsForUser method obtains a listing of
        ///  groups that a user is a member of. Opnum: 39 
        /// </summary>
        /// <param name="UserHandle">
        ///  An RPC context handle, as specified in section , representing
        ///  a user object.
        /// </param>
        /// <param name="Groups">
        ///  An array of RIDs of the groups that the user referenced
        ///  by UserHandle is a member of.
        /// </param>
        /// <returns>
        /// status of the function call, for example: 0 indicates STATUS_SUCCESS
        /// </returns>
        public int SamrGetGroupsForUser(IntPtr UserHandle, out _SAMPR_GET_GROUPS_BUFFER? Groups)
        {
            const ushort opnum = 39;
            Int3264[] paramList;
            int retVal = 0;

            paramList = new Int3264[] {
                UserHandle,
                IntPtr.Zero,
                IntPtr.Zero
            };

            using (RpceInt3264Collection outParamList = RpceCall(paramList, opnum))
            {
                Groups = TypeMarshal.ToNullableStruct<_SAMPR_GET_GROUPS_BUFFER>(
                    Marshal.ReadIntPtr(outParamList[1]));
                retVal = outParamList[2].ToInt32();
            }

            return retVal;
        }