ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2010
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
19 participants
896 discussions
Start a n
N
ew thread
[akhaldi] 46259: [NTDDK] - Group some related definitions.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Mar 18 14:19:50 2010 New Revision: 46259 URL:
http://svn.reactos.org/svn/reactos?rev=46259&view=rev
Log: [NTDDK] - Group some related definitions. Modified: branches/header-work/include/ddk/ntddk.h Modified: branches/header-work/include/ddk/ntddk.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/ntddk.h…
============================================================================== --- branches/header-work/include/ddk/ntddk.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/ntddk.h [iso-8859-1] Thu Mar 18 14:19:50 2010 @@ -55,6 +55,18 @@ #ifdef __cplusplus extern "C" { #endif + +/* GUID and UUID */ +#ifndef _NTLSA_IFS_ +#ifndef _NTLSA_AUDIT_ +#define _NTLSA_AUDIT_ + +#ifndef GUID_DEFINED +#include <guiddef.h> +#endif + +#endif /* _NTLSA_AUDIT_ */ +#endif /* _NTLSA_IFS_ */ struct _LOADER_PARAMETER_BLOCK; struct _CREATE_DISK; @@ -4443,6 +4455,50 @@ IN PHYSICAL_ADDRESS PhysicalAddress, IN LARGE_INTEGER NumberOfBytes); +typedef BOOLEAN +(NTAPI *pHalTranslateBusAddress)( + IN INTERFACE_TYPE InterfaceType, + IN ULONG BusNumber, + IN PHYSICAL_ADDRESS BusAddress, + IN OUT PULONG AddressSpace, + OUT PPHYSICAL_ADDRESS TranslatedAddress); + +typedef NTSTATUS +(NTAPI *pHalAssignSlotResources)( + IN PUNICODE_STRING RegistryPath, + IN PUNICODE_STRING DriverClassName OPTIONAL, + IN PDRIVER_OBJECT DriverObject, + IN PDEVICE_OBJECT DeviceObject, + IN INTERFACE_TYPE BusType, + IN ULONG BusNumber, + IN ULONG SlotNumber, + IN OUT PCM_RESOURCE_LIST *AllocatedResources); + +typedef VOID +(NTAPI *pHalHaltSystem)( + VOID); + +typedef BOOLEAN +(NTAPI *pHalResetDisplay)( + VOID); + +typedef struct _MAP_REGISTER_ENTRY { + PVOID MapRegister; + BOOLEAN WriteToDevice; +} MAP_REGISTER_ENTRY, *PMAP_REGISTER_ENTRY; + +typedef UCHAR +(NTAPI *pHalVectorToIDTEntry)( + ULONG Vector); + +typedef BOOLEAN +(NTAPI *pHalFindBusAddressTranslation)( + IN PHYSICAL_ADDRESS BusAddress, + IN OUT PULONG AddressSpace, + OUT PPHYSICAL_ADDRESS TranslatedAddress, + IN OUT PULONG_PTR Context, + IN BOOLEAN NextBus); + typedef struct _DEBUG_DEVICE_ADDRESS { UCHAR Type; BOOLEAN Valid; @@ -5287,6 +5343,28 @@ /* ZwXxx Functions */ +NTSYSAPI +NTSTATUS +NTAPI +ZwAllocateLocallyUniqueId( + OUT PLUID Luid); + +NTSYSAPI +NTSTATUS +NTAPI +ZwTerminateProcess( + IN HANDLE ProcessHandle OPTIONAL, + IN NTSTATUS ExitStatus); + +NTSYSAPI +NTSTATUS +NTAPI +ZwOpenProcess( + OUT PHANDLE ProcessHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + IN PCLIENT_ID ClientId OPTIONAL); + #if (NTDDI_VERSION >= NTDDI_WIN2K) NTSTATUS @@ -5346,79 +5424,48 @@ OUT PVOID OutputBuffer OPTIONAL, IN ULONG OutputBufferLength); +NTSYSAPI +NTSTATUS +NTAPI +ZwQueryVolumeInformationFile( + IN HANDLE FileHandle, + OUT PIO_STATUS_BLOCK IoStatusBlock, + OUT PVOID FsInformation, + IN ULONG Length, + IN FS_INFORMATION_CLASS FsInformationClass); + +NTSYSAPI +NTSTATUS +NTAPI +ZwDeviceIoControlFile( + IN HANDLE FileHandle, + IN HANDLE Event OPTIONAL, + IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, + IN PVOID ApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN ULONG IoControlCode, + IN PVOID InputBuffer OPTIONAL, + IN ULONG InputBufferLength, + OUT PVOID OutputBuffer OPTIONAL, + IN ULONG OutputBufferLength); + #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ - - - - - - - - - - - - - - -// -// GUID and UUID -// -#ifndef GUID_DEFINED -#include <guiddef.h> -#endif - -typedef struct _MAP_REGISTER_ENTRY { - PVOID MapRegister; - BOOLEAN WriteToDevice; -} MAP_REGISTER_ENTRY, *PMAP_REGISTER_ENTRY; - -typedef BOOLEAN -(NTAPI *pHalTranslateBusAddress)( - IN INTERFACE_TYPE InterfaceType, - IN ULONG BusNumber, - IN PHYSICAL_ADDRESS BusAddress, - IN OUT PULONG AddressSpace, - OUT PPHYSICAL_ADDRESS TranslatedAddress); - -typedef NTSTATUS -(NTAPI *pHalAssignSlotResources)( - IN PUNICODE_STRING RegistryPath, - IN PUNICODE_STRING DriverClassName OPTIONAL, - IN PDRIVER_OBJECT DriverObject, - IN PDEVICE_OBJECT DeviceObject, - IN INTERFACE_TYPE BusType, - IN ULONG BusNumber, - IN ULONG SlotNumber, - IN OUT PCM_RESOURCE_LIST *AllocatedResources); - -typedef VOID -(NTAPI *pHalHaltSystem)( - VOID); - -typedef BOOLEAN -(NTAPI *pHalResetDisplay)( - VOID); - -typedef UCHAR -(NTAPI *pHalVectorToIDTEntry)( - ULONG Vector); - -typedef BOOLEAN -(NTAPI *pHalFindBusAddressTranslation)( - IN PHYSICAL_ADDRESS BusAddress, - IN OUT PULONG AddressSpace, - OUT PPHYSICAL_ADDRESS TranslatedAddress, - IN OUT PULONG_PTR Context, - IN BOOLEAN NextBus); +#if (NTDDI_VERSION >= NTDDI_WIN7) +NTSTATUS +NTAPI +ZwSetTimerEx( + IN HANDLE TimerHandle, + IN TIMER_SET_INFORMATION_CLASS TimerSetInformationClass, + IN OUT PVOID TimerSetInformation, + IN ULONG TimerSetInformationLength); +#endif + +#ifdef _X86_ extern NTKERNELAPI PVOID MmHighestUserAddress; extern NTKERNELAPI PVOID MmSystemRangeStart; extern NTKERNELAPI ULONG MmUserProbeAddress; - - -#ifdef _X86_ #define MM_HIGHEST_USER_ADDRESS MmHighestUserAddress #define MM_SYSTEM_RANGE_START MmSystemRangeStart @@ -5486,6 +5533,25 @@ return (ULONG)__readfsbyte(FIELD_OFFSET(KPCR, Number)); } +NTKERNELAPI +INTERLOCKED_RESULT +FASTCALL +Exfi386InterlockedIncrementLong( + IN OUT LONG volatile *Addend); + +NTKERNELAPI +INTERLOCKED_RESULT +FASTCALL +Exfi386InterlockedDecrementLong( + IN PLONG Addend); + +NTKERNELAPI +ULONG +FASTCALL +Exfi386InterlockedExchangeUlong( + IN PULONG Target, + IN ULONG Value); + #endif /* _X86_ */ #ifdef _AMD64_ @@ -5578,74 +5644,6 @@ ResultPositive = RESULT_POSITIVE } INTERLOCKED_RESULT; -#ifdef _X86_ - -NTKERNELAPI -INTERLOCKED_RESULT -FASTCALL -Exfi386InterlockedIncrementLong( - IN OUT LONG volatile *Addend); - -NTKERNELAPI -INTERLOCKED_RESULT -FASTCALL -Exfi386InterlockedDecrementLong( - IN PLONG Addend); - -NTKERNELAPI -ULONG -FASTCALL -Exfi386InterlockedExchangeUlong( - IN PULONG Target, - IN ULONG Value); - -#endif /* _X86_ */ - -/* ZwXxx Functions */ - -NTSYSAPI -NTSTATUS -NTAPI -ZwTerminateProcess ( - IN HANDLE ProcessHandle OPTIONAL, - IN NTSTATUS ExitStatus -); - -NTSYSAPI -NTSTATUS -NTAPI -ZwOpenProcess ( - OUT PHANDLE ProcessHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN PCLIENT_ID ClientId OPTIONAL -); - -NTSYSAPI -NTSTATUS -NTAPI -ZwQueryVolumeInformationFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID FsInformation, - IN ULONG Length, - IN FS_INFORMATION_CLASS FsInformationClass); - -NTSYSAPI -NTSTATUS -NTAPI -ZwDeviceIoControlFile( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG IoControlCode, - IN PVOID InputBuffer OPTIONAL, - IN ULONG InputBufferLength, - OUT PVOID OutputBuffer OPTIONAL, - IN ULONG OutputBufferLength); - #ifdef __cplusplus } #endif
14 years, 9 months
1
0
0
0
[akhaldi] 46258: [NTDDK] - Group related definitions. - Add EXTENDED_AGP_REGISTER and several missing PCI_*, PCIX_*, and OSC_* definitions
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Mar 18 13:54:44 2010 New Revision: 46258 URL:
http://svn.reactos.org/svn/reactos?rev=46258&view=rev
Log: [NTDDK] - Group related definitions. - Add EXTENDED_AGP_REGISTER and several missing PCI_*, PCIX_*, and OSC_* definitions Modified: branches/header-work/include/ddk/ntddk.h Modified: branches/header-work/include/ddk/ntddk.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/ntddk.h…
============================================================================== --- branches/header-work/include/ddk/ntddk.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/ntddk.h [iso-8859-1] Thu Mar 18 13:54:44 2010 @@ -2548,6 +2548,16 @@ #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ +/* Filesystem runtime library routines */ + +#if (NTDDI_VERSION >= NTDDI_WIN2K) +NTKERNELAPI +BOOLEAN +NTAPI +FsRtlIsTotalDeviceFailure( + IN NTSTATUS Status); +#endif + /* Memory Manager Types */ typedef struct _PHYSICAL_MEMORY_RANGE { @@ -3298,6 +3308,535 @@ PTRANSLATE_RESOURCE_REQUIREMENTS_HANDLER TranslateResourceRequirements; } TRANSLATOR_INTERFACE, *PTRANSLATOR_INTERFACE; +typedef struct _PCI_AGP_CAPABILITY { + PCI_CAPABILITIES_HEADER Header; + USHORT Minor:4; + USHORT Major:4; + USHORT Rsvd1:8; + struct _PCI_AGP_STATUS { + ULONG Rate:3; + ULONG Agp3Mode:1; + ULONG FastWrite:1; + ULONG FourGB:1; + ULONG HostTransDisable:1; + ULONG Gart64:1; + ULONG ITA_Coherent:1; + ULONG SideBandAddressing:1; + ULONG CalibrationCycle:3; + ULONG AsyncRequestSize:3; + ULONG Rsvd1:1; + ULONG Isoch:1; + ULONG Rsvd2:6; + ULONG RequestQueueDepthMaximum:8; + } AGPStatus; + struct _PCI_AGP_COMMAND { + ULONG Rate:3; + ULONG Rsvd1:1; + ULONG FastWriteEnable:1; + ULONG FourGBEnable:1; + ULONG Rsvd2:1; + ULONG Gart64:1; + ULONG AGPEnable:1; + ULONG SBAEnable:1; + ULONG CalibrationCycle:3; + ULONG AsyncReqSize:3; + ULONG Rsvd3:8; + ULONG RequestQueueDepth:8; + } AGPCommand; +} PCI_AGP_CAPABILITY, *PPCI_AGP_CAPABILITY; + +typedef enum _EXTENDED_AGP_REGISTER { + IsochStatus, + AgpControl, + ApertureSize, + AperturePageSize, + GartLow, + GartHigh, + IsochCommand +} EXTENDED_AGP_REGISTER, *PEXTENDED_AGP_REGISTER; + +typedef struct _PCI_AGP_ISOCH_STATUS { + ULONG ErrorCode:2; + ULONG Rsvd1:1; + ULONG Isoch_L:3; + ULONG Isoch_Y:2; + ULONG Isoch_N:8; + ULONG Rsvd2:16; +} PCI_AGP_ISOCH_STATUS, *PPCI_AGP_ISOCH_STATUS; + +typedef struct _PCI_AGP_CONTROL { + ULONG Rsvd1:7; + ULONG GTLB_Enable:1; + ULONG AP_Enable:1; + ULONG CAL_Disable:1; + ULONG Rsvd2:22; +} PCI_AGP_CONTROL, *PPCI_AGP_CONTROL; + +typedef struct _PCI_AGP_APERTURE_PAGE_SIZE { + USHORT PageSizeMask:11; + USHORT Rsvd1:1; + USHORT PageSizeSelect:4; +} PCI_AGP_APERTURE_PAGE_SIZE, *PPCI_AGP_APERTURE_PAGE_SIZE; + +typedef struct _PCI_AGP_ISOCH_COMMAND { + USHORT Rsvd1:6; + USHORT Isoch_Y:2; + USHORT Isoch_N:8; +} PCI_AGP_ISOCH_COMMAND, *PPCI_AGP_ISOCH_COMMAND; + +typedef struct PCI_AGP_EXTENDED_CAPABILITY { + PCI_AGP_ISOCH_STATUS IsochStatus; + PCI_AGP_CONTROL AgpControl; + USHORT ApertureSize; + PCI_AGP_APERTURE_PAGE_SIZE AperturePageSize; + ULONG GartLow; + ULONG GartHigh; + PCI_AGP_ISOCH_COMMAND IsochCommand; +} PCI_AGP_EXTENDED_CAPABILITY, *PPCI_AGP_EXTENDED_CAPABILITY; + +#define PCI_AGP_RATE_1X 0x1 +#define PCI_AGP_RATE_2X 0x2 +#define PCI_AGP_RATE_4X 0x4 + +#define PCIX_MODE_CONVENTIONAL_PCI 0x0 +#define PCIX_MODE1_66MHZ 0x1 +#define PCIX_MODE1_100MHZ 0x2 +#define PCIX_MODE1_133MHZ 0x3 +#define PCIX_MODE2_266_66MHZ 0x9 +#define PCIX_MODE2_266_100MHZ 0xA +#define PCIX_MODE2_266_133MHZ 0xB +#define PCIX_MODE2_533_66MHZ 0xD +#define PCIX_MODE2_533_100MHZ 0xE +#define PCIX_MODE2_533_133MHZ 0xF + +#define PCIX_VERSION_MODE1_ONLY 0x0 +#define PCIX_VERSION_MODE2_ECC 0x1 +#define PCIX_VERSION_DUAL_MODE_ECC 0x2 + +typedef struct _PCIX_BRIDGE_CAPABILITY { + PCI_CAPABILITIES_HEADER Header; + union { + struct { + USHORT Bus64Bit:1; + USHORT Bus133MHzCapable:1; + USHORT SplitCompletionDiscarded:1; + USHORT UnexpectedSplitCompletion:1; + USHORT SplitCompletionOverrun:1; + USHORT SplitRequestDelayed:1; + USHORT BusModeFrequency:4; + USHORT Rsvd:2; + USHORT Version:2; + USHORT Bus266MHzCapable:1; + USHORT Bus533MHzCapable:1; + } DUMMYSTRUCTNAME; + USHORT AsUSHORT; + } SecondaryStatus; + union { + struct { + ULONG FunctionNumber:3; + ULONG DeviceNumber:5; + ULONG BusNumber:8; + ULONG Device64Bit:1; + ULONG Device133MHzCapable:1; + ULONG SplitCompletionDiscarded:1; + ULONG UnexpectedSplitCompletion:1; + ULONG SplitCompletionOverrun:1; + ULONG SplitRequestDelayed:1; + ULONG Rsvd:7; + ULONG DIMCapable:1; + ULONG Device266MHzCapable:1; + ULONG Device533MHzCapable:1; + } DUMMYSTRUCTNAME; + ULONG AsULONG; + } BridgeStatus; + USHORT UpstreamSplitTransactionCapacity; + USHORT UpstreamSplitTransactionLimit; + USHORT DownstreamSplitTransactionCapacity; + USHORT DownstreamSplitTransactionLimit; + union { + struct { + ULONG SelectSecondaryRegisters:1; + ULONG ErrorPresentInOtherBank:1; + ULONG AdditionalCorrectableError:1; + ULONG AdditionalUncorrectableError:1; + ULONG ErrorPhase:3; + ULONG ErrorCorrected:1; + ULONG Syndrome:8; + ULONG ErrorFirstCommand:4; + ULONG ErrorSecondCommand:4; + ULONG ErrorUpperAttributes:4; + ULONG ControlUpdateEnable:1; + ULONG Rsvd:1; + ULONG DisableSingleBitCorrection:1; + ULONG EccMode:1; + } DUMMYSTRUCTNAME; + ULONG AsULONG; + } EccControlStatus; + ULONG EccFirstAddress; + ULONG EccSecondAddress; + ULONG EccAttribute; +} PCIX_BRIDGE_CAPABILITY, *PPCIX_BRIDGE_CAPABILITY; + +typedef struct _PCI_SUBSYSTEM_IDS_CAPABILITY { + PCI_CAPABILITIES_HEADER Header; + USHORT Reserved; + USHORT SubVendorID; + USHORT SubSystemID; +} PCI_SUBSYSTEM_IDS_CAPABILITY, *PPCI_SUBSYSTEM_IDS_CAPABILITY; + +#define OSC_FIRMWARE_FAILURE 0x02 +#define OSC_UNRECOGNIZED_UUID 0x04 +#define OSC_UNRECOGNIZED_REVISION 0x08 +#define OSC_CAPABILITIES_MASKED 0x10 + +#define PCI_ROOT_BUS_OSC_METHOD_CAPABILITY_REVISION 0x01 + +typedef struct _PCI_ROOT_BUS_OSC_SUPPORT_FIELD { + union { + struct { + ULONG ExtendedConfigOpRegions:1; + ULONG ActiveStatePowerManagement:1; + ULONG ClockPowerManagement:1; + ULONG SegmentGroups:1; + ULONG MessageSignaledInterrupts:1; + ULONG WindowsHardwareErrorArchitecture:1; + ULONG Reserved:26; + } DUMMYSTRUCTNAME; + ULONG AsULONG; + } u; +} PCI_ROOT_BUS_OSC_SUPPORT_FIELD, *PPCI_ROOT_BUS_OSC_SUPPORT_FIELD; + +typedef struct _PCI_ROOT_BUS_OSC_CONTROL_FIELD { + union { + struct { + ULONG ExpressNativeHotPlug:1; + ULONG ShpcNativeHotPlug:1; + ULONG ExpressNativePME:1; + ULONG ExpressAdvancedErrorReporting:1; + ULONG ExpressCapabilityStructure:1; + ULONG Reserved:27; + } DUMMYSTRUCTNAME; + ULONG AsULONG; + } u; +} PCI_ROOT_BUS_OSC_CONTROL_FIELD, *PPCI_ROOT_BUS_OSC_CONTROL_FIELD; + +typedef enum _PCI_HARDWARE_INTERFACE { + PciConventional, + PciXMode1, + PciXMode2, + PciExpress +} PCI_HARDWARE_INTERFACE, *PPCI_HARDWARE_INTERFACE; + +typedef enum { + BusWidth32Bits, + BusWidth64Bits +} PCI_BUS_WIDTH; + +typedef struct _PCI_ROOT_BUS_HARDWARE_CAPABILITY { + PCI_HARDWARE_INTERFACE SecondaryInterface; + struct { + BOOLEAN BusCapabilitiesFound; + ULONG CurrentSpeedAndMode; + ULONG SupportedSpeedsAndModes; + BOOLEAN DeviceIDMessagingCapable; + PCI_BUS_WIDTH SecondaryBusWidth; + } DUMMYSTRUCTNAME; + PCI_ROOT_BUS_OSC_SUPPORT_FIELD OscFeatureSupport; + PCI_ROOT_BUS_OSC_CONTROL_FIELD OscControlRequest; + PCI_ROOT_BUS_OSC_CONTROL_FIELD OscControlGranted; +} PCI_ROOT_BUS_HARDWARE_CAPABILITY, *PPCI_ROOT_BUS_HARDWARE_CAPABILITY; + +typedef union _PCI_EXPRESS_CAPABILITIES_REGISTER { + struct { + USHORT CapabilityVersion:4; + USHORT DeviceType:4; + USHORT SlotImplemented:1; + USHORT InterruptMessageNumber:5; + USHORT Rsvd:2; + } DUMMYSTRUCTNAME; + USHORT AsUSHORT; +} PCI_EXPRESS_CAPABILITIES_REGISTER, *PPCI_EXPRESS_CAPABILITIES_REGISTER; + +typedef union _PCI_EXPRESS_DEVICE_CAPABILITIES_REGISTER { + struct { + ULONG MaxPayloadSizeSupported:3; + ULONG PhantomFunctionsSupported:2; + ULONG ExtendedTagSupported:1; + ULONG L0sAcceptableLatency:3; + ULONG L1AcceptableLatency:3; + ULONG Undefined:3; + ULONG RoleBasedErrorReporting:1; + ULONG Rsvd1:2; + ULONG CapturedSlotPowerLimit:8; + ULONG CapturedSlotPowerLimitScale:2; + ULONG Rsvd2:4; + } DUMMYSTRUCTNAME; + ULONG AsULONG; +} PCI_EXPRESS_DEVICE_CAPABILITIES_REGISTER, *PPCI_EXPRESS_DEVICE_CAPABILITIES_REGISTER; + +#define PCI_EXPRESS_AER_DEVICE_CONTROL_MASK 0x07; + +typedef union _PCI_EXPRESS_DEVICE_CONTROL_REGISTER { + struct { + USHORT CorrectableErrorEnable:1; + USHORT NonFatalErrorEnable:1; + USHORT FatalErrorEnable:1; + USHORT UnsupportedRequestErrorEnable:1; + USHORT EnableRelaxedOrder:1; + USHORT MaxPayloadSize:3; + USHORT ExtendedTagEnable:1; + USHORT PhantomFunctionsEnable:1; + USHORT AuxPowerEnable:1; + USHORT NoSnoopEnable:1; + USHORT MaxReadRequestSize:3; + USHORT BridgeConfigRetryEnable:1; + } DUMMYSTRUCTNAME; + USHORT AsUSHORT; +} PCI_EXPRESS_DEVICE_CONTROL_REGISTER, *PPCI_EXPRESS_DEVICE_CONTROL_REGISTER; + +#define PCI_EXPRESS_AER_DEVICE_STATUS_MASK 0x0F; + +typedef union _PCI_EXPRESS_DEVICE_STATUS_REGISTER { + struct { + USHORT CorrectableErrorDetected:1; + USHORT NonFatalErrorDetected:1; + USHORT FatalErrorDetected:1; + USHORT UnsupportedRequestDetected:1; + USHORT AuxPowerDetected:1; + USHORT TransactionsPending:1; + USHORT Rsvd:10; + } DUMMYSTRUCTNAME; + USHORT AsUSHORT; +} PCI_EXPRESS_DEVICE_STATUS_REGISTER, *PPCI_EXPRESS_DEVICE_STATUS_REGISTER; + +typedef union _PCI_EXPRESS_LINK_CAPABILITIES_REGISTER { + struct { + ULONG MaximumLinkSpeed:4; + ULONG MaximumLinkWidth:6; + ULONG ActiveStatePMSupport:2; + ULONG L0sExitLatency:3; + ULONG L1ExitLatency:3; + ULONG ClockPowerManagement:1; + ULONG SurpriseDownErrorReportingCapable:1; + ULONG DataLinkLayerActiveReportingCapable:1; + ULONG Rsvd:3; + ULONG PortNumber:8; + } DUMMYSTRUCTNAME; + ULONG AsULONG; +} PCI_EXPRESS_LINK_CAPABILITIES_REGISTER, *PPCI_EXPRESS_LINK_CAPABILITIES_REGISTER; + +typedef union _PCI_EXPRESS_LINK_CONTROL_REGISTER { + struct { + USHORT ActiveStatePMControl:2; + USHORT Rsvd1:1; + USHORT ReadCompletionBoundary:1; + USHORT LinkDisable:1; + USHORT RetrainLink:1; + USHORT CommonClockConfig:1; + USHORT ExtendedSynch:1; + USHORT EnableClockPowerManagement:1; + USHORT Rsvd2:7; + } DUMMYSTRUCTNAME; + USHORT AsUSHORT; +} PCI_EXPRESS_LINK_CONTROL_REGISTER, *PPCI_EXPRESS_LINK_CONTROL_REGISTER; + +typedef union _PCI_EXPRESS_LINK_STATUS_REGISTER { + struct { + USHORT LinkSpeed:4; + USHORT LinkWidth:6; + USHORT Undefined:1; + USHORT LinkTraining:1; + USHORT SlotClockConfig:1; + USHORT DataLinkLayerActive:1; + USHORT Rsvd:2; + } DUMMYSTRUCTNAME; + USHORT AsUSHORT; +} PCI_EXPRESS_LINK_STATUS_REGISTER, *PPCI_EXPRESS_LINK_STATUS_REGISTER; + +typedef union _PCI_EXPRESS_SLOT_CAPABILITIES_REGISTER { + struct { + ULONG AttentionButtonPresent:1; + ULONG PowerControllerPresent:1; + ULONG MRLSensorPresent:1; + ULONG AttentionIndicatorPresent:1; + ULONG PowerIndicatorPresent:1; + ULONG HotPlugSurprise:1; + ULONG HotPlugCapable:1; + ULONG SlotPowerLimit:8; + ULONG SlotPowerLimitScale:2; + ULONG ElectromechanicalLockPresent:1; + ULONG NoCommandCompletedSupport:1; + ULONG PhysicalSlotNumber:13; + } DUMMYSTRUCTNAME; + ULONG AsULONG; +} PCI_EXPRESS_SLOT_CAPABILITIES_REGISTER, *PPCI_EXPRESS_SLOT_CAPABILITIES_REGISTER; + +typedef union _PCI_EXPRESS_SLOT_CONTROL_REGISTER { + struct { + USHORT AttentionButtonEnable:1; + USHORT PowerFaultDetectEnable:1; + USHORT MRLSensorEnable:1; + USHORT PresenceDetectEnable:1; + USHORT CommandCompletedEnable:1; + USHORT HotPlugInterruptEnable:1; + USHORT AttentionIndicatorControl:2; + USHORT PowerIndicatorControl:2; + USHORT PowerControllerControl:1; + USHORT ElectromechanicalLockControl:1; + USHORT DataLinkStateChangeEnable:1; + USHORT Rsvd:3; + } DUMMYSTRUCTNAME; + USHORT AsUSHORT; +} PCI_EXPRESS_SLOT_CONTROL_REGISTER, *PPCI_EXPRESS_SLOT_CONTROL_REGISTER; + +typedef union _PCI_EXPRESS_SLOT_STATUS_REGISTER { + struct { + USHORT AttentionButtonPressed:1; + USHORT PowerFaultDetected:1; + USHORT MRLSensorChanged:1; + USHORT PresenceDetectChanged:1; + USHORT CommandCompleted:1; + USHORT MRLSensorState:1; + USHORT PresenceDetectState:1; + USHORT ElectromechanicalLockEngaged:1; + USHORT DataLinkStateChanged:1; + USHORT Rsvd:7; + } DUMMYSTRUCTNAME; + USHORT AsUSHORT; +} PCI_EXPRESS_SLOT_STATUS_REGISTER, *PPCI_EXPRESS_SLOT_STATUS_REGISTER; + +typedef union _PCI_EXPRESS_ROOT_CONTROL_REGISTER { + struct { + USHORT CorrectableSerrEnable:1; + USHORT NonFatalSerrEnable:1; + USHORT FatalSerrEnable:1; + USHORT PMEInterruptEnable:1; + USHORT CRSSoftwareVisibilityEnable:1; + USHORT Rsvd:11; + } DUMMYSTRUCTNAME; + USHORT AsUSHORT; +} PCI_EXPRESS_ROOT_CONTROL_REGISTER, *PPCI_EXPRESS_ROOT_CONTROL_REGISTER; + +typedef union _PCI_EXPRESS_ROOT_CAPABILITIES_REGISTER { + struct { + USHORT CRSSoftwareVisibility:1; + USHORT Rsvd:15; + } DUMMYSTRUCTNAME; + USHORT AsUSHORT; +} PCI_EXPRESS_ROOT_CAPABILITIES_REGISTER, *PPCI_EXPRESS_ROOT_CAPABILITIES_REGISTER; + +typedef union _PCI_EXPRESS_ROOT_STATUS_REGISTER { + struct { + ULONG PMERequestorId:16; + ULONG PMEStatus:1; + ULONG PMEPending:1; + ULONG Rsvd:14; + } DUMMYSTRUCTNAME; + ULONG AsULONG; +} PCI_EXPRESS_ROOT_STATUS_REGISTER, *PPCI_EXPRESS_ROOT_STATUS_REGISTER; + +typedef struct _PCI_EXPRESS_CAPABILITY { + PCI_CAPABILITIES_HEADER Header; + PCI_EXPRESS_CAPABILITIES_REGISTER ExpressCapabilities; + PCI_EXPRESS_DEVICE_CAPABILITIES_REGISTER DeviceCapabilities; + PCI_EXPRESS_DEVICE_CONTROL_REGISTER DeviceControl; + PCI_EXPRESS_DEVICE_STATUS_REGISTER DeviceStatus; + PCI_EXPRESS_LINK_CAPABILITIES_REGISTER LinkCapabilities; + PCI_EXPRESS_LINK_CONTROL_REGISTER LinkControl; + PCI_EXPRESS_LINK_STATUS_REGISTER LinkStatus; + PCI_EXPRESS_SLOT_CAPABILITIES_REGISTER SlotCapabilities; + PCI_EXPRESS_SLOT_CONTROL_REGISTER SlotControl; + PCI_EXPRESS_SLOT_STATUS_REGISTER SlotStatus; + PCI_EXPRESS_ROOT_CONTROL_REGISTER RootControl; + PCI_EXPRESS_ROOT_CAPABILITIES_REGISTER RootCapabilities; + PCI_EXPRESS_ROOT_STATUS_REGISTER RootStatus; +} PCI_EXPRESS_CAPABILITY, *PPCI_EXPRESS_CAPABILITY; + +typedef enum { + MRLClosed = 0, + MRLOpen +} PCI_EXPRESS_MRL_STATE; + +typedef enum { + SlotEmpty = 0, + CardPresent +} PCI_EXPRESS_CARD_PRESENCE; + +typedef enum { + IndicatorOn = 1, + IndicatorBlink, + IndicatorOff +} PCI_EXPRESS_INDICATOR_STATE; + +typedef enum { + PowerOn = 0, + PowerOff +} PCI_EXPRESS_POWER_STATE; + +typedef enum { + L0sEntrySupport = 1, + L0sAndL1EntrySupport = 3 +} PCI_EXPRESS_ASPM_SUPPORT; + +typedef enum { + L0sAndL1EntryDisabled, + L0sEntryEnabled, + L1EntryEnabled, + L0sAndL1EntryEnabled +} PCI_EXPRESS_ASPM_CONTROL; + +typedef enum { + L0s_Below64ns = 0, + L0s_64ns_128ns, + L0s_128ns_256ns, + L0s_256ns_512ns, + L0s_512ns_1us, + L0s_1us_2us, + L0s_2us_4us, + L0s_Above4us +} PCI_EXPRESS_L0s_EXIT_LATENCY; + +typedef enum { + L1_Below1us = 0, + L1_1us_2us, + L1_2us_4us, + L1_4us_8us, + L1_8us_16us, + L1_16us_32us, + L1_32us_64us, + L1_Above64us +} PCI_EXPRESS_L1_EXIT_LATENCY; + +typedef enum { + PciExpressEndpoint = 0, + PciExpressLegacyEndpoint, + PciExpressRootPort = 4, + PciExpressUpstreamSwitchPort, + PciExpressDownstreamSwitchPort, + PciExpressToPciXBridge, + PciXToExpressBridge, + PciExpressRootComplexIntegratedEndpoint, + PciExpressRootComplexEventCollector +} PCI_EXPRESS_DEVICE_TYPE; + +typedef enum { + MaxPayload128Bytes = 0, + MaxPayload256Bytes, + MaxPayload512Bytes, + MaxPayload1024Bytes, + MaxPayload2048Bytes, + MaxPayload4096Bytes +} PCI_EXPRESS_MAX_PAYLOAD_SIZE; + +typedef union _PCI_EXPRESS_PME_REQUESTOR_ID { + struct { + USHORT FunctionNumber:3; + USHORT DeviceNumber:5; + USHORT BusNumber:8; + } DUMMYSTRUCTNAME; + USHORT AsUSHORT; +} PCI_EXPRESS_PME_REQUESTOR_ID, *PPCI_EXPRESS_PME_REQUESTOR_ID; + /* I/O Manager Functions */ /* @@ -3743,6 +4282,8 @@ IoSetFileObjectIgnoreSharing( IN PFILE_OBJECT FileObject); #endif + +/* HAL Types */ typedef BOOLEAN (NTAPI *PHAL_RESET_DISPLAY_PARAMETERS)( @@ -4375,12 +4916,95 @@ PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR Descriptors[ANYSIZE_ARRAY]; } PHYSICAL_COUNTER_RESOURCE_LIST, *PPHYSICAL_COUNTER_RESOURCE_LIST; +typedef VOID +(NTAPI *PciPin2Line)( + IN struct _BUS_HANDLER *BusHandler, + IN struct _BUS_HANDLER *RootHandler, + IN PCI_SLOT_NUMBER SlotNumber, + IN PPCI_COMMON_CONFIG PciData); + +typedef VOID +(NTAPI *PciLine2Pin)( + IN struct _BUS_HANDLER *BusHandler, + IN struct _BUS_HANDLER *RootHandler, + IN PCI_SLOT_NUMBER SlotNumber, + IN PPCI_COMMON_CONFIG PciNewData, + IN PPCI_COMMON_CONFIG PciOldData); + +typedef VOID +(NTAPI *PciReadWriteConfig)( + IN struct _BUS_HANDLER *BusHandler, + IN PCI_SLOT_NUMBER Slot, + IN PVOID Buffer, + IN ULONG Offset, + IN ULONG Length); + +#define PCI_DATA_TAG ' ICP' +#define PCI_DATA_VERSION 1 + +typedef struct _PCIBUSDATA { + ULONG Tag; + ULONG Version; + PciReadWriteConfig ReadConfig; + PciReadWriteConfig WriteConfig; + PciPin2Line Pin2Line; + PciLine2Pin Line2Pin; + PCI_SLOT_NUMBER ParentSlot; + PVOID Reserved[4]; +} PCIBUSDATA, *PPCIBUSDATA; + +#ifndef _PCIINTRF_X_ +#define _PCIINTRF_X_ + +typedef ULONG +(NTAPI *PCI_READ_WRITE_CONFIG)( + IN PVOID Context, + IN ULONG BusOffset, + IN ULONG Slot, + IN PVOID Buffer, + IN ULONG Offset, + IN ULONG Length); + +typedef VOID +(NTAPI *PCI_PIN_TO_LINE)( + IN PVOID Context, + IN PPCI_COMMON_CONFIG PciData); + +typedef VOID +(NTAPI *PCI_LINE_TO_PIN)( + IN PVOID Context, + IN PPCI_COMMON_CONFIG PciNewData, + IN PPCI_COMMON_CONFIG PciOldData); + +typedef VOID +(NTAPI *PCI_ROOT_BUS_CAPABILITY)( + IN PVOID Context, + OUT PPCI_ROOT_BUS_HARDWARE_CAPABILITY HardwareCapability); + +typedef VOID +(NTAPI *PCI_EXPRESS_WAKE_CONTROL)( + IN PVOID Context, + IN BOOLEAN EnableWake); + +typedef struct _PCI_BUS_INTERFACE_STANDARD { + USHORT Size; + USHORT Version; + PVOID Context; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PCI_READ_WRITE_CONFIG ReadConfig; + PCI_READ_WRITE_CONFIG WriteConfig; + PCI_PIN_TO_LINE PinToLine; + PCI_LINE_TO_PIN LineToPin; + PCI_ROOT_BUS_CAPABILITY RootBusCapability; + PCI_EXPRESS_WAKE_CONTROL ExpressWakeControl; +} PCI_BUS_INTERFACE_STANDARD, *PPCI_BUS_INTERFACE_STANDARD; + +#define PCI_BUS_INTERFACE_STANDARD_VERSION 1 + +#endif /* _PCIINTRF_X_ */ + /* Hardware Abstraction Layer Functions */ - -NTSTATUS -NTAPI -HalFreeHardwareCounters( - IN HANDLE CounterSetHandle); #if !defined(NO_LEGACY_DRIVERS) @@ -4606,6 +5230,7 @@ #endif #if (NTDDI_VERSION >= NTDDI_WIN7) + NTSTATUS NTAPI HalAllocateHardwareCounters( @@ -4613,6 +5238,12 @@ IN ULONG GroupCount, IN PPHYSICAL_COUNTER_RESOURCE_LIST ResourceList, OUT PHANDLE CounterSetHandle); + +NTSTATUS +NTAPI +HalFreeHardwareCounters( + IN HANDLE CounterSetHandle); + #endif @@ -4653,6 +5284,83 @@ IN PWHEA_ERROR_RECORD ErrorRecord); #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */ + +/* ZwXxx Functions */ + +#if (NTDDI_VERSION >= NTDDI_WIN2K) + +NTSTATUS +NTAPI +ZwCancelTimer( + IN HANDLE TimerHandle, + OUT PBOOLEAN CurrentState OPTIONAL); + +NTSTATUS +NTAPI +ZwCreateTimer( + OUT PHANDLE TimerHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, + IN TIMER_TYPE TimerType); + +NTSTATUS +NTAPI +ZwOpenTimer( + OUT PHANDLE TimerHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes); + +NTSYSAPI +NTSTATUS +NTAPI +ZwSetInformationThread( + IN HANDLE ThreadHandle, + IN THREADINFOCLASS ThreadInformationClass, + IN PVOID ThreadInformation, + IN ULONG ThreadInformationLength); + +NTSTATUS +NTAPI +ZwSetTimer( + IN HANDLE TimerHandle, + IN PLARGE_INTEGER DueTime, + IN PTIMER_APC_ROUTINE TimerApcRoutine OPTIONAL, + IN PVOID TimerContext OPTIONAL, + IN BOOLEAN ResumeTimer, + IN LONG Period OPTIONAL, + OUT PBOOLEAN PreviousState OPTIONAL); + +NTSYSAPI +NTSTATUS +NTAPI +ZwDisplayString( + IN PUNICODE_STRING String); + +NTSYSAPI +NTSTATUS +NTAPI +ZwPowerInformation( + IN POWER_INFORMATION_LEVEL PowerInformationLevel, + IN PVOID InputBuffer OPTIONAL, + IN ULONG InputBufferLength, + OUT PVOID OutputBuffer OPTIONAL, + IN ULONG OutputBufferLength); + +#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ + + + + + + + + + + + + + + // // GUID and UUID @@ -4893,123 +5601,7 @@ #endif /* _X86_ */ -/** Filesystem runtime library routines **/ - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -BOOLEAN -NTAPI -FsRtlIsTotalDeviceFailure( - IN NTSTATUS Status); -#endif - -/* Hardware Abstraction Layer Types */ - -typedef VOID -(NTAPI *PciPin2Line)( - IN struct _BUS_HANDLER *BusHandler, - IN struct _BUS_HANDLER *RootHandler, - IN PCI_SLOT_NUMBER SlotNumber, - IN PPCI_COMMON_CONFIG PciData); - -typedef VOID -(NTAPI *PciLine2Pin)( - IN struct _BUS_HANDLER *BusHandler, - IN struct _BUS_HANDLER *RootHandler, - IN PCI_SLOT_NUMBER SlotNumber, - IN PPCI_COMMON_CONFIG PciNewData, - IN PPCI_COMMON_CONFIG PciOldData); - -typedef VOID -(NTAPI *PciReadWriteConfig)( - IN struct _BUS_HANDLER *BusHandler, - IN PCI_SLOT_NUMBER Slot, - IN PVOID Buffer, - IN ULONG Offset, - IN ULONG Length); - -#define PCI_DATA_TAG ' ICP' -#define PCI_DATA_VERSION 1 - -typedef struct _PCIBUSDATA { - ULONG Tag; - ULONG Version; - PciReadWriteConfig ReadConfig; - PciReadWriteConfig WriteConfig; - PciPin2Line Pin2Line; - PciLine2Pin Line2Pin; - PCI_SLOT_NUMBER ParentSlot; - PVOID Reserved[4]; -} PCIBUSDATA, *PPCIBUSDATA; - /* ZwXxx Functions */ - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -NTSTATUS -NTAPI -ZwCancelTimer( - IN HANDLE TimerHandle, - OUT PBOOLEAN CurrentState OPTIONAL); - -NTSTATUS -NTAPI -ZwCreateTimer( - OUT PHANDLE TimerHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN TIMER_TYPE TimerType); - -NTSTATUS -NTAPI -ZwOpenTimer( - OUT PHANDLE TimerHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes); - -NTSYSAPI -NTSTATUS -NTAPI -ZwSetInformationThread( - IN HANDLE ThreadHandle, - IN THREADINFOCLASS ThreadInformationClass, - IN PVOID ThreadInformation, - IN ULONG ThreadInformationLength); - -NTSTATUS -NTAPI -ZwSetTimer( - IN HANDLE TimerHandle, - IN PLARGE_INTEGER DueTime, - IN PTIMER_APC_ROUTINE TimerApcRoutine OPTIONAL, - IN PVOID TimerContext OPTIONAL, - IN BOOLEAN ResumeTimer, - IN LONG Period OPTIONAL, - OUT PBOOLEAN PreviousState OPTIONAL); - -#endif - -NTSYSAPI -NTSTATUS -NTAPI -ZwDisplayString ( - IN PUNICODE_STRING String -); - -#if (VER_PRODUCTBUILD >= 2195) - -NTSYSAPI -NTSTATUS -NTAPI -ZwPowerInformation ( - IN POWER_INFORMATION_LEVEL PowerInformationLevel, - IN PVOID InputBuffer OPTIONAL, - IN ULONG InputBufferLength, - OUT PVOID OutputBuffer OPTIONAL, - IN ULONG OutputBufferLength -); - -#endif /* (VER_PRODUCTBUILD >= 2195) */ NTSYSAPI NTSTATUS
14 years, 9 months
1
0
0
0
[cwittich] 46257: fix memory leak on error path
by cwittich@svn.reactos.org
Author: cwittich Date: Thu Mar 18 07:34:39 2010 New Revision: 46257 URL:
http://svn.reactos.org/svn/reactos?rev=46257&view=rev
Log: fix memory leak on error path Modified: trunk/tools/sysreg2/virt.c Modified: trunk/tools/sysreg2/virt.c URL:
http://svn.reactos.org/svn/reactos/trunk/tools/sysreg2/virt.c?rev=46257&r1=…
============================================================================== --- trunk/tools/sysreg2/virt.c [iso-8859-1] (original) +++ trunk/tools/sysreg2/virt.c [iso-8859-1] Thu Mar 18 07:34:39 2010 @@ -137,6 +137,7 @@ if (virDomainCreate(vDomPtr) != 0) { virDomainUndefine(vDomPtr); + virDomainFree(vDomPtr); vDomPtr = NULL; } else @@ -189,7 +190,7 @@ /* SysregPrintf("Error: Virtual Machine is already running.\n"); goto cleanup; */ system("virsh destroy ReactOS"); - usleep(1000); + usleep(1000); } /* If the HD image already exists, delete it */
14 years, 9 months
1
0
0
0
[akhaldi] 46256: [NTDDK] - Group related definitions. - Add missing NTAPI attribute to IoCreateFileSpecifyDeviceObjectHint and IoCreateFileEx. - Fix a FIXME. [SERIAL] - Remove redundant IoAttachDeviceToDeviceStackSafe definition. [MCE] - Add mce.h definitions.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Mar 18 01:36:45 2010 New Revision: 46256 URL:
http://svn.reactos.org/svn/reactos?rev=46256&view=rev
Log: [NTDDK] - Group related definitions. - Add missing NTAPI attribute to IoCreateFileSpecifyDeviceObjectHint and IoCreateFileEx. - Fix a FIXME. [SERIAL] - Remove redundant IoAttachDeviceToDeviceStackSafe definition. [MCE] - Add mce.h definitions. Added: branches/header-work/include/ddk/mce.h (with props) Modified: branches/header-work/drivers/serial/serial/serial.h branches/header-work/include/ddk/ntddk.h Modified: branches/header-work/drivers/serial/serial/serial.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/drivers/serial/seri…
============================================================================== --- branches/header-work/drivers/serial/serial/serial.h [iso-8859-1] (original) +++ branches/header-work/drivers/serial/serial/serial.h [iso-8859-1] Thu Mar 18 01:36:45 2010 @@ -16,15 +16,6 @@ /* See winbase.h */ #define PST_RS232 1 #define COMMPROP_INITIALIZED 0xE73CF52E - -#ifndef _NTIFS_ -/* Why is it only defined in ntifs.h file? */ -NTSTATUS NTAPI -IoAttachDeviceToDeviceStackSafe( - IN PDEVICE_OBJECT SourceDevice, - IN PDEVICE_OBJECT TargetDevice, - OUT PDEVICE_OBJECT *AttachedToDeviceObject); -#endif typedef enum { Added: branches/header-work/include/ddk/mce.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/mce.h?r…
============================================================================== --- branches/header-work/include/ddk/mce.h (added) +++ branches/header-work/include/ddk/mce.h [iso-8859-1] Thu Mar 18 01:36:45 2010 @@ -1,0 +1,1074 @@ +#pragma once + +#if defined(_X86_) || defined(_IA64_) || defined(_AMD64_) + +typedef union _MCI_ADDR { + struct { + ULONG Address; + ULONG Reserved; + } DUMMYSTRUCTNAME; + ULONGLONG QuadPart; +} MCI_ADDR, *PMCI_ADDR; + +typedef enum { + HAL_MCE_RECORD, + HAL_MCA_RECORD +} MCA_EXCEPTION_TYPE; + +#if defined(_AMD64_) + +#if (NTDDI_VERSION <= NTDDI_WINXP) + +typedef union _MCI_STATS { + struct { + USHORT McaCod; + USHORT ModelErrorCode; + ULONG OtherInfo:25; + ULONG Damage:1; + ULONG AddressValid:1; + ULONG MiscValid:1; + ULONG Enabled:1; + ULONG Uncorrected:1; + ULONG OverFlow:1; + ULONG Valid:1; + } MciStatus; + ULONG64 QuadPart; +} MCI_STATS, *PMCI_STATS; + +#else + +typedef union _MCI_STATS { + struct { + USHORT McaErrorCode; + USHORT ModelErrorCode; + ULONG OtherInformation:25; + ULONG ContextCorrupt:1; + ULONG AddressValid:1; + ULONG MiscValid:1; + ULONG ErrorEnabled:1; + ULONG UncorrectedError:1; + ULONG StatusOverFlow:1; + ULONG Valid:1; + } MciStatus; + ULONG64 QuadPart; +} MCI_STATS, *PMCI_STATS; + +#endif /* (NTDDI_VERSION <= NTDDI_WINXP) */ + +#endif /* defined(_AMD64_) */ + +#if defined(_X86_) +typedef union _MCI_STATS { + struct { + USHORT McaCod; + USHORT MsCod; + ULONG OtherInfo:25; + ULONG Damage:1; + ULONG AddressValid:1; + ULONG MiscValid:1; + ULONG Enabled:1; + ULONG UnCorrected:1; + ULONG OverFlow:1; + ULONG Valid:1; + } MciStats; + ULONGLONG QuadPart; +} MCI_STATS, *PMCI_STATS; +#endif + +#define MCA_EXTREG_V2MAX 24 + +#if defined(_X86_) || defined(_AMD64_) + +#if (NTDDI_VERSION >= NTDDI_WINXP) + +typedef struct _MCA_EXCEPTION { + ULONG VersionNumber; + MCA_EXCEPTION_TYPE ExceptionType; + LARGE_INTEGER TimeStamp; + ULONG ProcessorNumber; + ULONG Reserved1; + union { + struct { + UCHAR BankNumber; + UCHAR Reserved2[7]; + MCI_STATS Status; + MCI_ADDR Address; + ULONGLONG Misc; + } Mca; + struct { + ULONGLONG Address; + ULONGLONG Type; + } Mce; + } u; + ULONG ExtCnt; + ULONG Reserved3; + ULONGLONG ExtReg[MCA_EXTREG_V2MAX]; +} MCA_EXCEPTION, *PMCA_EXCEPTION; + +#else + +typedef struct _MCA_EXCEPTION { + ULONG VersionNumber; + MCA_EXCEPTION_TYPE ExceptionType; + LARGE_INTEGER TimeStamp; + ULONG ProcessorNumber; + ULONG Reserved1; + union { + struct { + UCHAR BankNumber; + UCHAR Reserved2[7]; + MCI_STATS Status; + MCI_ADDR Address; + ULONGLONG Misc; + } Mca; + struct { + ULONGLONG Address; + ULONGLONG Type; + } Mce; + } u; +} MCA_EXCEPTION, *PMCA_EXCEPTION; + +#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ + +typedef MCA_EXCEPTION CMC_EXCEPTION, *PCMC_EXCEPTION; +typedef MCA_EXCEPTION CPE_EXCEPTION, *PCPE_EXCEPTION; + +#if (NTDDI_VERSION >= NTDDI_WINXP) +#define MCA_EXCEPTION_V1_SIZE FIELD_OFFSET(MCA_EXCEPTION, ExtCnt) +#define MCA_EXCEPTION_V2_SIZE sizeof(struct _MCA_EXCEPTION) +#endif + +#endif /* defined(_X86_) || defined(_AMD64_) */ + +#if defined(_AMD64_) || defined(_IA64_) + +typedef UCHAR ERROR_SEVERITY, *PERROR_SEVERITY; + +typedef enum _ERROR_SEVERITY_VALUE { + ErrorRecoverable = 0, + ErrorFatal = 1, + ErrorCorrected = 2, + ErrorOthers = 3, +} ERROR_SEVERITY_VALUE; + +#endif + +#if defined(_IA64_) + +typedef union _ERROR_REVISION { + USHORT Revision; + struct { + UCHAR Minor; + UCHAR Major; + } DUMMYSTRUCTNAME; +} ERROR_REVISION, *PERROR_REVISION; + +#if (NTDDI_VERSION > NTDDI_WINXP) +#define ERROR_MAJOR_REVISION_SAL_03_00 0 +#define ERROR_MINOR_REVISION_SAL_03_00 2 +#define ERROR_REVISION_SAL_03_00 {ERROR_MINOR_REVISION_SAL_03_00,ERROR_MAJOR_REVISION_SAL_03_00} +#define ERROR_FIXED_SECTION_REVISION {2,0} +#else +#define ERROR_REVISION_SAL_03_00 {2,0} +#endif /* (NTDDI_VERSION > NTDDI_WINXP) */ + +typedef union _ERROR_TIMESTAMP { + ULONGLONG TimeStamp; + struct { + UCHAR Seconds; + UCHAR Minutes; + UCHAR Hours; + UCHAR Reserved; + UCHAR Day; + UCHAR Month; + UCHAR Year; + UCHAR Century; + } DUMMYSTRUCTNAME; +} ERROR_TIMESTAMP, *PERROR_TIMESTAMP; + +typedef struct _ERROR_GUID { + ULONG Data1; + USHORT Data2; + USHORT Data3; + UCHAR Data4[8]; +} ERROR_GUID, *PERROR_GUID; + +typedef ERROR_GUID _ERROR_DEVICE_GUID; +typedef _ERROR_DEVICE_GUID ERROR_DEVICE_GUID, *PERROR_DEVICE_GUID; + +typedef ERROR_GUID _ERROR_PLATFORM_GUID; +typedef _ERROR_PLATFORM_GUID ERROR_PLATFORM_GUID, *PERROR_PLATFORM_GUID; + +typedef union _ERROR_RECORD_VALID { + UCHAR Valid; + struct { + UCHAR OemPlatformID:1; + UCHAR Reserved:7; + } DUMMYSTRUCTNAME; +} ERROR_RECORD_VALID, *PERROR_RECORD_VALID; + +typedef struct _ERROR_RECORD_HEADER { + ULONGLONG Id; + ERROR_REVISION Revision; + ERROR_SEVERITY ErrorSeverity; + ERROR_RECORD_VALID Valid; + ULONG Length; + ERROR_TIMESTAMP TimeStamp; + UCHAR OemPlatformId[16]; +} ERROR_RECORD_HEADER, *PERROR_RECORD_HEADER; + +typedef union _ERROR_RECOVERY_INFO { + UCHAR RecoveryInfo; + struct { + UCHAR Corrected:1; + UCHAR NotContained:1; + UCHAR Reset:1; + UCHAR Reserved:4; + UCHAR Valid:1; + } DUMMYSTRUCTNAME; +} ERROR_RECOVERY_INFO, *PERROR_RECOVERY_INFO; + +typedef struct _ERROR_SECTION_HEADER { + ERROR_DEVICE_GUID Guid; + ERROR_REVISION Revision; + ERROR_RECOVERY_INFO RecoveryInfo; + UCHAR Reserved; + ULONG Length; +} ERROR_SECTION_HEADER, *PERROR_SECTION_HEADER; + +#if !defined(__midl) && defined(_MSC_EXTENSIONS) +__inline +USHORT +NTAPI +GetFwMceLogProcessorNumber( + PERROR_RECORD_HEADER Log) +{ + PERROR_SECTION_HEADER section = (PERROR_SECTION_HEADER)((ULONG64)Log + sizeof(*Log)); + USHORT lid = (USHORT)((UCHAR)(section->Reserved)); + lid |= (USHORT)((UCHAR)(Log->TimeStamp.Reserved) << 8); + return( lid ); +} +#endif + +#define ERROR_PROCESSOR_GUID {0xe429faf1, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81}} + +typedef union _ERROR_MODINFO_VALID { + ULONGLONG Valid; + struct { + ULONGLONG CheckInfo:1; + ULONGLONG RequestorIdentifier:1; + ULONGLONG ResponderIdentifier:1; + ULONGLONG TargetIdentifier:1; + ULONGLONG PreciseIP:1; + ULONGLONG Reserved:59; + } DUMMYSTRUCTNAME; +} ERROR_MODINFO_VALID, *PERROR_MODINFO_VALID; + +typedef enum _ERROR_CHECK_IS { + isIA64 = 0, + isIA32 = 1, +} ERROR_CHECK_IS; + +typedef enum _ERROR_CACHE_CHECK_OPERATION { + CacheUnknownOp = 0, + CacheLoad = 1, + CacheStore = 2, + CacheInstructionFetch = 3, + CacheDataPrefetch = 4, + CacheSnoop = 5, + CacheCastOut = 6, + CacheMoveIn = 7, +} ERROR_CACHE_CHECK_OPERATION; + +typedef enum _ERROR_CACHE_CHECK_MESI { + CacheInvalid = 0, + CacheHeldShared = 1, + CacheHeldExclusive = 2, + CacheModified = 3, +} ERROR_CACHE_CHECK_MESI; + +#if (NTDDI_VERSION >= NTDDI_VISTA) + +typedef union _ERROR_CACHE_CHECK { + ULONGLONG CacheCheck; + struct { + ULONGLONG Operation:4; + ULONGLONG Level:2; + ULONGLONG Reserved1:2; + ULONGLONG DataLine:1; + ULONGLONG TagLine:1; + ULONGLONG DataCache:1; + ULONGLONG InstructionCache:1; + ULONGLONG MESI:3; + ULONGLONG MESIValid:1; + ULONGLONG Way:5; + ULONGLONG WayIndexValid:1; + ULONGLONG Reserved2:1; + ULONGLONG DP:1; + ULONGLONG Reserved3:8; + ULONGLONG Index:20; + ULONGLONG Reserved4:2; + ULONGLONG InstructionSet:1; + ULONGLONG InstructionSetValid:1; + ULONGLONG PrivilegeLevel:2; + ULONGLONG PrivilegeLevelValid:1; + ULONGLONG MachineCheckCorrected:1; + ULONGLONG TargetAddressValid:1; + ULONGLONG RequestIdValid:1; + ULONGLONG ResponderIdValid:1; + ULONGLONG PreciseIPValid:1; + } DUMMYSTRUCTNAME; +} ERROR_CACHE_CHECK, *PERROR_CACHE_CHECK; + +# else + +typedef union _ERROR_CACHE_CHECK { + ULONGLONG CacheCheck; + struct { + ULONGLONG Operation:4; + ULONGLONG Level:2; + ULONGLONG Reserved1:2; + ULONGLONG DataLine:1; + ULONGLONG TagLine:1; + ULONGLONG DataCache:1; + ULONGLONG InstructionCache:1; + ULONGLONG MESI:3; + ULONGLONG MESIValid:1; + ULONGLONG Way:5; + ULONGLONG WayIndexValid:1; + ULONGLONG Reserved2:10; + ULONGLONG Index:20; + ULONGLONG Reserved3:2; + ULONGLONG InstructionSet:1; + ULONGLONG InstructionSetValid:1; + ULONGLONG PrivilegeLevel:2; + ULONGLONG PrivilegeLevelValid:1; + ULONGLONG MachineCheckCorrected:1; + ULONGLONG TargetAddressValid:1; + ULONGLONG RequestIdValid:1; + ULONGLONG ResponderIdValid:1; + ULONGLONG PreciseIPValid:1; + } DUMMYSTRUCTNAME; +} ERROR_CACHE_CHECK, *PERROR_CACHE_CHECK; + +#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */ + +typedef enum _ERROR_TLB_CHECK_OPERATION { + TlbUnknownOp = 0, + TlbAccessWithLoad = 1, + TlbAccessWithStore = 2, + TlbAccessWithInstructionFetch = 3, + TlbAccessWithDataPrefetch = 4, + TlbShootDown = 5, + TlbProbe = 6, + TlbVhptFill = 7, + TlbPurge = 8, +} ERROR_TLB_CHECK_OPERATION; + +typedef union _ERROR_TLB_CHECK { + ULONGLONG TlbCheck; + struct { + ULONGLONG TRSlot:8; + ULONGLONG TRSlotValid:1; + ULONGLONG Reserved1:1; + ULONGLONG Level:2; + ULONGLONG Reserved2:4; + ULONGLONG DataTransReg:1; + ULONGLONG InstructionTransReg:1; + ULONGLONG DataTransCache:1; + ULONGLONG InstructionTransCache:1; + ULONGLONG Operation:4; + ULONGLONG Reserved3:30; + ULONGLONG InstructionSet:1; + ULONGLONG InstructionSetValid:1; + ULONGLONG PrivilegeLevel:2; + ULONGLONG PrivilegeLevelValid:1; + ULONGLONG MachineCheckCorrected:1; + ULONGLONG TargetAddressValid:1; + ULONGLONG RequestIdValid:1; + ULONGLONG ResponderIdValid:1; + ULONGLONG PreciseIPValid:1; + } DUMMYSTRUCTNAME; +} ERROR_TLB_CHECK, *PERROR_TLB_CHECK; + +typedef enum _ERROR_BUS_CHECK_OPERATION { + BusUnknownOp = 0, + BusPartialRead = 1, + BusPartialWrite = 2, + BusFullLineRead = 3, + BusFullLineWrite = 4, + BusWriteBack = 5, + BusSnoopProbe = 6, + BusIncomingPtcG = 7, + BusWriteCoalescing = 8, +} ERROR_BUS_CHECK_OPERATION; + +#if (NTDDI_VERSION >= NTDDI_VISTA) + +typedef union _ERROR_BUS_CHECK { + ULONGLONG BusCheck; + struct { + ULONGLONG Size:5; + ULONGLONG Internal:1; + ULONGLONG External:1; + ULONGLONG CacheTransfer:1; + ULONGLONG Type:8; + ULONGLONG Severity:5; + ULONGLONG Hierarchy:2; + ULONGLONG DP:1; + ULONGLONG Status:8; + ULONGLONG Reserved1:22; + ULONGLONG InstructionSet:1; + ULONGLONG InstructionSetValid:1; + ULONGLONG PrivilegeLevel:2; + ULONGLONG PrivilegeLevelValid:1; + ULONGLONG MachineCheckCorrected:1; + ULONGLONG TargetAddressValid:1; + ULONGLONG RequestIdValid:1; + ULONGLONG ResponderIdValid:1; + ULONGLONG PreciseIPValid:1; + } DUMMYSTRUCTNAME; +} ERROR_BUS_CHECK, *PERROR_BUS_CHECK; + +#else + +typedef union _ERROR_BUS_CHECK { + ULONGLONG BusCheck; + struct { + ULONGLONG Size:5; + ULONGLONG Internal:1; + ULONGLONG External:1; + ULONGLONG CacheTransfer:1; + ULONGLONG Type:8; + ULONGLONG Severity:5; + ULONGLONG Hierarchy:2; + ULONGLONG Reserved1:1; + ULONGLONG Status:8; + ULONGLONG Reserved2:22; + ULONGLONG InstructionSet:1; + ULONGLONG InstructionSetValid:1; + ULONGLONG PrivilegeLevel:2; + ULONGLONG PrivilegeLevelValid:1; + ULONGLONG MachineCheckCorrected:1; + ULONGLONG TargetAddressValid:1; + ULONGLONG RequestIdValid:1; + ULONGLONG ResponderIdValid:1; + ULONGLONG PreciseIPValid:1; + } DUMMYSTRUCTNAME; +} ERROR_BUS_CHECK, *PERROR_BUS_CHECK; + +#endif + +typedef enum _ERROR_REGFILE_CHECK_IDENTIFIER { + RegFileUnknownId = 0, + GeneralRegisterBank1 = 1, + GeneralRegisterBank0 = 2, + FloatingPointRegister = 3, + BranchRegister = 4, + PredicateRegister = 5, + ApplicationRegister = 6, + ControlRegister = 7, + RegionRegister = 8, + ProtectionKeyRegister = 9, + DataBreakPointRegister = 10, + InstructionBreakPointRegister = 11, + PerformanceMonitorControlRegister = 12, + PerformanceMonitorDataRegister = 13, +} ERROR_REGFILE_CHECK_IDENTIFIER; + +typedef enum _ERROR_REGFILE_CHECK_OPERATION { + RegFileUnknownOp = 0, + RegFileRead = 1, + RegFileWrite = 2, +} ERROR_REGFILE_CHECK_OPERATION; + +typedef union _ERROR_REGFILE_CHECK { + ULONGLONG RegFileCheck; + struct { + ULONGLONG Identifier:4; + ULONGLONG Operation:4; + ULONGLONG RegisterNumber:7; + ULONGLONG RegisterNumberValid:1; + ULONGLONG Reserved1:38; + ULONGLONG InstructionSet:1; + ULONGLONG InstructionSetValid:1; + ULONGLONG PrivilegeLevel:2; + ULONGLONG PrivilegeLevelValid:1; + ULONGLONG MachineCheckCorrected:1; + ULONGLONG Reserved2:3; + ULONGLONG PreciseIPValid:1; + } DUMMYSTRUCTNAME; +} ERROR_REGFILE_CHECK, *PERROR_REGFILE_CHECK; + +#if (NTDDK_VERSION <= WINXP) +typedef enum _ERROR_MS_CHECK_OPERATION { + MsUnknownOp = 0, + MsReadOrLoad = 1, + MsWriteOrStore = 2 +} ERROR_MS_CHECK_OPERATION; +#else +typedef enum _ERROR_MS_CHECK_OPERATION { + MsUnknownOp = 0, + MsReadOrLoad = 1, + MsWriteOrStore = 2, + MsOverTemperature = 3, + MsNormalTemperature = 4 +} ERROR_MS_CHECK_OPERATION; +#endif + +typedef union _ERROR_MS_CHECK { + ULONGLONG MsCheck; + struct { + ULONGLONG StructureIdentifier:5; + ULONGLONG Level:3; + ULONGLONG ArrayId:4; + ULONGLONG Operation:4; + ULONGLONG Way:6; + ULONGLONG WayValid:1; + ULONGLONG IndexValid:1; + ULONGLONG Reserved1:8; + ULONGLONG Index:8; + ULONGLONG Reserved2:14; + ULONGLONG InstructionSet:1; + ULONGLONG InstructionSetValid:1; + ULONGLONG PrivilegeLevel:2; + ULONGLONG PrivilegeLevelValid:1; + ULONGLONG MachineCheckCorrected:1; + ULONGLONG TargetAddressValid:1; + ULONGLONG RequestIdValid:1; + ULONGLONG ResponderIdValid:1; + ULONGLONG PreciseIPValid:1; + } DUMMYSTRUCTNAME; +} ERROR_MS_CHECK, *PERROR_MS_CHECK; + +typedef union _ERROR_CHECK_INFO { + ULONGLONG CheckInfo; + ERROR_CACHE_CHECK CacheCheck; + ERROR_TLB_CHECK TlbCheck; + ERROR_BUS_CHECK BusCheck; + ERROR_REGFILE_CHECK RegFileCheck; + ERROR_MS_CHECK MsCheck; +} ERROR_CHECK_INFO, *PERROR_CHECK_INFO; + +typedef struct _ERROR_MODINFO { + ERROR_MODINFO_VALID Valid; + ERROR_CHECK_INFO CheckInfo; + ULONGLONG RequestorId; + ULONGLONG ResponderId; + ULONGLONG TargetId; + ULONGLONG PreciseIP; +} ERROR_MODINFO, *PERROR_MODINFO; + +typedef union _ERROR_PROCESSOR_VALID { + ULONGLONG Valid; + struct { + ULONGLONG ErrorMap:1; + ULONGLONG StateParameter:1; + ULONGLONG CRLid:1; + ULONGLONG StaticStruct:1; + ULONGLONG CacheCheckNum:4; + ULONGLONG TlbCheckNum:4; + ULONGLONG BusCheckNum:4; + ULONGLONG RegFileCheckNum:4; + ULONGLONG MsCheckNum:4; + ULONGLONG CpuIdInfo:1; + ULONGLONG Reserved:39; + } DUMMYSTRUCTNAME; +} ERROR_PROCESSOR_VALID, *PERROR_PROCESSOR_VALID; + +typedef union _ERROR_PROCESSOR_ERROR_MAP { + ULONGLONG ErrorMap; + struct { + ULONGLONG Cid:4; + ULONGLONG Tid:4; + ULONGLONG Eic:4; + ULONGLONG Edc:4; + ULONGLONG Eit:4; + ULONGLONG Edt:4; + ULONGLONG Ebh:4; + ULONGLONG Erf:4; + ULONGLONG Ems:16; + ULONGLONG Reserved:16; + } DUMMYSTRUCTNAME; +} ERROR_PROCESSOR_ERROR_MAP, *PERROR_PROCESSOR_ERROR_MAP; + +typedef ERROR_PROCESSOR_ERROR_MAP _ERROR_PROCESSOR_LEVEL_INDEX; +typedef _ERROR_PROCESSOR_LEVEL_INDEX ERROR_PROCESSOR_LEVEL_INDEX, *PERROR_PROCESSOR_LEVEL_INDEX; + +typedef union _ERROR_PROCESSOR_STATE_PARAMETER { + ULONGLONG StateParameter; + struct { + ULONGLONG reserved0:2; + ULONGLONG rz:1; + ULONGLONG ra:1; + ULONGLONG me:1; + ULONGLONG mn:1; + ULONGLONG sy:1; + ULONGLONG co:1; + ULONGLONG ci:1; + ULONGLONG us:1; + ULONGLONG hd:1; + ULONGLONG tl:1; + ULONGLONG mi:1; + ULONGLONG pi:1; + ULONGLONG pm:1; + ULONGLONG dy:1; + ULONGLONG in:1; + ULONGLONG rs:1; + ULONGLONG cm:1; + ULONGLONG ex:1; + ULONGLONG cr:1; + ULONGLONG pc:1; + ULONGLONG dr:1; + ULONGLONG tr:1; + ULONGLONG rr:1; + ULONGLONG ar:1; + ULONGLONG br:1; + ULONGLONG pr:1; + ULONGLONG fp:1; + ULONGLONG b1:1; + ULONGLONG b0:1; + ULONGLONG gr:1; + ULONGLONG dsize:16; + ULONGLONG reserved1:11; + ULONGLONG cc:1; + ULONGLONG tc:1; + ULONGLONG bc:1; + ULONGLONG rc:1; + ULONGLONG uc:1; + } DUMMYSTRUCTNAME; +} ERROR_PROCESSOR_STATE_PARAMETER, *PERROR_PROCESSOR_STATE_PARAMETER; + +typedef union _PROCESSOR_LOCAL_ID { + ULONGLONG LocalId; + struct { + ULONGLONG reserved:16; + ULONGLONG eid:8; + ULONGLONG id:8; + ULONGLONG ignored:32; + } DUMMYSTRUCTNAME; +} PROCESSOR_LOCAL_ID, *PPROCESSOR_LOCAL_ID; + +typedef struct _ERROR_PROCESSOR_MS { + ULONGLONG MsError[1]; +} ERROR_PROCESSOR_MS, *PERROR_PROCESSOR_MS; + +typedef struct _ERROR_PROCESSOR_CPUID_INFO { + ULONGLONG CpuId0; + ULONGLONG CpuId1; + ULONGLONG CpuId2; + ULONGLONG CpuId3; + ULONGLONG CpuId4; + ULONGLONG Reserved; +} ERROR_PROCESSOR_CPUID_INFO, *PERROR_PROCESSOR_CPUID_INFO; + +typedef union _ERROR_PROCESSOR_STATIC_INFO_VALID { + ULONGLONG Valid; + struct { + ULONGLONG MinState:1; + ULONGLONG BR:1; + ULONGLONG CR:1; + ULONGLONG AR:1; + ULONGLONG RR:1; + ULONGLONG FR:1; + ULONGLONG Reserved:58; + } DUMMYSTRUCTNAME; +} ERROR_PROCESSOR_STATIC_INFO_VALID, *PERROR_PROCESSOR_STATIC_INFO_VALID; + +typedef struct _ERROR_PROCESSOR_STATIC_INFO { + ERROR_PROCESSOR_STATIC_INFO_VALID Valid; + UCHAR MinState[1024]; + ULONGLONG BR[8]; + ULONGLONG CR[128]; + ULONGLONG AR[128]; + ULONGLONG RR[8]; + ULONGLONG FR[2 * 128]; +} ERROR_PROCESSOR_STATIC_INFO, *PERROR_PROCESSOR_STATIC_INFO; + +typedef struct _ERROR_PROCESSOR { + ERROR_SECTION_HEADER Header; + ERROR_PROCESSOR_VALID Valid; + ERROR_PROCESSOR_ERROR_MAP ErrorMap; + ERROR_PROCESSOR_STATE_PARAMETER StateParameter; + PROCESSOR_LOCAL_ID CRLid; +} ERROR_PROCESSOR, *PERROR_PROCESSOR; + +#define ERROR_PROCESSOR_STATE_PARAMETER_CACHE_CHECK_SHIFT 59 +#define ERROR_PROCESSOR_STATE_PARAMETER_CACHE_CHECK_MASK 0x1 +#define ERROR_PROCESSOR_STATE_PARAMETER_TLB_CHECK_SHIFT 60 +#define ERROR_PROCESSOR_STATE_PARAMETER_TLB_CHECK_MASK 0x1 +#define ERROR_PROCESSOR_STATE_PARAMETER_BUS_CHECK_SHIFT 61 +#define ERROR_PROCESSOR_STATE_PARAMETER_BUS_CHECK_MASK 0x1 +#define ERROR_PROCESSOR_STATE_PARAMETER_REG_CHECK_SHIFT 62 +#define ERROR_PROCESSOR_STATE_PARAMETER_REG_CHECK_MASK 0x1 +#define ERROR_PROCESSOR_STATE_PARAMETER_MICROARCH_CHECK_SHIFT 63 +#define ERROR_PROCESSOR_STATE_PARAMETER_MICROARCH_CHECK_MASK 0x1 + +#define ERROR_PROCESSOR_STATE_PARAMETER_UNKNOWN_CHECK_SHIFT ERROR_PROCESSOR_STATE_PARAMETER_MICROARCH_CHECK_SHIFT +#define ERROR_PROCESSOR_STATE_PARAMETER_UNKNOWN_CHECK_MASK ERROR_PROCESSOR_STATE_PARAMETER_MICROARCH_CHECK_MASK + +typedef enum _ERR_TYPES { + ERR_INTERNAL = 1, + ERR_BUS = 16, + ERR_MEM = 4, + ERR_TLB = 5, + ERR_CACHE = 6, + ERR_FUNCTION = 7, + ERR_SELFTEST = 8, + ERR_FLOW = 9, + ERR_MAP = 17, + ERR_IMPROPER = 18, + ERR_UNIMPL = 19, + ERR_LOL = 20, + ERR_RESPONSE = 21, + ERR_PARITY = 22, + ERR_PROTOCOL = 23, + ERR_ERROR = 24, + ERR_TIMEOUT = 25, + ERR_POISONED = 26, +} _ERR_TYPE; + +typedef union _ERROR_STATUS { + ULONGLONG Status; + struct { + ULONGLONG Reserved0:8; + ULONGLONG Type:8; + ULONGLONG Address:1; + ULONGLONG Control:1; + ULONGLONG Data:1; + ULONGLONG Responder:1; + ULONGLONG Requestor:1; + ULONGLONG FirstError:1; + ULONGLONG Overflow:1; + ULONGLONG Reserved1:41; + } DUMMYSTRUCTNAME; +} ERROR_STATUS, *PERROR_STATUS; + +typedef struct _ERROR_OEM_DATA { + USHORT Length; +} ERROR_OEM_DATA, *PERROR_OEM_DATA; + +typedef union _ERROR_BUS_SPECIFIC_DATA { + ULONGLONG BusSpecificData; + struct { + ULONGLONG LockAsserted:1; + ULONGLONG DeferLogged:1; + ULONGLONG IOQEmpty:1; + ULONGLONG DeferredTransaction:1; + ULONGLONG RetriedTransaction:1; + ULONGLONG MemoryClaimedTransaction:1; + ULONGLONG IOClaimedTransaction:1; + ULONGLONG ResponseParitySignal:1; + ULONGLONG DeferSignal:1; + ULONGLONG HitMSignal:1; + ULONGLONG HitSignal:1; + ULONGLONG RequestBusFirstCycle:6; + ULONGLONG RequestBusSecondCycle:6; + ULONGLONG AddressParityBusFirstCycle:2; + ULONGLONG AddressParityBusSecondCycle:2; + ULONGLONG ResponseBus:3; + ULONGLONG RequestParitySignalFirstCycle:1; + ULONGLONG RequestParitySignalSecondCycle:1; + ULONGLONG Reserved:32; + } DUMMYSTRUCTNAME; +} ERROR_BUS_SPECIFIC_DATA, *PERROR_BUS_SPECIFIC_DATA; + +#define ERROR_MEMORY_GUID {0xe429faf2, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81}} + +typedef union _ERROR_MEMORY_VALID { + ULONGLONG Valid; + struct { + ULONGLONG ErrorStatus:1; + ULONGLONG PhysicalAddress:1; + ULONGLONG AddressMask:1; + ULONGLONG Node:1; + ULONGLONG Card:1; + ULONGLONG Module:1; + ULONGLONG Bank:1; + ULONGLONG Device:1; + ULONGLONG Row:1; + ULONGLONG Column:1; + ULONGLONG BitPosition:1; + ULONGLONG RequestorId:1; + ULONGLONG ResponderId:1; + ULONGLONG TargetId:1; + ULONGLONG BusSpecificData:1; + ULONGLONG OemId:1; + ULONGLONG OemData:1; + ULONGLONG Reserved:47; + } DUMMYSTRUCTNAME; +} ERROR_MEMORY_VALID, *PERROR_MEMORY_VALID; + +typedef struct _ERROR_MEMORY { + ERROR_SECTION_HEADER Header; + ERROR_MEMORY_VALID Valid; + ERROR_STATUS ErrorStatus; + ULONGLONG PhysicalAddress; + ULONGLONG PhysicalAddressMask; + USHORT Node; + USHORT Card; + USHORT Module; + USHORT Bank; + USHORT Device; + USHORT Row; + USHORT Column; + USHORT BitPosition; + ULONGLONG RequestorId; + ULONGLONG ResponderId; + ULONGLONG TargetId; + ULONGLONG BusSpecificData; + UCHAR OemId[16]; + ERROR_OEM_DATA OemData; +} ERROR_MEMORY, *PERROR_MEMORY; + +#define ERROR_PCI_BUS_GUID {0xe429faf4, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81}} + +typedef union _ERROR_PCI_BUS_VALID { + ULONGLONG Valid; + struct { + ULONGLONG ErrorStatus:1; + ULONGLONG ErrorType:1; + ULONGLONG Id:1; + ULONGLONG Address:1; + ULONGLONG Data:1; + ULONGLONG CmdType:1; + ULONGLONG RequestorId:1; + ULONGLONG ResponderId:1; + ULONGLONG TargetId:1; + ULONGLONG OemId:1; + ULONGLONG OemData:1; + ULONGLONG Reserved:53; + } DUMMYSTRUCTNAME; +} ERROR_PCI_BUS_VALID, *PERROR_PCI_BUS_VALID; + +typedef struct _ERROR_PCI_BUS_TYPE { + UCHAR Type; + UCHAR Reserved; +} ERROR_PCI_BUS_TYPE, *PERROR_PCI_BUS_TYPE; + +#define PciBusUnknownError ((UCHAR)0) +#define PciBusDataParityError ((UCHAR)1) +#define PciBusSystemError ((UCHAR)2) +#define PciBusMasterAbort ((UCHAR)3) +#define PciBusTimeOut ((UCHAR)4) +#define PciMasterDataParityError ((UCHAR)5) +#define PciAddressParityError ((UCHAR)6) +#define PciCommandParityError ((UCHAR)7) + +typedef struct _ERROR_PCI_BUS_ID { + UCHAR BusNumber; + UCHAR SegmentNumber; +} ERROR_PCI_BUS_ID, *PERROR_PCI_BUS_ID; + +typedef struct _ERROR_PCI_BUS { + ERROR_SECTION_HEADER Header; + ERROR_PCI_BUS_VALID Valid; + ERROR_STATUS ErrorStatus; + ERROR_PCI_BUS_TYPE Type; + ERROR_PCI_BUS_ID Id; + UCHAR Reserved[4]; + ULONGLONG Address; + ULONGLONG Data; + ULONGLONG CmdType; + ULONGLONG RequestorId; + ULONGLONG ResponderId; + ULONGLONG TargetId; + UCHAR OemId[16]; + ERROR_OEM_DATA OemData; +} ERROR_PCI_BUS, *PERROR_PCI_BUS; + +#define ERROR_PCI_COMPONENT_GUID {0xe429faf6, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81}} + +typedef union _ERROR_PCI_COMPONENT_VALID { + ULONGLONG Valid; + struct { + ULONGLONG ErrorStatus:1; + ULONGLONG Info:1; + ULONGLONG MemoryMappedRegistersPairs:1; + ULONGLONG ProgrammedIORegistersPairs:1; + ULONGLONG RegistersDataPairs:1; + ULONGLONG OemData:1; + ULONGLONG Reserved:58; + } DUMMYSTRUCTNAME; +} ERROR_PCI_COMPONENT_VALID, *PERROR_PCI_COMPONENT_VALID; + +typedef struct _ERROR_PCI_COMPONENT_INFO { + USHORT VendorId; + USHORT DeviceId; + UCHAR ClassCodeInterface; + UCHAR ClassCodeSubClass; + UCHAR ClassCodeBaseClass; + UCHAR FunctionNumber; + UCHAR DeviceNumber; + UCHAR BusNumber; + UCHAR SegmentNumber; + UCHAR Reserved0; + ULONG Reserved1; +} ERROR_PCI_COMPONENT_INFO, *PERROR_PCI_COMPONENT_INFO; + +typedef struct _ERROR_PCI_COMPONENT { + ERROR_SECTION_HEADER Header; + ERROR_PCI_COMPONENT_VALID Valid; + ERROR_STATUS ErrorStatus; + ERROR_PCI_COMPONENT_INFO Info; + ULONG MemoryMappedRegistersPairs; + ULONG ProgrammedIORegistersPairs; +} ERROR_PCI_COMPONENT, *PERROR_PCI_COMPONENT; + +#define ERROR_SYSTEM_EVENT_LOG_GUID {0xe429faf3, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81}} + +typedef union _ERROR_SYSTEM_EVENT_LOG_VALID { + ULONGLONG Valid; + struct { + ULONGLONG RecordId:1; + ULONGLONG RecordType:1; + ULONGLONG GeneratorId:1; + ULONGLONG EVMRev:1; + ULONGLONG SensorType:1; + ULONGLONG SensorNum:1; + ULONGLONG EventDirType:1; + ULONGLONG EventData1:1; + ULONGLONG EventData2:1; + ULONGLONG EventData3:1; + ULONGLONG Reserved:54; + } DUMMYSTRUCTNAME; +} ERROR_SYSTEM_EVENT_LOG_VALID, *PSYSTEM_EVENT_LOG_VALID; + +typedef struct _ERROR_SYSTEM_EVENT_LOG { + ERROR_SECTION_HEADER Header; + ERROR_SYSTEM_EVENT_LOG_VALID Valid; + USHORT RecordId; + UCHAR RecordType; + ULONG TimeStamp; + USHORT GeneratorId; + UCHAR EVMRevision; + UCHAR SensorType; + UCHAR SensorNumber; + UCHAR EventDir; + UCHAR Data1; + UCHAR Data2; + UCHAR Data3; +} ERROR_SYSTEM_EVENT_LOG, *PERROR_SYSTEM_EVENT_LOG; + +#define ERROR_SMBIOS_GUID {0xe429faf5, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81}} + +typedef union _ERROR_SMBIOS_VALID { + ULONGLONG Valid; + struct { + ULONGLONG EventType:1; + ULONGLONG Length:1; + ULONGLONG TimeStamp:1; + ULONGLONG OemData:1; + ULONGLONG Reserved:60; + } DUMMYSTRUCTNAME; +} ERROR_SMBIOS_VALID, *PERROR_SMBIOS_VALID; + +typedef UCHAR ERROR_SMBIOS_EVENT_TYPE, *PERROR_SMBIOS_EVENT_TYPE; + +typedef struct _ERROR_SMBIOS { + ERROR_SECTION_HEADER Header; + ERROR_SMBIOS_VALID Valid; + ERROR_SMBIOS_EVENT_TYPE EventType; + UCHAR Length; + ERROR_TIMESTAMP TimeStamp; + ERROR_OEM_DATA OemData; +} ERROR_SMBIOS, *PERROR_SMBIOS; + +#define ERROR_PLATFORM_SPECIFIC_GUID {0xe429faf7, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81}} + +typedef union _ERROR_PLATFORM_SPECIFIC_VALID { + ULONGLONG Valid; + struct { + ULONGLONG ErrorStatus:1; + ULONGLONG RequestorId:1; + ULONGLONG ResponderId:1; + ULONGLONG TargetId:1; + ULONGLONG BusSpecificData:1; + ULONGLONG OemId:1; + ULONGLONG OemData:1; + ULONGLONG OemDevicePath:1; + ULONGLONG Reserved:56; + } DUMMYSTRUCTNAME; +} ERROR_PLATFORM_SPECIFIC_VALID, *PERROR_PLATFORM_SPECIFIC_VALID; + +typedef struct _ERROR_PLATFORM_SPECIFIC { + ERROR_SECTION_HEADER Header; + ERROR_PLATFORM_SPECIFIC_VALID Valid; + ERROR_STATUS ErrorStatus; + ULONGLONG RequestorId; + ULONGLONG ResponderId; + ULONGLONG TargetId; + ERROR_BUS_SPECIFIC_DATA BusSpecificData; + UCHAR OemId[16]; + ERROR_OEM_DATA OemData; +} ERROR_PLATFORM_SPECIFIC, *PERROR_PLATFORM_SPECIFIC; + +#define ERROR_PLATFORM_BUS_GUID {0xe429faf9, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81}} + +typedef union _ERROR_PLATFORM_BUS_VALID { + ULONGLONG Valid; + struct { + ULONGLONG ErrorStatus:1; + ULONGLONG RequestorId:1; + ULONGLONG ResponderId:1; + ULONGLONG TargetId:1; + ULONGLONG BusSpecificData:1; + ULONGLONG OemId:1; + ULONGLONG OemData:1; + ULONGLONG OemDevicePath:1; + ULONGLONG Reserved:56; + } DUMMYSTRUCTNAME; +} ERROR_PLATFORM_BUS_VALID, *PERROR_PLATFORM_BUS_VALID; + +typedef struct _ERROR_PLATFORM_BUS { + ERROR_SECTION_HEADER Header; + ERROR_PLATFORM_BUS_VALID Valid; + ERROR_STATUS ErrorStatus; + ULONGLONG RequestorId; + ULONGLONG ResponderId; + ULONGLONG TargetId; + ERROR_BUS_SPECIFIC_DATA BusSpecificData; + UCHAR OemId[16]; + ERROR_OEM_DATA OemData; +} ERROR_PLATFORM_BUS, *PERROR_PLATFORM_BUS; + +#define ERROR_PLATFORM_HOST_CONTROLLER_GUID {0xe429faf8, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81}} + +typedef union _ERROR_PLATFORM_HOST_CONTROLLER_VALID { + ULONGLONG Valid; + struct { + ULONGLONG ErrorStatus:1; + ULONGLONG RequestorId:1; + ULONGLONG ResponderId:1; + ULONGLONG TargetId:1; + ULONGLONG BusSpecificData:1; + ULONGLONG OemId:1; + ULONGLONG OemData:1; + ULONGLONG OemDevicePath:1; + ULONGLONG Reserved:56; + } DUMMYSTRUCTNAME; +} ERROR_PLATFORM_HOST_CONTROLLER_VALID, *PERROR_PLATFORM_HOST_CONTROLLER_VALID; + +typedef struct _ERROR_PLATFORM_HOST_CONTROLLER { + ERROR_SECTION_HEADER Header; + ERROR_PCI_COMPONENT_VALID Valid; + ERROR_STATUS ErrorStatus; + ULONGLONG RequestorId; + ULONGLONG ResponderId; + ULONGLONG TargetId; + ERROR_BUS_SPECIFIC_DATA BusSpecificData; + UCHAR OemId[16]; + ERROR_OEM_DATA OemData; +} ERROR_PLATFORM_HOST_CONTROLLER, *PERROR_PLATFORM_HOST_CONTROLLER; + +typedef ERROR_RECORD_HEADER ERROR_LOGRECORD, *PERROR_LOGRECORD; +typedef ERROR_RECORD_HEADER MCA_EXCEPTION, *PMCA_EXCEPTION; +typedef ERROR_RECORD_HEADER CMC_EXCEPTION, *PCMC_EXCEPTION; +typedef ERROR_RECORD_HEADER CPE_EXCEPTION, *PCPE_EXCEPTION; +#if (NTDDI_VERSION > NTDDI_WINXP) +typedef ERROR_RECORD_HEADER INIT_EXCEPTION, *PINIT_EXCEPTION; +#endif + +#endif /* defined(_IA64_) */ + +#endif /* defined(_X86_) || defined(_IA64_) || defined(_AMD64_) */ Propchange: branches/header-work/include/ddk/mce.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/header-work/include/ddk/ntddk.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/ntddk.h…
============================================================================== --- branches/header-work/include/ddk/ntddk.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/ntddk.h [iso-8859-1] Thu Mar 18 01:36:45 2010 @@ -56,6 +56,11 @@ extern "C" { #endif +struct _LOADER_PARAMETER_BLOCK; +struct _CREATE_DISK; +struct _DRIVE_LAYOUT_INFORMATION_EX; +struct _SET_PARTITION_INFORMATION_EX; + typedef struct _BUS_HANDLER *PBUS_HANDLER; typedef struct _DEVICE_HANDLER_OBJECT *PDEVICE_HANDLER_OBJECT; #if defined(_NTHAL_INCLUDED_) @@ -86,9 +91,7 @@ extern PCCHAR KeNumberProcessors; #endif -/* FIXME #include <mce.h> -*/ #ifdef _X86_ @@ -3628,6 +3631,7 @@ NTKERNELAPI NTSTATUS +NTAPI IoCreateFileSpecifyDeviceObjectHint( OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, @@ -3691,6 +3695,7 @@ NTKERNELAPI NTSTATUS +NTAPI IoCreateFileEx( OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, @@ -4017,6 +4022,15 @@ (NTAPI *pHalSetPciErrorHandlerCallback)( IN PCI_ERROR_HANDLER_CALLBACK Callback); +#if 1 /* Not present in WDK 7600 */ +typedef VOID +(FASTCALL *pHalIoAssignDriveLetters)( + IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock, + IN PSTRING NtDeviceName, + OUT PUCHAR NtSystemPath, + OUT PSTRING NtSystemPathString); +#endif + typedef struct { ULONG Version; pHalQuerySystemInformation HalQuerySystemInformation; @@ -4365,14 +4379,6 @@ NTSTATUS NTAPI -HalAllocateHardwareCounters( - IN PGROUP_AFFINITY GroupAffinty, - IN ULONG GroupCount, - IN PPHYSICAL_COUNTER_RESOURCE_LIST ResourceList, - OUT PHANDLE CounterSetHandle); - -NTSTATUS -NTAPI HalFreeHardwareCounters( IN HANDLE CounterSetHandle); @@ -4599,6 +4605,18 @@ OUT PVOID *Buffer); #endif +#if (NTDDI_VERSION >= NTDDI_WIN7) +NTSTATUS +NTAPI +HalAllocateHardwareCounters( + IN PGROUP_AFFINITY GroupAffinty, + IN ULONG GroupCount, + IN PPHYSICAL_COUNTER_RESOURCE_LIST ResourceList, + OUT PHANDLE CounterSetHandle); +#endif + + + #if defined(_IA64_) #if (NTDDI_VERSION >= NTDDI_WIN2K) NTHALAPI @@ -4635,11 +4653,6 @@ IN PWHEA_ERROR_RECORD ErrorRecord); #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */ - -struct _LOADER_PARAMETER_BLOCK; -struct _CREATE_DISK; -struct _DRIVE_LAYOUT_INFORMATION_EX; -struct _SET_PARTITION_INFORMATION_EX; // // GUID and UUID @@ -4691,15 +4704,6 @@ OUT PPHYSICAL_ADDRESS TranslatedAddress, IN OUT PULONG_PTR Context, IN BOOLEAN NextBus); - -#if 1 /* Not present in WDK 7600 */ -typedef VOID -(FASTCALL *pHalIoAssignDriveLetters)( - IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock, - IN PSTRING NtDeviceName, - OUT PUCHAR NtSystemPath, - OUT PSTRING NtSystemPathString); -#endif extern NTKERNELAPI PVOID MmHighestUserAddress; extern NTKERNELAPI PVOID MmSystemRangeStart;
14 years, 9 months
1
0
0
0
[akhaldi] 46255: [NTDDK] - Group related definitions. - Add PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR_TYPE, PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR, PHYSICAL_COUNTER_RESOURCE_LIST and several missing Hal*, pHal* and HAL_* definitions.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Mar 17 23:44:46 2010 New Revision: 46255 URL:
http://svn.reactos.org/svn/reactos?rev=46255&view=rev
Log: [NTDDK] - Group related definitions. - Add PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR_TYPE, PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR, PHYSICAL_COUNTER_RESOURCE_LIST and several missing Hal*, pHal* and HAL_* definitions. Modified: branches/header-work/include/ddk/ntddk.h Modified: branches/header-work/include/ddk/ntddk.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/ntddk.h…
============================================================================== --- branches/header-work/include/ddk/ntddk.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/ntddk.h [iso-8859-1] Wed Mar 17 23:44:46 2010 @@ -3739,32 +3739,19 @@ IN PFILE_OBJECT FileObject); #endif - - - - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -VOID -FASTCALL -HalExamineMBR( - IN PDEVICE_OBJECT DeviceObject, - IN ULONG SectorSize, - IN ULONG MBRTypeIdentifier, - OUT PVOID *Buffer); -#endif - -struct _LOADER_PARAMETER_BLOCK; -struct _CREATE_DISK; -struct _DRIVE_LAYOUT_INFORMATION_EX; -struct _SET_PARTITION_INFORMATION_EX; - -// -// GUID and UUID -// -#ifndef GUID_DEFINED -#include <guiddef.h> -#endif +typedef BOOLEAN +(NTAPI *PHAL_RESET_DISPLAY_PARAMETERS)( + IN ULONG Columns, + IN ULONG Rows); + +typedef PBUS_HANDLER +(FASTCALL *pHalHandlerForBus)( + IN INTERFACE_TYPE InterfaceType, + IN ULONG BusNumber); + +typedef VOID +(FASTCALL *pHalReferenceBusHandler)( + IN PBUS_HANDLER BusHandler); typedef enum _HAL_QUERY_INFORMATION_CLASS { HalInstalledBusInformation, @@ -3812,21 +3799,103 @@ HalProfileDpgoSourceInterruptHandler } HAL_SET_INFORMATION_CLASS, *PHAL_SET_INFORMATION_CLASS; -typedef struct _HAL_PROFILE_SOURCE_INTERVAL { - KPROFILE_SOURCE Source; - ULONG_PTR Interval; -} HAL_PROFILE_SOURCE_INTERVAL, *PHAL_PROFILE_SOURCE_INTERVAL; - -typedef struct _HAL_PROFILE_SOURCE_INFORMATION { - KPROFILE_SOURCE Source; - BOOLEAN Supported; - ULONG Interval; -} HAL_PROFILE_SOURCE_INFORMATION, *PHAL_PROFILE_SOURCE_INFORMATION; - -typedef struct _MAP_REGISTER_ENTRY { - PVOID MapRegister; - BOOLEAN WriteToDevice; -} MAP_REGISTER_ENTRY, *PMAP_REGISTER_ENTRY; +typedef NTSTATUS +(NTAPI *pHalQuerySystemInformation)( + IN HAL_QUERY_INFORMATION_CLASS InformationClass, + IN ULONG BufferSize, + IN OUT PVOID Buffer, + OUT PULONG ReturnedLength); + +typedef NTSTATUS +(NTAPI *pHalSetSystemInformation)( + IN HAL_SET_INFORMATION_CLASS InformationClass, + IN ULONG BufferSize, + IN PVOID Buffer); + +typedef VOID +(FASTCALL *pHalExamineMBR)( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN ULONG MBRTypeIdentifier, + OUT PVOID *Buffer); + +typedef NTSTATUS +(FASTCALL *pHalIoReadPartitionTable)( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN BOOLEAN ReturnRecognizedPartitions, + OUT struct _DRIVE_LAYOUT_INFORMATION **PartitionBuffer); + +typedef NTSTATUS +(FASTCALL *pHalIoSetPartitionInformation)( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN ULONG PartitionNumber, + IN ULONG PartitionType); + +typedef NTSTATUS +(FASTCALL *pHalIoWritePartitionTable)( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN ULONG SectorsPerTrack, + IN ULONG NumberOfHeads, + IN struct _DRIVE_LAYOUT_INFORMATION *PartitionBuffer); + +typedef NTSTATUS +(NTAPI *pHalQueryBusSlots)( + IN PBUS_HANDLER BusHandler, + IN ULONG BufferSize, + OUT PULONG SlotNumbers, + OUT PULONG ReturnedLength); + +typedef NTSTATUS +(NTAPI *pHalInitPnpDriver)( + VOID); + +typedef struct _PM_DISPATCH_TABLE { + ULONG Signature; + ULONG Version; + PVOID Function[1]; +} PM_DISPATCH_TABLE, *PPM_DISPATCH_TABLE; + +typedef NTSTATUS +(NTAPI *pHalInitPowerManagement)( + IN PPM_DISPATCH_TABLE PmDriverDispatchTable, + OUT PPM_DISPATCH_TABLE *PmHalDispatchTable); + +typedef struct _DMA_ADAPTER* +(NTAPI *pHalGetDmaAdapter)( + IN PVOID Context, + IN struct _DEVICE_DESCRIPTION *DeviceDescriptor, + OUT PULONG NumberOfMapRegisters); + +typedef NTSTATUS +(NTAPI *pHalGetInterruptTranslator)( + IN INTERFACE_TYPE ParentInterfaceType, + IN ULONG ParentBusNumber, + IN INTERFACE_TYPE BridgeInterfaceType, + IN USHORT Size, + IN USHORT Version, + OUT PTRANSLATOR_INTERFACE Translator, + OUT PULONG BridgeBusNumber); + +typedef NTSTATUS +(NTAPI *pHalStartMirroring)( + VOID); + +typedef NTSTATUS +(NTAPI *pHalEndMirroring)( + IN ULONG PassNumber); + +typedef NTSTATUS +(NTAPI *pHalMirrorPhysicalMemory)( + IN PHYSICAL_ADDRESS PhysicalAddress, + IN LARGE_INTEGER NumberOfBytes); + +typedef NTSTATUS +(NTAPI *pHalMirrorVerify)( + IN PHYSICAL_ADDRESS PhysicalAddress, + IN LARGE_INTEGER NumberOfBytes); typedef struct _DEBUG_DEVICE_ADDRESS { UCHAR Type; @@ -3860,222 +3929,59 @@ DEBUG_MEMORY_REQUIREMENTS Memory; } DEBUG_DEVICE_DESCRIPTOR, *PDEBUG_DEVICE_DESCRIPTOR; -typedef struct _PM_DISPATCH_TABLE { - ULONG Signature; - ULONG Version; - PVOID Function[1]; -} PM_DISPATCH_TABLE, *PPM_DISPATCH_TABLE; +typedef NTSTATUS +(NTAPI *pKdSetupPciDeviceForDebugging)( + IN PVOID LoaderBlock OPTIONAL, + IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice); + +typedef NTSTATUS +(NTAPI *pKdReleasePciDeviceForDebugging)( + IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice); + +typedef PVOID +(NTAPI *pKdGetAcpiTablePhase0)( + IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock, + IN ULONG Signature); typedef VOID -(FASTCALL *pHalExamineMBR)( - IN PDEVICE_OBJECT DeviceObject, - IN ULONG SectorSize, - IN ULONG MBRTypeIdentifier, - OUT PVOID *Buffer); - -typedef NTSTATUS -(FASTCALL *pHalIoReadPartitionTable)( - IN PDEVICE_OBJECT DeviceObject, - IN ULONG SectorSize, - IN BOOLEAN ReturnRecognizedPartitions, - OUT struct _DRIVE_LAYOUT_INFORMATION **PartitionBuffer); - -typedef NTSTATUS -(FASTCALL *pHalIoSetPartitionInformation)( - IN PDEVICE_OBJECT DeviceObject, - IN ULONG SectorSize, - IN ULONG PartitionNumber, - IN ULONG PartitionType); - -typedef NTSTATUS -(FASTCALL *pHalIoWritePartitionTable)( - IN PDEVICE_OBJECT DeviceObject, - IN ULONG SectorSize, - IN ULONG SectorsPerTrack, - IN ULONG NumberOfHeads, - IN struct _DRIVE_LAYOUT_INFORMATION *PartitionBuffer); - -typedef PBUS_HANDLER -(FASTCALL *pHalHandlerForBus)( - IN INTERFACE_TYPE InterfaceType, - IN ULONG BusNumber); - -typedef VOID -(FASTCALL *pHalReferenceBusHandler)( - IN PBUS_HANDLER BusHandler); - -typedef NTSTATUS -(NTAPI *pHalQuerySystemInformation)( - IN HAL_QUERY_INFORMATION_CLASS InformationClass, - IN ULONG BufferSize, - IN OUT PVOID Buffer, - OUT PULONG ReturnedLength); - -typedef NTSTATUS -(NTAPI *pHalSetSystemInformation)( - IN HAL_SET_INFORMATION_CLASS InformationClass, - IN ULONG BufferSize, - IN PVOID Buffer); - -typedef NTSTATUS -(NTAPI *pHalQueryBusSlots)( - IN PBUS_HANDLER BusHandler, - IN ULONG BufferSize, - OUT PULONG SlotNumbers, - OUT PULONG ReturnedLength); - -typedef NTSTATUS -(NTAPI *pHalInitPnpDriver)( +(NTAPI *pKdCheckPowerButton)( VOID); - -typedef NTSTATUS -(NTAPI *pHalInitPowerManagement)( - IN PPM_DISPATCH_TABLE PmDriverDispatchTable, - OUT PPM_DISPATCH_TABLE *PmHalDispatchTable); - -typedef struct _DMA_ADAPTER* -(NTAPI *pHalGetDmaAdapter)( - IN PVOID Context, - IN struct _DEVICE_DESCRIPTION *DeviceDescriptor, - OUT PULONG NumberOfMapRegisters); - -typedef NTSTATUS -(NTAPI *pHalGetInterruptTranslator)( - IN INTERFACE_TYPE ParentInterfaceType, - IN ULONG ParentBusNumber, - IN INTERFACE_TYPE BridgeInterfaceType, - IN USHORT Size, - IN USHORT Version, - OUT PTRANSLATOR_INTERFACE Translator, - OUT PULONG BridgeBusNumber); - -typedef NTSTATUS -(NTAPI *pHalStartMirroring)( - VOID); - -typedef NTSTATUS -(NTAPI *pHalEndMirroring)( - IN ULONG PassNumber); - -typedef NTSTATUS -(NTAPI *pHalMirrorPhysicalMemory)( - IN PHYSICAL_ADDRESS PhysicalAddress, - IN LARGE_INTEGER NumberOfBytes); - -typedef NTSTATUS -(NTAPI *pHalMirrorVerify)( - IN PHYSICAL_ADDRESS PhysicalAddress, - IN LARGE_INTEGER NumberOfBytes); typedef VOID (NTAPI *pHalEndOfBoot)( VOID); -typedef -BOOLEAN -(NTAPI *pHalTranslateBusAddress)( - IN INTERFACE_TYPE InterfaceType, - IN ULONG BusNumber, - IN PHYSICAL_ADDRESS BusAddress, - IN OUT PULONG AddressSpace, - OUT PPHYSICAL_ADDRESS TranslatedAddress); - -typedef -NTSTATUS -(NTAPI *pHalAssignSlotResources)( - IN PUNICODE_STRING RegistryPath, - IN PUNICODE_STRING DriverClassName OPTIONAL, - IN PDRIVER_OBJECT DriverObject, - IN PDEVICE_OBJECT DeviceObject, - IN INTERFACE_TYPE BusType, - IN ULONG BusNumber, - IN ULONG SlotNumber, - IN OUT PCM_RESOURCE_LIST *AllocatedResources); - -typedef -VOID -(NTAPI *pHalHaltSystem)( - VOID); - -typedef -BOOLEAN -(NTAPI *pHalResetDisplay)( - VOID); - -typedef -UCHAR -(NTAPI *pHalVectorToIDTEntry)( - ULONG Vector); - -typedef -BOOLEAN -(NTAPI *pHalFindBusAddressTranslation)( - IN PHYSICAL_ADDRESS BusAddress, - IN OUT PULONG AddressSpace, - OUT PPHYSICAL_ADDRESS TranslatedAddress, - IN OUT PULONG_PTR Context, - IN BOOLEAN NextBus); - -typedef -NTSTATUS -(NTAPI *pKdSetupPciDeviceForDebugging)( - IN PVOID LoaderBlock OPTIONAL, - IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice); - -typedef -NTSTATUS -(NTAPI *pKdReleasePciDeviceForDebugging)( - IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice); - -typedef -PVOID -(NTAPI *pKdGetAcpiTablePhase0)( - IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock, - IN ULONG Signature); - -typedef -PVOID -(NTAPI *pHalGetAcpiTable)( - IN ULONG Signature, - IN PCSTR OemId OPTIONAL, - IN PCSTR OemTableId OPTIONAL); - -typedef -VOID -(NTAPI *pKdCheckPowerButton)( - VOID); - #if (NTDDI_VERSION >= NTDDI_VISTA) -typedef -PVOID +typedef PVOID (NTAPI *pKdMapPhysicalMemory64)( IN PHYSICAL_ADDRESS PhysicalAddress, IN ULONG NumberPages, IN BOOLEAN FlushCurrentTLB); -typedef -VOID +typedef VOID (NTAPI *pKdUnmapVirtualAddress)( IN PVOID VirtualAddress, IN ULONG NumberPages, IN BOOLEAN FlushCurrentTLB); #else -typedef -PVOID +typedef PVOID (NTAPI *pKdMapPhysicalMemory64)( IN PHYSICAL_ADDRESS PhysicalAddress, IN ULONG NumberPages); -typedef -VOID +typedef VOID (NTAPI *pKdUnmapVirtualAddress)( IN PVOID VirtualAddress, IN ULONG NumberPages); #endif - -typedef -ULONG +typedef PVOID +(NTAPI *pHalGetAcpiTable)( + IN ULONG Signature, + IN PCSTR OemId OPTIONAL, + IN PCSTR OemTableId OPTIONAL); + +typedef ULONG (NTAPI *pKdGetPciDataByOffset)( IN ULONG BusNumber, IN ULONG SlotNumber, @@ -4083,8 +3989,7 @@ IN ULONG Offset, IN ULONG Length); -typedef -ULONG +typedef ULONG (NTAPI *pKdSetPciDataByOffset)( IN ULONG BusNumber, IN ULONG SlotNumber, @@ -4092,29 +3997,25 @@ IN ULONG Offset, IN ULONG Length); -typedef BOOLEAN -(NTAPI *PHAL_RESET_DISPLAY_PARAMETERS)( - IN ULONG Columns, - IN ULONG Rows); - -typedef -VOID +#if defined(_IA64_) +typedef NTSTATUS +(*pHalGetErrorCapList)( + IN OUT PULONG CapsListLength, + IN OUT PUCHAR ErrorCapList); + +typedef NTSTATUS +(*pHalInjectError)( + IN ULONG BufferLength, + IN PUCHAR Buffer); +#endif + +typedef VOID (NTAPI *PCI_ERROR_HANDLER_CALLBACK)( VOID); -typedef -VOID +typedef VOID (NTAPI *pHalSetPciErrorHandlerCallback)( IN PCI_ERROR_HANDLER_CALLBACK Callback); - -#if 1 /* Not present in WDK 7600 */ -typedef VOID -(FASTCALL *pHalIoAssignDriveLetters)( - IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock, - IN PSTRING NtDeviceName, - OUT PUCHAR NtSystemPath, - OUT PSTRING NtSystemPathString); -#endif typedef struct { ULONG Version; @@ -4177,6 +4078,628 @@ #define HalMirrorPhysicalMemory HALDISPATCH->HalMirrorPhysicalMemory #define HalEndOfBoot HALDISPATCH->HalEndOfBoot #define HalMirrorVerify HALDISPATCH->HalMirrorVerify +#define HalGetCachedAcpiTable HALDISPATCH->HalGetCachedAcpiTable +#define HalSetPciErrorHandlerCallback HALDISPATCH->HalSetPciErrorHandlerCallback +#if defined(_IA64_) +#define HalGetErrorCapList HALDISPATCH->HalGetErrorCapList +#define HalInjectError HALDISPATCH->HalInjectError +#endif + +typedef struct _HAL_BUS_INFORMATION { + INTERFACE_TYPE BusType; + BUS_DATA_TYPE ConfigurationType; + ULONG BusNumber; + ULONG Reserved; +} HAL_BUS_INFORMATION, *PHAL_BUS_INFORMATION; + +typedef struct _HAL_PROFILE_SOURCE_INFORMATION { + KPROFILE_SOURCE Source; + BOOLEAN Supported; + ULONG Interval; +} HAL_PROFILE_SOURCE_INFORMATION, *PHAL_PROFILE_SOURCE_INFORMATION; + +typedef struct _HAL_PROFILE_SOURCE_INFORMATION_EX { + KPROFILE_SOURCE Source; + BOOLEAN Supported; + ULONG_PTR Interval; + ULONG_PTR DefInterval; + ULONG_PTR MaxInterval; + ULONG_PTR MinInterval; +} HAL_PROFILE_SOURCE_INFORMATION_EX, *PHAL_PROFILE_SOURCE_INFORMATION_EX; + +typedef struct _HAL_PROFILE_SOURCE_INTERVAL { + KPROFILE_SOURCE Source; + ULONG_PTR Interval; +} HAL_PROFILE_SOURCE_INTERVAL, *PHAL_PROFILE_SOURCE_INTERVAL; + +typedef struct _HAL_PROFILE_SOURCE_LIST { + KPROFILE_SOURCE Source; + PWSTR Description; +} HAL_PROFILE_SOURCE_LIST, *PHAL_PROFILE_SOURCE_LIST; + +typedef enum _HAL_DISPLAY_BIOS_INFORMATION { + HalDisplayInt10Bios, + HalDisplayEmulatedBios, + HalDisplayNoBios +} HAL_DISPLAY_BIOS_INFORMATION, *PHAL_DISPLAY_BIOS_INFORMATION; + +typedef struct _HAL_POWER_INFORMATION { + ULONG TBD; +} HAL_POWER_INFORMATION, *PHAL_POWER_INFORMATION; + +typedef struct _HAL_PROCESSOR_SPEED_INFO { + ULONG ProcessorSpeed; +} HAL_PROCESSOR_SPEED_INFORMATION, *PHAL_PROCESSOR_SPEED_INFORMATION; + +typedef struct _HAL_CALLBACKS { + PCALLBACK_OBJECT SetSystemInformation; + PCALLBACK_OBJECT BusCheck; +} HAL_CALLBACKS, *PHAL_CALLBACKS; + +typedef struct _HAL_PROCESSOR_FEATURE { + ULONG UsableFeatureBits; +} HAL_PROCESSOR_FEATURE; + +typedef NTSTATUS +(NTAPI *PHALIOREADWRITEHANDLER)( + IN BOOLEAN fRead, + IN ULONG dwAddr, + IN ULONG dwSize, + IN OUT PULONG pdwData); + +typedef struct _HAL_AMLI_BAD_IO_ADDRESS_LIST { + ULONG BadAddrBegin; + ULONG BadAddrSize; + ULONG OSVersionTrigger; + PHALIOREADWRITEHANDLER IOHandler; +} HAL_AMLI_BAD_IO_ADDRESS_LIST, *PHAL_AMLI_BAD_IO_ADDRESS_LIST; + +#if defined(_X86_) || defined(_IA64_) || defined(_AMD64_) + +typedef VOID +(NTAPI *PHALMCAINTERFACELOCK)( + VOID); + +typedef VOID +(NTAPI *PHALMCAINTERFACEUNLOCK)( + VOID); + +typedef NTSTATUS +(NTAPI *PHALMCAINTERFACEREADREGISTER)( + IN UCHAR BankNumber, + IN OUT PVOID Exception); + +typedef struct _HAL_MCA_INTERFACE { + PHALMCAINTERFACELOCK Lock; + PHALMCAINTERFACEUNLOCK Unlock; + PHALMCAINTERFACEREADREGISTER ReadRegister; +} HAL_MCA_INTERFACE; + +typedef enum { + ApicDestinationModePhysical = 1, + ApicDestinationModeLogicalFlat, + ApicDestinationModeLogicalClustered, + ApicDestinationModeUnknown +} HAL_APIC_DESTINATION_MODE, *PHAL_APIC_DESTINATION_MODE; + +#if defined(_AMD64_) + +struct _KTRAP_FRAME; +struct _KEXCEPTION_FRAME; + +typedef ERROR_SEVERITY +(NTAPI *PDRIVER_EXCPTN_CALLBACK)( + IN PVOID Context, + IN struct _KTRAP_FRAME *TrapFrame, + IN struct _KEXCEPTION_FRAME *ExceptionFrame, + IN PMCA_EXCEPTION Exception); + +#endif + +#if defined(_X86_) || defined(_IA64_) +typedef +#if defined(_IA64_) +ERROR_SEVERITY +#else +VOID +#endif +(NTAPI *PDRIVER_EXCPTN_CALLBACK)( + IN PVOID Context, + IN PMCA_EXCEPTION BankLog); +#endif + +typedef PDRIVER_EXCPTN_CALLBACK PDRIVER_MCA_EXCEPTION_CALLBACK; + +typedef struct _MCA_DRIVER_INFO { + PDRIVER_MCA_EXCEPTION_CALLBACK ExceptionCallback; + PKDEFERRED_ROUTINE DpcCallback; + PVOID DeviceContext; +} MCA_DRIVER_INFO, *PMCA_DRIVER_INFO; + +typedef struct _HAL_ERROR_INFO { + ULONG Version; + ULONG InitMaxSize; + ULONG McaMaxSize; + ULONG McaPreviousEventsCount; + ULONG McaCorrectedEventsCount; + ULONG McaKernelDeliveryFails; + ULONG McaDriverDpcQueueFails; + ULONG McaReserved; + ULONG CmcMaxSize; + ULONG CmcPollingInterval; + ULONG CmcInterruptsCount; + ULONG CmcKernelDeliveryFails; + ULONG CmcDriverDpcQueueFails; + ULONG CmcGetStateFails; + ULONG CmcClearStateFails; + ULONG CmcReserved; + ULONGLONG CmcLogId; + ULONG CpeMaxSize; + ULONG CpePollingInterval; + ULONG CpeInterruptsCount; + ULONG CpeKernelDeliveryFails; + ULONG CpeDriverDpcQueueFails; + ULONG CpeGetStateFails; + ULONG CpeClearStateFails; + ULONG CpeInterruptSources; + ULONGLONG CpeLogId; + ULONGLONG KernelReserved[4]; +} HAL_ERROR_INFO, *PHAL_ERROR_INFO; + +#define HAL_MCE_INTERRUPTS_BASED ((ULONG)-1) +#define HAL_MCE_DISABLED ((ULONG)0) + +#define HAL_CMC_INTERRUPTS_BASED HAL_MCE_INTERRUPTS_BASED +#define HAL_CMC_DISABLED HAL_MCE_DISABLED + +#define HAL_CPE_INTERRUPTS_BASED HAL_MCE_INTERRUPTS_BASED +#define HAL_CPE_DISABLED HAL_MCE_DISABLED + +#define HAL_MCA_INTERRUPTS_BASED HAL_MCE_INTERRUPTS_BASED +#define HAL_MCA_DISABLED HAL_MCE_DISABLED + +typedef VOID +(NTAPI *PDRIVER_CMC_EXCEPTION_CALLBACK)( + IN PVOID Context, + IN PCMC_EXCEPTION CmcLog); + +typedef VOID +(NTAPI *PDRIVER_CPE_EXCEPTION_CALLBACK)( + IN PVOID Context, + IN PCPE_EXCEPTION CmcLog); + +typedef struct _CMC_DRIVER_INFO { + PDRIVER_CMC_EXCEPTION_CALLBACK ExceptionCallback; + PKDEFERRED_ROUTINE DpcCallback; + PVOID DeviceContext; +} CMC_DRIVER_INFO, *PCMC_DRIVER_INFO; + +typedef struct _CPE_DRIVER_INFO { + PDRIVER_CPE_EXCEPTION_CALLBACK ExceptionCallback; + PKDEFERRED_ROUTINE DpcCallback; + PVOID DeviceContext; +} CPE_DRIVER_INFO, *PCPE_DRIVER_INFO; + +#endif // defined(_X86_) || defined(_IA64_) || defined(_AMD64_) + +#if defined(_IA64_) + +typedef NTSTATUS +(*HALSENDCROSSPARTITIONIPI)( + IN USHORT ProcessorID, + IN UCHAR HardwareVector); + +typedef NTSTATUS +(*HALRESERVECROSSPARTITIONINTERRUPTVECTOR)( + OUT PULONG Vector, + OUT PKIRQL Irql, + IN OUT PGROUP_AFFINITY Affinity, + OUT PUCHAR HardwareVector); + +typedef VOID +(*HALFREECROSSPARTITIONINTERRUPTVECTOR)( + IN ULONG Vector, + IN PGROUP_AFFINITY Affinity); + +typedef struct _HAL_CROSS_PARTITION_IPI_INTERFACE { + HALSENDCROSSPARTITIONIPI HalSendCrossPartitionIpi; + HALRESERVECROSSPARTITIONINTERRUPTVECTOR HalReserveCrossPartitionInterruptVector; + HALFREECROSSPARTITIONINTERRUPTVECTOR HalFreeCrossPartitionInterruptVector; +} HAL_CROSS_PARTITION_IPI_INTERFACE; + +#define HAL_CROSS_PARTITION_IPI_INTERFACE_MINIMUM_SIZE \ + FIELD_OFFSET(HAL_CROSS_PARTITION_IPI_INTERFACE, \ + HalFreeCrossPartitionInterruptVector) + +#endif /* defined(_IA64_) */ + +typedef struct _HAL_PLATFORM_INFORMATION { + ULONG PlatformFlags; +} HAL_PLATFORM_INFORMATION, *PHAL_PLATFORM_INFORMATION; + +#define HAL_PLATFORM_DISABLE_WRITE_COMBINING 0x01L +#define HAL_PLATFORM_DISABLE_PTCG 0x04L +#define HAL_PLATFORM_DISABLE_UC_MAIN_MEMORY 0x08L +#define HAL_PLATFORM_ENABLE_WRITE_COMBINING_MMIO 0x10L +#define HAL_PLATFORM_ACPI_TABLES_CACHED 0x20L + +#if defined(_WIN64) + +#ifndef USE_DMA_MACROS +#define USE_DMA_MACROS +#endif + +#ifndef NO_LEGACY_DRIVERS +#define NO_LEGACY_DRIVERS +#endif + +#endif /* defined(_WIN64) */ + +typedef enum _PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR_TYPE { + ResourceTypeSingle = 0, + ResourceTypeRange, + ResourceTypeExtendedCounterConfiguration, + ResourceTypeOverflow, + ResourceTypeMax +} PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR_TYPE; + +typedef struct _PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR { + PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR_TYPE Type; + ULONG Flags; + union { + ULONG CounterIndex; + ULONG ExtendedRegisterAddress; + struct { + ULONG Begin; + ULONG End; + } Range; + } u; +} PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR, *PPHYSICAL_COUNTER_RESOURCE_DESCRIPTOR; + +typedef struct _PHYSICAL_COUNTER_RESOURCE_LIST { + ULONG Count; + PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR Descriptors[ANYSIZE_ARRAY]; +} PHYSICAL_COUNTER_RESOURCE_LIST, *PPHYSICAL_COUNTER_RESOURCE_LIST; + +/* Hardware Abstraction Layer Functions */ + +NTSTATUS +NTAPI +HalAllocateHardwareCounters( + IN PGROUP_AFFINITY GroupAffinty, + IN ULONG GroupCount, + IN PPHYSICAL_COUNTER_RESOURCE_LIST ResourceList, + OUT PHANDLE CounterSetHandle); + +NTSTATUS +NTAPI +HalFreeHardwareCounters( + IN HANDLE CounterSetHandle); + +#if !defined(NO_LEGACY_DRIVERS) + +#if (NTDDI_VERSION >= NTDDI_WIN2K) + +NTHALAPI +NTSTATUS +NTAPI +HalAssignSlotResources( + IN PUNICODE_STRING RegistryPath, + IN PUNICODE_STRING DriverClassName, + IN PDRIVER_OBJECT DriverObject, + IN PDEVICE_OBJECT DeviceObject, + IN INTERFACE_TYPE BusType, + IN ULONG BusNumber, + IN ULONG SlotNumber, + IN OUT PCM_RESOURCE_LIST *AllocatedResources); + +NTHALAPI +ULONG +NTAPI +HalGetInterruptVector( + IN INTERFACE_TYPE InterfaceType, + IN ULONG BusNumber, + IN ULONG BusInterruptLevel, + IN ULONG BusInterruptVector, + OUT PKIRQL Irql, + OUT PKAFFINITY Affinity); + +NTHALAPI +ULONG +NTAPI +HalSetBusData( + IN BUS_DATA_TYPE BusDataType, + IN ULONG BusNumber, + IN ULONG SlotNumber, + IN PVOID Buffer, + IN ULONG Length); + +NTHALAPI +ULONG +NTAPI +HalGetBusData( + IN BUS_DATA_TYPE BusDataType, + IN ULONG BusNumber, + IN ULONG SlotNumber, + OUT PVOID Buffer, + IN ULONG Length); + +NTHALAPI +BOOLEAN +NTAPI +HalMakeBeep( + IN ULONG Frequency); + +#endif + +#endif /* !defined(NO_LEGACY_DRIVERS) */ + +#if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_) +// nothing here +#else + +#if (NTDDI_VERSION >= NTDDI_WIN2K) +//DECLSPEC_DEPRECATED_DDK +NTHALAPI +VOID +NTAPI +IoFreeAdapterChannel( + IN PADAPTER_OBJECT AdapterObject); + +//DECLSPEC_DEPRECATED_DDK +NTHALAPI +BOOLEAN +NTAPI +IoFlushAdapterBuffers( + IN PADAPTER_OBJECT AdapterObject, + IN PMDL Mdl, + IN PVOID MapRegisterBase, + IN PVOID CurrentVa, + IN ULONG Length, + IN BOOLEAN WriteToDevice); + +//DECLSPEC_DEPRECATED_DDK +NTHALAPI +VOID +NTAPI +IoFreeMapRegisters( + IN PADAPTER_OBJECT AdapterObject, + IN PVOID MapRegisterBase, + IN ULONG NumberOfMapRegisters); + +//DECLSPEC_DEPRECATED_DDK +NTHALAPI +PVOID +NTAPI +HalAllocateCommonBuffer( + IN PADAPTER_OBJECT AdapterObject, + IN ULONG Length, + OUT PPHYSICAL_ADDRESS LogicalAddress, + IN BOOLEAN CacheEnabled); + +//DECLSPEC_DEPRECATED_DDK +NTHALAPI +VOID +NTAPI +HalFreeCommonBuffer( + IN PADAPTER_OBJECT AdapterObject, + IN ULONG Length, + IN PHYSICAL_ADDRESS LogicalAddress, + IN PVOID VirtualAddress, + IN BOOLEAN CacheEnabled); + +//DECLSPEC_DEPRECATED_DDK +NTHALAPI +ULONG +NTAPI +HalReadDmaCounter( + IN PADAPTER_OBJECT AdapterObject); + +NTHALAPI +NTSTATUS +NTAPI +HalAllocateAdapterChannel( + IN PADAPTER_OBJECT AdapterObject, + IN PWAIT_CONTEXT_BLOCK Wcb, + IN ULONG NumberOfMapRegisters, + IN PDRIVER_CONTROL ExecutionRoutine); + +#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ + +#endif /* defined(USE_DMA_MACROS) && !defined(_NTHAL_) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_) */ + +#if (NTDDI_VERSION >= NTDDI_WIN2K) + +NTHALAPI +PADAPTER_OBJECT +NTAPI +HalGetAdapter( + IN PDEVICE_DESCRIPTION DeviceDescription, + OUT PULONG NumberOfMapRegisters); + +VOID +NTAPI +HalPutDmaAdapter( + IN PADAPTER_OBJECT DmaAdapter); + +NTHALAPI +VOID +NTAPI +HalAcquireDisplayOwnership( + IN PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters); + +NTHALAPI +ULONG +NTAPI +HalGetBusDataByOffset( + IN BUS_DATA_TYPE BusDataType, + IN ULONG BusNumber, + IN ULONG SlotNumber, + OUT PVOID Buffer, + IN ULONG Offset, + IN ULONG Length); + +NTHALAPI +ULONG +NTAPI +HalSetBusDataByOffset( + IN BUS_DATA_TYPE BusDataType, + IN ULONG BusNumber, + IN ULONG SlotNumber, + IN PVOID Buffer, + IN ULONG Offset, + IN ULONG Length); + +NTHALAPI +BOOLEAN +NTAPI +HalTranslateBusAddress( + IN INTERFACE_TYPE InterfaceType, + IN ULONG BusNumber, + IN PHYSICAL_ADDRESS BusAddress, + IN OUT PULONG AddressSpace, + OUT PPHYSICAL_ADDRESS TranslatedAddress); + +NTHALAPI +PVOID +NTAPI +HalAllocateCrashDumpRegisters( + IN PADAPTER_OBJECT AdapterObject, + IN OUT PULONG NumberOfMapRegisters); + +NTSTATUS +NTAPI +HalGetScatterGatherList( + IN PADAPTER_OBJECT DmaAdapter, + IN PDEVICE_OBJECT DeviceObject, + IN PMDL Mdl, + IN PVOID CurrentVa, + IN ULONG Length, + IN PDRIVER_LIST_CONTROL ExecutionRoutine, + IN PVOID Context, + IN BOOLEAN WriteToDevice); + +VOID +NTAPI +HalPutScatterGatherList( + IN PADAPTER_OBJECT DmaAdapter, + IN PSCATTER_GATHER_LIST ScatterGather, + IN BOOLEAN WriteToDevice); + +#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ + +#if (NTDDI_VERSION >= NTDDI_WINXP) +NTKERNELAPI +VOID +FASTCALL +HalExamineMBR( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN ULONG MBRTypeIdentifier, + OUT PVOID *Buffer); +#endif + +#if defined(_IA64_) +#if (NTDDI_VERSION >= NTDDI_WIN2K) +NTHALAPI +ULONG +NTAPI +HalGetDmaAlignmentRequirement(VOID); +#endif +#endif /* defined(_IA64_) */ + +#if defined(_M_IX86) || defined(_M_AMD64) +#define HalGetDmaAlignmentRequirement() 1L +#endif + +#if (NTDDI_VERSION >= NTDDI_WIN7) + +typedef struct _WHEA_ERROR_SOURCE_DESCRIPTOR *PWHEA_ERROR_SOURCE_DESCRIPTOR; +typedef struct _WHEA_ERROR_RECORD *PWHEA_ERROR_RECORD; + +NTHALAPI +VOID +NTAPI +HalBugCheckSystem( + IN PWHEA_ERROR_SOURCE_DESCRIPTOR ErrorSource, + IN PWHEA_ERROR_RECORD ErrorRecord); + +#else + +typedef struct _WHEA_ERROR_RECORD *PWHEA_ERROR_RECORD; + +NTHALAPI +VOID +NTAPI +HalBugCheckSystem( + IN PWHEA_ERROR_RECORD ErrorRecord); + +#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */ + +struct _LOADER_PARAMETER_BLOCK; +struct _CREATE_DISK; +struct _DRIVE_LAYOUT_INFORMATION_EX; +struct _SET_PARTITION_INFORMATION_EX; + +// +// GUID and UUID +// +#ifndef GUID_DEFINED +#include <guiddef.h> +#endif + +typedef struct _MAP_REGISTER_ENTRY { + PVOID MapRegister; + BOOLEAN WriteToDevice; +} MAP_REGISTER_ENTRY, *PMAP_REGISTER_ENTRY; + +typedef BOOLEAN +(NTAPI *pHalTranslateBusAddress)( + IN INTERFACE_TYPE InterfaceType, + IN ULONG BusNumber, + IN PHYSICAL_ADDRESS BusAddress, + IN OUT PULONG AddressSpace, + OUT PPHYSICAL_ADDRESS TranslatedAddress); + +typedef NTSTATUS +(NTAPI *pHalAssignSlotResources)( + IN PUNICODE_STRING RegistryPath, + IN PUNICODE_STRING DriverClassName OPTIONAL, + IN PDRIVER_OBJECT DriverObject, + IN PDEVICE_OBJECT DeviceObject, + IN INTERFACE_TYPE BusType, + IN ULONG BusNumber, + IN ULONG SlotNumber, + IN OUT PCM_RESOURCE_LIST *AllocatedResources); + +typedef VOID +(NTAPI *pHalHaltSystem)( + VOID); + +typedef BOOLEAN +(NTAPI *pHalResetDisplay)( + VOID); + +typedef UCHAR +(NTAPI *pHalVectorToIDTEntry)( + ULONG Vector); + +typedef BOOLEAN +(NTAPI *pHalFindBusAddressTranslation)( + IN PHYSICAL_ADDRESS BusAddress, + IN OUT PULONG AddressSpace, + OUT PPHYSICAL_ADDRESS TranslatedAddress, + IN OUT PULONG_PTR Context, + IN BOOLEAN NextBus); + +#if 1 /* Not present in WDK 7600 */ +typedef VOID +(FASTCALL *pHalIoAssignDriveLetters)( + IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock, + IN PSTRING NtDeviceName, + OUT PUCHAR NtSystemPath, + OUT PSTRING NtSystemPathString); +#endif extern NTKERNELAPI PVOID MmHighestUserAddress; extern NTKERNELAPI PVOID MmSystemRangeStart; @@ -4415,196 +4938,6 @@ PVOID Reserved[4]; } PCIBUSDATA, *PPCIBUSDATA; -/* Hardware Abstraction Layer Functions */ - -#if !defined(NO_LEGACY_DRIVERS) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -NTHALAPI -NTSTATUS -NTAPI -HalAssignSlotResources( - IN PUNICODE_STRING RegistryPath, - IN PUNICODE_STRING DriverClassName, - IN PDRIVER_OBJECT DriverObject, - IN PDEVICE_OBJECT DeviceObject, - IN INTERFACE_TYPE BusType, - IN ULONG BusNumber, - IN ULONG SlotNumber, - IN OUT PCM_RESOURCE_LIST *AllocatedResources); - -NTHALAPI -ULONG -NTAPI -HalGetInterruptVector( - IN INTERFACE_TYPE InterfaceType, - IN ULONG BusNumber, - IN ULONG BusInterruptLevel, - IN ULONG BusInterruptVector, - OUT PKIRQL Irql, - OUT PKAFFINITY Affinity); - -NTHALAPI -ULONG -NTAPI -HalSetBusData( - IN BUS_DATA_TYPE BusDataType, - IN ULONG BusNumber, - IN ULONG SlotNumber, - IN PVOID Buffer, - IN ULONG Length); - -#endif - -#endif /* !defined(NO_LEGACY_DRIVERS) */ - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -NTHALAPI -PADAPTER_OBJECT -NTAPI -HalGetAdapter( - IN PDEVICE_DESCRIPTION DeviceDescription, - IN OUT PULONG NumberOfMapRegisters); - -NTHALAPI -BOOLEAN -NTAPI -HalMakeBeep( - IN ULONG Frequency); - -VOID -NTAPI -HalPutDmaAdapter( - IN PADAPTER_OBJECT DmaAdapter); - -NTHALAPI -VOID -NTAPI -HalAcquireDisplayOwnership( - IN PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters); - -NTHALAPI -ULONG -NTAPI -HalGetBusData( - IN BUS_DATA_TYPE BusDataType, - IN ULONG BusNumber, - IN ULONG SlotNumber, - OUT PVOID Buffer, - IN ULONG Length); - -NTHALAPI -ULONG -NTAPI -HalGetBusDataByOffset( - IN BUS_DATA_TYPE BusDataType, - IN ULONG BusNumber, - IN ULONG SlotNumber, - OUT PVOID Buffer, - IN ULONG Offset, - IN ULONG Length); - -NTHALAPI -ULONG -NTAPI -HalSetBusDataByOffset( - IN BUS_DATA_TYPE BusDataType, - IN ULONG BusNumber, - IN ULONG SlotNumber, - IN PVOID Buffer, - IN ULONG Offset, - IN ULONG Length); - -NTHALAPI -BOOLEAN -NTAPI -HalTranslateBusAddress( - IN INTERFACE_TYPE InterfaceType, - IN ULONG BusNumber, - IN PHYSICAL_ADDRESS BusAddress, - IN OUT PULONG AddressSpace, - OUT PPHYSICAL_ADDRESS TranslatedAddress); - -#endif - -#if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_) -// nothing here -#else - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -//DECLSPEC_DEPRECATED_DDK -NTHALAPI -VOID -NTAPI -IoFreeAdapterChannel( - IN PADAPTER_OBJECT AdapterObject); - -//DECLSPEC_DEPRECATED_DDK -NTHALAPI -BOOLEAN -NTAPI -IoFlushAdapterBuffers( - IN PADAPTER_OBJECT AdapterObject, - IN PMDL Mdl, - IN PVOID MapRegisterBase, - IN PVOID CurrentVa, - IN ULONG Length, - IN BOOLEAN WriteToDevice); - -//DECLSPEC_DEPRECATED_DDK -NTHALAPI -VOID -NTAPI -IoFreeMapRegisters( - IN PADAPTER_OBJECT AdapterObject, - IN PVOID MapRegisterBase, - IN ULONG NumberOfMapRegisters); - -//DECLSPEC_DEPRECATED_DDK -NTHALAPI -PVOID -NTAPI -HalAllocateCommonBuffer( - IN PADAPTER_OBJECT AdapterObject, - IN ULONG Length, - OUT PPHYSICAL_ADDRESS LogicalAddress, - IN BOOLEAN CacheEnabled); - -//DECLSPEC_DEPRECATED_DDK -NTHALAPI -VOID -NTAPI -HalFreeCommonBuffer( - IN PADAPTER_OBJECT AdapterObject, - IN ULONG Length, - IN PHYSICAL_ADDRESS LogicalAddress, - IN PVOID VirtualAddress, - IN BOOLEAN CacheEnabled); - -//DECLSPEC_DEPRECATED_DDK -NTHALAPI -ULONG -NTAPI -HalReadDmaCounter( - IN PADAPTER_OBJECT AdapterObject); - -NTHALAPI -NTSTATUS -NTAPI -HalAllocateAdapterChannel( - IN PADAPTER_OBJECT AdapterObject, - IN PWAIT_CONTEXT_BLOCK Wcb, - IN ULONG NumberOfMapRegisters, - IN PDRIVER_CONTROL ExecutionRoutine); - -#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ - -#endif /* defined(USE_DMA_MACROS) && !defined(_NTHAL_) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_) */ - -/** Process manager routines **/ - /* ZwXxx Functions */ #if (NTDDI_VERSION >= NTDDI_WIN2K)
14 years, 9 months
1
0
0
0
[cwittich] 46254: try to fix valgrind warnings
by cwittich@svn.reactos.org
Author: cwittich Date: Wed Mar 17 22:59:22 2010 New Revision: 46254 URL:
http://svn.reactos.org/svn/reactos?rev=46254&view=rev
Log: try to fix valgrind warnings Modified: trunk/tools/sysreg2/console.c Modified: trunk/tools/sysreg2/console.c URL:
http://svn.reactos.org/svn/reactos/trunk/tools/sysreg2/console.c?rev=46254&…
============================================================================== --- trunk/tools/sysreg2/console.c [iso-8859-1] (original) +++ trunk/tools/sysreg2/console.c [iso-8859-1] Wed Mar 17 22:59:22 2010 @@ -25,7 +25,8 @@ /* Initialize CacheBuffer with an empty string */ *CacheBuffer = 0; - + memset(Buffer, 0, BUFFER_SIZE); + /* ttyfd is the file descriptor of the virtual COM port */ if ((ttyfd = open(tty, O_NOCTTY | O_RDWR)) < 0) {
14 years, 9 months
1
0
0
0
[tkreuzer] 46253: [NTOS] Add DPRINTs to tell if SYSENTER is detected. Requested by Christoph for testing the test machine.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Mar 17 22:26:04 2010 New Revision: 46253 URL:
http://svn.reactos.org/svn/reactos?rev=46253&view=rev
Log: [NTOS] Add DPRINTs to tell if SYSENTER is detected. Requested by Christoph for testing the test machine. Modified: trunk/reactos/ntoskrnl/ke/i386/cpu.c Modified: trunk/reactos/ntoskrnl/ke/i386/cpu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/cpu.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/cpu.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/i386/cpu.c [iso-8859-1] Wed Mar 17 22:26:04 2010 @@ -1010,18 +1010,21 @@ /* It's enabled, so use the proper exit stub */ KiFastCallExitHandler = KiSystemCallSysExitReturn; + DPRINT1("Support for SYSENTER detected.\n"); } else { /* Disable fast system call */ KeFeatureBits &= ~KF_FAST_SYSCALL; KiFastCallExitHandler = KiSystemCallTrapReturn; + DPRINT1("Support for SYSENTER disabled.\n"); } } else { /* Use the IRET handler */ KiFastCallExitHandler = KiSystemCallTrapReturn; + DPRINT1("No support for SYSENTER detected.\n"); } }
14 years, 9 months
1
0
0
0
[akhaldi] 46252: [NTDDK] - Group related definitions. - Update ARBITER_PARAMETERS. - Add PS_CREATE_NOTIFY_INFO, PCREATE_PROCESS_NOTIFY_ROUTINE_EX, IMAGE_INFO_EX, TXN_PARAMETER_BLOCK, TXF_MINIVERSION_DEFAULT_VIEW, AGP_TARGET_BUS_INTERFACE_STANDARD, PNP_LOCATION_INTERFACE, and several missing Ps*, IO_*, DO_*, ARBITER_* and Io*. - IMAGE_INFO : ULONG Reserved:22 -> ULONG Reserved:21.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Mar 17 17:25:03 2010 New Revision: 46252 URL:
http://svn.reactos.org/svn/reactos?rev=46252&view=rev
Log: [NTDDK] - Group related definitions. - Update ARBITER_PARAMETERS. - Add PS_CREATE_NOTIFY_INFO, PCREATE_PROCESS_NOTIFY_ROUTINE_EX, IMAGE_INFO_EX, TXN_PARAMETER_BLOCK, TXF_MINIVERSION_DEFAULT_VIEW, AGP_TARGET_BUS_INTERFACE_STANDARD, PNP_LOCATION_INTERFACE, and several missing Ps*, IO_*, DO_*, ARBITER_* and Io*. - IMAGE_INFO : ULONG Reserved:22 -> ULONG Reserved:21. Modified: branches/header-work/include/ddk/ntddk.h Modified: branches/header-work/include/ddk/ntddk.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/ntddk.h…
============================================================================== --- branches/header-work/include/ddk/ntddk.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/ntddk.h [iso-8859-1] Wed Mar 17 17:25:03 2010 @@ -2779,17 +2779,200 @@ IN KPROCESSOR_MODE PreviousMode); #endif -struct _LOADER_PARAMETER_BLOCK; -struct _CREATE_DISK; -struct _DRIVE_LAYOUT_INFORMATION_EX; -struct _SET_PARTITION_INFORMATION_EX; - -// -// GUID and UUID -// -#ifndef GUID_DEFINED -#include <guiddef.h> -#endif +extern NTKERNELAPI PEPROCESS PsInitialSystemProcess; + +#if !defined(_PSGETCURRENTTHREAD_) +#define _PSGETCURRENTTHREAD_ + +FORCEINLINE +PETHREAD +NTAPI +PsGetCurrentThread(VOID) +{ + return (PETHREAD)KeGetCurrentThread(); +} + +#endif + +/** Process Manager types **/ + +typedef VOID +(NTAPI *PCREATE_PROCESS_NOTIFY_ROUTINE)( + IN HANDLE ParentId, + IN HANDLE ProcessId, + IN BOOLEAN Create); + +typedef struct _PS_CREATE_NOTIFY_INFO { + IN SIZE_T Size; + union { + IN ULONG Flags; + struct { + IN ULONG FileOpenNameAvailable:1; + IN ULONG Reserved:31; + }; + }; + IN HANDLE ParentProcessId; + IN CLIENT_ID CreatingThreadId; + IN OUT struct _FILE_OBJECT *FileObject; + IN PCUNICODE_STRING ImageFileName; + IN PCUNICODE_STRING CommandLine OPTIONAL; + IN OUT NTSTATUS CreationStatus; +} PS_CREATE_NOTIFY_INFO, *PPS_CREATE_NOTIFY_INFO; + +typedef VOID +(NTAPI *PCREATE_PROCESS_NOTIFY_ROUTINE_EX)( + IN OUT PEPROCESS Process, + IN HANDLE ProcessId, + IN PPS_CREATE_NOTIFY_INFO CreateInfo OPTIONAL); + +typedef VOID +(NTAPI *PCREATE_THREAD_NOTIFY_ROUTINE)( + IN HANDLE ProcessId, + IN HANDLE ThreadId, + IN BOOLEAN Create); + +#define IMAGE_ADDRESSING_MODE_32BIT 3 + +typedef struct _IMAGE_INFO { + _ANONYMOUS_UNION union { + ULONG Properties; + _ANONYMOUS_STRUCT struct { + ULONG ImageAddressingMode:8; + ULONG SystemModeImage:1; + ULONG ImageMappedToAllPids:1; + ULONG ExtendedInfoPresent:1; + ULONG Reserved:21; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + PVOID ImageBase; + ULONG ImageSelector; + SIZE_T ImageSize; + ULONG ImageSectionNumber; +} IMAGE_INFO, *PIMAGE_INFO; + +typedef struct _IMAGE_INFO_EX { + SIZE_T Size; + IMAGE_INFO ImageInfo; + struct _FILE_OBJECT *FileObject; +} IMAGE_INFO_EX, *PIMAGE_INFO_EX; + +typedef VOID +(NTAPI *PLOAD_IMAGE_NOTIFY_ROUTINE)( + IN PUNICODE_STRING FullImageName, + IN HANDLE ProcessId, + IN PIMAGE_INFO ImageInfo); + +/** Process Manager functions **/ + +#if (NTDDI_VERSION >= NTDDI_WIN2K) + +NTKERNELAPI +NTSTATUS +NTAPI +PsSetCreateProcessNotifyRoutine( + IN PCREATE_PROCESS_NOTIFY_ROUTINE NotifyRoutine, + IN BOOLEAN Remove); + +NTKERNELAPI +NTSTATUS +NTAPI +PsSetCreateThreadNotifyRoutine( + IN PCREATE_THREAD_NOTIFY_ROUTINE NotifyRoutine); + +NTKERNELAPI +NTSTATUS +NTAPI +PsSetLoadImageNotifyRoutine( + IN PLOAD_IMAGE_NOTIFY_ROUTINE NotifyRoutine); + +NTKERNELAPI +HANDLE +NTAPI +PsGetCurrentProcessId(VOID); + +NTKERNELAPI +HANDLE +NTAPI +PsGetCurrentThreadId(VOID); + +NTKERNELAPI +BOOLEAN +NTAPI +PsGetVersion( + OUT PULONG MajorVersion OPTIONAL, + OUT PULONG MinorVersion OPTIONAL, + OUT PULONG BuildNumber OPTIONAL, + OUT PUNICODE_STRING CSDVersion OPTIONAL); + +#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ + +#if (NTDDI_VERSION >= NTDDI_WINXP) + +NTKERNELAPI +HANDLE +NTAPI +PsGetProcessId( + IN PEPROCESS Process); + +NTKERNELAPI +HANDLE +NTAPI +PsGetThreadId( + IN PETHREAD Thread); + +NTKERNELAPI +NTSTATUS +NTAPI +PsRemoveCreateThreadNotifyRoutine( + IN PCREATE_THREAD_NOTIFY_ROUTINE NotifyRoutine); + +NTKERNELAPI +NTSTATUS +NTAPI +PsRemoveLoadImageNotifyRoutine( + IN PLOAD_IMAGE_NOTIFY_ROUTINE NotifyRoutine); + +NTKERNELAPI +LONGLONG +NTAPI +PsGetProcessCreateTimeQuadPart( + IN PEPROCESS Process); + +#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ + +#if (NTDDI_VERSION >= NTDDI_WS03) +NTKERNELAPI +HANDLE +NTAPI +PsGetThreadProcessId( + IN PETHREAD Thread); +#endif + +#if (NTDDI_VERSION >= NTDDI_VISTA) + +NTKERNELAPI +BOOLEAN +NTAPI +PsSetCurrentThreadPrefetching( + IN BOOLEAN Prefetching); + +NTKERNELAPI +BOOLEAN +NTAPI +PsIsCurrentThreadPrefetching(VOID); + +#endif + +#if (NTDDI_VERSION >= NTDDI_VISTASP1) +NTKERNELAPI +NTSTATUS +NTAPI +PsSetCreateProcessNotifyRoutineEx( + IN PCREATE_PROCESS_NOTIFY_ROUTINE_EX NotifyRoutine, + IN BOOLEAN Remove); +#endif + +/* I/O Manager Types */ /* ** IRP function codes @@ -2824,12 +3007,63 @@ #define IRP_MN_QUERY_LEGACY_BUS_INFORMATION 0x18 +#define IO_CHECK_CREATE_PARAMETERS 0x0200 +#define IO_ATTACH_DEVICE 0x0400 +#define IO_IGNORE_SHARE_ACCESS_CHECK 0x0800 + +typedef +NTSTATUS +(NTAPI *PIO_QUERY_DEVICE_ROUTINE)( + IN PVOID Context, + IN PUNICODE_STRING PathName, + IN INTERFACE_TYPE BusType, + IN ULONG BusNumber, + IN PKEY_VALUE_FULL_INFORMATION *BusInformation, + IN CONFIGURATION_TYPE ControllerType, + IN ULONG ControllerNumber, + IN PKEY_VALUE_FULL_INFORMATION *ControllerInformation, + IN CONFIGURATION_TYPE PeripheralType, + IN ULONG PeripheralNumber, + IN PKEY_VALUE_FULL_INFORMATION *PeripheralInformation); + +typedef enum _IO_QUERY_DEVICE_DATA_FORMAT { + IoQueryDeviceIdentifier = 0, + IoQueryDeviceConfigurationData, + IoQueryDeviceComponentInformation, + IoQueryDeviceMaxData +} IO_QUERY_DEVICE_DATA_FORMAT, *PIO_QUERY_DEVICE_DATA_FORMAT; + +typedef VOID +(NTAPI *PDRIVER_REINITIALIZE)( + IN struct _DRIVER_OBJECT *DriverObject, + IN PVOID Context OPTIONAL, + IN ULONG Count); + +typedef struct _CONTROLLER_OBJECT { + CSHORT Type; + CSHORT Size; + PVOID ControllerExtension; + KDEVICE_QUEUE DeviceWaitQueue; + ULONG Spare1; + LARGE_INTEGER Spare2; +} CONTROLLER_OBJECT, *PCONTROLLER_OBJECT; + /* DEVICE_OBJECT.Flags */ +#define DO_VERIFY_VOLUME 0x00000002 +#define DO_BUFFERED_IO 0x00000004 +#define DO_EXCLUSIVE 0x00000008 +#define DO_DIRECT_IO 0x00000010 +#define DO_MAP_IO_BUFFER 0x00000020 #define DO_DEVICE_HAS_NAME 0x00000040 +#define DO_DEVICE_INITIALIZING 0x00000080 #define DO_SYSTEM_BOOT_PARTITION 0x00000100 #define DO_LONG_TERM_REQUESTS 0x00000200 #define DO_NEVER_LAST_DEVICE 0x00000400 +#define DO_SHUTDOWN_REGISTERED 0x00000800 +#define DO_BUS_ENUMERATED_DEVICE 0x00001000 +#define DO_POWER_PAGABLE 0x00002000 +#define DO_POWER_INRUSH 0x00004000 #define DO_LOW_PRIORITY_FILESYSTEM 0x00010000 #define DO_SUPPORTS_TRANSACTIONS 0x00040000 #define DO_FORCE_NEITHER_IO 0x00080000 @@ -2843,21 +3077,72 @@ #define DRVO_BOOTREINIT_REGISTERED 0x00000020 #define DRVO_LEGACY_RESOURCES 0x00000040 -typedef enum _ARBITER_REQUEST_SOURCE { - ArbiterRequestUndefined = -1, - ArbiterRequestLegacyReported, - ArbiterRequestHalReported, - ArbiterRequestLegacyAssigned, - ArbiterRequestPnpDetected, - ArbiterRequestPnpEnumerated -} ARBITER_REQUEST_SOURCE; - -typedef enum _ARBITER_RESULT { - ArbiterResultUndefined = -1, - ArbiterResultSuccess, - ArbiterResultExternalConflict, - ArbiterResultNullRequest -} ARBITER_RESULT; +typedef struct _CONFIGURATION_INFORMATION { + ULONG DiskCount; + ULONG FloppyCount; + ULONG CdRomCount; + ULONG TapeCount; + ULONG ScsiPortCount; + ULONG SerialCount; + ULONG ParallelCount; + BOOLEAN AtDiskPrimaryAddressClaimed; + BOOLEAN AtDiskSecondaryAddressClaimed; + ULONG Version; + ULONG MediumChangerCount; +} CONFIGURATION_INFORMATION, *PCONFIGURATION_INFORMATION; + +typedef struct _DISK_SIGNATURE { + ULONG PartitionStyle; + _ANONYMOUS_UNION union { + struct { + ULONG Signature; + ULONG CheckSum; + } Mbr; + struct { + GUID DiskId; + } Gpt; + } DUMMYUNIONNAME; +} DISK_SIGNATURE, *PDISK_SIGNATURE; + +typedef struct _TXN_PARAMETER_BLOCK { + USHORT Length; + USHORT TxFsContext; + PVOID TransactionObject; +} TXN_PARAMETER_BLOCK, *PTXN_PARAMETER_BLOCK; + +#define TXF_MINIVERSION_DEFAULT_VIEW (0xFFFE) + +typedef struct _IO_DRIVER_CREATE_CONTEXT { + CSHORT Size; + struct _ECP_LIST *ExtraCreateParameter; + PVOID DeviceObjectHint; + PTXN_PARAMETER_BLOCK TxnParameters; +} IO_DRIVER_CREATE_CONTEXT, *PIO_DRIVER_CREATE_CONTEXT; + +typedef struct _AGP_TARGET_BUS_INTERFACE_STANDARD { + USHORT Size; + USHORT Version; + PVOID Context; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PGET_SET_DEVICE_DATA SetBusData; + PGET_SET_DEVICE_DATA GetBusData; + UCHAR CapabilityID; +} AGP_TARGET_BUS_INTERFACE_STANDARD, *PAGP_TARGET_BUS_INTERFACE_STANDARD; + +typedef NTSTATUS +(NTAPI *PGET_LOCATION_STRING)( + IN OUT PVOID Context OPTIONAL, + OUT PWCHAR *LocationStrings); + +typedef struct _PNP_LOCATION_INTERFACE { + USHORT Size; + USHORT Version; + PVOID Context; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PGET_LOCATION_STRING GetLocationString; +} PNP_LOCATION_INTERFACE, *PPNP_LOCATION_INTERFACE; typedef enum _ARBITER_ACTION { ArbiterActionTestAllocation, @@ -2878,38 +3163,68 @@ ULONGLONG End; } ARBITER_CONFLICT_INFO, *PARBITER_CONFLICT_INFO; +typedef struct _ARBITER_TEST_ALLOCATION_PARAMETERS { + IN OUT PLIST_ENTRY ArbitrationList; + IN ULONG AllocateFromCount; + IN PCM_PARTIAL_RESOURCE_DESCRIPTOR AllocateFrom; +} ARBITER_TEST_ALLOCATION_PARAMETERS, *PARBITER_TEST_ALLOCATION_PARAMETERS; + +typedef struct _ARBITER_RETEST_ALLOCATION_PARAMETERS { + IN OUT PLIST_ENTRY ArbitrationList; + IN ULONG AllocateFromCount; + IN PCM_PARTIAL_RESOURCE_DESCRIPTOR AllocateFrom; +} ARBITER_RETEST_ALLOCATION_PARAMETERS, *PARBITER_RETEST_ALLOCATION_PARAMETERS; + +typedef struct _ARBITER_BOOT_ALLOCATION_PARAMETERS { + IN OUT PLIST_ENTRY ArbitrationList; +} ARBITER_BOOT_ALLOCATION_PARAMETERS, *PARBITER_BOOT_ALLOCATION_PARAMETERS; + +typedef struct _ARBITER_QUERY_ALLOCATED_RESOURCES_PARAMETERS { + OUT PCM_PARTIAL_RESOURCE_LIST *AllocatedResources; +} ARBITER_QUERY_ALLOCATED_RESOURCES_PARAMETERS, *PARBITER_QUERY_ALLOCATED_RESOURCES_PARAMETERS; + +typedef struct _ARBITER_QUERY_CONFLICT_PARAMETERS { + IN PDEVICE_OBJECT PhysicalDeviceObject; + IN PIO_RESOURCE_DESCRIPTOR ConflictingResource; + OUT PULONG ConflictCount; + OUT PARBITER_CONFLICT_INFO *Conflicts; +} ARBITER_QUERY_CONFLICT_PARAMETERS, *PARBITER_QUERY_CONFLICT_PARAMETERS; + +typedef struct _ARBITER_QUERY_ARBITRATE_PARAMETERS { + IN PLIST_ENTRY ArbitrationList; +} ARBITER_QUERY_ARBITRATE_PARAMETERS, *PARBITER_QUERY_ARBITRATE_PARAMETERS; + +typedef struct _ARBITER_ADD_RESERVED_PARAMETERS { + IN PDEVICE_OBJECT ReserveDevice; +} ARBITER_ADD_RESERVED_PARAMETERS, *PARBITER_ADD_RESERVED_PARAMETERS; + typedef struct _ARBITER_PARAMETERS { union { - struct { - IN OUT PLIST_ENTRY ArbitrationList; - IN ULONG AllocateFromCount; - IN PCM_PARTIAL_RESOURCE_DESCRIPTOR AllocateFrom; - } TestAllocation; - struct { - IN OUT PLIST_ENTRY ArbitrationList; - IN ULONG AllocateFromCount; - IN PCM_PARTIAL_RESOURCE_DESCRIPTOR AllocateFrom; - } RetestAllocation; - struct { - IN OUT PLIST_ENTRY ArbitrationList; - } BootAllocation; - struct { - OUT PCM_PARTIAL_RESOURCE_LIST *AllocatedResources; - } QueryAllocatedResources; - struct { - IN PDEVICE_OBJECT PhysicalDeviceObject; - IN PIO_RESOURCE_DESCRIPTOR ConflictingResource; - OUT PULONG ConflictCount; - OUT PARBITER_CONFLICT_INFO *Conflicts; - } QueryConflict; - struct { - IN PLIST_ENTRY ArbitrationList; - } QueryArbitrate; - struct { - IN PDEVICE_OBJECT ReserveDevice; - } AddReserved; + ARBITER_TEST_ALLOCATION_PARAMETERS TestAllocation; + ARBITER_RETEST_ALLOCATION_PARAMETERS RetestAllocation; + ARBITER_BOOT_ALLOCATION_PARAMETERS BootAllocation; + ARBITER_QUERY_ALLOCATED_RESOURCES_PARAMETERS QueryAllocatedResources; + ARBITER_QUERY_CONFLICT_PARAMETERS QueryConflict; + ARBITER_QUERY_ARBITRATE_PARAMETERS QueryArbitrate; + ARBITER_ADD_RESERVED_PARAMETERS AddReserved; } Parameters; } ARBITER_PARAMETERS, *PARBITER_PARAMETERS; + +typedef enum _ARBITER_REQUEST_SOURCE { + ArbiterRequestUndefined = -1, + ArbiterRequestLegacyReported, + ArbiterRequestHalReported, + ArbiterRequestLegacyAssigned, + ArbiterRequestPnpDetected, + ArbiterRequestPnpEnumerated +} ARBITER_REQUEST_SOURCE; + +typedef enum _ARBITER_RESULT { + ArbiterResultUndefined = -1, + ArbiterResultSuccess, + ArbiterResultExternalConflict, + ArbiterResultNullRequest +} ARBITER_RESULT; #define ARBITER_FLAG_BOOT_CONFIG 0x00000001 @@ -2946,6 +3261,510 @@ PARBITER_HANDLER ArbiterHandler; ULONG Flags; } ARBITER_INTERFACE, *PARBITER_INTERFACE; + +typedef enum _RESOURCE_TRANSLATION_DIRECTION { + TranslateChildToParent, + TranslateParentToChild +} RESOURCE_TRANSLATION_DIRECTION; + +typedef NTSTATUS +(NTAPI *PTRANSLATE_RESOURCE_HANDLER)( + IN OUT PVOID Context OPTIONAL, + IN PCM_PARTIAL_RESOURCE_DESCRIPTOR Source, + IN RESOURCE_TRANSLATION_DIRECTION Direction, + IN ULONG AlternativesCount OPTIONAL, + IN IO_RESOURCE_DESCRIPTOR Alternatives[], + IN PDEVICE_OBJECT PhysicalDeviceObject, + OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR Target); + +typedef NTSTATUS +(NTAPI *PTRANSLATE_RESOURCE_REQUIREMENTS_HANDLER)( + IN OUT PVOID Context OPTIONAL, + IN PIO_RESOURCE_DESCRIPTOR Source, + IN PDEVICE_OBJECT PhysicalDeviceObject, + OUT PULONG TargetCount, + OUT PIO_RESOURCE_DESCRIPTOR *Target); + +typedef struct _TRANSLATOR_INTERFACE { + USHORT Size; + USHORT Version; + PVOID Context; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PTRANSLATE_RESOURCE_HANDLER TranslateResources; + PTRANSLATE_RESOURCE_REQUIREMENTS_HANDLER TranslateResourceRequirements; +} TRANSLATOR_INTERFACE, *PTRANSLATOR_INTERFACE; + +/* I/O Manager Functions */ + +/* + * VOID IoAssignArcName( + * IN PUNICODE_STRING ArcName, + * IN PUNICODE_STRING DeviceName); + */ +#define IoAssignArcName(_ArcName, _DeviceName) ( \ + IoCreateSymbolicLink((_ArcName), (_DeviceName))) + +/* + * VOID + * IoDeassignArcName( + * IN PUNICODE_STRING ArcName) + */ +#define IoDeassignArcName IoDeleteSymbolicLink + +VOID +FORCEINLINE +NTAPI +IoInitializeDriverCreateContext( + PIO_DRIVER_CREATE_CONTEXT DriverContext) +{ + RtlZeroMemory(DriverContext, sizeof(IO_DRIVER_CREATE_CONTEXT)); + DriverContext->Size = sizeof(IO_DRIVER_CREATE_CONTEXT); +} + +#if (NTDDI_VERSION >= NTDDI_WIN2K) + +#if !(defined(USE_DMA_MACROS) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_)) +NTKERNELAPI +NTSTATUS +NTAPI +IoAllocateAdapterChannel( + IN PADAPTER_OBJECT AdapterObject, + IN PDEVICE_OBJECT DeviceObject, + IN ULONG NumberOfMapRegisters, + IN PDRIVER_CONTROL ExecutionRoutine, + IN PVOID Context); +#endif + +//DECLSPEC_DEPRECATED_DDK +NTHALAPI +PHYSICAL_ADDRESS +NTAPI +IoMapTransfer( + IN PADAPTER_OBJECT AdapterObject, + IN PMDL Mdl, + IN PVOID MapRegisterBase, + IN PVOID CurrentVa, + IN OUT PULONG Length, + IN BOOLEAN WriteToDevice); + +NTKERNELAPI +VOID +NTAPI +IoAllocateController( + IN PCONTROLLER_OBJECT ControllerObject, + IN PDEVICE_OBJECT DeviceObject, + IN PDRIVER_CONTROL ExecutionRoutine, + IN PVOID Context OPTIONAL); + +NTKERNELAPI +PCONTROLLER_OBJECT +NTAPI +IoCreateController( + IN ULONG Size); + +NTKERNELAPI +VOID +NTAPI +IoDeleteController( + IN PCONTROLLER_OBJECT ControllerObject); + +NTKERNELAPI +VOID +NTAPI +IoFreeController( + IN PCONTROLLER_OBJECT ControllerObject); + +NTKERNELAPI +PCONFIGURATION_INFORMATION +NTAPI +IoGetConfigurationInformation(VOID); + +NTKERNELAPI +PDEVICE_OBJECT +NTAPI +IoGetDeviceToVerify( + IN PETHREAD Thread); + +NTKERNELAPI +VOID +NTAPI +IoCancelFileOpen( + IN PDEVICE_OBJECT DeviceObject, + IN PFILE_OBJECT FileObject); + +NTKERNELAPI +PGENERIC_MAPPING +NTAPI +IoGetFileObjectGenericMapping(VOID); + +NTKERNELAPI +PIRP +NTAPI +IoMakeAssociatedIrp( + IN PIRP Irp, + IN CCHAR StackSize); + +NTKERNELAPI +NTSTATUS +NTAPI +IoQueryDeviceDescription( + IN PINTERFACE_TYPE BusType OPTIONAL, + IN PULONG BusNumber OPTIONAL, + IN PCONFIGURATION_TYPE ControllerType OPTIONAL, + IN PULONG ControllerNumber OPTIONAL, + IN PCONFIGURATION_TYPE PeripheralType OPTIONAL, + IN PULONG PeripheralNumber OPTIONAL, + IN PIO_QUERY_DEVICE_ROUTINE CalloutRoutine, + IN OUT PVOID Context OPTIONAL); + +NTKERNELAPI +VOID +NTAPI +IoRaiseHardError( + IN PIRP Irp, + IN PVPB Vpb OPTIONAL, + IN PDEVICE_OBJECT RealDeviceObject); + +NTKERNELAPI +BOOLEAN +NTAPI +IoRaiseInformationalHardError( + IN NTSTATUS ErrorStatus, + IN PUNICODE_STRING String OPTIONAL, + IN PKTHREAD Thread OPTIONAL); + +NTKERNELAPI +VOID +NTAPI +IoRegisterBootDriverReinitialization( + IN PDRIVER_OBJECT DriverObject, + IN PDRIVER_REINITIALIZE DriverReinitializationRoutine, + IN PVOID Context OPTIONAL); + +NTKERNELAPI +VOID +NTAPI +IoRegisterDriverReinitialization( + IN PDRIVER_OBJECT DriverObject, + IN PDRIVER_REINITIALIZE DriverReinitializationRoutine, + IN PVOID Context OPTIONAL); + +NTKERNELAPI +NTSTATUS +NTAPI +IoAttachDeviceByPointer( + IN PDEVICE_OBJECT SourceDevice, + IN PDEVICE_OBJECT TargetDevice); + +NTKERNELAPI +NTSTATUS +NTAPI +IoReportDetectedDevice( + IN PDRIVER_OBJECT DriverObject, + IN INTERFACE_TYPE LegacyBusType, + IN ULONG BusNumber, + IN ULONG SlotNumber, + IN PCM_RESOURCE_LIST ResourceList OPTIONAL, + IN PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements OPTIONAL, + IN BOOLEAN ResourceAssigned, + IN OUT PDEVICE_OBJECT *DeviceObject OPTIONAL); + +NTKERNELAPI +NTSTATUS +NTAPI +IoReportResourceForDetection( + IN PDRIVER_OBJECT DriverObject, + IN PCM_RESOURCE_LIST DriverList OPTIONAL, + IN ULONG DriverListSize OPTIONAL, + IN PDEVICE_OBJECT DeviceObject OPTIONAL, + IN PCM_RESOURCE_LIST DeviceList OPTIONAL, + IN ULONG DeviceListSize OPTIONAL, + OUT PBOOLEAN ConflictDetected); + +NTKERNELAPI +NTSTATUS +NTAPI +IoReportResourceUsage( + IN PUNICODE_STRING DriverClassName OPTIONAL, + IN PDRIVER_OBJECT DriverObject, + IN PCM_RESOURCE_LIST DriverList OPTIONAL, + IN ULONG DriverListSize OPTIONAL, + IN PDEVICE_OBJECT DeviceObject, + IN PCM_RESOURCE_LIST DeviceList OPTIONAL, + IN ULONG DeviceListSize OPTIONAL, + IN BOOLEAN OverrideConflict, + OUT PBOOLEAN ConflictDetected); + +NTKERNELAPI +VOID +NTAPI +IoSetHardErrorOrVerifyDevice( + IN PIRP Irp, + IN PDEVICE_OBJECT DeviceObject); + +NTKERNELAPI +NTSTATUS +NTAPI +IoAssignResources( + IN PUNICODE_STRING RegistryPath, + IN PUNICODE_STRING DriverClassName OPTIONAL, + IN PDRIVER_OBJECT DriverObject, + IN PDEVICE_OBJECT DeviceObject OPTIONAL, + IN PIO_RESOURCE_REQUIREMENTS_LIST RequestedResources OPTIONAL, + IN OUT PCM_RESOURCE_LIST *AllocatedResources); + +NTKERNELAPI +BOOLEAN +NTAPI +IoSetThreadHardErrorMode( + IN BOOLEAN EnableHardErrors); + +#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ + +#if (NTDDI_VERSION >= NTDDI_WIN2KSP3) + +NTKERNELAPI +BOOLEAN +NTAPI +IoIsFileOriginRemote( + IN PFILE_OBJECT FileObject); + +NTKERNELAPI +NTSTATUS +NTAPI +IoSetFileOrigin( + IN PFILE_OBJECT FileObject, + IN BOOLEAN Remote); + +#endif + +#if (NTDDI_VERSION >= NTDDI_WINXP) + +NTKERNELAPI +NTSTATUS +FASTCALL +IoReadPartitionTable( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN BOOLEAN ReturnRecognizedPartitions, + OUT struct _DRIVE_LAYOUT_INFORMATION **PartitionBuffer); + +NTKERNELAPI +NTSTATUS +FASTCALL +IoSetPartitionInformation( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN ULONG PartitionNumber, + IN ULONG PartitionType); + +NTKERNELAPI +NTSTATUS +FASTCALL +IoWritePartitionTable( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN ULONG SectorsPerTrack, + IN ULONG NumberOfHeads, + IN struct _DRIVE_LAYOUT_INFORMATION *PartitionBuffer); + +NTKERNELAPI +NTSTATUS +NTAPI +IoCreateDisk( + IN PDEVICE_OBJECT DeviceObject, + IN struct _CREATE_DISK* Disk OPTIONAL); + +NTKERNELAPI +NTSTATUS +NTAPI +IoReadDiskSignature( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG BytesPerSector, + OUT PDISK_SIGNATURE Signature); + +NTKERNELAPI +NTSTATUS +NTAPI +IoReadPartitionTableEx( + IN PDEVICE_OBJECT DeviceObject, + OUT struct _DRIVE_LAYOUT_INFORMATION_EX **PartitionBuffer); + +NTKERNELAPI +NTSTATUS +NTAPI +IoSetPartitionInformationEx( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG PartitionNumber, + IN struct _SET_PARTITION_INFORMATION_EX *PartitionInfo); + +NTKERNELAPI +NTSTATUS +NTAPI +IoSetSystemPartition( + IN PUNICODE_STRING VolumeNameString); + +NTKERNELAPI +NTSTATUS +NTAPI +IoVerifyPartitionTable( + IN PDEVICE_OBJECT DeviceObject, + IN BOOLEAN FixErrors); + +NTKERNELAPI +NTSTATUS +NTAPI +IoVolumeDeviceToDosName( + IN PVOID VolumeDeviceObject, + OUT PUNICODE_STRING DosName); + +NTKERNELAPI +NTSTATUS +NTAPI +IoWritePartitionTableEx( + IN PDEVICE_OBJECT DeviceObject, + IN struct _DRIVE_LAYOUT_INFORMATION_EX *DriveLayout); + +NTKERNELAPI +NTSTATUS +IoCreateFileSpecifyDeviceObjectHint( + OUT PHANDLE FileHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN PLARGE_INTEGER AllocationSize OPTIONAL, + IN ULONG FileAttributes, + IN ULONG ShareAccess, + IN ULONG Disposition, + IN ULONG CreateOptions, + IN PVOID EaBuffer OPTIONAL, + IN ULONG EaLength, + IN CREATE_FILE_TYPE CreateFileType, + IN PVOID InternalParameters OPTIONAL, + IN ULONG Options, + IN PVOID DeviceObject OPTIONAL); + +NTKERNELAPI +NTSTATUS +NTAPI +IoAttachDeviceToDeviceStackSafe( + IN PDEVICE_OBJECT SourceDevice, + IN PDEVICE_OBJECT TargetDevice, + OUT PDEVICE_OBJECT *AttachedToDeviceObject); + +#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ + +#if (NTDDI_VERSION >= NTDDI_WS03) +NTKERNELAPI +IO_PAGING_PRIORITY +FASTCALL +IoGetPagingIoPriority( + IN PIRP Irp); +#endif + +#if (NTDDI_VERSION >= NTDDI_WS03SP1) +BOOLEAN +NTAPI +IoTranslateBusAddress( + IN INTERFACE_TYPE InterfaceType, + IN ULONG BusNumber, + IN PHYSICAL_ADDRESS BusAddress, + IN OUT PULONG AddressSpace, + OUT PPHYSICAL_ADDRESS TranslatedAddress); +#endif + +#if (NTDDI_VERSION >= NTDDI_VISTA) + +NTKERNELAPI +NTSTATUS +NTAPI +IoUpdateDiskGeometry( + IN PDEVICE_OBJECT DeviceObject, + IN struct _DISK_GEOMETRY_EX* OldDiskGeometry, + IN struct _DISK_GEOMETRY_EX* NewDiskGeometry); + +PTXN_PARAMETER_BLOCK +NTAPI +IoGetTransactionParameterBlock( + IN PFILE_OBJECT FileObject); + +NTKERNELAPI +NTSTATUS +IoCreateFileEx( + OUT PHANDLE FileHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN PLARGE_INTEGER AllocationSize OPTIONAL, + IN ULONG FileAttributes, + IN ULONG ShareAccess, + IN ULONG Disposition, + IN ULONG CreateOptions, + IN PVOID EaBuffer OPTIONAL, + IN ULONG EaLength, + IN CREATE_FILE_TYPE CreateFileType, + IN PVOID InternalParameters OPTIONAL, + IN ULONG Options, + IN PIO_DRIVER_CREATE_CONTEXT DriverContext OPTIONAL); + +NTSTATUS +NTAPI +IoSetIrpExtraCreateParameter( + IN OUT PIRP Irp, + IN struct _ECP_LIST *ExtraCreateParameter); + +VOID +NTAPI +IoClearIrpExtraCreateParameter( + IN OUT PIRP Irp); + +NTSTATUS +NTAPI +IoGetIrpExtraCreateParameter( + IN PIRP Irp, + OUT struct _ECP_LIST **ExtraCreateParameter OPTIONAL); + +BOOLEAN +NTAPI +IoIsFileObjectIgnoringSharing( + IN PFILE_OBJECT FileObject); + +#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */ + +#if (NTDDI_VERSION >= NTDDI_WIN7) +NTSTATUS +NTAPI +IoSetFileObjectIgnoreSharing( + IN PFILE_OBJECT FileObject); +#endif + + + + + +#if (NTDDI_VERSION >= NTDDI_WINXP) +NTKERNELAPI +VOID +FASTCALL +HalExamineMBR( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN ULONG MBRTypeIdentifier, + OUT PVOID *Buffer); +#endif + +struct _LOADER_PARAMETER_BLOCK; +struct _CREATE_DISK; +struct _DRIVE_LAYOUT_INFORMATION_EX; +struct _SET_PARTITION_INFORMATION_EX; + +// +// GUID and UUID +// +#ifndef GUID_DEFINED +#include <guiddef.h> +#endif typedef enum _HAL_QUERY_INFORMATION_CLASS { HalInstalledBusInformation, @@ -3047,39 +3866,6 @@ PVOID Function[1]; } PM_DISPATCH_TABLE, *PPM_DISPATCH_TABLE; -typedef enum _RESOURCE_TRANSLATION_DIRECTION { - TranslateChildToParent, - TranslateParentToChild -} RESOURCE_TRANSLATION_DIRECTION; - -typedef NTSTATUS -(NTAPI *PTRANSLATE_RESOURCE_HANDLER)( - IN OUT PVOID Context, - IN PCM_PARTIAL_RESOURCE_DESCRIPTOR Source, - IN RESOURCE_TRANSLATION_DIRECTION Direction, - IN ULONG AlternativesCount OPTIONAL, - IN IO_RESOURCE_DESCRIPTOR Alternatives[], - IN PDEVICE_OBJECT PhysicalDeviceObject, - OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR Target); - -typedef NTSTATUS -(NTAPI *PTRANSLATE_RESOURCE_REQUIREMENTS_HANDLER)( - IN PVOID Context OPTIONAL, - IN PIO_RESOURCE_DESCRIPTOR Source, - IN PDEVICE_OBJECT PhysicalDeviceObject, - OUT PULONG TargetCount, - OUT PIO_RESOURCE_DESCRIPTOR *Target); - -typedef struct _TRANSLATOR_INTERFACE { - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - PTRANSLATE_RESOURCE_HANDLER TranslateResources; - PTRANSLATE_RESOURCE_REQUIREMENTS_HANDLER TranslateResourceRequirements; -} TRANSLATOR_INTERFACE, *PTRANSLATOR_INTERFACE; - typedef VOID (FASTCALL *pHalExamineMBR)( IN PDEVICE_OBJECT DeviceObject, @@ -3391,45 +4177,6 @@ #define HalMirrorPhysicalMemory HALDISPATCH->HalMirrorPhysicalMemory #define HalEndOfBoot HALDISPATCH->HalEndOfBoot #define HalMirrorVerify HALDISPATCH->HalMirrorVerify - -typedef struct _IMAGE_INFO { - _ANONYMOUS_UNION union { - ULONG Properties; - _ANONYMOUS_STRUCT struct { - ULONG ImageAddressingMode:8; - ULONG SystemModeImage:1; - ULONG ImageMappedToAllPids:1; - ULONG ExtendedInfoPresent:1; - ULONG Reserved:22; - } DUMMYSTRUCTNAME; - } DUMMYUNIONNAME; - PVOID ImageBase; - ULONG ImageSelector; - SIZE_T ImageSize; - ULONG ImageSectionNumber; -} IMAGE_INFO, *PIMAGE_INFO; - -#define IMAGE_ADDRESSING_MODE_32BIT 3 - -typedef enum _IO_QUERY_DEVICE_DATA_FORMAT { - IoQueryDeviceIdentifier = 0, - IoQueryDeviceConfigurationData, - IoQueryDeviceComponentInformation, - IoQueryDeviceMaxData -} IO_QUERY_DEVICE_DATA_FORMAT, *PIO_QUERY_DEVICE_DATA_FORMAT; - -typedef struct _DISK_SIGNATURE { - ULONG PartitionStyle; - _ANONYMOUS_UNION union { - struct { - ULONG Signature; - ULONG CheckSum; - } Mbr; - struct { - GUID DiskId; - } Gpt; - } DUMMYUNIONNAME; -} DISK_SIGNATURE, *PDISK_SIGNATURE; extern NTKERNELAPI PVOID MmHighestUserAddress; extern NTKERNELAPI PVOID MmSystemRangeStart; @@ -3619,53 +4366,6 @@ #endif /* _X86_ */ -typedef struct _CONTROLLER_OBJECT { - CSHORT Type; - CSHORT Size; - PVOID ControllerExtension; - KDEVICE_QUEUE DeviceWaitQueue; - ULONG Spare1; - LARGE_INTEGER Spare2; -} CONTROLLER_OBJECT, *PCONTROLLER_OBJECT; - -typedef struct _CONFIGURATION_INFORMATION { - ULONG DiskCount; - ULONG FloppyCount; - ULONG CdRomCount; - ULONG TapeCount; - ULONG ScsiPortCount; - ULONG SerialCount; - ULONG ParallelCount; - BOOLEAN AtDiskPrimaryAddressClaimed; - BOOLEAN AtDiskSecondaryAddressClaimed; - ULONG Version; - ULONG MediumChangerCount; -} CONFIGURATION_INFORMATION, *PCONFIGURATION_INFORMATION; - -typedef -NTSTATUS -(NTAPI *PIO_QUERY_DEVICE_ROUTINE)( - IN PVOID Context, - IN PUNICODE_STRING PathName, - IN INTERFACE_TYPE BusType, - IN ULONG BusNumber, - IN PKEY_VALUE_FULL_INFORMATION *BusInformation, - IN CONFIGURATION_TYPE ControllerType, - IN ULONG ControllerNumber, - IN PKEY_VALUE_FULL_INFORMATION *ControllerInformation, - IN CONFIGURATION_TYPE PeripheralType, - IN ULONG PeripheralNumber, - IN PKEY_VALUE_FULL_INFORMATION *PeripheralInformation); - -typedef -VOID -(NTAPI DRIVER_REINITIALIZE)( - IN struct _DRIVER_OBJECT *DriverObject, - IN PVOID Context, - IN ULONG Count); - -typedef DRIVER_REINITIALIZE *PDRIVER_REINITIALIZE; - /** Filesystem runtime library routines **/ #if (NTDDI_VERSION >= NTDDI_WIN2K) @@ -3829,17 +4529,6 @@ #endif -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -VOID -FASTCALL -HalExamineMBR( - IN PDEVICE_OBJECT DeviceObject, - IN ULONG SectorSize, - IN ULONG MBRTypeIdentifier, - OUT PVOID *Buffer); -#endif - #if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_) // nothing here #else @@ -3914,403 +4603,7 @@ #endif /* defined(USE_DMA_MACROS) && !defined(_NTHAL_) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_) */ -/* I/O Manager Functions */ - -/* - * VOID IoAssignArcName( - * IN PUNICODE_STRING ArcName, - * IN PUNICODE_STRING DeviceName); - */ -#define IoAssignArcName(_ArcName, _DeviceName) ( \ - IoCreateSymbolicLink((_ArcName), (_DeviceName))) - -/* - * VOID - * IoDeassignArcName( - * IN PUNICODE_STRING ArcName) - */ -#define IoDeassignArcName IoDeleteSymbolicLink - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -#if !(defined(USE_DMA_MACROS) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_)) -NTKERNELAPI -NTSTATUS -NTAPI -IoAllocateAdapterChannel( - IN PADAPTER_OBJECT AdapterObject, - IN PDEVICE_OBJECT DeviceObject, - IN ULONG NumberOfMapRegisters, - IN PDRIVER_CONTROL ExecutionRoutine, - IN PVOID Context); -#endif - -//DECLSPEC_DEPRECATED_DDK -NTHALAPI -PHYSICAL_ADDRESS -NTAPI -IoMapTransfer( - IN PADAPTER_OBJECT AdapterObject, - IN PMDL Mdl, - IN PVOID MapRegisterBase, - IN PVOID CurrentVa, - IN OUT PULONG Length, - IN BOOLEAN WriteToDevice); - -NTKERNELAPI -VOID -NTAPI -IoAllocateController( - IN PCONTROLLER_OBJECT ControllerObject, - IN PDEVICE_OBJECT DeviceObject, - IN PDRIVER_CONTROL ExecutionRoutine, - IN PVOID Context OPTIONAL); - -NTKERNELAPI -PCONTROLLER_OBJECT -NTAPI -IoCreateController( - IN ULONG Size); - -NTKERNELAPI -VOID -NTAPI -IoDeleteController( - IN PCONTROLLER_OBJECT ControllerObject); - -NTKERNELAPI -VOID -NTAPI -IoFreeController( - IN PCONTROLLER_OBJECT ControllerObject); - -NTKERNELAPI -PCONFIGURATION_INFORMATION -NTAPI -IoGetConfigurationInformation( - VOID); - -NTKERNELAPI -PDEVICE_OBJECT -NTAPI -IoGetDeviceToVerify( - IN PETHREAD Thread); - -NTKERNELAPI -VOID -NTAPI -IoCancelFileOpen( - IN PDEVICE_OBJECT DeviceObject, - IN PFILE_OBJECT FileObject); - -NTKERNELAPI -PGENERIC_MAPPING -NTAPI -IoGetFileObjectGenericMapping( - VOID); - -NTKERNELAPI -PIRP -NTAPI -IoMakeAssociatedIrp( - IN PIRP Irp, - IN CCHAR StackSize); - -NTKERNELAPI -NTSTATUS -NTAPI -IoQueryDeviceDescription( - IN PINTERFACE_TYPE BusType OPTIONAL, - IN PULONG BusNumber OPTIONAL, - IN PCONFIGURATION_TYPE ControllerType OPTIONAL, - IN PULONG ControllerNumber OPTIONAL, - IN PCONFIGURATION_TYPE PeripheralType OPTIONAL, - IN PULONG PeripheralNumber OPTIONAL, - IN PIO_QUERY_DEVICE_ROUTINE CalloutRoutine, - IN OUT PVOID Context OPTIONAL); - -NTKERNELAPI -VOID -NTAPI -IoRaiseHardError( - IN PIRP Irp, - IN PVPB Vpb OPTIONAL, - IN PDEVICE_OBJECT RealDeviceObject); - -NTKERNELAPI -BOOLEAN -NTAPI -IoRaiseInformationalHardError( - IN NTSTATUS ErrorStatus, - IN PUNICODE_STRING String OPTIONAL, - IN PKTHREAD Thread OPTIONAL); - -NTKERNELAPI -VOID -NTAPI -IoRegisterBootDriverReinitialization( - IN PDRIVER_OBJECT DriverObject, - IN PDRIVER_REINITIALIZE DriverReinitializationRoutine, - IN PVOID Context OPTIONAL); - -NTKERNELAPI -VOID -NTAPI -IoRegisterDriverReinitialization( - IN PDRIVER_OBJECT DriverObject, - IN PDRIVER_REINITIALIZE DriverReinitializationRoutine, - IN PVOID Context OPTIONAL); - -NTKERNELAPI -NTSTATUS -NTAPI -IoAttachDeviceByPointer( - IN PDEVICE_OBJECT SourceDevice, - IN PDEVICE_OBJECT TargetDevice); - -NTKERNELAPI -NTSTATUS -NTAPI -IoReportDetectedDevice( - IN PDRIVER_OBJECT DriverObject, - IN INTERFACE_TYPE LegacyBusType, - IN ULONG BusNumber, - IN ULONG SlotNumber, - IN PCM_RESOURCE_LIST ResourceList OPTIONAL, - IN PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements OPTIONAL, - IN BOOLEAN ResourceAssigned, - IN OUT PDEVICE_OBJECT *DeviceObject); - -NTKERNELAPI -NTSTATUS -NTAPI -IoReportResourceForDetection( - IN PDRIVER_OBJECT DriverObject, - IN PCM_RESOURCE_LIST DriverList OPTIONAL, - IN ULONG DriverListSize OPTIONAL, - IN PDEVICE_OBJECT DeviceObject OPTIONAL, - IN PCM_RESOURCE_LIST DeviceList OPTIONAL, - IN ULONG DeviceListSize OPTIONAL, - OUT PBOOLEAN ConflictDetected); - -NTKERNELAPI -NTSTATUS -NTAPI -IoReportResourceUsage( - IN PUNICODE_STRING DriverClassName OPTIONAL, - IN PDRIVER_OBJECT DriverObject, - IN PCM_RESOURCE_LIST DriverList OPTIONAL, - IN ULONG DriverListSize OPTIONAL, - IN PDEVICE_OBJECT DeviceObject, - IN PCM_RESOURCE_LIST DeviceList OPTIONAL, - IN ULONG DeviceListSize OPTIONAL, - IN BOOLEAN OverrideConflict, - OUT PBOOLEAN ConflictDetected); - -NTKERNELAPI -VOID -NTAPI -IoSetHardErrorOrVerifyDevice( - IN PIRP Irp, - IN PDEVICE_OBJECT DeviceObject); - -NTKERNELAPI -NTSTATUS -NTAPI -IoAssignResources( - IN PUNICODE_STRING RegistryPath, - IN PUNICODE_STRING DriverClassName OPTIONAL, - IN PDRIVER_OBJECT DriverObject, - IN PDEVICE_OBJECT DeviceObject OPTIONAL, - IN PIO_RESOURCE_REQUIREMENTS_LIST RequestedResources OPTIONAL, - IN OUT PCM_RESOURCE_LIST *AllocatedResources); - -#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -NTKERNELAPI -NTSTATUS -NTAPI -IoCreateDisk( - IN PDEVICE_OBJECT DeviceObject, - IN struct _CREATE_DISK* Disk OPTIONAL); - -NTKERNELAPI -NTSTATUS -NTAPI -IoReadDiskSignature( - IN PDEVICE_OBJECT DeviceObject, - IN ULONG BytesPerSector, - OUT PDISK_SIGNATURE Signature); - -NTKERNELAPI -NTSTATUS -FASTCALL -IoReadPartitionTable( - IN PDEVICE_OBJECT DeviceObject, - IN ULONG SectorSize, - IN BOOLEAN ReturnRecognizedPartitions, - OUT struct _DRIVE_LAYOUT_INFORMATION **PartitionBuffer); - -NTKERNELAPI -NTSTATUS -NTAPI -IoReadPartitionTableEx( - IN PDEVICE_OBJECT DeviceObject, - IN struct _DRIVE_LAYOUT_INFORMATION_EX **PartitionBuffer); - -NTKERNELAPI -NTSTATUS -FASTCALL -IoSetPartitionInformation( - IN PDEVICE_OBJECT DeviceObject, - IN ULONG SectorSize, - IN ULONG PartitionNumber, - IN ULONG PartitionType); - -NTKERNELAPI -NTSTATUS -NTAPI -IoSetPartitionInformationEx( - IN PDEVICE_OBJECT DeviceObject, - IN ULONG PartitionNumber, - IN struct _SET_PARTITION_INFORMATION_EX *PartitionInfo); - -NTKERNELAPI -NTSTATUS -NTAPI -IoSetSystemPartition( - IN PUNICODE_STRING VolumeNameString); - -NTKERNELAPI -BOOLEAN -NTAPI -IoSetThreadHardErrorMode( - IN BOOLEAN EnableHardErrors); - -NTKERNELAPI -NTSTATUS -NTAPI -IoVerifyPartitionTable( - IN PDEVICE_OBJECT DeviceObject, - IN BOOLEAN FixErrors); - -NTKERNELAPI -NTSTATUS -NTAPI -IoVolumeDeviceToDosName( - IN PVOID VolumeDeviceObject, - OUT PUNICODE_STRING DosName); - -NTKERNELAPI -NTSTATUS -FASTCALL -IoWritePartitionTable( - IN PDEVICE_OBJECT DeviceObject, - IN ULONG SectorSize, - IN ULONG SectorsPerTrack, - IN ULONG NumberOfHeads, - IN struct _DRIVE_LAYOUT_INFORMATION *PartitionBuffer); - -NTKERNELAPI -NTSTATUS -NTAPI -IoWritePartitionTableEx( - IN PDEVICE_OBJECT DeviceObject, - IN struct _DRIVE_LAYOUT_INFORMATION_EX *DriveLayout); - -#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ - -/** Process manager types **/ - -typedef VOID -(NTAPI *PCREATE_PROCESS_NOTIFY_ROUTINE)( - IN HANDLE ParentId, - IN HANDLE ProcessId, - IN BOOLEAN Create); - -typedef VOID -(NTAPI *PCREATE_THREAD_NOTIFY_ROUTINE)( - IN HANDLE ProcessId, - IN HANDLE ThreadId, - IN BOOLEAN Create); - -typedef VOID -(NTAPI *PLOAD_IMAGE_NOTIFY_ROUTINE)( - IN PUNICODE_STRING FullImageName, - IN HANDLE ProcessId, - IN PIMAGE_INFO ImageInfo); - /** Process manager routines **/ - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -NTKERNELAPI -NTSTATUS -NTAPI -PsSetLoadImageNotifyRoutine( - IN PLOAD_IMAGE_NOTIFY_ROUTINE NotifyRoutine); - -NTKERNELAPI -NTSTATUS -NTAPI -PsSetCreateThreadNotifyRoutine( - IN PCREATE_THREAD_NOTIFY_ROUTINE NotifyRoutine); - -NTKERNELAPI -NTSTATUS -NTAPI -PsSetCreateProcessNotifyRoutine( - IN PCREATE_PROCESS_NOTIFY_ROUTINE NotifyRoutine, - IN BOOLEAN Remove); - -NTKERNELAPI -HANDLE -NTAPI -PsGetCurrentProcessId( - VOID); - -NTKERNELAPI -HANDLE -NTAPI -PsGetCurrentThreadId( - VOID); - -NTKERNELAPI -BOOLEAN -NTAPI -PsGetVersion( - OUT PULONG MajorVersion OPTIONAL, - OUT PULONG MinorVersion OPTIONAL, - OUT PULONG BuildNumber OPTIONAL, - OUT PUNICODE_STRING CSDVersion OPTIONAL); - -#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -NTKERNELAPI -HANDLE -NTAPI -PsGetProcessId( - IN PEPROCESS Process); - -NTKERNELAPI -NTSTATUS -NTAPI -PsRemoveCreateThreadNotifyRoutine( - IN PCREATE_THREAD_NOTIFY_ROUTINE NotifyRoutine); - -NTKERNELAPI -NTSTATUS -NTAPI -PsRemoveLoadImageNotifyRoutine( - IN PLOAD_IMAGE_NOTIFY_ROUTINE NotifyRoutine); - -#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ - -extern NTKERNELAPI PEPROCESS PsInitialSystemProcess; /* ZwXxx Functions */
14 years, 9 months
1
0
0
0
[cwittich] 46251: [USER32] reduce diff to wine
by cwittich@svn.reactos.org
Author: cwittich Date: Wed Mar 17 17:20:55 2010 New Revision: 46251 URL:
http://svn.reactos.org/svn/reactos?rev=46251&view=rev
Log: [USER32] reduce diff to wine Modified: trunk/reactos/dll/win32/user32/windows/menu.c Modified: trunk/reactos/dll/win32/user32/windows/menu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/m…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/menu.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/menu.c [iso-8859-1] Wed Mar 17 17:20:55 2010 @@ -268,6 +268,157 @@ HeapFree(GetProcessHeap(), 0, ItemInfo); } +/*********************************************************************** + * MenuInitSysMenuPopup + * + * Grey the appropriate items in System menu. + */ +void FASTCALL MenuInitSysMenuPopup(HMENU hmenu, DWORD style, DWORD clsStyle, LONG HitTest ) +{ + BOOL gray; + UINT DefItem; + #if 0 + MENUITEMINFOW mii; + #endif + + gray = !(style & WS_THICKFRAME) || (style & (WS_MAXIMIZE | WS_MINIMIZE)); + EnableMenuItem( hmenu, SC_SIZE, (gray ? MF_GRAYED : MF_ENABLED) ); + gray = ((style & WS_MAXIMIZE) != 0); + EnableMenuItem( hmenu, SC_MOVE, (gray ? MF_GRAYED : MF_ENABLED) ); + gray = !(style & WS_MINIMIZEBOX) || (style & WS_MINIMIZE); + EnableMenuItem( hmenu, SC_MINIMIZE, (gray ? MF_GRAYED : MF_ENABLED) ); + gray = !(style & WS_MAXIMIZEBOX) || (style & WS_MAXIMIZE); + EnableMenuItem( hmenu, SC_MAXIMIZE, (gray ? MF_GRAYED : MF_ENABLED) ); + gray = !(style & (WS_MAXIMIZE | WS_MINIMIZE)); + EnableMenuItem( hmenu, SC_RESTORE, (gray ? MF_GRAYED : MF_ENABLED) ); + gray = (clsStyle & CS_NOCLOSE) != 0; + + /* The menu item must keep its state if it's disabled */ + if(gray) + EnableMenuItem( hmenu, SC_CLOSE, MF_GRAYED); + + /* Set default menu item */ + if(style & WS_MINIMIZE) DefItem = SC_RESTORE; + else if(HitTest == HTCAPTION) DefItem = ((style & (WS_MAXIMIZE | WS_MINIMIZE)) ? SC_RESTORE : SC_MAXIMIZE); + else DefItem = SC_CLOSE; +#if 0 + mii.cbSize = sizeof(MENUITEMINFOW); + mii.fMask |= MIIM_STATE; + if((DefItem != SC_CLOSE) && GetMenuItemInfoW(hmenu, DefItem, FALSE, &mii) && + (mii.fState & (MFS_GRAYED | MFS_DISABLED))) DefItem = SC_CLOSE; +#endif + SetMenuDefaultItem(hmenu, DefItem, MF_BYCOMMAND); +} + +/****************************************************************************** + * + * UINT MenuGetStartOfNextColumn( + * PROSMENUINFO MenuInfo) + * + *****************************************************************************/ +static UINT MenuGetStartOfNextColumn( + PROSMENUINFO MenuInfo) +{ + PROSMENUITEMINFO MenuItems; + UINT i; + + i = MenuInfo->FocusedItem; + if ( i == NO_SELECTED_ITEM ) + return i; + + if (MenuGetAllRosMenuItemInfo(MenuInfo->Self, &MenuItems) <= 0) + return NO_SELECTED_ITEM; + + for (i++ ; i < MenuInfo->MenuItemCount; i++) + if (0 != (MenuItems[i].fType & (MF_MENUBREAK | MF_MENUBARBREAK))) + return i; + + return NO_SELECTED_ITEM; +} + +/****************************************************************************** + * + * UINT MenuGetStartOfPrevColumn( + * PROSMENUINFO MenuInfo) + * + *****************************************************************************/ + +static UINT FASTCALL MenuGetStartOfPrevColumn( + PROSMENUINFO MenuInfo) +{ + PROSMENUITEMINFO MenuItems; + UINT i; + + if (!MenuInfo->FocusedItem || MenuInfo->FocusedItem == NO_SELECTED_ITEM) + return NO_SELECTED_ITEM; + + if (MenuGetAllRosMenuItemInfo(MenuInfo->Self, &MenuItems) <= 0) + return NO_SELECTED_ITEM; + + /* Find the start of the column */ + for (i = MenuInfo->FocusedItem; + 0 != i && 0 == (MenuItems[i].fType & (MF_MENUBREAK | MF_MENUBARBREAK)); + --i) + { + ; /* empty */ + } + + if (i == 0) + { + MenuCleanupAllRosMenuItemInfo(MenuItems); + return NO_SELECTED_ITEM; + } + + for (--i; 0 != i; --i) + if (MenuItems[i].fType & (MF_MENUBREAK | MF_MENUBARBREAK)) + break; + + MenuCleanupAllRosMenuItemInfo(MenuItems); + TRACE("ret %d.\n", i ); + + return i; +} + +/*********************************************************************** + * MenuFindSubMenu + * + * Find a Sub menu. Return the position of the submenu, and modifies + * *hmenu in case it is found in another sub-menu. + * If the submenu cannot be found, NO_SELECTED_ITEM is returned. + */ +static UINT FASTCALL MenuFindSubMenu(HMENU *hmenu, HMENU hSubTarget ) +{ + ROSMENUINFO menu; + UINT i; + ROSMENUITEMINFO item; + if (((*hmenu)==(HMENU)0xffff) || + (!MenuGetRosMenuInfo(&menu, *hmenu))) + return NO_SELECTED_ITEM; + + MenuInitRosMenuItemInfo(&item); + for (i = 0; i < menu.MenuItemCount; i++) { + if (! MenuGetRosMenuItemInfo(menu.Self, i, &item)) + { + MenuCleanupRosMenuItemInfo(&item); + return NO_SELECTED_ITEM; + } + if (!(item.fType & MF_POPUP)) continue; + if (item.hSubMenu == hSubTarget) { + MenuCleanupRosMenuItemInfo(&item); + return i; + } + else { + HMENU hsubmenu = item.hSubMenu; + UINT pos = MenuFindSubMenu(&hsubmenu, hSubTarget ); + if (pos != NO_SELECTED_ITEM) { + *hmenu = hsubmenu; + return pos; + } + } + } + MenuCleanupRosMenuItemInfo(&item); + return NO_SELECTED_ITEM; +} /*********************************************************************** * MenuLoadBitmaps @@ -347,49 +498,6 @@ SelectObject(dc, hOldFont); SetBkMode(dc, bkmode); DeleteObject(hFont); -} - -/*********************************************************************** - * MenuFindSubMenu - * - * Find a Sub menu. Return the position of the submenu, and modifies - * *hmenu in case it is found in another sub-menu. - * If the submenu cannot be found, NO_SELECTED_ITEM is returned. - */ -static UINT FASTCALL MenuFindSubMenu(HMENU *hmenu, HMENU hSubTarget ) -{ - ROSMENUINFO menu; - UINT i; - ROSMENUITEMINFO item; - - if (((*hmenu)==(HMENU)0xffff) || - (!MenuGetRosMenuInfo(&menu, *hmenu))) - return NO_SELECTED_ITEM; - - MenuInitRosMenuItemInfo(&item); - for (i = 0; i < menu.MenuItemCount; i++) - { - if (! MenuGetRosMenuItemInfo(menu.Self, i, &item)) - { - MenuCleanupRosMenuItemInfo(&item); - return NO_SELECTED_ITEM; - } - if (!(item.fType & MF_POPUP)) continue; - if (item.hSubMenu == hSubTarget) { - MenuCleanupRosMenuItemInfo(&item); - return i; - } - else { - HMENU hsubmenu = item.hSubMenu; - UINT pos = MenuFindSubMenu(&hsubmenu, hSubTarget ); - if (pos != NO_SELECTED_ITEM) { - *hmenu = hsubmenu; - return pos; - } - } - } - MenuCleanupRosMenuItemInfo(&item); - return NO_SELECTED_ITEM; } /*********************************************************************** @@ -2121,66 +2229,6 @@ } /*********************************************************************** - * MenuInitSysMenuPopup - * - * Grey the appropriate items in System menu. - */ -void FASTCALL -MenuInitSysMenuPopup(HMENU Menu, DWORD Style, DWORD ClsStyle, LONG HitTest ) -{ - BOOL Gray; - UINT DefItem; - #if 0 - MENUITEMINFOW mii; - #endif - - Gray = 0 == (Style & WS_THICKFRAME) || 0 != (Style & (WS_MAXIMIZE | WS_MINIMIZE)); - EnableMenuItem(Menu, SC_SIZE, (Gray ? MF_GRAYED : MF_ENABLED)); - Gray = 0 != (Style & WS_MAXIMIZE); - EnableMenuItem(Menu, SC_MOVE, (Gray ? MF_GRAYED : MF_ENABLED)); - Gray = 0 == (Style & WS_MINIMIZEBOX) || 0 != (Style & WS_MINIMIZE); - EnableMenuItem(Menu, SC_MINIMIZE, (Gray ? MF_GRAYED : MF_ENABLED)); - Gray = 0 == (Style & WS_MAXIMIZEBOX) || 0 != (Style & WS_MAXIMIZE); - EnableMenuItem(Menu, SC_MAXIMIZE, (Gray ? MF_GRAYED : MF_ENABLED)); - Gray = 0 == (Style & (WS_MAXIMIZE | WS_MINIMIZE)); - EnableMenuItem(Menu, SC_RESTORE, (Gray ? MF_GRAYED : MF_ENABLED)); - Gray = 0 != (ClsStyle & CS_NOCLOSE); - - /* The menu item must keep its state if it's disabled */ - if (Gray) - { - EnableMenuItem(Menu, SC_CLOSE, MF_GRAYED); - } - - /* Set default menu item */ - if(Style & WS_MINIMIZE) - { - DefItem = SC_RESTORE; - } - else - { - if(HitTest == HTCAPTION) - { - DefItem = ((Style & (WS_MAXIMIZE | WS_MINIMIZE)) ? SC_RESTORE : SC_MAXIMIZE); - } - else - { - DefItem = SC_CLOSE; - } - } - #if 0 - mii.cbSize = sizeof(MENUITEMINFOW); - mii.fMask |= MIIM_STATE; - if((DefItem != SC_CLOSE) && GetMenuItemInfoW(Menu, DefItem, FALSE, &mii) && - (mii.fState & (MFS_GRAYED | MFS_DISABLED))) - { - DefItem = SC_CLOSE; - } - #endif - SetMenuDefaultItem(Menu, DefItem, MF_BYCOMMAND); -} - -/*********************************************************************** * MenuShowSubPopup * * Display the sub-menu of the selected item of this menu. @@ -2676,86 +2724,6 @@ return TRUE; } -/****************************************************************************** - * - * UINT MenuGetStartOfNextColumn(PROSMENUINFO MenuInfo) - */ -static UINT MenuGetStartOfNextColumn(PROSMENUINFO MenuInfo) -{ - UINT i; - PROSMENUITEMINFO MenuItems; - - i = MenuInfo->FocusedItem; - if (NO_SELECTED_ITEM == i) - { - return i; - } - - if (MenuGetAllRosMenuItemInfo(MenuInfo->Self, &MenuItems) <= 0) - { - return NO_SELECTED_ITEM; - } - - for (i++ ; i < MenuInfo->MenuItemCount; i++) - { - if (0 != (MenuItems[i].fType & (MF_MENUBREAK | MF_MENUBARBREAK))) - { - return i; - } - } - - return NO_SELECTED_ITEM; -} - -/****************************************************************************** - * - * UINT MenuGetStartOfPrevColumn(PROSMENUINFO MenuInfo) - */ -static UINT FASTCALL -MenuGetStartOfPrevColumn(PROSMENUINFO MenuInfo) -{ - UINT i; - PROSMENUITEMINFO MenuItems; - - if (0 == MenuInfo->FocusedItem || NO_SELECTED_ITEM == MenuInfo->FocusedItem) - { - return NO_SELECTED_ITEM; - } - - if (MenuGetAllRosMenuItemInfo(MenuInfo->Self, &MenuItems) <= 0) - { - return NO_SELECTED_ITEM; - } - - /* Find the start of the column */ - - for (i = MenuInfo->FocusedItem; - 0 != i && 0 == (MenuItems[i].fType & (MF_MENUBREAK | MF_MENUBARBREAK)); - --i) - { - ; /* empty */ - } - - if (0 == i) - { - MenuCleanupAllRosMenuItemInfo(MenuItems); - return NO_SELECTED_ITEM; - } - - for (--i; 0 != i; --i) - { - if (MenuItems[i].fType & (MF_MENUBREAK | MF_MENUBARBREAK)) - { - break; - } - } - - MenuCleanupAllRosMenuItemInfo(MenuItems); - TRACE("ret %d.\n", i ); - - return i; -} - /*********************************************************************** * MenuGetSubPopup * @@ -3252,138 +3220,138 @@ switch(msg.message) { - /* no WM_NC... messages in captured state */ - - case WM_RBUTTONDBLCLK: - case WM_RBUTTONDOWN: - if (!(wFlags & TPM_RIGHTBUTTON)) break; - /* fall through */ - case WM_LBUTTONDBLCLK: - case WM_LBUTTONDOWN: - /* If the message belongs to the menu, removes it from the queue */ - /* Else, end menu tracking */ - fRemove = MenuButtonDown(&mt, hmenu, wFlags); - fEndMenu = !fRemove; - break; - - case WM_RBUTTONUP: - if (!(wFlags & TPM_RIGHTBUTTON)) break; - /* fall through */ - case WM_LBUTTONUP: - /* Check if a menu was selected by the mouse */ - if (hmenu) - { - executedMenuId = MenuButtonUp( &mt, hmenu, wFlags); + /* no WM_NC... messages in captured state */ + + case WM_RBUTTONDBLCLK: + case WM_RBUTTONDOWN: + if (!(wFlags & TPM_RIGHTBUTTON)) break; + /* fall through */ + case WM_LBUTTONDBLCLK: + case WM_LBUTTONDOWN: + /* If the message belongs to the menu, removes it from the queue */ + /* Else, end menu tracking */ + fRemove = MenuButtonDown(&mt, hmenu, wFlags); + fEndMenu = !fRemove; + break; + + case WM_RBUTTONUP: + if (!(wFlags & TPM_RIGHTBUTTON)) break; + /* fall through */ + case WM_LBUTTONUP: + /* Check if a menu was selected by the mouse */ + if (hmenu) + { + executedMenuId = MenuButtonUp( &mt, hmenu, wFlags); /* End the loop if executedMenuId is an item ID */ /* or if the job was done (executedMenuId = 0). */ - fEndMenu = fRemove = (executedMenuId != -1); - } - else - { + fEndMenu = fRemove = (executedMenuId != -1); + } /* No menu was selected by the mouse */ /* if the function was called by TrackPopupMenu, continue with the menu tracking. If not, stop it */ - fEndMenu = ((wFlags & TPM_POPUPMENU) ? FALSE : TRUE); - } - break; - - case WM_MOUSEMOVE: - if (hmenu) - fEndMenu |= !MenuMouseMove(&mt, hmenu, wFlags); - break; - - } /* switch(Msg.message) - mouse */ - } - else if ((msg.message >= WM_KEYFIRST) && (msg.message <= WM_KEYLAST)) - { - fRemove = TRUE; /* Keyboard messages are always removed */ - switch(msg.message) + else + fEndMenu = ((wFlags & TPM_POPUPMENU) ? FALSE : TRUE); + + break; + + case WM_MOUSEMOVE: + /* the selected menu item must be changed every time */ + /* the mouse moves. */ + + if (hmenu) + fEndMenu |= !MenuMouseMove( &mt, hmenu, wFlags ); + break; + + } /* switch(msg.message) - mouse */ + } + else if ((msg.message >= WM_KEYFIRST) && (msg.message <= WM_KEYLAST)) + { + fRemove = TRUE; /* Keyboard messages are always removed */ + switch(msg.message) { - case WM_SYSKEYDOWN: - case WM_KEYDOWN: + case WM_KEYDOWN: + case WM_SYSKEYDOWN: switch(msg.wParam) - { + { case VK_MENU: - fEndMenu = TRUE; - break; + case VK_F10: + fEndMenu = TRUE; + break; + case VK_HOME: case VK_END: - if (MenuGetRosMenuInfo(&MenuInfo, mt.CurrentMenu)) + if (MenuGetRosMenuInfo(&MenuInfo, mt.CurrentMenu)) { - MenuSelectItem(mt.OwnerWnd, &MenuInfo, NO_SELECTED_ITEM, - FALSE, 0 ); - MenuMoveSelection(mt.OwnerWnd, &MenuInfo, - VK_HOME == msg.wParam ? ITEM_NEXT : ITEM_PREV); + MenuSelectItem(mt.OwnerWnd, &MenuInfo, + NO_SELECTED_ITEM, FALSE, 0 ); + MenuMoveSelection(mt.OwnerWnd, &MenuInfo, + VK_HOME == msg.wParam ? ITEM_NEXT : ITEM_PREV); } - break; + break; case VK_UP: case VK_DOWN: /* If on menu bar, pull-down the menu */ - if (MenuGetRosMenuInfo(&MenuInfo, mt.CurrentMenu)) + if (MenuGetRosMenuInfo(&MenuInfo, mt.CurrentMenu)) { - if (!(MenuInfo.Flags & MF_POPUP)) + if (!(MenuInfo.Flags & MF_POPUP)) { - if (MenuGetRosMenuInfo(&MenuInfo, mt.TopMenu)) - { - mt.CurrentMenu = MenuShowSubPopup(mt.OwnerWnd, &MenuInfo, - TRUE, wFlags); - } + if (MenuGetRosMenuInfo(&MenuInfo, mt.TopMenu)) + mt.CurrentMenu = MenuShowSubPopup(mt.OwnerWnd, &MenuInfo, TRUE, wFlags); } - else /* otherwise try to move selection */ - { - MenuMoveSelection(mt.OwnerWnd, &MenuInfo, - VK_DOWN == msg.wParam ? ITEM_NEXT : ITEM_PREV); - } + else /* otherwise try to move selection */ + MenuMoveSelection(mt.OwnerWnd, &MenuInfo, + (msg.wParam == VK_UP)? ITEM_PREV : ITEM_NEXT ); } - break; + break; case VK_LEFT: - MenuKeyLeft(&mt, wFlags); - break; + MenuKeyLeft( &mt, wFlags ); + break; case VK_RIGHT: - MenuKeyRight(&mt, wFlags); - break; + MenuKeyRight( &mt, wFlags ); + break; case VK_ESCAPE: - fEndMenu = MenuKeyEscape(&mt, wFlags); - break; + fEndMenu = MenuKeyEscape(&mt, wFlags); + break; case VK_F1: - { + { HELPINFO hi; hi.cbSize = sizeof(HELPINFO); hi.iContextType = HELPINFO_MENUITEM; if (MenuGetRosMenuInfo(&MenuInfo, mt.CurrentMenu)) - { - if (MenuInfo.FocusedItem == NO_SELECTED_ITEM) hi.iCtrlId = 0; + { + if (MenuInfo.FocusedItem == NO_SELECTED_ITEM) + hi.iCtrlId = 0; else - { + { MenuInitRosMenuItemInfo(&ItemInfo); if (MenuGetRosMenuItemInfo(MenuInfo.Self, MenuInfo.FocusedItem, &ItemInfo)) - { + { hi.iCtrlId = ItemInfo.wID; - } + } else - { + { hi.iCtrlId = 0; - } + } MenuCleanupRosMenuItemInfo(&ItemInfo); - } - } + } + } hi.hItemHandle = hmenu; hi.dwContextId = MenuInfo.dwContextHelpID; hi.MousePos = msg.pt; - SendMessageW(hwnd, WM_HELP, 0, (LPARAM) &hi); + SendMessageW(hwnd, WM_HELP, 0, (LPARAM)&hi); break; - } + } default: - break; - } + break; + } break; /* WM_KEYDOWN */ case WM_CHAR: @@ -3636,6 +3604,43 @@ MenuTrackMenu( hTrackMenu, wFlags, 0, 0, hwnd, NULL ); MenuExitTracking( hwnd ); +} + +/********************************************************************** + * TrackPopupMenuEx (USER32.@) + */ +BOOL WINAPI TrackPopupMenuEx( HMENU Menu, UINT Flags, int x, int y, + HWND Wnd, LPTPMPARAMS Tpm) +{ + /* Not fully implemented */ + return TrackPopupMenu(Menu, Flags, x, y, 0, Wnd, + NULL != Tpm ? &Tpm->rcExclude : NULL); +} + +/********************************************************************** + * TrackPopupMenu (USER32.@) + */ +BOOL WINAPI TrackPopupMenu( HMENU Menu, UINT Flags, int x, int y, + int Reserved, HWND Wnd, CONST RECT *Rect) +{ + BOOL ret = FALSE; + + if (!IsMenu(Menu)) + { + SetLastError( ERROR_INVALID_MENU_HANDLE ); + return FALSE; + } + + MenuInitTracking(Wnd, Menu, TRUE, Flags); + + /* Send WM_INITMENUPOPUP message only if TPM_NONOTIFY flag is not specified */ + if (!(Flags & TPM_NONOTIFY)) + SendMessageW(Wnd, WM_INITMENUPOPUP, (WPARAM) Menu, 0); + + if (MenuShowPopup(Wnd, Menu, 0, Flags, x, y, 0, 0 )) + ret = MenuTrackMenu(Menu, Flags | TPM_POPUPMENU, 0, 0, Wnd, Rect); + MenuExitTracking(Wnd); + return ret; } /* @@ -4992,64 +4997,6 @@ return NtUserSetSystemMenu(hwnd, hMenu); } - -/* - * @implemented - */ -BOOL -WINAPI -TrackPopupMenu( - HMENU Menu, - UINT Flags, - int x, - int y, - int Reserved, - HWND Wnd, - CONST RECT *Rect) -{ - BOOL ret = FALSE; - - if (!IsMenu(Menu)) - { - SetLastError( ERROR_INVALID_MENU_HANDLE ); - return FALSE; - } - - MenuInitTracking(Wnd, Menu, TRUE, Flags); - - /* Send WM_INITMENUPOPUP message only if TPM_NONOTIFY flag is not specified */ - if (0 == (Flags & TPM_NONOTIFY)) - { - SendMessageW(Wnd, WM_INITMENUPOPUP, (WPARAM) Menu, 0); - } - - if (MenuShowPopup(Wnd, Menu, 0, Flags, x, y, 0, 0 )) - { - ret = MenuTrackMenu(Menu, Flags | TPM_POPUPMENU, 0, 0, Wnd, Rect); - } - MenuExitTracking(Wnd); - return ret; -} - - -/* - * @unimplemented - */ -BOOL -WINAPI -TrackPopupMenuEx( - HMENU Menu, - UINT Flags, - int x, - int y, - HWND Wnd, - LPTPMPARAMS Tpm) -{ - /* Not fully implemented */ - return TrackPopupMenu(Menu, Flags, x, y, 0, Wnd, - NULL != Tpm ? &Tpm->rcExclude : NULL); -} - // // Example for the Win32/User32 rewrite. // Def = TrackPopupMenuEx@24=NtUserTrackPopupMenuEx@24
14 years, 9 months
1
0
0
0
[tkreuzer] 46250: [NTOS] I forgot to set the exit function for systems without sysenter/sysexit support. Should fix sysreg.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Mar 17 17:17:16 2010 New Revision: 46250 URL:
http://svn.reactos.org/svn/reactos?rev=46250&view=rev
Log: [NTOS] I forgot to set the exit function for systems without sysenter/sysexit support. Should fix sysreg. Modified: trunk/reactos/ntoskrnl/ke/i386/cpu.c Modified: trunk/reactos/ntoskrnl/ke/i386/cpu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/cpu.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/cpu.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/i386/cpu.c [iso-8859-1] Wed Mar 17 17:17:16 2010 @@ -1018,6 +1018,11 @@ KiFastCallExitHandler = KiSystemCallTrapReturn; } } + else + { + /* Use the IRET handler */ + KiFastCallExitHandler = KiSystemCallTrapReturn; + } } ULONG_PTR
14 years, 9 months
1
0
0
0
← Newer
1
...
35
36
37
38
39
40
41
...
90
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Results per page:
10
25
50
100
200