strip whitespace from end of lines
Modified: trunk/reactos/lib/ntdll/csr/capture.c
Modified: trunk/reactos/lib/ntdll/csr/lpc.c
Modified: trunk/reactos/lib/ntdll/ldr/res.c
Modified: trunk/reactos/lib/ntdll/ldr/startup.c
Modified: trunk/reactos/lib/ntdll/ldr/utils.c
Modified: trunk/reactos/lib/ntdll/main/dllmain.c
Modified: trunk/reactos/lib/ntdll/rtl/apc.c
Modified: trunk/reactos/lib/ntdll/rtl/callback.c
Modified: trunk/reactos/lib/ntdll/rtl/crc32.c
Modified: trunk/reactos/lib/ntdll/rtl/critical.c
Modified: trunk/reactos/lib/ntdll/rtl/dbgbuffer.c
Modified: trunk/reactos/lib/ntdll/rtl/exception.c
Modified: trunk/reactos/lib/ntdll/rtl/handle.c
Modified: trunk/reactos/lib/ntdll/rtl/intrlck.c
Modified: trunk/reactos/lib/ntdll/rtl/libsupp.c
Modified: trunk/reactos/lib/ntdll/rtl/misc.c
Modified: trunk/reactos/lib/ntdll/rtl/path.c
Modified: trunk/reactos/lib/ntdll/rtl/process.c
Modified: trunk/reactos/lib/ntdll/rtl/propvar.c
Modified: trunk/reactos/lib/ntdll/rtl/resource.c
Modified: trunk/reactos/lib/ntdll/rtl/teb.c
Modified: trunk/reactos/lib/ntdll/stdio/sprintf.c
Modified: trunk/reactos/lib/ntdll/stdio/swprintf.c
Modified: trunk/reactos/lib/ntdll/stdlib/itoa.c
Modified: trunk/reactos/lib/ntdll/stdlib/itow.c
Modified: trunk/reactos/lib/ntdll/string/strlwr.c
Modified: trunk/reactos/lib/ntdll/string/strupr.c
_____
Modified: trunk/reactos/lib/ntdll/csr/capture.c
--- trunk/reactos/lib/ntdll/csr/capture.c 2005-05-09 01:42:07 UTC
(rev 15167)
+++ trunk/reactos/lib/ntdll/csr/capture.c 2005-05-09 01:43:25 UTC
(rev 15168)
@@ -34,7 +34,7 @@
)
{
/* FIXME: implement it! */
- return NULL;
+ return NULL;
}
/*
@@ -99,7 +99,7 @@
{
if (Milliseconds == -1)
return NULL;
-
+
Timeout->QuadPart = Milliseconds * -100000;
return Timeout;
}
_____
Modified: trunk/reactos/lib/ntdll/csr/lpc.c
--- trunk/reactos/lib/ntdll/csr/lpc.c 2005-05-09 01:42:07 UTC (rev
15167)
+++ trunk/reactos/lib/ntdll/csr/lpc.c 2005-05-09 01:43:25 UTC (rev
15168)
@@ -52,7 +52,7 @@
PVOID Unknown OPTIONAL,
CSR_CCS_API CsrApi,
ULONG SizeOfData);
-
+
Request is the family of PCSRSS_XXX_REQUEST objects.
XXX_REQUEST depend on the CsrApiNumber.Index.
@@ -97,20 +97,20 @@
ULONG ReplyLength)
{
NTSTATUS Status;
-
+
if (INVALID_HANDLE_VALUE == WindowsApiPort)
{
DbgPrint ("NTDLL.%s: client not connected to CSRSS!\n",
__FUNCTION__);
return (STATUS_UNSUCCESSFUL);
}
-
+
Request->Header.DataSize = Length - sizeof(LPC_MESSAGE);
Request->Header.MessageSize = Length;
-
+
Status = NtRequestWaitReplyPort(WindowsApiPort,
&Request->Header,
(Reply?&Reply->Header:&Request->Header));
-
+
return(Status);
}
@@ -181,7 +181,7 @@
{
return(STATUS_NO_MEMORY);
}
-
+
Request.Type = CSRSS_CONNECT_PROCESS;
Status = CsrClientCallServer(&Request,
&Reply,
_____
Modified: trunk/reactos/lib/ntdll/ldr/res.c
--- trunk/reactos/lib/ntdll/ldr/res.c 2005-05-09 01:42:07 UTC (rev
15167)
+++ trunk/reactos/lib/ntdll/ldr/res.c 2005-05-09 01:43:25 UTC (rev
15168)
@@ -1,5 +1,5 @@
/* $Id$
- *
+ *
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: lib/ntdll/ldr/res.c
@@ -63,7 +63,7 @@
high = mid - 1;
else
low = mid + 1;
-
+
mid = (low + high)/2;
}
@@ -157,7 +157,7 @@
high = mid - 1;
else
low = mid + 1;
-
+
mid = (low + high)/2;
}
} else {
_____
Modified: trunk/reactos/lib/ntdll/ldr/startup.c
--- trunk/reactos/lib/ntdll/ldr/startup.c 2005-05-09 01:42:07 UTC
(rev 15167)
+++ trunk/reactos/lib/ntdll/ldr/startup.c 2005-05-09 01:43:25 UTC
(rev 15168)
@@ -99,14 +99,14 @@
}
/*
* FIXME:
- * read more options
+ * read more options
*/
}
}
-
-
+
+
BOOLEAN FASTCALL
LoadCompatibilitySettings(PPEB Peb)
{
@@ -133,7 +133,7 @@
return FALSE;
}
- RtlRosInitUnicodeStringFromLiteral(&KeyName,
+ RtlRosInitUnicodeStringFromLiteral(&KeyName,
L"Software\\Microsoft\\Windows
NT\\CurrentVersion\\AppCompatFlags\\Layers");
InitializeObjectAttributes(&ObjectAttributes,
@@ -307,7 +307,7 @@
DPRINT1("Failed to create process heap\n");
ZwTerminateProcess(NtCurrentProcess(),STATUS_UNSUCCESSFUL);
}
-
+
/* initialized vectored exception handling */
RtlpInitializeVectoredExceptionHandling();
@@ -325,11 +325,11 @@
Peb->TlsExpansionCounter = TLS_MINIMUM_AVAILABLE;
/* Initialize table of callbacks for the kernel. */
- Peb->KernelCallbackTable =
+ Peb->KernelCallbackTable =
RtlAllocateHeap(RtlGetProcessHeap(),
0,
sizeof(PVOID) * (USER32_CALLBACK_MAXIMUM +
1));
-
+
/* initalize loader lock */
RtlInitializeCriticalSection (&LoaderLock);
Peb->LoaderLock = &LoaderLock;
_____
Modified: trunk/reactos/lib/ntdll/ldr/utils.c
--- trunk/reactos/lib/ntdll/ldr/utils.c 2005-05-09 01:42:07 UTC (rev
15167)
+++ trunk/reactos/lib/ntdll/ldr/utils.c 2005-05-09 01:43:25 UTC (rev
15168)
@@ -1,5 +1,5 @@
/* $Id$
- *
+ *
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: lib/ntdll/ldr/utils.c
@@ -187,7 +187,7 @@
PVOID TlsData;
ULONG i;
PTEB Teb = NtCurrentTeb();
-
+
DPRINT("LdrpInitializeTlsForThread() called for %wZ\n",
&ExeModule->BaseDllName);
Teb->StaticUnicodeString.Length = 0;
_____
Modified: trunk/reactos/lib/ntdll/main/dllmain.c
--- trunk/reactos/lib/ntdll/main/dllmain.c 2005-05-09 01:42:07 UTC
(rev 15167)
+++ trunk/reactos/lib/ntdll/main/dllmain.c 2005-05-09 01:43:25 UTC
(rev 15168)
@@ -3,8 +3,8 @@
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/ntdll/main/dllmain.c
- * PURPOSE:
- * PROGRAMMER:
+ * PURPOSE:
+ * PROGRAMMER:
*/
#include <ddk/ntddk.h>
_____
Modified: trunk/reactos/lib/ntdll/rtl/apc.c
--- trunk/reactos/lib/ntdll/rtl/apc.c 2005-05-09 01:42:07 UTC (rev
15167)
+++ trunk/reactos/lib/ntdll/rtl/apc.c 2005-05-09 01:43:25 UTC (rev
15168)
@@ -32,7 +32,7 @@
/* FUNCTIONS
***************************************************************/
-VOID STDCALL
+VOID STDCALL
KiUserApcDispatcher(PIO_APC_ROUTINE ApcRoutine,
PVOID ApcContext,
PIO_STATUS_BLOCK Iosb,
@@ -40,7 +40,7 @@
PCONTEXT Context)
{
/*
- * Call the APC
+ * Call the APC
*/
//DPRINT1("ITS ME\n");
ApcRoutine(ApcContext,
_____
Modified: trunk/reactos/lib/ntdll/rtl/callback.c
--- trunk/reactos/lib/ntdll/rtl/callback.c 2005-05-09 01:42:07 UTC
(rev 15167)
+++ trunk/reactos/lib/ntdll/rtl/callback.c 2005-05-09 01:43:25 UTC
(rev 15168)
@@ -16,7 +16,7 @@
/* TYPES
*********************************************************************/
-typedef NTSTATUS STDCALL_FUNC (*CALLBACK_FUNCTION)(PVOID Argument,
+typedef NTSTATUS STDCALL_FUNC (*CALLBACK_FUNCTION)(PVOID Argument,
ULONG ArgumentLength);
/* FUNCTIONS
*****************************************************************/
@@ -29,7 +29,7 @@
PPEB Peb;
NTSTATUS Status;
CALLBACK_FUNCTION Callback;
-
+
Peb = NtCurrentPeb();
Callback =
(CALLBACK_FUNCTION)Peb->KernelCallbackTable[RoutineIndex];
Status = Callback(Argument, ArgumentLength);
_____
Modified: trunk/reactos/lib/ntdll/rtl/crc32.c
--- trunk/reactos/lib/ntdll/rtl/crc32.c 2005-05-09 01:42:07 UTC (rev
15167)
+++ trunk/reactos/lib/ntdll/rtl/crc32.c 2005-05-09 01:43:25 UTC (rev
15168)
@@ -1,9 +1,9 @@
-/*
+/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* PURPOSE: crc32 functions
* FILE: lib/ntdll/rtl/crc32.c
- * PROGRAMER: Steven Edwards
+ * PROGRAMER: Steven Edwards
* REVISION HISTORY:
* 11/15/2000: Created
*/
_____
Modified: trunk/reactos/lib/ntdll/rtl/critical.c
--- trunk/reactos/lib/ntdll/rtl/critical.c 2005-05-09 01:42:07 UTC
(rev 15167)
+++ trunk/reactos/lib/ntdll/rtl/critical.c 2005-05-09 01:43:25 UTC
(rev 15168)
@@ -30,7 +30,7 @@
static BOOLEAN RtlpDebugInfoFreeList[MAX_STATIC_CS_DEBUG_OBJECTS];
/*++
- * RtlDeleteCriticalSection
+ * RtlDeleteCriticalSection
* @implemented NT4
*
* Deletes a Critical Section
@@ -51,37 +51,37 @@
PRTL_CRITICAL_SECTION CriticalSection)
{
NTSTATUS Status = STATUS_SUCCESS;
-
+
DPRINT("Deleting Critical Section: %x\n", CriticalSection);
/* Close the Event Object Handle if it exists */
if (CriticalSection->LockSemaphore) {
-
+
/* In case NtClose fails, return the status */
Status = NtClose(CriticalSection->LockSemaphore);
-
+
}
-
+
/* Protect List */
RtlEnterCriticalSection(&RtlCriticalSectionLock);
-
+
/* Remove it from the list */
- RemoveEntryList(&CriticalSection->DebugInfo->ProcessLocksList);
-
+ RemoveEntryList(&CriticalSection->DebugInfo->ProcessLocksList);
+
/* Unprotect */
RtlLeaveCriticalSection(&RtlCriticalSectionLock);
-
+
/* Free it */
RtlpFreeDebugInfo(CriticalSection->DebugInfo);
-
+
/* Wipe it out */
RtlZeroMemory(CriticalSection, sizeof(RTL_CRITICAL_SECTION));
-
+
/* Return */
return Status;
}
/*++
- * RtlSetCriticalSectionSpinCount
+ * RtlSetCriticalSectionSpinCount
* @implemented NT4
*
* Sets the spin count for a critical section.
@@ -104,16 +104,16 @@
PRTL_CRITICAL_SECTION CriticalSection,
DWORD SpinCount
)
-{
+{
DWORD OldCount = CriticalSection->SpinCount;
-
+
/* Set to parameter if MP, or to 0 if this is Uniprocessor */
CriticalSection->SpinCount = (NtCurrentPeb()->NumberOfProcessors >
1) ? SpinCount : 0;
return OldCount;
}
/*++
- * RtlEnterCriticalSection
+ * RtlEnterCriticalSection
* @implemented NT4
*
* Waits to gain ownership of the critical section.
@@ -134,16 +134,16 @@
PRTL_CRITICAL_SECTION CriticalSection)
{
HANDLE Thread = (HANDLE)NtCurrentTeb()->Cid.UniqueThread;
-
+
/* Try to Lock it */
if (InterlockedIncrement(&CriticalSection->LockCount) != 0) {
- /*
+ /*
* We've failed to lock it! Does this thread
* actually own it?
*/
if (Thread == CriticalSection->OwningThread) {
-
+
/* You own it, so you'll get it when you're done with it!
No need to
use the interlocked functions as only the thread who
already owns
the lock can modify this data. */
@@ -157,11 +157,11 @@
acquire it as well (LockCount == 1) but thread a
hasn't had a
chance to set the OwningThread! So it's not an error
when
OwningThread is NULL here! */
-
+
/* We don't own it, so we must wait for it */
RtlpWaitForCriticalSection(CriticalSection);
}
-
+
/* Lock successful. Changing this information has not to be
serialized because
only one thread at a time can actually change it (the one who
acquired
the lock)! */
@@ -171,7 +171,7 @@
}
/*++
- * RtlInitializeCriticalSection
+ * RtlInitializeCriticalSection
* @implemented NT4
*
* Initialises a new critical section.
@@ -186,17 +186,17 @@
* Simply calls RtlInitializeCriticalSectionAndSpinCount
*
*--*/
-NTSTATUS
+NTSTATUS
STDCALL
RtlInitializeCriticalSection(
PRTL_CRITICAL_SECTION CriticalSection)
-{
+{
/* Call the Main Function */
return RtlInitializeCriticalSectionAndSpinCount(CriticalSection,
0);
}
/*++
- * RtlInitializeCriticalSectionAndSpinCount
+ * RtlInitializeCriticalSectionAndSpinCount
* @implemented NT4
*
* Initialises a new critical section.
@@ -220,7 +220,7 @@
DWORD SpinCount)
{
PRTL_CRITICAL_SECTION_DEBUG CritcalSectionDebugData;
-
+
/* First things first, set up the Object */
DPRINT("Initializing Critical Section: %x\n", CriticalSection);
CriticalSection->LockCount = -1;
@@ -230,18 +230,18 @@
CriticalSection->LockSemaphore = 0;
/* Allocate the Debug Data */
- CritcalSectionDebugData = RtlpAllocateDebugInfo();
- DPRINT("Allocated Debug Data: %x inside Process: %x\n",
- CritcalSectionDebugData,
+ CritcalSectionDebugData = RtlpAllocateDebugInfo();
+ DPRINT("Allocated Debug Data: %x inside Process: %x\n",
+ CritcalSectionDebugData,
NtCurrentTeb()->Cid.UniqueProcess);
-
+
if (!CritcalSectionDebugData) {
-
+
/* This is bad! */
DPRINT1("Couldn't allocate Debug Data for: %x\n",
CriticalSection);
return STATUS_NO_MEMORY;
}
-
+
/* Set it up */
CritcalSectionDebugData->Type = RTL_CRITSECT_TYPE;
CritcalSectionDebugData->ContentionCount = 0;
@@ -249,18 +249,18 @@
CritcalSectionDebugData->CriticalSection = CriticalSection;
CriticalSection->DebugInfo = CritcalSectionDebugData;
- /*
+ /*
* Add it to the List of Critical Sections owned by the process.
* If we've initialized the Lock, then use it. If not, then probably
* this is the lock initialization itself, so insert it directly.
*/
if ((CriticalSection != &RtlCriticalSectionLock) &&
(RtlpCritSectInitialized)) {
-
- DPRINT("Securely Inserting into ProcessLocks: %x, %x, %x\n",
+
+ DPRINT("Securely Inserting into ProcessLocks: %x, %x, %x\n",
&CritcalSectionDebugData->ProcessLocksList,
CriticalSection,
&RtlCriticalSectionList);
-
+
/* Protect List */
RtlEnterCriticalSection(&RtlCriticalSectionLock);
@@ -269,14 +269,14 @@
/* Unprotect */
RtlLeaveCriticalSection(&RtlCriticalSectionLock);
-
+
} else {
- DPRINT("Inserting into ProcessLocks: %x, %x, %x\n",
+ DPRINT("Inserting into ProcessLocks: %x, %x, %x\n",
&CritcalSectionDebugData->ProcessLocksList,
CriticalSection,
&RtlCriticalSectionList);
-
+
/* Add it directly */
InsertTailList(&RtlCriticalSectionList,
&CritcalSectionDebugData->ProcessLocksList);
}
@@ -285,7 +285,7 @@
}
/*++
- * RtlLeaveCriticalSection
+ * RtlLeaveCriticalSection
* @implemented NT4
*
* Releases a critical section and makes if available for new
owners.
@@ -304,10 +304,10 @@
STDCALL
RtlLeaveCriticalSection(
PRTL_CRITICAL_SECTION CriticalSection)
-{
+{
#ifndef NDEBUG
HANDLE Thread = (HANDLE)NtCurrentTeb()->Cid.UniqueThread;
-
+
/* In win this case isn't checked. However it's a valid check so it
should only
be performed in debug builds! */
if (Thread != CriticalSection->OwningThread)
@@ -316,34 +316,34 @@
return STATUS_INVALID_PARAMETER;
}
#endif
-
+
/* Decrease the Recursion Count. No need to do this atomically
because only
the thread who holds the lock can call this function (unless the
program
is totally screwed... */
if (--CriticalSection->RecursionCount) {
-
+
/* Someone still owns us, but we are free. This needs to be
done atomically. */
InterlockedDecrement(&CriticalSection->LockCount);
-
+
} else {
-
+
/* Nobody owns us anymore. No need to do this atomically. See
comment
above. */
CriticalSection->OwningThread = 0;
-
+
/* Was someone wanting us? This needs to be done atomically. */
InterlockedDecrement(&CriticalSection->LockCount);
-
+
/* Let him have us */
RtlpUnWaitCriticalSection(CriticalSection);
}
-
+
/* Sucessful! */
return STATUS_SUCCESS;
}
/*++
- * RtlTryEnterCriticalSection
+ * RtlTryEnterCriticalSection
* @implemented NT4
*
* Attemps to gain ownership of the critical section without
waiting.
@@ -386,7 +386,7 @@
}
/*++
- * RtlpWaitForCriticalSection
+ * RtlpWaitForCriticalSection
*
* Slow path of RtlEnterCriticalSection. Waits on an Event Object.
*
@@ -409,42 +409,42 @@
EXCEPTION_RECORD ExceptionRecord;
BOOLEAN LastChance = FALSE;
LARGE_INTEGER Timeout;
-
+
/* Wait 2.5 minutes */
Timeout.QuadPart = 150000L * (ULONGLONG)10000;
Timeout.QuadPart = -Timeout.QuadPart;
/* ^^ HACK HACK HACK. Good way:
Timeout = &NtCurrentPeb()->CriticalSectionTimeout */
-
+
/* Do we have an Event yet? */
if (!CriticalSection->LockSemaphore) {
RtlpCreateCriticalSectionSem(CriticalSection);
}
-
+
/* Increase the Debug Entry count */
- DPRINT("Waiting on Critical Section Event: %x %x\n",
- CriticalSection,
+ DPRINT("Waiting on Critical Section Event: %x %x\n",
+ CriticalSection,
CriticalSection->LockSemaphore);
CriticalSection->DebugInfo->EntryCount++;
-
+
for (;;) {
-
+
/* Increase the number of times we've had contention */
CriticalSection->DebugInfo->ContentionCount++;
-
+
/* Wait on the Event */
Status = NtWaitForSingleObject(CriticalSection->LockSemaphore,
FALSE,
&Timeout);
-
+
/* We have Timed out */
if (Status == STATUS_TIMEOUT) {
-
+
/* Is this the 2nd time we've timed out? */
if (LastChance) {
-
+
DPRINT1("Deadlock: %x\n", CriticalSection);
-
+
/* Yes it is, we are raising an exception */
ExceptionRecord.ExceptionCode =
STATUS_POSSIBLE_DEADLOCK;
ExceptionRecord.ExceptionFlags = 0;
@@ -453,14 +453,14 @@
ExceptionRecord.NumberParameters = 1;
ExceptionRecord.ExceptionInformation[0] =
(ULONG_PTR)CriticalSection;
RtlRaiseException(&ExceptionRecord);
-
- }
-
+
+ }
+
/* One more try */
LastChance = TRUE;
-
+
} else {
-
+
/* If we are here, everything went fine */
return STATUS_SUCCESS;
}
@@ -468,7 +468,7 @@
}
/*++
- * RtlpUnWaitCriticalSection
+ * RtlpUnWaitCriticalSection
*
* Slow path of RtlLeaveCriticalSection. Fires an Event Object.
*
@@ -486,26 +486,26 @@
STDCALL
RtlpUnWaitCriticalSection(
PRTL_CRITICAL_SECTION CriticalSection)
-
+
{
NTSTATUS Status;
-
+
/* Do we have an Event yet? */
if (!CriticalSection->LockSemaphore) {
RtlpCreateCriticalSectionSem(CriticalSection);
}
-
+
/* Signal the Event */
- DPRINT("Signaling Critical Section Event: %x, %x\n",
- CriticalSection,
+ DPRINT("Signaling Critical Section Event: %x, %x\n",
+ CriticalSection,
CriticalSection->LockSemaphore);
Status = NtSetEvent(CriticalSection->LockSemaphore, NULL);
-
+
if (!NT_SUCCESS(Status)) {
-
+
/* We've failed */
- DPRINT1("Signaling Failed for: %x, %x, %x\n",
- CriticalSection,
+ DPRINT1("Signaling Failed for: %x, %x, %x\n",
+ CriticalSection,
CriticalSection->LockSemaphore,
Status);
RtlRaiseStatus(Status);
@@ -513,7 +513,7 @@
}
/*++
- * RtlpCreateCriticalSectionSem
+ * RtlpCreateCriticalSectionSem
*
* Checks if an Event has been created for the critical section.
*
@@ -535,17 +535,17 @@
HANDLE hEvent = CriticalSection->LockSemaphore;
HANDLE hNewEvent;
NTSTATUS Status;
-
+
/* Chevk if we have an event */
if (!hEvent) {
-
+
/* No, so create it */
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);
@@ -553,22 +553,22 @@
return;
}
DPRINT("Created Event: %x \n", hNewEvent);
-
+
if ((hEvent =
InterlockedCompareExchangePointer((PVOID*)&CriticalSection->LockSemaphor
e,
(PVOID)hNewEvent,
0))) {
-
+
/* Some just created an event */
DPRINT("Closing already created event: %x\n", hNewEvent);
NtClose(hNewEvent);
}
}
-
+
return;
}
/*++
- * RtlpInitDeferedCriticalSection
+ * RtlpInitDeferedCriticalSection
*
* Initializes the Critical Section implementation.
*
@@ -587,19 +587,19 @@
RtlpInitDeferedCriticalSection(
VOID)
{
-
+
/* Initialize the Process Critical Section List */
InitializeListHead(&RtlCriticalSectionList);
-
+
/* Initialize the CS Protecting the List */
RtlInitializeCriticalSection(&RtlCriticalSectionLock);
-
+
/* It's now safe to enter it */
RtlpCritSectInitialized = TRUE;
}
/*++
- * RtlpAllocateDebugInfo
+ * RtlpAllocateDebugInfo
*
* Finds or allocates memory for a Critical Section Debug Object
*
@@ -620,31 +620,31 @@
VOID)
{
ULONG i;
-
+
/* Try to allocate from our buffer first */
for (i = 0; i < MAX_STATIC_CS_DEBUG_OBJECTS; i++) {
-
+
/* Check if Entry is free */
if (!RtlpDebugInfoFreeList[i]) {
-
+
/* Mark entry in use */
DPRINT("Using entry: %d. Buffer: %x\n", i,
&RtlpStaticDebugInfo[i]);
RtlpDebugInfoFreeList[i] = TRUE;
-
+
/* Use free entry found */
return &RtlpStaticDebugInfo[i];
}
-
+
}
-
+
/* We are out of static buffer, allocate dynamic */
- return RtlAllocateHeap(NtCurrentPeb()->ProcessHeap,
- 0,
+ return RtlAllocateHeap(NtCurrentPeb()->ProcessHeap,
+ 0,
sizeof(RTL_CRITICAL_SECTION_DEBUG));
}
/*++
- * RtlpFreeDebugInfo
+ * RtlpFreeDebugInfo
*
* Frees the memory for a Critical Section Debug Object
*
@@ -665,27 +665,27 @@
PRTL_CRITICAL_SECTION_DEBUG DebugInfo)
{
ULONG EntryId;
-
+
/* Is it part of our cached entries? */
- if ((DebugInfo >= RtlpStaticDebugInfo) &&
+ if ((DebugInfo >= RtlpStaticDebugInfo) &&
(DebugInfo <=
&RtlpStaticDebugInfo[MAX_STATIC_CS_DEBUG_OBJECTS-1])) {
-
+
/* Yes. zero it out */
RtlZeroMemory(DebugInfo, sizeof(RTL_CRITICAL_SECTION_DEBUG));
-
+
/* Mark as free */
EntryId = (DebugInfo - RtlpStaticDebugInfo);
- DPRINT("Freeing from Buffer: %x. Entry: %d inside Process:
%x\n",
- DebugInfo,
+ DPRINT("Freeing from Buffer: %x. Entry: %d inside Process:
%x\n",
+ DebugInfo,
EntryId,
NtCurrentTeb()->Cid.UniqueProcess);
RtlpDebugInfoFreeList[EntryId] = FALSE;
} else {
-
+
/* It's a dynamic one, so free from the heap */
- DPRINT("Freeing from Heap: %x inside Process: %x\n",
- DebugInfo,
+ DPRINT("Freeing from Heap: %x inside Process: %x\n",
+ DebugInfo,
NtCurrentTeb()->Cid.UniqueProcess);
RtlFreeHeap(NtCurrentPeb()->ProcessHeap, 0, DebugInfo);
_____
Modified: trunk/reactos/lib/ntdll/rtl/dbgbuffer.c
--- trunk/reactos/lib/ntdll/rtl/dbgbuffer.c 2005-05-09 01:42:07 UTC
(rev 15167)
+++ trunk/reactos/lib/ntdll/rtl/dbgbuffer.c 2005-05-09 01:43:25 UTC
(rev 15168)
@@ -23,8 +23,8 @@
* FILE: lib/ntdll/rtl/dbgbuffer.c
* PROGRAMER: James Tabor
* Fixme: Add Process and Thread event pair support.
- * Start Locks and Heap support.
- * Test: Create remote thread to help query remote
+ * Start Locks and Heap support.
+ * Test: Create remote thread to help query remote
* processes and use view mapping to read them.
*
*/
@@ -55,7 +55,7 @@
NTSTATUS Status;
PDEBUG_BUFFER Buf = NULL;
ULONG SectionSize = 100 * PAGE_SIZE;
-
+
Status = NtAllocateVirtualMemory( NtCurrentProcess(),
(PVOID)&Buf,
0,
@@ -69,7 +69,7 @@
Buf->SectionBase = Buf;
Buf->SectionSize = SectionSize;
-
+
DPRINT("RtlCQDB: BA: %x BS: %d\n", Buf->SectionBase,
Buf->SectionSize);
return Buf;
@@ -120,14 +120,14 @@
PCHAR p;
DPRINT("RtlpQueryRemoteProcessModules Start\n");
-
+
/* query the process basic information (includes the PEB address) */
Status = NtQueryInformationProcess ( ProcessHandle,
ProcessBasicInformation,
&pbiInfo,
sizeof(PROCESS_BASIC_INFORMATION),
NULL);
-
+
if (!NT_SUCCESS(Status))
{
/* failure */
@@ -152,7 +152,7 @@
&ppldLdrData,
sizeof(ppldLdrData),
NULL );
-
+
if (!NT_SUCCESS(Status))
{
/* failure */
@@ -160,7 +160,7 @@
return Status;
}
-
+
/* head of the module list: the last element in the list will point
to this */
pleListHead = &ppldLdrData->InLoadOrderModuleList;
@@ -183,7 +183,7 @@
UNICODE_STRING Unicode;
WCHAR Buffer[256 * sizeof(WCHAR)];
-
+
/* read the current module */
Status = NtReadVirtualMemory ( ProcessHandle,
CONTAINING_RECORD(pleCurEntry, LDR_MODULE,
InLoadOrderModuleList),
@@ -191,7 +191,7 @@
sizeof(LDR_MODULE),
NULL );
- /* Import module name from remote Process user space. */
+ /* Import module name from remote Process user space. */
Unicode.Length = lmModule.FullDllName.Length;
Unicode.MaximumLength = lmModule.FullDllName.MaximumLength;
Unicode.Buffer = Buffer;
@@ -201,7 +201,7 @@
Unicode.Buffer,
Unicode.Length,
NULL );
-
+
if (!NT_SUCCESS(Status))
{
/* failure */
@@ -246,7 +246,7 @@
/* address of the next module in the list */
pleCurEntry = lmModule.InLoadOrderModuleList.Flink;
}
-
+
if (ReturnedSize != 0)
*ReturnedSize = UsedSize;
@@ -259,9 +259,9 @@
/*
* @unimplemented
*/
-NTSTATUS STDCALL
-RtlQueryProcessDebugInformation(IN ULONG ProcessId,
- IN ULONG DebugInfoMask,
+NTSTATUS STDCALL
+RtlQueryProcessDebugInformation(IN ULONG ProcessId,
+ IN ULONG DebugInfoMask,
IN OUT PDEBUG_BUFFER Buf)
{
NTSTATUS Status = STATUS_SUCCESS;
@@ -281,7 +281,7 @@
{
Status = STATUS_ACCESS_VIOLATION;
}
-else
+else
if (Pid == ProcessId)
{
if (DebugInfoMask & PDI_MODULES)
@@ -303,12 +303,12 @@
{
return Status;
}
-
+
MSize = Mp->ModuleCount * (sizeof(MODULE_INFORMATION) + 8);
- Buf->ModuleInformation = Mp;
+ Buf->ModuleInformation = Mp;
Buf->SizeOfInfo = Buf->SizeOfInfo + MSize;
}
-
+
if (DebugInfoMask & PDI_HEAPS)
{
PHEAP_INFORMATION Hp;
@@ -322,19 +322,19 @@
if (DebugInfoMask & PDI_HEAP_BLOCKS)
{
}
- Buf->HeapInformation = Hp;
+ Buf->HeapInformation = Hp;
Buf->SizeOfInfo = Buf->SizeOfInfo + HSize;
-
+
}
-
+
if (DebugInfoMask & PDI_LOCKS)
{
PLOCK_INFORMATION Lp;
ULONG LSize;
-
+
Lp = (PLOCK_INFORMATION)(Buf + Buf->SizeOfInfo);
LSize = sizeof(LOCK_INFORMATION);
- Buf->LockInformation = Lp;
+ Buf->LockInformation = Lp;
Buf->SizeOfInfo = Buf->SizeOfInfo + LSize;
}
@@ -360,7 +360,7 @@
Status = NtOpenProcess( &hProcess,
(PROCESS_ALL_ACCESS),
&ObjectAttributes,
- &ClientId );
+ &ClientId );
if (!NT_SUCCESS(Status))
{
return Status;
@@ -387,12 +387,12 @@
{
return Status;
[truncated at 1000 lines; 740 more skipped]