示例#1
0
 public static extern int DsCrackNames(
     SafeDsHandle hDS,
     DsNameFlags flags,
     DsNameFormat formatOffered,
     DsNameFormat formatDesired,
     int cNames,
     string[] rpNames,
     out IntPtr ppResult //pointer to pointer of DS_NAME_RESULT
 );
示例#2
0
 public static extern int DsCrackNames(
     SafeDsHandle hDS,
     DsNameFlags flags,
     DsNameFormat formatOffered,
     DsNameFormat formatDesired,
     int cNames,
     string[] rpNames,
     out IntPtr ppResult //pointer to pointer of DS_NAME_RESULT
     );
示例#3
0
 public static extern int DsBindWithCred(
     string DomainControllerName,
     string DnsDomainName,
     SafeDsCredentialsHandle AuthIdentity,
     out SafeDsHandle phDS
 );
示例#4
0
 public static extern int DsBind(
     string DomainControllerName,
     string DnsDomainName,
     out SafeDsHandle phDS
 );
示例#5
0
        private static DsNameResultItem[] CrackNames(
            SafeDsHandle hDS,
            DsNameFlags flags,
            DsNameFormat formatOffered,
            DsNameFormat formatDesired,
            string[] names)
        {
            PscxArgumentException.ThrowIfIsNullOrEmpty(names);

            IntPtr ptr = IntPtr.Zero;

            try
            {
                NativeMethods.EnforceSuccess(NativeMethods.DsCrackNames(
                    hDS,
                    flags,
                    formatOffered,
                    formatDesired,
                    names.Length,
                    names,
                    out ptr));

                DsNameResult result = Utils.PtrToStructure<DsNameResult>(ptr);

                IEnumerable<DsNameResultItem> items =
                    Utils.ReadNativeArray<DsNameResultItem>(result.rItems, result.cItems);

                return new List<DsNameResultItem>(items).ToArray();
            }
            finally
            {
                NativeMethods.DsFreeNameResult(ptr);
            }
        }
示例#6
0
        private static int TryBind(string server, string domain, SafeDsCredentialsHandle credentials, out SafeDsHandle handle)
        {
            if (credentials != null)
            {
                return NativeMethods.DsBindWithCred(server, domain, credentials, out handle);
            }

            return NativeMethods.DsBind(server, domain, out handle);
        }
示例#7
0
 public static extern int DsBindWithCred(
     string DomainControllerName,
     string DnsDomainName,
     SafeDsCredentialsHandle AuthIdentity,
     out SafeDsHandle phDS
     );
示例#8
0
 public static extern int DsBind(
     string DomainControllerName,
     string DnsDomainName,
     out SafeDsHandle phDS
     );