diff --git a/reactos/include/ddk/exfuncs.h b/reactos/include/ddk/exfuncs.h index 1dc8b5f43a4..552d550c6ac 100644 --- a/reactos/include/ddk/exfuncs.h +++ b/reactos/include/ddk/exfuncs.h @@ -478,7 +478,7 @@ ExPostSystemEvent ( * ); */ #define ExQueryDepthSList(ListHead) \ - (USHORT)(ListHead)->s.Depth + (USHORT)(ListHead)->Depth VOID STDCALL diff --git a/reactos/include/ddk/extypes.h b/reactos/include/ddk/extypes.h index 02cdfd01860..3990e9cf170 100644 --- a/reactos/include/ddk/extypes.h +++ b/reactos/include/ddk/extypes.h @@ -1,4 +1,4 @@ -/* $Id: extypes.h,v 1.18 2003/07/17 16:57:38 silverblade Exp $ */ +/* $Id: extypes.h,v 1.19 2003/08/14 18:30:27 silverblade Exp $ */ #ifndef __INCLUDE_DDK_EXTYPES_H #define __INCLUDE_DDK_EXTYPES_H @@ -27,7 +27,7 @@ typedef struct _OWNER_ENTRY { LONG OwnerCount; ULONG TableSize; - } u; + }; // anon } OWNER_ENTRY, *POWNER_ENTRY; typedef struct _ERESOURCE @@ -46,7 +46,7 @@ typedef struct _ERESOURCE { PVOID Address; ULONG CreatorBackTraceIndex; - } u; + }; // anon KSPIN_LOCK SpinLock; } ERESOURCE, *PERESOURCE; @@ -105,7 +105,7 @@ typedef union _SLIST_HEADER SINGLE_LIST_ENTRY Next; USHORT Depth; USHORT Sequence; - } s; + }; // now anonymous } SLIST_HEADER, *PSLIST_HEADER; typedef struct _NPAGED_LOOKASIDE_LIST diff --git a/reactos/include/ddk/fsfuncs.h b/reactos/include/ddk/fsfuncs.h index e0b58ea45e6..b963ee3e0ea 100644 --- a/reactos/include/ddk/fsfuncs.h +++ b/reactos/include/ddk/fsfuncs.h @@ -1,8 +1,11 @@ #ifndef __INCLUDE_DDK_FSFUNCS_H #define __INCLUDE_DDK_FSFUNCS_H -/* $Id: fsfuncs.h,v 1.19 2003/04/26 23:13:26 hyperion Exp $ */ +/* $Id: fsfuncs.h,v 1.20 2003/08/14 18:30:27 silverblade Exp $ */ #define FlagOn(x,f) ((x) & (f)) +#include + + VOID STDCALL FsRtlFreeFileLock( @@ -217,7 +220,7 @@ FsRtlFastUnlockSingle ( IN PVOID Context OPTIONAL, IN BOOLEAN AlreadySynchronized ); -VOID +BOOLEAN STDCALL FsRtlFindInTunnelCache ( IN PTUNNEL Cache, @@ -453,7 +456,7 @@ FsRtlNotifyFullReportChange ( VOID STDCALL FsRtlNotifyUninitializeSync ( - IN OUT PNOTIFY_SYNC * NotifySync + IN OUT PNOTIFY_SYNC * NotifySync ); VOID STDCALL @@ -466,7 +469,7 @@ FsRtlNotifyReportChange ( ); VOID STDCALL -FsRtlNotifyInitializeSync(IN OUT PNOTIFY_SYNC *NotifySync); +FsRtlNotifyInitializeSync(IN OUT PNOTIFY_SYNC * NotifySync); NTSTATUS STDCALL FsRtlNotifyVolumeEvent(IN PFILE_OBJECT FileObject, diff --git a/reactos/include/ddk/fstypes.h b/reactos/include/ddk/fstypes.h index dd5f144e734..d04f7bc0101 100644 --- a/reactos/include/ddk/fstypes.h +++ b/reactos/include/ddk/fstypes.h @@ -1,15 +1,6 @@ #ifndef __INCLUDE_DDK_FSTYPES_H #define __INCLUDE_DDK_FSTYPES_H -/* $Id: fstypes.h,v 1.12 2003/08/07 11:47:32 silverblade Exp $ */ - -#define FSRTL_TAG TAG('F','S','r','t') - -typedef ULONG LBN; -typedef LBN *PLBN; - -typedef ULONG VBN; -typedef VBN *PVBN; - +/* $Id: fstypes.h,v 1.13 2003/08/14 18:30:27 silverblade Exp $ */ #ifndef __USE_W32API @@ -23,6 +14,7 @@ typedef struct _FILE_LOCK_INFO { LARGE_INTEGER EndingByte; } FILE_LOCK_INFO, *PFILE_LOCK_INFO; + typedef NTSTATUS (*PCOMPLETE_LOCK_IRP_ROUTINE) ( IN PVOID Context, IN PIRP Irp @@ -33,6 +25,7 @@ typedef VOID (*PUNLOCK_ROUTINE) ( IN PFILE_LOCK_INFO FileLockInfo ); + typedef struct _FILE_LOCK { PCOMPLETE_LOCK_IRP_ROUTINE CompleteLockIrpRoutine; PUNLOCK_ROUTINE UnlockRoutine; @@ -43,6 +36,7 @@ typedef struct _FILE_LOCK { PVOID LastReturnedLock; } FILE_LOCK, *PFILE_LOCK; + typedef struct _TUNNEL { FAST_MUTEX Mutex; PRTL_SPLAY_LINKS Cache; @@ -67,19 +61,6 @@ typedef struct _NOTIFY_SYNC } NOTIFY_SYNC, * PNOTIFY_SYNC; -typedef struct _LARGE_MCB -{ - PFAST_MUTEX FastMutex; - ULONG MaximumPairCount; - ULONG PairCount; - POOL_TYPE PoolType; - PVOID Mapping; -} LARGE_MCB, *PLARGE_MCB; - -typedef struct _MCB { - LARGE_MCB LargeMcb; -} MCB, *PMCB; - typedef VOID (*POPLOCK_WAIT_COMPLETE_ROUTINE)(PVOID Context, PIRP Irp); @@ -92,10 +73,4 @@ typedef PVOID OPLOCK, *POPLOCK; #endif /* __USE_W32API */ -typedef struct _FILE_LOCK_GRANTED { - LIST_ENTRY ListEntry; - FILE_LOCK_INFO Lock; -} FILE_LOCK_GRANTED, *PFILE_LOCK_GRANTED; - - #endif /* __INCLUDE_DDK_FSFUNCS_H */ diff --git a/reactos/include/ddk/ioctrl.h b/reactos/include/ddk/ioctrl.h index 867eb9a2647..ac0e36db0e0 100644 --- a/reactos/include/ddk/ioctrl.h +++ b/reactos/include/ddk/ioctrl.h @@ -5,8 +5,8 @@ #define CTL_CODE(Dev, Func, Meth, Acc) ( ((Dev)<<16) | ((Acc)<<14) | ((Func)<<2) | (Meth)) -#define DEVICE_TYPE_FROM_CTL_CODE(ctlCode) (((ULONG)(ctlCode&0xffff0000))>>16) -#define IO_METHOD_FROM_CTL_CODE(ctlCode) (ctlCode&0x00000003) +//#define DEVICE_TYPE_FROM_CTL_CODE(ctlCode) (((ULONG)(ctlCode&0xffff0000))>>16) +//#define IO_METHOD_FROM_CTL_CODE(ctlCode) (ctlCode&0x00000003) // IOCTL Parameter buffering methods diff --git a/reactos/include/ddk/iotypes.h b/reactos/include/ddk/iotypes.h index 5fe3f607cfb..420c02b979c 100644 --- a/reactos/include/ddk/iotypes.h +++ b/reactos/include/ddk/iotypes.h @@ -1,4 +1,4 @@ -/* $Id: iotypes.h,v 1.51 2003/08/07 11:47:32 silverblade Exp $ +/* $Id: iotypes.h,v 1.52 2003/08/14 18:30:27 silverblade Exp $ * */ @@ -742,32 +742,6 @@ typedef struct _IO_STATUS_BLOCK ULONG Information; } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK; -typedef struct _IO_COMPLETION_PACKET{ - ULONG Key; - ULONG Overlapped; - IO_STATUS_BLOCK IoStatus; - LIST_ENTRY ListEntry; -} IO_COMPLETION_PACKET, *PIO_COMPLETION_PACKET; - -typedef struct _IO_PIPE_CREATE_BUFFER -{ - BOOLEAN WriteModeMessage; - BOOLEAN ReadModeMessage; - BOOLEAN NonBlocking; - ULONG MaxInstances; - ULONG InBufferSize; - ULONG OutBufferSize; - LARGE_INTEGER TimeOut; -} IO_PIPE_CREATE_BUFFER, *PIO_PIPE_CREATE_BUFFER; - - -typedef struct _IO_MAILSLOT_CREATE_BUFFER -{ - ULONG Param; /* ?? */ - ULONG MaxMessageSize; - LARGE_INTEGER TimeOut; -} IO_MAILSLOT_CREATE_BUFFER, *PIO_MAILSLOT_CREATE_BUFFER; - /* * Driver entry point declaration @@ -1142,4 +1116,23 @@ typedef VOID STDCALL_FUNC IN BOOLEAN DriverActive); #endif // (_WIN32_WINNT >= 0x0400) + +typedef struct _IO_PIPE_CREATE_BUFFER +{ + BOOLEAN WriteModeMessage; + BOOLEAN ReadModeMessage; + BOOLEAN NonBlocking; + ULONG MaxInstances; + ULONG InBufferSize; + ULONG OutBufferSize; + LARGE_INTEGER TimeOut; +} IO_PIPE_CREATE_BUFFER, *PIO_PIPE_CREATE_BUFFER; + +typedef struct _IO_MAILSLOT_CREATE_BUFFER +{ + ULONG Param; /* ?? */ + ULONG MaxMessageSize; + LARGE_INTEGER TimeOut; +} IO_MAILSLOT_CREATE_BUFFER, *PIO_MAILSLOT_CREATE_BUFFER; + #endif /* __INCLUDE_DDK_IOTYPES_H */ diff --git a/reactos/include/ddk/kefuncs.h b/reactos/include/ddk/kefuncs.h index 1fd65bcff62..1dba2510e8c 100644 --- a/reactos/include/ddk/kefuncs.h +++ b/reactos/include/ddk/kefuncs.h @@ -91,8 +91,6 @@ VOID STDCALL KeEnterCriticalRegion (VOID); */ VOID STDCALL KeEnterKernelDebugger (VOID); -VOID STDCALL KeFlushWriteBuffer (VOID); - KIRQL STDCALL KeGetCurrentIrql (VOID); #ifndef __USE_W32API diff --git a/reactos/include/ddk/ketypes.h b/reactos/include/ddk/ketypes.h index 95d391a102c..16cdaa035e5 100644 --- a/reactos/include/ddk/ketypes.h +++ b/reactos/include/ddk/ketypes.h @@ -3,19 +3,7 @@ #ifndef __INCLUDE_DDK_KETYPES_H #define __INCLUDE_DDK_KETYPES_H -#ifdef __NTOSKRNL__ -extern CHAR EXPORTED KeNumberProcessors; -extern LOADER_PARAMETER_BLOCK EXPORTED KeLoaderBlock; -extern ULONG EXPORTED KeDcacheFlushCount; -extern ULONG EXPORTED KeIcacheFlushCount; -#else -extern CHAR IMPORTED KeNumberProcessors; -extern LOADER_PARAMETER_BLOCK IMPORTED KeLoaderBlock; -extern ULONG EXPORTED KeDcacheFlushCount; -extern ULONG EXPORTED KeIcacheFlushCount; -#endif - - +// include ntos/ketypes.h here? struct _KMUTANT; diff --git a/reactos/include/ntos.h b/reactos/include/ntos.h index c2fa327aa13..b8a5872d3c2 100644 --- a/reactos/include/ntos.h +++ b/reactos/include/ntos.h @@ -1,6 +1,6 @@ #ifndef _NTOS_H #define _NTOS_H -/* $Id: ntos.h,v 1.13 2003/08/07 11:47:33 silverblade Exp $ */ +/* $Id: ntos.h,v 1.14 2003/08/14 18:30:27 silverblade Exp $ */ #if defined(NTOS_MODE_USER) // include windows.h before ntddk.h to get user mode prototype for InterlockedXxx functions @@ -14,6 +14,7 @@ #include "ntos/except.h" #include "ntos/file.h" #include "ntos/gditypes.h" +#include "ntos/fstypes.h" // AG #include "ntos/heap.h" #include "ntos/kdbgsyms.h" #include "ntos/keyboard.h" @@ -88,6 +89,7 @@ #include "ntos/halfuncs.h" #include "ntos/kdfuncs.h" #include "ntos/kefuncs.h" // AG +#include "ntos/fstypes.h" // AG #include "ntos/obtypes.h" #include "ntos/tss.h" #include "rosrtl/thread.h" diff --git a/reactos/include/ntos/disk.h b/reactos/include/ntos/disk.h index 8d8e64d07a5..80a2d3f5dac 100644 --- a/reactos/include/ntos/disk.h +++ b/reactos/include/ntos/disk.h @@ -1,4 +1,4 @@ -/* $Id: disk.h,v 1.13 2003/06/22 16:33:44 ekohl Exp $ +/* $Id: disk.h,v 1.14 2003/08/14 18:30:27 silverblade Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -166,16 +166,16 @@ typedef struct _DISK_GEOMETRY DWORD BytesPerSector; } DISK_GEOMETRY, *PDISK_GEOMETRY; -#ifndef __USE_W32API - typedef struct _DRIVE_LAYOUT_INFORMATION { DWORD PartitionCount; DWORD Signature; PARTITION_INFORMATION PartitionEntry[1]; -} DRIVE_LAYOUT_INFORMATION, *PDRIVE_LAYOUT_INFORMATION; +} DRIVE_LAYOUT_INFORMATION; -#endif /* !__USE_W32API */ +#ifndef __USE_W32API +typedef DRIVE_LAYOUT_INFORMATION *PDRIVE_LAYOUT_INFORMATION; +#endif #endif /* __INCLUDE_DISK_H */ diff --git a/reactos/include/ntos/fstypes.h b/reactos/include/ntos/fstypes.h new file mode 100644 index 00000000000..bc0596237fe --- /dev/null +++ b/reactos/include/ntos/fstypes.h @@ -0,0 +1,35 @@ +#ifndef __INCLUDE_NTOS_FSTYPES_H +#define __INCLUDE_NTOS_FSTYPES_H + +#define FSRTL_TAG TAG('F','S','r','t') + + +typedef ULONG LBN; +typedef LBN *PLBN; + +typedef ULONG VBN; +typedef VBN *PVBN; + + +typedef struct _LARGE_MCB +{ + PFAST_MUTEX FastMutex; + ULONG MaximumPairCount; + ULONG PairCount; + POOL_TYPE PoolType; + PVOID Mapping; +} LARGE_MCB, *PLARGE_MCB; + +typedef struct _MCB { + LARGE_MCB LargeMcb; +} MCB, *PMCB; + + +typedef struct _FILE_LOCK_GRANTED { + LIST_ENTRY ListEntry; + FILE_LOCK_INFO Lock; +} FILE_LOCK_GRANTED, *PFILE_LOCK_GRANTED; + + + +#endif /* __INCLUDE_DDK_FSTYPES_H */ diff --git a/reactos/include/ntos/haltypes.h b/reactos/include/ntos/haltypes.h index 065040a0619..2377d0546c8 100755 --- a/reactos/include/ntos/haltypes.h +++ b/reactos/include/ntos/haltypes.h @@ -1,4 +1,4 @@ -/* $Id: haltypes.h,v 1.1 2003/05/28 18:35:35 chorns Exp $ +/* $Id: haltypes.h,v 1.2 2003/08/14 18:30:27 silverblade Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -10,8 +10,16 @@ */ -#ifndef __INCLUDE_DDK_HALTYPES_H -#define __INCLUDE_DDK_HALTYPES_H +#ifndef __INCLUDE_NTOS_HALTYPES_H +#define __INCLUDE_NTOS_HALTYPES_H + +#ifdef __GNUC__ +#define STDCALL_FUNC STDCALL +#else +#define STDCALL_FUNC(a) (__stdcall a ) +#endif /*__GNUC__*/ + +#include "types.h" /* HalReturnToFirmware */ @@ -424,14 +432,19 @@ typedef struct _HAL_DISPATCH #ifdef __NTOSKRNL__ extern HAL_DISPATCH EXPORTED HalDispatchTable; -#define HALDISPATCH (&HalDispatchTable) #else extern PHAL_DISPATCH IMPORTED HalDispatchTable; -#define HALDISPATCH ((PHAL_DISPATCH)&HalDispatchTable) #endif #endif /* !__USE_W32API */ +#ifdef __NTOSKRNL__ +#define HALDISPATCH (&HalDispatchTable) +#else +#define HALDISPATCH ((PHAL_DISPATCH)&HalDispatchTable) +#endif + + #define HAL_DISPATCH_VERSION 1 #define HalDispatchTableVersion HALDISPATCH->Version #define HalQuerySystemInformation HALDISPATCH->HalQuerySystemInformation diff --git a/reactos/include/ntos/kefuncs.h b/reactos/include/ntos/kefuncs.h index 0f307c61686..349a9522c69 100644 --- a/reactos/include/ntos/kefuncs.h +++ b/reactos/include/ntos/kefuncs.h @@ -9,4 +9,20 @@ #define KEBUGCHECK(a) DbgPrint("KeBugCheck at %s:%i\n",__FILE__,__LINE__), KeBugCheck(a) #define KEBUGCHECKEX(a,b,c,d,e) DbgPrint("KeBugCheckEx at %s:%i\n",__FILE__,__LINE__), KeBugCheckEx(a,b,c,d,e) + +#ifdef __NTOSKRNL__ +extern CHAR EXPORTED KeNumberProcessors; +extern LOADER_PARAMETER_BLOCK EXPORTED KeLoaderBlock; +extern ULONG EXPORTED KeDcacheFlushCount; +extern ULONG EXPORTED KeIcacheFlushCount; +#else +extern CHAR IMPORTED KeNumberProcessors; +extern LOADER_PARAMETER_BLOCK IMPORTED KeLoaderBlock; +extern ULONG EXPORTED KeDcacheFlushCount; +extern ULONG EXPORTED KeIcacheFlushCount; +#endif + + +VOID STDCALL KeFlushWriteBuffer (VOID); + #endif /* __INCLUDE_NTOS_KEFUNCS_H */ diff --git a/reactos/include/ntos/ntdef.h b/reactos/include/ntos/ntdef.h index 2f49140b07e..e0c88c38988 100644 --- a/reactos/include/ntos/ntdef.h +++ b/reactos/include/ntos/ntdef.h @@ -11,12 +11,12 @@ #ifndef __INCLUDE_NTDEF_H #define __INCLUDE_NTDEF_H -#define PACKED __attribute__((packed)) - #define EX_MAXIMUM_WAIT_OBJECTS (64) #ifndef __USE_W32API +#define PACKED __attribute__((packed)) + #define ANYSIZE_ARRAY (1) #define DELETE (0x00010000L) diff --git a/reactos/include/ntos/zwtypes.h b/reactos/include/ntos/zwtypes.h index 1f218b1748e..6e80ada4e66 100755 --- a/reactos/include/ntos/zwtypes.h +++ b/reactos/include/ntos/zwtypes.h @@ -1,5 +1,5 @@ -#ifndef __INCLUDE_DDK_ZWTYPES_H -#define __INCLUDE_DDK_ZWTYPES_H +#ifndef __INCLUDE_NTOS_ZWTYPES_H +#define __INCLUDE_NTOS_ZWTYPES_H #ifndef __USE_W32API @@ -1081,7 +1081,7 @@ typedef enum _IO_COMPLETION_INFORMATION_CLASS { } IO_COMPLETION_INFORMATION_CLASS; typedef struct _IO_COMPLETION_BASIC_INFORMATION { - LONG SignalState; + LONG Depth; } IO_COMPLETION_BASIC_INFORMATION, *PIO_COMPLETION_BASIC_INFORMATION; #else /* __USE_W32API */ diff --git a/reactos/lib/user32/windows/draw.c b/reactos/lib/user32/windows/draw.c index d698a2aea2e..541a5fb2df1 100644 --- a/reactos/lib/user32/windows/draw.c +++ b/reactos/lib/user32/windows/draw.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: draw.c,v 1.16 2003/08/11 07:02:06 rcampbell Exp $ +/* $Id: draw.c,v 1.17 2003/08/14 18:30:27 silverblade Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -1635,6 +1635,45 @@ DrawStateW( int cy, UINT fuFlags) { - UNIMPLEMENTED; - return FALSE; + // AG: Experimental, unfinished, and most likely buggy! I haven't been + // able to test this - my intention was to implement some things needed + // by the button control. + + if ((! lpOutputFunc) && (fuFlags & DST_COMPLEX)) + return FALSE; + + RECT r; + SetRect(&r, x, y, cx, cy); + + HBITMAP MemBMP = CreateCompatibleBitmap(hdc, cx, cy); + HDC MemDC = CreateCompatibleDC(hdc); + + HBITMAP OldBMP = (HBITMAP) SelectObject(MemDC, MemBMP); + + // Do drawing first + + if (lpOutputFunc) + lpOutputFunc(MemDC, lData, wData, cx, cy); + + else if (fuFlags & DST_TEXT) + { + int count; + if (wData == 0) count = -1; + else count = wData; + DrawTextW(MemDC, (WCHAR*) lData, count, &r, 0); + } + + // Now apply state effect + // not implemented yet ... + + + // Copy to hdc + + BitBlt(hdc, x, y, cx, cy, MemDC, 0, 0, SRCCOPY); + + SelectObject(MemDC, OldBMP); + DeleteObject(MemBMP); + DeleteDC(MemDC); + + return TRUE; } diff --git a/reactos/ntoskrnl/ex/list.c b/reactos/ntoskrnl/ex/list.c index afc5f6bd27e..2088ef93683 100644 --- a/reactos/ntoskrnl/ex/list.c +++ b/reactos/ntoskrnl/ex/list.c @@ -1,4 +1,4 @@ -/* $Id: list.c,v 1.10 2003/07/12 10:24:45 chorns Exp $ +/* $Id: list.c,v 1.11 2003/08/14 18:30:28 silverblade Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -13,9 +13,9 @@ /* INCLUDES *****************************************************************/ -#ifdef __USE_W32API -#define NONAMELESSUNION -#endif +//#ifdef __USE_W32API +//#define NONAMELESSUNION +//#endif #include #define NDEBUG @@ -176,11 +176,11 @@ ExInterlockedPopEntrySList(IN PSLIST_HEADER ListHead, KIRQL oldlvl; KeAcquireSpinLock(Lock,&oldlvl); - ret = PopEntryList(&ListHead->s.Next); + ret = PopEntryList(&ListHead->Next); if (ret) { - ListHead->s.Depth--; - ListHead->s.Sequence++; + ListHead->Depth--; + ListHead->Sequence++; } KeReleaseSpinLock(Lock,oldlvl); return(ret); @@ -211,10 +211,10 @@ ExInterlockedPushEntrySList(IN PSLIST_HEADER ListHead, PSINGLE_LIST_ENTRY ret; KeAcquireSpinLock(Lock,&oldlvl); - ret=ListHead->s.Next.Next; - PushEntryList(&ListHead->s.Next,ListEntry); - ListHead->s.Depth++; - ListHead->s.Sequence++; + ret=ListHead->Next.Next; + PushEntryList(&ListHead->Next,ListEntry); + ListHead->Depth++; + ListHead->Sequence++; KeReleaseSpinLock(Lock,oldlvl); return(ret); } diff --git a/reactos/ntoskrnl/ex/lookas.c b/reactos/ntoskrnl/ex/lookas.c index 58ec97f4fbe..5a60c26ef90 100644 --- a/reactos/ntoskrnl/ex/lookas.c +++ b/reactos/ntoskrnl/ex/lookas.c @@ -1,4 +1,4 @@ -/* $Id: lookas.c,v 1.10 2003/07/12 10:24:45 chorns Exp $ +/* $Id: lookas.c,v 1.11 2003/08/14 18:30:28 silverblade Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -14,9 +14,9 @@ /* INCLUDES *****************************************************************/ -#ifdef __USE_W32API -#define NONAMELESSUNION -#endif +//#ifdef __USE_W32API +// #define NONAMELESSUNION +//#endif #include #include #define NDEBUG @@ -45,12 +45,12 @@ PSINGLE_LIST_ENTRY { PSINGLE_LIST_ENTRY ListEntry; - ListEntry = ListHead->s.Next.Next; + ListEntry = ListHead->Next.Next; if (ListEntry!=NULL) { - ListHead->s.Next.Next = ListEntry->Next; - ListHead->s.Depth++; - ListHead->s.Sequence++; + ListHead->Next.Next = ListEntry->Next; + ListHead->Depth++; + ListHead->Sequence++; } return ListEntry; } @@ -64,10 +64,10 @@ PushEntrySList ( PSINGLE_LIST_ENTRY Entry ) { - Entry->Next = ListHead->s.Next.Next; - ListHead->s.Next.Next = Entry; - ListHead->s.Depth++; - ListHead->s.Sequence++; + Entry->Next = ListHead->Next.Next; + ListHead->Next.Next = Entry; + ListHead->Depth++; + ListHead->Sequence++; } diff --git a/reactos/ntoskrnl/ex/resource.c b/reactos/ntoskrnl/ex/resource.c index bab33e96298..86b1efae209 100644 --- a/reactos/ntoskrnl/ex/resource.c +++ b/reactos/ntoskrnl/ex/resource.c @@ -1,4 +1,4 @@ -/* $Id: resource.c,v 1.25 2003/07/21 21:53:51 royce Exp $ +/* $Id: resource.c,v 1.26 2003/08/14 18:30:28 silverblade Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -36,9 +36,9 @@ #define ResourceOwnedExclusive 0x80 #define ResourceDisableBoost 0x08 -#ifdef __USE_W32API -#define NONAMELESSUNION -#endif +//#ifdef __USE_W32API +//#define NONAMELESSUNION +//#endif /* INCLUDES *****************************************************************/ @@ -125,7 +125,7 @@ ExAcquireResourceExclusiveLite ( && Resource->OwnerThreads[0].OwnerThread == ExGetCurrentResourceThread()) { /* it's ok : same lock for same thread */ - Resource->OwnerThreads[0].u.OwnerCount++; + Resource->OwnerThreads[0].OwnerCount++; KeReleaseSpinLock(&Resource->SpinLock, oldIrql); DPRINT("ExAcquireResourceExclusiveLite() = TRUE\n"); return(TRUE); @@ -162,7 +162,7 @@ ExAcquireResourceExclusiveLite ( Resource->Flag |= ResourceOwnedExclusive; Resource->ActiveCount = 1; Resource->OwnerThreads[0].OwnerThread = ExGetCurrentResourceThread(); - Resource->OwnerThreads[0].u.OwnerCount = 1; + Resource->OwnerThreads[0].OwnerCount = 1; KeReleaseSpinLock(&Resource->SpinLock, oldIrql); DPRINT("ExAcquireResourceExclusiveLite() = TRUE\n"); return(TRUE); @@ -182,8 +182,8 @@ static BOOLEAN EiRemoveSharedOwner(PERESOURCE Resource, if (Resource->OwnerThreads[1].OwnerThread == ResourceThreadId) { - Resource->OwnerThreads[1].u.OwnerCount--; - if (Resource->OwnerThreads[1].u.OwnerCount == 0) + Resource->OwnerThreads[1].OwnerCount--; + if (Resource->OwnerThreads[1].OwnerCount == 0) { Resource->ActiveCount--; Resource->OwnerThreads[1].OwnerThread = 0; @@ -197,12 +197,12 @@ static BOOLEAN EiRemoveSharedOwner(PERESOURCE Resource, return(FALSE);; } - for (i=0; iOwnerThreads[1].u.TableSize; i++) + for (i=0; iOwnerThreads[1].TableSize; i++) { if (Resource->OwnerTable[i].OwnerThread == ResourceThreadId) { - Resource->OwnerTable[i].u.OwnerCount--; - if (Resource->OwnerTable[i].u.OwnerCount == 0) + Resource->OwnerTable[i].OwnerCount--; + if (Resource->OwnerTable[i].OwnerCount == 0) { Resource->ActiveCount--; Resource->OwnerTable[i].OwnerThread = 0; @@ -232,7 +232,7 @@ static BOOLEAN EiAddSharedOwner(PERESOURCE Resource) { /* no owner, it's easy */ Resource->OwnerThreads[1].OwnerThread = ExGetCurrentResourceThread(); - Resource->OwnerThreads[1].u.OwnerCount = 1; + Resource->OwnerThreads[1].OwnerCount = 1; if (Resource->OwnerTable != NULL) { ExFreePool(Resource->OwnerTable); @@ -266,10 +266,10 @@ static BOOLEAN EiAddSharedOwner(PERESOURCE Resource) sizeof(OWNER_ENTRY)); Resource->OwnerThreads[1].OwnerThread = 0; - Resource->OwnerThreads[1].u.TableSize = 3; + Resource->OwnerThreads[1].TableSize = 3; Resource->OwnerTable[1].OwnerThread = CurrentThread; - Resource->OwnerTable[1].u.OwnerCount = 1; + Resource->OwnerTable[1].OwnerCount = 1; Resource->ActiveCount++; return(TRUE); @@ -278,15 +278,15 @@ static BOOLEAN EiAddSharedOwner(PERESOURCE Resource) DPRINT("Search free entries\n"); DPRINT("Number of entries %d\n", - Resource->OwnerThreads[1].u.TableSize); + Resource->OwnerThreads[1].TableSize); freeEntry = NULL; - for (i=0; iOwnerThreads[1].u.TableSize; i++) + for (i=0; iOwnerThreads[1].TableSize; i++) { if (Resource->OwnerTable[i].OwnerThread == CurrentThread) { DPRINT("Thread already owns resource\n"); - Resource->OwnerTable[i].u.OwnerCount++; + Resource->OwnerTable[i].OwnerCount++; return(TRUE); } if (Resource->OwnerTable[i].OwnerThread == 0) @@ -306,7 +306,7 @@ static BOOLEAN EiAddSharedOwner(PERESOURCE Resource) freeEntry = ExAllocatePoolWithTag(NonPagedPool, sizeof(OWNER_ENTRY)* - (Resource->OwnerThreads[1].u.TableSize+1), + (Resource->OwnerThreads[1].TableSize+1), TAG_OWNER_TABLE); if (freeEntry == NULL) { @@ -314,15 +314,15 @@ static BOOLEAN EiAddSharedOwner(PERESOURCE Resource) return(FALSE); } memcpy(freeEntry,Resource->OwnerTable, - sizeof(OWNER_ENTRY)*(Resource->OwnerThreads[1].u.TableSize)); + sizeof(OWNER_ENTRY)*(Resource->OwnerThreads[1].TableSize)); ExFreePool(Resource->OwnerTable); Resource->OwnerTable=freeEntry; - freeEntry=&Resource->OwnerTable[Resource->OwnerThreads[1].u.TableSize]; - Resource->OwnerThreads[1].u.TableSize++; + freeEntry=&Resource->OwnerTable[Resource->OwnerThreads[1].TableSize]; + Resource->OwnerThreads[1].TableSize++; } DPRINT("Creating entry\n"); freeEntry->OwnerThread=ExGetCurrentResourceThread(); - freeEntry->u.OwnerCount=1; + freeEntry->OwnerCount=1; Resource->ActiveCount++; return(TRUE); } @@ -371,7 +371,7 @@ ExAcquireResourceSharedLite ( /* * NOTE: Is this correct? Seems the same as ExConvertExclusiveToShared */ - Resource->OwnerThreads[0].u.OwnerCount++; + Resource->OwnerThreads[0].OwnerCount++; KeReleaseSpinLock(&Resource->SpinLock, oldIrql); DPRINT("ExAcquireResourceSharedLite() = TRUE\n"); return(TRUE); @@ -446,9 +446,9 @@ ExConvertExclusiveToSharedLite ( //transfer infos from entry 0 to entry 1 and erase entry 0 Resource->OwnerThreads[1].OwnerThread=Resource->OwnerThreads[0].OwnerThread; - Resource->OwnerThreads[1].u.OwnerCount=Resource->OwnerThreads[0].u.OwnerCount; + Resource->OwnerThreads[1].OwnerCount=Resource->OwnerThreads[0].OwnerCount; Resource->OwnerThreads[0].OwnerThread=0; - Resource->OwnerThreads[0].u.OwnerCount=0; + Resource->OwnerThreads[0].OwnerCount=0; /* erase exclusive flag */ Resource->Flag &= (~ResourceOwnedExclusive); /* if no shared waiters, that's all */ @@ -520,7 +520,7 @@ ExAcquireSharedStarveExclusive ( if (Resource->ActiveCount == 0) { Resource->OwnerThreads[1].OwnerThread=ExGetCurrentResourceThread(); - Resource->OwnerThreads[1].u.OwnerCount=1; + Resource->OwnerThreads[1].OwnerCount=1; Resource->ActiveCount=1; KeReleaseSpinLock(&Resource->SpinLock, oldIrql); DPRINT("ExAcquireSharedStarveExclusive() = TRUE\n"); @@ -531,7 +531,7 @@ ExAcquireSharedStarveExclusive ( && Resource->OwnerThreads[0].OwnerThread==ExGetCurrentResourceThread()) { /* exclusive, but by same thread : it's ok */ - Resource->OwnerThreads[0].u.OwnerCount++; + Resource->OwnerThreads[0].OwnerCount++; KeReleaseSpinLock(&Resource->SpinLock, oldIrql); DPRINT("ExAcquireSharedStarveExclusive() = TRUE\n"); return(TRUE); @@ -712,21 +712,21 @@ ExIsResourceAcquiredSharedLite( ULONG i; if (Resource->OwnerThreads[0].OwnerThread == ExGetCurrentResourceThread()) { - return(Resource->OwnerThreads[0].u.OwnerCount); + return(Resource->OwnerThreads[0].OwnerCount); } if (Resource->OwnerThreads[1].OwnerThread == ExGetCurrentResourceThread()) { - return(Resource->OwnerThreads[1].u.OwnerCount); + return(Resource->OwnerThreads[1].OwnerCount); } - if (!Resource->OwnerThreads[1].u.TableSize) + if (!Resource->OwnerThreads[1].TableSize) { return(0); } - for (i=0; iOwnerThreads[1].u.TableSize; i++) + for (i=0; iOwnerThreads[1].TableSize; i++) { if (Resource->OwnerTable[i].OwnerThread==ExGetCurrentResourceThread()) { - return Resource->OwnerTable[i].u.OwnerCount; + return Resource->OwnerTable[i].OwnerCount; } } return(0); @@ -754,9 +754,9 @@ ExReinitializeResourceLite ( ExFreePool(Resource->OwnerTable); } Resource->OwnerThreads[0].OwnerThread=0; - Resource->OwnerThreads[0].u.OwnerCount=0; + Resource->OwnerThreads[0].OwnerCount=0; Resource->OwnerThreads[1].OwnerThread=0; - Resource->OwnerThreads[1].u.OwnerCount=0; + Resource->OwnerThreads[1].OwnerCount=0; } /* @@ -823,8 +823,8 @@ ExReleaseResourceForThreadLite ( { DPRINT("Releasing from exclusive access\n"); - Resource->OwnerThreads[0].u.OwnerCount--; - if (Resource->OwnerThreads[0].u.OwnerCount > 0) + Resource->OwnerThreads[0].OwnerCount--; + if (Resource->OwnerThreads[0].OwnerCount > 0) { KeReleaseSpinLock(&Resource->SpinLock, oldIrql); DPRINT("ExReleaseResourceForThreadLite() finished\n"); diff --git a/reactos/ntoskrnl/fs/filelock.c b/reactos/ntoskrnl/fs/filelock.c index 9267bcd786f..cd19e7d129e 100644 --- a/reactos/ntoskrnl/fs/filelock.c +++ b/reactos/ntoskrnl/fs/filelock.c @@ -1,4 +1,4 @@ -/* $Id: filelock.c,v 1.10 2003/08/07 11:47:33 silverblade Exp $ +/* $Id: filelock.c,v 1.11 2003/08/14 18:30:28 silverblade Exp $ * * reactos/ntoskrnl/fs/filelock.c * @@ -6,6 +6,7 @@ #include #include #include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/fs/notify.c b/reactos/ntoskrnl/fs/notify.c index 2ba51b12c9a..83bda19aadb 100644 --- a/reactos/ntoskrnl/fs/notify.c +++ b/reactos/ntoskrnl/fs/notify.c @@ -1,4 +1,4 @@ -/* $Id: notify.c,v 1.6 2003/07/10 06:27:13 royce Exp $ +/* $Id: notify.c,v 1.7 2003/08/14 18:30:28 silverblade Exp $ * * reactos/ntoskrnl/fs/notify.c * @@ -144,23 +144,23 @@ FsRtlNotifyFullReportChange ( VOID STDCALL FsRtlNotifyInitializeSync ( - IN PNOTIFY_SYNC * NotifySync + IN PNOTIFY_SYNC * NotifySync ) { - *NotifySync = NULL; - *NotifySync = ExAllocatePoolWithTag ( + *NotifySync = NULL; + *NotifySync = ExAllocatePoolWithTag ( 0x10, // PoolType??? sizeof (NOTIFY_SYNC), // NumberOfBytes = 0x28 FSRTL_TAG ); #if 0 - *NotifySync->Unknown0 = 1; - *NotifySync->Unknown2 = 0; - *NotifySync->Unknown3 = 1; - *NotifySync->Unknown4 = 4; - *NotifySync->Unknown5 = 0; - *NotifySync->Unknown9 = 0; - *NotifySync->Unknown10 = 0; + *NotifySync->Unknown0 = 1; + *NotifySync->Unknown2 = 0; + *NotifySync->Unknown3 = 1; + *NotifySync->Unknown4 = 4; + *NotifySync->Unknown5 = 0; + *NotifySync->Unknown9 = 0; + *NotifySync->Unknown10 = 0; #endif } @@ -221,13 +221,13 @@ FsRtlNotifyReportChange ( VOID STDCALL FsRtlNotifyUninitializeSync ( - IN OUT PNOTIFY_SYNC * NotifySync + IN OUT PNOTIFY_SYNC * NotifySync ) { - if (NULL != *NotifySync) + if (NULL != *NotifySync) { - ExFreePool (*NotifySync); - *NotifySync = NULL; + ExFreePool (*NotifySync); + *NotifySync = NULL; } } diff --git a/reactos/ntoskrnl/fs/tunnel.c b/reactos/ntoskrnl/fs/tunnel.c index f629740db31..0935449259f 100644 --- a/reactos/ntoskrnl/fs/tunnel.c +++ b/reactos/ntoskrnl/fs/tunnel.c @@ -1,4 +1,4 @@ -/* $Id: tunnel.c,v 1.5 2003/07/10 06:27:13 royce Exp $ +/* $Id: tunnel.c,v 1.6 2003/08/14 18:30:28 silverblade Exp $ * * reactos/ntoskrnl/fs/tunnel.c * @@ -89,7 +89,7 @@ FsRtlDeleteTunnelCache ( * * @unimplemented */ -VOID +BOOLEAN STDCALL FsRtlFindInTunnelCache ( IN PTUNNEL Cache, @@ -101,6 +101,7 @@ FsRtlFindInTunnelCache ( OUT PVOID Data ) { + return FALSE; } diff --git a/reactos/ntoskrnl/include/internal/ifs.h b/reactos/ntoskrnl/include/internal/ifs.h index 134750c0b92..7a1494a5a4c 100644 --- a/reactos/ntoskrnl/include/internal/ifs.h +++ b/reactos/ntoskrnl/include/internal/ifs.h @@ -1,8 +1,9 @@ #ifndef __INCLUDE_INTERNAL_IFS_H #define __INCLUDE_INTERNAL_IFS_H -/* $Id: ifs.h,v 1.5 2003/01/25 15:52:43 hbirr Exp $ */ +/* $Id: ifs.h,v 1.6 2003/08/14 18:30:28 silverblade Exp $ */ #include +#include /* Look for "FSrt" in mem view */ #define IFS_POOL_TAG 0x74725346 diff --git a/reactos/ntoskrnl/include/internal/io.h b/reactos/ntoskrnl/include/internal/io.h index 32af4261df7..44bb89ace58 100644 --- a/reactos/ntoskrnl/include/internal/io.h +++ b/reactos/ntoskrnl/include/internal/io.h @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: io.h,v 1.32 2003/06/20 22:42:18 ekohl Exp $ +/* $Id: io.h,v 1.33 2003/08/14 18:30:28 silverblade Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -33,6 +33,22 @@ #include #include + +#ifndef __USE_W32API +#define DEVICE_TYPE_FROM_CTL_CODE(ctlCode) (((ULONG)(ctlCode&0xffff0000))>>16) +#endif + +#define IO_METHOD_FROM_CTL_CODE(ctlCode) (ctlCode&0x00000003) + + +typedef struct _IO_COMPLETION_PACKET{ + ULONG Key; + ULONG Overlapped; + IO_STATUS_BLOCK IoStatus; + LIST_ENTRY ListEntry; +} IO_COMPLETION_PACKET, *PIO_COMPLETION_PACKET; + + typedef struct _DEVICE_NODE { struct _DEVICE_NODE *Parent; @@ -297,7 +313,7 @@ PIRP IoBuildSynchronousFsdRequestWithMdl(ULONG MajorFunction, PLARGE_INTEGER StartingOffset, PKEVENT Event, PIO_STATUS_BLOCK IoStatusBlock, - ULONG PagingIo); + BOOLEAN PagingIo); VOID IoInitShutdownNotification(VOID); VOID IoShutdownRegisteredDevices(VOID); diff --git a/reactos/ntoskrnl/io/adapter.c b/reactos/ntoskrnl/io/adapter.c index e405700256e..18ef2c040ff 100644 --- a/reactos/ntoskrnl/io/adapter.c +++ b/reactos/ntoskrnl/io/adapter.c @@ -1,4 +1,4 @@ -/* $Id: adapter.c,v 1.8 2003/07/10 15:47:00 royce Exp $ +/* $Id: adapter.c,v 1.9 2003/08/14 18:30:28 silverblade Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -12,6 +12,7 @@ /* INCLUDES *****************************************************************/ #include +#include #include @@ -19,7 +20,7 @@ POBJECT_TYPE EXPORTED IoAdapterObjectType = NULL; /* FIXME */ POBJECT_TYPE EXPORTED IoDeviceHandlerObjectType = NULL; /* FIXME */ -USHORT EXPORTED IoDeviceHandlerObjectSize = 0; /* FIXME */ +ULONG EXPORTED IoDeviceHandlerObjectSize = 0; /* FIXME */ /* FUNCTIONS *****************************************************************/ diff --git a/reactos/ntoskrnl/io/buildirp.c b/reactos/ntoskrnl/io/buildirp.c index c6e0df5fb5b..3704a2773fb 100644 --- a/reactos/ntoskrnl/io/buildirp.c +++ b/reactos/ntoskrnl/io/buildirp.c @@ -1,4 +1,4 @@ -/* $Id: buildirp.c,v 1.33 2003/07/10 15:47:00 royce Exp $ +/* $Id: buildirp.c,v 1.34 2003/08/14 18:30:28 silverblade Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -14,6 +14,7 @@ #include #include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/io/errlog.c b/reactos/ntoskrnl/io/errlog.c index db977efa43b..1f02ef65f28 100644 --- a/reactos/ntoskrnl/io/errlog.c +++ b/reactos/ntoskrnl/io/errlog.c @@ -1,4 +1,4 @@ -/* $Id: errlog.c,v 1.10 2003/07/10 15:47:00 royce Exp $ +/* $Id: errlog.c,v 1.11 2003/08/14 18:30:28 silverblade Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -20,7 +20,7 @@ /* TYPES *********************************************************************/ - +#ifndef __USE_W32API typedef struct _IO_ERROR_LOG_PACKET { UCHAR MajorFunctionCode; @@ -37,6 +37,7 @@ typedef struct _IO_ERROR_LOG_PACKET LARGE_INTEGER DeviceOffset; ULONG DumpData[1]; } IO_ERROR_LOG_PACKET, *PIO_ERROR_LOG_PACKET; +#endif typedef struct _ERROR_LOG_ENTRY { diff --git a/reactos/ntoskrnl/io/iocomp.c b/reactos/ntoskrnl/io/iocomp.c index 61fcdbb1454..dddc777259b 100644 --- a/reactos/ntoskrnl/io/iocomp.c +++ b/reactos/ntoskrnl/io/iocomp.c @@ -15,6 +15,7 @@ #define NTOS_MODE_KERNEL #include //#include +#include #define NDEBUG #include @@ -202,7 +203,7 @@ NtQueryIoCompletion( NULL); if (NT_SUCCESS(Status)) { - ((PIO_COMPLETION_BASIC_INFORMATION)IoCompletionInformation)->SignalState = + ((PIO_COMPLETION_BASIC_INFORMATION)IoCompletionInformation)->Depth = Queue->Header.SignalState; ObDereferenceObject(Queue); diff --git a/reactos/ntoskrnl/io/mailslot.c b/reactos/ntoskrnl/io/mailslot.c index 93d9c7e1147..8f58c29f032 100644 --- a/reactos/ntoskrnl/io/mailslot.c +++ b/reactos/ntoskrnl/io/mailslot.c @@ -12,6 +12,7 @@ /* INCLUDES *****************************************************************/ #include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/io/npipe.c b/reactos/ntoskrnl/io/npipe.c index e45596aa07f..91fd1630ef8 100644 --- a/reactos/ntoskrnl/io/npipe.c +++ b/reactos/ntoskrnl/io/npipe.c @@ -11,6 +11,7 @@ /* INCLUDES *****************************************************************/ #include +#include #define NDEBUG #include diff --git a/reactos/ntoskrnl/ke/queue.c b/reactos/ntoskrnl/ke/queue.c index c4068b3eb69..6d20eea8b53 100644 --- a/reactos/ntoskrnl/ke/queue.c +++ b/reactos/ntoskrnl/ke/queue.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: queue.c,v 1.8 2003/07/11 01:23:15 royce Exp $ +/* $Id: queue.c,v 1.9 2003/08/14 18:30:28 silverblade Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/queue.c @@ -29,6 +29,7 @@ /* INCLUDES *****************************************************************/ #include +#include #include #include #include