2003-06-01 Casper S. Hornstrup <chorns@users.sourceforge.net>

Changes for compiling with w32api

	* include/ntos/zwtypes.h (SYSTEM_MODULES): Rename to
	SYSTEM_MODULE_INFORMATION. Match w32api structure fieldnames.
	(SYSTEM_MODULE_INFORMATION):  Rename to SYSTEM_MODULE_INFORMATION_ENTRY.
	Match w32api structure fieldnames.
	* include/epsapi.h: Include <ntos.h>.
	(PSYSMOD_ENUM_ROUTINE, PsaCaptureSystemModules, PsaWalkSystemModules,
	PsaWalkFirstSystemModule, PsaWalkNextSystemModule): Use
	SYSTEM_MODULE_INFORMATION_ENTRY and SYSTEM_MODULE_INFORMATION structures.
	* lib/epsapi/enum/drivers.c: Use SYSTEM_MODULE_INFORMATION_ENTRY and
	SYSTEM_MODULE_INFORMATION structures.
	* lib/psapi/misc/win32.c: Ditto.
	* ntoskrnl/ldr/loader.c: Ditto.
	* lib/epsapi/enum/modules.c: Include <ntos.h>.
	* lib/ntdll/rtl/thread.c: Ditto.
	* lib/rosrtl/thread/context.c: Ditto.
	* lib/rosrtl/thread/create.c: Ditto.
	* lib/rosrtl/thread/stack.c: Ditto.
	* include/ntos.h: Include "rosrtl/thread.h".
	* include/structs.h (_BLOB_DEFINED): Rename to __BLOB_T_DEFINED.
	* include/winsock2.h: Ditto.
	* include/ntos/obtypes.h (POBJECT_TYPE): Make a pointer to struct
	_OBJECT_TYPE.
	(PHANDLE_TABLE): Make a pointer to struct _HANDLE_TABLE.
	* ntoskrnl/include/internal/mm.h (PSECTION_OBJECT): Make a pointer to
	struct _SECTION_OBJECT.
	* ntoskrnl/include/internal/i386/ps.h (PKPCR): Make a pointer to struct
	_KPCR.

svn path=/trunk/; revision=4807
This commit is contained in:
Casper Hornstrup 2003-06-01 14:59:02 +00:00
parent 17c104a163
commit 05a9cdcf10
17 changed files with 151 additions and 102 deletions

View file

@ -1,3 +1,35 @@
2003-06-01 Casper S. Hornstrup <chorns@users.sourceforge.net>
Changes for compiling with w32api
* include/ntos/zwtypes.h (SYSTEM_MODULES): Rename to
SYSTEM_MODULE_INFORMATION. Match w32api structure fieldnames.
(SYSTEM_MODULE_INFORMATION): Rename to SYSTEM_MODULE_INFORMATION_ENTRY.
Match w32api structure fieldnames.
* include/epsapi.h: Include <ntos.h>.
(PSYSMOD_ENUM_ROUTINE, PsaCaptureSystemModules, PsaWalkSystemModules,
PsaWalkFirstSystemModule, PsaWalkNextSystemModule): Use
SYSTEM_MODULE_INFORMATION_ENTRY and SYSTEM_MODULE_INFORMATION structures.
* lib/epsapi/enum/drivers.c: Use SYSTEM_MODULE_INFORMATION_ENTRY and
SYSTEM_MODULE_INFORMATION structures.
* lib/psapi/misc/win32.c: Ditto.
* ntoskrnl/ldr/loader.c: Ditto.
* lib/epsapi/enum/modules.c: Include <ntos.h>.
* lib/ntdll/rtl/thread.c: Ditto.
* lib/rosrtl/thread/context.c: Ditto.
* lib/rosrtl/thread/create.c: Ditto.
* lib/rosrtl/thread/stack.c: Ditto.
* include/ntos.h: Include "rosrtl/thread.h".
* include/structs.h (_BLOB_DEFINED): Rename to __BLOB_T_DEFINED.
* include/winsock2.h: Ditto.
* include/ntos/obtypes.h (POBJECT_TYPE): Make a pointer to struct
_OBJECT_TYPE.
(PHANDLE_TABLE): Make a pointer to struct _HANDLE_TABLE.
* ntoskrnl/include/internal/mm.h (PSECTION_OBJECT): Make a pointer to
struct _SECTION_OBJECT.
* ntoskrnl/include/internal/i386/ps.h (PKPCR): Make a pointer to struct
_KPCR.
2003-05-28 Casper S. Hornstrup <chorns@users.sourceforge.net> 2003-05-28 Casper S. Hornstrup <chorns@users.sourceforge.net>
* Makefile: Update bootcd target. * Makefile: Update bootcd target.

