Merged mingw32 branch into main trunk

svn path=/trunk/; revision=321
This commit is contained in:
Rex Jolliff 1999-03-19 05:55:55 +00:00
parent bf4de1d7cd
commit d704562082
341 changed files with 8425 additions and 7213 deletions

View file

@ -1,4 +1,4 @@
0.0.14 (so far):
0.0.14 (so far):
0.0.13: Mostly bugfixes (I think)

View file

@ -0,0 +1,35 @@
#include <internal/mmhal.h>
#include <ddk/ntddk.h>
#include <stdarg.h>
#include <string.h>
HANDLE OutputHandle;
HANDLE InputHandle;
void debug_printf(char* fmt, ...)
{
va_list args;
char buffer[255];
va_start(args,fmt);
vsprintf(buffer,fmt,args);
WriteConsoleA(OutputHandle, buffer, strlen(buffer), NULL, NULL);
va_end(args);
}
void main(int argc, char* argv[])
{
int i;
AllocConsole();
InputHandle = GetStdHandle(STD_INPUT_HANDLE);
OutputHandle = GetStdHandle(STD_OUTPUT_HANDLE);
for (i=0; i<argc; i++)
{
debug_printf("Args: '%s'\n",argv[i]);
}
}

View file

@ -0,0 +1,11 @@
all: args.bin
OBJECTS= ../common/crt0.o args.o
LIBS= ../../lib/kernel32/kernel32.a ../../lib/ntdll/ntdll.a
args.bin: $(OBJECTS) $(LIBS)
$(CC) -specs=../../specs -Ttext 0x10000 $(OBJECTS) $(LIBS) -lgcc \
-o args.exe
$(NM) --numeric-sort args.exe > args.sym
../../ntoskrnl/utils/pe2bin/pe2bin$(EXE_POSTFIX) 0x10000 args.exe \
args.bin

View file

@ -1,11 +1,10 @@
all: shell.bin
all: shell.exe
OBJECTS= ../common/crt0.o shell.o
LIBS= ../../lib/kernel32/kernel32.a ../../lib/ntdll/ntdll.a ../../ntoskrnl/libgcc.a
LIBS= ../../lib/kernel32/kernel32.a ../../lib/ntdll/ntdll.a
shell.bin: $(OBJECTS) $(LIBS)
$(LD) -Ttext 0x10000 $(OBJECTS) $(LIBS) -o shell.exe
shell.exe: $(OBJECTS) $(LIBS)
$(CC) -specs=../../specs $(OBJECTS) $(LIBS) -lgcc -o shell.exe
$(NM) --numeric-sort shell.exe > shell.sym
$(OBJCOPY) -O binary shell.exe shell.bin
include ../../rules.mak

View file

@ -46,10 +46,10 @@ void ExecuteDir(char* cmdline)
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);
// 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);
@ -159,6 +159,11 @@ void ExecuteCommand(char* line)
ExecuteType(tail);
return;
}
if (strcmp(cmd,"exit")==0)
{
ExitProcess(0);
return;
}
if (ExecuteProcess(cmd,tail))
{
return;

View file

@ -1 +1 @@
loaders\dos\loadros ntoskrnl\kimage.bin services\dd\ide\ide.o services\fs\vfat\vfatfsd.o services\dd\keyboard\keyboard.o ext2fs.sys
loadros kimage.bin ide.o vfatfsd.o keyboard.o

View file

@ -3,9 +3,11 @@
:
: copy files to HD...
:
COPY /Y SHELL.BIN C:\reactos\system\SHELL.bin
COPY /Y BLUES.o C:\reactos\system\drivers\BLUES.o
COPY /Y KEYBOARD.o C:\reactos\system\drivers\KEYBOARD.o
COPY /Y BLUE.SYS C:\reactos\system\drivers\blue.SYS
COPY /Y KEYBOARD.SYS C:\reactos\system\drivers\KEYBOARD.SYS
COPY /Y NTDLL.DLL C:\reactos\system\NTDLL.DLL
: COPY /Y CRTDLL.DLL C:\reactos\system\CRTDLL.DLL
COPY /Y SHELL.EXE C:\reactos\system\SHELL.EXE
:
: present a menu to the booter...
@ -13,23 +15,23 @@ COPY /Y KEYBOARD.o C:\reactos\system\drivers\KEYBOARD.o
ECHO 1) Keyboard,IDE,VFatFSD
ECHO 2) IDE,VFatFSD
ECHO 3) No Drivers
CHOICE /C:123 /T:2,10 "Select kernel boot config"
CHOICE /C:123 /T:2,3 "Select kernel boot config"
IF ERRORLEVEL 3 GOTO :L3
IF ERRORLEVEL 2 GOTO :L2
:L1
CLS
LOADROS KIMAGE.BIN KEYBOARD.O IDE.O VFATFSD.O
LOADROS NTOSKRNL.EXE KEYBOARD.O IDE.SYS VFATFSD.SYS
GOTO :END
:L2
CLS
LOADROS KIMAGE.BIN IDE.O VFATFSD.O
LOADROS NTOSKRNL.EXE IDE.SYS VFATFSD.SYS
GOTO :END
:L3
CLS
LOADROS KIMAGE.BIN
LOADROS NTOSKRNL.EXE
GOTO :END
:END

View file

@ -0,0 +1,4 @@
base.tmp
junk.tmp
temp.exp

View file

@ -1,8 +1,8 @@
#undef WIN32_LEAN_AND_MEAN
#include <internal/mmhal.h>
#include <internal/halio.h>
#include <ddk/ntddk.h>
#include <string.h>
#include <internal/string.h>
#include <defines.h>
@ -79,7 +79,8 @@ NTSTATUS ScrDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
/*
* Module entry point
*/
NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
STDCALL NTSTATUS
DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
{
PDEVICE_OBJECT DeviceObject;
ANSI_STRING adevice_name;

View file

@ -0,0 +1,23 @@
#
#
#
all: blue.sys
.phony: all
OBJECTS = blue.o ../../../ntoskrnl/ntoskrnl.a
blue.sys: $(OBJECTS)
$(CC) -specs=../../svc_specs -mdll -o junk.tmp -Wl,--defsym,_end=end \
-Wl,--defsym,_edata=__data_end__ -Wl,--defsym,_etext=etext \
-Wl,--base-file,base.tmp $(OBJECTS)
- $(RM) junk.tmp
$(DLLTOOL) --dllname blue.sys --base-file base.tmp \
--output-exp temp.exp
- $(RM) base.tmp
$(CC) --verbose -Wl,--image-base,0x10000 -Wl,-e,_DriverEntry@8 \
-specs=../../svc_specs -mdll -o blue.sys $(OBJECTS) -Wl,temp.exp
- $(RM) temp.exp

View file

@ -165,4 +165,4 @@ main(
}
// EOF
// EOF

View file

@ -444,4 +444,4 @@ Return Value:
}
// EOF
// EOF

View file

@ -0,0 +1,3 @@
base.tmp
junk.tmp
temp.exp

View file

@ -72,6 +72,7 @@ typedef DISK_GEOMETRY *PDISK_GEOMETRY;
// -------------------------------------------------------------------------
#include <internal/i386/io.h>
#include <string.h>
#include <internal/string.h>
#define NDEBUG
@ -230,7 +231,7 @@ IDESwapBytePairs(char *Buf,
// RETURNS:
// NTSTATUS
NTSTATUS
STDCALL NTSTATUS
DriverEntry(IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath)
{

View file

@ -1,9 +1,16 @@
#
#
#
all: ide.sys
all: ide.o
OBJECTS = ide.o ../../../ntoskrnl/ntoskrnl.a
ide.o: ide.c ide.h idep.h partitio.h
include ../../../rules.mak
# --def ide.def --def ide.def
ide.sys: $(OBJECTS)
$(DLLTOOL) --dllname ide.sys --output-lib ide.a
$(CC) -specs=../../svc_specs -mdll -o junk.tmp -Wl,--defsym,_end=end \
-Wl,--defsym,_edata=__data_end__ -Wl,--defsym,_etext=etext \
-Wl,--base-file,base.tmp $(OBJECTS)
- $(RM) junk.tmp
$(DLLTOOL) --dllname ide.sys --base-file base.tmp \
--output-exp temp.exp
- $(RM) base.tmp
$(CC) --verbose -Wl,--image-base,0x10000 -Wl,-e,_DriverEntry@8 -specs=../../svc_specs -mdll -o ide.sys $(OBJECTS) -Wl,temp.exp
- $(RM) temp.exp

View file

@ -75,14 +75,14 @@ typedef enum PartitionTypes {
((P)->PartitionType == PTDosExtended)
typedef struct Partition {
__u8 BootFlags;
__u8 StartingHead;
__u8 StartingSector;
__u8 StartingCylinder;
__u8 PartitionType;
__u8 EndingHead;
__u8 EndingSector;
__u8 EndingCylinder;
unsigned char BootFlags;
unsigned char StartingHead;
unsigned char StartingSector;
unsigned char StartingCylinder;
unsigned char PartitionType;
unsigned char EndingHead;
unsigned char EndingSector;
unsigned char EndingCylinder;
unsigned int StartingBlock;
unsigned int SectorCount;

View file

@ -0,0 +1,4 @@
base.tmp
junk.tmp
temp.exp

View file

@ -20,10 +20,10 @@
**
*/
#undef WIN32_LEAN_AND_MEAN
#include <internal/mmhal.h>
#include <internal/halio.h>
#include <ddk/ntddk.h>
#include <string.h>
#include <internal/string.h>
#include <defines.h>
@ -689,7 +689,8 @@ NTSTATUS KbdDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
/*
* Module entry point
*/
NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
STDCALL NTSTATUS
DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
{
PDEVICE_OBJECT DeviceObject;
ANSI_STRING adevice_name;

View file

@ -1 +1,15 @@
all: keyboard.o
all: keyboard.sys
OBJECTS = keyboard.o ../../../ntoskrnl/ntoskrnl.a
keyboard.sys: $(OBJECTS)
$(CC) -specs=../../svc_specs -mdll -o junk.tmp -Wl,--defsym,_end=end \
-Wl,--defsym,_edata=__data_end__ -Wl,--defsym,_etext=etext \
-Wl,--base-file,base.tmp $(OBJECTS)
- $(RM) junk.tmp
$(DLLTOOL) --dllname keyboard.sys --base-file base.tmp \
--output-exp temp.exp
- $(RM) base.tmp
$(CC) --verbose -Wl,--image-base,0x10000 -Wl,-e,_DriverEntry@8 \
-specs=../../svc_specs -mdll -o keyboard.sys $(OBJECTS) -Wl,temp.exp
- $(RM) temp.exp

View file

@ -58,4 +58,4 @@ void write_dsp(unsigned short base,unsigned char data)
while ((inb(base+DSP_WRITE_PORT) & 0x80) != 0);
outb(base+DSP_WRITE_PORT, data);
}

View file

@ -29,4 +29,4 @@ void get_dma(SB16* sb16)
if(lo==0x08) sb16->dma8=3;
if(lo==0x02) sb16->dma8=1;
if(lo==0x01) sb16->dma8=0;
}
}

View file

@ -6,4 +6,4 @@ typedef struct
unsigned char dma16;
unsigned char* buffer;
}SB16;

View file

@ -1,3 +1,3 @@
void write_wave()
{
}
}

View file

@ -17,6 +17,7 @@
#include <internal/hal/ddk.h>
#include <internal/dma.h>
#include <internal/mm.h>
#include <string.h>
#include <internal/string.h>
#include <devices.h>
#include "sb16.h"

View file

@ -0,0 +1,126 @@
ULONG OldIRQ;
PKINTERRUPT IrqObject;
BOOLEAN DMAOutputISR(PKINTERRUPT Interrupt, PVOID ServiceContext)
{
printk("interrupt\n");
return FALSE;
}
void sb16_play(WAVE_HDR* wave)
{
unsigned int eflags;
ULONG MappedIrq;
KIRQL Dirql;
KAFFINITY Affinity;
PKINTERRUPT IrqObject;
unsigned int mask,newmask;
unsigned int i;
unsigned int tmp[255];
i=0;
dump_wav(wave);
do
{
tmp[i++]=get_dma_page(0x0fffff+IDMAP_BASE);
printk("0x%x ",tmp[i-1]);
}
while((tmp[i-1]&0xffff)!=0);
free_page((tmp[0])-IDMAP_BASE,i-1);
sb16.buffer=((unsigned char*)tmp[i-1]);
/*
* Because this is used by alomost every subsystem including irqs it
* must be atomic. The following code sequence disables interrupts after
* saving the previous state of the interrupt flag
*/
__asm__("pushf\n\tpop %0\n\tcli\n\t"
: "=m" (eflags)
: );
memcpy(sb16.buffer,(&wave->data),wave->dLen);
MappedIrq = HalGetInterruptVector(Internal,0,0,8+sb16.irq,&Dirql,&Affinity);
IoConnectInterrupt(&IrqObject,DMAOutputISR,0,NULL,MappedIrq,Dirql,Dirql,0,FALSE,Affinity,FALSE);
mask=inb(0x21);
newmask=((int)1<<sb16.irq);
outb(0x21,(mask&~newmask));
// Restore the interrupt flag
__asm__("push %0\n\tpopf\n\t"
:
: "m" (eflags));
disable_dma(sb16.dma8);
//outb(0x0a,5);
clear_dma_ff(1);
//outb(0xc,0);
set_dma_count(1,wave->dLen);
set_dma_mode(1,DMA_MODE_WRITE);
//outb(0xb,0x49);
//outb(0x3,(wave->dLen)&0xff);
//outb(0x3,((unsigned int)(wave->dLen)>>8)&0xff);
set_dma_addr(sb16.dma8,(unsigned int)sb16.buffer-IDMAP_BASE);
//outb(0x83,(((unsigned int)(sb16.buffer-IDMAP_BASE)>>16))&0xf);
//outb(0x2,((unsigned int)sb16.buffer&0xff));
//outb(0x2,(((unsigned int)(sb16.buffer-IDMAP_BASE)>>8))&0xff);
enable_dma(sb16.dma8);
//outb(0xa,1);
write_dsp(sb16.base,0x00D1);
write_dsp(sb16.base,0x40);
write_dsp(sb16.base,((unsigned char)256-(1000000/wave->nSamplesPerSec)));
outb(sb16.base + 4, (int) 0xa);
outb(sb16.base + 5, (int) 0x00);
outb(sb16.base + 4, (int) 4);
outb(sb16.base + 5, (int) 0xFF);
outb(sb16.base + 4, (int) 0x22);
outb(sb16.base + 5, (int) 0xFF);
write_dsp(sb16.base,0x14);
write_dsp(sb16.base,(wave->dLen&0x00ff));
write_dsp(sb16.base,((wave->dLen)&0xff00)>>8);
// write_dsp(sb16.base,0xc0);
// write_dsp(sb16.base,0x0);
// OldIRQ=HalGetInterruptVector(Internal,0,0,irq+8,&irql,&affinity);
// printk("OldIRQ: 0x%x\n",OldIRQ);
// status=IoConnectInterrupt(&IrqObject,playRoutine,0,NULL,OldIRQ,irql,irql,0,FALSE,affinity,FALSE);
// if(status!=STATUS_SUCCESS) printk("Couldn't set irq\n");
// else printk("IRQ set\n");
}
void dump_wav(WAVE_HDR* wave)
{
printk("wave.rID: %c%c%c%c\n",wave->rID[0],wave->rID[1],wave->rID[2],wave->rID[3]);
printk("wave.rLen: 0x%x\n",wave->rLen);
printk("wave.wID: %c%c%c%c\n",wave->wID[0],wave->wID[1],wave->wID[2],wave->wID[3]);
printk("wave.fID: %c%c%c%c\n",wave->fID[0],wave->fID[1],wave->fID[2],wave->fID[3]);
printk("wave.fLen: 0x%x\n",wave->fLen);
printk("wave.wFormatTag: 0x%x\n",wave->wFormatTag);
printk("wave.nChannels: 0x%x\n",wave->nChannels);
printk("wave.nSamplesPerSec: 0x%x\n",wave->nSamplesPerSec);
printk("wave.nAvgBytesPerSec: 0x%x\n",wave->nAvgBytesPerSec);
printk("wave.nBlockAlign: 0x%x\n",wave->nBlockAlign);
printk("wave.FormatSpecific: 0x%x\n",wave->FormatSpecific);
printk("wave.dID: %c%c%c%c\n",wave->dID[0],wave->dID[1],wave->dID[2],wave->dID[3]);
printk("wave.dLen: 0x%x\n",wave->dLen);
}
BOOLEAN playRoutine(PKINTERRUPT Interrupt,PVOID ServiceContext)
{
return FALSE;
}

View file

@ -21,4 +21,4 @@ typedef struct
void sb16_play(WAVE_HDR* wave);
void dump_wav(WAVE_HDR* wave);
BOOLEAN playRoutine(PKINTERRUPT Interrupt,PVOID ServiceContext);
BOOLEAN playRoutine(PKINTERRUPT Interrupt,PVOID ServiceContext);

View file

@ -0,0 +1,4 @@
base.tmp
junk.tmp
temp.exp

View file

@ -1 +1,16 @@
all: test.o
all: test.sys
OBJECTS = test.o ../../../ntoskrnl/ntoskrnl.a
# --def test.def --def test.def
test.sys: test.o
$(DLLTOOL) --dllname test.sys --output-lib test.a
$(CC) -specs=$(KM_SPECS) -mdll -o junk.tmp -Wl,--defsym,_end=end \
-Wl,--defsym,_edata=__data_end__ -Wl,--defsym,_etext=etext \
-Wl,--base-file,base.tmp $(OBJECTS)
- $(RM) junk.tmp
$(DLLTOOL) --dllname test.sys --base-file base.tmp \
--output-exp temp.exp
- $(RM) base.tmp
$(CC) --verbose -Wl,--image-base,0x10000 -Wl,-e,_DriverEntry -specs=$(KM_SPECS) -mdll -o test.sys $(OBJECTS) -Wl,temp.exp
- $(RM) temp.exp

View file

@ -15,12 +15,14 @@
/* FUNCTIONS **************************************************************/
#if 0
NTSTATUS TestWrite(PIRP Irp, PIO_STACK_LOCATION Stk)
{
PVOID Address;
Address = MmGetSystemAddressForMdl(Irp->MdlAddress);
printk("Asked to write '%s'\n",(PCH)Address);
DbgPrint("Asked to write '%s'\n",(PCH)Address);
return(STATUS_SUCCESS);
}
@ -40,7 +42,7 @@ NTSTATUS TestDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
switch (Stack->MajorFunction)
{
case IRP_MJ_CREATE:
printk("(Test Driver) Creating\n");
DbgPrint("(Test Driver) Creating\n");
status = STATUS_SUCCESS;
break;
@ -49,7 +51,7 @@ NTSTATUS TestDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
break;
case IRP_MJ_WRITE:
printk("(Test Driver) Writing\n");
DbgPrint("(Test Driver) Writing\n");
status = TestWrite(Irp,Stack);
break;
@ -65,6 +67,8 @@ NTSTATUS TestDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
return(status);
}
#endif
NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
/*
* FUNCTION: Called by the system to initalize the driver
@ -79,8 +83,9 @@ NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
ANSI_STRING astr;
UNICODE_STRING ustr;
printk("Test Driver 0.0.1\n");
DbgPrint("Test Driver 0.0.1\n");
#if 0
RtlInitAnsiString(&astr,"\\Device\\Test");
RtlAnsiStringToUnicodeString(&ustr,&astr,TRUE);
ret = IoCreateDevice(DriverObject,0,&ustr,
@ -96,7 +101,7 @@ NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
DriverObject->MajorFunction[IRP_MJ_WRITE] = TestDispatch;
DriverObject->MajorFunction[IRP_MJ_WRITE] = TestDispatch;
DriverObject->DriverUnload = NULL;
#endif
return(STATUS_SUCCESS);
}

View file

@ -10,6 +10,7 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <string.h>
#include <internal/string.h>
#define NDEBUG

View file

@ -10,8 +10,8 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <wchar.h>
#include <internal/string.h>
#include <wstring.h>
#define NDEBUG
#include <internal/debug.h>

View file

@ -10,8 +10,6 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <internal/string.h>
#include <wstring.h>
#define NDEBUG
#include <internal/debug.h>

View file

@ -1,9 +1,16 @@
OBJECTS = super.o blockdev.o inode.o file.o dir.o rw.o
all: ext2fs.sys
all: ext2.o
ext2.o: $(OBJECTS)
$(LD) -r $(OBJECTS) -o ext2fs.sys
include ../../../rules.mak
OBJECTS = super.o blockdev.o inode.o file.o dir.o rw.o \
../../../ntoskrnl/ntoskrnl.a
ext2fs.sys: $(OBJECTS)
$(CC) -specs=$(KM_SPECS) -mdll -o junk.tmp -Wl,--defsym,_end=end \
-Wl,--defsym,_edata=__data_end__ -Wl,--defsym,_etext=etext \
-Wl,--base-file,base.tmp $(OBJECTS)
$(RM) junk.tmp
$(DLLTOOL) --dllname ext2fs.sys --base-file base.tmp \
--output-exp temp.exp
$(RM) base.tmp
$(CC) --verbose -Wl,--image-base,0x10000 -Wl,-e,_DriverEntry \
-specs=$(KM_SPECS) -mdll -o ext2fs.sys $(OBJECTS) -Wl,temp.exp
$(RM) temp.exp

View file

@ -10,8 +10,6 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <internal/string.h>
#include <wstring.h>
#define NDEBUG
#include <internal/debug.h>

View file

@ -10,8 +10,8 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <wchar.h>
#include <internal/string.h>
#include <wstring.h>
#define NDEBUG
#include <internal/debug.h>

View file

@ -10,8 +10,6 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <internal/string.h>
#include <wstring.h>
#define NDEBUG
#include <internal/debug.h>

View file

@ -10,6 +10,7 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <string.h>
#include <internal/string.h>
#define NDEBUG

View file

@ -10,8 +10,6 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <internal/string.h>
#include <wstring.h>
#define NDEBUG
#include <internal/debug.h>

View file

@ -10,6 +10,7 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <string.h>
#include <internal/string.h>
#include <internal/bitops.h>
#include <ddk/ntifs.h>

View file

@ -11,8 +11,6 @@
#include <ddk/ntddk.h>
#include <ddk/ntifs.h>
#include <internal/string.h>
#include <wstring.h>
#define NDEBUG
#include <internal/debug.h>

View file

@ -10,8 +10,6 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <internal/string.h>
#include <wstring.h>
#define NDEBUG
#include <internal/debug.h>

View file

@ -0,0 +1,4 @@
base.tmp
junk.tmp
temp.exp

View file

@ -10,8 +10,6 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <internal/string.h>
#include <wstring.h>
#define NDEBUG
#include <internal/debug.h>

View file

@ -7,9 +7,10 @@
19-12-1998 : created
*/
#include <ddk/ntddk.h>
#include <wchar.h>
#include <internal/string.h>
#include <wstring.h>
#include <ddk/ntddk.h>
#include <ddk/cctypes.h>
#include <ddk/zwtypes.h>
@ -36,7 +37,7 @@ BOOL fsdDosDateTimeToFileTime(WORD wDosDate,WORD wDosTime, TIME *FileTime)
long long int mult;
Day=wDosDate&0x001f;
Month= (wDosDate&0x00e0)>>5;//1=January
Year= ((wDosDate&0xfe00)>>9)+1980;
Year= ((wDosDate&0xff00)>>8)+1980;
Second=(wDosTime&0x001f)<<1;
Minute=(wDosTime&0x07e0)>>5;
Hour= (wDosTime&0xf100)>>11;
@ -49,13 +50,13 @@ BOOL fsdDosDateTimeToFileTime(WORD wDosDate,WORD wDosTime, TIME *FileTime)
mult *=24;
*pTime +=(Day-1)*mult;
if((Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0) ? 1 : 0))
*pTime += MonthsDF1[1][Month-1]*mult;
*pTime += MonthsDF1[1][Month-1];
else
*pTime += MonthsDF1[0][Month-1]*mult;
*pTime +=((Year-1601)*365
*pTime += MonthsDF1[0][Month-1];
*pTime +=(Year-1601)*mult*365
+(Year-1601)/4
-(Year-1601)/100
+(Year-1601)/400)*mult;
+(Year-1601)/400;
return TRUE;
}
#define DosDateTimeToFileTime fsdDosDateTimeToFileTime
@ -215,7 +216,7 @@ NTSTATUS DoQuery(PDEVICE_OBJECT DeviceObject, PIRP Irp,PIO_STACK_LOCATION Stack)
PVfatCCB pCcb;
PDEVICE_EXTENSION DeviceExt;
WCHAR star[5],*pCharPattern;
unsigned long OldEntry;
unsigned long OldEntry,OldSector;
DeviceExt = DeviceObject->DeviceExtension;
// Obtain the callers parameters
BufferLength = Stack->Parameters.QueryDirectory.Length;
@ -227,7 +228,7 @@ NTSTATUS DoQuery(PDEVICE_OBJECT DeviceObject, PIRP Irp,PIO_STACK_LOCATION Stack)
pFcb = pCcb->pFcb;
if(Stack->Flags & SL_RESTART_SCAN)
{//FIXME : what is really use of RestartScan ?
pCcb->StartEntry=0;
pCcb->StartEntry=pCcb->StartSector=0;
}
// determine Buffer for result :
if (Irp->MdlAddress)
@ -245,12 +246,12 @@ NTSTATUS DoQuery(PDEVICE_OBJECT DeviceObject, PIRP Irp,PIO_STACK_LOCATION Stack)
tmpFcb.ObjectName=tmpFcb.PathName;
while(RC==STATUS_SUCCESS && BufferLength >0)
{
OldSector=pCcb->StartSector;
OldEntry=pCcb->StartEntry;
CHECKPOINT;
RC=FindFile(DeviceExt,&tmpFcb,pFcb,pCharPattern,&pCcb->StartEntry);
DPRINT("Found %w,RC=%x,entry %x\n",tmpFcb.ObjectName,RC
,pCcb->StartEntry);
pCcb->StartEntry++;
if(OldSector)pCcb->StartEntry++;
RC=FindFile(DeviceExt,&tmpFcb,pFcb,pCharPattern,&pCcb->StartSector,&pCcb->StartEntry);
DPRINT("Found %w,RC=%x, sector %x entry %x\n",tmpFcb.ObjectName,RC
,pCcb->StartSector,pCcb->StartEntry);
if (NT_SUCCESS(RC))
{
switch(FileInformationClass)
@ -283,6 +284,7 @@ DPRINT("Found %w,RC=%x,entry %x\n",tmpFcb.ObjectName,RC
if(RC==STATUS_BUFFER_OVERFLOW)
{
if(Buffer0) Buffer0->NextEntryOffset=0;
pCcb->StartSector=OldSector;
pCcb->StartEntry=OldEntry;
break;
}

View file

@ -8,10 +8,10 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <ctype.h>
#include <wchar.h>
#include <internal/string.h>
#include <internal/ctype.h>
#include <wstring.h>
#include <ddk/ntddk.h>
#include <ddk/cctypes.h>
#define NDEBUG
@ -19,22 +19,23 @@
#include "vfat.h"
NTSTATUS updEntry(PDEVICE_EXTENSION DeviceExt,PVfatFCB pFcb)
NTSTATUS updEntry(PDEVICE_EXTENSION DeviceExt,PFILE_OBJECT pFileObject)
/*
update an existing FAT entry
*/
{
WCHAR DirName[MAX_PATH],*FileName,*PathFileName;
VfatFCB FileFcb;
ULONG Entry=0;
ULONG Sector=0,Entry=0;
PUCHAR Buffer;
FATDirEntry * pEntries;
NTSTATUS status;
FILE_OBJECT FileObject;
PVfatCCB pDirCcb;
PVfatFCB pDirFcb;
PVfatFCB pDirFcb,pFcb;
short i,posCar,NameLen;
CHECKPOINT;
PathFileName=pFcb->PathName;
PathFileName=pFileObject->FileName.Buffer;
pFcb=((PVfatCCB)pFileObject->FsContext2)->pFcb;
//find last \ in PathFileName
posCar=-1;
for(i=0;PathFileName[i];i++)
@ -49,8 +50,6 @@ NTSTATUS updEntry(PDEVICE_EXTENSION DeviceExt,PVfatFCB pFcb)
if(FileName[0]==0 && DirName[0]==0)
return STATUS_SUCCESS;//root : nothing to do ?
memset(&FileObject,0,sizeof(FILE_OBJECT));
FileObject.FileName.Buffer=DirName;
FileObject.FileName.Length=posCar;
DPRINT("open directory %w for update of entry %w\n",DirName,FileName);
status=FsdOpenFile(DeviceExt,&FileObject,DirName);
pDirCcb=(PVfatCCB)FileObject.FsContext2;
@ -58,15 +57,18 @@ DPRINT("open directory %w for update of entry %w\n",DirName,FileName);
pDirFcb=pDirCcb->pFcb;
assert(pDirFcb);
FileFcb.ObjectName=&FileFcb.PathName[0];
status=FindFile(DeviceExt,&FileFcb,pDirFcb,FileName,&Entry);
status=FindFile(DeviceExt,&FileFcb,pDirFcb,FileName,&Sector,&Entry);
if(NT_SUCCESS(status))
{
DPRINT("update entry: entry %d\n",Entry);
status=FsdWriteFile(DeviceExt,pDirFcb,&pFcb->entry,sizeof(FATDirEntry)
,Entry*sizeof(FATDirEntry));
Buffer=ExAllocatePool(NonPagedPool,BLOCKSIZE);
DPRINT("update entry: sector %d, entry %d\n",Sector,Entry);
VFATReadSectors(DeviceExt->StorageDevice,Sector,1,Buffer);
pEntries=(FATDirEntry *)Buffer;
memcpy(&pEntries[Entry],&pFcb->entry,sizeof(FATDirEntry));
VFATWriteSectors(DeviceExt->StorageDevice,Sector,1,Buffer);
ExFreePool(Buffer);
}
FsdCloseFile(DeviceExt,&FileObject);
CHECKPOINT;
return status;
}
@ -85,13 +87,11 @@ NTSTATUS addEntry(PDEVICE_EXTENSION DeviceExt
slot *pSlots;
ULONG LengthRead,Offset;
short nbSlots=0,nbFree=0,i,j,posCar,NameLen;
PUCHAR Buffer;
PUCHAR Buffer,Buffer2;
BOOLEAN needTilde=FALSE,needLong=FALSE;
PVfatFCB newFCB,pDirFCB;
PVfatCCB newCCB,pDirCCB;
PVfatFCB newFCB;
PVfatCCB newCCB;
ULONG CurrentCluster;
TIME_FIELDS RTCTime;
CHECKPOINT;
PathFileName=pFileObject->FileName.Buffer;
DPRINT("addEntry: Pathname=%w\n",PathFileName);
//find last \ in PathFileName
@ -108,8 +108,6 @@ NTSTATUS addEntry(PDEVICE_EXTENSION DeviceExt
// open parent directory
memset(&FileObject,0,sizeof(FILE_OBJECT));
status=FsdOpenFile(DeviceExt,&FileObject,DirName);
pDirCCB=FileObject.FsContext2;
pDirFCB=pDirCCB->pFcb;
nbSlots=(NameLen+12)/13+1;//nb of entry needed for long name+normal entry
DPRINT("NameLen= %d, nbSlots =%d\n",NameLen,nbSlots);
Buffer=ExAllocatePool(NonPagedPool,(nbSlots+1)*sizeof(FATDirEntry));
@ -128,6 +126,7 @@ NTSTATUS addEntry(PDEVICE_EXTENSION DeviceExt
memset(pEntry,' ',11);
for(i=0,j=0;j<8 && i<posCar;i++)
{
//FIXME : is there other characters to ignore ?
if( FileName[i]!='.'
&& FileName[i]!=' '
&& FileName[i]!='+'
@ -168,7 +167,7 @@ NTSTATUS addEntry(PDEVICE_EXTENSION DeviceExt
DirName[7]='0'+i;
pEntry->Filename[7]='0'+i;
status=FindFile(DeviceExt,&FileFcb
,&DirFcb,DirName,NULL);
,&DirFcb,DirName,NULL,NULL);
if(status!=STATUS_SUCCESS)break;
}
//try second with xxxxx~yy.zzz
@ -180,7 +179,7 @@ NTSTATUS addEntry(PDEVICE_EXTENSION DeviceExt
DirName[7]='0'+i;
pEntry->Filename[7]='0'+i;
status=FindFile(DeviceExt,&FileFcb
,&DirFcb,DirName,NULL);
,&DirFcb,DirName,NULL,NULL);
if(status!=STATUS_SUCCESS)break;
}
}
@ -225,19 +224,13 @@ DPRINT("i=%d,j=%d,%d,%d\n",i,j,pEntry->Filename[i],FileName[i]);
DirName[NameLen]=0;
}
DPRINT("dos name=%11.11s\n",pEntry->Filename);
// set attributes, dates, times
//FIXME : set attributes, dates, times
pEntry->Attrib=ReqAttr;
if(RequestedOptions&FILE_DIRECTORY_FILE)
pEntry->Attrib |= FILE_ATTRIBUTE_DIRECTORY;
HalQueryRealTimeClock(&RTCTime);
pEntry->CreationTime
= (RTCTime.Second>>1)+(RTCTime.Minute<<5)+(RTCTime.Hour<<11);
pEntry->CreationDate
= RTCTime.Day+(RTCTime.Month<<5)+((RTCTime.Year-1980)<<9);
pEntry->UpdateDate=pEntry->CreationDate;
pEntry->UpdateTime=pEntry->CreationTime;
pEntry->AccessDate=pEntry->CreationDate;
pEntry->CreationDate=0x21;
pEntry->UpdateDate=0x21;
// calculate checksum for 8.3 name
for(pSlots[0].alias_checksum=i=0;i<11;i++)
{
@ -256,28 +249,33 @@ DPRINT("i=%d,j=%d,%d,%d\n",i,j,pEntry->Filename[i],FileName[i]);
pSlots[i].id=nbSlots-i-1+0x40;
pSlots[i].alias_checksum=pSlots[0].alias_checksum;
//FIXME pSlots[i].start=;
memcpy(pSlots[i].name0_4 ,DirName+(nbSlots-i-2)*13
memcpy(pSlots[i].name0_4 ,FileName+(nbSlots-i-2)*13
,5*sizeof(WCHAR));
memcpy(pSlots[i].name5_10 ,DirName+(nbSlots-i-2)*13+5
memcpy(pSlots[i].name5_10 ,FileName+(nbSlots-i-2)*13+5
,6*sizeof(WCHAR));
memcpy(pSlots[i].name11_12,DirName+(nbSlots-i-2)*13+11
memcpy(pSlots[i].name11_12,FileName+(nbSlots-i-2)*13+11
,2*sizeof(WCHAR));
}
//try to find nbSlots contiguous entries frees in directory
for(i=0,status=STATUS_SUCCESS;status==STATUS_SUCCESS;i++)
{
status=FsdReadFile(DeviceExt,pDirFCB,&FatEntry
status=FsdReadFile(DeviceExt,&FileObject,&FatEntry
,sizeof(FATDirEntry),i*sizeof(FATDirEntry),&LengthRead);
if(IsLastEntry(&FatEntry))
if(IsLastEntry(&FatEntry,0))
break;
if(IsDeletedEntry(&FatEntry)) nbFree++;
if(IsDeletedEntry(&FatEntry,0)) nbFree++;
else nbFree=0;
if (nbFree==nbSlots) break;
}
DPRINT("NbFree %d, entry number %d\n",nbFree,i);
if(RequestedOptions&FILE_DIRECTORY_FILE)
{ // directory has always a first cluster
{
CurrentCluster=GetNextWriteCluster(DeviceExt,0);
// zero the cluster
Buffer2=ExAllocatePool(NonPagedPool,DeviceExt->BytesPerCluster);
memset(Buffer2,0,DeviceExt->BytesPerCluster);
VFATWriteCluster(DeviceExt,Buffer2,CurrentCluster);
ExFreePool(Buffer2);
if (DeviceExt->FatType == FAT32)
{
pEntry->FirstClusterHigh=CurrentCluster>>16;
@ -289,13 +287,13 @@ DPRINT("i=%d,j=%d,%d,%d\n",i,j,pEntry->Filename[i],FileName[i]);
if(nbFree==nbSlots)
{//use old slots
Offset=(i-nbSlots+1)*sizeof(FATDirEntry);
status=FsdWriteFile(DeviceExt,pDirFCB,Buffer
status=FsdWriteFile(DeviceExt,&FileObject,Buffer
,sizeof(FATDirEntry)*nbSlots,Offset);
}
else
{//write at end of directory
Offset=(i-nbFree)*sizeof(FATDirEntry);
status=FsdWriteFile(DeviceExt,pDirFCB,Buffer
status=FsdWriteFile(DeviceExt,&FileObject,Buffer
,sizeof(FATDirEntry)*(nbSlots+1),Offset);
}
DPRINT("write entry offset %d status=%x\n",Offset,status);
@ -307,13 +305,10 @@ DPRINT("i=%d,j=%d,%d,%d\n",i,j,pEntry->Filename[i],FileName[i]);
newCCB->PtrFileObject=pFileObject;
newFCB->RefCount++;
//FIXME : initialize all fields in FCB and CCB
newFCB->Buffer=ExAllocatePool(NonPagedPool,DeviceExt->BytesPerCluster);
newFCB->Cluster=0xFFFFFFFF;
newFCB->Flags=0;
newFCB->nextFcb=pFirstFcb;
memcpy(&newFCB->entry,pEntry,sizeof(FATDirEntry));
DPRINT("new : entry=%11.11s\n",newFCB->entry.Filename);
DPRINT("new : entry=%11.11s\n",pEntry->Filename);
newFCB->nextFcb=pFirstFcb;
pFirstFcb=newFCB;
vfat_wcsncpy(newFCB->PathName,PathFileName,MAX_PATH);
newFCB->ObjectName=newFCB->PathName+(PathFileName-FileName);
@ -324,7 +319,7 @@ DPRINT("new : entry=%11.11s\n",pEntry->Filename);
{
// create . and ..
memcpy(pEntry->Filename,". ",11);
status=FsdWriteFile(DeviceExt,newFCB,pEntry
status=FsdWriteFile(DeviceExt,pFileObject,pEntry
,sizeof(FATDirEntry),0L);
pEntry->FirstCluster
=((VfatCCB *)(FileObject.FsContext2))->pFcb->entry.FirstCluster;
@ -333,7 +328,7 @@ DPRINT("new : entry=%11.11s\n",pEntry->Filename);
memcpy(pEntry->Filename,".. ",11);
if(pEntry->FirstCluster==1 && DeviceExt->FatType!=FAT32)
pEntry->FirstCluster=0;
status=FsdWriteFile(DeviceExt,newFCB,pEntry
status=FsdWriteFile(DeviceExt,pFileObject,pEntry
,sizeof(FATDirEntry),sizeof(FATDirEntry));
}
FsdCloseFile(DeviceExt,&FileObject);

File diff suppressed because it is too large Load diff

View file

@ -1,22 +1,15 @@
%.o: %.cc
$(CC) $(CFLAGS) -c $< -o $@
%.o: %.asm
$(NASM) $(NFLAGS) $< -o $@
all: vfatfsd.sys
OBJECTS= blockdev.o iface.o dir.o dirwr.o
OBJECTS = blockdev.o dir.o dirwr.o iface.o ../../../ntoskrnl/ntoskrnl.a
all: vfatfsd.o
tests: tstvfat5.bin tstvfat6.bin
vfatfsd.o: $(OBJECTS)
$(LD) $(OBJECTS) -r -o vfatfsd.o
$(NM) --numeric-sort vfatfsd.o > vfatfsd.sym
OBJECTS2 = ../../../apps/common/crt0.o
LIBS= ../../../lib/kernel32/kernel32.a ../../../lib/ntdll/ntdll.a
%.bin: $(OBJECTS) %.o
$(LD) -Ttext 0x10000 $(OBJECTS2) $*.o $(LIBS) -o $*.exe
$(OBJCOPY) -O binary $*.exe $*.bin
include ../../../rules.mak
vfatfsd.sys: $(OBJECTS)
$(CC) -specs=../../svc_specs -mdll -o junk.tmp -Wl,--defsym,_end=end \
-Wl,--defsym,_edata=__data_end__ -Wl,--defsym,_etext=etext \
-Wl,--base-file,base.tmp $(OBJECTS)
- $(RM) junk.tmp
$(DLLTOOL) --dllname vfatfsd.sys --base-file base.tmp \
--output-exp temp.exp
- $(RM) base.tmp
$(CC) --verbose -Wl,--image-base,0x10000 -Wl,-e,_DriverEntry@8 \
-specs=../../svc_specs -mdll -o vfatfsd.sys $(OBJECTS) -Wl,temp.exp
- $(RM) temp.exp

View file

@ -1,4 +1,4 @@
#include <wchar.h>
@ -113,9 +113,6 @@ typedef struct _VfatFCB
PDEVICE_EXTENSION pDevExt;
struct _VfatFCB * nextFcb, *prevFcb;
struct _VfatFCB * parentFcb;
UCHAR *Buffer;
long Flags;
ULONG Cluster;
} VfatFCB, *PVfatFCB;
typedef struct
@ -124,6 +121,7 @@ typedef struct
LIST_ENTRY NextCCB;
PFILE_OBJECT PtrFileObject;
LARGE_INTEGER CurrentByteOffset;
ULONG StartSector; // for DirectoryControl
ULONG StartEntry; //for DirectoryControl
// PSTRING DirectorySearchPattern;// for DirectoryControl ?
} VfatCCB, *PVfatCCB;
@ -158,27 +156,27 @@ BOOLEAN VFATWriteSectors(IN PDEVICE_OBJECT pDeviceObject,
//internal functions in iface.c :
NTSTATUS FindFile(PDEVICE_EXTENSION DeviceExt, PVfatFCB Fcb,
PVfatFCB Parent, PWSTR FileToFind,ULONG *Entry);
PVfatFCB Parent, PWSTR FileToFind,ULONG *StartSector,ULONG *Entry);
NTSTATUS FsdCloseFile(PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject);
NTSTATUS FsdGetStandardInformation(PVfatFCB FCB, PDEVICE_OBJECT DeviceObject,
PFILE_STANDARD_INFORMATION StandardInfo);
NTSTATUS FsdOpenFile(PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject,
PWSTR FileName);
NTSTATUS FsdReadFile(PDEVICE_EXTENSION DeviceExt, PVfatFCB pFcb,
NTSTATUS FsdReadFile(PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject,
PVOID Buffer, ULONG Length, ULONG ReadOffset,
PULONG LengthRead);
NTSTATUS FsdWriteFile(PDEVICE_EXTENSION DeviceExt, PVfatFCB pFcb,
PVOID Buffer, ULONG Length, ULONG WriteOffset);
NTSTATUS FsdWriteFile(PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject,
PVOID Buffer, ULONG Length, ULONG WriteOffset);
ULONG GetNextWriteCluster(PDEVICE_EXTENSION DeviceExt, ULONG CurrentCluster);
BOOLEAN IsDeletedEntry(FATDirEntry *pEntry);
BOOLEAN IsLastEntry(FATDirEntry *pEntry);
BOOLEAN IsDeletedEntry(PVOID Block, ULONG Offset);
BOOLEAN IsLastEntry(PVOID Block, ULONG Offset);
wchar_t * vfat_wcsncpy(wchar_t * dest, const wchar_t *src,size_t wcount);
void VFATWriteCluster(PDEVICE_EXTENSION DeviceExt, PVOID Buffer, ULONG Cluster);
//internal functions in dirwr.c
NTSTATUS addEntry(PDEVICE_EXTENSION DeviceExt
,PFILE_OBJECT pFileObject,ULONG RequestedOptions,UCHAR ReqAttr);
NTSTATUS updEntry(PDEVICE_EXTENSION DeviceExt,PVfatFCB pFcb);
NTSTATUS updEntry(PDEVICE_EXTENSION DeviceExt,PFILE_OBJECT pFileObject);
//FIXME : following defines must be removed

View file

@ -9,4 +9,4 @@ To install :
What's new :
- some bugfixes
- support for IRP_MJ_DIRECTORY_CONTROL
(see reactos/tst/sshell.c for use of ZwQueryDirectoryFile)
(see reactos/tst/sshell.c for use of ZwQueryDirectoryFile)

78
reactos/drivers/svc_specs Normal file
View file

@ -0,0 +1,78 @@
*asm:
*asm_final:
*cpp:
-remap %(cpp_cpu) %{posix:-D_POSIX_SOURCE}
*cc1:
%(cc1_spec)
*cc1plus:
*endfile:
*link:
%{mwindows:--subsystem windows} %{mdll:--dll -e _DriverEntry@8}
*lib:
*libgcc:
*startfile:
*switches_need_spaces:
*signed_char:
%{funsigned-char:-D__CHAR_UNSIGNED__}
*predefines:
-Di386 -D_WIN32 -DWIN32 -D__WIN32__ -D__MINGW32__ -DWINNT -D_X86_=1 -D__STDC__=1 -D__stdcall=__attribute__((__stdcall__)) _D_stdcall=__attribute__((__stdcall__)) -D__cdecl=__attribute__((__cdecl__)) -D__declspec(x)=__attribute__((x)) -Asystem(winnt) -Acpu(i386) -Amachine(i386)
*cross_compile:
1
*version:
egcs-2.91.57
*multilib:
. ;
*multilib_defaults:
*multilib_extra:
*multilib_matches:
*linker:
collect2
*cpp_486:
%{!ansi:-Di486} -D__i486 -D__i486__
*cpp_586:
%{!ansi:-Di586 -Dpentium} -D__i586 -D__i586__ -D__pentium -D__pentium__
*cpp_686:
%{!ansi:-Di686 -Dpentiumpro} -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__
*cpp_cpu_default:
%(cpp_586)
*cpp_cpu:
-Acpu(i386) -Amachine(i386) %{!ansi:-Di386} -D__i386 -D__i386__ %{mcpu=i486:%(cpp_486)} %{m486:%(cpp_486)} %{mpentium:%(cpp_586)} %{mcpu=pentium:%(cpp_586)} %{mpentiumpro:%(cpp_686)} %{mcpu=pentiumpro:%(cpp_686)} %{!mcpu*:%{!m486:%{!mpentium*:%(cpp_cpu_default)}}}
*cc1_cpu:
%{!mcpu*: %{m386:-mcpu=i386 -march=i386} %{mno-486:-mcpu=i386 -march=i386} %{m486:-mcpu=i486 -march=i486} %{mno-386:-mcpu=i486 -march=i486} %{mno-pentium:-mcpu=i486 -march=i486} %{mpentium:-mcpu=pentium} %{mno-pentiumpro:-mcpu=pentium} %{mpentiumpro:-mcpu=pentiumpro}}

View file

@ -10,10 +10,13 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define TRUE 1
#define FALSE 0
#define PARAMETERIZED_LIBS
/* FUNCTIONS ****************************************************************/
int process(FILE* in, FILE* out, FILE *out2)
@ -24,7 +27,8 @@ int process(FILE* in, FILE* out, FILE *out2)
char* name2;
int value;
char* nr_args;
char* stmp;
unsigned char first1 = TRUE;
fprintf(out,"// Machine generated, don't edit\n");
@ -53,6 +57,11 @@ int process(FILE* in, FILE* out, FILE *out2)
// value = strtok(NULL," \t");
nr_args = (char *)strtok(NULL," \t");
if ((stmp=strchr(nr_args,'\n'))!=NULL)
{
*stmp=0;
}
// printf("name %s value %d\n",name,value);
#ifdef PARAMETERIZED_LIBS
fprintf(out,"__asm__(\"\\n\\t.global _%s@%s\\n\\t\"\n",name,nr_args);

View file

@ -11,8 +11,8 @@ genntdll$(EXE_POSTFIX): genntdll.c
sysfuncs.lst: dummy
clean: dummy
- $(RM) ../../lib/ntdll/sysfuncs.lst
- $(RM) ../../include/ntdll/napi.h
$(RM) ../../lib/ntdll/sysfuncs.lst
$(RM) ../../include/ntdll/napi.h
dummy:

View file

@ -60,7 +60,7 @@ NtFreeVirtualMemory ZwFreeVirtualMemory 16
NtFsControlFile ZwFsControlFile 40
NtGetContextThread ZwGetContextThread 8
NtGetPlugPlayEvent ZwGetPlugPlayEvent 16
NtGetTickCount ZwGetTickCount 0
NtGetTickCount ZwGetTickCount 4
NtImpersonateClientOfPort ZwImpersonateClientOfPort 8
NtImpersonateThread ZwImpersonateThread 12
NtInitializeRegistry ZwInitializeRegistry 4

View file

@ -65,6 +65,10 @@ typedef unsigned short *PUSHORT;
typedef void *PVOID;
typedef unsigned char BYTE;
typedef void *LPVOID;
typedef DWORD *PDWORD;
typedef float *PFLOAT;
typedef unsigned short *PWCH;
typedef unsigned short *PWORD;
/* Check VOID before defining CHAR, SHORT, and LONG */
#ifndef VOID
@ -274,8 +278,6 @@ typedef BYTE *PBYTE;
typedef const CHAR *PCCH;
typedef const char *PCSTR;
typedef const unsigned short *PCWCH;
typedef DWORD *PDWORD;
typedef float *PFLOAT;
/* typedef PHKEY; */
typedef int *PINT;
/* typedef LCID *PLCID; */
@ -296,8 +298,6 @@ typedef char *PTCHAR;
typedef char *PTSTR;
#endif /* UNICODE */
typedef unsigned short *PWCH;
typedef unsigned short *PWORD;
/*
typedef PWSTR;
typedef REGSAM;

View file

@ -1,67 +0,0 @@
/*
* conio.h
*
* Low level console I/O functions. Pretty please try to use the ANSI
* standard ones if you are writing new code.
*
* This file is part of the Mingw32 package.
*
* Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
*
* 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
* DISCLAMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision: 1.4 $
* $Author: ariadne $
* $Date: 1999/02/25 22:51:47 $
*
*/
#ifndef __STRICT_ANSI__
#ifndef _CONIO_H_
#define _CONIO_H_
#ifdef __cplusplus
extern "C" {
#endif
char* _cgets (char* szBuffer);
int _cprintf (const char* szFormat, ...);
int _cputs (const char* szString);
int _cscanf (char* szFormat, ...);
int _getch (void);
int _getche (void);
int _kbhit (void);
int _putch (int cPut);
int _ungetch (int cUnget);
#ifndef _NO_OLDNAMES
#define getch _getch
#define getche _getche
#define kbhit _kbhit
#define putch _putch
#define ungetch _ungetch
#endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus
}
#endif
#endif /* Not _CONIO_H_ */
#endif /* Not __STRICT_ANSI__ */

View file

@ -18,9 +18,9 @@
* DISCLAMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision: 1.1 $
* $Author: ariadne $
* $Date: 1999/02/25 22:51:47 $
* $Revision: 1.2 $
* $Author: rex $
* $Date: 1999/03/19 05:55:07 $
*
*/

View file

@ -0,0 +1,111 @@
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_conio_h_
#define __dj_include_conio_h_
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
#ifndef __STRICT_ANSI__
#ifndef _POSIX_SOURCE
extern int directvideo; /* ignored by gppconio */
extern int _wscroll;
#define _NOCURSOR 0
#define _SOLIDCURSOR 1
#define _NORMALCURSOR 2
struct text_info {
unsigned char winleft;
unsigned char wintop;
unsigned char winright;
unsigned char winbottom;
unsigned char attribute;
unsigned char normattr;
unsigned char currmode;
unsigned char screenheight;
unsigned char screenwidth;
unsigned char curx;
unsigned char cury;
};
enum text_modes { LASTMODE=-1, BW40=0, C40, BW80, C80, MONO=7, C4350=64 };
enum COLORS {
/* dark colors */
BLACK,
BLUE,
GREEN,
CYAN,
RED,
MAGENTA,
BROWN,
LIGHTGRAY,
/* light colors */
DARKGRAY,
LIGHTBLUE,
LIGHTGREEN,
LIGHTCYAN,
LIGHTRED,
LIGHTMAGENTA,
YELLOW,
WHITE
};
#define BLINK 0x80 /* blink bit */
void blinkvideo(void);
char * cgets(char *_str);
void clreol(void);
void clrscr(void);
int _conio_kbhit(void); /* checks for ungetch char */
//int cprintf(const char *_format, ...) __attribute__((format(printf,1,2)));
int cputs(const char *_str);
//int cscanf(const char *_format, ...) __attribute__((format(scanf,1,2)));
void delline(void);
int getch(void);
int getche(void);
int gettext(int _left, int _top, int _right, int _bottom, void *_destin);
void gettextinfo(struct text_info *_r);
void gotoxy(int _x, int _y);
void gppconio_init(void);
void highvideo(void);
void insline(void);
void intensevideo(void);
void lowvideo(void);
int movetext(int _left, int _top, int _right, int _bottom, int _destleft, int _desttop);
void normvideo(void);
int putch(int _c);
int puttext(int _left, int _top, int _right, int _bottom, void *_source);
void _setcursortype(int _type);
void _set_screen_lines(int _nlines);
void textattr(int _attr);
void textbackground(int _color);
void textcolor(int _color);
void textmode(int _mode);
int ungetch(int);
unsigned int wherex(void);
unsigned int wherey(void);
void window(int _left, int _top, int _right, int _bottom);
#define kbhit _conio_kbhit /* Who ever includes gppconio.h probably
also wants _conio_kbhit and not kbhit
from libc */
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
#ifdef __cplusplus
}
#endif
#endif /* !__dj_include_conio_h_ */

View file

@ -19,8 +19,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision: 1.2 $
* $Author: ariadne $
* $Date: 1999/03/07 13:35:10 $
* $Author: rex $
* $Date: 1999/03/19 05:55:07 $
*
*/
#ifndef _LINUX_CTYPE_H
@ -50,10 +50,18 @@
#define _ALPHA 0x0103
// additionally defined
#define _PRINT 0x0200
#define _GRAPH 0x0400
/* from DJGPP, see appropriate licence */
#define __dj_ISALNUM 0x0001
#define __dj_ISALPHA 0x0002
#define __dj_ISCNTRL 0x0004
#define __dj_ISDIGIT 0x0008
#define __dj_ISGRAPH 0x0010
#define __dj_ISLOWER 0x0020
#define __dj_ISPRINT 0x0040
#define __dj_ISPUNCT 0x0080
#define __dj_ISSPACE 0x0100
#define __dj_ISUPPER 0x0200
#define __dj_ISXDIGIT 0x0400
#ifdef __cplusplus
extern "C" {
@ -72,7 +80,7 @@ int isupper(int c);
int isxdigit(int c);
#ifndef __STRICT_ANSI__
int _isctype (unsigned char c, int ctypeFlags);
int _isctype (unsigned int c, int ctypeFlags);
#endif
int tolower(int c);
@ -103,20 +111,20 @@ int _toupper(int c);
typedef int wctype_t;
/* Wide character equivalents */
int iswalnum(int wc);
int iswalpha(int wc);
int iswascii(int wc);
int iswcntrl(int wc);
int iswctype(unsigned short wc, int wctypeFlags);
int is_wctype(unsigned short wc, int wctypeFlags); /* Obsolete! */
int iswdigit(int wc);
int iswgraph(int wc);
int iswlower(int wc);
int iswprint(int wc);
int iswpunct(int wc);
int iswspace(int wc);
int iswupper(int wc);
int iswxdigit(int wc);
int iswalnum(wint_t wc);
int iswalpha(wint_t wc);
int iswascii(wint_t wc);
int iswcntrl(wint_t wc);
int iswctype(wint_t wc, wctype_t wctypeFlags);
int is_wctype(wint_t wc, wctype_t wctypeFlags); /* Obsolete! */
int iswdigit(wint_t wc);
int iswgraph(wint_t wc);
int iswlower(wint_t wc);
int iswprint(wint_t wc);
int iswpunct(wint_t wc);
int iswspace(wint_t wc);
int iswupper(wint_t wc);
int iswxdigit(wint_t wc);
wchar_t towlower(wchar_t c);
wchar_t towupper(wchar_t c);
@ -130,10 +138,10 @@ int __iscsymf (int c); /* Valid first character in C symbol */
int __iscsym (int c); /* Valid character in C symbol (after first) */
#ifndef _NO_OLDNAMES
#define isascii(c) (!((c)&(~0x7f)))
#define toascii(c) ((unsigned)(c) &0x7F)
#define iscsymf(c) (isalpha(c) || ( c == '_' ))
#define iscsym(c) (isalnum(c) || ( c == '_' ))
int isascii (int c);
int toascii (int c);
int iscsymf (int c);
int iscsym (int c);
#endif /* Not _NO_OLDNAMES */
#endif /* Not __STRICT_ANSI__ */

View file

@ -18,9 +18,9 @@
* DISCLAMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision: 1.1 $
* $Author: ariadne $
* $Date: 1999/02/25 22:51:47 $
* $Revision: 1.2 $
* $Author: rex $
* $Date: 1999/03/19 05:55:07 $
*
*/

View file

@ -0,0 +1,27 @@
#ifndef __include_direct_h_
#define __include_direct_h_
struct _diskfree_t {
unsigned short total_clusters;
unsigned short avail_clusters;
unsigned short sectors_per_cluster;
unsigned short bytes_per_sector;
};
int _chdrive( int drive );
int _getdrive( void );
char *_getcwd( char *buffer, int maxlen );
int _chdir(const char *_path);
char *_getcwd(char *, int);
int _mkdir(const char *_path);
int _rmdir(const char *_path);
unsigned int _getdiskfree(unsigned int _drive, struct _diskfree_t *_diskspace);
#define chdir _chdir
#define getcwd _getcwd
#define mkdir _mkdir
#define rmdir _rmdir
#endif

View file

@ -14,9 +14,9 @@
* DISCLAMED. This includeds but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision: 1.1 $
* $Author: ariadne $
* $Date: 1999/02/25 22:51:47 $
* $Revision: 1.2 $
* $Author: rex $
* $Date: 1999/03/19 05:55:07 $
*
*/

View file

@ -0,0 +1,158 @@
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_h_
#define __dj_include_h_
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
#ifndef __STRICT_ANSI__
#ifndef _POSIX_SOURCE
struct ftime {
unsigned ft_tsec:5; /* 0-29, double to get real seconds */
unsigned ft_min:6; /* 0-59 */
unsigned ft_hour:5; /* 0-23 */
unsigned ft_day:5; /* 1-31 */
unsigned ft_month:4; /* 1-12 */
unsigned ft_year:7; /* since 1980 */
};
struct date {
short da_year;
char da_day;
char da_mon;
};
struct time {
unsigned char ti_min;
unsigned char ti_hour;
unsigned char ti_hund;
unsigned char ti_sec;
};
struct dfree {
unsigned df_avail;
unsigned df_total;
unsigned df_bsec;
unsigned df_sclus;
};
#ifdef __cplusplus
extern "C" {
#endif
extern unsigned short _osmajor, _osminor;
extern const char * _os_flavor;
unsigned short _get_version(int);
int getftime(int handle, struct ftime *ftimep);
int setftime(int handle, struct ftime *ftimep);
int getcbrk(void);
int setcbrk(int new_value);
void getdate(struct date *);
void gettime(struct time *);
void setdate(struct date *);
void settime(struct time *);
void getdfree(unsigned char drive, struct dfree *ptr);
void delay(unsigned msec);
/* int _get_default_drive(void);
void _fixpath(const char *, char *); */
/*
* For compatibility with other DOS C compilers.
*/
#define _A_NORMAL 0x00 /* Normal file - No read/write restrictions */
#define _A_RDONLY 0x01 /* Read only file */
#define _A_HIDDEN 0x02 /* Hidden file */
#define _A_SYSTEM 0x04 /* System file */
#define _A_VOLID 0x08 /* Volume ID file */
#define _A_SUBDIR 0x10 /* Subdirectory */
#define _A_ARCH 0x20 /* Archive file */
#define _enable enable
#define _disable disable
struct date_t {
unsigned char day; /* 1-31 */
unsigned char month; /* 1-12 */
unsigned short year; /* 1980-2099 */
unsigned char dayofweek; /* 0-6, 0=Sunday */
};
#define dosdate_t date_t
struct time_t {
unsigned char hour; /* 0-23 */
unsigned char minute; /* 0-59 */
unsigned char second; /* 0-59 */
unsigned char hsecond; /* 0-99 */
};
#define dostime_t time_t
#define finddata_t _finddata_t
#define diskfree_t _diskfree_t
struct _DOSERROR {
int exterror;
#ifdef __cplusplus
char errclass;
#else
char class;
#endif
char action;
char locus;
};
#define DOSERROR _DOSERROR
void _getdate(struct date_t *_date);
unsigned int _setdate(struct date_t *_date);
void _gettime(struct time_t *_time);
unsigned int _settime(struct time_t *_time);
unsigned int _getftime(int _handle, unsigned int *_p_date, unsigned int *_p_time);
unsigned int _setftime(int _handle, unsigned int _date, unsigned int _time);
unsigned int _getfileattr(const char *_filename, unsigned int *_p_attr);
unsigned int _setfileattr(const char *_filename, unsigned int _attr);
void _setdrive(unsigned int _drive, unsigned int *_p_drives);
int exterr(struct _DOSERROR *_p_error);
#define dosexterr(_ep) exterr(_ep)
#include <direct.h>
#define int386(_i, _ir, _or) int86(_i, _ir, _or)
#define int386x(_i, _ir, _or, _sr) int86x(_i, _ir, _or, _sr)
#ifdef __cplusplus
}
#endif
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
#endif /* !__dj_include_h_ */

View file

@ -18,9 +18,9 @@
* DISCLAMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision: 1.1 $
* $Author: ariadne $
* $Date: 1999/02/25 22:51:47 $
* $Revision: 1.2 $
* $Author: rex $
* $Date: 1999/03/19 05:55:07 $
*
*/
@ -96,10 +96,10 @@ extern "C" {
* sys_errlist.
*/
int* _errno(void);
#define errno (*_errno(void))
#define errno (*_errno())
int* __doserrno(void);
#define _doserrno (*__doserrno(void))
#define _doserrno (*__doserrno())
#if __MSVCRT__
/* One of the MSVCRTxx libraries */

View file

@ -0,0 +1,164 @@
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_fcntl_h_
#define __dj_include_fcntl_h_
#ifdef __cplusplus
extern "C" {
#endif
#define _IOREAD 000010
#define _IOWRT 000020
#define _IOMYBUF 000040
#define _IOEOF 000100
#define _IOERR 000200
#define _IOSTRG 000400
#define _IORW 001000
#define _IOAPPEND 002000
#define _IORMONCL 004000 /* remove on close, for temp files */
/* if _flag & _IORMONCL, ._name_to_remove needs freeing */
#define _IOUNGETC 010000 /* there is an ungetc'ed character in the buffer */
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
#ifndef __STRICT_ANSI__
#define FD_CLOEXEC 0x0001
#define F_DUPFD 1
#define F_GETFD 2
#define F_GETFL 3
#define F_GETLK 4
#define F_SETFD 5
#define F_SETFL 6
#define F_SETLK 7
#define F_SETLKW 8
#define F_UNLCK 0
#define F_RDLCK 1
#define F_WRLCK 2
#define O_RDONLY 0x0000
#define O_WRONLY 0x0001
#define O_RDWR 0x0002
#define O_ACCMODE 0x0003
#define O_BINARY 0x0004 /* must fit in char, reserved by dos */
#define O_TEXT 0x0008 /* must fit in char, reserved by dos */
#define O_RANDOM 0x0010
#define O_SEQUENTIAL 0x0020
#define O_TEMPORARY 0x0040
/* temporary access hint */
/* sequential/random access hints */
#define O_NOINHERIT 0x0080 /* DOS-specific */
#define O_CREAT 0x0100 /* second byte, away from DOS bits */
#define O_EXCL 0x0200
#define O_NOCTTY 0x0400
#define O_TRUNC 0x0800
#define O_APPEND 0x1000
#define O_NONBLOCK 0x2000
#define O_SHORT_LIVED 0x1000
//#include <sys/types.h>
#include <sys/stat.h>
//typedef int dev_t;
//typedef int ino_t;
//typedef int mode_t;
//typedef int nlink_t;
#include <io.h>
struct flock {
off_t l_len;
pid_t l_pid;
off_t l_start;
short l_type;
short l_whence;
};
extern int _fmode; /* O_TEXT or O_BINARY */
//int open(const char *_path, int _oflag, ...);
//int creat(const char *_path, int _mode);
int fcntl(int _fildes, int _cmd, ...);
#ifndef _POSIX_SOURCE
#define S_IREAD S_IRUSR
#define S_IWRITE S_IWUSR
#define S_IEXEC S_IXUSR
/*
* For compatibility with other DOS C compilers.
*/
#define _O_RDONLY O_RDONLY
#define _O_WRONLY O_WRONLY
#define _O_RDWR O_RDWR
#define _O_APPEND O_APPEND
#define _O_CREAT O_CREAT
#define _O_TRUNC O_TRUNC
#define _O_EXCL O_EXCL
#define _O_TEXT O_TEXT
#define _O_BINARY O_BINARY
#define _O_NOINHERIT O_NOINHERIT
#define _O_RANDOM O_RANDOM
#define _O_SEQUENTIAL O_RANDOM
#define _O_SHORT_LIVED O_SHORT_LIVED
#define _O_TEMPORARY O_TEMPORARY
#define _S_IREAD S_IRUSR
#define _S_IWRITE S_IWUSR
#define _S_IEXEC S_IXUSR
/*
* Support for advanced filesystems (Windows 9x VFAT, NTFS, LFN etc.)
*/
#define _FILESYS_UNKNOWN 0x80000000U
#define _FILESYS_CASE_SENSITIVE 0x0001
#define _FILESYS_CASE_PRESERVED 0x0002
#define _FILESYS_UNICODE 0x0004
#define _FILESYS_LFN_SUPPORTED 0x4000
#define _FILESYS_VOL_COMPRESSED 0x8000
unsigned _get_volume_info (const char *_path, int *_max_file_len, int *_max_path_len, char *_filesystype);
char _use_lfn (const char *_path);
char *_lfn_gen_short_fname (const char *_long_fname, char *_short_fname);
#define _LFN_CTIME 1
#define _LFN_ATIME 2
unsigned _lfn_get_ftime (int _handle, int _which);
char _preserve_fncase (void);
#define _USE_LFN _use_lfn(0) /* assume it's the same on ALL drives */
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
#ifdef __cplusplus
}
#endif
#endif /* !__dj_include_fcntl_h_ */

View file

@ -28,8 +28,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision: 1.2 $
* $Author: ariadne $
* $Date: 1999/03/07 13:35:10 $
* $Author: rex $
* $Date: 1999/03/19 05:55:07 $
*
*/
@ -146,15 +146,15 @@ unsigned int _controlfp (unsigned int unNew, unsigned int unMask);
unsigned int _control87 (unsigned int unNew, unsigned int unMask);
unsigned int _clearfp (void); /* Clear the FPU status word */
unsigned int _statusfp (void); /* Report the FPU status word */
unsigned int _clearfp (); /* Clear the FPU status word */
unsigned int _statusfp (); /* Report the FPU status word */
#define _clear87 _clearfp
#define _status87 _statusfp
void _fpreset (void); /* Reset the FPU */
void _fpreset (); /* Reset the FPU */
/* Global 'variable' for the current floating point error code. */
int * __fpecode(void);
int * __fpecode();
#define _fpecode (*(__fpecode()))
/*

View file

@ -18,9 +18,9 @@
* DISCLAMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision: 1.5 $
* $Author: ariadne $
* $Date: 1999/03/07 13:35:10 $
* $Revision: 1.2 $
* $Author: rex $
* $Date: 1999/03/19 05:55:07 $
*
*/
/* Appropriated for Reactos Crtdll by Ariadne */

View file

@ -18,9 +18,9 @@
* DISCLAMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision: 1.1 $
* $Author: ariadne $
* $Date: 1999/02/25 22:51:47 $
* $Revision: 1.2 $
* $Author: rex $
* $Date: 1999/03/19 05:55:07 $
*
*/

View file

@ -18,9 +18,9 @@
* DISCLAMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision: 1.3 $
* $Author: ariadne $
* $Date: 1999/03/07 13:35:10 $
* $Revision: 1.2 $
* $Author: rex $
* $Date: 1999/03/19 05:55:09 $
*
*/
/* Appropriated for Reactos Crtdll by Ariadne */

View file

@ -14,4 +14,4 @@
#define _SH_DENYRD SH_DENYRD
#define _SH_DENYNO SH_DENYNO
#endif
#endif

View file

@ -19,8 +19,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision: 1.2 $
* $Author: ariadne $
* $Date: 1999/03/07 13:35:10 $
* $Author: rex $
* $Date: 1999/03/19 05:55:09 $
*
*/
/* added some extra signal constants */

View file

@ -26,9 +26,9 @@
* DISCLAMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision: 1.1 $
* $Author: ariadne $
* $Date: 1999/02/21 13:29:56 $
* $Revision: 1.2 $
* $Author: rex $
* $Date: 1999/03/19 05:55:09 $
*
*/
/* Appropriated for Reactos Crtdll by Ariadne */

View file

@ -28,9 +28,9 @@
* DISCLAMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision: 1.3 $
* $Author: ariadne $
* $Date: 1999/02/21 20:59:55 $
* $Revision: 1.2 $
* $Author: rex $
* $Date: 1999/03/19 05:55:09 $
*
*/

View file

@ -0,0 +1,157 @@
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_stdio_h_
#define __dj_include_stdio_h_
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
#include <sys/djtypes.h>
#define _IOFBF 00001
#define _IONBF 00002
#define _IOLBF 00004
#define BUFSIZ 16384
#define EOF (-1)
#define FILENAME_MAX 260
#define FOPEN_MAX 20
#define L_tmpnam 260
#ifndef NULL
#define NULL 0
#endif
#define TMP_MAX 999999
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#define _IOREAD 000010
#define _IOWRT 000020
#define _IOMYBUF 000040
#define _IOEOF 000100
#define _IOERR 000200
#define _IOSTRG 000400
#define _IORW 001000
#define _IOAPPEND 002000
#define _IORMONCL 004000 /* remove on close, for temp files */
/* if _flag & _IORMONCL, ._name_to_remove needs freeing */
#define _IOUNGETC 010000 /* there is an ungetc'ed character in the buffer */
#include <internal/types.h>
__DJ_va_list
#undef __DJ_va_list
#define __DJ_va_list
#ifndef _FILE_DEFINED
typedef struct {
char *_ptr;
int _cnt;
char *_base;
int _flag;
int _file;
int _ungotchar;
int _bufsiz;
char *_name_to_remove;
} FILE;
#define _FILE_DEFINED
#endif
typedef unsigned long fpos_t;
extern FILE _iob[];
#define stdin (&_iob[0])
#define stdout (&_iob[1])
#define stderr (&_iob[2])
#define stdaux (&_iob[3])
#define stdprn (&_iob[4])
void clearerr(FILE *_stream);
int fclose(FILE *_stream);
int feof(FILE *_stream);
int ferror(FILE *_stream);
int fflush(FILE *_stream);
int fgetc(FILE *_stream);
int fgetpos(FILE *_stream, fpos_t *_pos);
char * fgets(char *_s, int _n, FILE *_stream);
FILE * fopen(const char *_filename, const char *_mode);
int fprintf(FILE *_stream, const char *_format, ...);
int fputc(int _c, FILE *_stream);
int fputs(const char *_s, FILE *_stream);
size_t fread(void *_ptr, size_t _size, size_t _nelem, FILE *_stream);
FILE * freopen(const char *_filename, const char *_mode, FILE *_stream);
int fscanf(FILE *_stream, const char *_format, ...);
int fseek(FILE *_stream, long _offset, int _mode);
int fsetpos(FILE *_stream, const fpos_t *_pos);
long ftell(FILE *_stream);
size_t fwrite(const void *_ptr, size_t _size, size_t _nelem, FILE *_stream);
int getc(FILE *_stream);
int getchar(void);
char * gets(char *_s);
void perror(const char *_s);
int printf(const char *_format, ...);
int putc(int _c, FILE *_stream);
int putchar(int _c);
int puts(const char *_s);
int remove(const char *_filename);
int rename(const char *_old, const char *_new);
void rewind(FILE *_stream);
int scanf(const char *_format, ...);
void setbuf(FILE *_stream, char *_buf);
int setvbuf(FILE *_stream, char *_buf, int _mode, size_t _size);
int sprintf(char *_s, const char *_format, ...);
int sscanf(const char *_s, const char *_format, ...);
FILE * tmpfile(void);
char * tmpnam(char *_s);
char * _tmpnam(char *_s);
int ungetc(int _c, FILE *_stream);
int vfprintf(FILE *_stream, const char *_format, va_list _ap);
int vprintf(const char *_format, va_list _ap);
int vsprintf(char *_s, const char *_format, va_list _ap);
#ifndef __STRICT_ANSI__
#define L_ctermid
#define L_cusrid
/* #define STREAM_MAX 20 - DOS can change this */
int fileno(FILE *_stream);
int _fileno(FILE *_stream);
FILE * fdopen(int _fildes, const char *_type);
int pclose(FILE *_pf);
FILE * popen(const char *_command, const char *_mode);
#ifndef _POSIX_SOURCE
void _djstat_describe_lossage(FILE *_to_where);
int _doprnt(const char *_fmt, va_list _args, FILE *_f);
int _doscan(FILE *_f, const char *_fmt, void **_argp);
int _doscan_low(FILE *, int (*)(FILE *_get), int (*_unget)(int, FILE *), const char *_fmt, void **_argp);
int fpurge(FILE *_f);
int getw(FILE *_f);
int mkstemp(char *_template);
char * mktemp(char *_template);
int putw(int _v, FILE *_f);
void setbuffer(FILE *_f, void *_buf, int _size);
void setlinebuf(FILE *_f);
char * tempnam(const char *_dir, const char *_prefix);
int _rename(const char *_old, const char *_new); /* Simple (no directory) */
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
#ifdef __cplusplus
}
#endif
#endif /* !__dj_include_stdio_h_ */

View file

@ -18,9 +18,9 @@
* DISCLAMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision: 1.3 $
* $Author: ariadne $
* $Date: 1999/02/25 22:51:47 $
* $Revision: 1.2 $
* $Author: rex $
* $Date: 1999/03/19 05:55:09 $
*
*/
/* Appropriated for Reactos Crtdll by Ariadne */

View file

@ -0,0 +1,128 @@
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_stat_h_
#define __dj_include_sys_stat_h_
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
#ifndef __STRICT_ANSI__
#define S_ISBLK(m) (((m) & 0xf000) == 0x1000)
#define S_ISCHR(m) (((m) & 0xf000) == 0x2000)
#define S_ISDIR(m) (((m) & 0xf000) == 0x3000)
#define S_ISFIFO(m) (((m) & 0xf000) == 0x4000)
#define S_ISREG(m) (((m) & 0xf000) == 0x0000)
#define S_ISUID 0x80000000
#define S_ISGID 0x40000000
#define S_IRUSR 00400
#define S_IRGRP 00040
#define S_IROTH 00004
#define S_IWUSR 00200
#define S_IWGRP 00020
#define S_IWOTH 00002
#define S_IXUSR 00100
#define S_IXGRP 00010
#define S_IXOTH 00001
#define S_IRWXU 00700
#define S_IRWXG 00070
#define S_IRWXO 00007
#include <sys/types.h>
#include <internal/types.h>
//#include <sys/djtypes.h>
__DJ_time_t
#undef __DJ_time_t
#define __DJ_time_t
struct stat {
time_t st_atime;
time_t st_ctime;
dev_t st_dev;
gid_t st_gid;
ino_t st_ino;
mode_t st_mode;
time_t st_mtime;
nlink_t st_nlink;
off_t st_size;
off_t st_blksize;
uid_t st_uid;
dev_t st_rdev; /* unused */
};
int chmod(const char *_path, mode_t _mode);
int fstat(int _fildes, struct stat *_buf);
//int mkdir(const char *_path, mode_t _mode);
int mkfifo(const char *_path, mode_t _mode);
int stat(const char *_path, struct stat *_buf);
mode_t umask(mode_t _cmask);
#ifndef _POSIX_SOURCE
/* POSIX.1 doesn't mention these at all */
#define S_IFMT 0xf000
#define S_IFREG 0x0000
#define S_IFBLK 0x1000
#define S_IFCHR 0x2000
#define S_IFDIR 0x3000
#define S_IFIFO 0x4000
#define S_IFFIFO S_IFIFO
#define S_IFLABEL 0x5000
#define S_ISLABEL(m) (((m) & 0xf000) == 0x5000)
void _fixpath(const char *, char *);
unsigned short _get_magic(const char *, int);
int _is_executable(const char *, int, const char *);
int mknod(const char *_path, mode_t _mode, dev_t _dev);
char * _truename(const char *, char *);
/* Bit-mapped variable _djstat_flags describes what expensive
f?stat() features our application needs. If you don't need a
feature, set its bit in the variable. By default, all the
bits are cleared (i.e., you get the most expensive code). */
#define _STAT_INODE 1 /* should we bother getting inode numbers? */
#define _STAT_EXEC_EXT 2 /* get execute bits from file extension? */
#define _STAT_EXEC_MAGIC 4 /* get execute bits from magic signature? */
#define _STAT_DIRSIZE 8 /* compute directory size? */
#define _STAT_ROOT_TIME 0x10 /* try to get root dir time stamp? */
#define _STAT_WRITEBIT 0x20 /* fstat() needs write bit? */
extern unsigned short _djstat_flags;
/* Bit-mapped variable _djstat_fail_bits describes which individual
undocumented features f?stat() failed to use. To get a human-
readable description of the bits, call _djstat_describe_lossage(). */
#define _STFAIL_SDA 1 /* Get SDA call failed */
#define _STFAIL_OSVER 2 /* Unsupported DOS version */
#define _STFAIL_BADSDA 4 /* Bad pointer to SDA */
#define _STFAIL_TRUENAME 8 /* _truename() failed */
#define _STFAIL_HASH 0x10 /* inode defaults to hashing */
#define _STFAIL_LABEL 0x20 /* Root dir, but no volume label */
#define _STFAIL_DCOUNT 0x40 /* dirent_count ridiculously large */
#define _STFAIL_WRITEBIT 0x80 /* fstat() failed to get write access bit */
#define _STFAIL_DEVNO 0x100 /* fstat() failed to get device number */
#define _STFAIL_BADSFT 0x200 /* SFT entry found, but can't be trusted */
#define _STFAIL_SFTIDX 0x400 /* bad SFT index in JFT */
#define _STFAIL_SFTNF 0x800 /* file entry not found in SFT array */
extern unsigned short _djstat_fail_bits;
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
#ifdef __cplusplus
}
#endif
#endif /* !__dj_include_sys_stat_h_ */

View file

@ -0,0 +1,67 @@
/* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#ifndef __dj_include_sys_types_h_
#define __dj_include_sys_types_h_
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
#ifndef __STRICT_ANSI__
#include <sys/djtypes.h>
typedef int dev_t;
typedef int ino_t;
typedef int mode_t;
typedef int nlink_t;
__DJ_gid_t
#undef __DJ_gid_t
#define __DJ_gid_t
__DJ_off_t
#undef __DJ_off_t
#define __DJ_off_t
__DJ_pid_t
#undef __DJ_pid_t
#define __DJ_pid_t
//__DJ_size_t
#undef __DJ_size_t
#define __DJ_size_t
__DJ_ssize_t
#undef __DJ_ssize_t
#define __DJ_ssize_t
__DJ_uid_t
#undef __DJ_uid_t
#define __DJ_uid_t
#ifndef _POSIX_SOURCE
/* Allow including program to override. */
#ifndef FD_SETSIZE
#define FD_SETSIZE 256
#endif
typedef struct fd_set {
unsigned char fd_bits [((FD_SETSIZE) + 7) / 8];
} fd_set;
#define FD_SET(n, p) ((p)->fd_bits[(n) / 8] |= (1 << ((n) & 7)))
#define FD_CLR(n, p) ((p)->fd_bits[(n) / 8] &= ~(1 << ((n) & 7)))
#define FD_ISSET(n, p) ((p)->fd_bits[(n) / 8] & (1 << ((n) & 7)))
#define FD_ZERO(p) memset ((void *)(p), 0, sizeof (*(p)))
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
#ifndef __dj_ENFORCE_FUNCTION_CALLS
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
#ifdef __cplusplus
}
#endif
#endif /* !__dj_include_sys_types_h_ */

View file

@ -19,8 +19,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision: 1.2 $
* $Author: ariadne $
* $Date: 1999/02/21 13:29:57 $
* $Author: rex $
* $Date: 1999/03/19 05:55:10 $
*
*/
/* Appropriated for Reactos Crtdll by Ariadne */

View file

@ -1,4 +1,5 @@
extern POBJECT_TYPE ExEventType;
typedef ULONG INTERLOCKED_RESULT;
typedef ULONG WORK_QUEUE_TYPE;

View file

@ -242,12 +242,6 @@ enum
#define FILE_EXISTS 0x0004
#define FILE_DOES_NOT_EXIST 0x0005
/*
* ByteOffset parameter : special values
*/
#define FILE_WRITE_TO_END_OF_FILE 0xffffffff
#define FILE_USE_FILE_POINTER_POSITION 0xfffffffe
/*
* file creation flags

View file

@ -152,10 +152,6 @@ typedef struct _IO_STACK_LOCATION
HANDLE DeleteHandle;
} u;
} SetFile;
/*
* This is a guess
*/
struct
{
ULONG Length;
@ -175,14 +171,7 @@ typedef struct _IO_STACK_LOCATION
typedef struct _IO_STATUS_BLOCK
{
/*
* Is the completion status
*/
NTSTATUS Status;
/*
* Is a request dependant value
*/
ULONG Information;
} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;

View file

@ -147,13 +147,7 @@ typedef struct
} KSEMAPHORE, *PKSEMAPHORE;
typedef struct _KEVENT
/*
* PURPOSE: Describes an event
*/
{
/*
* PURPOSE: So we can use the general wait routine
*/
DISPATCHER_HEADER Header;
} KEVENT, *PKEVENT;
@ -222,7 +216,7 @@ typedef struct _WAIT_CONTEXT_BLOCK
struct _KINTERRUPT;
typedef BOOLEAN (*PKSERVICE_ROUTINE)(struct _KINTERRUPT* Interrupt,
PVOID ServiceContext);
PVOID ServiceContext);
typedef struct _KINTERRUPT
{

View file

@ -38,9 +38,9 @@ extern "C"
#include <ddk/pstypes.h>
#include <ddk/zwtypes.h>
#include <ddk/ioctrl.h>
#include <ddk/rtl.h>
#include <internal/hal/ddk.h>
#include <ddk/zw.h>
#include <ddk/cmfuncs.h>
#include <ddk/exfuncs.h>

View file

@ -280,33 +280,21 @@ typedef struct {
// Heap creation routine
HANDLE
STDCALL
RtlCreateHeap(
ULONG Flags,
PVOID BaseAddress,
ULONG SizeToReserve,
ULONG SizeToCommit,
PVOID Unknown,
PRTL_HEAP_DEFINITION Definition
);
HANDLE STDCALL RtlCreateHeap(ULONG Flags,
PVOID BaseAddress,
ULONG SizeToReserve,
ULONG SizeToCommit,
PVOID Unknown,
PRTL_HEAP_DEFINITION Definition);
PVOID
STDCALL
RtlAllocateHeap(
HANDLE Heap,
ULONG Flags,
ULONG Size
);
PVOID STDCALL RtlAllocateHeap(HANDLE Heap,
ULONG Flags,
ULONG Size);
BOOLEAN
STDCALL
RtlFreeHeap(
HANDLE Heap,
ULONG Flags,
PVOID Address
);
BOOLEAN STDCALL RtlFreeHeap(HANDLE Heap,
ULONG Flags,
PVOID Address);
NTSTATUS RtlUnicodeStringToAnsiString(IN OUT PANSI_STRING DestinationString,
IN PUNICODE_STRING SourceString,

View file

@ -108,7 +108,7 @@ enum
STATUS_ALREADY_DISCONNECTED,
STATUS_LONGJUMP,
STATUS_UNSUCCESSFUL=0xC0000001,
STATUS_UNSUCCESSFUL=0xC0000001,
STATUS_NOT_IMPLEMENTED,
STATUS_INVALID_INFO_CLASS,
STATUS_INFO_LENGTH_MISMATCH,
@ -123,6 +123,8 @@ enum
STATUS_INVALID_PARAMETER,
STATUS_NO_SUCH_DEVICE,
STATUS_NO_SUCH_FILE,
// c0000010
STATUS_INVALID_DEVICE_REQUEST,
STATUS_END_OF_FILE,
STATUS_WRONG_VOLUME,
@ -139,6 +141,8 @@ enum
STATUS_ILLEGAL_INSTRUCTION,
STATUS_INVALID_LOCK_SEQUENCE,
STATUS_INVALID_VIEW_SIZE,
// c0000020
STATUS_INVALID_FILE_FOR_SECTION,
STATUS_ALREADY_COMMITTED,
STATUS_ACCESS_DENIED,

View file

@ -15,15 +15,11 @@
#ifndef __DDK_ZW_H
#define __DDK_ZW_H
#include <windows.h>
//#ifndef WIN32_LEAN_AND_MEAN
#define PTOKEN_USER PVOID
#define PTOKEN_GROUPS PVOID
#define PTOKEN_OWNER PVOID
#define PTOKEN_PRIVILEGES PVOID
#define PTOKEN_PRIMARY_GROUP PVOID
#define PTOKEN_DEFAULT_DACL PVOID
#define PTOKEN_SOURCE PVOID
#define TOKEN_INFORMATION_CLASS CINT
#define LCID ULONG
#define SECURITY_INFORMATION ULONG
@ -325,16 +321,13 @@ NtAllocateVirtualMemory(
IN ULONG Protect
);
NTSTATUS
STDCALL
ZwAllocateVirtualMemory(
IN HANDLE ProcessHandle,
IN OUT PVOID *BaseAddress,
IN ULONG ZeroBits,
IN OUT PULONG RegionSize,
IN ULONG AllocationType,
IN ULONG Protect
);
NTSTATUS STDCALL ZwAllocateVirtualMemory(IN HANDLE ProcessHandle,
IN OUT PVOID *BaseAddress,
IN ULONG ZeroBits,
IN OUT PULONG RegionSize,
IN ULONG AllocationType,
IN ULONG Protect);
/*
* FUNCTION: Returns from a callback into user mode
* ARGUMENTS:
@ -1084,63 +1077,6 @@ ZwCreateTimer(
IN CINT TimerType
);
/*
* FUNCTION: Creates a token.
* ARGUMENTS:
* TokenHandle (OUT) = Caller supplied storage for the resulting handle
* DesiredAccess = Specifies the allowed or desired access to the process can
* be a combinate of STANDARD_RIGHTS_REQUIRED| ..
* ObjectAttribute = Initialized attributes for the object, contains the rootdirectory and the filename
* TokenType =
* AuthenticationId =
* ExpirationTime =
* TokenUser =
* TokenGroups =
* TokenPrivileges =
* TokenOwner =
* TokenPrimaryGroup =
* TokenDefaultDacl =
* TokenSource =
* REMARKS:
* This function does not map to a win32 function
* RETURNS: Status
*/
NTSTATUS
STDCALL
NtCreateToken(
OUT PHANDLE TokenHandle,
IN ACCESS_MASK DesiredAccess,
IN POBJECT_ATTRIBUTES ObjectAttributes,
IN TOKEN_TYPE TokenType,
IN PLUID AuthenticationId,
IN PLARGE_INTEGER ExpirationTime,
IN PTOKEN_USER TokenUser,
IN PTOKEN_GROUPS TokenGroups,
IN PTOKEN_PRIVILEGES TokenPrivileges,
IN PTOKEN_OWNER TokenOwner,
IN PTOKEN_PRIMARY_GROUP TokenPrimaryGroup,
IN PTOKEN_DEFAULT_DACL TokenDefaultDacl,
IN PTOKEN_SOURCE TokenSource
);
NTSTATUS
STDCALL
ZwCreateToken(
OUT PHANDLE TokenHandle,
IN ACCESS_MASK DesiredAccess,
IN POBJECT_ATTRIBUTES ObjectAttributes,
IN TOKEN_TYPE TokenType,
IN PLUID AuthenticationId,
IN PLARGE_INTEGER ExpirationTime,
IN PTOKEN_USER TokenUser,
IN PTOKEN_GROUPS TokenGroups,
IN PTOKEN_PRIVILEGES TokenPrivileges,
IN PTOKEN_OWNER TokenOwner,
IN PTOKEN_PRIMARY_GROUP TokenPrimaryGroup,
IN PTOKEN_DEFAULT_DACL TokenDefaultDacl,
IN PTOKEN_SOURCE TokenSource
);
/*
* FUNCTION: Returns the callers thread TEB.
@ -5137,6 +5073,7 @@ NTSTATUS STDCALL NtCompleteConnectPort(VOID);
NTSTATUS STDCALL NtConnectPort(VOID);
NTSTATUS STDCALL NtCreatePort(VOID);
NTSTATUS STDCALL NtCreateToken(VOID);
NTSTATUS STDCALL NtGetPlugPlayEvent(VOID);
NTSTATUS STDCALL NtImpersonateClientOfPort(VOID);

View file

@ -13,4 +13,4 @@ typedef struct
PVOID DevCapsRoutine;
PVOID HwSetVolume;
ULONG IoMethod;
}SOUND_DEVICE_INIT;
}SOUND_DEVICE_INIT;

View file

@ -1,63 +0,0 @@
/*
* direct.h
*
* Functions for manipulating paths and directories (included from dir.h)
* plus functions for setting the current drive.
*
* This file is part of the Mingw32 package.
*
* Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
*
* 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
* DISCLAMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision: 1.3 $
* $Author: ariadne $
* $Date: 1999/02/25 22:51:47 $
*
*/
#ifndef __STRICT_ANSI__
#ifndef _DIRECT_H_
#define _DIRECT_H_
#include <dir.h>
#ifdef __cplusplus
extern "C" {
#endif
struct _diskfree_t {
unsigned long total_clusters;
unsigned long avail_clusters;
unsigned long sectors_per_cluster;
unsigned long bytes_per_sector;
};
#define diskfree_t _diskfree_t
/*
* You really shouldn't be using these. Use the Win32 API functions instead.
* However, it does make it easier to port older code.
*/
int _chdrive (int nDrive);
char* _getdcwd (int nDrive, char* caBuffer, int nBufLen);
unsigned int _getdiskfree(unsigned int _drive, struct _diskfree_t *_diskspace);
#ifdef __cplusplus
}
#endif
#endif /* Not _DIRECT_H_ */
#endif /* Not __STRICT_ANSI__ */

View file

@ -1,68 +0,0 @@
/*
* dos.h
*
* Definitions for MS-DOS interface routines
*
* This header file is meant for use with CRTDLL.DLL as included with
* Windows 95(tm) and Windows NT(tm). In conjunction with other versions
* of the standard C library things may or may not work so well.
*
* Contributors:
* Created by J.J. van der Heijden <J.J.vanderHeijden@student.utwente.nl>
*
* 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
* DISCLAMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef __STRICT_ANSI__
#ifndef _DOS_H_
#define _DOS_H_
#define __need_wchar_t
#include <stddef.h>
/* For DOS file attributes */
#include <dir.h>
#ifdef __cplusplus
extern "C" {
#endif
extern char** __imp__pgmptr_dll;
#define _pgmptr (*__imp__pgmptr_dll)
/* Wide character equivalent */
extern wchar_t** __imp__wpgmptr_dll;
#define _wpgmptr (*__imp__wpgmptr_dll)
/* These are obsolete, but some may find them useful */
extern unsigned int* __imp__basemajor_dll;
extern unsigned int* __imp__baseminor_dll;
extern unsigned int* __imp__baseversion_dll;
extern unsigned int* __imp__osmajor_dll;
extern unsigned int* __imp__osminor_dll;
extern unsigned int* __imp__osversion_dll;
#define _basemajor (*__imp__basemajor_dll)
#define _baseminor (*__imp__baseminor_dll)
#define _baseversion (*__imp__baseversion_dll)
#define _osmajor (*__imp__osmajor_dll)
#define _osminor (*__imp__osminor_dll)
#define _osversion (*__imp__osversion_dll)
#ifdef __cplusplus
}
#endif
#endif /* _DOS_H_ */
#endif /* Not __STRICT_ANSI__ */

View file

@ -1,113 +0,0 @@
/*
* fcntl.h
*
* Access constants for _open. Note that the permissions constants are
* in sys/stat.h (ick).
*
* This code is part of the Mingw32 package.
*
* Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
*
* 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
* DISCLAMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision: 1.2 $
* $Author: ariadne $
* $Date: 1999/02/21 13:29:56 $
*
*/
/* Appropriated for Reactos Crtdll by Ariadne */
/* added _O_RANDOM_O_SEQUENTIAL _O_SHORT_LIVED*/
#ifndef _FCNTL_H_
#define _FCNTL_H_
/*
* It appears that fcntl.h should include io.h for compatibility...
*/
#include <io.h>
/*
* This variable determines the default file mode.
* TODO: Which flags work?
*/
#if __MSVCRT__
extern unsigned int* __imp__fmode;
#define _fmode (*__imp__fmode)
#else
/* CRTDLL */
extern unsigned int* __imp__fmode_dll;
#define _fmode (*__imp__fmode_dll)
#endif
/* Specifiy one of these flags to define the access mode. */
#define _O_RDONLY 0
#define _O_WRONLY 1
#define _O_RDWR 2
/* Mask for access mode bits in the _open flags. */
#define _O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
#define _O_APPEND 0x0008 /* Writes will add to the end of the file. */
#define _O_CREAT 0x0100 /* Create the file if it does not exist. */
#define _O_TRUNC 0x0200 /* Truncate the file if it does exist. */
#define _O_EXCL 0x0400 /* Open only if the file does not exist. */
/* NOTE: Text is the default even if the given _O_TEXT bit is not on. */
#define _O_TEXT 0x4000 /* CR-LF in file becomes LF in memory. */
#define _O_BINARY 0x8000 /* Input and output is not translated. */
#define _O_RAW _O_BINARY
#define _O_TEMPORARY 0x0040 /* Make the file dissappear after closing.
* WARNING: Even if not created by _open! */
#define _O_RANDOM 0x0010
#define _O_SEQUENTIAL _O_RANDOM
#define _O_SHORT_LIVED 0x1000
#ifndef __STRICT_ANSI__
#ifndef _NO_OLDNAMES
/* POSIX/Non-ANSI names for increased portability */
#define O_RDONLY _O_RDONLY
#define O_WRONLY _O_WRONLY
#define O_RDWR _O_RDWR
#define O_ACCMODE _O_ACCMODE
#define O_APPEND _O_APPEND
#define O_CREAT _O_CREAT
#define O_TRUNC _O_TRUNC
#define O_EXCL _O_EXCL
#define O_TEXT _O_TEXT
#define O_BINARY _O_BINARY
#define O_TEMPORARY _O_TEMPORARY
#define O_RANDOM _O_RANDOM
#define O_SEQUENTIAL _O_RANDOM
#define O_SHORT_LIVED _O_SHORT_LIVED
#endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus
extern "C" {
#endif
int _setmode (int nHandle, int nAccessMode);
#ifndef _NO_OLDNAMES
int setmode (int nHandle, int nAccessMode);
#endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus
}
#endif
#endif /* Not __STRICT_ANSI__ */
#endif /* Not _FCNTL_H_ */

View file

@ -7435,6 +7435,8 @@ DWORD STDCALL NetLocalGroupEnum (LPWSTR, DWORD, LPBYTE*, DWORD, LPDWORD,
VOID CopyMemory(PVOID Destination, CONST VOID* Source, DWORD Length);
DWORD STDCALL GetCurrentTime(VOID);
void WINAPI
SHAddToRecentDocs (UINT, LPCVOID);

View file

@ -488,4 +488,4 @@ unsigned char wave[]={
0x7d,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,
0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,
0x7f,0x7f,0x80,0x80,0x80,0x80,0x80,0x80,
};
};

View file

@ -115,4 +115,5 @@ BOOLEAN HalTranslateBusAddress(INTERFACE_TYPE InterfaceType,
PPHYSICAL_ADDRESS TranslatedAddress);
BOOLEAN HalMakeBeep(ULONG Frequency);
VOID HalQueryRealTimeClock(PTIME_FIELDS pTime);
#endif /* __INCLUDE_INTERNAL_HAL_DDK_H */

View file

@ -9,16 +9,7 @@
#define PAGESIZE (4096)
PULONG MmGetPageEntry(PEPROCESS Process, ULONG Address);
/*
* Sets a page entry
* vaddr: The virtual address to set the page entry for
* attributes: The access attributes to give the page
* physaddr: The physical address the page should map to
*/
void set_page(unsigned int vaddr, unsigned int attributes,
unsigned int physaddr);
PULONG MmGetPageEntry(PEPROCESS Process, PVOID Address);
/*
@ -75,10 +66,6 @@ extern inline unsigned int* get_page_directory(void)
#define VADDR_TO_PT_OFFSET(x) (((x/1024)%4096))
#define VADDR_TO_PD_OFFSET(x) ((x)/(4*1024*1024))
unsigned int* get_page_entry(unsigned int vaddr);
BOOL is_page_present(unsigned int vaddr);
VOID MmSetPage(PEPROCESS Process,
PVOID Address,
ULONG flProtect,

View file

@ -0,0 +1,487 @@
#ifndef _I386_STRING_H_
#define _I386_STRING_H_
/*
* On a 486 or Pentium, we are better off not using the
* byte string operations. But on a 386 or a PPro the
* byte string ops are faster than doing it by hand
* (MUCH faster on a Pentium).
*
* Also, the byte strings actually work correctly. Forget
* the i486 routines for now as they may be broken..
*/
#if FIXED_486_STRING && (CPU == 486 || CPU == 586)
#include <asm/string-486.h>
#else
/*
* This string-include defines all string functions as inline
* functions. Use gcc. It also assumes ds=es=data space, this should be
* normal. Most of the string-functions are rather heavily hand-optimized,
* see especially strtok,strstr,str[c]spn. They should work, but are not
* very easy to understand. Everything is done entirely within the register
* set, making the functions fast and clean. String instructions have been
* used through-out, making for "slightly" unclear code :-)
*
* NO Copyright (C) 1991, 1992 Linus Torvalds,
* consider these trivial functions to be PD.
*/
#define __HAVE_ARCH_STRCPY
extern inline char * strcpy(char * dest,const char *src)
{
int d0, d1, d2;
__asm__ __volatile__(
"cld\n"
"1:\tlodsb\n\t"
"stosb\n\t"
"testb %%al,%%al\n\t"
"jne 1b"
: "=&S" (d0), "=&D" (d1), "=&a" (d2)
:"0" (src),"1" (dest) : "memory");
return dest;
}
#define __HAVE_ARCH_STRNCPY
extern inline char * strncpy(char * dest,const char *src,size_t count)
{
int d0, d1, d2, d3;
__asm__ __volatile__(
"cld\n"
"1:\tdecl %2\n\t"
"js 2f\n\t"
"lodsb\n\t"
"stosb\n\t"
"testb %%al,%%al\n\t"
"jne 1b\n\t"
"rep\n\t"
"stosb\n"
"2:"
: "=&S" (d0), "=&D" (d1), "=&c" (d2), "=&a" (d3)
:"0" (src),"1" (dest),"2" (count) : "memory");
return dest;
}
#define __HAVE_ARCH_STRCAT
extern inline char * strcat(char * dest,const char * src)
{
int d0, d1, d2, d3;
__asm__ __volatile__(
"cld\n\t"
"repne\n\t"
"scasb\n\t"
"decl %1\n"
"1:\tlodsb\n\t"
"stosb\n\t"
"testb %%al,%%al\n\t"
"jne 1b"
: "=&S" (d0), "=&D" (d1), "=&a" (d2), "=&c" (d3)
: "0" (src), "1" (dest), "2" (0), "3" (0xffffffff):"memory");
return dest;
}
#define __HAVE_ARCH_STRNCAT
extern inline char * strncat(char * dest,const char * src,size_t count)
{
int d0, d1, d2, d3;
__asm__ __volatile__(
"cld\n\t"
"repne\n\t"
"scasb\n\t"
"decl %1\n\t"
"movl %8,%3\n"
"1:\tdecl %3\n\t"
"js 2f\n\t"
"lodsb\n\t"
"stosb\n\t"
"testb %%al,%%al\n\t"
"jne 1b\n"
"2:\txorl %2,%2\n\t"
"stosb"
: "=&S" (d0), "=&D" (d1), "=&a" (d2), "=&c" (d3)
: "0" (src),"1" (dest),"2" (0),"3" (0xffffffff), "g" (count)
: "memory");
return dest;
}
#define __HAVE_ARCH_STRCMP
extern inline int strcmp(const char * cs,const char * ct)
{
int d0, d1;
register int __res;
__asm__ __volatile__(
"cld\n"
"1:\tlodsb\n\t"
"scasb\n\t"
"jne 2f\n\t"
"testb %%al,%%al\n\t"
"jne 1b\n\t"
"xorl %%eax,%%eax\n\t"
"jmp 3f\n"
"2:\tsbbl %%eax,%%eax\n\t"
"orb $1,%%al\n"
"3:"
:"=a" (__res), "=&S" (d0), "=&D" (d1)
:"1" (cs),"2" (ct));
return __res;
}
#define __HAVE_ARCH_STRNCMP
extern inline int strncmp(const char * cs,const char * ct,size_t count)
{
register int __res;
int d0, d1, d2;
__asm__ __volatile__(
"cld\n"
"1:\tdecl %3\n\t"
"js 2f\n\t"
"lodsb\n\t"
"scasb\n\t"
"jne 3f\n\t"
"testb %%al,%%al\n\t"
"jne 1b\n"
"2:\txorl %%eax,%%eax\n\t"
"jmp 4f\n"
"3:\tsbbl %%eax,%%eax\n\t"
"orb $1,%%al\n"
"4:"
:"=a" (__res), "=&S" (d0), "=&D" (d1), "=&c" (d2)
:"1" (cs),"2" (ct),"3" (count));
return __res;
}
#define __HAVE_ARCH_STRCHR
extern inline char * strchr(const char * s, int c)
{
int d0;
register char * __res;
__asm__ __volatile__(
"cld\n\t"
"movb %%al,%%ah\n"
"1:\tlodsb\n\t"
"cmpb %%ah,%%al\n\t"
"je 2f\n\t"
"testb %%al,%%al\n\t"
"jne 1b\n\t"
"movl $1,%1\n"
"2:\tmovl %1,%0\n\t"
"decl %0"
:"=a" (__res), "=&S" (d0) : "1" (s),"0" (c));
return __res;
}
#define __HAVE_ARCH_STRRCHR
extern inline char * strrchr(const char * s, int c)
{
int d0, d1;
register char * __res;
__asm__ __volatile__(
"cld\n\t"
"movb %%al,%%ah\n"
"1:\tlodsb\n\t"
"cmpb %%ah,%%al\n\t"
"jne 2f\n\t"
"leal -1(%%esi),%0\n"
"2:\ttestb %%al,%%al\n\t"
"jne 1b"
:"=g" (__res), "=&S" (d0), "=&a" (d1) :"0" (0),"1" (s),"2" (c));
return __res;
}
#define __HAVE_ARCH_STRLEN
extern inline size_t strlen(const char * s)
{
int d0;
register int __res;
__asm__ __volatile__(
"cld\n\t"
"repne\n\t"
"scasb\n\t"
"notl %0\n\t"
"decl %0"
:"=c" (__res), "=&D" (d0) :"1" (s),"a" (0), "0" (0xffffffff));
return __res;
}
extern inline void * __memcpy(void * to, const void * from, size_t n)
{
int d0, d1, d2;
__asm__ __volatile__(
"cld\n\t"
"rep ; movsl\n\t"
"testb $2,%b4\n\t"
"je 1f\n\t"
"movsw\n"
"1:\ttestb $1,%b4\n\t"
"je 2f\n\t"
"movsb\n"
"2:"
: "=&c" (d0), "=&D" (d1), "=&S" (d2)
:"0" (n/4), "q" (n),"1" ((long) to),"2" ((long) from)
: "memory");
return (to);
}
/*
* This looks horribly ugly, but the compiler can optimize it totally,
* as the count is constant.
*/
extern inline void * __constant_memcpy(void * to, const void * from, size_t n)
{
switch (n) {
case 0:
return to;
case 1:
*(unsigned char *)to = *(const unsigned char *)from;
return to;
case 2:
*(unsigned short *)to = *(const unsigned short *)from;
return to;
case 3:
*(unsigned short *)to = *(const unsigned short *)from;
*(2+(unsigned char *)to) = *(2+(const unsigned char *)from);
return to;
case 4:
*(unsigned long *)to = *(const unsigned long *)from;
return to;
case 6: /* for Ethernet addresses */
*(unsigned long *)to = *(const unsigned long *)from;
*(2+(unsigned short *)to) = *(2+(const unsigned short *)from);
return to;
case 8:
*(unsigned long *)to = *(const unsigned long *)from;
*(1+(unsigned long *)to) = *(1+(const unsigned long *)from);
return to;
case 12:
*(unsigned long *)to = *(const unsigned long *)from;
*(1+(unsigned long *)to) = *(1+(const unsigned long *)from);
*(2+(unsigned long *)to) = *(2+(const unsigned long *)from);
return to;
case 16:
*(unsigned long *)to = *(const unsigned long *)from;
*(1+(unsigned long *)to) = *(1+(const unsigned long *)from);
*(2+(unsigned long *)to) = *(2+(const unsigned long *)from);
*(3+(unsigned long *)to) = *(3+(const unsigned long *)from);
return to;
case 20:
*(unsigned long *)to = *(const unsigned long *)from;
*(1+(unsigned long *)to) = *(1+(const unsigned long *)from);
*(2+(unsigned long *)to) = *(2+(const unsigned long *)from);
*(3+(unsigned long *)to) = *(3+(const unsigned long *)from);
*(4+(unsigned long *)to) = *(4+(const unsigned long *)from);
return to;
}
#define COMMON(x) \
__asm__ __volatile__( \
"cld\n\t" \
"rep ; movsl" \
x \
: "=&c" (d0), "=&D" (d1), "=&S" (d2) \
: "0" (n/4),"1" ((long) to),"2" ((long) from) \
: "memory");
{
int d0, d1, d2;
switch (n % 4) {
case 0: COMMON(""); return to;
case 1: COMMON("\n\tmovsb"); return to;
case 2: COMMON("\n\tmovsw"); return to;
default: COMMON("\n\tmovsw\n\tmovsb"); return to;
}
}
#undef COMMON
}
#define __HAVE_ARCH_MEMCPY
#define memcpy(t, f, n) \
(__builtin_constant_p(n) ? \
__constant_memcpy((t),(f),(n)) : \
__memcpy((t),(f),(n)))
#define __HAVE_ARCH_MEMMOVE
extern inline void * memmove(void * dest,const void * src, size_t n)
{
int d0, d1, d2;
if (dest<src)
__asm__ __volatile__(
"cld\n\t"
"rep\n\t"
"movsb"
: "=&c" (d0), "=&S" (d1), "=&D" (d2)
:"0" (n),"1" (src),"2" (dest)
: "memory");
else
__asm__ __volatile__(
"std\n\t"
"rep\n\t"
"movsb\n\t"
"cld"
: "=&c" (d0), "=&S" (d1), "=&D" (d2)
:"0" (n),
"1" (n-1+(const char *)src),
"2" (n-1+(char *)dest)
:"memory");
return dest;
}
#define memcmp __builtin_memcmp
#define __HAVE_ARCH_MEMCHR
extern inline void * memchr(const void * cs,int c,size_t count)
{
int d0;
register void * __res;
if (!count)
return NULL;
__asm__ __volatile__(
"cld\n\t"
"repne\n\t"
"scasb\n\t"
"je 1f\n\t"
"movl $1,%0\n"
"1:\tdecl %0"
:"=D" (__res), "=&c" (d0) : "a" (c),"0" (cs),"1" (count));
return __res;
}
extern inline void * __memset_generic(void * s, char c,size_t count)
{
int d0, d1;
__asm__ __volatile__(
"cld\n\t"
"rep\n\t"
"stosb"
: "=&c" (d0), "=&D" (d1)
:"a" (c),"1" (s),"0" (count)
:"memory");
return s;
}
/* we might want to write optimized versions of these later */
#define __constant_count_memset(s,c,count) __memset_generic((s),(c),(count))
/*
* memset(x,0,y) is a reasonably common thing to do, so we want to fill
* things 32 bits at a time even when we don't know the size of the
* area at compile-time..
*/
extern inline void * __constant_c_memset(void * s, unsigned long c, size_t count)
{
int d0, d1;
__asm__ __volatile__(
"cld\n\t"
"rep ; stosl\n\t"
"testb $2,%b3\n\t"
"je 1f\n\t"
"stosw\n"
"1:\ttestb $1,%b3\n\t"
"je 2f\n\t"
"stosb\n"
"2:"
: "=&c" (d0), "=&D" (d1)
:"a" (c), "q" (count), "0" (count/4), "1" ((long) s)
:"memory");
return (s);
}
/* Added by Gertjan van Wingerde to make minix and sysv module work */
#define __HAVE_ARCH_STRNLEN
extern inline size_t strnlen(const char * s, size_t count)
{
int d0;
register int __res;
__asm__ __volatile__(
"movl %2,%0\n\t"
"jmp 2f\n"
"1:\tcmpb $0,(%0)\n\t"
"je 3f\n\t"
"incl %0\n"
"2:\tdecl %1\n\t"
"cmpl $-1,%1\n\t"
"jne 1b\n"
"3:\tsubl %2,%0"
:"=a" (__res), "=&d" (d0)
:"c" (s),"1" (count));
return __res;
}
/* end of additional stuff */
/*
* This looks horribly ugly, but the compiler can optimize it totally,
* as we by now know that both pattern and count is constant..
*/
extern inline void * __constant_c_and_count_memset(void * s, unsigned long pattern, size_t count)
{
switch (count) {
case 0:
return s;
case 1:
*(unsigned char *)s = pattern;
return s;
case 2:
*(unsigned short *)s = pattern;
return s;
case 3:
*(unsigned short *)s = pattern;
*(2+(unsigned char *)s) = pattern;
return s;
case 4:
*(unsigned long *)s = pattern;
return s;
}
#define COMMON(x) \
__asm__ __volatile__("cld\n\t" \
"rep ; stosl" \
x \
: "=&c" (d0), "=&D" (d1) \
: "a" (pattern),"0" (count/4),"1" ((long) s) \
: "memory")
{
int d0, d1;
switch (count % 4) {
case 0: COMMON(""); return s;
case 1: COMMON("\n\tstosb"); return s;
case 2: COMMON("\n\tstosw"); return s;
default: COMMON("\n\tstosw\n\tstosb"); return s;
}
}
#undef COMMON
}
#define __constant_c_x_memset(s, c, count) \
(__builtin_constant_p(count) ? \
__constant_c_and_count_memset((s),(c),(count)) : \
__constant_c_memset((s),(c),(count)))
#define __memset(s, c, count) \
(__builtin_constant_p(count) ? \
__constant_count_memset((s),(c),(count)) : \
__memset_generic((s),(c),(count)))
#define __HAVE_ARCH_MEMSET
#define memset(s, c, count) \
(__builtin_constant_p(c) ? \
__constant_c_x_memset((s),(0x01010101UL*(unsigned char)c),(count)) : \
__memset((s),(c),(count)))
/*
* find the first occurrence of byte 'c', or 1 past the area if none
*/
#define __HAVE_ARCH_MEMSCAN
extern inline void * memscan(void * addr, int c, size_t size)
{
if (!size)
return addr;
__asm__("cld
repnz; scasb
jnz 1f
dec %%edi
1: "
: "=D" (addr), "=c" (size)
: "0" (addr), "1" (size), "a" (c));
return addr;
}
#endif
#endif

View file

@ -3,9 +3,10 @@
*/
#define BASE_OBJECT_ID (0x12345678)
#define FILE_OBJECT_ID (BASE_OBJECT_ID + 1)
#define DEVICE_OBJECT_ID (BASE_OBJECT_ID + 2)
#define DRIVER_OBJECT_ID (BASE_OBJECT_ID + 3)
#define DIRECTORY_OBJECT_ID (BASE_OBJECT_ID + 4)
#define CC1_CCB_ID (BASE_OBJECT_ID + 5)
#define ID_BASE_OBJECT (0x1234)
#define ID_FILE_OBJECT (ID_BASE_OBJECT + 1)
#define ID_DEVICE_OBJECT (ID_BASE_OBJECT + 2)
#define ID_DRIVER_OBJECT (ID_BASE_OBJECT + 3)
#define ID_DIRECTORY_OBJECT (ID_BASE_OBJECT + 4)
#define ID_EVENT_OBJECT (ID_BASE_OBJECT + 5)
#define ID_TIMER_OBJECT (ID_BASE_OBJECT + 6)

View file

@ -24,7 +24,7 @@ extern POBJECT_TYPE IoSymbolicLinkType;
* entry = pointer to the driver initialization routine
* RETURNS: Success or failure
*/
NTSTATUS InitializeLoadedDriver(PDRIVER_INITIALIZE entry);
NTSTATUS IoInitializeDriver(PDRIVER_INITIALIZE DriverEntry);
@ -42,8 +42,8 @@ PIRP IoBuildFilesystemControlRequest(ULONG MinorFunction,
PDEVICE_OBJECT DeviceToMount);
NTSTATUS IoPageRead(PFILE_OBJECT FileObject,
PVOID Address,
PLARGE_INTEGER Offset,
PIO_STATUS_BLOCK StatusBlock);
PLARGE_INTEGER Offset,
PIO_STATUS_BLOCK StatusBlock);
VOID IoSecondStageCompletion(PIRP Irp, CCHAR PriorityBoost);
NTSTATUS IopCreateFile(PVOID ObjectBody,

View file

@ -39,11 +39,7 @@ VOID KeInitDpc(VOID);
VOID KeInitBugCheck(VOID);
VOID KeInitDispatcher(VOID);
VOID KeCalibrateTimerLoop(VOID);
VOID KeInitializeDispatcher(VOID);
VOID KeInitializeTimerImpl(VOID);
#endif

View file

@ -0,0 +1,6 @@
NTSTATUS LdrLoadDriver(PUNICODE_STRING Filename);
NTSTATUS LdrLoadInitialProcess(VOID);
VOID LdrLoadAutoConfigDrivers(VOID);

View file

@ -93,10 +93,6 @@ VOID TstBegin(VOID);
VOID KeInit(VOID);
VOID HalInitConsole(boot_param* bp);
/*
* Loader functions (called in main())
*/
VOID LdrInitModuleManagement(VOID);
VOID LdrLoadAutoConfigDrivers(VOID);
extern WCHAR wtolower(WCHAR ch);
#endif

Some files were not shown because too many files have changed in this diff Show more