no message

svn path=/trunk/; revision=193
This commit is contained in:
David Welch 1999-01-28 15:54:26 +00:00
parent 531f88e833
commit 0bcca89137
11 changed files with 169 additions and 103 deletions

View file

@ -55,25 +55,26 @@ void ExecuteDir(char* cmdline)
TIME_FIELDS fTime; TIME_FIELDS fTime;
shandle = FindFirstFile("*",&FindData); shandle = FindFirstFile("*",&FindData);
if (shandle==INVALID_HANDLE_VALUE) if (shandle==INVALID_HANDLE_VALUE)
{ {
return; debug_printf("Invalid directory\n");
} return;
do }
{ do
debug_printf("%-15.15s",FindData.cAlternateFileName); {
if(FindData.dwFileAttributes &FILE_ATTRIBUTE_DIRECTORY) debug_printf("%-15.15s",FindData.cAlternateFileName);
debug_printf("<REP> "),nRep++; if(FindData.dwFileAttributes &FILE_ATTRIBUTE_DIRECTORY)
else debug_printf("<REP> "),nRep++;
debug_printf(" %10d ",FindData.nFileSizeLow),nFile++; else
// RtlTimeToTimeFields(&FindData.ftLastWriteTime ,&fTime); debug_printf(" %10d ",FindData.nFileSizeLow),nFile++;
// RtlTimeToTimeFields(&FindData.ftLastWriteTime ,&fTime);
// debug_printf("%02d/%02d/%04d %02d:%02d:%02d " // debug_printf("%02d/%02d/%04d %02d:%02d:%02d "
// ,fTime.Month,fTime.Day,fTime.Year // ,fTime.Month,fTime.Day,fTime.Year
// ,fTime.Hour,fTime.Minute,fTime.Second); // ,fTime.Hour,fTime.Minute,fTime.Second);
debug_printf("%s\n",FindData.cFileName); debug_printf("%s\n",FindData.cFileName);
} while(FindNextFile(shandle,&FindData)); } while(FindNextFile(shandle,&FindData));
debug_printf("\n %d files\n %d directories\n\n",nFile,nRep); debug_printf("\n %d files\n %d directories\n\n",nFile,nRep);
} }
void ExecuteType(char* cmdline) void ExecuteType(char* cmdline)

View file

@ -1,47 +1,94 @@
This is the file "copying.dj". It does NOT apply to any sources or This is the file "copying.dj". It does NOT apply to any sources or
binaries copyrighted by UCB Berkeley, the Free Software Foundation, or
any other agency besides DJ Delorie and others who have agreed to binaries copyrighted by UCB Berkeley, the Free Software Foundation, or
allow their sources to be distributed under these terms.
any other agency besides DJ Delorie and others who have agreed to
Copyright Information for sources and executables that are marked
Copyright (C) DJ Delorie allow their sources to be distributed under these terms.
7 Kim Lane
Rochester NH 03867-2954
This document is Copyright (C) DJ Delorie and may be distributed Copyright Information for sources and executables that are marked
verbatim, but changing it is not allowed.
Copyright (C) DJ Delorie
Source code copyright DJ Delorie is distributed under the terms of the
GNU General Public Licence, with the following exceptions: 7 Kim Lane
* Sources used to build crt0.o, gcrt0.o, libc.a, libdbg.a, and Rochester NH 03867-2954
libemu.a are distributed under the terms of the GNU Library General
Public License, rather than the GNU GPL.
* Any existing copyright or authorship information in any given source This document is Copyright (C) DJ Delorie and may be distributed
file must remain intact. If you modify a source file, a notice to that
effect must be added to the authorship information in the source file. verbatim, but changing it is not allowed.
* Runtime binaries, as provided by DJ in DJGPP, may be distributed
without sources ONLY if the recipient is given sufficient information
to obtain a copy of djgpp themselves. This primarily applies to Source code copyright DJ Delorie is distributed under the terms of the
go32-v2.exe, emu387.dxe, and stubedit.exe.
GNU General Public Licence, with the following exceptions:
* Runtime objects and libraries, as provided by DJ in DJGPP, when
linked into an application, may be distributed without sources ONLY
if the recipient is given sufficient information to obtain a copy of
djgpp themselves. This primarily applies to crt0.o and libc.a. * Sources used to build crt0.o, gcrt0.o, libc.a, libdbg.a, and
----- libemu.a are distributed under the terms of the GNU Library General
Changes to source code copyright BSD or FSF by DJ Delorie fall under Public License, rather than the GNU GPL.
the terms of the original copyright.
A copy of the files "COPYING" and "COPYING.LIB" are included with this
document. If you did not receive a copy of these files, you may * Any existing copyright or authorship information in any given source
obtain one from whence this document was obtained, or by writing:
file must remain intact. If you modify a source file, a notice to that
Free Software Foundation
675 Mass Ave effect must be added to the authorship information in the source file.
Cambridge, MA 02139
USA
* Runtime binaries, as provided by DJ in DJGPP, may be distributed
without sources ONLY if the recipient is given sufficient information
to obtain a copy of djgpp themselves. This primarily applies to
go32-v2.exe, emu387.dxe, and stubedit.exe.
* Runtime objects and libraries, as provided by DJ in DJGPP, when
linked into an application, may be distributed without sources ONLY
if the recipient is given sufficient information to obtain a copy of
djgpp themselves. This primarily applies to crt0.o and libc.a.
-----
Changes to source code copyright BSD or FSF by DJ Delorie fall under
the terms of the original copyright.
A copy of the files "COPYING" and "COPYING.LIB" are included with this
document. If you did not receive a copy of these files, you may
obtain one from whence this document was obtained, or by writing:
Free Software Foundation
675 Mass Ave
Cambridge, MA 02139
USA

