mirror of
https://github.com/reactos/reactos.git
synced 2024-12-26 17:14:41 +00:00
no message
svn path=/trunk/; revision=193
This commit is contained in:
parent
531f88e833
commit
0bcca89137
11 changed files with 169 additions and 103 deletions
|
@ -55,25 +55,26 @@ void ExecuteDir(char* cmdline)
|
|||
TIME_FIELDS fTime;
|
||||
|
||||
shandle = FindFirstFile("*",&FindData);
|
||||
|
||||
if (shandle==INVALID_HANDLE_VALUE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
do
|
||||
{
|
||||
debug_printf("%-15.15s",FindData.cAlternateFileName);
|
||||
if(FindData.dwFileAttributes &FILE_ATTRIBUTE_DIRECTORY)
|
||||
debug_printf("<REP> "),nRep++;
|
||||
else
|
||||
debug_printf(" %10d ",FindData.nFileSizeLow),nFile++;
|
||||
// RtlTimeToTimeFields(&FindData.ftLastWriteTime ,&fTime);
|
||||
|
||||
if (shandle==INVALID_HANDLE_VALUE)
|
||||
{
|
||||
debug_printf("Invalid directory\n");
|
||||
return;
|
||||
}
|
||||
do
|
||||
{
|
||||
debug_printf("%-15.15s",FindData.cAlternateFileName);
|
||||
if(FindData.dwFileAttributes &FILE_ATTRIBUTE_DIRECTORY)
|
||||
debug_printf("<REP> "),nRep++;
|
||||
else
|
||||
debug_printf(" %10d ",FindData.nFileSizeLow),nFile++;
|
||||
// RtlTimeToTimeFields(&FindData.ftLastWriteTime ,&fTime);
|
||||
// debug_printf("%02d/%02d/%04d %02d:%02d:%02d "
|
||||
// ,fTime.Month,fTime.Day,fTime.Year
|
||||
// ,fTime.Hour,fTime.Minute,fTime.Second);
|
||||
debug_printf("%s\n",FindData.cFileName);
|
||||
} while(FindNextFile(shandle,&FindData));
|
||||
debug_printf("\n %d files\n %d directories\n\n",nFile,nRep);
|
||||
debug_printf("%s\n",FindData.cFileName);
|
||||
} while(FindNextFile(shandle,&FindData));
|
||||
debug_printf("\n %d files\n %d directories\n\n",nFile,nRep);
|
||||
}
|
||||
|
||||
void ExecuteType(char* cmdline)
|
||||
|
|
|
@ -1,47 +1,94 @@
|
|||
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
|
||||
allow their sources to be distributed under these terms.
|
||||
|
||||
Copyright Information for sources and executables that are marked
|
||||
Copyright (C) DJ Delorie
|
||||
7 Kim Lane
|
||||
Rochester NH 03867-2954
|
||||
|
||||
This document is Copyright (C) DJ Delorie and may be distributed
|
||||
verbatim, but changing it is not allowed.
|
||||
|
||||
Source code copyright DJ Delorie is distributed under the terms of the
|
||||
GNU General Public Licence, with the following exceptions:
|
||||
|
||||
* 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
|
||||
Public License, rather than the GNU GPL.
|
||||
|
||||
* Any existing copyright or authorship information in any given source
|
||||
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.
|
||||
|
||||
* 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
|
||||
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
|
||||
|
||||
allow their sources to be distributed under these terms.
|
||||
|
||||
|
||||
|
||||
Copyright Information for sources and executables that are marked
|
||||
|
||||
Copyright (C) DJ Delorie
|
||||
|
||||
7 Kim Lane
|
||||
|
||||
Rochester NH 03867-2954
|
||||
|
||||
|
||||
|
||||
This document is Copyright (C) DJ Delorie and may be distributed
|
||||
|
||||
verbatim, but changing it is not allowed.
|
||||
|
||||
|
||||
|
||||
Source code copyright DJ Delorie is distributed under the terms of the
|
||||
|
||||
GNU General Public Licence, with the following exceptions:
|
||||
|
||||
|
||||
|
||||
* 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
|
||||
|
||||
Public License, rather than the GNU GPL.
|
||||
|
||||
|
||||
|
||||
* Any existing copyright or authorship information in any given source
|
||||
|
||||
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.
|
||||
|
||||
|
||||
|
||||
* 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
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ extern "C"
|
|||
|
||||
#include <ddk/li.h>
|
||||
|
||||
#include <internal/id.h>
|
||||
#include <ddk/status.h>
|
||||
#include <ddk/ntdef.h>
|
||||
#include <ddk/defines.h>
|
||||
|
|
|
@ -28,7 +28,7 @@ NTSTATUS KeAddThreadTimeout(PKTHREAD Thread, PLARGE_INTEGER Interval);
|
|||
VOID KeInitializeDispatcherHeader(DISPATCHER_HEADER* Header, ULONG Type,
|
||||
ULONG Size, ULONG SignalState);
|
||||
|
||||
VOID KeDumpStackFrames(ULONG DummyArg);
|
||||
VOID KeDumpStackFrames(ULONG DummyArg, ULONG NrFrames);
|
||||
|
||||
/* INITIALIZATION FUNCTIONS *************************************************/
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
|
|
|
@ -48,7 +48,7 @@ static HEAP_BUCKET __HeapDefaultBuckets[]=
|
|||
{ NULL, 256, 15, 4088 },
|
||||
};
|
||||
|
||||
PHEAP __ProcessHeap;
|
||||
PHEAP __ProcessHeap = NULL;
|
||||
|
||||
static BOOL __HeapCommit(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->Flags=flags;
|
||||
pheap->LastBlock=(LPVOID)pheap + PAGESIZE;
|
||||
CopyMemory(pheap->Bucket,__HeapDefaultBuckets,sizeof(__HeapDefaultBuckets));
|
||||
if(__ProcessHeap)
|
||||
CopyMemory(pheap->Bucket,
|
||||
__HeapDefaultBuckets,
|
||||
sizeof(__HeapDefaultBuckets));
|
||||
if (__ProcessHeap)
|
||||
{
|
||||
pheap->NextHeap=__ProcessHeap->NextHeap;
|
||||
__ProcessHeap->NextHeap=pheap;
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
|
||||
/* TYPES *********************************************************************/
|
||||
|
||||
#define CACHE_SEGMENT_SIZE (0x10000)
|
||||
|
||||
#define CACHE_SEGMENT_INVALID (0) // Isn't valid
|
||||
#define CACHE_SEGMENT_WRITTEN (1) // Written
|
||||
#define CACHE_SEGMENT_READ (2)
|
||||
|
@ -28,7 +30,7 @@ typedef struct _CACHE_SEGMENT
|
|||
ULONG Size;
|
||||
LIST_ENTRY ListEntry; // Entry in the per-open list of segments
|
||||
PVOID BaseAddress; // Base address of the mapping
|
||||
ULONG Length; // Length of the mapping
|
||||
ULONG ValidLength; // Length of the mapping
|
||||
ULONG State; // Information
|
||||
MEMORY_AREA* MemoryArea; // Memory area for 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,
|
||||
ULONG FileOffset,
|
||||
ULONG Length,
|
||||
BOOLEAN Wait,
|
||||
BOOLEAN AcquireForWrite)
|
||||
NTSTATUS Cc1RequestView(PCC1_CCB CacheDesc,
|
||||
ULONG FileOffset,
|
||||
ULONG Length,
|
||||
PCACHE_SEGMENT ReturnedSegments[],
|
||||
PULONG NrSegments)
|
||||
/*
|
||||
* 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;
|
||||
PCACHE_SEGMENT current;
|
||||
PCACHE_SEGMENT new_segment;
|
||||
ULONG MaxSegments;
|
||||
ULONG LengthDelta;
|
||||
|
||||
MaxSegments = *NrSegments;
|
||||
(*NrSegments) = 0;
|
||||
|
||||
KeAcquireSpinLock(&CacheDesc->CacheSegmentListLock);
|
||||
|
||||
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 &&
|
||||
(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;
|
||||
}
|
||||
|
||||
|
@ -118,8 +125,14 @@ PCC1_CCB Cc1InitializeFileCache(PFILE_OBJECT FileObject)
|
|||
PCC1_CCB CacheDesc;
|
||||
|
||||
CacheDesc = ExAllocatePool(NonPagedPool, sizeof(CC1_CCB));
|
||||
if (CacheDesc == NULL)
|
||||
{
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
CacheDesc->Type = CC1_CCB_ID;
|
||||
InitializeListHead(&CacheDesc->CacheSegmentListHead);
|
||||
KeAcquireSpinLock(&CacheDesc->CacheSegmentListLock);
|
||||
KeInitializeSpinLock(&CacheDesc->CacheSegmentListLock);
|
||||
|
||||
return(CacheDesc);
|
||||
}
|
||||
|
|
|
@ -255,7 +255,7 @@ asmlinkage void exception_handler(unsigned int edi,
|
|||
for(;;);
|
||||
}
|
||||
|
||||
VOID KeDumpStackFrames(ULONG DummyArg)
|
||||
VOID KeDumpStackFrames(ULONG DummyArg, ULONG NrFrames)
|
||||
{
|
||||
PULONG Stack = &((&DummyArg)[-1]);
|
||||
ULONG i;
|
||||
|
@ -263,7 +263,7 @@ VOID KeDumpStackFrames(ULONG DummyArg)
|
|||
Stack = (PVOID)(((ULONG)Stack) & (~0x3));
|
||||
|
||||
DbgPrint("Frames:\n");
|
||||
for (i=0; i<32; i++)
|
||||
for (i=0; i<NrFrames; i++)
|
||||
{
|
||||
if (Stack[i] > KERNEL_BASE && Stack[i] < ((ULONG)&etext))
|
||||
{
|
||||
|
|
|
@ -194,11 +194,12 @@ PIRP IoAllocateIrp(CCHAR StackSize, BOOLEAN ChargeQuota)
|
|||
{
|
||||
PIRP Irp;
|
||||
|
||||
DPRINT("IoAllocateIrp(StackSize %d ChargeQuota %d)\n",
|
||||
DbgPrint("IoAllocateIrp(StackSize %d ChargeQuota %d)\n",
|
||||
StackSize,
|
||||
ChargeQuota);
|
||||
// if (ChargeQuota)
|
||||
if (0)
|
||||
KeDumpStackFrames(0,8);
|
||||
|
||||
if (ChargeQuota)
|
||||
{
|
||||
Irp = ExAllocatePoolWithQuota(NonPagedPool,IoSizeOfIrp(StackSize));
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ VOID KeBugCheckEx(ULONG BugCheckCode,
|
|||
DbgPrint("Bug detected (code %x param %x %x %x %x)\n",BugCheckCode,
|
||||
BugCheckParameter1,BugCheckParameter2,BugCheckParameter3,
|
||||
BugCheckParameter4);
|
||||
KeDumpStackFrames();
|
||||
KeDumpStackFrames(0,32);
|
||||
for(;;);
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#define VALIDATE_POOL
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#if 1
|
||||
#define POOL_TRACE(args...) do { DbgPrint(args); } while(0);
|
||||
#else
|
||||
#define POOL_TRACE(args...)
|
||||
|
|
Loading…
Reference in a new issue