mirror of
https://github.com/mitb-archive/filebot
synced 2025-03-09 13:59:49 -04:00
Try to fix 32-bit MWS support
This commit is contained in:
parent
28d126b5a8
commit
7e4888d95f
@ -8,10 +8,10 @@ import com.sun.jna.win32.W32APIOptions;
|
|||||||
|
|
||||||
public interface Kernel32 extends StdCallLibrary {
|
public interface Kernel32 extends StdCallLibrary {
|
||||||
|
|
||||||
public static final long APPMODEL_ERROR_NO_PACKAGE = 15700;
|
|
||||||
|
|
||||||
Kernel32 INSTANCE = Native.loadLibrary("kernel32", Kernel32.class, W32APIOptions.DEFAULT_OPTIONS);
|
Kernel32 INSTANCE = Native.loadLibrary("kernel32", Kernel32.class, W32APIOptions.DEFAULT_OPTIONS);
|
||||||
|
|
||||||
long GetCurrentPackageFullName(UINTByReference packageFullNameLength, LPWSTR packageFullName);
|
long GetCurrentPackageFullName(UINTByReference packageFullNameLength, LPWSTR packageFullName);
|
||||||
|
|
||||||
|
long APPMODEL_ERROR_NO_PACKAGE = 15700;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ import com.sun.jna.Memory;
|
|||||||
import com.sun.jna.Native;
|
import com.sun.jna.Native;
|
||||||
import com.sun.jna.WString;
|
import com.sun.jna.WString;
|
||||||
import com.sun.jna.platform.win32.Shell32;
|
import com.sun.jna.platform.win32.Shell32;
|
||||||
|
import com.sun.jna.platform.win32.W32Errors;
|
||||||
import com.sun.jna.platform.win32.WinDef.UINT;
|
import com.sun.jna.platform.win32.WinDef.UINT;
|
||||||
import com.sun.jna.platform.win32.WinDef.UINTByReference;
|
import com.sun.jna.platform.win32.WinDef.UINTByReference;
|
||||||
import com.sun.jna.platform.win32.WinError;
|
import com.sun.jna.platform.win32.WinError;
|
||||||
@ -41,20 +42,15 @@ public class WinAppUtilities {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String getPackageName() {
|
public static String getPackageName() {
|
||||||
System.out.println("WinAppUtilities.getPackageName()");
|
|
||||||
|
|
||||||
UINTByReference length = new UINTByReference(new UINT(0));
|
UINTByReference length = new UINTByReference(new UINT(0));
|
||||||
Kernel32.INSTANCE.GetCurrentPackageFullName(length, null);
|
if (Kernel32.INSTANCE.GetCurrentPackageFullName(length, null) != W32Errors.ERROR_SUCCESS) {
|
||||||
|
throw new IllegalStateException("Kernel32.GetCurrentPackageFullName");
|
||||||
System.out.println(length);
|
}
|
||||||
System.out.println(length.getValue());
|
|
||||||
System.out.println(length.getValue().longValue());
|
|
||||||
|
|
||||||
LPWSTR lpwstr = new LPWSTR(new Memory(length.getValue().intValue() * Native.WCHAR_SIZE));
|
LPWSTR lpwstr = new LPWSTR(new Memory(length.getValue().intValue() * Native.WCHAR_SIZE));
|
||||||
Kernel32.INSTANCE.GetCurrentPackageFullName(length, lpwstr);
|
if (Kernel32.INSTANCE.GetCurrentPackageFullName(length, null) != W32Errors.ERROR_SUCCESS) {
|
||||||
System.out.println(length);
|
throw new IllegalStateException("Kernel32.GetCurrentPackageFullName");
|
||||||
System.out.println(length.getValue());
|
}
|
||||||
System.out.println(lpwstr);
|
|
||||||
|
|
||||||
return lpwstr.toString();
|
return lpwstr.toString();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user