Kernel32GetFileSize(SafeFileHandle, UInt32) Method
Note: This API is now obsolete.
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", ExactSpelling = true, SetLastError = true)]
[ObsoleteAttribute("Call NativeMethods.GetFileSize() instead", true)]
public static uint GetFileSize(
SafeFileHandle hFile,
out uint fileSizeHigh
)
<DllImportAttribute("Kernel32.dll", ExactSpelling := true, SetLastError := true>]
<ObsoleteAttribute("Call NativeMethods.GetFileSize() instead", true)>
Public Shared Function GetFileSize (
hFile As SafeFileHandle,
<OutAttribute> ByRef fileSizeHigh As UInteger
) As UInteger
Dim hFile As SafeFileHandle
Dim fileSizeHigh As UInteger
Dim returnValue As UInteger
returnValue = Kernel32.GetFileSize(hFile,
fileSizeHigh)
public:
[DllImportAttribute(L"Kernel32.dll", ExactSpelling = true, SetLastError = true)]
[ObsoleteAttribute(L"Call NativeMethods.GetFileSize() instead", true)]
static unsigned int GetFileSize(
[InAttribute] SafeFileHandle^ hFile,
[OutAttribute] unsigned int% fileSizeHigh
)
[<DllImportAttribute("Kernel32.dll", ExactSpelling = true, SetLastError = true)>]
[<ObsoleteAttribute("Call NativeMethods.GetFileSize() instead", true)>]
static member GetFileSize :
hFile : SafeFileHandle *
fileSizeHigh : uint32 byref -> uint32
No code example is currently available or this language may not be supported.
- hFile SafeFileHandle
-
A handle to the file.
- fileSizeHigh UInt32
-
A pointer to the variable where the high-order doubleword of the file size is returned.
This parameter can be NULL if the application does not require the high-order doubleword.
UInt32
If the function succeeds, the return value is the low-order doubleword of the file size,
and, if
fileSizeHigh is non-
NULL,
the function puts the high-order doubleword of the file size into the variable pointed to by that parameter.
If the function fails and
fileSizeHigh is
NULL,
the return value is
INVALID_FILE_SIZE.
When
fileSizeHigh is
NULL, the results returned for large files are ambiguous,
and you will not be able to determine the actual size of the file.
It is recommended that you use
GetFileSizeEx(SafeFileHandle, Int64) instead.
If the function fails and
fileSizeHigh is non-
NULL,
the return value is
INVALID_FILE_SIZE and
GetLastError will return a value other than
NO_ERROR.