Using a mix of jni4net and Jacob

This shoooouuld work
But now jni4net can't load the .NET proxy
This commit is contained in:
Norbi Peti 2020-11-22 03:27:40 +01:00
parent e1352b7f87
commit 5adc49d40a
44 changed files with 208 additions and 1691 deletions

View file

@ -101,7 +101,7 @@ public final class Computer {
handler.registerTo(progress.getEventSource()); //TODO: Show progress bar some way?
val fb = new MCFrameBuffer(console.getDisplay());
fb.start();
String fbid = console.getDisplay().attachFramebuffer(0, COMUtils.gimmeAFramebuffer(fb));
String fbid = console.getDisplay().attachFramebuffer(0L, COMUtils.gimmeAFramebuffer(fb));
fb.setId(fbid);
framebuffer = fb;
}
@ -174,10 +174,10 @@ public final class Computer {
try {
synchronized (session) {
if (seamless == null)
session.getConsole().getDisplay().setVideoModeHint(COMUtils.convertFromLong(0L),
COMUtils.convertFromBool(true), COMUtils.convertFromBool(false),
0, 0, COMUtils.convertFromLong(640L), COMUtils.convertFromLong(480L),
COMUtils.convertFromLong(32L), COMUtils.convertFromBool(false));
session.getConsole().getDisplay().setVideoModeHint(0L,
true, false,
0, 0, 640L, 480L,
32L, false);
} //Last param: notify - send PnP notification - stops updates but not changes for some reason
Bukkit.getScheduler().runTaskLaterAsynchronously(PluginMain.Instance, () -> {
synchronized (session) {

View file

@ -84,8 +84,7 @@ public class PluginMain extends JavaPlugin {
new File(getDataFolder(), "jni4net.n.w64.v40-0.8.9.0.dll"),
new File(getDataFolder(), "VirtualComputerWindows.j4n.dll"),
new File(getDataFolder(), "VirtualComputerWindows.dll"),
new File(getDataFolder(), "Interop.VirtualBox.dll"),
new File(getDataFolder(), "Interop.VirtualBox.j4n.dll")
new File(getDataFolder(), "Interop.VirtualBox.dll")
};
for (final File lib : libs) {
@ -95,11 +94,9 @@ public class PluginMain extends JavaPlugin {
}
ccs.sendMessage("§bInitializing bridge...");
Bridge.setVerbose(true);
//Bridge.init(new File(getDataFolder(), "jni4net.n.w64.v40-0.8.9.0.dll").getAbsoluteFile());
Bridge.init(getDataFolder().getAbsoluteFile());
Bridge.getSetup().setVeryVerbose(true);
Bridge.LoadAndRegisterAssemblyFrom(new File(getDataFolder(), "VirtualComputerWindows.j4n.dll"));
Bridge.LoadAndRegisterAssemblyFrom(new File(getDataFolder(), "Interop.VirtualBox.j4n.dll"));
}
final VirtualBoxManager manager = VirtualBoxManager.createInstance(getDataFolder().getAbsolutePath());
if (!windows) {

View file

@ -43,7 +43,7 @@ public class MachineEventHandler extends EventHandlerBase {
starting = false;
Bukkit.getScheduler().runTaskAsynchronously(PluginMain.Instance, () -> {
progress.waitForCompletion(-1);
if (progress != null && COMUtils.convertToBool(progress.getCompleted()) && progress.getResultCode() != 0) {
if (progress != null && progress.getCompleted() && progress.getResultCode() != 0) {
Logger l = PluginMain.Instance.getLogger();
l.warning("Result code: " + Integer.toHexString(progress.getResultCode()));
for (var info = progress.getErrorInfo(); info != null; info = info.getNext()) {

View file

@ -31,6 +31,11 @@
<artifactId>VirtualComputer-Windows</artifactId>
<version>0.8.9.0</version>
</dependency>
<dependency>
<groupId>net.sf.jacob-project</groupId>
<artifactId>jacob</artifactId>
<version>1.19</version>
</dependency>
</dependencies>
<build>

View file

@ -1,18 +0,0 @@
package org.virtualbox_6_1;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public enum BitmapFormat {
Opaque(0),
PNG(541544016), // 0x20474E50
BGR(542263106), // 0x20524742
BGR0(810698562), // 0x30524742
RGBA(1094862674), // 0x41424752
BGRA(1095911234), // 0x41524742
JPEG(1195724874); // 0x4745504A
@Getter
private final int value;
}

View file

@ -1,5 +0,0 @@
package org.virtualbox_6_1;
public class Holder<T> {
public T value;
}

View file

@ -1,42 +0,0 @@
// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by jni4net. See http://jni4net.sourceforge.net/
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
package org.virtualbox_6_1;
import lombok.var;
import virtualcomputerwindows.Exports;
@net.sf.jni4net.attributes.ClrInterface
public interface IEvent {
//<generated-interface>
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/VBoxEventType;")
org.virtualbox_6_1_FixIt.VBoxEventType getType_FixIt();
default VBoxEventType getType() {
var type = Exports.convertEnum(getType_FixIt());
for (var value : VBoxEventType.values())
if (value.value() == type)
return value;
return null;
}
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/IEventSource;")
IEventSource getSource();
@net.sf.jni4net.attributes.ClrMethod("()I")
int getWaitable();
@net.sf.jni4net.attributes.ClrMethod("()V")
void setProcessed();
@net.sf.jni4net.attributes.ClrMethod("(I)I")
int waitProcessed(int aTimeout);
//</generated-interface>
}

View file

@ -1,74 +0,0 @@
// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by jni4net. See http://jni4net.sourceforge.net/
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
package org.virtualbox_6_1;
import lombok.var;
import system.Array;
import virtualcomputerwindows.Exports;
import java.util.List;
@net.sf.jni4net.attributes.ClrInterface
public interface IKeyboard {
//<generated-interface>
@net.sf.jni4net.attributes.ClrMethod("()LSystem/Array;")
system.Array getKeyboardLEDs_FixIt();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/IEventSource;")
IEventSource getEventSource();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute1IKeyboard();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute2IKeyboard();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute3IKeyboard();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute4IKeyboard();
@net.sf.jni4net.attributes.ClrMethod("(I)V")
void putScancode(int aScancode);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/Array;)LSystem/UInt32;")
int putScancodes_FixIt(system.Array aScancodes);
default int putScancodes(List<Integer> scancodes) {
var sc = new int[scancodes.size()];
for (int i = 0; i < sc.length; i++)
sc[i] = scancodes.get(i);
return putScancodes_FixIt(Exports.convertArray_FixIt(sc));
}
@net.sf.jni4net.attributes.ClrMethod("()V")
void putCAD();
@net.sf.jni4net.attributes.ClrMethod("()V")
void releaseKeys();
@net.sf.jni4net.attributes.ClrMethod("(III)V")
void putUsageCode(int aUsageCode, int aUsagePage, int aKeyRelease);
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod1IKeyboard();
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod2IKeyboard();
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod3IKeyboard();
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod4IKeyboard();
//</generated-interface>
}

View file

@ -1,699 +0,0 @@
// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by jni4net. See http://jni4net.sourceforge.net/
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
package org.virtualbox_6_1;
import lombok.var;
import virtualcomputerwindows.Exports;
@net.sf.jni4net.attributes.ClrInterface
public interface IMachine {
//<generated-interface>
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute15IMachine();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute16IMachine();
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/Session;Lorg/virtualbox_6_1/LockType;)V")
void lockMachine_FixIt(Session aSession, org.virtualbox_6_1_FixIt.LockType aLockType);
default void lockMachine(ISession session, LockType lockType) {
lockMachine_FixIt((Session) session, (org.virtualbox_6_1_FixIt.LockType) system.Enum.ToObject(org.virtualbox_6_1_FixIt.LockType.typeof(), lockType.ordinal()));
}
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/Session;LSystem/String;LSystem/Array;)Lorg/virtualbox_6_1/IProgress;")
IProgress launchVMProcess_FixIt(Session aSession, String aName, system.Array aEnvironmentChanges);
//default IProgress launchVMProcess(Session session, String name, )
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;Lorg/virtualbox_6_1/DeviceType;)V")
void setBootOrder_FixIt(int aPosition, org.virtualbox_6_1_FixIt.DeviceType aDevice);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;)Lorg/virtualbox_6_1/DeviceType;")
org.virtualbox_6_1_FixIt.DeviceType getBootOrder_FixIt(int aPosition);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;IILorg/virtualbox_6_1/DeviceType;Lorg/virtualbox_6_1/IMedium;)V")
void attachDevice_FixIt(String aName, int aControllerPort, int aDevice, org.virtualbox_6_1_FixIt.DeviceType aType, IMedium aMedium);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;IILorg/virtualbox_6_1/DeviceType;)V")
void attachDeviceWithoutMedium_FixIt(String aName, int aControllerPort, int aDevice, org.virtualbox_6_1_FixIt.DeviceType aType);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;II)V")
void detachDevice(String aName, int aControllerPort, int aDevice);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;III)V")
void passthroughDevice(String aName, int aControllerPort, int aDevice, int aPassthrough);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;III)V")
void temporaryEjectDevice(String aName, int aControllerPort, int aDevice, int aTemporaryEject);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;III)V")
void nonRotationalDevice(String aName, int aControllerPort, int aDevice, int aNonRotational);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;III)V")
void setAutoDiscardForDevice(String aName, int aControllerPort, int aDevice, int aDiscard);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;III)V")
void setHotPluggableForDevice(String aName, int aControllerPort, int aDevice, int aHotPluggable);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;IILorg/virtualbox_6_1/IBandwidthGroup;)V")
void setBandwidthGroupForDevice(String aName, int aControllerPort, int aDevice, IBandwidthGroup aBandwidthGroup);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;II)V")
void setNoBandwidthGroupForDevice(String aName, int aControllerPort, int aDevice);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;III)V")
void unmountMedium(String aName, int aControllerPort, int aDevice, int aForce);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;IILorg/virtualbox_6_1/IMedium;I)V")
void mountMedium(String aName, int aControllerPort, int aDevice, IMedium aMedium, int aForce);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;II)Lorg/virtualbox_6_1/IMedium;")
IMedium getMedium(String aName, int aControllerPort, int aDevice);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)LSystem/Array;")
system.Array getMediumAttachmentsOfController_FixIt(String aName);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;II)Lorg/virtualbox_6_1/IMediumAttachment;")
IMediumAttachment getMediumAttachment(String aName, int aControllerPort, int aDevice);
@net.sf.jni4net.attributes.ClrMethod("(III)V")
void attachHostPCIDevice(int aHostAddress, int aDesiredGuestAddress, int aTryToUnbind);
@net.sf.jni4net.attributes.ClrMethod("(I)V")
void detachHostPCIDevice(int aHostAddress);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;)Lorg/virtualbox_6_1/INetworkAdapter;")
INetworkAdapter getNetworkAdapter(int aSlot);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;Lorg/virtualbox_6_1/StorageBus;)Lorg/virtualbox_6_1/IStorageController;")
IStorageController addStorageController_FixIt(String aName, org.virtualbox_6_1_FixIt.StorageBus aConnectionType);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)Lorg/virtualbox_6_1/IStorageController;")
IStorageController getStorageControllerByName(String aName);
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/StorageBus;LSystem/UInt32;)Lorg/virtualbox_6_1/IStorageController;")
IStorageController getStorageControllerByInstance_FixIt(org.virtualbox_6_1_FixIt.StorageBus aConnectionType, int aInstance);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)V")
void removeStorageController(String aName);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;I)V")
void setStorageControllerBootable(String aName, int aBootable);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;Lorg/virtualbox_6_1/USBControllerType;)Lorg/virtualbox_6_1/IUSBController;")
IUSBController addUSBController_FixIt(String aName, org.virtualbox_6_1_FixIt.USBControllerType aType);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)V")
void removeUSBController(String aName);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)Lorg/virtualbox_6_1/IUSBController;")
IUSBController getUSBControllerByName(String aName);
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/USBControllerType;)LSystem/UInt32;")
int getUSBControllerCountByType_FixIt(org.virtualbox_6_1_FixIt.USBControllerType aType);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;)Lorg/virtualbox_6_1/ISerialPort;")
ISerialPort getSerialPort(int aSlot);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;)Lorg/virtualbox_6_1/IParallelPort;")
IParallelPort getParallelPort(int aSlot);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/Array;")
system.Array getExtraDataKeys_FixIt();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)LSystem/String;")
String getExtraData(String aKey);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;LSystem/String;)V")
void setExtraData(String aKey, String aValue);
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/CPUPropertyType;)I")
int getCPUProperty_FixIt(org.virtualbox_6_1_FixIt.CPUPropertyType aProperty);
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/CPUPropertyType;I)V")
void setCPUProperty_FixIt(org.virtualbox_6_1_FixIt.CPUPropertyType aProperty, int aValue);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;LSystem/UInt32;LSystem/UInt32;LSystem/UInt32;LSystem/UInt32;LSystem/UInt32;LSystem/UInt32;)V")
void getCPUIDLeafByOrdinal(int aOrdinal, net.sf.jni4net.Out<Integer> aIdx, net.sf.jni4net.Out<Integer> aIdxSub, net.sf.jni4net.Out<Integer> aValEax, net.sf.jni4net.Out<Integer> aValEbx, net.sf.jni4net.Out<Integer> aValEcx, net.sf.jni4net.Out<Integer> aValEdx);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;LSystem/UInt32;LSystem/UInt32;LSystem/UInt32;LSystem/UInt32;LSystem/UInt32;)V")
void getCPUIDLeaf(int aIdx, int aIdxSub, net.sf.jni4net.Out<Integer> aValEax, net.sf.jni4net.Out<Integer> aValEbx, net.sf.jni4net.Out<Integer> aValEcx, net.sf.jni4net.Out<Integer> aValEdx);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;LSystem/UInt32;LSystem/UInt32;LSystem/UInt32;LSystem/UInt32;LSystem/UInt32;)V")
void setCPUIDLeaf(int aIdx, int aIdxSub, int aValEax, int aValEbx, int aValEcx, int aValEdx);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;LSystem/UInt32;)V")
void removeCPUIDLeaf(int aIdx, int aIdxSub);
@net.sf.jni4net.attributes.ClrMethod("()V")
void removeAllCPUIDLeaves();
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/HWVirtExPropertyType;)I")
int getHWVirtExProperty_FixIt(org.virtualbox_6_1_FixIt.HWVirtExPropertyType aProperty);
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/HWVirtExPropertyType;I)V")
void setHWVirtExProperty_FixIt(org.virtualbox_6_1_FixIt.HWVirtExPropertyType aProperty, int aValue);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)Lorg/virtualbox_6_1/IProgress;")
IProgress setSettingsFilePath(String aSettingsFilePath);
@net.sf.jni4net.attributes.ClrMethod("()V")
void saveSettings();
@net.sf.jni4net.attributes.ClrMethod("()V")
void discardSettings();
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/CleanupMode;)LSystem/Array;")
system.Array unregister_FixIt(org.virtualbox_6_1_FixIt.CleanupMode aCleanupMode);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/Array;)Lorg/virtualbox_6_1/IProgress;")
IProgress deleteConfig_FixIt(system.Array aMedia);
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/IAppliance;LSystem/String;)Lorg/virtualbox_6_1/IVirtualSystemDescription;")
IVirtualSystemDescription exportTo(IAppliance aAppliance, String aLocation);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)Lorg/virtualbox_6_1/ISnapshot;")
ISnapshot findSnapshot(String aNameOrId);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;LSystem/String;IILSystem/String;)V")
void createSharedFolder(String aName, String aHostPath, int aWritable, int aAutoMount, String aAutoMountPoint);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)V")
void removeSharedFolder(String aName);
@net.sf.jni4net.attributes.ClrMethod("()I")
int canShowConsoleWindow();
@net.sf.jni4net.attributes.ClrMethod("()J")
long showConsoleWindow();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;LSystem/String;JLSystem/String;)V")
void getGuestProperty(String aName, net.sf.jni4net.Out<String> aValue, net.sf.jni4net.Out<Long> aTimeStamp, net.sf.jni4net.Out<String> aFlags);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)LSystem/String;")
String getGuestPropertyValue(String aProperty);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)J")
long getGuestPropertyTimestamp(String aProperty);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;LSystem/String;LSystem/String;)V")
void setGuestProperty(String aProperty, String aValue, String aFlags);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;LSystem/String;)V")
void setGuestPropertyValue(String aProperty, String aValue);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)V")
void deleteGuestProperty(String aName);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;LSystem/Array;LSystem/Array;LSystem/Array;LSystem/Array;)V")
void enumerateGuestProperties(String aPatterns, net.sf.jni4net.Out<system.Array> aNames, net.sf.jni4net.Out<system.Array> aValues, net.sf.jni4net.Out<system.Array> aTimestamps, net.sf.jni4net.Out<system.Array> aFlags);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;LSystem/UInt32;LSystem/UInt32;LSystem/UInt32;LSystem/UInt32;I)V")
void querySavedGuestScreenInfo(int aScreenId, net.sf.jni4net.Out<Integer> aOriginX, net.sf.jni4net.Out<Integer> aOriginY, net.sf.jni4net.Out<Integer> aWidth, net.sf.jni4net.Out<Integer> aHeight, net.sf.jni4net.Out<Integer> aEnabled);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;Lorg/virtualbox_6_1/BitmapFormat;LSystem/UInt32;LSystem/UInt32;)LSystem/Array;")
system.Array readSavedThumbnailToArray_FixIt(int aScreenId, org.virtualbox_6_1_FixIt.BitmapFormat aBitmapFormat, net.sf.jni4net.Out<Integer> aWidth, net.sf.jni4net.Out<Integer> aHeight);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;LSystem/UInt32;LSystem/UInt32;)LSystem/Array;")
system.Array querySavedScreenshotInfo_FixIt(int aScreenId, net.sf.jni4net.Out<Integer> aWidth, net.sf.jni4net.Out<Integer> aHeight);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;Lorg/virtualbox_6_1/BitmapFormat;LSystem/UInt32;LSystem/UInt32;)LSystem/Array;")
system.Array readSavedScreenshotToArray_FixIt(int aScreenId, org.virtualbox_6_1_FixIt.BitmapFormat aBitmapFormat, net.sf.jni4net.Out<Integer> aWidth, net.sf.jni4net.Out<Integer> aHeight);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;)V")
void hotPlugCPU(int aCpu);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;)V")
void hotUnplugCPU(int aCpu);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;)I")
int getCPUStatus(int aCpu);
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/ParavirtProvider;")
org.virtualbox_6_1_FixIt.ParavirtProvider getEffectiveParavirtProvider_FixIt();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;)LSystem/String;")
String queryLogFilename(int aIdx);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;JJ)LSystem/Array;")
system.Array readLog_FixIt(int aIdx, long aOffset, long aSize);
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/IMachine;Lorg/virtualbox_6_1/CloneMode;LSystem/Array;)Lorg/virtualbox_6_1/IProgress;")
IProgress cloneTo_FixIt(IMachine aTarget, org.virtualbox_6_1_FixIt.CloneMode aMode, system.Array aOptions);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;LSystem/String;)Lorg/virtualbox_6_1/IProgress;")
IProgress moveTo(String aFolder, String aType);
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/IProgress;")
IProgress saveState();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)V")
void adoptSavedState(String aSavedStateFile);
@net.sf.jni4net.attributes.ClrMethod("(I)V")
void discardSavedState(int aFRemoveFile);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;LSystem/String;ILSystem/String;)Lorg/virtualbox_6_1/IProgress;")
IProgress takeSnapshot(String aName, String aDescription, int aPause, net.sf.jni4net.Out<String> aId);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)Lorg/virtualbox_6_1/IProgress;")
IProgress deleteSnapshot(String aId);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)Lorg/virtualbox_6_1/IProgress;")
IProgress deleteSnapshotAndAllChildren(String aId);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;LSystem/String;)Lorg/virtualbox_6_1/IProgress;")
IProgress deleteSnapshotRange(String aStartId, String aEndId);
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/ISnapshot;)Lorg/virtualbox_6_1/IProgress;")
IProgress restoreSnapshot(ISnapshot aSnapshot);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)V")
void applyDefaults(String aFlags);
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod1IMachine();
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod2IMachine();
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod3IMachine();
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod4IMachine();
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod5IMachine();
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod6IMachine();
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod7IMachine();
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod8IMachine();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/VirtualBox;")
VirtualBox getParent();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/Array;")
system.Array getIcon_FixIt();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/Array;)V")
void setIcon_FixIt(system.Array aIcon);
@net.sf.jni4net.attributes.ClrMethod("()I")
int getAccessible();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/IVirtualBoxErrorInfo;")
IVirtualBoxErrorInfo getAccessError();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getName();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)V")
void setName(String aName);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getDescription();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)V")
void setDescription(String aDescription);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getId();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/Array;")
system.Array getGroups_FixIt();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/Array;)V")
void setGroups_FixIt(system.Array aGroups);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getOSTypeId();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)V")
void setOSTypeId(String aOSTypeId);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getHardwareVersion();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)V")
void setHardwareVersion(String aHardwareVersion);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getHardwareUUID();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)V")
void setHardwareUUID(String aHardwareUUID);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getCPUCount();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;)V")
void setCPUCount(int aCPUCount);
@net.sf.jni4net.attributes.ClrMethod("()I")
int getCPUHotPlugEnabled();
@net.sf.jni4net.attributes.ClrMethod("(I)V")
void setCPUHotPlugEnabled(int aCPUHotPlugEnabled);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getCPUExecutionCap();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;)V")
void setCPUExecutionCap(int aCPUExecutionCap);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getCPUIDPortabilityLevel();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;)V")
void setCPUIDPortabilityLevel(int aCPUIDPortabilityLevel);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getMemorySize();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;)V")
void setMemorySize(int aMemorySize);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getMemoryBalloonSize();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;)V")
void setMemoryBalloonSize(int aMemoryBalloonSize);
@net.sf.jni4net.attributes.ClrMethod("()I")
int getPageFusionEnabled();
@net.sf.jni4net.attributes.ClrMethod("(I)V")
void setPageFusionEnabled(int aPageFusionEnabled);
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/IGraphicsAdapter;")
IGraphicsAdapter getGraphicsAdapter();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/IBIOSSettings;")
IBIOSSettings getBIOSSettings();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/IRecordingSettings;")
IRecordingSettings getRecordingSettings();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/FirmwareType;")
org.virtualbox_6_1_FixIt.FirmwareType getFirmwareType_FixIt();
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/FirmwareType;)V")
void setFirmwareType_FixIt(org.virtualbox_6_1_FixIt.FirmwareType aFirmwareType);
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/PointingHIDType;")
org.virtualbox_6_1_FixIt.PointingHIDType getPointingHIDType_FixIt();
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/PointingHIDType;)V")
void setPointingHIDType_FixIt(org.virtualbox_6_1_FixIt.PointingHIDType aPointingHIDType);
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/KeyboardHIDType;")
org.virtualbox_6_1_FixIt.KeyboardHIDType getKeyboardHIDType_FixIt();
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/KeyboardHIDType;)V")
void setKeyboardHIDType_FixIt(org.virtualbox_6_1_FixIt.KeyboardHIDType aKeyboardHIDType);
@net.sf.jni4net.attributes.ClrMethod("()I")
int getHPETEnabled();
@net.sf.jni4net.attributes.ClrMethod("(I)V")
void setHPETEnabled(int aHPETEnabled);
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/ChipsetType;")
org.virtualbox_6_1_FixIt.ChipsetType getChipsetType_FixIt();
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/ChipsetType;)V")
void setChipsetType_FixIt(org.virtualbox_6_1_FixIt.ChipsetType aChipsetType);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getSnapshotFolder();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)V")
void setSnapshotFolder(String aSnapshotFolder);
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/IVRDEServer;")
IVRDEServer getVRDEServer();
@net.sf.jni4net.attributes.ClrMethod("()I")
int getEmulatedUSBCardReaderEnabled();
@net.sf.jni4net.attributes.ClrMethod("(I)V")
void setEmulatedUSBCardReaderEnabled(int aEmulatedUSBCardReaderEnabled);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/Array;")
system.Array getMediumAttachments_FixIt();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/Array;")
system.Array getUSBControllers_FixIt();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/IUSBDeviceFilters;")
IUSBDeviceFilters getUSBDeviceFilters();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/IAudioAdapter;")
IAudioAdapter getAudioAdapter();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/Array;")
system.Array getStorageControllers_FixIt();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getSettingsFilePath();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getSettingsAuxFilePath();
@net.sf.jni4net.attributes.ClrMethod("()I")
int getSettingsModified();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/SessionState;")
org.virtualbox_6_1_FixIt.SessionState getSessionState_FixIt();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getSessionName();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getSessionPID();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/MachineState;")
org.virtualbox_6_1_FixIt.MachineState getState_FixIt();
default MachineState getState() {
int state = Exports.convertEnum(getState_FixIt());
for (var value : MachineState.values())
if (value.value() == state)
return value;
return null;
}
@net.sf.jni4net.attributes.ClrMethod("()J")
long getLastStateChange();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getStateFilePath();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getLogFolder();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/ISnapshot;")
ISnapshot getCurrentSnapshot();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getSnapshotCount();
@net.sf.jni4net.attributes.ClrMethod("()I")
int getCurrentStateModified();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/Array;")
system.Array getSharedFolders_FixIt();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/ClipboardMode;")
org.virtualbox_6_1_FixIt.ClipboardMode getClipboardMode_FixIt();
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/ClipboardMode;)V")
void setClipboardMode_FixIt(org.virtualbox_6_1_FixIt.ClipboardMode aClipboardMode);
@net.sf.jni4net.attributes.ClrMethod("()I")
int getClipboardFileTransfersEnabled();
@net.sf.jni4net.attributes.ClrMethod("(I)V")
void setClipboardFileTransfersEnabled(int aClipboardFileTransfersEnabled);
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/DnDMode;")
org.virtualbox_6_1_FixIt.DnDMode getDnDMode_FixIt();
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/DnDMode;)V")
void setDnDMode_FixIt(org.virtualbox_6_1_FixIt.DnDMode aDnDMode);
@net.sf.jni4net.attributes.ClrMethod("()I")
int getTeleporterEnabled();
@net.sf.jni4net.attributes.ClrMethod("(I)V")
void setTeleporterEnabled(int aTeleporterEnabled);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getTeleporterPort();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;)V")
void setTeleporterPort(int aTeleporterPort);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getTeleporterAddress();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)V")
void setTeleporterAddress(String aTeleporterAddress);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getTeleporterPassword();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)V")
void setTeleporterPassword(String aTeleporterPassword);
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/ParavirtProvider;")
org.virtualbox_6_1_FixIt.ParavirtProvider getParavirtProvider_FixIt();
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/ParavirtProvider;)V")
void setParavirtProvider_FixIt(org.virtualbox_6_1_FixIt.ParavirtProvider aParavirtProvider);
@net.sf.jni4net.attributes.ClrMethod("()I")
int getRTCUseUTC();
@net.sf.jni4net.attributes.ClrMethod("(I)V")
void setRTCUseUTC(int aRTCUseUTC);
@net.sf.jni4net.attributes.ClrMethod("()I")
int getIOCacheEnabled();
@net.sf.jni4net.attributes.ClrMethod("(I)V")
void setIOCacheEnabled(int aIOCacheEnabled);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getIOCacheSize();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;)V")
void setIOCacheSize(int aIOCacheSize);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/Array;")
system.Array getPCIDeviceAssignments_FixIt();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/IBandwidthControl;")
IBandwidthControl getBandwidthControl();
@net.sf.jni4net.attributes.ClrMethod("()I")
int getTracingEnabled();
@net.sf.jni4net.attributes.ClrMethod("(I)V")
void setTracingEnabled(int aTracingEnabled);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getTracingConfig();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)V")
void setTracingConfig(String aTracingConfig);
@net.sf.jni4net.attributes.ClrMethod("()I")
int getAllowTracingToAccessVM();
@net.sf.jni4net.attributes.ClrMethod("(I)V")
void setAllowTracingToAccessVM(int aAllowTracingToAccessVM);
@net.sf.jni4net.attributes.ClrMethod("()I")
int getAutostartEnabled();
@net.sf.jni4net.attributes.ClrMethod("(I)V")
void setAutostartEnabled(int aAutostartEnabled);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getAutostartDelay();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;)V")
void setAutostartDelay(int aAutostartDelay);
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/AutostopType;")
org.virtualbox_6_1_FixIt.AutostopType getAutostopType_FixIt();
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/AutostopType;)V")
void setAutostopType_FixIt(org.virtualbox_6_1_FixIt.AutostopType aAutostopType);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getDefaultFrontend();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)V")
void setDefaultFrontend(String aDefaultFrontend);
@net.sf.jni4net.attributes.ClrMethod("()I")
int getUSBProxyAvailable();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/VMProcPriority;")
org.virtualbox_6_1_FixIt.VMProcPriority getVMProcessPriority_FixIt();
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/VMProcPriority;)V")
void setVMProcessPriority_FixIt(org.virtualbox_6_1_FixIt.VMProcPriority aVMProcessPriority);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getParavirtDebug();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)V")
void setParavirtDebug(String aParavirtDebug);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getCPUProfile();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)V")
void setCPUProfile(String aCPUProfile);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute1IMachine();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute2IMachine();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute3IMachine();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute4IMachine();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute5IMachine();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute6IMachine();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute7IMachine();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute8IMachine();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute9IMachine();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute10IMachine();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute11IMachine();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute12IMachine();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute13IMachine();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute14IMachine();
//</generated-interface>
}

