/
NativeMethods.cs
34 lines (30 loc) · 988 Bytes
/
NativeMethods.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
namespace Smart.Net
{
using System;
using System.Runtime.InteropServices;
/// <summary>
///
/// </summary>
internal struct NETRESOURCE
{
internal int Scope;
internal int Type;
internal int DisplayType;
internal int Usage;
internal IntPtr LocalName;
internal IntPtr RemoteName;
internal IntPtr Comment;
internal IntPtr Provider;
}
/// <summary>
///
/// </summary>
internal static class NativeMethods
{
// MapDrive
[DllImport("coredll", CharSet = CharSet.Unicode, SetLastError = true)]
internal static extern int WNetAddConnection3(IntPtr hwndOwner, IntPtr lpNetResource, string lpPassword, string lpUserName, int dwFlags);
[DllImport("coredll", CharSet = CharSet.Unicode, SetLastError = true)]
internal static extern int WNetCancelConnection2(string lpName, int dwFlags, int fForce);
}
}