Author: ion
Date: Wed Sep 4 07:07:08 2013
New Revision: 59984
URL:
http://svn.reactos.org/svn/reactos?rev=59984&view=rev
Log:
[BASESRV]: Add INIFILE_MAPPING structures, and set a valid IniFileMapping pointer in the
shared static data. Windows' kernel32 needs this whenever an INI API is called, which
is why UserInit was crashing on load (our pointer was set to NULL). Now userinit.exe
loads/works, and explorer.exe is the one that fails to initialize. But one can
CTRL-ALT-DEL and launch Task Manager (works!), Calc (but not Notepad).
Modified:
trunk/reactos/include/reactos/subsys/win/base.h
trunk/reactos/subsystems/win/basesrv/init.c
Modified: trunk/reactos/include/reactos/subsys/win/base.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/subsys/win…
==============================================================================
--- trunk/reactos/include/reactos/subsys/win/base.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/subsys/win/base.h [iso-8859-1] Wed Sep 4 07:07:08 2013
@@ -62,6 +62,44 @@
} NLS_USER_INFO, *PNLS_USER_INFO;
C_ASSERT(sizeof(NLS_USER_INFO) == 0x1870);
+typedef struct _INIFILE_MAPPING_TARGET
+{
+ struct _INIFILE_MAPPING_TARGET *Next;
+ UNICODE_STRING RegistryPath;
+} INIFILE_MAPPING_TARGET, *PINIFILE_MAPPING_TARGET;
+
+typedef struct _INIFILE_MAPPING_VARNAME
+{
+ struct _INIFILE_MAPPING_VARNAME *Next;
+ UNICODE_STRING Name;
+ ULONG MappingFlags;
+ PINIFILE_MAPPING_TARGET MappingTarget;
+} INIFILE_MAPPING_VARNAME, *PINIFILE_MAPPING_VARNAME;
+
+typedef struct _INIFILE_MAPPING_APPNAME
+{
+ struct _INIFILE_MAPPING_APPNAME *Next;
+ UNICODE_STRING Name;
+ PINIFILE_MAPPING_VARNAME VariableNames;
+ PINIFILE_MAPPING_VARNAME DefaultVarNameMapping;
+} INIFILE_MAPPING_APPNAME, *PINIFILE_MAPPING_APPNAME;
+
+typedef struct _INIFILE_MAPPING_FILENAME
+{
+ struct _INIFILE_MAPPING_FILENAME *Next;
+ UNICODE_STRING Name;
+ PINIFILE_MAPPING_APPNAME ApplicationNames;
+ PINIFILE_MAPPING_APPNAME DefaultAppNameMapping;
+} INIFILE_MAPPING_FILENAME, *PINIFILE_MAPPING_FILENAME;
+
+typedef struct _INIFILE_MAPPING
+{
+ PINIFILE_MAPPING_FILENAME FileNames;
+ PINIFILE_MAPPING_FILENAME DefaultFileNameMapping;
+ PINIFILE_MAPPING_FILENAME WinIniFileMapping;
+ ULONG Reserved;
+} INIFILE_MAPPING, *PINIFILE_MAPPING;
+
typedef struct _BASE_STATIC_SERVER_DATA
{
UNICODE_STRING WindowsDirectory;
Modified: trunk/reactos/subsystems/win/basesrv/init.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win/basesrv/ini…
==============================================================================
--- trunk/reactos/subsystems/win/basesrv/init.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win/basesrv/init.c [iso-8859-1] Wed Sep 4 07:07:08 2013
@@ -23,6 +23,8 @@
HANDLE BaseSrvHeap = NULL; // Our own heap.
HANDLE BaseSrvSharedHeap = NULL; // Shared heap with CSR. (CsrSrvSharedSectionHeap)
PBASE_STATIC_SERVER_DATA BaseStaticServerData = NULL; // Data that we can share amongst
processes. Initialized inside BaseSrvSharedHeap.
+
+PINIFILE_MAPPING BaseSrvIniFileMapping;
// Windows Server 2003 table from
http://j00ru.vexillium.org/csrss_list/api_list.html#Windows_2k3
PCSR_API_ROUTINE BaseServerApiDispatchTable[BasepMaxApiNumber - BASESRV_FIRST_API_NUMBER]
=
@@ -130,8 +132,28 @@
"BaseNlsGetUserInfo",
};
-
/* FUNCTIONS ******************************************************************/
+
+NTSTATUS
+NTAPI
+BaseSrvInitializeIniFileMappings(IN PBASE_STATIC_SERVER_DATA StaticServerData)
+{
+ /* Allocate the mapping blob */
+ BaseSrvIniFileMapping = RtlAllocateHeap(BaseSrvHeap,
+ HEAP_ZERO_MEMORY,
+ sizeof(*BaseSrvIniFileMapping));
+ if (BaseSrvIniFileMapping == NULL)
+ {
+ DPRINT1("BASESRV: Unable to allocate memory in shared heap for
IniFileMapping\n");
+ return STATUS_NO_MEMORY;
+ }
+
+ /* Set it*/
+ StaticServerData->IniFileMapping = BaseSrvIniFileMapping;
+
+ /* FIXME: Do the work to initialize the mappings */
+ return STATUS_SUCCESS;
+}
NTSTATUS
NTAPI
@@ -418,6 +440,10 @@
NULL);
ASSERT(NT_SUCCESS(Status));
+ /* Setup the ini file mappings */
+ Status = BaseSrvInitializeIniFileMappings(BaseStaticServerData);
+ ASSERT(NT_SUCCESS(Status));
+
/* FIXME: Should query the registry for these */
BaseStaticServerData->DefaultSeparateVDM = FALSE;
BaseStaticServerData->IsWowTaskReady = FALSE;