View file

@ -1,83 +0,0 @@
// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by jni4net. See http://jni4net.sourceforge.net/
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
package org.virtualbox_6_1;
import virtualcomputerwindows.Exports;
@net.sf.jni4net.attributes.ClrInterface
public interface ISession {
//<generated-interface>
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/SessionState;")
org.virtualbox_6_1_FixIt.SessionState getState_FixIt();
default org.virtualbox_6_1.SessionState getState() {
return SessionState.values()[Exports.convertEnum(getState_FixIt())];
}
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/SessionType;")
org.virtualbox_6_1_FixIt.SessionType getType_FixIt();
default org.virtualbox_6_1.SessionType getType() {
return SessionType.values()[Exports.convertEnum(getType_FixIt())];
}
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
java.lang.String getName();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)V")
void setName(java.lang.String aName);
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/IMachine;")
org.virtualbox_6_1.IMachine getMachine();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/IConsole;")
org.virtualbox_6_1.IConsole getConsole();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute1ISession();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute2ISession();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute3ISession();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute4ISession();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute5ISession();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute6ISession();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute7ISession();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute8ISession();
@net.sf.jni4net.attributes.ClrMethod("()V")
void unlockMachine();
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod1ISession();
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod2ISession();
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod3ISession();
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod4ISession();
//</generated-interface>
}

