SafeFileHandle ptrFile = CreateFile("\\\\.\\u:", DesiredAccess.GENERIC_READ | DesiredAccess.GENERIC_WRITE, ShareMode.FILE_SHARE_READ_AND_WRITE, IntPtr.Zero, CreationDisposition.OPEN_EXISTING, FlagsAndAttributes.FILE_ATTRIBUTE_NORMAL, IntPtr.Zero); byte[] buffer = new byte[512]; uint readed = 0; try { bool retor = SetFilePointerEx(ptrFile, 512, IntPtr.Zero, MoveMethod.FILE_BEGIN); } catch (Exception) { throw new Win32Exception(Marshal.GetLastWin32Error()); } bool b = ReadFile(ptrFile, buffer,512 , out readed, IntPtr.Zero);
retor
SetFilePointerEx()
GetLastError()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)