View file

@ -1,4 +1,4 @@
/* $Id: epsapi.h,v 1.2 2003/04/13 03:57:41 hyperion Exp $ /* $Id: epsapi.h,v 1.3 2003/06/01 14:59:01 chorns Exp $
*/ */
/* /*
* epsapi.h * epsapi.h
@ -26,8 +26,8 @@
#define __INTERNAL_PSAPI_H_INCLUDED__ #define __INTERNAL_PSAPI_H_INCLUDED__
/* INCLUDES */ /* INCLUDES */
#include <ddk/ntddk.h> #define NTOS_MODE_USER
#include <ntdll/ldr.h> #include <ntos.h>
/* OBJECTS */ /* OBJECTS */
@ -46,7 +46,7 @@ typedef NTSTATUS NTAPI (*PTHREAD_ENUM_ROUTINE)
typedef NTSTATUS NTAPI (*PSYSMOD_ENUM_ROUTINE) typedef NTSTATUS NTAPI (*PSYSMOD_ENUM_ROUTINE)
( (
IN PSYSTEM_MODULE_INFORMATION CurrentModule, IN PSYSTEM_MODULE_INFORMATION_ENTRY CurrentModule,
IN OUT PVOID CallbackContext IN OUT PVOID CallbackContext
); );
@ -169,26 +169,26 @@ NTSTATUS
NTAPI NTAPI
PsaCaptureSystemModules PsaCaptureSystemModules
( (
OUT PSYSTEM_MODULES * SystemModules OUT PSYSTEM_MODULE_INFORMATION * SystemModules
); );
NTSTATUS NTSTATUS
NTAPI NTAPI
PsaWalkSystemModules PsaWalkSystemModules
( (
IN PSYSTEM_MODULES SystemModules, IN PSYSTEM_MODULE_INFORMATION SystemModules,
IN PSYSMOD_ENUM_ROUTINE Callback, IN PSYSMOD_ENUM_ROUTINE Callback,
IN OUT PVOID CallbackContext IN OUT PVOID CallbackContext
); );
PSYSTEM_MODULE_INFORMATION PSYSTEM_MODULE_INFORMATION_ENTRY
FASTCALL FASTCALL
PsaWalkFirstSystemModule PsaWalkFirstSystemModule
( (
IN PSYSTEM_MODULES SystemModules IN PSYSTEM_MODULE_INFORMATION SystemModules
); );
PSYSTEM_MODULE_INFORMATION PSYSTEM_MODULE_INFORMATION_ENTRY
FASTCALL FASTCALL
PsaWalkNextSystemModule PsaWalkNextSystemModule
( (

View file

@ -1,6 +1,6 @@
#ifndef _NTOS_H #ifndef _NTOS_H
#define _NTOS_H #define _NTOS_H
/* $Id: ntos.h,v 1.9 2003/05/28 18:09:09 chorns Exp $ */ /* $Id: ntos.h,v 1.10 2003/06/01 14:59:01 chorns Exp $ */
#if defined(NTOS_MODE_USER) #if defined(NTOS_MODE_USER)
// include windows.h before ntddk.h to get user mode prototype for InterlockedXxx functions // include windows.h before ntddk.h to get user mode prototype for InterlockedXxx functions
@ -44,10 +44,10 @@
#include "ntdll/registry.h" #include "ntdll/registry.h"
#include "ntdll/rtl.h" #include "ntdll/rtl.h"
#include "ntdll/trace.h" #include "ntdll/trace.h"
#include "rosrtl/thread.h"
#include "kernel32/error.h" #include "kernel32/error.h"
#else // Assume kernel mode #else // Assume kernel mode
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
//#include "ntos/types.h" // robd
#include <ddk/ntifs.h> #include <ddk/ntifs.h>
#include "ntos/types.h" #include "ntos/types.h"
#include "ntos/cdrom.h" #include "ntos/cdrom.h"
@ -83,6 +83,7 @@
#include "ntos/haltypes.h" #include "ntos/haltypes.h"
#include "ntos/obtypes.h" #include "ntos/obtypes.h"
#include "ntos/tss.h" #include "ntos/tss.h"
#include "rosrtl/thread.h"
#endif #endif
#endif /* ndef _NTOS_H */ #endif /* ndef _NTOS_H */

View file

@ -1,6 +1,6 @@
#ifndef _INCLUDE_DDK_OBTYPES_H #ifndef _INCLUDE_DDK_OBTYPES_H
#define _INCLUDE_DDK_OBTYPES_H #define _INCLUDE_DDK_OBTYPES_H
/* $Id: obtypes.h,v 1.1 2003/05/28 18:35:35 chorns Exp $ */ /* $Id: obtypes.h,v 1.2 2003/06/01 14:59:01 chorns Exp $ */
struct _DIRECTORY_OBJECT; struct _DIRECTORY_OBJECT;
struct _OBJECT_ATTRIBUTES; struct _OBJECT_ATTRIBUTES;
@ -128,7 +128,13 @@ typedef struct _OBJECT_TYPE
VOID STDCALL_FUNC (*DuplicationNotify)(PEPROCESS DuplicateTo, VOID STDCALL_FUNC (*DuplicationNotify)(PEPROCESS DuplicateTo,
PEPROCESS DuplicateFrom, PEPROCESS DuplicateFrom,
PVOID Object); PVOID Object);
} OBJECT_TYPE, *POBJECT_TYPE; } OBJECT_TYPE;
#ifndef __USE_W32API
typedef struct _OBJECT_TYPE *POBJECT_TYPE;
#endif /* __USE_W32API */
typedef struct _OBJECT_HEADER typedef struct _OBJECT_HEADER
@ -178,7 +184,13 @@ typedef struct _HANDLE_TABLE
{ {
LIST_ENTRY ListHead; LIST_ENTRY ListHead;
KSPIN_LOCK ListLock; KSPIN_LOCK ListLock;
} HANDLE_TABLE, *PHANDLE_TABLE; } HANDLE_TABLE;
#ifndef __USE_W32API
typedef struct _HANDLE_TABLE *PHANDLE_TABLE;
#endif /* __USE_W32API */
extern POBJECT_TYPE ObDirectoryType; extern POBJECT_TYPE ObDirectoryType;