View file

@ -1,47 +0,0 @@
// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by jni4net. See http://jni4net.sourceforge.net/
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
package org.virtualbox_6_1;
import virtualcomputerwindows.Exports;
@net.sf.jni4net.attributes.ClrInterface
public interface ISessionStateChangedEvent extends IMachineEvent, IEvent {
//<generated-interface>
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/VBoxEventType;")
org.virtualbox_6_1_FixIt.VBoxEventType getType_FixIt();
default VBoxEventType getType() {
return VBoxEventType.values()[Exports.convertEnum(getType_FixIt())];
}
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/IEventSource;")
IEventSource getSource();
@net.sf.jni4net.attributes.ClrMethod("()I")
int getWaitable();
@net.sf.jni4net.attributes.ClrMethod("()V")
void setProcessed();
@net.sf.jni4net.attributes.ClrMethod("(I)I")
int waitProcessed(int aTimeout);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getMachineId();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/SessionState;")
org.virtualbox_6_1_FixIt.SessionState getState_FixIt();
default SessionState getState() {
return SessionState.values()[Exports.convertEnum(getState_FixIt())];
}
//</generated-interface>
}

View file

@ -1,45 +0,0 @@
// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by jni4net. See http://jni4net.sourceforge.net/
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
package org.virtualbox_6_1;
import lombok.var;
import virtualcomputerwindows.Exports;
@net.sf.jni4net.attributes.ClrInterface
public interface IStateChangedEvent extends IEvent {
//<generated-interface>
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/VBoxEventType;")
org.virtualbox_6_1_FixIt.VBoxEventType getType_FixIt();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/IEventSource;")
IEventSource getSource();
@net.sf.jni4net.attributes.ClrMethod("()I")
int getWaitable();
@net.sf.jni4net.attributes.ClrMethod("()V")
void setProcessed();
@net.sf.jni4net.attributes.ClrMethod("(I)I")
int waitProcessed(int aTimeout);
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/MachineState;")
org.virtualbox_6_1_FixIt.MachineState getState_FixIt();
default MachineState getState() {
int state = Exports.convertEnum(getState_FixIt());
for (var value : MachineState.values())
if (value.value() == state)
return value;
return null;
}
//</generated-interface>
}

