* Bring back rbuild build to be used until bug 6372 is fixed.
[reactos.git] / lib / rossym / zwfile.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: lib/rossym/zwfile.c
5 * PURPOSE: File I/O using native functions
6 *
7 * PROGRAMMERS: Ge van Geldorp (gvg@reactos.com)
8 */
9
10 #define NTOSAPI
11 #include <ntddk.h>
12 #include <reactos/rossym.h>
13 #include "rossympriv.h"
14
15 #define NDEBUG
16 #include <debug.h>
17
18 BOOLEAN
19 RosSymZwReadFile(PVOID FileContext, PVOID Buffer, ULONG Size)
20 {
21 NTSTATUS Status;
22 IO_STATUS_BLOCK IoStatusBlock;
23
24 Status = ZwReadFile(*((HANDLE *) FileContext),
25 0, 0, 0,
26 &IoStatusBlock,
27 Buffer,
28 Size,
29 0, 0);
30
31 return NT_SUCCESS(Status) && IoStatusBlock.Information == Size;
32 }
33
34 BOOLEAN
35 RosSymZwSeekFile(PVOID FileContext, ULONG_PTR Position)
36 {
37 NTSTATUS Status;
38 IO_STATUS_BLOCK IoStatusBlock;
39 FILE_POSITION_INFORMATION NewPosition;
40
41 NewPosition.CurrentByteOffset.u.HighPart = 0;
42 NewPosition.CurrentByteOffset.u.LowPart = Position;
43 Status = ZwSetInformationFile(*((HANDLE *) FileContext),
44 &IoStatusBlock,
45 (PVOID) &NewPosition,
46 sizeof(FILE_POSITION_INFORMATION),
47 FilePositionInformation);
48
49 return NT_SUCCESS(Status);
50 }
51
52 /* EOF */