diff --git a/reactos/ChangeLog b/reactos/ChangeLog index c2936d4c1e8..a3c40877f04 100644 --- a/reactos/ChangeLog +++ b/reactos/ChangeLog @@ -1,3 +1,72 @@ +2002-11-13 Casper S. Hornstrup + + * drivers/bus/acpi/ospm/osl.c (acpi_os_readable, acpi_os_writable): + Match prototypes. + * include/ascii.h (AbortSystemShutdownA): Correct prototype. + * include/debug.h (assert): Wrap in #ifndef assert. + * include/funcs.h (AbortSystemShutdown): Remove duplicate prototype. + * include/ddk/rtltypes.h: Move ... + * include/ntos/rtltypes.h: ... here. + * include/ddk/rtl.h: Move ... + * include/ntos/rtl.h: ... here. + * include/ddk/zwtypes.h: Move ... + * include/ntos/zwtypes.h: ... here. + * include/ddk/zw.h: Move ... + * include/ntos/zw.h: ... here. + | include/ddk/cmfuncs.h: Remove file; Move NtCreateKey to ntos/zw.h. + * include/ntos.h: #include ntos/rtltypes.h, ntos/rtl.h, ntos/zwtypes.h, + and ntos/zw.h. + * include/unicode.h: (AbortSystemShutdownW): Correct prototype. + * include/ddk/ntddk.h: Include headers at new location; Don't include + removed files. + * include/defines.h: Wrap definitions in w32api in #ifndef __USE_W32API. + * include/ntos/zwtypes.h: Ditto. + * include/napi/lpc.h: Ditto. + * include/napi/shared_data.h: Ditto. + * include/napi/teb.h: Ditto. + * include/napi/types.h: Ditto. + * include/ntdll/ldr.h: Ditto. + * include/ntdll/rtl.h: Ditto. + * include/ntos/console.h: Ditto. + * include/ntos/disk.h: Ditto. + * include/ntos/except.h: Ditto. + * include/ntos/file.h: Ditto. + * include/ntos/gditypes.h: Ditto. + * include/ntos/heap.h: Ditto. + * include/ntos/keyboard.h: Ditto. + * include/ntos/mm.h: Ditto. + * include/ntos/ntdef.h: Ditto. + * include/ntos/ps.h: Ditto. + * include/ntos/registry.h: Ditto. + * include/ntos/security.h: Ditto. + * include/ntos/synch.h: Ditto. + * include/ntos/time.h: Ditto. + * include/ntos/types.h: Ditto. + * include/ntos/port.h: Ditto. + * lib/advapi32/misc/shutdown.c (AbortSystemShutdownW, + AbortSystemShutdownA): Correct prototype. + * lib/advapi32/reg/reg.c: #include ntos.h. + * lib/advapi32/sec/misc.c: Ditto. + * lib/advapi32/sec/sid.c: Ditto. + * lib/advapi32/service/sctrl.c: Ditto. + * lib/advapi32/token/token.c: Ditto. + * lib/kernel32/misc/dllmain.c: Ditto. + * ntoskrnl/ex/napi.c: Ditto. + * ntoskrnl/rtl/i386/exception.c: Ditto. + * lib/advapi32/sec/ac.c: Ditto. + (FindFirstFreeAce, GetAce): Change PACE* to PACE_HEADER*. + * lib/advapi32/service/scm.c (EnumServicesStatusExA, + EnumServicesStatusExW, QueryServiceStatusEx): Correct prototype. + * lib/ntdll/rtl/ppb.c (RtlDestroyProcessParameters): Match prototype. + * ntoskrnl/dbg/errinfo.c (DbgGetErrorText): Use %08x, not %08lx. + * ntoskrnl/io/arcname.c (IoCreateSystemRootLink): Use %u, not %lu. + * ntoskrnl/ke/main.c (ExpInitializeExecutive): Ditto. + * (_main): Use %d, not %ld. + * ntoskrnl/include/internal/i386/ke.h: Add #pragma GCC system_header. + * include/ddk/ntdef.h (NTSYSAPI, NTAPI, NTKERNELAPI): Define to STDCALL; + Check if already defined. + * include/base.h (STDCALL, CDECL, CALLBACK, PASCAL): Move to ntos/types.h. + 2002-11-13 Rick Gaiser * drivers/bus/isapnp/isapnp.c (FindNextReadPort): Increment Port before diff --git a/reactos/drivers/bus/acpi/ospm/osl.c b/reactos/drivers/bus/acpi/ospm/osl.c index f46fd173236..8e478b1c014 100644 --- a/reactos/drivers/bus/acpi/ospm/osl.c +++ b/reactos/drivers/bus/acpi/ospm/osl.c @@ -592,14 +592,14 @@ acpi_os_get_line(NATIVE_CHAR *buffer) return 0; } -BOOLEAN +u8 acpi_os_readable(void *ptr, u32 len) { /* Always readable */ return TRUE; } -BOOLEAN +u8 acpi_os_writable(void *ptr, u32 len) { /* Always writable */ diff --git a/reactos/include/ascii.h b/reactos/include/ascii.h index 50b0dc8b553..598da565c3c 100644 --- a/reactos/include/ascii.h +++ b/reactos/include/ascii.h @@ -2415,7 +2415,7 @@ InitiateSystemShutdownA( WINBOOL STDCALL AbortSystemShutdownA( - LPSTR lpMachineName + LPCSTR lpMachineName ); int diff --git a/reactos/include/base.h b/reactos/include/base.h index d57906e5378..91b43bb9956 100644 --- a/reactos/include/base.h +++ b/reactos/include/base.h @@ -56,17 +56,6 @@ typedef long LONG; #define CONST const -#ifdef i386 -#define STDCALL __attribute__ ((stdcall)) -#define CDECL __attribute((cdecl)) -#define CALLBACK WINAPI -#define PASCAL WINAPI -#else -#define STDCALL -#define CDECL -#define CALLBACK -#define PASCAL -#endif #define WINAPI STDCALL #define APIENTRY STDCALL #define WINGDIAPI diff --git a/reactos/include/ddk/cmfuncs.h b/reactos/include/ddk/cmfuncs.h deleted file mode 100644 index fee65aacca1..00000000000 --- a/reactos/include/ddk/cmfuncs.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * FUNCTION: Creates a registry key - * ARGUMENTS: - * KeyHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies the allowed or desired access to the key - * It can have a combination of the following values: - * KEY_READ | KEY_WRITE | KEY_EXECUTE | KEY_ALL_ACCESS - * or - * KEY_QUERY_VALUE The values of the key can be queried. - * KEY_SET_VALUE The values of the key can be modified. - * KEY_CREATE_SUB_KEYS The key may contain subkeys. - * KEY_ENUMERATE_SUB_KEYS Subkeys can be queried. - * KEY_NOTIFY - * KEY_CREATE_LINK A symbolic link to the key can be created. - * ObjectAttributes = The name of the key may be specified directly in the name field - * of object attributes or relative to a key in rootdirectory. - * TitleIndex = Might specify the position in the sequential order of subkeys. - * Class = Specifies the kind of data, for example REG_SZ for string data. [ ??? ] - * CreateOptions = Specifies additional options with which the key is created - * REG_OPTION_VOLATILE The key is not preserved across boots. - * REG_OPTION_NON_VOLATILE The key is preserved accross boots. - * REG_OPTION_CREATE_LINK The key is a symbolic link to another key. - * REG_OPTION_BACKUP_RESTORE Key is being opened or created for backup/restore operations. - * Disposition = Indicates if the call to NtCreateKey resulted in the creation of a key it - * can have the following values: REG_CREATED_NEW_KEY | REG_OPENED_EXISTING_KEY - * RETURNS: - * Status - */ - -NTSTATUS STDCALL -NtCreateKey(OUT PHANDLE KeyHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN ULONG TitleIndex, - IN PUNICODE_STRING Class OPTIONAL, - IN ULONG CreateOptions, - IN PULONG Disposition OPTIONAL); - -NTSTATUS STDCALL -ZwCreateKey(OUT PHANDLE KeyHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN ULONG TitleIndex, - IN PUNICODE_STRING Class OPTIONAL, - IN ULONG CreateOptions, - IN PULONG Disposition OPTIONAL); - diff --git a/reactos/include/ddk/ntddk.h b/reactos/include/ddk/ntddk.h index 59e7fbcf549..b5343f73f62 100644 --- a/reactos/include/ddk/ntddk.h +++ b/reactos/include/ddk/ntddk.h @@ -1,4 +1,4 @@ -/* $Id: ntddk.h,v 1.31 2002/09/08 10:47:44 chorns Exp $ +/* $Id: ntddk.h,v 1.32 2002/11/14 18:21:02 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -57,17 +57,16 @@ extern "C" #include #include #include -#include +#include #include -#include +#include #include #include -#include -#include +#include +#include #include #include -#include #if defined(__NTOSKRNL__) || defined(__NTDRIVER__) || defined(__NTHAL__) #include #include diff --git a/reactos/include/ddk/ntdef.h b/reactos/include/ddk/ntdef.h index 264adc16039..837c729523c 100644 --- a/reactos/include/ddk/ntdef.h +++ b/reactos/include/ddk/ntdef.h @@ -5,9 +5,16 @@ struct _KTHREAD; struct _ETHREAD; struct _EPROCESS; -#define NTKERNELAPI -#define NTSYSAPI -#define NTAPI +#ifndef NTKERNELAPI +#define NTKERNELAPI STDCAL +#endif +#ifndef NTSYSAPI +#define NTSYSAPI STDCALL +#endif + +#ifndef NTAPI +#define NTAPI STDCALL +#endif #endif diff --git a/reactos/include/ddk/rtl.h b/reactos/include/ddk/rtl.h deleted file mode 100644 index b010a6f86ad..00000000000 --- a/reactos/include/ddk/rtl.h +++ /dev/null @@ -1,2183 +0,0 @@ -/* $Id: rtl.h,v 1.69 2002/11/10 13:34:42 robd Exp $ - * - */ - -#ifndef __DDK_RTL_H -#define __DDK_RTL_H - -#if defined(__NTOSKRNL__) || defined(__NTDRIVER__) || defined(__NTHAL__) || defined(__NTDLL__) || defined (__NTAPP__) - -#include -#include - -#endif /* __NTOSKRNL__ || __NTDRIVER__ || __NTHAL__ || __NTDLL__ || __NTAPP__ */ - -#include - - - -/* - * PURPOSE: Flags for RtlQueryRegistryValues - */ -#define RTL_QUERY_REGISTRY_SUBKEY (0x00000001) -#define RTL_QUERY_REGISTRY_TOPKEY (0x00000002) -#define RTL_QUERY_REGISTRY_REQUIRED (0x00000004) -#define RTL_QUERY_REGISTRY_NOVALUE (0x00000008) -#define RTL_QUERY_REGISTRY_NOEXPAND (0x00000010) -#define RTL_QUERY_REGISTRY_DIRECT (0x00000020) -#define RTL_QUERY_REGISTRY_DELETE (0x00000040) - - -/* - * PURPOSE: Used with RtlCheckRegistryKey, RtlCreateRegistryKey, - * RtlDeleteRegistryKey - */ -#define RTL_REGISTRY_ABSOLUTE 0 -#define RTL_REGISTRY_SERVICES 1 -#define RTL_REGISTRY_CONTROL 2 -#define RTL_REGISTRY_WINDOWS_NT 3 -#define RTL_REGISTRY_DEVICEMAP 4 -#define RTL_REGISTRY_USER 5 -#define RTL_REGISTRY_ENUM 6 // ReactOS specific: Used internally in kernel only -#define RTL_REGISTRY_MAXIMUM 7 - -#define RTL_REGISTRY_HANDLE 0x40000000 -#define RTL_REGISTRY_OPTIONAL 0x80000000 - - -#define SHORT_SIZE (sizeof(USHORT)) -#define SHORT_MASK (SHORT_SIZE-1) -#define LONG_SIZE (sizeof(ULONG)) -#define LONG_MASK (LONG_SIZE-1) -#define LOWBYTE_MASK 0x00FF - -#define FIRSTBYTE(Value) ((Value) & LOWBYTE_MASK) -#define SECONDBYTE(Value) (((Value) >> 8) & LOWBYTE_MASK) -#define THIRDBYTE(Value) (((Value) >> 16) & LOWBYTE_MASK) -#define FOURTHBYTE(Value) (((Value) >> 24) & LOWBYTE_MASK) - -/* FIXME: reverse byte-order on big-endian machines (e.g. MIPS) */ -#define SHORT_LEAST_SIGNIFICANT_BIT 0 -#define SHORT_MOST_SIGNIFICANT_BIT 1 - -#define LONG_LEAST_SIGNIFICANT_BIT 0 -#define LONG_3RD_MOST_SIGNIFICANT_BIT 1 -#define LONG_2RD_MOST_SIGNIFICANT_BIT 2 -#define LONG_MOST_SIGNIFICANT_BIT 3 - - - -#if defined(__NTOSKRNL__) || defined(__NTDLL__) -#define NLS_MB_CODE_PAGE_TAG NlsMbCodePageTag -#define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag -#else -#define NLS_MB_CODE_PAGE_TAG (*NlsMbCodePageTag) -#define NLS_MB_OEM_CODE_PAGE_TAG (*NlsMbOemCodePageTag) -#endif /* __NTOSKRNL__ || __NTDLL__ */ - -extern BOOLEAN NLS_MB_CODE_PAGE_TAG; -extern BOOLEAN NLS_MB_OEM_CODE_PAGE_TAG; - - -/* - * NOTE: ReactOS extensions - */ -#define RtlMin(X,Y) (((X) < (Y))? (X) : (Y)) -#define RtlMax(X,Y) (((X) > (Y))? (X) : (Y)) -#define RtlMin3(X,Y,Z) (((X) < (Y)) ? RtlMin(X,Z) : RtlMin(Y,Z)) -#define RtlMax3(X,Y,Z) (((X) > (Y)) ? RtlMax(X,Z) : RtlMax(Y,Z)) - - -/* - * VOID - * InitializeObjectAttributes ( - * POBJECT_ATTRIBUTES InitializedAttributes, - * PUNICODE_STRING ObjectName, - * ULONG Attributes, - * HANDLE RootDirectory, - * PSECURITY_DESCRIPTOR SecurityDescriptor - * ); - * - * FUNCTION: Sets up a parameter of type OBJECT_ATTRIBUTES for a - * subsequent call to ZwCreateXXX or ZwOpenXXX - * ARGUMENTS: - * InitializedAttributes (OUT) = Caller supplied storage for the - * object attributes - * ObjectName = Full path name for object - * Attributes = Attributes for the object - * RootDirectory = Where the object should be placed or NULL - * SecurityDescriptor = Ignored - */ -#define InitializeObjectAttributes(p,n,a,r,s) \ -{ \ - (p)->Length = sizeof(OBJECT_ATTRIBUTES); \ - (p)->ObjectName = n; \ - (p)->Attributes = a; \ - (p)->RootDirectory = r; \ - (p)->SecurityDescriptor = s; \ - (p)->SecurityQualityOfService = NULL; \ -} - - -/* - * VOID - * InitializeListHead ( - * PLIST_ENTRY ListHead - * ); - * - * FUNCTION: Initializes a double linked list - * ARGUMENTS: - * ListHead = Caller supplied storage for the head of the list - */ -#define InitializeListHead(ListHead) \ -{ \ - (ListHead)->Flink = (ListHead); \ - (ListHead)->Blink = (ListHead); \ -} - - -/* - * VOID - * InsertHeadList ( - * PLIST_ENTRY ListHead, - * PLIST_ENTRY Entry - * ); - * - * FUNCTION: Inserts an entry in a double linked list - * ARGUMENTS: - * ListHead = Head of the list - * Entry = Entry to insert - */ -#define InsertHeadList(ListHead, ListEntry) \ -{ \ - PLIST_ENTRY OldFlink; \ - OldFlink = (ListHead)->Flink; \ - (ListEntry)->Flink = OldFlink; \ - (ListEntry)->Blink = (ListHead); \ - OldFlink->Blink = (ListEntry); \ - (ListHead)->Flink = (ListEntry); \ - assert((ListEntry) != NULL); \ - assert((ListEntry)->Blink!=NULL); \ - assert((ListEntry)->Blink->Flink == (ListEntry)); \ - assert((ListEntry)->Flink != NULL); \ - assert((ListEntry)->Flink->Blink == (ListEntry)); \ -} - - -/* - * VOID - * InsertTailList ( - * PLIST_ENTRY ListHead, - * PLIST_ENTRY Entry - * ); - * - * FUNCTION: - * Inserts an entry in a double linked list - * - * ARGUMENTS: - * ListHead = Head of the list - * Entry = Entry to insert - */ -#define InsertTailList(ListHead, ListEntry) \ -{ \ - PLIST_ENTRY OldBlink; \ - OldBlink = (ListHead)->Blink; \ - (ListEntry)->Flink = (ListHead); \ - (ListEntry)->Blink = OldBlink; \ - OldBlink->Flink = (ListEntry); \ - (ListHead)->Blink = (ListEntry); \ - assert((ListEntry) != NULL); \ - assert((ListEntry)->Blink != NULL); \ - assert((ListEntry)->Blink->Flink == (ListEntry)); \ - assert((ListEntry)->Flink != NULL); \ - assert((ListEntry)->Flink->Blink == (ListEntry)); \ -} - -/* - * BOOLEAN - * IsListEmpty ( - * PLIST_ENTRY ListHead - * ); - * - * FUNCTION: - * Checks if a double linked list is empty - * - * ARGUMENTS: - * ListHead = Head of the list -*/ -#define IsListEmpty(ListHead) \ - ((ListHead)->Flink == (ListHead)) - - -/* - * PSINGLE_LIST_ENTRY - * PopEntryList ( - * PSINGLE_LIST_ENTRY ListHead - * ); - * - * FUNCTION: - * Removes an entry from the head of a single linked list - * - * ARGUMENTS: - * ListHead = Head of the list - * - * RETURNS: - * The removed entry - */ -/* -#define PopEntryList(ListHead) \ - (ListHead)->Next; \ - { \ - PSINGLE_LIST_ENTRY FirstEntry; \ - FirstEntry = (ListHead)->Next; \ - if (FirstEntry != NULL) \ - { \ - (ListHead)->Next = FirstEntry->Next; \ - } \ - } -*/ -static -inline -PSINGLE_LIST_ENTRY - PopEntryList( - PSINGLE_LIST_ENTRY ListHead - ) -{ - PSINGLE_LIST_ENTRY ListEntry; - - ListEntry = ListHead->Next; - if (ListEntry!=NULL) - { - ListHead->Next = ListEntry->Next; - } - return ListEntry; -} - -/* -VOID -PushEntryList ( - PSINGLE_LIST_ENTRY ListHead, - PSINGLE_LIST_ENTRY Entry - ); -*/ -/* -#define PushEntryList(ListHead,Entry) \ - (Entry)->Next = (ListHead)->Next; \ - (ListHead)->Next = (Entry) -*/ -static -inline -VOID -PushEntryList ( - PSINGLE_LIST_ENTRY ListHead, - PSINGLE_LIST_ENTRY Entry - ) -{ - Entry->Next = ListHead->Next; - ListHead->Next = Entry; -} - - -/* - * An ReactOS extension - */ -static -inline -PSINGLE_LIST_ENTRY - PopEntrySList( - PSLIST_HEADER ListHead - ) -{ - PSINGLE_LIST_ENTRY ListEntry; - - ListEntry = ListHead->s.Next.Next; - if (ListEntry!=NULL) - { - ListHead->s.Next.Next = ListEntry->Next; - ListHead->s.Depth++; - ListHead->s.Sequence++; - } - return ListEntry; -} - - -/* - * An ReactOS extension - */ -static -inline -VOID -PushEntrySList ( - PSLIST_HEADER ListHead, - PSINGLE_LIST_ENTRY Entry - ) -{ - Entry->Next = ListHead->s.Next.Next; - ListHead->s.Next.Next = Entry; - ListHead->s.Depth++; - ListHead->s.Sequence++; -} - - -/* - *VOID - *RemoveEntryList ( - * PLIST_ENTRY Entry - * ); - * - * FUNCTION: - * Removes an entry from a double linked list - * - * ARGUMENTS: - * ListEntry = Entry to remove - */ -#define RemoveEntryList(ListEntry) \ -{ \ - PLIST_ENTRY OldFlink; \ - PLIST_ENTRY OldBlink; \ - assert((ListEntry) != NULL); \ - assert((ListEntry)->Blink!=NULL); \ - assert((ListEntry)->Blink->Flink == (ListEntry)); \ - assert((ListEntry)->Flink != NULL); \ - assert((ListEntry)->Flink->Blink == (ListEntry)); \ - OldFlink = (ListEntry)->Flink; \ - OldBlink = (ListEntry)->Blink; \ - OldFlink->Blink = OldBlink; \ - OldBlink->Flink = OldFlink; \ - (ListEntry)->Flink = NULL; \ - (ListEntry)->Blink = NULL; \ -} - - -/* - * PLIST_ENTRY - * RemoveHeadList ( - * PLIST_ENTRY ListHead - * ); - * - * FUNCTION: - * Removes the head entry from a double linked list - * - * ARGUMENTS: - * ListHead = Head of the list - * - * RETURNS: - * The removed entry - */ -/* -#define RemoveHeadList(ListHead) \ - (ListHead)->Flink; \ - {RemoveEntryList((ListHead)->Flink)} -*/ -/* -PLIST_ENTRY -RemoveHeadList ( - PLIST_ENTRY ListHead - ); -*/ - -static -inline -PLIST_ENTRY -RemoveHeadList ( - PLIST_ENTRY ListHead - ) -{ - PLIST_ENTRY Old; - PLIST_ENTRY OldFlink; - PLIST_ENTRY OldBlink; - - Old = ListHead->Flink; - - OldFlink = ListHead->Flink->Flink; - OldBlink = ListHead->Flink->Blink; - OldFlink->Blink = OldBlink; - OldBlink->Flink = OldFlink; - if (Old != ListHead) - { - Old->Flink = NULL; - Old->Blink = NULL; - } - - return(Old); -} - - -/* - * PLIST_ENTRY - * RemoveTailList ( - * PLIST_ENTRY ListHead - * ); - * - * FUNCTION: - * Removes the tail entry from a double linked list - * - * ARGUMENTS: - * ListHead = Head of the list - * - * RETURNS: - * The removed entry - */ -/* -#define RemoveTailList(ListHead) \ - (ListHead)->Blink; \ - {RemoveEntryList((ListHead)->Blink)} -*/ -/* -PLIST_ENTRY -RemoveTailList ( - PLIST_ENTRY ListHead - ); -*/ - -static -inline -PLIST_ENTRY -RemoveTailList ( - PLIST_ENTRY ListHead - ) -{ - PLIST_ENTRY Old; - PLIST_ENTRY OldFlink; - PLIST_ENTRY OldBlink; - - Old = ListHead->Blink; - - OldFlink = ListHead->Blink->Flink; - OldBlink = ListHead->Blink->Blink; - OldFlink->Blink = OldBlink; - OldBlink->Flink = OldFlink; - if (Old != ListHead) - { - Old->Flink = NULL; - Old->Blink = NULL; - } - - return(Old); -} - - -NTSTATUS -STDCALL -RtlAddAtomToAtomTable ( - IN PRTL_ATOM_TABLE AtomTable, - IN PWSTR AtomName, - OUT PRTL_ATOM Atom - ); - -PVOID STDCALL -RtlAllocateHeap ( - HANDLE Heap, - ULONG Flags, - ULONG Size - ); - -WCHAR -STDCALL -RtlAnsiCharToUnicodeChar ( - CHAR AnsiChar - ); - -ULONG -STDCALL -RtlAnsiStringToUnicodeSize ( - PANSI_STRING AnsiString - ); - -NTSTATUS -STDCALL -RtlAnsiStringToUnicodeString ( - PUNICODE_STRING DestinationString, - PANSI_STRING SourceString, - BOOLEAN AllocateDestinationString - ); - -NTSTATUS -STDCALL -RtlAppendAsciizToString( - PSTRING Destination, - PCSZ Source - ); - -NTSTATUS -STDCALL -RtlAppendStringToString ( - PSTRING Destination, - PSTRING Source - ); - -NTSTATUS -STDCALL -RtlAppendUnicodeStringToString ( - PUNICODE_STRING Destination, - PUNICODE_STRING Source - ); - -NTSTATUS -STDCALL -RtlAppendUnicodeToString ( - PUNICODE_STRING Destination, - PWSTR Source - ); - -BOOLEAN -STDCALL -RtlAreBitsClear ( - PRTL_BITMAP BitMapHeader, - ULONG StartingIndex, - ULONG Length - ); - -BOOLEAN -STDCALL -RtlAreBitsSet ( - PRTL_BITMAP BitMapHeader, - ULONG StartingIndex, - ULONG Length - ); - -VOID -STDCALL -RtlAssert ( - PVOID FailedAssertion, - PVOID FileName, - ULONG LineNumber, - PCHAR Message - ); - -NTSTATUS -STDCALL -RtlCharToInteger ( - PCSZ String, - ULONG Base, - PULONG Value - ); - -NTSTATUS -STDCALL -RtlCheckRegistryKey ( - ULONG RelativeTo, - PWSTR Path - ); - -VOID -STDCALL -RtlClearAllBits ( - IN PRTL_BITMAP BitMapHeader - ); - -VOID -STDCALL -RtlClearBits ( - IN PRTL_BITMAP BitMapHeader, - IN ULONG StartingIndex, - IN ULONG NumberToClear - ); - -DWORD -STDCALL -RtlCompactHeap ( - HANDLE hheap, - DWORD flags - ); - -ULONG -STDCALL -RtlCompareMemory ( - PVOID Source1, - PVOID Source2, - ULONG Length - ); - -LONG -STDCALL -RtlCompareString ( - PSTRING String1, - PSTRING String2, - BOOLEAN CaseInsensitive - ); - -LONG -STDCALL -RtlCompareUnicodeString ( - PUNICODE_STRING String1, - PUNICODE_STRING String2, - BOOLEAN BaseInsensitive - ); - -NTSTATUS STDCALL -RtlCompressBuffer(IN USHORT CompressionFormatAndEngine, - IN PUCHAR UncompressedBuffer, - IN ULONG UncompressedBufferSize, - OUT PUCHAR CompressedBuffer, - IN ULONG CompressedBufferSize, - IN ULONG UncompressedChunkSize, - OUT PULONG FinalCompressedSize, - IN PVOID WorkSpace); - -NTSTATUS STDCALL -RtlCompressChunks(IN PUCHAR UncompressedBuffer, - IN ULONG UncompressedBufferSize, - OUT PUCHAR CompressedBuffer, - IN ULONG CompressedBufferSize, - IN OUT PCOMPRESSED_DATA_INFO CompressedDataInfo, - IN ULONG CompressedDataInfoLength, - IN PVOID WorkSpace); - -LARGE_INTEGER STDCALL -RtlConvertLongToLargeInteger(IN LONG SignedInteger); - -NTSTATUS STDCALL -RtlConvertSidToUnicodeString(IN OUT PUNICODE_STRING String, - IN PSID Sid, - IN BOOLEAN AllocateString); - -LARGE_INTEGER STDCALL -RtlConvertUlongToLargeInteger(IN ULONG UnsignedInteger); - -#if 0 -VOID -RtlCopyBytes ( - PVOID Destination, - CONST VOID * Source, - ULONG Length - ); - -VOID -RtlCopyMemory ( - VOID * Destination, - CONST VOID * Source, - ULONG Length - ); -#endif - -#define RtlCopyMemory(Destination,Source,Length) \ - memcpy((Destination),(Source),(Length)) - -#define RtlCopyBytes RtlCopyMemory - -VOID STDCALL -RtlCopyLuid(IN PLUID LuidDest, - IN PLUID LuidSrc); - -VOID STDCALL -RtlCopyLuidAndAttributesArray(ULONG Count, - PLUID_AND_ATTRIBUTES Src, - PLUID_AND_ATTRIBUTES Dest); - -NTSTATUS STDCALL -RtlCopySid(ULONG BufferLength, - PSID Dest, - PSID Src); - -NTSTATUS STDCALL -RtlCopySidAndAttributesArray(ULONG Count, - PSID_AND_ATTRIBUTES Src, - ULONG SidAreaSize, - PSID_AND_ATTRIBUTES Dest, - PVOID SidArea, - PVOID* RemainingSidArea, - PULONG RemainingSidAreaSize); - -VOID STDCALL -RtlCopyString(PSTRING DestinationString, - PSTRING SourceString); - -VOID STDCALL -RtlCopyUnicodeString(PUNICODE_STRING DestinationString, - PUNICODE_STRING SourceString); - -NTSTATUS STDCALL -RtlCreateAtomTable(IN ULONG TableSize, - IN OUT PRTL_ATOM_TABLE *AtomTable); - -HANDLE -STDCALL -RtlCreateHeap ( - ULONG Flags, - PVOID BaseAddress, - ULONG SizeToReserve, // dwMaximumSize - ULONG SizeToCommit, // dwInitialSize - PVOID Unknown, - PRTL_HEAP_DEFINITION Definition - ); - -NTSTATUS -STDCALL -RtlCreateRegistryKey ( - ULONG RelativeTo, - PWSTR Path - ); - -NTSTATUS -STDCALL -RtlCreateSecurityDescriptor ( - PSECURITY_DESCRIPTOR SecurityDescriptor, - ULONG Revision - ); - -BOOLEAN -STDCALL -RtlCreateUnicodeString ( - OUT PUNICODE_STRING Destination, - IN PWSTR Source - ); - -BOOLEAN STDCALL -RtlCreateUnicodeStringFromAsciiz (OUT PUNICODE_STRING Destination, - IN PCSZ Source); - -NTSTATUS -STDCALL -RtlCustomCPToUnicodeN ( - PRTL_NLS_DATA NlsData, - PWCHAR UnicodeString, - ULONG UnicodeSize, - PULONG ResultSize, - PCHAR CustomString, - ULONG CustomSize - ); - -NTSTATUS STDCALL -RtlDecompressBuffer(IN USHORT CompressionFormat, - OUT PUCHAR UncompressedBuffer, - IN ULONG UncompressedBufferSize, - IN PUCHAR CompressedBuffer, - IN ULONG CompressedBufferSize, - OUT PULONG FinalUncompressedSize); - -NTSTATUS STDCALL -RtlDecompressChunks(OUT PUCHAR UncompressedBuffer, - IN ULONG UncompressedBufferSize, - IN PUCHAR CompressedBuffer, - IN ULONG CompressedBufferSize, - IN PUCHAR CompressedTail, - IN ULONG CompressedTailSize, - IN PCOMPRESSED_DATA_INFO CompressedDataInfo); - -NTSTATUS STDCALL -RtlDecompressFragment(IN USHORT CompressionFormat, - OUT PUCHAR UncompressedFragment, - IN ULONG UncompressedFragmentSize, - IN PUCHAR CompressedBuffer, - IN ULONG CompressedBufferSize, - IN ULONG FragmentOffset, - OUT PULONG FinalUncompressedSize, - IN PVOID WorkSpace); - -NTSTATUS STDCALL -RtlDeleteAtomFromAtomTable(IN PRTL_ATOM_TABLE AtomTable, - IN RTL_ATOM Atom); - -NTSTATUS STDCALL -RtlDeleteRegistryValue(IN ULONG RelativeTo, - IN PWSTR Path, - IN PWSTR ValueName); - -NTSTATUS STDCALL -RtlDescribeChunk(IN USHORT CompressionFormat, - IN OUT PUCHAR *CompressedBuffer, - IN PUCHAR EndOfCompressedBufferPlus1, - OUT PUCHAR *ChunkBuffer, - OUT PULONG ChunkSize); - -NTSTATUS STDCALL -RtlDestroyAtomTable(IN PRTL_ATOM_TABLE AtomTable); - -BOOL STDCALL -RtlDestroyHeap(HANDLE hheap); - -NTSTATUS -STDCALL -RtlDowncaseUnicodeString ( - IN OUT PUNICODE_STRING DestinationString, - IN PUNICODE_STRING SourceString, - IN BOOLEAN AllocateDestinationString - ); - -NTSTATUS -STDCALL -RtlEmptyAtomTable ( - IN PRTL_ATOM_TABLE AtomTable, - IN BOOLEAN DeletePinned - ); - -LARGE_INTEGER -STDCALL -RtlEnlargedIntegerMultiply ( - LONG Multiplicand, - LONG Multiplier - ); - -ULONG -STDCALL -RtlEnlargedUnsignedDivide ( - ULARGE_INTEGER Dividend, - ULONG Divisor, - PULONG Remainder - ); - -LARGE_INTEGER -STDCALL -RtlEnlargedUnsignedMultiply ( - ULONG Multiplicand, - ULONG Multiplier - ); - -BOOLEAN STDCALL -RtlEqualLuid(IN PLUID Luid1, - IN PLUID Luid2); - -BOOLEAN -STDCALL -RtlEqualString ( - PSTRING String1, - PSTRING String2, - BOOLEAN CaseInSensitive - ); - -BOOLEAN -STDCALL -RtlEqualUnicodeString ( - PUNICODE_STRING String1, - PUNICODE_STRING String2, - BOOLEAN CaseInSensitive - ); - -LARGE_INTEGER -STDCALL -RtlExtendedIntegerMultiply ( - LARGE_INTEGER Multiplicand, - LONG Multiplier - ); - -LARGE_INTEGER -STDCALL -RtlExtendedLargeIntegerDivide ( - LARGE_INTEGER Dividend, - ULONG Divisor, - PULONG Remainder - ); - -LARGE_INTEGER -STDCALL -RtlExtendedMagicDivide ( - LARGE_INTEGER Dividend, - LARGE_INTEGER MagicDivisor, - CCHAR ShiftCount - ); - -VOID -STDCALL -RtlFillMemory ( - PVOID Destination, - ULONG Length, - UCHAR Fill - ); - -VOID -STDCALL -RtlFillMemoryUlong ( - PVOID Destination, - ULONG Length, - ULONG Fill - ); - -ULONG -STDCALL -RtlFindClearBits ( - PRTL_BITMAP BitMapHeader, - ULONG NumberToFind, - ULONG HintIndex - ); - -ULONG -STDCALL -RtlFindClearBitsAndSet ( - PRTL_BITMAP BitMapHeader, - ULONG NumberToFind, - ULONG HintIndex - ); - -ULONG -STDCALL -RtlFindFirstRunClear ( - PRTL_BITMAP BitMapHeader, - PULONG StartingIndex - ); - -ULONG -STDCALL -RtlFindFirstRunSet ( - PRTL_BITMAP BitMapHeader, - PULONG StartingIndex - ); - -ULONG -STDCALL -RtlFindLongestRunClear ( - PRTL_BITMAP BitMapHeader, - PULONG StartingIndex - ); - -ULONG -STDCALL -RtlFindLongestRunSet ( - PRTL_BITMAP BitMapHeader, - PULONG StartingIndex - ); - -NTSTATUS -STDCALL -RtlFindMessage ( - IN PVOID BaseAddress, - IN ULONG Type, - IN ULONG Language, - IN ULONG MessageId, - OUT PRTL_MESSAGE_RESOURCE_ENTRY *MessageResourceEntry - ); - -ULONG -STDCALL -RtlFindSetBits ( - PRTL_BITMAP BitMapHeader, - ULONG NumberToFind, - ULONG HintIndex - ); - -ULONG -STDCALL -RtlFindSetBitsAndClear ( - PRTL_BITMAP BitMapHeader, - ULONG NumberToFind, - ULONG HintIndex - ); - -NTSTATUS -STDCALL -RtlFormatCurrentUserKeyPath ( - IN OUT PUNICODE_STRING KeyPath - ); - -VOID -STDCALL -RtlFreeAnsiString ( - PANSI_STRING AnsiString - ); - -BOOLEAN -STDCALL -RtlFreeHeap ( - HANDLE Heap, - ULONG Flags, - PVOID Address - ); - -VOID -STDCALL -RtlFreeOemString ( - POEM_STRING OemString - ); - -VOID -STDCALL -RtlFreeUnicodeString ( - PUNICODE_STRING UnicodeString - ); - -VOID STDCALL -RtlGenerate8dot3Name(IN PUNICODE_STRING Name, - IN BOOLEAN AllowExtendedCharacters, - IN OUT PGENERATE_NAME_CONTEXT Context, - OUT PUNICODE_STRING Name8dot3); - -VOID -RtlGetCallersAddress ( - PVOID * CallersAddress - ); - -NTSTATUS STDCALL -RtlGetCompressionWorkSpaceSize(IN USHORT CompressionFormatAndEngine, - OUT PULONG CompressBufferAndWorkSpaceSize, - OUT PULONG CompressFragmentWorkSpaceSize); - -VOID -STDCALL -RtlGetDefaultCodePage ( - PUSHORT AnsiCodePage, - PUSHORT OemCodePage - ); - -#define RtlGetProcessHeap() (NtCurrentPeb()->ProcessHeap) - -PVOID -STDCALL -RtlImageDirectoryEntryToData ( - PVOID BaseAddress, - BOOLEAN bFlag, - ULONG Directory, - PULONG Size - ); - -PIMAGE_NT_HEADERS -STDCALL -RtlImageNtHeader ( - PVOID BaseAddress - ); - -PIMAGE_SECTION_HEADER -STDCALL -RtlImageRvaToSection ( - PIMAGE_NT_HEADERS NtHeader, - PVOID BaseAddress, - ULONG Rva - ); - -ULONG -STDCALL -RtlImageRvaToVa ( - PIMAGE_NT_HEADERS NtHeader, - PVOID BaseAddress, - ULONG Rva, - PIMAGE_SECTION_HEADER *SectionHeader - ); - -VOID -STDCALL -RtlInitAnsiString ( - PANSI_STRING DestinationString, - PCSZ SourceString - ); - -VOID -STDCALL -RtlInitString ( - PSTRING DestinationString, - PCSZ SourceString - ); - -VOID -STDCALL -RtlInitUnicodeString ( - PUNICODE_STRING DestinationString, - PCWSTR SourceString - ); - -/* -VOID -InitializeUnicodeString ( - PUNICODE_STRING DestinationString, - USHORT Lenght, - USHORT MaximumLength, - PCWSTR Buffer - ); - - Initialize an UNICODE_STRING from its fields. Use when you know the values of - all the fields in advance - - */ - -#define InitializeUnicodeString(__PDEST_STRING__,__LENGTH__,__MAXLENGTH__,__BUFFER__) \ -{ \ - (__PDEST_STRING__)->Length = (__LENGTH__); \ - (__PDEST_STRING__)->MaximumLength = (__MAXLENGTH__); \ - (__PDEST_STRING__)->Buffer = (__BUFFER__); \ -} - -/* -VOID -RtlInitUnicodeStringFromLiteral ( - PUNICODE_STRING DestinationString, - PCWSTR SourceString - ); - - Initialize an UNICODE_STRING from a wide string literal. WARNING: use only with - string literals and statically initialized arrays, it will calculate the wrong - length otherwise - - */ - -#define RtlInitUnicodeStringFromLiteral(__PDEST_STRING__,__SOURCE_STRING__) \ - InitializeUnicodeString( \ - (__PDEST_STRING__), \ - sizeof(__SOURCE_STRING__) - sizeof(WCHAR), \ - sizeof(__SOURCE_STRING__), \ - (__SOURCE_STRING__) \ - ) - -/* - Static initializer for UNICODE_STRING variables. Usage: - - UNICODE_STRING wstr = UNICODE_STRING_INITIALIZER(L"string"); - -*/ - -#define UNICODE_STRING_INITIALIZER(__SOURCE_STRING__) \ -{ \ - sizeof((__SOURCE_STRING__)) - sizeof(WCHAR), \ - sizeof((__SOURCE_STRING__)), \ - (__SOURCE_STRING__) \ -} - -/* - Initializer for empty UNICODE_STRING variables. Usage: - - UNICODE_STRING wstr = EMPTY_UNICODE_STRING; - -*/ -#define EMPTY_UNICODE_STRING {0, 0, NULL} - -VOID -STDCALL -RtlInitializeBitMap ( - IN OUT PRTL_BITMAP BitMapHeader, - IN PULONG BitMapBuffer, - IN ULONG SizeOfBitMap - ); - -NTSTATUS -STDCALL -RtlInitializeContext ( - IN HANDLE ProcessHandle, - IN PCONTEXT Context, - IN PVOID Parameter, - IN PTHREAD_START_ROUTINE StartAddress, - IN OUT PINITIAL_TEB InitialTeb - ); - -VOID -STDCALL -RtlInitializeGenericTable ( - IN OUT PRTL_GENERIC_TABLE Table, - IN PVOID CompareRoutine, - IN PVOID AllocateRoutine, - IN PVOID FreeRoutine, - IN ULONG UserParameter - ); - -PVOID -STDCALL -RtlInsertElementGenericTable ( - IN OUT PRTL_GENERIC_TABLE Table, - IN PVOID Element, - IN ULONG ElementSize, - IN ULONG Unknown4 - ); - -NTSTATUS -STDCALL -RtlIntegerToChar ( - IN ULONG Value, - IN ULONG Base, - IN ULONG Length, - IN OUT PCHAR String - ); - -NTSTATUS -STDCALL -RtlIntegerToUnicodeString ( - IN ULONG Value, - IN ULONG Base, - IN OUT PUNICODE_STRING String - ); - -BOOLEAN -STDCALL -RtlIsGenericTableEmpty ( - IN PRTL_GENERIC_TABLE Table - ); - -BOOLEAN STDCALL -RtlIsNameLegalDOS8Dot3(IN PUNICODE_STRING UnicodeName, - IN PANSI_STRING AnsiName, - OUT PBOOLEAN SpacesFound); - -LARGE_INTEGER -STDCALL -RtlLargeIntegerAdd ( - LARGE_INTEGER Addend1, - LARGE_INTEGER Addend2 - ); - -/* - * VOID - * RtlLargeIntegerAnd ( - * PLARGE_INTEGER Result, - * LARGE_INTEGER Source, - * LARGE_INTEGER Mask - * ); - */ -#define RtlLargeIntegerAnd(Result, Source, Mask) \ -{ \ - Result.HighPart = Source.HighPart & Mask.HighPart; \ - Result.LowPart = Source.LowPart & Mask.LowPart; \ -} - -LARGE_INTEGER -STDCALL -RtlLargeIntegerArithmeticShift ( - LARGE_INTEGER LargeInteger, - CCHAR ShiftCount - ); - -LARGE_INTEGER -STDCALL -RtlLargeIntegerDivide ( - LARGE_INTEGER Dividend, - LARGE_INTEGER Divisor, - PLARGE_INTEGER Remainder - ); - -/* - * BOOLEAN - * RtlLargeIntegerEqualTo ( - * LARGE_INTEGER Operand1, - * LARGE_INTEGER Operand2 - * ); - */ -#define RtlLargeIntegerEqualTo(X,Y) \ - (!(((X).LowPart ^ (Y).LowPart) | ((X).HighPart ^ (Y).HighPart))) - -/* - * BOOLEAN - * RtlLargeIntegerEqualToZero ( - * LARGE_INTEGER Operand - * ); - */ -#define RtlLargeIntegerEqualToZero(X) \ - (!((X).LowPart | (X).HighPart)) - -/* - * BOOLEAN - * RtlLargeIntegerGreaterThan ( - * LARGE_INTEGER Operand1, - * LARGE_INTEGER Operand2 - * ); - */ -#define RtlLargeIntegerGreaterThan(X,Y) \ - ((((X).HighPart == (Y).HighPart) && ((X).LowPart > (Y).LowPart)) || \ - ((X).HighPart > (Y).HighPart)) - -/* - * BOOLEAN - * RtlLargeIntegerGreaterThanOrEqualTo ( - * LARGE_INTEGER Operand1, - * LARGE_INTEGER Operand2 - * ); - */ -#define RtlLargeIntegerGreaterThanOrEqualTo(X,Y) \ - ((((X).HighPart == (Y).HighPart) && ((X).LowPart >= (Y).LowPart)) || \ - ((X).HighPart > (Y).HighPart)) - -/* - * BOOLEAN - * RtlLargeIntegerGreaterThanOrEqualToZero ( - * LARGE_INTEGER Operand1 - * ); - */ -#define RtlLargeIntegerGreaterOrEqualToZero(X) \ - ((X).HighPart >= 0) - -/* - * BOOLEAN - * RtlLargeIntegerGreaterThanZero ( - * LARGE_INTEGER Operand1 - * ); - */ -#define RtlLargeIntegerGreaterThanZero(X) \ - ((((X).HighPart == 0) && ((X).LowPart > 0)) || \ - ((X).HighPart > 0 )) - -/* - * BOOLEAN - * RtlLargeIntegerLessThan ( - * LARGE_INTEGER Operand1, - * LARGE_INTEGER Operand2 - * ); - */ -#define RtlLargeIntegerLessThan(X,Y) \ - ((((X).HighPart == (Y).HighPart) && ((X).LowPart < (Y).LowPart)) || \ - ((X).HighPart < (Y).HighPart)) - -/* - * BOOLEAN - * RtlLargeIntegerLessThanOrEqualTo ( - * LARGE_INTEGER Operand1, - * LARGE_INTEGER Operand2 - * ); - */ -#define RtlLargeIntegerLessThanOrEqualTo(X,Y) \ - ((((X).HighPart == (Y).HighPart) && ((X).LowPart <= (Y).LowPart)) || \ - ((X).HighPart < (Y).HighPart)) - -/* - * BOOLEAN - * RtlLargeIntegerLessThanOrEqualToZero ( - * LARGE_INTEGER Operand - * ); - */ -#define RtlLargeIntegerLessOrEqualToZero(X) \ - (((X).HighPart < 0) || !((X).LowPart | (X).HighPart)) - -/* - * BOOLEAN - * RtlLargeIntegerLessThanZero ( - * LARGE_INTEGER Operand - * ); - */ -#define RtlLargeIntegerLessThanZero(X) \ - (((X).HighPart < 0)) - -LARGE_INTEGER -STDCALL -RtlLargeIntegerNegate ( - LARGE_INTEGER Subtrahend - ); - -/* - * BOOLEAN - * RtlLargeIntegerNotEqualTo ( - * LARGE_INTEGER Operand1, - * LARGE_INTEGER Operand2 - * ); - */ -#define RtlLargeIntegerNotEqualTo(X,Y) \ - ((((X).LowPart ^ (Y).LowPart) | ((X).HighPart ^ (Y).HighPart))) - -/* - * BOOLEAN - * RtlLargeIntegerNotEqualToZero ( - * LARGE_INTEGER Operand - * ); - */ -#define RtlLargeIntegerNotEqualToZero(X) \ - (((X).LowPart | (X).HighPart)) - -LARGE_INTEGER -STDCALL -RtlLargeIntegerShiftLeft ( - LARGE_INTEGER LargeInteger, - CCHAR ShiftCount - ); - -LARGE_INTEGER -STDCALL -RtlLargeIntegerShiftRight ( - LARGE_INTEGER LargeInteger, - CCHAR ShiftCount - ); - -LARGE_INTEGER -STDCALL -RtlLargeIntegerSubtract ( - LARGE_INTEGER Minuend, - LARGE_INTEGER Subtrahend - ); - -ULONG -STDCALL -RtlLengthSecurityDescriptor ( - PSECURITY_DESCRIPTOR SecurityDescriptor - ); - -BOOL -STDCALL -RtlLockHeap ( - HANDLE hheap - ); - -NTSTATUS -STDCALL -RtlLookupAtomInAtomTable ( - IN PRTL_ATOM_TABLE AtomTable, - IN PWSTR AtomName, - OUT PRTL_ATOM Atom - ); - -VOID STDCALL -RtlMoveMemory (PVOID Destination, CONST VOID* Source, ULONG Length); - -NTSTATUS -STDCALL -RtlMultiByteToUnicodeN ( - PWCHAR UnicodeString, - ULONG UnicodeSize, - PULONG ResultSize, - PCHAR MbString, - ULONG MbSize - ); - -NTSTATUS -STDCALL -RtlMultiByteToUnicodeSize ( - PULONG UnicodeSize, - PCHAR MbString, - ULONG MbSize - ); - -DWORD -STDCALL -RtlNtStatusToDosError ( - NTSTATUS StatusCode - ); - -DWORD -STDCALL -RtlNtStatusToDosErrorNoTeb ( - NTSTATUS StatusCode - ); - -int -STDCALL -RtlNtStatusToPsxErrno ( - NTSTATUS StatusCode - ); - -ULONG -STDCALL -RtlNumberGenericTableElements ( - IN PRTL_GENERIC_TABLE Table - ); - -ULONG -STDCALL -RtlNumberOfClearBits ( - PRTL_BITMAP BitMapHeader - ); - -ULONG -STDCALL -RtlNumberOfSetBits ( - PRTL_BITMAP BitMapHeader - ); - -ULONG -STDCALL -RtlOemStringToUnicodeSize ( - POEM_STRING AnsiString - ); - -NTSTATUS -STDCALL -RtlOemStringToUnicodeString ( - PUNICODE_STRING DestinationString, - POEM_STRING SourceString, - BOOLEAN AllocateDestinationString - ); - -NTSTATUS -STDCALL -RtlOemToUnicodeN ( - PWCHAR UnicodeString, - ULONG UnicodeSize, - PULONG ResultSize, - PCHAR OemString, - ULONG OemSize - ); - -NTSTATUS -STDCALL -RtlOpenCurrentUser ( - IN ACCESS_MASK DesiredAccess, - OUT PHANDLE KeyHandle - ); - -NTSTATUS STDCALL -RtlPinAtomInAtomTable ( - IN PRTL_ATOM_TABLE AtomTable, - IN RTL_ATOM Atom - ); - -BOOLEAN -STDCALL -RtlPrefixString ( - PANSI_STRING String1, - PANSI_STRING String2, - BOOLEAN CaseInsensitive - ); - -BOOLEAN -STDCALL -RtlPrefixUnicodeString ( - PUNICODE_STRING String1, - PUNICODE_STRING String2, - BOOLEAN CaseInsensitive - ); - -NTSTATUS -STDCALL -RtlQueryAtomInAtomTable ( - IN PRTL_ATOM_TABLE AtomTable, - IN RTL_ATOM Atom, - IN OUT PULONG RefCount OPTIONAL, - IN OUT PULONG PinCount OPTIONAL, - IN OUT PWSTR AtomName OPTIONAL, - IN OUT PULONG NameLength OPTIONAL - ); - -NTSTATUS -STDCALL -RtlQueryRegistryValues ( - IN ULONG RelativeTo, - IN PWSTR Path, - IN PRTL_QUERY_REGISTRY_TABLE QueryTable, - IN PVOID Context, - IN PVOID Environment - ); - -NTSTATUS -STDCALL -RtlQueryTimeZoneInformation ( - IN OUT PTIME_ZONE_INFORMATION TimeZoneInformation - ); - -VOID -STDCALL -RtlRaiseException ( - IN PEXCEPTION_RECORD ExceptionRecord - ); - -LPVOID -STDCALL -RtlReAllocateHeap ( - HANDLE hheap, - DWORD flags, - LPVOID ptr, - DWORD size - ); - -NTSTATUS STDCALL -RtlReserveChunk(IN USHORT CompressionFormat, - IN OUT PUCHAR *CompressedBuffer, - IN PUCHAR EndOfCompressedBufferPlus1, - OUT PUCHAR *ChunkBuffer, - IN ULONG ChunkSize); - -/* - * VOID - * RtlRetrieveUlong ( - * PULONG DestinationAddress, - * PULONG SourceAddress - * ); - */ -#define RtlRetrieveUlong(DestAddress,SrcAddress) \ - if ((ULONG)(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)); \ - } - -/* - * VOID - * RtlRetrieveUshort ( - * PUSHORT DestinationAddress, - * PUSHORT SourceAddress - * ); - */ -#define RtlRetrieveUshort(DestAddress,SrcAddress) \ - if ((ULONG)(SrcAddress) & SHORT_MASK) \ - { \ - ((PUCHAR)(DestAddress))[0]=((PUCHAR)(SrcAddress))[0]; \ - ((PUCHAR)(DestAddress))[1]=((PUCHAR)(SrcAddress))[1]; \ - } \ - else \ - { \ - *((PUSHORT)(DestAddress))=*((PUSHORT)(SrcAddress)); \ - } - -VOID -STDCALL -RtlSecondsSince1970ToTime ( - ULONG SecondsSince1970, - PLARGE_INTEGER Time - ); - -VOID -STDCALL -RtlSecondsSince1980ToTime ( - ULONG SecondsSince1980, - PLARGE_INTEGER Time - ); - -VOID -STDCALL -RtlSetAllBits ( - IN PRTL_BITMAP BitMapHeader - ); - -VOID -STDCALL -RtlSetBits ( - PRTL_BITMAP BitMapHeader, - ULONG StartingIndex, - ULONG NumberToSet - ); - -NTSTATUS -STDCALL -RtlSetDaclSecurityDescriptor ( - PSECURITY_DESCRIPTOR SecurityDescriptor, - BOOLEAN DaclPresent, - PACL Dacl, - BOOLEAN DaclDefaulted - ); - -NTSTATUS -STDCALL -RtlSetTimeZoneInformation ( - IN OUT PTIME_ZONE_INFORMATION TimeZoneInformation - ); - -DWORD -STDCALL -RtlSizeHeap ( - HANDLE hheap, - DWORD flags, - PVOID pmem - ); - -/* - * VOID - * RtlStoreUlong ( - * PULONG Address, - * ULONG Value - * ); - */ -#define RtlStoreUlong(Address,Value) \ - if ((ULONG)(Address) & LONG_MASK) \ - { \ - ((PUCHAR)(Address))[LONG_LEAST_SIGNIFICANT_BIT]=(UCHAR)(FIRSTBYTE(Value)); \ - ((PUCHAR)(Address))[LONG_3RD_MOST_SIGNIFICANT_BIT]=(UCHAR)(FIRSTBYTE(Value)); \ - ((PUCHAR)(Address))[LONG_2ND_MOST_SIGNIFICANT_BIT]=(UCHAR)(THIRDBYTE(Value)); \ - ((PUCHAR)(Address))[LONG_MOST_SIGNIFICANT_BIT]=(UCHAR)(FOURTHBYTE(Value)); \ - } \ - else \ - { \ - *((PULONG)(Address))=(ULONG)(Value); \ - } - -/* - * VOID - * RtlStoreUshort ( - * PUSHORT Address, - * USHORT Value - * ); - */ -#define RtlStoreUshort(Address,Value) \ - if ((ULONG)(Address) & SHORT_MASK) \ - { \ - ((PUCHAR)(Address))[SHORT_LEAST_SIGNIFICANT_BIT]=(UCHAR)(FIRSTBYTE(Value)); \ - ((PUCHAR)(Address))[SHORT_MOST_SIGNIFICANT_BIT]=(UCHAR)(SECONDBYTE(Value)); \ - } \ - else \ - { \ - *((PUSHORT)(Address))=(USHORT)(Value); \ - } - -BOOLEAN -STDCALL -RtlTimeFieldsToTime ( - PTIME_FIELDS TimeFields, - PLARGE_INTEGER Time - ); - -BOOLEAN -STDCALL -RtlTimeToSecondsSince1970 ( - PLARGE_INTEGER Time, - PULONG SecondsSince1970 - ); - -BOOLEAN -STDCALL -RtlTimeToSecondsSince1980 ( - PLARGE_INTEGER Time, - PULONG SecondsSince1980 - ); - -VOID -STDCALL -RtlTimeToTimeFields ( - PLARGE_INTEGER Time, - PTIME_FIELDS TimeFields - ); - -ULONG -STDCALL -RtlUnicodeStringToAnsiSize ( - IN PUNICODE_STRING UnicodeString - ); - -NTSTATUS -STDCALL -RtlUnicodeStringToAnsiString ( - IN OUT PANSI_STRING DestinationString, - IN PUNICODE_STRING SourceString, - IN BOOLEAN AllocateDestinationString - ); - -NTSTATUS -STDCALL -RtlUnicodeStringToInteger ( - IN PUNICODE_STRING String, - IN ULONG Base, - OUT PULONG Value - ); - -ULONG -STDCALL -RtlUnicodeStringToOemSize ( - IN PUNICODE_STRING UnicodeString - ); - -NTSTATUS -STDCALL -RtlUnicodeStringToCountedOemString ( - IN OUT POEM_STRING DestinationString, - IN PUNICODE_STRING SourceString, - IN BOOLEAN AllocateDestinationString - ); - -NTSTATUS -STDCALL -RtlUnicodeStringToOemString ( - IN OUT POEM_STRING DestinationString, - IN PUNICODE_STRING SourceString, - IN BOOLEAN AllocateDestinationString - ); - -NTSTATUS -STDCALL -RtlUnicodeToCustomCPN ( - PRTL_NLS_DATA NlsData, - PCHAR MbString, - ULONG MbSize, - PULONG ResultSize, - PWCHAR UnicodeString, - ULONG UnicodeSize - ); - -NTSTATUS -STDCALL -RtlUnicodeToMultiByteN ( - PCHAR MbString, - ULONG MbSize, - PULONG ResultSize, - PWCHAR UnicodeString, - ULONG UnicodeSize - ); - -NTSTATUS -STDCALL -RtlUnicodeToMultiByteSize ( - PULONG MbSize, - PWCHAR UnicodeString, - ULONG UnicodeSize - ); - -NTSTATUS -STDCALL -RtlUnicodeToOemN ( - PCHAR OemString, - ULONG OemSize, - PULONG ResultSize, - PWCHAR UnicodeString, - ULONG UnicodeSize - ); - -BOOL -STDCALL -RtlUnlockHeap ( - HANDLE hheap - ); - -VOID -STDCALL -RtlUnwind ( - PEXCEPTION_REGISTRATION RegistrationFrame, - PVOID ReturnAddress, - PEXCEPTION_RECORD ExceptionRecord, - DWORD EaxValue - ); - -WCHAR -STDCALL -RtlUpcaseUnicodeChar ( - WCHAR Source - ); - -NTSTATUS -STDCALL -RtlUpcaseUnicodeString ( - IN OUT PUNICODE_STRING DestinationString, - IN PUNICODE_STRING SourceString, - IN BOOLEAN AllocateDestinationString - ); - -NTSTATUS -STDCALL -RtlUpcaseUnicodeStringToAnsiString ( - IN OUT PANSI_STRING DestinationString, - IN PUNICODE_STRING SourceString, - IN BOOLEAN AllocateDestinationString - ); - -NTSTATUS -STDCALL -RtlUpcaseUnicodeStringToCountedOemString ( - IN OUT POEM_STRING DestinationString, - IN PUNICODE_STRING SourceString, - IN BOOLEAN AllocateDestinationString - ); - -NTSTATUS -STDCALL -RtlUpcaseUnicodeStringToOemString ( - IN OUT POEM_STRING DestinationString, - IN PUNICODE_STRING SourceString, - IN BOOLEAN AllocateDestinationString - ); - -NTSTATUS -STDCALL -RtlUpcaseUnicodeToCustomCPN ( - PRTL_NLS_DATA NlsData, - PCHAR MbString, - ULONG MbSize, - PULONG ResultSize, - PWCHAR UnicodeString, - ULONG UnicodeSize - ); - -NTSTATUS -STDCALL -RtlUpcaseUnicodeToMultiByteN ( - PCHAR MbString, - ULONG MbSize, - PULONG ResultSize, - PWCHAR UnicodeString, - ULONG UnicodeSize - ); - -NTSTATUS -STDCALL -RtlUpcaseUnicodeToOemN ( - PCHAR OemString, - ULONG OemSize, - PULONG ResultSize, - PWCHAR UnicodeString, - ULONG UnicodeSize - ); - -CHAR -STDCALL -RtlUpperChar ( - CHAR Source - ); - -VOID -STDCALL -RtlUpperString ( - PSTRING DestinationString, - PSTRING SourceString - ); - -BOOL -STDCALL -RtlValidateHeap ( - HANDLE hheap, - DWORD flags, - PVOID pmem - ); - -BOOLEAN -STDCALL -RtlValidSecurityDescriptor ( - PSECURITY_DESCRIPTOR SecurityDescriptor - ); - -BOOLEAN STDCALL -RtlValidSid(IN PSID Sid); - -NTSTATUS -STDCALL -RtlWriteRegistryValue ( - ULONG RelativeTo, - PWSTR Path, - PWSTR ValueName, - ULONG ValueType, - PVOID ValueData, - ULONG ValueLength - ); - -VOID STDCALL -RtlZeroMemory (PVOID Destination, ULONG Length); - -ULONG -STDCALL -RtlxAnsiStringToUnicodeSize ( - IN PANSI_STRING AnsiString - ); - -ULONG -STDCALL -RtlxOemStringToUnicodeSize ( - IN POEM_STRING OemString - ); - -ULONG -STDCALL -RtlxUnicodeStringToAnsiSize ( - IN PUNICODE_STRING UnicodeString - ); - -ULONG -STDCALL -RtlxUnicodeStringToOemSize ( - IN PUNICODE_STRING UnicodeString - ); - - -/* Register io functions */ - -UCHAR -STDCALL -READ_REGISTER_UCHAR ( - PUCHAR Register - ); - -USHORT -STDCALL -READ_REGISTER_USHORT ( - PUSHORT Register - ); - -ULONG -STDCALL -READ_REGISTER_ULONG ( - PULONG Register - ); - -VOID -STDCALL -READ_REGISTER_BUFFER_UCHAR ( - PUCHAR Register, - PUCHAR Buffer, - ULONG Count - ); - -VOID -STDCALL -READ_REGISTER_BUFFER_USHORT ( - PUSHORT Register, - PUSHORT Buffer, - ULONG Count - ); - -VOID -STDCALL -READ_REGISTER_BUFFER_ULONG ( - PULONG Register, - PULONG Buffer, - ULONG Count - ); - -VOID -STDCALL -WRITE_REGISTER_UCHAR ( - PUCHAR Register, - UCHAR Value - ); - -VOID -STDCALL -WRITE_REGISTER_USHORT ( - PUSHORT Register, - USHORT Value - ); - -VOID -STDCALL -WRITE_REGISTER_ULONG ( - PULONG Register, - ULONG Value - ); - -VOID -STDCALL -WRITE_REGISTER_BUFFER_UCHAR ( - PUCHAR Register, - PUCHAR Buffer, - ULONG Count - ); - -VOID -STDCALL -WRITE_REGISTER_BUFFER_USHORT ( - PUSHORT Register, - PUSHORT Buffer, - ULONG Count - ); - -VOID -STDCALL -WRITE_REGISTER_BUFFER_ULONG ( - PULONG Register, - PULONG Buffer, - ULONG Count - ); - - -NTSTATUS STDCALL RtlCreateAcl(PACL Acl, ULONG AclSize, ULONG AclRevision); -NTSTATUS STDCALL RtlQueryInformationAcl (PACL Acl, PVOID Information, ULONG InformationLength, ACL_INFORMATION_CLASS InformationClass); -NTSTATUS STDCALL RtlSetInformationAcl (PACL Acl, PVOID Information, ULONG InformationLength, ACL_INFORMATION_CLASS InformationClass); -BOOLEAN STDCALL RtlValidAcl (PACL Acl); - -NTSTATUS STDCALL RtlAddAccessAllowedAce(PACL Acl, ULONG Revision, ACCESS_MASK AccessMask, PSID Sid); -NTSTATUS STDCALL RtlAddAccessDeniedAce(PACL Acl, ULONG Revision, ACCESS_MASK AccessMask, PSID Sid); -NTSTATUS STDCALL RtlAddAce(PACL Acl, ULONG Revision, ULONG StartingIndex, PACE AceList, ULONG AceListLength); -NTSTATUS STDCALL RtlAddAuditAccessAce (PACL Acl, ULONG Revision, ACCESS_MASK AccessMask, PSID Sid, BOOLEAN Success, BOOLEAN Failure); -NTSTATUS STDCALL RtlDeleteAce(PACL Acl, ULONG AceIndex); -BOOLEAN STDCALL RtlFirstFreeAce(PACL Acl, PACE* Ace); -NTSTATUS STDCALL RtlGetAce(PACL Acl, ULONG AceIndex, PACE *Ace); - -NTSTATUS STDCALL RtlAbsoluteToSelfRelativeSD (PSECURITY_DESCRIPTOR AbsSD, PSECURITY_DESCRIPTOR RelSD, PULONG BufferLength); -NTSTATUS STDCALL RtlMakeSelfRelativeSD (PSECURITY_DESCRIPTOR AbsSD, PSECURITY_DESCRIPTOR RelSD, PULONG BufferLength); -NTSTATUS STDCALL RtlCreateSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, ULONG Revision); -BOOLEAN STDCALL RtlValidSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor); -ULONG STDCALL RtlLengthSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor); -NTSTATUS STDCALL RtlSetDaclSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, BOOLEAN DaclPresent, PACL Dacl, BOOLEAN DaclDefaulted); -NTSTATUS STDCALL RtlGetDaclSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, PBOOLEAN DaclPresent, PACL* Dacl, PBOOLEAN DaclDefauted); -NTSTATUS STDCALL RtlSetOwnerSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, PSID Owner, BOOLEAN OwnerDefaulted); -NTSTATUS STDCALL RtlGetOwnerSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, PSID* Owner, PBOOLEAN OwnerDefaulted); -NTSTATUS STDCALL RtlSetGroupSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, PSID Group, BOOLEAN GroupDefaulted); -NTSTATUS STDCALL RtlGetGroupSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, PSID* Group, PBOOLEAN GroupDefaulted); -NTSTATUS STDCALL RtlGetControlSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, PSECURITY_DESCRIPTOR_CONTROL Control, PULONG Revision); -NTSTATUS STDCALL RtlSetSaclSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, BOOLEAN SaclPresent, PACL Sacl, BOOLEAN SaclDefaulted); -NTSTATUS STDCALL RtlGetSaclSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor, PBOOLEAN SaclPresent, PACL* Sacl, PBOOLEAN SaclDefauted); -NTSTATUS STDCALL RtlSelfRelativeToAbsoluteSD (PSECURITY_DESCRIPTOR RelSD, - PSECURITY_DESCRIPTOR AbsSD, - PDWORD AbsSDSize, - PACL Dacl, - PDWORD DaclSize, - PACL Sacl, - PDWORD SaclSize, - PSID Owner, - PDWORD OwnerSize, - PSID Group, - PDWORD GroupSize); - -NTSTATUS STDCALL RtlAllocateAndInitializeSid (PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, - UCHAR SubAuthorityCount, - ULONG SubAuthority0, - ULONG SubAuthority1, - ULONG SubAuthority2, - ULONG SubAuthority3, - ULONG SubAuthority4, - ULONG SubAuthority5, - ULONG SubAuthority6, - ULONG SubAuthority7, - PSID *Sid); -ULONG STDCALL RtlLengthRequiredSid (UCHAR SubAuthorityCount); -PSID_IDENTIFIER_AUTHORITY STDCALL RtlIdentifierAuthoritySid (PSID Sid); -NTSTATUS STDCALL RtlInitializeSid (PSID Sid, PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, UCHAR SubAuthorityCount); -PULONG STDCALL RtlSubAuthoritySid (PSID Sid, ULONG SubAuthority); -BOOLEAN STDCALL RtlEqualPrefixSid (PSID Sid1, PSID Sid2); -BOOLEAN STDCALL RtlEqualSid(PSID Sid1, PSID Sid2); -PSID STDCALL RtlFreeSid (PSID Sid); -ULONG STDCALL RtlLengthSid (PSID Sid); -PULONG STDCALL RtlSubAuthoritySid (PSID Sid, ULONG SubAuthority); -PUCHAR STDCALL RtlSubAuthorityCountSid (PSID Sid); -BOOLEAN STDCALL RtlValidSid (PSID Sid); -NTSTATUS STDCALL RtlConvertSidToUnicodeString (PUNICODE_STRING String, PSID Sid, BOOLEAN AllocateBuffer); - -BOOLEAN STDCALL RtlAreAllAccessesGranted (ACCESS_MASK GrantedAccess, ACCESS_MASK DesiredAccess); -BOOLEAN STDCALL RtlAreAnyAccessesGranted (ACCESS_MASK GrantedAccess, ACCESS_MASK DesiredAccess); -VOID STDCALL RtlMapGenericMask (PACCESS_MASK AccessMask, PGENERIC_MAPPING GenericMapping); - - -/* functions exported from NTOSKRNL.EXE which are considered RTL */ - -#if defined(__NTOSKRNL__) || defined(__NTDRIVER__) || defined(__NTHAL__) || defined(__NTDLL__) || defined(__NTAPP__) - -char *_itoa (int value, char *string, int radix); -int _snprintf(char * buf, size_t cnt, const char *fmt, ...); -int _snwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, ...); -int _stricmp(const char *s1, const char *s2); -char * _strlwr(char *x); -int _strnicmp(const char *s1, const char *s2, size_t n); -char * _strnset(char* szToFill, int szFill, size_t sizeMaxFill); -char * _strrev(char *s); -char * _strset(char* szToFill, int szFill); -char * _strupr(char *x); -int _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args); -int _wcsicmp (const wchar_t* cs, const wchar_t* ct); -wchar_t * _wcslwr (wchar_t *x); -int _wcsnicmp (const wchar_t * cs,const wchar_t * ct,size_t count); -wchar_t* _wcsnset (wchar_t* wsToFill, wchar_t wcFill, size_t sizeMaxFill); -wchar_t * _wcsrev(wchar_t *s); -wchar_t *_wcsupr(wchar_t *x); - -int atoi(const char *str); -long atol(const char *str); -int isdigit(int c); -int islower(int c); -int isprint(int c); -int isspace(int c); -int isupper(int c); -int isxdigit(int c); -size_t mbstowcs (wchar_t *wcstr, const char *mbstr, size_t count); -int mbtowc (wchar_t *wchar, const char *mbchar, size_t count); -void * memchr(const void *s, int c, size_t n); -void * memcpy(void *to, const void *from, size_t count); -void * memmove(void *dest,const void *src, size_t count); -void * memset(void *src, int val, size_t count); - -#if 0 -qsort -#endif - -int rand(void); -int sprintf(char * buf, const char *fmt, ...); -void srand(unsigned seed); -char * strcat(char *s, const char *append); -char * strchr(const char *s, int c); -int strcmp(const char *s1, const char *s2); -char * strcpy(char *to, const char *from); -size_t strlen(const char *str); -char * strncat(char *dst, const char *src, size_t n); -int strncmp(const char *s1, const char *s2, size_t n); -char *strncpy(char *dst, const char *src, size_t n); -char *strrchr(const char *s, int c); -size_t strspn(const char *s1, const char *s2); -char *strstr(const char *s, const char *find); -int swprintf(wchar_t *buf, const wchar_t *fmt, ...); -int tolower(int c); -int toupper(int c); -wchar_t towlower(wchar_t c); -wchar_t towupper(wchar_t c); -int vsprintf(char *buf, const char *fmt, va_list args); -wchar_t * wcscat(wchar_t *dest, const wchar_t *src); -wchar_t * wcschr(const wchar_t *str, wchar_t ch); -int wcscmp(const wchar_t *cs, const wchar_t *ct); -wchar_t* wcscpy(wchar_t* str1, const wchar_t* str2); -size_t wcscspn(const wchar_t *str,const wchar_t *reject); -size_t wcslen(const wchar_t *s); -wchar_t * wcsncat(wchar_t *dest, const wchar_t *src, size_t count); -int wcsncmp(const wchar_t *cs, const wchar_t *ct, size_t count); -wchar_t * wcsncpy(wchar_t *dest, const wchar_t *src, size_t count); -wchar_t * wcsrchr(const wchar_t *str, wchar_t ch); -size_t wcsspn(const wchar_t *str,const wchar_t *accept); -wchar_t *wcsstr(const wchar_t *s,const wchar_t *b); -size_t wcstombs (char *mbstr, const wchar_t *wcstr, size_t count); -int wctomb (char *mbchar, wchar_t wchar); - -#endif /* __NTOSKRNL__ || __NTDRIVER__ || __NTHAL__ || __NTDLL__ || __NTAPP__ */ - -#endif /* __DDK_RTL_H */ diff --git a/reactos/include/ddk/rtltypes.h b/reactos/include/ddk/rtltypes.h deleted file mode 100644 index 19b388f26e9..00000000000 --- a/reactos/include/ddk/rtltypes.h +++ /dev/null @@ -1,214 +0,0 @@ -/* $Id: rtltypes.h,v 1.6 2002/09/08 10:47:45 chorns Exp $ - * - */ - -#ifndef __DDK_RTLTYPES_H -#define __DDK_RTLTYPES_H - - -#define COMPRESSION_FORMAT_NONE 0x0000 -#define COMPRESSION_FORMAT_DEFAULT 0x0001 -#define COMPRESSION_FORMAT_LZNT1 0x0002 - -#define COMPRESSION_ENGINE_STANDARD 0x0000 -#define COMPRESSION_ENGINE_MAXIMUM 0x0100 -#define COMPRESSION_ENGINE_HIBER 0x0200 - - -typedef struct _INITIAL_TEB -{ - ULONG StackCommit; - ULONG StackReserve; - PVOID StackBase; - PVOID StackLimit; - PVOID StackAllocate; -} INITIAL_TEB, *PINITIAL_TEB; - -typedef struct _CONTROLLER_OBJECT -{ - CSHORT Type; - CSHORT Size; - PVOID ControllerExtension; - KDEVICE_QUEUE DeviceWaitQueue; - ULONG Spare1; - LARGE_INTEGER Spare2; -} CONTROLLER_OBJECT, *PCONTROLLER_OBJECT; - -typedef struct _STRING -{ - /* - * Length in bytes of the string stored in buffer - */ - USHORT Length; - - /* - * Maximum length of the string - */ - USHORT MaximumLength; - - /* - * String - */ - PCHAR Buffer; -} STRING, *PSTRING; - -typedef STRING ANSI_STRING; -typedef PSTRING PANSI_STRING; - -typedef STRING OEM_STRING; -typedef PSTRING POEM_STRING; - - -typedef struct _TIME_FIELDS -{ - CSHORT Year; - CSHORT Month; - CSHORT Day; - CSHORT Hour; - CSHORT Minute; - CSHORT Second; - CSHORT Milliseconds; - CSHORT Weekday; -} TIME_FIELDS, *PTIME_FIELDS; - -typedef struct _RTL_BITMAP -{ - ULONG SizeOfBitMap; - PULONG Buffer; -} RTL_BITMAP, *PRTL_BITMAP; - -typedef struct _RTL_HEAP_DEFINITION -{ - ULONG Length; - ULONG Unknown[11]; -} RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION; - -typedef struct _RTL_ATOM_TABLE -{ - ULONG TableSize; - ULONG NumberOfAtoms; - PVOID Lock; /* fast mutex (kernel mode)/ critical section (user mode) */ - PVOID HandleTable; - LIST_ENTRY Slot[0]; -} RTL_ATOM_TABLE, *PRTL_ATOM_TABLE; - -typedef struct _LB_RANGE -{ - UCHAR upper; - UCHAR lower; -} LB_RANGE; - -typedef struct _RTL_NLS_DATA -{ - USHORT CodePage; - USHORT MaxCharacterSize; // SBCS = 1, DBCS = 2 - WCHAR DefaultCharacter; - WCHAR char1; - WCHAR char2; - WCHAR char3; - USHORT DbcsFlag; - LB_RANGE LeadByteRange[6]; - USHORT reserved; - PWCHAR MultiByteToUnicode; - PCHAR UnicodeToMultiByte; - PWCHAR DosMultiByteToUnicode; - PCHAR DbcsTags; -} RTL_NLS_DATA, *PRTL_NLS_DATA; - -typedef struct _RTL_NLS_TABLE -{ - RTL_NLS_DATA OemInfo; - RTL_NLS_DATA AnsiInfo; - PWCHAR UpcaseTable; - PWCHAR DowncaseTable; -} RTL_NLS_TABLE, *PRTL_NLS_TABLE; - - -typedef struct _RTL_SPLAY_LINKS -{ - struct _RTL_SPLAY_LINKS *Parent; - struct _RTL_SPLAY_LINKS *LeftChild; - struct _RTL_SPLAY_LINKS *RightChild; -} RTL_SPLAY_LINKS, *PRTL_SPLAY_LINKS; - - -typedef struct _RTL_GENERIC_TABLE -{ - PVOID RootElement; - ULONG Unknown2; - ULONG Unknown3; - ULONG Unknown4; - ULONG Unknown5; - ULONG ElementCount; - PVOID CompareRoutine; - PVOID AllocateRoutine; - PVOID FreeRoutine; - ULONG UserParameter; -} RTL_GENERIC_TABLE, *PRTL_GENERIC_TABLE; - - -typedef struct _RTL_MESSAGE_RESOURCE_ENTRY -{ - USHORT Length; - USHORT Flags; - UCHAR Text[1]; -} RTL_MESSAGE_RESOURCE_ENTRY, *PRTL_MESSAGE_RESOURCE_ENTRY; - -typedef struct _RTL_MESSAGE_RESOURCE_BLOCK -{ - ULONG LowId; - ULONG HighId; - ULONG OffsetToEntries; -} RTL_MESSAGE_RESOURCE_BLOCK, *PRTL_MESSAGE_RESOURCE_BLOCK; - -typedef struct _RTL_MESSAGE_RESOURCE_DATA -{ - ULONG NumberOfBlocks; - RTL_MESSAGE_RESOURCE_BLOCK Blocks[1]; -} RTL_MESSAGE_RESOURCE_DATA, *PRTL_MESSAGE_RESOURCE_DATA; - - -typedef NTSTATUS STDCALL -(*PRTL_QUERY_REGISTRY_ROUTINE)(PWSTR ValueName, - ULONG ValueType, - PVOID ValueData, - ULONG ValueLength, - PVOID Context, - PVOID EntryContext); - -typedef struct _RTL_QUERY_REGISTRY_TABLE -{ - PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine; - ULONG Flags; - PWSTR Name; - PVOID EntryContext; - ULONG DefaultType; - PVOID DefaultData; - ULONG DefaultLength; -} RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE; - - -typedef struct _GENERATE_NAME_CONTEXT -{ - USHORT Checksum; - BOOLEAN CheckSumInserted; - UCHAR NameLength; - WCHAR NameBuffer[8]; - ULONG ExtensionLength; - WCHAR ExtensionBuffer[4]; - ULONG LastIndexValue; -} GENERATE_NAME_CONTEXT, *PGENERATE_NAME_CONTEXT; - - -typedef struct _COMPRESSED_DATA_INFO -{ - USHORT CompressionFormatAndEngine; - UCHAR CompressionUnitShift; - UCHAR ChunkShift; - UCHAR ClusterShift; - UCHAR Reserved; - USHORT NumberOfChunks; - ULONG CompressedChunkSizes[1]; -} COMPRESSED_DATA_INFO, *PCOMPRESSED_DATA_INFO; - -#endif /* __DDK_RTLTYPES_H */ diff --git a/reactos/include/ddk/zw.h b/reactos/include/ddk/zw.h deleted file mode 100644 index a821ab5a23b..00000000000 --- a/reactos/include/ddk/zw.h +++ /dev/null @@ -1,5308 +0,0 @@ - -/* $Id: zw.h,v 1.54 2002/10/25 22:08:20 chorns Exp $ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: System call definitions - * FILE: include/ddk/zw.h - * REVISION HISTORY: - * ??/??/??: First few functions (David Welch) - * ??/??/??: Complete implementation by Ariadne - * 13/07/98: Reorganised things a bit (David Welch) - * 04/08/98: Added some documentation (Ariadne) - * 14/08/98: Added type TIME and change variable type from [1] to [0] - * 14/09/98: Added for each Nt call a corresponding Zw Call - */ - -#ifndef __DDK_ZW_H -#define __DDK_ZW_H - -#include -#include - -//#define LCID ULONG -//#define SECURITY_INFORMATION ULONG -//typedef ULONG SECURITY_INFORMATION; - - -/* - * FUNCTION: Checks a clients access rights to a object - * ARGUMENTS: - * SecurityDescriptor = Security information against which the access is checked - * ClientToken = Represents a client - * DesiredAcces = - * GenericMapping = - * PrivilegeSet = - * ReturnLength = Bytes written - * GrantedAccess = - * AccessStatus = Indicates if the ClientToken allows the requested access - * REMARKS: The arguments map to the win32 AccessCheck - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtAccessCheck( - IN PSECURITY_DESCRIPTOR SecurityDescriptor, - IN HANDLE ClientToken, - IN ACCESS_MASK DesiredAcces, - IN PGENERIC_MAPPING GenericMapping, - OUT PPRIVILEGE_SET PrivilegeSet, - OUT PULONG ReturnLength, - OUT PULONG GrantedAccess, - OUT PBOOLEAN AccessStatus - ); - -NTSTATUS -STDCALL -ZwAccessCheck( - IN PSECURITY_DESCRIPTOR SecurityDescriptor, - IN HANDLE ClientToken, - IN ACCESS_MASK DesiredAcces, - IN PGENERIC_MAPPING GenericMapping, - OUT PPRIVILEGE_SET PrivilegeSet, - OUT PULONG ReturnLength, - OUT PULONG GrantedAccess, - OUT PBOOLEAN AccessStatus - ); - -/* - * FUNCTION: Checks a clients access rights to a object and issues a audit a alarm. ( it logs the access ) - * ARGUMENTS: - * SubsystemName = Specifies the name of the subsystem, can be "WIN32" or "DEBUG" - * ObjectHandle = - * ObjectAttributes = - * DesiredAcces = - * GenericMapping = - * ObjectCreation = - * GrantedAccess = - * AccessStatus = - * GenerateOnClose = - * REMARKS: The arguments map to the win32 AccessCheck - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtAccessCheckAndAuditAlarm( - IN PUNICODE_STRING SubsystemName, - IN PHANDLE ObjectHandle, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN ACCESS_MASK DesiredAccess, - IN PGENERIC_MAPPING GenericMapping, - IN BOOLEAN ObjectCreation, - OUT PULONG GrantedAccess, - OUT PBOOLEAN AccessStatus, - OUT PBOOLEAN GenerateOnClose - ); - -NTSTATUS -STDCALL -ZwAccessCheckAndAuditAlarm( - IN PUNICODE_STRING SubsystemName, - IN PHANDLE ObjectHandle, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN ACCESS_MASK DesiredAccess, - IN PGENERIC_MAPPING GenericMapping, - IN BOOLEAN ObjectCreation, - OUT PULONG GrantedAccess, - OUT PBOOLEAN AccessStatus, - OUT PBOOLEAN GenerateOnClose - ); - -/* - * FUNCTION: Adds an atom to the global atom table - * ARGUMENTS: - * AtomString = The string to add to the atom table. - * Atom (OUT) = Caller supplies storage for the resulting atom. - * REMARKS: The arguments map to the win32 add GlobalAddAtom. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtAddAtom( - IN PWSTR AtomName, - IN OUT PRTL_ATOM Atom - ); - - -NTSTATUS -STDCALL -ZwAddAtom( - IN PWSTR AtomName, - IN OUT PRTL_ATOM Atom - ); - - -/* - * FUNCTION: Adjusts the groups in an access token - * ARGUMENTS: - * TokenHandle = Specifies the access token - * ResetToDefault = If true the NewState parameter is ignored and the groups are set to - * their default state, if false the groups specified in - * NewState are set. - * NewState = - * BufferLength = Specifies the size of the buffer for the PreviousState. - * PreviousState = - * ReturnLength = Bytes written in PreviousState buffer. - * REMARKS: The arguments map to the win32 AdjustTokenGroups - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtAdjustGroupsToken( - IN HANDLE TokenHandle, - IN BOOLEAN ResetToDefault, - IN PTOKEN_GROUPS NewState, - IN ULONG BufferLength, - OUT PTOKEN_GROUPS PreviousState OPTIONAL, - OUT PULONG ReturnLength - ); - -NTSTATUS -STDCALL -ZwAdjustGroupsToken( - IN HANDLE TokenHandle, - IN BOOLEAN ResetToDefault, - IN PTOKEN_GROUPS NewState, - IN ULONG BufferLength, - OUT PTOKEN_GROUPS PreviousState, - OUT PULONG ReturnLength - ); - - -/* - * FUNCTION: - * - * ARGUMENTS: - * TokenHandle = Handle to the access token - * DisableAllPrivileges = The resulting suspend count. - NewState = - BufferLength = - PreviousState = - ReturnLength = - * REMARK: - * The arguments map to the win32 AdjustTokenPrivileges - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtAdjustPrivilegesToken( - IN HANDLE TokenHandle, - IN BOOLEAN DisableAllPrivileges, - IN PTOKEN_PRIVILEGES NewState, - IN ULONG BufferLength, - OUT PTOKEN_PRIVILEGES PreviousState, - OUT PULONG ReturnLength - ); - -NTSTATUS -STDCALL -ZwAdjustPrivilegesToken( - IN HANDLE TokenHandle, - IN BOOLEAN DisableAllPrivileges, - IN PTOKEN_PRIVILEGES NewState, - IN ULONG BufferLength, - OUT PTOKEN_PRIVILEGES PreviousState, - OUT PULONG ReturnLength - ); - - -/* - * FUNCTION: Decrements a thread's suspend count and places it in an alerted - * state. - * ARGUMENTS: - * ThreadHandle = Handle to the thread that should be resumed - * SuspendCount = The resulting suspend count. - * REMARK: - * A thread is resumed if its suspend count is 0 - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtAlertResumeThread( - IN HANDLE ThreadHandle, - OUT PULONG SuspendCount - ); - -NTSTATUS -STDCALL -ZwAlertResumeThread( - IN HANDLE ThreadHandle, - OUT PULONG SuspendCount - ); - -/* - * FUNCTION: Puts the thread in a alerted state - * ARGUMENTS: - * ThreadHandle = Handle to the thread that should be alerted - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtAlertThread( - IN HANDLE ThreadHandle - ); - -NTSTATUS -STDCALL -ZwAlertThread( - IN HANDLE ThreadHandle - ); - - -/* - * FUNCTION: Allocates a locally unique id - * ARGUMENTS: - * LocallyUniqueId = Locally unique number - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtAllocateLocallyUniqueId( - OUT LUID *LocallyUniqueId - ); - -NTSTATUS -STDCALL -ZwAllocateLocallyUniqueId( - OUT PLUID Luid - ); - -NTSTATUS -STDCALL -NtAllocateUuids( - PULARGE_INTEGER Time, - PULONG Range, - PULONG Sequence - ); - -NTSTATUS -STDCALL -ZwAllocateUuids( - PULARGE_INTEGER Time, - PULONG Range, - PULONG Sequence - ); - - -/* - * FUNCTION: Allocates a block of virtual memory in the process address space - * ARGUMENTS: - * ProcessHandle = The handle of the process which owns the virtual memory - * BaseAddress = A pointer to the virtual memory allocated. If you supply a non zero - * value the system will try to allocate the memory at the address supplied. It rounds - * it down to a multiple if the page size. - * ZeroBits = (OPTIONAL) You can specify the number of high order bits that must be zero, ensuring that - * the memory will be allocated at a address below a certain value. - * RegionSize = The number of bytes to allocate - * AllocationType = Indicates the type of virtual memory you like to allocated, - * can be one of the values : MEM_COMMIT, MEM_RESERVE, MEM_RESET, MEM_TOP_DOWN - * Protect = Indicates the protection type of the pages allocated, can be a combination of - * PAGE_READONLY, PAGE_READWRITE, PAGE_EXECUTE_READ, - * PAGE_EXECUTE_READWRITE, PAGE_GUARD, PAGE_NOACCESS, PAGE_NOACCESS - * REMARKS: - * This function maps to the win32 VirtualAllocEx. Virtual memory is process based so the - * protocol starts with a ProcessHandle. I splitted the functionality of obtaining the actual address and specifying - * the start address in two parameters ( BaseAddress and StartAddress ) The NumberOfBytesAllocated specify the range - * and the AllocationType and ProctectionType map to the other two parameters. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtAllocateVirtualMemory ( - IN HANDLE ProcessHandle, - IN OUT PVOID *BaseAddress, - IN ULONG ZeroBits, - IN OUT PULONG RegionSize, - IN ULONG AllocationType, - IN ULONG Protect - ); - -NTSTATUS -STDCALL -ZwAllocateVirtualMemory ( - IN HANDLE ProcessHandle, - IN OUT PVOID *BaseAddress, - IN ULONG ZeroBits, - IN OUT PULONG RegionSize, - IN ULONG AllocationType, - IN ULONG Protect); - -/* - * FUNCTION: Returns from a callback into user mode - * ARGUMENTS: - * RETURN Status - */ -//FIXME: this function might need 3 parameters -NTSTATUS STDCALL NtCallbackReturn(PVOID Result, - ULONG ResultLength, - NTSTATUS Status); - -NTSTATUS STDCALL ZwCallbackReturn(PVOID Result, - ULONG ResultLength, - NTSTATUS Status); - -/* - * FUNCTION: Cancels a IO request - * ARGUMENTS: - * FileHandle = Handle to the file - * IoStatusBlock = - * - * REMARKS: - * This function maps to the win32 CancelIo. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtCancelIoFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock - ); - -NTSTATUS -STDCALL -ZwCancelIoFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock - ); -/* - * FUNCTION: Cancels a timer - * ARGUMENTS: - * TimerHandle = Handle to the timer - * CurrentState = Specifies the state of the timer when cancelled. - * REMARKS: - * The arguments to this function map to the function CancelWaitableTimer. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtCancelTimer( - IN HANDLE TimerHandle, - OUT PBOOLEAN CurrentState OPTIONAL - ); - -NTSTATUS -STDCALL -ZwCancelTimer( - IN HANDLE TimerHandle, - OUT ULONG ElapsedTime - ); -/* - * FUNCTION: Sets the status of the event back to non-signaled - * ARGUMENTS: - * EventHandle = Handle to the event - * REMARKS: - * This function maps to win32 function ResetEvent. - * RETURcNS: Status - */ - -NTSTATUS -STDCALL -NtClearEvent( - IN HANDLE EventHandle - ); - -NTSTATUS -STDCALL -ZwClearEvent( - IN HANDLE EventHandle - ); - -/* - * FUNCTION: Closes an object handle - * ARGUMENTS: - * Handle = Handle to the object - * REMARKS: - * This function maps to the win32 function CloseHandle. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtClose( - IN HANDLE Handle - ); - -NTSTATUS -STDCALL -ZwClose( - IN HANDLE Handle - ); - -/* - * FUNCTION: Generates an audit message when a handle to an object is dereferenced - * ARGUMENTS: - * SubsystemName = - HandleId = Handle to the object - GenerateOnClose = - * REMARKS: - * This function maps to the win32 function ObjectCloseAuditAlarm. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtCloseObjectAuditAlarm( - IN PUNICODE_STRING SubsystemName, - IN PVOID HandleId, - IN BOOLEAN GenerateOnClose - ); - -NTSTATUS -STDCALL -ZwCloseObjectAuditAlarm( - IN PUNICODE_STRING SubsystemName, - IN PVOID HandleId, - IN BOOLEAN GenerateOnClose - ); - -/* - * FUNCTION: Continues a thread with the specified context - * ARGUMENTS: - * Context = Specifies the processor context - * IrqLevel = Specifies the Interupt Request Level to continue with. Can - * be PASSIVE_LEVEL or APC_LEVEL - * REMARKS - * NtContinue can be used to continue after an exception or apc. - * RETURNS: Status - */ -//FIXME This function might need another parameter - -NTSTATUS -STDCALL -NtContinue( - IN PCONTEXT Context, - IN BOOLEAN TestAlert - ); - -NTSTATUS STDCALL ZwContinue(IN PCONTEXT Context, IN CINT IrqLevel); - - -/* - * FUNCTION: Creates a directory object - * ARGUMENTS: - * DirectoryHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies access to the directory - * ObjectAttribute = Initialized attributes for the object - * REMARKS: This function maps to the win32 CreateDirectory. A directory is like a file so it needs a - * handle, a access mask and a OBJECT_ATTRIBUTES structure to map the path name and the SECURITY_ATTRIBUTES. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtCreateDirectoryObject( - OUT PHANDLE DirectoryHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -NTSTATUS -STDCALL -ZwCreateDirectoryObject( - OUT PHANDLE DirectoryHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -/* - * FUNCTION: Creates an event object - * ARGUMENTS: - * EventHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies access to the event - * ObjectAttribute = Initialized attributes for the object - * ManualReset = manual-reset or auto-reset if true you have to reset the state of the event manually - * using NtResetEvent/NtClearEvent. if false the system will reset the event to a non-signalled state - * automatically after the system has rescheduled a thread waiting on the event. - * InitialState = specifies the initial state of the event to be signaled ( TRUE ) or non-signalled (FALSE). - * REMARKS: This function maps to the win32 CreateEvent. Demanding a out variable of type HANDLE, - * a access mask and a OBJECT_ATTRIBUTES structure mapping to the SECURITY_ATTRIBUTES. ManualReset and InitialState are - * both parameters aswell ( possibly the order is reversed ). - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtCreateEvent( - OUT PHANDLE EventHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN BOOLEAN ManualReset, - IN BOOLEAN InitialState - ); - -NTSTATUS -STDCALL -ZwCreateEvent( - OUT PHANDLE EventHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN BOOLEAN ManualReset, - IN BOOLEAN InitialState - ); - -/* - * FUNCTION: Creates an eventpair object - * ARGUMENTS: - * EventPairHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies access to the event - * ObjectAttribute = Initialized attributes for the object - */ - -NTSTATUS -STDCALL -NtCreateEventPair( - OUT PHANDLE EventPairHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -NTSTATUS -STDCALL -ZwCreateEventPair( - OUT PHANDLE EventPairHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - - -/* - * FUNCTION: Creates or opens a file, directory or device object. - * ARGUMENTS: - * FileHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies the allowed or desired access to the file can - * be a combination of DELETE | FILE_READ_DATA .. - * ObjectAttribute = Initialized attributes for the object, contains the rootdirectory and the filename - * IoStatusBlock (OUT) = Caller supplied storage for the resulting status information, indicating if the - * the file is created and opened or allready existed and is just opened. - * FileAttributes = file attributes can be a combination of FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN ... - * ShareAccess = can be a combination of the following: FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE - * CreateDisposition = specifies what the behavior of the system if the file allready exists. - * CreateOptions = specifies the behavior of the system on file creation. - * EaBuffer (OPTIONAL) = Extended Attributes buffer, applies only to files and directories. - * EaLength = Extended Attributes buffer size, applies only to files and directories. - * REMARKS: This function maps to the win32 CreateFile. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtCreateFile( - 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 CreateDisposition, - IN ULONG CreateOptions, - IN PVOID EaBuffer OPTIONAL, - IN ULONG EaLength - ); - -NTSTATUS -STDCALL -ZwCreateFile( - 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 CreateDisposition, - IN ULONG CreateOptions, - IN PVOID EaBuffer OPTIONAL, - IN ULONG EaLength - ); - -/* - * FUNCTION: Creates or opens a file, directory or device object. - * ARGUMENTS: - * CompletionPort (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies the allowed or desired access to the port - * IoStatusBlock = - * NumberOfConcurrentThreads = - * REMARKS: This function maps to the win32 CreateIoCompletionPort - * RETURNS: - * Status - */ - -NTSTATUS -STDCALL -NtCreateIoCompletion( - OUT PHANDLE CompletionPort, - IN ACCESS_MASK DesiredAccess, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG NumberOfConcurrentThreads - ); - -NTSTATUS -STDCALL -ZwCreateIoCompletion( - OUT PHANDLE CompletionPort, - IN ACCESS_MASK DesiredAccess, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG NumberOfConcurrentThreads - ); - - -/* - * FUNCTION: Creates a mail slot file - * ARGUMENTS: - * MailSlotFileHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies the allowed or desired access to the file - * ObjectAttributes = Contains the name of the mailslotfile. - * IoStatusBlock = - * FileAttributes = - * ShareAccess = - * MaxMessageSize = - * TimeOut = - * - * REMARKS: This funciton maps to the win32 function CreateMailSlot - * RETURNS: - * Status - */ - -NTSTATUS -STDCALL -NtCreateMailslotFile( - OUT PHANDLE MailSlotFileHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG FileAttributes, - IN ULONG ShareAccess, - IN ULONG MaxMessageSize, - IN PLARGE_INTEGER TimeOut - ); - -NTSTATUS -STDCALL -ZwCreateMailslotFile( - OUT PHANDLE MailSlotFileHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG FileAttributes, - IN ULONG ShareAccess, - IN ULONG MaxMessageSize, - IN PLARGE_INTEGER TimeOut - ); - -/* - * FUNCTION: Creates or opens a mutex - * ARGUMENTS: - * MutantHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies the allowed or desired access to the port - * ObjectAttributes = Contains the name of the mutex. - * InitialOwner = If true the calling thread acquires ownership - * of the mutex. - * REMARKS: This funciton maps to the win32 function CreateMutex - * RETURNS: - * Status - */ -NTSTATUS -STDCALL -NtCreateMutant( - OUT PHANDLE MutantHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN BOOLEAN InitialOwner - ); - -NTSTATUS -STDCALL -ZwCreateMutant( - OUT PHANDLE MutantHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN BOOLEAN InitialOwner - ); - - -/* - * FUNCTION: Creates a paging file. - * ARGUMENTS: - * FileName = Name of the pagefile - * InitialSize = Specifies the initial size in bytes - * MaximumSize = Specifies the maximum size in bytes - * Reserved = Reserved for future use - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtCreatePagingFile( - IN PUNICODE_STRING FileName, - IN PLARGE_INTEGER InitialSize, - IN PLARGE_INTEGER MaxiumSize, - IN ULONG Reserved - ); - -NTSTATUS -STDCALL -ZwCreatePagingFile( - IN PUNICODE_STRING FileName, - IN PLARGE_INTEGER InitialSize, - IN PLARGE_INTEGER MaxiumSize, - IN ULONG Reserved - ); - -/* - * FUNCTION: Creates a process. - * ARGUMENTS: - * ProcessHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies the allowed or desired access to the process can - * be a combinate of STANDARD_RIGHTS_REQUIRED| .. - * ObjectAttribute = Initialized attributes for the object, contains the rootdirectory and the filename - * ParentProcess = Handle to the parent process. - * InheritObjectTable = Specifies to inherit the objects of the parent process if true. - * SectionHandle = Handle to a section object to back the image file - * DebugPort = Handle to a DebugPort if NULL the system default debug port will be used. - * ExceptionPort = Handle to a exception port. - * REMARKS: - * This function maps to the win32 CreateProcess. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtCreateProcess( - OUT PHANDLE ProcessHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN HANDLE ParentProcess, - IN BOOLEAN InheritObjectTable, - IN HANDLE SectionHandle OPTIONAL, - IN HANDLE DebugPort OPTIONAL, - IN HANDLE ExceptionPort OPTIONAL - ); - -NTSTATUS -STDCALL -ZwCreateProcess( - OUT PHANDLE ProcessHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN HANDLE ParentProcess, - IN BOOLEAN InheritObjectTable, - IN HANDLE SectionHandle OPTIONAL, - IN HANDLE DebugPort OPTIONAL, - IN HANDLE ExceptionPort OPTIONAL - ); - -/* - * FUNCTION: Creates a profile - * ARGUMENTS: - * ProfileHandle (OUT) = Caller supplied storage for the resulting handle - * ObjectAttribute = Initialized attributes for the object - * ImageBase = Start address of executable image - * ImageSize = Size of the image - * Granularity = Bucket size - * Buffer = Caller supplies buffer for profiling info - * ProfilingSize = Buffer size - * ClockSource = Specify 0 / FALSE ?? - * ProcessorMask = A value of -1 indicates disables per processor profiling, - otherwise bit set for the processor to profile. - * REMARKS: - * This function maps to the win32 CreateProcess. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtCreateProfile(OUT PHANDLE ProfileHandle, - IN HANDLE ProcessHandle, - IN PVOID ImageBase, - IN ULONG ImageSize, - IN ULONG Granularity, - OUT PULONG Buffer, - IN ULONG ProfilingSize, - IN KPROFILE_SOURCE Source, - IN ULONG ProcessorMask); - -NTSTATUS -STDCALL -ZwCreateProfile( - OUT PHANDLE ProfileHandle, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN ULONG ImageBase, - IN ULONG ImageSize, - IN ULONG Granularity, - OUT PVOID Buffer, - IN ULONG ProfilingSize, - IN ULONG ClockSource, - IN ULONG ProcessorMask - ); - -/* - * FUNCTION: Creates a section object. - * ARGUMENTS: - * SectionHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies the desired access to the section can be a combination of STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_WRITE | - * SECTION_MAP_READ | SECTION_MAP_EXECUTE. - * ObjectAttribute = Initialized attributes for the object can be used to create a named section - * MaxiumSize = Maximizes the size of the memory section. Must be non-NULL for a page-file backed section. - * If value specified for a mapped file and the file is not large enough, file will be extended. - * SectionPageProtection = Can be a combination of PAGE_READONLY | PAGE_READWRITE | PAGE_WRITEONLY | PAGE_WRITECOPY. - * AllocationAttributes = can be a combination of SEC_IMAGE | SEC_RESERVE - * FileHanlde = Handle to a file to create a section mapped to a file instead of a memory backed section. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtCreateSection( - OUT PHANDLE SectionHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN PLARGE_INTEGER MaximumSize OPTIONAL, - IN ULONG SectionPageProtection OPTIONAL, - IN ULONG AllocationAttributes, - IN HANDLE FileHandle OPTIONAL - ); - -NTSTATUS -STDCALL -ZwCreateSection( - OUT PHANDLE SectionHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN PLARGE_INTEGER MaximumSize OPTIONAL, - IN ULONG SectionPageProtection OPTIONAL, - IN ULONG AllocationAttributes, - IN HANDLE FileHandle OPTIONAL - ); - -/* - * FUNCTION: Creates a semaphore object for interprocess synchronization. - * ARGUMENTS: - * SemaphoreHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies the allowed or desired access to the semaphore. - * ObjectAttribute = Initialized attributes for the object. - * InitialCount = Not necessary zero, might be smaller than zero. - * MaximumCount = Maxiumum count the semaphore can reach. - * RETURNS: Status - * REMARKS: - * The semaphore is set to signaled when its count is greater than zero, and non-signaled when its count is zero. - */ - -//FIXME: should a semaphore's initial count allowed to be smaller than zero ?? -NTSTATUS -STDCALL -NtCreateSemaphore( - OUT PHANDLE SemaphoreHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN LONG InitialCount, - IN LONG MaximumCount - ); - -NTSTATUS -STDCALL -ZwCreateSemaphore( - OUT PHANDLE SemaphoreHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN LONG InitialCount, - IN LONG MaximumCount - ); - -/* - * FUNCTION: Creates a symbolic link object - * ARGUMENTS: - * SymbolicLinkHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies the allowed or desired access to the thread. - * ObjectAttributes = Initialized attributes for the object. - * Name = Target name of the symbolic link - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtCreateSymbolicLinkObject( - OUT PHANDLE SymbolicLinkHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN PUNICODE_STRING Name - ); - -NTSTATUS -STDCALL -ZwCreateSymbolicLinkObject( - OUT PHANDLE SymbolicLinkHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN PUNICODE_STRING Name - ); - -/* - * FUNCTION: Creates a user mode thread - * ARGUMENTS: - * ThreadHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies the allowed or desired access to the thread. - * ObjectAttributes = Initialized attributes for the object. - * ProcessHandle = Handle to the threads parent process. - * ClientId (OUT) = Caller supplies storage for returned process id and thread id. - * ThreadContext = Initial processor context for the thread. - * InitialTeb = Initial user mode stack context for the thread. - * CreateSuspended = Specifies if the thread is ready for scheduling - * REMARKS: - * This function maps to the win32 function CreateThread. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtCreateThread( - OUT PHANDLE ThreadHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN HANDLE ProcessHandle, - OUT PCLIENT_ID ClientId, - IN PCONTEXT ThreadContext, - IN PINITIAL_TEB InitialTeb, - IN BOOLEAN CreateSuspended - ); - -NTSTATUS -STDCALL -ZwCreateThread( - OUT PHANDLE ThreadHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN HANDLE ProcessHandle, - OUT PCLIENT_ID ClientId, - IN PCONTEXT ThreadContext, - IN PINITIAL_TEB InitialTeb, - IN BOOLEAN CreateSuspended - ); - -/* - * FUNCTION: Creates a waitable timer. - * ARGUMENTS: - * TimerHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies the allowed or desired access to the timer. - * ObjectAttributes = Initialized attributes for the object. - * TimerType = Specifies if the timer should be reset manually. - * REMARKS: - * This function maps to the win32 CreateWaitableTimer. lpTimerAttributes and lpTimerName map to - * corresponding fields in OBJECT_ATTRIBUTES structure. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtCreateTimer( - OUT PHANDLE TimerHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN TIMER_TYPE TimerType - ); - -NTSTATUS -STDCALL -ZwCreateTimer( - OUT PHANDLE TimerHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN TIMER_TYPE TimerType - ); - -/* - * FUNCTION: Creates a token. - * ARGUMENTS: - * TokenHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Specifies the allowed or desired access to the process can - * be a combinate of STANDARD_RIGHTS_REQUIRED| .. - * ObjectAttribute = Initialized attributes for the object, contains the rootdirectory and the filename - * TokenType = - * AuthenticationId = - * ExpirationTime = - * TokenUser = - * TokenGroups = - * TokenPrivileges = - * TokenOwner = - * TokenPrimaryGroup = - * TokenDefaultDacl = - * TokenSource = - * REMARKS: - * This function does not map to a win32 function - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtCreateToken( - OUT PHANDLE TokenHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN TOKEN_TYPE TokenType, - IN PLUID AuthenticationId, - IN PLARGE_INTEGER ExpirationTime, - IN PTOKEN_USER TokenUser, - IN PTOKEN_GROUPS TokenGroups, - IN PTOKEN_PRIVILEGES TokenPrivileges, - IN PTOKEN_OWNER TokenOwner, - IN PTOKEN_PRIMARY_GROUP TokenPrimaryGroup, - IN PTOKEN_DEFAULT_DACL TokenDefaultDacl, - IN PTOKEN_SOURCE TokenSource - ); - -NTSTATUS -STDCALL -ZwCreateToken( - OUT PHANDLE TokenHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN TOKEN_TYPE TokenType, - IN PLUID AuthenticationId, - IN PLARGE_INTEGER ExpirationTime, - IN PTOKEN_USER TokenUser, - IN PTOKEN_GROUPS TokenGroups, - IN PTOKEN_PRIVILEGES TokenPrivileges, - IN PTOKEN_OWNER TokenOwner, - IN PTOKEN_PRIMARY_GROUP TokenPrimaryGroup, - IN PTOKEN_DEFAULT_DACL TokenDefaultDacl, - IN PTOKEN_SOURCE TokenSource - ); - -/* - * FUNCTION: Returns the callers thread TEB. - * RETURNS: The resulting teb. - */ -#if 0 - NT_TEB * -STDCALL -NtCurrentTeb(VOID - ); -#endif - -/* - * FUNCTION: Delays the execution of the calling thread. - * ARGUMENTS: - * Alertable = If TRUE the thread is alertable during is wait period - * Interval = Specifies the interval to wait. - * RETURNS: Status - */ -NTSTATUS STDCALL NtDelayExecution(IN ULONG Alertable, IN TIME* Interval); - -NTSTATUS -STDCALL -ZwDelayExecution( - IN BOOLEAN Alertable, - IN TIME *Interval - ); - - -/* - * FUNCTION: Deletes an atom from the global atom table - * ARGUMENTS: - * Atom = Identifies the atom to delete - * REMARKS: - * The function maps to the win32 GlobalDeleteAtom - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtDeleteAtom( - IN RTL_ATOM Atom - ); - -NTSTATUS -STDCALL -ZwDeleteAtom( - IN RTL_ATOM Atom - ); - -/* - * FUNCTION: Deletes a file or a directory - * ARGUMENTS: - * ObjectAttributes = Name of the file which should be deleted - * REMARKS: - * This system call is functionally equivalent to NtSetInformationFile - * setting the disposition information. - * The function maps to the win32 DeleteFile. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtDeleteFile( - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -NTSTATUS -STDCALL -ZwDeleteFile( - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -/* - * FUNCTION: Deletes a registry key - * ARGUMENTS: - * KeyHandle = Handle of the key - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtDeleteKey( - IN HANDLE KeyHandle - ); -NTSTATUS -STDCALL -ZwDeleteKey( - IN HANDLE KeyHandle - ); - -/* - * FUNCTION: Generates a audit message when an object is deleted - * ARGUMENTS: - * SubsystemName = Spefies the name of the subsystem can be 'WIN32' or 'DEBUG' - * HandleId= Handle to an audit object - * GenerateOnClose = Value returned by NtAccessCheckAndAuditAlarm - * REMARKS: This function maps to the win32 ObjectCloseAuditAlarm - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtDeleteObjectAuditAlarm ( - IN PUNICODE_STRING SubsystemName, - IN PVOID HandleId, - IN BOOLEAN GenerateOnClose - ); - -NTSTATUS -STDCALL -ZwDeleteObjectAuditAlarm ( - IN PUNICODE_STRING SubsystemName, - IN PVOID HandleId, - IN BOOLEAN GenerateOnClose - ); - - -/* - * FUNCTION: Deletes a value from a registry key - * ARGUMENTS: - * KeyHandle = Handle of the key - * ValueName = Name of the value to delete - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtDeleteValueKey( - IN HANDLE KeyHandle, - IN PUNICODE_STRING ValueName - ); - -NTSTATUS -STDCALL -ZwDeleteValueKey( - IN HANDLE KeyHandle, - IN PUNICODE_STRING ValueName - ); -/* - * FUNCTION: Sends IOCTL to the io sub system - * ARGUMENTS: - * DeviceHandle = Points to the handle that is created by NtCreateFile - * Event = Event to synchronize on STATUS_PENDING - * ApcRoutine = Asynchroneous procedure callback - * ApcContext = Callback context. - * IoStatusBlock = Caller should supply storage for extra information.. - * IoControlCode = Contains the IO Control command. This is an - * index to the structures in InputBuffer and OutputBuffer. - * InputBuffer = Caller should supply storage for input buffer if IOTL expects one. - * InputBufferSize = Size of the input bufffer - * OutputBuffer = Caller should supply storage for output buffer if IOTL expects one. - * OutputBufferSize = Size of the input bufffer - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtDeviceIoControlFile( - IN HANDLE DeviceHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL, - IN PVOID UserApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG IoControlCode, - IN PVOID InputBuffer, - IN ULONG InputBufferSize, - OUT PVOID OutputBuffer, - IN ULONG OutputBufferSize - ); - -NTSTATUS -STDCALL -ZwDeviceIoControlFile( - IN HANDLE DeviceHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL, - IN PVOID UserApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG IoControlCode, - IN PVOID InputBuffer, - IN ULONG InputBufferSize, - OUT PVOID OutputBuffer, - IN ULONG OutputBufferSize - ); -/* - * FUNCTION: Displays a string on the blue screen - * ARGUMENTS: - * DisplayString = The string to display - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtDisplayString( - IN PUNICODE_STRING DisplayString - ); - -NTSTATUS -STDCALL -ZwDisplayString( - IN PUNICODE_STRING DisplayString - ); - -/* - * FUNCTION: Copies a handle from one process space to another - * ARGUMENTS: - * SourceProcessHandle = The source process owning the handle. The source process should have opened - * the SourceHandle with PROCESS_DUP_HANDLE access. - * SourceHandle = The handle to the object. - * TargetProcessHandle = The destination process owning the handle - * TargetHandle (OUT) = Caller should supply storage for the duplicated handle. - * DesiredAccess = The desired access to the handle. - * InheritHandle = Indicates wheter the new handle will be inheritable or not. - * Options = Specifies special actions upon duplicating the handle. Can be - * one of the values DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS. - * DUPLICATE_CLOSE_SOURCE specifies that the source handle should be - * closed after duplicating. DUPLICATE_SAME_ACCESS specifies to ignore - * the DesiredAccess paramter and just grant the same access to the new - * handle. - * RETURNS: Status - * REMARKS: This function maps to the win32 DuplicateHandle. - */ - -NTSTATUS -STDCALL -NtDuplicateObject( - IN HANDLE SourceProcessHandle, - IN HANDLE SourceHandle, - IN HANDLE TargetProcessHandle, - OUT PHANDLE TargetHandle, - IN ACCESS_MASK DesiredAccess, - IN BOOLEAN InheritHandle, - IN ULONG Options - ); - -NTSTATUS -STDCALL -ZwDuplicateObject( - IN HANDLE SourceProcessHandle, - IN PHANDLE SourceHandle, - IN HANDLE TargetProcessHandle, - OUT PHANDLE TargetHandle, - IN ACCESS_MASK DesiredAccess, - IN BOOLEAN InheritHandle, - IN ULONG Options - ); - -NTSTATUS -STDCALL -NtDuplicateToken( - IN HANDLE ExistingToken, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel, - IN TOKEN_TYPE TokenType, - OUT PHANDLE NewToken - ); - -NTSTATUS -STDCALL -ZwDuplicateToken( - IN HANDLE ExistingToken, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel, - IN TOKEN_TYPE TokenType, - OUT PHANDLE NewToken - ); -/* - * FUNCTION: Returns information about the subkeys of an open key - * ARGUMENTS: - * KeyHandle = Handle of the key whose subkeys are to enumerated - * Index = zero based index of the subkey for which information is - * request - * KeyInformationClass = Type of information returned - * KeyInformation (OUT) = Caller allocated buffer for the information - * about the key - * Length = Length in bytes of the KeyInformation buffer - * ResultLength (OUT) = Caller allocated storage which holds - * the number of bytes of information retrieved - * on return - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtEnumerateKey( - IN HANDLE KeyHandle, - IN ULONG Index, - IN KEY_INFORMATION_CLASS KeyInformationClass, - OUT PVOID KeyInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -NTSTATUS -STDCALL -ZwEnumerateKey( - IN HANDLE KeyHandle, - IN ULONG Index, - IN KEY_INFORMATION_CLASS KeyInformationClass, - OUT PVOID KeyInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); -/* - * FUNCTION: Returns information about the value entries of an open key - * ARGUMENTS: - * KeyHandle = Handle of the key whose value entries are to enumerated - * Index = zero based index of the subkey for which information is - * request - * KeyInformationClass = Type of information returned - * KeyInformation (OUT) = Caller allocated buffer for the information - * about the key - * Length = Length in bytes of the KeyInformation buffer - * ResultLength (OUT) = Caller allocated storage which holds - * the number of bytes of information retrieved - * on return - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtEnumerateValueKey( - IN HANDLE KeyHandle, - IN ULONG Index, - IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, - OUT PVOID KeyValueInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -NTSTATUS -STDCALL -ZwEnumerateValueKey( - IN HANDLE KeyHandle, - IN ULONG Index, - IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, - OUT PVOID KeyValueInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); -/* - * FUNCTION: Extends a section - * ARGUMENTS: - * SectionHandle = Handle to the section - * NewMaximumSize = Adjusted size - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtExtendSection( - IN HANDLE SectionHandle, - IN ULONG NewMaximumSize - ); -NTSTATUS -STDCALL -ZwExtendSection( - IN HANDLE SectionHandle, - IN ULONG NewMaximumSize - ); - -/* - * FUNCTION: Finds a atom - * ARGUMENTS: - * AtomName = Name to search for. - * Atom = Caller supplies storage for the resulting atom - * RETURNS: Status - * REMARKS: - * This funciton maps to the win32 GlobalFindAtom - */ -NTSTATUS -STDCALL -NtFindAtom( - IN PWSTR AtomName, - OUT PRTL_ATOM Atom OPTIONAL - ); - -NTSTATUS -STDCALL -ZwFindAtom( - IN PWSTR AtomName, - OUT PRTL_ATOM Atom OPTIONAL - ); - -/* - * FUNCTION: Flushes chached file data to disk - * ARGUMENTS: - * FileHandle = Points to the file - * IoStatusBlock = Caller must supply storage to receive the result of the flush - * buffers operation. The information field is set to number of bytes - * flushed to disk. - * RETURNS: Status - * REMARKS: - * This funciton maps to the win32 FlushFileBuffers - */ -NTSTATUS -STDCALL -NtFlushBuffersFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock - ); - -NTSTATUS -STDCALL -ZwFlushBuffersFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock - ); -/* - * FUNCTION: Flushes a the processors instruction cache - * ARGUMENTS: - * ProcessHandle = Points to the process owning the cache - * BaseAddress = // might this be a image address ???? - * NumberOfBytesToFlush = - * RETURNS: Status - * REMARKS: - * This funciton is used by debuggers - */ -NTSTATUS -STDCALL -NtFlushInstructionCache( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress, - IN UINT NumberOfBytesToFlush - ); -NTSTATUS -STDCALL -ZwFlushInstructionCache( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress, - IN UINT NumberOfBytesToFlush - ); -/* - * FUNCTION: Flushes a registry key to disk - * ARGUMENTS: - * KeyHandle = Points to the registry key handle - * RETURNS: Status - * REMARKS: - * This funciton maps to the win32 RegFlushKey. - */ -NTSTATUS -STDCALL -NtFlushKey( - IN HANDLE KeyHandle - ); - -NTSTATUS -STDCALL -ZwFlushKey( - IN HANDLE KeyHandle - ); - -/* - * FUNCTION: Flushes virtual memory to file - * ARGUMENTS: - * ProcessHandle = Points to the process that allocated the virtual memory - * BaseAddress = Points to the memory address - * NumberOfBytesToFlush = Limits the range to flush, - * NumberOfBytesFlushed = Actual number of bytes flushed - * RETURNS: Status - * REMARKS: - * Check return status on STATUS_NOT_MAPPED_DATA - */ -NTSTATUS -STDCALL -NtFlushVirtualMemory( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress, - IN ULONG NumberOfBytesToFlush, - OUT PULONG NumberOfBytesFlushed OPTIONAL - ); -NTSTATUS -STDCALL -ZwFlushVirtualMemory( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress, - IN ULONG NumberOfBytesToFlush, - OUT PULONG NumberOfBytesFlushed OPTIONAL - ); - -/* - * FUNCTION: Flushes the dirty pages to file - * RETURNS: Status - * FIXME: Not sure this does (how is the file specified) - */ -NTSTATUS STDCALL NtFlushWriteBuffer(VOID); -NTSTATUS STDCALL ZwFlushWriteBuffer(VOID); - - /* - * FUNCTION: Frees a range of virtual memory - * ARGUMENTS: - * ProcessHandle = Points to the process that allocated the virtual - * memory - * BaseAddress = Points to the memory address, rounded down to a - * multiple of the pagesize - * RegionSize = Limits the range to free, rounded up to a multiple of - * the paging size - * FreeType = Can be one of the values: MEM_DECOMMIT, or MEM_RELEASE - * RETURNS: Status - */ -NTSTATUS STDCALL NtFreeVirtualMemory(IN HANDLE ProcessHandle, - IN PVOID *BaseAddress, - IN PULONG RegionSize, - IN ULONG FreeType); -NTSTATUS STDCALL ZwFreeVirtualMemory(IN HANDLE ProcessHandle, - IN PVOID *BaseAddress, - IN PULONG RegionSize, - IN ULONG FreeType); - -/* - * FUNCTION: Sends FSCTL to the filesystem - * ARGUMENTS: - * DeviceHandle = Points to the handle that is created by NtCreateFile - * Event = Event to synchronize on STATUS_PENDING - * ApcRoutine = - * ApcContext = - * IoStatusBlock = Caller should supply storage for - * IoControlCode = Contains the File System Control command. This is an - * index to the structures in InputBuffer and OutputBuffer. - * FSCTL_GET_RETRIEVAL_POINTERS MAPPING_PAIR - * FSCTL_GET_RETRIEVAL_POINTERS GET_RETRIEVAL_DESCRIPTOR - * FSCTL_GET_VOLUME_BITMAP BITMAP_DESCRIPTOR - * FSCTL_MOVE_FILE MOVEFILE_DESCRIPTOR - * - * InputBuffer = Caller should supply storage for input buffer if FCTL expects one. - * InputBufferSize = Size of the input bufffer - * OutputBuffer = Caller should supply storage for output buffer if FCTL expects one. - * OutputBufferSize = Size of the input bufffer - * RETURNS: Status [ STATUS_SUCCESS | STATUS_PENDING | STATUS_ACCESS_DENIED | STATUS_INSUFFICIENT_RESOURCES | - * STATUS_INVALID_PARAMETER | STATUS_INVALID_DEVICE_REQUEST ] - */ -NTSTATUS -STDCALL -NtFsControlFile( - IN HANDLE DeviceHandle, - 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, - IN ULONG InputBufferSize, - OUT PVOID OutputBuffer, - IN ULONG OutputBufferSize - ); - -NTSTATUS -STDCALL -ZwFsControlFile( - IN HANDLE DeviceHandle, - 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, - IN ULONG InputBufferSize, - OUT PVOID OutputBuffer, - IN ULONG OutputBufferSize - ); - -/* - * FUNCTION: Retrieves the processor context of a thread - * ARGUMENTS: - * ThreadHandle = Handle to a thread - * Context (OUT) = Caller allocated storage for the processor context - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtGetContextThread( - IN HANDLE ThreadHandle, - OUT PCONTEXT Context - ); - -NTSTATUS -STDCALL -ZwGetContextThread( - IN HANDLE ThreadHandle, - OUT PCONTEXT Context - ); -/* - * FUNCTION: Retrieves the uptime of the system - * ARGUMENTS: - * UpTime = Number of clock ticks since boot. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtGetTickCount( - PULONG UpTime - ); - -NTSTATUS -STDCALL -ZwGetTickCount( - PULONG UpTime - ); - -/* - * FUNCTION: Sets a thread to impersonate another - * ARGUMENTS: - * ThreadHandle = Server thread that will impersonate a client. - ThreadToImpersonate = Client thread that will be impersonated - SecurityQualityOfService = Specifies the impersonation level. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtImpersonateThread( - IN HANDLE ThreadHandle, - IN HANDLE ThreadToImpersonate, - IN PSECURITY_QUALITY_OF_SERVICE SecurityQualityOfService - ); - -NTSTATUS -STDCALL -ZwImpersonateThread( - IN HANDLE ThreadHandle, - IN HANDLE ThreadToImpersonate, - IN PSECURITY_QUALITY_OF_SERVICE SecurityQualityOfService - ); - -/* - * FUNCTION: Initializes the registry. - * ARGUMENTS: - * SetUpBoot = This parameter is true for a setup boot. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtInitializeRegistry( - BOOLEAN SetUpBoot - ); -NTSTATUS -STDCALL -ZwInitializeRegistry( - BOOLEAN SetUpBoot - ); - -/* - * FUNCTION: Loads a driver. - * ARGUMENTS: - * DriverServiceName = Name of the driver to load - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtLoadDriver( - IN PUNICODE_STRING DriverServiceName - ); - -NTSTATUS -STDCALL -ZwLoadDriver( - IN PUNICODE_STRING DriverServiceName - ); - -/* - * FUNCTION: Loads a registry key. - * ARGUMENTS: - * KeyHandle = Handle to the registry key - * ObjectAttributes = ??? - * REMARK: - * This procedure maps to the win32 procedure RegLoadKey - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtLoadKey( - PHANDLE KeyHandle, - POBJECT_ATTRIBUTES ObjectAttributes - ); -NTSTATUS -STDCALL -ZwLoadKey( - PHANDLE KeyHandle, - POBJECT_ATTRIBUTES ObjectAttributes - ); - -/* - * FUNCTION: Loads a registry key. - * ARGUMENTS: - * KeyHandle = Handle to the registry key - * ObjectAttributes = ??? - * Unknown3 = ??? - * REMARK: - * This procedure maps to the win32 procedure RegLoadKey - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtLoadKey2 ( - PHANDLE KeyHandle, - POBJECT_ATTRIBUTES ObjectAttributes, - ULONG Unknown3 - ); -NTSTATUS -STDCALL -ZwLoadKey2 ( - PHANDLE KeyHandle, - POBJECT_ATTRIBUTES ObjectAttributes, - ULONG Unknown3 - ); - -/* - * FUNCTION: Locks a range of bytes in a file. - * ARGUMENTS: - * FileHandle = Handle to the file - * Event = Should be null if apc is specified. - * ApcRoutine = Asynchroneous Procedure Callback - * ApcContext = Argument to the callback - * IoStatusBlock (OUT) = Caller should supply storage for a structure containing - * the completion status and information about the requested lock operation. - * ByteOffset = Offset - * Length = Number of bytes to lock. - * Key = Special value to give other threads the possibility to unlock the file - by supplying the key in a call to NtUnlockFile. - * FailImmediatedly = If false the request will block untill the lock is obtained. - * ExclusiveLock = Specifies whether a exclusive or a shared lock is obtained. - * REMARK: - This procedure maps to the win32 procedure LockFileEx. STATUS_PENDING is returned if the lock could - not be obtained immediately, the device queue is busy and the IRP is queued. - * RETURNS: Status [ STATUS_SUCCESS | STATUS_PENDING | STATUS_ACCESS_DENIED | STATUS_INSUFFICIENT_RESOURCES | - STATUS_INVALID_PARAMETER | STATUS_INVALID_DEVICE_REQUEST | STATUS_LOCK_NOT_GRANTED ] - - */ -NTSTATUS -STDCALL -NtLockFile( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN PLARGE_INTEGER ByteOffset, - IN PLARGE_INTEGER Length, - IN PULONG Key, - IN BOOLEAN FailImmediatedly, - IN BOOLEAN ExclusiveLock - ); - -NTSTATUS -STDCALL -ZwLockFile( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN PLARGE_INTEGER ByteOffset, - IN PLARGE_INTEGER Length, - IN PULONG Key, - IN BOOLEAN FailImmediatedly, - IN BOOLEAN ExclusiveLock - ); -/* - * FUNCTION: Locks a range of virtual memory. - * ARGUMENTS: - * ProcessHandle = Handle to the process - * BaseAddress = Lower boundary of the range of bytes to lock. - * NumberOfBytesLock = Offset to the upper boundary. - * NumberOfBytesLocked (OUT) = Number of bytes actually locked. - * REMARK: - This procedure maps to the win32 procedure VirtualLock - * RETURNS: Status [STATUS_SUCCESS | STATUS_WAS_LOCKED ] - */ -NTSTATUS -STDCALL -NtLockVirtualMemory( - HANDLE ProcessHandle, - PVOID BaseAddress, - ULONG NumberOfBytesToLock, - PULONG NumberOfBytesLocked - ); -NTSTATUS -STDCALL -ZwLockVirtualMemory( - HANDLE ProcessHandle, - PVOID BaseAddress, - ULONG NumberOfBytesToLock, - PULONG NumberOfBytesLocked - ); -/* - * FUNCTION: Makes temporary object that will be removed at next boot. - * ARGUMENTS: - * Handle = Handle to object - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtMakeTemporaryObject( - IN HANDLE Handle - ); - -NTSTATUS -STDCALL -ZwMakeTemporaryObject( - IN HANDLE Handle - ); -/* - * FUNCTION: Maps a view of a section into the virtual address space of a - * process - * ARGUMENTS: - * SectionHandle = Handle of the section - * ProcessHandle = Handle of the process - * BaseAddress = Desired base address (or NULL) on entry - * Actual base address of the view on exit - * ZeroBits = Number of high order address bits that must be zero - * CommitSize = Size in bytes of the initially committed section of - * the view - * SectionOffset = Offset in bytes from the beginning of the section - * to the beginning of the view - * ViewSize = Desired length of map (or zero to map all) on entry - * Actual length mapped on exit - * InheritDisposition = Specified how the view is to be shared with - * child processes - * AllocateType = Type of allocation for the pages - * Protect = Protection for the committed region of the view - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtMapViewOfSection( - IN HANDLE SectionHandle, - IN HANDLE ProcessHandle, - IN OUT PVOID *BaseAddress, - IN ULONG ZeroBits, - IN ULONG CommitSize, - IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, - IN OUT PULONG ViewSize, - IN SECTION_INHERIT InheritDisposition, - IN ULONG AllocationType, - IN ULONG AccessProtection - ); - -NTSTATUS -STDCALL -ZwMapViewOfSection( - IN HANDLE SectionHandle, - IN HANDLE ProcessHandle, - IN OUT PVOID *BaseAddress, - IN ULONG ZeroBits, - IN ULONG CommitSize, - IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, - IN OUT PULONG ViewSize, - IN SECTION_INHERIT InheritDisposition, - IN ULONG AllocationType, - IN ULONG AccessProtection - ); - -/* - * FUNCTION: Installs a notify for the change of a directory's contents - * ARGUMENTS: - * FileHandle = Handle to the directory - Event = - * ApcRoutine = Start address - * ApcContext = Delimits the range of virtual memory - * for which the new access protection holds - * IoStatusBlock = The new access proctection for the pages - * Buffer = Caller supplies storage for resulting information --> FILE_NOTIFY_INFORMATION - * BufferSize = Size of the buffer - CompletionFilter = Can be one of the following values: - FILE_NOTIFY_CHANGE_FILE_NAME - FILE_NOTIFY_CHANGE_DIR_NAME - FILE_NOTIFY_CHANGE_NAME ( FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME ) - FILE_NOTIFY_CHANGE_ATTRIBUTES - FILE_NOTIFY_CHANGE_SIZE - FILE_NOTIFY_CHANGE_LAST_WRITE - FILE_NOTIFY_CHANGE_LAST_ACCESS - FILE_NOTIFY_CHANGE_CREATION ( change of creation timestamp ) - FILE_NOTIFY_CHANGE_EA - FILE_NOTIFY_CHANGE_SECURITY - FILE_NOTIFY_CHANGE_STREAM_NAME - FILE_NOTIFY_CHANGE_STREAM_SIZE - FILE_NOTIFY_CHANGE_STREAM_WRITE - WatchTree = If true the notify will be installed recursively on the targetdirectory and all subdirectories. - * - * REMARKS: - * The function maps to the win32 FindFirstChangeNotification, FindNextChangeNotification - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtNotifyChangeDirectoryFile( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID Buffer, - IN ULONG BufferSize, - IN ULONG CompletionFilter, - IN BOOLEAN WatchTree - ); - -NTSTATUS -STDCALL -ZwNotifyChangeDirectoryFile( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID Buffer, - IN ULONG BufferSize, - IN ULONG CompletionFilter, - IN BOOLEAN WatchTree - ); - -/* - * FUNCTION: Installs a notfication callback on registry changes - * ARGUMENTS: - KeyHandle = Handle to the registry key - Event = Event that should be signalled on modification of the key - ApcRoutine = Routine that should be called on modification of the key - ApcContext = Argument to the ApcRoutine - IoStatusBlock = ??? - CompletionFilter = Specifies the kind of notification the caller likes to receive. - Can be a combination of the following values: - - REG_NOTIFY_CHANGE_NAME - REG_NOTIFY_CHANGE_ATTRIBUTES - REG_NOTIFY_CHANGE_LAST_SET - REG_NOTIFY_CHANGE_SECURITY - - - Asynchroneous = If TRUE the changes are reported by signalling an event if false - the function will not return before a change occurs. - ChangeBuffer = Will return the old value - Length = Size of the change buffer - WatchSubtree = Indicates if the caller likes to receive a notification of changes in - sub keys or not. - * REMARKS: If the key is closed the event is signalled aswell. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtNotifyChangeKey( - IN HANDLE KeyHandle, - IN HANDLE Event, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG CompletionFilter, - IN BOOLEAN Asynchroneous, - OUT PVOID ChangeBuffer, - IN ULONG Length, - IN BOOLEAN WatchSubtree - ); - -NTSTATUS -STDCALL -ZwNotifyChangeKey( - IN HANDLE KeyHandle, - IN HANDLE Event, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG CompletionFilter, - IN BOOLEAN Asynchroneous, - OUT PVOID ChangeBuffer, - IN ULONG Length, - IN BOOLEAN WatchSubtree - ); - -/* - * FUNCTION: Opens an existing directory object - * ARGUMENTS: - * FileHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the directory - * ObjectAttributes = Initialized attributes for the object - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtOpenDirectoryObject( - OUT PHANDLE FileHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -NTSTATUS -STDCALL -ZwOpenDirectoryObject( - OUT PHANDLE FileHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -/* - * FUNCTION: Opens an existing event - * ARGUMENTS: - * EventHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the event - * ObjectAttributes = Initialized attributes for the object - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtOpenEvent( - OUT PHANDLE EventHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -NTSTATUS -STDCALL -ZwOpenEvent( - OUT PHANDLE EventHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -/* - * FUNCTION: Opens an existing event pair - * ARGUMENTS: - * EventHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the event - * ObjectAttributes = Initialized attributes for the object - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtOpenEventPair( - OUT PHANDLE EventPairHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -NTSTATUS -STDCALL -ZwOpenEventPair( - OUT PHANDLE EventPairHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -/* - * FUNCTION: Opens an existing file - * ARGUMENTS: - * FileHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the file - * ObjectAttributes = Initialized attributes for the object - * IoStatusBlock = - * ShareAccess = - * OpenOptions = - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtOpenFile( - OUT PHANDLE FileHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG ShareAccess, - IN ULONG OpenOptions - ); - -NTSTATUS -STDCALL -ZwOpenFile( - OUT PHANDLE FileHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG ShareAccess, - IN ULONG OpenOptions - ); - -/* - * FUNCTION: Opens an existing io completion object - * ARGUMENTS: - * CompletionPort (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the io completion object - * ObjectAttributes = Initialized attributes for the object - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtOpenIoCompletion( - OUT PHANDLE CompetionPort, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -NTSTATUS -STDCALL -ZwOpenIoCompletion( - OUT PHANDLE CompetionPort, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -/* - * FUNCTION: Opens an existing key in the registry - * ARGUMENTS: - * KeyHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the key - * ObjectAttributes = Initialized attributes for the object - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtOpenKey( - OUT PHANDLE KeyHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -NTSTATUS -STDCALL -ZwOpenKey( - OUT PHANDLE KeyHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -/* - * FUNCTION: Opens an existing key in the registry - * ARGUMENTS: - * MutantHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the mutant - * ObjectAttribute = Initialized attributes for the object - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtOpenMutant( - OUT PHANDLE MutantHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -NTSTATUS -STDCALL -ZwOpenMutant( - OUT PHANDLE MutantHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -NTSTATUS -STDCALL -NtOpenObjectAuditAlarm( - IN PUNICODE_STRING SubsystemName, - IN PVOID HandleId, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN HANDLE ClientToken, - IN ULONG DesiredAccess, - IN ULONG GrantedAccess, - IN PPRIVILEGE_SET Privileges, - IN BOOLEAN ObjectCreation, - IN BOOLEAN AccessGranted, - OUT PBOOLEAN GenerateOnClose - ); - -NTSTATUS -STDCALL -ZwOpenObjectAuditAlarm( - IN PUNICODE_STRING SubsystemName, - IN PVOID HandleId, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN HANDLE ClientToken, - IN ULONG DesiredAccess, - IN ULONG GrantedAccess, - IN PPRIVILEGE_SET Privileges, - IN BOOLEAN ObjectCreation, - IN BOOLEAN AccessGranted, - OUT PBOOLEAN GenerateOnClose - ); -/* - * FUNCTION: Opens an existing process - * ARGUMENTS: - * ProcessHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the process - * ObjectAttribute = Initialized attributes for the object - * ClientId = Identifies the process id to open - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtOpenProcess ( - OUT PHANDLE ProcessHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN PCLIENT_ID ClientId - ); -NTSTATUS -STDCALL -ZwOpenProcess ( - OUT PHANDLE ProcessHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN PCLIENT_ID ClientId - ); -/* - * FUNCTION: Opens an existing process - * ARGUMENTS: - * ProcessHandle = Handle of the process of which owns the token - * DesiredAccess = Requested access to the token - * TokenHandle (OUT) = Caller supplies storage for the resulting token. - * REMARKS: - This function maps to the win32 - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtOpenProcessToken( - IN HANDLE ProcessHandle, - IN ACCESS_MASK DesiredAccess, - OUT PHANDLE TokenHandle - ); - -NTSTATUS -STDCALL -ZwOpenProcessToken( - IN HANDLE ProcessHandle, - IN ACCESS_MASK DesiredAccess, - OUT PHANDLE TokenHandle - ); - -/* - * FUNCTION: Opens an existing section object - * ARGUMENTS: - * KeyHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the key - * ObjectAttribute = Initialized attributes for the object - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtOpenSection( - OUT PHANDLE SectionHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -NTSTATUS -STDCALL -ZwOpenSection( - OUT PHANDLE SectionHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -/* - * FUNCTION: Opens an existing semaphore - * ARGUMENTS: - * SemaphoreHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the semaphore - * ObjectAttribute = Initialized attributes for the object - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtOpenSemaphore( - IN HANDLE SemaphoreHandle, - IN ACCESS_MASK DesiredAcces, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -NTSTATUS -STDCALL -ZwOpenSemaphore( - IN HANDLE SemaphoreHandle, - IN ACCESS_MASK DesiredAcces, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -/* - * FUNCTION: Opens an existing symbolic link - * ARGUMENTS: - * SymbolicLinkHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the symbolic link - * ObjectAttribute = Initialized attributes for the object - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtOpenSymbolicLinkObject( - OUT PHANDLE SymbolicLinkHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -NTSTATUS -STDCALL -ZwOpenSymbolicLinkObject( - OUT PHANDLE SymbolicLinkHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -/* - * FUNCTION: Opens an existing thread - * ARGUMENTS: - * ThreadHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the thread - * ObjectAttribute = Initialized attributes for the object - * ClientId = Identifies the thread to open. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtOpenThread( - OUT PHANDLE ThreadHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN PCLIENT_ID ClientId - ); -NTSTATUS -STDCALL -ZwOpenThread( - OUT PHANDLE ThreadHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN PCLIENT_ID ClientId - ); - -NTSTATUS -STDCALL -NtOpenThreadToken( - IN HANDLE ThreadHandle, - IN ACCESS_MASK DesiredAccess, - IN BOOLEAN OpenAsSelf, - OUT PHANDLE TokenHandle - ); - -NTSTATUS -STDCALL -ZwOpenThreadToken( - IN HANDLE ThreadHandle, - IN ACCESS_MASK DesiredAccess, - IN BOOLEAN OpenAsSelf, - OUT PHANDLE TokenHandle - ); -/* - * FUNCTION: Opens an existing timer - * ARGUMENTS: - * TimerHandle (OUT) = Caller supplied storage for the resulting handle - * DesiredAccess = Requested access to the timer - * ObjectAttribute = Initialized attributes for the object - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtOpenTimer( - OUT PHANDLE TimerHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); -NTSTATUS -STDCALL -ZwOpenTimer( - OUT PHANDLE TimerHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -/* - * FUNCTION: Checks an access token for specific privileges - * ARGUMENTS: - * ClientToken = Handle to a access token structure - * RequiredPrivileges = Specifies the requested privileges. - * Result = Caller supplies storage for the result. If PRIVILEGE_SET_ALL_NECESSARY is - set in the Control member of PRIVILEGES_SET Result - will only be TRUE if all privileges are present in the access token. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtPrivilegeCheck( - IN HANDLE ClientToken, - IN PPRIVILEGE_SET RequiredPrivileges, - IN PBOOLEAN Result - ); - -NTSTATUS -STDCALL -ZwPrivilegeCheck( - IN HANDLE ClientToken, - IN PPRIVILEGE_SET RequiredPrivileges, - IN PBOOLEAN Result - ); - -NTSTATUS -STDCALL -NtPrivilegedServiceAuditAlarm( - IN PUNICODE_STRING SubsystemName, - IN PUNICODE_STRING ServiceName, - IN HANDLE ClientToken, - IN PPRIVILEGE_SET Privileges, - IN BOOLEAN AccessGranted - ); - -NTSTATUS -STDCALL -ZwPrivilegedServiceAuditAlarm( - IN PUNICODE_STRING SubsystemName, - IN PUNICODE_STRING ServiceName, - IN HANDLE ClientToken, - IN PPRIVILEGE_SET Privileges, - IN BOOLEAN AccessGranted - ); - -NTSTATUS -STDCALL -NtPrivilegeObjectAuditAlarm( - IN PUNICODE_STRING SubsystemName, - IN PVOID HandleId, - IN HANDLE ClientToken, - IN ULONG DesiredAccess, - IN PPRIVILEGE_SET Privileges, - IN BOOLEAN AccessGranted - ); - -NTSTATUS -STDCALL -ZwPrivilegeObjectAuditAlarm( - IN PUNICODE_STRING SubsystemName, - IN PVOID HandleId, - IN HANDLE ClientToken, - IN ULONG DesiredAccess, - IN PPRIVILEGE_SET Privileges, - IN BOOLEAN AccessGranted - ); - -/* - * FUNCTION: Entry point for native applications - * ARGUMENTS: - * Peb = Pointes to the Process Environment Block (PEB) - * REMARKS: - * Native applications should use this function instead of a main. - * Calling proces should terminate itself. - * RETURNS: Status - */ -VOID STDCALL -NtProcessStartup( - IN PPEB Peb - ); - -/* - * FUNCTION: Set the access protection of a range of virtual memory - * ARGUMENTS: - * ProcessHandle = Handle to process owning the virtual address space - * BaseAddress = Start address - * NumberOfBytesToProtect = Delimits the range of virtual memory - * for which the new access protection holds - * NewAccessProtection = The new access proctection for the pages - * OldAccessProtection = Caller should supply storage for the old - * access protection - * - * REMARKS: - * The function maps to the win32 VirtualProtectEx - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtProtectVirtualMemory( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress, - IN ULONG NumberOfBytesToProtect, - IN ULONG NewAccessProtection, - OUT PULONG OldAccessProtection - ); - -NTSTATUS -STDCALL -ZwProtectVirtualMemory( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress, - IN ULONG NumberOfBytesToProtect, - IN ULONG NewAccessProtection, - OUT PULONG OldAccessProtection - ); - - -/* - * FUNCTION: Signals an event and resets it afterwards. - * ARGUMENTS: - * EventHandle = Handle to the event - * PulseCount = Number of times the action is repeated - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtPulseEvent( - IN HANDLE EventHandle, - IN PULONG PulseCount OPTIONAL - ); - -NTSTATUS -STDCALL -ZwPulseEvent( - IN HANDLE EventHandle, - IN PULONG PulseCount OPTIONAL - ); - -/* - * FUNCTION: Queries the attributes of a file - * ARGUMENTS: - * ObjectAttributes = Initialized attributes for the object - * Buffer = Caller supplies storage for the attributes - * RETURNS: Status - */ - -NTSTATUS STDCALL -NtQueryAttributesFile(IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PFILE_BASIC_INFORMATION FileInformation); - -NTSTATUS STDCALL -ZwQueryAttributesFile(IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PFILE_BASIC_INFORMATION FileInformation); - -/* - * FUNCTION: Queries the default locale id - * ARGUMENTS: - * UserProfile = Type of locale id - * TRUE: thread locale id - * FALSE: system locale id - * DefaultLocaleId = Caller supplies storage for the locale id - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtQueryDefaultLocale( - IN BOOLEAN UserProfile, - OUT PLCID DefaultLocaleId - ); - -NTSTATUS -STDCALL -ZwQueryDefaultLocale( - IN BOOLEAN UserProfile, - OUT PLCID DefaultLocaleId - ); - -/* - * FUNCTION: Queries a directory file. - * ARGUMENTS: - * FileHandle = Handle to a directory file - * EventHandle = Handle to the event signaled on completion - * ApcRoutine = Asynchroneous procedure callback, called on completion - * ApcContext = Argument to the apc. - * IoStatusBlock = Caller supplies storage for extended status information. - * FileInformation = Caller supplies storage for the resulting information. - * - * FileNameInformation FILE_NAMES_INFORMATION - * FileDirectoryInformation FILE_DIRECTORY_INFORMATION - * FileFullDirectoryInformation FILE_FULL_DIRECTORY_INFORMATION - * FileBothDirectoryInformation FILE_BOTH_DIR_INFORMATION - * - * Length = Size of the storage supplied - * FileInformationClass = Indicates the type of information requested. - * ReturnSingleEntry = Specify true if caller only requests the first directory found. - * FileName = Initial directory name to query, that may contain wild cards. - * RestartScan = Number of times the action should be repeated - * RETURNS: Status [ STATUS_SUCCESS, STATUS_ACCESS_DENIED, STATUS_INSUFFICIENT_RESOURCES, - * STATUS_INVALID_PARAMETER, STATUS_INVALID_DEVICE_REQUEST, STATUS_BUFFER_OVERFLOW, - * STATUS_INVALID_INFO_CLASS, STATUS_NO_SUCH_FILE, STATUS_NO_MORE_FILES ] - */ - -NTSTATUS -STDCALL -NtQueryDirectoryFile( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID FileInformation, - IN ULONG Length, - IN FILE_INFORMATION_CLASS FileInformationClass, - IN BOOLEAN ReturnSingleEntry, - IN PUNICODE_STRING FileName OPTIONAL, - IN BOOLEAN RestartScan - ); - -NTSTATUS -STDCALL -ZwQueryDirectoryFile( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID FileInformation, - IN ULONG Length, - IN FILE_INFORMATION_CLASS FileInformationClass, - IN BOOLEAN ReturnSingleEntry, - IN PUNICODE_STRING FileName OPTIONAL, - IN BOOLEAN RestartScan - ); - -/* - * FUNCTION: Query information about the content of a directory object - * ARGUMENTS: - DirObjInformation = Buffer must be large enough to hold the name strings too - GetNextIndex = If TRUE :return the index of the next object in this directory in ObjectIndex - If FALSE: return the number of objects in this directory in ObjectIndex - IgnoreInputIndex= If TRUE: ignore input value of ObjectIndex always start at index 0 - If FALSE use input value of ObjectIndex - ObjectIndex = zero based index of object in the directory depends on GetNextIndex and IgnoreInputIndex - DataWritten = Actual size of the ObjectIndex ??? - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtQueryDirectoryObject( - IN HANDLE DirObjHandle, - OUT POBJDIR_INFORMATION DirObjInformation, - IN ULONG BufferLength, - IN BOOLEAN GetNextIndex, - IN BOOLEAN IgnoreInputIndex, - IN OUT PULONG ObjectIndex, - OUT PULONG DataWritten OPTIONAL - ); - -NTSTATUS -STDCALL -ZwQueryDirectoryObject( - IN HANDLE DirObjHandle, - OUT POBJDIR_INFORMATION DirObjInformation, - IN ULONG BufferLength, - IN BOOLEAN GetNextIndex, - IN BOOLEAN IgnoreInputIndex, - IN OUT PULONG ObjectIndex, - OUT PULONG DataWritten OPTIONAL - ); - -/* - * FUNCTION: Queries the extended attributes of a file - * ARGUMENTS: - * FileHandle = Handle to the event - * IoStatusBlock = Number of times the action is repeated - * Buffer - * Length - * ReturnSingleEntry - * EaList - * EaListLength - * EaIndex - * RestartScan - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtQueryEaFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID Buffer, - IN ULONG Length, - IN BOOLEAN ReturnSingleEntry, - IN PVOID EaList OPTIONAL, - IN ULONG EaListLength, - IN PULONG EaIndex OPTIONAL, - IN BOOLEAN RestartScan - ); - -NTSTATUS -STDCALL -ZwQueryEaFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID Buffer, - IN ULONG Length, - IN BOOLEAN ReturnSingleEntry, - IN PVOID EaList OPTIONAL, - IN ULONG EaListLength, - IN PULONG EaIndex OPTIONAL, - IN BOOLEAN RestartScan - ); - -/* - * FUNCTION: Queries an event - * ARGUMENTS: - * EventHandle = Handle to the event - * EventInformationClass = Index of the information structure - - EventBasicInformation EVENT_BASIC_INFORMATION - - * EventInformation = Caller supplies storage for the information structure - * EventInformationLength = Size of the information structure - * ReturnLength = Data written - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtQueryEvent( - IN HANDLE EventHandle, - IN EVENT_INFORMATION_CLASS EventInformationClass, - OUT PVOID EventInformation, - IN ULONG EventInformationLength, - OUT PULONG ReturnLength - ); -NTSTATUS -STDCALL -ZwQueryEvent( - IN HANDLE EventHandle, - IN EVENT_INFORMATION_CLASS EventInformationClass, - OUT PVOID EventInformation, - IN ULONG EventInformationLength, - OUT PULONG ReturnLength - ); - -NTSTATUS STDCALL -NtQueryFullAttributesFile(IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PFILE_NETWORK_OPEN_INFORMATION FileInformation); - -NTSTATUS STDCALL -ZwQueryFullAttributesFile(IN POBJECT_ATTRIBUTES ObjectAttributes, - OUT PFILE_NETWORK_OPEN_INFORMATION FileInformation); - -NTSTATUS -STDCALL -NtQueryInformationAtom( - IN RTL_ATOM Atom, - IN ATOM_INFORMATION_CLASS AtomInformationClass, - OUT PVOID AtomInformation, - IN ULONG AtomInformationLength, - OUT PULONG ReturnLength OPTIONAL - ); - -NTSTATUS -STDCALL -NtQueryInformationAtom( - IN RTL_ATOM Atom, - IN ATOM_INFORMATION_CLASS AtomInformationClass, - OUT PVOID AtomInformation, - IN ULONG AtomInformationLength, - OUT PULONG ReturnLength OPTIONAL - ); - - -/* - * FUNCTION: Queries the information of a file object. - * ARGUMENTS: - * FileHandle = Handle to the file object - * IoStatusBlock = Caller supplies storage for extended information - * on the current operation. - * FileInformation = Storage for the new file information - * Lenght = Size of the storage for the file information. - * FileInformationClass = Indicates which file information is queried - - FileDirectoryInformation FILE_DIRECTORY_INFORMATION - FileFullDirectoryInformation FILE_FULL_DIRECTORY_INFORMATION - FileBothDirectoryInformation FILE_BOTH_DIRECTORY_INFORMATION - FileBasicInformation FILE_BASIC_INFORMATION - FileStandardInformation FILE_STANDARD_INFORMATION - FileInternalInformation FILE_INTERNAL_INFORMATION - FileEaInformation FILE_EA_INFORMATION - FileAccessInformation FILE_ACCESS_INFORMATION - FileNameInformation FILE_NAME_INFORMATION - FileRenameInformation FILE_RENAME_INFORMATION - FileLinkInformation - FileNamesInformation FILE_NAMES_INFORMATION - FileDispositionInformation FILE_DISPOSITION_INFORMATION - FilePositionInformation FILE_POSITION_INFORMATION - FileFullEaInformation FILE_FULL_EA_INFORMATION - FileModeInformation FILE_MODE_INFORMATION - FileAlignmentInformation FILE_ALIGNMENT_INFORMATION - FileAllInformation FILE_ALL_INFORMATION - - FileEndOfFileInformation FILE_END_OF_FILE_INFORMATION - FileAlternateNameInformation - FileStreamInformation FILE_STREAM_INFORMATION - FilePipeInformation - FilePipeLocalInformation - FilePipeRemoteInformation - FileMailslotQueryInformation - FileMailslotSetInformation - FileCompressionInformation FILE_COMPRESSION_INFORMATION - FileCopyOnWriteInformation - FileCompletionInformation IO_COMPLETION_CONTEXT - FileMoveClusterInformation - FileOleClassIdInformation - FileOleStateBitsInformation - FileNetworkOpenInformation FILE_NETWORK_OPEN_INFORMATION - FileObjectIdInformation - FileOleAllInformation - FileOleDirectoryInformation - FileContentIndexInformation - FileInheritContentIndexInformation - FileOleInformation - FileMaximumInformation - - * REMARK: - * This procedure maps to the win32 GetShortPathName, GetLongPathName, - GetFullPathName, GetFileType, GetFileSize, GetFileTime functions. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtQueryInformationFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID FileInformation, - IN ULONG Length, - IN FILE_INFORMATION_CLASS FileInformationClass - ); - -NTSTATUS -STDCALL -ZwQueryInformationFile( - HANDLE FileHandle, - PIO_STATUS_BLOCK IoStatusBlock, - PVOID FileInformation, - ULONG Length, - FILE_INFORMATION_CLASS FileInformationClass - ); - -/* - * FUNCTION: Queries the information of a process object. - * ARGUMENTS: - * ProcessHandle = Handle to the process object - * ProcessInformation = Index to a certain information structure - - ProcessBasicInformation PROCESS_BASIC_INFORMATION - ProcessQuotaLimits QUOTA_LIMITS - ProcessIoCounters IO_COUNTERS - ProcessVmCounters VM_COUNTERS - ProcessTimes KERNEL_USER_TIMES - ProcessBasePriority KPRIORITY - ProcessRaisePriority KPRIORITY - ProcessDebugPort HANDLE - ProcessExceptionPort HANDLE - ProcessAccessToken PROCESS_ACCESS_TOKEN - ProcessLdtInformation LDT_ENTRY ?? - ProcessLdtSize ULONG - ProcessDefaultHardErrorMode ULONG - ProcessIoPortHandlers // kernel mode only - ProcessPooledUsageAndLimits POOLED_USAGE_AND_LIMITS - ProcessWorkingSetWatch PROCESS_WS_WATCH_INFORMATION - ProcessUserModeIOPL (I/O Privilege Level) - ProcessEnableAlignmentFaultFixup BOOLEAN - ProcessPriorityClass ULONG - ProcessWx86Information ULONG - ProcessHandleCount ULONG - ProcessAffinityMask ULONG - ProcessPooledQuotaLimits QUOTA_LIMITS - MaxProcessInfoClass - - * ProcessInformation = Caller supplies storage for the process information structure - * ProcessInformationLength = Size of the process information structure - * ReturnLength = Actual number of bytes written - - * REMARK: - * This procedure maps to the win32 GetProcessTimes, GetProcessVersion, - GetProcessWorkingSetSize, GetProcessPriorityBoost, GetProcessAffinityMask, GetPriorityClass, - GetProcessShutdownParameters functions. - * RETURNS: Status -*/ - -NTSTATUS -STDCALL -NtQueryInformationProcess( - IN HANDLE ProcessHandle, - IN CINT ProcessInformationClass, - OUT PVOID ProcessInformation, - IN ULONG ProcessInformationLength, - OUT PULONG ReturnLength - ); - -NTSTATUS -STDCALL -ZwQueryInformationProcess( - IN HANDLE ProcessHandle, - IN CINT ProcessInformationClass, - OUT PVOID ProcessInformation, - IN ULONG ProcessInformationLength, - OUT PULONG ReturnLength - ); - - -/* - * FUNCTION: Queries the information of a thread object. - * ARGUMENTS: - * ThreadHandle = Handle to the thread object - * ThreadInformationClass = Index to a certain information structure - - ThreadBasicInformation THREAD_BASIC_INFORMATION - ThreadTimes KERNEL_USER_TIMES - ThreadPriority KPRIORITY - ThreadBasePriority KPRIORITY - ThreadAffinityMask KAFFINITY - ThreadImpersonationToken - ThreadDescriptorTableEntry - ThreadEnableAlignmentFaultFixup - ThreadEventPair - ThreadQuerySetWin32StartAddress - ThreadZeroTlsCell - ThreadPerformanceCount - ThreadAmILastThread BOOLEAN - ThreadIdealProcessor ULONG - ThreadPriorityBoost ULONG - MaxThreadInfoClass - - - * ThreadInformation = Caller supplies torage for the thread information - * ThreadInformationLength = Size of the thread information structure - * ReturnLength = Actual number of bytes written - - * REMARK: - * This procedure maps to the win32 GetThreadTimes, GetThreadPriority, - GetThreadPriorityBoost functions. - * RETURNS: Status -*/ - - -NTSTATUS -STDCALL -NtQueryInformationThread( - IN HANDLE ThreadHandle, - IN THREADINFOCLASS ThreadInformationClass, - OUT PVOID ThreadInformation, - IN ULONG ThreadInformationLength, - OUT PULONG ReturnLength - ); - - -NTSTATUS -STDCALL -NtQueryInformationToken( - IN HANDLE TokenHandle, - IN TOKEN_INFORMATION_CLASS TokenInformationClass, - OUT PVOID TokenInformation, - IN ULONG TokenInformationLength, - OUT PULONG ReturnLength - ); - -NTSTATUS -STDCALL -ZwQueryInformationToken( - IN HANDLE TokenHandle, - IN TOKEN_INFORMATION_CLASS TokenInformationClass, - OUT PVOID TokenInformation, - IN ULONG TokenInformationLength, - OUT PULONG ReturnLength - ); - -/* - * FUNCTION: Query the interval and the clocksource for profiling - * ARGUMENTS: - Interval = - ClockSource = - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtQueryIntervalProfile( - OUT PULONG Interval, - OUT KPROFILE_SOURCE ClockSource - ); - -NTSTATUS -STDCALL -ZwQueryIntervalProfile( - OUT PULONG Interval, - OUT KPROFILE_SOURCE ClockSource - ); - - - -NTSTATUS -STDCALL -NtQueryIoCompletion( - IN HANDLE CompletionPort, - IN ULONG CompletionKey, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PULONG NumberOfBytesTransferred - ); -NTSTATUS -STDCALL -ZwQueryIoCompletion( - IN HANDLE CompletionPort, - IN ULONG CompletionKey, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PULONG NumberOfBytesTransferred - ); - - -/* - * FUNCTION: Queries the information of a registry key object. - * ARGUMENTS: - KeyHandle = Handle to a registry key - KeyInformationClass = Index to a certain information structure - KeyInformation = Caller supplies storage for resulting information - Length = Size of the supplied storage - ResultLength = Bytes written - */ -NTSTATUS -STDCALL -NtQueryKey( - IN HANDLE KeyHandle, - IN KEY_INFORMATION_CLASS KeyInformationClass, - OUT PVOID KeyInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -NTSTATUS -STDCALL -ZwQueryKey( - IN HANDLE KeyHandle, - IN KEY_INFORMATION_CLASS KeyInformationClass, - OUT PVOID KeyInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - - -// draft - -NTSTATUS -STDCALL -NtQueryMultipleValueKey( - IN HANDLE KeyHandle, - IN OUT PKEY_VALUE_ENTRY ValueList, - IN ULONG NumberOfValues, - OUT PVOID Buffer, - IN OUT PULONG Length, - OUT PULONG ReturnLength - ); - -NTSTATUS -STDCALL -ZwQueryMultipleValueKey( - IN HANDLE KeyHandle, - IN OUT PKEY_VALUE_ENTRY ValueList, - IN ULONG NumberOfValues, - OUT PVOID Buffer, - IN OUT PULONG Length, - OUT PULONG ReturnLength - ); - -/* - * FUNCTION: Queries the information of a mutant object. - * ARGUMENTS: - MutantHandle = Handle to a mutant - MutantInformationClass = Index to a certain information structure - MutantInformation = Caller supplies storage for resulting information - Length = Size of the supplied storage - ResultLength = Bytes written - */ -NTSTATUS -STDCALL -NtQueryMutant( - IN HANDLE MutantHandle, - IN CINT MutantInformationClass, - OUT PVOID MutantInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -NTSTATUS -STDCALL -ZwQueryMutant( - IN HANDLE MutantHandle, - IN CINT MutantInformationClass, - OUT PVOID MutantInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); -/* - * FUNCTION: Queries the information of a object. - * ARGUMENTS: - ObjectHandle = Handle to a object - ObjectInformationClass = Index to a certain information structure - - ObjectBasicInformation - ObjectTypeInformation OBJECT_TYPE_INFORMATION - ObjectNameInformation OBJECT_NAME_INFORMATION - ObjectDataInformation OBJECT_DATA_INFORMATION - - ObjectInformation = Caller supplies storage for resulting information - Length = Size of the supplied storage - ResultLength = Bytes written - */ - -NTSTATUS -STDCALL -NtQueryObject( - IN HANDLE ObjectHandle, - IN CINT ObjectInformationClass, - OUT PVOID ObjectInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -NTSTATUS -STDCALL -ZwQueryObject( - IN HANDLE ObjectHandle, - IN CINT ObjectInformationClass, - OUT PVOID ObjectInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -/* - * FUNCTION: Queries the system ( high-resolution ) performance counter. - * ARGUMENTS: - * Counter = Performance counter - * Frequency = Performance frequency - * REMARKS: - This procedure queries a tick count faster than 10ms ( The resolution for Intel®-based CPUs is about 0.8 microseconds.) - This procedure maps to the win32 QueryPerformanceCounter, QueryPerformanceFrequency - * RETURNS: Status - * -*/ -NTSTATUS -STDCALL -NtQueryPerformanceCounter( - IN PLARGE_INTEGER Counter, - IN PLARGE_INTEGER Frequency - ); - -NTSTATUS -STDCALL -ZwQueryPerformanceCounter( - IN PLARGE_INTEGER Counter, - IN PLARGE_INTEGER Frequency - ); -/* - * FUNCTION: Queries the information of a section object. - * ARGUMENTS: - * SectionHandle = Handle to the section link object - * SectionInformationClass = Index to a certain information structure - * SectionInformation (OUT)= Caller supplies storage for resulting information - * Length = Size of the supplied storage - * ResultLength = Data written - * RETURNS: Status - * -*/ -NTSTATUS -STDCALL -NtQuerySection( - IN HANDLE SectionHandle, - IN CINT SectionInformationClass, - OUT PVOID SectionInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -NTSTATUS -STDCALL -ZwQuerySection( - IN HANDLE SectionHandle, - IN CINT SectionInformationClass, - OUT PVOID SectionInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -NTSTATUS -STDCALL -NtQuerySecurityObject( - IN HANDLE Object, - IN CINT SecurityObjectInformationClass, - OUT PVOID SecurityObjectInformation, - IN ULONG Length, - OUT PULONG ReturnLength - ); - -NTSTATUS -STDCALL -ZwQuerySecurityObject( - IN HANDLE Object, - IN CINT SecurityObjectInformationClass, - OUT PVOID SecurityObjectInformation, - IN ULONG Length, - OUT PULONG ReturnLength - ); - - -/* - * FUNCTION: Queries the information of a semaphore. - * ARGUMENTS: - * SemaphoreHandle = Handle to the semaphore object - * SemaphoreInformationClass = Index to a certain information structure - - SemaphoreBasicInformation SEMAPHORE_BASIC_INFORMATION - - * SemaphoreInformation = Caller supplies storage for the semaphore information structure - * Length = Size of the infomation structure - */ -NTSTATUS -STDCALL -NtQuerySemaphore( - IN HANDLE SemaphoreHandle, - IN SEMAPHORE_INFORMATION_CLASS SemaphoreInformationClass, - OUT PVOID SemaphoreInformation, - IN ULONG Length, - OUT PULONG ReturnLength - ); - -NTSTATUS -STDCALL -ZwQuerySemaphore( - IN HANDLE SemaphoreHandle, - IN SEMAPHORE_INFORMATION_CLASS SemaphoreInformationClass, - OUT PVOID SemaphoreInformation, - IN ULONG Length, - OUT PULONG ReturnLength - ); - - -/* - * FUNCTION: Queries the information of a symbolic link object. - * ARGUMENTS: - * SymbolicLinkHandle = Handle to the symbolic link object - * LinkTarget = resolved name of link - * DataWritten = size of the LinkName. - * RETURNS: Status - * -*/ -NTSTATUS -STDCALL -NtQuerySymbolicLinkObject( - IN HANDLE SymLinkObjHandle, - OUT PUNICODE_STRING LinkTarget, - OUT PULONG DataWritten OPTIONAL - ); - -NTSTATUS -STDCALL -ZwQuerySymbolicLinkObject( - IN HANDLE SymLinkObjHandle, - OUT PUNICODE_STRING LinkName, - OUT PULONG DataWritten OPTIONAL - ); - - -/* - * FUNCTION: Queries a system environment variable. - * ARGUMENTS: - * Name = Name of the variable - * Value (OUT) = value of the variable - * Length = size of the buffer - * ReturnLength = data written - * RETURNS: Status - * -*/ -NTSTATUS -STDCALL -NtQuerySystemEnvironmentValue( - IN PUNICODE_STRING Name, - OUT PVOID Value, - ULONG Length, - PULONG ReturnLength - ); - -NTSTATUS -STDCALL -ZwQuerySystemEnvironmentValue( - IN PUNICODE_STRING Name, - OUT PVOID Value, - ULONG Length, - PULONG ReturnLength - ); - - -/* - * FUNCTION: Queries the system information. - * ARGUMENTS: - * SystemInformationClass = Index to a certain information structure - - SystemTimeAdjustmentInformation SYSTEM_TIME_ADJUSTMENT - SystemCacheInformation SYSTEM_CACHE_INFORMATION - SystemConfigurationInformation CONFIGURATION_INFORMATION - - * SystemInformation = caller supplies storage for the information structure - * Length = size of the structure - ResultLength = Data written - * RETURNS: Status - * -*/ -NTSTATUS -STDCALL -NtQuerySystemInformation( - IN SYSTEM_INFORMATION_CLASS SystemInformationClass, - OUT PVOID SystemInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -NTSTATUS -STDCALL -ZwQuerySystemInformation( - IN SYSTEM_INFORMATION_CLASS SystemInformationClass, - OUT PVOID SystemInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -/* - * FUNCTION: Retrieves the system time - * ARGUMENTS: - * CurrentTime (OUT) = Caller should supply storage for the resulting time. - * RETURNS: Status - * -*/ - -NTSTATUS -STDCALL -NtQuerySystemTime ( - OUT TIME *CurrentTime - ); - -NTSTATUS -STDCALL -ZwQuerySystemTime ( - OUT TIME *CurrentTime - ); - -/* - * FUNCTION: Queries information about a timer - * ARGUMENTS: - * TimerHandle = Handle to the timer - TimerValueInformationClass = Index to a certain information structure - TimerValueInformation = Caller supplies storage for the information structure - Length = Size of the information structure - ResultLength = Data written - * RETURNS: Status - * -*/ -NTSTATUS -STDCALL -NtQueryTimer( - IN HANDLE TimerHandle, - IN CINT TimerInformationClass, - OUT PVOID TimerInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); -NTSTATUS -STDCALL -ZwQueryTimer( - IN HANDLE TimerHandle, - IN CINT TimerInformationClass, - OUT PVOID TimerInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -/* - * FUNCTION: Queries the timer resolution - * ARGUMENTS: - * MinimumResolution (OUT) = Caller should supply storage for the resulting time. - Maximum Resolution (OUT) = Caller should supply storage for the resulting time. - ActualResolution (OUT) = Caller should supply storage for the resulting time. - * RETURNS: Status - * -*/ - - -NTSTATUS -STDCALL -NtQueryTimerResolution ( - OUT PULONG MinimumResolution, - OUT PULONG MaximumResolution, - OUT PULONG ActualResolution - ); - -NTSTATUS -STDCALL -ZwQueryTimerResolution ( - OUT PULONG MinimumResolution, - OUT PULONG MaximumResolution, - OUT PULONG ActualResolution - ); - -/* - * FUNCTION: Queries a registry key value - * ARGUMENTS: - * KeyHandle = Handle to the registry key - ValueName = Name of the value in the registry key - KeyValueInformationClass = Index to a certain information structure - - KeyValueBasicInformation = KEY_VALUE_BASIC_INFORMATION - KeyValueFullInformation = KEY_FULL_INFORMATION - KeyValuePartialInformation = KEY_VALUE_PARTIAL_INFORMATION - - KeyValueInformation = Caller supplies storage for the information structure - Length = Size of the information structure - ResultLength = Data written - * RETURNS: Status - * -*/ -NTSTATUS -STDCALL -NtQueryValueKey( - IN HANDLE KeyHandle, - IN PUNICODE_STRING ValueName, - IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, - OUT PVOID KeyValueInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -NTSTATUS -STDCALL -ZwQueryValueKey( - IN HANDLE KeyHandle, - IN PUNICODE_STRING ValueName, - IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, - OUT PVOID KeyValueInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - - - - -/* - * FUNCTION: Queries the virtual memory information. - * ARGUMENTS: - ProcessHandle = Process owning the virtual address space - BaseAddress = Points to the page where the information is queried for. - * VirtualMemoryInformationClass = Index to a certain information structure - - MemoryBasicInformation MEMORY_BASIC_INFORMATION - - * VirtualMemoryInformation = caller supplies storage for the information structure - * Length = size of the structure - ResultLength = Data written - * RETURNS: Status - * -*/ - -NTSTATUS -STDCALL -NtQueryVirtualMemory( - IN HANDLE ProcessHandle, - IN PVOID Address, - IN IN CINT VirtualMemoryInformationClass, - OUT PVOID VirtualMemoryInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); -NTSTATUS -STDCALL -ZwQueryVirtualMemory( - IN HANDLE ProcessHandle, - IN PVOID Address, - IN IN CINT VirtualMemoryInformationClass, - OUT PVOID VirtualMemoryInformation, - IN ULONG Length, - OUT PULONG ResultLength - ); - -/* - * FUNCTION: Queries the volume information - * ARGUMENTS: - * FileHandle = Handle to a file object on the target volume - * IoStatusBlock = Caller should supply storage for additional status information - * ReturnLength = DataWritten - * FsInformation = Caller should supply storage for the information structure. - * Length = Size of the information structure - * FsInformationClass = Index to a information structure - - FileFsVolumeInformation FILE_FS_VOLUME_INFORMATION - FileFsLabelInformation FILE_FS_LABEL_INFORMATION - FileFsSizeInformation FILE_FS_SIZE_INFORMATION - FileFsDeviceInformation FILE_FS_DEVICE_INFORMATION - FileFsAttributeInformation FILE_FS_ATTRIBUTE_INFORMATION - FileFsControlInformation - FileFsQuotaQueryInformation -- - FileFsQuotaSetInformation -- - FileFsMaximumInformation - - * RETURNS: Status [ STATUS_SUCCESS | STATUS_INSUFFICIENT_RESOURCES | STATUS_INVALID_PARAMETER | - STATUS_INVALID_DEVICE_REQUEST | STATUS_BUFFER_OVERFLOW ] - * -*/ -NTSTATUS -STDCALL -NtQueryVolumeInformationFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID FsInformation, - IN ULONG Length, - IN FS_INFORMATION_CLASS FsInformationClass - ); - -NTSTATUS -STDCALL -ZwQueryVolumeInformationFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID FsInformation, - IN ULONG Length, - IN FS_INFORMATION_CLASS FsInformationClass - ); -// draft -// FIXME: Should I specify if the apc is user or kernel mode somewhere ?? -/* - * FUNCTION: Queues a (user) apc to a thread. - * ARGUMENTS: - ThreadHandle = Thread to which the apc is queued. - ApcRoutine = Points to the apc routine - NormalContext = Argument to Apc Routine - * SystemArgument1 = Argument of the Apc Routine - SystemArgument2 = Argument of the Apc Routine - * REMARK: If the apc is queued against a thread of a different process than the calling thread - the apc routine should be specified in the address space of the queued thread's process. - * RETURNS: Status -*/ - -NTSTATUS -STDCALL -NtQueueApcThread( - HANDLE ThreadHandle, - PKNORMAL_ROUTINE ApcRoutine, - PVOID NormalContext, - PVOID SystemArgument1, - PVOID SystemArgument2); - -NTSTATUS -STDCALL -ZwQueueApcThread( - HANDLE ThreadHandle, - PKNORMAL_ROUTINE ApcRoutine, - PVOID NormalContext, - PVOID SystemArgument1, - PVOID SystemArgument2); - - -/* - * FUNCTION: Raises an exception - * ARGUMENTS: - * ExceptionRecord = Structure specifying the exception - * Context = Context in which the excpetion is raised - * IsDebugger = - * RETURNS: Status - * -*/ - -NTSTATUS -STDCALL -NtRaiseException( - IN PEXCEPTION_RECORD ExceptionRecord, - IN PCONTEXT Context, - IN BOOLEAN SearchFrames - ); - -NTSTATUS -STDCALL -ZwRaiseException( - IN PEXCEPTION_RECORD ExceptionRecord, - IN PCONTEXT Context, - IN BOOLEAN SearchFrames - ); - -/* - * FUNCTION: Raises a hard error (stops the system) - * ARGUMENTS: - * Status = Status code of the hard error - * Unknown2 = ?? - * Unknown3 = ?? - * Unknown4 = ?? - * Unknown5 = ?? - * Unknown6 = ?? - * RETURNS: Status - * - */ - -NTSTATUS -STDCALL -NtRaiseHardError( - IN NTSTATUS Status, - ULONG Unknown2, - ULONG Unknown3, - ULONG Unknown4, - ULONG Unknown5, - ULONG Unknown6 - ); - -NTSTATUS -STDCALL -ZwRaiseHardError( - IN NTSTATUS Status, - ULONG Unknown2, - ULONG Unknown3, - ULONG Unknown4, - ULONG Unknown5, - ULONG Unknown6 - ); - -/* - * FUNCTION: Read a file - * ARGUMENTS: - * FileHandle = Handle of a file to read - * Event = This event is signalled when the read operation completes - * UserApcRoutine = Call back , if supplied Event should be NULL - * UserApcContext = Argument to the callback - * IoStatusBlock = Caller should supply storage for additional status information - * Buffer = Caller should supply storage to receive the information - * BufferLength = Size of the buffer - * ByteOffset = Offset to start reading the file - * Key = If a range is lock a matching key will allow the read to continue. - * RETURNS: Status - * - */ - -NTSTATUS -STDCALL -NtReadFile( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL, - IN PVOID UserApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID Buffer, - IN ULONG BufferLength, - IN PLARGE_INTEGER ByteOffset OPTIONAL, - IN PULONG Key OPTIONAL - ); - -NTSTATUS -STDCALL -ZwReadFile( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL, - IN PVOID UserApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PVOID Buffer, - IN ULONG BufferLength, - IN PLARGE_INTEGER ByteOffset OPTIONAL, - IN PULONG Key OPTIONAL - ); -/* - * FUNCTION: Read a file using scattered io - * ARGUMENTS: - FileHandle = Handle of a file to read - Event = This event is signalled when the read operation completes - * UserApcRoutine = Call back , if supplied Event should be NULL - UserApcContext = Argument to the callback - IoStatusBlock = Caller should supply storage for additional status information - BufferDescription = Caller should supply storage to receive the information - BufferLength = Size of the buffer - ByteOffset = Offset to start reading the file - Key = Key = If a range is lock a matching key will allow the read to continue. - * RETURNS: Status - * -*/ -NTSTATUS -STDCALL -NtReadFileScatter( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL, - IN PVOID UserApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK UserIoStatusBlock, - IN FILE_SEGMENT_ELEMENT BufferDescription[], - IN ULONG BufferLength, - IN PLARGE_INTEGER ByteOffset, - IN PULONG Key OPTIONAL - ); - -NTSTATUS -STDCALL -ZwReadFileScatter( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL, - IN PVOID UserApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK UserIoStatusBlock, - IN FILE_SEGMENT_ELEMENT BufferDescription[], - IN ULONG BufferLength, - IN PLARGE_INTEGER ByteOffset, - IN PULONG Key OPTIONAL - ); -/* - * FUNCTION: Copies a range of virtual memory to a buffer - * ARGUMENTS: - * ProcessHandle = Specifies the process owning the virtual address space - * BaseAddress = Points to the address of virtual memory to start the read - * Buffer = Caller supplies storage to copy the virtual memory to. - * NumberOfBytesToRead = Limits the range to read - * NumberOfBytesRead = The actual number of bytes read. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtReadVirtualMemory( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress, - OUT PVOID Buffer, - IN ULONG NumberOfBytesToRead, - OUT PULONG NumberOfBytesRead - ); -NTSTATUS -STDCALL -ZwReadVirtualMemory( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress, - OUT PVOID Buffer, - IN ULONG NumberOfBytesToRead, - OUT PULONG NumberOfBytesRead - ); - - -/* - * FUNCTION: Debugger can register for thread termination - * ARGUMENTS: - * TerminationPort = Port on which the debugger likes to be notified. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtRegisterThreadTerminatePort( - HANDLE TerminationPort - ); -NTSTATUS -STDCALL -ZwRegisterThreadTerminatePort( - HANDLE TerminationPort - ); - -/* - * FUNCTION: Releases a mutant - * ARGUMENTS: - * MutantHandle = Handle to the mutant - * ReleaseCount = - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtReleaseMutant( - IN HANDLE MutantHandle, - IN PULONG ReleaseCount OPTIONAL - ); - -NTSTATUS -STDCALL -ZwReleaseMutant( - IN HANDLE MutantHandle, - IN PULONG ReleaseCount OPTIONAL - ); - -/* - * FUNCTION: Releases a semaphore - * ARGUMENTS: - * SemaphoreHandle = Handle to the semaphore object - * ReleaseCount = Number to decrease the semaphore count - * PreviousCount = Previous semaphore count - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtReleaseSemaphore( - IN HANDLE SemaphoreHandle, - IN LONG ReleaseCount, - OUT PLONG PreviousCount - ); - -NTSTATUS -STDCALL -ZwReleaseSemaphore( - IN HANDLE SemaphoreHandle, - IN LONG ReleaseCount, - OUT PLONG PreviousCount - ); - -/* - * FUNCTION: Removes an io completion - * ARGUMENTS: - * CompletionPort (OUT) = Caller supplied storage for the resulting handle - * CompletionKey = Requested access to the key - * IoStatusBlock = Caller provides storage for extended status information - * CompletionStatus = Current status of the io operation. - * WaitTime = Time to wait if .. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtRemoveIoCompletion( - IN HANDLE CompletionPort, - OUT PULONG CompletionKey, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PULONG CompletionStatus, - IN PLARGE_INTEGER WaitTime - ); - -NTSTATUS -STDCALL -ZwRemoveIoCompletion( - IN HANDLE CompletionPort, - OUT PULONG CompletionKey, - OUT PIO_STATUS_BLOCK IoStatusBlock, - OUT PULONG CompletionStatus, - IN PLARGE_INTEGER WaitTime - ); -/* - * FUNCTION: Replaces one registry key with another - * ARGUMENTS: - * ObjectAttributes = Specifies the attributes of the key - * Key = Handle to the key - * ReplacedObjectAttributes = The function returns the old object attributes - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtReplaceKey( - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN HANDLE Key, - IN POBJECT_ATTRIBUTES ReplacedObjectAttributes - ); -NTSTATUS -STDCALL -ZwReplaceKey( - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN HANDLE Key, - IN POBJECT_ATTRIBUTES ReplacedObjectAttributes - ); - -/* - * FUNCTION: Resets a event to a non signaled state - * ARGUMENTS: - * EventHandle = Handle to the event that should be reset - * NumberOfWaitingThreads = The number of threads released. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtResetEvent( - HANDLE EventHandle, - PULONG NumberOfWaitingThreads OPTIONAL - ); -NTSTATUS -STDCALL -ZwResetEvent( - HANDLE EventHandle, - PULONG NumberOfWaitingThreads OPTIONAL - ); -//draft -NTSTATUS -STDCALL -NtRestoreKey( - HANDLE KeyHandle, - HANDLE FileHandle, - ULONG RestoreFlags - ); - -NTSTATUS -STDCALL -ZwRestoreKey( - HANDLE KeyHandle, - HANDLE FileHandle, - ULONG RestoreFlags - ); -/* - * FUNCTION: Decrements a thread's resume count - * ARGUMENTS: - * ThreadHandle = Handle to the thread that should be resumed - * ResumeCount = The resulting resume count. - * REMARK: - * A thread is resumed if its suspend count is 0. This procedure maps to - * the win32 ResumeThread function. ( documentation about the the suspend count can be found here aswell ) - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtResumeThread( - IN HANDLE ThreadHandle, - OUT PULONG SuspendCount - ); -NTSTATUS -STDCALL -ZwResumeThread( - IN HANDLE ThreadHandle, - OUT PULONG SuspendCount - ); -/* - * FUNCTION: Writes the content of a registry key to ascii file - * ARGUMENTS: - * KeyHandle = Handle to the key - * FileHandle = Handle of the file - * REMARKS: - This function maps to the Win32 RegSaveKey. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtSaveKey( - IN HANDLE KeyHandle, - IN HANDLE FileHandle - ); -NTSTATUS -STDCALL -ZwSaveKey( - IN HANDLE KeyHandle, - IN HANDLE FileHandle - ); - -/* - * FUNCTION: Sets the context of a specified thread. - * ARGUMENTS: - * ThreadHandle = Handle to the thread - * Context = The processor context. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtSetContextThread( - IN HANDLE ThreadHandle, - IN PCONTEXT Context - ); -NTSTATUS -STDCALL -ZwSetContextThread( - IN HANDLE ThreadHandle, - IN PCONTEXT Context - ); - -/* - * FUNCTION: Sets the default locale id - * ARGUMENTS: - * UserProfile = Type of locale id - * TRUE: thread locale id - * FALSE: system locale id - * DefaultLocaleId = Locale id - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtSetDefaultLocale( - IN BOOLEAN UserProfile, - IN LCID DefaultLocaleId - ); - -NTSTATUS -STDCALL -ZwSetDefaultLocale( - IN BOOLEAN UserProfile, - IN LCID DefaultLocaleId - ); - -/* - * FUNCTION: Sets the default hard error port - * ARGUMENTS: - * PortHandle = Handle to the port - * NOTE: The hard error port is used for first change exception handling - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtSetDefaultHardErrorPort( - IN HANDLE PortHandle - ); -NTSTATUS -STDCALL -ZwSetDefaultHardErrorPort( - IN HANDLE PortHandle - ); - -/* - * FUNCTION: Sets the extended attributes of a file. - * ARGUMENTS: - * FileHandle = Handle to the file - * IoStatusBlock = Storage for a resulting status and information - * on the current operation. - * EaBuffer = Extended Attributes buffer. - * EaBufferSize = Size of the extended attributes buffer - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtSetEaFile( - IN HANDLE FileHandle, - IN PIO_STATUS_BLOCK IoStatusBlock, - PVOID EaBuffer, - ULONG EaBufferSize - ); -NTSTATUS -STDCALL -ZwSetEaFile( - IN HANDLE FileHandle, - IN PIO_STATUS_BLOCK IoStatusBlock, - PVOID EaBuffer, - ULONG EaBufferSize - ); - -//FIXME: should I return the event state ? - -/* - * FUNCTION: Sets the event to a signalled state. - * ARGUMENTS: - * EventHandle = Handle to the event - * NumberOfThreadsReleased = The number of threads released - * REMARK: - * This procedure maps to the win32 SetEvent function. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtSetEvent( - IN HANDLE EventHandle, - PULONG NumberOfThreadsReleased - ); - -NTSTATUS -STDCALL -ZwSetEvent( - IN HANDLE EventHandle, - PULONG NumberOfThreadsReleased - ); - -/* - * FUNCTION: Sets the high part of an event pair - * ARGUMENTS: - EventPair = Handle to the event pair - * RETURNS: Status -*/ - -NTSTATUS -STDCALL -NtSetHighEventPair( - IN HANDLE EventPairHandle - ); - -NTSTATUS -STDCALL -ZwSetHighEventPair( - IN HANDLE EventPairHandle - ); -/* - * FUNCTION: Sets the high part of an event pair and wait for the low part - * ARGUMENTS: - EventPair = Handle to the event pair - * RETURNS: Status -*/ -NTSTATUS -STDCALL -NtSetHighWaitLowEventPair( - IN HANDLE EventPairHandle - ); -NTSTATUS -STDCALL -ZwSetHighWaitLowEventPair( - IN HANDLE EventPairHandle - ); - -/* - * FUNCTION: Sets the information of a file object. - * ARGUMENTS: - * FileHandle = Handle to the file object - * IoStatusBlock = Caller supplies storage for extended information - * on the current operation. - * FileInformation = Storage for the new file information - * Lenght = Size of the new file information. - * FileInformationClass = Indicates to a certain information structure - - FileNameInformation FILE_NAME_INFORMATION - FileRenameInformation FILE_RENAME_INFORMATION - FileStreamInformation FILE_STREAM_INFORMATION - * FileCompletionInformation IO_COMPLETION_CONTEXT - - * REMARK: - * This procedure maps to the win32 SetEndOfFile, SetFileAttributes, - * SetNamedPipeHandleState, SetMailslotInfo functions. - * RETURNS: Status - */ - - -NTSTATUS -STDCALL -NtSetInformationFile( - IN HANDLE FileHandle, - IN PIO_STATUS_BLOCK IoStatusBlock, - IN PVOID FileInformation, - IN ULONG Length, - IN FILE_INFORMATION_CLASS FileInformationClass - ); -NTSTATUS -STDCALL -ZwSetInformationFile( - IN HANDLE FileHandle, - IN PIO_STATUS_BLOCK IoStatusBlock, - IN PVOID FileInformation, - IN ULONG Length, - IN FILE_INFORMATION_CLASS FileInformationClass - ); - - - -/* - * FUNCTION: Sets the information of a registry key. - * ARGUMENTS: - * KeyHandle = Handle to the registry key - * KeyInformationClass = Index to the a certain information structure. - Can be one of the following values: - - * KeyWriteTimeInformation KEY_WRITE_TIME_INFORMATION - - KeyInformation = Storage for the new information - * KeyInformationLength = Size of the information strucure - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtSetInformationKey( - IN HANDLE KeyHandle, - IN CINT KeyInformationClass, - IN PVOID KeyInformation, - IN ULONG KeyInformationLength - ); - -NTSTATUS -STDCALL -ZwSetInformationKey( - IN HANDLE KeyHandle, - IN CINT KeyInformationClass, - IN PVOID KeyInformation, - IN ULONG KeyInformationLength - ); -/* - * FUNCTION: Changes a set of object specific parameters - * ARGUMENTS: - * ObjectHandle = - * ObjectInformationClass = Index to the set of parameters to change. - - - ObjectBasicInformation - ObjectTypeInformation OBJECT_TYPE_INFORMATION - ObjectAllInformation - ObjectDataInformation OBJECT_DATA_INFORMATION - ObjectNameInformation OBJECT_NAME_INFORMATION - - - * ObjectInformation = Caller supplies storage for parameters to set. - * Length = Size of the storage supplied - * RETURNS: Status -*/ -NTSTATUS -STDCALL -NtSetInformationObject( - IN HANDLE ObjectHandle, - IN CINT ObjectInformationClass, - IN PVOID ObjectInformation, - IN ULONG Length - ); - -NTSTATUS -STDCALL -ZwSetInformationObject( - IN HANDLE ObjectHandle, - IN CINT ObjectInformationClass, - IN PVOID ObjectInformation, - IN ULONG Length - ); - -/* - * FUNCTION: Changes a set of process specific parameters - * ARGUMENTS: - * ProcessHandle = Handle to the process - * ProcessInformationClass = Index to a information structure. - * - * ProcessBasicInformation PROCESS_BASIC_INFORMATION - * ProcessQuotaLimits QUOTA_LIMITS - * ProcessBasePriority KPRIORITY - * ProcessRaisePriority KPRIORITY - * ProcessDebugPort HANDLE - * ProcessExceptionPort HANDLE - * ProcessAccessToken PROCESS_ACCESS_TOKEN - * ProcessDefaultHardErrorMode ULONG - * ProcessPriorityClass ULONG - * ProcessAffinityMask KAFFINITY //?? - * - * ProcessInformation = Caller supplies storage for information to set. - * ProcessInformationLength = Size of the information structure - * RETURNS: Status -*/ -NTSTATUS -STDCALL -NtSetInformationProcess( - IN HANDLE ProcessHandle, - IN CINT ProcessInformationClass, - IN PVOID ProcessInformation, - IN ULONG ProcessInformationLength - ); -NTSTATUS -STDCALL -ZwSetInformationProcess( - IN HANDLE ProcessHandle, - IN CINT ProcessInformationClass, - IN PVOID ProcessInformation, - IN ULONG ProcessInformationLength - ); -/* - * FUNCTION: Changes a set of thread specific parameters - * ARGUMENTS: - * ThreadHandle = Handle to the thread - * ThreadInformationClass = Index to the set of parameters to change. - * Can be one of the following values: - * - * ThreadBasicInformation THREAD_BASIC_INFORMATION - * ThreadPriority KPRIORITY //??? - * ThreadBasePriority KPRIORITY - * ThreadAffinityMask KAFFINITY //?? - * ThreadImpersonationToken ACCESS_TOKEN - * ThreadIdealProcessor ULONG - * ThreadPriorityBoost ULONG - * - * ThreadInformation = Caller supplies storage for parameters to set. - * ThreadInformationLength = Size of the storage supplied - * RETURNS: Status -*/ -NTSTATUS -STDCALL -NtSetInformationThread( - IN HANDLE ThreadHandle, - IN THREADINFOCLASS ThreadInformationClass, - IN PVOID ThreadInformation, - IN ULONG ThreadInformationLength - ); -NTSTATUS -STDCALL -ZwSetInformationThread( - IN HANDLE ThreadHandle, - IN THREADINFOCLASS ThreadInformationClass, - IN PVOID ThreadInformation, - IN ULONG ThreadInformationLength - ); - -/* - * FUNCTION: Changes a set of token specific parameters - * ARGUMENTS: - * TokenHandle = Handle to the token - * TokenInformationClass = Index to a certain information structure. - * Can be one of the following values: - * - TokenUser TOKEN_USER - TokenGroups TOKEN_GROUPS - TokenPrivileges TOKEN_PRIVILEGES - TokenOwner TOKEN_OWNER - TokenPrimaryGroup TOKEN_PRIMARY_GROUP - TokenDefaultDacl TOKEN_DEFAULT_DACL - TokenSource TOKEN_SOURCE - TokenType TOKEN_TYPE - TokenImpersonationLevel TOKEN_IMPERSONATION_LEVEL - TokenStatistics TOKEN_STATISTICS - * - * TokenInformation = Caller supplies storage for information structure. - * TokenInformationLength = Size of the information structure - * RETURNS: Status -*/ - -NTSTATUS -STDCALL -NtSetInformationToken( - IN HANDLE TokenHandle, - IN TOKEN_INFORMATION_CLASS TokenInformationClass, - OUT PVOID TokenInformation, - IN ULONG TokenInformationLength - ); - -NTSTATUS -STDCALL -ZwSetInformationToken( - IN HANDLE TokenHandle, - IN TOKEN_INFORMATION_CLASS TokenInformationClass, - OUT PVOID TokenInformation, - IN ULONG TokenInformationLength - ); - - -/* - * FUNCTION: Sets an io completion - * ARGUMENTS: - * CompletionPort = - * CompletionKey = - * IoStatusBlock = - * NumberOfBytesToTransfer = - * NumberOfBytesTransferred = - * RETURNS: Status -*/ -NTSTATUS -STDCALL -NtSetIoCompletion( - IN HANDLE CompletionPort, - IN ULONG CompletionKey, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG NumberOfBytesToTransfer, - OUT PULONG NumberOfBytesTransferred - ); -NTSTATUS -STDCALL -ZwSetIoCompletion( - IN HANDLE CompletionPort, - IN ULONG CompletionKey, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG NumberOfBytesToTransfer, - OUT PULONG NumberOfBytesTransferred - ); - -/* - * FUNCTION: Set properties for profiling - * ARGUMENTS: - * Interval = - * ClockSource = - * RETURNS: Status - * - */ - -NTSTATUS -STDCALL -NtSetIntervalProfile( - ULONG Interval, - KPROFILE_SOURCE ClockSource - ); - -NTSTATUS -STDCALL -ZwSetIntervalProfile( - ULONG Interval, - KPROFILE_SOURCE ClockSource - ); - - -/* - * FUNCTION: Sets the low part of an event pair - * ARGUMENTS: - EventPair = Handle to the event pair - * RETURNS: Status -*/ - -NTSTATUS -STDCALL -NtSetLowEventPair( - HANDLE EventPair - ); -NTSTATUS -STDCALL -ZwSetLowEventPair( - HANDLE EventPair - ); -/* - * FUNCTION: Sets the low part of an event pair and wait for the high part - * ARGUMENTS: - EventPair = Handle to the event pair - * RETURNS: Status -*/ -NTSTATUS -STDCALL -NtSetLowWaitHighEventPair( - HANDLE EventPair - ); -NTSTATUS -STDCALL -ZwSetLowWaitHighEventPair( - HANDLE EventPair - ); - -NTSTATUS -STDCALL -NtSetSecurityObject( - IN HANDLE Handle, - IN SECURITY_INFORMATION SecurityInformation, - IN PSECURITY_DESCRIPTOR SecurityDescriptor - ); - -NTSTATUS -STDCALL -ZwSetSecurityObject( - IN HANDLE Handle, - IN SECURITY_INFORMATION SecurityInformation, - IN PSECURITY_DESCRIPTOR SecurityDescriptor - ); - - -/* - * FUNCTION: Sets a system environment variable - * ARGUMENTS: - * ValueName = Name of the environment variable - * Value = Value of the environment variable - * RETURNS: Status -*/ -NTSTATUS -STDCALL -NtSetSystemEnvironmentValue( - IN PUNICODE_STRING VariableName, - IN PUNICODE_STRING Value - ); -NTSTATUS -STDCALL -ZwSetSystemEnvironmentValue( - IN PUNICODE_STRING VariableName, - IN PUNICODE_STRING Value - ); -/* - * FUNCTION: Sets system parameters - * ARGUMENTS: - * SystemInformationClass = Index to a particular set of system parameters - * Can be one of the following values: - * - * SystemTimeAdjustmentInformation SYSTEM_TIME_ADJUSTMENT - * - * SystemInformation = Structure containing the parameters. - * SystemInformationLength = Size of the structure. - * RETURNS: Status -*/ -NTSTATUS -STDCALL -NtSetSystemInformation( - IN SYSTEM_INFORMATION_CLASS SystemInformationClass, - IN PVOID SystemInformation, - IN ULONG SystemInformationLength - ); - -NTSTATUS -STDCALL -ZwSetSystemInformation( - IN SYSTEM_INFORMATION_CLASS SystemInformationClass, - IN PVOID SystemInformation, - IN ULONG SystemInformationLength - ); - -/* - * FUNCTION: Sets the system time - * ARGUMENTS: - * SystemTime = Old System time - * NewSystemTime = New System time - * RETURNS: Status -*/ -NTSTATUS -STDCALL -NtSetSystemTime( - IN PLARGE_INTEGER SystemTime, - IN PLARGE_INTEGER NewSystemTime OPTIONAL - ); -NTSTATUS -STDCALL -ZwSetSystemTime( - IN PLARGE_INTEGER SystemTime, - IN PLARGE_INTEGER NewSystemTime OPTIONAL - ); -/* - * FUNCTION: Sets the characteristics of a timer - * ARGUMENTS: - * TimerHandle = Handle to the timer - * DueTime = Time before the timer becomes signalled for the first time. - * TimerApcRoutine = Completion routine can be called on time completion - * TimerContext = Argument to the completion routine - * Resume = Specifies if the timer should repeated after completing one cycle - * Period = Cycle of the timer - * REMARKS: This routine maps to the win32 SetWaitableTimer. - * RETURNS: Status -*/ -NTSTATUS -STDCALL -NtSetTimer( - IN HANDLE TimerHandle, - IN PLARGE_INTEGER DueTime, - IN PTIMERAPCROUTINE TimerApcRoutine, - IN PVOID TimerContext, - IN BOOL WakeTimer, - IN ULONG Period OPTIONAL, - OUT PBOOLEAN PreviousState OPTIONAL - ); -NTSTATUS -STDCALL -ZwSetTimer( - IN HANDLE TimerHandle, - IN PLARGE_INTEGER DueTime, - IN PTIMERAPCROUTINE TimerApcRoutine, - IN PVOID TimerContext, - IN BOOL WakeTimer, - IN ULONG Period OPTIONAL, - OUT PBOOLEAN PreviousState OPTIONAL - ); - -/* - * FUNCTION: Sets the frequency of the system timer - * ARGUMENTS: - * RequestedResolution = - * SetOrUnset = - * ActualResolution = - * RETURNS: Status -*/ -NTSTATUS -STDCALL -NtSetTimerResolution( - IN ULONG RequestedResolution, - IN BOOL SetOrUnset, - OUT PULONG ActualResolution - ); -NTSTATUS -STDCALL -ZwSetTimerResolution( - IN ULONG RequestedResolution, - IN BOOL SetOrUnset, - OUT PULONG ActualResolution - ); - -/* - * FUNCTION: Sets the value of a registry key - * ARGUMENTS: - * KeyHandle = Handle to a registry key - * ValueName = Name of the value entry to change - * TitleIndex = pointer to a structure containing the new volume information - * Type = Type of the registry key. Can be one of the values: - * REG_BINARY Unspecified binary data - * REG_DWORD A 32 bit value - * REG_DWORD_LITTLE_ENDIAN Same as REG_DWORD - * REG_DWORD_BIG_ENDIAN A 32 bit value whose least significant byte is at the highest address - * REG_EXPAND_SZ A zero terminated wide character string with unexpanded environment variables ( "%PATH%" ) - * REG_LINK A zero terminated wide character string referring to a symbolic link. - * REG_MULTI_SZ A series of zero-terminated strings including a additional trailing zero - * REG_NONE Unspecified type - * REG_SZ A wide character string ( zero terminated ) - * REG_RESOURCE_LIST ?? - * REG_RESOURCE_REQUIREMENTS_LIST ?? - * REG_FULL_RESOURCE_DESCRIPTOR ?? - * Data = Contains the data for the registry key. - * DataSize = size of the data. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtSetValueKey( - IN HANDLE KeyHandle, - IN PUNICODE_STRING ValueName, - IN ULONG TitleIndex OPTIONAL, - IN ULONG Type, - IN PVOID Data, - IN ULONG DataSize - ); -NTSTATUS -STDCALL -ZwSetValueKey( - IN HANDLE KeyHandle, - IN PUNICODE_STRING ValueName, - IN ULONG TitleIndex OPTIONAL, - IN ULONG Type, - IN PVOID Data, - IN ULONG DataSize - ); - -/* - * FUNCTION: Sets the volume information. - * ARGUMENTS: - * FileHandle = Handle to the file - * IoStatusBlock = Caller should supply storage for additional status information - * VolumeInformation = pointer to a structure containing the new volume information - * Length = size of the structure. - * VolumeInformationClass = specifies the particular volume information to set - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtSetVolumeInformationFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN PVOID FsInformation, - IN ULONG Length, - IN FS_INFORMATION_CLASS FsInformationClass - ); - -NTSTATUS -STDCALL -ZwSetVolumeInformationFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN PVOID FsInformation, - IN ULONG Length, - IN FS_INFORMATION_CLASS FsInformationClass - ); - -/* - * FUNCTION: Shuts the system down - * ARGUMENTS: - * Action = Specifies the type of shutdown, it can be one of the following values: - * ShutdownNoReboot, ShutdownReboot, ShutdownPowerOff - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtShutdownSystem( - IN SHUTDOWN_ACTION Action - ); - -NTSTATUS -STDCALL -ZwShutdownSystem( - IN SHUTDOWN_ACTION Action - ); - - -/* --- PROFILING --- */ - -/* - * FUNCTION: Starts profiling - * ARGUMENTS: - * ProfileHandle = Handle to the profile - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtStartProfile( - HANDLE ProfileHandle - ); - -NTSTATUS -STDCALL -ZwStartProfile( - HANDLE ProfileHandle - ); - -/* - * FUNCTION: Stops profiling - * ARGUMENTS: - * ProfileHandle = Handle to the profile - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtStopProfile( - HANDLE ProfileHandle - ); - -NTSTATUS -STDCALL -ZwStopProfile( - HANDLE ProfileHandle - ); - -/* --- PROCESS MANAGEMENT --- */ - -//--NtSystemDebugControl -/* - * FUNCTION: Terminates the execution of a process. - * ARGUMENTS: - * ThreadHandle = Handle to the process - * ExitStatus = The exit status of the process to terminate with. - * REMARKS - Native applications should kill themselves using this function. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtTerminateProcess( - IN HANDLE ProcessHandle , - IN NTSTATUS ExitStatus - ); -NTSTATUS -STDCALL -ZwTerminateProcess( - IN HANDLE ProcessHandle , - IN NTSTATUS ExitStatus - ); - -/* --- DEVICE DRIVER CONTROL --- */ - -/* - * FUNCTION: Unloads a driver. - * ARGUMENTS: - * DriverServiceName = Name of the driver to unload - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtUnloadDriver( - IN PUNICODE_STRING DriverServiceName - ); -NTSTATUS -STDCALL -ZwUnloadDriver( - IN PUNICODE_STRING DriverServiceName - ); - -/* --- VIRTUAL MEMORY MANAGEMENT --- */ - -/* - * FUNCTION: Writes a range of virtual memory - * ARGUMENTS: - * ProcessHandle = The handle to the process owning the address space. - * BaseAddress = The points to the address to write to - * Buffer = Pointer to the buffer to write - * NumberOfBytesToWrite = Offset to the upper boundary to write - * NumberOfBytesWritten = Total bytes written - * REMARKS: - * This function maps to the win32 WriteProcessMemory - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtWriteVirtualMemory( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress, - IN PVOID Buffer, - IN ULONG NumberOfBytesToWrite, - OUT PULONG NumberOfBytesWritten - ); - -NTSTATUS -STDCALL -ZwWriteVirtualMemory( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress, - IN PVOID Buffer, - IN ULONG NumberOfBytesToWrite, - OUT PULONG NumberOfBytesWritten - ); - -/* - * FUNCTION: Unlocks a range of virtual memory. - * ARGUMENTS: - * ProcessHandle = Handle to the process - * BaseAddress = Lower boundary of the range of bytes to unlock. - * NumberOfBytesToUnlock = Offset to the upper boundary to unlock. - * NumberOfBytesUnlocked (OUT) = Number of bytes actually unlocked. - * REMARK: - This procedure maps to the win32 procedure VirtualUnlock - * RETURNS: Status [ STATUS_SUCCESS | STATUS_PAGE_WAS_ULOCKED ] - */ -NTSTATUS -STDCALL -NtUnlockVirtualMemory( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress, - IN ULONG NumberOfBytesToUnlock, - OUT PULONG NumberOfBytesUnlocked OPTIONAL - ); - -NTSTATUS -STDCALL -ZwUnlockVirtualMemory( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress, - IN ULONG NumberOfBytesToUnlock, - OUT PULONG NumberOfBytesUnlocked OPTIONAL - ); -/* - * FUNCTION: Unmaps a piece of virtual memory backed by a file. - * ARGUMENTS: - * ProcessHandle = Handle to the process - * BaseAddress = The address where the mapping begins - * REMARK: - This procedure maps to the win32 UnMapViewOfFile - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtUnmapViewOfSection( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress - ); -NTSTATUS -STDCALL -ZwUnmapViewOfSection( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress - ); - -/* --- OBJECT SYNCHRONIZATION --- */ - -/* - * FUNCTION: Signals an object and wait for an other one. - * ARGUMENTS: - * SignalObject = Handle to the object that should be signaled - * WaitObject = Handle to the object that should be waited for - * Alertable = True if the wait is alertable - * Time = The time to wait - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtSignalAndWaitForSingleObject( - IN HANDLE SignalObject, - IN HANDLE WaitObject, - IN BOOLEAN Alertable, - IN PLARGE_INTEGER Time - ); - -NTSTATUS -STDCALL -NtSignalAndWaitForSingleObject( - IN HANDLE SignalObject, - IN HANDLE WaitObject, - IN BOOLEAN Alertable, - IN PLARGE_INTEGER Time - ); - -/* - * FUNCTION: Waits for multiple objects to become signalled. - * ARGUMENTS: - * Count = The number of objects - * Object = The array of object handles - * WaitType = Can be one of the values UserMode or KernelMode - * Alertable = If true the wait is alertable. - * Time = The maximum wait time. - * REMARKS: - * This function maps to the win32 WaitForMultipleObjectEx. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtWaitForMultipleObjects ( - IN ULONG Count, - IN HANDLE Object[], - IN CINT WaitType, - IN BOOLEAN Alertable, - IN PLARGE_INTEGER Time - ); - -NTSTATUS -STDCALL -ZwWaitForMultipleObjects ( - IN ULONG Count, - IN HANDLE Object[], - IN CINT WaitType, - IN BOOLEAN Alertable, - IN PLARGE_INTEGER Time - ); - -/* - * FUNCTION: Waits for an object to become signalled. - * ARGUMENTS: - * Object = The object handle - * Alertable = If true the wait is alertable. - * Time = The maximum wait time. - * REMARKS: - * This function maps to the win32 WaitForSingleObjectEx. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtWaitForSingleObject ( - IN HANDLE Object, - IN BOOLEAN Alertable, - IN PLARGE_INTEGER Time - ); - -NTSTATUS -STDCALL -ZwWaitForSingleObject ( - IN HANDLE Object, - IN BOOLEAN Alertable, - IN PLARGE_INTEGER Time - ); - -/* --- EVENT PAIR OBJECT --- */ - -/* - * FUNCTION: Waits for the high part of an eventpair to become signalled - * ARGUMENTS: - * EventPairHandle = Handle to the event pair. - * RETURNS: Status - */ - -NTSTATUS -STDCALL -NtWaitHighEventPair( - IN HANDLE EventPairHandle - ); - -NTSTATUS -STDCALL -ZwWaitHighEventPair( - IN HANDLE EventPairHandle - ); - -/* - * FUNCTION: Waits for the low part of an eventpair to become signalled - * ARGUMENTS: - * EventPairHandle = Handle to the event pair. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtWaitLowEventPair( - IN HANDLE EventPairHandle - ); - -NTSTATUS -STDCALL -ZwWaitLowEventPair( - IN HANDLE EventPairHandle - ); - -/* --- FILE MANAGEMENT --- */ - -/* - * FUNCTION: Unlocks a range of bytes in a file. - * ARGUMENTS: - * FileHandle = Handle to the file - * IoStatusBlock = Caller should supply storage for a structure containing - * the completion status and information about the requested unlock operation. - The information field is set to the number of bytes unlocked. - * ByteOffset = Offset to start the range of bytes to unlock - * Length = Number of bytes to unlock. - * Key = Special value to enable other threads to unlock a file than the - thread that locked the file. The key supplied must match with the one obtained - in a previous call to NtLockFile. - * REMARK: - This procedure maps to the win32 procedure UnlockFileEx. STATUS_PENDING is returned if the lock could - not be obtained immediately, the device queue is busy and the IRP is queued. - * RETURNS: Status [ STATUS_SUCCESS | STATUS_PENDING | STATUS_ACCESS_DENIED | STATUS_INSUFFICIENT_RESOURCES | - STATUS_INVALID_PARAMETER | STATUS_INVALID_DEVICE_REQUEST | STATUS_RANGE_NOT_LOCKED ] - */ -NTSTATUS -STDCALL -NtUnlockFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN PLARGE_INTEGER ByteOffset, - IN PLARGE_INTEGER Lenght, - OUT PULONG Key OPTIONAL - ); -NTSTATUS -STDCALL -ZwUnlockFile( - IN HANDLE FileHandle, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN PLARGE_INTEGER ByteOffset, - IN PLARGE_INTEGER Lenght, - OUT PULONG Key OPTIONAL - ); - -/* - * FUNCTION: Writes data to a file - * ARGUMENTS: - * FileHandle = The handle a file ( from NtCreateFile ) - * Event = Specifies a event that will become signalled when the write operation completes. - * ApcRoutine = Asynchroneous Procedure Callback [ Should not be used by device drivers ] - * ApcContext = Argument to the Apc Routine - * IoStatusBlock = Caller should supply storage for a structure containing the completion status and information about the requested write operation. - * Buffer = Caller should supply storage for a buffer that will contain the information to be written to file. - * Length = Size in bytest of the buffer - * ByteOffset = Points to a file offset. If a combination of Length and BytesOfSet is past the end-of-file mark the file will be enlarged. - * BytesOffset is ignored if the file is created with FILE_APPEND_DATA in the DesiredAccess. BytesOffset is also ignored if - * the file is created with CreateOptions flags FILE_SYNCHRONOUS_IO_ALERT or FILE_SYNCHRONOUS_IO_NONALERT set, in that case a offset - * should be created by specifying FILE_USE_FILE_POINTER_POSITION. - * Key = Unused - * REMARKS: - * This function maps to the win32 WriteFile. - * Callers to NtWriteFile should run at IRQL PASSIVE_LEVEL. - * RETURNS: Status [ STATUS_SUCCESS | STATUS_PENDING | STATUS_ACCESS_DENIED | STATUS_INSUFFICIENT_RESOURCES - STATUS_INVALID_PARAMETER | STATUS_INVALID_DEVICE_REQUEST | STATUS_FILE_LOCK_CONFLICT ] - */ -NTSTATUS -STDCALL -NtWriteFile( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN PVOID Buffer, - IN ULONG Length, - IN PLARGE_INTEGER ByteOffset, - IN PULONG Key OPTIONAL - ); - -NTSTATUS -STDCALL -ZwWriteFile( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN PVOID Buffer, - IN ULONG Length, - IN PLARGE_INTEGER ByteOffset , - IN PULONG Key OPTIONAL - ); - -/* - * FUNCTION: Writes a file - * ARGUMENTS: - * FileHandle = The handle of the file - * Event = - * ApcRoutine = Asynchroneous Procedure Callback [ Should not be used by device drivers ] - * ApcContext = Argument to the Apc Routine - * IoStatusBlock = Caller should supply storage for a structure containing the completion status and information about the requested write operation. - * BufferDescription = Caller should supply storage for a buffer that will contain the information to be written to file. - * BufferLength = Size in bytest of the buffer - * ByteOffset = Points to a file offset. If a combination of Length and BytesOfSet is past the end-of-file mark the file will be enlarged. - * BytesOffset is ignored if the file is created with FILE_APPEND_DATA in the DesiredAccess. BytesOffset is also ignored if - * the file is created with CreateOptions flags FILE_SYNCHRONOUS_IO_ALERT or FILE_SYNCHRONOUS_IO_NONALERT set, in that case a offset - * should be created by specifying FILE_USE_FILE_POINTER_POSITION. Use FILE_WRITE_TO_END_OF_FILE to write to the EOF. - * Key = If a matching key [ a key provided at NtLockFile ] is provided the write operation will continue even if a byte range is locked. - * REMARKS: - * This function maps to the win32 WriteFile. - * Callers to NtWriteFile should run at IRQL PASSIVE_LEVEL. - * RETURNS: Status [ STATUS_SUCCESS | STATUS_PENDING | STATUS_ACCESS_DENIED | STATUS_INSUFFICIENT_RESOURCES - STATUS_INVALID_PARAMETER | STATUS_INVALID_DEVICE_REQUEST | STATUS_FILE_LOCK_CONFLICT ] - */ - -NTSTATUS -STDCALL -NtWriteFileGather( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN FILE_SEGMENT_ELEMENT BufferDescription[], - IN ULONG BufferLength, - IN PLARGE_INTEGER ByteOffset, - IN PULONG Key OPTIONAL - ); - -NTSTATUS -STDCALL -ZwWriteFileGather( - IN HANDLE FileHandle, - IN HANDLE Event OPTIONAL, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN FILE_SEGMENT_ELEMENT BufferDescription[], - IN ULONG BufferLength, - IN PLARGE_INTEGER ByteOffset, - IN PULONG Key OPTIONAL - ); - - -/* --- THREAD MANAGEMENT --- */ - -/* - * FUNCTION: Increments a thread's resume count - * ARGUMENTS: - * ThreadHandle = Handle to the thread that should be resumed - * PreviousSuspendCount = The resulting/previous suspend count. - * REMARK: - * A thread will be suspended if its suspend count is greater than 0. This procedure maps to - * the win32 SuspendThread function. ( documentation about the the suspend count can be found here aswell ) - * The suspend count is not increased if it is greater than MAXIMUM_SUSPEND_COUNT. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtSuspendThread( - IN HANDLE ThreadHandle, - IN PULONG PreviousSuspendCount - ); - -NTSTATUS -STDCALL -ZwSuspendThread( - IN HANDLE ThreadHandle, - IN PULONG PreviousSuspendCount - ); - -/* - * FUNCTION: Terminates the execution of a thread. - * ARGUMENTS: - * ThreadHandle = Handle to the thread - * ExitStatus = The exit status of the thread to terminate with. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtTerminateThread( - IN HANDLE ThreadHandle , - IN NTSTATUS ExitStatus - ); -NTSTATUS -STDCALL -ZwTerminateThread( - IN HANDLE ThreadHandle , - IN NTSTATUS ExitStatus - ); -/* - * FUNCTION: Tests to see if there are any pending alerts for the calling thread - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtTestAlert( - VOID - ); -NTSTATUS -STDCALL -ZwTestAlert( - VOID - ); - -/* - * FUNCTION: Yields the callers thread. - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtYieldExecution( - VOID - ); - -NTSTATUS -STDCALL -ZwYieldExecution( - VOID - ); - - -/* - * --- Local Procedure Call Facility - * These prototypes are unknown as yet - * (stack sizes by Peter-Michael Hager) - */ - -/* --- REGISTRY --- */ - -/* - * FUNCTION: Unloads a registry key. - * ARGUMENTS: - * KeyHandle = Handle to the registry key - * REMARK: - * This procedure maps to the win32 procedure RegUnloadKey - * RETURNS: Status - */ -NTSTATUS -STDCALL -NtUnloadKey( - HANDLE KeyHandle - ); -NTSTATUS -STDCALL -ZwUnloadKey( - HANDLE KeyHandle - ); - - -/* --- PLUG AND PLAY --- */ - -NTSTATUS -STDCALL -NtPlugPlayControl ( - VOID - ); - -NTSTATUS -STDCALL -NtGetPlugPlayEvent ( - VOID - ); - -/* --- POWER MANAGEMENT --- */ - -NTSTATUS STDCALL -NtSetSystemPowerState(IN POWER_ACTION SystemAction, - IN SYSTEM_POWER_STATE MinSystemState, - IN ULONG Flags); - -/* --- DEBUG SUBSYSTEM --- */ - -NTSTATUS STDCALL -NtSystemDebugControl(DEBUG_CONTROL_CODE ControlCode, - PVOID InputBuffer, - ULONG InputBufferLength, - PVOID OutputBuffer, - ULONG OutputBufferLength, - PULONG ReturnLength); - -/* --- VIRTUAL DOS MACHINE (VDM) --- */ - -NTSTATUS -STDCALL -NtVdmControl (ULONG ControlCode, PVOID ControlData); - - -/* --- WIN32 --- */ - -NTSTATUS STDCALL -NtW32Call(IN ULONG RoutineIndex, - IN PVOID Argument, - IN ULONG ArgumentLength, - OUT PVOID* Result OPTIONAL, - OUT PULONG ResultLength OPTIONAL); - -/* --- CHANNELS --- */ - -NTSTATUS -STDCALL -NtCreateChannel ( - VOID - ); - -NTSTATUS -STDCALL -NtListenChannel ( - VOID - ); - -NTSTATUS -STDCALL -NtOpenChannel ( - VOID - ); - -NTSTATUS -STDCALL -NtReplyWaitSendChannel ( - VOID - ); - -NTSTATUS -STDCALL -NtSendWaitReplyChannel ( - VOID - ); - -NTSTATUS -STDCALL -NtSetContextChannel ( - VOID - ); - -/* --- MISCELLANEA --- */ - -//NTSTATUS STDCALL NtSetLdtEntries(VOID); -NTSTATUS -STDCALL -NtSetLdtEntries ( - HANDLE Thread, - ULONG FirstEntry, - PULONG Entries - ); - - -NTSTATUS -STDCALL -NtQueryOleDirectoryFile ( - VOID - ); - -#endif /* __DDK_ZW_H */ diff --git a/reactos/include/ddk/zwtypes.h b/reactos/include/ddk/zwtypes.h deleted file mode 100644 index 1095c91c948..00000000000 --- a/reactos/include/ddk/zwtypes.h +++ /dev/null @@ -1,1662 +0,0 @@ -#ifndef __INCLUDE_DDK_ZWTYPES_H -#define __INCLUDE_DDK_ZWTYPES_H - -typedef enum _DEBUG_CONTROL_CODE -{ - DebugGetTraceInformation = 1, - DebugSetInternalBreakpoint, - DebugSetSpecialCalls, - DebugClearSpecialCalls, - DebugQuerySpecialCalls, - DebugDbgBreakPoint, - DebugDbgLoadSymbols -} DEBUG_CONTROL_CODE; - -typedef enum _KPROFILE_SOURCE -{ - ProfileTime -} KPROFILE_SOURCE; - -#define NtCurrentProcess() ( (HANDLE) 0xFFFFFFFF ) -#define NtCurrentThread() ( (HANDLE) 0xFFFFFFFE ) - -#ifdef __NTOSKRNL__ -extern ULONG EXPORTED NtBuildNumber; -#else -extern ULONG IMPORTED NtBuildNumber; -#endif - - -// event access mask - -#define EVENT_READ_ACCESS 1 -#define EVENT_WRITE_ACCESS 2 - - -// file disposition values - - -#define FILE_SUPERSEDE 0x0000 -#define FILE_OPEN 0x0001 -#define FILE_CREATE 0x0002 -#define FILE_OPEN_IF 0x0003 -#define FILE_OVERWRITE 0x0004 -#define FILE_OVERWRITE_IF 0x0005 -#define FILE_MAXIMUM_DISPOSITION 0x0005 - -// job query / set information class - -typedef enum _JOBOBJECTINFOCLASS { // Q S - JobObjectBasicAccountingInformation = 1, // Y N - JobObjectBasicLimitInformation, // Y Y - JobObjectBasicProcessIdList, // Y N - JobObjectBasicUIRestrictions, // Y Y - JobObjectSecurityLimitInformation, // Y Y - JobObjectEndOfJobTimeInformation, // N Y - JobObjectAssociateCompletionPortInformation, // N Y - JobObjectBasicAndIoAccountingInformation, // Y N - JobObjectExtendedLimitInformation, // Y Y -} JOBOBJECTINFOCLASS; - -//process query / set information class - -#define ProcessBasicInformation 0 -#define ProcessQuotaLimits 1 -#define ProcessIoCounters 2 -#define ProcessVmCounters 3 -#define ProcessTimes 4 -#define ProcessBasePriority 5 -#define ProcessRaisePriority 6 -#define ProcessDebugPort 7 -#define ProcessExceptionPort 8 -#define ProcessAccessToken 9 -#define ProcessLdtInformation 10 -#define ProcessLdtSize 11 -#define ProcessDefaultHardErrorMode 12 -#define ProcessIoPortHandlers 13 -#define ProcessPooledUsageAndLimits 14 -#define ProcessWorkingSetWatch 15 -#define ProcessUserModeIOPL 16 -#define ProcessEnableAlignmentFaultFixup 17 -#define ProcessPriorityClass 18 -#define ProcessWx86Information 19 -#define ProcessHandleCount 20 -#define ProcessAffinityMask 21 -#define ProcessPriorityBoost 22 -#define ProcessDeviceMap 23 -#define ProcessSessionInformation 24 -#define ProcessForegroundInformation 25 -#define ProcessWow64Information 26 -/* ReactOS private. */ -#define ProcessImageFileName 27 -#define ProcessDesktop 28 -#define MaxProcessInfoClass 29 - -/* - * thread query / set information class - */ -#define ThreadBasicInformation 0 -#define ThreadTimes 1 -#define ThreadPriority 2 -#define ThreadBasePriority 3 -#define ThreadAffinityMask 4 -#define ThreadImpersonationToken 5 -#define ThreadDescriptorTableEntry 6 -#define ThreadEnableAlignmentFaultFixup 7 -#define ThreadEventPair 8 -#define ThreadQuerySetWin32StartAddress 9 -#define ThreadZeroTlsCell 10 -#define ThreadPerformanceCount 11 -#define ThreadAmILastThread 12 -#define ThreadIdealProcessor 13 -#define ThreadPriorityBoost 14 -#define ThreadSetTlsArrayAddress 15 -#define ThreadIsIoPending 16 -#define ThreadHideFromDebugger 17 -#define MaxThreadInfoClass 17 - -// object handle information - -#define ObjectBasicInformation 0 -#define ObjectNameInformation 1 -#define ObjectTypeInformation 2 -#define ObjectAllInformation 3 -#define ObjectDataInformation 4 - -// atom information - -typedef enum _ATOM_INFORMATION_CLASS -{ - AtomBasicInformation = 0, - AtomTableInformation = 1, -} ATOM_INFORMATION_CLASS; - -typedef struct _ATOM_BASIC_INFORMATION -{ - USHORT UsageCount; - USHORT Flags; - USHORT NameLength; - WCHAR Name[1]; -} ATOM_BASIC_INFORMATION, *PATOM_BASIC_INFORMATION; - -typedef struct _ATOM_TABLE_INFORMATION -{ - ULONG NumberOfAtoms; - RTL_ATOM Atoms[1]; -} ATOM_TABLE_INFORMATION, *PATOM_TABLE_INFORMATION; - - -// mutant information - -typedef enum _MUTANT_INFORMATION_CLASS -{ - MutantBasicInformation = 0 -} MUTANT_INFORMATION_CLASS; - -typedef struct _MUTANT_BASIC_INFORMATION -{ - LONG Count; - BOOLEAN Owned; - BOOLEAN Abandoned; -} MUTANT_BASIC_INFORMATION, *PMUTANT_BASIC_INFORMATION; - - -// semaphore information - -typedef enum _SEMAPHORE_INFORMATION_CLASS -{ - SemaphoreBasicInformation = 0 -} SEMAPHORE_INFORMATION_CLASS; - -typedef struct _SEMAPHORE_BASIC_INFORMATION -{ - LONG CurrentCount; - LONG MaximumCount; -} SEMAPHORE_BASIC_INFORMATION, *PSEMAPHORE_BASIC_INFORMATION; - - -// event information - -typedef enum _EVENT_INFORMATION_CLASS -{ - EventBasicInformation = 0 -} EVENT_INFORMATION_CLASS; - -typedef struct _EVENT_BASIC_INFORMATION -{ - EVENT_TYPE EventType; - LONG EventState; -} EVENT_BASIC_INFORMATION, *PEVENT_BASIC_INFORMATION; - - -// system information -// {Nt|Zw}{Query|Set}SystemInformation -// (GN means Gary Nebbet in "NT/W2K Native API Reference") - -typedef -enum _SYSTEM_INFORMATION_CLASS -{ - SystemInformationClassMin = 0, - SystemBasicInformation = 0, /* Q */ - - SystemProcessorInformation = 1, /* Q */ - - SystemPerformanceInformation = 2, /* Q */ - - SystemTimeOfDayInformation = 3, /* Q */ - - SystemPathInformation = 4, /* Q (checked build only) */ - SystemNotImplemented1 = 4, /* Q (GN) */ - - SystemProcessInformation = 5, /* Q */ - SystemProcessesAndThreadsInformation = 5, /* Q (GN) */ - - SystemCallCountInfoInformation = 6, /* Q */ - SystemCallCounts = 6, /* Q (GN) */ - - SystemDeviceInformation = 7, /* Q */ -// It conflicts with symbol in ntoskrnl/io/resource.c -// SystemConfigurationInformation = 7, /* Q (GN) */ - - SystemProcessorPerformanceInformation = 8, /* Q */ - SystemProcessorTimes = 8, /* Q (GN) */ - - SystemFlagsInformation = 9, /* QS */ - SystemGlobalFlag = 9, /* QS (GN) */ - - SystemCallTimeInformation = 10, - SystemNotImplemented2 = 10, /* (GN) */ - - SystemModuleInformation = 11, /* Q */ - - SystemLocksInformation = 12, /* Q */ - SystemLockInformation = 12, /* Q (GN) */ - - SystemStackTraceInformation = 13, - SystemNotImplemented3 = 13, /* Q (GN) */ - - SystemPagedPoolInformation = 14, - SystemNotImplemented4 = 14, /* Q (GN) */ - - SystemNonPagedPoolInformation = 15, - SystemNotImplemented5 = 15, /* Q (GN) */ - - SystemHandleInformation = 16, /* Q */ - - SystemObjectInformation = 17, /* Q */ - - SystemPageFileInformation = 18, /* Q */ - SystemPagefileInformation = 18, /* Q (GN) */ - - SystemVdmInstemulInformation = 19, /* Q */ - SystemInstructionEmulationCounts = 19, /* Q (GN) */ - - SystemVdmBopInformation = 20, - SystemInvalidInfoClass1 = 20, /* (GN) */ - - SystemFileCacheInformation = 21, /* QS */ - SystemCacheInformation = 21, /* QS (GN) */ - - SystemPoolTagInformation = 22, /* Q (checked build only) */ - - SystemInterruptInformation = 23, /* Q */ - SystemProcessorStatistics = 23, /* Q (GN) */ - - SystemDpcBehaviourInformation = 24, /* QS */ - SystemDpcInformation = 24, /* QS (GN) */ - - SystemFullMemoryInformation = 25, - SystemNotImplemented6 = 25, /* (GN) */ - - SystemLoadImage = 26, /* S (callable) (GN) */ - - SystemUnloadImage = 27, /* S (callable) (GN) */ - - SystemTimeAdjustmentInformation = 28, /* QS */ - SystemTimeAdjustment = 28, /* QS (GN) */ - - SystemSummaryMemoryInformation = 29, - SystemNotImplemented7 = 29, /* (GN) */ - - SystemNextEventIdInformation = 30, - SystemNotImplemented8 = 30, /* (GN) */ - - SystemEventIdsInformation = 31, - SystemNotImplemented9 = 31, /* (GN) */ - - SystemCrashDumpInformation = 32, /* Q */ - - SystemExceptionInformation = 33, /* Q */ - - SystemCrashDumpStateInformation = 34, /* Q */ - - SystemKernelDebuggerInformation = 35, /* Q */ - - SystemContextSwitchInformation = 36, /* Q */ - - SystemRegistryQuotaInformation = 37, /* QS */ - - SystemLoadAndCallImage = 38, /* S (GN) */ - - SystemPrioritySeparation = 39, /* S */ - - SystemPlugPlayBusInformation = 40, - SystemNotImplemented10 = 40, /* Q (GN) */ - - SystemDockInformation = 41, - SystemNotImplemented11 = 41, /* Q (GN) */ - - SystemPowerInformation = 42, - SystemInvalidInfoClass2 = 42, /* (GN) */ - - SystemProcessorSpeedInformation = 43, - SystemInvalidInfoClass3 = 43, /* (GN) */ - - SystemCurrentTimeZoneInformation = 44, /* QS */ - SystemTimeZoneInformation = 44, /* QS (GN) */ - - SystemLookasideInformation = 45, /* Q */ - - SystemSetTimeSlipEvent = 46, /* S (GN) */ - - SystemCreateSession = 47, /* S (GN) */ - - SystemDeleteSession = 48, /* S (GN) */ - - SystemInvalidInfoClass4 = 49, /* (GN) */ - - SystemRangeStartInformation = 50, /* Q (GN) */ - - SystemVerifierInformation = 51, /* QS (GN) */ - - SystemAddVerifier = 52, /* S (GN) */ - - SystemSessionProcessesInformation = 53, /* Q (GN) */ - SystemInformationClassMax - -} SYSTEM_INFORMATION_CLASS; - -// SystemBasicInformation (0) -typedef -struct _SYSTEM_BASIC_INFORMATION -{ - ULONG Reserved; - ULONG TimerResolution; - ULONG PageSize; - ULONG NumberOfPhysicalPages; - ULONG LowestPhysicalPageNumber; - ULONG HighestPhysicalPageNumber; - ULONG AllocationGranularity; - ULONG MinimumUserModeAddress; - ULONG MaximumUserModeAddress; - KAFFINITY ActiveProcessorsAffinityMask; - CCHAR NumberOfProcessors; -} SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION; - -// SystemProcessorInformation (1) -typedef -struct _SYSTEM_PROCESSOR_INFORMATION -{ - USHORT ProcessorArchitecture; - USHORT ProcessorLevel; - USHORT ProcessorRevision; - USHORT Reserved; - ULONG ProcessorFeatureBits; -} SYSTEM_PROCESSOR_INFORMATION, *PSYSTEM_PROCESSOR_INFORMATION; - -// SystemPerformanceInfo (2) -typedef -struct _SYSTEM_PERFORMANCE_INFORMATION -{ - LARGE_INTEGER IdleProcessorTime; - LARGE_INTEGER IoReadTransferCount; - LARGE_INTEGER IoWriteTransferCount; - LARGE_INTEGER IoOtherTransferCount; - ULONG IoReadOperationCount; - ULONG IoWriteOperationCount; - ULONG IoOtherOperationCount; - ULONG AvailablePages; - ULONG CommitedPages; - ULONG CommitLimit; - ULONG PeakCommitment; - ULONG PageFaultCount; - ULONG CopyOnWriteCount; - ULONG TransitionCount; - ULONG CacheTransitionCount; - ULONG DemandZeroCount; - ULONG PageReadCount; - ULONG PageReadIoCount; - ULONG CacheReadCount; - ULONG CacheIoCount; - ULONG DirtyPagesWriteCount; - ULONG DirtyWriteIoCount; - ULONG MappedPagesWriteCount; - ULONG MappedWriteIoCount; - ULONG PagedPoolPages; - ULONG NonPagedPoolPages; - ULONG Unknown6; - ULONG Unknown7; - ULONG Unknown8; - ULONG Unknown9; - ULONG MmTotalSystemFreePtes; - ULONG MmSystemCodepage; - ULONG MmTotalSystemDriverPages; - ULONG MmTotalSystemCodePages; - ULONG Unknown10; - ULONG Unknown11; - ULONG Unknown12; - ULONG MmSystemCachePage; - ULONG MmPagedPoolPage; - ULONG MmSystemDriverPage; - ULONG CcFastReadNoWait; - ULONG CcFastReadWait; - ULONG CcFastReadResourceMiss; - ULONG CcFastReadNotPossible; - ULONG CcFastMdlReadNoWait; - ULONG CcFastMdlReadWait; - ULONG CcFastMdlReadResourceMiss; - ULONG CcFastMdlReadNotPossible; - ULONG CcMapDataNoWait; - ULONG CcMapDataWait; - ULONG CcMapDataNoWaitMiss; - ULONG CcMapDataWaitMiss; - ULONG CcPinMappedDataCount; - ULONG CcPinReadNoWait; - ULONG CcPinReadWait; - ULONG CcPinReadNoWaitMiss; - ULONG CcPinReadWaitMiss; - ULONG CcCopyReadNoWait; - ULONG CcCopyReadWait; - ULONG CcCopyReadNoWaitMiss; - ULONG CcCopyReadWaitMiss; - ULONG CcMdlReadNoWait; - ULONG CcMdlReadWait; - ULONG CcMdlReadNoWaitMiss; - ULONG CcMdlReadWaitMiss; - ULONG CcReadaheadIos; - ULONG CcLazyWriteIos; - ULONG CcLazyWritePages; - ULONG CcDataFlushes; - ULONG CcDataPages; - ULONG ContextSwitches; - ULONG Unknown13; - ULONG Unknown14; - ULONG SystemCalls; - -} SYSTEM_PERFORMANCE_INFO, *PSYSTEM_PERFORMANCE_INFO; - -// SystemTimeOfDayInformation (3) -typedef -struct _SYSTEM_TIMEOFDAY_INFORMATION -{ - LARGE_INTEGER BootTime; - LARGE_INTEGER CurrentTime; - LARGE_INTEGER TimeZoneBias; - ULONG TimeZoneId; - ULONG Reserved; -} SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION; - -// SystemPathInformation (4) -// IT DOES NOT WORK -typedef -struct _SYSTEM_PATH_INFORMATION -{ - PVOID Dummy; - -} SYSTEM_PATH_INFORMATION, * PSYSTEM_PATH_INFORMATION; - -// SystemProcessInformation (5) -typedef -struct _SYSTEM_THREAD_INFORMATION -{ - TIME KernelTime; - TIME UserTime; - TIME CreateTime; - ULONG TickCount; - ULONG StartEIP; - CLIENT_ID ClientId; - ULONG DynamicPriority; - ULONG BasePriority; - ULONG nSwitches; - DWORD State; - KWAIT_REASON WaitReason; - -} SYSTEM_THREAD_INFORMATION, *PSYSTEM_THREAD_INFORMATION; - -typedef -struct SYSTEM_PROCESS_INFORMATION -{ - ULONG RelativeOffset; - ULONG ThreadCount; - ULONG Unused1 [6]; - TIME CreateTime; - TIME UserTime; - TIME KernelTime; - UNICODE_STRING Name; - ULONG BasePriority; - ULONG ProcessId; - ULONG ParentProcessId; - ULONG HandleCount; - ULONG Unused2[2]; - ULONG PeakVirtualSizeBytes; - ULONG TotalVirtualSizeBytes; - ULONG PageFaultCount; - ULONG PeakWorkingSetSizeBytes; - ULONG TotalWorkingSetSizeBytes; - ULONG PeakPagedPoolUsagePages; - ULONG TotalPagedPoolUsagePages; - ULONG PeakNonPagedPoolUsagePages; - ULONG TotalNonPagedPoolUsagePages; - ULONG TotalPageFileUsageBytes; - ULONG PeakPageFileUsageBytes; - ULONG TotalPrivateBytes; - SYSTEM_THREAD_INFORMATION ThreadSysInfo [1]; - -} SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION; - -// SystemCallCountInformation (6) -typedef -struct _SYSTEM_SDT_INFORMATION -{ - ULONG BufferLength; - ULONG NumberOfSystemServiceTables; - ULONG NumberOfServices [1]; - ULONG ServiceCounters [1]; - -} SYSTEM_SDT_INFORMATION, *PSYSTEM_SDT_INFORMATION; - -// SystemDeviceInformation (7) -typedef -struct _SYSTEM_DEVICE_INFORMATION -{ - ULONG NumberOfDisks; - ULONG NumberOfFloppies; - ULONG NumberOfCdRoms; - ULONG NumberOfTapes; - ULONG NumberOfSerialPorts; - ULONG NumberOfParallelPorts; -} SYSTEM_DEVICE_INFORMATION, *PSYSTEM_DEVICE_INFORMATION; - -// SystemProcessorPerformanceInformation (8) -// (one per processor in the system) -typedef -struct _SYSTEM_PROCESSORTIME_INFO -{ - TIME TotalProcessorRunTime; - TIME TotalProcessorTime; - TIME TotalProcessorUserTime; - TIME TotalDPCTime; - TIME TotalInterruptTime; - ULONG TotalInterrupts; - ULONG Unused; - -} SYSTEM_PROCESSORTIME_INFO, *PSYSTEM_PROCESSORTIME_INFO; - -// SystemFlagsInformation (9) -typedef -struct _SYSTEM_FLAGS_INFORMATION -{ - ULONG Flags; - -} SYSTEM_FLAGS_INFORMATION, * PSYSTEM_FLAGS_INFORMATION; - -#define FLG_STOP_ON_EXCEPTION 0x00000001 -#define FLG_SHOW_LDR_SNAPS 0x00000002 -#define FLG_DEBUG_INITIAL_COMMAND 0x00000004 -#define FLG_STOP_ON_HANG_GUI 0x00000008 -#define FLG_HEAP_ENABLE_TAIL_CHECK 0x00000010 -#define FLG_HEAP_ENABLE_FREE_CHECK 0x00000020 -#define FLG_HEAP_VALIDATE_PARAMETERS 0x00000040 -#define FLG_HEAP_VALIDATE_ALL 0x00000080 -#define FLG_POOL_ENABLE_TAIL_CHECK 0x00000100 -#define FLG_POOL_ENABLE_FREE_CHECK 0x00000200 -#define FLG_POOL_ENABLE_TAGGING 0x00000400 -#define FLG_HEAP_ENABLE_TAGGING 0x00000800 -#define FLG_USER_STACK_TRACE_DB 0x00001000 -#define FLG_KERNEL_STACK_TRACE_DB 0x00002000 -#define FLG_MAINTAIN_OBJECT_TYPELIST 0x00004000 -#define FLG_HEAP_ENABLE_TAG_BY_DLL 0x00008000 -#define FLG_IGNORE_DEBUG_PRIV 0x00010000 -#define FLG_ENABLE_CSRDEBUG 0x00020000 -#define FLG_ENABLE_KDEBUG_SYMBOL_LOAD 0x00040000 -#define FLG_DISABLE_PAGE_KERNEL_STACKS 0x00080000 -#define FLG_HEAP_ENABLE_CALL_TRACING 0x00100000 -#define FLG_HEAP_DISABLE_COALESCING 0x00200000 -#define FLG_ENABLE_CLOSE_EXCEPTION 0x00400000 -#define FLG_ENABLE_EXCEPTION_LOGGING 0x00800000 -#define FLG_UNKNOWN_01000000 0x01000000 -#define FLG_UNKNOWN_02000000 0x02000000 -#define FLG_UNKNOWN_04000000 0x04000000 -#define FLG_ENABLE_DBGPRINT_BUFFERING 0x08000000 -#define FLG_UNKNOWN_10000000 0x10000000 -#define FLG_UNKNOWN_20000000 0x20000000 -#define FLG_UNKNOWN_40000000 0x40000000 -#define FLG_UNKNOWN_80000000 0x80000000 - -// SystemCallTimeInformation (10) -// UNKNOWN - -// SystemModuleInformation (11) -typedef -struct _SYSTEM_MODULE_ENTRY -{ - ULONG Unknown1; - ULONG Unknown2; - PVOID BaseAddress; - ULONG Size; - ULONG Flags; - ULONG EntryIndex; - USHORT NameLength; /* Length of module name not including the path, this field contains valid value only for NTOSKRNL module*/ - USHORT PathLength; /* Length of 'directory path' part of modulename*/ - CHAR Name [256]; -} SYSTEM_MODULE_ENTRY, * PSYSTEM_MODULE_ENTRY; - -typedef -struct _SYSTEM_MODULE_INFORMATION -{ - ULONG Count; - SYSTEM_MODULE_ENTRY Module [1]; -} SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION; - -// SystemLocksInformation (12) -typedef -struct _SYSTEM_RESOURCE_LOCK_ENTRY -{ - ULONG ResourceAddress; - ULONG Always1; - ULONG Unknown; - ULONG ActiveCount; - ULONG ContentionCount; - ULONG Unused[2]; - ULONG NumberOfSharedWaiters; - ULONG NumberOfExclusiveWaiters; - -} SYSTEM_RESOURCE_LOCK_ENTRY, *PSYSTEM_RESOURCE_LOCK_ENTRY; - -typedef -struct _SYSTEM_RESOURCE_LOCK_INFO -{ - ULONG Count; - SYSTEM_RESOURCE_LOCK_ENTRY Lock [1]; - -} SYSTEM_RESOURCE_LOCK_INFO, *PSYSTEM_RESOURCE_LOCK_INFO; - -// SystemInformation13 (13) -// UNKNOWN - -// SystemInformation14 (14) -// UNKNOWN - -// SystemInformation15 (15) -// UNKNOWN - -// SystemHandleInformation (16) -// (see ontypes.h) -typedef -struct _SYSTEM_HANDLE_ENTRY -{ - ULONG OwnerPid; - BYTE ObjectType; - BYTE HandleFlags; - USHORT HandleValue; - PVOID ObjectPointer; - ULONG AccessMask; - -} SYSTEM_HANDLE_ENTRY, *PSYSTEM_HANDLE_ENTRY; - -typedef -struct _SYSTEM_HANDLE_INFORMATION -{ - ULONG Count; - SYSTEM_HANDLE_ENTRY Handle [1]; - -} SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION; - -// SystemObjectInformation (17) -typedef -struct _SYSTEM_OBJECT_TYPE_INFORMATION -{ - ULONG NextEntryOffset; - ULONG ObjectCount; - ULONG HandleCount; - ULONG TypeNumber; - ULONG InvalidAttributes; - GENERIC_MAPPING GenericMapping; - ACCESS_MASK ValidAccessMask; - POOL_TYPE PoolType; - UCHAR Unknown; - UNICODE_STRING Name; - -} SYSTEM_OBJECT_TYPE_INFORMATION, *PSYSTEM_OBJECT_TYPE_INFORMATION; - -typedef -struct _SYSTEM_OBJECT_INFORMATION -{ - ULONG NextEntryOffset; - PVOID Object; - ULONG CreatorProcessId; - USHORT Unknown; - USHORT Flags; - ULONG PointerCount; - ULONG HandleCount; - ULONG PagedPoolUsage; - ULONG NonPagedPoolUsage; - ULONG ExclusiveProcessId; - PSECURITY_DESCRIPTOR SecurityDescriptor; - UNICODE_STRING Name; - -} SYSTEM_OBJECT_INFORMATION, *PSYSTEM_OBJECT_INFORMATION; - -// SystemPageFileInformation (18) -typedef -struct _SYSTEM_PAGEFILE_INFORMATION -{ - ULONG RelativeOffset; - ULONG CurrentSizePages; - ULONG TotalUsedPages; - ULONG PeakUsedPages; - UNICODE_STRING PagefileFileName; - -} SYSTEM_PAGEFILE_INFORMATION, *PSYSTEM_PAGEFILE_INFORMATION; - -// SystemInstructionEmulationInfo (19) -typedef -struct _SYSTEM_VDM_INFORMATION -{ - ULONG VdmSegmentNotPresentCount; - ULONG VdmINSWCount; - ULONG VdmESPREFIXCount; - ULONG VdmCSPREFIXCount; - ULONG VdmSSPREFIXCount; - ULONG VdmDSPREFIXCount; - ULONG VdmFSPREFIXCount; - ULONG VdmGSPREFIXCount; - ULONG VdmOPER32PREFIXCount; - ULONG VdmADDR32PREFIXCount; - ULONG VdmINSBCount; - ULONG VdmINSWV86Count; - ULONG VdmOUTSBCount; - ULONG VdmOUTSWCount; - ULONG VdmPUSHFCount; - ULONG VdmPOPFCount; - ULONG VdmINTNNCount; - ULONG VdmINTOCount; - ULONG VdmIRETCount; - ULONG VdmINBIMMCount; - ULONG VdmINWIMMCount; - ULONG VdmOUTBIMMCount; - ULONG VdmOUTWIMMCount; - ULONG VdmINBCount; - ULONG VdmINWCount; - ULONG VdmOUTBCount; - ULONG VdmOUTWCount; - ULONG VdmLOCKPREFIXCount; - ULONG VdmREPNEPREFIXCount; - ULONG VdmREPPREFIXCount; - ULONG VdmHLTCount; - ULONG VdmCLICount; - ULONG VdmSTICount; - ULONG VdmBopCount; - -} SYSTEM_VDM_INFORMATION, *PSYSTEM_VDM_INFORMATION; - -// SystemInformation20 (20) -// UNKNOWN - -// SystemCacheInformation (21) -typedef -struct _SYSTEM_CACHE_INFORMATION -{ - ULONG CurrentSize; - ULONG PeakSize; - ULONG PageFaultCount; - ULONG MinimumWorkingSet; - ULONG MaximumWorkingSet; - ULONG Unused[4]; - -} SYSTEM_CACHE_INFORMATION; - -// SystemPoolTagInformation (22) -// found by Klaus P. Gerlicher -// (implemented only in checked builds) -typedef -struct _POOL_TAG_STATS -{ - ULONG AllocationCount; - ULONG FreeCount; - ULONG SizeBytes; - -} POOL_TAG_STATS; - -typedef -struct _SYSTEM_POOL_TAG_ENTRY -{ - ULONG Tag; - POOL_TAG_STATS Paged; - POOL_TAG_STATS NonPaged; - -} SYSTEM_POOL_TAG_ENTRY, * PSYSTEM_POOL_TAG_ENTRY; - -typedef -struct _SYSTEM_POOL_TAG_INFO -{ - ULONG Count; - SYSTEM_POOL_TAG_ENTRY PoolEntry [1]; - -} SYSTEM_POOL_TAG_INFO, *PSYSTEM_POOL_TAG_INFO; - -// SystemProcessorScheduleInfo (23) -typedef -struct _SYSTEM_PROCESSOR_SCHEDULE_INFO -{ - ULONG nContextSwitches; - ULONG nDPCQueued; - ULONG nDPCRate; - ULONG TimerResolution; - ULONG nDPCBypasses; - ULONG nAPCBypasses; - -} SYSTEM_PROCESSOR_SCHEDULE_INFO, *PSYSTEM_PROCESSOR_SCHEDULE_INFO; - -// SystemDpcInformation (24) -typedef -struct _SYSTEM_DPC_INFORMATION -{ - ULONG Unused; - ULONG KiMaximumDpcQueueDepth; - ULONG KiMinimumDpcRate; - ULONG KiAdjustDpcThreshold; - ULONG KiIdealDpcRate; - -} SYSTEM_DPC_INFORMATION, *PSYSTEM_DPC_INFORMATION; - -// SystemInformation25 (25) -// UNKNOWN - -// SystemLoadImage (26) -typedef struct _SYSTEM_LOAD_IMAGE -{ - UNICODE_STRING ModuleName; - PVOID ModuleBase; - PVOID SectionPointer; - PVOID EntryPoint; - PVOID ExportDirectory; -} SYSTEM_LOAD_IMAGE, *PSYSTEM_LOAD_IMAGE; - -// SystemUnloadImage (27) -typedef struct _SYSTEM_UNLOAD_IMAGE -{ - PVOID ModuleBase; -} SYSTEM_UNLOAD_IMAGE, *PSYSTEM_UNLOAD_IMAGE; - -// SystemTimeAdjustmentInformation (28) -typedef -struct _SYSTEM_QUERY_TIME_ADJUSTMENT -{ - ULONG TimeAdjustment; - ULONG MaximumIncrement; - BOOLEAN TimeSynchronization; - -} SYSTEM_QUERY_TIME_ADJUSTMENT, *PSYSTEM_QUERY_TIME_ADJUSTMENT; - -typedef -struct _SYSTEM_SET_TIME_ADJUSTMENT -{ - ULONG TimeAdjustment; - BOOLEAN TimeSynchronization; - -} SYSTEM_TIME_ADJUSTMENT_INFO, *PSYSTEM_TIME_ADJUSTMENT_INFO; - -// SystemProcessorFaultCountInfo (33) -typedef -struct _SYSTEM_PROCESSOR_FAULT_INFO -{ - ULONG nAlignmentFixup; - ULONG nExceptionDispatches; - ULONG nFloatingEmulation; - ULONG Unknown; - -} SYSTEM_PROCESSOR_FAULT_INFO, *PSYSTEM_PROCESSOR_FAULT_INFO; - -// SystemCrashDumpStateInfo (34) -// - -// SystemDebuggerInformation (35) -typedef -struct _SYSTEM_DEBUGGER_INFO -{ - BOOLEAN KdDebuggerEnabled; - BOOLEAN KdDebuggerPresent; - -} SYSTEM_DEBUGGER_INFO, *PSYSTEM_DEBUGGER_INFO; - -// SystemInformation36 (36) -// UNKNOWN - -// SystemQuotaInformation (37) -typedef -struct _SYSTEM_QUOTA_INFORMATION -{ - ULONG CmpGlobalQuota; - ULONG CmpGlobalQuotaUsed; - ULONG MmSizeofPagedPoolInBytes; - -} SYSTEM_QUOTA_INFORMATION, *PSYSTEM_QUOTA_INFORMATION; - -// SystemLoadAndCallImage(38) -typedef struct _SYSTEM_LOAD_AND_CALL_IMAGE -{ - UNICODE_STRING ModuleName; -} SYSTEM_LOAD_AND_CALL_IMAGE, *PSYSTEM_LOAD_AND_CALL_IMAGE; - -// SystemTimeZoneInformation (44) -typedef -struct _SYSTEM_TIME_ZONE_INFORMATION -{ - LONG Bias; - WCHAR StandardName [32]; - TIME StandardDate; - LONG StandardBias; - WCHAR DaylightName [32]; - TIME DaylightDate; - LONG DaylightBias; - -} SYSTEM_TIME_ZONE_INFORMATION, * PSYSTEM_TIME_ZONE_INFORMATION; - -// SystemLookasideInformation (45) -typedef -struct _SYSTEM_LOOKASIDE_INFORMATION -{ - USHORT Depth; - USHORT MaximumDepth; - ULONG TotalAllocates; - ULONG AllocatesMisses; - ULONG TotalFrees; - ULONG FreeMisses; - POOL_TYPE Type; - ULONG Tag; - ULONG Size; - -} SYSTEM_LOOKASIDE_INFORMATION, * PSYSTEM_LOOKASIDE_INFORMATION; - -// SystemSetTimeSlipEvent (46) -typedef -struct _SYSTEM_SET_TIME_SLIP_EVENT -{ - HANDLE TimeSlipEvent; /* IN */ - -} SYSTEM_SET_TIME_SLIP_EVENT, * PSYSTEM_SET_TIME_SLIP_EVENT; - -// SystemCreateSession (47) -// (available only on TSE/NT5+) -typedef -struct _SYSTEM_CREATE_SESSION -{ - ULONG SessionId; /* OUT */ - -} SYSTEM_CREATE_SESSION, * PSYSTEM_CREATE_SESSION; - -// SystemDeleteSession (48) -// (available only on TSE/NT5+) -typedef -struct _SYSTEM_DELETE_SESSION -{ - ULONG SessionId; /* IN */ - -} SYSTEM_DELETE_SESSION, * PSYSTEM_DELETE_SESSION; - -// (49) -// UNKNOWN - -// SystemRangeStartInformation (50) -typedef -struct _SYSTEM_RANGE_START_INFORMATION -{ - PVOID SystemRangeStart; - -} SYSTEM_RANGE_START_INFORMATION, * PSYSTEM_RANGE_START_INFORMATION; - -// SystemVerifierInformation (51) -// UNKNOWN - -// SystemAddVerifier (52) -// UNKNOWN - -// SystemSessionProcessesInformation (53) -// (available only on TSE/NT5+) -typedef -struct _SYSTEM_SESSION_PROCESSES_INFORMATION -{ - ULONG SessionId; - ULONG BufferSize; - PVOID Buffer; /* same format as in SystemProcessInformation */ - -} SYSTEM_SESSION_PROCESSES_INFORMATION, * PSYSTEM_SESSION_PROCESSES_INFORMATION; - -// memory information - -typedef enum _MEMORY_INFORMATION_CLASS { - MemoryBasicInformation, - MemoryWorkingSetList, - MemorySectionName //, - //MemoryBasicVlmInformation //??? -} MEMORY_INFORMATION_CLASS; - -typedef struct _MEMORY_BASIC_INFORMATION { // Information Class 0 - PVOID BaseAddress; - PVOID AllocationBase; - ULONG AllocationProtect; - ULONG RegionSize; - ULONG State; - ULONG Protect; - ULONG Type; -} MEMORY_BASIC_INFORMATION, *PMEMORY_BASIC_INFORMATION; - -typedef struct _MEMORY_WORKING_SET_LIST { // Information Class 1 - ULONG NumberOfPages; - ULONG WorkingSetList[1]; -} MEMORY_WORKING_SET_LIST, *PMEMORY_WORKING_SET_LIST; - -// Information Class 2 -#define _MEMORY_SECTION_NAME_STATIC(__bufsize__) \ - { \ - UNICODE_STRING SectionFileName; \ - WCHAR NameBuffer[(__bufsize__)]; \ -} - -#define MEMORY_SECTION_NAME_STATIC(__bufsize__) \ - struct _MEMORY_SECTION_NAME_STATIC((__bufsize__) - -typedef struct _MEMORY_SECTION_NAME_STATIC(ANYSIZE_ARRAY) - MEMORY_SECTION_NAME, *PMEMORY_SECTION_NAME; - -// shutdown action - -typedef enum SHUTDOWN_ACTION_TAG { - ShutdownNoReboot, - ShutdownReboot, - ShutdownPowerOff -} SHUTDOWN_ACTION; - -// wait type - -#define WaitAll 0 -#define WaitAny 1 - -// number of wait objects - -#define THREAD_WAIT_OBJECTS 3 -//#define MAXIMUM_WAIT_OBJECTS 64 - -// key restore flags - -#define REG_WHOLE_HIVE_VOLATILE 1 -#define REG_REFRESH_HIVE 2 - -// object type access rights - -#define OBJECT_TYPE_CREATE 0x0001 -#define OBJECT_TYPE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1) - -// directory access rights - -#define DIRECTORY_QUERY 0x0001 -#define DIRECTORY_TRAVERSE 0x0002 -#define DIRECTORY_CREATE_OBJECT 0x0004 -#define DIRECTORY_CREATE_SUBDIRECTORY 0x0008 - -#define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF) - -// symbolic link access rights - -#define SYMBOLIC_LINK_QUERY 0x0001 -#define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1) - -// Information class 0 -typedef struct _PROCESS_BASIC_INFORMATION -{ - NTSTATUS ExitStatus; - PPEB PebBaseAddress; - KAFFINITY AffinityMask; - KPRIORITY BasePriority; - ULONG UniqueProcessId; - ULONG InheritedFromUniqueProcessId; -} PROCESS_BASIC_INFORMATION, *PPROCESS_BASIC_INFORMATION; - -// Information class 1 -typedef struct _QUOTA_LIMITS -{ - ULONG PagedPoolLimit; - ULONG NonPagedPoolLimit; - ULONG MinimumWorkingSetSize; - ULONG MaximumWorkingSetSize; - ULONG PagefileLimit; - TIME TimeLimit; -} QUOTA_LIMITS, *PQUOTA_LIMITS; - -// Information class 2 -typedef struct _IO_COUNTERS -{ - ULONG ReadOperationCount; - ULONG WriteOperationCount; - ULONG OtherOperationCount; - LARGE_INTEGER ReadTransferCount; - LARGE_INTEGER WriteTransferCount; - LARGE_INTEGER OtherTransferCount; -} IO_COUNTERS, *PIO_COUNTERS; - -// Information class 3 -typedef struct _VM_COUNTERS_ -{ - ULONG PeakVirtualSize; - ULONG VirtualSize; - ULONG PageFaultCount; - ULONG PeakWorkingSetSize; - ULONG WorkingSetSize; - ULONG QuotaPeakPagedPoolUsage; - ULONG QuotaPagedPoolUsage; - ULONG QuotaPeakNonPagedPoolUsage; - ULONG QuotaNonPagedPoolUsage; - ULONG PagefileUsage; - ULONG PeakPagefileUsage; -} VM_COUNTERS, *PVM_COUNTERS; - -// Information class 4 -typedef struct _KERNEL_USER_TIMES -{ - TIME CreateTime; - TIME ExitTime; - TIME KernelTime; - TIME UserTime; -} KERNEL_USER_TIMES, *PKERNEL_USER_TIMES; - -// Information class 9 -typedef struct _PROCESS_ACCESS_TOKEN -{ - HANDLE Token; - HANDLE Thread; -} PROCESS_ACCESS_TOKEN, *PPROCESS_ACCESS_TOKEN; - -// Information class 14 -typedef struct _POOLED_USAGE_AND_LIMITS_ -{ - ULONG PeakPagedPoolUsage; - ULONG PagedPoolUsage; - ULONG PagedPoolLimit; - ULONG PeakNonPagedPoolUsage; - ULONG NonPagedPoolUsage; - ULONG NonPagedPoolLimit; - ULONG PeakPagefileUsage; - ULONG PagefileUsage; - ULONG PagefileLimit; -} POOLED_USAGE_AND_LIMITS, *PPOOLED_USAGE_AND_LIMITS; - -// Information class 15 -typedef struct _PROCESS_WS_WATCH_INFORMATION -{ - PVOID FaultingPc; - PVOID FaultingVa; -} PROCESS_WS_WATCH_INFORMATION, *PPROCESS_WS_WATCH_INFORMATION; - -// Information class 18 -typedef struct _PROCESS_PRIORITY_CLASS -{ - BOOLEAN Foreground; - UCHAR PriorityClass; -} PROCESS_PRIORITY_CLASS, *PPROCESS_PRIORITY_CLASS; - -// Information class 23 -typedef struct _PROCESS_DEVICEMAP_INFORMATION -{ - union { - struct { - HANDLE DirectoryHandle; - } Set; - struct { - ULONG DriveMap; - UCHAR DriveType[32]; - } Query; - }; -} PROCESS_DEVICEMAP_INFORMATION, *pPROCESS_DEVICEMAP_INFORMATION; - -// Information class 24 -typedef struct _PROCESS_SESSION_INFORMATION -{ - ULONG SessionId; -} PROCESS_SESSION_INFORMATION, *PPROCESS_SESSION_INFORMATION; - -// thread information - -// incompatible with MS NT - -typedef struct _THREAD_BASIC_INFORMATION -{ - NTSTATUS ExitStatus; - PVOID TebBaseAddress; // PNT_TIB (GN) - CLIENT_ID ClientId; - KAFFINITY AffinityMask; - KPRIORITY Priority; - KPRIORITY BasePriority; -} THREAD_BASIC_INFORMATION, *PTHREAD_BASIC_INFORMATION; - -// object information - -typedef struct _OBJECT_NAME_INFORMATION -{ - UNICODE_STRING Name; -} OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION; - - - -typedef struct _OBJECT_DATA_INFORMATION -{ - BOOLEAN bInheritHandle; - BOOLEAN bProtectFromClose; -} OBJECT_DATA_INFORMATION, *POBJECT_DATA_INFORMATION; - - -typedef struct _OBJECT_TYPE_INFORMATION -{ - UNICODE_STRING Name; - UNICODE_STRING Type; - ULONG TotalHandles; - ULONG ReferenceCount; -} OBJECT_TYPE_INFORMATION, *POBJECT_TYPE_INFORMATION; - -// file information - -typedef struct _FILE_BASIC_INFORMATION -{ - TIME CreationTime; - TIME LastAccessTime; - TIME LastWriteTime; - TIME ChangeTime; - ULONG FileAttributes; -} FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION; - -typedef struct _FILE_STANDARD_INFORMATION -{ - LARGE_INTEGER AllocationSize; - LARGE_INTEGER EndOfFile; - ULONG NumberOfLinks; - BOOLEAN DeletePending; - BOOLEAN Directory; -} FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION; - -typedef struct _FILE_POSITION_INFORMATION -{ - LARGE_INTEGER CurrentByteOffset; -} FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION; - -typedef struct _FILE_ALIGNMENT_INFORMATION -{ - ULONG AlignmentRequirement; -} FILE_ALIGNMENT_INFORMATION, *PFILE_ALIGNMENT_INFORMATION; - -typedef struct _FILE_DISPOSITION_INFORMATION -{ - BOOLEAN DoDeleteFile; -} FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION; - -typedef struct _FILE_END_OF_FILE_INFORMATION -{ - LARGE_INTEGER EndOfFile; -} FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION; - -typedef struct _FILE_NETWORK_OPEN_INFORMATION -{ - TIME CreationTime; - TIME LastAccessTime; - TIME LastWriteTime; - TIME ChangeTime; - LARGE_INTEGER AllocationSize; - LARGE_INTEGER EndOfFile; - ULONG FileAttributes; -} FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION; - -typedef struct _FILE_FULL_EA_INFORMATION -{ - ULONG NextEntryOffset; - UCHAR Flags; - UCHAR EaNameLength; - USHORT EaValueLength; - CHAR EaName[0]; -} FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION; - - -typedef struct _FILE_EA_INFORMATION { - ULONG EaSize; -} FILE_EA_INFORMATION, *PFILE_EA_INFORMATION; - - -typedef struct _FILE_GET_EA_INFORMATION { - ULONG NextEntryOffset; - UCHAR EaNameLength; - CHAR EaName[0]; -} FILE_GET_EA_INFORMATION, *PFILE_GET_EA_INFORMATION; - -typedef struct _FILE_STREAM_INFORMATION { - ULONG NextEntryOffset; - ULONG StreamNameLength; - LARGE_INTEGER StreamSize; - LARGE_INTEGER StreamAllocationSize; - WCHAR StreamName[0]; -} FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION; - -typedef struct _FILE_ALLOCATION_INFORMATION { - LARGE_INTEGER AllocationSize; -} FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION; - -typedef struct _FILE_NAME_INFORMATION { - ULONG FileNameLength; - WCHAR FileName[0]; -} FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION; - -typedef struct _FILE_NAMES_INFORMATION -{ - ULONG NextEntryOffset; - ULONG FileIndex; - ULONG FileNameLength; - WCHAR FileName[0]; -} FILE_NAMES_INFORMATION, *PFILE_NAMES_INFORMATION; - - -typedef struct _FILE_RENAME_INFORMATION { - BOOLEAN Replace; - HANDLE RootDir; - ULONG FileNameLength; - WCHAR FileName[0]; -} FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION; - - -typedef struct _FILE_INTERNAL_INFORMATION { - LARGE_INTEGER IndexNumber; -} FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION; - -typedef struct _FILE_ACCESS_INFORMATION { - ACCESS_MASK AccessFlags; -} FILE_ACCESS_INFORMATION, *PFILE_ACCESS_INFORMATION; - - -typedef struct _FILE_MODE_INFORMATION { - ULONG Mode; -} FILE_MODE_INFORMATION, *PFILE_MODE_INFORMATION; - - -typedef struct _FILE_PIPE_INFORMATION { - ULONG ReadMode; - ULONG CompletionMode; -} FILE_PIPE_INFORMATION, *PFILE_PIPE_INFORMATION; - -typedef struct _FILE_PIPE_LOCAL_INFORMATION { - ULONG NamedPipeType; - ULONG NamedPipeConfiguration; - ULONG MaximumInstances; - ULONG CurrentInstances; - ULONG InboundQuota; - ULONG ReadDataAvailable; - ULONG OutboundQuota; - ULONG WriteQuotaAvailable; - ULONG NamedPipeState; - ULONG NamedPipeEnd; -} FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION; - -typedef struct _FILE_PIPE_REMOTE_INFORMATION { - LARGE_INTEGER CollectDataTime; - ULONG MaximumCollectionCount; -} FILE_PIPE_REMOTE_INFORMATION, *PFILE_PIPE_REMOTE_INFORMATION; - -typedef struct _FILE_MAILSLOT_QUERY_INFORMATION { - ULONG MaxMessageSize; - ULONG Unknown; /* ?? */ - ULONG NextSize; - ULONG MessageCount; - LARGE_INTEGER Timeout; -} FILE_MAILSLOT_QUERY_INFORMATION, *PFILE_MAILSLOT_QUERY_INFORMATION; - -typedef struct _FILE_MAILSLOT_SET_INFORMATION { - LARGE_INTEGER Timeout; -} FILE_MAILSLOT_SET_INFORMATION, *PFILE_MAILSLOT_SET_INFORMATION; - -typedef struct _FILE_COMPRESSION_INFORMATION { - LARGE_INTEGER CompressedFileSize; - USHORT CompressionFormat; - UCHAR CompressionUnitShift; - UCHAR ChunkShift; - UCHAR ClusterShift; - UCHAR Reserved[3]; -} FILE_COMPRESSION_INFORMATION, *PFILE_COMPRESSION_INFORMATION; - -typedef struct _FILE_ALL_INFORMATION { - FILE_BASIC_INFORMATION BasicInformation; - FILE_STANDARD_INFORMATION StandardInformation; - FILE_INTERNAL_INFORMATION InternalInformation; - FILE_EA_INFORMATION EaInformation; - FILE_ACCESS_INFORMATION AccessInformation; - FILE_POSITION_INFORMATION PositionInformation; - FILE_MODE_INFORMATION ModeInformation; - FILE_ALIGNMENT_INFORMATION AlignmentInformation; - FILE_NAME_INFORMATION NameInformation; -} FILE_ALL_INFORMATION, *PFILE_ALL_INFORMATION; - - -// file system information structures - -typedef struct _FILE_FS_DEVICE_INFORMATION { - DEVICE_TYPE DeviceType; - ULONG Characteristics; -} FILE_FS_DEVICE_INFORMATION, *PFILE_FS_DEVICE_INFORMATION; - - -typedef struct _FILE_FS_VOLUME_INFORMATION { - TIME VolumeCreationTime; - ULONG VolumeSerialNumber; - ULONG VolumeLabelLength; - BOOLEAN SupportsObjects; - WCHAR VolumeLabel[0]; -} FILE_FS_VOLUME_INFORMATION, *PFILE_FS_VOLUME_INFORMATION; - -typedef struct _FILE_FS_SIZE_INFORMATION { - LARGE_INTEGER TotalAllocationUnits; - LARGE_INTEGER AvailableAllocationUnits; - ULONG SectorsPerAllocationUnit; - ULONG BytesPerSector; -} FILE_FS_SIZE_INFORMATION, *PFILE_FS_SIZE_INFORMATION; - -typedef struct _FILE_FS_ATTRIBUTE_INFORMATION { - ULONG FileSystemAttributes; - LONG MaximumComponentNameLength; - ULONG FileSystemNameLength; - WCHAR FileSystemName[0]; -} FILE_FS_ATTRIBUTE_INFORMATION, *PFILE_FS_ATTRIBUTE_INFORMATION; - -/* - FileSystemAttributes is one of the following values: - - FILE_CASE_SENSITIVE_SEARCH 0x00000001 - FILE_CASE_PRESERVED_NAMES 0x00000002 - FILE_UNICODE_ON_DISK 0x00000004 - FILE_PERSISTENT_ACLS 0x00000008 - FILE_FILE_COMPRESSION 0x00000010 - FILE_VOLUME_QUOTAS 0x00000020 - FILE_VOLUME_IS_COMPRESSED 0x00008000 -*/ -typedef struct _FILE_FS_LABEL_INFORMATION { - ULONG VolumeLabelLength; - WCHAR VolumeLabel[0]; -} FILE_FS_LABEL_INFORMATION, *PFILE_FS_LABEL_INFORMATION; - -// read file scatter / write file scatter -//FIXME I am a win32 struct aswell - -typedef union _FILE_SEGMENT_ELEMENT { - PVOID Buffer; - ULONG Alignment; -}FILE_SEGMENT_ELEMENT, *PFILE_SEGMENT_ELEMENT; - -// directory information - -typedef struct _OBJDIR_INFORMATION { - UNICODE_STRING ObjectName; - UNICODE_STRING ObjectTypeName; // Directory, Device ... - UCHAR Data[0]; -} OBJDIR_INFORMATION, *POBJDIR_INFORMATION; - - -typedef struct _FILE_DIRECTORY_INFORMATION { - ULONG NextEntryOffset; - ULONG FileIndex; - TIME CreationTime; - TIME LastAccessTime; - TIME LastWriteTime; - TIME ChangeTime; - LARGE_INTEGER EndOfFile; - LARGE_INTEGER AllocationSize; - ULONG FileAttributes; - ULONG FileNameLength; - WCHAR FileName[0]; -} FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION; - -typedef struct _FILE_FULL_DIRECTORY_INFORMATION { - ULONG NextEntryOffset; - ULONG FileIndex; - TIME CreationTime; - TIME LastAccessTime; - TIME LastWriteTime; - TIME ChangeTime; - LARGE_INTEGER EndOfFile; - LARGE_INTEGER AllocationSize; - ULONG FileAttributes; - ULONG FileNameLength; - ULONG EaSize; - WCHAR FileName[0]; // variable size -} FILE_FULL_DIRECTORY_INFORMATION, *PFILE_FULL_DIRECTORY_INFORMATION, - FILE_FULL_DIR_INFORMATION, *PFILE_FULL_DIR_INFORMATION; - - -typedef struct _FILE_BOTH_DIRECTORY_INFORMATION { - ULONG NextEntryOffset; - ULONG FileIndex; - TIME CreationTime; - TIME LastAccessTime; - TIME LastWriteTime; - TIME ChangeTime; - LARGE_INTEGER EndOfFile; - LARGE_INTEGER AllocationSize; - ULONG FileAttributes; - ULONG FileNameLength; - ULONG EaSize; - CHAR ShortNameLength; - WCHAR ShortName[12]; // 8.3 name - WCHAR FileName[0]; -} FILE_BOTH_DIRECTORY_INFORMATION, *PFILE_BOTH_DIRECTORY_INFORMATION, - FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION; - - -/* - NotifyFilter / CompletionFilter: - - FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001 - FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002 - FILE_NOTIFY_CHANGE_NAME 0x00000003 - FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004 - FILE_NOTIFY_CHANGE_SIZE 0x00000008 - FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010 - FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020 - FILE_NOTIFY_CHANGE_CREATION 0x00000040 - FILE_NOTIFY_CHANGE_EA 0x00000080 - FILE_NOTIFY_CHANGE_SECURITY 0x00000100 - FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200 - FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400 - FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800 -*/ - -typedef struct _FILE_NOTIFY_INFORMATION { - ULONG Action; - ULONG FileNameLength; - WCHAR FileName[0]; -} FILE_NOTIFY_INFORMATION; - - -/* - Action is one of the following values: - - FILE_ACTION_ADDED 0x00000001 - FILE_ACTION_REMOVED 0x00000002 - FILE_ACTION_MODIFIED 0x00000003 - FILE_ACTION_RENAMED_OLD_NAME 0x00000004 - FILE_ACTION_RENAMED_NEW_NAME 0x00000005 - FILE_ACTION_ADDED_STREAM 0x00000006 - FILE_ACTION_REMOVED_STREAM 0x00000007 - FILE_ACTION_MODIFIED_STREAM 0x00000008 - -*/ - - -// File System Control commands ( related to defragging ) - -#define FSCTL_READ_MFT_RECORD 0x90068 // NTFS only -#define FSCTL_GET_VOLUME_BITMAP 0x9006F -#define FSCTL_GET_RETRIEVAL_POINTERS 0x90073 -#define FSCTL_MOVE_FILE 0x90074 - -typedef struct _MAPPING_PAIR -{ - ULONGLONG Vcn; - ULONGLONG Lcn; -} MAPPING_PAIR, *PMAPPING_PAIR; - -typedef struct _GET_RETRIEVAL_DESCRIPTOR -{ - ULONG NumberOfPairs; - ULONGLONG StartVcn; - MAPPING_PAIR Pair[0]; // variable size -} GET_RETRIEVAL_DESCRIPTOR, *PGET_RETRIEVAL_DESCRIPTOR; - -typedef struct _BITMAP_DESCRIPTOR -{ - ULONGLONG StartLcn; - ULONGLONG ClustersToEndOfVol; - BYTE Map[0]; // variable size -} BITMAP_DESCRIPTOR, *PBITMAP_DESCRIPTOR; - -typedef struct _MOVEFILE_DESCRIPTOR -{ - HANDLE FileHandle; - ULONG Reserved; - LARGE_INTEGER StartVcn; - LARGE_INTEGER TargetLcn; - ULONG NumVcns; - ULONG Reserved1; -} MOVEFILE_DESCRIPTOR, *PMOVEFILE_DESCRIPTOR; - - - -//typedef enum _TIMER_TYPE -//{ -// NotificationTimer, -// SynchronizationTimer -//} TIMER_TYPE; - -typedef struct _TIMER_BASIC_INFORMATION -{ - LARGE_INTEGER TimeRemaining; - BOOLEAN SignalState; -} TIMER_BASIC_INFORMATION, *PTIMER_BASIC_INFORMATION; - -typedef enum _TIMER_INFORMATION_CLASS -{ - TimerBasicInformation -} TIMER_INFORMATION_CLASS; - -typedef -struct _LPC_PORT_BASIC_INFORMATION -{ - DWORD Unknown0; - DWORD Unknown1; - DWORD Unknown2; - DWORD Unknown3; - DWORD Unknown4; - DWORD Unknown5; - DWORD Unknown6; - DWORD Unknown7; - DWORD Unknown8; - DWORD Unknown9; - DWORD Unknown10; - DWORD Unknown11; - DWORD Unknown12; - DWORD Unknown13; - -} LPC_PORT_BASIC_INFORMATION, * PLPC_PORT_BASIC_INFORMATION; - -typedef struct _SECTION_BASIC_INFORMATION -{ - PVOID BaseAddress; - ULONG Attributes; - LARGE_INTEGER Size; -} SECTION_BASIC_INFORMATION, *PSECTION_BASIC_INFORMATION; - -typedef struct _SECTION_IMAGE_INFORMATION -{ - PVOID EntryPoint; - ULONG Unknown1; - ULONG StackReserve; - ULONG StackCommit; - ULONG Subsystem; - USHORT MinorSubsystemVersion; - USHORT MajorSubsystemVersion; - ULONG Unknown2; - ULONG Characteristics; - USHORT ImageNumber; - BOOLEAN Executable; - UCHAR Unknown3; - ULONG Unknown4[3]; -} SECTION_IMAGE_INFORMATION, *PSECTION_IMAGE_INFORMATION; - -typedef enum _SECTION_INFORMATION_CLASS -{ - SectionBasicInformation, - SectionImageInformation, -} SECTION_INFORMATION_CLASS; - -#endif diff --git a/reactos/include/debug.h b/reactos/include/debug.h index 75d87989b97..38c9223a5c9 100644 --- a/reactos/include/debug.h +++ b/reactos/include/debug.h @@ -23,11 +23,13 @@ #define CHECKED #endif +#ifndef assert #ifndef NASSERT #define assert(x) if (!(x)) {RtlAssert("#x",__FILE__,__LINE__, ""); } #else #define assert(x) #endif +#endif #define DPRINT1(args...) do { DbgPrint("(%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0); #define CHECKPOINT1 do { DbgPrint("%s:%d\n",__FILE__,__LINE__); } while(0); diff --git a/reactos/include/defines.h b/reactos/include/defines.h index 4f763582173..a4fe9acebe1 100644 --- a/reactos/include/defines.h +++ b/reactos/include/defines.h @@ -4718,6 +4718,18 @@ DECLARE_HANDLE(HANDLE); #endif +#ifndef __USE_W32API + +typedef enum _SC_STATUS_TYPE { + SC_STATUS_PROCESS_INFO = 0 +} SC_STATUS_TYPE; + +typedef enum _SC_ENUM_TYPE { + SC_ENUM_PROCESS_INFO = 0 +} SC_ENUM_TYPE; + +#endif /* !__USE_W32API */ + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/reactos/include/funcs.h b/reactos/include/funcs.h index 1d0902fb7b0..0e4aa97d620 100644 --- a/reactos/include/funcs.h +++ b/reactos/include/funcs.h @@ -865,7 +865,6 @@ int STDCALL AbortDoc(HDC); WINBOOL STDCALL AbortPath(HDC); WINBOOL STDCALL AbortPrinter(HANDLE); WINBOOL CALLBACK AbortProc(HDC, int); -WINBOOL STDCALL AbortSystemShutdown(LPTSTR); WINBOOL STDCALL AccessCheck( PSECURITY_DESCRIPTOR pSecurityDescriptor, HANDLE ClientToken, diff --git a/reactos/include/napi/lpc.h b/reactos/include/napi/lpc.h index a99c919e06a..f136bf5af1f 100644 --- a/reactos/include/napi/lpc.h +++ b/reactos/include/napi/lpc.h @@ -1,10 +1,16 @@ #ifndef __INCLUDE_NAPI_LPC_H #define __INCLUDE_NAPI_LPC_H +#ifdef __USE_W32API +#include +#endif /* !__USE_W32API */ + #include #define MAX_MESSAGE_DATA (0x130) +#ifndef __USE_W32API + typedef enum { UNUSED_MSG_TYPE = 0x0, /* ReactOS */ @@ -52,6 +58,8 @@ typedef struct _LPC_MESSAGE_HEADER ULONG SharedSectionSize; } LPC_MESSAGE, *PLPC_MESSAGE; +#endif /* !__USE_W32API */ + typedef struct _LPC_TERMINATION_MESSAGE { LPC_MESSAGE Header; diff --git a/reactos/include/napi/shared_data.h b/reactos/include/napi/shared_data.h index 2387273032f..a44b154678c 100644 --- a/reactos/include/napi/shared_data.h +++ b/reactos/include/napi/shared_data.h @@ -15,9 +15,9 @@ typedef struct _KUSER_SHARED_DATA { volatile ULONG TickCountLow; ULONG TickCountMultiplier; - volatile KSYSTEM_TIME InterruptTime; - volatile KSYSTEM_TIME SystemTime; - volatile KSYSTEM_TIME TimeZoneBias; + volatile ULARGE_INTEGER InterruptTime; + volatile ULARGE_INTEGER SystemTime; + volatile ULARGE_INTEGER TimeZoneBias; USHORT ImageNumberLow; USHORT ImageNumberHigh; WCHAR NtSystemRoot[260]; @@ -61,7 +61,9 @@ typedef struct _KUSER_SHARED_DATA #define KI_USER_SHARED_DATA (0xFFDF0000) #define SharedUserData ((KUSER_SHARED_DATA * const)KI_USER_SHARED_DATA) #else +#ifndef __USE_W32API #define SharedUserData ((KUSER_SHARED_DATA * const)USER_SHARED_DATA) +#endif /* !__USE_W32API */ #endif diff --git a/reactos/include/napi/teb.h b/reactos/include/napi/teb.h index 05962c2a7c1..ec94959b78c 100644 --- a/reactos/include/napi/teb.h +++ b/reactos/include/napi/teb.h @@ -1,233 +1,244 @@ -/* TEB/PEB parameters */ -#ifndef __INCLUDE_INTERNAL_TEB -#define __INCLUDE_INTERNAL_TEB - -#include - -typedef struct _CLIENT_ID -{ - HANDLE UniqueProcess; - HANDLE UniqueThread; -} CLIENT_ID, *PCLIENT_ID; - -typedef struct _CURDIR -{ - UNICODE_STRING DosPath; - PVOID Handle; -} CURDIR, *PCURDIR; - -typedef struct RTL_DRIVE_LETTER_CURDIR -{ - USHORT Flags; - USHORT Length; - ULONG TimeStamp; - UNICODE_STRING DosPath; -} RTL_DRIVE_LETTER_CURDIR, *PRTL_DRIVE_LETTER_CURDIR; - -typedef struct _PEB_FREE_BLOCK -{ - struct _PEB_FREE_BLOCK* Next; - ULONG Size; -} PEB_FREE_BLOCK, *PPEB_FREE_BLOCK; - -/* RTL_USER_PROCESS_PARAMETERS.Flags */ -#define PPF_NORMALIZED (1) - -typedef struct _RTL_USER_PROCESS_PARAMETERS { - ULONG AllocationSize; - ULONG Size; - ULONG Flags; - ULONG DebugFlags; - HANDLE hConsole; - ULONG ProcessGroup; - HANDLE hStdInput; - HANDLE hStdOutput; - HANDLE hStdError; - UNICODE_STRING CurrentDirectoryName; - HANDLE CurrentDirectoryHandle; - UNICODE_STRING DllPath; - UNICODE_STRING ImagePathName; - UNICODE_STRING CommandLine; - PWSTR Environment; - ULONG dwX; - ULONG dwY; - ULONG dwXSize; - ULONG dwYSize; - ULONG dwXCountChars; - ULONG dwYCountChars; - ULONG dwFillAttribute; - ULONG dwFlags; - ULONG wShowWindow; - UNICODE_STRING WindowTitle; - UNICODE_STRING DesktopInfo; - UNICODE_STRING ShellInfo; - UNICODE_STRING RuntimeInfo; -} RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS; - -#define PEB_BASE (0x7FFDF000) - -typedef struct _PEB_LDR_DATA -{ - ULONG Length; - BOOLEAN Initialized; - PVOID SsHandle; - LIST_ENTRY InLoadOrderModuleList; - LIST_ENTRY InMemoryOrderModuleList; - LIST_ENTRY InInitializationOrderModuleList; -} PEB_LDR_DATA, *PPEB_LDR_DATA; - -typedef VOID STDCALL (*PPEBLOCKROUTINE)(PVOID); - -typedef struct _PEB -{ - UCHAR InheritedAddressSpace; // 00h - UCHAR ReadImageFileExecOptions; // 01h - UCHAR BeingDebugged; // 02h - UCHAR Spare; // 03h - PVOID Mutant; // 04h - PVOID ImageBaseAddress; // 08h - PPEB_LDR_DATA Ldr; // 0Ch - PRTL_USER_PROCESS_PARAMETERS ProcessParameters; // 10h - PVOID SubSystemData; // 14h - PVOID ProcessHeap; // 18h - PVOID FastPebLock; // 1Ch - PPEBLOCKROUTINE FastPebLockRoutine; // 20h - PPEBLOCKROUTINE FastPebUnlockRoutine; // 24h - ULONG EnvironmentUpdateCount; // 28h - PVOID* KernelCallbackTable; // 2Ch - PVOID EventLogSection; // 30h - PVOID EventLog; // 34h - PPEB_FREE_BLOCK FreeList; // 38h - ULONG TlsExpansionCounter; // 3Ch - PVOID TlsBitmap; // 40h - ULONG TlsBitmapBits[0x2]; // 44h - PVOID ReadOnlySharedMemoryBase; // 4Ch - PVOID ReadOnlySharedMemoryHeap; // 50h - PVOID* ReadOnlyStaticServerData; // 54h - PVOID AnsiCodePageData; // 58h - PVOID OemCodePageData; // 5Ch - PVOID UnicodeCaseTableData; // 60h - ULONG NumberOfProcessors; // 64h - ULONG NtGlobalFlag; // 68h - UCHAR Spare2[0x4]; // 6Ch - LARGE_INTEGER CriticalSectionTimeout; // 70h - ULONG HeapSegmentReserve; // 78h - ULONG HeapSegmentCommit; // 7Ch - ULONG HeapDeCommitTotalFreeThreshold; // 80h - ULONG HeapDeCommitFreeBlockThreshold; // 84h - ULONG NumberOfHeaps; // 88h - ULONG MaximumNumberOfHeaps; // 8Ch - PVOID** ProcessHeaps; // 90h - PVOID GdiSharedHandleTable; // 94h - PVOID ProcessStarterHelper; // 98h - PVOID GdiDCAttributeList; // 9Ch - PVOID LoaderLock; // A0h - ULONG OSMajorVersion; // A4h - ULONG OSMinorVersion; // A8h - ULONG OSBuildNumber; // ACh - ULONG OSPlatformId; // B0h - ULONG ImageSubSystem; // B4h - ULONG ImageSubSystemMajorVersion; // B8h - ULONG ImageSubSystemMinorVersion; // C0h - ULONG GdiHandleBuffer[0x22]; // C4h -} PEB, *PPEB; - - -typedef struct _NT_TIB { - struct _EXCEPTION_REGISTRATION_RECORD* ExceptionList; // 00h - PVOID StackBase; // 04h - PVOID StackLimit; // 08h - PVOID SubSystemTib; // 0Ch - union { - PVOID FiberData; // 10h - ULONG Version; // 10h - } Fib; - PVOID ArbitraryUserPointer; // 14h - struct _NT_TIB *Self; // 18h -} NT_TIB, *PNT_TIB; - -typedef struct _GDI_TEB_BATCH -{ - ULONG Offset; - ULONG HDC; - ULONG Buffer[0x136]; -} GDI_TEB_BATCH, *PGDI_TEB_BATCH; - -typedef struct _TEB -{ - NT_TIB Tib; // 00h - PVOID EnvironmentPointer; // 1Ch - CLIENT_ID Cid; // 20h - PVOID ActiveRpcInfo; // 28h - PVOID ThreadLocalStoragePointer; // 2Ch - PPEB Peb; // 30h - ULONG LastErrorValue; // 34h - ULONG CountOfOwnedCriticalSections; // 38h - PVOID CsrClientThread; // 3Ch - struct _W32THREAD* Win32ThreadInfo; // 40h - ULONG Win32ClientInfo[0x1F]; // 44h - PVOID WOW32Reserved; // C0h - ULONG CurrentLocale; // C4h - ULONG FpSoftwareStatusRegister; // C8h - PVOID SystemReserved1[0x36]; // CCh - PVOID Spare1; // 1A4h - LONG ExceptionCode; // 1A8h - ULONG SpareBytes1[0x28]; // 1ACh - PVOID SystemReserved2[0xA]; // 1D4h -// GDI_TEB_BATCH GdiTebBatch; // 1FCh - ULONG gdiRgn; // 6DCh - ULONG gdiPen; // 6E0h - ULONG gdiBrush; // 6E4h - CLIENT_ID RealClientId; // 6E8h - PVOID GdiCachedProcessHandle; // 6F0h - ULONG GdiClientPID; // 6F4h - ULONG GdiClientTID; // 6F8h - PVOID GdiThreadLocaleInfo; // 6FCh - PVOID UserReserved[5]; // 700h - PVOID glDispatchTable[0x118]; // 714h - ULONG glReserved1[0x1A]; // B74h - PVOID glReserved2; // BDCh - PVOID glSectionInfo; // BE0h - PVOID glSection; // BE4h - PVOID glTable; // BE8h - PVOID glCurrentRC; // BECh - PVOID glContext; // BF0h - NTSTATUS LastStatusValue; // BF4h - UNICODE_STRING StaticUnicodeString; // BF8h - WCHAR StaticUnicodeBuffer[0x105]; // C00h - PVOID DeallocationStack; // E0Ch - PVOID TlsSlots[0x40]; // E10h - LIST_ENTRY TlsLinks; // F10h - PVOID Vdm; // F18h - PVOID ReservedForNtRpc; // F1Ch - PVOID DbgSsReserved[0x2]; // F20h - ULONG HardErrorDisabled; // F28h - PVOID Instrumentation[0x10]; // F2Ch - PVOID WinSockData; // F6Ch - ULONG GdiBatchCount; // F70h - ULONG Spare2; // F74h - ULONG Spare3; // F78h - ULONG Spare4; // F7Ch - PVOID ReservedForOle; // F80h - ULONG WaitingOnLoaderLock; // F84h - PVOID WineDebugInfo; // Needed for WINE DLL's -} TEB, *PTEB; - - -#define NtCurrentPeb() (NtCurrentTeb()->Peb) - -static inline PTEB NtCurrentTeb(VOID) -{ - int x; - - __asm__ __volatile__("movl %%fs:0x18, %0\n\t" - : "=r" (x) /* can't have two memory operands */ - : /* no inputs */ - ); - - return((PTEB)x); -} - - - -#endif /* __INCLUDE_INTERNAL_TEB */ +/* TEB/PEB parameters */ +#ifndef __INCLUDE_INTERNAL_TEB +#define __INCLUDE_INTERNAL_TEB + +#include + +#ifdef __USE_W32API +#include +#endif /* !__USE_W32API */ + +#ifndef __USE_W32API + +typedef struct _CLIENT_ID +{ + HANDLE UniqueProcess; + HANDLE UniqueThread; +} CLIENT_ID, *PCLIENT_ID; + +typedef struct _RTL_USER_PROCESS_PARAMETERS { + ULONG AllocationSize; + ULONG Size; + ULONG Flags; + ULONG DebugFlags; + HANDLE hConsole; + ULONG ProcessGroup; + HANDLE hStdInput; + HANDLE hStdOutput; + HANDLE hStdError; + UNICODE_STRING CurrentDirectoryName; + HANDLE CurrentDirectoryHandle; + UNICODE_STRING DllPath; + UNICODE_STRING ImagePathName; + UNICODE_STRING CommandLine; + PWSTR Environment; + ULONG dwX; + ULONG dwY; + ULONG dwXSize; + ULONG dwYSize; + ULONG dwXCountChars; + ULONG dwYCountChars; + ULONG dwFillAttribute; + ULONG dwFlags; + ULONG wShowWindow; + UNICODE_STRING WindowTitle; + UNICODE_STRING DesktopInfo; + UNICODE_STRING ShellInfo; + UNICODE_STRING RuntimeInfo; +} RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS; + +typedef struct _NT_TIB { + struct _EXCEPTION_REGISTRATION_RECORD* ExceptionList; // 00h + PVOID StackBase; // 04h + PVOID StackLimit; // 08h + PVOID SubSystemTib; // 0Ch + union { + PVOID FiberData; // 10h + ULONG Version; // 10h + } Fib; + PVOID ArbitraryUserPointer; // 14h + struct _NT_TIB *Self; // 18h +} NT_TIB, *PNT_TIB; + +#endif /* !__USE_W32API */ + +typedef struct _CURDIR +{ + UNICODE_STRING DosPath; + PVOID Handle; +} CURDIR, *PCURDIR; + +typedef struct RTL_DRIVE_LETTER_CURDIR +{ + USHORT Flags; + USHORT Length; + ULONG TimeStamp; + UNICODE_STRING DosPath; +} RTL_DRIVE_LETTER_CURDIR, *PRTL_DRIVE_LETTER_CURDIR; + +typedef struct _PEB_FREE_BLOCK +{ + struct _PEB_FREE_BLOCK* Next; + ULONG Size; +} PEB_FREE_BLOCK, *PPEB_FREE_BLOCK; + +/* RTL_USER_PROCESS_PARAMETERS.Flags */ +#define PPF_NORMALIZED (1) + +#define PEB_BASE (0x7FFDF000) + +typedef struct _PEB_LDR_DATA +{ + ULONG Length; + BOOLEAN Initialized; + PVOID SsHandle; + LIST_ENTRY InLoadOrderModuleList; + LIST_ENTRY InMemoryOrderModuleList; + LIST_ENTRY InInitializationOrderModuleList; +} PEB_LDR_DATA, *PPEB_LDR_DATA; + +typedef VOID STDCALL (*PPEBLOCKROUTINE)(PVOID); + +typedef struct _PEB +{ + UCHAR InheritedAddressSpace; // 00h + UCHAR ReadImageFileExecOptions; // 01h + UCHAR BeingDebugged; // 02h + UCHAR Spare; // 03h + PVOID Mutant; // 04h + PVOID ImageBaseAddress; // 08h + PPEB_LDR_DATA Ldr; // 0Ch + PRTL_USER_PROCESS_PARAMETERS ProcessParameters; // 10h + PVOID SubSystemData; // 14h + PVOID ProcessHeap; // 18h + PVOID FastPebLock; // 1Ch + PPEBLOCKROUTINE FastPebLockRoutine; // 20h + PPEBLOCKROUTINE FastPebUnlockRoutine; // 24h + ULONG EnvironmentUpdateCount; // 28h + PVOID* KernelCallbackTable; // 2Ch + PVOID EventLogSection; // 30h + PVOID EventLog; // 34h + PPEB_FREE_BLOCK FreeList; // 38h + ULONG TlsExpansionCounter; // 3Ch + PVOID TlsBitmap; // 40h + ULONG TlsBitmapBits[0x2]; // 44h + PVOID ReadOnlySharedMemoryBase; // 4Ch + PVOID ReadOnlySharedMemoryHeap; // 50h + PVOID* ReadOnlyStaticServerData; // 54h + PVOID AnsiCodePageData; // 58h + PVOID OemCodePageData; // 5Ch + PVOID UnicodeCaseTableData; // 60h + ULONG NumberOfProcessors; // 64h + ULONG NtGlobalFlag; // 68h + UCHAR Spare2[0x4]; // 6Ch + LARGE_INTEGER CriticalSectionTimeout; // 70h + ULONG HeapSegmentReserve; // 78h + ULONG HeapSegmentCommit; // 7Ch + ULONG HeapDeCommitTotalFreeThreshold; // 80h + ULONG HeapDeCommitFreeBlockThreshold; // 84h + ULONG NumberOfHeaps; // 88h + ULONG MaximumNumberOfHeaps; // 8Ch + PVOID** ProcessHeaps; // 90h + PVOID GdiSharedHandleTable; // 94h + PVOID ProcessStarterHelper; // 98h + PVOID GdiDCAttributeList; // 9Ch + PVOID LoaderLock; // A0h + ULONG OSMajorVersion; // A4h + ULONG OSMinorVersion; // A8h + ULONG OSBuildNumber; // ACh + ULONG OSPlatformId; // B0h + ULONG ImageSubSystem; // B4h + ULONG ImageSubSystemMajorVersion; // B8h + ULONG ImageSubSystemMinorVersion; // C0h + ULONG GdiHandleBuffer[0x22]; // C4h +} PEB; + +#ifndef __USE_W32API + +typedef PEB *PPEB; + +#endif /* !__USE_W32API */ + +typedef struct _GDI_TEB_BATCH +{ + ULONG Offset; + ULONG HDC; + ULONG Buffer[0x136]; +} GDI_TEB_BATCH, *PGDI_TEB_BATCH; + +typedef struct _TEB +{ + NT_TIB Tib; // 00h + PVOID EnvironmentPointer; // 1Ch + CLIENT_ID Cid; // 20h + PVOID ActiveRpcInfo; // 28h + PVOID ThreadLocalStoragePointer; // 2Ch + PPEB Peb; // 30h + ULONG LastErrorValue; // 34h + ULONG CountOfOwnedCriticalSections; // 38h + PVOID CsrClientThread; // 3Ch + struct _W32THREAD* Win32ThreadInfo; // 40h + ULONG Win32ClientInfo[0x1F]; // 44h + PVOID WOW32Reserved; // C0h + ULONG CurrentLocale; // C4h + ULONG FpSoftwareStatusRegister; // C8h + PVOID SystemReserved1[0x36]; // CCh + PVOID Spare1; // 1A4h + LONG ExceptionCode; // 1A8h + ULONG SpareBytes1[0x28]; // 1ACh + PVOID SystemReserved2[0xA]; // 1D4h +// GDI_TEB_BATCH GdiTebBatch; // 1FCh + ULONG gdiRgn; // 6DCh + ULONG gdiPen; // 6E0h + ULONG gdiBrush; // 6E4h + CLIENT_ID RealClientId; // 6E8h + PVOID GdiCachedProcessHandle; // 6F0h + ULONG GdiClientPID; // 6F4h + ULONG GdiClientTID; // 6F8h + PVOID GdiThreadLocaleInfo; // 6FCh + PVOID UserReserved[5]; // 700h + PVOID glDispatchTable[0x118]; // 714h + ULONG glReserved1[0x1A]; // B74h + PVOID glReserved2; // BDCh + PVOID glSectionInfo; // BE0h + PVOID glSection; // BE4h + PVOID glTable; // BE8h + PVOID glCurrentRC; // BECh + PVOID glContext; // BF0h + NTSTATUS LastStatusValue; // BF4h + UNICODE_STRING StaticUnicodeString; // BF8h + WCHAR StaticUnicodeBuffer[0x105]; // C00h + PVOID DeallocationStack; // E0Ch + PVOID TlsSlots[0x40]; // E10h + LIST_ENTRY TlsLinks; // F10h + PVOID Vdm; // F18h + PVOID ReservedForNtRpc; // F1Ch + PVOID DbgSsReserved[0x2]; // F20h + ULONG HardErrorDisabled; // F28h + PVOID Instrumentation[0x10]; // F2Ch + PVOID WinSockData; // F6Ch + ULONG GdiBatchCount; // F70h + ULONG Spare2; // F74h + ULONG Spare3; // F78h + ULONG Spare4; // F7Ch + PVOID ReservedForOle; // F80h + ULONG WaitingOnLoaderLock; // F84h + PVOID WineDebugInfo; // Needed for WINE DLL's +} TEB, *PTEB; + + +#define NtCurrentPeb() (NtCurrentTeb()->Peb) + +static inline PTEB NtCurrentTeb(VOID) +{ + int x; + + __asm__ __volatile__("movl %%fs:0x18, %0\n\t" + : "=r" (x) /* can't have two memory operands */ + : /* no inputs */ + ); + + return((PTEB)x); +} + +#endif /* __INCLUDE_INTERNAL_TEB */ diff --git a/reactos/include/napi/types.h b/reactos/include/napi/types.h index 694ae40f5ce..01560e1bcb6 100644 --- a/reactos/include/napi/types.h +++ b/reactos/include/napi/types.h @@ -3,16 +3,6 @@ // these should be moved to a file like ntdef.h -typedef const int CINT; - -typedef LONG NTSTATUS, *PNTSTATUS; - -typedef ULONG DEVICE_TYPE; - - - - - enum { DIRECTORY_QUERY, @@ -25,19 +15,6 @@ enum /* * General type for status information */ -//typedef LONG NTSTATUS; - -typedef struct _UNICODE_STRING -{ - USHORT Length; - USHORT MaximumLength; - PWSTR Buffer; -} UNICODE_STRING, *PUNICODE_STRING; - -typedef enum _SECTION_INHERIT { - ViewShare = 1, - ViewUnmap = 2 -} SECTION_INHERIT; typedef enum _NT_PRODUCT_TYPE { @@ -46,6 +23,14 @@ typedef enum _NT_PRODUCT_TYPE NtProductServer } NT_PRODUCT_TYPE, *PNT_PRODUCT_TYPE; +typedef ULARGE_INTEGER TIME, *PTIME; + +#ifndef __USE_W32API + +typedef const int CINT; +typedef LONG NTSTATUS, *PNTSTATUS; +typedef ULONG DEVICE_TYPE; + /* File information for IRP_MJ_QUERY_INFORMATION (and SET) */ typedef enum _FILE_INFORMATION_CLASS { @@ -92,17 +77,11 @@ typedef enum _FILE_INFORMATION_CLASS FileMaximumInformation, } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS; -typedef ULONG WAIT_TYPE; -typedef USHORT CSHORT; +typedef enum _SECTION_INHERIT { + ViewShare = 1, + ViewUnmap = 2 +} SECTION_INHERIT; - -#if 0 -typedef struct _TIME { - DWORD LowPart; - LONG HighPart; -} TIME, *PTIME; -#endif - -typedef ULARGE_INTEGER TIME, *PTIME; +#endif /* !__USE_W32API */ #endif /* __INCLUDE_NAPI_TYPES_H */ diff --git a/reactos/include/ntdll/ldr.h b/reactos/include/ntdll/ldr.h index 85c0752acc1..5bad54e2ec7 100644 --- a/reactos/include/ntdll/ldr.h +++ b/reactos/include/ntdll/ldr.h @@ -1,135 +1,136 @@ -#ifndef __NTOSKRNL_INCLUDE_INTERNAL_LDR_H -#define __NTOSKRNL_INCLUDE_INTERNAL_LDR_H - -#include -#include - -typedef NTSTATUS STDCALL (*PEPFUNC)(PPEB); - -/* Type for a DLL's entry point */ -typedef BOOL STDCALL -(* PDLLMAIN_FUNC)(HANDLE hInst, - ULONG ul_reason_for_call, - LPVOID lpReserved); - -typedef struct _LDR_MODULE -{ - LIST_ENTRY InLoadOrderModuleList; - LIST_ENTRY InMemoryOrderModuleList; // not used - LIST_ENTRY InInitializationOrderModuleList; // not used - PVOID BaseAddress; - ULONG EntryPoint; - ULONG SizeOfImage; - UNICODE_STRING FullDllName; - UNICODE_STRING BaseDllName; - ULONG Flags; - SHORT LoadCount; - SHORT TlsIndex; - HANDLE SectionHandle; - ULONG CheckSum; - ULONG TimeDateStamp; -#ifdef KDBG - IMAGE_SYMBOL_INFO SymbolInfo; -#endif /* KDBG */ -} LDR_MODULE, *PLDR_MODULE; - -typedef struct _LDR_SYMBOL_INFO { - PLDR_MODULE ModuleObject; - ULONG_PTR ImageBase; - PVOID SymbolsBuffer; - ULONG SymbolsBufferLength; - PVOID SymbolStringsBuffer; - ULONG SymbolStringsBufferLength; -} LDR_SYMBOL_INFO, *PLDR_SYMBOL_INFO; - - -#define RVA(m, b) ((ULONG)b + m) - - -typedef struct _MODULE_ENTRY -{ - ULONG Unknown0; - ULONG Unknown1; - PVOID BaseAddress; - ULONG SizeOfImage; - ULONG Flags; - USHORT Unknown2; - USHORT Unknown3; - SHORT LoadCount; - USHORT PathLength; - CHAR ModuleName[256]; -} MODULE_ENTRY, *PMODULE_ENTRY; - -typedef struct _MODULE_INFORMATION -{ - ULONG ModuleCount; - MODULE_ENTRY ModuleEntry[1]; -} MODULE_INFORMATION, *PMODULE_INFORMATION; - -#ifdef KDBG - -VOID -LdrpLoadUserModuleSymbols(PLDR_MODULE LdrModule); - -#endif - -PEPFUNC LdrPEStartup (PVOID ImageBase, - HANDLE SectionHandle, - PLDR_MODULE* Module, - PWSTR FullDosName); -NTSTATUS LdrMapSections(HANDLE ProcessHandle, - PVOID ImageBase, - HANDLE SectionHandle, - PIMAGE_NT_HEADERS NTHeaders); -NTSTATUS LdrMapNTDllForProcess(HANDLE ProcessHandle, - PHANDLE NTDllSectionHandle); - - -NTSTATUS STDCALL -LdrDisableThreadCalloutsForDll(IN PVOID BaseAddress); - -NTSTATUS STDCALL -LdrGetDllHandle(IN ULONG Unknown1, - IN ULONG Unknown2, - IN PUNICODE_STRING DllName, - OUT PVOID *BaseAddress); - -NTSTATUS STDCALL -LdrFindEntryForAddress(PVOID Address, - PLDR_MODULE *Module); - -NTSTATUS STDCALL -LdrGetProcedureAddress(IN PVOID BaseAddress, - IN PANSI_STRING Name, - IN ULONG Ordinal, - OUT PVOID *ProcedureAddress); - -VOID STDCALL -LdrInitializeThunk(ULONG Unknown1, - ULONG Unknown2, - ULONG Unknown3, - ULONG Unknown4); - -NTSTATUS STDCALL -LdrLoadDll(IN PWSTR SearchPath OPTIONAL, - IN ULONG LoadFlags, - IN PUNICODE_STRING Name, - OUT PVOID *BaseAddress OPTIONAL); - -NTSTATUS STDCALL -LdrQueryProcessModuleInformation(IN PMODULE_INFORMATION ModuleInformation OPTIONAL, - IN ULONG Size OPTIONAL, - OUT PULONG ReturnedSize); - -NTSTATUS STDCALL -LdrShutdownProcess(VOID); - -NTSTATUS STDCALL -LdrShutdownThread(VOID); - -NTSTATUS STDCALL -LdrUnloadDll(IN PVOID BaseAddress); - -#endif /* __NTOSKRNL_INCLUDE_INTERNAL_LDR_H */ - -/* EOF */ +#ifndef __NTOSKRNL_INCLUDE_INTERNAL_LDR_H +#define __NTOSKRNL_INCLUDE_INTERNAL_LDR_H + +#include +#include +#include + +typedef NTSTATUS STDCALL (*PEPFUNC)(PPEB); + +/* Type for a DLL's entry point */ +typedef BOOL STDCALL +(* PDLLMAIN_FUNC)(HANDLE hInst, + ULONG ul_reason_for_call, + LPVOID lpReserved); + +typedef struct _LDR_MODULE +{ + LIST_ENTRY InLoadOrderModuleList; + LIST_ENTRY InMemoryOrderModuleList; // not used + LIST_ENTRY InInitializationOrderModuleList; // not used + PVOID BaseAddress; + ULONG EntryPoint; + ULONG SizeOfImage; + UNICODE_STRING FullDllName; + UNICODE_STRING BaseDllName; + ULONG Flags; + SHORT LoadCount; + SHORT TlsIndex; + HANDLE SectionHandle; + ULONG CheckSum; + ULONG TimeDateStamp; +#ifdef KDBG + IMAGE_SYMBOL_INFO SymbolInfo; +#endif /* KDBG */ +} LDR_MODULE, *PLDR_MODULE; + +typedef struct _LDR_SYMBOL_INFO { + PLDR_MODULE ModuleObject; + ULONG_PTR ImageBase; + PVOID SymbolsBuffer; + ULONG SymbolsBufferLength; + PVOID SymbolStringsBuffer; + ULONG SymbolStringsBufferLength; +} LDR_SYMBOL_INFO, *PLDR_SYMBOL_INFO; + + +#define RVA(m, b) ((ULONG)b + m) + + +typedef struct _MODULE_ENTRY +{ + ULONG Unknown0; + ULONG Unknown1; + PVOID BaseAddress; + ULONG SizeOfImage; + ULONG Flags; + USHORT Unknown2; + USHORT Unknown3; + SHORT LoadCount; + USHORT PathLength; + CHAR ModuleName[256]; +} MODULE_ENTRY, *PMODULE_ENTRY; + +typedef struct _MODULE_INFORMATION +{ + ULONG ModuleCount; + MODULE_ENTRY ModuleEntry[1]; +} MODULE_INFORMATION, *PMODULE_INFORMATION; + +#ifdef KDBG + +VOID +LdrpLoadUserModuleSymbols(PLDR_MODULE LdrModule); + +#endif + +PEPFUNC LdrPEStartup (PVOID ImageBase, + HANDLE SectionHandle, + PLDR_MODULE* Module, + PWSTR FullDosName); +NTSTATUS LdrMapSections(HANDLE ProcessHandle, + PVOID ImageBase, + HANDLE SectionHandle, + PIMAGE_NT_HEADERS NTHeaders); +NTSTATUS LdrMapNTDllForProcess(HANDLE ProcessHandle, + PHANDLE NTDllSectionHandle); + + +NTSTATUS STDCALL +LdrDisableThreadCalloutsForDll(IN PVOID BaseAddress); + +NTSTATUS STDCALL +LdrGetDllHandle(IN ULONG Unknown1, + IN ULONG Unknown2, + IN PUNICODE_STRING DllName, + OUT PVOID *BaseAddress); + +NTSTATUS STDCALL +LdrFindEntryForAddress(PVOID Address, + PLDR_MODULE *Module); + +NTSTATUS STDCALL +LdrGetProcedureAddress(IN PVOID BaseAddress, + IN PANSI_STRING Name, + IN ULONG Ordinal, + OUT PVOID *ProcedureAddress); + +VOID STDCALL +LdrInitializeThunk(ULONG Unknown1, + ULONG Unknown2, + ULONG Unknown3, + ULONG Unknown4); + +NTSTATUS STDCALL +LdrLoadDll(IN PWSTR SearchPath OPTIONAL, + IN ULONG LoadFlags, + IN PUNICODE_STRING Name, + OUT PVOID *BaseAddress OPTIONAL); + +NTSTATUS STDCALL +LdrQueryProcessModuleInformation(IN PMODULE_INFORMATION ModuleInformation OPTIONAL, + IN ULONG Size OPTIONAL, + OUT PULONG ReturnedSize); + +NTSTATUS STDCALL +LdrShutdownProcess(VOID); + +NTSTATUS STDCALL +LdrShutdownThread(VOID); + +NTSTATUS STDCALL +LdrUnloadDll(IN PVOID BaseAddress); + +#endif /* __NTOSKRNL_INCLUDE_INTERNAL_LDR_H */ + +/* EOF */ diff --git a/reactos/include/ntdll/rtl.h b/reactos/include/ntdll/rtl.h index e4c65cd3c56..871d212fa48 100644 --- a/reactos/include/ntdll/rtl.h +++ b/reactos/include/ntdll/rtl.h @@ -1,17 +1,22 @@ -/* $Id: rtl.h,v 1.35 2002/09/08 10:22:32 chorns Exp $ +/* $Id: rtl.h,v 1.36 2002/11/14 18:21:03 chorns Exp $ * */ #ifndef __INCLUDE_NTDLL_RTL_H #define __INCLUDE_NTDLL_RTL_H +#include #include #include +#include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ + +#ifndef __USE_W32API + typedef struct _DEBUG_BUFFER { HANDLE SectionHandle; @@ -52,6 +57,9 @@ typedef struct _CRITICAL_SECTION { DWORD Reserved; } CRITICAL_SECTION, *PCRITICAL_SECTION, *LPCRITICAL_SECTION; +#endif /* !__USE_W32API */ + + typedef struct _RTL_PROCESS_INFO { ULONG Size; @@ -374,7 +382,7 @@ RtlDeNormalizeProcessParams ( IN PRTL_USER_PROCESS_PARAMETERS ProcessParameters ); -VOID +NTSTATUS STDCALL RtlDestroyProcessParameters ( IN PRTL_USER_PROCESS_PARAMETERS ProcessParameters @@ -569,6 +577,10 @@ RtlpNtSetValueKey ( ); #ifndef __NTDRIVER__ + +#ifndef __INTERLOCKED_DECLARED +#define __INTERLOCKED_DECLARED + LONG STDCALL InterlockedIncrement ( @@ -603,6 +615,7 @@ InterlockedExchangeAdd ( LONG Increment ); +#endif /* __INTERLOCKED_DECLARED */ #endif /* __NTDRIVER__ */ diff --git a/reactos/include/ntos.h b/reactos/include/ntos.h index 4e27456344d..6e14bd00dc3 100644 --- a/reactos/include/ntos.h +++ b/reactos/include/ntos.h @@ -1,11 +1,12 @@ #ifndef _NTOS_H #define _NTOS_H -/* $Id: ntos.h,v 1.6 2002/10/19 14:24:15 chorns Exp $ */ +/* $Id: ntos.h,v 1.7 2002/11/14 18:21:02 chorns Exp $ */ #if defined(NTOS_MODE_USER) // include windows.h before ntddk.h to get user mode prototype for InterlockedXxx functions #include #include +#include #include "ntos/types.h" #include "ntos/cdrom.h" #include "ntos/console.h" @@ -33,6 +34,10 @@ #include "napi/npipe.h" #include "napi/shared_data.h" #include "napi/win32.h" +#include "ntos/rtltypes.h" +#include "ntos/rtl.h" +#include "ntos/zwtypes.h" +#include "ntos/zw.h" #include "ntdll/csr.h" #include "ntdll/dbg.h" #include "ntdll/ldr.h" @@ -70,6 +75,10 @@ #include "napi/npipe.h" #include "napi/shared_data.h" #include "napi/win32.h" +#include "ntos/rtltypes.h" +#include "ntos/rtl.h" +#include "ntos/zwtypes.h" +#include "ntos/zw.h" #endif #endif /* ndef _NTOS_H */ diff --git a/reactos/include/ntos/cdrom.h b/reactos/include/ntos/cdrom.h index 4fd8f402808..a1a964f7de6 100644 --- a/reactos/include/ntos/cdrom.h +++ b/reactos/include/ntos/cdrom.h @@ -1,44 +1,44 @@ -/* $Id: cdrom.h,v 1.3 2002/09/17 20:35:22 hbirr Exp $ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: include/ntos/cdrom.h - * PURPOSE: CD-ROM related definitions used by all the parts of the system - * PROGRAMMER: Eric Kohl - * UPDATE HISTORY: - * 10/04/2002: Created - */ - -#ifndef __INCLUDE_NTOS_CDROM_H -#define __INCLUDE_NTOS_CDROM_H - -#define IOCTL_CDROM_READ_TOC CTL_CODE(FILE_DEVICE_CD_ROM, 0x0000, METHOD_BUFFERED, FILE_READ_ACCESS) -#define IOCTL_CDROM_GET_LAST_SESSION CTL_CODE(FILE_DEVICE_CD_ROM, 0x000E, METHOD_BUFFERED, FILE_READ_ACCESS) -#define IOCTL_CDROM_GET_DRIVE_GEOMETRY CTL_CODE(FILE_DEVICE_CD_ROM, 0x0013, METHOD_BUFFERED, FILE_READ_ACCESS) - -#define MAXIMUM_NUMBER_TRACKS 100 -#define MAXIMUM_CDROM_SIZE 804 - -typedef struct _TRACK_DATA { - UCHAR Reserved; - UCHAR Control : 4; - UCHAR Adr : 4; - UCHAR TrackNumber; - UCHAR Reserved1; - UCHAR Address[4]; -} TRACK_DATA, *PTRACK_DATA; - -typedef struct _CDROM_TOC { - UCHAR Length[2]; - UCHAR FirstTrack; - UCHAR LastTrack; - TRACK_DATA TrackData[MAXIMUM_NUMBER_TRACKS]; -} CDROM_TOC, *PCDROM_TOC; - -#define CDROM_TOC_SIZE sizeof(CDROM_TOC) - - - -#endif /* __INCLUDE_NTOS_CDROM_H */ - -/* EOF */ +/* $Id: cdrom.h,v 1.4 2002/11/14 18:21:03 chorns Exp $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/ntos/cdrom.h + * PURPOSE: CD-ROM related definitions used by all the parts of the system + * PROGRAMMER: Eric Kohl + * UPDATE HISTORY: + * 10/04/2002: Created + */ + +#ifndef __INCLUDE_NTOS_CDROM_H +#define __INCLUDE_NTOS_CDROM_H + +#define IOCTL_CDROM_READ_TOC CTL_CODE(FILE_DEVICE_CD_ROM, 0x0000, METHOD_BUFFERED, FILE_READ_ACCESS) +#define IOCTL_CDROM_GET_LAST_SESSION CTL_CODE(FILE_DEVICE_CD_ROM, 0x000E, METHOD_BUFFERED, FILE_READ_ACCESS) +#define IOCTL_CDROM_GET_DRIVE_GEOMETRY CTL_CODE(FILE_DEVICE_CD_ROM, 0x0013, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define MAXIMUM_NUMBER_TRACKS 100 +#define MAXIMUM_CDROM_SIZE 804 + +typedef struct _TRACK_DATA { + UCHAR Reserved; + UCHAR Control : 4; + UCHAR Adr : 4; + UCHAR TrackNumber; + UCHAR Reserved1; + UCHAR Address[4]; +} TRACK_DATA, *PTRACK_DATA; + +typedef struct _CDROM_TOC { + UCHAR Length[2]; + UCHAR FirstTrack; + UCHAR LastTrack; + TRACK_DATA TrackData[MAXIMUM_NUMBER_TRACKS]; +} CDROM_TOC, *PCDROM_TOC; + +#define CDROM_TOC_SIZE sizeof(CDROM_TOC) + + + +#endif /* __INCLUDE_NTOS_CDROM_H */ + +/* EOF */ diff --git a/reactos/include/ntos/console.h b/reactos/include/ntos/console.h index 294d003826f..fde2458fcf6 100644 --- a/reactos/include/ntos/console.h +++ b/reactos/include/ntos/console.h @@ -14,16 +14,31 @@ #define __INCLUDE_CONSOLE_H /* GetConsoleMode */ -#define ENABLE_LINE_INPUT (0x02) -#define ENABLE_ECHO_INPUT (0x04) -#define ENABLE_PROCESSED_INPUT (0x01) -#define ENABLE_WINDOW_INPUT (0x08) -#define ENABLE_MOUSE_INPUT (0x0f) #define CONSOLE_INPUT_MODE_VALID (0x0f) -#define ENABLE_PROCESSED_OUTPUT (0x01) -#define ENABLE_WRAP_AT_EOL_OUTPUT (0x02) #define CONSOLE_OUTPUT_MODE_VALID (0x03) +typedef struct _CONSOLE_FONT_INFO { + DWORD nFont; + COORD dwFontSize; +} CONSOLE_FONT_INFO, *PCONSOLE_FONT_INFO; + +typedef struct _CONSOLE_SELECTION_INFO { + DWORD dwFlags; + COORD dwSelectionAnchor; + SMALL_RECT srSelection; +} CONSOLE_SELECTION_INFO, *PCONSOLE_SELECTION_INFO; + +#ifndef __USE_W32API + +/* GetConsoleMode */ +#define ENABLE_LINE_INPUT (0x02) +#define ENABLE_ECHO_INPUT (0x04) +#define ENABLE_PROCESSED_INPUT (0x01) +#define ENABLE_WINDOW_INPUT (0x08) +#define ENABLE_MOUSE_INPUT (0x0f) +#define ENABLE_PROCESSED_OUTPUT (0x01) +#define ENABLE_WRAP_AT_EOL_OUTPUT (0x02) + typedef struct _CONSOLE_SCREEN_BUFFER_INFO { COORD dwSize; COORD dwCursorPosition; @@ -37,18 +52,6 @@ typedef struct _CONSOLE_CURSOR_INFO { BOOL bVisible; } CONSOLE_CURSOR_INFO, *PCONSOLE_CURSOR_INFO; -typedef struct _CONSOLE_FONT_INFO { - DWORD nFont; - COORD dwFontSize; -} CONSOLE_FONT_INFO, *PCONSOLE_FONT_INFO; - -typedef struct _CONSOLE_SELECTION_INFO { - DWORD dwFlags; - COORD dwSelectionAnchor; - SMALL_RECT srSelection; -} CONSOLE_SELECTION_INFO, *PCONSOLE_SELECTION_INFO; +#endif /* !__USE_W32API */ #endif /* __INCLUDE_CONSOLE_H */ - - - diff --git a/reactos/include/ntos/disk.h b/reactos/include/ntos/disk.h index 1c73220b40b..6b40e1c5c70 100644 --- a/reactos/include/ntos/disk.h +++ b/reactos/include/ntos/disk.h @@ -1,4 +1,4 @@ -/* $Id: disk.h,v 1.11 2002/09/08 10:22:32 chorns Exp $ +/* $Id: disk.h,v 1.12 2002/11/14 18:21:03 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -134,13 +134,6 @@ typedef struct _PARTITION_INFORMATION BOOLEAN RewritePartition; } PARTITION_INFORMATION, *PPARTITION_INFORMATION; -typedef struct _DRIVE_LAYOUT_INFORMATION -{ - DWORD PartitionCount; - DWORD Signature; - PARTITION_INFORMATION PartitionEntry[1]; -} DRIVE_LAYOUT_INFORMATION, *PDRIVE_LAYOUT_INFORMATION; - typedef struct _SET_PARTITION_INFORMATION { ULONG PartitionType; @@ -155,6 +148,17 @@ typedef struct _DISK_GEOMETRY DWORD BytesPerSector; } DISK_GEOMETRY, *PDISK_GEOMETRY; +#ifndef __USE_W32API + +typedef struct _DRIVE_LAYOUT_INFORMATION +{ + DWORD PartitionCount; + DWORD Signature; + PARTITION_INFORMATION PartitionEntry[1]; +} DRIVE_LAYOUT_INFORMATION, *PDRIVE_LAYOUT_INFORMATION; + +#endif /* !__USE_W32API */ + #endif /* __INCLUDE_DISK_H */ /* EOF */ diff --git a/reactos/include/ntos/except.h b/reactos/include/ntos/except.h index c34b62df11f..62992417a8c 100644 --- a/reactos/include/ntos/except.h +++ b/reactos/include/ntos/except.h @@ -31,6 +31,7 @@ typedef EXCEPTION_DISPOSITION CDECL (*PEXCEPTION_HANDLER)( PCONTEXT Context, PVOID DispatcherContext); +#ifndef __USE_W32API #define EXCEPTION_MAXIMUM_PARAMETERS (15) @@ -43,6 +44,8 @@ typedef struct _EXCEPTION_RECORD { DWORD ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; } EXCEPTION_RECORD, *PEXCEPTION_RECORD, *LPEXCEPTION_RECORD; +#endif /* !__USE_W32API */ + /* ExceptionFlags */ #ifndef _GNU_H_WINDOWS32_DEFINES #ifdef __NTOSKRNL__ @@ -55,12 +58,6 @@ typedef struct _EXCEPTION_RECORD { #define EXCEPTION_NESTED_CALL 0x10 -typedef struct _EXCEPTION_POINTERS { - PEXCEPTION_RECORD ExceptionRecord; - PCONTEXT ContextRecord; -} EXCEPTION_POINTERS, *PEXCEPTION_POINTERS, *LPEXCEPTION_POINTERS; - - typedef struct _EXCEPTION_REGISTRATION { struct _EXCEPTION_REGISTRATION* prev; @@ -142,4 +139,15 @@ typedef PRTL_EXCEPTION_REGISTRATION_I386 PRTL_EXCEPTION_REGISTRATION; #endif +#ifndef __USE_W32API + +#define EXCEPTION_MAXIMUM_PARAMETERS (15) + +typedef struct _EXCEPTION_POINTERS { + PEXCEPTION_RECORD ExceptionRecord; + PCONTEXT ContextRecord; +} EXCEPTION_POINTERS, *PEXCEPTION_POINTERS, *LPEXCEPTION_POINTERS; + +#endif /* !__USE_W32API */ + #endif /* __INCLUDE_EXCEPT_H */ diff --git a/reactos/include/ntos/file.h b/reactos/include/ntos/file.h index eed866d849d..3899f8bd3f5 100644 --- a/reactos/include/ntos/file.h +++ b/reactos/include/ntos/file.h @@ -13,6 +13,8 @@ #ifndef __INCLUDE_FILE_H #define __INCLUDE_FILE_H +#ifndef __USE_W32API + #define GENERIC_READ (0x80000000L) #define GENERIC_WRITE (0x40000000L) #define FILE_READ_DATA ( 0x0001 ) /* file & pipe */ @@ -40,28 +42,6 @@ #define FILE_WRITE_ATTRIBUTES ( 0x0100 ) /* all */ -#define FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF) - -#define FILE_GENERIC_READ (STANDARD_RIGHTS_READ |\ - FILE_READ_DATA |\ - FILE_READ_ATTRIBUTES |\ - FILE_READ_EA |\ - SYNCHRONIZE) - - -#define FILE_GENERIC_WRITE (STANDARD_RIGHTS_WRITE |\ - FILE_WRITE_DATA |\ - FILE_WRITE_ATTRIBUTES |\ - FILE_WRITE_EA |\ - FILE_APPEND_DATA |\ - SYNCHRONIZE) - - -#define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE |\ - FILE_READ_ATTRIBUTES |\ - FILE_EXECUTE |\ - SYNCHRONIZE) - #define FILE_SHARE_DELETE (4) #define FILE_SHARE_READ (1) #define FILE_SHARE_WRITE (2) @@ -112,5 +92,28 @@ #define FILE_FILE_COMPRESSION (0x00000010) #define FILE_VOLUME_IS_COMPRESSED (0x00008000) +#endif /* !__USE_W32API */ + +#define FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF) + +#define FILE_GENERIC_READ (STANDARD_RIGHTS_READ |\ + FILE_READ_DATA |\ + FILE_READ_ATTRIBUTES |\ + FILE_READ_EA |\ + SYNCHRONIZE) + + +#define FILE_GENERIC_WRITE (STANDARD_RIGHTS_WRITE |\ + FILE_WRITE_DATA |\ + FILE_WRITE_ATTRIBUTES |\ + FILE_WRITE_EA |\ + FILE_APPEND_DATA |\ + SYNCHRONIZE) + + +#define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE |\ + FILE_READ_ATTRIBUTES |\ + FILE_EXECUTE |\ + SYNCHRONIZE) #endif /* __INCLUDE_FILE_H */ diff --git a/reactos/include/ntos/gditypes.h b/reactos/include/ntos/gditypes.h index 180fd406cb2..3932cf9ae8a 100644 --- a/reactos/include/ntos/gditypes.h +++ b/reactos/include/ntos/gditypes.h @@ -11,6 +11,8 @@ #ifndef __INCLUDE_NTOS_GDITYPES_H #define __INCLUDE_NTOS_GDITYPES_H +#ifndef __USE_W32API + #define CCHDEVICENAME (32) #define CCHFORMNAME (32) @@ -86,6 +88,8 @@ typedef struct _devicemodeW DWORD dmICCModel; } DEVMODEW,*LPDEVMODEW,*PDEVMODEW; +#endif /* !__USE_W32API */ + #endif /* __INCLUDE_NTOS_GDITYPES_H */ /* EOF */ diff --git a/reactos/include/ntos/heap.h b/reactos/include/ntos/heap.h index 391d638d572..9eb17962f2a 100644 --- a/reactos/include/ntos/heap.h +++ b/reactos/include/ntos/heap.h @@ -9,16 +9,20 @@ * 27/06/00: Created */ - #ifndef __INCLUDE_HEAP_H #define __INCLUDE_HEAP_H /* HeapAlloc, HeapReAlloc */ +#define HEAP_NO_VALLOC (64) + +#ifndef __USE_W32API + #define HEAP_GENERATE_EXCEPTIONS (4) #define HEAP_NO_SERIALIZE (1) #define HEAP_ZERO_MEMORY (8) #define HEAP_REALLOC_IN_PLACE_ONLY (16) -#define HEAP_GROWABLE (2) -#define HEAP_NO_VALLOC (64) +#define HEAP_GROWABLE (32) + +#endif /* !__USE_W32API */ #endif /* __INCLUDE_HEAP_H */ diff --git a/reactos/include/ntos/kdbgsyms.h b/reactos/include/ntos/kdbgsyms.h index 79c19ec4f90..47c0f606914 100644 --- a/reactos/include/ntos/kdbgsyms.h +++ b/reactos/include/ntos/kdbgsyms.h @@ -1,46 +1,46 @@ - -#ifndef __KDBGSYMS_H -#define __KDBGSYMS_H - -#include - -#define ST_FILENAME 0x00 -#define ST_FUNCTION 0x01 -#define ST_LINENUMBER 0x02 - -typedef struct _SYMBOL -{ - struct _SYMBOL *Next; - /* Address relative to module base address */ - ULONG RelativeAddress; - ULONG SymbolType; - ANSI_STRING Name; - ULONG LineNumber; -} SYMBOL, *PSYMBOL; - -typedef struct _SYMBOL_TABLE -{ - ULONG SymbolCount; - PSYMBOL Symbols; -} SYMBOL_TABLE, *PSYMBOL_TABLE; - -typedef struct _IMAGE_SYMBOL_INFO -{ - SYMBOL_TABLE FileNameSymbols; - SYMBOL_TABLE FunctionSymbols; - SYMBOL_TABLE LineNumberSymbols; - ULONG_PTR ImageBase; - ULONG_PTR ImageSize; - PVOID FileBuffer; - PVOID SymbolsBase; - ULONG SymbolsLength; - PVOID SymbolStringsBase; - ULONG SymbolStringsLength; -} IMAGE_SYMBOL_INFO, *PIMAGE_SYMBOL_INFO; - -#define AreSymbolsParsed(si)((si)->FileNameSymbols.Symbols \ - || (si)->FunctionSymbols.Symbols \ - || (si)->LineNumberSymbols.Symbols) - -#endif - + +#ifndef __KDBGSYMS_H +#define __KDBGSYMS_H + +#include + +#define ST_FILENAME 0x00 +#define ST_FUNCTION 0x01 +#define ST_LINENUMBER 0x02 + +typedef struct _SYMBOL +{ + struct _SYMBOL *Next; + /* Address relative to module base address */ + ULONG RelativeAddress; + ULONG SymbolType; + ANSI_STRING Name; + ULONG LineNumber; +} SYMBOL, *PSYMBOL; + +typedef struct _SYMBOL_TABLE +{ + ULONG SymbolCount; + PSYMBOL Symbols; +} SYMBOL_TABLE, *PSYMBOL_TABLE; + +typedef struct _IMAGE_SYMBOL_INFO +{ + SYMBOL_TABLE FileNameSymbols; + SYMBOL_TABLE FunctionSymbols; + SYMBOL_TABLE LineNumberSymbols; + ULONG_PTR ImageBase; + ULONG_PTR ImageSize; + PVOID FileBuffer; + PVOID SymbolsBase; + ULONG SymbolsLength; + PVOID SymbolStringsBase; + ULONG SymbolStringsLength; +} IMAGE_SYMBOL_INFO, *PIMAGE_SYMBOL_INFO; + +#define AreSymbolsParsed(si)((si)->FileNameSymbols.Symbols \ + || (si)->FunctionSymbols.Symbols \ + || (si)->LineNumberSymbols.Symbols) + +#endif + diff --git a/reactos/include/ntos/keyboard.h b/reactos/include/ntos/keyboard.h index 2945a737ad1..c6361a26bcc 100644 --- a/reactos/include/ntos/keyboard.h +++ b/reactos/include/ntos/keyboard.h @@ -15,6 +15,46 @@ #include +/* Virtual Key codes */ +#define VK_0 (48) +#define VK_1 (49) +#define VK_2 (50) +#define VK_3 (51) +#define VK_4 (52) +#define VK_5 (53) +#define VK_6 (54) +#define VK_7 (55) +#define VK_8 (56) +#define VK_9 (57) +#define VK_A (65) +#define VK_B (66) +#define VK_C (67) +#define VK_D (68) +#define VK_E (69) +#define VK_F (70) +#define VK_G (71) +#define VK_H (72) +#define VK_I (73) +#define VK_J (74) +#define VK_K (75) +#define VK_L (76) +#define VK_M (77) +#define VK_N (78) +#define VK_O (79) +#define VK_P (80) +#define VK_Q (81) +#define VK_R (82) +#define VK_S (83) +#define VK_T (84) +#define VK_U (85) +#define VK_V (86) +#define VK_W (87) +#define VK_X (88) +#define VK_Y (89) +#define VK_Z (90) + +#ifndef __USE_W32API + /* KEY_EVENT_RECORD structure */ #define CAPSLOCK_ON (128) #define ENHANCED_KEY (256) @@ -88,7 +128,7 @@ typedef struct _INPUT_RECORD { } Event; } INPUT_RECORD, *PINPUT_RECORD; -/* Virtual Key codes */ + /* Virtual Key codes */ #define VK_LBUTTON (1) #define VK_RBUTTON (2) #define VK_CANCEL (3) @@ -119,42 +159,6 @@ typedef struct _INPUT_RECORD { #define VK_INSERT (45) #define VK_DELETE (46) #define VK_HELP (47) -#define VK_0 (48) -#define VK_1 (49) -#define VK_2 (50) -#define VK_3 (51) -#define VK_4 (52) -#define VK_5 (53) -#define VK_6 (54) -#define VK_7 (55) -#define VK_8 (56) -#define VK_9 (57) -#define VK_A (65) -#define VK_B (66) -#define VK_C (67) -#define VK_D (68) -#define VK_E (69) -#define VK_F (70) -#define VK_G (71) -#define VK_H (72) -#define VK_I (73) -#define VK_J (74) -#define VK_K (75) -#define VK_L (76) -#define VK_M (77) -#define VK_N (78) -#define VK_O (79) -#define VK_P (80) -#define VK_Q (81) -#define VK_R (82) -#define VK_S (83) -#define VK_T (84) -#define VK_U (85) -#define VK_V (86) -#define VK_W (87) -#define VK_X (88) -#define VK_Y (89) -#define VK_Z (90) #define VK_NUMPAD0 (96) #define VK_NUMPAD1 (97) #define VK_NUMPAD2 (98) @@ -206,6 +210,7 @@ typedef struct _INPUT_RECORD { #define VK_RCONTROL (163) #define VK_RMENU (165) +#endif /* !__USE_W32API */ #endif /* __INCLUDE_KEYBOARD_H */ diff --git a/reactos/include/ntos/minmax.h b/reactos/include/ntos/minmax.h index 37d9ff3fcaf..3dc7fec0a3e 100644 --- a/reactos/include/ntos/minmax.h +++ b/reactos/include/ntos/minmax.h @@ -1,7 +1,7 @@ -#ifndef max -#define max(a, b) (((a) > (b)) ? (a) : (b)) -#endif - -#ifndef min -#define min(a, b) (((a) < (b)) ? (a) : (b)) -#endif +#ifndef max +#define max(a, b) (((a) > (b)) ? (a) : (b)) +#endif + +#ifndef min +#define min(a, b) (((a) < (b)) ? (a) : (b)) +#endif diff --git a/reactos/include/ntos/mm.h b/reactos/include/ntos/mm.h index 7ed75b4bc9f..706ee3724f1 100644 --- a/reactos/include/ntos/mm.h +++ b/reactos/include/ntos/mm.h @@ -13,12 +13,8 @@ #ifndef __INCLUDE_MM_H #define __INCLUDE_MM_H -#if 0 -#define SEC_COMMIT (134217728) -#define SEC_IMAGE (16777216) -#define SEC_NOCACHE (268435456) -#define SEC_RESERVE (67108864) -#else +#ifndef __USE_W32API + #define SEC_BASED (0x00200000) #define SEC_NO_CHANGE (0x00400000) #define SEC_IMAGE (0x01000000) @@ -26,7 +22,6 @@ #define SEC_RESERVE (0x04000000) #define SEC_COMMIT (0x08000000) #define SEC_NOCACHE (0x10000000) -#endif #define PAGE_READONLY (2) #define PAGE_READWRITE (4) #define PAGE_WRITECOPY (8) @@ -58,6 +53,10 @@ #define FILE_MAP_READ (4) #define FILE_MAP_WRITE (2) #define FILE_MAP_COPY (1) +#else /* __USE_W32API */ +#include + +#endif /* __USE_W32API */ #endif /* __INCLUDE_MM_H */ diff --git a/reactos/include/ntos/ntdef.h b/reactos/include/ntos/ntdef.h index c3356c80611..2f49140b07e 100644 --- a/reactos/include/ntos/ntdef.h +++ b/reactos/include/ntos/ntdef.h @@ -11,6 +11,12 @@ #ifndef __INCLUDE_NTDEF_H #define __INCLUDE_NTDEF_H +#define PACKED __attribute__((packed)) + +#define EX_MAXIMUM_WAIT_OBJECTS (64) + +#ifndef __USE_W32API + #define ANYSIZE_ARRAY (1) #define DELETE (0x00010000L) @@ -20,10 +26,8 @@ #define DUPLICATE_CLOSE_SOURCE (1) #define DUPLICATE_SAME_ACCESS (2) -#define PACKED __attribute__((packed)) - #define INVALID_HANDLE_VALUE ((HANDLE)-1) -#define EX_MAXIMUM_WAIT_OBJECTS (64) +#endif /* !__USE_W32API */ #endif /* __INCLUDE_NTDEF_H */ diff --git a/reactos/include/ntos/port.h b/reactos/include/ntos/port.h index b62babfd9d9..3cf8a7c631d 100644 --- a/reactos/include/ntos/port.h +++ b/reactos/include/ntos/port.h @@ -1,4 +1,4 @@ -/* $Id: port.h,v 1.1 2001/02/02 20:44:21 ekohl Exp $ +/* $Id: port.h,v 1.2 2002/11/14 18:21:03 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -13,11 +13,18 @@ #ifndef __INCLUDE_PORT_H #define __INCLUDE_PORT_H +#ifndef __USE_W32API /* Port Object Access */ #define PORT_ALL_ACCESS (0x1) +#else /* __USE_W32API */ + +#include + +#endif /* __USE_W32API */ + #endif /* __INCLUDE_PORT_H */ /* EOF */ diff --git a/reactos/include/ntos/ps.h b/reactos/include/ntos/ps.h index c9e817195f4..e2169219930 100644 --- a/reactos/include/ntos/ps.h +++ b/reactos/include/ntos/ps.h @@ -13,6 +13,21 @@ #ifndef __INCLUDE_PS_H #define __INCLUDE_PS_H +#define THREAD_READ (0x020048L) +#define THREAD_WRITE (0x020037L) +#define THREAD_EXECUTE (0x120000L) + +#define PROCESS_READ (0x020410L) +#define PROCESS_WRITE (0x020bebL) +#define PROCESS_EXECUTE (0x120000L) + +/* Thread priorities */ +#define THREAD_PRIORITY_BELOW_NORMAL (-1) +#define THREAD_PRIORITY_IDLE (-15) +#define THREAD_PRIORITY_LOWEST (-2) + +#ifndef __USE_W32API + /* Thread access rights */ #define THREAD_TERMINATE (0x0001L) #define THREAD_SUSPEND_RESUME (0x0002L) @@ -25,9 +40,6 @@ #define THREAD_DIRECT_IMPERSONATION (0x0200L) #define THREAD_ALL_ACCESS (0x1f03ffL) -#define THREAD_READ (0x020048L) -#define THREAD_WRITE (0x020037L) -#define THREAD_EXECUTE (0x120000L) /* Process access rights */ #define PROCESS_TERMINATE (0x0001L) @@ -43,16 +55,10 @@ #define PROCESS_QUERY_INFORMATION (0x0400L) #define PROCESS_ALL_ACCESS (0x1f0fffL) -#define PROCESS_READ (0x020410L) -#define PROCESS_WRITE (0x020bebL) -#define PROCESS_EXECUTE (0x120000L) /* Thread priorities */ #define THREAD_PRIORITY_ABOVE_NORMAL (1) -#define THREAD_PRIORITY_BELOW_NORMAL (-1) #define THREAD_PRIORITY_HIGHEST (2) -#define THREAD_PRIORITY_IDLE (-15) -#define THREAD_PRIORITY_LOWEST (-2) #define THREAD_PRIORITY_NORMAL (0) #define THREAD_PRIORITY_TIME_CRITICAL (15) #define THREAD_PRIORITY_ERROR_RETURN (2147483647) @@ -75,4 +81,6 @@ /* ResumeThread / SuspendThread */ #define MAXIMUM_SUSPEND_COUNT (0x7f) +#endif /* !__USE_W32API */ + #endif /* __INCLUDE_PS_H */ diff --git a/reactos/include/ntos/registry.h b/reactos/include/ntos/registry.h index d2cf2f47046..9f481ebc298 100644 --- a/reactos/include/ntos/registry.h +++ b/reactos/include/ntos/registry.h @@ -1,4 +1,4 @@ -/* $Id: registry.h,v 1.3 2002/06/19 22:30:29 ekohl Exp $ +/* $Id: registry.h,v 1.4 2002/11/14 18:21:03 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -13,6 +13,8 @@ #ifndef __INCLUDE_NTOS_REGISTRY_H #define __INCLUDE_NTOS_REGISTRY_H +#ifndef __USE_W32API + /* Key access rights */ #define KEY_QUERY_VALUE (1) #define KEY_SET_VALUE (2) @@ -51,5 +53,6 @@ #define REG_FULL_RESOURCE_DESCRIPTOR (9) #define REG_RESOURCE_REQUIREMENTS_LIST (10) +#endif /* !__USE_W32API */ #endif /* __INCLUDE_NTOS_REGISTRY_H */ diff --git a/reactos/include/ntos/security.h b/reactos/include/ntos/security.h index c88df82f510..d7b5359cf02 100644 --- a/reactos/include/ntos/security.h +++ b/reactos/include/ntos/security.h @@ -4,6 +4,71 @@ #include #include +/* Privileges */ +#define SE_MIN_WELL_KNOWN_PRIVILEGE (2L) +#define SE_CREATE_TOKEN_PRIVILEGE (2L) +#define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE (3L) +#define SE_LOCK_MEMORY_PRIVILEGE (4L) +#define SE_INCREASE_QUOTA_PRIVILEGE (5L) +#define SE_UNSOLICITED_INPUT_PRIVILEGE (6L) /* unused */ +#define SE_MACHINE_ACCOUNT_PRIVILEGE (6L) +#define SE_TCB_PRIVILEGE (7L) +#define SE_SECURITY_PRIVILEGE (8L) +#define SE_TAKE_OWNERSHIP_PRIVILEGE (9L) +#define SE_LOAD_DRIVER_PRIVILEGE (10L) +#define SE_SYSTEM_PROFILE_PRIVILEGE (11L) +#define SE_SYSTEMTIME_PRIVILEGE (12L) +#define SE_PROF_SINGLE_PROCESS_PRIVILEGE (13L) +#define SE_INC_BASE_PRIORITY_PRIVILEGE (14L) +#define SE_CREATE_PAGEFILE_PRIVILEGE (15L) +#define SE_CREATE_PERMANENT_PRIVILEGE (16L) +#define SE_BACKUP_PRIVILEGE (17L) +#define SE_RESTORE_PRIVILEGE (18L) +#define SE_SHUTDOWN_PRIVILEGE (19L) +#define SE_DEBUG_PRIVILEGE (20L) +#define SE_AUDIT_PRIVILEGE (21L) +#define SE_SYSTEM_ENVIRONMENT_PRIVILEGE (22L) +#define SE_CHANGE_NOTIFY_PRIVILEGE (23L) +#define SE_REMOTE_SHUTDOWN_PRIVILEGE (24L) +#define SE_MAX_WELL_KNOWN_PRIVILEGE SE_REMOTE_SHUTDOWN_PRIVILEGE + +#if 0 +/* Security descriptor control. */ +#define SECURITY_DESCRIPTOR_REVISION (1) +#define SECURITY_DESCRIPTOR_MIN_LENGTH (20) +#define SE_OWNER_DEFAULTED (1) +#define SE_GROUP_DEFAULTED (2) +#define SE_DACL_PRESENT (4) +#define SE_DACL_DEFAULTED (8) +#define SE_SACL_PRESENT (16) +#define SE_SACL_DEFAULTED (32) +#define SE_SELF_RELATIVE (32768) +#endif + +typedef ULONG ACCESS_MODE, *PACCESS_MODE; + +#if 0 +typedef struct _ACE_HEADER +{ + CHAR AceType; + CHAR AceFlags; + USHORT AceSize; + ACCESS_MASK AccessMask; +} ACE_HEADER, *PACE_HEADER; + +typedef struct +{ + ACE_HEADER Header; +} ACE, *PACE; +#endif + +typedef struct _SECURITY_DESCRIPTOR_CONTEXT +{ +} SECURITY_DESCRIPTOR_CONTEXT, *PSECURITY_DESCRIPTOR_CONTEXT; + + +#ifndef __USE_W32API + /* SID Auhority */ #define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0} #define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1} @@ -51,47 +116,6 @@ #define DOMAIN_ALIAS_RID_BACKUP_OPS (0x227L) #define DOMAIN_ALIAS_RID_REPLICATOR (0x228L) -/* Privileges */ -#define SE_MIN_WELL_KNOWN_PRIVILEGE (2L) -#define SE_CREATE_TOKEN_PRIVILEGE (2L) -#define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE (3L) -#define SE_LOCK_MEMORY_PRIVILEGE (4L) -#define SE_INCREASE_QUOTA_PRIVILEGE (5L) -#define SE_UNSOLICITED_INPUT_PRIVILEGE (6L) /* unused */ -#define SE_MACHINE_ACCOUNT_PRIVILEGE (6L) -#define SE_TCB_PRIVILEGE (7L) -#define SE_SECURITY_PRIVILEGE (8L) -#define SE_TAKE_OWNERSHIP_PRIVILEGE (9L) -#define SE_LOAD_DRIVER_PRIVILEGE (10L) -#define SE_SYSTEM_PROFILE_PRIVILEGE (11L) -#define SE_SYSTEMTIME_PRIVILEGE (12L) -#define SE_PROF_SINGLE_PROCESS_PRIVILEGE (13L) -#define SE_INC_BASE_PRIORITY_PRIVILEGE (14L) -#define SE_CREATE_PAGEFILE_PRIVILEGE (15L) -#define SE_CREATE_PERMANENT_PRIVILEGE (16L) -#define SE_BACKUP_PRIVILEGE (17L) -#define SE_RESTORE_PRIVILEGE (18L) -#define SE_SHUTDOWN_PRIVILEGE (19L) -#define SE_DEBUG_PRIVILEGE (20L) -#define SE_AUDIT_PRIVILEGE (21L) -#define SE_SYSTEM_ENVIRONMENT_PRIVILEGE (22L) -#define SE_CHANGE_NOTIFY_PRIVILEGE (23L) -#define SE_REMOTE_SHUTDOWN_PRIVILEGE (24L) -#define SE_MAX_WELL_KNOWN_PRIVILEGE SE_REMOTE_SHUTDOWN_PRIVILEGE - -#if 0 -/* Security descriptor control. */ -#define SECURITY_DESCRIPTOR_REVISION (1) -#define SECURITY_DESCRIPTOR_MIN_LENGTH (20) -#define SE_OWNER_DEFAULTED (1) -#define SE_GROUP_DEFAULTED (2) -#define SE_DACL_PRESENT (4) -#define SE_DACL_DEFAULTED (8) -#define SE_SACL_PRESENT (16) -#define SE_SACL_DEFAULTED (32) -#define SE_SELF_RELATIVE (32768) -#endif - /* ACCESS_MASK */ #define MAXIMUM_ALLOWED (0x2000000L) #define GENERIC_ALL (0x10000000L) @@ -148,19 +172,12 @@ typedef ULONG SECURITY_IMPERSONATION_LEVEL, *PSECURITY_IMPERSONATION_LEVEL; #define SecurityImpersonation ((SECURITY_IMPERSONATION_LEVEL)3) #define SecurityDelegation ((SECURITY_IMPERSONATION_LEVEL)4) +typedef ULONG ACCESS_MASK, *PACCESS_MASK; typedef ULONG TOKEN_TYPE, *PTOKEN_TYPE; #define TokenPrimary ((TOKEN_TYPE)1) #define TokenImpersonation ((TOKEN_TYPE)2) -//typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE, *PSECURITY_CONTEXT_TRACKING_MODE; - -//#define SECURITY_DYNAMIC_TRACKING (TRUE) -//#define SECURITY_STATIC_TRACKING (FALSE) - -typedef ULONG ACCESS_MASK, *PACCESS_MASK; -typedef ULONG ACCESS_MODE, *PACCESS_MODE; - typedef struct _SECURITY_QUALITY_OF_SERVICE { ULONG Length; @@ -178,12 +195,6 @@ typedef struct _ACE_HEADER WORD AceSize; } ACE_HEADER, *PACE_HEADER; -typedef struct -{ - ACE_HEADER Header; - ACCESS_MASK AccessMask; -} ACE, *PACE; - typedef struct _SID_IDENTIFIER_AUTHORITY { BYTE Value[6]; @@ -226,10 +237,6 @@ typedef enum _ACL_INFORMATION_CLASS typedef USHORT SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL; -typedef struct _SECURITY_DESCRIPTOR_CONTEXT -{ -} SECURITY_DESCRIPTOR_CONTEXT, *PSECURITY_DESCRIPTOR_CONTEXT; - typedef LARGE_INTEGER LUID, *PLUID; typedef struct _SECURITY_DESCRIPTOR @@ -340,5 +347,12 @@ typedef struct _SECURITY_ATTRIBUTES BOOL bInheritHandle; } SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES; +#endif /* !__USE_W32API */ + +typedef struct +{ + ACE_HEADER Header; + ACCESS_MASK AccessMask; +} ACE, *PACE; #endif /* __INCLUDE_SECURITY_H */ diff --git a/reactos/include/ntos/synch.h b/reactos/include/ntos/synch.h index 85d1a3bede7..be138d4f325 100644 --- a/reactos/include/ntos/synch.h +++ b/reactos/include/ntos/synch.h @@ -12,13 +12,13 @@ #ifndef __INCLUDE_SYNCH_H #define __INCLUDE_SYNCH_H +#ifndef __USE_W32API #define EVENT_ALL_ACCESS (0x1f0003L) -#define EVENT_QUERY_STATE (1) #define EVENT_MODIFY_STATE (2) +#define EVENT_QUERY_STATE (1) #define EVENT_PAIR_ALL_ACCESS (0x1f0000L) #define MUTEX_ALL_ACCESS (0x1f0001L) -#define MUTEX_QUERY_STATE (1) #define MUTANT_ALL_ACCESS (0x1f0001L) #define MUTANT_QUERY_STATE (1) #define SEMAPHORE_ALL_ACCESS (0x1f0003L) @@ -28,5 +28,8 @@ #define TIMER_QUERY_STATE (1) #define TIMER_MODIFY_STATE (2) +#endif /* !__USE_W32API */ + +#define MUTEX_QUERY_STATE (1) #endif /* __INCLUDE_SYNCH_H */ diff --git a/reactos/include/ntos/time.h b/reactos/include/ntos/time.h index 8387a89003a..3c77ab3d4f1 100644 --- a/reactos/include/ntos/time.h +++ b/reactos/include/ntos/time.h @@ -14,6 +14,8 @@ #include +#ifndef __USE_W32API + typedef struct _SYSTEMTIME { WORD wYear; @@ -37,4 +39,13 @@ typedef struct _TIME_ZONE_INFORMATION LONG DaylightBias; } TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION; +#else /* __USE_W32API */ + +#include + +typedef LPTIME_ZONE_INFORMATION PTIME_ZONE_INFORMATION; + +#endif /* __USE_W32API */ + + #endif /* __INCLUDE_NTOS_TIME_H */ diff --git a/reactos/include/ntos/types.h b/reactos/include/ntos/types.h index ebdf60f97ba..af36a27b445 100644 --- a/reactos/include/ntos/types.h +++ b/reactos/include/ntos/types.h @@ -1,432 +1,423 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: include/types.h - * PURPOSE: Types used by all the parts of the system - * PROGRAMMER: David Welch - * DEFINES: _WIN64: 64-bit architecture - * _WIN32: 32-bit architecture (default) - * UPDATE HISTORY: - * 27/06/00: Created - * 01/05/01: Portabillity changes - */ - -#ifndef __INCLUDE_TYPES_H -#define __INCLUDE_TYPES_H - -/* Fixed precision types */ -typedef signed char INT8, *PINT8; -typedef signed short INT16, *PINT16; -typedef signed int INT32, *PINT32; -typedef signed long long INT64, *PINT64; -typedef unsigned char UINT8, *PUINT8; -typedef unsigned short UINT16, *PUINT16; -typedef unsigned int UINT32, *PUINT32; -typedef unsigned long long UINT64, *PUINT64; - -typedef signed long int LONG32, *PLONG32; -typedef unsigned long int ULONG32, *PULONG32; -typedef unsigned long int DWORD32, *PDWORD32; - - -#ifdef _WIN64 - -/* 64-bit architecture */ - -typedef INT64 INT, *PINT; -typedef LONG64 LONG, *PLONG; -typedef DWORD64 DWORD, *PDWORD; -typedef UINT64 UINT, *PUINT; -typedef ULONG64 ULONG, *PULONG; - -/* Pointer precision types */ -typedef long long INT_PTR, *PINT_PTR; -typedef unsigned long long UINT_PTR, *PUINT_PTR; -typedef long long LONG_PTR, *PLONG_PTR; -typedef unsigned long long ULONG_PTR, *PULONG_PTR; -typedef unsigned long long HANDLE_PTR; -typedef unsigned int UHALF_PTR, *PUHALF_PTR; -typedef int HALF_PTR, *PHALF_PTR; - -#else /* _WIN64 */ - -/* 32-bit architecture */ - -typedef INT32 INT, *PINT; -typedef LONG32 LONG, *PLONG; -typedef DWORD32 DWORD, *PDWORD; -typedef UINT32 UINT, *PUINT; -typedef ULONG32 ULONG, *PULONG; - - -/* Pointer precision types */ -typedef int INT_PTR, *PINT_PTR; -typedef unsigned int UINT_PTR, *PUINT_PTR; -typedef long LONG_PTR, *PLONG_PTR; -typedef unsigned long ULONG_PTR, *PULONG_PTR; -typedef unsigned short UHALF_PTR, *PUHALF_PTR; -typedef short HALF_PTR, *PHALF_PTR; -typedef unsigned long HANDLE_PTR; - -#endif /* _WIN64 */ - -typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR; - -typedef long long LONG64, *PLONG64; - -typedef unsigned long long ULONG64, *PULONG64; -typedef unsigned long long DWORD64, *PDWORD64; - - -typedef unsigned char UCHAR; -typedef unsigned short USHORT; -typedef unsigned short WCHAR; -typedef unsigned short WORD; -typedef int BOOL; -typedef unsigned char BOOLEAN; -typedef BOOLEAN* PBOOLEAN; -typedef unsigned short *LPWSTR; -typedef unsigned short *PWSTR; -typedef unsigned char *PUCHAR; -typedef unsigned short *PUSHORT; -typedef void *PVOID; -typedef unsigned char BYTE; -typedef void *LPVOID; -typedef float *PFLOAT; -typedef unsigned short *PWCH; -typedef unsigned short *PWORD; - -typedef long long LONGLONG; -typedef unsigned long long ULONGLONG; -typedef long long *PLONGLONG; -typedef unsigned long long *PULONGLONG; - -/* Check VOID before defining CHAR, SHORT */ -#ifndef VOID -#define VOID void -typedef char CHAR; -typedef short SHORT; -#endif - -typedef CHAR *PCHAR; -typedef CHAR *PCH; -typedef void *HANDLE; -typedef char CCHAR; -typedef CCHAR *PCCHAR; - - -#define FALSE 0 -#define TRUE 1 - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void*)0) -#endif /* __cplusplus */ -#endif /* NULL */ - -typedef const unsigned short *PCWSTR; - -typedef char* PCSZ; - -typedef union _LARGE_INTEGER -{ - struct - { - DWORD LowPart; - LONG HighPart; - } u; -#ifdef ANONYMOUSUNIONS - struct - { - DWORD LowPart; - LONG HighPart; - }; -#endif /* ANONYMOUSUNIONS */ - LONGLONG QuadPart; -} LARGE_INTEGER, *PLARGE_INTEGER; - -typedef union _ULARGE_INTEGER -{ - struct - { - DWORD LowPart; - DWORD HighPart; - } u; -#ifdef ANONYMOUSUNIONS - struct - { - DWORD LowPart; - DWORD HighPart; - }; -#endif /* ANONYMOUSUNIONS */ - ULONGLONG QuadPart; -} ULARGE_INTEGER, *PULARGE_INTEGER; - -typedef struct _FILETIME -{ - DWORD dwLowDateTime; - DWORD dwHighDateTime; -} FILETIME, *LPFILETIME, *PFILETIME; - -#define CONST const - -#ifdef i386 -#define STDCALL __attribute__ ((stdcall)) -#define CDECL __attribute((cdecl)) -#define CALLBACK WINAPI -#define PASCAL WINAPI -#else -#define STDCALL -#define CDECL -#define CALLBACK -#define PASCAL -#endif - -typedef struct _LIST_ENTRY { - struct _LIST_ENTRY *Flink; - struct _LIST_ENTRY *Blink; -} LIST_ENTRY, *PLIST_ENTRY; - -typedef struct _SINGLE_LIST_ENTRY { - struct _SINGLE_LIST_ENTRY *Next; -} SINGLE_LIST_ENTRY, *PSINGLE_LIST_ENTRY; - -typedef DWORD STDCALL (*PTHREAD_START_ROUTINE) (LPVOID); -typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE; - -typedef unsigned short *PWCHAR; - -#ifdef __PPC__ -#define CONTEXT_CONTROL 1L -#define CONTEXT_FLOATING_POINT 2L -#define CONTEXT_INTEGER 4L -#define CONTEXT_DEBUG_REGISTERS 8L - -#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER) -#define CONTEXT_DEBUGGER (CONTEXT_FULL) - -#else /* x86 */ -/* The doc refered me to winnt.h, so I had to look... */ -#define SIZE_OF_80387_REGISTERS 80 - -/* Values for contextflags */ -#define CONTEXT_i386 0x10000 -#define CONTEXT_CONTROL (CONTEXT_i386 | 1) -#define CONTEXT_INTEGER (CONTEXT_i386 | 2) -#define CONTEXT_SEGMENTS (CONTEXT_i386 | 4) -#define CONTEXT_FLOATING_POINT (CONTEXT_i386 | 8) -#define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386 | 0x10) -#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS) - -/* our own invention */ -#define FLAG_TRACE_BIT 0x100 -#define CONTEXT_DEBUGGER (CONTEXT_FULL | CONTEXT_FLOATING_POINT) - -#endif - -typedef struct _FLOATING_SAVE_AREA { - DWORD ControlWord; - DWORD StatusWord; - DWORD TagWord; - DWORD ErrorOffset; - DWORD ErrorSelector; - DWORD DataOffset; - DWORD DataSelector; - BYTE RegisterArea[80]; - DWORD Cr0NpxState; -} FLOATING_SAVE_AREA; - -typedef struct _CONTEXT_X86 { - DWORD ContextFlags; - - DWORD Dr0; - DWORD Dr1; - DWORD Dr2; - DWORD Dr3; - DWORD Dr6; - DWORD Dr7; - - FLOATING_SAVE_AREA FloatSave; - - DWORD SegGs; - DWORD SegFs; - DWORD SegEs; - DWORD SegDs; - - DWORD Edi; - DWORD Esi; - DWORD Ebx; - DWORD Edx; - DWORD Ecx; - DWORD Eax; - - DWORD Ebp; - DWORD Eip; - DWORD SegCs; - DWORD EFlags; - DWORD Esp; - DWORD SegSs; -} CONTEXT_X86, *PCONTEXT_X86, *LPCONTEXT_X86; - -typedef struct _CONTEXT_PPC - { - /* Floating point registers returned when CONTEXT_FLOATING_POINT is set */ - double Fpr0; - double Fpr1; - double Fpr2; - double Fpr3; - double Fpr4; - double Fpr5; - double Fpr6; - double Fpr7; - double Fpr8; - double Fpr9; - double Fpr10; - double Fpr11; - double Fpr12; - double Fpr13; - double Fpr14; - double Fpr15; - double Fpr16; - double Fpr17; - double Fpr18; - double Fpr19; - double Fpr20; - double Fpr21; - double Fpr22; - double Fpr23; - double Fpr24; - double Fpr25; - double Fpr26; - double Fpr27; - double Fpr28; - double Fpr29; - double Fpr30; - double Fpr31; - double Fpscr; - - /* Integer registers returned when CONTEXT_INTEGER is set. */ - DWORD Gpr0; - DWORD Gpr1; - DWORD Gpr2; - DWORD Gpr3; - DWORD Gpr4; - DWORD Gpr5; - DWORD Gpr6; - DWORD Gpr7; - DWORD Gpr8; - DWORD Gpr9; - DWORD Gpr10; - DWORD Gpr11; - DWORD Gpr12; - DWORD Gpr13; - DWORD Gpr14; - DWORD Gpr15; - DWORD Gpr16; - DWORD Gpr17; - DWORD Gpr18; - DWORD Gpr19; - DWORD Gpr20; - DWORD Gpr21; - DWORD Gpr22; - DWORD Gpr23; - DWORD Gpr24; - DWORD Gpr25; - DWORD Gpr26; - DWORD Gpr27; - DWORD Gpr28; - DWORD Gpr29; - DWORD Gpr30; - DWORD Gpr31; - - DWORD Cr; /* Condition register */ - DWORD Xer; /* Fixed point exception register */ - - /* The following are set when CONTEXT_CONTROL is set. */ - DWORD Msr; /* Machine status register */ - DWORD Iar; /* Instruction address register */ - DWORD Lr; /* Link register */ - DWORD Ctr; /* Control register */ - - /* Control which context values are returned */ - DWORD ContextFlags; - DWORD Fill[3]; - - /* Registers returned if CONTEXT_DEBUG_REGISTERS is set. */ - DWORD Dr0; /* Breakpoint Register 1 */ - DWORD Dr1; /* Breakpoint Register 2 */ - DWORD Dr2; /* Breakpoint Register 3 */ - DWORD Dr3; /* Breakpoint Register 4 */ - DWORD Dr4; /* Breakpoint Register 5 */ - DWORD Dr5; /* Breakpoint Register 6 */ - DWORD Dr6; /* Debug Status Register */ - DWORD Dr7; /* Debug Control Register */ -} CONTEXT_PPC, *PCONTEXT_PPC, *LPCONTEXT_PPC; - -#ifdef __i386__ - -typedef CONTEXT_X86 CONTEXT; -typedef PCONTEXT_X86 PCONTEXT; -typedef LPCONTEXT_X86 LPCONTEXT; - -#else /* __ppc__ */ - -typedef CONTEXT_PPC CONTEXT; -typedef PCONTEXT_PPC PCONTEXT; -typedef LPCONTEXT_PPC LPCONTEXT; - -#endif - -typedef HANDLE *PHANDLE; - -typedef struct value_ent { - LPWSTR ve_valuename; - DWORD ve_valuelen; - DWORD ve_valueptr; - DWORD ve_type; -} WVALENT, *PWVALENT; - - -typedef const void *LPCVOID; -typedef BYTE *LPBYTE, *PBYTE; - -typedef BOOL *PBOOL; - -typedef DWORD LCID; -typedef DWORD *PLCID; - -typedef const char *LPCSTR; - -typedef char *LPSTR; - -typedef const unsigned short *LPCWSTR; - -typedef unsigned short RTL_ATOM; -typedef unsigned short *PRTL_ATOM; -typedef WORD ATOM; - -typedef struct _COORD { - SHORT X; - SHORT Y; -} COORD; - -typedef struct _SMALL_RECT { - SHORT Left; - SHORT Top; - SHORT Right; - SHORT Bottom; -} SMALL_RECT, *PSMALL_RECT; - - -typedef VOID STDCALL -(*PTIMERAPCROUTINE)( - LPVOID lpArgToCompletionRoutine, - DWORD dwTimerLowValue, - DWORD dwTimerHighValue - ); - -#include "except.h" - -#endif /* __INCLUDE_TYPES_H */ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/types.h + * PURPOSE: Types used by all the parts of the system + * PROGRAMMER: David Welch + * DEFINES: _WIN64: 64-bit architecture + * _WIN32: 32-bit architecture (default) + * UPDATE HISTORY: + * 27/06/00: Created + * 01/05/01: Portabillity changes + */ + +#ifndef __INCLUDE_TYPES_H +#define __INCLUDE_TYPES_H + +#include + +/* Fixed precision types */ +typedef signed char INT8, *PINT8; +typedef signed short INT16, *PINT16; + +typedef unsigned short UINT8, *PUINT8; +typedef unsigned short UINT16, *PUINT16; + + +/* Check VOID before defining CHAR, SHORT */ +#ifndef VOID +#define VOID void +typedef char CHAR; +typedef short SHORT; +#endif + + +#ifndef __USE_W32API + +#ifdef i386 +#define STDCALL __attribute__ ((stdcall)) +#define CDECL __attribute__ ((cdecl)) +#define CALLBACK WINAPI +#define PASCAL WINAPI +#else +#define STDCALL +#define CDECL +#define CALLBACK +#define PASCAL +#endif + +#ifdef _WIN64 + +/* 64-bit architecture */ + +typedef INT64 INT, *PINT; +typedef LONG64 LONG, *PLONG; +typedef DWORD64 DWORD, *PDWORD; +typedef UINT64 UINT, *PUINT; +typedef ULONG64 ULONG, *PULONG; + +#else /* _WIN64 */ + +/* 32-bit architecture */ + +typedef INT32 INT, *PINT; +typedef LONG32 LONG, *PLONG; +typedef DWORD32 DWORD, *PDWORD; +typedef UINT32 UINT, *PUINT; +typedef ULONG32 ULONG, *PULONG; + +#endif /* _WIN64 */ + +typedef unsigned char UCHAR; +typedef unsigned short USHORT; +typedef unsigned short WCHAR; +typedef unsigned short WORD; +typedef int BOOL; +typedef unsigned char BOOLEAN; +typedef BOOLEAN* PBOOLEAN; +typedef unsigned short *LPWSTR; +typedef unsigned short *PWSTR; +typedef unsigned char *PUCHAR; +typedef unsigned short *PUSHORT; +typedef void *PVOID; +typedef unsigned char BYTE; +typedef void *LPVOID; +typedef float *PFLOAT; +typedef unsigned short *PWCH; +typedef unsigned short *PWORD; +typedef long long LONGLONG; +typedef unsigned long long ULONGLONG; +typedef long long *PLONGLONG; +typedef unsigned long long *PULONGLONG; +typedef const void *LPCVOID; +typedef BYTE *LPBYTE, *PBYTE; +typedef BOOL *PBOOL; +typedef DWORD LCID; +typedef DWORD *PLCID; +typedef const char *LPCSTR; +typedef char *LPSTR; +typedef const unsigned short *LPCWSTR; +typedef CHAR *PCHAR; +typedef CHAR *PCH; +typedef void *HANDLE; +typedef HANDLE *PHANDLE; +typedef char CCHAR; +typedef CCHAR *PCCHAR; +typedef unsigned short *PWCHAR; +typedef ULONG WAIT_TYPE; +typedef USHORT CSHORT; +typedef const unsigned short *PCWSTR; +typedef char* PCSZ; + +typedef DWORD STDCALL (*PTHREAD_START_ROUTINE) (LPVOID); + +typedef union _LARGE_INTEGER +{ + struct + { + DWORD LowPart; + LONG HighPart; + } u; +#ifdef ANONYMOUSUNIONS + struct + { + DWORD LowPart; + LONG HighPart; + }; +#endif /* ANONYMOUSUNIONS */ + LONGLONG QuadPart; +} LARGE_INTEGER, *PLARGE_INTEGER; + +typedef union _ULARGE_INTEGER +{ + struct + { + DWORD LowPart; + DWORD HighPart; + } u; +#ifdef ANONYMOUSUNIONS + struct + { + DWORD LowPart; + DWORD HighPart; + }; +#endif /* ANONYMOUSUNIONS */ + ULONGLONG QuadPart; +} ULARGE_INTEGER, *PULARGE_INTEGER; + +typedef struct _FILETIME +{ + DWORD dwLowDateTime; + DWORD dwHighDateTime; +} FILETIME, *LPFILETIME, *PFILETIME; + +typedef struct _LIST_ENTRY { + struct _LIST_ENTRY *Flink; + struct _LIST_ENTRY *Blink; +} LIST_ENTRY, *PLIST_ENTRY; + +typedef struct _SINGLE_LIST_ENTRY { + struct _SINGLE_LIST_ENTRY *Next; +} SINGLE_LIST_ENTRY, *PSINGLE_LIST_ENTRY; + +typedef struct _UNICODE_STRING +{ + USHORT Length; + USHORT MaximumLength; + PWSTR Buffer; +} UNICODE_STRING, *PUNICODE_STRING; + +typedef struct _FLOATING_SAVE_AREA { + DWORD ControlWord; + DWORD StatusWord; + DWORD TagWord; + DWORD ErrorOffset; + DWORD ErrorSelector; + DWORD DataOffset; + DWORD DataSelector; + BYTE RegisterArea[80]; + DWORD Cr0NpxState; +} FLOATING_SAVE_AREA; + +typedef unsigned short RTL_ATOM; +typedef unsigned short *PRTL_ATOM; + +#else /* __USE_W32API */ + +#include + +#endif /* __USE_W32API */ + +#define FALSE 0 +#define TRUE 1 + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void*)0) +#endif /* __cplusplus */ +#endif /* NULL */ + +#define CONST const + +#ifdef __PPC__ +#define CONTEXT_CONTROL 1L +#define CONTEXT_FLOATING_POINT 2L +#define CONTEXT_INTEGER 4L +#define CONTEXT_DEBUG_REGISTERS 8L + +#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER) +#define CONTEXT_DEBUGGER (CONTEXT_FULL) + +#else /* x86 */ + +#define SIZE_OF_80387_REGISTERS 80 + +/* Values for contextflags */ +#define CONTEXT_i386 0x10000 + +#ifndef __USE_W32API + +#define CONTEXT_CONTROL (CONTEXT_i386 | 1) +#define CONTEXT_INTEGER (CONTEXT_i386 | 2) +#define CONTEXT_SEGMENTS (CONTEXT_i386 | 4) +#define CONTEXT_FLOATING_POINT (CONTEXT_i386 | 8) +#define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386 | 0x10) +#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS) + +#endif /* !__USE_W32API */ + +/* our own invention */ +#define FLAG_TRACE_BIT 0x100 +#define CONTEXT_DEBUGGER (CONTEXT_FULL | CONTEXT_FLOATING_POINT) + +#endif + +typedef struct _CONTEXT_X86 { + DWORD ContextFlags; + + DWORD Dr0; + DWORD Dr1; + DWORD Dr2; + DWORD Dr3; + DWORD Dr6; + DWORD Dr7; + + FLOATING_SAVE_AREA FloatSave; + + DWORD SegGs; + DWORD SegFs; + DWORD SegEs; + DWORD SegDs; + + DWORD Edi; + DWORD Esi; + DWORD Ebx; + DWORD Edx; + DWORD Ecx; + DWORD Eax; + + DWORD Ebp; + DWORD Eip; + DWORD SegCs; + DWORD EFlags; + DWORD Esp; + DWORD SegSs; +} CONTEXT_X86, *PCONTEXT_X86, *LPCONTEXT_X86; + +typedef struct _CONTEXT_PPC + { + /* Floating point registers returned when CONTEXT_FLOATING_POINT is set */ + double Fpr0; + double Fpr1; + double Fpr2; + double Fpr3; + double Fpr4; + double Fpr5; + double Fpr6; + double Fpr7; + double Fpr8; + double Fpr9; + double Fpr10; + double Fpr11; + double Fpr12; + double Fpr13; + double Fpr14; + double Fpr15; + double Fpr16; + double Fpr17; + double Fpr18; + double Fpr19; + double Fpr20; + double Fpr21; + double Fpr22; + double Fpr23; + double Fpr24; + double Fpr25; + double Fpr26; + double Fpr27; + double Fpr28; + double Fpr29; + double Fpr30; + double Fpr31; + double Fpscr; + + /* Integer registers returned when CONTEXT_INTEGER is set. */ + DWORD Gpr0; + DWORD Gpr1; + DWORD Gpr2; + DWORD Gpr3; + DWORD Gpr4; + DWORD Gpr5; + DWORD Gpr6; + DWORD Gpr7; + DWORD Gpr8; + DWORD Gpr9; + DWORD Gpr10; + DWORD Gpr11; + DWORD Gpr12; + DWORD Gpr13; + DWORD Gpr14; + DWORD Gpr15; + DWORD Gpr16; + DWORD Gpr17; + DWORD Gpr18; + DWORD Gpr19; + DWORD Gpr20; + DWORD Gpr21; + DWORD Gpr22; + DWORD Gpr23; + DWORD Gpr24; + DWORD Gpr25; + DWORD Gpr26; + DWORD Gpr27; + DWORD Gpr28; + DWORD Gpr29; + DWORD Gpr30; + DWORD Gpr31; + + DWORD Cr; /* Condition register */ + DWORD Xer; /* Fixed point exception register */ + + /* The following are set when CONTEXT_CONTROL is set. */ + DWORD Msr; /* Machine status register */ + DWORD Iar; /* Instruction address register */ + DWORD Lr; /* Link register */ + DWORD Ctr; /* Control register */ + + /* Control which context values are returned */ + DWORD ContextFlags; + DWORD Fill[3]; + + /* Registers returned if CONTEXT_DEBUG_REGISTERS is set. */ + DWORD Dr0; /* Breakpoint Register 1 */ + DWORD Dr1; /* Breakpoint Register 2 */ + DWORD Dr2; /* Breakpoint Register 3 */ + DWORD Dr3; /* Breakpoint Register 4 */ + DWORD Dr4; /* Breakpoint Register 5 */ + DWORD Dr5; /* Breakpoint Register 6 */ + DWORD Dr6; /* Debug Status Register */ + DWORD Dr7; /* Debug Control Register */ +} CONTEXT_PPC, *PCONTEXT_PPC, *LPCONTEXT_PPC; + +typedef struct value_ent { + LPWSTR ve_valuename; + DWORD ve_valuelen; + DWORD ve_valueptr; + DWORD ve_type; +} WVALENT, *PWVALENT; + +//#include "except.h" + +#ifndef __USE_W32API + +typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE; + +#ifdef __i386__ + +typedef CONTEXT_X86 CONTEXT; +typedef PCONTEXT_X86 PCONTEXT; +typedef LPCONTEXT_X86 LPCONTEXT; + +#else /* __ppc__ */ + +typedef CONTEXT_PPC CONTEXT; +typedef PCONTEXT_PPC PCONTEXT; +typedef LPCONTEXT_PPC LPCONTEXT; + +#endif + +typedef WORD ATOM; + +typedef struct _COORD { + SHORT X; + SHORT Y; +} COORD; + +typedef struct _SMALL_RECT { + SHORT Left; + SHORT Top; + SHORT Right; + SHORT Bottom; +} SMALL_RECT, *PSMALL_RECT; + + +typedef VOID STDCALL +(*PTIMERAPCROUTINE)( + LPVOID lpArgToCompletionRoutine, + DWORD dwTimerLowValue, + DWORD dwTimerHighValue + ); + +#include "except.h" + +#else /* __USE_W32API */ + +typedef LPTHREAD_START_ROUTINE PTHREAD_START_ROUTINE; + +#include + +#endif /* __USE_W32API */ + +#endif /* __INCLUDE_TYPES_H */ diff --git a/reactos/include/pe.h b/reactos/include/pe.h index 0905542301d..344fea10187 100644 --- a/reactos/include/pe.h +++ b/reactos/include/pe.h @@ -3,33 +3,21 @@ #define _ANONYMOUS_UNION __extension__ #define _ANONYMOUS_STRUCT __extension__ -#define NTAPI -#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S)) +#ifndef NTAPI +#define NTAPI STDCALL +#endif -#define IMAGE_SECTION_CHAR_CODE 0x00000020 -#define IMAGE_SECTION_CHAR_DATA 0x00000040 -#define IMAGE_SECTION_CHAR_BSS 0x00000080 -#define IMAGE_SECTION_CHAR_NON_CACHABLE 0x04000000 -#define IMAGE_SECTION_CHAR_NON_PAGEABLE 0x08000000 -#define IMAGE_SECTION_CHAR_SHARED 0x10000000 -#define IMAGE_SECTION_CHAR_EXECUTABLE 0x20000000 -#define IMAGE_SECTION_CHAR_READABLE 0x40000000 -#define IMAGE_SECTION_CHAR_WRITABLE 0x80000000 -#define IMAGE_SECTION_NOLOAD 0x00000002 +#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 +#define IMAGE_SIZEOF_SHORT_NAME 8 +#define IMAGE_SIZEOF_SYMBOL 18 -#define IMAGE_DOS_MAGIC 0x5a4d -#define IMAGE_PE_MAGIC 0x00004550 +#ifndef __USE_W32API #define IMAGE_DOS_SIGNATURE 0x5a4d #define IMAGE_OS2_SIGNATURE 0x454e - #define IMAGE_OS2_SIGNATURE_LE 0x454c #define IMAGE_VXD_SIGNATURE 0x454c -#define IMAGE_NT_SIGNATURE 0x00004550 - - -#define IMAGE_SIZEOF_FILE_HEADER 20 #define IMAGE_FILE_RELOCS_STRIPPED 0x0001 // Relocation info stripped from file. #define IMAGE_FILE_EXECUTABLE_IMAGE 0x0002 // File is executable (i.e. no unresolved externel references). @@ -53,250 +41,6 @@ #define IMAGE_FILE_MACHINE_ALPHA 0x184 // Alpha_AXP #define IMAGE_FILE_MACHINE_POWERPC 0x1F0 // IBM PowerPC Little-Endian - -#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 - - -#define IMAGE_SUBSYSTEM_UNKNOWN 0 -#define IMAGE_SUBSYSTEM_NATIVE 1 -#define IMAGE_SUBSYSTEM_WINDOWS_GUI 2 -#define IMAGE_SUBSYSTEM_WINDOWS_CUI 3 -#define IMAGE_SUBSYSTEM_OS2_GUI 4 -#define IMAGE_SUBSYSTEM_OS2_CUI 5 -#define IMAGE_SUBSYSTEM_POSIX_GUI 6 -#define IMAGE_SUBSYSTEM_POSIX_CUI 7 -#define IMAGE_SUBSYSTEM_WINDOWS_CE_GUI 9 - - - -// Directory Entries - -#define IMAGE_DIRECTORY_ENTRY_EXPORT 0 // Export Directory -#define IMAGE_DIRECTORY_ENTRY_IMPORT 1 // Import Directory -#define IMAGE_DIRECTORY_ENTRY_RESOURCE 2 // Resource Directory -#define IMAGE_DIRECTORY_ENTRY_EXCEPTION 3 // Exception Directory -#define IMAGE_DIRECTORY_ENTRY_SECURITY 4 // Security Directory -#define IMAGE_DIRECTORY_ENTRY_BASERELOC 5 // Base Relocation Table -#define IMAGE_DIRECTORY_ENTRY_DEBUG 6 // Debug Directory -#define IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7 // Description String -#define IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8 // Machine Value (MIPS GP) -#define IMAGE_DIRECTORY_ENTRY_TLS 9 // TLS Directory -#define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10 // Load Configuration Directory -#define IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT 11 // Bound Import Directory in headers -#define IMAGE_DIRECTORY_ENTRY_IAT 12 // Import Address -// -// Section header format. -// -#define IMAGE_SIZEOF_FILE_HEADER 20 -#define IMAGE_FILE_MACHINE_UNKNOWN 0 -#define IMAGE_NT_SIGNATURE 0x00004550 -#define IMAGE_NT_OPTIONAL_HDR_MAGIC 0x10b -#define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107 -#define IMAGE_SEPARATE_DEBUG_SIGNATURE 0x4944 -#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 -#define IMAGE_SIZEOF_ROM_OPTIONAL_HEADER 56 -#define IMAGE_SIZEOF_STD_OPTIONAL_HEADER 28 -#define IMAGE_SIZEOF_NT_OPTIONAL_HEADER 224 -#define IMAGE_SIZEOF_SHORT_NAME 8 -#define IMAGE_SIZEOF_SECTION_HEADER 40 -#define IMAGE_SIZEOF_SYMBOL 18 -#define IMAGE_SIZEOF_AUX_SYMBOL 18 -#define IMAGE_SIZEOF_RELOCATION 10 -#define IMAGE_SIZEOF_BASE_RELOCATION 8 -#define IMAGE_SIZEOF_LINENUMBER 6 -#define IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60 -#define SIZEOF_RFPO_DATA 16 -#define IMAGE_FIRST_SECTION(h) ((PIMAGE_SECTION_HEADER) ((DWORD)h+FIELD_OFFSET(IMAGE_NT_HEADERS,OptionalHeader)+((PIMAGE_NT_HEADERS)(h))->FileHeader.SizeOfOptionalHeader)) -#define IMAGE_SCN_TYPE_NO_PAD 8 -#define IMAGE_SCN_CNT_CODE 32 -#define IMAGE_SCN_CNT_INITIALIZED_DATA 64 -#define IMAGE_SCN_CNT_UNINITIALIZED_DATA 128 -#define IMAGE_SCN_LNK_OTHER 256 -#define IMAGE_SCN_LNK_INFO 512 -#define IMAGE_SCN_LNK_REMOVE 2048 -#define IMAGE_SCN_LNK_COMDAT 4096 -#define IMAGE_SCN_MEM_FARDATA 0x8000 -#define IMAGE_SCN_MEM_PURGEABLE 0x20000 -#define IMAGE_SCN_MEM_16BIT 0x20000 -#define IMAGE_SCN_MEM_LOCKED 0x40000 -#define IMAGE_SCN_MEM_PRELOAD 0x80000 -#define IMAGE_SCN_ALIGN_1BYTES 0x100000 -#define IMAGE_SCN_ALIGN_2BYTES 0x200000 -#define IMAGE_SCN_ALIGN_4BYTES 0x300000 -#define IMAGE_SCN_ALIGN_8BYTES 0x400000 -#define IMAGE_SCN_ALIGN_16BYTES 0x500000 -#define IMAGE_SCN_ALIGN_32BYTES 0x600000 -#define IMAGE_SCN_ALIGN_64BYTES 0x700000 -#define IMAGE_SCN_LNK_NRELOC_OVFL 0x1000000 -#define IMAGE_SCN_MEM_DISCARDABLE 0x2000000 -#define IMAGE_SCN_MEM_NOT_CACHED 0x4000000 -#define IMAGE_SCN_MEM_NOT_PAGED 0x8000000 -#define IMAGE_SCN_MEM_SHARED 0x10000000 -#define IMAGE_SCN_MEM_EXECUTE 0x20000000 -#define IMAGE_SCN_MEM_READ 0x40000000 -#define IMAGE_SCN_MEM_WRITE 0x80000000 -#define IMAGE_SYM_UNDEFINED 0 -#define IMAGE_SYM_ABSOLUTE (-1) -#define IMAGE_SYM_DEBUG (-2) -#define IMAGE_SYM_TYPE_NULL 0 -#define IMAGE_SYM_TYPE_VOID 1 -#define IMAGE_SYM_TYPE_CHAR 2 -#define IMAGE_SYM_TYPE_SHORT 3 -#define IMAGE_SYM_TYPE_INT 4 -#define IMAGE_SYM_TYPE_LONG 5 -#define IMAGE_SYM_TYPE_FLOAT 6 -#define IMAGE_SYM_TYPE_DOUBLE 7 -#define IMAGE_SYM_TYPE_STRUCT 8 -#define IMAGE_SYM_TYPE_UNION 9 -#define IMAGE_SYM_TYPE_ENUM 10 -#define IMAGE_SYM_TYPE_MOE 11 -#define IMAGE_SYM_TYPE_BYTE 12 -#define IMAGE_SYM_TYPE_WORD 13 -#define IMAGE_SYM_TYPE_UINT 14 -#define IMAGE_SYM_TYPE_DWORD 15 -#define IMAGE_SYM_TYPE_PCODE 32768 -#define IMAGE_SYM_DTYPE_NULL 0 -#define IMAGE_SYM_DTYPE_POINTER 1 -#define IMAGE_SYM_DTYPE_FUNCTION 2 -#define IMAGE_SYM_DTYPE_ARRAY 3 -#define IMAGE_SYM_CLASS_END_OF_FUNCTION (-1) -#define IMAGE_SYM_CLASS_NULL 0 -#define IMAGE_SYM_CLASS_AUTOMATIC 1 -#define IMAGE_SYM_CLASS_EXTERNAL 2 -#define IMAGE_SYM_CLASS_STATIC 3 -#define IMAGE_SYM_CLASS_REGISTER 4 -#define IMAGE_SYM_CLASS_EXTERNAL_DEF 5 -#define IMAGE_SYM_CLASS_LABEL 6 -#define IMAGE_SYM_CLASS_UNDEFINED_LABEL 7 -#define IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 8 -#define IMAGE_SYM_CLASS_ARGUMENT 9 -#define IMAGE_SYM_CLASS_STRUCT_TAG 10 -#define IMAGE_SYM_CLASS_MEMBER_OF_UNION 11 -#define IMAGE_SYM_CLASS_UNION_TAG 12 -#define IMAGE_SYM_CLASS_TYPE_DEFINITION 13 -#define IMAGE_SYM_CLASS_UNDEFINED_STATIC 14 -#define IMAGE_SYM_CLASS_ENUM_TAG 15 -#define IMAGE_SYM_CLASS_MEMBER_OF_ENUM 16 -#define IMAGE_SYM_CLASS_REGISTER_PARAM 17 -#define IMAGE_SYM_CLASS_BIT_FIELD 18 -#define IMAGE_SYM_CLASS_FAR_EXTERNAL 68 -#define IMAGE_SYM_CLASS_BLOCK 100 -#define IMAGE_SYM_CLASS_FUNCTION 101 -#define IMAGE_SYM_CLASS_END_OF_STRUCT 102 -#define IMAGE_SYM_CLASS_FILE 103 -#define IMAGE_SYM_CLASS_SECTION 104 -#define IMAGE_SYM_CLASS_WEAK_EXTERNAL 105 -#define IMAGE_COMDAT_SELECT_NODUPLICATES 1 -#define IMAGE_COMDAT_SELECT_ANY 2 -#define IMAGE_COMDAT_SELECT_SAME_SIZE 3 -#define IMAGE_COMDAT_SELECT_EXACT_MATCH 4 -#define IMAGE_COMDAT_SELECT_ASSOCIATIVE 5 -#define IMAGE_COMDAT_SELECT_LARGEST 6 -#define IMAGE_COMDAT_SELECT_NEWEST 7 -#define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1 -#define IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2 -#define IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3 -#define IMAGE_REL_I386_ABSOLUTE 0 -#define IMAGE_REL_I386_DIR16 1 -#define IMAGE_REL_I386_REL16 2 -#define IMAGE_REL_I386_DIR32 6 -#define IMAGE_REL_I386_DIR32NB 7 -#define IMAGE_REL_I386_SEG12 9 -#define IMAGE_REL_I386_SECTION 10 -#define IMAGE_REL_I386_SECREL 11 -#define IMAGE_REL_I386_REL32 20 -#define IMAGE_REL_MIPS_ABSOLUTE 0 -#define IMAGE_REL_MIPS_REFHALF 1 -#define IMAGE_REL_MIPS_REFWORD 2 -#define IMAGE_REL_MIPS_JMPADDR 3 -#define IMAGE_REL_MIPS_REFHI 4 -#define IMAGE_REL_MIPS_REFLO 5 -#define IMAGE_REL_MIPS_GPREL 6 -#define IMAGE_REL_MIPS_LITERAL 7 -#define IMAGE_REL_MIPS_SECTION 10 -#define IMAGE_REL_MIPS_SECREL 11 -#define IMAGE_REL_MIPS_SECRELLO 12 -#define IMAGE_REL_MIPS_SECRELHI 13 -#define IMAGE_REL_MIPS_REFWORDNB 34 -#define IMAGE_REL_MIPS_PAIR 35 -#define IMAGE_REL_ALPHA_ABSOLUTE 0 -#define IMAGE_REL_ALPHA_REFLONG 1 -#define IMAGE_REL_ALPHA_REFQUAD 2 -#define IMAGE_REL_ALPHA_GPREL32 3 -#define IMAGE_REL_ALPHA_LITERAL 4 -#define IMAGE_REL_ALPHA_LITUSE 5 -#define IMAGE_REL_ALPHA_GPDISP 6 -#define IMAGE_REL_ALPHA_BRADDR 7 -#define IMAGE_REL_ALPHA_HINT 8 -#define IMAGE_REL_ALPHA_INLINE_REFLONG 9 -#define IMAGE_REL_ALPHA_REFHI 10 -#define IMAGE_REL_ALPHA_REFLO 11 -#define IMAGE_REL_ALPHA_PAIR 12 -#define IMAGE_REL_ALPHA_MATCH 13 -#define IMAGE_REL_ALPHA_SECTION 14 -#define IMAGE_REL_ALPHA_SECREL 15 -#define IMAGE_REL_ALPHA_REFLONGNB 16 -#define IMAGE_REL_ALPHA_SECRELLO 17 -#define IMAGE_REL_ALPHA_SECRELHI 18 -#define IMAGE_REL_PPC_ABSOLUTE 0 -#define IMAGE_REL_PPC_ADDR64 1 -#define IMAGE_REL_PPC_ADDR32 2 -#define IMAGE_REL_PPC_ADDR24 3 -#define IMAGE_REL_PPC_ADDR16 4 -#define IMAGE_REL_PPC_ADDR14 5 -#define IMAGE_REL_PPC_REL24 6 -#define IMAGE_REL_PPC_REL14 7 -#define IMAGE_REL_PPC_TOCREL16 8 -#define IMAGE_REL_PPC_TOCREL14 9 -#define IMAGE_REL_PPC_ADDR32NB 10 -#define IMAGE_REL_PPC_SECREL 11 -#define IMAGE_REL_PPC_SECTION 12 -#define IMAGE_REL_PPC_IFGLUE 13 -#define IMAGE_REL_PPC_IMGLUE 14 -#define IMAGE_REL_PPC_SECREL16 15 -#define IMAGE_REL_PPC_REFHI 16 -#define IMAGE_REL_PPC_REFLO 17 -#define IMAGE_REL_PPC_PAIR 18 -#define IMAGE_REL_PPC_TYPEMASK 255 -#define IMAGE_REL_PPC_NEG 256 -#define IMAGE_REL_PPC_BRTAKEN 512 -#define IMAGE_REL_PPC_BRNTAKEN 1024 -#define IMAGE_REL_PPC_TOCDEFN 2048 -#define IMAGE_REL_BASED_ABSOLUTE 0 -#define IMAGE_REL_BASED_HIGH 1 -#define IMAGE_REL_BASED_LOW 2 -#define IMAGE_REL_BASED_HIGHLOW 3 -#define IMAGE_REL_BASED_HIGHADJ 4 -#define IMAGE_REL_BASED_MIPS_JMPADDR 5 -#define IMAGE_ARCHIVE_START_SIZE 8 -#define IMAGE_ARCHIVE_START "!\n" -#define IMAGE_ARCHIVE_END "`\n" -#define IMAGE_ARCHIVE_PAD "\n" -#define IMAGE_ARCHIVE_LINKER_MEMBER "/ " -#define IMAGE_ARCHIVE_LONGNAMES_MEMBER "// " -#define IMAGE_ORDINAL_FLAG 0x80000000 -#define IMAGE_SNAP_BY_ORDINAL(o) ((o&IMAGE_ORDINAL_FLAG)!=0) -#define IMAGE_RESOURCE_NAME_IS_STRING 0x80000000 -#define IMAGE_RESOURCE_DATA_IS_DIRECTORY 0x80000000 -#define IMAGE_DEBUG_TYPE_UNKNOWN 0 -#define IMAGE_DEBUG_TYPE_COFF 1 -#define IMAGE_DEBUG_TYPE_CODEVIEW 2 -#define IMAGE_DEBUG_TYPE_FPO 3 -#define IMAGE_DEBUG_TYPE_MISC 4 -#define IMAGE_DEBUG_TYPE_EXCEPTION 5 -#define IMAGE_DEBUG_TYPE_FIXUP 6 -#define IMAGE_DEBUG_TYPE_OMAP_TO_SRC 7 -#define IMAGE_DEBUG_TYPE_OMAP_FROM_SRC 8 - - -#define IMAGE_SIZEOF_SHORT_NAME 8 - -#define IMAGE_SIZEOF_SECTION_HEADER 40 - -#define IMAGE_SECTION_CODE (0x20) -#define IMAGE_SECTION_INITIALIZED_DATA (0x40) -#define IMAGE_SECTION_UNINITIALIZED_DATA (0x80) - #pragma pack(push,4) typedef struct _IMAGE_FILE_HEADER { WORD Machine; @@ -701,12 +445,305 @@ typedef struct _IMAGE_SEPARATE_DEBUG_HEADER { } IMAGE_SEPARATE_DEBUG_HEADER,*PIMAGE_SEPARATE_DEBUG_HEADER; #pragma pack(pop) +#define IMAGE_ORDINAL(Ordinal) (Ordinal & 0xffff) + +// +// Each directory contains the 32-bit Name of the entry and an offset, +// relative to the beginning of the resource directory of the data associated +// with this directory entry. If the name of the entry is an actual text +// string instead of an integer Id, then the high order bit of the name field +// is set to one and the low order 31-bits are an offset, relative to the +// beginning of the resource directory of the string, which is of type +// IMAGE_RESOURCE_DIRECTORY_STRING. Otherwise the high bit is clear and the +// low-order 16-bits are the integer Id that identify this resource directory +// entry. If the directory entry is yet another resource directory (i.e. a +// subdirectory), then the high order bit of the offset field will be +// set to indicate this. Otherwise the high bit is clear and the offset +// field points to a resource data entry. +// +typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY { + DWORD Name; + DWORD OffsetToData; +} IMAGE_RESOURCE_DIRECTORY_ENTRY, *PIMAGE_RESOURCE_DIRECTORY_ENTRY; +/* +typedef struct _IMAGE_RESOURCE_DIRECTORY { + DWORD Characteristics; + DWORD TimeDateStamp; + WORD MajorVersion; + WORD MinorVersion; + WORD NumberOfNamedEntries; + WORD NumberOfIdEntries; + IMAGE_RESOURCE_DIRECTORY_ENTRY DirectoryEntries[0]; +} IMAGE_RESOURCE_DIRECTORY, *PIMAGE_RESOURCE_DIRECTORY; +*/ + +#endif /* !__USE_W32API */ + +#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S)) + +#define IMAGE_SECTION_CHAR_CODE 0x00000020 +#define IMAGE_SECTION_CHAR_DATA 0x00000040 +#define IMAGE_SECTION_CHAR_BSS 0x00000080 +#define IMAGE_SECTION_CHAR_NON_CACHABLE 0x04000000 +#define IMAGE_SECTION_CHAR_NON_PAGEABLE 0x08000000 +#define IMAGE_SECTION_CHAR_SHARED 0x10000000 +#define IMAGE_SECTION_CHAR_EXECUTABLE 0x20000000 +#define IMAGE_SECTION_CHAR_READABLE 0x40000000 +#define IMAGE_SECTION_CHAR_WRITABLE 0x80000000 +#define IMAGE_SECTION_NOLOAD 0x00000002 + +#define IMAGE_DOS_MAGIC 0x5a4d +#define IMAGE_PE_MAGIC 0x00004550 + +#define IMAGE_NT_SIGNATURE 0x00004550 + + +#define IMAGE_SIZEOF_FILE_HEADER 20 + + +#define IMAGE_SUBSYSTEM_UNKNOWN 0 +#define IMAGE_SUBSYSTEM_NATIVE 1 +#define IMAGE_SUBSYSTEM_WINDOWS_GUI 2 +#define IMAGE_SUBSYSTEM_WINDOWS_CUI 3 +#define IMAGE_SUBSYSTEM_OS2_GUI 4 +#define IMAGE_SUBSYSTEM_OS2_CUI 5 +#define IMAGE_SUBSYSTEM_POSIX_GUI 6 +#define IMAGE_SUBSYSTEM_POSIX_CUI 7 +#define IMAGE_SUBSYSTEM_WINDOWS_CE_GUI 9 + + + +// Directory Entries + +#define IMAGE_DIRECTORY_ENTRY_EXPORT 0 // Export Directory +#define IMAGE_DIRECTORY_ENTRY_IMPORT 1 // Import Directory +#define IMAGE_DIRECTORY_ENTRY_RESOURCE 2 // Resource Directory +#define IMAGE_DIRECTORY_ENTRY_EXCEPTION 3 // Exception Directory +#define IMAGE_DIRECTORY_ENTRY_SECURITY 4 // Security Directory +#define IMAGE_DIRECTORY_ENTRY_BASERELOC 5 // Base Relocation Table +#define IMAGE_DIRECTORY_ENTRY_DEBUG 6 // Debug Directory +#define IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7 // Description String +#define IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8 // Machine Value (MIPS GP) +#define IMAGE_DIRECTORY_ENTRY_TLS 9 // TLS Directory +#define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10 // Load Configuration Directory +#define IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT 11 // Bound Import Directory in headers +#define IMAGE_DIRECTORY_ENTRY_IAT 12 // Import Address +// +// Section header format. +// +#define IMAGE_SIZEOF_FILE_HEADER 20 +#define IMAGE_FILE_MACHINE_UNKNOWN 0 +#define IMAGE_NT_SIGNATURE 0x00004550 +#define IMAGE_NT_OPTIONAL_HDR_MAGIC 0x10b +#define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107 +#define IMAGE_SEPARATE_DEBUG_SIGNATURE 0x4944 +#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 +#define IMAGE_SIZEOF_ROM_OPTIONAL_HEADER 56 +#define IMAGE_SIZEOF_STD_OPTIONAL_HEADER 28 +#define IMAGE_SIZEOF_NT_OPTIONAL_HEADER 224 +#define IMAGE_SIZEOF_SECTION_HEADER 40 +#define IMAGE_SIZEOF_AUX_SYMBOL 18 +#define IMAGE_SIZEOF_RELOCATION 10 +#define IMAGE_SIZEOF_BASE_RELOCATION 8 +#define IMAGE_SIZEOF_LINENUMBER 6 +#define IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60 +#define SIZEOF_RFPO_DATA 16 +#define IMAGE_FIRST_SECTION(h) ((PIMAGE_SECTION_HEADER) ((DWORD)h+FIELD_OFFSET(IMAGE_NT_HEADERS,OptionalHeader)+((PIMAGE_NT_HEADERS)(h))->FileHeader.SizeOfOptionalHeader)) +#define IMAGE_SCN_TYPE_NO_PAD 8 +#define IMAGE_SCN_CNT_CODE 32 +#define IMAGE_SCN_CNT_INITIALIZED_DATA 64 +#define IMAGE_SCN_CNT_UNINITIALIZED_DATA 128 +#define IMAGE_SCN_LNK_OTHER 256 +#define IMAGE_SCN_LNK_INFO 512 +#define IMAGE_SCN_LNK_REMOVE 2048 +#define IMAGE_SCN_LNK_COMDAT 4096 +#define IMAGE_SCN_MEM_FARDATA 0x8000 +#define IMAGE_SCN_MEM_PURGEABLE 0x20000 +#define IMAGE_SCN_MEM_16BIT 0x20000 +#define IMAGE_SCN_MEM_LOCKED 0x40000 +#define IMAGE_SCN_MEM_PRELOAD 0x80000 +#define IMAGE_SCN_ALIGN_1BYTES 0x100000 +#define IMAGE_SCN_ALIGN_2BYTES 0x200000 +#define IMAGE_SCN_ALIGN_4BYTES 0x300000 +#define IMAGE_SCN_ALIGN_8BYTES 0x400000 +#define IMAGE_SCN_ALIGN_16BYTES 0x500000 +#define IMAGE_SCN_ALIGN_32BYTES 0x600000 +#define IMAGE_SCN_ALIGN_64BYTES 0x700000 +#define IMAGE_SCN_LNK_NRELOC_OVFL 0x1000000 +#define IMAGE_SCN_MEM_DISCARDABLE 0x2000000 +#define IMAGE_SCN_MEM_NOT_CACHED 0x4000000 +#define IMAGE_SCN_MEM_NOT_PAGED 0x8000000 +#define IMAGE_SCN_MEM_SHARED 0x10000000 +#define IMAGE_SCN_MEM_EXECUTE 0x20000000 +#define IMAGE_SCN_MEM_READ 0x40000000 +#define IMAGE_SCN_MEM_WRITE 0x80000000 +#define IMAGE_SYM_UNDEFINED 0 +#define IMAGE_SYM_ABSOLUTE (-1) +#define IMAGE_SYM_DEBUG (-2) +#define IMAGE_SYM_TYPE_NULL 0 +#define IMAGE_SYM_TYPE_VOID 1 +#define IMAGE_SYM_TYPE_CHAR 2 +#define IMAGE_SYM_TYPE_SHORT 3 +#define IMAGE_SYM_TYPE_INT 4 +#define IMAGE_SYM_TYPE_LONG 5 +#define IMAGE_SYM_TYPE_FLOAT 6 +#define IMAGE_SYM_TYPE_DOUBLE 7 +#define IMAGE_SYM_TYPE_STRUCT 8 +#define IMAGE_SYM_TYPE_UNION 9 +#define IMAGE_SYM_TYPE_ENUM 10 +#define IMAGE_SYM_TYPE_MOE 11 +#define IMAGE_SYM_TYPE_BYTE 12 +#define IMAGE_SYM_TYPE_WORD 13 +#define IMAGE_SYM_TYPE_UINT 14 +#define IMAGE_SYM_TYPE_DWORD 15 +#define IMAGE_SYM_TYPE_PCODE 32768 +#define IMAGE_SYM_DTYPE_NULL 0 +#define IMAGE_SYM_DTYPE_POINTER 1 +#define IMAGE_SYM_DTYPE_FUNCTION 2 +#define IMAGE_SYM_DTYPE_ARRAY 3 +#define IMAGE_SYM_CLASS_END_OF_FUNCTION (-1) +#define IMAGE_SYM_CLASS_NULL 0 +#define IMAGE_SYM_CLASS_AUTOMATIC 1 +#define IMAGE_SYM_CLASS_EXTERNAL 2 +#define IMAGE_SYM_CLASS_STATIC 3 +#define IMAGE_SYM_CLASS_REGISTER 4 +#define IMAGE_SYM_CLASS_EXTERNAL_DEF 5 +#define IMAGE_SYM_CLASS_LABEL 6 +#define IMAGE_SYM_CLASS_UNDEFINED_LABEL 7 +#define IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 8 +#define IMAGE_SYM_CLASS_ARGUMENT 9 +#define IMAGE_SYM_CLASS_STRUCT_TAG 10 +#define IMAGE_SYM_CLASS_MEMBER_OF_UNION 11 +#define IMAGE_SYM_CLASS_UNION_TAG 12 +#define IMAGE_SYM_CLASS_TYPE_DEFINITION 13 +#define IMAGE_SYM_CLASS_UNDEFINED_STATIC 14 +#define IMAGE_SYM_CLASS_ENUM_TAG 15 +#define IMAGE_SYM_CLASS_MEMBER_OF_ENUM 16 +#define IMAGE_SYM_CLASS_REGISTER_PARAM 17 +#define IMAGE_SYM_CLASS_BIT_FIELD 18 +#define IMAGE_SYM_CLASS_FAR_EXTERNAL 68 +#define IMAGE_SYM_CLASS_BLOCK 100 +#define IMAGE_SYM_CLASS_FUNCTION 101 +#define IMAGE_SYM_CLASS_END_OF_STRUCT 102 +#define IMAGE_SYM_CLASS_FILE 103 +#define IMAGE_SYM_CLASS_SECTION 104 +#define IMAGE_SYM_CLASS_WEAK_EXTERNAL 105 +#define IMAGE_COMDAT_SELECT_NODUPLICATES 1 +#define IMAGE_COMDAT_SELECT_ANY 2 +#define IMAGE_COMDAT_SELECT_SAME_SIZE 3 +#define IMAGE_COMDAT_SELECT_EXACT_MATCH 4 +#define IMAGE_COMDAT_SELECT_ASSOCIATIVE 5 +#define IMAGE_COMDAT_SELECT_LARGEST 6 +#define IMAGE_COMDAT_SELECT_NEWEST 7 +#define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1 +#define IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2 +#define IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3 +#define IMAGE_REL_I386_ABSOLUTE 0 +#define IMAGE_REL_I386_DIR16 1 +#define IMAGE_REL_I386_REL16 2 +#define IMAGE_REL_I386_DIR32 6 +#define IMAGE_REL_I386_DIR32NB 7 +#define IMAGE_REL_I386_SEG12 9 +#define IMAGE_REL_I386_SECTION 10 +#define IMAGE_REL_I386_SECREL 11 +#define IMAGE_REL_I386_REL32 20 +#define IMAGE_REL_MIPS_ABSOLUTE 0 +#define IMAGE_REL_MIPS_REFHALF 1 +#define IMAGE_REL_MIPS_REFWORD 2 +#define IMAGE_REL_MIPS_JMPADDR 3 +#define IMAGE_REL_MIPS_REFHI 4 +#define IMAGE_REL_MIPS_REFLO 5 +#define IMAGE_REL_MIPS_GPREL 6 +#define IMAGE_REL_MIPS_LITERAL 7 +#define IMAGE_REL_MIPS_SECTION 10 +#define IMAGE_REL_MIPS_SECREL 11 +#define IMAGE_REL_MIPS_SECRELLO 12 +#define IMAGE_REL_MIPS_SECRELHI 13 +#define IMAGE_REL_MIPS_REFWORDNB 34 +#define IMAGE_REL_MIPS_PAIR 35 +#define IMAGE_REL_ALPHA_ABSOLUTE 0 +#define IMAGE_REL_ALPHA_REFLONG 1 +#define IMAGE_REL_ALPHA_REFQUAD 2 +#define IMAGE_REL_ALPHA_GPREL32 3 +#define IMAGE_REL_ALPHA_LITERAL 4 +#define IMAGE_REL_ALPHA_LITUSE 5 +#define IMAGE_REL_ALPHA_GPDISP 6 +#define IMAGE_REL_ALPHA_BRADDR 7 +#define IMAGE_REL_ALPHA_HINT 8 +#define IMAGE_REL_ALPHA_INLINE_REFLONG 9 +#define IMAGE_REL_ALPHA_REFHI 10 +#define IMAGE_REL_ALPHA_REFLO 11 +#define IMAGE_REL_ALPHA_PAIR 12 +#define IMAGE_REL_ALPHA_MATCH 13 +#define IMAGE_REL_ALPHA_SECTION 14 +#define IMAGE_REL_ALPHA_SECREL 15 +#define IMAGE_REL_ALPHA_REFLONGNB 16 +#define IMAGE_REL_ALPHA_SECRELLO 17 +#define IMAGE_REL_ALPHA_SECRELHI 18 +#define IMAGE_REL_PPC_ABSOLUTE 0 +#define IMAGE_REL_PPC_ADDR64 1 +#define IMAGE_REL_PPC_ADDR32 2 +#define IMAGE_REL_PPC_ADDR24 3 +#define IMAGE_REL_PPC_ADDR16 4 +#define IMAGE_REL_PPC_ADDR14 5 +#define IMAGE_REL_PPC_REL24 6 +#define IMAGE_REL_PPC_REL14 7 +#define IMAGE_REL_PPC_TOCREL16 8 +#define IMAGE_REL_PPC_TOCREL14 9 +#define IMAGE_REL_PPC_ADDR32NB 10 +#define IMAGE_REL_PPC_SECREL 11 +#define IMAGE_REL_PPC_SECTION 12 +#define IMAGE_REL_PPC_IFGLUE 13 +#define IMAGE_REL_PPC_IMGLUE 14 +#define IMAGE_REL_PPC_SECREL16 15 +#define IMAGE_REL_PPC_REFHI 16 +#define IMAGE_REL_PPC_REFLO 17 +#define IMAGE_REL_PPC_PAIR 18 +#define IMAGE_REL_PPC_TYPEMASK 255 +#define IMAGE_REL_PPC_NEG 256 +#define IMAGE_REL_PPC_BRTAKEN 512 +#define IMAGE_REL_PPC_BRNTAKEN 1024 +#define IMAGE_REL_PPC_TOCDEFN 2048 +#define IMAGE_REL_BASED_ABSOLUTE 0 +#define IMAGE_REL_BASED_HIGH 1 +#define IMAGE_REL_BASED_LOW 2 +#define IMAGE_REL_BASED_HIGHLOW 3 +#define IMAGE_REL_BASED_HIGHADJ 4 +#define IMAGE_REL_BASED_MIPS_JMPADDR 5 +#define IMAGE_ARCHIVE_START_SIZE 8 +#define IMAGE_ARCHIVE_START "!\n" +#define IMAGE_ARCHIVE_END "`\n" +#define IMAGE_ARCHIVE_PAD "\n" +#define IMAGE_ARCHIVE_LINKER_MEMBER "/ " +#define IMAGE_ARCHIVE_LONGNAMES_MEMBER "// " +#define IMAGE_ORDINAL_FLAG 0x80000000 +#define IMAGE_SNAP_BY_ORDINAL(o) ((o&IMAGE_ORDINAL_FLAG)!=0) +#define IMAGE_RESOURCE_NAME_IS_STRING 0x80000000 +#define IMAGE_RESOURCE_DATA_IS_DIRECTORY 0x80000000 +#define IMAGE_DEBUG_TYPE_UNKNOWN 0 +#define IMAGE_DEBUG_TYPE_COFF 1 +#define IMAGE_DEBUG_TYPE_CODEVIEW 2 +#define IMAGE_DEBUG_TYPE_FPO 3 +#define IMAGE_DEBUG_TYPE_MISC 4 +#define IMAGE_DEBUG_TYPE_EXCEPTION 5 +#define IMAGE_DEBUG_TYPE_FIXUP 6 +#define IMAGE_DEBUG_TYPE_OMAP_TO_SRC 7 +#define IMAGE_DEBUG_TYPE_OMAP_FROM_SRC 8 + + +#define IMAGE_SIZEOF_SHORT_NAME 8 + +#define IMAGE_SIZEOF_SECTION_HEADER 40 + +#define IMAGE_SECTION_CODE (0x20) +#define IMAGE_SECTION_INITIALIZED_DATA (0x40) +#define IMAGE_SECTION_UNINITIALIZED_DATA (0x80) + // // Import Format // #define IMAGE_ORDINAL_FLAG 0x80000000 -#define IMAGE_ORDINAL(Ordinal) (Ordinal & 0xffff) // Predefined resource types ... there may be some more, but I don't have @@ -738,35 +775,6 @@ typedef struct _IMAGE_SEPARATE_DEBUG_HEADER { // -// -// Each directory contains the 32-bit Name of the entry and an offset, -// relative to the beginning of the resource directory of the data associated -// with this directory entry. If the name of the entry is an actual text -// string instead of an integer Id, then the high order bit of the name field -// is set to one and the low order 31-bits are an offset, relative to the -// beginning of the resource directory of the string, which is of type -// IMAGE_RESOURCE_DIRECTORY_STRING. Otherwise the high bit is clear and the -// low-order 16-bits are the integer Id that identify this resource directory -// entry. If the directory entry is yet another resource directory (i.e. a -// subdirectory), then the high order bit of the offset field will be -// set to indicate this. Otherwise the high bit is clear and the offset -// field points to a resource data entry. -// -typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY { - DWORD Name; - DWORD OffsetToData; -} IMAGE_RESOURCE_DIRECTORY_ENTRY, *PIMAGE_RESOURCE_DIRECTORY_ENTRY; -/* -typedef struct _IMAGE_RESOURCE_DIRECTORY { - DWORD Characteristics; - DWORD TimeDateStamp; - WORD MajorVersion; - WORD MinorVersion; - WORD NumberOfNamedEntries; - WORD NumberOfIdEntries; - IMAGE_RESOURCE_DIRECTORY_ENTRY DirectoryEntries[0]; -} IMAGE_RESOURCE_DIRECTORY, *PIMAGE_RESOURCE_DIRECTORY; -*/ #define IMAGE_RESOURCE_NAME_IS_STRING 0x80000000 #define IMAGE_RESOURCE_DATA_IS_DIRECTORY 0x80000000 diff --git a/reactos/include/unicode.h b/reactos/include/unicode.h index 2c9294150c7..e6567027a81 100644 --- a/reactos/include/unicode.h +++ b/reactos/include/unicode.h @@ -2251,7 +2251,7 @@ InitiateSystemShutdownW( WINBOOL STDCALL AbortSystemShutdownW( - LPWSTR lpMachineName + LPCWSTR lpMachineName ); LONG diff --git a/reactos/lib/advapi32/misc/shutdown.c b/reactos/lib/advapi32/misc/shutdown.c index b719584c70b..60795f7bf2e 100644 --- a/reactos/lib/advapi32/misc/shutdown.c +++ b/reactos/lib/advapi32/misc/shutdown.c @@ -1,193 +1,194 @@ -/* $Id: shutdown.c,v 1.5 2002/09/08 10:22:36 chorns Exp $ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries - * FILE: lib/advapi32/misc/shutdown.c - * PURPOSE: System shutdown functions - * PROGRAMMER: Emanuele Aliberti - * UPDATE HISTORY: - * 19990413 EA created - * 19990515 EA - */ - -#include -#include - -#define USZ {0,0,0} - -/********************************************************************** - * AbortSystemShutdownW - */ -BOOL -STDCALL -AbortSystemShutdownW( - LPWSTR lpMachineName - ) -{ - NTSTATUS Status; - - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - - -/********************************************************************** - * AbortSystemShutdownA - */ -BOOL -STDCALL -AbortSystemShutdownA( - LPSTR lpMachineName - ) -{ - ANSI_STRING MachineNameA; - UNICODE_STRING MachineNameW; - NTSTATUS Status; - BOOL rv; - - RtlInitAnsiString( - & MachineNameA, - lpMachineName - ); - Status = RtlAnsiStringToUnicodeString( - & MachineNameW, - & MachineNameA, - TRUE - ); - if (STATUS_SUCCESS != Status) - { - SetLastError(RtlNtStatusToDosError(Status)); - return FALSE; - } - rv = AbortSystemShutdownW( - MachineNameW.Buffer - ); - RtlFreeAnsiString( - & MachineNameA - ); - RtlFreeUnicodeString( - & MachineNameW - ); - SetLastError(ERROR_SUCCESS); - return rv; -} - - -/********************************************************************** - * InitiateSystemShutdownW - */ -BOOL -STDCALL -InitiateSystemShutdownW( - LPWSTR lpMachineName, - LPWSTR lpMessage, - DWORD dwTimeout, - BOOL bForceAppsClosed, - BOOL bRebootAfterShutdown - ) -{ - SHUTDOWN_ACTION Action = ShutdownNoReboot; - NTSTATUS Status; - - if (lpMachineName) - { - /* FIXME: remote machine shutdown not supported yet */ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; - } - if (dwTimeout) - { - } - Status = NtShutdownSystem(Action); - SetLastError(RtlNtStatusToDosError(Status)); - return FALSE; -} - - -/********************************************************************** - * InitiateSystemShutdownA - */ -BOOL -STDCALL -InitiateSystemShutdownA( - LPSTR lpMachineName, - LPSTR lpMessage, - DWORD dwTimeout, - BOOL bForceAppsClosed, - BOOL bRebootAfterShutdown - ) -{ - ANSI_STRING MachineNameA; - ANSI_STRING MessageA; - UNICODE_STRING MachineNameW; - UNICODE_STRING MessageW; - NTSTATUS Status; - INT LastError; - BOOL rv; - - if (lpMachineName) - { - RtlInitAnsiString( - & MachineNameA, - lpMachineName - ); - Status = RtlAnsiStringToUnicodeString( - & MachineNameW, - & MachineNameA, - TRUE - ); - if (STATUS_SUCCESS != Status) - { - RtlFreeAnsiString(&MachineNameA); - SetLastError(RtlNtStatusToDosError(Status)); - return FALSE; - } - } - if (lpMessage) - { - RtlInitAnsiString( - & MessageA, - lpMessage - ); - Status = RtlAnsiStringToUnicodeString( - & MessageW, - & MessageA, - TRUE - ); - if (STATUS_SUCCESS != Status) - { - if (MachineNameW.Length) - { - RtlFreeAnsiString(&MachineNameA); - RtlFreeUnicodeString(&MachineNameW); - } - RtlFreeAnsiString(&MessageA); - SetLastError(RtlNtStatusToDosError(Status)); - return FALSE; - } - } - rv = InitiateSystemShutdownW( - MachineNameW.Buffer, - MessageW.Buffer, - dwTimeout, - bForceAppsClosed, - bRebootAfterShutdown - ); - LastError = GetLastError(); - if (lpMachineName) - { - RtlFreeAnsiString(&MachineNameA); - RtlFreeUnicodeString(&MachineNameW); - } - if (lpMessage) - { - RtlFreeAnsiString(&MessageA); - RtlFreeUnicodeString(&MessageW); - } - SetLastError(LastError); - return rv; -} - - -/* EOF */ - +/* $Id: shutdown.c,v 1.6 2002/11/14 18:21:03 chorns Exp $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/advapi32/misc/shutdown.c + * PURPOSE: System shutdown functions + * PROGRAMMER: Emanuele Aliberti + * UPDATE HISTORY: + * 19990413 EA created + * 19990515 EA + */ + +#include +#define NTOS_MODE_USER +#include + +#define USZ {0,0,0} + +/********************************************************************** + * AbortSystemShutdownW + */ +WINBOOL +STDCALL +AbortSystemShutdownW( + LPCWSTR lpMachineName + ) +{ + NTSTATUS Status; + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + + +/********************************************************************** + * AbortSystemShutdownA + */ +BOOL +STDCALL +AbortSystemShutdownA( + LPCSTR lpMachineName + ) +{ + ANSI_STRING MachineNameA; + UNICODE_STRING MachineNameW; + NTSTATUS Status; + BOOL rv; + + RtlInitAnsiString( + & MachineNameA, + lpMachineName + ); + Status = RtlAnsiStringToUnicodeString( + & MachineNameW, + & MachineNameA, + TRUE + ); + if (STATUS_SUCCESS != Status) + { + SetLastError(RtlNtStatusToDosError(Status)); + return FALSE; + } + rv = AbortSystemShutdownW( + MachineNameW.Buffer + ); + RtlFreeAnsiString( + & MachineNameA + ); + RtlFreeUnicodeString( + & MachineNameW + ); + SetLastError(ERROR_SUCCESS); + return rv; +} + + +/********************************************************************** + * InitiateSystemShutdownW + */ +BOOL +STDCALL +InitiateSystemShutdownW( + LPWSTR lpMachineName, + LPWSTR lpMessage, + DWORD dwTimeout, + BOOL bForceAppsClosed, + BOOL bRebootAfterShutdown + ) +{ + SHUTDOWN_ACTION Action = ShutdownNoReboot; + NTSTATUS Status; + + if (lpMachineName) + { + /* FIXME: remote machine shutdown not supported yet */ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; + } + if (dwTimeout) + { + } + Status = NtShutdownSystem(Action); + SetLastError(RtlNtStatusToDosError(Status)); + return FALSE; +} + + +/********************************************************************** + * InitiateSystemShutdownA + */ +BOOL +STDCALL +InitiateSystemShutdownA( + LPSTR lpMachineName, + LPSTR lpMessage, + DWORD dwTimeout, + BOOL bForceAppsClosed, + BOOL bRebootAfterShutdown + ) +{ + ANSI_STRING MachineNameA; + ANSI_STRING MessageA; + UNICODE_STRING MachineNameW; + UNICODE_STRING MessageW; + NTSTATUS Status; + INT LastError; + BOOL rv; + + if (lpMachineName) + { + RtlInitAnsiString( + & MachineNameA, + lpMachineName + ); + Status = RtlAnsiStringToUnicodeString( + & MachineNameW, + & MachineNameA, + TRUE + ); + if (STATUS_SUCCESS != Status) + { + RtlFreeAnsiString(&MachineNameA); + SetLastError(RtlNtStatusToDosError(Status)); + return FALSE; + } + } + if (lpMessage) + { + RtlInitAnsiString( + & MessageA, + lpMessage + ); + Status = RtlAnsiStringToUnicodeString( + & MessageW, + & MessageA, + TRUE + ); + if (STATUS_SUCCESS != Status) + { + if (MachineNameW.Length) + { + RtlFreeAnsiString(&MachineNameA); + RtlFreeUnicodeString(&MachineNameW); + } + RtlFreeAnsiString(&MessageA); + SetLastError(RtlNtStatusToDosError(Status)); + return FALSE; + } + } + rv = InitiateSystemShutdownW( + MachineNameW.Buffer, + MessageW.Buffer, + dwTimeout, + bForceAppsClosed, + bRebootAfterShutdown + ); + LastError = GetLastError(); + if (lpMachineName) + { + RtlFreeAnsiString(&MachineNameA); + RtlFreeUnicodeString(&MachineNameW); + } + if (lpMessage) + { + RtlFreeAnsiString(&MessageA); + RtlFreeUnicodeString(&MessageW); + } + SetLastError(LastError); + return rv; +} + + +/* EOF */ + diff --git a/reactos/lib/advapi32/reg/reg.c b/reactos/lib/advapi32/reg/reg.c index 5b2c6853161..93553a95b02 100644 --- a/reactos/lib/advapi32/reg/reg.c +++ b/reactos/lib/advapi32/reg/reg.c @@ -1,4 +1,4 @@ -/* $Id: reg.c,v 1.19 2002/11/10 13:44:48 robd Exp $ +/* $Id: reg.c,v 1.20 2002/11/14 18:21:04 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -9,6 +9,8 @@ * Created 01/11/98 * 19990309 EA Stubs */ +#define NTOS_MODE_USER +#include #ifdef WIN32_REGDBG #include "cm_win32.h" diff --git a/reactos/lib/advapi32/sec/ac.c b/reactos/lib/advapi32/sec/ac.c index 230f6f3b68d..355f4d5f9cd 100644 --- a/reactos/lib/advapi32/sec/ac.c +++ b/reactos/lib/advapi32/sec/ac.c @@ -1,4 +1,4 @@ -/* $Id: ac.c,v 1.4 2002/09/08 10:22:37 chorns Exp $ +/* $Id: ac.c,v 1.5 2002/11/14 18:21:04 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -6,8 +6,8 @@ * PURPOSE: ACL/ACE functions */ -#include -#include +#define NTOS_MODE_USER +#include #include @@ -346,7 +346,7 @@ FindFirstFreeAce ( ) { return RtlFirstFreeAce (pAcl, - (PACE*)pAce); + (PACE_HEADER*)pAce); } @@ -362,7 +362,7 @@ GetAce ( Status = RtlGetAce (pAcl, dwAceIndex, - (PACE*)pAce); + (PACE_HEADER*)pAce); if (!NT_SUCCESS(Status)) { SetLastError (RtlNtStatusToDosError (Status)); diff --git a/reactos/lib/advapi32/sec/misc.c b/reactos/lib/advapi32/sec/misc.c index 9c6e602ce9d..8329810e6a1 100644 --- a/reactos/lib/advapi32/sec/misc.c +++ b/reactos/lib/advapi32/sec/misc.c @@ -1,8 +1,8 @@ /* */ -#include -#include +#define NTOS_MODE_USER +#include #include diff --git a/reactos/lib/advapi32/sec/sec.c b/reactos/lib/advapi32/sec/sec.c index 03fa1341b24..72b4e715a3a 100644 --- a/reactos/lib/advapi32/sec/sec.c +++ b/reactos/lib/advapi32/sec/sec.c @@ -8,8 +8,8 @@ * Created 01/11/98 */ -#include -#include +#define NTOS_MODE_USER +#include #include diff --git a/reactos/lib/advapi32/sec/sid.c b/reactos/lib/advapi32/sec/sid.c index b20556992e4..d5b096bf548 100644 --- a/reactos/lib/advapi32/sec/sid.c +++ b/reactos/lib/advapi32/sec/sid.c @@ -1,4 +1,4 @@ -/* $Id: sid.c,v 1.6 2002/09/08 10:22:37 chorns Exp $ +/* $Id: sid.c,v 1.7 2002/11/14 18:21:04 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -6,8 +6,8 @@ * PURPOSE: Security ID functions */ -#include -#include +#define NTOS_MODE_USER +#include #include diff --git a/reactos/lib/advapi32/service/scm.c b/reactos/lib/advapi32/service/scm.c index 93b9d2bde40..4a0d7fecf51 100644 --- a/reactos/lib/advapi32/service/scm.c +++ b/reactos/lib/advapi32/service/scm.c @@ -1,4 +1,4 @@ -/* $Id: scm.c,v 1.12 2002/09/08 10:22:37 chorns Exp $ +/* $Id: scm.c,v 1.13 2002/11/14 18:21:04 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -12,8 +12,10 @@ /* INCLUDES ******************************************************************/ +#define NTOS_MODE_USER +#include #include -#include +#include /* FUNCTIONS *****************************************************************/ @@ -245,7 +247,17 @@ EnumServicesStatusA ( */ BOOL STDCALL -EnumServicesStatusExA(VOID) +EnumServicesStatusExA(SC_HANDLE hSCManager, + SC_ENUM_TYPE InfoLevel, + DWORD dwServiceType, + DWORD dwServiceState, + LPBYTE lpServices, + DWORD cbBufSize, + LPDWORD pcbBytesNeeded, + LPDWORD lpServicesReturned, + LPDWORD lpResumeHandle, + LPCSTR pszGroupName + ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; @@ -257,7 +269,17 @@ EnumServicesStatusExA(VOID) */ BOOL STDCALL -EnumServicesStatusExW(VOID) +EnumServicesStatusExW(SC_HANDLE hSCManager, + SC_ENUM_TYPE InfoLevel, + DWORD dwServiceType, + DWORD dwServiceState, + LPBYTE lpServices, + DWORD cbBufSize, + LPDWORD pcbBytesNeeded, + LPDWORD lpServicesReturned, + LPDWORD lpResumeHandle, + LPCWSTR pszGroupName + ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; @@ -691,7 +713,12 @@ QueryServiceStatus( */ BOOL STDCALL -QueryServiceStatusEx(VOID) +QueryServiceStatusEx(SC_HANDLE hService, + SC_STATUS_TYPE InfoLevel, + LPBYTE lpBuffer, + DWORD cbBufSize, + LPDWORD pcbBytesNeeded + ) { SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; diff --git a/reactos/lib/advapi32/service/sctrl.c b/reactos/lib/advapi32/service/sctrl.c index c517d4dc694..973587ba0ad 100644 --- a/reactos/lib/advapi32/service/sctrl.c +++ b/reactos/lib/advapi32/service/sctrl.c @@ -1,4 +1,4 @@ -/* $Id: sctrl.c,v 1.7 2002/09/08 10:22:37 chorns Exp $ +/* $Id: sctrl.c,v 1.8 2002/11/14 18:21:04 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -12,8 +12,9 @@ /* INCLUDES ******************************************************************/ +#define NTOS_MODE_USER +#include #include -#include #define NDEBUG #include diff --git a/reactos/lib/advapi32/token/token.c b/reactos/lib/advapi32/token/token.c index e2760365de3..b27fe6f5de8 100644 --- a/reactos/lib/advapi32/token/token.c +++ b/reactos/lib/advapi32/token/token.c @@ -8,8 +8,9 @@ * Created 01/11/98 */ +#define NTOS_MODE_USER +#include #include -#include WINBOOL STDCALL diff --git a/reactos/lib/kernel32/misc/dllmain.c b/reactos/lib/kernel32/misc/dllmain.c index 9fb6c0212f9..a8851201904 100644 --- a/reactos/lib/kernel32/misc/dllmain.c +++ b/reactos/lib/kernel32/misc/dllmain.c @@ -1,4 +1,4 @@ -/* $Id: dllmain.c,v 1.23 2002/09/08 10:22:43 chorns Exp $ +/* $Id: dllmain.c,v 1.24 2002/11/14 18:21:05 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,10 +11,8 @@ /* INCLUDES ******************************************************************/ -#include -#include -#include -#include +#define NTOS_MODE_USER +#include #include #define NDEBUG diff --git a/reactos/lib/ntdll/rtl/ppb.c b/reactos/lib/ntdll/rtl/ppb.c index 78930bd45a3..66c6a9cc343 100644 --- a/reactos/lib/ntdll/rtl/ppb.c +++ b/reactos/lib/ntdll/rtl/ppb.c @@ -1,4 +1,4 @@ -/* $Id: ppb.c,v 1.16 2002/10/20 11:56:00 chorns Exp $ +/* $Id: ppb.c,v 1.17 2002/11/14 18:21:05 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -97,10 +97,10 @@ RtlCreateProcessParameters(PRTL_USER_PROCESS_PARAMETERS *ProcessParameters, if (Environment == NULL) Environment = NtCurrentPeb()->ProcessParameters->Environment; if (CurrentDirectory == NULL) - CurrentDirectory = &NtCurrentPeb()->ProcessParameters->CurrentDirectoryName; - CurrentDirectoryHandle = NtCurrentPeb()->ProcessParameters->CurrentDirectoryHandle; - ConsoleHandle = NtCurrentPeb()->ProcessParameters->hConsole; - ConsoleFlags = NtCurrentPeb()->ProcessParameters->ProcessGroup; + CurrentDirectory = &NtCurrentPeb()->ProcessParameters->CurrentDirectoryName; + CurrentDirectoryHandle = NtCurrentPeb()->ProcessParameters->CurrentDirectoryHandle; + ConsoleHandle = NtCurrentPeb()->ProcessParameters->hConsole; + ConsoleFlags = NtCurrentPeb()->ProcessParameters->ProcessGroup; } else { @@ -156,33 +156,33 @@ RtlCreateProcessParameters(PRTL_USER_PROCESS_PARAMETERS *ProcessParameters, DPRINT ("Process parameters allocated\n"); - Param->AllocationSize = RegionSize; - Param->Size = Length; + Param->AllocationSize = RegionSize; + Param->Size = Length; Param->Flags = PPF_NORMALIZED; Param->Environment = Environment; - Param->CurrentDirectoryHandle = CurrentDirectoryHandle; - Param->hConsole = ConsoleHandle; - Param->ProcessGroup = ConsoleFlags; + Param->CurrentDirectoryHandle = CurrentDirectoryHandle; + Param->hConsole = ConsoleHandle; + Param->ProcessGroup = ConsoleFlags; Dest = (PWCHAR)(((PBYTE)Param) + sizeof(RTL_USER_PROCESS_PARAMETERS)); /* copy current directory */ RtlpCopyParameterString(&Dest, - &Param->CurrentDirectoryName, + &Param->CurrentDirectoryName, CurrentDirectory, MAX_PATH * sizeof(WCHAR)); /* make sure the current directory has a trailing backslash */ - if (Param->CurrentDirectoryName.Length > 0) + if (Param->CurrentDirectoryName.Length > 0) { ULONG Length; - Length = Param->CurrentDirectoryName.Length / sizeof(WCHAR); - if (Param->CurrentDirectoryName.Buffer[Length-1] != L'\\') + Length = Param->CurrentDirectoryName.Length / sizeof(WCHAR); + if (Param->CurrentDirectoryName.Buffer[Length-1] != L'\\') { - Param->CurrentDirectoryName.Buffer[Length] = L'\\'; - Param->CurrentDirectoryName.Buffer[Length + 1] = 0; - Param->CurrentDirectoryName.Length += sizeof(WCHAR); + Param->CurrentDirectoryName.Buffer[Length] = L'\\'; + Param->CurrentDirectoryName.Buffer[Length + 1] = 0; + Param->CurrentDirectoryName.Length += sizeof(WCHAR); } } @@ -235,12 +235,12 @@ RtlCreateProcessParameters(PRTL_USER_PROCESS_PARAMETERS *ProcessParameters, return STATUS_SUCCESS; } -VOID STDCALL +NTSTATUS STDCALL RtlDestroyProcessParameters(PRTL_USER_PROCESS_PARAMETERS ProcessParameters) { ULONG RegionSize = 0; - NtFreeVirtualMemory (NtCurrentProcess (), + return NtFreeVirtualMemory (NtCurrentProcess (), (PVOID)ProcessParameters, &RegionSize, MEM_RELEASE); @@ -254,7 +254,7 @@ RtlDeNormalizeProcessParams(PRTL_USER_PROCESS_PARAMETERS Params) { if (Params && (Params->Flags & PPF_NORMALIZED)) { - DENORMALIZE(Params->CurrentDirectoryName.Buffer, Params); + DENORMALIZE(Params->CurrentDirectoryName.Buffer, Params); DENORMALIZE(Params->DllPath.Buffer, Params); DENORMALIZE(Params->ImagePathName.Buffer, Params); DENORMALIZE(Params->CommandLine.Buffer, Params); @@ -277,7 +277,7 @@ RtlNormalizeProcessParams(PRTL_USER_PROCESS_PARAMETERS Params) { if (Params && !(Params->Flags & PPF_NORMALIZED)) { - NORMALIZE(Params->CurrentDirectoryName.Buffer, Params); + NORMALIZE(Params->CurrentDirectoryName.Buffer, Params); NORMALIZE(Params->DllPath.Buffer, Params); NORMALIZE(Params->ImagePathName.Buffer, Params); NORMALIZE(Params->CommandLine.Buffer, Params); diff --git a/reactos/ntoskrnl/dbg/errinfo.c b/reactos/ntoskrnl/dbg/errinfo.c index 917ac28d44d..b4ea4852f10 100644 --- a/reactos/ntoskrnl/dbg/errinfo.c +++ b/reactos/ntoskrnl/dbg/errinfo.c @@ -257,11 +257,11 @@ DbgGetErrorText(NTSTATUS ErrorCode, PUNICODE_STRING ErrorText, ULONG Flags) { if (Flags & DBG_GET_SHOW_FACILITY) { - sprintf(NumBuf, "%08lx", ErrorCode); + sprintf(NumBuf, "%08x", ErrorCode); strcat(TempBuf, NumBuf); strcat(TempBuf, " "); } - sprintf(NumBuf, "Unknown Message #%08lx", ErrorCode); + sprintf(NumBuf, "Unknown Message #%08x", ErrorCode); strcat(TempBuf, NumBuf); } RtlInitAnsiString(&AnsiString, TempBuf); diff --git a/reactos/ntoskrnl/ex/napi.c b/reactos/ntoskrnl/ex/napi.c index ae64d80f2e8..939584bf898 100644 --- a/reactos/ntoskrnl/ex/napi.c +++ b/reactos/ntoskrnl/ex/napi.c @@ -8,8 +8,7 @@ /* INCLUDES *****************************************************************/ -#include -#include +#include #include /* GLOBALS ******************************************************************/ diff --git a/reactos/ntoskrnl/include/internal/i386/ke.h b/reactos/ntoskrnl/include/internal/i386/ke.h index 89d81e6cafd..02f8f36504c 100644 --- a/reactos/ntoskrnl/include/internal/i386/ke.h +++ b/reactos/ntoskrnl/include/internal/i386/ke.h @@ -19,6 +19,10 @@ #ifndef __NTOSKRNL_INCLUDE_INTERNAL_I386_KE_H #define __NTOSKRNL_INCLUDE_INTERNAL_I386_KE_H +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + #define KTRAP_FRAME_DEBUGEBP (0x0) #define KTRAP_FRAME_DEBUGEIP (0x4) #define KTRAP_FRAME_DEBUGARGMARK (0x8) diff --git a/reactos/ntoskrnl/io/arcname.c b/reactos/ntoskrnl/io/arcname.c index 09a1f375f71..2295175154f 100644 --- a/reactos/ntoskrnl/io/arcname.c +++ b/reactos/ntoskrnl/io/arcname.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: arcname.c,v 1.9 2002/09/08 10:23:24 chorns Exp $ +/* $Id: arcname.c,v 1.10 2002/11/14 18:21:07 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -296,7 +296,7 @@ IoCreateSystemRootLink(PCHAR ParameterLine) return(Status); } - sprintf(p, "cdrom(%lu)", DeviceNumber); + sprintf(p, "cdrom(%u)", DeviceNumber); DPRINT("New ARC name: %s\n", ParamBuffer); @@ -313,7 +313,7 @@ IoCreateSystemRootLink(PCHAR ParameterLine) q++; strcpy(temp, q); - sprintf(p, "cdrom(%lu)", DeviceNumber); + sprintf(p, "cdrom(%u)", DeviceNumber); strcat(p, temp); } } diff --git a/reactos/ntoskrnl/ke/main.c b/reactos/ntoskrnl/ke/main.c index ed34f7ee7c0..1f645ee600e 100644 --- a/reactos/ntoskrnl/ke/main.c +++ b/reactos/ntoskrnl/ke/main.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: main.c,v 1.141 2002/11/13 06:01:12 robd Exp $ +/* $Id: main.c,v 1.142 2002/11/14 18:21:07 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/main.c @@ -399,14 +399,14 @@ ExpInitializeExecutive(VOID) if (KeNumberProcessors > 1) { sprintf(str, - "Found %d system processors. [%lu MB Memory]\n", + "Found %d system processors. [%u MB Memory]\n", KeNumberProcessors, (KeLoaderBlock.MemHigher + 1088)/ 1024); } else { sprintf(str, - "Found 1 system processor. [%lu MB Memory]\n", + "Found 1 system processor. [%u MB Memory]\n", (KeLoaderBlock.MemHigher + 1088)/ 1024); } HalDisplayString(str); @@ -695,7 +695,7 @@ _main (ULONG MultiBootMagic, PLOADER_PARAMETER_BLOCK _LoaderBlock) } } sprintf(KeLoaderCommandLine, - "multi(0)disk(0)rdisk(%ld)partition(%ld)%s %s", + "multi(0)disk(0)rdisk(%d)partition(%d)%s %s", DiskNumber, PartNumber + 1, Temp, options); p = KeLoaderCommandLine; diff --git a/reactos/ntoskrnl/rtl/i386/exception.c b/reactos/ntoskrnl/rtl/i386/exception.c index 09d583472ae..f5f104060a4 100755 --- a/reactos/ntoskrnl/rtl/i386/exception.c +++ b/reactos/ntoskrnl/rtl/i386/exception.c @@ -1,4 +1,4 @@ -/* $Id: exception.c,v 1.3 2002/11/10 18:17:42 chorns Exp $ +/* $Id: exception.c,v 1.4 2002/11/14 18:21:07 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -9,7 +9,7 @@ /* INCLUDES *****************************************************************/ -#include +#include #include #include @@ -58,8 +58,8 @@ __ret_label: /* Implemented in except.s */ -VOID -RtlpCaptureContext(PCONTEXT pContext); +VOID +RtlpCaptureContext(PCONTEXT pContext); /* Macros that will help streamline the SEH implementations for kernel mode and user mode */