You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DFS_INFO_9.cs 4.2 KiB

8 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* Copyright (C) 2008-2016 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
  2. *
  3. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4. * of this software and associated documentation files (the "Software"), to deal
  5. * in the Software without restriction, including without limitation the rights
  6. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7. * copies of the Software, and to permit persons to whom the Software is
  8. * furnished to do so, subject to the following conditions:
  9. *
  10. * The above copyright notice and this permission notice shall be included in
  11. * all copies or substantial portions of the Software.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19. * THE SOFTWARE.
  20. */
  21. using System;
  22. using System.Diagnostics.CodeAnalysis;
  23. using System.Runtime.InteropServices;
  24. namespace Alphaleonis.Win32.Network
  25. {
  26. internal static partial class NativeMethods
  27. {
  28. /// <summary>Contains the name, status, GUID, time-out, property flags, metadata size, DFS target information, link reparse point security descriptor, and a list of DFS targets for a root or link.</summary>
  29. /// <remarks>Minimum supported client: Windows Vista with SP1</remarks>
  30. /// <remarks>Minimum supported server: Windows Server 2008</remarks>
  31. [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Dfs")]
  32. [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
  33. internal struct DFS_INFO_9
  34. {
  35. /// <summary>The Universal Naming Convention (UNC) path of a DFS root or link.</summary>
  36. [MarshalAs(UnmanagedType.LPWStr)] public readonly string EntryPath;
  37. /// <summary>The comment associated with the DFS root or link.</summary>
  38. [MarshalAs(UnmanagedType.LPWStr)] public readonly string Comment;
  39. /// <summary>A <see cref="DfsVolumeStates"/> that specifies a set of bit flags that describe the DFS root or link.</summary>
  40. [MarshalAs(UnmanagedType.U4)] public readonly DfsVolumeStates State;
  41. /// <summary>Specifies the time-out, in seconds, of the DFS root or link.</summary>
  42. [MarshalAs(UnmanagedType.U4)] public readonly uint Timeout;
  43. /// <summary>Specifies the GUID of the DFS root or link.</summary>
  44. public readonly Guid Guid;
  45. /// <summary>Specifies a set of flags that describe specific properties of a DFS namespace, root, or link.</summary>
  46. [MarshalAs(UnmanagedType.U4)] public readonly DfsPropertyFlags PropertyFlags;
  47. /// <summary>For domain-based DFS namespaces, this member specifies the size of the corresponding Active Directory data blob, in bytes.
  48. /// For stand-alone DFS namespaces, this field specifies the size of the metadata stored in the registry,
  49. /// including the key names and value names, in addition to the specific data items associated with them.
  50. /// This field is valid for DFS roots only.
  51. /// </summary>
  52. [MarshalAs(UnmanagedType.U4)] public readonly uint MetadataSize;
  53. /// <summary>This member is reserved for system use.</summary>
  54. [MarshalAs(UnmanagedType.U4)] public readonly uint SdLengthReserved;
  55. /// <summary>Pointer to a SECURITY_DESCRIPTOR structure that specifies a self-relative security descriptor to be associated with the DFS link's reparse point.
  56. /// This field is valid for DFS links only.
  57. /// </summary>
  58. public IntPtr pSecurityDescriptor;
  59. /// <summary>Specifies the number of DFS targets.</summary>
  60. [MarshalAs(UnmanagedType.U4)] public readonly uint NumberOfStorages;
  61. /// <summary>An array of <see cref="DFS_STORAGE_INFO_1"/> structures.</summary>
  62. public readonly IntPtr Storage;
  63. }
  64. }
  65. }