mirror of
https://github.com/reactos/reactos.git
synced 2024-12-26 00:54:40 +00:00
Partially implemented (handlers only)
NTOSKRNL.NtQuerySystemInformation() and NTOSKRNL.NtSetSystemInformation(). --- Partially implemented (kernel32/process/proc.c) KERNEL32.GetPriorityClass(), KERNEL32.SetPriorityClass() and NTDLL.CsrSetPriorityClass() (stub only). Renamed (in include/csrss/csrss.h) priority class macros: #define CSR_PRIORITY_CLASS_NORMAL (0x10) #define CSR_PRIORITY_CLASS_IDLE (0x20) #define CSR_PRIORITY_CLASS_HIGH (0x40) #define CSR_PRIORITY_CLASS_REALTIME (0x80) --- Implemented (kernel32/misc/error.c) #include <kernel32/error.h> DWORD STDCALL SetLastErrorByStatus ( NTSTATUS Status ); to replace SetLastError(RtlNtStatusToDosError(Status)) in KERNEL32, and fixed KERNEL32.SetLastError() KERNEL32.GetLastError() to use the field in NT_TEB (LastError is per thread not per process). --- Implemented (lib/kernel32/sysinfo.c) GetSystemInfo() (to be completed). --- Fixed rosapps/sysutils/makefile to use ROS import libraries. --- Added QSI to the system utilities set. The target is writing a tool that can be used to query as much system information as possible from user mode (to be finished and tested only under nt4sp4/x86; it was NOT tested under ROS: it crashes immediately and needs NtQuerySystemInformation implemented!). svn path=/trunk/; revision=1137
This commit is contained in:
parent
0c4a5f1e06
commit
b3ea65f0e4
26 changed files with 4278 additions and 462 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $Id: conport.c,v 1.5 1999/07/17 23:10:12 ea Exp $
|
||||
/* $Id: conport.c,v 1.6 2000/04/25 23:22:46 ea Exp $
|
||||
*
|
||||
* reactos/apps/lpc/conport.c
|
||||
*
|
||||
|
@ -107,14 +107,14 @@ TryConnectPort(char *port_name)
|
|||
*/
|
||||
Port = 0;
|
||||
Status = ConnectPort(
|
||||
& Port,
|
||||
& PortName,
|
||||
& ObjectAttributes,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
LPC_CONNECT_FLAG5
|
||||
& Port, /* & PortHandle */
|
||||
& PortName, /* & PortName */
|
||||
& ObjectAttributes, /* & PortAttributes */
|
||||
NULL, /* & SecurityQos */
|
||||
NULL, /* & SectionInfo */
|
||||
NULL, /* & MapInfo */
|
||||
NULL, /* & MaxMessageSize */
|
||||
LPC_CONNECT_FLAG5 /* & ConnectInfoLength */
|
||||
);
|
||||
if (Status == STATUS_SUCCESS)
|
||||
{
|
||||
|
|
|
@ -3,6 +3,12 @@
|
|||
|
||||
#include <napi/lpc.h>
|
||||
|
||||
#define CSR_PRIORITY_CLASS_NORMAL (0x10)
|
||||
#define CSR_PRIORITY_CLASS_IDLE (0x20)
|
||||
#define CSR_PRIORITY_CLASS_HIGH (0x40)
|
||||
#define CSR_PRIORITY_CLASS_REALTIME (0x80)
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
} CSRSS_CONNECT_PROCESS_REQUEST, PCSRSS_CONNECT_PROCESS_REQUEST;
|
||||
|
|
|
@ -243,4 +243,20 @@ enum
|
|||
#define FIRST_DEVICE_SPECIFIC_LEVEL (4)
|
||||
#define HIGH_LEVEL (FIRST_DEVICE_SPECIFIC_LEVEL + NR_DEVICE_SPECIFIC_LEVELS)
|
||||
|
||||
/* NT's IRQL */
|
||||
#if 0
|
||||
#define PASSIVE_LEVEL 0 // Passive release level
|
||||
#define LOW_LEVEL 0 // Lowest interrupt level
|
||||
#define APC_LEVEL 1 // APC interrupt level
|
||||
#define DISPATCH_LEVEL 2 // Dispatcher level
|
||||
|
||||
#define PROFILE_LEVEL 27 // timer used for profiling.
|
||||
#define CLOCK1_LEVEL 28 // Interval clock 1 level - Not used on x86
|
||||
#define CLOCK2_LEVEL 28 // Interval clock 2 level
|
||||
#define IPI_LEVEL 29 // Interprocessor interrupt level
|
||||
#define POWER_LEVEL 30 // Power failure level
|
||||
#define HIGH_LEVEL 31 // Highest interrupt level
|
||||
#define SYNCH_LEVEL (IPI_LEVEL-1) // synchronization level
|
||||
#endif
|
||||
|
||||
#endif /* ndef _DDK_DEFINES_H */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/* $Id: zw.h,v 1.28 2000/04/03 21:54:34 dwelch Exp $
|
||||
/* $Id: zw.h,v 1.29 2000/04/25 23:22:49 ea Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -3379,19 +3379,19 @@ ZwQuerySystemEnvironmentValue(
|
|||
NTSTATUS
|
||||
STDCALL
|
||||
NtQuerySystemInformation(
|
||||
IN CINT SystemInformationClass,
|
||||
OUT PVOID SystemInformation,
|
||||
IN ULONG Length,
|
||||
OUT PULONG ResultLength
|
||||
IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
||||
OUT PVOID SystemInformation,
|
||||
IN ULONG Length,
|
||||
OUT PULONG ResultLength
|
||||
);
|
||||
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
ZwQuerySystemInformation(
|
||||
IN CINT SystemInformationClass,
|
||||
OUT PVOID SystemInformation,
|
||||
IN ULONG Length,
|
||||
OUT PULONG ResultLength
|
||||
IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
||||
OUT PVOID SystemInformation,
|
||||
IN ULONG Length,
|
||||
OUT PULONG ResultLength
|
||||
);
|
||||
|
||||
/*
|
||||
|
@ -4450,17 +4450,17 @@ ZwSetSystemEnvironmentValue(
|
|||
NTSTATUS
|
||||
STDCALL
|
||||
NtSetSystemInformation(
|
||||
IN CINT SystemInformationClass,
|
||||
IN PVOID SystemInformation,
|
||||
IN ULONG SystemInformationLength
|
||||
IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
||||
IN PVOID SystemInformation,
|
||||
IN ULONG SystemInformationLength
|
||||
);
|
||||
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
ZwSetSystemInformation(
|
||||
IN CINT SystemInformationClass,
|
||||
IN PVOID SystemInformation,
|
||||
IN ULONG SystemInformationLength
|
||||
IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
||||
IN PVOID SystemInformation,
|
||||
IN ULONG SystemInformationLength
|
||||
);
|
||||
|
||||
/*
|
||||
|
|
|
@ -85,19 +85,590 @@
|
|||
#define EventBasicInformation 0
|
||||
|
||||
// system information
|
||||
// {Nt|Zw}{Query|Set}SystemInformation
|
||||
|
||||
typedef
|
||||
enum _SYSTEM_INFORMATION_CLASS
|
||||
{
|
||||
SystemInformationClassMin = 0,
|
||||
SystemBasicInformation = 0, /* Q */
|
||||
SystemProcessorInformation = 1, /* Q */
|
||||
SystemPerformanceInformation = 2, /* Q */
|
||||
SystemTimeInformation = 3, /* Q */
|
||||
SystemPathInformation = 4,
|
||||
SystemProcessInformation = 5, /* Q */
|
||||
SystemServiceDescriptorTableInfo = 6, /* Q */
|
||||
SystemIoConfigInformation = 7, /* Q */
|
||||
SystemProcessorTimeInformation = 8, /* Q */
|
||||
SystemNtGlobalFlagInformation = 9, /* QS */
|
||||
SystemInformation10 = 10,
|
||||
SystemModuleInformation = 11, /* Q */
|
||||
SystemResourceLockInformation = 12, /* Q */
|
||||
SystemInformation13 = 13,
|
||||
SystemInformation14 = 14,
|
||||
SystemInformation15 = 15,
|
||||
SystemHandleInformation = 16, /* Q */
|
||||
SystemObjectInformation = 17, /* Q */
|
||||
SystemPageFileInformation = 18, /* Q */
|
||||
SystemInstructionEmulationInfo = 19, /* Q */
|
||||
SystemInformation20 = 20,
|
||||
SystemCacheInformation = 21, /* QS */
|
||||
SystemPoolTagInformation = 22, /* Q (checked build only) */
|
||||
SystemProcessorScheduleInfo = 23, /* Q */
|
||||
SystemDpcInformation = 24, /* QS */
|
||||
SystemInformation25 = 25,
|
||||
SystemLoadImage = 26, /* S (callable) */
|
||||
SystemUnloadImage = 27, /* S (callable) */
|
||||
SystemTimeAdjustmentInformation = 28, /* QS */
|
||||
SystemInformation29 = 29,
|
||||
SystemInformation30 = 30,
|
||||
SystemInformation31 = 31,
|
||||
SystemCrashDumpSectionInfo = 32, /* Q */
|
||||
SystemProcessorFaultCountInfo = 33, /* Q */
|
||||
SystemCrashDumpStateInfo = 34, /* Q */
|
||||
SystemDebuggerInformation = 35, /* Q */
|
||||
SystemThreadSwitchCountersInfo = 36, /* Q */
|
||||
SystemQuotaInformation = 37, /* QS */
|
||||
SystemLoadDriver = 38, /* S */
|
||||
SystemPrioritySeparationInfo = 39, /* S */
|
||||
SystemInformation40 = 40,
|
||||
SystemInformation41 = 41,
|
||||
SystemInformation42 = 42,
|
||||
SystemInformation43 = 43,
|
||||
SystemTimeZoneInformation = 44, /* QS */
|
||||
SystemLookasideInformation = 45, /* Q */
|
||||
SystemInformationClassMax
|
||||
|
||||
} SYSTEM_INFORMATION_CLASS;
|
||||
|
||||
// SystemBasicInformation (0)
|
||||
typedef
|
||||
struct _SYSTEM_BASIC_INFORMATION
|
||||
{
|
||||
DWORD AlwaysZero;
|
||||
ULONG KeMaximumIncrement;
|
||||
ULONG MmPageSize;
|
||||
ULONG MmNumberOfPhysicalPages;
|
||||
ULONG MmLowestPhysicalPage;
|
||||
ULONG MmHighestPhysicalPage;
|
||||
PVOID MmLowestUserAddress;
|
||||
PVOID MmLowestUserAddress1;
|
||||
PVOID MmHighestUserAddress;
|
||||
DWORD KeActiveProcessors;
|
||||
USHORT KeNumberProcessors;
|
||||
|
||||
} SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
|
||||
|
||||
// SystemProcessorInformation (1)
|
||||
typedef
|
||||
struct _SYSTEM_PROCESSOR_INFORMATION
|
||||
{
|
||||
USHORT KeProcessorArchitecture;
|
||||
USHORT KeProcessorLevel;
|
||||
USHORT KeProcessorRevision;
|
||||
USHORT AlwaysZero;
|
||||
DWORD KeFeatureBits;
|
||||
|
||||
} SYSTEM_PROCESSOR_INFORMATION, *PSYSTEM_PROCESSOR_INFORMATION;
|
||||
|
||||
// SystemPerformanceInfo (2)
|
||||
typedef
|
||||
struct _SYSTEM_PERFORMANCE_INFO
|
||||
{
|
||||
LARGE_INTEGER TotalProcessorTime;
|
||||
LARGE_INTEGER IoReadTransferCount;
|
||||
LARGE_INTEGER IoWriteTransferCount;
|
||||
LARGE_INTEGER IoOtherTransferCount;
|
||||
ULONG IoReadOperationCount;
|
||||
ULONG IoWriteOperationCount;
|
||||
ULONG IoOtherOperationCount;
|
||||
ULONG MmAvailablePages;
|
||||
ULONG MmTotalCommitedPages;
|
||||
ULONG MmTotalCommitLimit;
|
||||
ULONG MmPeakLimit;
|
||||
ULONG PageFaults;
|
||||
ULONG WriteCopies;
|
||||
ULONG TransitionFaults;
|
||||
ULONG Unknown1;
|
||||
ULONG DemandZeroFaults;
|
||||
ULONG PagesInput;
|
||||
ULONG PagesRead;
|
||||
ULONG Unknown2;
|
||||
ULONG Unknown3;
|
||||
ULONG PagesOutput;
|
||||
ULONG PageWrites;
|
||||
ULONG Unknown4;
|
||||
ULONG Unknown5;
|
||||
ULONG PoolPagedBytes;
|
||||
ULONG PoolNonPagedBytes;
|
||||
ULONG Unknown6;
|
||||
ULONG Unknown7;
|
||||
ULONG Unknown8;
|
||||
ULONG Unknown9;
|
||||
ULONG MmTotalSystemFreePtes;
|
||||
ULONG MmSystemCodepage;
|
||||
ULONG MmTotalSystemDriverPages;
|
||||
ULONG MmTotalSystemCodePages;
|
||||
ULONG Unknown10;
|
||||
ULONG Unknown11;
|
||||
ULONG Unknown12;
|
||||
ULONG MmSystemCachePage;
|
||||
ULONG MmPagedPoolPage;
|
||||
ULONG MmSystemDriverPage;
|
||||
ULONG CcFastReadNoWait;
|
||||
ULONG CcFastReadWait;
|
||||
ULONG CcFastReadResourceMiss;
|
||||
ULONG CcFastReadNotPossible;
|
||||
ULONG CcFastMdlReadNoWait;
|
||||
ULONG CcFastMdlReadWait;
|
||||
ULONG CcFastMdlReadResourceMiss;
|
||||
ULONG CcFastMdlReadNotPossible;
|
||||
ULONG CcMapDataNoWait;
|
||||
ULONG CcMapDataWait;
|
||||
ULONG CcMapDataNoWaitMiss;
|
||||
ULONG CcMapDataWaitMiss;
|
||||
ULONG CcPinMappedDataCount;
|
||||
ULONG CcPinReadNoWait;
|
||||
ULONG CcPinReadWait;
|
||||
ULONG CcPinReadNoWaitMiss;
|
||||
ULONG CcPinReadWaitMiss;
|
||||
ULONG CcCopyReadNoWait;
|
||||
ULONG CcCopyReadWait;
|
||||
ULONG CcCopyReadNoWaitMiss;
|
||||
ULONG CcCopyReadWaitMiss;
|
||||
ULONG CcMdlReadNoWait;
|
||||
ULONG CcMdlReadWait;
|
||||
ULONG CcMdlReadNoWaitMiss;
|
||||
ULONG CcMdlReadWaitMiss;
|
||||
ULONG CcReadaheadIos;
|
||||
ULONG CcLazyWriteIos;
|
||||
ULONG CcLazyWritePages;
|
||||
ULONG CcDataFlushes;
|
||||
ULONG CcDataPages;
|
||||
ULONG ContextSwitches;
|
||||
ULONG Unknown13;
|
||||
ULONG Unknown14;
|
||||
ULONG SystemCalls;
|
||||
|
||||
} SYSTEM_PERFORMANCE_INFO, *PSYSTEM_PERFORMANCE_INFO;
|
||||
|
||||
// SystemTimeInformation (3)
|
||||
typedef
|
||||
struct _SYSTEM_TIME_INFORMATION
|
||||
{
|
||||
TIME KeBootTime;
|
||||
TIME KeSystemTime;
|
||||
TIME ExpTimeZoneBias;
|
||||
ULONG ExpTimeZoneId;
|
||||
ULONG Unused;
|
||||
|
||||
} SYSTEM_TIME_INFORMATION, *PSYSTEM_TIME_INFORMATION;
|
||||
|
||||
// SystemPathInformation (4)
|
||||
// IT DOES NOT WORK
|
||||
typedef
|
||||
struct _SYSTEM_PATH_INFORMATION
|
||||
{
|
||||
PVOID Dummy;
|
||||
|
||||
} SYSTEM_PATH_INFORMATION, * PSYSTEM_PATH_INFORMATION;
|
||||
|
||||
// SystemProcessThreadInfo (5)
|
||||
typedef
|
||||
struct _SYSTEM_THREAD_INFORMATION
|
||||
{
|
||||
TIME KernelTime;
|
||||
TIME UserTime;
|
||||
TIME CreateTime;
|
||||
ULONG TickCount;
|
||||
ULONG StartEIP;
|
||||
CLIENT_ID ClientId;
|
||||
ULONG DynamicPriority;
|
||||
ULONG BasePriority;
|
||||
ULONG nSwitches;
|
||||
DWORD State;
|
||||
KWAIT_REASON WaitReason;
|
||||
|
||||
} SYSTEM_THREAD_INFORMATION, *PSYSTEM_THREAD_INFORMATION;
|
||||
|
||||
typedef
|
||||
struct SYSTEM_PROCESS_INFORMATION
|
||||
{
|
||||
ULONG RelativeOffset;
|
||||
ULONG ThreadCount;
|
||||
ULONG Unused1 [6];
|
||||
TIME CreateTime;
|
||||
TIME UserTime;
|
||||
TIME KernelTime;
|
||||
UNICODE_STRING Name;
|
||||
ULONG BasePriority;
|
||||
ULONG ProcessId;
|
||||
ULONG ParentProcessId;
|
||||
ULONG HandleCount;
|
||||
ULONG Unused2[2];
|
||||
ULONG PeakVirtualSizeBytes;
|
||||
ULONG TotalVirtualSizeBytes;
|
||||
ULONG PageFaultCount;
|
||||
ULONG PeakWorkingSetSizeBytes;
|
||||
ULONG TotalWorkingSetSizeBytes;
|
||||
ULONG PeakPagedPoolUsagePages;
|
||||
ULONG TotalPagedPoolUsagePages;
|
||||
ULONG PeakNonPagedPoolUsagePages;
|
||||
ULONG TotalNonPagedPoolUsagePages;
|
||||
ULONG TotalPageFileUsageBytes;
|
||||
ULONG PeakPageFileUsageBytes;
|
||||
ULONG TotalPrivateBytes;
|
||||
SYSTEM_THREAD_INFORMATION ThreadSysInfo [1];
|
||||
|
||||
} SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
|
||||
|
||||
// SystemServiceDescriptorTableInfo (6)
|
||||
typedef
|
||||
struct _SYSTEM_SDT_INFORMATION
|
||||
{
|
||||
ULONG BufferLength;
|
||||
ULONG NumberOfSystemServiceTables;
|
||||
ULONG NumberOfServices [1];
|
||||
ULONG ServiceCounters [1];
|
||||
|
||||
} SYSTEM_SDT_INFORMATION, *PSYSTEM_SDT_INFORMATION;
|
||||
|
||||
// SystemIoConfigInformation (7)
|
||||
typedef
|
||||
struct _SYSTEM_IOCONFIG_INFORMATION
|
||||
{
|
||||
ULONG DiskCount;
|
||||
ULONG FloppyCount;
|
||||
ULONG CdRomCount;
|
||||
ULONG TapeCount;
|
||||
ULONG SerialCount;
|
||||
ULONG ParallelCount;
|
||||
|
||||
} SYSTEM_IOCONFIG_INFORMATION, *PSYSTEM_IOCONFIG_INFORMATION;
|
||||
|
||||
// SystemProcessorTimeInformation (8)
|
||||
typedef
|
||||
struct _SYSTEM_PROCESSORTIME_INFO
|
||||
{
|
||||
TIME TotalProcessorRunTime;
|
||||
TIME TotalProcessorTime;
|
||||
TIME TotalProcessorUserTime;
|
||||
TIME TotalDPCTime;
|
||||
TIME TotalInterruptTime;
|
||||
ULONG TotalInterrupts;
|
||||
ULONG Unused;
|
||||
|
||||
} SYSTEM_PROCESSORTIME_INFO, *PSYSTEM_PROCESSORTIME_INFO;
|
||||
|
||||
// SystemNtGlobalFlagInformation (9)
|
||||
typedef
|
||||
struct _SYSTEM_GLOBAL_FLAG_INFO
|
||||
{
|
||||
ULONG NtGlobalFlag;
|
||||
|
||||
} SYSTEM_GLOBAL_FLAG_INFO, * PSYSTEM_GLOBAL_FLAG_INFO;
|
||||
|
||||
// SystemInformation10 (10)
|
||||
// UNKNOWN
|
||||
|
||||
// SystemModuleInformation (11)
|
||||
typedef
|
||||
struct _SYSTEM_MODULE_ENTRY
|
||||
{
|
||||
ULONG Unused;
|
||||
ULONG Always0;
|
||||
ULONG ModuleBaseAddress;
|
||||
ULONG ModuleSize;
|
||||
ULONG Unknown;
|
||||
ULONG ModuleEntryIndex;
|
||||
USHORT ModuleNameLength; /* Length of module name not including the path, this field contains valid value only for NTOSKRNL module*/
|
||||
USHORT ModulePathLength; /* Length of 'directory path' part of modulename*/
|
||||
CHAR ModuleName [256];
|
||||
|
||||
} SYSTEM_MODULE_ENTRY, * PSYSTEM_MODULE_ENTRY;
|
||||
|
||||
typedef
|
||||
struct _SYSTEM_MODULE_INFORMATION
|
||||
{
|
||||
ULONG Count;
|
||||
SYSTEM_MODULE_ENTRY Module [1];
|
||||
|
||||
} SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;
|
||||
|
||||
// SystemResourceLockInformation (12)
|
||||
typedef
|
||||
struct _SYSTEM_RESOURCE_LOCK_ENTRY
|
||||
{
|
||||
ULONG ResourceAddress;
|
||||
ULONG Always1;
|
||||
ULONG Unknown;
|
||||
ULONG ActiveCount;
|
||||
ULONG ContentionCount;
|
||||
ULONG Unused[2];
|
||||
ULONG NumberOfSharedWaiters;
|
||||
ULONG NumberOfExclusiveWaiters;
|
||||
|
||||
} SYSTEM_RESOURCE_LOCK_ENTRY, *PSYSTEM_RESOURCE_LOCK_ENTRY;
|
||||
|
||||
typedef
|
||||
struct _SYSTEM_RESOURCE_LOCK_INFO
|
||||
{
|
||||
ULONG Count;
|
||||
SYSTEM_RESOURCE_LOCK_ENTRY Lock [1];
|
||||
|
||||
} SYSTEM_RESOURCE_LOCK_INFO, *PSYSTEM_RESOURCE_LOCK_INFO;
|
||||
|
||||
// SystemInformation13 (13)
|
||||
// UNKNOWN
|
||||
|
||||
// SystemInformation14 (14)
|
||||
// UNKNOWN
|
||||
|
||||
// SystemInformation15 (15)
|
||||
// UNKNOWN
|
||||
|
||||
// SystemHandleInformation (16)
|
||||
typedef
|
||||
struct _SYSTEM_HANDLE_ENTRY
|
||||
{
|
||||
ULONG OwnerPid;
|
||||
USHORT ObjectType;
|
||||
USHORT HandleValue;
|
||||
PVOID ObjectPointer;
|
||||
ULONG AccessMask;
|
||||
|
||||
} SYSTEM_HANDLE_ENTRY, *PSYSTEM_HANDLE_ENTRY;
|
||||
|
||||
typedef
|
||||
struct _SYSTEM_HANDLE_INFORMATION
|
||||
{
|
||||
ULONG Count;
|
||||
SYSTEM_HANDLE_ENTRY Handle [1];
|
||||
|
||||
} SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION;
|
||||
|
||||
// SystemObjectInformation (17)
|
||||
// UNKNOWN
|
||||
typedef
|
||||
struct _SYSTEM_OBJECT_INFORMATION
|
||||
{
|
||||
DWORD Unknown;
|
||||
/* FIXME */
|
||||
} SYSTEM_OBJECT_INFORMATION, *PSYSTEM_OBJECT_INFORMATION;
|
||||
|
||||
// SystemPageFileInformation (18)
|
||||
typedef
|
||||
struct _SYSTEM_PAGEFILE_INFORMATION
|
||||
{
|
||||
ULONG RelativeOffset;
|
||||
ULONG CurrentSizePages;
|
||||
ULONG TotalUsedPages;
|
||||
ULONG PeakUsedPages;
|
||||
UNICODE_STRING PagefileFileName;
|
||||
|
||||
} SYSTEM_PAGEFILE_INFORMATION, *PSYSTEM_PAGEFILE_INFORMATION;
|
||||
|
||||
// SystemInstructionEmulationInfo (19)
|
||||
typedef
|
||||
struct _SYSTEM_VDM_INFORMATION
|
||||
{
|
||||
ULONG VdmSegmentNotPresentCount;
|
||||
ULONG VdmINSWCount;
|
||||
ULONG VdmESPREFIXCount;
|
||||
ULONG VdmCSPREFIXCount;
|
||||
ULONG VdmSSPREFIXCount;
|
||||
ULONG VdmDSPREFIXCount;
|
||||
ULONG VdmFSPREFIXCount;
|
||||
ULONG VdmGSPREFIXCount;
|
||||
ULONG VdmOPER32PREFIXCount;
|
||||
ULONG VdmADDR32PREFIXCount;
|
||||
ULONG VdmINSBCount;
|
||||
ULONG VdmINSWV86Count;
|
||||
ULONG VdmOUTSBCount;
|
||||
ULONG VdmOUTSWCount;
|
||||
ULONG VdmPUSHFCount;
|
||||
ULONG VdmPOPFCount;
|
||||
ULONG VdmINTNNCount;
|
||||
ULONG VdmINTOCount;
|
||||
ULONG VdmIRETCount;
|
||||
ULONG VdmINBIMMCount;
|
||||
ULONG VdmINWIMMCount;
|
||||
ULONG VdmOUTBIMMCount;
|
||||
ULONG VdmOUTWIMMCount;
|
||||
ULONG VdmINBCount;
|
||||
ULONG VdmINWCount;
|
||||
ULONG VdmOUTBCount;
|
||||
ULONG VdmOUTWCount;
|
||||
ULONG VdmLOCKPREFIXCount;
|
||||
ULONG VdmREPNEPREFIXCount;
|
||||
ULONG VdmREPPREFIXCount;
|
||||
ULONG VdmHLTCount;
|
||||
ULONG VdmCLICount;
|
||||
ULONG VdmSTICount;
|
||||
ULONG VdmBopCount;
|
||||
|
||||
} SYSTEM_VDM_INFORMATION, *PSYSTEM_VDM_INFORMATION;
|
||||
|
||||
// SystemInformation20 (20)
|
||||
// UNKNOWN
|
||||
|
||||
// SystemCacheInformation (21)
|
||||
typedef
|
||||
struct _SYSTEM_CACHE_INFORMATION
|
||||
{
|
||||
ULONG CurrentSize;
|
||||
ULONG PeakSize;
|
||||
ULONG PageFaultCount;
|
||||
ULONG MinimumWorkingSet;
|
||||
ULONG MaximumWorkingSet;
|
||||
ULONG Unused[4];
|
||||
|
||||
} SYSTEM_CACHE_INFORMATION;
|
||||
|
||||
// SystemPoolTagInformation (22)
|
||||
// found by Klaus P. Gerlicher
|
||||
// (implemented only in checked builds)
|
||||
typedef
|
||||
struct _POOL_TAG_STATS
|
||||
{
|
||||
ULONG AllocationCount;
|
||||
ULONG FreeCount;
|
||||
ULONG SizeBytes;
|
||||
|
||||
} POOL_TAG_STATS;
|
||||
|
||||
typedef
|
||||
struct _SYSTEM_POOL_TAG_ENTRY
|
||||
{
|
||||
ULONG Tag;
|
||||
POOL_TAG_STATS Paged;
|
||||
POOL_TAG_STATS NonPaged;
|
||||
|
||||
} SYSTEM_POOL_TAG_ENTRY, * PSYSTEM_POOL_TAG_ENTRY;
|
||||
|
||||
typedef
|
||||
struct _SYSTEM_POOL_TAG_INFO
|
||||
{
|
||||
ULONG Count;
|
||||
SYSTEM_POOL_TAG_ENTRY PoolEntry [1];
|
||||
|
||||
} SYSTEM_POOL_TAG_INFO, *PSYSTEM_POOL_TAG_INFO;
|
||||
|
||||
// SystemProcessorScheduleInfo (23)
|
||||
typedef
|
||||
struct _SYSTEM_PROCESSOR_SCHEDULE_INFO
|
||||
{
|
||||
ULONG nContextSwitches;
|
||||
ULONG nDPCQueued;
|
||||
ULONG nDPCRate;
|
||||
ULONG TimerResolution;
|
||||
ULONG nDPCBypasses;
|
||||
ULONG nAPCBypasses;
|
||||
|
||||
} SYSTEM_PROCESSOR_SCHEDULE_INFO, *PSYSTEM_PROCESSOR_SCHEDULE_INFO;
|
||||
|
||||
// SystemDpcInformation (24)
|
||||
typedef
|
||||
struct _SYSTEM_DPC_INFORMATION
|
||||
{
|
||||
ULONG Unused;
|
||||
ULONG KiMaximumDpcQueueDepth;
|
||||
ULONG KiMinimumDpcRate;
|
||||
ULONG KiAdjustDpcThreshold;
|
||||
ULONG KiIdealDpcRate;
|
||||
|
||||
} SYSTEM_DPC_INFORMATION, *PSYSTEM_DPC_INFORMATION;
|
||||
|
||||
// SystemInformation25 (25)
|
||||
// UNKNOWN
|
||||
|
||||
// SystemLoadImage (26)
|
||||
typedef
|
||||
struct _SYSTEM_IMAGE_LOAD
|
||||
{
|
||||
UNICODE_STRING ModuleFileName IN;
|
||||
PVOID BaseAddress OUT;
|
||||
PVOID Section OUT;
|
||||
PVOID EntryPoint OUT;
|
||||
PVOID ExportDirectory OUT;
|
||||
|
||||
} SYSTEM_IMAGE_LOAD, *PSYSTEM_IMAGE_LOAD;
|
||||
|
||||
// SystemUnloadImage (27)
|
||||
typedef
|
||||
struct _SYSTEM_IMAGE_UNLOAD
|
||||
{
|
||||
PVOID Section IN; /* see SYSTEM_IMAGE_LOAD.ModuleSection */
|
||||
|
||||
} SYSTEM_IMAGE_UNLOAD, *PSYSTEM_IMAGE_UNLOAD;
|
||||
|
||||
|
||||
// SystemTimeAdjustmentInformation (28)
|
||||
// (what is the right one?)
|
||||
#if 0
|
||||
typedef
|
||||
struct _SYSTEM_TIME_ADJUSTMENT_INFO
|
||||
{
|
||||
TIME TimeAdjustment;
|
||||
BOOL TimeAdjustmentDisabled;
|
||||
|
||||
} SYSTEM_TIME_ADJUSTMENT_INFO, *PSYSTEM_TIME_ADJUSTMENT_INFO;
|
||||
#else
|
||||
typedef
|
||||
struct _SYSTEM_TIME_ADJUSTMENT_INFO
|
||||
{
|
||||
ULONG KeTimeAdjustment;
|
||||
ULONG KeMaximumIncrement;
|
||||
BOOLEAN KeTimeSynchronization;
|
||||
|
||||
} SYSTEM_TIME_ADJUSTMENT_INFO, *PSYSTEM_TIME_ADJUSTMENT_INFO;
|
||||
#endif
|
||||
|
||||
// SystemProcessorFaultCountInfo (33)
|
||||
typedef
|
||||
struct _SYSTEM_PROCESSOR_FAULT_INFO
|
||||
{
|
||||
ULONG nAlignmentFixup;
|
||||
ULONG nExceptionDispatches;
|
||||
ULONG nFloatingEmulation;
|
||||
ULONG Unknown;
|
||||
|
||||
} SYSTEM_PROCESSOR_FAULT_INFO, *PSYSTEM_PROCESSOR_FAULT_INFO;
|
||||
|
||||
// SystemCrashDumpStateInfo (34)
|
||||
//
|
||||
|
||||
// SystemDebuggerInformation (35)
|
||||
typedef
|
||||
struct _SYSTEM_DEBUGGER_INFO
|
||||
{
|
||||
BOOLEAN KdDebuggerEnabled;
|
||||
BOOLEAN KdDebuggerPresent;
|
||||
|
||||
} SYSTEM_DEBUGGER_INFO, *PSYSTEM_DEBUGGER_INFO;
|
||||
|
||||
// SystemInformation36 (36)
|
||||
// UNKNOWN
|
||||
|
||||
// SystemQuotaInformation (37)
|
||||
typedef
|
||||
struct _SYSTEM_QUOTA_INFORMATION
|
||||
{
|
||||
ULONG CmpGlobalQuota;
|
||||
ULONG CmpGlobalQuotaUsed;
|
||||
ULONG MmSizeofPagedPoolInBytes;
|
||||
|
||||
} SYSTEM_QUOTA_INFORMATION, *PSYSTEM_QUOTA_INFORMATION;
|
||||
|
||||
// SystemLoadDriver (38)
|
||||
typedef
|
||||
struct _SYSTEM_DRIVER_LOAD
|
||||
{
|
||||
UNICODE_STRING DriverRegistryEntry;
|
||||
|
||||
} SYSTEM_DRIVER_LOAD, *PSYSTEM_DRIVER_LOAD;
|
||||
|
||||
|
||||
#define SystemInformation0 0
|
||||
#define SystemInformation1 1
|
||||
#define SystemPerformanceInformation 2
|
||||
#define SystemTimeInformation 3
|
||||
#define SystemProcessInformation 5
|
||||
#define SystemGlobalFlagInformation 9
|
||||
#define SystemDriverInformation 11
|
||||
#define SystemPageFileInformation 18
|
||||
#define SystemCacheInformation 21
|
||||
#define SystemPoolTagStatsInformation 22
|
||||
#define SystemTimeAdjustmentInformation 28
|
||||
#define SystemTimeZoneInformation 44
|
||||
|
||||
// memory information
|
||||
|
||||
|
@ -264,168 +835,6 @@ typedef struct _OBJECT_TYPE_INFORMATION
|
|||
ULONG ReferenceCount;
|
||||
} OBJECT_TYPE_INFORMATION, *POBJECT_TYPE_INFORMATION;
|
||||
|
||||
// system information
|
||||
|
||||
#if 0
|
||||
#pragma pack(2)
|
||||
typedef struct _SYSTEM_THREAD_INFORMATION
|
||||
{
|
||||
FILETIME ftCreationTime;
|
||||
DWORD dwUnknown1;
|
||||
PVOID dwStartAddress;
|
||||
DWORD dwOwningPID;
|
||||
DWORD dwThreadID;
|
||||
DWORD dwCurrentPriority;
|
||||
DWORD dwBasePriority;
|
||||
DWORD dwContextSwitches;
|
||||
DWORD dwThreadState;
|
||||
DWORD dwWaitReason;
|
||||
DWORD dwUnknown2 [ 5 ];
|
||||
|
||||
|
||||
} SYSTEM_THREAD_INFORMATION, * PSYSTEM_THREAD_INFORMATION;
|
||||
|
||||
|
||||
typedef struct _SYSTEM_PROCESS_INFORMATION
|
||||
{
|
||||
DWORD dwOffset;
|
||||
DWORD dwThreadCount;
|
||||
DWORD dwUnknown1 [6];
|
||||
FILETIME ftCreationTime;
|
||||
DWORD dwUnknown2 [5];
|
||||
WCHAR * pszProcessName;
|
||||
DWORD dwBasePriority;
|
||||
DWORD dwProcessID;
|
||||
DWORD dwParentProcessID;
|
||||
DWORD dwHandleCount;
|
||||
DWORD dwUnknown3;
|
||||
DWORD dwUnknown4;
|
||||
DWORD dwVirtualBytesPeak;
|
||||
DWORD dwVirtualBytes;
|
||||
DWORD dwPageFaults;
|
||||
DWORD dwWorkingSetPeak;
|
||||
DWORD dwWorkingSet;
|
||||
DWORD dwUnknown5;
|
||||
DWORD dwPagedPool;
|
||||
DWORD dwUnknown6;
|
||||
DWORD dwNonPagedPool;
|
||||
DWORD dwPageFileBytesPeak;
|
||||
DWORD dwPrivateBytes;
|
||||
DWORD dwPageFileBytes;
|
||||
DWORD dwUnknown7 [4];
|
||||
SYSTEM_THREAD_INFORMATION Threads [1];
|
||||
|
||||
} SYSTEM_PROCESS_INFORMATION, * PSYSTEM_PROCESS_INFORMATION;
|
||||
#endif
|
||||
|
||||
typedef struct _SYSTEM_TIME_INFORMATION
|
||||
{
|
||||
LARGE_INTEGER BootTime;
|
||||
LARGE_INTEGER SystemTime;
|
||||
LARGE_INTEGER TimeZoneBias;
|
||||
ULONG TimeZoneId;
|
||||
ULONG Unknown;
|
||||
} SYSTEM_TIME_INFORMATION, *PSYSTEM_TIME_INFORMATION;
|
||||
|
||||
typedef struct _SYSTEM_GLOBAL_FLAGS_INFO
|
||||
{
|
||||
DWORD GlobalFlags;
|
||||
|
||||
} SYSTEM_GLOBAL_FLAGS_INFO, * PSYSTEM_GLOBAL_FLAGS_INFO;
|
||||
|
||||
#if 0
|
||||
#pragma pack(4)
|
||||
typedef struct _SYSTEM_DRIVER_INFO
|
||||
{
|
||||
PVOID BaseAddress;
|
||||
DWORD Unknown1;
|
||||
DWORD Unknown2;
|
||||
DWORD EntryIndex;
|
||||
DWORD Unknown4;
|
||||
CHAR DriverName [256];
|
||||
|
||||
} SYSTEM_DRIVER_INFO, * PSYSTEM_DRIVER_INFO;
|
||||
|
||||
|
||||
typedef struct _SYSTEM_DRIVERS_INFO
|
||||
{
|
||||
DWORD DriverCount;
|
||||
SYSTEM_DRIVER_INFO DriverInfo[1];
|
||||
} SYSTEM_DRIVERS_INFO, *PSYSTEM_DRIVERS_INFO;
|
||||
|
||||
#pragma pack(4)
|
||||
typedef struct _SYSTEM_TIME_ADJUSTMENT
|
||||
{
|
||||
TIME TimeAdjustment;
|
||||
BOOL TimeAdjustmentDisabled;
|
||||
|
||||
} SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
|
||||
|
||||
typedef struct _SYSTEM_CONFIGURATION_INFO {
|
||||
union {
|
||||
ULONG OemId;
|
||||
struct {
|
||||
WORD ProcessorArchitecture;
|
||||
WORD Reserved;
|
||||
} tag1;
|
||||
} tag2;
|
||||
ULONG PageSize;
|
||||
PVOID MinimumApplicationAddress;
|
||||
PVOID MaximumApplicationAddress;
|
||||
ULONG ActiveProcessorMask;
|
||||
ULONG NumberOfProcessors;
|
||||
ULONG ProcessorType;
|
||||
ULONG AllocationGranularity;
|
||||
WORD ProcessorLevel;
|
||||
WORD ProcessorRevision;
|
||||
} SYSTEM_CONFIGURATION_INFO, *PSYSTEM_CONFIGURATION_INFO;
|
||||
|
||||
|
||||
typedef struct _SYSTEM_PAGEFILE_INFORMATION
|
||||
{
|
||||
DWORD Unknown [6];
|
||||
WCHAR PagefileName [16];
|
||||
|
||||
} SYSTEM_PAGEFILE_INFORMATION, * PSYSTEM_PAGEFILE_INFORMATION;
|
||||
|
||||
|
||||
typedef struct _SYSTEM_CACHE_INFORMATION
|
||||
{
|
||||
ULONG CurrentSize;
|
||||
ULONG PeakSize;
|
||||
ULONG PageFaultCount;
|
||||
ULONG MinimumWorkingSet;
|
||||
ULONG MaximumWorkingSet;
|
||||
ULONG Unused[4];
|
||||
} SYSTEM_CACHE_INFORMATION;
|
||||
|
||||
|
||||
/* SYSTEM_POOL_ENTRY_INFO, SYSTEM_POOL_INFORMATION
|
||||
* found by Klaus P. Gerlicher */
|
||||
typedef
|
||||
struct _SYSTEM_POOL_ENTRY_INFO
|
||||
{
|
||||
ULONG Tag;
|
||||
ULONG NP_Allocs;
|
||||
ULONG NP_Frees;
|
||||
ULONG NP_Used;
|
||||
ULONG P_Allocs;
|
||||
ULONG P_Frees;
|
||||
ULONG P_Used;
|
||||
|
||||
} SYSTEM_POOL_ENTRY_INFO, * PSYSTEM_POOL_ENTRY_INFO;
|
||||
|
||||
|
||||
typedef
|
||||
struct _SYSTEM_POOL_INFORMATION
|
||||
{
|
||||
ULONG Count;
|
||||
SYSTEM_POOL_ENTRY_INFO PoolEntry [1];
|
||||
|
||||
} SYSTEM_POOL_INFORMATION, *PSYSTEM_POOL_INFORMATION;
|
||||
|
||||
#endif
|
||||
|
||||
// file information
|
||||
|
||||
typedef struct _FILE_BASIC_INFORMATION
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef _FMIFS_H
|
||||
#define _FMIFS_H
|
||||
/* $Id: fmifs.h,v 1.1 1999/05/11 21:16:01 ea Exp $
|
||||
/* $Id: fmifs.h,v 1.2 2000/04/25 23:22:48 ea Exp $
|
||||
*
|
||||
* fmifs.h
|
||||
*
|
||||
|
@ -67,7 +67,7 @@ BOOL
|
|||
/* Chkdsk command in FMIFS */
|
||||
VOID
|
||||
STDCALL
|
||||
ChkDsk(
|
||||
Chkdsk(
|
||||
PWCHAR DriveRoot,
|
||||
PWCHAR Format,
|
||||
BOOL CorrectErrors,
|
||||
|
|
|
@ -55,7 +55,7 @@ NTSTATUS PsInitializeThread(HANDLE ProcessHandle,
|
|||
#define PROCESS_PRIO_NORMAL 8
|
||||
#define PROCESS_PRIO_HIGH 13
|
||||
#define PROCESS_PRIO_RT 18
|
||||
|
||||
|
||||
/*
|
||||
* Functions the HAL must provide
|
||||
*/
|
||||
|
|
12
reactos/include/kernel32/error.h
Normal file
12
reactos/include/kernel32/error.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
#ifndef _INCLUDE_KERNEL32_H
|
||||
#define _INCLUDE_KERNEL32_H
|
||||
/* $Id: error.h,v 1.1 2000/04/25 23:22:52 ea Exp $ */
|
||||
#include <windows.h>
|
||||
#define NTOS_MODE_USER
|
||||
#include <ntos.h>
|
||||
DWORD
|
||||
STDCALL
|
||||
SetLastErrorByStatus (
|
||||
NTSTATUS Status
|
||||
);
|
||||
#endif /* _INCLUDE_KERNEL32_H */
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: csr.h,v 1.2 2000/03/22 18:35:47 dwelch Exp $
|
||||
/* $Id: csr.h,v 1.3 2000/04/25 23:22:52 ea Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -12,6 +12,12 @@ NTSTATUS STDCALL CsrClientCallServer(PCSRSS_API_REQUEST Request,
|
|||
PCSRSS_API_REPLY Reply,
|
||||
ULONG Length,
|
||||
ULONG ReplyLength);
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
CsrSetPriorityClass (
|
||||
HANDLE hProcess,
|
||||
DWORD * PriorityClass
|
||||
);
|
||||
|
||||
#endif /* __INCLUDE_NTDLL_CSR_H */
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/* $Id: dllmain.c,v 1.1 1999/05/11 21:19:41 ea Exp $
|
||||
/* $Id: dllmain.c,v 1.2 2000/04/25 23:22:53 ea Exp $
|
||||
*
|
||||
* ReactOS FMIFS.DLL
|
||||
*/
|
||||
#include <windows.h>
|
||||
INT
|
||||
BOOLEAN
|
||||
__stdcall
|
||||
DllMain(
|
||||
PVOID hinstDll,
|
||||
|
@ -22,6 +22,6 @@ DllMain(
|
|||
case DLL_PROCESS_DETACH:
|
||||
break;
|
||||
}
|
||||
return(1);
|
||||
return (TRUE);
|
||||
}
|
||||
/* EOF */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: makefile,v 1.32 2000/04/06 17:23:26 ekohl Exp $
|
||||
# $Id: makefile,v 1.33 2000/04/25 23:22:53 ea Exp $
|
||||
#
|
||||
# ReactOS Operating System
|
||||
#
|
||||
|
@ -27,7 +27,7 @@ SYNCH_OBJECTS = synch/critical.o synch/event.o synch/wait.o synch/intrlck.o sync
|
|||
|
||||
MISC_OBJECTS = misc/error.o misc/atom.o misc/handle.o misc/env.o misc/dllmain.o \
|
||||
misc/console.o misc/time.o misc/stubs.o misc/rtl.o misc/ldr.o misc/res.o \
|
||||
misc/debug.o
|
||||
misc/debug.o misc/sysinfo.o
|
||||
|
||||
FILE_OBJECTS = file/file.o file/curdir.o file/lfile.o file/dir.o \
|
||||
file/iocompl.o file/volume.o file/deviceio.o file/dosdev.o \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: error.c,v 1.12 1999/10/07 23:45:07 ekohl Exp $
|
||||
/* $Id: error.c,v 1.13 2000/04/25 23:22:53 ea Exp $
|
||||
*
|
||||
* reactos/lib/kernel32/misc/error.c
|
||||
*
|
||||
|
@ -8,9 +8,20 @@
|
|||
|
||||
// #define NDEBUG
|
||||
#include <kernel32/kernel32.h>
|
||||
#include <kernel32/error.h>
|
||||
|
||||
|
||||
static DWORD LastError=0;
|
||||
/* INTERNAL */
|
||||
DWORD
|
||||
STDCALL
|
||||
SetLastErrorByStatus (
|
||||
NTSTATUS Status
|
||||
)
|
||||
{
|
||||
DWORD Error = RtlNtStatusToDosError (Status);
|
||||
SetLastError (Error);
|
||||
return (Error);
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
|
@ -19,16 +30,14 @@ SetLastError (
|
|||
DWORD dwErrorCode
|
||||
)
|
||||
{
|
||||
/* FIXME: it is per thread */
|
||||
LastError = dwErrorCode;
|
||||
NtCurrentTeb ()->LastErrorValue = (ULONG) dwErrorCode;
|
||||
}
|
||||
|
||||
DWORD
|
||||
STDCALL
|
||||
GetLastError (VOID)
|
||||
{
|
||||
/* FIXME: it is per thread */
|
||||
return LastError;
|
||||
return (DWORD) (NtCurrentTeb ()->LastErrorValue);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: stubs.c,v 1.14 2000/04/14 01:49:40 ekohl Exp $
|
||||
/* $Id: stubs.c,v 1.15 2000/04/25 23:22:54 ea Exp $
|
||||
*
|
||||
* KERNEL32.DLL stubs (unimplemented functions)
|
||||
* Remove from this file, if you implement them.
|
||||
|
@ -1691,18 +1691,6 @@ GetOEMCP (VOID)
|
|||
}
|
||||
|
||||
|
||||
DWORD
|
||||
STDCALL
|
||||
GetPriorityClass (
|
||||
HANDLE hProcess
|
||||
)
|
||||
{
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return NORMAL_PRIORITY_CLASS; /* FIXME: call NTOSKRNL.Ps */
|
||||
}
|
||||
|
||||
|
||||
|
||||
UINT
|
||||
STDCALL
|
||||
GetPrivateProfileIntW (
|
||||
|
@ -2073,40 +2061,6 @@ GetSystemDefaultLangID (VOID)
|
|||
}
|
||||
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
GetSystemInfo (
|
||||
LPSYSTEM_INFO lpSystemInfo
|
||||
)
|
||||
{
|
||||
/* FIXME: ??? */
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
|
||||
lpSystemInfo->u.s.wProcessorArchitecture =
|
||||
PROCESSOR_ARCHITECTURE_INTEL;
|
||||
lpSystemInfo->u.s.wReserved =
|
||||
0;
|
||||
lpSystemInfo->dwPageSize =
|
||||
4096; /* FIXME: x86 default; may be 4Mb */
|
||||
lpSystemInfo->lpMinimumApplicationAddress =
|
||||
(PVOID) 0x00010000; /* ? */
|
||||
lpSystemInfo->lpMaximumApplicationAddress =
|
||||
(PVOID) 0x00010000; /* ? */
|
||||
lpSystemInfo->dwActiveProcessorMask =
|
||||
0x00000001;
|
||||
lpSystemInfo->dwNumberOfProcessors =
|
||||
1; /* ReactOS is UP for now! */
|
||||
lpSystemInfo->dwProcessorType =
|
||||
PROCESSOR_INTEL_PENTIUM;
|
||||
lpSystemInfo->dwAllocationGranularity =
|
||||
65536; /* hard coded on Intel? */
|
||||
lpSystemInfo->wProcessorLevel =
|
||||
5; /* from cpuid on Intel? */
|
||||
lpSystemInfo->wProcessorRevision =
|
||||
0x0000; /* from cpuid on Intel? */
|
||||
}
|
||||
|
||||
|
||||
DWORD
|
||||
STDCALL
|
||||
GetSystemPowerStatus (
|
||||
|
@ -3508,18 +3462,6 @@ SetNamedPipeHandleState (
|
|||
}
|
||||
|
||||
|
||||
WINBOOL
|
||||
STDCALL
|
||||
SetPriorityClass (
|
||||
HANDLE hProcess,
|
||||
DWORD dwPriorityClass
|
||||
)
|
||||
{
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
WINBOOL
|
||||
STDCALL
|
||||
SetProcessShutdownParameters (
|
||||
|
|
100
reactos/lib/kernel32/misc/sysinfo.c
Normal file
100
reactos/lib/kernel32/misc/sysinfo.c
Normal file
|
@ -0,0 +1,100 @@
|
|||
/* $Id: sysinfo.c,v 1.1 2000/04/25 23:22:54 ea Exp $
|
||||
*
|
||||
* reactos/lib/kernel32/misc/sysinfo.c
|
||||
*
|
||||
*/
|
||||
#include <ddk/ntddk.h>
|
||||
|
||||
#include <kernel32/kernel32.h>
|
||||
#include <kernel32/error.h>
|
||||
|
||||
|
||||
#define PV_NT351 0x00030033
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
GetSystemInfo (
|
||||
LPSYSTEM_INFO Si
|
||||
)
|
||||
{
|
||||
SYSTEM_BASIC_INFORMATION Sbi;
|
||||
SYSTEM_PROCESSOR_INFORMATION Spi;
|
||||
DWORD ProcessVersion;
|
||||
NTSTATUS Status;
|
||||
|
||||
RtlZeroMemory (Si, sizeof (SYSTEM_INFO));
|
||||
Status = NtQuerySystemInformation (
|
||||
SystemBasicInformation, /* 0 */
|
||||
& Sbi,
|
||||
sizeof Sbi, /* 44 */
|
||||
0
|
||||
);
|
||||
if (STATUS_SUCCESS != Status)
|
||||
{
|
||||
SetLastErrorByStatus (Status);
|
||||
return;
|
||||
}
|
||||
Status = NtQuerySystemInformation (
|
||||
SystemProcessorInformation, /* 1 */
|
||||
& Spi,
|
||||
sizeof Spi, /* 12 */
|
||||
0
|
||||
);
|
||||
if (STATUS_SUCCESS != Status)
|
||||
{
|
||||
SetLastErrorByStatus (Status);
|
||||
return;
|
||||
}
|
||||
/*
|
||||
* PROCESSOR_ARCHITECTURE_INTEL 0
|
||||
* PROCESSOR_ARCHITECTURE_MIPS 1
|
||||
* PROCESSOR_ARCHITECTURE_ALPHA 2
|
||||
* PROCESSOR_ARCHITECTURE_PPC 3
|
||||
* PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF
|
||||
*/
|
||||
Si->u.s.wProcessorArchitecture = Spi.KeProcessorArchitecture;
|
||||
/* For future use: always zero */
|
||||
Si->u.s.wReserved = 0;
|
||||
Si->dwPageSize = Sbi.MmPageSize;
|
||||
Si->lpMinimumApplicationAddress = Sbi.MmLowestUserAddress;
|
||||
Si->lpMaximumApplicationAddress = Sbi.MmHighestUserAddress;
|
||||
Si->dwActiveProcessorMask = Sbi.KeActiveProcessors;
|
||||
Si->dwNumberOfProcessors = Sbi.KeNumberProcessors;
|
||||
/*
|
||||
* Compatibility:
|
||||
* PROCESSOR_INTEL_386 386
|
||||
* PROCESSOR_INTEL_486 486
|
||||
* PROCESSOR_INTEL_PENTIUM 586
|
||||
* PROCESSOR_MIPS_R4000 4000
|
||||
* PROCESSOR_ALPHA_21064 21064
|
||||
*/
|
||||
#if 0
|
||||
switch (Spi.KeProcessorArchitecture)
|
||||
{
|
||||
case :
|
||||
#endif
|
||||
Si->dwProcessorType = PROCESSOR_INTEL_PENTIUM;
|
||||
#if 0
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
Si->dwAllocationGranularity = 65536; /* hard coded on Intel? */
|
||||
Si->wProcessorRevision = Spi.KeProcessorRevision;
|
||||
/*
|
||||
* Get the version of Windows on which
|
||||
* the process expects to run.
|
||||
*/
|
||||
#if 0
|
||||
ProcessVersion = GetProcessVersion (0); /* current process */
|
||||
#endif
|
||||
|
||||
/* In NT 3.1, these fields were always zero. */
|
||||
if (PV_NT351 > ProcessVersion)
|
||||
{
|
||||
Si->wProcessorLevel = 0;
|
||||
Si->wProcessorRevision = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* EOF */
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: proc.c,v 1.31 2000/03/16 01:14:37 ekohl Exp $
|
||||
/* $Id: proc.c,v 1.32 2000/04/25 23:22:54 ea Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
|
@ -16,10 +16,13 @@
|
|||
#include <windows.h>
|
||||
#include <kernel32/proc.h>
|
||||
#include <kernel32/thread.h>
|
||||
#include <kernel32/error.h>
|
||||
#include <wchar.h>
|
||||
#include <string.h>
|
||||
#include <internal/i386/segment.h>
|
||||
#include <internal/teb.h>
|
||||
#include <ntdll/csr.h>
|
||||
|
||||
|
||||
#define NDEBUG
|
||||
#include <kernel32/kernel32.h>
|
||||
|
@ -61,8 +64,35 @@ GetProcessTimes (
|
|||
LPFILETIME lpUserTime
|
||||
)
|
||||
{
|
||||
DPRINT("GetProcessTimes is unimplemented\n");
|
||||
return FALSE;
|
||||
NTSTATUS Status;
|
||||
KERNEL_USER_TIMES Kut;
|
||||
|
||||
Status = NtQueryInformationProcess (
|
||||
hProcess,
|
||||
ProcessTimes,
|
||||
& Kut,
|
||||
sizeof Kut,
|
||||
NULL
|
||||
);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastErrorByStatus (Status);
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
lpCreationTime->dwLowDateTime = Kut.CreateTime.u.LowPart;
|
||||
lpCreationTime->dwHighDateTime = Kut.CreateTime.u.HighPart;
|
||||
|
||||
lpExitTime->dwLowDateTime = Kut.ExitTime.u.LowPart;
|
||||
lpExitTime->dwHighDateTime = Kut.ExitTime.u.HighPart;
|
||||
|
||||
lpKernelTime->dwLowDateTime = Kut.KernelTime.u.LowPart;
|
||||
lpKernelTime->dwHighDateTime = Kut.KernelTime.u.HighPart;
|
||||
|
||||
lpUserTime->dwLowDateTime = Kut.UserTime.u.LowPart;
|
||||
lpUserTime->dwHighDateTime = Kut.UserTime.u.HighPart;
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -102,7 +132,7 @@ GetExitCodeProcess (
|
|||
&BytesWritten);
|
||||
if (!NT_SUCCESS(errCode))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(errCode));
|
||||
SetLastErrorByStatus (errCode);
|
||||
return FALSE;
|
||||
}
|
||||
memcpy(lpExitCode, &ProcessBasic.ExitStatus, sizeof(DWORD));
|
||||
|
@ -128,7 +158,7 @@ GetProcessId (
|
|||
&BytesWritten);
|
||||
if (!NT_SUCCESS(errCode))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(errCode));
|
||||
SetLastErrorByStatus (errCode);
|
||||
return FALSE;
|
||||
}
|
||||
memcpy( lpProcessId ,&ProcessBasic.UniqueProcessId,sizeof(DWORD));
|
||||
|
@ -169,7 +199,7 @@ OpenProcess (
|
|||
&ClientId);
|
||||
if (!NT_SUCCESS(errCode))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(errCode));
|
||||
SetLastErrorByStatus (errCode);
|
||||
return NULL;
|
||||
}
|
||||
return ProcessHandle;
|
||||
|
@ -207,10 +237,15 @@ WinExec (
|
|||
dosErr = GetLastError();
|
||||
return dosErr;
|
||||
}
|
||||
if ( lpfnGlobalRegisterWaitForInputIdle != NULL )
|
||||
lpfnGlobalRegisterWaitForInputIdle(ProcessInformation.hProcess,10000);
|
||||
NtClose(ProcessInformation.hProcess);
|
||||
NtClose(ProcessInformation.hThread);
|
||||
if (NULL != lpfnGlobalRegisterWaitForInputIdle)
|
||||
{
|
||||
lpfnGlobalRegisterWaitForInputIdle (
|
||||
ProcessInformation.hProcess,
|
||||
10000
|
||||
);
|
||||
}
|
||||
NtClose (ProcessInformation.hProcess);
|
||||
NtClose (ProcessInformation.hThread);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -260,10 +295,10 @@ SleepEx (
|
|||
|
||||
Interval.QuadPart = dwMilliseconds * 1000;
|
||||
|
||||
errCode = NtDelayExecution(bAlertable,&Interval);
|
||||
errCode = NtDelayExecution (bAlertable, & Interval);
|
||||
if (!NT_SUCCESS(errCode))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(errCode));
|
||||
SetLastErrorByStatus (errCode);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -390,13 +425,13 @@ FlushInstructionCache (
|
|||
{
|
||||
NTSTATUS errCode;
|
||||
|
||||
errCode = NtFlushInstructionCache(
|
||||
errCode = NtFlushInstructionCache (
|
||||
hProcess,
|
||||
(PVOID) lpBaseAddress,
|
||||
dwSize);
|
||||
if (!NT_SUCCESS(errCode))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(errCode));
|
||||
SetLastErrorByStatus (errCode);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
|
@ -423,10 +458,10 @@ TerminateProcess (
|
|||
{
|
||||
NTSTATUS errCode;
|
||||
|
||||
errCode = NtTerminateProcess(hProcess, uExitCode);
|
||||
errCode = NtTerminateProcess (hProcess, uExitCode);
|
||||
if (!NT_SUCCESS(errCode))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(errCode));
|
||||
SetLastErrorByStatus (errCode);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
|
@ -443,11 +478,11 @@ FatalAppExitA (
|
|||
UNICODE_STRING MessageTextU;
|
||||
ANSI_STRING MessageText;
|
||||
|
||||
RtlInitAnsiString (&MessageText,
|
||||
(LPSTR)lpMessageText);
|
||||
RtlInitAnsiString (& MessageText,
|
||||
(LPSTR) lpMessageText);
|
||||
|
||||
RtlAnsiStringToUnicodeString (&MessageTextU,
|
||||
&MessageText,
|
||||
RtlAnsiStringToUnicodeString (& MessageTextU,
|
||||
& MessageText,
|
||||
TRUE);
|
||||
|
||||
FatalAppExitW (uAction,
|
||||
|
@ -467,4 +502,111 @@ FatalAppExitW (
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
DWORD
|
||||
STDCALL
|
||||
GetPriorityClass (
|
||||
HANDLE hProcess
|
||||
)
|
||||
{
|
||||
HANDLE hProcessTmp;
|
||||
DWORD CsrPriorityClass;
|
||||
NTSTATUS Status;
|
||||
|
||||
Status = NtDuplicateObject (
|
||||
GetCurrentProcess(),
|
||||
hProcess,
|
||||
GetCurrentProcess(),
|
||||
& hProcessTmp,
|
||||
(PROCESS_SET_INFORMATION | PROCESS_QUERY_INFORMATION),
|
||||
FALSE,
|
||||
0
|
||||
);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastErrorByStatus (Status);
|
||||
return (0); /* ERROR */
|
||||
}
|
||||
/* Ask CSRSS to set it */
|
||||
CsrSetPriorityClass (
|
||||
hProcessTmp,
|
||||
& CsrPriorityClass
|
||||
);
|
||||
NtClose (hProcessTmp);
|
||||
/* Translate CSR->W32 priorities */
|
||||
switch (CsrPriorityClass)
|
||||
{
|
||||
case CSR_PRIORITY_CLASS_NORMAL:
|
||||
return (NORMAL_PRIORITY_CLASS); /* 32 */
|
||||
case CSR_PRIORITY_CLASS_IDLE:
|
||||
return (IDLE_PRIORITY_CLASS); /* 64 */
|
||||
case CSR_PRIORITY_CLASS_HIGH:
|
||||
return (HIGH_PRIORITY_CLASS); /* 128 */
|
||||
case CSR_PRIORITY_CLASS_REALTIME:
|
||||
return (REALTIME_PRIORITY_CLASS); /* 256 */
|
||||
}
|
||||
SetLastError (ERROR_ACCESS_DENIED);
|
||||
return (0); /* ERROR */
|
||||
}
|
||||
|
||||
|
||||
|
||||
WINBOOL
|
||||
STDCALL
|
||||
SetPriorityClass (
|
||||
HANDLE hProcess,
|
||||
DWORD dwPriorityClass
|
||||
)
|
||||
{
|
||||
HANDLE hProcessTmp;
|
||||
DWORD CsrPriorityClass;
|
||||
NTSTATUS Status;
|
||||
|
||||
switch (dwPriorityClass)
|
||||
{
|
||||
case NORMAL_PRIORITY_CLASS: /* 32 */
|
||||
CsrPriorityClass = CSR_PRIORITY_CLASS_NORMAL;
|
||||
break;
|
||||
case IDLE_PRIORITY_CLASS: /* 64 */
|
||||
CsrPriorityClass = CSR_PRIORITY_CLASS_IDLE;
|
||||
break;
|
||||
case HIGH_PRIORITY_CLASS: /* 128 */
|
||||
CsrPriorityClass = CSR_PRIORITY_CLASS_HIGH;
|
||||
break;
|
||||
case REALTIME_PRIORITY_CLASS: /* 256 */
|
||||
CsrPriorityClass = CSR_PRIORITY_CLASS_REALTIME;
|
||||
break;
|
||||
default:
|
||||
SetLastError (ERROR_INVALID_PARAMETER);
|
||||
return (FALSE);
|
||||
}
|
||||
Status = NtDuplicateObject (
|
||||
GetCurrentProcess(),
|
||||
hProcess,
|
||||
GetCurrentProcess(),
|
||||
& hProcessTmp,
|
||||
(PROCESS_SET_INFORMATION | PROCESS_QUERY_INFORMATION),
|
||||
FALSE,
|
||||
0
|
||||
);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastErrorByStatus (Status);
|
||||
return (FALSE); /* ERROR */
|
||||
}
|
||||
/* Ask CSRSS to set it */
|
||||
Status = CsrSetPriorityClass (
|
||||
hProcessTmp,
|
||||
& CsrPriorityClass
|
||||
);
|
||||
NtClose (hProcessTmp);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastErrorByStatus (Status);
|
||||
return (FALSE);
|
||||
}
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: critical.c,v 1.8 2000/04/20 05:28:31 phreak Exp $
|
||||
/* $Id: critical.c,v 1.9 2000/04/25 23:22:55 ea Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
|
@ -14,6 +14,9 @@
|
|||
|
||||
#include <kernel32/kernel32.h>
|
||||
|
||||
#define NTOS_MODE_USER
|
||||
#include <ntos.h>
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: api.c,v 1.5 2000/04/03 21:54:36 dwelch Exp $
|
||||
/* $Id: api.c,v 1.6 2000/04/25 23:22:55 ea Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -11,6 +11,7 @@
|
|||
#include <ddk/ntddk.h>
|
||||
#include <ntdll/csr.h>
|
||||
#include <string.h>
|
||||
#include <internal/ps.h>
|
||||
|
||||
#include <csrss/csrss.h>
|
||||
|
||||
|
@ -83,3 +84,19 @@ NTSTATUS STDCALL CsrClientConnectToServer(VOID)
|
|||
}
|
||||
return(STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
CsrSetPriorityClass (
|
||||
HANDLE hProcess,
|
||||
DWORD * PriorityClass
|
||||
)
|
||||
{
|
||||
/* FIXME: call csrss to get hProcess' priority */
|
||||
*PriorityClass = PS_PRIORITY_CLASS_NORMAL;
|
||||
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; $Id: ntdll.def,v 1.52 2000/04/15 23:10:02 ekohl Exp $
|
||||
; $Id: ntdll.def,v 1.53 2000/04/25 23:22:55 ea Exp $
|
||||
;
|
||||
; ReactOS Operating System
|
||||
;
|
||||
|
@ -7,6 +7,7 @@ LIBRARY ntdll.dll
|
|||
EXPORTS
|
||||
CsrClientCallServer@16
|
||||
;CsrClientConnectToServer@24
|
||||
CsrSetPriorityClass@8
|
||||
DbgBreakPoint@0
|
||||
DbgPrint
|
||||
;DbgPrompt
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; $Id: ntdll.edf,v 1.41 2000/04/15 23:10:02 ekohl Exp $
|
||||
; $Id: ntdll.edf,v 1.42 2000/04/25 23:22:56 ea Exp $
|
||||
;
|
||||
; ReactOS Operating System
|
||||
;
|
||||
|
@ -7,6 +7,7 @@ LIBRARY ntdll.dll
|
|||
EXPORTS
|
||||
CsrClientCallServer=CsrClientCallServer@16
|
||||
;CsrClientConnectToServer=CsrClientConnectToServer@24
|
||||
CsrSetPriorityClass=CsrSetPriorityClass@8
|
||||
DbgBreakPoint=DbgBreakPoint@0
|
||||
DbgPrint
|
||||
;DbgPrompt
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: sysinfo.c,v 1.4 2000/03/26 19:38:18 ea Exp $
|
||||
/* $Id: sysinfo.c,v 1.5 2000/04/25 23:22:56 ea Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -18,6 +18,8 @@
|
|||
|
||||
#include <internal/debug.h>
|
||||
|
||||
extern ULONG NtGlobalFlag; /* FIXME: it should go in a ddk/?.h */
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
NTSTATUS
|
||||
|
@ -44,13 +46,656 @@ NtSetSystemEnvironmentValue (
|
|||
}
|
||||
|
||||
|
||||
/* --- Query/Set System Information --- */
|
||||
|
||||
|
||||
/*
|
||||
* NOTE: QSI_DEF(n) and SSI_DEF(n) define _cdecl function symbols
|
||||
* so the stack is popped only in one place on x86 platform.
|
||||
*/
|
||||
#define QSI_USE(n) QSI##n
|
||||
#define QSI_DEF(n) \
|
||||
static NTSTATUS QSI_USE(n) (PVOID Buffer, ULONG Size, PULONG ReqSize)
|
||||
|
||||
#define SSI_USE(n) SSI##n
|
||||
#define SSI_DEF(n) \
|
||||
static NTSTATUS SSI_USE(n) (PVOID Buffer, ULONG Size)
|
||||
|
||||
/* Class 0 - Basic Information */
|
||||
QSI_DEF(SystemBasicInformation)
|
||||
{
|
||||
PSYSTEM_BASIC_INFORMATION Sbi
|
||||
= (PSYSTEM_BASIC_INFORMATION) Buffer;
|
||||
|
||||
*ReqSize = sizeof (SYSTEM_BASIC_INFORMATION);
|
||||
/*
|
||||
* Check user buffer's size
|
||||
*/
|
||||
if (Size < sizeof (SYSTEM_BASIC_INFORMATION))
|
||||
{
|
||||
return (STATUS_INFO_LENGTH_MISMATCH);
|
||||
}
|
||||
|
||||
Sbi->AlwaysZero = 0;
|
||||
Sbi->KeMaximumIncrement = 0; /* FIXME */
|
||||
Sbi->MmPageSize = PAGESIZE; /* FIXME: it should be PAGE_SIZE */
|
||||
Sbi->MmNumberOfPhysicalPages = 0; /* FIXME */
|
||||
Sbi->MmLowestPhysicalPage = 0; /* FIXME */
|
||||
Sbi->MmHighestPhysicalPage = 0; /* FIXME */
|
||||
Sbi->MmLowestUserAddress = 0; /* FIXME */
|
||||
Sbi->MmLowestUserAddress1 = 0; /* FIXME */
|
||||
Sbi->MmHighestUserAddress = 0; /* FIXME */
|
||||
Sbi->KeActiveProcessors = 0x00000001; /* FIXME */
|
||||
Sbi->KeNumberProcessors = 1; /* FIXME */
|
||||
|
||||
return (STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
/* Class 1 - Processor Information */
|
||||
QSI_DEF(SystemProcessorInformation)
|
||||
{
|
||||
PSYSTEM_PROCESSOR_INFORMATION Spi
|
||||
= (PSYSTEM_PROCESSOR_INFORMATION) Buffer;
|
||||
|
||||
*ReqSize = sizeof (SYSTEM_PROCESSOR_INFORMATION);
|
||||
/*
|
||||
* Check user buffer's size
|
||||
*/
|
||||
if (Size < sizeof (SYSTEM_PROCESSOR_INFORMATION))
|
||||
{
|
||||
return (STATUS_INFO_LENGTH_MISMATCH);
|
||||
}
|
||||
|
||||
/* FIXME: add CPU type detection code */
|
||||
Spi->KeProcessorArchitecture = 0; /* FIXME */
|
||||
Spi->KeProcessorLevel = 0; /* FIXME */
|
||||
Spi->KeProcessorRevision = 0; /* FIXME */
|
||||
Spi->AlwaysZero = 0;
|
||||
Spi->KeFeatureBits = 0x00000000; /* FIXME */
|
||||
|
||||
return (STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
/* Class 2 - Performance Information */
|
||||
QSI_DEF(SystemPerformanceInfo)
|
||||
{
|
||||
PSYSTEM_PERFORMANCE_INFO Spi
|
||||
= (PSYSTEM_PERFORMANCE_INFO) Buffer;
|
||||
|
||||
*ReqSize = sizeof (SYSTEM_PERFORMANCE_INFO);
|
||||
/*
|
||||
* Check user buffer's size
|
||||
*/
|
||||
if (Size < sizeof (SYSTEM_PERFORMANCE_INFO))
|
||||
{
|
||||
return (STATUS_INFO_LENGTH_MISMATCH);
|
||||
}
|
||||
|
||||
Spi->TotalProcessorTime.QuadPart = 0; /* FIXME */
|
||||
Spi->IoReadTransferCount.QuadPart = 0; /* FIXME */
|
||||
Spi->IoWriteTransferCount.QuadPart = 0; /* FIXME */
|
||||
Spi->IoOtherTransferCount.QuadPart = 0; /* FIXME */
|
||||
Spi->IoReadOperationCount = 0; /* FIXME */
|
||||
Spi->IoWriteOperationCount = 0; /* FIXME */
|
||||
Spi->IoOtherOperationCount = 0; /* FIXME */
|
||||
Spi->MmAvailablePages = 0; /* FIXME */
|
||||
Spi->MmTotalCommitedPages = 0; /* FIXME */
|
||||
Spi->MmTotalCommitLimit = 0; /* FIXME */
|
||||
Spi->MmPeakLimit = 0; /* FIXME */
|
||||
Spi->PageFaults = 0; /* FIXME */
|
||||
Spi->WriteCopies = 0; /* FIXME */
|
||||
Spi->TransitionFaults = 0; /* FIXME */
|
||||
Spi->Unknown1 = 0; /* FIXME */
|
||||
Spi->DemandZeroFaults = 0; /* FIXME */
|
||||
Spi->PagesInput = 0; /* FIXME */
|
||||
Spi->PagesRead = 0; /* FIXME */
|
||||
Spi->Unknown2 = 0; /* FIXME */
|
||||
Spi->Unknown3 = 0; /* FIXME */
|
||||
Spi->PagesOutput = 0; /* FIXME */
|
||||
Spi->PageWrites = 0; /* FIXME */
|
||||
Spi->Unknown4 = 0; /* FIXME */
|
||||
Spi->Unknown5 = 0; /* FIXME */
|
||||
Spi->PoolPagedBytes = 0; /* FIXME */
|
||||
Spi->PoolNonPagedBytes = 0; /* FIXME */
|
||||
Spi->Unknown6 = 0; /* FIXME */
|
||||
Spi->Unknown7 = 0; /* FIXME */
|
||||
Spi->Unknown8 = 0; /* FIXME */
|
||||
Spi->Unknown9 = 0; /* FIXME */
|
||||
Spi->MmTotalSystemFreePtes = 0; /* FIXME */
|
||||
Spi->MmSystemCodepage = 0; /* FIXME */
|
||||
Spi->MmTotalSystemDriverPages = 0; /* FIXME */
|
||||
Spi->MmTotalSystemCodePages = 0; /* FIXME */
|
||||
Spi->Unknown10 = 0; /* FIXME */
|
||||
Spi->Unknown11 = 0; /* FIXME */
|
||||
Spi->Unknown12 = 0; /* FIXME */
|
||||
Spi->MmSystemCachePage = 0; /* FIXME */
|
||||
Spi->MmPagedPoolPage = 0; /* FIXME */
|
||||
Spi->MmSystemDriverPage = 0; /* FIXME */
|
||||
Spi->CcFastReadNoWait = 0; /* FIXME */
|
||||
Spi->CcFastReadWait = 0; /* FIXME */
|
||||
Spi->CcFastReadResourceMiss = 0; /* FIXME */
|
||||
Spi->CcFastReadNotPossible = 0; /* FIXME */
|
||||
Spi->CcFastMdlReadNoWait = 0; /* FIXME */
|
||||
Spi->CcFastMdlReadWait = 0; /* FIXME */
|
||||
Spi->CcFastMdlReadResourceMiss = 0; /* FIXME */
|
||||
Spi->CcFastMdlReadNotPossible = 0; /* FIXME */
|
||||
Spi->CcMapDataNoWait = 0; /* FIXME */
|
||||
Spi->CcMapDataWait = 0; /* FIXME */
|
||||
Spi->CcMapDataNoWaitMiss = 0; /* FIXME */
|
||||
Spi->CcMapDataWaitMiss = 0; /* FIXME */
|
||||
Spi->CcPinMappedDataCount = 0; /* FIXME */
|
||||
Spi->CcPinReadNoWait = 0; /* FIXME */
|
||||
Spi->CcPinReadWait = 0; /* FIXME */
|
||||
Spi->CcPinReadNoWaitMiss = 0; /* FIXME */
|
||||
Spi->CcPinReadWaitMiss = 0; /* FIXME */
|
||||
Spi->CcCopyReadNoWait = 0; /* FIXME */
|
||||
Spi->CcCopyReadWait = 0; /* FIXME */
|
||||
Spi->CcCopyReadNoWaitMiss = 0; /* FIXME */
|
||||
Spi->CcCopyReadWaitMiss = 0; /* FIXME */
|
||||
Spi->CcMdlReadNoWait = 0; /* FIXME */
|
||||
Spi->CcMdlReadWait = 0; /* FIXME */
|
||||
Spi->CcMdlReadNoWaitMiss = 0; /* FIXME */
|
||||
Spi->CcMdlReadWaitMiss = 0; /* FIXME */
|
||||
Spi->CcReadaheadIos = 0; /* FIXME */
|
||||
Spi->CcLazyWriteIos = 0; /* FIXME */
|
||||
Spi->CcLazyWritePages = 0; /* FIXME */
|
||||
Spi->CcDataFlushes = 0; /* FIXME */
|
||||
Spi->CcDataPages = 0; /* FIXME */
|
||||
Spi->ContextSwitches = 0; /* FIXME */
|
||||
Spi->Unknown13 = 0; /* FIXME */
|
||||
Spi->Unknown14 = 0; /* FIXME */
|
||||
Spi->SystemCalls = 0; /* FIXME */
|
||||
|
||||
return (STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
/* Class 3 - Time Information */
|
||||
QSI_DEF(SystemTimeInformation)
|
||||
{
|
||||
PSYSTEM_TIME_INFORMATION Sti
|
||||
= (PSYSTEM_TIME_INFORMATION) Buffer;
|
||||
|
||||
*ReqSize = sizeof (SYSTEM_TIME_INFORMATION);
|
||||
/*
|
||||
* Check user buffer's size
|
||||
*/
|
||||
if (Size < sizeof (SYSTEM_TIME_INFORMATION))
|
||||
{
|
||||
return (STATUS_INFO_LENGTH_MISMATCH);
|
||||
}
|
||||
|
||||
Sti->KeBootTime.QuadPart = 0; /* FIXME */
|
||||
Sti->KeSystemTime.QuadPart = 0; /* FIXME */
|
||||
Sti->ExpTimeZoneBias.QuadPart = 0; /* FIXME */
|
||||
Sti->ExpTimeZoneId = 0; /* FIXME */
|
||||
Sti->Unused = 0; /* FIXME */
|
||||
|
||||
return (STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
/* Class 4 - Path Information */
|
||||
QSI_DEF(SystemPathInformation)
|
||||
{
|
||||
/* FIXME: QSI returns STATUS_BREAKPOINT. Why? */
|
||||
return (STATUS_BREAKPOINT);
|
||||
}
|
||||
|
||||
/* Class 5 - Process Information */
|
||||
QSI_DEF(SystemProcessInformation)
|
||||
{
|
||||
/* FIXME: scan the process+thread list */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 6 - SDT Information */
|
||||
QSI_DEF(SystemServiceDescriptorTableInfo)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 7 - I/O Configuration Information */
|
||||
QSI_DEF(SystemIoConfigInfo)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 8 - Processor Time Information */
|
||||
QSI_DEF(SystemProcessorTimeInfo)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 9 - Global Flag Information */
|
||||
QSI_DEF(SystemNtGlobalFlagInformation)
|
||||
{
|
||||
if (sizeof (SYSTEM_GLOBAL_FLAG_INFO) != Size)
|
||||
{
|
||||
* ReqSize = sizeof (SYSTEM_GLOBAL_FLAG_INFO);
|
||||
return (STATUS_INFO_LENGTH_MISMATCH);
|
||||
}
|
||||
((PSYSTEM_GLOBAL_FLAG_INFO) Buffer)->NtGlobalFlag = NtGlobalFlag;
|
||||
return (STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
SSI_DEF(SystemNtGlobalFlagInformation)
|
||||
{
|
||||
if (sizeof (SYSTEM_GLOBAL_FLAG_INFO) != Size)
|
||||
{
|
||||
return (STATUS_INFO_LENGTH_MISMATCH);
|
||||
}
|
||||
NtGlobalFlag = ((PSYSTEM_GLOBAL_FLAG_INFO) Buffer)->NtGlobalFlag;
|
||||
return (STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
/* Class 10 - ? Information */
|
||||
QSI_DEF(SystemInformation10)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 11 - Modules Information */
|
||||
QSI_DEF(SystemModuleInfo)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 12 - Resource Lock Information */
|
||||
QSI_DEF(SystemResourceLockInfo)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 13 - ? Information */
|
||||
QSI_DEF(SystemInformation13)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 14 - ? Information */
|
||||
QSI_DEF(SystemInformation14)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 15 - ? Information */
|
||||
QSI_DEF(SystemInformation15)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 16 - Handle Information */
|
||||
QSI_DEF(SystemHandleInfo)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 17 - Information */
|
||||
QSI_DEF(SystemObjectInformation)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 18 - Information */
|
||||
QSI_DEF(SystemPageFileInformation)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 19 - Information */
|
||||
QSI_DEF(SystemInstructionEmulationInfo)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 20 - ? Information */
|
||||
QSI_DEF(SystemInformation20)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 21 - Information */
|
||||
QSI_DEF(SystemCacheInformation)
|
||||
{
|
||||
if (Size < sizeof (SYSTEM_CACHE_INFORMATION))
|
||||
{
|
||||
* ReqSize = sizeof (SYSTEM_CACHE_INFORMATION);
|
||||
return (STATUS_INFO_LENGTH_MISMATCH);
|
||||
}
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
SSI_DEF(SystemCacheInformation)
|
||||
{
|
||||
if (Size < sizeof (SYSTEM_CACHE_INFORMATION))
|
||||
{
|
||||
return (STATUS_INFO_LENGTH_MISMATCH);
|
||||
}
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 22 - Pool Tag Information */
|
||||
QSI_DEF(SystemPoolTagInformation)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 23 - Processor Schedule Information */
|
||||
QSI_DEF(SystemProcessorScheduleInfo)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 24 - DPC Information */
|
||||
QSI_DEF(SystemDpcInformation)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
SSI_DEF(SystemDpcInformation)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 25 - ? Information */
|
||||
QSI_DEF(SystemInformation25)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 26 - Load Image (callable) */
|
||||
SSI_DEF(SystemLoadImage)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 27 - Unload Image (callable) */
|
||||
SSI_DEF(SystemUnloadImage)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 28 - Information */
|
||||
QSI_DEF(SystemTimeAdjustmentInformation)
|
||||
{
|
||||
if (sizeof (SYSTEM_TIME_ADJUSTMENT_INFO) > Size)
|
||||
{
|
||||
* ReqSize = sizeof (SYSTEM_TIME_ADJUSTMENT_INFO);
|
||||
return (STATUS_INFO_LENGTH_MISMATCH);
|
||||
}
|
||||
/* FIXME: */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
SSI_DEF(SystemTimeAdjustmentInformation)
|
||||
{
|
||||
if (sizeof (SYSTEM_TIME_ADJUSTMENT_INFO) > Size)
|
||||
{
|
||||
return (STATUS_INFO_LENGTH_MISMATCH);
|
||||
}
|
||||
/* FIXME: */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 29 - ? Information */
|
||||
QSI_DEF(SystemInformation29)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 30 - ? Information */
|
||||
QSI_DEF(SystemInformation30)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 31 - ? Information */
|
||||
QSI_DEF(SystemInformation31)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 32 - Crach Dump Information */
|
||||
QSI_DEF(SystemCrashDumpSectionInfo)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 33 - Processor Fault Information */
|
||||
QSI_DEF(SystemProcessorFaultCountInfo)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 34 - Crach Dump State Information */
|
||||
QSI_DEF(SystemCrashDumpStateInfo)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 35 - Debugger Information */
|
||||
QSI_DEF(SystemDebuggerInfo)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 36 - Thread Switch Counters Information */
|
||||
QSI_DEF(SystemThreadSwitchCountersInfo)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 37 - Quota Information */
|
||||
QSI_DEF(SystemQuotaInformation)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
SSI_DEF(SystemQuotaInformation)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 38 - Load Driver Information */
|
||||
SSI_DEF(SystemLoadDriverInfo)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 39 - Priority Separation Information */
|
||||
SSI_DEF(SystemPrioritySeparationInfo)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 40 - ? Information */
|
||||
QSI_DEF(SystemInformation40)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 41 - ? Information */
|
||||
QSI_DEF(SystemInformation41)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 42 - ? Information */
|
||||
QSI_DEF(SystemInformation42)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 43 - ? Information */
|
||||
QSI_DEF(SystemInformation43)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
/* Class 44 - Information */
|
||||
QSI_DEF(SystemTimeZoneInformation)
|
||||
{
|
||||
* ReqSize = sizeof (TIME_ZONE_INFORMATION);
|
||||
|
||||
if (sizeof (TIME_ZONE_INFORMATION) != Size)
|
||||
{
|
||||
return (STATUS_INFO_LENGTH_MISMATCH);
|
||||
}
|
||||
/* Copy the time zone information struct */
|
||||
memcpy (
|
||||
Buffer,
|
||||
& SystemTimeZoneInfo,
|
||||
sizeof (TIME_ZONE_INFORMATION)
|
||||
);
|
||||
|
||||
return (STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
SSI_DEF(SystemTimeZoneInformation)
|
||||
{
|
||||
/*
|
||||
* Check user buffer's size
|
||||
*/
|
||||
if (Size < sizeof (TIME_ZONE_INFORMATION))
|
||||
{
|
||||
return (STATUS_INFO_LENGTH_MISMATCH);
|
||||
}
|
||||
/* Copy the time zone information struct */
|
||||
memcpy (
|
||||
& SystemTimeZoneInfo,
|
||||
(TIME_ZONE_INFORMATION *) Buffer,
|
||||
sizeof (TIME_ZONE_INFORMATION)
|
||||
);
|
||||
return (STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
/* Class 45 - Information */
|
||||
QSI_DEF(SystemLookasideInformation)
|
||||
{
|
||||
/* FIXME */
|
||||
return (STATUS_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
|
||||
/* Query/Set Calls Table */
|
||||
typedef
|
||||
struct _QSSI_CALLS
|
||||
{
|
||||
NTSTATUS (* Query) (PVOID,ULONG,PULONG);
|
||||
NTSTATUS (* Set) (PVOID,ULONG);
|
||||
|
||||
} QSSI_CALLS;
|
||||
|
||||
// QS Query & Set
|
||||
// QX Query
|
||||
// XQ Set
|
||||
// XX unknown behaviour
|
||||
//
|
||||
#define SI_QS(n) {QSI_USE(n),SSI_USE(n)}
|
||||
#define SI_QX(n) {QSI_USE(n),NULL}
|
||||
#define SI_XS(n) {NULL,SSI_USE(n)}
|
||||
#define SI_XX(n) {NULL,NULL}
|
||||
|
||||
static
|
||||
QSSI_CALLS
|
||||
CallQS [] =
|
||||
{
|
||||
SI_QX(SystemBasicInformation),
|
||||
SI_QX(SystemProcessorInformation),
|
||||
SI_QX(SystemPerformanceInfo),
|
||||
SI_QX(SystemTimeInformation),
|
||||
SI_QX(SystemPathInformation), /* should be SI_XX */
|
||||
SI_QX(SystemProcessInformation),
|
||||
SI_QX(SystemServiceDescriptorTableInfo),
|
||||
SI_QX(SystemIoConfigInfo),
|
||||
SI_QX(SystemProcessorTimeInfo),
|
||||
SI_QS(SystemNtGlobalFlagInformation),
|
||||
SI_QX(SystemInformation10), /* should be SI_XX */
|
||||
SI_QX(SystemModuleInfo),
|
||||
SI_QX(SystemResourceLockInfo),
|
||||
SI_QX(SystemInformation13), /* should be SI_XX */
|
||||
SI_QX(SystemInformation14), /* should be SI_XX */
|
||||
SI_QX(SystemInformation15), /* should be SI_XX */
|
||||
SI_QX(SystemHandleInfo),
|
||||
SI_QX(SystemObjectInformation),
|
||||
SI_QX(SystemPageFileInformation),
|
||||
SI_QX(SystemInstructionEmulationInfo),
|
||||
SI_QX(SystemInformation20), /* it should be SI_XX */
|
||||
SI_QS(SystemCacheInformation),
|
||||
SI_QX(SystemPoolTagInformation),
|
||||
SI_QX(SystemProcessorScheduleInfo),
|
||||
SI_QS(SystemDpcInformation),
|
||||
SI_QX(SystemInformation25), /* it should be SI_XX */
|
||||
SI_XS(SystemLoadImage),
|
||||
SI_XS(SystemUnloadImage),
|
||||
SI_QS(SystemTimeAdjustmentInformation),
|
||||
SI_QX(SystemInformation29), /* it should be SI_XX */
|
||||
SI_QX(SystemInformation30), /* it should be SI_XX */
|
||||
SI_QX(SystemInformation31), /* it should be SI_XX */
|
||||
SI_QX(SystemCrashDumpSectionInfo),
|
||||
SI_QX(SystemProcessorFaultCountInfo),
|
||||
SI_QX(SystemCrashDumpStateInfo),
|
||||
SI_QX(SystemDebuggerInfo),
|
||||
SI_QX(SystemThreadSwitchCountersInfo),
|
||||
SI_QS(SystemQuotaInformation),
|
||||
SI_XS(SystemLoadDriverInfo),
|
||||
SI_XS(SystemPrioritySeparationInfo),
|
||||
SI_QX(SystemInformation40), /* it should be SI_XX */
|
||||
SI_QX(SystemInformation41), /* it should be SI_XX */
|
||||
SI_QX(SystemInformation42), /* it should be SI_XX */
|
||||
SI_QX(SystemInformation43), /* it should be SI_XX */
|
||||
SI_QS(SystemTimeZoneInformation), /* it should be SI_QX */
|
||||
SI_QX(SystemLookasideInformation)
|
||||
};
|
||||
|
||||
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
NtQuerySystemInformation (
|
||||
IN CINT SystemInformationClass,
|
||||
OUT PVOID SystemInformation,
|
||||
IN ULONG Length,
|
||||
OUT PULONG ResultLength
|
||||
IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
||||
OUT PVOID SystemInformation,
|
||||
IN ULONG Length,
|
||||
OUT PULONG ResultLength
|
||||
)
|
||||
{
|
||||
/*
|
||||
|
@ -74,118 +719,36 @@ NtQuerySystemInformation (
|
|||
/*
|
||||
* Clear the user buffer.
|
||||
*/
|
||||
memset(
|
||||
SystemInformation,
|
||||
0,
|
||||
Length
|
||||
);
|
||||
RtlZeroMemory (SystemInformation, Length);
|
||||
/*
|
||||
* Check the request is valid.
|
||||
*/
|
||||
switch (SystemInformationClass)
|
||||
if ( (SystemInformationClass >= SystemInformationClassMin)
|
||||
&& (SystemInformationClass < SystemInformationClassMax)
|
||||
)
|
||||
{
|
||||
#if 0
|
||||
/*---*/
|
||||
case SystemPerformanceInformation:
|
||||
/*
|
||||
* Check user buffer's size
|
||||
*/
|
||||
if (Length < sizeof())
|
||||
{
|
||||
*ResultLength =
|
||||
return STATUS_INFO_LENGTH_MISMATCH;
|
||||
}
|
||||
/* FIXME */
|
||||
return STATUS_SUCCESS;
|
||||
/*---*/
|
||||
case SystemDriverInformation:
|
||||
/* Check user buffer's size */
|
||||
if (Length < sizeof (SYSTEM_DRIVER_INFO))
|
||||
{
|
||||
*ResultLength = sizeof (SYSTEM_DRIVER_INFO);
|
||||
return STATUS_INFO_LENGTH_MISMATCH;
|
||||
}
|
||||
/* FIXME: */
|
||||
return STATUS_SUCCESS;
|
||||
/*---*/
|
||||
case SystemCacheInformation:
|
||||
/* Check user buffer's size */
|
||||
if (Length < sizeof (SYSTEM_CACHE_INFORMATION))
|
||||
{
|
||||
*ResultLength = sizeof (SYSTEM_CACHE_INFORMATION);
|
||||
return STATUS_INFO_LENGTH_MISMATCH;
|
||||
}
|
||||
return STATUS_SUCCESS;
|
||||
/*---*/
|
||||
case SystemTimeAdjustmentInformation:
|
||||
/*
|
||||
* Check user buffer's size
|
||||
*/
|
||||
if (Length < sizeof (SYSTEM_TIME_ADJUSTMENT))
|
||||
{
|
||||
*ResultLength = sizeof (SYSTEM_TIME_ADJUSTMENT);
|
||||
return STATUS_INFO_LENGTH_MISMATCH;
|
||||
}
|
||||
/* FIXME: */
|
||||
return STATUS_SUCCESS;
|
||||
/*---*/
|
||||
case SystemConfigurationInformation:
|
||||
if (NULL != CallQS [SystemInformationClass].Query)
|
||||
{
|
||||
PSYSTEM_CONFIGURATION_INFO Sci
|
||||
= (PSYSTEM_CONFIGURATION_INFO) SystemInformation;
|
||||
|
||||
*ResultLength = sizeof (SYSTEM_CONFIGUTATION_INFO);
|
||||
/*
|
||||
* Check user buffer's size
|
||||
* Hand the request to a subhandler.
|
||||
*/
|
||||
if (Length < sizeof (SYSTEM_CONFIGURATION_INFO))
|
||||
{
|
||||
return STATUS_INFO_LENGTH_MISMATCH;
|
||||
}
|
||||
/*
|
||||
* Fill the object with config data.
|
||||
* FIXME: some data should come from the
|
||||
* registry.
|
||||
*/
|
||||
Sci->tag2.tag1.ProcessorAchitecture
|
||||
= 80586;
|
||||
Sci->tag2.tag1.Reserved
|
||||
= 0x00000000;
|
||||
Sci->PageSize
|
||||
= 4096;
|
||||
return STATUS_SUCCESS;
|
||||
return CallQS [SystemInformationClass].Query (
|
||||
SystemInformation,
|
||||
Length,
|
||||
ResultLength
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
case SystemTimeZoneInformation: /* 44 */
|
||||
*ResultLength = sizeof (TIME_ZONE_INFORMATION);
|
||||
|
||||
/*
|
||||
* Check user buffer's size
|
||||
*/
|
||||
if (Length < sizeof (TIME_ZONE_INFORMATION))
|
||||
{
|
||||
return STATUS_INFO_LENGTH_MISMATCH;
|
||||
}
|
||||
|
||||
/* Copy the time zone information struct */
|
||||
memcpy (SystemInformation,
|
||||
&SystemTimeZoneInfo,
|
||||
sizeof (TIME_ZONE_INFORMATION));
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
|
||||
}
|
||||
return STATUS_INVALID_INFO_CLASS;
|
||||
return (STATUS_INVALID_INFO_CLASS);
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
NtSetSystemInformation (
|
||||
IN CINT SystemInformationClass,
|
||||
IN PVOID SystemInformation,
|
||||
IN ULONG SystemInformationLength
|
||||
IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
||||
IN PVOID SystemInformation,
|
||||
IN ULONG SystemInformationLength
|
||||
)
|
||||
{
|
||||
/*
|
||||
|
@ -206,32 +769,25 @@ NtSetSystemInformation (
|
|||
// );
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Check the request is valid.
|
||||
*/
|
||||
switch (SystemInformationClass)
|
||||
if ( (SystemInformationClass >= SystemInformationClassMin)
|
||||
&& (SystemInformationClass < SystemInformationClassMax)
|
||||
)
|
||||
{
|
||||
|
||||
|
||||
case SystemTimeZoneInformation: /* 44 */
|
||||
if (NULL != CallQS [SystemInformationClass].Set)
|
||||
{
|
||||
/*
|
||||
* Check user buffer's size
|
||||
* Hand the request to a subhandler.
|
||||
*/
|
||||
if (SystemInformationLength < sizeof (TIME_ZONE_INFORMATION))
|
||||
{
|
||||
return STATUS_INFO_LENGTH_MISMATCH;
|
||||
}
|
||||
|
||||
/* Copy the time zone information struct */
|
||||
memcpy (&SystemTimeZoneInfo,
|
||||
&SystemInformation,
|
||||
sizeof (TIME_ZONE_INFORMATION));
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
return CallQS [SystemInformationClass].Set (
|
||||
SystemInformation,
|
||||
SystemInformationLength
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return STATUS_INVALID_INFO_CLASS;
|
||||
return (STATUS_INVALID_INFO_CLASS);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*
|
||||
/* $Id: time.c,v 1.9 2000/04/25 23:22:56 ea Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: kernel/excutive/time.c
|
||||
|
@ -22,7 +23,7 @@
|
|||
/* GLOBALS ******************************************************************/
|
||||
|
||||
/* Note: Bias[minutes] = UTC - local time */
|
||||
TIME_ZONE_INFORMATION SystemTimeZoneInfo;
|
||||
TIME_ZONE_INFORMATION _SystemTimeZoneInfo;
|
||||
|
||||
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
@ -31,7 +32,7 @@ VOID
|
|||
ExInitTimeZoneInfo (VOID)
|
||||
{
|
||||
/* Initialize system time zone information */
|
||||
memset (&SystemTimeZoneInfo, 0, sizeof(TIME_ZONE_INFORMATION));
|
||||
memset (& _SystemTimeZoneInfo, 0, sizeof(TIME_ZONE_INFORMATION));
|
||||
|
||||
/* FIXME: Read time zone information from the registry */
|
||||
|
||||
|
@ -69,7 +70,7 @@ ExLocalTimeToSystemTime (
|
|||
)
|
||||
{
|
||||
SystemTime->QuadPart = LocalTime->QuadPart +
|
||||
SystemTimeZoneInfo.Bias * TICKSPERMINUTE;
|
||||
_SystemTimeZoneInfo.Bias * TICKSPERMINUTE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -80,7 +81,7 @@ ExSystemTimeToLocalTime (
|
|||
)
|
||||
{
|
||||
LocalTime->QuadPart = SystemTime->QuadPart -
|
||||
SystemTimeZoneInfo.Bias * TICKSPERMINUTE;
|
||||
_SystemTimeZoneInfo.Bias * TICKSPERMINUTE;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -64,6 +64,7 @@ endif
|
|||
CC = $(PREFIX)gcc
|
||||
NATIVE_CC = gcc
|
||||
CFLAGS = \
|
||||
$(BASE_CFLAGS) \
|
||||
-pipe \
|
||||
-O2 \
|
||||
-Wall \
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//======================================================================
|
||||
//
|
||||
// $Id: chkdsk.c,v 1.2 2000/02/29 23:57:46 ea Exp $
|
||||
// $Id: chkdsk.c,v 1.3 2000/04/25 23:22:57 ea Exp $
|
||||
//
|
||||
// Chkdskx
|
||||
//
|
||||
|
@ -63,7 +63,7 @@ WCHAR CurrentDirectory[1024];
|
|||
//
|
||||
// FMIFS function
|
||||
//
|
||||
//PCHKDSK ChkDsk;
|
||||
//PCHKDSK Chkdsk;
|
||||
#endif /* ndef FMIFS_IMPORT_DLL */
|
||||
|
||||
|
||||
|
@ -306,7 +306,7 @@ LoadFMIFSEntryPoints(VOID)
|
|||
{
|
||||
LoadLibraryW( L"fmifs.dll" );
|
||||
|
||||
if( !(ChkDsk =
|
||||
if( !(Chkdsk =
|
||||
(void *) GetProcAddress(
|
||||
GetModuleHandleW(L"fmifs.dll"),
|
||||
"Chkdsk" ))
|
||||
|
@ -459,7 +459,7 @@ ReactOS adaptation 1999 by Emanuele Aliberti\n\n"
|
|||
L"The type of file system is %s.\n",
|
||||
fileSystem
|
||||
);
|
||||
ChkDsk(
|
||||
Chkdsk(
|
||||
Drive,
|
||||
fileSystem,
|
||||
FixErrors,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: makefile,v 1.3 2000/02/29 23:57:47 ea Exp $
|
||||
# $Id: makefile,v 1.4 2000/04/25 23:22:57 ea Exp $
|
||||
#
|
||||
# ReactOS System Utilities
|
||||
#
|
||||
|
@ -15,69 +15,110 @@
|
|||
# 1999-12-19 (ea)
|
||||
# Added qsi.c
|
||||
#
|
||||
# 2000-04-23 (ea)
|
||||
# Added pedump.c
|
||||
#
|
||||
BASE_CFLAGS = -I../../reactos/include
|
||||
|
||||
ROSINC=../../reactos/include
|
||||
|
||||
TARGET=regnav.exe chklib.exe
|
||||
# chkdsk.exe format.exe \
|
||||
# chklib.exe shutdown.exe regnav.exe
|
||||
# login.exe chklib.exe shutdown.exe regnav.exe
|
||||
ROS_DIR=../../reactos
|
||||
ROS_INC=$(ROS_DIR)/include
|
||||
ROS_LIB=$(ROS_DIR)/lib
|
||||
IMPORT_NTDLL=$(ROS_LIB)/ntdll/ntdll.a
|
||||
IMPORT_FMIFS=$(ROS_LIB)/fmifs/fmifs.a
|
||||
IMPORT_KERNEL32=$(ROS_LIB)/kernel32/kernel32.a
|
||||
IMPORT_USER32=$(ROS_LIB)/user32/user32.a
|
||||
IMPORT_CRTDLL=$(ROS_LIB)/crtdll/crtdll.a
|
||||
|
||||
TARGET=\
|
||||
regnav.exe \
|
||||
chklib.exe \
|
||||
qsi.exe
|
||||
# pedump.exe \
|
||||
# shutdown.exe \
|
||||
# chkdsk.exe \
|
||||
# format.exe \
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
# By Mark Russinovich
|
||||
|
||||
chkdsk.exe: chkdsk.o win32err.o wmain.o
|
||||
$(CC) chkdsk.o win32err.o wmain.o \
|
||||
-o chkdsk.exe \
|
||||
-lkernel32 \
|
||||
-lcrtdll \
|
||||
-lfmifs
|
||||
$(CC) \
|
||||
chkdsk.o \
|
||||
win32err.o \
|
||||
wmain.o \
|
||||
$(IMPORT_FMIFS) \
|
||||
$(IMPORT_KERNEL32) \
|
||||
$(IMPORT_CRTDLL) \
|
||||
-o chkdsk.exe
|
||||
$(NM) --numeric-sort chkdsk.exe > chkdsk.sym
|
||||
|
||||
format.exe: format.o win32err.o wmain.o
|
||||
$(CC) format.o win32err.o wmain.o \
|
||||
-o format.exe \
|
||||
-lkernel32 \
|
||||
-lcrtdll \
|
||||
-lfmifs
|
||||
$(CC) \
|
||||
format.o \
|
||||
win32err.o \
|
||||
wmain.o \
|
||||
$(IMPORT_FMIFS) \
|
||||
$(IMPORT_KERNEL32) \
|
||||
$(IMPORT_CRTDLL) \
|
||||
-o format.exe
|
||||
$(NM) --numeric-sort format.exe > format.sym
|
||||
|
||||
#---
|
||||
|
||||
chklib.exe: chklib.o win32err.o
|
||||
$(CC) chklib.o win32err.o \
|
||||
-o chklib.exe \
|
||||
-lkernel32 \
|
||||
-lcrtdll
|
||||
$(CC) \
|
||||
chklib.o \
|
||||
win32err.o \
|
||||
$(IMPORT_KERNEL32) \
|
||||
$(IMPORT_CRTDLL) \
|
||||
-o chklib.exe
|
||||
$(NM) --numeric-sort chklib.exe > chklib.sym
|
||||
|
||||
|
||||
regnav.exe: regnav.o win32err.o
|
||||
$(CC) regnav.o win32err.o \
|
||||
-o regnav.exe \
|
||||
-lkernel32 \
|
||||
-lcrtdll
|
||||
$(CC) \
|
||||
regnav.o \
|
||||
win32err.o \
|
||||
$(IMPORT_KERNEL32) \
|
||||
$(IMPORT_CRTDLL) \
|
||||
-o regnav.exe
|
||||
$(NM) --numeric-sort regnav.exe > regnav.sym
|
||||
|
||||
|
||||
shutdown.exe: shutdown.o win32err.o
|
||||
$(CC) shutdown.o win32err.o \
|
||||
-o shutdown.exe \
|
||||
-lkernel32 \
|
||||
-luser32 \
|
||||
-lcrtdll
|
||||
$(CC) \
|
||||
shutdown.o \
|
||||
win32err.o \
|
||||
$(IMPORT_KERNEL32) \
|
||||
$(IMPORT_USER32) \
|
||||
$(IMPORT_CRTDLL) \
|
||||
-o shutdown.exe
|
||||
$(NM) --numeric-sort shutdown.exe > shutdown.sym
|
||||
|
||||
qsi.exe: qsi.o
|
||||
$(CC) qsi.o \
|
||||
../../reactos/lib/ntdll/ntdll.a
|
||||
-o qsi.exe \
|
||||
-lkernel32 \
|
||||
-lcrtdll
|
||||
echo $(BASE_CFLAGS)
|
||||
$(CC) \
|
||||
qsi.o \
|
||||
$(IMPORT_NTDLL) \
|
||||
$(IMPORT_KERNEL32) \
|
||||
$(IMPORT_CRTDLL) \
|
||||
-o qsi.exe
|
||||
$(NM) --numeric-sort qsi.exe > qsi.sym
|
||||
|
||||
qsi.o: qsi.c
|
||||
qsi.o: qsi.c $(ROS_INC)/ddk/zwtypes.h
|
||||
|
||||
pedump.exe: pedump.o
|
||||
$(CC) \
|
||||
pedump.o \
|
||||
$(IMPORT_NTDLL) \
|
||||
$(IMPORT_KERNEL32) \
|
||||
$(IMPORT_CRTDLL) \
|
||||
-o pedump.exe
|
||||
$(NM) --numeric-sort pedump.exe > pedump.sym
|
||||
|
||||
pedump.o: pedump.c
|
||||
|
||||
#---
|
||||
|
||||
|
|
2548
rosapps/sysutils/qsi.c
Normal file
2548
rosapps/sysutils/qsi.c
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,4 +1,4 @@
|
|||
/* $Id: shutdown.c,v 1.1 1999/05/16 07:27:35 ea Exp $
|
||||
/* $Id: shutdown.c,v 1.2 2000/04/25 23:22:57 ea Exp $
|
||||
*
|
||||
* EAU shutdown.c 1.4.1
|
||||
*
|
||||
|
@ -34,6 +34,11 @@
|
|||
#include <tchar.h>
|
||||
#include "win32err.h"
|
||||
|
||||
#ifndef SE_PRIVILEGE_ENABLED
|
||||
#define NTOS_MODE_USER
|
||||
#include <ntos.h>
|
||||
#endif
|
||||
|
||||
|
||||
struct _EWX
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue