ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

zwfile.c
Go to the documentation of this file.
00001 /*
00002  * COPYRIGHT:       See COPYING in the top level directory
00003  * PROJECT:         ReactOS kernel
00004  * FILE:            lib/rossym/zwfile.c
00005  * PURPOSE:         File I/O using native functions
00006  *
00007  * PROGRAMMERS:     Ge van Geldorp (gvg@reactos.com)
00008  */
00009 
00010 #define NTOSAPI
00011 #include <ntddk.h>
00012 #include <reactos/rossym.h>
00013 #include "rossympriv.h"
00014 
00015 #define NDEBUG
00016 #include <debug.h>
00017 
00018 BOOLEAN
00019 RosSymZwReadFile(PVOID FileContext, PVOID Buffer, ULONG Size)
00020 {
00021   NTSTATUS Status;
00022   IO_STATUS_BLOCK IoStatusBlock;
00023 
00024   Status = ZwReadFile(*((HANDLE *) FileContext),
00025                       0, 0, 0,
00026                       &IoStatusBlock,
00027                       Buffer,
00028                       Size,
00029                       0, 0);
00030 
00031   return NT_SUCCESS(Status) && IoStatusBlock.Information == Size;
00032 }
00033 
00034 BOOLEAN
00035 RosSymZwSeekFile(PVOID FileContext, ULONG_PTR Position)
00036 {
00037   NTSTATUS Status;
00038   IO_STATUS_BLOCK IoStatusBlock;
00039   FILE_POSITION_INFORMATION NewPosition;
00040 
00041   NewPosition.CurrentByteOffset.u.HighPart = 0;
00042   NewPosition.CurrentByteOffset.u.LowPart = Position;
00043   Status = ZwSetInformationFile(*((HANDLE *) FileContext),
00044                                 &IoStatusBlock,
00045                                 (PVOID) &NewPosition,
00046                                 sizeof(FILE_POSITION_INFORMATION),
00047                                 FilePositionInformation);
00048 
00049   return NT_SUCCESS(Status);
00050 }
00051 
00052 /* EOF */

Generated on Sat May 26 2012 04:35:19 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.