Author: arty
Date: Sun Aug 19 09:02:31 2007
New Revision: 28415
URL: http://svn.reactos.org/svn/reactos?rev=28415&view=rev
Log:
Fix part two of the bug:
The actual problem was that we'd overrun the end of the handle count array
when decrementing. This also led to a handle leak (observed). Stop correctly
when we find the handle we want.
Modified:
trunk/reactos/ntoskrnl/ob/obhandle.c
Modified: trunk/reactos/ntoskrnl/ob/obhandle.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/obhandle.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/ob/obhandle.c (original)
+++ trunk/reactos/ntoskrnl/ob/obhandle.c Sun Aug 19 09:02:31 2007
@@ -331,6 +331,8 @@
/* Insert a new entry */
FreeEntry = ObpInsertHandleCount(ObjectHeader);
if (!FreeEntry) return STATUS_INSUFFICIENT_RESOURCES;
+ ASSERT(!FreeEntry->Process);
+ ASSERT(!FreeEntry->HandleCount);
/* Fill it out */
FreeEntry->Process = Process;
@@ -375,6 +377,8 @@
/* Allocate one */
FreeEntry = ObpInsertHandleCount(ObjectHeader);
if (!FreeEntry) return STATUS_INSUFFICIENT_RESOURCES;
+ ASSERT(!FreeEntry->Process);
+ ASSERT(!FreeEntry->HandleCount);
}
/* Fill out the entry */
@@ -533,6 +537,7 @@
{
/* Found it, get the process handle count */
ProcessHandleCount = HandleEntry->HandleCount--;
+ break;
}
/* Keep looping */
Author: cfinck
Date: Sun Aug 19 02:06:00 2007
New Revision: 28414
URL: http://svn.reactos.org/svn/reactos?rev=28414&view=rev
Log:
Use host_gpp instead of host_gcc for building "ssprintf.cpp" and "tools.cpp".
These are C++ files, so they should be built with g++ like it's done for the other tools. Usually they can also be built with gcc, but Collibri from IRC reported that broken gcc interfaces exist, which lead to problems with these files.
Modified:
trunk/reactos/tools/tools.mak
Modified: trunk/reactos/tools/tools.mak
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/tools.mak?rev=28414&…
==============================================================================
--- trunk/reactos/tools/tools.mak (original)
+++ trunk/reactos/tools/tools.mak Sun Aug 19 02:06:00 2007
@@ -34,11 +34,11 @@
$(TOOLS_INT_)ssprintf.o: $(TOOLS_BASE_)ssprintf.cpp $(XML_SSPRINTF_HEADERS) | $(TOOLS_INT)
$(ECHO_CC)
- ${host_gcc} $(TOOLS_CPPFLAGS) -c $< -o $@
+ ${host_gpp} $(TOOLS_CPPFLAGS) -c $< -o $@
$(TOOLS_INT_)xml.o: $(TOOLS_BASE_)xml.cpp $(XML_SSPRINTF_HEADERS) | $(TOOLS_INT)
$(ECHO_CC)
- ${host_gcc} $(TOOLS_CPPFLAGS) -c $< -o $@
+ ${host_gpp} $(TOOLS_CPPFLAGS) -c $< -o $@
include tools/bin2c.mak
include tools/bin2res/bin2res.mak
Author: cfinck
Date: Sun Aug 19 01:10:14 2007
New Revision: 28411
URL: http://svn.reactos.org/svn/reactos?rev=28411&view=rev
Log:
Include windef.h, which then includes winnt.h, which uses our wchar_t check and reports the wchar_t definition back to the host.
Then the host finally knows that it should not define wchar_t again.
Modified:
trunk/reactos/tools/unicode/cptable.c
Modified: trunk/reactos/tools/unicode/cptable.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/unicode/cptable.c?re…
==============================================================================
--- trunk/reactos/tools/unicode/cptable.c (original)
+++ trunk/reactos/tools/unicode/cptable.c Sun Aug 19 01:10:14 2007
@@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <windef.h>
#include <stdlib.h>
#include "wine/unicode.h"
Author: cfinck
Date: Sun Aug 19 00:30:12 2007
New Revision: 28410
URL: http://svn.reactos.org/svn/reactos?rev=28410&view=rev
Log:
Fix the logic for the wchar_t checks.
We don't only need to check if wchar_t has already been defined, but also report this to all known hosts and operating systems.
Modified:
trunk/reactos/include/psdk/winnt.h
Modified: trunk/reactos/include/psdk/winnt.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winnt.h?rev=2…
==============================================================================
--- trunk/reactos/include/psdk/winnt.h (original)
+++ trunk/reactos/include/psdk/winnt.h Sun Aug 19 00:30:12 2007
@@ -50,22 +50,38 @@
#include <basetsd.h>
#include <guiddef.h>
+/* wchar_t checks
+ * First check if wchar_t has already been defined by any host/OS */
+#ifndef _WCHAR_T_DEFINED
+#ifndef _WCHAR_T_DECLARED /* for FreeBSD 5 and later */
+#ifndef _WCHAR_T /* for Mac OS X */
+#ifndef _WCHAR_T_
+#undef __need_wchar_t
+#ifndef __cplusplus
+ typedef unsigned short wchar_t;
+#endif
+#endif
+#endif
+#endif
+#endif
+
+/* Now report that it has been defined to all known hosts/operating systems */
#ifndef _WCHAR_T_DEFINED
#define _WCHAR_T_DEFINED
-#ifndef _WCHAR_T_DECLARED /* for FreeBSD 5 and later */
+#endif
+
+#ifndef _WCHAR_T_DECLARED
#define _WCHAR_T_DECLARED
-#ifndef _WCHAR_T /* for Mac OS X */
+#endif
+
+#ifndef _WCHAR_T
#define _WCHAR_T
+#endif
+
#ifndef _WCHAR_T_
#define _WCHAR_T_
-#undef __need_wchar_t
-#ifndef __cplusplus
-typedef unsigned short wchar_t;
-#endif
-#endif
-#endif
-#endif
-#endif
+#endif
+
#include <ctype.h>
#include <winerror.h>