View file

@ -311,37 +311,25 @@ struct _SYSTEM_PERFORMANCE_INFORMATION
} SYSTEM_PERFORMANCE_INFO, *PSYSTEM_PERFORMANCE_INFO; } SYSTEM_PERFORMANCE_INFO, *PSYSTEM_PERFORMANCE_INFO;
// SystemModuleInformation (11) // SystemModuleInformation (11)
typedef typedef struct _SYSTEM_MODULE_INFORMATION_ENTRY {
struct _SYSTEM_MODULE_INFORMATION
{
ULONG Reserved[2];
PVOID Base;
SIZE_T Size;
ULONG Flags;
USHORT Index;
USHORT Unknown;
USHORT LoadCount;
USHORT ModuleNameOffset;
CHAR ImageName[256];
#if 0
ULONG Unknown1; ULONG Unknown1;
ULONG Unknown2; ULONG Unknown2;
PVOID BaseAddress; PVOID Base;
ULONG Size; ULONG Size;
ULONG Flags; ULONG Flags;
ULONG EntryIndex; USHORT Index;
USHORT NameLength; /* Length of module name not including the path, this field contains valid value only for NTOSKRNL module*/ /* Length of module name not including the path, this
USHORT PathLength; /* Length of 'directory path' part of modulename*/ field contains valid value only for NTOSKRNL module */
CHAR Name [256]; USHORT NameLength;
#endif USHORT LoadCount;
} SYSTEM_MODULE_INFORMATION, * PSYSTEM_MODULE_INFORMATION; USHORT PathLength;
CHAR ImageName[256];
} SYSTEM_MODULE_INFORMATION_ENTRY, *PSYSTEM_MODULE_INFORMATION_ENTRY;
typedef typedef struct _SYSTEM_MODULE_INFORMATION {
struct _SYSTEM_MODULES ULONG Count;
{ SYSTEM_MODULE_INFORMATION_ENTRY Module[1];
SIZE_T Count; } SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;
SYSTEM_MODULE_INFORMATION Modules[ANYSIZE_ARRAY];
} SYSTEM_MODULES, *PSYSTEM_MODULES;
// SystemHandleInformation (16) // SystemHandleInformation (16)
// (see ontypes.h) // (see ontypes.h)

