- NDK updates and compatibility fixes for Vista/WDK/User-Mode/Individual per-file NDK Usage.

- Update targets to pentium to take advantage of cmpxhg8b when possible. (ROS won't run on 386/486 anyway).
- Fix some compiler problems when building with -O3.

svn path=/trunk/; revision=26274
This commit is contained in:
Alex Ionescu 2007-04-07 05:33:30 +00:00
parent dd4ede8870
commit 2d88738681
12 changed files with 73 additions and 24 deletions

View file

@ -277,7 +277,7 @@ int WINAPI WinMain (HINSTANCE hInst,
LPSTR lpCmdLine, LPSTR lpCmdLine,
int iCmdShow) int iCmdShow)
{ {
HWND hwndParent; HWND hwndParent = 0;
int chOption = 0; int chOption = 0;
MSG Message; MSG Message;

View file

@ -32,7 +32,7 @@
See GCC manual for more CPU names and which CPUs GCC can optimize for. See GCC manual for more CPU names and which CPUs GCC can optimize for.
--> -->
<property name="OARCH" value="i486" /> <property name="OARCH" value="pentium" />
<!-- <!--

View file

@ -31,6 +31,9 @@ Author:
#include <ketypes.h> #include <ketypes.h>
#include <potypes.h> #include <potypes.h>
#include <lpctypes.h> #include <lpctypes.h>
#ifdef NTOS_MODE_USER
#include <obtypes.h>
#endif
// //
// GCC compatibility // GCC compatibility

View file

@ -948,7 +948,12 @@ typedef struct _KPROCESS
{ {
DISPATCHER_HEADER Header; DISPATCHER_HEADER Header;
LIST_ENTRY ProfileListHead; LIST_ENTRY ProfileListHead;
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
ULONG DirectoryTableBase;
ULONG Unused0;
#else
LARGE_INTEGER DirectoryTableBase; LARGE_INTEGER DirectoryTableBase;
#endif
#if defined(_M_IX86) #if defined(_M_IX86)
KGDTENTRY LdtDescriptor; KGDTENTRY LdtDescriptor;
KIDTENTRY Int21Descriptor; KIDTENTRY Int21Descriptor;

View file

@ -23,7 +23,7 @@ Author:
// Dependencies // Dependencies
// //
#include <umtypes.h> #include <umtypes.h>
#include <pstypes.h> //#include <pstypes.h>
// //
// Internal helper macro // Internal helper macro

View file

@ -24,6 +24,7 @@ Author:
// //
#include <umtypes.h> #include <umtypes.h>
#include <arch/mmtypes.h> #include <arch/mmtypes.h>
#include <extypes.h>
// //
// Page-Rounding Macros // Page-Rounding Macros
@ -576,20 +577,42 @@ typedef struct _MMSUPPORT_FLAGS
// //
typedef struct _MMSUPPORT typedef struct _MMSUPPORT
{ {
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
LIST_ENTRY WorkingSetExpansionLinks;
USHORT LastTrimpStamp;
USHORT NextPageColor;
#else
LARGE_INTEGER LastTrimTime; LARGE_INTEGER LastTrimTime;
#endif
MMSUPPORT_FLAGS Flags; MMSUPPORT_FLAGS Flags;
ULONG PageFaultCount; ULONG PageFaultCount;
ULONG PeakWorkingSetSize; ULONG PeakWorkingSetSize;
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
ULONG Spare0;
#else
ULONG WorkingSetSize; ULONG WorkingSetSize;
#endif
ULONG MinimumWorkingSetSize; ULONG MinimumWorkingSetSize;
ULONG MaximumWorkingSetSize; ULONG MaximumWorkingSetSize;
PMMWSL MmWorkingSetList; PMMWSL MmWorkingSetList;
#if (NTDDI_VERSION < NTDDI_LONGHORN)
LIST_ENTRY WorkingSetExpansionLinks; LIST_ENTRY WorkingSetExpansionLinks;
#endif
ULONG Claim; ULONG Claim;
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
ULONG Spare;
ULONG WorkingSetPrivateSize;
ULONG WorkingSetSizeOverhead;
ULONG WorkingSetSize;
PKEVENT ExitEvent;
EX_PUSH_LOCK WorkingSetMutex;
PVOID AccessLog;
#else
ULONG NextEstimationSlot; ULONG NextEstimationSlot;
ULONG NextAgingSlot; ULONG NextAgingSlot;
ULONG EstimatedAvailable; ULONG EstimatedAvailable;
ULONG GrowthSinceLastEstimate; ULONG GrowthSinceLastEstimate;
#endif
} MMSUPPORT, *PMMSUPPORT; } MMSUPPORT, *PMMSUPPORT;
// //

View file

@ -19,6 +19,9 @@ Author:
#ifndef _OBTYPES_H #ifndef _OBTYPES_H
#define _OBTYPES_H #define _OBTYPES_H
#undef NTDDI_VERSION
#define NTDDI_VERSION NTDDI_WS03SP1
// //
// Dependencies // Dependencies
// //
@ -27,9 +30,6 @@ Author:
#include <extypes.h> #include <extypes.h>
#endif #endif
#undef NTDDI_VERSION
#define NTDDI_VERSION NTDDI_WS03SP1
#ifdef NTOS_MODE_USER #ifdef NTOS_MODE_USER
// //
// Definitions for Object Creation // Definitions for Object Creation

View file

@ -131,6 +131,12 @@ PsLookupProcessThreadByCid(
OUT PETHREAD *Thread OUT PETHREAD *Thread
); );
BOOLEAN
NTAPI
PsIsProtectedProcess(
IN PEPROCESS Process
);
#endif #endif
// //

View file

@ -235,6 +235,11 @@ Author:
#define PSF_CREATE_FAILED_BIT 0x4000000 #define PSF_CREATE_FAILED_BIT 0x4000000
#define PSF_DEFAULT_IO_PRIORITY_BIT 0x8000000 #define PSF_DEFAULT_IO_PRIORITY_BIT 0x8000000
//
// Vista Process Flags
//
#define PSF2_PROTECTED_BIT 0x800
#ifdef NTOS_MODE_USER #ifdef NTOS_MODE_USER
// //
// Current Process/Thread built-in 'special' handles // Current Process/Thread built-in 'special' handles
@ -529,19 +534,6 @@ typedef NTSTATUS
VOID VOID
); );
#ifdef NTOS_MODE_USER
//
// ClientID Structure
//
typedef struct _CLIENT_ID
{
HANDLE UniqueProcess;
HANDLE UniqueThread;
} CLIENT_ID, *PCLIENT_ID;
#endif
// //
// Descriptor Table Entry Definition // Descriptor Table Entry Definition
// //
@ -1001,7 +993,6 @@ typedef struct _PSP_RATE_APC
// //
// Executive Thread (ETHREAD) // Executive Thread (ETHREAD)
// //
#include <pshpack4.h>
typedef struct _ETHREAD typedef struct _ETHREAD
{ {
KTHREAD Tcb; KTHREAD Tcb;
@ -1200,7 +1191,11 @@ typedef struct _EPROCESS
#endif #endif
PETHREAD ForkInProgress; PETHREAD ForkInProgress;
ULONG HardwareTrigger; ULONG HardwareTrigger;
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
PMM_AVL_TABLE PhysicalVadroot;
#else
MM_AVL_TABLE PhysicalVadroot; MM_AVL_TABLE PhysicalVadroot;
#endif
PVOID CloneRoot; PVOID CloneRoot;
ULONG NumberOfPrivatePages; ULONG NumberOfPrivatePages;
ULONG NumberOfLockedPages; ULONG NumberOfLockedPages;
@ -1217,7 +1212,6 @@ typedef struct _EPROCESS
PVOID VdmObjects; PVOID VdmObjects;
PVOID DeviceMap; PVOID DeviceMap;
#if (NTDDI_VERSION >= NTDDI_LONGHORN) #if (NTDDI_VERSION >= NTDDI_LONGHORN)
ULONG AlpcPagedPoolQuotaCache;
PVOID EtwDataSource; PVOID EtwDataSource;
PVOID FreeTebHint; PVOID FreeTebHint;
#else #else
@ -1351,7 +1345,6 @@ typedef struct _EPROCESS
MM_AVL_TABLE VadRoot; MM_AVL_TABLE VadRoot;
ULONG Cookie; ULONG Cookie;
} EPROCESS; } EPROCESS;
#include <poppack.h>
// //
// Job Token Filter Data // Job Token Filter Data

View file

@ -2768,7 +2768,17 @@ RtlCheckRegistryKey(
NTSYSAPI NTSYSAPI
NTSTATUS NTSTATUS
NTAPI NTAPI
RtlFormatCurrentUserKeyPath(IN OUT PUNICODE_STRING KeyPath); RtlCreateRegistryKey(
IN ULONG RelativeTo,
IN PWSTR Path
);
NTSYSAPI
NTSTATUS
NTAPI
RtlFormatCurrentUserKeyPath(
IN OUT PUNICODE_STRING KeyPath
);
NTSYSAPI NTSYSAPI
NTSTATUS NTSTATUS

View file

@ -160,6 +160,15 @@ typedef struct _OBJECT_ATTRIBUTES
PVOID SecurityQualityOfService; PVOID SecurityQualityOfService;
} OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES; } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
//
// ClientID Structure
//
typedef struct _CLIENT_ID
{
HANDLE UniqueProcess;
HANDLE UniqueThread;
} CLIENT_ID, *PCLIENT_ID;
typedef const UNICODE_STRING* PCUNICODE_STRING; typedef const UNICODE_STRING* PCUNICODE_STRING;
typedef STRING ANSI_STRING; typedef STRING ANSI_STRING;
typedef PSTRING PANSI_STRING; typedef PSTRING PANSI_STRING;

View file

@ -2712,7 +2712,7 @@ NtGdiSetRectRgn(HRGN hRgn,
HRGN STDCALL HRGN STDCALL
NtGdiUnionRectWithRgn(HRGN hDest, CONST PRECT UnsafeRect) NtGdiUnionRectWithRgn(HRGN hDest, CONST PRECT UnsafeRect)
{ {
RECT SafeRect; RECT SafeRect = {0};
PROSRGNDATA Rgn; PROSRGNDATA Rgn;
NTSTATUS Status = STATUS_SUCCESS; NTSTATUS Status = STATUS_SUCCESS;