Author: fireball
Date: Sat Aug 4 12:26:58 2007
New Revision: 28151
URL:
http://svn.reactos.org/svn/reactos?rev=28151&view=rev
Log:
- WDK and MSVC compatibility fixes.
Modified:
trunk/reactos/dll/win32/kernel32/misc/handle.c
trunk/reactos/dll/win32/msafd/misc/dllmain.c
trunk/reactos/include/ddk/ntifs.h
trunk/reactos/include/ddk/winddk.h
trunk/reactos/include/ndk/haltypes.h
trunk/reactos/include/ndk/ketypes.h
trunk/reactos/include/ndk/mmtypes.h
trunk/reactos/include/ndk/obtypes.h
trunk/reactos/include/ndk/psfuncs.h
trunk/reactos/include/ndk/pstypes.h
trunk/reactos/include/psdk/ntdef.h
trunk/reactos/ntoskrnl/config/cmindex.c
trunk/reactos/ntoskrnl/config/cmvalche.c
trunk/reactos/ntoskrnl/include/internal/ps.h
trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c
trunk/reactos/ntoskrnl/ob/oblife.c
trunk/reactos/ntoskrnl/po/events.c
Modified: trunk/reactos/dll/win32/kernel32/misc/handle.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/ha…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/handle.c (original)
+++ trunk/reactos/dll/win32/kernel32/misc/handle.c Sat Aug 4 12:26:58 2007
@@ -54,7 +54,7 @@
}
Status = NtQueryObject (hObject,
- ObjectHandleInformation,
+ ObjectHandleFlagInformation,
&HandleInfo,
sizeof(OBJECT_HANDLE_ATTRIBUTE_INFORMATION),
&BytesWritten);
@@ -106,7 +106,7 @@
}
Status = NtQueryObject (hObject,
- ObjectHandleInformation,
+ ObjectHandleFlagInformation,
&HandleInfo,
sizeof(OBJECT_HANDLE_ATTRIBUTE_INFORMATION),
&BytesWritten);
@@ -118,7 +118,7 @@
HandleInfo.ProtectFromClose = (dwFlags & HANDLE_FLAG_PROTECT_FROM_CLOSE) != 0;
Status = NtSetInformationObject (hObject,
- ObjectHandleInformation,
+ ObjectHandleFlagInformation,
&HandleInfo,
sizeof(OBJECT_HANDLE_ATTRIBUTE_INFORMATION));
if(!NT_SUCCESS(Status))
Modified: trunk/reactos/dll/win32/msafd/misc/dllmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/misc/dllma…
==============================================================================
--- trunk/reactos/dll/win32/msafd/misc/dllmain.c (original)
+++ trunk/reactos/dll/win32/msafd/misc/dllmain.c Sat Aug 4 12:26:58 2007
@@ -1903,7 +1903,7 @@
HandleFlags.ProtectFromClose = TRUE;
HandleFlags.Inherit = FALSE;
Status = NtSetInformationObject(SockAsyncCompletionPort,
- ObjectHandleInformation,
+ ObjectHandleFlagInformation,
&HandleFlags,
sizeof(HandleFlags));
}
@@ -2014,7 +2014,7 @@
HandleFlags.ProtectFromClose = TRUE;
HandleFlags.Inherit = FALSE;
Status = NtSetInformationObject(SockAsyncCompletionPort,
- ObjectHandleInformation,
+ ObjectHandleFlagInformation,
&HandleFlags,
sizeof(HandleFlags));
Modified: trunk/reactos/include/ddk/ntifs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntifs.h?rev=28…
==============================================================================
--- trunk/reactos/include/ddk/ntifs.h (original)
+++ trunk/reactos/include/ddk/ntifs.h Sat Aug 4 12:26:58 2007
@@ -609,13 +609,31 @@
StorageTypeStream
} FILE_STORAGE_TYPE;
-typedef enum _OBJECT_INFO_CLASS {
- ObjectBasicInfo,
- ObjectNameInfo,
- ObjectTypeInfo,
- ObjectAllTypesInfo,
- ObjectProtectionInfo
-} OBJECT_INFO_CLASS;
+typedef enum _OBJECT_INFORMATION_CLASS
+{
+ ObjectBasicInformation,
+ ObjectNameInformation,
+ ObjectTypeInformation,
+ ObjectTypesInformation,
+ ObjectHandleFlagInformation,
+ ObjectSessionInformation,
+ MaxObjectInfoClass
+} OBJECT_INFORMATION_CLASS;
+
+typedef struct _OBJECT_BASIC_INFORMATION
+{
+ ULONG Attributes;
+ ACCESS_MASK GrantedAccess;
+ ULONG HandleCount;
+ ULONG PointerCount;
+ ULONG PagedPoolCharge;
+ ULONG NonPagedPoolCharge;
+ ULONG Reserved[ 3 ];
+ ULONG NameInfoSize;
+ ULONG TypeInfoSize;
+ ULONG SecurityDescriptorSize;
+ LARGE_INTEGER CreationTime;
+} OBJECT_BASIC_INFORMATION, *POBJECT_BASIC_INFORMATION;
typedef struct _KAPC_STATE {
LIST_ENTRY ApcListHead[2];
Modified: trunk/reactos/include/ddk/winddk.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/winddk.h?rev=2…
==============================================================================
--- trunk/reactos/include/ddk/winddk.h (original)
+++ trunk/reactos/include/ddk/winddk.h Sat Aug 4 12:26:58 2007
@@ -9942,6 +9942,11 @@
VOID);
NTKERNELAPI
+HANDLE
+NTAPI
+PsGetProcessId(PEPROCESS Process);
+
+NTKERNELAPI
BOOLEAN
NTAPI
PsGetVersion(
Modified: trunk/reactos/include/ndk/haltypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/haltypes.h?rev…
==============================================================================
--- trunk/reactos/include/ndk/haltypes.h (original)
+++ trunk/reactos/include/ndk/haltypes.h Sat Aug 4 12:26:58 2007
@@ -224,10 +224,11 @@
// HAL Exports
//
#ifndef _NTHAL_
-extern DECL_IMPORT PUCHAR *KdComPortInUse;
-#endif
-
-#endif
-#endif
-
-
+extern NTHALAPI PUCHAR *KdComPortInUse;
+#endif
+
+#endif
+#endif
+
+
+
Modified: trunk/reactos/include/ndk/ketypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/ketypes.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/ketypes.h (original)
+++ trunk/reactos/include/ndk/ketypes.h Sat Aug 4 12:26:58 2007
@@ -936,7 +936,7 @@
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
PVOID MdlForLockedteb;
#endif
-} KTHREAD;
+} KTHREAD, *PKTHREAD;
#define ASSERT_THREAD(object) \
ASSERT((((object)->DispatcherHeader.Type & KOBJECT_TYPE_MASK) ==
ThreadObject))
Modified: trunk/reactos/include/ndk/mmtypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/mmtypes.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/mmtypes.h (original)
+++ trunk/reactos/include/ndk/mmtypes.h Sat Aug 4 12:26:58 2007
@@ -58,6 +58,7 @@
#define MEM_PHYSICAL 0x400000
#define MEM_ROTATE 0x800000
#define MEM_IMAGE SEC_IMAGE
+#define MEM_DOS_LIM 0x40000000
//
// Section Flags for NtCreateSection
Modified: trunk/reactos/include/ndk/obtypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/obtypes.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/obtypes.h (original)
+++ trunk/reactos/include/ndk/obtypes.h Sat Aug 4 12:26:58 2007
@@ -72,6 +72,20 @@
//
#define OBJ_NAME_PATH_SEPARATOR L'\\'
+//
+// Object Information Classes for NtQueryInformationObject
+//
+typedef enum _OBJECT_INFORMATION_CLASS
+{
+ ObjectBasicInformation,
+ ObjectNameInformation,
+ ObjectTypeInformation,
+ ObjectTypesInformation,
+ ObjectHandleFlagInformation,
+ ObjectSessionInformation,
+ MaxObjectInfoClass
+} OBJECT_INFORMATION_CLASS;
+
#else
//
@@ -145,18 +159,6 @@
#define DOSDEVICE_DRIVE_REMOTE 4
#define DOSDEVICE_DRIVE_CDROM 5
#define DOSDEVICE_DRIVE_RAMDISK 6
-
-//
-// Object Information Classes for NtQueryInformationObject
-//
-typedef enum _OBJECT_INFORMATION_CLASS
-{
- ObjectBasicInformation,
- ObjectNameInformation,
- ObjectTypeInformation,
- ObjectAllTypesInformation,
- ObjectHandleInformation
-} OBJECT_INFORMATION_CLASS;
//
// Dump Control Structure for Object Debugging
@@ -297,7 +299,7 @@
ULONG DefaultNonPagedPoolCharge;
} OBJECT_TYPE_INFORMATION, *POBJECT_TYPE_INFORMATION;
-#ifndef NTOS_MODE_USER
+#ifdef NTOS_MODE_USER
typedef struct _OBJECT_BASIC_INFORMATION
{
@@ -313,6 +315,8 @@
ULONG SecurityDescriptorLength;
LARGE_INTEGER CreateTime;
} OBJECT_BASIC_INFORMATION, *POBJECT_BASIC_INFORMATION;
+
+#else
typedef struct _OBJECT_CREATE_INFORMATION
{
Modified: trunk/reactos/include/ndk/psfuncs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/psfuncs.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/psfuncs.h (original)
+++ trunk/reactos/include/ndk/psfuncs.h Sat Aug 4 12:26:58 2007
@@ -117,11 +117,6 @@
//
// Misc. Functions
//
-NTKERNELAPI
-HANDLE
-NTAPI
-PsGetProcessId(PEPROCESS Process);
-
NTKERNELAPI
NTSTATUS
NTAPI
Modified: trunk/reactos/include/ndk/pstypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/pstypes.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/pstypes.h (original)
+++ trunk/reactos/include/ndk/pstypes.h Sat Aug 4 12:26:58 2007
@@ -35,16 +35,6 @@
// KUSER_SHARED_DATA location in User Mode
//
#define USER_SHARED_DATA (0x7FFE0000)
-
-//
-// Kernel Exports
-//
-#ifndef NTOS_MODE_USER
-
-//extern NTSYSAPI struct _EPROCESS* PsInitialSystemProcess;
-//extern NTSYSAPI POBJECT_TYPE PsProcessType;
-
-#endif
//
// Global Flags
@@ -423,7 +413,7 @@
//
struct _W32THREAD;
struct _W32PROCESS;
-struct _ETHREAD;
+//struct _ETHREAD;
struct _WIN32_POWEREVENT_PARAMETERS;
struct _WIN32_POWERSTATE_PARAMETERS;
struct _WIN32_JOBCALLOUT_PARAMETERS;
@@ -1148,7 +1138,7 @@
KSEMAPHORE AlpcWaitSemaphore;
ULONG CacheManagerCount;
#endif
-} ETHREAD;
+} ETHREAD, *PETHREAD;
//
// Executive Process (EPROCESS)
@@ -1344,7 +1334,7 @@
UCHAR PriorityClass;
MM_AVL_TABLE VadRoot;
ULONG Cookie;
-} EPROCESS;
+} EPROCESS, *PEPROCESS;
//
// Job Token Filter Data
Modified: trunk/reactos/include/psdk/ntdef.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntdef.h?rev=2…
==============================================================================
--- trunk/reactos/include/psdk/ntdef.h (original)
+++ trunk/reactos/include/psdk/ntdef.h Sat Aug 4 12:26:58 2007
@@ -3,7 +3,11 @@
#if __GNUC__ >=3
#pragma GCC system_header
#endif
-
+
+#include <stdarg.h>
+#include <windef.h>
+#include <excpt.h>
+
/* TODO: some compilers support this */
#define RESTRICTED_POINTER
Modified: trunk/reactos/ntoskrnl/config/cmindex.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmindex.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmindex.c (original)
+++ trunk/reactos/ntoskrnl/config/cmindex.c Sat Aug 4 12:26:58 2007
@@ -722,7 +722,7 @@
HvReleaseCell(Hive, CellToRelease);
/* Make sure we found something valid */
- if (Found < 0) break;
+ if (Found & 0x80000000) break;
/* Get the new Index Root and set the new cell to be released */
if (SubKey == HCELL_NIL) continue;
@@ -749,7 +749,7 @@
HvReleaseCell(Hive, CellToRelease);
/* Make sure we found a valid index */
- if (Found < 0) break;
+ if (Found & 0x80000000) break;
}
else
{
Modified: trunk/reactos/ntoskrnl/config/cmvalche.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmvalche.c…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmvalche.c (original)
+++ trunk/reactos/ntoskrnl/config/cmvalche.c Sat Aug 4 12:26:58 2007
@@ -512,7 +512,8 @@
Info->KeyValueFullInformation.DataOffset = AlignedData;
/* Only the data remains to be copied */
- SizeLeft = max(0, Length - AlignedData);
+ SizeLeft = (((LONG)Length - (LONG)AlignedData) < 0) ?
+ 0 : (Length - AlignedData);
Size = KeySize;
/* Check if the caller has no space for it */
Modified: trunk/reactos/ntoskrnl/include/internal/ps.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/ps.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/ps.h Sat Aug 4 12:26:58 2007
@@ -358,7 +358,6 @@
extern LIST_ENTRY PspReaperListHead;
extern WORK_QUEUE_ITEM PspReaperWorkItem;
extern BOOLEAN PspReaping;
-extern PEPROCESS PsInitialSystemProcess;
extern PEPROCESS PsIdleProcess;
extern LIST_ENTRY PsActiveProcessHead;
extern KGUARDED_MUTEX PspActiveProcessMutex;
Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnproot…
==============================================================================
--- trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c (original)
+++ trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c Sat Aug 4 12:26:58 2007
@@ -328,7 +328,7 @@
PPNPROOT_FDO_DEVICE_EXTENSION DeviceExtension;
OBJECT_ATTRIBUTES ObjectAttributes;
PKEY_BASIC_INFORMATION KeyInfo = NULL, SubKeyInfo = NULL;
- UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\"
REGSTR_PATH_SYSTEMENUM "\\" REGSTR_KEY_ROOTENUM);
+ UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\"
REGSTR_PATH_SYSTEMENUM L"\\" REGSTR_KEY_ROOTENUM);
UNICODE_STRING SubKeyName;
WCHAR DevicePath[MAX_PATH + 1];
RTL_QUERY_REGISTRY_TABLE QueryTable[5];
Modified: trunk/reactos/ntoskrnl/ob/oblife.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/oblife.c?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/ob/oblife.c (original)
+++ trunk/reactos/ntoskrnl/ob/oblife.c Sat Aug 4 12:26:58 2007
@@ -1411,7 +1411,7 @@
* Make sure this isn't a generic type query, since the caller doesn't
* have to give a handle for it
*/
- if (ObjectInformationClass != ObjectAllTypesInformation)
+ if (ObjectInformationClass != ObjectTypesInformation)
{
/* Reference the object */
Status = ObReferenceObjectByHandle(ObjectHandle,
@@ -1463,27 +1463,27 @@
}
/* Copy quota information */
- BasicInfo->PagedPoolUsage = 0; /* FIXME*/
- BasicInfo->NonPagedPoolUsage = 0; /* FIXME*/
+ BasicInfo->PagedPoolCharge = 0; /* FIXME*/
+ BasicInfo->NonPagedPoolCharge = 0; /* FIXME*/
/* Copy name information */
- BasicInfo->NameInformationLength = 0; /* FIXME*/
- BasicInfo->TypeInformationLength = 0; /* FIXME*/
+ BasicInfo->NameInfoSize = 0; /* FIXME*/
+ BasicInfo->TypeInfoSize = 0; /* FIXME*/
/* Copy security information */
- BasicInfo->SecurityDescriptorLength = 0; /* FIXME*/
+ BasicInfo->SecurityDescriptorSize = 0; /* FIXME*/
/* Check if this is a symlink */
if (ObjectHeader->Type == ObSymbolicLinkType)
{
/* Return the creation time */
- BasicInfo->CreateTime.QuadPart =
+ BasicInfo->CreationTime.QuadPart =
((POBJECT_SYMBOLIC_LINK)Object)->CreationTime.QuadPart;
}
else
{
/* Otherwise return 0 */
- BasicInfo->CreateTime.QuadPart = (ULONGLONG)0;
+ BasicInfo->CreationTime.QuadPart = (ULONGLONG)0;
}
/* Break out with success */
@@ -1513,13 +1513,13 @@
break;
/* Information about all types */
- case ObjectAllTypesInformation:
+ case ObjectTypesInformation:
DPRINT1("NOT IMPLEMENTED!\n");
Status = STATUS_NOT_IMPLEMENTED;
break;
/* Information about the handle flags */
- case ObjectHandleInformation:
+ case ObjectHandleFlagInformation:
/* Validate length */
InfoLength = sizeof (OBJECT_HANDLE_ATTRIBUTE_INFORMATION);
@@ -1609,7 +1609,7 @@
PAGED_CODE();
/* Validate the information class */
- if (ObjectInformationClass != ObjectHandleInformation)
+ if (ObjectInformationClass != ObjectHandleFlagInformation)
{
/* Invalid class */
return STATUS_INVALID_INFO_CLASS;
Modified: trunk/reactos/ntoskrnl/po/events.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/po/events.c?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/po/events.c (original)
+++ trunk/reactos/ntoskrnl/po/events.c Sat Aug 4 12:26:58 2007
@@ -100,7 +100,7 @@
IN PVOID Context)
{
PSYS_BUTTON_CONTEXT SysButtonContext = Context;
- PIO_WORKITEM CurrentWorkItem = SysButtonContext->WorkItem;;
+ PIO_WORKITEM CurrentWorkItem = SysButtonContext->WorkItem;
PIRP Irp;
/* Get button pressed (IOCTL_GET_SYS_BUTTON_EVENT) */