Some NDK Fixes, kernel32 almost compiles

svn path=/trunk/; revision=16131
This commit is contained in:
Alex Ionescu 2005-06-20 03:55:42 +00:00
parent 8cd2554cff
commit 3bfd20f396
4 changed files with 203 additions and 61 deletions

View file

@ -38,7 +38,13 @@ extern NTOSAPI POBJECT_TYPE PsThreadType;
#define USER_SHARED_DATA (0x7FFE0000)
#define PROCESS_PRIORITY_CLASS_NORMAL (2) /* FIXME */
/* Process priority classes */
#define PROCESS_PRIORITY_CLASS_HIGH (4) /* FIXME */
#define PROCESS_PRIORITY_CLASS_IDLE (0) /* FIXME */
#define PROCESS_PRIORITY_CLASS_NORMAL (2) /* FIXME */
#define PROCESS_PRIORITY_CLASS_REALTIME (5) /* FIXME */
#define PROCESS_PRIORITY_CLASS_BELOW_NORMAL (1) /* FIXME */
#define PROCESS_PRIORITY_CLASS_ABOVE_NORMAL (3) /* FIXME */
/* Global Flags */
#define FLG_STOP_ON_EXCEPTION 0x00000001

View file

@ -12,8 +12,7 @@
#include <ndk/rtltypes.h>
#include <ndk/pstypes.h>
/*FIXME: REORGANIZE THIS */
/* FIXME: SOME FUNCTIONS MUST BE PROTECTED AGAINST DDK/IFS. */
/* FIXME: FILE NEEDS TO BE CLEANED UP AT THE END WHEN ALL THE FUNCTIONS HAVE BEEN ADDED */
/*
* VOID
@ -675,6 +674,12 @@ RtlAnsiStringToUnicodeString (
BOOLEAN AllocateDestinationString
);
ULONG
STDCALL
RtlAnsiStringToUnicodeSize (
PANSI_STRING AnsiString
);
NTSTATUS
STDCALL
RtlUnicodeToMultiByteN (
@ -905,7 +910,53 @@ RtlImageRvaToSection (
PVOID BaseAddress,
ULONG Rva
);
NTSTATUS
STDCALL
RtlIntegerToChar (
IN ULONG Value,
IN ULONG Base,
IN ULONG Length,
IN OUT PCHAR String
);
NTSTATUS
STDCALL
RtlIntegerToUnicode(
IN ULONG Value,
IN ULONG Base OPTIONAL,
IN ULONG Length OPTIONAL,
IN OUT LPWSTR String
);
NTSTATUS
STDCALL
RtlIntegerToUnicodeString (
IN ULONG Value,
IN ULONG Base,
IN OUT PUNICODE_STRING String
);
NTSTATUS
STDCALL
RtlCharToInteger (
PCSZ String,
ULONG Base,
PULONG Value
);
USHORT FASTCALL
RtlUshortByteSwap (IN USHORT Source);
ULONG
STDCALL
RtlIsTextUnicode (
PVOID Buffer,
ULONG Length,
ULONG *Flags
);
NTSTATUS
STDCALL
RtlInitializeSid (
@ -922,6 +973,13 @@ RtlInitNlsTables (
IN PUSHORT CaseTableBase,
OUT PNLSTABLEINFO NlsTable
);
VOID
STDCALL
RtlInitCodePageTable (
IN PUSHORT TableBase,
OUT PCPTABLEINFO CodePageTable
);
NTSTATUS
STDCALL
@ -1110,6 +1168,17 @@ RtlUpcaseUnicodeStringToCountedOemString (
IN PUNICODE_STRING SourceString,
IN BOOLEAN AllocateDestinationString
);
NTSTATUS STDCALL
RtlSetTimeZoneInformation (IN OUT LPTIME_ZONE_INFORMATION TimeZoneInformation);
NTSTATUS
STDCALL
RtlUpcaseUnicodeString (
IN OUT PUNICODE_STRING DestinationString,
IN PCUNICODE_STRING SourceString,
IN BOOLEAN AllocateDestinationString
);
NTSTATUS
STDCALL
@ -1137,6 +1206,19 @@ RtlLargeIntegerToChar (
IN ULONG Length,
IN OUT PCHAR String
);
NTSTATUS
STDCALL
RtlVerifyVersionInfo(
IN PRTL_OSVERSIONINFOEXW VersionInfo,
IN ULONG TypeMask,
IN ULONGLONG ConditionMask
);
NTSTATUS
STDCALL
RtlGetVersion(
IN OUT PRTL_OSVERSIONINFOW lpVersionInformation);
BOOLEAN
STDCALL
@ -1187,7 +1269,37 @@ RtlUnwind (
PEXCEPTION_RECORD ExceptionRecord,
DWORD EaxValue
);
HANDLE STDCALL
RtlDestroyHeap (HANDLE hheap);
PVOID STDCALL
RtlReAllocateHeap (
HANDLE Heap,
ULONG Flags,
PVOID Ptr,
ULONG Size
);
BOOLEAN STDCALL
RtlLockHeap (IN HANDLE Heap);
BOOLEAN STDCALL
RtlUnlockHeap (IN HANDLE Heap);
ULONG STDCALL
RtlSizeHeap(
IN PVOID HeapHandle,
IN ULONG Flags,
IN PVOID MemoryPointer
);
BOOLEAN STDCALL
RtlValidateHeap (
HANDLE Heap,
ULONG Flags,
PVOID pmem
);
BOOLEAN
STDCALL
RtlValidSid (

View file

@ -61,34 +61,6 @@
#define FSCTL_MAILSLOT_PEEK \
CTL_CODE(FILE_DEVICE_MAILSLOT, 0, METHOD_NEITHER, FILE_READ_DATA)
/* I/O Control Codes for communicating with Network Drivers */
#define IOCTL_REDIR_QUERY_PATH \
CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 99, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_NETWORK_SET_CONFIGURATION_INFO \
CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 102, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
#define FSCTL_NETWORK_GET_CONFIGURATION_INFO \
CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 103, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
#define FSCTL_NETWORK_GET_CONNECTION_INFO \
CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 104, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_NETWORK_ENUMERATE_CONNECTIONS \
CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 105, METHOD_NEITHER, FILE_ANY_ACCESS)
#define FSCTL_NETWORK_DELETE_CONNECTION \
CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 107, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_NETWORK_GET_STATISTICS \
CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 116, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_NETWORK_SET_DOMAIN_NAME \
CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 120, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_NETWORK_REMOTE_BOOT_INIT_SCRT \
CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 250, METHOD_BUFFERED, FILE_ANY_ACCESS)
/* I/O Control Codes for communicating with Pipes */
#define FSCTL_PIPE_ASSIGN_EVENT \
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
@ -186,6 +158,7 @@
/* Device Charactertics */
#define FILE_REMOVABLE_MEDIA 0x00000001
#define FILE_REMOTE_DEVICE 0x00000010
/* SID Constants */
#define SID_MAX_SUB_AUTHORITIES 15
@ -283,6 +256,12 @@ typedef enum _TIMER_TYPE
SynchronizationTimer
} TIMER_TYPE;
typedef enum _WAIT_TYPE
{
WaitAll,
WaitAny
} WAIT_TYPE;
typedef enum _INTERFACE_TYPE
{
InterfaceTypeUndefined = -1,
@ -582,12 +561,12 @@ typedef LONG NTSTATUS, *PNTSTATUS;
typedef UCHAR KIRQL, *PKIRQL;
typedef ULONG KAFFINITY, *PKAFFINITY;
typedef ULONG_PTR KSPIN_LOCK, *PKSPIN_LOCK;
typedef ULONG WAIT_TYPE;
typedef struct _PEB *PPEB;
typedef ULONG KPROCESSOR_MODE;
typedef struct _OBJECT_TYPE *POBJECT_TYPE;
struct _ETHREAD;
struct _EVENT_TRACE_HEADER; /* <--- We might want to declare this one */
typedef ULONG EXECUTION_STATE;
/* Basic NT Types */
typedef struct _UNICODE_STRING
@ -925,13 +904,35 @@ typedef struct _FILE_FS_DEVICE_INFORMATION
ULONG Characteristics;
} FILE_FS_DEVICE_INFORMATION, *PFILE_FS_DEVICE_INFORMATION;
typedef struct _FILE_FS_ATTRIBUTE_INFORMATION
{
ULONG FileSystemAttributes;
ULONG MaximumComponentNameLength;
ULONG FileSystemNameLength;
WCHAR FileSystemName[1];
} FILE_FS_ATTRIBUTE_INFORMATION, *PFILE_FS_ATTRIBUTE_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_LABEL_INFORMATION
{
ULONG VolumeLabelLength;
WCHAR VolumeLabel[1];
} FILE_FS_LABEL_INFORMATION, *PFILE_FS_LABEL_INFORMATION;
typedef struct _FILE_FS_VOLUME_INFORMATION
{
LARGE_INTEGER VolumeCreationTime;
ULONG VolumeSerialNumber;
ULONG VolumeLabelLength;
BOOLEAN SupportsObjects;
WCHAR VolumeLabel[1];
LARGE_INTEGER VolumeCreationTime;
ULONG VolumeSerialNumber;
ULONG VolumeLabelLength;
BOOLEAN SupportsObjects;
WCHAR VolumeLabel[1];
} FILE_FS_VOLUME_INFORMATION, *PFILE_FS_VOLUME_INFORMATION;
/*
@ -941,19 +942,19 @@ typedef struct _FILE_FS_VOLUME_INFORMATION
/* Class 0 */
typedef struct _KEY_VALUE_ENTRY
{
PUNICODE_STRING ValueName;
ULONG DataLength;
ULONG DataOffset;
ULONG Type;
PUNICODE_STRING ValueName;
ULONG DataLength;
ULONG DataOffset;
ULONG Type;
} KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
/* Class 1 */
typedef struct _KEY_VALUE_PARTIAL_INFORMATION
{
ULONG TitleIndex;
ULONG Type;
ULONG DataLength;
UCHAR Data[1];
ULONG TitleIndex;
ULONG Type;
ULONG DataLength;
UCHAR Data[1];
} KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
/* Class 2 */
@ -989,21 +990,6 @@ typedef struct _KEY_BASIC_INFORMATION
WCHAR Name[1];
} KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
/*
* Process
*/
/* 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;
/* File Pipe Structures for the FSCTLs */
typedef struct _FILE_PIPE_WAIT_FOR_BUFFER
{

View file

@ -17,6 +17,9 @@
/* CONSTANTS *****************************************************************/
#define MAX_BUS_NAME 24
#define EVENT_READ_ACCESS 1
#define EVENT_WRITE_ACCESS 2
#define EVENT_PAIR_ALL_ACCESS (0x1F0000L)
/* ENUMERATIONS **************************************************************/
@ -381,6 +384,35 @@ typedef struct _EVENT_BASIC_INFORMATION
/*
* Process
*/
/* 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;
/* Class 4 */
typedef struct _KERNEL_USER_TIMES
{
LARGE_INTEGER CreateTime;
LARGE_INTEGER ExitTime;
LARGE_INTEGER KernelTime;
LARGE_INTEGER UserTime;
} KERNEL_USER_TIMES, *PKERNEL_USER_TIMES;
/* Class 16 */
typedef struct _PROCESS_PRIORITY_CLASS
{
BOOLEAN Foreground;
UCHAR PriorityClass;
} PROCESS_PRIORITY_CLASS, *PPROCESS_PRIORITY_CLASS;
/* Class 23 */
typedef struct _PROCESS_DEVICEMAP_INFORMATION
{
@ -398,6 +430,12 @@ typedef struct _PROCESS_DEVICEMAP_INFORMATION
};
} PROCESS_DEVICEMAP_INFORMATION, *PPROCESS_DEVICEMAP_INFORMATION;
/* Class 24 */
typedef struct _PROCESS_SESSION_INFORMATION
{
ULONG SessionId;
} PROCESS_SESSION_INFORMATION, *PPROCESS_SESSION_INFORMATION;
/*
* System
*/