Hi all!
When running AbiWord this is happening. Everything works, just more of these errors.
I think the first clue is this next line,
(subsys/win32k/m(subsys/win32k/objects/gdiobj.c:1289) Attempted to change owner
isc/object.c:50) ObjectHeader 0x8D0E0140 has invalid reference count (-2)
(subsys/win32k/misc/object.c:50) ObjectHeader 0x8D0E6808 has invalid reference c
ount (-2)
(subsys/win32k/misc/object.c:50) ObjectHeade
ship of object 0x2304035f (pid: 0x12c) from pid 0x128!!!
(subsys/win32k/objects/gdiobj.c:589) Attempted to free foreign handle: 0x2304035
f Owner: 0x12c from Caller: 0x128
r 0x8D0E65B8 has invalid reference count (-2)
(subsys/win32k/misc/object.c:50) ObjectHeader 0x8D0E0140 has invalid reference c
ount (-2)
(subsys/win32k/misc/object.c:50) ObjectHeader 0x8D0E6808 has invalid reference c
ount (-2)
(subsys/win32k/misc/object.c:50) ObjectHeader 0x8D0E65B8 has invalid reference c
ount (-2)
(subsys/win32k/misc/object.c:50) ObjectHeader 0x8D0E0140 has invalid reference c
ount (-2)
(subsys/win32k/misc/object.c:50) ObjectHeader 0x8D0E6808 has invalid reference c
ount (-2)
on and on
Thanks,
James
greatlrd(a)svn.reactos.com wrote:
>The return size calculation's of GetEnvironmentVariable string was wrong. Thx to <Bizzy_D> to find out cd %windir% did not work. Now it will
>
>Modified: trunk/reactos/lib/kernel32/misc/env.c
>
>
> ------------------------------------------------------------------------
> *Modified: trunk/reactos/lib/kernel32/misc/env.c*
>
>--- trunk/reactos/lib/kernel32/misc/env.c 2005-07-10 22:05:48 UTC (rev 16527)
>+++ trunk/reactos/lib/kernel32/misc/env.c 2005-07-10 22:12:07 UTC (rev 16528)
>@@ -70,7 +70,7 @@
>
>@@ -133,7 +133,7 @@
>
>
> }
> }
>
>
>
>- return (VarValue.Length / sizeof(WCHAR));
>
>
>+ return (VarValue.Length / sizeof(WCHAR) + sizeof(WCHAR));
>
>
> }
>
>
>
>
Hi,
this change is wrong. The MSDN library says:
If the function succeeds, the return value is the number of TCHARs
stored into the buffer pointed to by /lpBuffer/, not including the
terminating null character.
Please revert your change.
- Hartmut
> + VarValue.MaximumLength = (nSize != 0 ? (nSize - 1) * sizeof(WCHAR) : 0);
>
> VarValue.Buffer = lpBuffer;
>
> Status = RtlQueryEnvironmentVariable_U (NULL,
> @@ -125,13 +150,17 @@
>
> SetLastErrorByStatus (Status);
> if (Status == STATUS_BUFFER_TOO_SMALL)
> {
>
> - return (VarValue.Length / sizeof(WCHAR)) + 1;
>
> + return (VarValue.Length / sizeof(WCHAR)) + 1;
>
> }
> else
> {
> return 0;
> }
> }
>
> +
> + /* make sure the string is NULL-terminated! RtlQueryEnvironmentVariable_U
> + only terminates it if MaximumLength < Length */
> + VarValue.Buffer[VarValue.Length / sizeof(WCHAR)] = L'\0';
Is it possible for an environment variable's value to be empty?
If it is, RtlQueryEnvironmentVariable_U() could succeeded even
if a zero length buffer is passed in. And then, would we crash
appending the NUL termination?
Since GetEnvironmentVariable has to have a buffer of at least
one character to succeed, maybe we should add such a guard to
the top of the function...
Thanks,
Joseph
Hi all,
Bored again, decided to build ros on ros.
Getting this,
(subsys/csrss/api/handle.c:75) CsrGetObject returning invalid handle
(KERNEL32:lib/kernel32/mem/global.c:412) Memory Load: 11
(KERNEL32:lib/kernel32/mem/global.c:412) Memory Load: 11
(subsys/csrss/api/handle.c:75) CsrGetObject returning invalid handle
(subsys/csrss/api/handle.c:75) CsrGetObject returning invalid handle
Things I noticed may have been fixed,
Multi cmd problem, handle count going throw the roof and hangs.
Thanks,
James
Hi!
When compiling ros on ros this happens. The build process, well nothing has changed
for more than a year, except cmd and the dlls.
make[2]: Entering directory `C:/ros/reactos/apps/utils/rundl32'
windres --include-dir ../../../include --include-dir ../../../w32api/include ru
ndll32.rc -o rundll32.coff
gcc -DUNICODE -Wall -Werror -D__USE_W32API -I. -I../../../include -I../../../w32
api/include -pipe -march=i386 -D_M_IX86 -c rundll32.c -o rundll32.o
make[2]: *** No rule to make target `../../../dk/w32/lib/user32.a', needed by `r
undll32.nostrip.exe'. Stop.
I use a old build to test ros with. It gives ros hell and it is small too. Doesnt
use much disk space.
Thanks,
James
Hi
a new branch ros-branch-0_2_7 * r16538 exists, now.
Please be cautious in terms of to which branch you commit and that this
branch remains buildable.
The next days there will be a binary distribution as RC1 whilst RC2 or
final will follow.
It seems like there is some uncertainty between this
code and RtlQueryEnvironmentVariable_U about who is
going to ensure that the string returned from
GetEnvironmentVariable() is nul terminated...
If I read the code in RtlQueryEnvironmentVariable_U
correctly (and I don't swear I have), it is possible
for it to return STATUS_SUCCESS and not copy a
NUL terminator. This happens if the buffer is large
enough to contain the value but not the NUL terminator.
This is probably correct for this function since
UNICODE_STRINGs (and the Rtl* library) generally have
no requirement of a NUL terminator.
But then, if I read the code in GetEnvironmentVariable()
correctly, I don't believe it takes this situation into
account.
Probably, it would be best if RtlQueryEnvironmentVariable_U
_never_ copied the NUL terminator, and the caller was
always responsible for adding NUL termination, if needed.
Thanks,
Joseph
PS. MSDN is slightly unclear (to me) on how it should behave
in this case, but it seems unlikely that the real
GetEnvironmentVariable() returns success and a non-nul-terminated
string. But I haven't written a test program to prove it.
weiden(a)svn.reactos.com wrote:
> return the length of the string excluding the null-termination character on success in GetEnvironmentVariable(). Thanks to Hartmut.
>
> Modified: trunk/reactos/lib/kernel32/misc/env.c
>
> ------------------------------------------------------------------------
> *Modified: trunk/reactos/lib/kernel32/misc/env.c*
>
> --- trunk/reactos/lib/kernel32/misc/env.c 2005-07-11 18:22:53 UTC (rev 16535)
> +++ trunk/reactos/lib/kernel32/misc/env.c 2005-07-11 20:30:33 UTC (rev 16536)
> @@ -91,7 +91,7 @@
>
> /* free unicode variable name string */
> RtlFreeUnicodeString (&VarNameU);
>
>
> - return (VarValueU.Length / sizeof(WCHAR) + 1);
>
> + return (VarValueU.Length / sizeof(WCHAR));
>
> }
>
>
> @@ -133,7 +133,7 @@
>
> }
> }
>
>
> - return (VarValue.Length / sizeof(WCHAR) + 1);
>
> + return (VarValue.Length / sizeof(WCHAR));
>
> }
>
>
>