forked from petesh/jna-mpr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mpr.java
executable file
·43 lines (36 loc) · 2.5 KB
/
Mpr.java
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
35
36
37
38
39
40
41
42
43
import com.sun.jna.Memory;
import com.sun.jna.Native;
import com.sun.jna.platform.win32.WinNT;
import com.sun.jna.platform.win32.WinDef;
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.win32.W32APIOptions;
import com.sun.jna.WString;
import com.sun.jna.LastErrorException;
public interface Mpr extends WinNT
{
Mpr INSTANCE = (Mpr)Native.loadLibrary("Mpr", Mpr.class, W32APIOptions.UNICODE_OPTIONS);
public static final int CONNECT_UPDATE_PROFILE = 0x00000001;
public static final int CONNECT_UPDATE_RECENT = 0x00000002;
public static final int CONNECT_TEMPORARY = 0x00000004;
public static final int CONNECT_INTERACTIVE = 0x00000008;
public static final int CONNECT_PROMPT = 0x00000010;
public static final int CONNECT_NEED_DRIVE = 0x00000020;
public static final int CONNECT_REFCOUNT = 0x00000040;
public static final int CONNECT_REDIRECT = 0x00000080;
public static final int CONNECT_LOCALDRIVE = 0x00000100;
public static final int CONNECT_CURRENT_MEDIA = 0x00000200;
public static final int CONNECT_DEFERRED = 0x00000400;
public static final int CONNECT_RESERVED = 0xFF000000;
public static final int CONNECT_COMMANDLINE = 0x00000800;
public static final int CONNECT_CMD_SAVECRED = 0x00001000;
public static final int CONNECT_CRED_RESET = 0x00002000;
public int WNetAddConnection2A(NETRESOURCEA lpNetResource, String lpPassword, String lpUserName, int dwFlags) throws LastErrorException;
public int WNetAddConnection2W(NETRESOURCEW lpNetResource, WString lpPassword, WString lpUserName, int dwFlags) throws LastErrorException;
public int WNetCancelConnection2A(String lpName, int dwFlags, int FORCE) throws LastErrorException;
public int WNetCancelConnection2W(WString lpName, int dwFlags, int FORCE) throws LastErrorException;
public int WNetOpenEnumA(int dwScope, int dwType, int dwUsage, NETRESOURCEA lpNetResource, WinNT.HANDLEByReference handle) throws LastErrorException;
public int WNetOpenEnumW(int dwScope, int dwType, int dwUsage, NETRESOURCEW lpNetResource, WinNT.HANDLEByReference handle) throws LastErrorException;
public int WNetEnumResourceA(HANDLE handle, IntByReference lpcCount, Memory lpBuffer, IntByReference lpcBufferSize) throws LastErrorException;
public int WNetEnumResourceW(HANDLE handle, IntByReference lpcCount, Memory lpBuffer, IntByReference lpcBufferSize) throws LastErrorException;
public int WNetCloseEnum(HANDLE handle) throws LastErrorException;
}