View file

@ -282,8 +282,8 @@ typedef struct {
DWORD bV4GammaBlue; DWORD bV4GammaBlue;
} BITMAPV4HEADER, *LPBITMAPV4HEADER, *PBITMAPV4HEADER; } BITMAPV4HEADER, *LPBITMAPV4HEADER, *PBITMAPV4HEADER;
#ifndef _BLOB_DEFINED #ifndef __BLOB_T_DEFINED
#define _BLOB_DEFINED #define __BLOB_T_DEFINED
typedef struct _BLOB { typedef struct _BLOB {
ULONG cbSize; ULONG cbSize;
BYTE *pBlobData; BYTE *pBlobData;

View file

@ -650,8 +650,8 @@ typedef struct WSAData {
CHAR FAR* lpVendorInfo; CHAR FAR* lpVendorInfo;
} WSADATA, FAR* LPWSADATA; } WSADATA, FAR* LPWSADATA;
#ifndef _BLOB_DEFINED #ifndef __BLOB_T_DEFINED
#define _BLOB_DEFINED #define __BLOB_T_DEFINED
typedef struct _BLOB { typedef struct _BLOB {
ULONG cbSize; ULONG cbSize;
BYTE *pBlobData; BYTE *pBlobData;

View file

@ -1,4 +1,4 @@
/* $Id: drivers.c,v 1.1 2003/04/13 03:24:27 hyperion Exp $ /* $Id: drivers.c,v 1.2 2003/06/01 14:59:01 chorns Exp $
*/ */
/* /*
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
@ -14,9 +14,12 @@
* and improve reusability * and improve reusability
*/ */
#include <ddk/ntddk.h>
#include <debug.h>
#include <stddef.h> #include <stddef.h>
#define NTOS_MODE_USER
#include <ntos.h>
#define NDEBUG
#include <debug.h>
#include <epsapi.h> #include <epsapi.h>
@ -29,7 +32,7 @@ PsaEnumerateSystemModules
) )
{ {
register NTSTATUS nErrCode = STATUS_SUCCESS; register NTSTATUS nErrCode = STATUS_SUCCESS;
PSYSTEM_MODULES psmModules = NULL; PSYSTEM_MODULE_INFORMATION psmModules = NULL;
#if 0 #if 0
__try __try
@ -67,12 +70,12 @@ NTSTATUS
NTAPI NTAPI
PsaCaptureSystemModules PsaCaptureSystemModules
( (
OUT PSYSTEM_MODULES * SystemModules OUT PSYSTEM_MODULE_INFORMATION * SystemModules
) )
{ {
SIZE_T nSize = 0; SIZE_T nSize = 0;
register NTSTATUS nErrCode; register NTSTATUS nErrCode;
register PSYSTEM_MODULES psmModules = (PSYSTEM_MODULES)&nSize; register PSYSTEM_MODULE_INFORMATION psmModules = (PSYSTEM_MODULE_INFORMATION)&nSize;
#if 0 #if 0
__try __try
@ -174,7 +177,7 @@ NTSTATUS
NTAPI NTAPI
PsaWalkSystemModules PsaWalkSystemModules
( (
IN PSYSTEM_MODULES SystemModules, IN PSYSTEM_MODULE_INFORMATION SystemModules,
IN PSYSMOD_ENUM_ROUTINE Callback, IN PSYSMOD_ENUM_ROUTINE Callback,
IN OUT PVOID CallbackContext IN OUT PVOID CallbackContext
) )
@ -186,7 +189,7 @@ PsaWalkSystemModules
for(i = 0; i < SystemModules->Count; ++ i) for(i = 0; i < SystemModules->Count; ++ i)
{ {
/* return current module to the callback */ /* return current module to the callback */
nErrCode = Callback(&(SystemModules->Modules[i]), CallbackContext); nErrCode = Callback(&(SystemModules->Module[i]), CallbackContext);
if(!NT_SUCCESS(nErrCode)) if(!NT_SUCCESS(nErrCode))
/* failure */ /* failure */
@ -197,29 +200,29 @@ PsaWalkSystemModules
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
PSYSTEM_MODULE_INFORMATION PSYSTEM_MODULE_INFORMATION_ENTRY
FASTCALL FASTCALL
PsaWalkFirstSystemModule PsaWalkFirstSystemModule
( (
IN PSYSTEM_MODULES SystemModules IN PSYSTEM_MODULE_INFORMATION SystemModules
) )
{ {
return &(SystemModules->Modules[0]); return &(SystemModules->Module[0]);
} }
PSYSTEM_MODULE_INFORMATION PSYSTEM_MODULE_INFORMATION_ENTRY
FASTCALL FASTCALL
PsaWalkNextSystemModule PsaWalkNextSystemModule
( (
IN PSYSTEM_MODULE_INFORMATION CurrentSystemModule IN PSYSTEM_MODULE_INFORMATION CurrentSystemModule
) )
{ {
return (PSYSTEM_MODULE_INFORMATION) return (PSYSTEM_MODULE_INFORMATION_ENTRY)
( (
(ULONG_PTR)CurrentSystemModule + (ULONG_PTR)CurrentSystemModule +
( (
offsetof(SYSTEM_MODULES, Modules[1]) - offsetof(SYSTEM_MODULE_INFORMATION, Module[1]) -
offsetof(SYSTEM_MODULES, Modules[0]) offsetof(SYSTEM_MODULE_INFORMATION, Module[0])
) )
); );
} }

View file

@ -1,4 +1,4 @@
/* $Id: modules.c,v 1.1 2003/04/13 03:24:27 hyperion Exp $ /* $Id: modules.c,v 1.2 2003/06/01 14:59:01 chorns Exp $
*/ */
/* /*
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
@ -19,9 +19,11 @@
* and improve reusability * and improve reusability
*/ */
#include <ddk/ntddk.h> #define NTOS_MODE_USER
#include <ntos.h>
#define NDEBUG
#include <debug.h> #include <debug.h>
#include <ntdll/ldr.h>
#include <epsapi.h> #include <epsapi.h>

View file

@ -18,10 +18,8 @@
/* INCLUDES *****************************************************************/ /* INCLUDES *****************************************************************/
#include <ddk/ntddk.h> #define NTOS_MODE_USER
#include <napi/teb.h> #include <ntos.h>
#include <ntdll/rtl.h>
#include <rosrtl/thread.h>
#define NDEBUG #define NDEBUG
#include <ntdll/ntdll.h> #include <ntdll/ntdll.h>

View file

@ -1,4 +1,4 @@
/* $Id: win32.c,v 1.8 2003/04/13 03:24:26 hyperion Exp $ /* $Id: win32.c,v 1.9 2003/06/01 14:59:02 chorns Exp $
*/ */
/* /*
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
@ -73,7 +73,7 @@ typedef struct _ENUM_DEVICE_DRIVERS_CONTEXT
/* callback routine */ /* callback routine */
NTSTATUS STDCALL EnumDeviceDriversCallback NTSTATUS STDCALL EnumDeviceDriversCallback
( (
IN PSYSTEM_MODULE_INFORMATION CurrentModule, IN PSYSTEM_MODULE_INFORMATION_ENTRY CurrentModule,
IN OUT PVOID CallbackContext IN OUT PVOID CallbackContext
) )
{ {
@ -308,7 +308,7 @@ typedef struct _GET_DEVICE_DRIVER_NAME_CONTEXT
/* common callback routine */ /* common callback routine */
NTSTATUS STDCALL GetDeviceDriverNameCallback NTSTATUS STDCALL GetDeviceDriverNameCallback
( (
IN PSYSTEM_MODULE_INFORMATION CurrentModule, IN PSYSTEM_MODULE_INFORMATION_ENTRY CurrentModule,
IN OUT PVOID CallbackContext IN OUT PVOID CallbackContext
) )
{ {
@ -325,7 +325,7 @@ NTSTATUS STDCALL GetDeviceDriverNameCallback
if(pgddncContext->bFullName) if(pgddncContext->bFullName)
pcModuleName = &CurrentModule->ImageName[0]; pcModuleName = &CurrentModule->ImageName[0];
else else
pcModuleName = &CurrentModule->ImageName[CurrentModule->ModuleNameOffset]; pcModuleName = &CurrentModule->ImageName[CurrentModule->PathLength];
/* get the length of the name */ /* get the length of the name */
l = strlen(pcModuleName); l = strlen(pcModuleName);

View file

@ -1,10 +1,10 @@
/* $Id: context.c,v 1.2 2003/05/29 00:36:41 hyperion Exp $ /* $Id: context.c,v 1.3 2003/06/01 14:59:02 chorns Exp $
*/ */
/* /*
*/ */
#include <ddk/ntddk.h> #define NTOS_MODE_USER
#include <rosrtl/thread.h> #include <ntos.h>
#if defined(_M_IX86) #if defined(_M_IX86)
#include <napi/i386/segment.h> #include <napi/i386/segment.h>

View file

@ -1,11 +1,11 @@
/* $Id: create.c,v 1.2 2003/05/29 00:36:41 hyperion Exp $ /* $Id: create.c,v 1.3 2003/06/01 14:59:02 chorns Exp $
*/ */
/* /*
*/ */
#include <stdarg.h> #include <stdarg.h>
#include <ddk/ntddk.h> #define NTOS_MODE_USER
#include <rosrtl/thread.h> #include <ntos.h>
#define NDEBUG #define NDEBUG
#include <ntdll/ntdll.h> #include <ntdll/ntdll.h>

View file

@ -1,10 +1,10 @@
/* $Id: stack.c,v 1.1 2003/05/29 00:36:41 hyperion Exp $ /* $Id: stack.c,v 1.2 2003/06/01 14:59:02 chorns Exp $
*/ */
/* /*
*/ */
#include <ddk/ntddk.h> #define NTOS_MODE_USER
#include <rosrtl/thread.h> #include <ntos.h>
#define NDEBUG #define NDEBUG
#include <ntdll/ntdll.h> #include <ntdll/ntdll.h>

View file

@ -63,7 +63,14 @@ typedef struct _KPCR
KTSS* TSS; /* 28 */ KTSS* TSS; /* 28 */
UCHAR Reserved3[0xF8]; /* 2C */ UCHAR Reserved3[0xF8]; /* 2C */
struct _KTHREAD* CurrentThread; /* 124 */ struct _KTHREAD* CurrentThread; /* 124 */
} __attribute__((packed)) KPCR, *PKPCR; } __attribute__((packed)) KPCR;
#ifndef __USE_W32API
typedef struct _KPCR *PKPCR;
#endif /* __USE_W32API */
#ifndef __USE_W32API #ifndef __USE_W32API

View file

@ -88,7 +88,7 @@ typedef struct _MM_SECTION_SEGMENT
BOOLEAN WriteCopy; BOOLEAN WriteCopy;
} MM_SECTION_SEGMENT, *PMM_SECTION_SEGMENT; } MM_SECTION_SEGMENT, *PMM_SECTION_SEGMENT;
typedef struct typedef struct _SECTION_OBJECT
{ {
CSHORT Type; CSHORT Type;
CSHORT Size; CSHORT Size;
@ -111,7 +111,13 @@ typedef struct
ULONG ImageCharacteristics; ULONG ImageCharacteristics;
USHORT Machine; USHORT Machine;
BOOLEAN Executable; BOOLEAN Executable;
} SECTION_OBJECT, *PSECTION_OBJECT; } SECTION_OBJECT;
#ifndef __USE_W32API
typedef struct _SECTION_OBJECT *PSECTION_OBJECT;
#endif /* __USE_W32API */
typedef struct typedef struct
{ {

View file

@ -1,4 +1,4 @@
/* $Id: loader.c,v 1.130 2003/04/26 23:13:31 hyperion Exp $ /* $Id: loader.c,v 1.131 2003/06/01 14:59:02 chorns Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -594,7 +594,7 @@ LdrpQueryModuleInformation(PVOID Buffer,
PLIST_ENTRY current_entry; PLIST_ENTRY current_entry;
PMODULE_OBJECT current; PMODULE_OBJECT current;
ULONG ModuleCount = 0; ULONG ModuleCount = 0;
PSYSTEM_MODULES Smi; PSYSTEM_MODULE_INFORMATION Smi;
ANSI_STRING AnsiName; ANSI_STRING AnsiName;
PCHAR p; PCHAR p;
KIRQL Irql; KIRQL Irql;
@ -609,8 +609,8 @@ LdrpQueryModuleInformation(PVOID Buffer,
current_entry = current_entry->Flink; current_entry = current_entry->Flink;
} }
*ReqSize = sizeof(SYSTEM_MODULES)+ *ReqSize = sizeof(SYSTEM_MODULE_INFORMATION)+
(ModuleCount - 1) * sizeof(SYSTEM_MODULE_INFORMATION); (ModuleCount - 1) * sizeof(SYSTEM_MODULE_INFORMATION_ENTRY);
if (Size < *ReqSize) if (Size < *ReqSize)
{ {
@ -621,7 +621,7 @@ LdrpQueryModuleInformation(PVOID Buffer,
/* fill the buffer */ /* fill the buffer */
memset(Buffer, '=', Size); memset(Buffer, '=', Size);
Smi = (PSYSTEM_MODULES)Buffer; Smi = (PSYSTEM_MODULE_INFORMATION)Buffer;
Smi->Count = ModuleCount; Smi->Count = ModuleCount;
ModuleCount = 0; ModuleCount = 0;
@ -630,18 +630,18 @@ LdrpQueryModuleInformation(PVOID Buffer,
{ {
current = CONTAINING_RECORD(current_entry,MODULE_OBJECT,ListEntry); current = CONTAINING_RECORD(current_entry,MODULE_OBJECT,ListEntry);
Smi->Modules[ModuleCount].Reserved[0] = 0; /* Always 0 */ Smi->Module[ModuleCount].Unknown1 = 0; /* Always 0 */
Smi->Modules[ModuleCount].Reserved[1] = 0; /* Always 0 */ Smi->Module[ModuleCount].Unknown2 = 0; /* Always 0 */
Smi->Modules[ModuleCount].Base = current->Base; Smi->Module[ModuleCount].Base = current->Base;
Smi->Modules[ModuleCount].Size = current->Length; Smi->Module[ModuleCount].Size = current->Length;
Smi->Modules[ModuleCount].Flags = 0; /* Flags ??? (GN) */ Smi->Module[ModuleCount].Flags = 0; /* Flags ??? (GN) */
Smi->Modules[ModuleCount].Index = ModuleCount; Smi->Module[ModuleCount].Index = ModuleCount;
Smi->Modules[ModuleCount].Unknown = 0; Smi->Module[ModuleCount].NameLength = 0;
Smi->Modules[ModuleCount].LoadCount = 0; /* FIXME */ Smi->Module[ModuleCount].LoadCount = 0; /* FIXME */
AnsiName.Length = 0; AnsiName.Length = 0;
AnsiName.MaximumLength = 256; AnsiName.MaximumLength = 256;
AnsiName.Buffer = Smi->Modules[ModuleCount].ImageName; AnsiName.Buffer = Smi->Module[ModuleCount].ImageName;
RtlUnicodeStringToAnsiString(&AnsiName, RtlUnicodeStringToAnsiString(&AnsiName,
&current->FullName, &current->FullName,
FALSE); FALSE);
@ -649,12 +649,12 @@ LdrpQueryModuleInformation(PVOID Buffer,
p = strrchr(AnsiName.Buffer, '\\'); p = strrchr(AnsiName.Buffer, '\\');
if (p == NULL) if (p == NULL)
{ {
Smi->Modules[ModuleCount].ModuleNameOffset = 0; Smi->Module[ModuleCount].PathLength = 0;
} }
else else
{ {
p++; p++;
Smi->Modules[ModuleCount].ModuleNameOffset = p - AnsiName.Buffer; Smi->Module[ModuleCount].PathLength = p - AnsiName.Buffer;
} }
ModuleCount++; ModuleCount++;