View file

@ -1,255 +0,0 @@
// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by jni4net. See http://jni4net.sourceforge.net/
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
package org.virtualbox_6_1;
import lombok.var;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@net.sf.jni4net.attributes.ClrInterface
public interface IVirtualBox {
//<generated-interface>
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getVersion();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getVersionNormalized();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getRevision();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getPackageType();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getAPIVersion();
@net.sf.jni4net.attributes.ClrMethod("()J")
long getAPIRevision();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getHomeFolder();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/String;")
String getSettingsFilePath();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/IHost;")
IHost getHost();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/ISystemProperties;")
ISystemProperties getSystemProperties();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/Array;")
system.Array getMachines_FixIt();
default List<IMachine> getMachines() {
var list = new ArrayList<IMachine>();
var arr = getMachines_FixIt();
for (int i = 0; i < arr.getLength(); i++)
list.add((IMachine) arr.getItem(i));
return Collections.unmodifiableList(list);
}
@net.sf.jni4net.attributes.ClrMethod("()LSystem/Array;")
system.Array getMachineGroups_FixIt();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/Array;")
system.Array getHardDisks_FixIt();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/Array;")
system.Array getDVDImages_FixIt();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/Array;")
system.Array getFloppyImages_FixIt();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/Array;")
system.Array getProgressOperations_FixIt();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/Array;")
system.Array getGuestOSTypes_FixIt();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/Array;")
system.Array getSharedFolders_FixIt();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/IPerformanceCollector;")
IPerformanceCollector getPerformanceCollector();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/Array;")
system.Array getDHCPServers_FixIt();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/Array;")
system.Array getNATNetworks_FixIt();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/IEventSource;")
IEventSource getEventSource();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/IExtPackManager;")
IExtPackManager getExtensionPackManager();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/Array;")
system.Array getInternalNetworks_FixIt();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/Array;")
system.Array getGenericNetworkDrivers_FixIt();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/Array;")
system.Array getCloudNetworks_FixIt();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/ICloudProviderManager;")
ICloudProviderManager getCloudProviderManager();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute1IVirtualBox();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute2IVirtualBox();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute3IVirtualBox();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute4IVirtualBox();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute5IVirtualBox();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute6IVirtualBox();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute7IVirtualBox();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute8IVirtualBox();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute9IVirtualBox();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute10IVirtualBox();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute11IVirtualBox();
@net.sf.jni4net.attributes.ClrMethod("()LSystem/UInt32;")
int getInternalAndReservedAttribute12IVirtualBox();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;LSystem/String;LSystem/String;LSystem/String;)LSystem/String;")
String composeMachineFilename(String aName, String aGroup, String aCreateFlags, String aBaseFolder);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;LSystem/String;LSystem/Array;LSystem/String;LSystem/String;)Lorg/virtualbox_6_1/IMachine;")
IMachine createMachine_FixIt(String aSettingsFile, String aName, system.Array aGroups, String aOSTypeId, String aFlags);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)Lorg/virtualbox_6_1/IMachine;")
IMachine openMachine(String aSettingsFile);
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/IMachine;)V")
void registerMachine(IMachine aMachine);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)Lorg/virtualbox_6_1/IMachine;")
IMachine findMachine(String aNameOrId);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/Array;)LSystem/Array;")
system.Array getMachinesByGroups_FixIt(system.Array aGroups);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/Array;)LSystem/Array;")
system.Array getMachineStates_FixIt(system.Array aMachines);
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/IAppliance;")
IAppliance createAppliance();
@net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/IUnattended;")
IUnattended createUnattendedInstaller();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;LSystem/String;Lorg/virtualbox_6_1_FixIt/AccessMode;Lorg/virtualbox_6_1/DeviceType;)Lorg/virtualbox_6_1/IMedium;")
IMedium createMedium_FixIt(String aFormat, String aLocation, org.virtualbox_6_1_FixIt.AccessMode aAccessMode, org.virtualbox_6_1_FixIt.DeviceType aADeviceTypeType);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;Lorg/virtualbox_6_1/DeviceType;Lorg/virtualbox_6_1_FixIt/AccessMode;I)Lorg/virtualbox_6_1/IMedium;")
IMedium openMedium_FixIt(String aLocation, org.virtualbox_6_1_FixIt.DeviceType aDeviceType, org.virtualbox_6_1_FixIt.AccessMode aAccessMode, int aForceNewUuid);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)Lorg/virtualbox_6_1/IGuestOSType;")
IGuestOSType getGuestOSType(String aId);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;LSystem/String;IILSystem/String;)V")
void createSharedFolder(String aName, String aHostPath, int aWritable, int aAutoMount, String aAutoMountPoint);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)V")
void removeSharedFolder(String aName);
@net.sf.jni4net.attributes.ClrMethod("()LSystem/Array;")
system.Array getExtraDataKeys_FixIt();
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)LSystem/String;")
String getExtraData(String aKey);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;LSystem/String;)V")
void setExtraData(String aKey, String aValue);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)V")
void setSettingsSecret(String aPassword);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)Lorg/virtualbox_6_1/IDHCPServer;")
IDHCPServer createDHCPServer(String aName);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)Lorg/virtualbox_6_1/IDHCPServer;")
IDHCPServer findDHCPServerByNetworkName(String aName);
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/IDHCPServer;)V")
void removeDHCPServer(IDHCPServer aServer);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)Lorg/virtualbox_6_1/INATNetwork;")
INATNetwork createNATNetwork(String aNetworkName);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)Lorg/virtualbox_6_1/INATNetwork;")
INATNetwork findNATNetworkByName(String aNetworkName);
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/INATNetwork;)V")
void removeNATNetwork(INATNetwork aNetwork);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)Lorg/virtualbox_6_1/ICloudNetwork;")
ICloudNetwork createCloudNetwork(String aNetworkName);
@net.sf.jni4net.attributes.ClrMethod("(LSystem/String;)Lorg/virtualbox_6_1/ICloudNetwork;")
ICloudNetwork findCloudNetworkByName(String aNetworkName);
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/ICloudNetwork;)V")
void removeCloudNetwork(ICloudNetwork aNetwork);
@net.sf.jni4net.attributes.ClrMethod("(Lorg/virtualbox_6_1/FirmwareType;LSystem/String;LSystem/String;LSystem/String;)I")
int checkFirmwarePresent_FixIt(org.virtualbox_6_1_FixIt.FirmwareType aFirmwareType, String aVersion, net.sf.jni4net.Out<String> aUrl, net.sf.jni4net.Out<String> aFile);
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod1IVirtualBox();
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod2IVirtualBox();
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod3IVirtualBox();
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod4IVirtualBox();
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod5IVirtualBox();
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod6IVirtualBox();
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod7IVirtualBox();
@net.sf.jni4net.attributes.ClrMethod("()V")
void internalAndReservedMethod8IVirtualBox();
//</generated-interface>
}

