Desktop Functions: Smart Device Functions:
|
Search Results for "SafeFileHandle" in [All]wintrust
SafeFileHandle hFile, For .NET versions prior to 2.0, replace SafeFileHandle with IntPtr
SafeFileHandle invalidHandle = new SafeFileHandle(new IntPtr(-1), true);
if (IsCatalogFile(fs.SafeFileHandle, null)) winusb
static extern int WinUsb_Initialize(SafeFileHandle DeviceHandle, out IntPtr InterfaceHandle);
SafeFileHandle InterfaceHandle, ntdll4: NtCreateFile
public static extern int NtCreateFile(out SafeFileHandle handle, FileAccess access, OBJECT_ATTRIBUTES* objectAttributes, IO_STATUS_BLOCK* ioStatus, ref long allocSize, uint fileAttributes, FileShare share, uint createDisposition, uint createOptions, IntPtr eaBuffer, uint eaLength);
out Microsoft.Win32.SafeHandles.SafeFileHandle handle,
Microsoft.Win32.SafeHandles.SafeFileHandle hFile;
out SafeFileHandle DirectoryHandle,
SafeFileHandle h;
out SafeFileHandle LinkHandle,
SafeFileHandle h;
SafeFileHandle DirectoryHandle,
static extern IntPtr NtQueryInformationFile(SafeFileHandle fileHandle, ref IO_STATUS_BLOCK IoStatusBlock, IntPtr pInfoBlock, uint length, FILE_INFORMATION_CLASS fileInformation);
IntPtr iprc = NtQueryInformationFile(fs.SafeFileHandle, ref iosb, p_fbi, (uint)Marshal.SizeOf(fbi), FILE_INFORMATION_CLASS.FileBasicInformation);
SafeFileHandle LinkHandle, dbghelp
MiniDumpWriteDump( GetCurrentProcess(), GetCurrentProcessId(), file.SafeFileHandle.DangerousGetHandle(), hid11: HidD_FlushQueue
static extern Boolean HidD_FlushQueue(SafeFileHandle HidDeviceObject);
Declare Function HidD_FlushQueue Lib "hid.dll" (SafeFileHandle HidDeviceObject) As Boolean
internal HIDP_CAPS GetDeviceCapabilities( SafeFileHandle hidHandle )
SafeFileHandle HidDeviceObject, 14: HidD_GetFeature
static extern Boolean HidD_GetFeature(SafeFileHandle HidDeviceObject, ref Byte lpReportBuffer, Int32 ReportBufferLength);
Declare Function HidD_GetFeature Lib "hid.dll" (ByVal HidDeviceObject As SafeFileHandle, out lpReportBuffer As Byte, ReportBufferLength As Int32) As Boolean
Public Shared Function HidD_GetFeature(hidDeviceObject As SafeFileHandle, ByVal reportBuffer As Byte(), ByVal reportBufferLength As UInt32) As Boolean
private static extern bool HidD_GetIndexedString(SafeFileHandle HidDeviceObject, uint StringIndex, StringBuilder Buffer, uint BufferLength);
private static extern bool HidD_GetInputReport(SafeFileHandle HidDeviceObject, StringBuilder Buffer, uint BufferLength);
SafeFileHandle HidDeviceObject,
ByVal HidDeviceObject As SafeFileHandle, _
private static extern bool HidD_GetNumInputBuffers(SafeFileHandle HidDeviceObject, ref uint NumberBuffers);
private static extern bool HidD_GetPhysicalDescriptor(SafeFileHandle HidDeviceObject, StringBuilder Buffer, uint BufferLength);
public static extern bool HidD_GetPreparsedData(SafeFileHandle HidDeviceObject, ref IntPtr PreparsedData);
private static extern bool HidD_GetProductString(SafeFileHandle HidDeviceObject, StringBuilder Buffer, uint BufferLength); 22: HidD_SetFeature
private static extern bool HidD_SetFeature(SafeFileHandle HidDeviceObject, ref byte[] Buffer, uint BufferLength);
private static extern bool HidD_SetNumInputBuffers(SafeFileHandle HidDeviceObject, uint BufferLength); msvcrt24: _get_osfhandle
static extern SafeFileHandle _get_osfhandle(int fd); kernel3225: CloseHandle For .NET 2.0, consider using Microsoft.Win32.SafeHandles.SafeFileHandle instead. It can be used where IntPtr is used. If you use a SafeFileHandle, do not call CloseHandle as the CLR will close it for you (even if it's already closed). 26: CreateFile
static extern SafeFileHandle CreateFile(
public static extern SafeFileHandle CreateFile(
ByVal hTemplateFile As IntPtr) As Microsoft.Win32.SafeHandles.SafeFileHandle unless the hDrv is of the new SafeFileHandle type. Simply replace the IntPtr's with SafeFileHandle - the updated signature is:
static extern SafeFileHandle CreateFile(
SafeFileHandle handle = CreateFile(Path,GENERIC_WRITE,0,
static extern SafeFileHandle CreateFile(
SafeFileHandle drive = CreateFile( fileName: FileName,
SafeFileHandle drive = CreateFile( fileName: FileName, 27: DeviceIoControl
ByVal hDevice As Microsoft.Win32.SafeHandles.SafeFileHandle, _
SafeFileHandle hDevice,
IntPtr fileHandle=f.SafeFileHandle.DangerousGetHandle(); 28: FlushFileBuffers
static extern bool FlushFileBuffers(SafeFileHandle hFile);
static extern bool GetCommModemStatus(SafeFileHandle hFile, out uint lpModemStat); Get the SafeFileHandle from call to CreateFile 30: ReadFile
SafeFileHandle hFile, // handle to file
ByVal File As SafeFileHandle, _
ByRef Overlapped As System.Threading.NativeOverlapped) As SafeFileHandle NET 2.0 use SafeFileHandle instead of IntPtr 31: SafeFileHandle
static extern SafeFileHandle CreateFile(string lpFileName, uint dwDesiredAccess,
Private Shared Function CreateFile(ByVal lpFileName As String, ByVal dwDesiredAccess As System.UInt32, ByVal dwShareMode As System.UInt32, ByVal lpSecurityAttributes As IntPtr, ByVal dwCreationDisposition As System.UInt32, ByVal dwFlagsAndAttributes As System.UInt32, ByVal hTemplateFile As IntPtr) As Microsoft.Win32.SafeHandles.SafeFileHandle 32: SetCommBreak
static extern bool SetCommBreak([InAttribute] SafeFileHandle fileHandle);
SetFileInformationByHandle(fileStream.SafeFileHandle, FileInformationClass.FileDispositionInfo, ref FileInformation, Marshal.SizeOf(FileInformation.FILE_DISPOSITION_INFO));
SetFileInformationByHandle(fileStream.SafeFileHandle, FileInformationClass.FileEndOfFileInfo, ref FileInformation, Marshal.SizeOf(FileInformation.FILE_END_OF_FILE_INFO)); 34: SetFilePointer
[In] SafeFileHandle hFile,
[In] SafeFileHandle hFile, 35: SetFilePointerEx
SafeFileHandle hFile, long liDistanceToMove, In the Microsoft .NET Framework version 2.0, you should use a SafeFileHandle instead of an IntPtr to refer to hNamedPipe.
static extern bool SetNamedPipeHandleState(SafeFileHandle hNamedPipe, IntPtr lpMode,
ByVal hNamedPipe As SafeFileHandle, _ 37: WriteFile
"File" = The SafeFileHandle to the file to write to. The file must have at least write-level access.
ByVal File As SafeFileHandle, _ NET 2.0 use the SafeFileHandle version |