Desktop Functions: Smart Device Functions:
|
Search Results for "CreateFile" in [All]kernel32
''' <param name="hFile">The handle into file, a <see cref="CreateFile"/> handle is returning the handle for this.</param> The CreateFile function will returning hFile handle. 2: CloseHandle
hMapFile = CreateFileMapping(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, 4096, "mIRC") 3: CreateFile
public static extern IntPtr CreateFileMapping(
Friend Shared Function CreateFileMapping( _
_hMMF = Win32API.CreateFileMapping(_fs, Win32API.FileMapProtection.PageReadWrite, Int64.MaxValue, Name);
private static extern IntPtr CreateFileMapping(IntPtr hFile, IntPtr lpAttributes, FileMapProtection flProtect, Int32 dwMaxSizeHi, Int32 dwMaxSizeLow, string lpName);
internal static IntPtr CreateFileMapping(System.IO.FileStream File, FileMapProtection flProtect, Int64 ddMaxSize, string lpName)
return CreateFileMapping(File.SafeFileHandle.DangerousGetHandle(), IntPtr.Zero, flProtect, Hi, Lo, lpName);
public static extern IntPtr CreateFileMapping(
Friend Shared Function CreateFileMapping( _
_hMMF = Win32API.CreateFileMapping(_fs, Win32API.FileMapProtection.PageReadWrite, Int64.MaxValue, Name);
private static extern IntPtr CreateFileMapping(IntPtr hFile, IntPtr lpAttributes, FileMapProtection flProtect, Int32 dwMaxSizeHi, Int32 dwMaxSizeLow, string lpName);
internal static IntPtr CreateFileMapping(System.IO.FileStream File, FileMapProtection flProtect, Int64 ddMaxSize, string lpName)
return CreateFileMapping(File.SafeFileHandle.DangerousGetHandle(), IntPtr.Zero, flProtect, Hi, Lo, lpName);
[DllImport("kernel32.dll", EntryPoint = "CreateFile", SetLastError = true)]
private static extern IntPtr CreateFile(String lpFileName,
IntPtr handle = CreateFile(pipename, pipemode, hDevice - To retrieve a handle to a volume, call CreateFile with the lpFileName parameter set to a string of the following form: \\.\DriveLetter:. DriveLetter is not case-sensitive and does not require a colon after it.
tHandle = CreateFile(@"\\.\C:", FileAccess.Read, FileShare.ReadWrite, IntPtr.Zero, FileMode.Open, 0, IntPtr.Zero)
var handle = Win32.CreateFile(name, FileAccess.Read, FileShare.ReadWrite,
Private Declare Ansi Function CreateFile Lib "kernel32" Alias "CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As Integer, ByVal dwShareMode As Integer, ByVal lpSecurityAttributes As IntPtr, ByVal dwCreationDisposition As Integer, ByVal dwFlagsAndAttributes As Integer, ByVal hTemplateFile As IntPtr) As Integer
hdrive = CreateFile(".PHYSICALDRIVE0", GENERIC_READ Or GENERIC_WRITE, FILE_SHARE_READ Or FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0, IntPtr.Zero) This code segment will allow you to grab the Console input buffer using CreateFileW and Flush the input using FlushConsoleInputBuffer
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true, EntryPoint="CreateFileW")] Get the SafeFileHandle from call to CreateFile
var handle = CreateFile(dir, FileAccess.Read, FileShare.Read, IntPtr.Zero, FileMode.Open, 0x02000000 | 0x00000080, IntPtr.Zero);
var handle = CreateFile(dir, FileAccess.Read, FileShare.Read, IntPtr.Zero, FileMode.Open, 0x02000000 | 0x00000080, IntPtr.Zero); 11: GetFileSize
IntPtr handle = CreateFile( 12: GetFileSizeEx
IntPtr handle = CreateFile(PathString, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, 0); //PInvoked too 13: GetFileTime
private static extern IntPtr CreateFile(
ptr = CreateFile(FileName, GENERIC_READ, FILE_SHARE_READ, IntPtr.Zero, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, IntPtr.Zero); 14: 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 15: WriteFileEx
static extern IntPtr CreateFile(string lpFileName, uint dwDesiredAccess,
hfile = CreateFile(@"history.txt", (UInt32)FILE_ALL_ACCESS, FILE_SHARE_WRITE, IntPtr.Zero, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, IntPtr.Zero); Enums16: HRESULT
public const int CO_E_FAILEDTOCREATEFILE = unchecked((int)0x80010137);
Public Const CO_E_FAILEDTOCREATEFILE As Integer = CInt(&H80010137UI) 17: OpenFile
// FILE_SHARE_READ|FILE_SHARE_WRITE flags of the CreateFile function.
// This flag is mapped to the FILE_SHARE_READ|FILE_SHARE_WRITE flags of the CreateFile function.
// This flag is mapped to the FILE_SHARE_WRITE flag of the CreateFile function.
// This flag is mapped to the FILE_SHARE_READ flag of the CreateFile function. misc18: Comments Dang - I think I broke kernel32.CreateFile when adding coredll.CreateFile - Ian Darling [Note from Adam: This is now fixed, and was actually unrelated to coredll.CreateFile. Thanks!] Structures
// See pinvoke definition for CreateFile for the various Enums.
internal static extern IntPtr CreateFile(
IntPtr hMP = CreateFile(rppFolder
public extern static IntPtr CreateFile(string FileName, uint DesiredAccess,
IntPtr h = CreateFile(DevicePath.TrimEnd('\\'), 0, 0, IntPtr.Zero, OPEN_EXISTING, 0, IntPtr.Zero);
IntPtr h = CreateFile(Root.HubDevicePath, GENERIC_WRITE, FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0, IntPtr.Zero);
IntPtr h = CreateFile(PortHubDevicePath, GENERIC_WRITE, FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0, IntPtr.Zero);
IntPtr h = CreateFile(HubDevicePath, GENERIC_WRITE, FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0, IntPtr.Zero);
IntPtr h = CreateFile(PortHubDevicePath, GENERIC_WRITE, FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0, IntPtr.Zero);
IntPtr h = CreateFile(Root.HubDevicePath, GENERIC_WRITE, FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0, IntPtr.Zero);
IntPtr h = CreateFile(ControllerDevicePath, GENERIC_WRITE, FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0, IntPtr.Zero); icmp28: IcmpCloseHandle
29: IcmpCreateFile
30: IcmpSendEcho
private static extern IntPtr IcmpCreateFile();
IntPtr icmpHandle = IcmpCreateFile();
HANDLE WINAPI IcmpCreateFile(VOID);
HANDLE hIcmpFile = IcmpCreateFile();
printf("IcmpCreatefile returned error: %ld\n", GetLastError()); gdi3231: CreateDIBSection hSection is a handle to a file mapping object that the function will use to create the DIB and can be NULL. If hSection is not NULL, it must be a handle to a file mapping object created by calling the CreateFileMapping function (otherwise CreateDIBSection will fail). Moreover, the CreateDIBSection function will locate the bitmap’s bit values at offset dwOffset in the file mapping object referred to by hSection. An application can retrieve the hSection handle by calling the GetObject function with the HBITMAP returned by CreateDIBSection. setupapi32: Option Explicit Private Declare Function CreateFile Lib “kernel32″ Alias “CreateFileA” _ DeviceHandle = CreateFile(DeviceName, _ ole32
static extern int CreateFileMoniker([MarshalAs(UnmanagedType.LPWStr)] string Private Declare Function CreateFileMoniker Lib "ole32.dll" (ByVal lpszPathName As String, ByRef ppmk As IMoniker) As Integer rapi34: CeCreateFile
public static extern int CeCreateFile( function info on msdn at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceactsy/html/cerefCeCreateFileRAPI.asp
CeCreateFile("\\test.txt", GENERIC_READ | GENERIC_WRITE, 0, 0, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, 0); coredll35: CreateFile
static extern IntPtr CreateFile(String lpFileName, UInt32 dwDesiredAccess, UInt32 dwShareMode, IntPtr lpSecurityAttributes, UInt32 dwCreationDisposition, UInt32 dwFlagsAndAttributes, IntPtr hTemplateFile); Declare Function CreateFile Lib "coredll" (ByVal lpFileName As String, ByVal dwDesiredAccess As Integer, ByVal dwShareMode As Integer, ByVal lpSecurityAttributes As Integer, ByVal dwCreationDisposition As Integer, ByVal dwFLagsAndAttributes As Integer, ByVal hTemplateFile As Integer) As Integer 36: DeviceIOControl
IntPtr file = NativeMethods.CreateFile("ACS1:", 0, 0, IntPtr.Zero, ECreationDisposition.OpenExisting, 0, IntPtr.Zero); 37: WriteFile
hFile = CreateFile(txtFileName.Text, GENERIC_READ + GENERIC_WRITE, _ ntdll38: 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);
public static extern int NtCreateFile(
Declare Function NtCreateFile Lib "ntdll.dll" (TODO) As TODO
IntPtr _RootHandle; //This will need to be initialized with the root handle, can use CreateFile from kernel32.dll
int fOk = Win32Api.NtCreateFile( hid
deviceHandle = CreateFile(devicePath, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, IntPtr.Zero); Constants40: FILE_SHARE_READ
41: FILE_SHARE_WRITE
42: MAX_PATH This is the maximum number of characters, usually including a null terminator, of a standard fully-pathed filename for most Windows API functions that operate on filenames (and a few .NET ones, such as Assembly.LoadFrom). Those that fill a buffer with a filename, such as GetTempFileName, expect a buffer of exactly this length. Some functions, such as CreateFile, can be made to accept longer filenames by using the "\\?\" syntax. 43: WINERROR
public const int CO_E_FAILEDTOCREATEFILE = (int)(0x80010137 - 0x100000000); |