View file

@ -1,8 +0,0 @@
package org.virtualbox_6_1;
public enum LockType {
Null,
Shared,
Write,
VM,
}

View file

@ -1,40 +0,0 @@
package org.virtualbox_6_1;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public enum MachineState {
Null(0),
PoweredOff(1),
Saved(2),
Teleported(3),
Aborted(4),
FirstOnline(5),
Running(5),
Paused(6),
Stuck(7),
FirstTransient(8),
Teleporting(8),
LiveSnapshotting(9),
Starting(10), // 0x0000000A
Stopping(11), // 0x0000000B
Saving(12), // 0x0000000C
Restoring(13), // 0x0000000D
TeleportingPausedVM(14), // 0x0000000E
TeleportingIn(15), // 0x0000000F
DeletingSnapshotOnline(16), // 0x00000010
DeletingSnapshotPaused(17), // 0x00000011
LastOnline(18), // 0x00000012
OnlineSnapshotting(18), // 0x00000012
RestoringSnapshot(19), // 0x00000013
DeletingSnapshot(20), // 0x00000014
SettingUp(21), // 0x00000015
LastTransient(22), // 0x00000016
Snapshotting(22); // 0x00000016
private final int value;
public int value() {
return value;
}
}

View file

@ -1,21 +0,0 @@
package org.virtualbox_6_1;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public enum MouseButtonState {
LeftButton(1),
RightButton(2),
MiddleButton(4),
WheelUp(8),
WheelDown(16),
XButton1(32),
XButton2(64),
MouseStateMask(127);
private final int value;
public int value() {
return value;
}
}

