Fix silly bugs in Critical section code. Thanks to Gunnar for finding
one of them, thanks to mifritscher for finding the actual regression,
and thanks to Filip for being understanding :P
Modified: trunk/reactos/include/ntdll/rtl.h
Modified: trunk/reactos/lib/ntdll/rtl/critical.c
_____
Modified: trunk/reactos/include/ntdll/rtl.h
--- trunk/reactos/include/ntdll/rtl.h 2005-01-03 23:35:02 UTC (rev
12771)
+++ trunk/reactos/include/ntdll/rtl.h 2005-01-04 00:10:50 UTC (rev
12772)
@@ -99,7 +99,6 @@
LIST_ENTRY ProcessLocksList;
ULONG EntryCount;
ULONG ContentionCount;
- PVOID OwnerBackTrace[2];
PVOID Spare[2];
} CRITICAL_SECTION_DEBUG, *PCRITICAL_SECTION_DEBUG;
_____
Modified: trunk/reactos/lib/ntdll/rtl/critical.c
--- trunk/reactos/lib/ntdll/rtl/critical.c 2005-01-03 23:35:02 UTC
(rev 12771)
+++ trunk/reactos/lib/ntdll/rtl/critical.c 2005-01-04 00:10:50 UTC
(rev 12772)
@@ -16,7 +16,7 @@
#include <ntdll/rtl.h>
#include <ntos/synch.h>
-#define NDEBUG
+//#define NDEBUG
#include <ntdll/ntdll.h>
/* FUNCTIONS
*****************************************************************/
@@ -146,6 +146,7 @@
}
/* We don't own it, so we must wait for it */
+ DPRINT ("Waiting\n");
RtlpWaitForCriticalSection(CriticalSection);
}
@@ -486,14 +487,16 @@
/* Chevk if we have an event */
if (!hEvent) {
+ DPRINT ("Creating Event\n");
/* No, so create it */
- if (NT_SUCCESS(Status = NtCreateEvent(hNewEvent,
- EVENT_ALL_ACCESS,
- NULL,
- SynchronizationEvent,
- FALSE))) {
+ if (!NT_SUCCESS(Status = NtCreateEvent(&hNewEvent,
+ EVENT_ALL_ACCESS,
+ NULL,
+ SynchronizationEvent,
+ FALSE))) {
/* We failed, this is bad... */
+ DPRINT1("Failed to Create Event!\n");
InterlockedDecrement(&CriticalSection->LockCount);
RtlRaiseStatus(Status);
return;
@@ -508,11 +511,13 @@
} else {
/* Some just created an event */
+ DPRINT("Closing already created event!\n");
NtClose(hNewEvent);
}
/* Set either the new or the old */
CriticalSection->LockSemaphore = hEvent;
+ DPRINT("Event set!\n");
}
return;
added ntagp.h
Added: trunk/reactos/w32api/include/ddk/ntagp.h
_____
Added: trunk/reactos/w32api/include/ddk/ntagp.h
--- trunk/reactos/w32api/include/ddk/ntagp.h 2005-01-03 23:04:52 UTC
(rev 12767)
+++ trunk/reactos/w32api/include/ddk/ntagp.h 2005-01-03 23:12:56 UTC
(rev 12768)
@@ -0,0 +1,111 @@
+/*
+ * ntagp.h
+ *
+ * NT AGP bus driver interface
+ *
+ * This file is part of the w32api package.
+ *
+ * Contributors:
+ * Created by Gregor Anich <blight(a)blight.eu.org>
+ *
+ * THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ * This source code is offered for use in the public domain. You may
+ * use, modify or distribute it freely.
+ *
+ * This code is distributed in the hope that it will be useful but
+ * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ * DISCLAIMED. This includes but is not limited to warranties of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ */
+
+#ifndef __NTAGP_H
+#define __NTAGP_H
+
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "ntddk.h"
+#include "video.h"
+
+
+#define AGP_BUS_INTERFACE_V1 1L
+#define AGP_BUS_INTERFACE_V2 2L
+
+/* Indicates wether the GART supports mapping of physical memory for
the CPU */
+#define AGP_CAPABILITIES_MAP_PHYSICAL 0x00000001L
+
+typedef NTSTATUS
+(DDKAPI *PAGP_BUS_COMMIT_MEMORY)(
+ IN PVOID AgpContext,
+ IN PVOID MapHandle,
+ IN ULONG NumberOfPages,
+ IN ULONG OffsetInPages,
+ IN OUT PMDL Mdl OPTIONAL,
+ OUT PHYSICAL_ADDRESS *MemoryBase);
+
+typedef NTSTATUS
+(DDKAPI *PAGP_BUS_FREE_MEMORY)(
+ IN PVOID AgpContext,
+ IN PVOID MapHandle,
+ IN ULONG NumberOfPages,
+ IN ULONG OffsetInPages);
+
+typedef NTSTATUS
+(DDKAPI *PAGP_BUS_RELEASE_MEMORY)(
+ IN PVOID AgpContext,
+ IN PVOID MapHandle);
+
+typedef NTSTATUS
+(DDKAPI *PAGP_BUS_RESERVE_MEMORY)(
+ IN PVOID AgpContext,
+ IN ULONG NumberOfPages,
+ IN MEMORY_CACHING_TYPE MemoryType,
+ OUT PVOID *MapHandle,
+ OUT PHYSICAL_ADDRESS *PhysicalAddress OPTIONAL);
+
+typedef NTSTATUS
+(DDKAPI *PAGP_BUS_SET_RATE)(
+ IN PVOID AgpContext,
+ IN ULONG AgpRate);
+
+typedef NTSTATUS
+(DDKAPI *PAGP_GET_MAPPED_PAGES)(
+ IN PVOID AgpContext,
+ IN PVOID MapHandle,
+ IN ULONG NumberOfPages,
+ IN ULONG OffsetInPages,
+ OUT PMDL Mdl);
+
+typedef struct _AGP_BUS_INTERFACE_STANDARD {
+ USHORT Size;
+ USHORT Version;
+ PVOID AgpContext;
+ PINTERFACE_REFERENCE InterfaceReference;
+ PINTERFACE_DEREFERENCE InterfaceDereference;
+
+ ULONG Capabilities;
+ PAGP_BUS_RESERVE_MEMORY ReserveMemory;
+ PAGP_BUS_RELEASE_MEMORY ReleaseMemory;
+ PAGP_BUS_COMMIT_MEMORY CommitMemory;
+ PAGP_BUS_FREE_MEMORY FreeMemory;
+ PAGP_GET_MAPPED_PAGES GetMappedPages;
+ PAGP_BUS_SET_RATE SetRate;
+} AGP_BUS_INTERFACE_STANDARD, *PAGP_BUS_INTERFACE_STANDARD;
+
+#define AGP_BUS_INTERFACE_V2_SIZE sizeof(AGP_BUS_INTERFACE_STANDARD)
+#define AGP_BUS_INTERFACE_V1_SIZE \
+ (AGP_BUS_INTERFACE_V2_SIZE - sizeof(PAGP_BUS_SET_RATE))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __NTAGP_H */
+