[HAL]
[reactos.git] / reactos / hal / halx86 / generic / drive.c
1 /*
2 * PROJECT: ReactOS HAL
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: hal/halx86/generic/drive.c
5 * PURPOSE: I/O HAL Routines for Disk Access
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7 */
8
9 /* INCLUDES ******************************************************************/
10
11 #include <hal.h>
12
13 #include <ntdddisk.h>
14
15 #define NDEBUG
16 #include <debug.h>
17
18 /* FUNCTIONS *****************************************************************/
19
20 VOID
21 NTAPI
22 HalpAssignDriveLetters(IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock,
23 IN PSTRING NtDeviceName,
24 OUT PUCHAR NtSystemPath,
25 OUT PSTRING NtSystemPathString)
26 {
27 /* Call the kernel */
28 IoAssignDriveLetters(LoaderBlock,
29 NtDeviceName,
30 NtSystemPath,
31 NtSystemPathString);
32 }
33
34 NTSTATUS
35 NTAPI
36 HalpReadPartitionTable(IN PDEVICE_OBJECT DeviceObject,
37 IN ULONG SectorSize,
38 IN BOOLEAN ReturnRecognizedPartitions,
39 IN OUT PDRIVE_LAYOUT_INFORMATION *PartitionBuffer)
40 {
41 /* Call the kernel */
42 return IoReadPartitionTable(DeviceObject,
43 SectorSize,
44 ReturnRecognizedPartitions,
45 PartitionBuffer);
46 }
47
48 NTSTATUS
49 NTAPI
50 HalpWritePartitionTable(IN PDEVICE_OBJECT DeviceObject,
51 IN ULONG SectorSize,
52 IN ULONG SectorsPerTrack,
53 IN ULONG NumberOfHeads,
54 IN PDRIVE_LAYOUT_INFORMATION PartitionBuffer)
55 {
56 /* Call the kernel */
57 return IoWritePartitionTable(DeviceObject,
58 SectorSize,
59 SectorsPerTrack,
60 NumberOfHeads,
61 PartitionBuffer);
62 }
63
64 NTSTATUS
65 NTAPI
66 HalpSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject,
67 IN ULONG SectorSize,
68 IN ULONG PartitionNumber,
69 IN ULONG PartitionType)
70 {
71 /* Call the kernel */
72 return IoSetPartitionInformation(DeviceObject,
73 SectorSize,
74 PartitionNumber,
75 PartitionType);
76 }
77 /* EOF */