View file

@ -1,9 +0,0 @@
package org.virtualbox_6_1;
public enum SessionState {
Null,
Unlocked,
Locked,
Spawning,
Unlocking,
}

View file

@ -1,8 +0,0 @@
package org.virtualbox_6_1;
public enum SessionType {
Null,
WriteLock,
Remote,
Shared,
}

View file

@ -1,94 +0,0 @@
package org.virtualbox_6_1;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public enum VBoxEventType {
Invalid(0),
Any(1),
Vetoable(2),
MachineEvent(3),
SnapshotEvent(4),
InputEvent(5),
LastWildcard(31), // 0x0000001F
OnMachineStateChanged(32), // 0x00000020
OnMachineDataChanged(33), // 0x00000021
OnExtraDataChanged(34), // 0x00000022
OnExtraDataCanChange(35), // 0x00000023
OnMediumRegistered(36), // 0x00000024
OnMachineRegistered(37), // 0x00000025
OnSessionStateChanged(38), // 0x00000026
OnSnapshotTaken(39), // 0x00000027
OnSnapshotDeleted(40), // 0x00000028
OnSnapshotChanged(41), // 0x00000029
OnGuestPropertyChanged(42), // 0x0000002A
OnMousePointerShapeChanged(43), // 0x0000002B
OnMouseCapabilityChanged(44), // 0x0000002C
OnKeyboardLedsChanged(45), // 0x0000002D
OnStateChanged(46), // 0x0000002E
OnAdditionsStateChanged(47), // 0x0000002F
OnNetworkAdapterChanged(48), // 0x00000030
OnSerialPortChanged(49), // 0x00000031
OnParallelPortChanged(50), // 0x00000032
OnStorageControllerChanged(51), // 0x00000033
OnMediumChanged(52), // 0x00000034
OnVRDEServerChanged(53), // 0x00000035
OnUSBControllerChanged(54), // 0x00000036
OnUSBDeviceStateChanged(55), // 0x00000037
OnSharedFolderChanged(56), // 0x00000038
OnRuntimeError(57), // 0x00000039
OnCanShowWindow(58), // 0x0000003A
OnShowWindow(59), // 0x0000003B
OnCPUChanged(60), // 0x0000003C
OnVRDEServerInfoChanged(61), // 0x0000003D
OnEventSourceChanged(62), // 0x0000003E
OnCPUExecutionCapChanged(63), // 0x0000003F
OnGuestKeyboard(64), // 0x00000040
OnGuestMouse(65), // 0x00000041
OnNATRedirect(66), // 0x00000042
OnHostPCIDevicePlug(67), // 0x00000043
OnVBoxSVCAvailabilityChanged(68), // 0x00000044
OnBandwidthGroupChanged(69), // 0x00000045
OnGuestMonitorChanged(70), // 0x00000046
OnStorageDeviceChanged(71), // 0x00000047
OnClipboardModeChanged(72), // 0x00000048
OnDnDModeChanged(73), // 0x00000049
OnNATNetworkChanged(74), // 0x0000004A
OnNATNetworkStartStop(75), // 0x0000004B
OnNATNetworkAlter(76), // 0x0000004C
OnNATNetworkCreationDeletion(77), // 0x0000004D
OnNATNetworkSetting(78), // 0x0000004E
OnNATNetworkPortForward(79), // 0x0000004F
OnGuestSessionStateChanged(80), // 0x00000050
OnGuestSessionRegistered(81), // 0x00000051
OnGuestProcessRegistered(82), // 0x00000052
OnGuestProcessStateChanged(83), // 0x00000053
OnGuestProcessInputNotify(84), // 0x00000054
OnGuestProcessOutput(85), // 0x00000055
OnGuestFileRegistered(86), // 0x00000056
OnGuestFileStateChanged(87), // 0x00000057
OnGuestFileOffsetChanged(88), // 0x00000058
OnGuestFileRead(89), // 0x00000059
OnGuestFileWrite(90), // 0x0000005A
OnRecordingChanged(91), // 0x0000005B
OnGuestUserStateChanged(92), // 0x0000005C
OnGuestMultiTouch(93), // 0x0000005D
OnHostNameResolutionConfigurationChange(94), // 0x0000005E
OnSnapshotRestored(95), // 0x0000005F
OnMediumConfigChanged(96), // 0x00000060
OnAudioAdapterChanged(97), // 0x00000061
OnProgressPercentageChanged(98), // 0x00000062
OnProgressTaskCompleted(99), // 0x00000063
OnCursorPositionChanged(100), // 0x00000064
OnGuestAdditionsStatusChanged(101), // 0x00000065
OnGuestMonitorInfoChanged(102), // 0x00000066
OnGuestFileSizeChanged(103), // 0x00000067
OnClipboardFileTransferModeChanged(104), // 0x00000068
Last(105); // 0x00000069
private final int value;
public final int value() {
return value;
}
}

