From 3e1728b45bb2bc4cd7fa26c59a69b59d7b3414d5 Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Thu, 23 Jun 2005 03:18:20 +0000 Subject: [PATCH] Fix some NDK things and missing w32api defines. svn path=/trunk/; revision=16234 --- reactos/include/ndk/haltypes.h | 15 +++++- reactos/include/ndk/iotypes.h | 5 ++ reactos/include/ndk/kefuncs.h | 4 ++ reactos/include/ndk/lpctypes.h | 2 + reactos/include/ndk/mmtypes.h | 11 +++++ reactos/include/ndk/obtypes.h | 2 +- reactos/include/ndk/rtltypes.h | 5 ++ reactos/include/ndk/umtypes.h | 72 ---------------------------- reactos/include/ndk/zwfuncs.h | 38 +++++++-------- reactos/include/ndk/zwtypes.h | 5 +- reactos/include/ntos/ntpnp.h | 28 +---------- reactos/include/reactos/helper.h | 73 +++++++++++++++++++++++++++++ reactos/w32api/include/ddk/ntifs.h | 42 +++++++++++++++-- reactos/w32api/include/ddk/winddk.h | 29 +++++++++--- 14 files changed, 200 insertions(+), 131 deletions(-) diff --git a/reactos/include/ndk/haltypes.h b/reactos/include/ndk/haltypes.h index 91f7a7c1de7..7a18756f085 100644 --- a/reactos/include/ndk/haltypes.h +++ b/reactos/include/ndk/haltypes.h @@ -10,7 +10,6 @@ #define _HALTYPES_H /* DEPENDENCIES **************************************************************/ -//#include /* EXPORTED DATA *************************************************************/ extern ULONG NTOSAPI KdComPortInUse; @@ -30,6 +29,7 @@ extern ULONG NTOSAPI KdComPortInUse; #define MB_FLAGS_BOOT_LOADER_NAME (0x200) #define MB_FLAGS_APM_TABLE (0x400) #define MB_FLAGS_GRAPHICS_TABLE (0x800) +#define MB_FLAGS_ACPI_TABLE (0x1000) /* ENUMERATIONS **************************************************************/ typedef enum _FIRMWARE_ENTRY @@ -44,6 +44,19 @@ typedef enum _FIRMWARE_ENTRY /* TYPES *********************************************************************/ +typedef struct _HAL_PRIVATE_DISPATCH +{ + ULONG Version; +} HAL_PRIVATE_DISPATCH, *PHAL_PRIVATE_DISPATCH; + +#ifdef __NTOSKRNL__ +extern NTOSAPI HAL_PRIVATE_DISPATCH HalPrivateDispatchTable; +#else +extern NTOSAPI PHAL_PRIVATE_DISPATCH HalPrivateDispatchTable; +#endif + +#define HAL_PRIVATE_DISPATCH_VERSION 1 + typedef struct _LOADER_MODULE { ULONG ModStart; diff --git a/reactos/include/ndk/iotypes.h b/reactos/include/ndk/iotypes.h index b84fdb1880f..043aad821c2 100644 --- a/reactos/include/ndk/iotypes.h +++ b/reactos/include/ndk/iotypes.h @@ -20,6 +20,11 @@ extern POBJECT_TYPE NTOSAPI IoDriverObjectType; extern POBJECT_TYPE NTOSAPI IoFileObjectType; /* CONSTANTS *****************************************************************/ +#define DOE_UNLOAD_PENDING 0x1 +#define DOE_DELETE_PENDING 0x2 +#define DOE_REMOVE_PENDING 0x4 +#define DOE_REMOVE_PROCESSED 0x8 +#define DOE_START_PENDING 0x10 /* ENUMERATIONS **************************************************************/ diff --git a/reactos/include/ndk/kefuncs.h b/reactos/include/ndk/kefuncs.h index 0f4128dc9f7..5848418a867 100644 --- a/reactos/include/ndk/kefuncs.h +++ b/reactos/include/ndk/kefuncs.h @@ -277,5 +277,9 @@ STDCALL KeRaiseUserException( IN NTSTATUS ExceptionCode ); + +VOID +STDCALL +KeFlushWriteBuffer(VOID); #endif diff --git a/reactos/include/ndk/lpctypes.h b/reactos/include/ndk/lpctypes.h index ec790dc027e..a9705db0c5f 100644 --- a/reactos/include/ndk/lpctypes.h +++ b/reactos/include/ndk/lpctypes.h @@ -16,6 +16,8 @@ /* CONSTANTS *****************************************************************/ #define LPC_MESSAGE_BASE_SIZE 24 #define MAX_MESSAGE_DATA (0x130) +#define PORT_MAX_DATA_LENGTH 0x104 +#define PORT_MAX_MESSAGE_LENGTH 0x148 /* ENUMERATIONS **************************************************************/ diff --git a/reactos/include/ndk/mmtypes.h b/reactos/include/ndk/mmtypes.h index 3bb8e02d31f..9ed0c780ef5 100644 --- a/reactos/include/ndk/mmtypes.h +++ b/reactos/include/ndk/mmtypes.h @@ -16,6 +16,17 @@ /* CONSTANTS *****************************************************************/ /* ENUMERATIONS **************************************************************/ +typedef enum _PP_NPAGED_LOOKASIDE_NUMBER +{ + LookasideSmallIrpList = 0, + LookasideLargeIrpList = 1, + LookasideMdlList = 2, + LookasideCreateInfoList = 3, + LookasideNameBufferList = 4, + LookasideTwilightList = 5, + LookasideCompletionList = 6, + LookasideMaximumList = 7 +} PP_NPAGED_LOOKASIDE_NUMBER; /* TYPES *********************************************************************/ diff --git a/reactos/include/ndk/obtypes.h b/reactos/include/ndk/obtypes.h index 7ab778230e0..a5eb866f8f8 100644 --- a/reactos/include/ndk/obtypes.h +++ b/reactos/include/ndk/obtypes.h @@ -13,7 +13,7 @@ /* EXPORTED DATA *************************************************************/ extern NTOSAPI POBJECT_TYPE ObDirectoryType; -extern NTOSAPI struct DEVICE_MAP* ObSystemDeviceMap; +extern NTOSAPI PDEVICE_MAP ObSystemDeviceMap; /* CONSTANTS *****************************************************************/ diff --git a/reactos/include/ndk/rtltypes.h b/reactos/include/ndk/rtltypes.h index 4b650a9959f..144272d2357 100644 --- a/reactos/include/ndk/rtltypes.h +++ b/reactos/include/ndk/rtltypes.h @@ -387,6 +387,11 @@ typedef struct _RTL_ATOM_TABLE AclRevisionInformation = 1, AclSizeInformation } ACL_INFORMATION_CLASS; + + #define TIME_ZONE_ID_UNKNOWN 0 + #define TIME_ZONE_ID_STANDARD 1 + #define TIME_ZONE_ID_DAYLIGHT 2 + #define TIME_ZONE_ID_INVALID 0xFFFFFFFF #endif #endif diff --git a/reactos/include/ndk/umtypes.h b/reactos/include/ndk/umtypes.h index 0efd600ace9..ba0c16a25ff 100644 --- a/reactos/include/ndk/umtypes.h +++ b/reactos/include/ndk/umtypes.h @@ -292,78 +292,6 @@ RemoveTailList( #define IsLastEntry(ListHead, Entry) \ ((ListHead)->Blink == Entry) - -#define InsertAscendingListFIFO(ListHead, Type, ListEntryField, NewEntry, SortField)\ -{\ - PLIST_ENTRY current;\ -\ - current = (ListHead)->Flink;\ - while (current != (ListHead))\ - {\ - if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField >\ - (NewEntry)->SortField)\ - {\ - break;\ - }\ - current = current->Flink;\ - }\ -\ - InsertTailList(current, &((NewEntry)->ListEntryField));\ -} - -#define InsertDescendingListFIFO(ListHead, Type, ListEntryField, NewEntry, SortField)\ -{\ - PLIST_ENTRY current;\ -\ - current = (ListHead)->Flink;\ - while (current != (ListHead))\ - {\ - if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField <\ - (NewEntry)->SortField)\ - {\ - break;\ - }\ - current = current->Flink;\ - }\ -\ - InsertTailList(current, &((NewEntry)->ListEntryField));\ -} - -#define InsertAscendingList(ListHead, Type, ListEntryField, NewEntry, SortField)\ -{\ - PLIST_ENTRY current;\ -\ - current = (ListHead)->Flink;\ - while (current != (ListHead))\ - {\ - if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField >=\ - (NewEntry)->SortField)\ - {\ - break;\ - }\ - current = current->Flink;\ - }\ -\ - InsertTailList(current, &((NewEntry)->ListEntryField));\ -} - -#define InsertDescendingList(ListHead, Type, ListEntryField, NewEntry, SortField)\ -{\ - PLIST_ENTRY current;\ -\ - current = (ListHead)->Flink;\ - while (current != (ListHead))\ - {\ - if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField <=\ - (NewEntry)->SortField)\ - {\ - break;\ - }\ - current = current->Flink;\ - }\ -\ - InsertTailList(current, &((NewEntry)->ListEntryField));\ -} /* * Constant String Macro diff --git a/reactos/include/ndk/zwfuncs.h b/reactos/include/ndk/zwfuncs.h index 806ac86f971..0e2eff30306 100644 --- a/reactos/include/ndk/zwfuncs.h +++ b/reactos/include/ndk/zwfuncs.h @@ -952,6 +952,15 @@ ZwGetContextThread( OUT PCONTEXT Context ); +NTSTATUS +STDCALL +NtGetPlugPlayEvent( + ULONG Reserved1, + ULONG Reserved2, + struct _PLUGPLAY_EVENT_BLOCK *Buffer, + ULONG BufferSize +); + NTSTATUS STDCALL NtImpersonateClientOfPort( @@ -1497,6 +1506,14 @@ ZwOpenTimer( IN POBJECT_ATTRIBUTES ObjectAttributes ); +NTSTATUS +STDCALL +NtPlugPlayControl( + ULONG ControlCode, + PVOID Buffer, + ULONG BufferSize +); + NTSTATUS STDCALL NtPowerInformation( @@ -2049,7 +2066,7 @@ NTSTATUS STDCALL NtQuerySystemEnvironmentValue( IN PUNICODE_STRING Name, - OUT PVOID Value, + OUT PWSTR Value, ULONG Length, PULONG ReturnLength ); @@ -3307,23 +3324,6 @@ ZwYieldExecution( VOID ); -NTSTATUS -STDCALL -NtPlugPlayControl( - DWORD Unknown1, - DWORD Unknown2, - DWORD Unknown3 -); - -NTSTATUS -STDCALL -NtGetPlugPlayEvent( - ULONG Reserved1, - ULONG Reserved2, - PVOID Buffer, - ULONG BufferLength -); - NTSTATUS STDCALL NtSetSystemPowerState( @@ -3608,7 +3608,7 @@ NTSTATUS STDCALL NtQuerySection( IN HANDLE SectionHandle, - IN CINT SectionInformationClass, + IN SECTION_INFORMATION_CLASS SectionInformationClass, OUT PVOID SectionInformation, IN ULONG Length, OUT PULONG ResultLength diff --git a/reactos/include/ndk/zwtypes.h b/reactos/include/ndk/zwtypes.h index 8c6b8fe2b6e..4a6e39bf344 100644 --- a/reactos/include/ndk/zwtypes.h +++ b/reactos/include/ndk/zwtypes.h @@ -25,6 +25,9 @@ #define EVENT_PAIR_ALL_ACCESS (0x1F0000L) +#define OBJECT_TYPE_CREATE 0x0001 +#define OBJECT_TYPE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1) + /* For ProcessDeviceMap */ #define DOSDEVICE_DRIVE_UNKNOWN 0 #define DOSDEVICE_DRIVE_CALCULATE 1 @@ -36,7 +39,6 @@ /* ENUMERATIONS **************************************************************/ - typedef enum _HARDERROR_RESPONSE_OPTION { OptionAbortRetryIgnore, @@ -250,6 +252,7 @@ typedef enum _IO_COMPLETION_INFORMATION_CLASS typedef unsigned short LANGID; typedef LANGID *PLANGID; +struct _PLUGPLAY_EVENT_BLOCK; /* FIXME: Ask Filip if it's OK to define it */ /**** Information Structures ****/ /* diff --git a/reactos/include/ntos/ntpnp.h b/reactos/include/ntos/ntpnp.h index dc3de4fac26..977a36622c2 100644 --- a/reactos/include/ntos/ntpnp.h +++ b/reactos/include/ntos/ntpnp.h @@ -71,24 +71,6 @@ typedef enum _PLUGPLAY_EVENT_CATEGORY { MaxPlugEventCategory } PLUGPLAY_EVENT_CATEGORY; -#ifndef __USE_W32API -typedef enum _PNP_VETO_TYPE { - PNP_VetoTypeUnknown, - PNP_VetoLegacyDevice, - PNP_VetoPendingClose, - PNP_VetoWindowsApp, - PNP_VetoWindowsService, - PNP_VetoOutstandingOpen, - PNP_VetoDevice, - PNP_VetoDriver, - PNP_VetoIllegalDeviceRequest, - PNP_VetoInsufficientPower, - PNP_VetoNonDisableable, - PNP_VetoLegacyDriver, - PNP_VetoInsufficientRights, -} PNP_VETO_TYPE; -#endif - /* * Plug and Play event structure used by NtGetPlugPlayEvent. * @@ -184,14 +166,13 @@ typedef struct _PLUGPLAY_EVENT_BLOCK { * * Remarks * This function isn't multi-thread safe! - */ - NTSTATUS STDCALL NtGetPlugPlayEvent( ULONG Reserved1, ULONG Reserved2, PPLUGPLAY_EVENT_BLOCK Buffer, ULONG BufferSize); + */ /* * NtPlugPlayControl @@ -294,13 +275,6 @@ typedef struct _PLUGPLAY_DEVICE_STATUS_DATA ULONG Flags; /* DN_ see cfg.h */ } PLUGPLAY_DEVICE_STATUS_DATA, *PPLUGPLAY_DEVICE_STATUS_DATA; - -NTSTATUS STDCALL -NtPlugPlayControl( - ULONG ControlCode, - PVOID Buffer, - ULONG BufferSize); - #endif /* __GUIDS_ONLY__ */ #endif /* __NTPNP_H */ diff --git a/reactos/include/reactos/helper.h b/reactos/include/reactos/helper.h index 4c9f3f2a2bc..4bde71d9cb9 100644 --- a/reactos/include/reactos/helper.h +++ b/reactos/include/reactos/helper.h @@ -41,4 +41,77 @@ #define SECONDS_TO_100NS(seconds) (((LONGLONG)(seconds)) * MILLIS_TO_100NS(1000)) #define MINUTES_TO_100NS(minutes) (((LONGLONG)(minutes)) * SECONDS_TO_100NS(60)) #define HOURS_TO_100NS(hours) (((LONGLONG)(hours)) * MINUTES_TO_100NS(60)) +#define TYPE_ALIGNMENT(t) FIELD_OFFSET(struct { char x; t test; }, test) +#define InsertAscendingListFIFO(ListHead, Type, ListEntryField, NewEntry, SortField)\ +{\ + PLIST_ENTRY current;\ +\ + current = (ListHead)->Flink;\ + while (current != (ListHead))\ + {\ + if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField >\ + (NewEntry)->SortField)\ + {\ + break;\ + }\ + current = current->Flink;\ + }\ +\ + InsertTailList(current, &((NewEntry)->ListEntryField));\ +} + +#define InsertDescendingListFIFO(ListHead, Type, ListEntryField, NewEntry, SortField)\ +{\ + PLIST_ENTRY current;\ +\ + current = (ListHead)->Flink;\ + while (current != (ListHead))\ + {\ + if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField <\ + (NewEntry)->SortField)\ + {\ + break;\ + }\ + current = current->Flink;\ + }\ +\ + InsertTailList(current, &((NewEntry)->ListEntryField));\ +} + +#define InsertAscendingList(ListHead, Type, ListEntryField, NewEntry, SortField)\ +{\ + PLIST_ENTRY current;\ +\ + current = (ListHead)->Flink;\ + while (current != (ListHead))\ + {\ + if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField >=\ + (NewEntry)->SortField)\ + {\ + break;\ + }\ + current = current->Flink;\ + }\ +\ + InsertTailList(current, &((NewEntry)->ListEntryField));\ +} + +#define InsertDescendingList(ListHead, Type, ListEntryField, NewEntry, SortField)\ +{\ + PLIST_ENTRY current;\ +\ + current = (ListHead)->Flink;\ + while (current != (ListHead))\ + {\ + if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField <=\ + (NewEntry)->SortField)\ + {\ + break;\ + }\ + current = current->Flink;\ + }\ +\ + InsertTailList(current, &((NewEntry)->ListEntryField));\ +} + #endif diff --git a/reactos/w32api/include/ddk/ntifs.h b/reactos/w32api/include/ddk/ntifs.h index 5b57ca3497c..a46d615a4a3 100644 --- a/reactos/w32api/include/ddk/ntifs.h +++ b/reactos/w32api/include/ddk/ntifs.h @@ -29,7 +29,7 @@ #endif #include "ntddk.h" -#include "ntapi.h" +//#include "ntapi.h" #ifdef __cplusplus extern "C" { @@ -329,9 +329,6 @@ extern LARGE_INTEGER IoOtherTransferCount; #define PIN_NO_READ (4) #define PIN_IF_BCB (8) -#define PORT_CONNECT 0x0001 -#define PORT_ALL_ACCESS (STANDARD_RIGHTS_ALL |\ - PORT_CONNECT) /* also in winnt.h */ #define SEC_BASED 0x00200000 #define SEC_NO_CHANGE 0x00400000 @@ -539,6 +536,12 @@ typedef struct _SHARED_CACHE_MAP *PSHARED_CACHE_MAP; typedef struct _VACB *PVACB; typedef struct _VAD_HEADER *PVAD_HEADER; +typedef ULONG LBN; +typedef LBN *PLBN; + +typedef ULONG VBN; +typedef VBN *PVBN; + typedef struct _NOTIFY_SYNC { ULONG Unknown0; @@ -1239,6 +1242,28 @@ typedef struct _FSRTL_PER_STREAM_CONTEXT { #endif /* (VER_PRODUCTBUILD >= 2600) */ +typedef struct _BASE_MCB +{ + ULONG MaximumPairCount; + ULONG PairCount; + POOL_TYPE PoolType; + PVOID Mapping; +} BASE_MCB; +typedef BASE_MCB *PBASE_MCB; + +typedef struct _LARGE_MCB +{ + PFAST_MUTEX FastMutex; + BASE_MCB BaseMcb; +} LARGE_MCB; +typedef LARGE_MCB *PLARGE_MCB; + +typedef struct _MCB +{ + LARGE_MCB DummyFieldThatSizesThisStructureCorrectly; +} MCB; +typedef MCB *PMCB; + typedef struct _GENERATE_NAME_CONTEXT { USHORT Checksum; BOOLEAN CheckSumInserted; @@ -2556,6 +2581,15 @@ FsRtlIsNtstatusExpected ( IN NTSTATUS Ntstatus ); +#define NLS_MB_CODE_PAGE_TAG NlsMbCodePageTag +#define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag +#define NLS_MB_CODE_PAGE_TAG NlsMbOemCodePageTag +#define NLS_OEM_LEAD_BYTE_INFO NlsOemLeadByteInfo + +extern BOOLEAN NlsMbCodePageTag; +extern BOOLEAN NlsMbOemCodePageTag; +extern PUSHORT NlsOemLeadByteInfo; + #define FsRtlIsLeadDbcsCharacter(DBCS_CHAR) ( \ (BOOLEAN)((UCHAR)(DBCS_CHAR) < 0x80 ? FALSE : \ (NLS_MB_CODE_PAGE_TAG && \ diff --git a/reactos/w32api/include/ddk/winddk.h b/reactos/w32api/include/ddk/winddk.h index d2c1c4a911d..1c4388ed78b 100644 --- a/reactos/w32api/include/ddk/winddk.h +++ b/reactos/w32api/include/ddk/winddk.h @@ -5368,12 +5368,29 @@ RtlQueryRegistryValues( IN PVOID Context, IN PVOID Environment OPTIONAL); -NTOSAPI -VOID -DDKAPI -RtlRetrieveUlong( - IN OUT PULONG DestinationAddress, - IN PULONG SourceAddress); + +#define LONG_SIZE (sizeof(LONG)) +#define LONG_MASK (LONG_SIZE - 1) + +/* + * VOID + * RtlRetrieveUlong ( + * PULONG DestinationAddress, + * PULONG SourceAddress + * ); + */ +#define RtlRetrieveUlong(DestAddress,SrcAddress) \ + if ((ULONG_PTR)(SrcAddress) & LONG_MASK) \ + { \ + ((PUCHAR)(DestAddress))[0]=((PUCHAR)(SrcAddress))[0]; \ + ((PUCHAR)(DestAddress))[1]=((PUCHAR)(SrcAddress))[1]; \ + ((PUCHAR)(DestAddress))[2]=((PUCHAR)(SrcAddress))[2]; \ + ((PUCHAR)(DestAddress))[3]=((PUCHAR)(SrcAddress))[3]; \ + } \ + else \ + { \ + *((PULONG)(DestAddress))=*((PULONG)(SrcAddress)); \ + } NTOSAPI VOID