Author: fireball
Date: Thu Aug 28 10:37:57 2008
New Revision: 35732
URL: http://svn.reactos.org/svn/reactos?rev=35732&view=rev
Log:
- Use CmpCompressedNameSize to obtain the compressed name length (I'll convert the other part of the routine to use CmpCopyCompressedName later, instead of assuming the current way of things).
- Fix incorrect freeing of a buffer returned by a call to CmpConstructName (spotted by Stefan Ginsberg).
- Changes in a couple of comments for better description, and a couple of 80col exceeders fixed.
Modified:
trunk/reactos/ntoskrnl/config/cmkcbncb.c
trunk/reactos/ntoskrnl/config/cmsysini.c
Modified: trunk/reactos/ntoskrnl/config/cmkcbncb.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmkcbncb.c…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmkcbncb.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmkcbncb.c [iso-8859-1] Thu Aug 28 10:37:57 2008
@@ -898,7 +898,7 @@
PWCHAR TargetBuffer, CurrentNameW;
PUCHAR CurrentName;
- /* Calculate how much size our key name is going to occupy */
+ /* Calculate how much size our key name is going to occupy */
NameLength = 0;
MyKcb = Kcb;
@@ -906,11 +906,16 @@
{
/* Add length of the name */
if (!MyKcb->NameBlock->Compressed)
+ {
NameLength += MyKcb->NameBlock->NameLength;
+ }
else
- NameLength += MyKcb->NameBlock->NameLength * sizeof(WCHAR);
-
- /* Sum up the separator also */
+ {
+ NameLength += CmpCompressedNameSize(MyKcb->NameBlock->Name,
+ MyKcb->NameBlock->NameLength);
+ }
+
+ /* Sum up the separator too */
NameLength += sizeof(WCHAR);
/* Go to the parent KCB */
@@ -918,10 +923,13 @@
}
/* Allocate the unicode string now */
- KeyName = ExAllocatePoolWithTag(PagedPool, NameLength + sizeof(UNICODE_STRING), TAG_CM);
+ KeyName = ExAllocatePoolWithTag(PagedPool,
+ NameLength + sizeof(UNICODE_STRING),
+ TAG_CM);
if (!KeyName) return NULL;
+ /* Set it up */
KeyName->Buffer = (PWSTR)(KeyName + 1);
KeyName->Length = NameLength;
KeyName->MaximumLength = NameLength;
@@ -932,7 +940,7 @@
while (MyKcb)
{
- /* Sanity checks for deleted keys */
+ /* Sanity checks for deleted and fake keys */
if ((!MyKcb->KeyCell && !MyKcb->Delete) ||
!MyKcb->KeyHive ||
MyKcb->ExtFlags & CM_KCB_KEY_NON_EXIST)
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] Thu Aug 28 10:37:57 2008
@@ -159,7 +159,7 @@
(Length < (*ReturnLength - sizeof(OBJECT_NAME_INFORMATION))))
{
/* Free the buffer allocated by CmpConstructName */
- ExFreePool(KeyName->Buffer);
+ ExFreePool(KeyName);
/* Return buffer length failure */
return STATUS_INFO_LENGTH_MISMATCH;
@@ -174,7 +174,9 @@
ObjectNameInfo->Name.Length = KeyName->Length;
/* Copy string content*/
- RtlCopyMemory(ObjectNameInfo->Name.Buffer, KeyName->Buffer, *ReturnLength);
+ RtlCopyMemory(ObjectNameInfo->Name.Buffer,
+ KeyName->Buffer,
+ *ReturnLength);
}
_SEH_HANDLE
{
@@ -186,6 +188,7 @@
/* Free the buffer allocated by CmpConstructName */
ExFreePool(KeyName);
+ /* Return status */
return Status;
}
Author: dreimer
Date: Thu Aug 28 05:06:30 2008
New Revision: 35726
URL: http://svn.reactos.org/svn/reactos?rev=35726&view=rev
Log:
Try to fix updater to REALLY work... Well. Next stupidity of Batch. Processing further without finished stuff before... (vars made with the help of for loops are still empty when needed) Feel free to help me.
Modified:
trunk/tools/RosBE/RosBE-Windows/Root/update.cmd
Modified: trunk/tools/RosBE/RosBE-Windows/Root/update.cmd
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/upd…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Root/update.cmd [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Root/update.cmd [iso-8859-1] Thu Aug 28 05:06:30 2008
@@ -19,12 +19,13 @@
::
:: The Update Server.
::
-set _ROSBE_URL=www.foo.bar
+set _ROSBE_URL=http://mitglied.lycos.de/reimerdaniel/rosbe
::
:: Default Variables.
::
set _ROSBE_OPATH=%~dp0
+set _ROSBE_OPATH=%_ROSBE_OPATH:~0,-1%
set _ROSBE_CMDS=yes
set _ROSBE_GCC=yes
set _ROSBE_TOOLS=yes
@@ -59,9 +60,15 @@
::
:: First check for a new Updater
::
+ for /f "usebackq" %%i in (`"forfiles /M update.cmd /C "cmd /c echo @fdate""`) do set _ROSBE_UPDDATE=%%i
"Tools\wget.exe" -N --ignore-length %_ROSBE_URL%/update.cmd
- "%_ROSBE_BASEDIR%\update.cmd"
-
+ for /f "usebackq" %%i in (`"forfiles /M update.cmd /C "cmd /c echo @fdate""`) do set _ROSBE_UPDDATE2=%%i
+
+ if %_ROSBE_UPDDATE% NEQ %_ROSBE_UPDDATE2% (
+ cls
+ echo Updater got updated and needs to be restarted.
+ goto :EOU
+ )
::
:: PS1 Files.
::
@@ -148,6 +155,8 @@
::
if exist GCC.7z (
for /f "usebackq" %%i in (`"forfiles /M GCC.7z /C "cmd /c echo @fdate""`) do set _ROSBE_GCCDATE=%%i
+ ) else (
+ set _ROSBE_GCCDATE=0
)
"Tools\wget.exe" -N --ignore-length %_ROSBE_URL%/GCC.7z
@@ -170,6 +179,8 @@
::
if exist Tools.7z (
for /f "usebackq" %%i in (`"forfiles /M Tools.7z /C "cmd /c echo @fdate""`) do set _ROSBE_TOOLSDATE=%%i
+ ) else (
+ set _ROSBE_TOOOLSDATE=0
)
"Tools\wget.exe" -N --ignore-length %_ROSBE_URL%/Tools.7z
@@ -206,6 +217,8 @@
set _ROSBE_TOOLS=
set _ROSBE_PARAM=
set _ROSBE_OPATH=
+set _ROSBE_UPDDATE=
+set _ROSBE_UPDDATE2=
if defined _ROSBE_VERSION (