View file

@ -1,10 +0,0 @@
package org.virtualbox_6_1;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
@Getter
@RequiredArgsConstructor
public class VBoxException extends RuntimeException {
private final long resultCode;
}

View file

@ -1,23 +0,0 @@
package org.virtualbox_6_1;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public class VirtualBoxManager {
private static VirtualBoxManager instance;
private final String path;
private final IVirtualBox vbox = new VirtualBoxClass();
private final ISession session = new SessionClass();
public static VirtualBoxManager createInstance(String path) {
return instance = new VirtualBoxManager(path);
}
public IVirtualBox getVBox() {
return vbox;
}
public ISession getSessionObject() {
return session;
}
}

View file

@ -1,102 +0,0 @@
package sznp.virtualcomputer;
import lombok.RequiredArgsConstructor;
import net.sf.jni4net.Ref;
import org.virtualbox_6_1.IFramebuffer;
import org.virtualbox_6_1.IFramebufferOverlay;
import org.virtualbox_6_1_FixIt.BitmapFormat;
import system.Array;
import system.Enum;
import sznp.virtualcomputer.util.IMCFrameBuffer;
import virtualcomputerwindows.Exports;
import java.util.Arrays;
@RequiredArgsConstructor
public class COMFrameBuffer implements IFramebuffer {
private final IMCFrameBuffer frameBuffer;
public int getBitsPerPixel() {
return 32;
}
public int getBytesPerLine() {
return 640;
}
public Array getCapabilities_FixIt() {
try {
System.out.println("Capabilities queried");
//return new long[]{FramebufferCapabilities.UpdateImage.value()};
return Array.CreateInstance(system.Type.GetType("System.Int32"), 0);
} catch (Exception e) {
e.printStackTrace();
return Array.CreateInstance(system.Type.GetType("System.Int32"), 0);
}
}
public int getHeight() {
return 480;
}
public int getHeightReduction() {
return 0;
}
public IFramebufferOverlay getOverlay() {
return null;
}
public BitmapFormat getPixelFormat_FixIt() {
Enum.ToObject(BitmapFormat.typeof(), org.virtualbox_6_1.BitmapFormat.BGRA.getValue());
return null;
}
public int getVisibleRegion(Ref<Byte> arg0, int arg1) {
return 0;
}
public int getWidth() {
return 640;
}
public long getWinId() {
return 0; // Zero means no win id
}
public void notify3DEvent_FixIt(int type, Array data) {
System.out.println("3D event! " + type + " - " + Arrays.toString(Exports.convertArrayByte_FixIt(data)));
}
public void notifyChange(int screenId, int xOrigin, int yOrigin, int width, int height) {
frameBuffer.notifyChange(screenId, xOrigin, yOrigin, width, height);
}
public void notifyUpdate(int x, int y, int width, int height) {
frameBuffer.notifyUpdate(x, y, width, height);
}
public void notifyUpdateImage_FixIt(int arg0, int arg1, int arg2, int arg3, Array arg4) {
frameBuffer.notifyUpdateImage(arg0, arg1, arg2, arg3, Exports.convertArrayByte_FixIt(arg4));
}
public void setVisibleRegion(Ref<Byte> arg0, int arg1) {
}
/**
* Posts a Video HW Acceleration Command to the frame buffer for processing.<br />
* <br />
* The commands used for 2D video acceleration (DDraw surface creation/destroying, blitting, scaling, color conversion, overlaying, etc.) are posted from quest to the host to be processed by the host hardware.
*
* @param command Pointer to VBOXVHWACMD containing the command to execute.
* @param enmCmd The validated VBOXVHWACMD::enmCmd value from the command.
* @param fromGuest Set when the command origins from the guest, clear if host.
*/ //https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp#L4645
public void processVHWACommand(Ref<Byte> command, int enmCmd, int fromGuest) {
}
public int videoModeSupported(int arg0, int arg1, int arg2) {
return 1;
}
}

View file

@ -1,33 +0,0 @@
package sznp.virtualcomputer;
import org.virtualbox_6_1.IEvent;
import org.virtualbox_6_1.IEventListener;
import sznp.virtualcomputer.util.IEventHandler;
/**
* A Bukkit-like event system which calls the appropriate methods on an event.
*/
public final class EventHandler implements IEventListener {
private final IEventHandler handler;
private boolean enabled = true;
/**
* New MSCOM event handler.
*
* @param handler The handle method that handles what needs to be handled
*/
public EventHandler(IEventHandler handler) {
this.handler = handler;
}
@Override
public final void handleEvent(IEvent iEvent) {
if (!enabled)
return;
handler.handleEvent(iEvent);
}
public void disable() {
enabled = false;
}
}

View file

@ -1,47 +1,40 @@
package sznp.virtualcomputer.util;
import com.jacob.com.Dispatch;
import lombok.SneakyThrows;
import lombok.val;
import net.sf.jni4net.Out;
import lombok.var;
import org.virtualbox_6_1.*;
import sznp.virtualcomputer.COMFrameBuffer;
import sznp.virtualcomputer.EventHandler;
import virtualcomputerwindows.Exports;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
public final class COMUtils {
private COMUtils() {
}
//public static void registerListener(IEventSource source, IEventListener listener, VBoxEventType... types) {
public static IEventListener registerListener(IEventSource source, IEventHandler listener, List<VBoxEventType> types) {
//new DispatchEvents(source.getTypedWrapped(), listener);
val ret = new EventHandler(listener);
/*com.jacob.activeX.ActiveXComponent.createNewInstance("IEventListener");
new ActiveXComponent("");
source.registerListener(ret, types, true);*/
//registerListener(source, new EventHandler(listener), types, true);
System.out.println("Testing listener...");
ret.handleEvent(null);
System.out.println("Tested");
long handler = Exports.GetEventHandler(listener);
var dp = new Dispatch();
dp.m_pDispatch = handler;
var ret = new IEventListener(dp);
source.registerListener(ret, types, true);
return ret;
//return null;
}
@SuppressWarnings("unchecked")
@SneakyThrows
public static <T extends IEvent> T getEvent(IEvent event, Class<T> cl) {
//val method = cl.getMethod("queryInterface", IUnknown.class);
//return (T) method.invoke(null, event);
return null; //TODO
return cl.getConstructor(Dispatch.class).newInstance(event.getTypedWrapped());
}
public static IFramebuffer gimmeAFramebuffer(IMCFrameBuffer frameBuffer) {
return new COMFrameBuffer(frameBuffer);
var dp = new Dispatch();
dp.m_pDispatch = Exports.GetFrameBuffer(frameBuffer);
return new IFramebuffer(dp);
}
public static void queryBitmapInfo(IDisplaySourceBitmap bitmap, long[] ptr, long[] w, long[] h, long[] bpp, long[] bpl, long[] pf) {
Out<Integer> wo = new Out<>(), ho = new Out<>(), bppo = new Out<>(), bplo = new Out<>();
/*Out<Integer> wo = new Out<>(), ho = new Out<>(), bppo = new Out<>(), bplo = new Out<>();
val pfo = new Out<org.virtualbox_6_1_FixIt.BitmapFormat>();
val ptro = new Out<Long>();
bitmap.queryBitmapInfo(ptro, wo, ho, bppo, bplo, pfo);
@ -50,24 +43,10 @@ public final class COMUtils {
h[0] = ho.getValue();
bpp[0] = bppo.getValue();
bpl[0] = bplo.getValue();
pf[0] = Exports.convertEnum(pfo.getValue());
pf[0] = Exports.convertEnum(pfo.getValue());*/
}
public static void querySourceBitmap(IDisplay display, Holder<IDisplaySourceBitmap> holder) {
val out = new Out<IDisplaySourceBitmap>();
display.querySourceBitmap(0, out);
holder.value = out.getValue();
}
public static boolean convertToBool(int bool) {
return bool != 0;
}
public static int convertFromBool(boolean bool) {
return bool ? 1 : 0;
}
public static int convertFromLong(long l) {
return (int) l;
display.querySourceBitmap(0L, holder);
}
}

