Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

72 linhas
4.0 KiB

  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.Runtime.InteropServices;
  22. namespace Alphaleonis.Win32.Network
  23. {
  24. internal static partial class NativeMethods
  25. {
  26. /// <summary>Contains information about a network resource.
  27. /// <para>The NETRESOURCE structure is returned during an enumeration of network resources.</para>
  28. /// <para>The NETRESOURCE structure is also specified when making or querying</para>
  29. /// <para>a network connection with calls to various Windows Networking functions.</para>
  30. /// </summary>
  31. [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
  32. internal struct NETRESOURCE
  33. {
  34. /// <summary>The scope of the enumeration.</summary>
  35. [MarshalAs(UnmanagedType.U4)] public readonly ResourceScope dwScope;
  36. /// <summary>The type of resource</summary>
  37. [MarshalAs(UnmanagedType.U4)] public ResourceType dwType;
  38. /// <summary>The display options for the network object in a network browsing user interface.</summary>
  39. [MarshalAs(UnmanagedType.U4)] public readonly ResourceDisplayType dwDisplayType;
  40. /// <summary>A set of bit flags describing how the resource can be used.</summary>
  41. [MarshalAs(UnmanagedType.U4)] public readonly ResourceUsage dwUsage;
  42. /// <summary>If the <see cref="dwScope"/> member is equal to <see cref="ResourceScope.Connected"/> or <see cref="ResourceScope.Remembered"/>,
  43. /// this member is a pointer to a <see langword="null"/>-terminated character string that specifies the name of a local device.
  44. /// This member is <see langword="null"/> if the connection does not use a device.
  45. /// </summary>
  46. [MarshalAs(UnmanagedType.LPWStr)] public string lpLocalName;
  47. /// <summary>If the entry is a network resource, this member is a <see cref="string"/> that specifies the remote network name.
  48. /// If the entry is a current or persistent connection, <see cref="lpRemoteName"/> member points to
  49. /// the network name associated with the name pointed to by the <see cref="lpLocalName"/> member.
  50. /// The <see cref="string"/> can be <see cref="Alphaleonis.Win32.Filesystem.NativeMethods.MaxPath"/> characters in length,
  51. /// and it must follow the network provider's naming conventions.
  52. /// </summary>
  53. [MarshalAs(UnmanagedType.LPWStr)] public string lpRemoteName;
  54. /// <summary>A <see cref="string"/> that contains a comment supplied by the network provider.</summary>
  55. [MarshalAs(UnmanagedType.LPWStr)] public readonly string lpComment;
  56. /// <summary>A <see cref="string"/> that contains the name of the provider that owns the resource.
  57. /// This member can be <see langword="null"/> if the provider name is unknown.
  58. /// </summary>
  59. [MarshalAs(UnmanagedType.LPWStr)] public readonly string lpProvider;
  60. }
  61. }
  62. }