46f05959b7a657441afc6a7cb1594e220124cd44
[reactos.git] / reactos / boot / environ / lib / io / fat.c
1 /*
2 * COPYRIGHT: See COPYING.ARM in the top level directory
3 * PROJECT: ReactOS UEFI Boot Library
4 * FILE: boot/environ/lib/io/fat.c
5 * PURPOSE: Boot Library FAT File System Management Routines
6 * PROGRAMMER: Alex Ionescu (alex.ionescu@reactos.org)
7 */
8
9 /* INCLUDES ******************************************************************/
10
11 #include "bl.h"
12
13 /* DATA VARIABLES ************************************************************/
14
15 PVOID* FatDeviceTable;
16 ULONG FatDeviceTableEntries;
17 PWCHAR FatpLongFileName;
18
19 /* FUNCTIONS *****************************************************************/
20
21 NTSTATUS
22 FatMount (
23 _In_ ULONG DeviceId,
24 _In_ ULONG Unknown,
25 _Out_ PBL_FILE_ENTRY* FileEntry
26 )
27 {
28 EfiPrintf(L"FAT Mount on Device %d TODO\r\n", DeviceId);
29 EfiStall(3000000);
30 return STATUS_NOT_IMPLEMENTED;
31 }
32
33 NTSTATUS
34 FatInitialize (
35 VOID
36 )
37 {
38 NTSTATUS Status;
39
40 /* Allocate the device table with 2 entries*/
41 FatDeviceTableEntries = 2;
42 FatDeviceTable = BlMmAllocateHeap(sizeof(PBL_FILE_ENTRY) *
43 FatDeviceTableEntries);
44 if (FatDeviceTable)
45 {
46 /* Zero it out */
47 RtlZeroMemory(FatDeviceTable,
48 sizeof(PBL_FILE_ENTRY) * FatDeviceTableEntries);
49
50 /* Allocate a 512 byte buffer for long file name conversion */
51 FatpLongFileName = BlMmAllocateHeap(512);
52 Status = FatpLongFileName != NULL ? STATUS_SUCCESS : STATUS_NO_MEMORY;
53 }
54 else
55 {
56 /* No memory, fail */
57 Status = STATUS_NO_MEMORY;
58 }
59
60 /* Return back to caller */
61 return Status;
62 }
63