View file

@ -1,7 +1,16 @@
package sznp.virtualcomputer.util;
import com.jacob.com.Dispatch;
import lombok.var;
import org.virtualbox_6_1.IEvent;
public interface IEventHandler {
public interface IEventHandler extends virtualcomputerwindows.IEventHandler {
void handleEvent(IEvent iEvent);
@Override
default void handleEvent(long l) {
var dp = new Dispatch();
dp.m_pDispatch = l;
handleEvent(new IEvent(dp));
}
}

View file

@ -1,6 +1,6 @@
package sznp.virtualcomputer.util;
public interface IMCFrameBuffer {
public interface IMCFrameBuffer extends virtualcomputerwindows.IMCFrameBuffer {
void notifyUpdate(long x, long y, long width, long height);
void notifyUpdateImage(long x, long y, long width, long height, byte[] image);

View file

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VirtualComputerWindows
{
public class EventHandler
{
private readonly IEventHandler handler;
private bool enabled = true;
/**
* New MSCOM event handler.
*
* @param handler The handle method that handles what needs to be handled
*/
public EventHandler(IEventHandler handler)
{
this.handler = handler;
}
public void handleEvent(long iEvent)
{
if (!enabled)
return;
handler.handleEvent(iEvent);
}
public void disable()
{
enabled = false;
}
}
}

View file

@ -25,8 +25,8 @@ namespace VirtualComputerWindows
//TODO: Only finds the VBoxVMM.dll when placed in the VirtualBox dir (regardless of working dir)
//Even then there are hardening issues: VERR_SUPDRV_NOT_BUDDING_VM_PROCESS_1
//https://www.virtualbox.org/svn/vbox/trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
vbc = new VirtualBoxClientClass();
var vbox = vbc.VirtualBox;
vbc = new VirtualBoxClientClass(); //GetObjectFromIUnknown
/*var vbox = vbc.VirtualBox;
//RTR3InitExe(0, "", 0);
var ses = vbc.Session;
var machine = vbox.Machines.GetValue(0) as IMachine;
@ -37,44 +37,32 @@ namespace VirtualComputerWindows
Console.WriteLine("Locked");
machine = ses.Machine;
Console.WriteLine("Powering up...");
ses.Console.PowerUp().WaitForCompletion(10000);
ses.Console.PowerUp().WaitForCompletion(10000);*/
}
catch(Exception e)
{
Console.WriteLine(e);
Console.ReadLine();
//Console.ReadLine();
}
}
public static void Main()
private static void Main()
{
Init();
Console.ReadLine();
}
public static int[] ConvertArrayInt(Array array)
public static long GetFrameBuffer(IMCFrameBuffer framebuffer)
{
return (int[]) array;
var fb = new WinFrameBuffer(framebuffer);
return (long) Marshal.GetIDispatchForObject(fb);
}
public static byte[] ConvertArrayByte(Array array)
public static long GetEventHandler(IEventHandler handler)
{
return (byte[]) array;
}
public static uint[] ConvertArrayUint(Array array)
{
return (uint[]) array;
}
public static Array ConvertArray(int[] array)
{
return array;
}
public static int ConvertEnum(object someEnum)
{
return (int) someEnum;
var han = new EventHandler(handler);
return (long) Marshal.GetIDispatchForObject(han);
}
}
}

View file

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VirtualComputerWindows
{
public interface IEventHandler
{
void handleEvent(long iEvent);
}
}

View file

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VirtualComputerWindows
{
public interface IMCFrameBuffer
{
void notifyUpdate(long x, long y, long width, long height);
void notifyUpdateImage(long x, long y, long width, long height, byte[] image);
void notifyChange(long screenId, long xOrigin, long yOrigin, long width, long height);
}
}

View file

@ -91,8 +91,12 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="EventHandler.cs" />
<Compile Include="Exports.cs" />
<Compile Include="IEventHandler.cs" />
<Compile Include="IMCFrameBuffer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="WinFrameBuffer.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />

View file

@ -0,0 +1,75 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VirtualBox;
namespace VirtualComputerWindows
{
public class WinFrameBuffer : IFramebuffer
{
private IMCFrameBuffer framebuffer;
public WinFrameBuffer(IMCFrameBuffer framebuffer)
{
this.framebuffer = framebuffer;
}
public void NotifyUpdate(uint aX, uint aY, uint aWidth, uint aHeight)
{
framebuffer.notifyUpdate(aX, aY, aWidth, aHeight);
}
public void NotifyUpdateImage(uint aX, uint aY, uint aWidth, uint aHeight, Array aImage)
{
framebuffer.notifyUpdateImage(aX, aY, aWidth, aHeight, (byte[])aImage);
}
public void NotifyChange(uint aScreenId, uint aXOrigin, uint aYOrigin, uint aWidth, uint aHeight)
{
framebuffer.notifyChange(aScreenId, aXOrigin, aYOrigin, aWidth, aHeight);
}
public int VideoModeSupported(uint aWidth, uint aHeight, uint aBpp)
{
return 1;
}
public uint GetVisibleRegion(ref byte aRectangles, uint aCount)
{
return 0;
}
public void SetVisibleRegion(ref byte aRectangles, uint aCount)
{
}
public void ProcessVHWACommand(ref byte aCommand, int aEnmCmd, int aFromGuest)
{
Console.WriteLine("VHWA command! " + aCommand);
}
public void Notify3DEvent(uint aType, Array aData)
{
Console.WriteLine("3D event! " + aType);
}
public uint Width => 640;
public uint Height => 480;
public uint BitsPerPixel => 32;
public uint BytesPerLine => 640;
public BitmapFormat PixelFormat => BitmapFormat.BitmapFormat_BGRA;
public uint HeightReduction => 0;
public IFramebufferOverlay Overlay => null;
public long WinId => 0;
public Array Capabilities => new[] { FramebufferCapabilities.FramebufferCapabilities_RenderCursor, FramebufferCapabilities.FramebufferCapabilities_UpdateImage };
}
}

Binary file not shown.

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>net.sf.jni4net</groupId>
<artifactId>clr</artifactId>
<version>0.8.8.0</version>
<description>POM was created from install:install-file</description>
</project>

View file

@ -3,10 +3,11 @@
<groupId>net.sf.jni4net</groupId>
<artifactId>clr</artifactId>
<versioning>
<release>0.8.9.0</release>
<release>0.8.8.0</release>
<versions>
<version>0.8.9.0</version>
<version>0.8.8.0</version>
</versions>
<lastUpdated>20201121164514</lastUpdated>
<lastUpdated>20201122015638</lastUpdated>
</versioning>
</metadata>