View file

@ -22,6 +22,7 @@ extern "C"
#include <ddk/li.h> #include <ddk/li.h>
#include <internal/id.h>
#include <ddk/status.h> #include <ddk/status.h>
#include <ddk/ntdef.h> #include <ddk/ntdef.h>
#include <ddk/defines.h> #include <ddk/defines.h>

View file

@ -28,7 +28,7 @@ NTSTATUS KeAddThreadTimeout(PKTHREAD Thread, PLARGE_INTEGER Interval);
VOID KeInitializeDispatcherHeader(DISPATCHER_HEADER* Header, ULONG Type, VOID KeInitializeDispatcherHeader(DISPATCHER_HEADER* Header, ULONG Type,
ULONG Size, ULONG SignalState); ULONG Size, ULONG SignalState);
VOID KeDumpStackFrames(ULONG DummyArg); VOID KeDumpStackFrames(ULONG DummyArg, ULONG NrFrames);
/* INITIALIZATION FUNCTIONS *************************************************/ /* INITIALIZATION FUNCTIONS *************************************************/

View file

@ -1,3 +1,4 @@
/* /*
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries

View file

@ -48,7 +48,7 @@ static HEAP_BUCKET __HeapDefaultBuckets[]=
{ NULL, 256, 15, 4088 }, { NULL, 256, 15, 4088 },
}; };
PHEAP __ProcessHeap; PHEAP __ProcessHeap = NULL;
static BOOL __HeapCommit(PHEAP pheap, LPVOID start, LPVOID end); static BOOL __HeapCommit(PHEAP pheap, LPVOID start, LPVOID end);
static BOOL __HeapDecommit(PHEAP pheap, LPVOID start, LPVOID end); static BOOL __HeapDecommit(PHEAP pheap, LPVOID start, LPVOID end);
@ -604,8 +604,10 @@ PHEAP __HeapPrepare(LPVOID base, ULONG minsize, ULONG maxsize, ULONG flags)
pheap->End= ((LPVOID)pheap)+minsize; pheap->End= ((LPVOID)pheap)+minsize;
pheap->Flags=flags; pheap->Flags=flags;
pheap->LastBlock=(LPVOID)pheap + PAGESIZE; pheap->LastBlock=(LPVOID)pheap + PAGESIZE;
CopyMemory(pheap->Bucket,__HeapDefaultBuckets,sizeof(__HeapDefaultBuckets)); CopyMemory(pheap->Bucket,
if(__ProcessHeap) __HeapDefaultBuckets,
sizeof(__HeapDefaultBuckets));
if (__ProcessHeap)
{ {
pheap->NextHeap=__ProcessHeap->NextHeap; pheap->NextHeap=__ProcessHeap->NextHeap;
__ProcessHeap->NextHeap=pheap; __ProcessHeap->NextHeap=pheap;

View file

@ -18,6 +18,8 @@
/* TYPES *********************************************************************/ /* TYPES *********************************************************************/
#define CACHE_SEGMENT_SIZE (0x10000)
#define CACHE_SEGMENT_INVALID (0) // Isn't valid #define CACHE_SEGMENT_INVALID (0) // Isn't valid
#define CACHE_SEGMENT_WRITTEN (1) // Written #define CACHE_SEGMENT_WRITTEN (1) // Written
#define CACHE_SEGMENT_READ (2) #define CACHE_SEGMENT_READ (2)
@ -28,7 +30,7 @@ typedef struct _CACHE_SEGMENT
ULONG Size; ULONG Size;
LIST_ENTRY ListEntry; // Entry in the per-open list of segments LIST_ENTRY ListEntry; // Entry in the per-open list of segments
PVOID BaseAddress; // Base address of the mapping PVOID BaseAddress; // Base address of the mapping
ULONG Length; // Length of the mapping ULONG ValidLength; // Length of the mapping
ULONG State; // Information ULONG State; // Information
MEMORY_AREA* MemoryArea; // Memory area for the mapping MEMORY_AREA* MemoryArea; // Memory area for the mapping
ULONG FileOffset; // Offset within the file of the mapping ULONG FileOffset; // Offset within the file of the mapping
@ -59,51 +61,56 @@ PVOID Cc1PurgeView(PCC1_CCB CacheDesc,
{ {
} }
BOOLEAN Cc1AcquireCacheSegment(PCACHE_SEGMENT CacheSegment,
BOOLEAN AcquireForWrite,
BOOLEAN Wait)
{
}
PVOID Cc1RequestView(PCC1_CCB CacheDesc, NTSTATUS Cc1RequestView(PCC1_CCB CacheDesc,
ULONG FileOffset, ULONG FileOffset,
ULONG Length, ULONG Length,
BOOLEAN Wait, PCACHE_SEGMENT ReturnedSegments[],
BOOLEAN AcquireForWrite) PULONG NrSegments)
/* /*
* FUNCTION: Request a view for caching data * FUNCTION: Request a view for caching data
* ARGUMENTS:
* FileObject = File to have information cached in the view
* FileOffset = Offset within the file of the cached information
* Length = Length of the information to be cached
* Wait = If the view is being created then wait for the creater
* to make the view valid
* AcquireForWrite = True if the view is being acquired for writing
* Buffer = Pointer to a variable to hold the base address of the view
* RETURNS: True if the view contains valid data,
* False otherwise
*/ */
{ {
PLIST_ENTRY current_entry; PLIST_ENTRY current_entry;
PCACHE_SEGMENT current; PCACHE_SEGMENT current;
PCACHE_SEGMENT new_segment;
ULONG MaxSegments;
ULONG LengthDelta;
MaxSegments = *NrSegments;
(*NrSegments) = 0;
KeAcquireSpinLock(&CacheDesc->CacheSegmentListLock); KeAcquireSpinLock(&CacheDesc->CacheSegmentListLock);
current_entry = CacheDesc->CacheSegmentListHead.Flink; current_entry = CacheDesc->CacheSegmentListHead.Flink;
while (current_entry != &CacheDesc->CacheSegmentListHead) while (current_entry != &(CacheDesc->CacheSegmentListHead))
{ {
current = CONTAING_RECORD(current_entry, CACHE_SEGMENT, ListEntry); current = CONTAING_RECORD(current_entry, CACHE_SEGMENT, ListEntry);
if (current->FileOffset <= FileOffset && if (current->FileOffset <= FileOffset &&
(current->FileOffset + current->length) >= (FileOffset + Length)) (current->FileOffset + current->ValidLength) > FileOffset)
{ {
if (!Cc1AcquireCacheSegment(AcquireForWrite, Wait)) ReturnedSegments[(*NrSegments)] = current;
(*NrSegments)++;
FileOffset = current->FileOffset + current->ValidLength;
LengthDelta = (FileOffset - current->FileOffset);
if (Length <= LengthDelta)
{ {
return(NULL); KeReleaseSpinLock(&CacheDesc->CacheSegmentListLock);
return(STATUS_SUCCESS);
} }
return(current->BaseAddress + (FileOffset - current->FileOffset)); Length = Length - LengthDelta;
} }
else if (current->FileOffset <= (FileOffset + Length) &&
(current->FileOffset + current->ValidLength) >
(FileOffset + Length))
{
ReturnedSegments[(*NrSegments)] = current;
(*NrSegments)++;
Length = Length - ((FileOffset + Length) - current->FileOffset);
}
current_entry = current_entry->Flink; current_entry = current_entry->Flink;
} }
@ -118,8 +125,14 @@ PCC1_CCB Cc1InitializeFileCache(PFILE_OBJECT FileObject)
PCC1_CCB CacheDesc; PCC1_CCB CacheDesc;
CacheDesc = ExAllocatePool(NonPagedPool, sizeof(CC1_CCB)); CacheDesc = ExAllocatePool(NonPagedPool, sizeof(CC1_CCB));
if (CacheDesc == NULL)
{
return(NULL);
}
CacheDesc->Type = CC1_CCB_ID;
InitializeListHead(&CacheDesc->CacheSegmentListHead); InitializeListHead(&CacheDesc->CacheSegmentListHead);
KeAcquireSpinLock(&CacheDesc->CacheSegmentListLock); KeInitializeSpinLock(&CacheDesc->CacheSegmentListLock);
return(CacheDesc); return(CacheDesc);
} }

View file

@ -255,7 +255,7 @@ asmlinkage void exception_handler(unsigned int edi,
for(;;); for(;;);
} }
VOID KeDumpStackFrames(ULONG DummyArg) VOID KeDumpStackFrames(ULONG DummyArg, ULONG NrFrames)
{ {
PULONG Stack = &((&DummyArg)[-1]); PULONG Stack = &((&DummyArg)[-1]);
ULONG i; ULONG i;
@ -263,7 +263,7 @@ VOID KeDumpStackFrames(ULONG DummyArg)
Stack = (PVOID)(((ULONG)Stack) & (~0x3)); Stack = (PVOID)(((ULONG)Stack) & (~0x3));
DbgPrint("Frames:\n"); DbgPrint("Frames:\n");
for (i=0; i<32; i++) for (i=0; i<NrFrames; i++)
{ {
if (Stack[i] > KERNEL_BASE && Stack[i] < ((ULONG)&etext)) if (Stack[i] > KERNEL_BASE && Stack[i] < ((ULONG)&etext))
{ {

View file

@ -194,11 +194,12 @@ PIRP IoAllocateIrp(CCHAR StackSize, BOOLEAN ChargeQuota)
{ {
PIRP Irp; PIRP Irp;
DPRINT("IoAllocateIrp(StackSize %d ChargeQuota %d)\n", DbgPrint("IoAllocateIrp(StackSize %d ChargeQuota %d)\n",
StackSize, StackSize,
ChargeQuota); ChargeQuota);
// if (ChargeQuota) KeDumpStackFrames(0,8);
if (0)
if (ChargeQuota)
{ {
Irp = ExAllocatePoolWithQuota(NonPagedPool,IoSizeOfIrp(StackSize)); Irp = ExAllocatePoolWithQuota(NonPagedPool,IoSizeOfIrp(StackSize));
} }

View file

@ -65,7 +65,7 @@ VOID KeBugCheckEx(ULONG BugCheckCode,
DbgPrint("Bug detected (code %x param %x %x %x %x)\n",BugCheckCode, DbgPrint("Bug detected (code %x param %x %x %x %x)\n",BugCheckCode,
BugCheckParameter1,BugCheckParameter2,BugCheckParameter3, BugCheckParameter1,BugCheckParameter2,BugCheckParameter3,
BugCheckParameter4); BugCheckParameter4);
KeDumpStackFrames(); KeDumpStackFrames(0,32);
for(;;); for(;;);
} }

View file

@ -34,7 +34,7 @@
#define VALIDATE_POOL #define VALIDATE_POOL
#endif #endif
#if 0 #if 1
#define POOL_TRACE(args...) do { DbgPrint(args); } while(0); #define POOL_TRACE(args...) do { DbgPrint(args); } while(0);
#else #else
#define POOL_TRACE(args...) #define POOL_TRACE(args...)