Compare commits

...

5 Commits

Author SHA1 Message Date
KJK::Hyperion
98dee81dd1 Fixes for GCC compilation, also fixed w32api definition of LUID
svn path=/branches/rox-u/; revision=16208
2005-06-21 18:44:20 +00:00
KJK::Hyperion
abea25e736 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 */

svn path=/branches/rox-u/; revision=16198
2005-06-21 00:23:09 +00:00
KJK::Hyperion
76431b873b Merge from trunk for a fresh start
svn path=/branches/rox-u/; revision=16184
2005-06-20 21:08:26 +00:00
KJK::Hyperion
c4a1b84860 make SVN merge happy
svn path=/branches/rox-u/; revision=16137
2005-06-20 05:11:48 +00:00
KJK::Hyperion
2091f47a64 Deleting in the hope SVN will merge painlessly
svn path=/branches/rox-u/; revision=16062
2005-06-18 21:10:48 +00:00
261 changed files with 3139 additions and 994 deletions

View File

@@ -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 */

View File

@@ -239,6 +239,7 @@ typedef struct _TEB
PVOID WineDebugInfo; /* Needed for WINE DLL's */ PVOID WineDebugInfo; /* Needed for WINE DLL's */
} TEB, *PTEB; } TEB, *PTEB;
#if 0 /* ROX-U */
#if (!defined(__USE_W32API) || __W32API_MAJOR_VERSION < 2 || __W32API_MINOR_VERSION < 5) #if (!defined(__USE_W32API) || __W32API_MAJOR_VERSION < 2 || __W32API_MINOR_VERSION < 5)
/* FIXME: at least NtCurrentTeb should be defined in winnt.h */ /* FIXME: at least NtCurrentTeb should be defined in winnt.h */
@@ -331,4 +332,6 @@ static inline struct _PEB * NtCurrentPeb(void)
#define NtCurrentPeb() (NtCurrentTeb()->Peb) #define NtCurrentPeb() (NtCurrentTeb()->Peb)
#endif #endif
#endif
#endif /* __INCLUDE_INTERNAL_TEB */ #endif /* __INCLUDE_INTERNAL_TEB */

View File

@@ -1,7 +1,7 @@
#ifndef __NTOSKRNL_INCLUDE_INTERNAL_LDR_H #ifndef __NTOSKRNL_INCLUDE_INTERNAL_LDR_H
#define __NTOSKRNL_INCLUDE_INTERNAL_LDR_H #define __NTOSKRNL_INCLUDE_INTERNAL_LDR_H
#include <roscfg.h> /*#include <roscfg.h>*/
#ifndef _NTNDK_ #ifndef _NTNDK_
#include <napi/teb.h> #include <napi/teb.h>
#endif #endif
@@ -85,7 +85,7 @@ typedef struct _LDR_SYMBOL_INFO {
} LDR_SYMBOL_INFO, *PLDR_SYMBOL_INFO; } 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) #if defined(KDBG) || defined(DBG)

View File

@@ -75,7 +75,6 @@
#include "ntos/registry.h" #include "ntos/registry.h"
#include "ntos/security.h" #include "ntos/security.h"
#include "ntos/synch.h" #include "ntos/synch.h"
#include "ntos/time.h"
#include "napi/i386/segment.h" #include "napi/i386/segment.h"
#include "napi/types.h" #include "napi/types.h"
#include "napi/dbg.h" #include "napi/dbg.h"

View File

@@ -2182,7 +2182,7 @@ RtlQueryInformationAcl (PACL Acl,
ACL_INFORMATION_CLASS InformationClass); ACL_INFORMATION_CLASS InformationClass);
NTSTATUS STDCALL NTSTATUS STDCALL
RtlQueryTimeZoneInformation (IN OUT PTIME_ZONE_INFORMATION TimeZoneInformation); RtlQueryTimeZoneInformation (IN OUT TIME_ZONE_INFORMATION * TimeZoneInformation);
VOID STDCALL VOID STDCALL
RtlRaiseException (IN PEXCEPTION_RECORD ExceptionRecord); RtlRaiseException (IN PEXCEPTION_RECORD ExceptionRecord);
@@ -2375,7 +2375,7 @@ RtlSetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR SecurityDescriptor,
PUCHAR RMControl); PUCHAR RMControl);
NTSTATUS STDCALL NTSTATUS STDCALL
RtlSetTimeZoneInformation (IN OUT PTIME_ZONE_INFORMATION TimeZoneInformation); RtlSetTimeZoneInformation (IN OUT TIME_ZONE_INFORMATION * TimeZoneInformation);
ULONG STDCALL ULONG STDCALL
RtlSizeHeap( RtlSizeHeap(

View File

@@ -136,7 +136,7 @@ ReadCacheSegmentChain(PBCB Bcb, ULONG ReadOffset, ULONG Length,
while (current2 != NULL && !current2->Valid && current_size < MAX_RW_LENGTH) while (current2 != NULL && !current2->Valid && current_size < MAX_RW_LENGTH)
{ {
PVOID address = current2->BaseAddress; 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); *MdlPages++ = MmGetPfnForProcess(NULL, address);
} }

View File

@@ -39,9 +39,8 @@ CcGetDirtyPages (
IN PVOID Context2 IN PVOID Context2
) )
{ {
UNIMPLEMENTED;
LARGE_INTEGER i; LARGE_INTEGER i;
UNIMPLEMENTED;
i.QuadPart = 0; i.QuadPart = 0;
return i; return i;
} }
@@ -69,9 +68,8 @@ CcGetLsnForFileObject (
OUT PLARGE_INTEGER OldestLsn OPTIONAL OUT PLARGE_INTEGER OldestLsn OPTIONAL
) )
{ {
UNIMPLEMENTED;
LARGE_INTEGER i; LARGE_INTEGER i;
UNIMPLEMENTED;
i.QuadPart = 0; i.QuadPart = 0;
return i; return i;
} }

View File

