Kernel32GetBinaryType Method
Determines whether a file is an executable (.exe) file, and if so, which subsystem runs the executable file.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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
)
<DllImportAttribute("Kernel32.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function GetBinaryType (
filePath As String,
<OutAttribute> ByRef refBinaryType As BinaryType
) As Boolean
Dim filePath As String
Dim refBinaryType As BinaryType
Dim returnValue As Boolean
returnValue = Kernel32.GetBinaryType(filePath,
refBinaryType)
public:
[DllImportAttribute(L"Kernel32.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static bool GetBinaryType(
String^ filePath,
[OutAttribute] BinaryType% refBinaryType
)
[<DllImportAttribute("Kernel32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member GetBinaryType :
filePath : string *
refBinaryType : BinaryType byref -> bool
No code example is currently available or this language may not be supported.
- 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.
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
.