Author: hpoussin
Date: Mon Sep 4 23:27:19 2006
New Revision: 23915
URL:
http://svn.reactos.org/svn/reactos?rev=23915&view=rev
Log:
Remove Vfat(x)Initialize and Vfat(x)Cleanup which were empty
Remove vfatlib dependancy of fmifs.dll (Providers like ufat.dll are loaded dynamically at
startup)
Modified:
trunk/reactos/base/setup/usetup/format.c
trunk/reactos/baseaddress.rbuild
trunk/reactos/dll/win32/fmifs/fmifs.rbuild
trunk/reactos/dll/win32/fmifs/format.c
trunk/reactos/dll/win32/fmifs/init.c
trunk/reactos/dll/win32/fmifs/precomp.h
trunk/reactos/include/reactos/libs/fslib/vfatlib.h
trunk/reactos/include/reactos/libs/fslib/vfatxlib.h
trunk/reactos/lib/fslib/vfatlib/vfatlib.c
trunk/reactos/lib/fslib/vfatxlib/vfatxlib.c
Modified: trunk/reactos/base/setup/usetup/format.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/format.c…
==============================================================================
--- trunk/reactos/base/setup/usetup/format.c (original)
+++ trunk/reactos/base/setup/usetup/format.c Mon Sep 4 23:27:19 2006
@@ -105,16 +105,12 @@
ProgressSetStepCount (ProgressBar, 100);
- VfatInitialize ();
-
Status = VfatFormat (DriveRoot,
0, /* MediaFlag */
NULL, /* Label */
TRUE, /* QuickFormat */
0, /* ClusterSize */
(PFMIFSCALLBACK)FormatCallback); /* Callback */
-
- VfatCleanup ();
DestroyProgressBar (ProgressBar);
ProgressBar = NULL;
Modified: trunk/reactos/baseaddress.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/baseaddress.rbuild?rev=239…
==============================================================================
--- trunk/reactos/baseaddress.rbuild (original)
+++ trunk/reactos/baseaddress.rbuild Mon Sep 4 23:27:19 2006
@@ -67,6 +67,7 @@
<property name="BASEADDRESS_LZ32" value="0x73d80000" />
<property name="BASEADDRESS_COREDLL" value="0x73d80000" />
<property name="BASEADDRESS_ICMP" value="0x741f0000" />
+ <property name="BASEADDRESS_UFAT" value="0x741f0000" />
<property name="BASEADDRESS_USERENV" value="0x74850000" />
<property name="BASEADDRESS_WS2_32" value="0x74aa0000" />
<property name="BASEADDRESS_SYSSETUP" value="0x74a30000" />
Modified: trunk/reactos/dll/win32/fmifs/fmifs.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/fmifs/fmifs.rbui…
==============================================================================
--- trunk/reactos/dll/win32/fmifs/fmifs.rbuild (original)
+++ trunk/reactos/dll/win32/fmifs/fmifs.rbuild Mon Sep 4 23:27:19 2006
@@ -4,7 +4,6 @@
<define name="_DISABLE_TIDENTS" />
<define name="__USE_W32API" />
<define name="_WIN32_WINNT">0x0600</define>
- <library>vfatlib</library>
<library>ntdll</library>
<library>kernel32</library>
<file>chkdsk.c</file>
Modified: trunk/reactos/dll/win32/fmifs/format.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/fmifs/format.c?r…
==============================================================================
--- trunk/reactos/dll/win32/fmifs/format.c (original)
+++ trunk/reactos/dll/win32/fmifs/format.c Mon Sep 4 23:27:19 2006
@@ -5,6 +5,7 @@
* PURPOSE: Volume format
*
* PROGRAMMERS: Emanuele Aliberti
+ * Hervé Poussineau (hpoussin(a)reactos.org)
*/
#include "precomp.h"
@@ -14,7 +15,7 @@
/* FMIFS.6 */
VOID NTAPI
-Format(void)
+Format(VOID)
{
}
@@ -29,13 +30,15 @@
IN ULONG ClusterSize,
IN PFMIFSCALLBACK Callback)
{
+ PIFS_PROVIDER Provider;
UNICODE_STRING usDriveRoot;
UNICODE_STRING usLabel;
BOOLEAN Argument = FALSE;
WCHAR VolumeName[MAX_PATH];
CURDIR CurDir;
- if (_wcsnicmp(Format, L"FAT", 3) != 0)
+ Provider = GetProvider(Format);
+ if (!Provider)
{
/* Unknown file system */
Callback(
@@ -58,16 +61,14 @@
RtlInitUnicodeString(&usLabel, Label);
- DPRINT1("FormatEx - FAT\n");
- VfatInitialize();
- VfatFormat(
+ DPRINT1("FormatEx - %S\n", Format);
+ Provider->FormatEx(
&usDriveRoot,
MediaFlag,
&usLabel,
QuickFormat,
ClusterSize,
Callback);
- VfatCleanup();
RtlFreeUnicodeString(&usDriveRoot);
}
Modified: trunk/reactos/dll/win32/fmifs/init.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/fmifs/init.c?rev…
==============================================================================
--- trunk/reactos/dll/win32/fmifs/init.c (original)
+++ trunk/reactos/dll/win32/fmifs/init.c Mon Sep 4 23:27:19 2006
@@ -5,17 +5,93 @@
* PURPOSE: Initialisation
*
* PROGRAMMERS: Emanuele Aliberti
+ * Hervé Poussineau (hpoussin(a)reactos.org)
*/
#include "precomp.h"
static BOOLEAN FmIfsInitialized = FALSE;
+LIST_ENTRY ProviderListHead;
-static BOOLEAN NTAPI
+PIFS_PROVIDER
+GetProvider(
+ IN PWCHAR FileSystem)
+{
+ PLIST_ENTRY ListEntry;
+ PIFS_PROVIDER Provider;
+
+ ListEntry = ProviderListHead.Flink;
+ while (ListEntry != ProviderListHead.Flink)
+ {
+ Provider = CONTAINING_RECORD(ListEntry, IFS_PROVIDER, ListEntry);
+ if (wcscmp(Provider->Name, FileSystem) == 0)
+ return Provider;
+ ListEntry = ListEntry->Flink;
+ }
+
+ /* Provider not found */
+ return NULL;
+}
+
+static BOOLEAN
+AddProvider(
+ IN PWCHAR FileSystem,
+ IN PWCHAR DllFile)
+{
+ PIFS_PROVIDER Provider = NULL;
+ ULONG RequiredSize;
+ HMODULE hMod = NULL;
+ BOOLEAN ret = FALSE;
+
+ hMod = LoadLibraryW(DllFile);
+ if (!hMod)
+ goto cleanup;
+
+ RequiredSize = FIELD_OFFSET(IFS_PROVIDER, Name)
+ + wcslen(FileSystem) * sizeof(WCHAR) + sizeof(UNICODE_NULL);
+ Provider = (PIFS_PROVIDER)RtlAllocateHeap(
+ RtlGetProcessHeap(),
+ 0,
+ RequiredSize);
+ if (!Provider)
+ goto cleanup;
+ RtlZeroMemory(Provider, RequiredSize);
+
+ /* Get function pointers */
+ //Provider->Chkdsk = (CHKDSK)GetProcAddress(hMod, "Chkdsk");
+ //Provider->ChkdskEx = (CHKDSKEX)GetProcAddress(hMod, "ChkdskEx");
+ //Provider->Extend = (EXTEND)GetProcAddress(hMod, "Extend");
+ //Provider->Format = (FORMAT)GetProcAddress(hMod, "Format");
+ Provider->FormatEx = (FORMATEX)GetProcAddress(hMod, "FormatEx");
+ //Provider->Recover = (RECOVER)GetProcAddress(hMod, "Recover");
+
+ wcscpy(Provider->Name, FileSystem);
+
+ InsertTailList(&ProviderListHead, &Provider->ListEntry);
+ ret = TRUE;
+
+cleanup:
+ if (!ret)
+ {
+ if (hMod)
+ FreeLibrary(hMod);
+ if (Provider)
+ RtlFreeHeap(RtlGetProcessHeap(), 0, Provider);
+ }
+ return ret;
+}
+
+static BOOLEAN
InitializeFmIfsOnce(void)
{
+ InitializeListHead(&ProviderListHead);
+
+ /* Add default providers */
+ AddProvider(L"FAT", L"ufat");
+ AddProvider(L"FAT32", L"ufat");
+
/* TODO: Check how many IFS are installed in the system */
- /* TOSO: and register a descriptor for each one */
+ /* TODO: and register a descriptor for each one */
return TRUE;
}
Modified: trunk/reactos/dll/win32/fmifs/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/fmifs/precomp.h?…
==============================================================================
--- trunk/reactos/dll/win32/fmifs/precomp.h (original)
+++ trunk/reactos/dll/win32/fmifs/precomp.h Mon Sep 4 23:27:19 2006
@@ -1,9 +1,11 @@
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS System Libraries
- * FILE: lib/fmifs/precomp.h
- * PURPOSE: Win32 FMIFS API Libary Header
- * PROGRAMMER: Alex Ionescu (alex(a)relsoft.net)
+ * PROJECT: File Management IFS Utility functions
+ * FILE: reactos/dll/win32/fmifs/precomp.h
+ * PURPOSE: Win32 FMIFS API Library Header
+ *
+ * PROGRAMMERS: Alex Ionescu (alex(a)relsoft.net)
+ * Hervé Poussineau (hpoussin(a)reactos.org)
*/
/* INCLUDES ******************************************************************/
@@ -23,4 +25,33 @@
/* VFATLIB Public Header */
#include <fslib/vfatlib.h>
+typedef NTSTATUS (NTAPI *FORMATEX)(
+ IN PUNICODE_STRING DriveRoot,
+ IN FMIFS_MEDIA_FLAG MediaFlag,
+ IN PUNICODE_STRING Label,
+ IN BOOLEAN QuickFormat,
+ IN ULONG ClusterSize,
+ IN PFMIFSCALLBACK Callback);
+
+extern LIST_ENTRY ProviderListHead;
+
+typedef struct _IFS_PROVIDER
+{
+ LIST_ENTRY ListEntry;
+
+ PVOID Chkdsk;
+ PVOID ChkdskEx;
+ PVOID Extend;
+ PVOID Format;
+ FORMATEX FormatEx;
+ PVOID Recover;
+
+ WCHAR Name[1];
+} IFS_PROVIDER, *PIFS_PROVIDER;
+
+/* init.c */
+PIFS_PROVIDER
+GetProvider(
+ IN PWCHAR FileSytem);
+
/* EOF */
Modified: trunk/reactos/include/reactos/libs/fslib/vfatlib.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/libs/fslib…
==============================================================================
--- trunk/reactos/include/reactos/libs/fslib/vfatlib.h (original)
+++ trunk/reactos/include/reactos/libs/fslib/vfatlib.h Mon Sep 4 23:27:19 2006
@@ -9,15 +9,9 @@
#include <fmifs/fmifs.h>
-NTSTATUS
-VfatInitialize (VOID);
-
-NTSTATUS
-VfatCleanup (VOID);
-
-NTSTATUS
+NTSTATUS NTAPI
VfatFormat (PUNICODE_STRING DriveRoot,
- ULONG MediaFlag,
+ FMIFS_MEDIA_FLAG MediaFlag,
PUNICODE_STRING Label,
BOOLEAN QuickFormat,
ULONG ClusterSize,
Modified: trunk/reactos/include/reactos/libs/fslib/vfatxlib.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/libs/fslib…
==============================================================================
--- trunk/reactos/include/reactos/libs/fslib/vfatxlib.h (original)
+++ trunk/reactos/include/reactos/libs/fslib/vfatxlib.h Mon Sep 4 23:27:19 2006
@@ -9,16 +9,12 @@
#include <fmifs/fmifs.h>
-NTSTATUS
-VfatxInitialize (VOID);
-
-NTSTATUS
-VfatxCleanup (VOID);
-
-NTSTATUS
+NTSTATUS NTAPI
VfatxFormat (PUNICODE_STRING DriveRoot,
- ULONG MediaFlag,
+ FMIFS_MEDIA_FLAG MediaFlag,
+ PUNICODE_STRING Label,
BOOLEAN QuickFormat,
+ ULONG ClusterSize,
PFMIFSCALLBACK Callback);
#endif /*__VFATLIB_H */
Modified: trunk/reactos/lib/fslib/vfatlib/vfatlib.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatlib/vfatlib.…
==============================================================================
--- trunk/reactos/lib/fslib/vfatlib/vfatlib.c (original)
+++ trunk/reactos/lib/fslib/vfatlib/vfatlib.c Mon Sep 4 23:27:19 2006
@@ -12,18 +12,9 @@
#define NDEBUG
#include <debug.h>
-NTSTATUS
-VfatInitialize(VOID)
-{
- DPRINT("VfatInitialize()\n");
-
- return STATUS_SUCCESS;
-}
-
-
-NTSTATUS
+NTSTATUS NTAPI
VfatFormat (PUNICODE_STRING DriveRoot,
- ULONG MediaFlag,
+ FMIFS_MEDIA_FLAG MediaFlag,
PUNICODE_STRING Label,
BOOLEAN QuickFormat,
ULONG ClusterSize,
@@ -194,15 +185,6 @@
}
-NTSTATUS
-VfatCleanup(VOID)
-{
- DPRINT("VfatCleanup()\n");
-
- return STATUS_SUCCESS;
-}
-
-
VOID
UpdateProgress (PFORMAT_CONTEXT Context,
ULONG Increment)
Modified: trunk/reactos/lib/fslib/vfatxlib/vfatxlib.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatxlib/vfatxli…
==============================================================================
--- trunk/reactos/lib/fslib/vfatxlib/vfatxlib.c (original)
+++ trunk/reactos/lib/fslib/vfatxlib/vfatxlib.c Mon Sep 4 23:27:19 2006
@@ -12,19 +12,12 @@
#define NDEBUG
#include <debug.h>
-NTSTATUS
-VfatxInitialize(VOID)
-{
- DPRINT("VfatxInitialize()\n");
-
- return STATUS_SUCCESS;
-}
-
-
-NTSTATUS
+NTSTATUS NTAPI
VfatxFormat (PUNICODE_STRING DriveRoot,
- ULONG MediaFlag,
+ FMIFS_MEDIA_FLAG MediaFlag,
+ PUNICODE_STRING Label,
BOOLEAN QuickFormat,
+ ULONG ClusterSize,
PFMIFSCALLBACK Callback)
{
OBJECT_ATTRIBUTES ObjectAttributes;
@@ -163,15 +156,6 @@
}
-NTSTATUS
-VfatxCleanup(VOID)
-{
- DPRINT("VfatxCleanup()\n");
-
- return STATUS_SUCCESS;
-}
-
-
VOID
VfatxUpdateProgress (PFORMAT_CONTEXT Context,
ULONG Increment)