@@ -121,8 +121,8 @@ CmpFindObject(POBJECT_ATTRIBUTES ObjectAttributes,
DPRINT("current %S\n",current); DPRINT("current %S\n",current);
CurrentHeader = BODY_TO_HEADER(CurrentObject); CurrentHeader = BODY_TO_HEADER(CurrentObject);
DPRINT("Current ObjectType %wZ\n", /*DPRINT("Current ObjectType %wZ\n",
&CurrentHeader->Type->TypeName); &CurrentHeader->Type->TypeName);*/ /* ROX-U */
if (CurrentHeader->Type->TypeInfo.ParseProcedure == NULL) if (CurrentHeader->Type->TypeInfo.ParseProcedure == NULL)
{ {

View File

@@ -18,7 +18,7 @@
/* GLOBALS *******************************************************************/ /* GLOBALS *******************************************************************/
POBJECT_TYPE EXPORTED ExEventPairObjectType = NULL; POBJECT_TYPE ExEventPairObjectType = NULL;
static GENERIC_MAPPING ExEventPairMapping = { static GENERIC_MAPPING ExEventPairMapping = {
STANDARD_RIGHTS_READ, STANDARD_RIGHTS_READ,

View File

@@ -496,7 +496,7 @@ ExpInitializeExecutive(VOID)
KeCreateApplicationProcessorIdleThread(KeNumberProcessors); KeCreateApplicationProcessorIdleThread(KeNumberProcessors);
/* Allocate a stack for use when booting the processor */ /* 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 */ /* Tell HAL a new CPU is being started */
HalStartNextProcessor(0, (ULONG)ProcessorStack - 2*sizeof(FX_SAVE_AREA)); HalStartNextProcessor(0, (ULONG)ProcessorStack - 2*sizeof(FX_SAVE_AREA));

View File

@@ -835,6 +835,10 @@ ObpGetNextHandleByProcessCount(PSYSTEM_HANDLE_TABLE_ENTRY_INFO pshi,
/* Class 16 - Handle Information */ /* Class 16 - Handle Information */
QSI_DEF(SystemHandleInformation) QSI_DEF(SystemHandleInformation)
{ {
PEPROCESS pr, syspr;
int curSize, i = 0;
ULONG hCount = 0;
PSYSTEM_HANDLE_INFORMATION Shi = PSYSTEM_HANDLE_INFORMATION Shi =
(PSYSTEM_HANDLE_INFORMATION) Buffer; (PSYSTEM_HANDLE_INFORMATION) Buffer;
@@ -848,10 +852,6 @@ QSI_DEF(SystemHandleInformation)
DPRINT("SystemHandleInformation 1\n"); DPRINT("SystemHandleInformation 1\n");
PEPROCESS pr, syspr;
int curSize, i = 0;
ULONG hCount = 0;
/* First Calc Size from Count. */ /* First Calc Size from Count. */
syspr = PsGetNextProcess(NULL); syspr = PsGetNextProcess(NULL);
pr = syspr; pr = syspr;
@@ -937,6 +937,7 @@ QSI_DEF(SystemObjectInformation)
/* Class 18 - Information */ /* Class 18 - Information */
QSI_DEF(SystemPageFileInformation) QSI_DEF(SystemPageFileInformation)
{ {
UNICODE_STRING FileName; /* FIXME */
SYSTEM_PAGEFILE_INFORMATION *Spfi = (SYSTEM_PAGEFILE_INFORMATION *) Buffer; SYSTEM_PAGEFILE_INFORMATION *Spfi = (SYSTEM_PAGEFILE_INFORMATION *) Buffer;
if (Size < sizeof (SYSTEM_PAGEFILE_INFORMATION)) if (Size < sizeof (SYSTEM_PAGEFILE_INFORMATION))
@@ -945,7 +946,6 @@ QSI_DEF(SystemPageFileInformation)
return (STATUS_INFO_LENGTH_MISMATCH); return (STATUS_INFO_LENGTH_MISMATCH);
} }
UNICODE_STRING FileName; /* FIXME */
RtlInitUnicodeString(&FileName, NULL); /* FIXME */ RtlInitUnicodeString(&FileName, NULL); /* FIXME */
/* FIXME */ /* FIXME */
@@ -1321,7 +1321,7 @@ SSI_DEF(SystemCurrentTimeZoneInformation)
return STATUS_INFO_LENGTH_MISMATCH; return STATUS_INFO_LENGTH_MISMATCH;
} }
return ExpSetTimeZoneInformation((PTIME_ZONE_INFORMATION)Buffer); return ExpSetTimeZoneInformation((TIME_ZONE_INFORMATION *)Buffer);
} }

View File

@@ -76,7 +76,7 @@ ExpInitTimeZoneInfo(VOID)
NTSTATUS NTSTATUS
ExpSetTimeZoneInformation(PTIME_ZONE_INFORMATION TimeZoneInformation) ExpSetTimeZoneInformation(TIME_ZONE_INFORMATION * TimeZoneInformation)
{ {
LARGE_INTEGER LocalTime; LARGE_INTEGER LocalTime;
LARGE_INTEGER SystemTime; LARGE_INTEGER SystemTime;

View File

@@ -149,7 +149,7 @@ static UCHAR LegalAnsiCharacterArray[] =
FSRTL_FAT_LEGAL | FSRTL_HPFS_LEGAL | FSRTL_NTFS_LEGAL /* 0x7f */ FSRTL_FAT_LEGAL | FSRTL_HPFS_LEGAL | FSRTL_NTFS_LEGAL /* 0x7f */
}; };
PUCHAR EXPORTED FsRtlLegalAnsiCharacterArray = LegalAnsiCharacterArray; PUCHAR FsRtlLegalAnsiCharacterArray = LegalAnsiCharacterArray;
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/

View File

@@ -19,7 +19,7 @@
#ifndef __NTOSKRNL_INCLUDE_INTERNAL_ARCH_KE_H #ifndef __NTOSKRNL_INCLUDE_INTERNAL_ARCH_KE_H
#define __NTOSKRNL_INCLUDE_INTERNAL_ARCH_KE_H #define __NTOSKRNL_INCLUDE_INTERNAL_ARCH_KE_H
#ifdef i386 #ifdef _M_IX86
#include "../i386/ke.h" #include "../i386/ke.h"
#else #else
#error "Unknown processor" #error "Unknown processor"

View File

@@ -19,7 +19,7 @@
#ifndef __NTOSKRNL_INCLUDE_INTERNAL_ARCH_MM_H #ifndef __NTOSKRNL_INCLUDE_INTERNAL_ARCH_MM_H
#define __NTOSKRNL_INCLUDE_INTERNAL_ARCH_MM_H #define __NTOSKRNL_INCLUDE_INTERNAL_ARCH_MM_H
#ifdef i386 #ifdef _M_IX86
#include <internal/i386/mm.h> #include <internal/i386/mm.h>
#else #else
#error "Unknown processor" #error "Unknown processor"

View File

@@ -19,7 +19,7 @@
#ifndef __NTOSKRNL_INCLUDE_INTERNAL_ARCH_PS_H #ifndef __NTOSKRNL_INCLUDE_INTERNAL_ARCH_PS_H
#define __NTOSKRNL_INCLUDE_INTERNAL_ARCH_PS_H #define __NTOSKRNL_INCLUDE_INTERNAL_ARCH_PS_H
#ifdef i386 #ifdef _M_IX86
#include <internal/i386/ps.h> #include <internal/i386/ps.h>
#define KiArchContextSwitch KiSwapContext #define KiArchContextSwitch KiSwapContext
#define KiArchInitThreadWithContext Ke386InitThreadWithContext #define KiArchInitThreadWithContext Ke386InitThreadWithContext

View File

@@ -81,8 +81,8 @@
#else /* DBG */ #else /* DBG */
#define CPRINT(args...) /*#define CPRINT(args...)
#define DPRINT1(args...) #define DPRINT1(args...)*/ /* ROX-U */
#ifndef __USE_W32API #ifndef __USE_W32API
#define assert(x) #define assert(x)
#define ASSERT(x) #define ASSERT(x)

View File

@@ -185,7 +185,7 @@ ExfpInterlockedExchange64(LONGLONG volatile * Destination,
PLONGLONG Exchange); PLONGLONG Exchange);
NTSTATUS NTSTATUS
ExpSetTimeZoneInformation(PTIME_ZONE_INFORMATION TimeZoneInformation); ExpSetTimeZoneInformation(TIME_ZONE_INFORMATION * TimeZoneInformation);
NTSTATUS NTSTATUS
ExpAllocateLocallyUniqueId(OUT LUID *LocallyUniqueId); ExpAllocateLocallyUniqueId(OUT LUID *LocallyUniqueId);

View File

@@ -189,8 +189,7 @@ KeCreateApplicationProcessorIdleThread(ULONG Id);
typedef typedef
VOID VOID
STDCALL (STDCALL*PKSYSTEM_ROUTINE)(PKSTART_ROUTINE StartRoutine,
(*PKSYSTEM_ROUTINE)(PKSTART_ROUTINE StartRoutine,
PVOID StartContext); PVOID StartContext);
VOID VOID
@@ -215,7 +214,7 @@ KiThreadStartup(PKSYSTEM_ROUTINE SystemRoutine,
#define LOCK "lock ; " #define LOCK "lock ; "
#else #else
#define LOCK "" #define LOCK ""
#define KeGetCurrentIrql(X) (((PKPCR)KPCR_BASE)->Irql) #define KeGetCurrentIrql() (((PKPCR)KPCR_BASE)->Irql)
#endif #endif
#if defined(__GNUC__) #if defined(__GNUC__)

View File

@@ -224,13 +224,13 @@ struct _KEXCEPTION_FRAME;
/* MACROS *************************************************************************/ /* MACROS *************************************************************************/
#define KeEnterCriticalRegion(X) \ #define KeEnterCriticalRegion() \
{ \ { \
PKTHREAD _Thread = KeGetCurrentThread(); \ PKTHREAD _Thread = KeGetCurrentThread(); \
if (_Thread) _Thread->KernelApcDisable--; \ if (_Thread) _Thread->KernelApcDisable--; \
} }
#define KeLeaveCriticalRegion(X) \ #define KeLeaveCriticalRegion() \
{ \ { \
PKTHREAD _Thread = KeGetCurrentThread(); \ PKTHREAD _Thread = KeGetCurrentThread(); \
if((_Thread) && (++_Thread->KernelApcDisable == 0)) \ if((_Thread) && (++_Thread->KernelApcDisable == 0)) \
@@ -354,8 +354,8 @@ extern PLOADER_MODULE CachedModules[MaximumCachedModuleType];
VOID STDCALL VOID STDCALL
DbgBreakPointNoBugCheck(VOID); DbgBreakPointNoBugCheck(VOID);
STDCALL
VOID VOID
STDCALL
KeInitializeProfile(struct _KPROFILE* Profile, KeInitializeProfile(struct _KPROFILE* Profile,
struct _KPROCESS* Process, struct _KPROCESS* Process,
PVOID ImageBase, PVOID ImageBase,
@@ -364,21 +364,22 @@ KeInitializeProfile(struct _KPROFILE* Profile,
KPROFILE_SOURCE ProfileSource, KPROFILE_SOURCE ProfileSource,
KAFFINITY Affinity); KAFFINITY Affinity);
STDCALL
VOID VOID
STDCALL
KeStartProfile(struct _KPROFILE* Profile, KeStartProfile(struct _KPROFILE* Profile,
PVOID Buffer); PVOID Buffer);
STDCALL
VOID VOID
STDCALL
KeStopProfile(struct _KPROFILE* Profile); KeStopProfile(struct _KPROFILE* Profile);
STDCALL
ULONG ULONG
STDCALL
KeQueryIntervalProfile(KPROFILE_SOURCE ProfileSource); KeQueryIntervalProfile(KPROFILE_SOURCE ProfileSource);
STDCALL
VOID VOID
STDCALL
KeSetIntervalProfile(KPROFILE_SOURCE ProfileSource, KeSetIntervalProfile(KPROFILE_SOURCE ProfileSource,
ULONG Interval); ULONG Interval);

View File

@@ -10,10 +10,17 @@
/* /*
* Use these to place a function in a specific section of the executable * Use these to place a function in a specific section of the executable
*/ */
#ifdef __GNUC__
#define PLACE_IN_SECTION(s) __attribute__((section (s))) #define PLACE_IN_SECTION(s) __attribute__((section (s)))
#define INIT_FUNCTION PLACE_IN_SECTION("init") #define INIT_FUNCTION PLACE_IN_SECTION("init")
#define PAGE_LOCKED_FUNCTION PLACE_IN_SECTION("pagelk") #define PAGE_LOCKED_FUNCTION PLACE_IN_SECTION("pagelk")
#define PAGE_UNLOCKED_FUNCTION PLACE_IN_SECTION("pagepo") #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> #include <pshpack1.h>
/* /*

View File

@@ -160,7 +160,7 @@ typedef struct _ETHREAD
ULONG OwnsSessionWorkingSetShared:1; ULONG OwnsSessionWorkingSetShared:1;
ULONG ApcNeeded:1; ULONG ApcNeeded:1;
}; };
ULONG SameThreadPassiveFlags; /* 248 */ ULONG SameThreadApcFlags; /* 248 */
}; };
UCHAR ForwardClusterOnly; /* 24C */ UCHAR ForwardClusterOnly; /* 24C */
UCHAR DisablePageFaultClustering; /* 24D */ UCHAR DisablePageFaultClustering; /* 24D */

View File

@@ -14,7 +14,7 @@
#undef IO_TYPE_FILE #undef IO_TYPE_FILE
#define IO_TYPE_FILE 0x0F5L /* Temp Hack */ #define IO_TYPE_FILE 0x0F5L /* Temp Hack */
#include <roscfg.h> /*#include <roscfg.h>*/ /* ROX-U */
#include <reactos/version.h> #include <reactos/version.h>
#include <reactos/resource.h> #include <reactos/resource.h>
#include <reactos/bugcodes.h> #include <reactos/bugcodes.h>
@@ -78,4 +78,18 @@
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24)) #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
#endif #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 */ #endif /* INCLUDE_NTOSKRNL_H */

View File

@@ -311,7 +311,11 @@ IopSaveBootLogToFile(VOID)
return; 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)) if (!NT_SUCCESS(Status))
{ {
DPRINT1("IopWriteLogFile() failed (Status %lx)\n", Status); DPRINT1("IopWriteLogFile() failed (Status %lx)\n", Status);

View File

@@ -337,8 +337,8 @@ INIT_FUNCTION
IopDisplayLoadingMessage(PVOID ServiceName, IopDisplayLoadingMessage(PVOID ServiceName,
BOOLEAN Unicode) BOOLEAN Unicode)
{ {
if (SetupMode) return;
CHAR TextBuffer[256]; CHAR TextBuffer[256];
if (SetupMode) return;
if (Unicode) if (Unicode)
{ {
sprintf(TextBuffer, "Loading %S...\n", (PWCHAR)ServiceName); sprintf(TextBuffer, "Loading %S...\n", (PWCHAR)ServiceName);

View File

@@ -71,10 +71,10 @@ IopCreateFile(PVOID ObjectBody,
if (ParentObjectType != IoDeviceObjectType && if (ParentObjectType != IoDeviceObjectType &&
ParentObjectType != IoFileObjectType) 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)->NameInfo->Name,
BODY_TO_HEADER(Parent)->Type->Name.Buffer, BODY_TO_HEADER(Parent)->Type->Name.Buffer,
RemainingPath); RemainingPath);*/
return(STATUS_UNSUCCESSFUL); return(STATUS_UNSUCCESSFUL);
} }
@@ -427,7 +427,7 @@ IopQueryNameFile(PVOID ObjectBody,
ExFreePool (LocalInfo); ExFreePool (LocalInfo);
return Status; return Status;
} }
DPRINT ("Device path: %wZ\n", &LocalInfo->Name); /*DPRINT ("Device path: %wZ\n", &LocalInfo->Name);*/
/* Write Device Path */ /* Write Device Path */
Status = RtlAppendUnicodeStringToString(&ObjectNameInfo->Name, Status = RtlAppendUnicodeStringToString(&ObjectNameInfo->Name,

View File

@@ -15,16 +15,16 @@
/* DATA ********************************************************************/ /* DATA ********************************************************************/
POBJECT_TYPE EXPORTED IoDeviceObjectType = NULL; POBJECT_TYPE IoDeviceObjectType = NULL;
POBJECT_TYPE EXPORTED IoFileObjectType = NULL; POBJECT_TYPE IoFileObjectType = NULL;
extern POBJECT_TYPE IoControllerObjectType; extern POBJECT_TYPE IoControllerObjectType;
ULONG EXPORTED IoReadOperationCount = 0; ULONG IoReadOperationCount = 0;
LARGE_INTEGER EXPORTED IoReadTransferCount = {{0, 0}}; LARGE_INTEGER IoReadTransferCount = {{0, 0}};
ULONG EXPORTED IoWriteOperationCount = 0; ULONG IoWriteOperationCount = 0;
LARGE_INTEGER EXPORTED IoWriteTransferCount = {{0, 0}}; LARGE_INTEGER IoWriteTransferCount = {{0, 0}};
ULONG IoOtherOperationCount = 0; ULONG IoOtherOperationCount = 0;
LARGE_INTEGER IoOtherTransferCount = {{0, 0}}; LARGE_INTEGER IoOtherTransferCount = {{0, 0}};
KSPIN_LOCK EXPORTED IoStatisticsLock = 0; KSPIN_LOCK IoStatisticsLock = 0;
GENERIC_MAPPING IopFileMapping = { GENERIC_MAPPING IopFileMapping = {
FILE_GENERIC_READ, FILE_GENERIC_READ,

View File

@@ -618,14 +618,6 @@ IoBuildAsynchronousFsdRequest(ULONG MajorFunction,
AccessType = IoReadAccess; 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 _SEH_TRY
{ {
/* Do the probe */ /* Do the probe */

View File

@@ -19,8 +19,8 @@
/* /*
* @unimplemented * @unimplemented
*/ */
STDCALL
NTSTATUS NTSTATUS
STDCALL
IoWMIRegistrationControl( IoWMIRegistrationControl(
IN PDEVICE_OBJECT DeviceObject, IN PDEVICE_OBJECT DeviceObject,
IN ULONG Action IN ULONG Action
@@ -33,8 +33,8 @@ IoWMIRegistrationControl(
/* /*
* @unimplemented * @unimplemented
*/ */
STDCALL
NTSTATUS NTSTATUS
STDCALL
IoWMIAllocateInstanceIds( IoWMIAllocateInstanceIds(
IN GUID *Guid, IN GUID *Guid,
IN ULONG InstanceCount, IN ULONG InstanceCount,
@@ -48,8 +48,8 @@ IoWMIAllocateInstanceIds(
/* /*
* @unimplemented * @unimplemented
*/ */
STDCALL
NTSTATUS NTSTATUS
STDCALL
IoWMISuggestInstanceName( IoWMISuggestInstanceName(
IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL, IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL,
IN PUNICODE_STRING SymbolicLinkName OPTIONAL, IN PUNICODE_STRING SymbolicLinkName OPTIONAL,
@@ -64,8 +64,8 @@ IoWMISuggestInstanceName(
/* /*
* @unimplemented * @unimplemented
*/ */
STDCALL
NTSTATUS NTSTATUS
STDCALL
IoWMIWriteEvent( IoWMIWriteEvent(
IN PVOID WnodeEventItem IN PVOID WnodeEventItem
) )
@@ -77,8 +77,8 @@ IoWMIWriteEvent(
/* /*
* @unimplemented * @unimplemented
*/ */
STDCALL NTSTATUS
NTSTATUS IoWMIOpenBlock( STDCALL IoWMIOpenBlock(
IN GUID *DataBlockGuid, IN GUID *DataBlockGuid,
IN ULONG DesiredAccess, IN ULONG DesiredAccess,
OUT PVOID *DataBlockObject OUT PVOID *DataBlockObject
@@ -91,8 +91,8 @@ NTSTATUS IoWMIOpenBlock(
/* /*
* @unimplemented * @unimplemented
*/ */
STDCALL NTSTATUS
NTSTATUS IoWMIQueryAllData( STDCALL IoWMIQueryAllData(
IN PVOID DataBlockObject, IN PVOID DataBlockObject,
IN OUT ULONG *InOutBufferSize, IN OUT ULONG *InOutBufferSize,
OUT PVOID OutBuffer OUT PVOID OutBuffer
@@ -105,8 +105,8 @@ NTSTATUS IoWMIQueryAllData(
/* /*
* @unimplemented * @unimplemented
*/ */
STDCALL
NTSTATUS NTSTATUS
STDCALL
IoWMIQueryAllDataMultiple( IoWMIQueryAllDataMultiple(
IN PVOID *DataBlockObjectList, IN PVOID *DataBlockObjectList,
IN ULONG ObjectCount, IN ULONG ObjectCount,
@@ -121,8 +121,8 @@ IoWMIQueryAllDataMultiple(
/* /*
* @unimplemented * @unimplemented
*/ */
STDCALL
NTSTATUS NTSTATUS
STDCALL
IoWMIQuerySingleInstance( IoWMIQuerySingleInstance(
IN PVOID DataBlockObject, IN PVOID DataBlockObject,
IN PUNICODE_STRING InstanceName, IN PUNICODE_STRING InstanceName,
@@ -137,8 +137,8 @@ IoWMIQuerySingleInstance(
/* /*
* @unimplemented * @unimplemented
*/ */
STDCALL
NTSTATUS NTSTATUS
STDCALL
IoWMIQuerySingleInstanceMultiple( IoWMIQuerySingleInstanceMultiple(
IN PVOID *DataBlockObjectList, IN PVOID *DataBlockObjectList,
IN PUNICODE_STRING InstanceNames, IN PUNICODE_STRING InstanceNames,
@@ -154,8 +154,8 @@ IoWMIQuerySingleInstanceMultiple(
/* /*
* @unimplemented * @unimplemented
*/ */
STDCALL
NTSTATUS NTSTATUS
STDCALL
IoWMISetSingleInstance( IoWMISetSingleInstance(
IN PVOID DataBlockObject, IN PVOID DataBlockObject,
IN PUNICODE_STRING InstanceName, IN PUNICODE_STRING InstanceName,
@@ -171,8 +171,8 @@ IoWMISetSingleInstance(
/* /*
* @unimplemented * @unimplemented
*/ */
STDCALL
NTSTATUS NTSTATUS
STDCALL
IoWMISetSingleItem( IoWMISetSingleItem(
IN PVOID DataBlockObject, IN PVOID DataBlockObject,
IN PUNICODE_STRING InstanceName, IN PUNICODE_STRING InstanceName,
@@ -189,8 +189,8 @@ IoWMISetSingleItem(
/* /*
* @unimplemented * @unimplemented
*/ */
STDCALL
NTSTATUS NTSTATUS
STDCALL
IoWMIExecuteMethod( IoWMIExecuteMethod(
IN PVOID DataBlockObject, IN PVOID DataBlockObject,
IN PUNICODE_STRING InstanceName, IN PUNICODE_STRING InstanceName,
@@ -207,8 +207,8 @@ IoWMIExecuteMethod(
/* /*
* @unimplemented * @unimplemented
*/ */
STDCALL
NTSTATUS NTSTATUS
STDCALL
IoWMISetNotificationCallback( IoWMISetNotificationCallback(
IN PVOID Object, IN PVOID Object,
IN WMI_NOTIFICATION_CALLBACK Callback, IN WMI_NOTIFICATION_CALLBACK Callback,
@@ -222,8 +222,8 @@ IoWMISetNotificationCallback(
/* /*
* @unimplemented * @unimplemented
*/ */
STDCALL
NTSTATUS NTSTATUS
STDCALL
IoWMIHandleToInstanceName( IoWMIHandleToInstanceName(
IN PVOID DataBlockObject, IN PVOID DataBlockObject,
IN HANDLE FileHandle, IN HANDLE FileHandle,
@@ -237,8 +237,8 @@ IoWMIHandleToInstanceName(
/* /*
* @unimplemented * @unimplemented
*/ */
STDCALL
NTSTATUS NTSTATUS
STDCALL
IoWMIDeviceObjectToInstanceName( IoWMIDeviceObjectToInstanceName(
IN PVOID DataBlockObject, IN PVOID DataBlockObject,
IN PDEVICE_OBJECT DeviceObject, IN PDEVICE_OBJECT DeviceObject,

View File

@@ -89,7 +89,7 @@ KiIpiServiceRoutine(IN PKTRAP_FRAME TrapFrame,
#endif #endif
} }
} }
((VOID STDCALL(*)(PVOID))(Prcb->SignalDone->WorkerRoutine))(Prcb->SignalDone->CurrentPacket[0]); ((VOID (STDCALL*)(PVOID))(Prcb->SignalDone->WorkerRoutine))(Prcb->SignalDone->CurrentPacket[0]);
Ke386TestAndClearBit(KeGetCurrentProcessorNumber(), &Prcb->SignalDone->TargetSet); Ke386TestAndClearBit(KeGetCurrentProcessorNumber(), &Prcb->SignalDone->TargetSet);
if (InterlockedCompareExchangeUL(&Prcb->SignalDone->CurrentPacket[2], 0, 0)) if (InterlockedCompareExchangeUL(&Prcb->SignalDone->CurrentPacket[2], 0, 0))
{ {
@@ -116,7 +116,7 @@ KiIpiServiceRoutine(IN PKTRAP_FRAME TrapFrame,
VOID VOID
STDCALL 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; ULONG i, Processor, CurrentProcessor;
PKPRCB Prcb, CurrentPrcb; PKPRCB Prcb, CurrentPrcb;

View File

@@ -245,8 +245,8 @@ KeRemoveByKeyDeviceQueue (IN PKDEVICE_QUEUE DeviceQueue,
/* /*
* @unimplemented * @unimplemented
*/ */
STDCALL
PKDEVICE_QUEUE_ENTRY PKDEVICE_QUEUE_ENTRY
STDCALL
KeRemoveByKeyDeviceQueueIfBusy(IN PKDEVICE_QUEUE DeviceQueue, KeRemoveByKeyDeviceQueueIfBusy(IN PKDEVICE_QUEUE DeviceQueue,
IN ULONG SortKey) IN ULONG SortKey)
{ {

View File

@@ -82,7 +82,9 @@ KeGetRecommendedSharedDataAlignment(VOID)
} }
VOID VOID
#ifdef __GNUC__
__attribute((noinline)) __attribute((noinline))
#endif
KiSystemStartup(BOOLEAN BootProcessor) KiSystemStartup(BOOLEAN BootProcessor)
{ {
DPRINT("KiSystemStartup(%d)\n", BootProcessor); DPRINT("KiSystemStartup(%d)\n", BootProcessor);

View File

@@ -203,7 +203,9 @@ KiSwapProcess(PKPROCESS NewProcess,
{ {
/* FIXME: Write this in ASM. Much easier */ /* FIXME: Write this in ASM. Much easier */
DPRINT("Switching CR3 to: %x\n", NewProcess->DirectoryTableBase.u.LowPart); DPRINT("Switching CR3 to: %x\n", NewProcess->DirectoryTableBase.u.LowPart);
#if 0 /* ROX-U */
Ke386SetPageTableDirectory(NewProcess->DirectoryTableBase.u.LowPart); Ke386SetPageTableDirectory(NewProcess->DirectoryTableBase.u.LowPart);
#endif
} }
/* /*

View File

@@ -22,8 +22,8 @@ ULONG KiProfileTimeInterval = 78125; /* Default resolution 7.8ms (sysinternals)
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
STDCALL
VOID VOID
STDCALL
KeInitializeProfile(PKPROFILE Profile, KeInitializeProfile(PKPROFILE Profile,
PKPROCESS Process, PKPROCESS Process,
PVOID ImageBase, PVOID ImageBase,
@@ -40,14 +40,14 @@ KeInitializeProfile(PKPROFILE Profile,
Profile->Process = Process; Profile->Process = Process;
Profile->RegionStart = ImageBase; Profile->RegionStart = ImageBase;
Profile->BucketShift = BucketSize - 2; /* See ntinternals.net -- Alex */ 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->Active = FALSE;
Profile->Source = ProfileSource; Profile->Source = ProfileSource;
Profile->Affinity = Affinity; Profile->Affinity = Affinity;
} }
STDCALL
VOID VOID
STDCALL
KeStartProfile(PKPROFILE Profile, KeStartProfile(PKPROFILE Profile,
PVOID Buffer) PVOID Buffer)
{ {
@@ -133,8 +133,8 @@ KeStartProfile(PKPROFILE Profile,
if (!FreeBuffer) ExFreePool(SourceBuffer); if (!FreeBuffer) ExFreePool(SourceBuffer);
} }
STDCALL
VOID VOID
STDCALL
KeStopProfile(PKPROFILE Profile) KeStopProfile(PKPROFILE Profile)
{ {
KIRQL OldIrql; KIRQL OldIrql;
@@ -178,8 +178,8 @@ KeStopProfile(PKPROFILE Profile)
if (CurrentSource) ExFreePool(CurrentSource); if (CurrentSource) ExFreePool(CurrentSource);
} }
STDCALL
ULONG ULONG
STDCALL
KeQueryIntervalProfile(KPROFILE_SOURCE ProfileSource) KeQueryIntervalProfile(KPROFILE_SOURCE ProfileSource)
{ {
/* Check if this is the timer profile */ /* Check if this is the timer profile */
@@ -200,8 +200,8 @@ KeQueryIntervalProfile(KPROFILE_SOURCE ProfileSource)
} }
} }
STDCALL
VOID VOID
STDCALL
KeSetIntervalProfile(KPROFILE_SOURCE ProfileSource, KeSetIntervalProfile(KPROFILE_SOURCE ProfileSource,
ULONG Interval) ULONG Interval)
{ {
@@ -224,8 +224,8 @@ KeSetIntervalProfile(KPROFILE_SOURCE ProfileSource,
/* /*
* @implemented * @implemented
*/ */
STDCALL
VOID VOID
STDCALL
KeProfileInterrupt(PKTRAP_FRAME TrapFrame) KeProfileInterrupt(PKTRAP_FRAME TrapFrame)
{ {
/* Called from HAL for Timer Profiling */ /* Called from HAL for Timer Profiling */
@@ -257,7 +257,7 @@ KiParseProfileList(IN PKTRAP_FRAME TrapFrame,
} }
/* Get the Pointer to the Bucket Value representing this EIP */ /* 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)) (TrapFrame->Eip - (ULONG_PTR)Profile->RegionStart))
>> Profile->BucketShift) &~ 0x3); >> Profile->BucketShift) &~ 0x3);
@@ -276,8 +276,8 @@ KiParseProfileList(IN PKTRAP_FRAME TrapFrame,
* from the trap frame into the buffer, while using buckets and * from the trap frame into the buffer, while using buckets and
* shifting like we specified. -- Alex * shifting like we specified. -- Alex
*/ */
STDCALL
VOID VOID
STDCALL
KeProfileInterruptWithSource(IN PKTRAP_FRAME TrapFrame, KeProfileInterruptWithSource(IN PKTRAP_FRAME TrapFrame,
IN KPROFILE_SOURCE Source) IN KPROFILE_SOURCE Source)
{ {
@@ -291,8 +291,8 @@ KeProfileInterruptWithSource(IN PKTRAP_FRAME TrapFrame,
/* /*
* @implemented * @implemented
*/ */
STDCALL
VOID VOID
STDCALL
KeSetProfileIrql(IN KIRQL ProfileIrql) KeSetProfileIrql(IN KIRQL ProfileIrql)
{ {
/* Set the IRQL at which Profiling will run */ /* Set the IRQL at which Profiling will run */

View File

@@ -910,7 +910,7 @@ LdrPEProcessModule(
Protect = PAGE_EXECUTE_READWRITE; Protect = PAGE_EXECUTE_READWRITE;
} }
#endif #endif
if (PageAddress < DriverBase + DriverSize) if (PageAddress < RVA(DriverBase, DriverSize))
{ {
MmSetPageProtect(NULL, PageAddress, Protect); MmSetPageProtect(NULL, PageAddress, Protect);
} }
@@ -937,14 +937,14 @@ LdrPEProcessModule(
PageAddress = (PVOID)((ULONG_PTR)PageAddress + PAGE_SIZE); PageAddress = (PVOID)((ULONG_PTR)PageAddress + PAGE_SIZE);
while ((ULONG_PTR)PageAddress + PAGE_SIZE < (ULONG_PTR)BaseAddress + Length) while ((ULONG_PTR)PageAddress + PAGE_SIZE < (ULONG_PTR)BaseAddress + Length)
{ {
if (PageAddress < DriverBase + DriverSize) if (PageAddress < RVA(DriverBase, DriverSize))
{ {
MmSetPageProtect(NULL, PageAddress, Protect); MmSetPageProtect(NULL, PageAddress, Protect);
} }
PageAddress = (PVOID)((ULONG_PTR)PageAddress + PAGE_SIZE); PageAddress = (PVOID)((ULONG_PTR)PageAddress + PAGE_SIZE);
} }
if (PageAddress < (PVOID)((ULONG_PTR)BaseAddress + Length) && if (PageAddress < (PVOID)((ULONG_PTR)BaseAddress + Length) &&
PageAddress < DriverBase + DriverSize) PageAddress < RVA(DriverBase, DriverSize))
{ {
Protect = LdrLookupPageProtection(PageAddress, DriverBase, &PENtHeaders->FileHeader, PESectionHeaders); Protect = LdrLookupPageProtection(PageAddress, DriverBase, &PENtHeaders->FileHeader, PESectionHeaders);
MmSetPageProtect(NULL, PageAddress, Protect); MmSetPageProtect(NULL, PageAddress, Protect);
@@ -1214,20 +1214,20 @@ LdrPEPerformRelocations (
Delta = (ULONG_PTR)DriverBase - NtHeaders->OptionalHeader.ImageBase; Delta = (ULONG_PTR)DriverBase - NtHeaders->OptionalHeader.ImageBase;
RelocationDir = (PIMAGE_BASE_RELOCATION)((ULONG_PTR)DriverBase + RelocationDDir->VirtualAddress); RelocationDir = (PIMAGE_BASE_RELOCATION)((ULONG_PTR)DriverBase + RelocationDDir->VirtualAddress);
RelocationEnd = (PIMAGE_BASE_RELOCATION)((ULONG_PTR)RelocationDir + RelocationDDir->Size); RelocationEnd = (PIMAGE_BASE_RELOCATION)((ULONG_PTR)RelocationDir + RelocationDDir->Size);
MaxAddress = DriverBase + DriverSize; MaxAddress = RVA(DriverBase, DriverSize);
while (RelocationDir < RelocationEnd && while (RelocationDir < RelocationEnd &&
RelocationDir->SizeOfBlock > 0) RelocationDir->SizeOfBlock > 0)
{ {
Count = (RelocationDir->SizeOfBlock - sizeof(IMAGE_BASE_RELOCATION)) / sizeof(USHORT); Count = (RelocationDir->SizeOfBlock - sizeof(IMAGE_BASE_RELOCATION)) / sizeof(USHORT);
Address = DriverBase + RelocationDir->VirtualAddress; Address = RVA(DriverBase, RelocationDir->VirtualAddress);
TypeOffset = (PUSHORT)(RelocationDir + 1); TypeOffset = (PUSHORT)(RelocationDir + 1);
for (i = 0; i < Count; i++) for (i = 0; i < Count; i++)
{ {
Offset = *TypeOffset & 0xFFF; Offset = *TypeOffset & 0xFFF;
Type = *TypeOffset >> 12; Type = *TypeOffset >> 12;
ShortPtr = (PUSHORT)(Address + Offset); ShortPtr = (PUSHORT)(RVA(Address, Offset));
/* Don't relocate after the end of the loaded driver */ /* Don't relocate after the end of the loaded driver */
if ((PVOID)ShortPtr >= MaxAddress) if ((PVOID)ShortPtr >= MaxAddress)
@@ -1277,6 +1277,10 @@ LdrPEPerformRelocations (
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
#ifndef PATH_MAX
#define PATH_MAX 260
#endif
static NTSTATUS static NTSTATUS
LdrPEGetOrLoadModule ( LdrPEGetOrLoadModule (
PMODULE_OBJECT Module, PMODULE_OBJECT Module,
@@ -1552,16 +1556,16 @@ LdrPEProcessImportDirectoryEntry(
} }
/* Get the import address list. */ /* 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. */ /* Get the list of functions to import. */
if (ImportModuleDirectory->OriginalFirstThunk != 0) if (ImportModuleDirectory->OriginalFirstThunk != 0)
{ {
FunctionNameList = (PULONG) (DriverBase + (ULONG_PTR)ImportModuleDirectory->OriginalFirstThunk); FunctionNameList = (PULONG)RVA(DriverBase, ImportModuleDirectory->OriginalFirstThunk);
} }
else else
{ {
FunctionNameList = (PULONG)(DriverBase + (ULONG_PTR)ImportModuleDirectory->FirstThunk); FunctionNameList = (PULONG)RVA(DriverBase, ImportModuleDirectory->FirstThunk);
} }
/* Walk through function list and fixup addresses. */ /* Walk through function list and fixup addresses. */

View File

@@ -195,8 +195,8 @@ found:;
/* /*
* @unimplemented * @unimplemented
*/ */
STDCALL
NTSTATUS NTSTATUS
STDCALL
LdrFindResourceDirectory_U( LdrFindResourceDirectory_U(
IN PVOID BaseAddress, IN PVOID BaseAddress,
IN PLDR_RESOURCE_INFO ResourceInfo, IN PLDR_RESOURCE_INFO ResourceInfo,
@@ -211,8 +211,8 @@ LdrFindResourceDirectory_U(
/* /*
* @unimplemented * @unimplemented
*/ */
STDCALL
NTSTATUS NTSTATUS
STDCALL
LdrEnumResources( LdrEnumResources(
IN PVOID BaseAddress, IN PVOID BaseAddress,
IN PLDR_RESOURCE_INFO ResourceInfo, IN PLDR_RESOURCE_INFO ResourceInfo,

View File

@@ -17,8 +17,6 @@
/* FUNCTIONS ****************************************************************/ /* FUNCTIONS ****************************************************************/
#define RVA(m, b) ((ULONG)b + m)
NTSTATUS STDCALL NTSTATUS STDCALL
LdrGetProcedureAddress (IN PVOID BaseAddress, LdrGetProcedureAddress (IN PVOID BaseAddress,
IN PANSI_STRING Name, IN PANSI_STRING Name,

View File

@@ -145,7 +145,7 @@ MmUnmapIoSpace (IN PVOID BaseAddress,
PVOID Address = BaseAddress; PVOID Address = BaseAddress;
Offset = (ULONG_PTR)Address % PAGE_SIZE; Offset = (ULONG_PTR)Address % PAGE_SIZE;
Address -= Offset; Address = RVA(Address, - Offset);
NumberOfBytes += Offset; NumberOfBytes += Offset;
MmLockAddressSpace(MmGetKernelAddressSpace()); MmLockAddressSpace(MmGetKernelAddressSpace());

View File

@@ -28,8 +28,8 @@ MiCreatePebOrTeb(PEPROCESS Process,
PMADDRESS_SPACE ProcessAddressSpace = &Process->AddressSpace; PMADDRESS_SPACE ProcessAddressSpace = &Process->AddressSpace;
PMEMORY_AREA MemoryArea; PMEMORY_AREA MemoryArea;
PHYSICAL_ADDRESS BoundaryAddressMultiple; PHYSICAL_ADDRESS BoundaryAddressMultiple;
BoundaryAddressMultiple.QuadPart = 0;
PVOID AllocatedBase = BaseAddress; PVOID AllocatedBase = BaseAddress;
BoundaryAddressMultiple.QuadPart = 0;
/* Acquire the Lock */ /* Acquire the Lock */
MmLockAddressSpace(ProcessAddressSpace); MmLockAddressSpace(ProcessAddressSpace);
@@ -54,7 +54,7 @@ MiCreatePebOrTeb(PEPROCESS Process,
TRUE, TRUE,
FALSE, FALSE,
BoundaryAddressMultiple); BoundaryAddressMultiple);
AllocatedBase = AllocatedBase - PAGE_SIZE; AllocatedBase = RVA(AllocatedBase, -PAGE_SIZE);
} while (Status != STATUS_SUCCESS); } while (Status != STATUS_SUCCESS);
/* Initialize the Region */ /* Initialize the Region */
@@ -69,7 +69,7 @@ MiCreatePebOrTeb(PEPROCESS Process,
/* Unlock Address Space */ /* Unlock Address Space */
DPRINT("Returning\n"); DPRINT("Returning\n");
MmUnlockAddressSpace(ProcessAddressSpace); MmUnlockAddressSpace(ProcessAddressSpace);
return AllocatedBase + PAGE_SIZE; return RVA(AllocatedBase, PAGE_SIZE);
} }
VOID VOID
@@ -345,9 +345,9 @@ MmCreateProcessAddressSpace(IN PEPROCESS Process,
PVOID BaseAddress; PVOID BaseAddress;
PMEMORY_AREA MemoryArea; PMEMORY_AREA MemoryArea;
PHYSICAL_ADDRESS BoundaryAddressMultiple; PHYSICAL_ADDRESS BoundaryAddressMultiple;
BoundaryAddressMultiple.QuadPart = 0;
ULONG ViewSize = 0; ULONG ViewSize = 0;
PVOID ImageBase = 0; PVOID ImageBase = 0;
BoundaryAddressMultiple.QuadPart = 0;
/* Initialize the Addresss Space */ /* Initialize the Addresss Space */
MmInitializeAddressSpace(Process, ProcessAddressSpace); MmInitializeAddressSpace(Process, ProcessAddressSpace);

View File

@@ -1952,7 +1952,7 @@ MmQuerySectionView(PMEMORY_AREA MemoryArea,
if (Section->AllocationAttributes & SEC_IMAGE) if (Section->AllocationAttributes & SEC_IMAGE)
{ {
Segment = MemoryArea->Data.SectionData.Segment; Segment = MemoryArea->Data.SectionData.Segment;
Info->AllocationBase = MemoryArea->StartingAddress - Segment->VirtualAddress; Info->AllocationBase = (PBYTE)MemoryArea->StartingAddress - Segment->VirtualAddress;
Info->Type = MEM_IMAGE; Info->Type = MEM_IMAGE;
} }
else else

View File

@@ -60,8 +60,8 @@ static VOID
ObpDecrementHandleCount(PVOID ObjectBody) ObpDecrementHandleCount(PVOID ObjectBody)
{ {
POBJECT_HEADER ObjectHeader = BODY_TO_HEADER(ObjectBody); POBJECT_HEADER ObjectHeader = BODY_TO_HEADER(ObjectBody);
DPRINT("Header: %x\n", ObjectHeader);
LONG NewHandleCount = InterlockedDecrement(&ObjectHeader->HandleCount); LONG NewHandleCount = InterlockedDecrement(&ObjectHeader->HandleCount);
DPRINT("Header: %x\n", ObjectHeader);
DPRINT("NewHandleCount: %x\n", NewHandleCount); DPRINT("NewHandleCount: %x\n", NewHandleCount);
DPRINT("HEADER_TO_OBJECT_NAME: %x\n", HEADER_TO_OBJECT_NAME(ObjectHeader)); DPRINT("HEADER_TO_OBJECT_NAME: %x\n", HEADER_TO_OBJECT_NAME(ObjectHeader));
@@ -833,7 +833,7 @@ ObReferenceObjectByHandle(HANDLE Handle,
if (ObjectType != NULL && ObjectType != ObjectHeader->Type) if (ObjectType != NULL && ObjectType != ObjectHeader->Type)
{ {
DPRINT("ObjectType mismatch: %wZ vs %wZ (handle 0x%x)\n", &ObjectType->TypeName, ObjectHeader->Type ? &ObjectHeader->Type->TypeName : NULL, Handle); /* ROX-U */ /*DPRINT("ObjectType mismatch: %wZ vs %wZ (handle 0x%x)\n", &ObjectType->TypeName, ObjectHeader->Type ? &ObjectHeader->Type->TypeName : NULL, Handle);*/
ExUnlockHandleTableEntry(HandleTable, ExUnlockHandleTableEntry(HandleTable,
HandleEntry); HandleEntry);
@@ -1008,14 +1008,14 @@ ObInsertObject(IN PVOID Object,
if (FoundHeader && FoundHeader->Type == ObDirectoryType && if (FoundHeader && FoundHeader->Type == ObDirectoryType &&
RemainingPath.Buffer) RemainingPath.Buffer)
{ {
ObpAddEntryDirectory(FoundObject, Header, NULL);
ObjectAttached = TRUE;
/* The name was changed so let's update it */ /* The name was changed so let's update it */
/* FIXME: TEMPORARY HACK This will go in ObFindObject in the next commit */ /* FIXME: TEMPORARY HACK This will go in ObFindObject in the next commit */
PVOID NewName; PVOID NewName;
PWSTR BufferPos = RemainingPath.Buffer; PWSTR BufferPos = RemainingPath.Buffer;
ULONG Delta = 0; ULONG Delta = 0;
ObpAddEntryDirectory(FoundObject, Header, NULL);
ObjectAttached = TRUE;
ObjectNameInfo = HEADER_TO_OBJECT_NAME(Header); ObjectNameInfo = HEADER_TO_OBJECT_NAME(Header);
@@ -1141,8 +1141,8 @@ ObInsertObject(IN PVOID Object,
DesiredAccess, DesiredAccess,
ObjectCreateInfo->Attributes & OBJ_INHERIT, ObjectCreateInfo->Attributes & OBJ_INHERIT,
Handle); Handle);
DPRINT("handle Created: %d. refcount. handlecount %d %d\n", /* ROX-U */ /*DPRINT("handle Created: %d. refcount. handlecount %d %d\n",
*Handle, Header->RefCount, Header->HandleCount); *Handle, Header->RefCount, Header->HandleCount);*/
} }
/* We can delete the Create Info now */ /* We can delete the Create Info now */

View File

@@ -860,12 +860,12 @@ ObReferenceObjectByPointer(IN PVOID Object,
if (ObjectType != NULL && Header->Type != ObjectType) if (ObjectType != NULL && Header->Type != ObjectType)
{ {
DPRINT("Failed %p (type was %x %wZ) should be %x %wZ\n", /* ROX-U */ /*DPRINT("Failed %p (type was %x %wZ) should be %x %wZ\n",
Header, Header,
Header->Type, Header->Type,
&BODY_TO_HEADER(Header->Type)->NameInfo, &BODY_TO_HEADER(Header->Type)->NameInfo,
ObjectType, ObjectType,
&BODY_TO_HEADER(ObjectType)->NameInfo); &BODY_TO_HEADER(ObjectType)->NameInfo);*/
return(STATUS_UNSUCCESSFUL); return(STATUS_UNSUCCESSFUL);
} }
if (Header->Type == PsProcessType) if (Header->Type == PsProcessType)

View File

@@ -24,8 +24,8 @@ extern FAST_MUTEX PspActiveProcessMutex;
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
STDCALL
VOID VOID
STDCALL
PspReapRoutine(PVOID Context) PspReapRoutine(PVOID Context)
{ {
KIRQL OldIrql; KIRQL OldIrql;

View File

@@ -173,8 +173,7 @@ PsInitProcessManagment(VOID)
ProcessObject, ProcessObject,
sizeof(EPROCESS), sizeof(EPROCESS),
FALSE); FALSE);
PsIdleProcess->Pcb.DirectoryTableBase = PsIdleProcess->Pcb.DirectoryTableBase.QuadPart = (ULONG_PTR)MmGetPageDirectory();
(LARGE_INTEGER)(LONGLONG)(ULONG)MmGetPageDirectory();
strcpy(PsIdleProcess->ImageFileName, "Idle"); strcpy(PsIdleProcess->ImageFileName, "Idle");
/* /*
@@ -234,6 +233,7 @@ PsInitProcessManagment(VOID)
InitializeListHead(&PsInitialSystemProcess->ThreadListHead); InitializeListHead(&PsInitialSystemProcess->ThreadListHead);
#ifndef SCHED_REWRITE #ifndef SCHED_REWRITE
{
PTOKEN BootToken; PTOKEN BootToken;
/* No parent, this is the Initial System Process. Assign Boot Token */ /* No parent, this is the Initial System Process. Assign Boot Token */
@@ -241,6 +241,7 @@ PsInitProcessManagment(VOID)
BootToken->TokenInUse = TRUE; BootToken->TokenInUse = TRUE;
PsInitialSystemProcess->Token.Object = BootToken; /* FIXME */ PsInitialSystemProcess->Token.Object = BootToken; /* FIXME */
ObReferenceObject(BootToken); ObReferenceObject(BootToken);
}
#endif #endif
} }

View File

@@ -15,8 +15,8 @@
/* GLOBALS ******************************************************************/ /* GLOBALS ******************************************************************/
PACL EXPORTED SePublicDefaultDacl = NULL; PACL SePublicDefaultDacl = NULL;
PACL EXPORTED SeSystemDefaultDacl = NULL; PACL SeSystemDefaultDacl = NULL;
PACL SePublicDefaultUnrestrictedDacl = NULL; PACL SePublicDefaultUnrestrictedDacl = NULL;
PACL SePublicOpenDacl = NULL; PACL SePublicOpenDacl = NULL;

View File

@@ -39,7 +39,7 @@ ExpAllocateLocallyUniqueId(OUT LUID *LocallyUniqueId)
/* atomically increment the luid */ /* atomically increment the luid */
do do
{ {
PrevLuid = (volatile LARGE_INTEGER)LuidValue; PrevLuid = LuidValue;
NewLuid = RtlLargeIntegerAdd(PrevLuid, NewLuid = RtlLargeIntegerAdd(PrevLuid,
LuidIncrement); LuidIncrement);
} while(ExfInterlockedCompareExchange64(&LuidValue.QuadPart, } while(ExfInterlockedCompareExchange64(&LuidValue.QuadPart,

View File

@@ -16,7 +16,7 @@
/* GLOBALS ******************************************************************/ /* GLOBALS ******************************************************************/
PSE_EXPORTS EXPORTED SeExports = NULL; PSE_EXPORTS SeExports = NULL;
SE_EXPORTS SepExports; SE_EXPORTS SepExports;
static ERESOURCE SepSubjectContextLock; static ERESOURCE SepSubjectContextLock;

View File

@@ -1820,18 +1820,19 @@ SepCreateSystemProcessToken(VOID)
NTSTATUS Status; NTSTATUS Status;
ULONG uSize; ULONG uSize;
ULONG i; ULONG i;
ULONG uLocalSystemLength;
ULONG uWorldLength;
ULONG uAuthUserLength;
ULONG uAdminsLength;
PTOKEN AccessToken;
PVOID SidArea;
PAGED_CODE(); PAGED_CODE();
ULONG uLocalSystemLength = RtlLengthSid(SeLocalSystemSid); uLocalSystemLength = RtlLengthSid(SeLocalSystemSid);
ULONG uWorldLength = RtlLengthSid(SeWorldSid); uWorldLength = RtlLengthSid(SeWorldSid);
ULONG uAuthUserLength = RtlLengthSid(SeAuthenticatedUserSid); uAuthUserLength = RtlLengthSid(SeAuthenticatedUserSid);
ULONG uAdminsLength = RtlLengthSid(SeAliasAdminsSid); uAdminsLength = RtlLengthSid(SeAliasAdminsSid);
PTOKEN AccessToken;
PVOID SidArea;
/* /*
* Initialize the token * Initialize the token
*/ */

View File

@@ -183,12 +183,12 @@ typedef struct _BATTERY_WAIT_STATUS {
CTL_CODE(FILE_DEVICE_BATTERY, 0x13, METHOD_BUFFERED, FILE_READ_ACCESS) CTL_CODE(FILE_DEVICE_BATTERY, 0x13, METHOD_BUFFERED, FILE_READ_ACCESS)
typedef NTSTATUS DDKAPI typedef NTSTATUS
(*BCLASS_DISABLE_STATUS_NOTIFY)( (DDKAPI*BCLASS_DISABLE_STATUS_NOTIFY)(
IN PVOID Context); IN PVOID Context);
typedef NTSTATUS DDKAPI typedef NTSTATUS
(*BCLASS_QUERY_INFORMATION)( (DDKAPI*BCLASS_QUERY_INFORMATION)(
IN PVOID Context, IN PVOID Context,
IN ULONG BatteryTag, IN ULONG BatteryTag,
IN BATTERY_QUERY_INFORMATION_LEVEL Level, IN BATTERY_QUERY_INFORMATION_LEVEL Level,
@@ -197,26 +197,26 @@ typedef NTSTATUS DDKAPI
IN ULONG BufferLength, IN ULONG BufferLength,
OUT PULONG ReturnedLength); OUT PULONG ReturnedLength);
typedef NTSTATUS DDKAPI typedef NTSTATUS
(*BCLASS_QUERY_STATUS)( (DDKAPI*BCLASS_QUERY_STATUS)(
IN PVOID Context, IN PVOID Context,
IN ULONG BatteryTag, IN ULONG BatteryTag,
OUT PBATTERY_STATUS BatteryStatus); OUT PBATTERY_STATUS BatteryStatus);
typedef NTSTATUS DDKAPI typedef NTSTATUS
(*BCLASS_QUERY_TAG)( (DDKAPI*BCLASS_QUERY_TAG)(
IN PVOID Context, IN PVOID Context,
OUT PULONG BatteryTag); OUT PULONG BatteryTag);
typedef NTSTATUS DDKAPI typedef NTSTATUS
(*BCLASS_SET_INFORMATION)( (DDKAPI*BCLASS_SET_INFORMATION)(
IN PVOID Context, IN PVOID Context,
IN ULONG BatteryTag, IN ULONG BatteryTag,
IN BATTERY_SET_INFORMATION_LEVEL Level, IN BATTERY_SET_INFORMATION_LEVEL Level,
IN PVOID Buffer OPTIONAL); IN PVOID Buffer OPTIONAL);
typedef NTSTATUS DDKAPI typedef NTSTATUS
(*BCLASS_SET_STATUS_NOTIFY)( (DDKAPI*BCLASS_SET_STATUS_NOTIFY)(
IN PVOID Context, IN PVOID Context,
IN ULONG BatteryTag, IN ULONG BatteryTag,
IN PBATTERY_NOTIFY BatteryNotify); IN PBATTERY_NOTIFY BatteryNotify);

View File

@@ -50,11 +50,11 @@ typedef CONST char *PCSZ;
#endif #endif
#ifndef DECL_IMPORT #ifndef DECL_IMPORT
#define DECL_IMPORT __attribute__((dllimport)) #define DECL_IMPORT __declspec(dllimport)
#endif #endif
#ifndef DECL_EXPORT #ifndef DECL_EXPORT
#define DECL_EXPORT __attribute__((dllexport)) #define DECL_EXPORT __declspec(dllexport)
#endif #endif
/* Windows NT status codes */ /* Windows NT status codes */

View File

@@ -585,7 +585,7 @@ typedef struct _KAPC_STATE {
BOOLEAN KernelApcInProgress; BOOLEAN KernelApcInProgress;
BOOLEAN KernelApcPending; BOOLEAN KernelApcPending;
BOOLEAN UserApcPending; BOOLEAN UserApcPending;
} KAPC_STATE, *PKAPC_STATE, *__restrict PRKAPC_STATE; } KAPC_STATE, *PKAPC_STATE, *RESTRICTED_POINTER PRKAPC_STATE;
#if (VER_PRODUCTBUILD >= 2600) #if (VER_PRODUCTBUILD >= 2600)
@@ -2291,15 +2291,15 @@ FsRtlCheckLockForWriteAccess (
); );
typedef typedef
VOID NTAPI VOID
(*POPLOCK_WAIT_COMPLETE_ROUTINE) ( (NTAPI*POPLOCK_WAIT_COMPLETE_ROUTINE) (
IN PVOID Context, IN PVOID Context,
IN PIRP Irp IN PIRP Irp
); );
typedef typedef
VOID NTAPI VOID
(*POPLOCK_FS_PREPOST_IRP) ( (NTAPI*POPLOCK_FS_PREPOST_IRP) (
IN PVOID Context, IN PVOID Context,
IN PIRP Irp IN PIRP Irp
); );

View File

@@ -43,8 +43,8 @@ typedef struct _PROCESSOR_IDLE_TIMES {
ULONG IdleHandlerReserved[4]; ULONG IdleHandlerReserved[4];
} PROCESSOR_IDLE_TIMES, *PPROCESSOR_IDLE_TIMES; } PROCESSOR_IDLE_TIMES, *PPROCESSOR_IDLE_TIMES;
typedef BOOLEAN DDKFASTAPI typedef BOOLEAN
(*PPROCESSOR_IDLE_HANDLER)( (DDKFASTAPI*PPROCESSOR_IDLE_HANDLER)(
IN OUT PPROCESSOR_IDLE_TIMES IdleTimes); IN OUT PPROCESSOR_IDLE_TIMES IdleTimes);
typedef struct _PROCESSOR_IDLE_HANDLER_INFO { typedef struct _PROCESSOR_IDLE_HANDLER_INFO {
@@ -52,12 +52,12 @@ typedef struct _PROCESSOR_IDLE_HANDLER_INFO {
PPROCESSOR_IDLE_HANDLER Handler; PPROCESSOR_IDLE_HANDLER Handler;
} PROCESSOR_IDLE_HANDLER_INFO, *PPROCESSOR_IDLE_HANDLER_INFO; } PROCESSOR_IDLE_HANDLER_INFO, *PPROCESSOR_IDLE_HANDLER_INFO;
typedef VOID DDKFASTAPI typedef VOID
(*PSET_PROCESSOR_THROTTLE)( (DDKFASTAPI*PSET_PROCESSOR_THROTTLE)(
IN UCHAR Throttle); IN UCHAR Throttle);
typedef NTSTATUS DDKFASTAPI typedef NTSTATUS
(*PSET_PROCESSOR_THROTTLE2)( (DDKFASTAPI*PSET_PROCESSOR_THROTTLE2)(
IN UCHAR Throttle); IN UCHAR Throttle);
#define MAX_IDLE_HANDLERS 3 #define MAX_IDLE_HANDLERS 3
@@ -81,12 +81,12 @@ typedef enum _POWER_STATE_HANDLER_TYPE {
PowerStateMaximum PowerStateMaximum
} POWER_STATE_HANDLER_TYPE, *PPOWER_STATE_HANDLER_TYPE; } POWER_STATE_HANDLER_TYPE, *PPOWER_STATE_HANDLER_TYPE;
typedef NTSTATUS DDKAPI typedef NTSTATUS
(*PENTER_STATE_SYSTEM_HANDLER)( (DDKAPI*PENTER_STATE_SYSTEM_HANDLER)(
IN PVOID SystemContext); IN PVOID SystemContext);
typedef NTSTATUS DDKAPI typedef NTSTATUS
(*PENTER_STATE_HANDLER)( (DDKAPI*PENTER_STATE_HANDLER)(
IN PVOID Context, IN PVOID Context,
IN PENTER_STATE_SYSTEM_HANDLER SystemHandler OPTIONAL, IN PENTER_STATE_SYSTEM_HANDLER SystemHandler OPTIONAL,
IN PVOID SystemContext, IN PVOID SystemContext,
@@ -101,8 +101,8 @@ typedef struct _POWER_STATE_HANDLER {
PVOID Context; PVOID Context;
} POWER_STATE_HANDLER, *PPOWER_STATE_HANDLER; } POWER_STATE_HANDLER, *PPOWER_STATE_HANDLER;
typedef NTSTATUS STDCALL typedef NTSTATUS
(*PENTER_STATE_NOTIFY_HANDLER)( (STDCALL*PENTER_STATE_NOTIFY_HANDLER)(
IN POWER_STATE_HANDLER_TYPE State, IN POWER_STATE_HANDLER_TYPE State,
IN PVOID Context, IN PVOID Context,
IN BOOLEAN Entering); IN BOOLEAN Entering);

View File

@@ -34,9 +34,9 @@ extern "C" {
/* /*
** Definitions specific to this Device Driver Kit ** Definitions specific to this Device Driver Kit
*/ */
#define DDKAPI __attribute__((stdcall)) #define DDKAPI __stdcall
#define DDKFASTAPI __attribute__((fastcall)) #define DDKFASTAPI __fastcall
#define DDKCDECLAPI __attribute__((cdecl)) #define DDKCDECLAPI __cdecl
#if defined(_NTOSKRNL_) #if defined(_NTOSKRNL_)
#ifndef NTOSAPI #ifndef NTOSAPI
@@ -128,11 +128,15 @@ static __inline struct _KPCR * KeGetCurrentKPCR(
VOID) VOID)
{ {
ULONG Value; ULONG Value;
#if defined(__GNUC__)
__asm__ __volatile__ ("movl %%fs:0x1C, %0\n\t" __asm__ __volatile__ ("movl %%fs:0x1C, %0\n\t"
: "=r" (Value) : "=r" (Value)
: /* no inputs */ : /* no inputs */
); );
#elif defined(_MSC_VER)
__asm mov eax, fs:[1Ch]
__asm mov [Value], eax
#endif
return (struct _KPCR *) Value; return (struct _KPCR *) Value;
} }
@@ -140,11 +144,15 @@ static __inline struct _KPRCB * KeGetCurrentPrcb(
VOID) VOID)
{ {
ULONG Value; ULONG Value;
#if defined(__GNUC__)
__asm__ __volatile__ ("movl %%fs:0x20, %0\n\t" __asm__ __volatile__ ("movl %%fs:0x20, %0\n\t"
: "=r" (Value) : "=r" (Value)
: /* no inputs */ : /* no inputs */
); );
#elif defined(_MSC_VER)
__asm mov eax, fs:[20h]
__asm mov [Value], eax
#endif
return (struct _KPRCB *) Value; return (struct _KPRCB *) Value;
} }
@@ -4331,8 +4339,8 @@ typedef struct _DISK_SIGNATURE {
} DUMMYUNIONNAME; } DUMMYUNIONNAME;
} DISK_SIGNATURE, *PDISK_SIGNATURE; } DISK_SIGNATURE, *PDISK_SIGNATURE;
typedef VOID DDKFASTAPI typedef VOID
(*PTIME_UPDATE_NOTIFY_ROUTINE)( (DDKFASTAPI*PTIME_UPDATE_NOTIFY_ROUTINE)(
IN HANDLE ThreadId, IN HANDLE ThreadId,
IN KPROCESSOR_MODE Mode); IN KPROCESSOR_MODE Mode);
@@ -8088,7 +8096,11 @@ KeMemoryBarrier(
VOID) VOID)
{ {
volatile LONG Barrier; volatile LONG Barrier;
#if defined(__GNUC__)
__asm__ __volatile__ ("xchg %%eax, %0" : : "m" (Barrier) : "%eax"); __asm__ __volatile__ ("xchg %%eax, %0" : : "m" (Barrier) : "%eax");
#elif defined(_MSC_VER)
__asm xchg [Barrier], eax
#endif
} }
NTOSAPI NTOSAPI

View File

@@ -4,6 +4,9 @@
#pragma GCC system_header #pragma GCC system_header
#endif #endif
/* TODO: some compilers support this */
#define RESTRICTED_POINTER
#define NTAPI __stdcall #define NTAPI __stdcall
#define OBJ_INHERIT 0x00000002 #define OBJ_INHERIT 0x00000002
#define OBJ_PERMANENT 0x00000010 #define OBJ_PERMANENT 0x00000010

View File

@@ -118,6 +118,9 @@ extern "C" {
#elif defined(__WATCOMC__) #elif defined(__WATCOMC__)
#define DECLSPEC_NORETURN #define DECLSPEC_NORETURN
#define DECLARE_STDCALL_P( type ) type __stdcall #define DECLARE_STDCALL_P( type ) type __stdcall
#elif defined(_MSC_VER)
#define DECLSPEC_NORETURN __declspec(noreturn)
#define DECLARE_STDCALL_P( type ) type __stdcall
#endif /* __GNUC__/__WATCOMC__ */ #endif /* __GNUC__/__WATCOMC__ */
#define MAKEWORD(a,b) ((WORD)(((BYTE)(a))|(((WORD)((BYTE)(b)))<<8))) #define MAKEWORD(a,b) ((WORD)(((BYTE)(a))|(((WORD)((BYTE)(b)))<<8)))
#define MAKELONG(a,b) ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16))) #define MAKELONG(a,b) ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16)))
@@ -160,7 +163,7 @@ extern "C" {
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) */ #endif /* __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) */
#endif /* NONAMELESSUNION */ #endif /* NONAMELESSUNION */
#elif defined(__WATCOMC__) #elif defined(__WATCOMC__) || defined(_MSC_VER)
#define _ANONYMOUS_UNION #define _ANONYMOUS_UNION
#define _ANONYMOUS_STRUCT #define _ANONYMOUS_STRUCT
#endif /* __GNUC__/__WATCOMC__ */ #endif /* __GNUC__/__WATCOMC__ */

View File

@@ -1358,7 +1358,7 @@ typedef struct _GUID {
unsigned short Data3; unsigned short Data3;
unsigned char Data4[8]; unsigned char Data4[8];
} GUID, *REFGUID, *LPGUID; } GUID, *REFGUID, *LPGUID;
#define SYSTEM_LUID { QuadPart:999 } #define SYSTEM_LUID { 0x3E7, 0x0 }
#endif /* GUID_DEFINED */ #endif /* GUID_DEFINED */
/* ACE Access Types, also in ntifs.h */ /* ACE Access Types, also in ntifs.h */
@@ -2039,7 +2039,10 @@ typedef union _ULARGE_INTEGER {
#endif /* NONAMELESSUNION */ #endif /* NONAMELESSUNION */
ULONGLONG QuadPart; ULONGLONG QuadPart;
} ULARGE_INTEGER, *PULARGE_INTEGER; } ULARGE_INTEGER, *PULARGE_INTEGER;
typedef LARGE_INTEGER LUID,*PLUID; typedef struct _LUID {
DWORD LowPart;
LONG HighPart;
} LUID, *PLUID;
#pragma pack(push,4) #pragma pack(push,4)
typedef struct _LUID_AND_ATTRIBUTES { typedef struct _LUID_AND_ATTRIBUTES {
LUID Luid; LUID Luid;
@@ -3413,17 +3416,6 @@ static __inline__ PVOID GetCurrentFiber(void)
return ret; return ret;
} }
static __inline__ PVOID GetFiberData(void)
{
void* ret;
__asm__ __volatile__ (
"movl %%fs:0x10,%0\n"
"movl (%0),%0"
: "=r" (ret) /* allow use of reg eax,ebx,ecx,edx,esi,edi */
);
return ret;
}
static __inline__ struct _TEB * NtCurrentTeb(void) static __inline__ struct _TEB * NtCurrentTeb(void)
{ {
struct _TEB *ret; struct _TEB *ret;
@@ -3437,7 +3429,7 @@ static __inline__ struct _TEB * NtCurrentTeb(void)
return ret; return ret;
} }
#else #elif defined(__WATCOMC__)
extern PVOID GetCurrentFiber(void); extern PVOID GetCurrentFiber(void);
#pragma aux GetCurrentFiber = \ #pragma aux GetCurrentFiber = \
@@ -3445,14 +3437,36 @@ extern PVOID GetCurrentFiber(void);
value [eax] \ value [eax] \
modify [eax]; modify [eax];
extern PVOID GetFiberData(void); extern struct _TEB * NtCurrentTeb(void);
#pragma aux GetFiberData = \ #pragma aux NtCurrentTeb = \
"mov eax, dword ptr fs:0x10" \ "mov eax, dword ptr fs:0x18" \
"mov eax, [eax]" \
value [eax] \ value [eax] \
modify [eax]; modify [eax];
#endif /* __GNUC__ */ #elif defined(_MSC_VER)
static __inline PVOID GetCurrentFiber(void)
{
PVOID p;
__asm mov eax, fs:[10h]
__asm mov [p], eax
return p;
}
static __inline struct _TEB * NtCurrentTeb(void)
{
struct _TEB *p;
__asm mov eax, fs:[18h]
__asm mov [p], eax
return p;
}
#endif /* __GNUC__/__WATCOMC__/_MSC_VER */
static __inline PVOID GetFiberData(void)
{
return *((PVOID *)GetCurrentFiber());
}
#endif /* RC_INVOKED */ #endif /* RC_INVOKED */

3
rosapps/.cvsignore Normal file
View File

@@ -0,0 +1,3 @@
*.zip
*.map
doxy-doc

118
rosapps/Makefile Normal file
View File

@@ -0,0 +1,118 @@
#
# Global makefile for the ROSAPPS package
#
include rules.mak
#
# Available applications
#
APPS = cmdutils \
cmdutils$(SEP)mode \
cmdutils$(SEP)touch \
demos$(SEP)maze \
devutils$(SEP)genguid \
devutils$(SEP)zoomin \
dflat32 \
games$(SEP)winemine \
games$(SEP)solitaire \
mc \
notevil \
packmgr$(SEP)lib \
packmgr$(SEP)cmd-line \
packmgr$(SEP)gui \
sysutils \
sysutils$(SEP)ctm \
sysutils$(SEP)kill \
sysutils$(SEP)tcat \
sysutils$(SEP)tlist \
net$(SEP)niclist \
net$(SEP)ncftp \
sysutils$(SEP)regexpl \
welcome \
winfile
all: $(APPS)
.PHONY: all
implib:
.PHONY: implib
clean: $(APPS:%=%_clean)
.PHONY: clean
install: $(APPS:%=%_install)
.PHONY: install
floppy: make_floppy_dirs $(APPS:%=%_floppy)
dist: clean_dist_dir make_dist_dirs $(APPS:%=%_dist)
.PHONY: dist
#
# Applications
#
$(APPS): %:
$(MAKE) -C $*
$(APPS:%=%_clean): %_clean:
$(MAKE) -C $* clean
$(APPS:%=%_floppy): %_floppy:
$(MAKE) -C $* floppy
$(APPS:%=%_dist): %_dist:
$(MAKE) -C $* dist
$(APPS:%=%_install): %_install:
$(MAKE) -C $* install
.PHONY: $(APPS) $(APPS:%=%_clean) $(APPS:%=%_floppy) $(APPS:%=%_dist) $(APPS:%=%_install)
#
# Make an install floppy
#
#install: all
# ./install.sh /mnt/hda1
make_floppy_dirs:
ifeq ($(DOSCLI),yes)
mkdir $(FLOPPY_DIR)\apps
else
mkdir $(FLOPPY_DIR)/apps
endif
.PHONY: make_floppy_dirs
#
# Make a distribution saveset
#
clean_dist_dir:
ifeq ($(DOSCLI),yes)
# $(RM) $(DIST_DIR)\apps\*.*
# $(RMDIR) $(DIST_DIR)\apps
# $(RMDIR) $(DIST_DIR)
else
$(RM) -r $(DIST_DIR)
endif
make_dist_dirs:
ifeq ($(DOSCLI),yes)
mkdir $(DIST_DIR)
mkdir $(DIST_DIR)\apps
else
mkdir $(DIST_DIR)
mkdir $(DIST_DIR)/apps
endif
#dist: $(TOOLS_PATH)/rcopy$(EXE_POSTFIX) dist_clean dist_dirs \
# $(WINE_MODULES:%=%_dist)
.PHONY: clean_dist_dir make_dist_dirs
# EOF

View File

@@ -0,0 +1,17 @@
*.sys
*.exe
*.dll
*.cpl
*.a
*.o
*.d
*.coff
*.dsp
*.dsw
*.aps
*.ncb
*.opt
*.sym
*.plg
*.bak
*.map

View File

@@ -1,52 +0,0 @@
<directory name="mode">
<xi:include href="mode/mode.xml" />
</directory>
<directory name="touch">
<xi:include href="touch/touch.xml" />
</directory>
<module name="find" type="win32cui" installbase="system32" installname="find.exe">
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
<library>kernel32</library>
<file>find.c</file>
<file>find.rc</file>
</module>
<module name="more" type="win32cui" installbase="system32" installname="more.exe">
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
<library>kernel32</library>
<file>more.c</file>
<file>more.rc</file>
</module>
<module name="sort" type="win32cui" installbase="system32" installname="sort.exe">
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
<library>kernel32</library>
<file>sort.c</file>
<file>sort.rc</file>
</module>
<module name="tee" type="win32cui" installbase="system32" installname="tee.exe">
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
<library>kernel32</library>
<file>tee.c</file>
<file>tee.rc</file>
</module>
<module name="y" type="win32cui" installbase="system32" installname="y.exe">
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
<library>kernel32</library>
<file>y.c</file>
<file>y.rc</file>
</module>

67
rosapps/cmdutils/makefile Normal file
View File

@@ -0,0 +1,67 @@
#
# ReactOS cmdutils makefile
#
PATH_TO_TOP=..
TARGET=find.exe more.exe sort.exe tee.exe y.exe
all: $(TARGET)
CLEAN_FILES = *.o *.exe *.sym *.coff
find.exe: find.o find.coff
$(CC) find.o -lkernel32 -lmsvcrt -o find.exe find.coff
$(NM) --numeric-sort find.exe > find.sym
more.exe: more.o more.coff
$(CC) more.o -lkernel32 -lmsvcrt -o more.exe more.coff
$(NM) --numeric-sort more.exe > more.sym
sort.exe: sort.o sort.coff
$(CC) sort.o -lkernel32 -lmsvcrt -o sort.exe sort.coff
$(NM) --numeric-sort sort.exe > sort.sym
tee.exe: tee.o tee.coff
$(CC) tee.o -lkernel32 -lmsvcrt -o tee.exe tee.coff
$(NM) --numeric-sort tee.exe > tee.sym
y.exe: y.o y.coff
$(CC) y.o -lkernel32 -lmsvcrt -o y.exe y.coff
$(NM) --numeric-sort y.exe > y.sym
install:
.phony: install
clean: $(CLEAN_FILES:%=%_clean)
$(CLEAN_FILES:%=%_clean): %_clean:
- $(RM) $*
.phony: clean $(CLEAN_FILES:%=%_clean)
floppy: $(TARGET:%=$(FLOPPY_DIR)/apps/%)
$(TARGET:%=$(FLOPPY_DIR)/apps/%): $(FLOPPY_DIR)/apps/%: %
ifeq ($(DOSCLI),yes)
$(CP) $* $(FLOPPY_DIR)\apps\$*
else
$(CP) $* $(FLOPPY_DIR)/apps/$*
endif
dist: $(TARGET:%=$(PATH_TO_TOP)/$(DIST_DIR)/apps/%)
$(TARGET:%=$(PATH_TO_TOP)/$(DIST_DIR)/apps/%): $(PATH_TO_TOP)/$(DIST_DIR)/apps/%: %
ifeq ($(DOSCLI),yes)
$(CP) $* $(PATH_TO_TOP)\$(DIST_DIR)\apps\$*
else
$(CP) $* $(PATH_TO_TOP)/$(DIST_DIR)/apps/$*
endif
include $(PATH_TO_TOP)/rules.mak

View File

@@ -0,0 +1,17 @@
*.sys
*.exe
*.dll
*.cpl
*.a
*.o
*.d
*.coff
*.dsp
*.dsw
*.aps
*.ncb
*.opt
*.sym
*.plg
*.bak
*.map

View File

@@ -0,0 +1,20 @@
PATH_TO_TOP=../../../reactos
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = mode
TARGET_SDKLIBS = ntdll.a
TARGET_OBJECTS = $(TARGET_NAME).o
TARGET_CFLAGS = -D__USE_W32API
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -1,10 +0,0 @@
<module name="mode" type="win32cui" installbase="system32" installname="mode.exe" warnings="true">
<include base="mode">.</include>
<include base="mode">.</include>
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
<library>kernel32</library>
<file>mode.c</file>
<file>mode.rc</file>
</module>

View File

@@ -0,0 +1,17 @@
*.sys
*.exe
*.dll
*.cpl
*.a
*.o
*.d
*.coff
*.dsp
*.dsw
*.aps
*.ncb
*.opt
*.sym
*.plg
*.bak
*.map

View File

@@ -0,0 +1,21 @@
PATH_TO_TOP=../../../reactos
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = touch
TARGET_SDKLIBS = ntdll.a
TARGET_OBJECTS = $(TARGET_NAME).o \
err.o
TARGET_GCCLIBS = iberty
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -1,10 +0,0 @@
<module name="touch" type="win32cui" installbase="system32" installname="touch.exe" warnings="true">
<include base="touch">.</include>
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
<library>ntdll</library>
<file>err.c</file>
<file>touch.c</file>
<file>touch.rc</file>
</module>

View File

@@ -1,3 +0,0 @@
<directory name="maze">
<xi:include href="maze/maze.xml" />
</directory>

View File

@@ -0,0 +1,7 @@
maze.exe
maze.nostrip.exe
maze.sym
maze.coff
.*.d
*.o
*.map

View File

@@ -1,9 +0,0 @@
<module name="maze" type="win32gui" installbase="system32" installname="maze.exe">
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
<define name="__USE_W32API" />
<library>kernel32</library>
<library>gdi32</library>
<file>maze.c</file>
<file>maze.rc</file>
</module>

View File

@@ -1,11 +0,0 @@
<directory name="gdb2">
<xi:include href="gdb2/gdb2.xml" />
</directory>
<directory name="genguid">
<xi:include href="genguid/genguid.xml" />
</directory>
<directory name="zoomin">
<xi:include href="zoomin/zoomin.xml" />
</directory>

View File

@@ -0,0 +1,13 @@
# $Id: Makefile,v 1.1 2001/04/15 23:43:12 narnaoud Exp $
#
# ReactOS makefile for gdb2
#
include ../../rules.mak
TARGET_NAME=gdb2
all: $(TARGET_NAME)$(EXE_POSTFIX)
gdb2.exe : gdb2.cpp ph.h
gcc gdb2.cpp -o gdb2.exe

View File

@@ -1,7 +0,0 @@
<module name="gdb2" type="win32cui" installbase="system32" installname="gdb2.exe">
<include base="gdb2">.</include>
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
<file>gdb2.cpp</file>
</module>

View File

@@ -0,0 +1,12 @@
*.exe
*.o
*.coff
*.dsp
*.dsw
*.aps
*.ncb
*.opt
*.sym
*.plg
*.bak
*.map

View File

@@ -0,0 +1,23 @@
# $Id: Makefile,v 1.1 2003/08/22 07:26:41 sedwards Exp $
PATH_TO_TOP = ../../../reactos
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = genguid
TARGET_CFLAGS = -D_WIN32_IE=0x0501 -D_WIN32_WINNT=0x0501 -D__USE_W32API
TARGET_SDKLIBS = kernel32.a
TARGET_GCCLIBS = ole32 uuid
TARGET_OBJECTS = genguid.o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -1,9 +0,0 @@
<module name="genguid" type="win32cui" installbase="system32" installname="genguid.exe">
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
<library>kernel32</library>
<library>ole32</library>
<library>uuid</library>
<file>genguid.c</file>
</module>

View File

@@ -0,0 +1,12 @@
*.exe
*.o
*.coff
*.dsp
*.dsw
*.aps
*.ncb
*.opt
*.sym
*.plg
*.bak
*.map

View File

@@ -0,0 +1,42 @@
# $Id: makefile,v 1.2 2004/06/02 02:27:04 royce Exp $
#
# ReactOS zoomin
#
# Makefile
#
# Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
PATH_TO_TOP = ../../../reactos
TARGET_TYPE = program
TARGET_APPTYPE = windows
TARGET_NAME = zoomin
TARGET_CFLAGS = -D_WIN32_IE=0x0501 -D_WIN32_WINNT=0x0501 -D__USE_W32API
TARGET_SDKLIBS = kernel32.a gdi32.a user32.a
TARGET_OBJECTS = framewnd.o main.o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -1,12 +0,0 @@
<module name="zoomin" type="win32gui" installbase="system32" installname="zoomin.exe">
<include base="zoomin">.</include>
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
<define name="__USE_W32API" />
<library>kernel32</library>
<library>gdi32</library>
<library>user32</library>
<file>framewnd.c</file>
<file>main.c</file>
<file>zoomin.rc</file>
</module>

View File

@@ -0,0 +1,17 @@
*.sys
*.exe
*.dll
*.cpl
*.a
*.o
*.d
*.coff
*.dsp
*.dsw
*.aps
*.ncb
*.opt
*.sym
*.plg
*.bak
*.map

View File

@@ -1,53 +0,0 @@
<module name="dflat32" type="win32cui" installbase="system32" installname="dflat32.exe" warnings="true">
<include base="ReactOS">include/wine</include>
<include base="dflat32">.</include>
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
<library>kernel32</library>
<library>gdi32</library>
<file>applicat.c</file>
<file>barchart.c</file>
<file>box.c</file>
<file>button.c</file>
<file>calendar.c</file>
<file>checkbox.c</file>
<file>clipbord.c</file>
<file>combobox.c</file>
<file>config.c</file>
<file>console.c</file>
<file>decomp.c</file>
<file>dfalloc.c</file>
<file>dialbox.c</file>
<file>dialogs.c</file>
<file>direct.c</file>
<file>edit.c</file>
<file>editbox.c</file>
<file>fileopen.c</file>
<file>helpbox.c</file>
<file>htree.c</file>
<file>keys.c</file>
<file>listbox.c</file>
<file>lists.c</file>
<file>log.c</file>
<file>menu.c</file>
<file>menubar.c</file>
<file>menus.c</file>
<file>message.c</file>
<file>msgbox.c</file>
<file>normal.c</file>
<file>pictbox.c</file>
<file>popdown.c</file>
<file>radio.c</file>
<file>rect.c</file>
<file>search.c</file>
<file>slidebox.c</file>
<file>spinbutt.c</file>
<file>statbar.c</file>
<file>sysmenu.c</file>
<file>text.c</file>
<file>textbox.c</file>
<file>video.c</file>
<file>watch.c</file>
<file>window.c</file>
</module>

41
rosapps/dflat32/makefile Normal file
View File

@@ -0,0 +1,41 @@
#
# ReactOS D-Flat/32
#
# Makefile
#
PATH_TO_TOP = ../../reactos
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = edit
WINE_MODE = yes
WINE_RC = $(TARGET_NAME)
WINE_INCLUDE = ./
TARGET_CFLAGS = -D__USE_W32API
#WITH_DEBUGGING=yes
TARGET_SDKLIBS = \
kernel32.a \
user32.a
TARGET_OBJECTS = \
applicat.o barchart.o box.o button.o calendar.o checkbox.o clipbord.o \
combobox.o config.o console.o decomp.o dfalloc.o dialbox.o dialogs.o \
direct.o edit.o editbox.o fileopen.o helpbox.o htree.o keys.o \
listbox.o lists.o log.o menu.o menubar.o menus.o message.o msgbox.o \
normal.o pictbox.o popdown.o radio.o rect.o search.o slidebox.o spinbutt.o \
statbar.o sysmenu.o text.o textbox.o video.o watch.o window.o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -1,55 +0,0 @@
<directory name="cmdutils">
<xi:include href="cmdutils/cmdutils.xml" />
</directory>
<directory name="demos">
<xi:include href="demos/directory.xml" />
</directory>
<directory name="devutils">
<xi:include href="devutils/directory.xml" />
</directory>
<directory name="dflat32">
<xi:include href="dflat32/dflat32.xml" />
</directory>
<directory name="games">
<xi:include href="games/directory.xml" />
</directory>
<!--
<directory name="lib">
<xi:include href="lib/directory.xml" />
</directory>
-->
<directory name="mc">
<xi:include href="mc/mc.xml" />
</directory>
<directory name="net">
<xi:include href="net/directory.xml" />
</directory>
<directory name="notevil">
<xi:include href="notevil/notevil.xml" />
</directory>
<directory name="packmgr">
<xi:include href="packmgr/directory.xml" />
</directory>
<directory name="sysutils">
<xi:include href="sysutils/sysutils.xml" />
</directory>
<directory name="templates">
<xi:include href="templates/directory.xml" />
</directory>
<!--
<directory name="welcome">
<xi:include href="welcome/welcome.xml" />
</directory>
-->
<directory name="winfile">
<xi:include href="winfile/winfile.xml" />
</directory>

View File

@@ -1,7 +0,0 @@
<directory name="solitaire">
<xi:include href="solitaire/solitaire.xml" />
</directory>
<directory name="winemine">
<xi:include href="winemine/winemine.xml" />
</directory>

View File

@@ -0,0 +1,44 @@
PATH_TO_TOP = ../../../reactos
TARGET_TYPE = program
TARGET_APPTYPE = windows
# change to console for debugging purposes...
#TARGET_APPTYPE = console
TARGET_INSTALLDIR = system32
TARGET_NAME = sol
TARGET_SDKLIBS = kernel32.a user32.a gdi32.a cards.a comctl32.a
TARGET_GCCLIBS = stdc++
TARGET_OBJECTS = $(SOL_OBJECTS) $(CARDLIB_OBJECTS)
SOL_OBJECTS = \
solcreate.o \
solgame.o \
solitaire.o
CARDLIB_OBJECTS = \
cardlib/cardbitmaps.o \
cardlib/cardbutton.o \
cardlib/cardcolor.o \
cardlib/cardcount.o \
cardlib/cardlib.o \
cardlib/cardregion.o \
cardlib/cardrgndraw.o \
cardlib/cardrgnmouse.o \
cardlib/cardstack.o \
cardlib/cardwindow.o \
cardlib/dropzone.o
TARGET_CPPFLAGS = -Icardlib -Wall -D__USE_W32API -D_WIN32_IE=0x0501 -D_WIN32_WINNT=0x0501 -D__REACTOS__
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -1,33 +0,0 @@
<module name="sol" type="win32gui" installbase="system32" installname="solitaire.exe" warnings="true">
<include base="sol">.</include>
<include base="sol">cardlib</include>
<linkerflag>-lstdc++</linkerflag>
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
<define name="__REACTOS__" />
<library>kernel32</library>
<library>user32</library>
<library>gdi32</library>
<library>cards</library>
<library>comctl32</library>
<file>solcreate.cpp</file>
<file>solgame.cpp</file>
<file>solitaire.cpp</file>
<directory name="cardlib">
<file>cardbitmaps.cpp</file>
<file>cardbutton.cpp</file>
<file>cardcolor.cpp</file>
<file>cardcount.cpp</file>
<file>cardlib.cpp</file>
<file>cardregion.cpp</file>
<file>cardrgndraw.cpp</file>
<file>cardrgnmouse.cpp</file>
<file>cardstack.cpp</file>
<file>cardwindow.cpp</file>
<file>dropzone.cpp</file>
</directory>
<file>sol.rc</file>
</module>

View File

@@ -0,0 +1,6 @@
*.o
*.d
*.exe
*.coff
*.sym
*.map

View File

@@ -0,0 +1,21 @@
# $Id$
PATH_TO_TOP = ../../../reactos
TARGET_TYPE = program
TARGET_APPTYPE = windows
TARGET_NAME = winemine
TARGET_SDKLIBS = kernel32.a gdi32.a
TARGET_OBJECTS = main.o dialog.o
TARGET_CFLAGS = -D__USE_W32API
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -1,10 +0,0 @@
<module name="winemine" type="win32gui" installbase="system32" installname="winemine.exe">
<include base="winemine">.</include>
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
<library>kernel32</library>
<library>gdi32</library>
<file>main.c</file>
<file>dialog.c</file>
</module>

View File

@@ -0,0 +1,17 @@
*.sys
*.exe
*.dll
*.cpl
*.a
*.o
*.d
*.coff
*.dsp
*.dsw
*.aps
*.ncb
*.opt
*.sym
*.plg
*.bak
*.map

View File

@@ -1,43 +0,0 @@
<module name="dflat32lib" type="win32dll" baseadress="0x98000000" installbase="system32" installname="dflat32.dll">
<importlibrary definition="dflat32.def" />
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
<file>applicat.c</file>
<file>box.c</file>
<file>checkbox.c</file>
<file>clipbord.c</file>
<file>config.c</file>
<file>console.c</file>
<file>decomp.c</file>
<file>dfalloc.c</file>
<file>dialbox.c</file>
<file>dialogs.c</file>
<file>dllmain.c</file>
<file>editbox.c</file>
<file>lists.c</file>
<file>helpbox.c</file>
<file>listbox.c</file>
<file>log.c</file>
<file>message.c</file>
<file>menu.c</file>
<file>menubar.c</file>
<file>menus.c</file>
<file>msgbox.c</file>
<file>normal.c</file>
<file>pictbox.c</file>
<file>popdown.c</file>
<file>keys.c</file>
<file>radio.c</file>
<file>rect.c</file>
<file>spinbutt.c</file>
<file>statbar.c</file>
<file>stubs.c</file>
<file>sysmenu.c</file>
<file>text.c</file>
<file>textbox.c</file>
<file>video.c</file>
<file>watch.c</file>
<file>window.c</file>
</module>

View File

@@ -1,3 +0,0 @@
<directory name="dflat32">
<xi:include href="dflat32/dflat32.xml" />
</directory>

17
rosapps/mc/.cvsignore Normal file
View File

@@ -0,0 +1,17 @@
*.sys
*.exe
*.dll
*.cpl
*.a
*.o
*.d
*.coff
*.dsp
*.dsw
*.aps
*.ncb
*.opt
*.sym
*.plg
*.bak
*.map

106
rosapps/mc/Makefile Normal file
View File

@@ -0,0 +1,106 @@
#
# ReactOS mc
#
# Makefile
#
PATH_TO_TOP = ../../reactos
TARGET_TYPE = program
TARGET_OS = NT
TARGET_APPTYPE = console
TARGET_NAME = mc
TARGET_CFLAGS = -I./pc -I./slang -DMC_$(TARGET_OS) -DHAVE_CONFIG_H -D__USE_W32API
TARGET_SDKLIBS = \
kernel32.a \
user32.a
MC_OBJS = \
./src/terms.o \
./src/user.o \
./src/file.o \
./src/listmode.o \
./src/cmd.o \
./src/command.o \
./src/help.o \
./src/menu.o \
./src/view.o \
./src/dir.o \
./src/info.o \
./src/widget.o \
./src/option.o \
./src/dlg.o \
./src/panelize.o \
./src/profile.o \
./src/util.o \
./src/dialog.o \
./src/ext.o \
./src/color.o \
./src/layout.o \
./src/setup.o \
./src/regex.o \
./src/hotlist.o \
./src/tree.o \
./src/win.o \
./src/complete.o \
./src/find.o \
./src/wtools.o \
./src/boxes.o \
./src/background.o \
./src/main.o \
./src/popt.o \
./src/text.o \
./src/screen.o
PC_OBJS= \
./pc/slint_pc.o \
./pc/chmod.o \
./pc/drive.o
NT_OBJS = \
./pc/cons_nt.o \
./pc/dirent_nt.o \
./pc/key_nt.o \
./pc/util_win32.o \
./pc/util_winnt.o \
./pc/util_nt.o
SLANG_NT = slw32tty.o
SLANG_OS2 = slos2tty.o
SLANG_OBJS = \
./slang/slerr.o \
./slang/slgetkey.o \
./slang/slsmg.o \
./slang/slvideo.o \
./slang/$(SLANG_$(TARGET_OS))
MCEDIT_OBJS = \
./edit/edit.o \
./edit/editcmd.o \
./edit/editdraw.o \
./edit/editmenu.o \
./edit/editoptions.o \
./edit/editwidget.o \
./edit/syntax.o \
./edit/wordproc.o
TARGET_OBJECTS = \
$(MC_OBJS) \
$(PC_OBJS) \
$(NT_OBJS) \
$(SLANG_OBJS) \
$(MCEDIT_OBJS) \
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

0
rosapps/mc/doc/Makefile Normal file
View File

View File

@@ -0,0 +1,2 @@
*.o
*.map

86
rosapps/mc/edit/Makefile Normal file
View File

@@ -0,0 +1,86 @@
# Generated automatically from Makefile.in by configure.
srcdir = .
rootdir = $(srcdir)/..
include ../Make.common
CFLAGS = $(XCFLAGS)
CPPFLAGS = $(XCPPFLAGS)
LDFLAGS = $(XLDFLAGS)
DEFS = $(XDEFS)
LIBS = $(XLIBS) $(XLIB)
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
AR = /usr/bin/ar
#
# Distribution variables
#
EDITSRC = edit.c editcmd.c editwidget.c edit_key_translator.c editdraw.c \
edit.h editmenu.c editcmddef.h wordproc.c syntax.c editoptions.c
EDITOBJS = edit.o editcmd.o editwidget.o editdraw.o editmenu.o wordproc.o \
syntax.o editoptions.o
DIST = Makefile.in README.edit $(EDITSRC)
all: libedit.a
.c.o:
$(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) -DMIDNIGHT $<
check:
@echo no tests are supplied.
libedit.a: $(EDITOBJS)
$(RMF) $@
$(AR) cr $@ $(EDITOBJS)
-$(RANLIB) $@
mcedit:
-$(RMF) $(DESTDIR)$(bindir)/$(binprefix)mcedit
$(LN_S) mc $(DESTDIR)$(bindir)/$(binprefix)mcedit
showlibdep:
@echo 'OBJS="$(EDITOBJS)"'
cross:
$(MAKE) CC=gcc-linux CPP="gcc-linux -E" \
CPPFLAGS="$(CPPFLAGS) -I/usr/local/lib/gcc-lib/i386-linux-linux/include/ncurses "
TAGS: $(EDITSRC)
etags $(EDITSRC)
clean:
$(RMF) *.o core a.out libedit.a
realclean: clean
$(RMF) .depend
$(RMF) TAGS
$(RMF) *~
distclean:
-$(RMF) $(srcdir)/*~ $(srcdir)/*.o $(srcdir)/a.out
-$(RMF) $(srcdir)/core $(srcdir)/libedit.a
-if test $(srcdir) = .; then $(MAKE) realclean; fi
-$(RMF) $(srcdir)/Makefile
install: mcedit
uninstall:
-$(RMF) $(DESTDIR)$(bindir)/$(binprefix)mcedit
distcopy:
$(CP) $(DIST) ../../mc-$(VERSION)/edit
depend dep: mcdep
fastdeploc:
# ***Dependencies***Do not edit***
ifeq (.depend,$(wildcard .depend))
include .depend
endif
# ***End of dependencies***

View File

@@ -1,83 +0,0 @@
<module name="mc" type="win32cui" installbase="system32" installname="mc.exe" warnings="true">
<include base="mc">src</include>
<include base="mc">pc</include>
<include base="mc">slang</include>
<include base="mc">edit</include>
<define name="__USE_W32API" />
<define name="DMC_NT" />
<define name="_OS_NT" />
<define name="HAVE_CONFIG_H" />
<library>kernel32</library>
<library>user32</library>
<directory name="src">
<file>terms.c</file>
<file>user.c</file>
<file>file.c</file>
<file>listmode.c</file>
<file>cmd.c</file>
<file>command.c</file>
<file>help.c</file>
<file>menu.c</file>
<file>view.c</file>
<file>dir.c</file>
<file>info.c</file>
<file>widget.c</file>
<file>option.c</file>
<file>dlg.c</file>
<file>panelize.c</file>
<file>profile.c</file>
<file>util.c</file>
<file>dialog.c</file>
<file>ext.c</file>
<file>color.c</file>
<file>layout.c</file>
<file>setup.c</file>
<file>regex.c</file>
<file>hotlist.c</file>
<file>tree.c</file>
<file>win.c</file>
<file>complete.c</file>
<file>find.c</file>
<file>wtools.c</file>
<file>boxes.c</file>
<file>background.c</file>
<file>main.c</file>
<file>popt.c</file>
<file>text.c</file>
<file>screen.c</file>
</directory>
<directory name="pc">
<file>slint_pc.c</file>
<file>chmod.c</file>
<file>drive.c</file>
<file>cons_nt.c</file>
<file>dirent_nt.c</file>
<file>key_nt.c</file>
<file>util_win32.c</file>
<file>util_winnt.c</file>
<file>util_nt.c</file>
</directory>
<directory name="slang">
<file>slerr.c</file>
<file>slgetkey.c</file>
<file>slsmg.c</file>
<file>slvideo.c</file>
<file>slw32tty.c</file>
</directory>
<directory name="edit">
<file>edit.c</file>
<file>editcmd.c</file>
<file>editdraw.c</file>
<file>editmenu.c</file>
<file>editoptions.c</file>
<file>editwidget.c</file>
<file>syntax.c</file>
<file>wordproc.c</file>
</directory>
<file>mc.rc</file>
</module>

2
rosapps/mc/pc/.cvsignore Normal file
View File

@@ -0,0 +1,2 @@
*.o
*.map

28
rosapps/mc/pc/Makefile Normal file
View File

@@ -0,0 +1,28 @@
TARGET_OS=NT
CC=gcc
LINK=gcc -s
OBJ_SUFFIX=o
OBJ_PLACE=-o
EXE_PLACE=-o
# ---- Compiler-specific optional stuff
MC_MISC_CFLAGS=
OBJS_DIR=release
EXTRA_MC_SRCS=
SPECIFIC_DEFINES=
SPECIFIC_MC_CFLAGS=-O2 $(MC_MISC_CFLAGS)
SPECIFIC_MC_LFLAGS_EXTRA=
SPECIFIC_SLANG_CFLAGS=$(SPECIFIC_MC_CFLAGS)
SPECIFIC_MCEDIT_CFLAGS=$(SPECIFIC_MC_CFLAGS)
# ---- Compiler independent defines
include Makefile.PC
# ---- Linkers are very compiler-specific
SPECIFIC_MC_LFLAGS=$(SPECIFIC_MC_LFLAGS_EXTRA)
MC_LIBS= # -lintl
$(MC_EXE): $(OBJS) $(MCEDIT_OBJS) $(SLANG_OBJS)
$(LINK) $(EXE_PLACE) $(MC_EXE) $(SPECIFIC_MC_LFLAGS) $+ $(MC_LIBS)

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