-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathWindowsAPI.java
More file actions
86 lines (73 loc) · 3.05 KB
/
Copy pathWindowsAPI.java
File metadata and controls
86 lines (73 loc) · 3.05 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
package javaforce.api.windows;
import javaforce.ffm.*;
/** Windows OS specific API.
*
* @author pquiring
*/
public interface WindowsAPI {
public static WindowsAPI getInstance() {
return WindowsFFM.getInstance();
}
//Windows
public int[] getWindowRect(String name); //returns x,y,width,height
public long executeSession(String cmd, String[] args); //execute child process in current session id (args MUST be NULL terminated)
public void simulateCtrlAltDel();
public void setInputDesktop();
public int getSessionID();
public boolean setSessionID(long token, int sid); //update session ID of process
public void closeSession(long token);
//WinPE resources
public long peBegin(String file); //returns handle
public void peAddIcon(long handle, byte[] data, int offset, int length);
public void peAddString(long handle, int name, int idx, byte[] data, int offset, int length);
public void peEnd(long handle);
//Impersonate User
public boolean impersonateUser(String domain, String user, String passwd);
public boolean revertToSelf();
public boolean createProcessAsUser(String domain, String user, String passwd, String app, String cmdline, int flags);
public boolean shellExecute(String op, String app, String cmdline);
public final int FLAG_LIMIT = 1;
public final int FLAG_ELEVATE = 2;
//JDK
public String findJDKHome();
//Console
public void enableConsoleMode();
public void disableConsoleMode();
public int[] getConsoleSize();
public int[] getConsolePos();
public char readConsole();
public boolean peekConsole();
public void writeConsole(int ch);
public void writeConsoleArray(byte[] ch, int off, int len);
//Tape drive
public long tapeOpen(String name);
public void tapeClose(long handle);
public boolean tapeFormat(long handle, int blocksize);
public int tapeRead(long handle, byte[] buf, int offset, int length);
public int tapeWrite(long handle, byte[] buf, int offset, int length);
public boolean tapeSetpos(long handle, long pos);
public long tapeGetpos(long handle);
public boolean tapeMedia(long handle);
public long tapeMediaSize();
public int tapeMediaBlockSize();
public boolean tapeMediaReadOnly();
public boolean tapeDrive(long handle);
public int tapeDriveMinBlockSize();
public int tapeDriveMaxBlockSize();
public int tapeDriveDefaultBlockSize();
public int tapeLastError();
//Tape changer
public long changerOpen(String name);
public void changerClose(long handle);
public String[] changerList(long handle);
public boolean changerMove(long handle, String src, String transport, String dst); //transport is optional
//VSS (Volume Shadow Services)
public boolean vssInit();
public String[] vssListVols();
public String[][] vssListShadows(); //ret = GUID, shadow volume, org volume
public boolean vssCreateShadow(String drv, String mount); //mount optional
public boolean vssDeleteShadow(String shadowID);
public boolean vssDeleteShadowAll();
public boolean vssMountShadow(String mount, String shadowVol);
public boolean vssUnmountShadow(String mount);
}