Kernel32GetBinaryType Method

Determines whether a file is an executable (.exe) file, and if so, which subsystem runs the executable file.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", CharSet = CharSet.Auto, BestFitMapping = false, 
	ThrowOnUnmappableChar = true, SetLastError = true)]
public static bool GetBinaryType(
	string filePath,
	out BinaryType refBinaryType
)

Parameters

filePath  String
The full path of the file whose executable type is to be determined.

In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "\?" to the path.

refBinaryType  BinaryType
A variable to receive information about the executable type of the file specified by filePath.

Return Value

Boolean
If the file is executable, the return value is .

The function sets the variable pointed to by refBinaryType to indicate the file's executable type.

If the file is not executable, or if the function fails, the return value is .

Remarks

See Also