All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Alachisoft.NCache.Common.Interop.Win32 Maven / Gradle / Ivy

There is a newer version: 5.3.3
Show newest version
package Alachisoft.NCache.Common.Interop;


/**
 * Utility class to help with interop tasks.
 */
//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
//[CLSCompliant(false)]
public class Win32 {
	/*private Win32() {
	}

	public static native boolean QueryPerformanceFrequency(tangible.RefObject frequency);
	static {
		System.loadLibrary("kernel32");
	}

	public static native void QueryPerformanceCounter(tangible.RefObject ticks);

	public static native void GetSystemInfo(tangible.RefObject pSI);

	public static native void GetNativeSystemInfo(tangible.RefObject pSI);

	public static native int GetLastError();

//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public static extern uint FormatMessage(uint dwFlags, IntPtr lpSource, uint dwMessageId, uint dwLanguageId, StringBuilder lpBuffer, uint nSize, IntPtr Arguments);
	public static native int FormatMessage(int dwFlags, IntPtr lpSource, int dwMessageId, int dwLanguageId, StringBuilder lpBuffer, int nSize, IntPtr Arguments);

//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes:
//ORIGINAL LINE: private static extern bool IsWow64Process([In] IntPtr hProcess, [Out] out bool wow64Process);
	private static native boolean IsWow64Process(IntPtr hProcess, out boolean wow64Process);
	static {
		System.loadLibrary("kernel32.dll");
	}

	public static boolean InternalCheckIsWow64() {
		if ((Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor >= 1) || Environment.OSVersion.Version.Major >= 6) {
//C# TO JAVA CONVERTER NOTE: The following 'using' block is replaced by its Java equivalent:
//			using (Process p = Process.GetCurrentProcess())
			Process p = Process.GetCurrentProcess();
			try {
				boolean retVal = false;
				tangible.RefObject tempRef_retVal = new tangible.RefObject(retVal);
				boolean tempVar = !IsWow64Process(p.Handle, tempRef_retVal);
					retVal = tempRef_retVal.argvalue;
				if (tempVar) {
					return false;
				}
				return retVal;
			} finally {
				p.dispose();
			}
		} else {
			return false;
		}
	}*/
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy