Author: pschweitzer
Date: Mon Jan 11 22:41:32 2016
New Revision: 70578
URL: http://svn.reactos.org/svn/reactos?rev=70578&view=rev
Log:
[ROSVBOXMGMT]
Let's add hacks to glue hacks together:
In case rosvboxmgmt is started with its current directory not being the directory where it is along with hackssign_client.exe, then autoassign fails finding the hackssign client executable and thus, fails assigning drive letter.
This is what happens when you starts rosvboxmgmt on boot with shell.
So, when using autoassign, first look for the location of rosvboxmgmt and set our current directory there.
This fixes rosvboxmgmt autoassign not working on boot.
CORE-10032
ROSAPPS-303
Modified:
trunk/rosapps/applications/cmdutils/rosvboxmgmt/rosvboxmgmt.c
Modified: trunk/rosapps/applications/cmdutils/rosvboxmgmt/rosvboxmgmt.c
URL: http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/cmdutils/rosv…
==============================================================================
--- trunk/rosapps/applications/cmdutils/rosvboxmgmt/rosvboxmgmt.c [iso-8859-1] (original)
+++ trunk/rosapps/applications/cmdutils/rosvboxmgmt/rosvboxmgmt.c [iso-8859-1] Mon Jan 11 22:41:32 2016
@@ -297,6 +297,14 @@
if (assign)
{
+ wchar_t path[MAX_PATH];
+ if (GetModuleFileName(NULL, path, ARRAYSIZE(path)) != 0)
+ {
+ *(wcsrchr(path, '\\')) = 0;
+ wprintf(L"Switching to %s\n", path);
+ SetCurrentDirectory(path);
+ }
+
if (OpenFile("hackssign_client.exe", &ofs, OF_EXIST) != 1)
{
wprintf(L"hackssign_client.exe not found, falling back to links\n");
Author: hbelusca
Date: Mon Jan 11 00:37:44 2016
New Revision: 70575
URL: http://svn.reactos.org/svn/reactos?rev=70575&view=rev
Log:
[NTOS:CONFIG]
Remove a very old hack (that dated back from the Configuration Manager rewrite): now the hives are already correctly loaded in memory, therefore there is no need to call CmCreateRootNode after creating a hive, because the root node is subsequently initialized with calls to CmpCreateLinkNode. The comment saying that calls to CmCreateRootNode can be removed when CmpCreateLinkNode is used, is now in order. This means we correctly parse & mount the hives. The CmCreateRootNode function is now only used in the 'mkhive' tool in order to create file hives, since this tool needs to create new hives from nowhere (that's why also our bootloaders do not need this function: they only load & parse existing hive files).
The fact that this hack remained caused us hidden troubles: some hives (SAM, SOFTWARE) had "two" root keys: a first one that was unused (which was created by this hackish call), and the second one which was the one used (and was created by CmpCreateLinkNode as expected).
Modified:
trunk/reactos/ntoskrnl/config/cmparse.c
trunk/reactos/ntoskrnl/config/cmsysini.c
Modified: trunk/reactos/ntoskrnl/config/cmparse.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmparse.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmparse.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmparse.c [iso-8859-1] Mon Jan 11 00:37:44 2016
@@ -715,7 +715,6 @@
return Status;
}
-/* Remove calls to CmCreateRootNode once this is used! */
NTSTATUS
NTAPI
CmpCreateLinkNode(IN PHHIVE Hive,
Modified: trunk/reactos/ntoskrnl/config/cmsysini.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmsysini.c…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmsysini.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmsysini.c [iso-8859-1] Mon Jan 11 00:37:44 2016
@@ -370,9 +370,6 @@
/* Success, return hive */
*Hive = NewHive;
-
- /* HACK: ROS: Init root key cell and prepare the hive */
- if (Operation == HINIT_CREATE) CmCreateRootNode(&NewHive->Hive, L"");
/* Duplicate the hive name */
NewHive->FileFullPath.Buffer = ExAllocatePoolWithTag(PagedPool,