diff --git a/VirtualComputer-Core/pom.xml b/VirtualComputer-Core/pom.xml index 8d77754..c0c01c1 100644 --- a/VirtualComputer-Core/pom.xml +++ b/VirtualComputer-Core/pom.xml @@ -44,19 +44,17 @@ org.virtualbox VirtualBox-MSCOM 6.1 - system - ${project.basedir}/../VirtualComputerMSCOM/src/main/resources/Interop.VirtualBox.j4n.jar com.aparapi aparapi 1.10.0 - + io.github.NorbiPeti VirtualComputer-MSCOM diff --git a/VirtualComputer-Core/src/main/java/sznp/virtualcomputer/Computer.java b/VirtualComputer-Core/src/main/java/sznp/virtualcomputer/Computer.java index c648b2c..5cf8b6e 100644 --- a/VirtualComputer-Core/src/main/java/sznp/virtualcomputer/Computer.java +++ b/VirtualComputer-Core/src/main/java/sznp/virtualcomputer/Computer.java @@ -101,8 +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(0L, - COMUtils.gimmeAFramebuffer(fb)); + String fbid = console.getDisplay().attachFramebuffer(0, COMUtils.gimmeAFramebuffer(fb)); fb.setId(fbid); framebuffer = fb; } @@ -171,13 +170,14 @@ public final class Computer { return; } val lastUpdated = new Holder(); - var status = session.getConsole().getGuest().getFacilityStatus(AdditionsFacilityType.Seamless, lastUpdated); - sendMessage(sender, "Seamless status: " + status); sendMessage(sender, "§eFixing screen..."); try { synchronized (session) { if (seamless == null) - session.getConsole().getDisplay().setVideoModeHint(0L, true, false, 0, 0, 640L, 480L, 32L, false); + 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)); } //Last param: notify - send PnP notification - stops updates but not changes for some reason Bukkit.getScheduler().runTaskLaterAsynchronously(PluginMain.Instance, () -> { synchronized (session) { @@ -190,8 +190,6 @@ public final class Computer { } catch (Exception e) { e.printStackTrace(); } - status = session.getConsole().getGuest().getFacilityStatus(AdditionsFacilityType.Seamless, lastUpdated); - sendMessage(sender, "Seamless status: " + status); } public boolean checkMachineNotRunning(@Nullable CommandSender sender) { diff --git a/VirtualComputer-Core/src/main/java/sznp/virtualcomputer/events/MachineEventHandler.java b/VirtualComputer-Core/src/main/java/sznp/virtualcomputer/events/MachineEventHandler.java index fb4e893..f37dc8e 100644 --- a/VirtualComputer-Core/src/main/java/sznp/virtualcomputer/events/MachineEventHandler.java +++ b/VirtualComputer-Core/src/main/java/sznp/virtualcomputer/events/MachineEventHandler.java @@ -11,6 +11,7 @@ import org.virtualbox_6_1.IStateChangedEvent; import org.virtualbox_6_1.VBoxEventType; import sznp.virtualcomputer.Computer; import sznp.virtualcomputer.PluginMain; +import sznp.virtualcomputer.util.COMUtils; import java.util.logging.Logger; @@ -42,7 +43,7 @@ public class MachineEventHandler extends EventHandlerBase { starting = false; Bukkit.getScheduler().runTaskAsynchronously(PluginMain.Instance, () -> { progress.waitForCompletion(-1); - if (progress != null && progress.getCompleted() && progress.getResultCode() != 0) { + if (progress != null && COMUtils.convertToBool(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()) { diff --git a/VirtualComputer-Core/src/main/java/sznp/virtualcomputer/renderer/MCFrameBuffer.java b/VirtualComputer-Core/src/main/java/sznp/virtualcomputer/renderer/MCFrameBuffer.java index 61d8a40..f456a01 100644 --- a/VirtualComputer-Core/src/main/java/sznp/virtualcomputer/renderer/MCFrameBuffer.java +++ b/VirtualComputer-Core/src/main/java/sznp/virtualcomputer/renderer/MCFrameBuffer.java @@ -39,7 +39,7 @@ public class MCFrameBuffer implements IMCFrameBuffer { synchronized (this) { //If a change occurs twice, then wait for it try { //System.out.println("Change: " + xOrigin + " " + yOrigin + " - " + width + " " + height); - display.querySourceBitmap(0L, holder); + COMUtils.querySourceBitmap(display, holder); long[] ptr = new long[1], w = new long[1], h = new long[1], bpp = new long[1], bpl = new long[1], pf = new long[1]; COMUtils.queryBitmapInfo(holder.value, ptr, w, h, bpp, bpl, pf); if (PluginMain.direct) { diff --git a/VirtualComputerMSCOM/pom.xml b/VirtualComputerMSCOM/pom.xml index 8327136..82cf1ee 100644 --- a/VirtualComputerMSCOM/pom.xml +++ b/VirtualComputerMSCOM/pom.xml @@ -20,8 +20,6 @@ 6.1 true - system - ${project.basedir}/src/main/resources/Interop.VirtualBox.j4n.jar net.sf.jni4net diff --git a/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/BitmapFormat.java b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/BitmapFormat.java new file mode 100644 index 0000000..8795e71 --- /dev/null +++ b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/BitmapFormat.java @@ -0,0 +1,18 @@ +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; +} diff --git a/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/Holder.java b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/Holder.java new file mode 100644 index 0000000..711806e --- /dev/null +++ b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/Holder.java @@ -0,0 +1,5 @@ +package org.virtualbox_6_1; + +public class Holder { + public T value; +} diff --git a/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/IEvent.java b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/IEvent.java new file mode 100644 index 0000000..936b23f --- /dev/null +++ b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/IEvent.java @@ -0,0 +1,42 @@ +// ------------------------------------------------------------------------------ +// +// 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. +// +// ------------------------------------------------------------------------------ + +package org.virtualbox_6_1; + +import lombok.var; +import virtualcomputerwindows.Exports; + +@net.sf.jni4net.attributes.ClrInterface +public interface IEvent { + + // + @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); + // +} diff --git a/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/IKeyboard.java b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/IKeyboard.java new file mode 100644 index 0000000..b10a97c --- /dev/null +++ b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/IKeyboard.java @@ -0,0 +1,74 @@ +// ------------------------------------------------------------------------------ +// +// 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. +// +// ------------------------------------------------------------------------------ + +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 { + + // + @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 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(); + // +} diff --git a/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/IMachine.java b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/IMachine.java new file mode 100644 index 0000000..36e85a2 --- /dev/null +++ b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/IMachine.java @@ -0,0 +1,699 @@ +// ------------------------------------------------------------------------------ +// +// 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. +// +// ------------------------------------------------------------------------------ + +package org.virtualbox_6_1; + +import lombok.var; +import virtualcomputerwindows.Exports; + +@net.sf.jni4net.attributes.ClrInterface +public interface IMachine { + + // + @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 aIdx, net.sf.jni4net.Out aIdxSub, net.sf.jni4net.Out aValEax, net.sf.jni4net.Out aValEbx, net.sf.jni4net.Out aValEcx, net.sf.jni4net.Out 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 aValEax, net.sf.jni4net.Out aValEbx, net.sf.jni4net.Out aValEcx, net.sf.jni4net.Out 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 aValue, net.sf.jni4net.Out aTimeStamp, net.sf.jni4net.Out 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 aNames, net.sf.jni4net.Out aValues, net.sf.jni4net.Out aTimestamps, net.sf.jni4net.Out 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 aOriginX, net.sf.jni4net.Out aOriginY, net.sf.jni4net.Out aWidth, net.sf.jni4net.Out aHeight, net.sf.jni4net.Out 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 aWidth, net.sf.jni4net.Out aHeight); + + @net.sf.jni4net.attributes.ClrMethod("(LSystem/UInt32;LSystem/UInt32;LSystem/UInt32;)LSystem/Array;") + system.Array querySavedScreenshotInfo_FixIt(int aScreenId, net.sf.jni4net.Out aWidth, net.sf.jni4net.Out 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 aWidth, net.sf.jni4net.Out 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 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(); + // +} diff --git a/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/ISession.java b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/ISession.java index 78c0bb4..e1d42c9 100644 --- a/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/ISession.java +++ b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/ISession.java @@ -9,19 +9,25 @@ package org.virtualbox_6_1; +import virtualcomputerwindows.Exports; + @net.sf.jni4net.attributes.ClrInterface public interface ISession { // @net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/SessionState;") - org.virtualbox_6_1.SessionState getState_FixIt(); + org.virtualbox_6_1_FixIt.SessionState getState_FixIt(); default org.virtualbox_6_1.SessionState getState() { - return SessionState.Locked; + return SessionState.values()[Exports.convertEnum(getState_FixIt())]; } @net.sf.jni4net.attributes.ClrMethod("()Lorg/virtualbox_6_1/SessionType;") - org.virtualbox_6_1.SessionType getType_FixIt(); + 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(); diff --git a/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/ISessionStateChangedEvent.java b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/ISessionStateChangedEvent.java new file mode 100644 index 0000000..8cb8c8a --- /dev/null +++ b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/ISessionStateChangedEvent.java @@ -0,0 +1,47 @@ +// ------------------------------------------------------------------------------ +// +// 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. +// +// ------------------------------------------------------------------------------ + +package org.virtualbox_6_1; + +import virtualcomputerwindows.Exports; + +@net.sf.jni4net.attributes.ClrInterface +public interface ISessionStateChangedEvent extends IMachineEvent, IEvent { + + // + @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())]; + } + // +} diff --git a/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/IStateChangedEvent.java b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/IStateChangedEvent.java new file mode 100644 index 0000000..41715b5 --- /dev/null +++ b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/IStateChangedEvent.java @@ -0,0 +1,45 @@ +// ------------------------------------------------------------------------------ +// +// 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. +// +// ------------------------------------------------------------------------------ + +package org.virtualbox_6_1; + +import lombok.var; +import virtualcomputerwindows.Exports; + +@net.sf.jni4net.attributes.ClrInterface +public interface IStateChangedEvent extends IEvent { + + // + @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; + } + // +} diff --git a/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/IVirtualBox.java b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/IVirtualBox.java new file mode 100644 index 0000000..a87681c --- /dev/null +++ b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/IVirtualBox.java @@ -0,0 +1,255 @@ +// ------------------------------------------------------------------------------ +// +// 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. +// +// ------------------------------------------------------------------------------ + +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 { + + // + @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 getMachines() { + var list = new ArrayList(); + 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/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/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 aUrl, net.sf.jni4net.Out 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(); + // +} diff --git a/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/LockType.java b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/LockType.java new file mode 100644 index 0000000..8c9880c --- /dev/null +++ b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/LockType.java @@ -0,0 +1,8 @@ +package org.virtualbox_6_1; + +public enum LockType { + Null, + Shared, + Write, + VM, +} diff --git a/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/MachineState.java b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/MachineState.java new file mode 100644 index 0000000..6d2240b --- /dev/null +++ b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/MachineState.java @@ -0,0 +1,40 @@ +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; + } +} diff --git a/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/MouseButtonState.java b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/MouseButtonState.java new file mode 100644 index 0000000..c84af0a --- /dev/null +++ b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/MouseButtonState.java @@ -0,0 +1,21 @@ +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; + } +} diff --git a/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/SessionState.java b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/SessionState.java index 2344f26..af47892 100644 --- a/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/SessionState.java +++ b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/SessionState.java @@ -1,5 +1,9 @@ package org.virtualbox_6_1; public enum SessionState { - Locked + Null, + Unlocked, + Locked, + Spawning, + Unlocking, } diff --git a/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/SessionType.java b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/SessionType.java new file mode 100644 index 0000000..13e6286 --- /dev/null +++ b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/SessionType.java @@ -0,0 +1,8 @@ +package org.virtualbox_6_1; + +public enum SessionType { + Null, + WriteLock, + Remote, + Shared, +} diff --git a/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/VBoxEventType.java b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/VBoxEventType.java new file mode 100644 index 0000000..4b14332 --- /dev/null +++ b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/VBoxEventType.java @@ -0,0 +1,94 @@ +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; + } +} diff --git a/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/VBoxException.java b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/VBoxException.java new file mode 100644 index 0000000..db5e645 --- /dev/null +++ b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/VBoxException.java @@ -0,0 +1,10 @@ +package org.virtualbox_6_1; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@Getter +@RequiredArgsConstructor +public class VBoxException extends RuntimeException { + private final long resultCode; +} diff --git a/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/VirtualBoxManager.java b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/VirtualBoxManager.java new file mode 100644 index 0000000..dbf583c --- /dev/null +++ b/VirtualComputerMSCOM/src/main/java/org/virtualbox_6_1/VirtualBoxManager.java @@ -0,0 +1,23 @@ +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; + } +} diff --git a/VirtualComputerMSCOM/src/main/java/sznp/virtualcomputer/COMFrameBuffer.java b/VirtualComputerMSCOM/src/main/java/sznp/virtualcomputer/COMFrameBuffer.java index 6b9464e..376b3c0 100644 --- a/VirtualComputerMSCOM/src/main/java/sznp/virtualcomputer/COMFrameBuffer.java +++ b/VirtualComputerMSCOM/src/main/java/sznp/virtualcomputer/COMFrameBuffer.java @@ -2,10 +2,11 @@ package sznp.virtualcomputer; import lombok.RequiredArgsConstructor; import net.sf.jni4net.Ref; -import org.virtualbox_6_1.BitmapFormat; 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; @@ -47,7 +48,7 @@ public class COMFrameBuffer implements IFramebuffer { } public BitmapFormat getPixelFormat_FixIt() { - //return BitmapFormat.BGRA.value(); + Enum.ToObject(BitmapFormat.typeof(), org.virtualbox_6_1.BitmapFormat.BGRA.getValue()); return null; } @@ -64,7 +65,7 @@ public class COMFrameBuffer implements IFramebuffer { } public void notify3DEvent_FixIt(int type, Array data) { - System.out.println("3D event! " + type + " - " + Arrays.toString(Exports.ConvertArrayByte(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) { @@ -76,7 +77,7 @@ public class COMFrameBuffer implements IFramebuffer { } public void notifyUpdateImage_FixIt(int arg0, int arg1, int arg2, int arg3, Array arg4) { - frameBuffer.notifyUpdateImage(arg0, arg1, arg2, arg3, Exports.ConvertArrayByte(arg4)); + frameBuffer.notifyUpdateImage(arg0, arg1, arg2, arg3, Exports.convertArrayByte_FixIt(arg4)); } public void setVisibleRegion(Ref arg0, int arg1) { diff --git a/VirtualComputerMSCOM/src/main/java/sznp/virtualcomputer/util/COMUtils.java b/VirtualComputerMSCOM/src/main/java/sznp/virtualcomputer/util/COMUtils.java index 0265146..3d6bf67 100644 --- a/VirtualComputerMSCOM/src/main/java/sznp/virtualcomputer/util/COMUtils.java +++ b/VirtualComputerMSCOM/src/main/java/sznp/virtualcomputer/util/COMUtils.java @@ -42,7 +42,7 @@ public final class COMUtils { public static void queryBitmapInfo(IDisplaySourceBitmap bitmap, long[] ptr, long[] w, long[] h, long[] bpp, long[] bpl, long[] pf) { Out wo = new Out<>(), ho = new Out<>(), bppo = new Out<>(), bplo = new Out<>(); - val pfo = new Out(); + val pfo = new Out(); val ptro = new Out(); bitmap.queryBitmapInfo(ptro, wo, ho, bppo, bplo, pfo); ptr[0] = ptro.getValue(); @@ -50,6 +50,24 @@ 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 holder) { + val out = new Out(); + 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; } } diff --git a/VirtualComputerMSCOM/src/main/resources/Interop.VirtualBox.j4n.dll b/VirtualComputerMSCOM/src/main/resources/Interop.VirtualBox.j4n.dll index 2a1e3ea..dd2b3d8 100644 Binary files a/VirtualComputerMSCOM/src/main/resources/Interop.VirtualBox.j4n.dll and b/VirtualComputerMSCOM/src/main/resources/Interop.VirtualBox.j4n.dll differ diff --git a/VirtualComputerMSCOM/src/main/resources/Interop.VirtualBox.j4n.jar b/VirtualComputerMSCOM/src/main/resources/Interop.VirtualBox.j4n.jar index 4311b23..333ef16 100644 Binary files a/VirtualComputerMSCOM/src/main/resources/Interop.VirtualBox.j4n.jar and b/VirtualComputerMSCOM/src/main/resources/Interop.VirtualBox.j4n.jar differ diff --git a/VirtualComputerMSCOM/src/main/resources/VirtualComputerWindows.dll b/VirtualComputerMSCOM/src/main/resources/VirtualComputerWindows.dll index 69724e7..c1e24cf 100644 Binary files a/VirtualComputerMSCOM/src/main/resources/VirtualComputerWindows.dll and b/VirtualComputerMSCOM/src/main/resources/VirtualComputerWindows.dll differ diff --git a/VirtualComputerMSCOM/src/main/resources/VirtualComputerWindows.j4n.dll b/VirtualComputerMSCOM/src/main/resources/VirtualComputerWindows.j4n.dll index 998b4b6..e748d40 100644 Binary files a/VirtualComputerMSCOM/src/main/resources/VirtualComputerWindows.j4n.dll and b/VirtualComputerMSCOM/src/main/resources/VirtualComputerWindows.j4n.dll differ diff --git a/VirtualComputerMSCOM/src/main/resources/VirtualComputerWindows.j4n.jar b/VirtualComputerMSCOM/src/main/resources/VirtualComputerWindows.j4n.jar index 34316b2..23b0db3 100644 Binary files a/VirtualComputerMSCOM/src/main/resources/VirtualComputerWindows.j4n.jar and b/VirtualComputerMSCOM/src/main/resources/VirtualComputerWindows.j4n.jar differ diff --git a/VirtualComputerWindows/VirtualComputerWindows/Exports.cs b/VirtualComputerWindows/VirtualComputerWindows/Exports.cs index fbc6fea..940a358 100644 --- a/VirtualComputerWindows/VirtualComputerWindows/Exports.cs +++ b/VirtualComputerWindows/VirtualComputerWindows/Exports.cs @@ -67,9 +67,13 @@ namespace VirtualComputerWindows return (uint[]) array; } + public static Array ConvertArray(int[] array) + { + return array; + } + public static int ConvertEnum(object someEnum) { - BitmapFormat.BitmapFormat_RGBA; return (int) someEnum; } } diff --git a/VirtualComputerXPCOM/src/main/java/sznp/virtualcomputer/util/COMUtils.java b/VirtualComputerXPCOM/src/main/java/sznp/virtualcomputer/util/COMUtils.java index 156897b..131a6a6 100644 --- a/VirtualComputerXPCOM/src/main/java/sznp/virtualcomputer/util/COMUtils.java +++ b/VirtualComputerXPCOM/src/main/java/sznp/virtualcomputer/util/COMUtils.java @@ -10,32 +10,48 @@ import java.lang.reflect.InvocationTargetException; import java.util.List; public final class COMUtils { - private COMUtils() { - } + private COMUtils() { + } - //public static void registerListener(IEventSource source, IEventListener listener, VBoxEventType... types) { - public static org.virtualbox_6_1.IEventListener registerListener(IEventSource source, IEventHandler listener, List types) { - val ret = new org.virtualbox_6_1.IEventListener(new EventHandler(listener)); - source.registerListener(ret, types, true); - return ret; - } + //public static void registerListener(IEventSource source, IEventListener listener, VBoxEventType... types) { + public static org.virtualbox_6_1.IEventListener registerListener(IEventSource source, IEventHandler listener, List types) { + val ret = new org.virtualbox_6_1.IEventListener(new EventHandler(listener)); + source.registerListener(ret, types, true); + return ret; + } - @SuppressWarnings("unchecked") - public static T getEvent(IEvent event, Class cl) { - try { - val method = cl.getMethod("queryInterface", IUnknown.class); - return (T) method.invoke(null, event); - } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { - e.printStackTrace(); - return null; - } - } + @SuppressWarnings("unchecked") + public static T getEvent(IEvent event, Class cl) { + try { + val method = cl.getMethod("queryInterface", IUnknown.class); + return (T) method.invoke(null, event); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { + e.printStackTrace(); + return null; + } + } - public static IFramebuffer gimmeAFramebuffer(IMCFrameBuffer frameBuffer) { - return new IFramebuffer(new COMFrameBuffer(frameBuffer)); - } + public static IFramebuffer gimmeAFramebuffer(IMCFrameBuffer frameBuffer) { + return new IFramebuffer(new COMFrameBuffer(frameBuffer)); + } - public static void queryBitmapInfo(IDisplaySourceBitmap bitmap, long[] ptr, long[] w, long[] h, long[] bpp, long[] bpl, long[] pf) { - bitmap.getTypedWrapped().queryBitmapInfo(ptr, w, h, bpp, bpl, pf); - } + public static void queryBitmapInfo(IDisplaySourceBitmap bitmap, long[] ptr, long[] w, long[] h, long[] bpp, long[] bpl, long[] pf) { + bitmap.getTypedWrapped().queryBitmapInfo(ptr, w, h, bpp, bpl, pf); + } + + public static void querySourceBitmap(IDisplay display, Holder holder) { + display.querySourceBitmap(0L, holder); + } + + public static boolean convertToBool(boolean bool) { + return bool; + } + + public static boolean convertFromBool(boolean bool) { + return bool; + } + + public static long convertFromLong(long l) { + return l; + } } diff --git a/pom.xml b/pom.xml index 1098643..48e613a 100644 --- a/pom.xml +++ b/pom.xml @@ -8,6 +8,7 @@ VirtualComputer 2.1-SNAPSHOT + VirtualComputerMSCOM VirtualComputer-Core pom @@ -138,5 +139,16 @@ VirtualComputerMSCOM + + intellij-idea-only + + + idea.maven.embedder.version + + + + VirtualComputerMSCOM + + \ No newline at end of file diff --git a/repo/net/sf/jacob-project/jacob/1.19/jacob-1.19.jar b/repo/net/sf/jacob-project/jacob/1.19/jacob-1.19.jar deleted file mode 100644 index 06882a0..0000000 Binary files a/repo/net/sf/jacob-project/jacob/1.19/jacob-1.19.jar and /dev/null differ diff --git a/repo/net/sf/jacob-project/jacob/1.19/jacob-1.19.pom b/repo/net/sf/jacob-project/jacob/1.19/jacob-1.19.pom deleted file mode 100644 index 0d6f1a9..0000000 --- a/repo/net/sf/jacob-project/jacob/1.19/jacob-1.19.pom +++ /dev/null @@ -1,9 +0,0 @@ - - - 4.0.0 - net.sf.jacob-project - jacob - 1.19 - POM was created from install:install-file - diff --git a/repo/net/sf/jacob-project/jacob/maven-metadata-local.xml b/repo/net/sf/jacob-project/jacob/maven-metadata-local.xml deleted file mode 100644 index 29d7a8f..0000000 --- a/repo/net/sf/jacob-project/jacob/maven-metadata-local.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - net.sf.jacob-project - jacob - - 1.19 - - 1.19 - - 20200811224130 - - diff --git a/repo/org/virtualbox/VirtualBox-MSCOM/6.1/VirtualBox-MSCOM-6.1.jar b/repo/org/virtualbox/VirtualBox-MSCOM/6.1/VirtualBox-MSCOM-6.1.jar index c2a44b5..333ef16 100644 Binary files a/repo/org/virtualbox/VirtualBox-MSCOM/6.1/VirtualBox-MSCOM-6.1.jar and b/repo/org/virtualbox/VirtualBox-MSCOM/6.1/VirtualBox-MSCOM-6.1.jar differ diff --git a/repo/org/virtualbox/VirtualBox-MSCOM/maven-metadata-local.xml b/repo/org/virtualbox/VirtualBox-MSCOM/maven-metadata-local.xml index a3c96ca..215cc15 100644 --- a/repo/org/virtualbox/VirtualBox-MSCOM/maven-metadata-local.xml +++ b/repo/org/virtualbox/VirtualBox-MSCOM/maven-metadata-local.xml @@ -8,6 +8,6 @@ 6.0 6.1 - 20200731215317 + 20201016165020