/// <summary>
 ///  The SamrValidatePassword method validates an application
 ///  password against the locally stored policy. Opnum :
 ///  67 
 /// </summary>
 /// <param name="Handle">
 ///  An RPC binding handle parameter, as specified in [C706-Ch2Intro].
 /// </param>
 /// <param name="ValidationType">
 ///  The password policy validation requested.
 /// </param>
 /// <param name="InputArg">
 ///  The password-related material to validate.
 /// </param>
 /// <param name="OutputArg">
 ///  The result of the validation.
 /// </param>
 /// <returns>
 /// status of the function call, for example: 0 indicates STATUS_SUCCESS
 /// </returns>
 public int SamrValidatePassword(System.IntPtr Handle,
     _PASSWORD_POLICY_VALIDATION_TYPE ValidationType,
     //[Switch("ValidationType")]
     _SAM_VALIDATE_INPUT_ARG InputArg,
     //[Switch("ValidationType")]
     out _SAM_VALIDATE_OUTPUT_ARG? OutputArg)
 {
     return rpc.SamrValidatePassword(Handle, ValidationType, InputArg, out OutputArg);
 }
        /// <summary>
        ///  The SamrValidatePassword method validates an application
        ///  password against the locally stored policy. Opnum :
        ///  67 
        /// </summary>
        /// <param name="Handle">
        ///  An RPC binding handle parameter, as specified in [C706-Ch2Intro].
        /// </param>
        /// <param name="ValidationType">
        ///  The password policy validation requested.
        /// </param>
        /// <param name="InputArg">
        ///  The password-related material to validate.
        /// </param>
        /// <param name="OutputArg">
        ///  The result of the validation.
        /// </param>
        /// <returns>
        /// status of the function call, for example: 0 indicates STATUS_SUCCESS
        /// </returns>
        public int SamrValidatePassword(
            System.IntPtr Handle,
            _PASSWORD_POLICY_VALIDATION_TYPE ValidationType,
            _SAM_VALIDATE_INPUT_ARG InputArg,
            out _SAM_VALIDATE_OUTPUT_ARG? OutputArg)
        {
            const ushort opnum = 67;
            Int3264[] paramList;
            int retVal = 0;

            SafeIntPtr pInputArg = TypeMarshal.ToIntPtr(InputArg, ValidationType, null, null);

            paramList = new Int3264[] {
                (int)ValidationType,
                pInputArg,
                IntPtr.Zero,
                IntPtr.Zero
            };

            try
            {
                using (RpceInt3264Collection outParamList = RpceCall(paramList, opnum))
                {
                    OutputArg = TypeMarshal.ToNullableStruct<_SAM_VALIDATE_OUTPUT_ARG>(
                        Marshal.ReadIntPtr(outParamList[2]), ValidationType, null, null);
                    retVal = outParamList[3].ToInt32();
                }
            }
            finally
            {
                pInputArg.Dispose();
            }

            return retVal;
        }