fixes for Visual C++:
- repositioned __stdcall in several declarations
- replaced __attribute__ with __declspec when possible
- reimplemented some inline assembly
- use RESTRICTED_POINTER instead of __restrict
- change some w32api conditional compilation to take Visual C++ in
consideration
- fixed RVA macro
- moved variable declarations to the beginning of the scope block
- corrected mismatching DLL linkage for exported symbols in ntoskrnl
- corrected some non-standard casts
- do PVOID arithmetic with the RVA macro
- removed (unused) nested function
- corrected wrong macro definitions that took a parameter when they
shouldn't
- use the appropriate _M_XXX macros for architecture-specific
conditional compilation
- miscellaneous hacks tagged with /* ROX-U */
Deleted: branches/rox-u/reactos/include/ddk/ntifs.h
Modified: branches/rox-u/reactos/include/napi/teb.h
Modified: branches/rox-u/reactos/include/ntdll/ldr.h
Modified: branches/rox-u/reactos/include/ntos/rtl.h
Modified: branches/rox-u/reactos/include/ntos.h
Modified: branches/rox-u/reactos/ntoskrnl/cc/copy.c
Modified: branches/rox-u/reactos/ntoskrnl/cc/fs.c
Modified: branches/rox-u/reactos/ntoskrnl/cm/ntfunc.c
Modified: branches/rox-u/reactos/ntoskrnl/ex/evtpair.c
Modified: branches/rox-u/reactos/ntoskrnl/ex/init.c
Modified: branches/rox-u/reactos/ntoskrnl/ex/sysinfo.c
Modified: branches/rox-u/reactos/ntoskrnl/ex/time.c
Modified: branches/rox-u/reactos/ntoskrnl/fs/name.c
Modified: branches/rox-u/reactos/ntoskrnl/include/internal/arch/ke.h
Modified: branches/rox-u/reactos/ntoskrnl/include/internal/arch/mm.h
Modified: branches/rox-u/reactos/ntoskrnl/include/internal/arch/ps.h
Modified: branches/rox-u/reactos/ntoskrnl/include/internal/debug.h
Modified: branches/rox-u/reactos/ntoskrnl/include/internal/ex.h
Modified: branches/rox-u/reactos/ntoskrnl/include/internal/i386/ke.h
Modified: branches/rox-u/reactos/ntoskrnl/include/internal/ke.h
Modified: branches/rox-u/reactos/ntoskrnl/include/internal/ntoskrnl.h
Modified: branches/rox-u/reactos/ntoskrnl/include/internal/ps.h
Modified: branches/rox-u/reactos/ntoskrnl/include/ntoskrnl.h
Modified: branches/rox-u/reactos/ntoskrnl/io/bootlog.c
Modified: branches/rox-u/reactos/ntoskrnl/io/driver.c
Modified: branches/rox-u/reactos/ntoskrnl/io/file.c
Modified: branches/rox-u/reactos/ntoskrnl/io/iomgr.c
Modified: branches/rox-u/reactos/ntoskrnl/io/irp.c
Modified: branches/rox-u/reactos/ntoskrnl/io/wmi.c
Modified: branches/rox-u/reactos/ntoskrnl/ke/ipi.c
Modified: branches/rox-u/reactos/ntoskrnl/ke/kqueue.c
Modified: branches/rox-u/reactos/ntoskrnl/ke/main.c
Modified: branches/rox-u/reactos/ntoskrnl/ke/process.c
Modified: branches/rox-u/reactos/ntoskrnl/ke/profile.c
Modified: branches/rox-u/reactos/ntoskrnl/ldr/loader.c
Modified: branches/rox-u/reactos/ntoskrnl/ldr/resource.c
Modified: branches/rox-u/reactos/ntoskrnl/mm/iospace.c
Modified: branches/rox-u/reactos/ntoskrnl/mm/process.c
Modified: branches/rox-u/reactos/ntoskrnl/mm/section.c
Modified: branches/rox-u/reactos/ntoskrnl/ob/handle.c
Modified: branches/rox-u/reactos/ntoskrnl/ob/object.c
Modified: branches/rox-u/reactos/ntoskrnl/ps/kill.c
Modified: branches/rox-u/reactos/ntoskrnl/ps/psmgr.c
Modified: branches/rox-u/reactos/ntoskrnl/se/acl.c
Modified: branches/rox-u/reactos/ntoskrnl/se/luid.c
Modified: branches/rox-u/reactos/ntoskrnl/se/semgr.c
Modified: branches/rox-u/reactos/ntoskrnl/se/token.c
Modified: branches/rox-u/reactos/w32api/include/ddk/batclass.h
Modified: branches/rox-u/reactos/w32api/include/ddk/ntddk.h
Modified: branches/rox-u/reactos/w32api/include/ddk/ntifs.h
Modified: branches/rox-u/reactos/w32api/include/ddk/ntpoapi.h
Modified: branches/rox-u/reactos/w32api/include/ddk/winddk.h
Modified: branches/rox-u/reactos/w32api/include/ntdef.h
Modified: branches/rox-u/reactos/w32api/include/windef.h
Modified: branches/rox-u/reactos/w32api/include/winnt.h
_____
Deleted: branches/rox-u/reactos/include/ddk/ntifs.h
--- branches/rox-u/reactos/include/ddk/ntifs.h 2005-06-20 22:54:01 UTC
(rev 16197)
+++ branches/rox-u/reactos/include/ddk/ntifs.h 2005-06-21 00:23:09 UTC
(rev 16198)
@@ -1,20 +0,0 @@
-#ifndef __INCLUDE_DDK_NTIFS_H
-#define __INCLUDE_DDK_NTIFS_H
-
-#include_next <ddk/ntifs.h>
-
-NTSTATUS STDCALL
-CcRosInitializeFileCache (PFILE_OBJECT FileObject,
- ULONG CacheSegmentSize);
-NTSTATUS STDCALL
-CcRosReleaseFileCache (PFILE_OBJECT FileObject);
-
-#define FSCTL_ROS_QUERY_LCN_MAPPING \
- CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 63, METHOD_BUFFERED,
FILE_ANY_ACCESS)
-
-typedef struct _ROS_QUERY_LCN_MAPPING
-{
- LARGE_INTEGER LcnDiskOffset;
-} ROS_QUERY_LCN_MAPPING, *PROS_QUERY_LCN_MAPPING;
-
-#endif /* __INCLUDE_DDK_NTIFS_H */
_____
Modified: branches/rox-u/reactos/include/napi/teb.h
--- branches/rox-u/reactos/include/napi/teb.h 2005-06-20 22:54:01 UTC
(rev 16197)
+++ branches/rox-u/reactos/include/napi/teb.h 2005-06-21 00:23:09 UTC
(rev 16198)
@@ -239,6 +239,7 @@
PVOID WineDebugInfo; /* Needed for WINE DLL's */
} TEB, *PTEB;
+#if 0 /* ROX-U */
#if (!defined(__USE_W32API) || __W32API_MAJOR_VERSION < 2 ||
__W32API_MINOR_VERSION < 5)
/* FIXME: at least NtCurrentTeb should be defined in winnt.h */
@@ -331,4 +332,6 @@
#define NtCurrentPeb() (NtCurrentTeb()->Peb)
#endif
+#endif
+
#endif /* __INCLUDE_INTERNAL_TEB */
_____
Modified: branches/rox-u/reactos/include/ntdll/ldr.h
--- branches/rox-u/reactos/include/ntdll/ldr.h 2005-06-20 22:54:01 UTC
(rev 16197)
+++ branches/rox-u/reactos/include/ntdll/ldr.h 2005-06-21 00:23:09 UTC
(rev 16198)
@@ -1,7 +1,7 @@
#ifndef __NTOSKRNL_INCLUDE_INTERNAL_LDR_H
#define __NTOSKRNL_INCLUDE_INTERNAL_LDR_H
-#include <roscfg.h>
+/*#include <roscfg.h>*/
#ifndef _NTNDK_
#include <napi/teb.h>
#endif
@@ -85,7 +85,7 @@
} LDR_SYMBOL_INFO, *PLDR_SYMBOL_INFO;
-#define RVA(m, b) ((ULONG)b + m)
+#define RVA(m, b) ((PVOID)((ULONG)b + (PBYTE)m))
#if defined(KDBG) || defined(DBG)
_____
Modified: branches/rox-u/reactos/include/ntos/rtl.h
--- branches/rox-u/reactos/include/ntos/rtl.h 2005-06-20 22:54:01 UTC
(rev 16197)
+++ branches/rox-u/reactos/include/ntos/rtl.h 2005-06-21 00:23:09 UTC
(rev 16198)
@@ -2182,7 +2182,7 @@
ACL_INFORMATION_CLASS InformationClass);
NTSTATUS STDCALL
-RtlQueryTimeZoneInformation (IN OUT PTIME_ZONE_INFORMATION
TimeZoneInformation);
+RtlQueryTimeZoneInformation (IN OUT TIME_ZONE_INFORMATION *
TimeZoneInformation);
VOID STDCALL
RtlRaiseException (IN PEXCEPTION_RECORD ExceptionRecord);
@@ -2375,7 +2375,7 @@
PUCHAR RMControl);
NTSTATUS STDCALL
-RtlSetTimeZoneInformation (IN OUT PTIME_ZONE_INFORMATION
TimeZoneInformation);
+RtlSetTimeZoneInformation (IN OUT TIME_ZONE_INFORMATION *
TimeZoneInformation);
ULONG STDCALL
RtlSizeHeap(
_____
Modified: branches/rox-u/reactos/include/ntos.h
--- branches/rox-u/reactos/include/ntos.h 2005-06-20 22:54:01 UTC
(rev 16197)
+++ branches/rox-u/reactos/include/ntos.h 2005-06-21 00:23:09 UTC
(rev 16198)
@@ -75,7 +75,6 @@
#include "ntos/registry.h"
#include "ntos/security.h"
#include "ntos/synch.h"
-#include "ntos/time.h"
#include "napi/i386/segment.h"
#include "napi/types.h"
#include "napi/dbg.h"
_____
Modified: branches/rox-u/reactos/ntoskrnl/cc/copy.c
--- branches/rox-u/reactos/ntoskrnl/cc/copy.c 2005-06-20 22:54:01 UTC
(rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/cc/copy.c 2005-06-21 00:23:09 UTC
(rev 16198)
@@ -136,7 +136,7 @@
while (current2 != NULL && !current2->Valid && current_size <
MAX_RW_LENGTH)
{
PVOID address = current2->BaseAddress;
- for (i = 0; i < (Bcb->CacheSegmentSize / PAGE_SIZE); i++,
address += PAGE_SIZE)
+ for (i = 0; i < (Bcb->CacheSegmentSize / PAGE_SIZE); i++,
address = RVA(address, PAGE_SIZE))
{
*MdlPages++ = MmGetPfnForProcess(NULL, address);
}
_____
Modified: branches/rox-u/reactos/ntoskrnl/cc/fs.c
--- branches/rox-u/reactos/ntoskrnl/cc/fs.c 2005-06-20 22:54:01 UTC
(rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/cc/fs.c 2005-06-21 00:23:09 UTC
(rev 16198)
@@ -39,9 +39,8 @@
IN PVOID Context2
)
{
- UNIMPLEMENTED;
-
LARGE_INTEGER i;
+ UNIMPLEMENTED;
i.QuadPart = 0;
return i;
}
@@ -69,9 +68,8 @@
OUT PLARGE_INTEGER OldestLsn OPTIONAL
)
{
- UNIMPLEMENTED;
-
LARGE_INTEGER i;
+ UNIMPLEMENTED;
i.QuadPart = 0;
return i;
}
_____
Modified: branches/rox-u/reactos/ntoskrnl/cm/ntfunc.c
--- branches/rox-u/reactos/ntoskrnl/cm/ntfunc.c 2005-06-20 22:54:01 UTC
(rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/cm/ntfunc.c 2005-06-21 00:23:09 UTC
(rev 16198)
@@ -121,8 +121,8 @@
DPRINT("current %S\n",current);
CurrentHeader = BODY_TO_HEADER(CurrentObject);
- DPRINT("Current ObjectType %wZ\n",
- &CurrentHeader->Type->TypeName);
+ /*DPRINT("Current ObjectType %wZ\n",
+ &CurrentHeader->Type->TypeName);*/ /* ROX-U */
if (CurrentHeader->Type->TypeInfo.ParseProcedure == NULL)
{
_____
Modified: branches/rox-u/reactos/ntoskrnl/ex/evtpair.c
--- branches/rox-u/reactos/ntoskrnl/ex/evtpair.c 2005-06-20
22:54:01 UTC (rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/ex/evtpair.c 2005-06-21
00:23:09 UTC (rev 16198)
@@ -18,7 +18,7 @@
/* GLOBALS
*******************************************************************/
-POBJECT_TYPE EXPORTED ExEventPairObjectType = NULL;
+POBJECT_TYPE ExEventPairObjectType = NULL;
static GENERIC_MAPPING ExEventPairMapping = {
STANDARD_RIGHTS_READ,
_____
Modified: branches/rox-u/reactos/ntoskrnl/ex/init.c
--- branches/rox-u/reactos/ntoskrnl/ex/init.c 2005-06-20 22:54:01 UTC
(rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/ex/init.c 2005-06-21 00:23:09 UTC
(rev 16198)
@@ -496,7 +496,7 @@
KeCreateApplicationProcessorIdleThread(KeNumberProcessors);
/* Allocate a stack for use when booting the processor */
- ProcessorStack =
Ki386InitialStackArray[((int)KeNumberProcessors)] + MM_STACK_SIZE;
+ ProcessorStack =
RVA(Ki386InitialStackArray[((int)KeNumberProcessors)], MM_STACK_SIZE);
/* Tell HAL a new CPU is being started */
HalStartNextProcessor(0, (ULONG)ProcessorStack -
2*sizeof(FX_SAVE_AREA));
_____
Modified: branches/rox-u/reactos/ntoskrnl/ex/sysinfo.c
--- branches/rox-u/reactos/ntoskrnl/ex/sysinfo.c 2005-06-20
22:54:01 UTC (rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/ex/sysinfo.c 2005-06-21
00:23:09 UTC (rev 16198)
@@ -835,6 +835,10 @@
/* Class 16 - Handle Information */
QSI_DEF(SystemHandleInformation)
{
+ PEPROCESS pr, syspr;
+ int curSize, i = 0;
+ ULONG hCount = 0;
+
PSYSTEM_HANDLE_INFORMATION Shi =
(PSYSTEM_HANDLE_INFORMATION) Buffer;
@@ -848,10 +852,6 @@
DPRINT("SystemHandleInformation 1\n");
- PEPROCESS pr, syspr;
- int curSize, i = 0;
- ULONG hCount = 0;
-
/* First Calc Size from Count. */
syspr = PsGetNextProcess(NULL);
pr = syspr;
@@ -937,6 +937,7 @@
/* Class 18 - Information */
QSI_DEF(SystemPageFileInformation)
{
+ UNICODE_STRING FileName; /* FIXME */
SYSTEM_PAGEFILE_INFORMATION *Spfi = (SYSTEM_PAGEFILE_INFORMATION
*) Buffer;
if (Size < sizeof (SYSTEM_PAGEFILE_INFORMATION))
@@ -945,7 +946,6 @@
return (STATUS_INFO_LENGTH_MISMATCH);
}
- UNICODE_STRING FileName; /* FIXME */
RtlInitUnicodeString(&FileName, NULL); /* FIXME */
/* FIXME */
@@ -1321,7 +1321,7 @@
return STATUS_INFO_LENGTH_MISMATCH;
}
- return ExpSetTimeZoneInformation((PTIME_ZONE_INFORMATION)Buffer);
+ return ExpSetTimeZoneInformation((TIME_ZONE_INFORMATION *)Buffer);
}
_____
Modified: branches/rox-u/reactos/ntoskrnl/ex/time.c
--- branches/rox-u/reactos/ntoskrnl/ex/time.c 2005-06-20 22:54:01 UTC
(rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/ex/time.c 2005-06-21 00:23:09 UTC
(rev 16198)
@@ -76,7 +76,7 @@
NTSTATUS
-ExpSetTimeZoneInformation(PTIME_ZONE_INFORMATION TimeZoneInformation)
+ExpSetTimeZoneInformation(TIME_ZONE_INFORMATION * TimeZoneInformation)
{
LARGE_INTEGER LocalTime;
LARGE_INTEGER SystemTime;
_____
Modified: branches/rox-u/reactos/ntoskrnl/fs/name.c
--- branches/rox-u/reactos/ntoskrnl/fs/name.c 2005-06-20 22:54:01 UTC
(rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/fs/name.c 2005-06-21 00:23:09 UTC
(rev 16198)
@@ -149,7 +149,7 @@
FSRTL_FAT_LEGAL | FSRTL_HPFS_LEGAL | FSRTL_NTFS_LEGAL /*
0x7f */
};
-PUCHAR EXPORTED FsRtlLegalAnsiCharacterArray = LegalAnsiCharacterArray;
+PUCHAR FsRtlLegalAnsiCharacterArray = LegalAnsiCharacterArray;
/* FUNCTIONS
*****************************************************************/
_____
Modified: branches/rox-u/reactos/ntoskrnl/include/internal/arch/ke.h
--- branches/rox-u/reactos/ntoskrnl/include/internal/arch/ke.h
2005-06-20 22:54:01 UTC (rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/include/internal/arch/ke.h
2005-06-21 00:23:09 UTC (rev 16198)
@@ -19,7 +19,7 @@
#ifndef __NTOSKRNL_INCLUDE_INTERNAL_ARCH_KE_H
#define __NTOSKRNL_INCLUDE_INTERNAL_ARCH_KE_H
-#ifdef i386
+#ifdef _M_IX86
#include "../i386/ke.h"
#else
#error "Unknown processor"
_____
Modified: branches/rox-u/reactos/ntoskrnl/include/internal/arch/mm.h
--- branches/rox-u/reactos/ntoskrnl/include/internal/arch/mm.h
2005-06-20 22:54:01 UTC (rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/include/internal/arch/mm.h
2005-06-21 00:23:09 UTC (rev 16198)
@@ -19,7 +19,7 @@
#ifndef __NTOSKRNL_INCLUDE_INTERNAL_ARCH_MM_H
#define __NTOSKRNL_INCLUDE_INTERNAL_ARCH_MM_H
-#ifdef i386
+#ifdef _M_IX86
#include <internal/i386/mm.h>
#else
#error "Unknown processor"
_____
Modified: branches/rox-u/reactos/ntoskrnl/include/internal/arch/ps.h
--- branches/rox-u/reactos/ntoskrnl/include/internal/arch/ps.h
2005-06-20 22:54:01 UTC (rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/include/internal/arch/ps.h
2005-06-21 00:23:09 UTC (rev 16198)
@@ -19,7 +19,7 @@
#ifndef __NTOSKRNL_INCLUDE_INTERNAL_ARCH_PS_H
#define __NTOSKRNL_INCLUDE_INTERNAL_ARCH_PS_H
-#ifdef i386
+#ifdef _M_IX86
#include <internal/i386/ps.h>
#define KiArchContextSwitch KiSwapContext
#define KiArchInitThreadWithContext Ke386InitThreadWithContext
_____
Modified: branches/rox-u/reactos/ntoskrnl/include/internal/debug.h
--- branches/rox-u/reactos/ntoskrnl/include/internal/debug.h
2005-06-20 22:54:01 UTC (rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/include/internal/debug.h
2005-06-21 00:23:09 UTC (rev 16198)
@@ -81,8 +81,8 @@
#else /* DBG */
-#define CPRINT(args...)
-#define DPRINT1(args...)
+/*#define CPRINT(args...)
+#define DPRINT1(args...)*/ /* ROX-U */
#ifndef __USE_W32API
#define assert(x)
#define ASSERT(x)
_____
Modified: branches/rox-u/reactos/ntoskrnl/include/internal/ex.h
--- branches/rox-u/reactos/ntoskrnl/include/internal/ex.h
2005-06-20 22:54:01 UTC (rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/include/internal/ex.h
2005-06-21 00:23:09 UTC (rev 16198)
@@ -185,7 +185,7 @@
PLONGLONG Exchange);
NTSTATUS
-ExpSetTimeZoneInformation(PTIME_ZONE_INFORMATION TimeZoneInformation);
+ExpSetTimeZoneInformation(TIME_ZONE_INFORMATION * TimeZoneInformation);
NTSTATUS
ExpAllocateLocallyUniqueId(OUT LUID *LocallyUniqueId);
_____
Modified: branches/rox-u/reactos/ntoskrnl/include/internal/i386/ke.h
--- branches/rox-u/reactos/ntoskrnl/include/internal/i386/ke.h
2005-06-20 22:54:01 UTC (rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/include/internal/i386/ke.h
2005-06-21 00:23:09 UTC (rev 16198)
@@ -189,8 +189,7 @@
typedef
VOID
-STDCALL
-(*PKSYSTEM_ROUTINE)(PKSTART_ROUTINE StartRoutine,
+(STDCALL*PKSYSTEM_ROUTINE)(PKSTART_ROUTINE StartRoutine,
PVOID StartContext);
VOID
@@ -215,7 +214,7 @@
#define LOCK "lock ; "
#else
#define LOCK ""
-#define KeGetCurrentIrql(X) (((PKPCR)KPCR_BASE)->Irql)
+#define KeGetCurrentIrql() (((PKPCR)KPCR_BASE)->Irql)
#endif
#if defined(__GNUC__)
_____
Modified: branches/rox-u/reactos/ntoskrnl/include/internal/ke.h
--- branches/rox-u/reactos/ntoskrnl/include/internal/ke.h
2005-06-20 22:54:01 UTC (rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/include/internal/ke.h
2005-06-21 00:23:09 UTC (rev 16198)
@@ -224,13 +224,13 @@
/* MACROS
************************************************************************
*/
-#define KeEnterCriticalRegion(X) \
+#define KeEnterCriticalRegion() \
{ \
PKTHREAD _Thread = KeGetCurrentThread(); \
if (_Thread) _Thread->KernelApcDisable--; \
}
-#define KeLeaveCriticalRegion(X) \
+#define KeLeaveCriticalRegion() \
{ \
PKTHREAD _Thread = KeGetCurrentThread(); \
if((_Thread) && (++_Thread->KernelApcDisable == 0)) \
@@ -354,8 +354,8 @@
VOID STDCALL
DbgBreakPointNoBugCheck(VOID);
+VOID
STDCALL
-VOID
KeInitializeProfile(struct _KPROFILE* Profile,
struct _KPROCESS* Process,
PVOID ImageBase,
@@ -364,21 +364,22 @@
KPROFILE_SOURCE ProfileSource,
KAFFINITY Affinity);
+
+VOID
STDCALL
-VOID
KeStartProfile(struct _KPROFILE* Profile,
PVOID Buffer);
+VOID
STDCALL
-VOID
KeStopProfile(struct _KPROFILE* Profile);
+ULONG
STDCALL
-ULONG
KeQueryIntervalProfile(KPROFILE_SOURCE ProfileSource);
+VOID
STDCALL
-VOID
KeSetIntervalProfile(KPROFILE_SOURCE ProfileSource,
ULONG Interval);
_____
Modified: branches/rox-u/reactos/ntoskrnl/include/internal/ntoskrnl.h
--- branches/rox-u/reactos/ntoskrnl/include/internal/ntoskrnl.h
2005-06-20 22:54:01 UTC (rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/include/internal/ntoskrnl.h
2005-06-21 00:23:09 UTC (rev 16198)
@@ -10,10 +10,17 @@
/*
* Use these to place a function in a specific section of the
executable
*/
+#ifdef __GNUC__
#define PLACE_IN_SECTION(s) __attribute__((section (s)))
#define INIT_FUNCTION PLACE_IN_SECTION("init")
#define PAGE_LOCKED_FUNCTION PLACE_IN_SECTION("pagelk")
#define PAGE_UNLOCKED_FUNCTION PLACE_IN_SECTION("pagepo")
+#else /* TODO */ /* ROX-U */
+#define PLACE_IN_SECTION(s)
+#define INIT_FUNCTION
+#define PAGE_LOCKED_FUNCTION
+#define PAGE_UNLOCKED_FUNCTION
+#endif
#include <pshpack1.h>
/*
_____
Modified: branches/rox-u/reactos/ntoskrnl/include/internal/ps.h
--- branches/rox-u/reactos/ntoskrnl/include/internal/ps.h
2005-06-20 22:54:01 UTC (rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/include/internal/ps.h
2005-06-21 00:23:09 UTC (rev 16198)
@@ -160,7 +160,7 @@
ULONG OwnsSessionWorkingSetShared:1;
ULONG ApcNeeded:1;
};
- ULONG SameThreadPassiveFlags; /* 248
*/
+ ULONG SameThreadApcFlags; /* 248
*/
};
UCHAR ForwardClusterOnly; /* 24C
*/
UCHAR DisablePageFaultClustering; /* 24D
*/
_____
Modified: branches/rox-u/reactos/ntoskrnl/include/ntoskrnl.h
--- branches/rox-u/reactos/ntoskrnl/include/ntoskrnl.h 2005-06-20
22:54:01 UTC (rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/include/ntoskrnl.h 2005-06-21
00:23:09 UTC (rev 16198)
@@ -14,7 +14,7 @@
#undef IO_TYPE_FILE
#define IO_TYPE_FILE 0x0F5L /* Temp Hack */
-#include <roscfg.h>
+/*#include <roscfg.h>*/ /* ROX-U */
#include <reactos/version.h>
#include <reactos/resource.h>
#include <reactos/bugcodes.h>
@@ -78,4 +78,18 @@
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) +
((D)<<24))
#endif
+NTSTATUS STDCALL
+CcRosInitializeFileCache (PFILE_OBJECT FileObject,
+ ULONG CacheSegmentSize);
+NTSTATUS STDCALL
+CcRosReleaseFileCache (PFILE_OBJECT FileObject);
+
+#define FSCTL_ROS_QUERY_LCN_MAPPING \
+ CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 63, METHOD_BUFFERED,
FILE_ANY_ACCESS)
+
+typedef struct _ROS_QUERY_LCN_MAPPING
+{
+ LARGE_INTEGER LcnDiskOffset;
+} ROS_QUERY_LCN_MAPPING, *PROS_QUERY_LCN_MAPPING;
+
#endif /* INCLUDE_NTOSKRNL_H */
_____
Modified: branches/rox-u/reactos/ntoskrnl/io/bootlog.c
--- branches/rox-u/reactos/ntoskrnl/io/bootlog.c 2005-06-20
22:54:01 UTC (rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/io/bootlog.c 2005-06-21
00:23:09 UTC (rev 16198)
@@ -311,7 +311,11 @@
return;
}
- Status = IopWriteLogFile(L"ReactOS "KERNEL_VERSION_STR);
+#if 0 /* ROX-U */
+ Status = IopWriteLogFile(L"ReactOS " KERNEL_VERSION_WSTR);
+#else
+ Status = IopWriteLogFile(L"ReactOS");
+#endif
if (!NT_SUCCESS(Status))
{
DPRINT1("IopWriteLogFile() failed (Status %lx)\n", Status);
_____
Modified: branches/rox-u/reactos/ntoskrnl/io/driver.c
--- branches/rox-u/reactos/ntoskrnl/io/driver.c 2005-06-20 22:54:01 UTC
(rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/io/driver.c 2005-06-21 00:23:09 UTC
(rev 16198)
@@ -337,8 +337,8 @@
IopDisplayLoadingMessage(PVOID ServiceName,
BOOLEAN Unicode)
{
+ CHAR TextBuffer[256];
if (SetupMode) return;
- CHAR TextBuffer[256];
if (Unicode)
{
sprintf(TextBuffer, "Loading %S...\n", (PWCHAR)ServiceName);
_____
Modified: branches/rox-u/reactos/ntoskrnl/io/file.c
--- branches/rox-u/reactos/ntoskrnl/io/file.c 2005-06-20 22:54:01 UTC
(rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/io/file.c 2005-06-21 00:23:09 UTC
(rev 16198)
@@ -71,10 +71,10 @@
if (ParentObjectType != IoDeviceObjectType &&
ParentObjectType != IoFileObjectType)
{
- DPRINT("Parent [%wZ] is a %S which is neither a file type nor a
device type ; remaining path = %S\n",
+ /* ROX-U */ /*DPRINT("Parent [%wZ] is a %S which is neither a
file type nor a device type ; remaining path = %S\n",
&BODY_TO_HEADER(Parent)->NameInfo->Name,
BODY_TO_HEADER(Parent)->Type->Name.Buffer,
- RemainingPath);
+ RemainingPath);*/
return(STATUS_UNSUCCESSFUL);
}
@@ -427,7 +427,7 @@
ExFreePool (LocalInfo);
return Status;
}
- DPRINT ("Device path: %wZ\n", &LocalInfo->Name);
+ /*DPRINT ("Device path: %wZ\n", &LocalInfo->Name);*/
/* Write Device Path */
Status = RtlAppendUnicodeStringToString(&ObjectNameInfo->Name,
_____
Modified: branches/rox-u/reactos/ntoskrnl/io/iomgr.c
--- branches/rox-u/reactos/ntoskrnl/io/iomgr.c 2005-06-20 22:54:01 UTC
(rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/io/iomgr.c 2005-06-21 00:23:09 UTC
(rev 16198)
@@ -15,16 +15,16 @@
/* DATA
********************************************************************/
-POBJECT_TYPE EXPORTED IoDeviceObjectType = NULL;
-POBJECT_TYPE EXPORTED IoFileObjectType = NULL;
+POBJECT_TYPE IoDeviceObjectType = NULL;
+POBJECT_TYPE IoFileObjectType = NULL;
extern POBJECT_TYPE IoControllerObjectType;
-ULONG EXPORTED IoReadOperationCount = 0;
-LARGE_INTEGER EXPORTED IoReadTransferCount = {{0, 0}};
-ULONG EXPORTED IoWriteOperationCount = 0;
-LARGE_INTEGER EXPORTED IoWriteTransferCount = {{0, 0}};
-ULONG IoOtherOperationCount = 0;
-LARGE_INTEGER IoOtherTransferCount = {{0, 0}};
-KSPIN_LOCK EXPORTED IoStatisticsLock = 0;
+ULONG IoReadOperationCount = 0;
+LARGE_INTEGER IoReadTransferCount = {{0, 0}};
+ULONG IoWriteOperationCount = 0;
+LARGE_INTEGER IoWriteTransferCount = {{0, 0}};
+ULONG IoOtherOperationCount = 0;
+LARGE_INTEGER IoOtherTransferCount = {{0, 0}};
+KSPIN_LOCK IoStatisticsLock = 0;
GENERIC_MAPPING IopFileMapping = {
FILE_GENERIC_READ,
_____
Modified: branches/rox-u/reactos/ntoskrnl/io/irp.c
--- branches/rox-u/reactos/ntoskrnl/io/irp.c 2005-06-20 22:54:01 UTC
(rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/io/irp.c 2005-06-21 00:23:09 UTC
(rev 16198)
@@ -618,14 +618,6 @@
AccessType = IoReadAccess;
}
- /* Probe and Lock */
- _SEH_FILTER(FreeAndGoOn)
- {
- /* Free the IRP and its MDL */
- IoFreeMdl(Irp->MdlAddress);
- IoFreeIrp(Irp);
- return EXCEPTION_CONTINUE_SEARCH;
- }
_SEH_TRY
{
/* Do the probe */
_____
Modified: branches/rox-u/reactos/ntoskrnl/io/wmi.c
--- branches/rox-u/reactos/ntoskrnl/io/wmi.c 2005-06-20 22:54:01 UTC
(rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/io/wmi.c 2005-06-21 00:23:09 UTC
(rev 16198)
@@ -19,8 +19,8 @@
/*
* @unimplemented
*/
+NTSTATUS
STDCALL
-NTSTATUS
IoWMIRegistrationControl(
IN PDEVICE_OBJECT DeviceObject,
IN ULONG Action
@@ -33,8 +33,8 @@
/*
* @unimplemented
*/
+NTSTATUS
STDCALL
-NTSTATUS
IoWMIAllocateInstanceIds(
IN GUID *Guid,
IN ULONG InstanceCount,
@@ -48,8 +48,8 @@
/*
* @unimplemented
*/
+NTSTATUS
STDCALL
-NTSTATUS
IoWMISuggestInstanceName(
IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL,
IN PUNICODE_STRING SymbolicLinkName OPTIONAL,
@@ -64,8 +64,8 @@
/*
* @unimplemented
*/
+NTSTATUS
STDCALL
-NTSTATUS
IoWMIWriteEvent(
IN PVOID WnodeEventItem
)
@@ -77,8 +77,8 @@
/*
* @unimplemented
*/
-STDCALL
-NTSTATUS IoWMIOpenBlock(
+NTSTATUS
+STDCALL IoWMIOpenBlock(
IN GUID *DataBlockGuid,
IN ULONG DesiredAccess,
OUT PVOID *DataBlockObject
@@ -91,8 +91,8 @@
/*
* @unimplemented
*/
-STDCALL
-NTSTATUS IoWMIQueryAllData(
+NTSTATUS
+STDCALL IoWMIQueryAllData(
IN PVOID DataBlockObject,
IN OUT ULONG *InOutBufferSize,
OUT PVOID OutBuffer
@@ -105,8 +105,8 @@
/*
* @unimplemented
*/
+NTSTATUS
STDCALL
-NTSTATUS
IoWMIQueryAllDataMultiple(
IN PVOID *DataBlockObjectList,
IN ULONG ObjectCount,
@@ -121,8 +121,8 @@
/*
* @unimplemented
*/
+NTSTATUS
STDCALL
-NTSTATUS
IoWMIQuerySingleInstance(
IN PVOID DataBlockObject,
IN PUNICODE_STRING InstanceName,
@@ -137,8 +137,8 @@
/*
* @unimplemented
*/
+NTSTATUS
STDCALL
-NTSTATUS
IoWMIQuerySingleInstanceMultiple(
IN PVOID *DataBlockObjectList,
IN PUNICODE_STRING InstanceNames,
@@ -154,8 +154,8 @@
/*
* @unimplemented
*/
+NTSTATUS
STDCALL
-NTSTATUS
IoWMISetSingleInstance(
IN PVOID DataBlockObject,
IN PUNICODE_STRING InstanceName,
@@ -171,8 +171,8 @@
/*
* @unimplemented
*/
+NTSTATUS
STDCALL
-NTSTATUS
IoWMISetSingleItem(
IN PVOID DataBlockObject,
IN PUNICODE_STRING InstanceName,
@@ -189,8 +189,8 @@
/*
* @unimplemented
*/
+NTSTATUS
STDCALL
-NTSTATUS
IoWMIExecuteMethod(
IN PVOID DataBlockObject,
IN PUNICODE_STRING InstanceName,
@@ -207,8 +207,8 @@
/*
* @unimplemented
*/
+NTSTATUS
STDCALL
-NTSTATUS
IoWMISetNotificationCallback(
IN PVOID Object,
IN WMI_NOTIFICATION_CALLBACK Callback,
@@ -222,8 +222,8 @@
/*
* @unimplemented
*/
+NTSTATUS
STDCALL
-NTSTATUS
IoWMIHandleToInstanceName(
IN PVOID DataBlockObject,
IN HANDLE FileHandle,
@@ -237,8 +237,8 @@
/*
* @unimplemented
*/
+NTSTATUS
STDCALL
-NTSTATUS
IoWMIDeviceObjectToInstanceName(
IN PVOID DataBlockObject,
IN PDEVICE_OBJECT DeviceObject,
_____
Modified: branches/rox-u/reactos/ntoskrnl/ke/ipi.c
--- branches/rox-u/reactos/ntoskrnl/ke/ipi.c 2005-06-20 22:54:01 UTC
(rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/ke/ipi.c 2005-06-21 00:23:09 UTC
(rev 16198)
@@ -89,7 +89,7 @@
#endif
}
}
- ((VOID
STDCALL(*)(PVOID))(Prcb->SignalDone->WorkerRoutine))(Prcb->SignalDone->C
urrentPacket[0]);
+ ((VOID
(STDCALL*)(PVOID))(Prcb->SignalDone->WorkerRoutine))(Prcb->SignalDone->C
urrentPacket[0]);
Ke386TestAndClearBit(KeGetCurrentProcessorNumber(),
&Prcb->SignalDone->TargetSet);
if
(InterlockedCompareExchangeUL(&Prcb->SignalDone->CurrentPacket[2], 0,
0))
{
@@ -116,7 +116,7 @@
VOID
STDCALL
-KiIpiSendPacket(ULONG TargetSet, VOID STDCALL (*WorkerRoutine)(PVOID),
PVOID Argument, ULONG Count, BOOLEAN Synchronize)
+KiIpiSendPacket(ULONG TargetSet, VOID (STDCALL*WorkerRoutine)(PVOID),
PVOID Argument, ULONG Count, BOOLEAN Synchronize)
{
ULONG i, Processor, CurrentProcessor;
PKPRCB Prcb, CurrentPrcb;
_____
Modified: branches/rox-u/reactos/ntoskrnl/ke/kqueue.c
--- branches/rox-u/reactos/ntoskrnl/ke/kqueue.c 2005-06-20 22:54:01 UTC
(rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/ke/kqueue.c 2005-06-21 00:23:09 UTC
(rev 16198)
@@ -245,8 +245,8 @@
/*
* @unimplemented
*/
+PKDEVICE_QUEUE_ENTRY
STDCALL
-PKDEVICE_QUEUE_ENTRY
KeRemoveByKeyDeviceQueueIfBusy(IN PKDEVICE_QUEUE DeviceQueue,
IN ULONG SortKey)
{
_____
Modified: branches/rox-u/reactos/ntoskrnl/ke/main.c
--- branches/rox-u/reactos/ntoskrnl/ke/main.c 2005-06-20 22:54:01 UTC
(rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/ke/main.c 2005-06-21 00:23:09 UTC
(rev 16198)
@@ -82,7 +82,9 @@
}
VOID
+#ifdef __GNUC__
__attribute((noinline))
+#endif
KiSystemStartup(BOOLEAN BootProcessor)
{
DPRINT("KiSystemStartup(%d)\n", BootProcessor);
_____
Modified: branches/rox-u/reactos/ntoskrnl/ke/process.c
--- branches/rox-u/reactos/ntoskrnl/ke/process.c 2005-06-20
22:54:01 UTC (rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/ke/process.c 2005-06-21
00:23:09 UTC (rev 16198)
@@ -203,7 +203,9 @@
{
/* FIXME: Write this in ASM. Much easier */
DPRINT("Switching CR3 to: %x\n",
NewProcess->DirectoryTableBase.u.LowPart);
+#if 0 /* ROX-U */
Ke386SetPageTableDirectory(NewProcess->DirectoryTableBase.u.LowPart);
+#endif
}
/*
_____
Modified: branches/rox-u/reactos/ntoskrnl/ke/profile.c
--- branches/rox-u/reactos/ntoskrnl/ke/profile.c 2005-06-20
22:54:01 UTC (rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/ke/profile.c 2005-06-21
00:23:09 UTC (rev 16198)
@@ -22,8 +22,8 @@
/* FUNCTIONS
*****************************************************************/
+VOID
STDCALL
-VOID
KeInitializeProfile(PKPROFILE Profile,
PKPROCESS Process,
PVOID ImageBase,
@@ -40,14 +40,14 @@
Profile->Process = Process;
Profile->RegionStart = ImageBase;
Profile->BucketShift = BucketSize - 2; /* See
ntinternals.net --
Alex */
- Profile->RegionEnd = (PVOID)(ULONG_PTR)ImageBase + ImageSize;
+ Profile->RegionEnd = (PVOID)((ULONG_PTR)ImageBase + ImageSize);
Profile->Active = FALSE;
Profile->Source = ProfileSource;
Profile->Affinity = Affinity;
}
+VOID
STDCALL
-VOID
KeStartProfile(PKPROFILE Profile,
PVOID Buffer)
{
@@ -133,8 +133,8 @@
if (!FreeBuffer) ExFreePool(SourceBuffer);
}
+VOID
STDCALL
-VOID
KeStopProfile(PKPROFILE Profile)
{
KIRQL OldIrql;
@@ -178,8 +178,8 @@
if (CurrentSource) ExFreePool(CurrentSource);
}
+ULONG
STDCALL
-ULONG
KeQueryIntervalProfile(KPROFILE_SOURCE ProfileSource)
{
/* Check if this is the timer profile */
@@ -200,8 +200,8 @@
}
}
+VOID
STDCALL
-VOID
KeSetIntervalProfile(KPROFILE_SOURCE ProfileSource,
ULONG Interval)
{
@@ -224,8 +224,8 @@
/*
* @implemented
*/
+VOID
STDCALL
-VOID
KeProfileInterrupt(PKTRAP_FRAME TrapFrame)
{
/* Called from HAL for Timer Profiling */
@@ -257,7 +257,7 @@
}
/* Get the Pointer to the Bucket Value representing this EIP */
- BucketValue = (PULONG)(((ULONG_PTR)(Profile->Buffer +
+ BucketValue = (PULONG)((((ULONG_PTR)Profile->Buffer +
(TrapFrame->Eip -
(ULONG_PTR)Profile->RegionStart))
> Profile->BucketShift) &~ 0x3);
@@ -276,8 +276,8 @@
* from the trap frame into the buffer, while using buckets and
* shifting like we specified. -- Alex
*/
+VOID
STDCALL
-VOID
KeProfileInterruptWithSource(IN PKTRAP_FRAME TrapFrame,
IN KPROFILE_SOURCE Source)
{
@@ -291,8 +291,8 @@
/*
* @implemented
*/
+VOID
STDCALL
-VOID
KeSetProfileIrql(IN KIRQL ProfileIrql)
{
/* Set the IRQL at which Profiling will run */
_____
Modified: branches/rox-u/reactos/ntoskrnl/ldr/loader.c
--- branches/rox-u/reactos/ntoskrnl/ldr/loader.c 2005-06-20
22:54:01 UTC (rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/ldr/loader.c 2005-06-21
00:23:09 UTC (rev 16198)
@@ -910,7 +910,7 @@
Protect = PAGE_EXECUTE_READWRITE;
}
#endif
- if (PageAddress < DriverBase + DriverSize)
+ if (PageAddress < RVA(DriverBase, DriverSize))
{
MmSetPageProtect(NULL, PageAddress, Protect);
}
@@ -937,14 +937,14 @@
PageAddress = (PVOID)((ULONG_PTR)PageAddress + PAGE_SIZE);
while ((ULONG_PTR)PageAddress + PAGE_SIZE <
(ULONG_PTR)BaseAddress + Length)
{
- if (PageAddress < DriverBase + DriverSize)
+ if (PageAddress < RVA(DriverBase, DriverSize))
{
MmSetPageProtect(NULL, PageAddress, Protect);
}
PageAddress = (PVOID)((ULONG_PTR)PageAddress + PAGE_SIZE);
}
if (PageAddress < (PVOID)((ULONG_PTR)BaseAddress + Length) &&
- PageAddress < DriverBase + DriverSize)
+ PageAddress < RVA(DriverBase, DriverSize))
{
Protect = LdrLookupPageProtection(PageAddress, DriverBase,
&PENtHeaders->FileHeader, PESectionHeaders);
MmSetPageProtect(NULL, PageAddress, Protect);
@@ -1214,20 +1214,20 @@
Delta = (ULONG_PTR)DriverBase -
NtHeaders->OptionalHeader.ImageBase;
RelocationDir = (PIMAGE_BASE_RELOCATION)((ULONG_PTR)DriverBase +
RelocationDDir->VirtualAddress);
RelocationEnd = (PIMAGE_BASE_RELOCATION)((ULONG_PTR)RelocationDir +
RelocationDDir->Size);
- MaxAddress = DriverBase + DriverSize;
+ MaxAddress = RVA(DriverBase, DriverSize);
while (RelocationDir < RelocationEnd &&
RelocationDir->SizeOfBlock > 0)
{
Count = (RelocationDir->SizeOfBlock -
sizeof(IMAGE_BASE_RELOCATION)) / sizeof(USHORT);
- Address = DriverBase + RelocationDir->VirtualAddress;
+ Address = RVA(DriverBase, RelocationDir->VirtualAddress);
TypeOffset = (PUSHORT)(RelocationDir + 1);
for (i = 0; i < Count; i++)
{
Offset = *TypeOffset & 0xFFF;
Type = *TypeOffset >> 12;
- ShortPtr = (PUSHORT)(Address + Offset);
+ ShortPtr = (PUSHORT)(RVA(Address, Offset));
/* Don't relocate after the end of the loaded driver */
if ((PVOID)ShortPtr >= MaxAddress)
@@ -1277,6 +1277,10 @@
return STATUS_SUCCESS;
}
+#ifndef PATH_MAX
+#define PATH_MAX 260
+#endif
+
static NTSTATUS
LdrPEGetOrLoadModule (
PMODULE_OBJECT Module,
@@ -1552,16 +1556,16 @@
}
/* Get the import address list. */
- ImportAddressList = (PVOID*)(DriverBase +
(ULONG_PTR)ImportModuleDirectory->FirstThunk);
+ ImportAddressList = (PVOID*)RVA(DriverBase,
ImportModuleDirectory->FirstThunk);
/* Get the list of functions to import. */
if (ImportModuleDirectory->OriginalFirstThunk != 0)
{
- FunctionNameList = (PULONG) (DriverBase +
(ULONG_PTR)ImportModuleDirectory->OriginalFirstThunk);
+ FunctionNameList = (PULONG)RVA(DriverBase,
ImportModuleDirectory->OriginalFirstThunk);
}
else
{
- FunctionNameList = (PULONG)(DriverBase +
(ULONG_PTR)ImportModuleDirectory->FirstThunk);
+ FunctionNameList = (PULONG)RVA(DriverBase,
ImportModuleDirectory->FirstThunk);
}
/* Walk through function list and fixup addresses. */
_____
Modified: branches/rox-u/reactos/ntoskrnl/ldr/resource.c
--- branches/rox-u/reactos/ntoskrnl/ldr/resource.c 2005-06-20
22:54:01 UTC (rev 16197)
+++ branches/rox-u/reactos/ntoskrnl/ldr/resource.c 2005-06-21
00:23:09 UTC (rev 16198)
@@ -195,8 +195,8 @@
/*
* @unimplemented
*/
+NTSTATUS
STDCALL
-NTSTATUS
LdrFindResourceDirectory_U(
IN PVOID BaseAddress,
IN PLDR_RESOURCE_INFO ResourceInfo,
@@ -211,8 +211,8 @@
/*
* @unimplemented
*/
[truncated at 1000 lines; 632 more skipped]