- Various Microsoft DDK/PSDK compatibility fixes and some MSVC stuff too.

- Fix PSECURITY_DESCRIPTOR_RELATIVE names.c
 - Don't use rtltypes.h as a replacement for normal stdlib headers.
 - Fix a HAL header fixme.

svn path=/trunk/; revision=16744
This commit is contained in:
Alex Ionescu 2005-07-26 14:00:45 +00:00
parent 9acecc8bdd
commit b8f8df7565
54 changed files with 1592 additions and 1597 deletions

View file

@ -24,6 +24,7 @@
#ifndef VIDEOPRT_H #ifndef VIDEOPRT_H
#define VIDEOPRT_H #define VIDEOPRT_H
#include <stdio.h>
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <ddk/miniport.h> #include <ddk/miniport.h>
#include <ddk/video.h> #include <ddk/video.h>

View file

@ -8,25 +8,20 @@
/* INCLUDES ******************************************************************/ /* INCLUDES ******************************************************************/
/* C Headers */
#include <stdio.h>
/* IFS/DDK/NDK Headers */ /* IFS/DDK/NDK Headers */
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <ddk/ntifs.h> #include <ddk/ntifs.h>
#include <ndk/ntndk.h> #include <ndk/ntndk.h>
/* Internal Kernel Headers */ /* Internal Kernel Headers */
//#include <internal/mm.h> #include <internal/mm.h>
#include <internal/ke.h> #include <internal/ke.h>
#define KPCR_BASE 0xFF000000 // HACK! #define KPCR_BASE 0xFF000000 // HACK!
//Temporary hack below until ntoskrnl is on NDK
PVOID STDCALL
MmAllocateContiguousAlignedMemory(IN ULONG NumberOfBytes,
IN PHYSICAL_ADDRESS LowestAcceptableAddress,
IN PHYSICAL_ADDRESS HighestAcceptableAddress,
IN PHYSICAL_ADDRESS BoundaryAddressMultiple OPTIONAL,
IN MEMORY_CACHING_TYPE CacheType OPTIONAL,
IN ULONG Alignment);
/* Internal HAL Headers */ /* Internal HAL Headers */
#include "apic.h" #include "apic.h"
#include "bus.h" #include "bus.h"

View file

@ -33,17 +33,15 @@ typedef enum _PP_NPAGED_LOOKASIDE_NUMBER
/* TYPES *********************************************************************/ /* TYPES *********************************************************************/
/* FIXME: Forced to do this for now, because of EPROCESS, will go away before 0.3.0 */ /* FIXME: Forced to do this for now, because of EPROCESS, will go away before 0.3.0 */
#ifndef __NTOSKRNL__
typedef struct _MADDRESS_SPACE typedef struct _MADDRESS_SPACE
{ {
PVOID MemoryAreaRoot; struct _MEMORY_AREA *MemoryAreaRoot;
FAST_MUTEX Lock; FAST_MUTEX Lock;
PVOID LowestAddress; PVOID LowestAddress;
struct _EPROCESS* Process; struct _EPROCESS* Process;
PUSHORT PageTableRefCountTable; PUSHORT PageTableRefCountTable;
ULONG PageTableRefCountTableSize; ULONG PageTableRefCountTableSize;
} MADDRESS_SPACE, *PMADDRESS_SPACE; } MADDRESS_SPACE, *PMADDRESS_SPACE;
#endif
typedef struct _PP_LOOKASIDE_LIST typedef struct _PP_LOOKASIDE_LIST
{ {

View file

@ -9,8 +9,12 @@
#ifndef _NTNDK_ #ifndef _NTNDK_
#define _NTNDK_ #define _NTNDK_
#ifndef NTOS_MODE_USER /* C Standard Headers */
#include <stdarg.h>
#include <excpt.h>
/* Kernel-Mode NDK */ /* Kernel-Mode NDK */
#ifndef NTOS_MODE_USER
#include "kdtypes.h" /* Kernel Debugger Types */ #include "kdtypes.h" /* Kernel Debugger Types */
#include "kdfuncs.h" /* Kernel Debugger Functions */ #include "kdfuncs.h" /* Kernel Debugger Functions */
#include "cctypes.h" /* Cache Manager Types */ #include "cctypes.h" /* Cache Manager Types */

View file

@ -22,12 +22,12 @@ extern NTOSAPI POBJECT_TYPE PsThreadType;
/* CONSTANTS *****************************************************************/ /* CONSTANTS *****************************************************************/
/* These are not exposed to drivers normally */ /* These are not exposed to drivers normally */
#ifndef _NTOS_MODE_USER #ifndef NTOS_MODE_USER
#define JOB_OBJECT_ASSIGN_PROCESS (1) #define JOB_OBJECT_ASSIGN_PROCESS 1
#define JOB_OBJECT_SET_ATTRIBUTES (2) #define JOB_OBJECT_SET_ATTRIBUTES 2
#define JOB_OBJECT_QUERY (4) #define JOB_OBJECT_QUERY 4
#define JOB_OBJECT_TERMINATE (8) #define JOB_OBJECT_TERMINATE 8
#define JOB_OBJECT_SET_SECURITY_ATTRIBUTES (16) #define JOB_OBJECT_SET_SECURITY_ATTRIBUTES 16
#define JOB_OBJECT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|31) #define JOB_OBJECT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|31)
#endif #endif
@ -36,12 +36,12 @@ extern NTOSAPI POBJECT_TYPE PsThreadType;
#define USER_SHARED_DATA (0x7FFE0000) #define USER_SHARED_DATA (0x7FFE0000)
/* Process priority classes */ /* Process priority classes */
#define PROCESS_PRIORITY_CLASS_HIGH (4) /* FIXME */ #define PROCESS_PRIORITY_CLASS_IDLE 0
#define PROCESS_PRIORITY_CLASS_IDLE (0) /* FIXME */ #define PROCESS_PRIORITY_CLASS_BELOW_NORMAL 1
#define PROCESS_PRIORITY_CLASS_NORMAL (2) /* FIXME */ #define PROCESS_PRIORITY_CLASS_NORMAL 2
#define PROCESS_PRIORITY_CLASS_REALTIME (5) /* FIXME */ #define PROCESS_PRIORITY_CLASS_ABOVE_NORMAL 3
#define PROCESS_PRIORITY_CLASS_BELOW_NORMAL (1) /* FIXME */ #define PROCESS_PRIORITY_CLASS_HIGH 4
#define PROCESS_PRIORITY_CLASS_ABOVE_NORMAL (3) /* FIXME */ #define PROCESS_PRIORITY_CLASS_REALTIME 5
/* Global Flags */ /* Global Flags */
#define FLG_STOP_ON_EXCEPTION 0x00000001 #define FLG_STOP_ON_EXCEPTION 0x00000001
@ -75,16 +75,16 @@ extern NTOSAPI POBJECT_TYPE PsThreadType;
/* ENUMERATIONS **************************************************************/ /* ENUMERATIONS **************************************************************/
/* FUNCTION TYPES ************************************************************/ /* FUNCTION TYPES ************************************************************/
typedef VOID (STDCALL *PPEBLOCKROUTINE)(PVOID); typedef VOID (NTAPI *PPEBLOCKROUTINE)(PVOID);
typedef NTSTATUS typedef NTSTATUS
(STDCALL *PW32_PROCESS_CALLBACK)( (NTAPI *PW32_PROCESS_CALLBACK)(
struct _EPROCESS *Process, struct _EPROCESS *Process,
BOOLEAN Create BOOLEAN Create
); );
typedef NTSTATUS typedef NTSTATUS
(STDCALL *PW32_THREAD_CALLBACK)( (NTAPI *PW32_THREAD_CALLBACK)(
struct _ETHREAD *Thread, struct _ETHREAD *Thread,
BOOLEAN Create BOOLEAN Create
); );

View file

@ -12,7 +12,7 @@
/* DEPENDENCIES **************************************************************/ /* DEPENDENCIES **************************************************************/
#include "rtltypes.h" #include "rtltypes.h"
#include "pstypes.h" #include "pstypes.h"
#include <ddk/ntnls.h> #include <ntnls.h>
/* PROTOTYPES ****************************************************************/ /* PROTOTYPES ****************************************************************/
@ -156,7 +156,7 @@ NTSTATUS
STDCALL STDCALL
RtlAbsoluteToSelfRelativeSD( RtlAbsoluteToSelfRelativeSD(
IN PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor, IN PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor,
IN OUT PSECURITY_DESCRIPTOR_RELATIVE SelfRelativeSecurityDescriptor, IN OUT PISECURITY_DESCRIPTOR_RELATIVE SelfRelativeSecurityDescriptor,
IN PULONG BufferLength IN PULONG BufferLength
); );
@ -322,7 +322,7 @@ RtlCreateSecurityDescriptor(
NTSTATUS NTSTATUS
STDCALL STDCALL
RtlCreateSecurityDescriptorRelative( RtlCreateSecurityDescriptorRelative(
PSECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor, PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor,
ULONG Revision ULONG Revision
); );
@ -460,7 +460,7 @@ RtlQueryInformationAcl(
NTSTATUS NTSTATUS
STDCALL STDCALL
RtlSelfRelativeToAbsoluteSD( RtlSelfRelativeToAbsoluteSD(
IN PSECURITY_DESCRIPTOR_RELATIVE SelfRelativeSD, IN PISECURITY_DESCRIPTOR_RELATIVE SelfRelativeSD,
OUT PSECURITY_DESCRIPTOR AbsoluteSD, OUT PSECURITY_DESCRIPTOR AbsoluteSD,
IN PULONG AbsoluteSDSize, IN PULONG AbsoluteSDSize,
IN PACL Dacl, IN PACL Dacl,
@ -547,7 +547,7 @@ RtlSubAuthoritySid(
BOOLEAN BOOLEAN
STDCALL STDCALL
RtlValidRelativeSecurityDescriptor( RtlValidRelativeSecurityDescriptor(
IN PSECURITY_DESCRIPTOR_RELATIVE SecurityDescriptorInput, IN PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptorInput,
IN ULONG SecurityDescriptorLength, IN ULONG SecurityDescriptorLength,
IN SECURITY_INFORMATION RequiredInformation IN SECURITY_INFORMATION RequiredInformation
); );
@ -1016,14 +1016,6 @@ RtlLookupAtomInAtomTable(
/* /*
* Memory Functions * Memory Functions
*/ */
SIZE_T
STDCALL
RtlCompareMemory(
IN const VOID *Source1,
IN const VOID *Source2,
IN SIZE_T Length
);
VOID VOID
STDCALL STDCALL
RtlFillMemoryUlong( RtlFillMemoryUlong(
@ -1727,75 +1719,4 @@ NTSTATUS
STDCALL STDCALL
RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation); RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation);
/*
* C Runtime Library Functions
*/
char *_itoa (int value, char *string, int radix);
wchar_t *_itow (int value, wchar_t *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 isalpha(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);
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 #endif

View file

@ -11,6 +11,7 @@
/* DEPENDENCIES **************************************************************/ /* DEPENDENCIES **************************************************************/
#include "zwtypes.h" #include "zwtypes.h"
#include "excpt.h"
/* EXPORTED DATA *************************************************************/ /* EXPORTED DATA *************************************************************/
@ -67,14 +68,6 @@
/* ENUMERATIONS **************************************************************/ /* ENUMERATIONS **************************************************************/
typedef enum
{
ExceptionContinueExecution,
ExceptionContinueSearch,
ExceptionNestedException,
ExceptionCollidedUnwind
} EXCEPTION_DISPOSITION;
typedef enum typedef enum
{ {
INVALID_PATH = 0, INVALID_PATH = 0,
@ -102,16 +95,16 @@ typedef EXCEPTION_DISPOSITION
PVOID PVOID
); );
typedef LONG (STDCALL *PVECTORED_EXCEPTION_HANDLER)( typedef LONG (NTAPI *PVECTORED_EXCEPTION_HANDLER)(
PEXCEPTION_POINTERS ExceptionPointers PEXCEPTION_POINTERS ExceptionPointers
); );
typedef DWORD (STDCALL *PTHREAD_START_ROUTINE)( typedef DWORD (NTAPI *PTHREAD_START_ROUTINE)(
LPVOID Parameter LPVOID Parameter
); );
typedef VOID typedef VOID
(STDCALL *PRTL_BASE_PROCESS_START_ROUTINE)( (NTAPI *PRTL_BASE_PROCESS_START_ROUTINE)(
PTHREAD_START_ROUTINE StartAddress, PTHREAD_START_ROUTINE StartAddress,
PVOID Parameter PVOID Parameter
); );
@ -234,11 +227,13 @@ typedef struct _RTL_HEAP_DEFINITION
} RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION; } RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
/* END REVIEW AREA */ /* END REVIEW AREA */
#ifdef _INC_EXCPT
typedef struct _EXCEPTION_REGISTRATION typedef struct _EXCEPTION_REGISTRATION
{ {
struct _EXCEPTION_REGISTRATION* prev; struct _EXCEPTION_REGISTRATION* prev;
PEXCEPTION_HANDLER handler; PEXCEPTION_HANDLER handler;
} EXCEPTION_REGISTRATION, *PEXCEPTION_REGISTRATION; } EXCEPTION_REGISTRATION, *PEXCEPTION_REGISTRATION;
#endif
typedef EXCEPTION_REGISTRATION EXCEPTION_REGISTRATION_RECORD; typedef EXCEPTION_REGISTRATION EXCEPTION_REGISTRATION_RECORD;
typedef PEXCEPTION_REGISTRATION PEXCEPTION_REGISTRATION_RECORD; typedef PEXCEPTION_REGISTRATION PEXCEPTION_REGISTRATION_RECORD;
@ -276,7 +271,7 @@ typedef struct _RTL_RANGE
} RTL_RANGE, *PRTL_RANGE; } RTL_RANGE, *PRTL_RANGE;
typedef BOOLEAN typedef BOOLEAN
(STDCALL *PRTL_CONFLICT_RANGE_CALLBACK) ( (NTAPI *PRTL_CONFLICT_RANGE_CALLBACK) (
PVOID Context, PVOID Context,
PRTL_RANGE Range PRTL_RANGE Range
); );
@ -357,7 +352,7 @@ typedef struct _RTL_USER_PROCESS_PARAMETERS
ULONG CountY; ULONG CountY;
ULONG CountCharsX; ULONG CountCharsX;
ULONG CountCharsY; ULONG CountCharsY;
ULONG FillAttribute;; ULONG FillAttribute;
ULONG WindowFlags; ULONG WindowFlags;
ULONG ShowWindowFlags; ULONG ShowWindowFlags;
UNICODE_STRING WindowTitle; UNICODE_STRING WindowTitle;
@ -405,7 +400,7 @@ typedef struct _RTL_ATOM_TABLE
} RTL_ATOM_TABLE, *PRTL_ATOM_TABLE; } RTL_ATOM_TABLE, *PRTL_ATOM_TABLE;
/* Let Kernel Drivers use this */ /* Let Kernel Drivers use this */
#ifndef _WINBASE_H #ifndef _WINBASE_
typedef struct _SYSTEMTIME typedef struct _SYSTEMTIME
{ {
WORD wYear; WORD wYear;

View file

@ -13,7 +13,7 @@
/* DEPENDENCIES **************************************************************/ /* DEPENDENCIES **************************************************************/
#include <winioctl.h> #include <winioctl.h>
#include <ntstatus.h> #include <ntstatus.h>
#include <ddk/ntnls.h> #include <ntnls.h>
#define STATIC static #define STATIC static
/* EXPORTED DATA *************************************************************/ /* EXPORTED DATA *************************************************************/
@ -23,6 +23,8 @@
/* NTAPI/NTOSAPI Define */ /* NTAPI/NTOSAPI Define */
#define NTAPI __stdcall #define NTAPI __stdcall
#define NTOSAPI #define NTOSAPI
#define FASTCALL __fastcall
#define STDCALL __stdcall
/* Definitions for Object Creation -- winternl.h */ /* Definitions for Object Creation -- winternl.h */
#define OBJ_INHERIT 2L #define OBJ_INHERIT 2L
@ -64,46 +66,57 @@
/* I/O Control Codes for communicating with Pipes */ /* I/O Control Codes for communicating with Pipes */
#define FSCTL_PIPE_ASSIGN_EVENT \ #define FSCTL_PIPE_ASSIGN_EVENT \
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS) CTL_CODE(FILE_DEVICE_NAMED_PIPE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_PIPE_DISCONNECT \ #define FSCTL_PIPE_DISCONNECT \
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 1, METHOD_BUFFERED, FILE_ANY_ACCESS) CTL_CODE(FILE_DEVICE_NAMED_PIPE, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_PIPE_LISTEN \ #define FSCTL_PIPE_LISTEN \
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS) CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_PIPE_PEEK \ #define FSCTL_PIPE_PEEK \
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 3, METHOD_BUFFERED, FILE_READ_DATA) CTL_CODE(FILE_DEVICE_NAMED_PIPE, 3, METHOD_BUFFERED, FILE_READ_DATA)
#define FSCTL_PIPE_QUERY_EVENT \ #define FSCTL_PIPE_QUERY_EVENT \
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 4, METHOD_BUFFERED, FILE_ANY_ACCESS) CTL_CODE(FILE_DEVICE_NAMED_PIPE, 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_PIPE_TRANSCEIVE \ #define FSCTL_PIPE_TRANSCEIVE \
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 5, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA) CTL_CODE(FILE_DEVICE_NAMED_PIPE, 5, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
#define FSCTL_PIPE_WAIT \ #define FSCTL_PIPE_WAIT \
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 6, METHOD_BUFFERED, FILE_ANY_ACCESS) CTL_CODE(FILE_DEVICE_NAMED_PIPE, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_PIPE_IMPERSONATE \ #define FSCTL_PIPE_IMPERSONATE \
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 7, METHOD_BUFFERED, FILE_ANY_ACCESS) CTL_CODE(FILE_DEVICE_NAMED_PIPE, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_PIPE_SET_CLIENT_PROCESS \ #define FSCTL_PIPE_SET_CLIENT_PROCESS \
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 8, METHOD_BUFFERED, FILE_ANY_ACCESS) CTL_CODE(FILE_DEVICE_NAMED_PIPE, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_PIPE_QUERY_CLIENT_PROCESS \ #define FSCTL_PIPE_QUERY_CLIENT_PROCESS \
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 9, METHOD_BUFFERED, FILE_ANY_ACCESS) CTL_CODE(FILE_DEVICE_NAMED_PIPE, 9, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_PIPE_INTERNAL_READ \ #define FSCTL_PIPE_INTERNAL_READ \
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2045, METHOD_BUFFERED, FILE_READ_DATA) CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2045, METHOD_BUFFERED, FILE_READ_DATA)
#define FSCTL_PIPE_INTERNAL_WRITE \ #define FSCTL_PIPE_INTERNAL_WRITE \
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2046, METHOD_BUFFERED, FILE_WRITE_DATA) CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2046, METHOD_BUFFERED, FILE_WRITE_DATA)
#define FSCTL_PIPE_INTERNAL_TRANSCEIVE \ #define FSCTL_PIPE_INTERNAL_TRANSCEIVE \
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2047, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA) CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2047, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
#define FSCTL_PIPE_INTERNAL_READ_OVFLOW \ #define FSCTL_PIPE_INTERNAL_READ_OVFLOW \
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2048, METHOD_BUFFERED, FILE_READ_DATA) CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2048, METHOD_BUFFERED, FILE_READ_DATA)
/* I/O Control Codes for Communicating with Tapes */
#define IOCTL_TAPE_ERASE \
CTL_CODE(FILE_DEVICE_TAPE, 0, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_TAPE_PREPARE \
CTL_CODE(FILE_DEVICE_TAPE, 1, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_TAPE_WRITE_MARKS \
CTL_CODE(FILE_DEVICE_TAPE, 2, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_TAPE_GET_POSITION \
CTL_CODE(FILE_DEVICE_TAPE, 3, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_TAPE_SET_POSITION \
CTL_CODE(FILE_DEVICE_TAPE, 4, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_TAPE_GET_DRIVE_PARAMS \
CTL_CODE(FILE_DEVICE_TAPE, 5, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_TAPE_SET_DRIVE_PARAMS \
CTL_CODE(FILE_DEVICE_TAPE, 6, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_TAPE_GET_MEDIA_PARAMS \
CTL_CODE(FILE_DEVICE_TAPE, 7, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_TAPE_SET_MEDIA_PARAMS \
CTL_CODE(FILE_DEVICE_TAPE, 8, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_TAPE_GET_STATUS \
CTL_CODE(FILE_DEVICE_TAPE, 9, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_TAPE_CREATE_PARTITION \
CTL_CODE(FILE_DEVICE_TAPE, 10, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
/* Macros for current Process/Thread built-in 'special' ID */ /* Macros for current Process/Thread built-in 'special' ID */
#define NtCurrentProcess() ( (HANDLE)(LONG_PTR) -1 ) #define NtCurrentProcess() ( (HANDLE)(LONG_PTR) -1 )
#define ZwCurrentProcess() NtCurrentProcess() #define ZwCurrentProcess() NtCurrentProcess()
@ -155,13 +168,45 @@
#define FILE_PIPE_CLIENT_END 0x00000000 #define FILE_PIPE_CLIENT_END 0x00000000
#define FILE_PIPE_SERVER_END 0x00000001 #define FILE_PIPE_SERVER_END 0x00000001
/* File Attributes */
#define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
#define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
/* File Flags */
#define FILE_SUPERSEDE 0x00000000
#define FILE_OPEN 0x00000001
#define FILE_CREATE 0x00000002
#define FILE_OPEN_IF 0x00000003
#define FILE_OVERWRITE 0x00000004
#define FILE_OVERWRITE_IF 0x00000005
#define FILE_MAXIMUM_DISPOSITION 0x00000005
/* File Types */
#define FILE_DIRECTORY_FILE 0x00000001
#define FILE_WRITE_THROUGH 0x00000002
#define FILE_SEQUENTIAL_ONLY 0x00000004
#define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
#define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
#define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
#define FILE_NON_DIRECTORY_FILE 0x00000040
#define FILE_CREATE_TREE_CONNECTION 0x00000080
#define FILE_COMPLETE_IF_OPLOCKED 0x00000100
#define FILE_NO_EA_KNOWLEDGE 0x00000200
#define FILE_OPEN_FOR_RECOVERY 0x00000400
#define FILE_RANDOM_ACCESS 0x00000800
#define FILE_DELETE_ON_CLOSE 0x00001000
#define FILE_OPEN_BY_FILE_ID 0x00002000
#define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
#define FILE_NO_COMPRESSION 0x00008000
#define FILE_RESERVE_OPFILTER 0x00100000
#define FILE_OPEN_REPARSE_POINT 0x00200000
#define FILE_OPEN_NO_RECALL 0x00400000
#define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
/* Device Charactertics */ /* Device Charactertics */
#define FILE_REMOVABLE_MEDIA 0x00000001 #define FILE_REMOVABLE_MEDIA 0x00000001
#define FILE_REMOTE_DEVICE 0x00000010 #define FILE_REMOTE_DEVICE 0x00000010
/* SID Constants */
#define SID_MAX_SUB_AUTHORITIES 15
/* Version Constants */ /* Version Constants */
#define VER_MINORVERSION 0x0000001 #define VER_MINORVERSION 0x0000001
#define VER_MAJORVERSION 0x0000002 #define VER_MAJORVERSION 0x0000002
@ -712,20 +757,20 @@ typedef struct _IO_STATUS_BLOCK
ULONG_PTR Information; ULONG_PTR Information;
} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK; } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
typedef VOID NTAPI typedef VOID
(*PIO_APC_ROUTINE)( (NTAPI *PIO_APC_ROUTINE)(
IN PVOID ApcContext, IN PVOID ApcContext,
IN PIO_STATUS_BLOCK IoStatusBlock, IN PIO_STATUS_BLOCK IoStatusBlock,
IN ULONG Reserved); IN ULONG Reserved);
typedef VOID NTAPI typedef VOID
(*PKNORMAL_ROUTINE)( (NTAPI *PKNORMAL_ROUTINE)(
IN PVOID NormalContext, IN PVOID NormalContext,
IN PVOID SystemArgument1, IN PVOID SystemArgument1,
IN PVOID SystemArgument2); IN PVOID SystemArgument2);
typedef VOID NTAPI typedef VOID
(*PTIMER_APC_ROUTINE)( (NTAPI *PTIMER_APC_ROUTINE)(
IN PVOID TimerContext, IN PVOID TimerContext,
IN ULONG TimerLowValue, IN ULONG TimerLowValue,
IN LONG TimerHighValue); IN LONG TimerHighValue);
@ -897,12 +942,6 @@ typedef struct _FILE_NETWORK_OPEN_INFORMATION
ULONG FileAttributes; ULONG FileAttributes;
} FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION; } FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;
typedef struct _FILE_ZERO_DATA_INFORMATION
{
LARGE_INTEGER FileOffset;
LARGE_INTEGER BeyondFinalZero;
} FILE_ZERO_DATA_INFORMATION, *PFILE_ZERO_DATA_INFORMATION;
typedef struct _FILE_EA_INFORMATION typedef struct _FILE_EA_INFORMATION
{ {
ULONG EaSize; ULONG EaSize;
@ -928,12 +967,6 @@ typedef struct _FILE_DISPOSITION_INFORMATION
BOOLEAN DeleteFile; BOOLEAN DeleteFile;
} FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION; } FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;
typedef struct FILE_ALLOCATED_RANGE_BUFFER
{
LARGE_INTEGER FileOffset;
LARGE_INTEGER Length;
} FILE_ALLOCATED_RANGE_BUFFER, *PFILE_ALLOCATED_RANGE_BUFFER;
typedef struct _FILE_FULL_EA_INFORMATION typedef struct _FILE_FULL_EA_INFORMATION
{ {
ULONG NextEntryOffset; ULONG NextEntryOffset;
@ -1261,47 +1294,47 @@ typedef struct _RTL_SPLAY_LINKS
struct _RTL_AVL_TABLE; struct _RTL_AVL_TABLE;
struct _RTL_GENERIC_TABLE; struct _RTL_GENERIC_TABLE;
typedef NTSTATUS STDCALL typedef NTSTATUS
(*PRTL_AVL_MATCH_FUNCTION)( (NTAPI *PRTL_AVL_MATCH_FUNCTION)(
struct _RTL_AVL_TABLE *Table, struct _RTL_AVL_TABLE *Table,
PVOID UserData, PVOID UserData,
PVOID MatchData PVOID MatchData
); );
typedef RTL_GENERIC_COMPARE_RESULTS STDCALL typedef RTL_GENERIC_COMPARE_RESULTS
(*PRTL_AVL_COMPARE_ROUTINE) ( (NTAPI *PRTL_AVL_COMPARE_ROUTINE) (
struct _RTL_AVL_TABLE *Table, struct _RTL_AVL_TABLE *Table,
PVOID FirstStruct, PVOID FirstStruct,
PVOID SecondStruct PVOID SecondStruct
); );
typedef RTL_GENERIC_COMPARE_RESULTS STDCALL typedef RTL_GENERIC_COMPARE_RESULTS
(*PRTL_GENERIC_COMPARE_ROUTINE) ( (NTAPI *PRTL_GENERIC_COMPARE_ROUTINE) (
struct _RTL_GENERIC_TABLE *Table, struct _RTL_GENERIC_TABLE *Table,
PVOID FirstStruct, PVOID FirstStruct,
PVOID SecondStruct PVOID SecondStruct
); );
typedef PVOID STDCALL typedef PVOID
(*PRTL_GENERIC_ALLOCATE_ROUTINE) ( (NTAPI *PRTL_GENERIC_ALLOCATE_ROUTINE) (
struct _RTL_GENERIC_TABLE *Table, struct _RTL_GENERIC_TABLE *Table,
LONG ByteSize LONG ByteSize
); );
typedef VOID STDCALL typedef VOID
(*PRTL_GENERIC_FREE_ROUTINE) ( (NTAPI *PRTL_GENERIC_FREE_ROUTINE) (
struct _RTL_GENERIC_TABLE *Table, struct _RTL_GENERIC_TABLE *Table,
PVOID Buffer PVOID Buffer
); );
typedef VOID STDCALL typedef VOID
(*PRTL_AVL_ALLOCATE_ROUTINE) ( (NTAPI *PRTL_AVL_ALLOCATE_ROUTINE) (
struct _RTL_AVL_TABLE *Table, struct _RTL_AVL_TABLE *Table,
LONG ByteSize LONG ByteSize
); );
typedef VOID STDCALL typedef VOID
(*PRTL_AVL_FREE_ROUTINE) ( (NTAPI *PRTL_AVL_FREE_ROUTINE) (
struct _RTL_AVL_TABLE *Table, struct _RTL_AVL_TABLE *Table,
PVOID Buffer PVOID Buffer
); );
@ -1343,8 +1376,8 @@ typedef struct _RTL_AVL_TABLE
PVOID TableContext; PVOID TableContext;
} RTL_AVL_TABLE, *PRTL_AVL_TABLE; } RTL_AVL_TABLE, *PRTL_AVL_TABLE;
typedef NTSTATUS STDCALL typedef NTSTATUS
(*PRTL_QUERY_REGISTRY_ROUTINE)( (NTAPI *PRTL_QUERY_REGISTRY_ROUTINE)(
IN PWSTR ValueName, IN PWSTR ValueName,
IN ULONG ValueType, IN ULONG ValueType,
IN PVOID ValueData, IN PVOID ValueData,

View file

@ -4025,7 +4025,7 @@ ZwYieldExecution(
); );
static inline struct _PEB * NtCurrentPeb(void) static __inline struct _PEB* NtCurrentPeb (void)
{ {
struct _PEB * pPeb; struct _PEB * pPeb;

View file

@ -11,7 +11,7 @@
/* DEPENDENCIES **************************************************************/ /* DEPENDENCIES **************************************************************/
#include "rtltypes.h" #include "rtltypes.h"
#include <ddk/cfg.h> #include <cfg.h>
/* EXPORTED DATA *************************************************************/ /* EXPORTED DATA *************************************************************/
@ -820,6 +820,7 @@ typedef struct _SYSTEM_RESOURCE_LOCK_INFO
/* Class 13 */ /* Class 13 */
typedef struct _SYSTEM_BACKTRACE_INFORMATION_ENTRY typedef struct _SYSTEM_BACKTRACE_INFORMATION_ENTRY
{ {
ULONG Dummy;
/* FIXME */ /* FIXME */
} SYSTEM_BACKTRACE_INFORMATION_ENTRY, *PSYSTEM_BACKTRACE_INFORMATION_ENTRY; } SYSTEM_BACKTRACE_INFORMATION_ENTRY, *PSYSTEM_BACKTRACE_INFORMATION_ENTRY;

View file

@ -63,7 +63,7 @@
#endif #endif
#ifndef NDEBUG #ifndef NDEBUG
#define DPRINT(args...) do { DbgPrint("(%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0); #define DPRINT(...) do { DbgPrint("(%s:%d) ",__FILE__,__LINE__); DbgPrint(__VA_ARGS__); } while(0);
#define CHECKPOINT do { DbgPrint("%s:%d\n",__FILE__,__LINE__); } while(0); #define CHECKPOINT do { DbgPrint("%s:%d\n",__FILE__,__LINE__); } while(0);
#else #else
#ifdef __GNUC__ #ifdef __GNUC__

View file

@ -41,7 +41,8 @@
#define SECONDS_TO_100NS(seconds) (((LONGLONG)(seconds)) * MILLIS_TO_100NS(1000)) #define SECONDS_TO_100NS(seconds) (((LONGLONG)(seconds)) * MILLIS_TO_100NS(1000))
#define MINUTES_TO_100NS(minutes) (((LONGLONG)(minutes)) * SECONDS_TO_100NS(60)) #define MINUTES_TO_100NS(minutes) (((LONGLONG)(minutes)) * SECONDS_TO_100NS(60))
#define HOURS_TO_100NS(hours) (((LONGLONG)(hours)) * MINUTES_TO_100NS(60)) #define HOURS_TO_100NS(hours) (((LONGLONG)(hours)) * MINUTES_TO_100NS(60))
#define TYPE_ALIGNMENT(t) FIELD_OFFSET(struct { char x; t test; }, test) #define UNICODIZE1(x) L##x
#define UNICODIZE(x) UNICODIZE1(x)
#define InsertAscendingListFIFO(ListHead, Type, ListEntryField, NewEntry, SortField)\ #define InsertAscendingListFIFO(ListHead, Type, ListEntryField, NewEntry, SortField)\
{\ {\
PLIST_ENTRY current;\ PLIST_ENTRY current;\

View file

@ -22,10 +22,11 @@ typedef ULONG CSR_API_NUMBER;
#define CSR_CSRSS_SECTION_SIZE (65536) #define CSR_CSRSS_SECTION_SIZE (65536)
typedef __declspec(noreturn) VOID CALLBACK(*PCONTROLDISPATCHER)(DWORD); typedef VOID (CALLBACK *PCONTROLDISPATCHER)(DWORD);
typedef struct typedef struct
{ {
ULONG Dummy;
} CSRSS_CONNECT_PROCESS, *PCSRSS_CONNECT_PROCESS; } CSRSS_CONNECT_PROCESS, *PCSRSS_CONNECT_PROCESS;
typedef struct typedef struct
@ -40,6 +41,7 @@ typedef struct
typedef struct typedef struct
{ {
ULONG Dummy;
} CSRSS_TERMINATE_PROCESS, *PCSRSS_TERMINATE_PROCESS; } CSRSS_TERMINATE_PROCESS, *PCSRSS_TERMINATE_PROCESS;
typedef struct typedef struct
@ -80,6 +82,7 @@ typedef struct
typedef struct typedef struct
{ {
ULONG Dummy;
} CSRSS_FREE_CONSOLE, *PCSRSS_FREE_CONSOLE; } CSRSS_FREE_CONSOLE, *PCSRSS_FREE_CONSOLE;
typedef struct typedef struct

View file

@ -16,7 +16,7 @@ unsigned long DbgPrint(char *Format,...);
#ifdef DBG #ifdef DBG
#define DPRINT1 DbgPrint("(%s:%d:%s) ",__FILE__,__LINE__,__FUNCTION__), DbgPrint #define DPRINT1 DbgPrint("(%s:%d:%s) ",__FILE__,__LINE__,__FUNCTION__), DbgPrint
#else #else
#define DPRINT1(args...) #define DPRINT1(...)
#endif #endif
#if !defined(DBG) || !defined(YDEBUG) #if !defined(DBG) || !defined(YDEBUG)

View file

@ -41,20 +41,20 @@
#define WINE_UNICODE_API __attribute__((dllimport)) #define WINE_UNICODE_API __attribute__((dllimport))
#endif #endif
static inline WCHAR *strpbrkW( const WCHAR *str, const WCHAR *accept ) static __inline WCHAR *strpbrkW( const WCHAR *str, const WCHAR *accept )
{ {
for ( ; *str; str++) if (strchrW( accept, *str )) return (WCHAR *)str; for ( ; *str; str++) if (strchrW( accept, *str )) return (WCHAR *)str;
return NULL; return NULL;
} }
static inline WCHAR *memchrW( const WCHAR *ptr, WCHAR ch, size_t n ) static __inline WCHAR *memchrW( const WCHAR *ptr, WCHAR ch, size_t n )
{ {
const WCHAR *end; const WCHAR *end;
for (end = ptr + n; ptr < end; ptr++) if (*ptr == ch) return (WCHAR *)ptr; for (end = ptr + n; ptr < end; ptr++) if (*ptr == ch) return (WCHAR *)ptr;
return NULL; return NULL;
} }
static inline WCHAR *memrchrW( const WCHAR *ptr, WCHAR ch, size_t n ) static __inline WCHAR *memrchrW( const WCHAR *ptr, WCHAR ch, size_t n )
{ {
const WCHAR *end, *ret = NULL; const WCHAR *end, *ret = NULL;
for (end = ptr + n; ptr < end; ptr++) if (*ptr == ch) ret = ptr; for (end = ptr + n; ptr < end; ptr++) if (*ptr == ch) ret = ptr;

View file

@ -8,6 +8,9 @@
/* INCLUDES ******************************************************************/ /* INCLUDES ******************************************************************/
/* C Headers */
#include <stdio.h>
/* PSDK/NDK Headers */ /* PSDK/NDK Headers */
#include <windows.h> #include <windows.h>
#include <ntsecapi.h> #include <ntsecapi.h>

View file

@ -245,7 +245,7 @@ MakeAbsoluteSD (
{ {
NTSTATUS Status; NTSTATUS Status;
Status = RtlSelfRelativeToAbsoluteSD ((PSECURITY_DESCRIPTOR_RELATIVE)pSelfRelativeSecurityDescriptor, Status = RtlSelfRelativeToAbsoluteSD ((PISECURITY_DESCRIPTOR_RELATIVE)pSelfRelativeSecurityDescriptor,
pAbsoluteSecurityDescriptor, pAbsoluteSecurityDescriptor,
lpdwAbsoluteSecurityDescriptorSize, lpdwAbsoluteSecurityDescriptorSize,
pDacl, pDacl,
@ -280,7 +280,7 @@ MakeSelfRelativeSD (
NTSTATUS Status; NTSTATUS Status;
Status = RtlAbsoluteToSelfRelativeSD (pAbsoluteSecurityDescriptor, Status = RtlAbsoluteToSelfRelativeSD (pAbsoluteSecurityDescriptor,
(PSECURITY_DESCRIPTOR_RELATIVE)pSelfRelativeSecurityDescriptor, (PISECURITY_DESCRIPTOR_RELATIVE)pSelfRelativeSecurityDescriptor,
(PULONG)lpdwBufferLength); (PULONG)lpdwBufferLength);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {

View file

@ -1,3 +1,4 @@
#include <ctype.h>
#include <windows.h> #include <windows.h>
#include <winerror.h> #include <winerror.h>
#include <windns.h> #include <windns.h>

View file

@ -16,7 +16,7 @@
/* /*
* @implemented * @implemented
*/ */
BOOL WINAPI DebugBreakProcess(HANDLE Process) WINBASEAPI BOOL WINAPI DebugBreakProcess(HANDLE Process)
{ {
NTSTATUS nErrCode = DbgUiIssueRemoteBreakin(Process); NTSTATUS nErrCode = DbgUiIssueRemoteBreakin(Process);

View file

@ -169,8 +169,8 @@ FindNextChangeNotification (
} }
extern VOID STDCALL extern VOID
(ApcRoutine)(PVOID ApcContext, (STDCALL ApcRoutine)(PVOID ApcContext,
struct _IO_STATUS_BLOCK* IoStatusBlock, struct _IO_STATUS_BLOCK* IoStatusBlock,
ULONG Reserved); ULONG Reserved);

View file

@ -166,7 +166,7 @@ GetTempPathW (
WCHAR tmp_full_path[MAX_PATH]; WCHAR tmp_full_path[MAX_PATH];
UINT ret; UINT ret;
DPRINT("GetTempPathW(%lu,%p)\n", nBufferLength, lpBuffer); DPRINT("GetTempPathW(%lu,%p)\n", count, path);
if (!(ret = GetEnvironmentVariableW( L"TMP", tmp_path, MAX_PATH ))) if (!(ret = GetEnvironmentVariableW( L"TMP", tmp_path, MAX_PATH )))
if (!(ret = GetEnvironmentVariableW( L"TEMP", tmp_path, MAX_PATH ))) if (!(ret = GetEnvironmentVariableW( L"TEMP", tmp_path, MAX_PATH )))

View file

@ -60,13 +60,8 @@ CreateIoCompletionPort(
if ( FileHandle != INVALID_HANDLE_VALUE ) if ( FileHandle != INVALID_HANDLE_VALUE )
{ {
#ifdef __USE_W32API
CompletionInformation.Port = CompletionPort; CompletionInformation.Port = CompletionPort;
CompletionInformation.Key = (PVOID)CompletionKey; CompletionInformation.Key = (PVOID)CompletionKey;
#else
CompletionInformation.IoCompletionHandle = CompletionPort;
CompletionInformation.CompletionKey = CompletionKey;
#endif
errCode = NtSetInformationFile(FileHandle, errCode = NtSetInformationFile(FileHandle,
&IoStatusBlock, &IoStatusBlock,

View file

@ -4,14 +4,18 @@
#define UNIMPLEMENTED DbgPrint("%s at %s:%d is unimplemented\n",__FUNCTION__,__FILE__,__LINE__); #define UNIMPLEMENTED DbgPrint("%s at %s:%d is unimplemented\n",__FUNCTION__,__FILE__,__LINE__);
#ifdef NDEBUG #ifdef NDEBUG
#ifdef __GNUC__
#define DPRINT(args...) #define DPRINT(args...)
#else
#define DPRINT
#endif
#define CHECKPOINT #define CHECKPOINT
#ifdef ASSERT #ifdef ASSERT
#undef ASSERT #undef ASSERT
#endif #endif
#define ASSERT(x) #define ASSERT(x)
#else #else
#define DPRINT(args...) do { DbgPrint("(KERNEL32:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0); #define DPRINT(...) do { DbgPrint("(KERNEL32:%s:%d) ",__FILE__,__LINE__); DbgPrint(__VA_ARGS__); } while(0);
#define CHECKPOINT do { DbgPrint("(KERNEL32:%s:%d) Checkpoint\n",__FILE__,__LINE__); } while(0); #define CHECKPOINT do { DbgPrint("(KERNEL32:%s:%d) Checkpoint\n",__FILE__,__LINE__); } while(0);
#ifdef ASSERT #ifdef ASSERT
#undef ASSERT #undef ASSERT
@ -19,7 +23,7 @@
#define ASSERT(x) do { if(!x) RtlAssert("#x", __FILE__,__LINE__, ""); } while(0); #define ASSERT(x) do { if(!x) RtlAssert("#x", __FILE__,__LINE__, ""); } while(0);
#endif #endif
#define DPRINT1(args...) do { DbgPrint("(KERNEL32:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0); #define DPRINT1(...) do { DbgPrint("(KERNEL32:%s:%d) ",__FILE__,__LINE__); DbgPrint(__VA_ARGS__); } while(0);
#define CHECKPOINT1 do { DbgPrint("(KERNEL32:%s:%d) Checkpoint\n",__FILE__,__LINE__); } while(0); #define CHECKPOINT1 do { DbgPrint("(KERNEL32:%s:%d) Checkpoint\n",__FILE__,__LINE__); } while(0);
#endif /* ndef _KERNEL32_INCLUDE_DEBUG_H */ #endif /* ndef _KERNEL32_INCLUDE_DEBUG_H */

View file

@ -9,20 +9,23 @@
/* INCLUDES ******************************************************************/ /* INCLUDES ******************************************************************/
/* PSDK/NDK Headers */ /* PSDK/NDK Headers */
#include <windows.h>
#define NTOS_MODE_USER #define NTOS_MODE_USER
#define _KERNEL32_
#define _WMIKM_
#include <windows.h>
#include <ndk/ntndk.h> #include <ndk/ntndk.h>
/* CSRSS Header */ /* CSRSS Header */
#include <csrss/csrss.h> #include <csrss/csrss.h>
/* C Headers */ /* C Headers */
#include <ctype.h>
#include <stdio.h>
#include <wchar.h> #include <wchar.h>
/* DDK Driver Headers */ /* DDK Driver Headers */
#include <ddk/ntddbeep.h> #include <ntddbeep.h>
#include <ddk/ntddser.h> #include <ntddser.h>
#include <ddk/ntddtape.h>
/* Internal Kernel32 Header */ /* Internal Kernel32 Header */
#include "include/kernel32.h" #include "include/kernel32.h"

View file

@ -4,6 +4,7 @@
#define REACTOS_STR_ORIGINAL_FILENAME "kernel32.dll\0" #define REACTOS_STR_ORIGINAL_FILENAME "kernel32.dll\0"
#include <reactos/version.rc> #include <reactos/version.rc>
#include "windows.h"
#include "errcodes.rc" #include "errcodes.rc"
#include "locale_rc.rc" #include "locale_rc.rc"

View file

@ -516,13 +516,14 @@ GetConsoleFontInfo (DWORD Unknown0,
/* /*
* @unimplemented * @unimplemented
*/ */
DWORD STDCALL COORD STDCALL
GetConsoleFontSize(HANDLE hConsoleOutput, GetConsoleFontSize(HANDLE hConsoleOutput,
DWORD nFont) DWORD nFont)
{ {
COORD Empty = {0, 0};
DPRINT1("GetConsoleFontSize(0x%x, 0x%x) UNIMPLEMENTED!\n", hConsoleOutput, nFont); DPRINT1("GetConsoleFontSize(0x%x, 0x%x) UNIMPLEMENTED!\n", hConsoleOutput, nFont);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0; return Empty ;
} }

View file

@ -33,7 +33,7 @@
/* strdup macros */ /* strdup macros */
/* DO NOT USE IT!! it will go away soon */ /* DO NOT USE IT!! it will go away soon */
inline static LPSTR HEAP_strdupWtoA( HANDLE heap, DWORD flags, LPCWSTR str ) __inline static LPSTR HEAP_strdupWtoA( HANDLE heap, DWORD flags, LPCWSTR str )
{ {
LPSTR ret; LPSTR ret;
INT len; INT len;

View file

@ -769,7 +769,7 @@ GetLocaleInfoW (
* *
* Retrieve the ANSI codepage for a given locale. * Retrieve the ANSI codepage for a given locale.
*/ */
inline static UINT get_lcid_codepage( LCID lcid ) __inline static UINT get_lcid_codepage( LCID lcid )
{ {
UINT ret; UINT ret;
if (!GetLocaleInfoW( lcid, LOCALE_IDEFAULTANSICODEPAGE|LOCALE_RETURN_NUMBER, (WCHAR *)&ret, if (!GetLocaleInfoW( lcid, LOCALE_IDEFAULTANSICODEPAGE|LOCALE_RETURN_NUMBER, (WCHAR *)&ret,

View file

@ -1,7 +1,7 @@
/* $Id$ /* $Id$
* *
*/ */
#include <windows.h> #include <k32.h>
/*********************************************************************** /***********************************************************************

View file

@ -879,7 +879,7 @@ GetOEMCP (VOID)
return OemCodePage.CodePageTable.CodePage; return OemCodePage.CodePageTable.CodePage;
} }
static inline BOOL static __inline BOOL
IntIsLeadByte(PCPTABLEINFO TableInfo, UCHAR Ch) IntIsLeadByte(PCPTABLEINFO TableInfo, UCHAR Ch)
{ {
if(TableInfo->MaximumCharacterSize == 2) if(TableInfo->MaximumCharacterSize == 2)

View file

@ -22,7 +22,7 @@
#include <k32.h> #include <k32.h>
#define NDEBUG #define NDEBUG
#include "debug.h" #include "../include/debug.h"
static const char bom_utf8[] = {0xEF,0xBB,0xBF}; static const char bom_utf8[] = {0xEF,0xBB,0xBF};
@ -84,7 +84,7 @@ static RTL_CRITICAL_SECTION PROFILE_CritSect = { &critsect_debug, -1, 0, 0, 0, 0
static const char hex[16] = "0123456789ABCDEF"; static const char hex[16] = "0123456789ABCDEF";
static inline WCHAR *memchrW( const WCHAR *ptr, WCHAR ch, size_t n ) static __inline WCHAR *memchrW( const WCHAR *ptr, WCHAR ch, size_t n )
{ {
const WCHAR *end; const WCHAR *end;
for (end = ptr + n; ptr < end; ptr++) for (end = ptr + n; ptr < end; ptr++)
@ -93,7 +93,7 @@ static inline WCHAR *memchrW( const WCHAR *ptr, WCHAR ch, size_t n )
return NULL; return NULL;
} }
static inline WCHAR *memrchrW( const WCHAR *ptr, WCHAR ch, size_t n ) static __inline WCHAR *memrchrW( const WCHAR *ptr, WCHAR ch, size_t n )
{ {
const WCHAR *end, *ret = NULL; const WCHAR *end, *ret = NULL;
for (end = ptr + n; ptr < end; ptr++) for (end = ptr + n; ptr < end; ptr++)
@ -129,7 +129,7 @@ static void PROFILE_CopyEntry( LPWSTR buffer, LPCWSTR value, int len,
/* byte-swaps shorts in-place in a buffer. len is in WCHARs */ /* byte-swaps shorts in-place in a buffer. len is in WCHARs */
static inline void PROFILE_ByteSwapShortBuffer(WCHAR * buffer, int len) static __inline void PROFILE_ByteSwapShortBuffer(WCHAR * buffer, int len)
{ {
int i; int i;
USHORT * shortbuffer = (USHORT *)buffer; USHORT * shortbuffer = (USHORT *)buffer;
@ -139,7 +139,7 @@ static inline void PROFILE_ByteSwapShortBuffer(WCHAR * buffer, int len)
/* writes any necessary encoding marker to the file */ /* writes any necessary encoding marker to the file */
static inline void PROFILE_WriteMarker(HANDLE hFile, ENCODING encoding) static __inline void PROFILE_WriteMarker(HANDLE hFile, ENCODING encoding)
{ {
DWORD dwBytesWritten; DWORD dwBytesWritten;
DWORD bom; DWORD bom;
@ -288,7 +288,7 @@ static void PROFILE_Free( PROFILESECTION *section )
/* returns 1 if a character white space else 0 */ /* returns 1 if a character white space else 0 */
static inline int PROFILE_isspaceW(WCHAR c) static __inline int PROFILE_isspaceW(WCHAR c)
{ {
if (iswspace(c)) if (iswspace(c))
return 1; return 1;
@ -299,7 +299,7 @@ static inline int PROFILE_isspaceW(WCHAR c)
} }
static inline ENCODING PROFILE_DetectTextEncoding(const void * buffer, int * len) static __inline ENCODING PROFILE_DetectTextEncoding(const void * buffer, int * len)
{ {
DWORD flags = IS_TEXT_UNICODE_SIGNATURE | DWORD flags = IS_TEXT_UNICODE_SIGNATURE |
IS_TEXT_UNICODE_REVERSE_SIGNATURE | IS_TEXT_UNICODE_REVERSE_SIGNATURE |

View file

@ -11,7 +11,7 @@
#include <k32.h> #include <k32.h>
#define NDEBUG #define NDEBUG
#include <debug.h> #include "../include/debug.h"
/* FUNCTIONS ****************************************************************/ /* FUNCTIONS ****************************************************************/

View file

@ -43,7 +43,6 @@ GetVersion(VOID)
return nVersion; return nVersion;
} }
/* /*
* @implemented * @implemented
*/ */
@ -83,7 +82,7 @@ GetVersionExW(
PWCHAR szVer = lpVersionInformation->szCSDVersion + ln; PWCHAR szVer = lpVersionInformation->szCSDVersion + ln;
RtlZeroMemory(szVer, (maxlen - ln + 1) * sizeof(WCHAR)); RtlZeroMemory(szVer, (maxlen - ln + 1) * sizeof(WCHAR));
wcsncpy(szVer, wcsncpy(szVer,
L"ReactOS " KERNEL_VERSION_STR L" (Build " KERNEL_VERSION_BUILD_STR L")", L"ReactOS " UNICODIZE(KERNEL_VERSION_STR) L" (Build " UNICODIZE(KERNEL_VERSION_BUILD_STR) L")",
maxlen - ln); maxlen - ln);
} }

View file

@ -1,5 +1,4 @@
#include <windows.h> #include <k32.h>
#include "regtests.h"
int int
mainCRTStartup(int argc, char *argv[]) mainCRTStartup(int argc, char *argv[])

View file

@ -1,6 +1,7 @@
#include "../../k32.h" #include <k32.h>
#include "regtests.h"
#ifdef __GNUC__
#include "regtests.h"
#define NDEBUG #define NDEBUG
#include "../../include/debug.h" #include "../../include/debug.h"
@ -124,3 +125,5 @@ static void RunTest()
} }
_Dispatcher(CreatefileTest, "CreateFileW") _Dispatcher(CreatefileTest, "CreateFileW")
#endif

View file

@ -8,6 +8,10 @@
/* INCLUDES ******************************************************************/ /* INCLUDES ******************************************************************/
/* C Headers */
#include <stdio.h>
#include <ctype.h>
/* SDK/DDK/NDK Headers. */ /* SDK/DDK/NDK Headers. */
#include <windows.h> #include <windows.h>
#define NTOS_MODE_USER #define NTOS_MODE_USER

View file

@ -8,6 +8,9 @@
/* INCLUDES ******************************************************************/ /* INCLUDES ******************************************************************/
/* C Headers */
#include <stdio.h>
/* PSDK/NDK Headers */ /* PSDK/NDK Headers */
#include <windows.h> #include <windows.h>
#define NTOS_MODE_USER #define NTOS_MODE_USER

View file

@ -28,7 +28,7 @@ RtlpQuerySecurityDescriptorPointers(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
{ {
if (SecurityDescriptor->Control & SE_SELF_RELATIVE) if (SecurityDescriptor->Control & SE_SELF_RELATIVE)
{ {
PSECURITY_DESCRIPTOR_RELATIVE RelSD = (PSECURITY_DESCRIPTOR_RELATIVE)SecurityDescriptor; PISECURITY_DESCRIPTOR_RELATIVE RelSD = (PISECURITY_DESCRIPTOR_RELATIVE)SecurityDescriptor;
if(Owner != NULL) if(Owner != NULL)
{ {
*Owner = ((RelSD->Owner != 0) ? (PSID)((ULONG_PTR)RelSD + RelSD->Owner) : NULL); *Owner = ((RelSD->Owner != 0) ? (PSID)((ULONG_PTR)RelSD + RelSD->Owner) : NULL);
@ -134,7 +134,7 @@ RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor,
NTSTATUS STDCALL NTSTATUS STDCALL
RtlCreateSecurityDescriptorRelative (PSECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor, RtlCreateSecurityDescriptorRelative (PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor,
ULONG Revision) ULONG Revision)
{ {
PAGED_CODE_RTL(); PAGED_CODE_RTL();
@ -429,7 +429,7 @@ RtlGetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor,
*/ */
NTSTATUS STDCALL NTSTATUS STDCALL
RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR AbsSD, RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR AbsSD,
PSECURITY_DESCRIPTOR_RELATIVE RelSD, PISECURITY_DESCRIPTOR_RELATIVE RelSD,
PULONG BufferLength) PULONG BufferLength)
{ {
PSID Owner; PSID Owner;
@ -514,7 +514,7 @@ RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR AbsSD,
*/ */
NTSTATUS STDCALL NTSTATUS STDCALL
RtlAbsoluteToSelfRelativeSD(PSECURITY_DESCRIPTOR AbsSD, RtlAbsoluteToSelfRelativeSD(PSECURITY_DESCRIPTOR AbsSD,
PSECURITY_DESCRIPTOR_RELATIVE RelSD, PISECURITY_DESCRIPTOR_RELATIVE RelSD,
PULONG BufferLength) PULONG BufferLength)
{ {
PAGED_CODE_RTL(); PAGED_CODE_RTL();
@ -655,7 +655,7 @@ RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor,
* @implemented * @implemented
*/ */
NTSTATUS STDCALL NTSTATUS STDCALL
RtlSelfRelativeToAbsoluteSD(PSECURITY_DESCRIPTOR_RELATIVE RelSD, RtlSelfRelativeToAbsoluteSD(PISECURITY_DESCRIPTOR_RELATIVE RelSD,
PSECURITY_DESCRIPTOR AbsSD, PSECURITY_DESCRIPTOR AbsSD,
PDWORD AbsSDSize, PDWORD AbsSDSize,
PACL Dacl, PACL Dacl,
@ -732,7 +732,7 @@ RtlSelfRelativeToAbsoluteSD(PSECURITY_DESCRIPTOR_RELATIVE RelSD,
* @unimplemented * @unimplemented
*/ */
NTSTATUS STDCALL NTSTATUS STDCALL
RtlSelfRelativeToAbsoluteSD2(PSECURITY_DESCRIPTOR_RELATIVE SelfRelativeSecurityDescriptor, RtlSelfRelativeToAbsoluteSD2(PISECURITY_DESCRIPTOR_RELATIVE SelfRelativeSecurityDescriptor,
PULONG BufferSize) PULONG BufferSize)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
@ -744,7 +744,7 @@ RtlSelfRelativeToAbsoluteSD2(PSECURITY_DESCRIPTOR_RELATIVE SelfRelativeSecurityD
* @implemented * @implemented
*/ */
BOOLEAN STDCALL BOOLEAN STDCALL
RtlValidRelativeSecurityDescriptor(IN PSECURITY_DESCRIPTOR_RELATIVE SecurityDescriptorInput, RtlValidRelativeSecurityDescriptor(IN PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptorInput,
IN ULONG SecurityDescriptorLength, IN ULONG SecurityDescriptorLength,
IN SECURITY_INFORMATION RequiredInformation) IN SECURITY_INFORMATION RequiredInformation)
{ {

View file

@ -1,3 +1,4 @@
#include <stdio.h>
#include <windows.h> #include <windows.h>
#define NTOS_MODE_USER #define NTOS_MODE_USER
#include <ndk/ntndk.h> #include <ndk/ntndk.h>

View file

@ -176,6 +176,7 @@ typedef struct _MEMORY_AREA
} Data; } Data;
} MEMORY_AREA, *PMEMORY_AREA; } MEMORY_AREA, *PMEMORY_AREA;
#ifndef _MMTYPES_H
typedef struct _MADDRESS_SPACE typedef struct _MADDRESS_SPACE
{ {
PMEMORY_AREA MemoryAreaRoot; PMEMORY_AREA MemoryAreaRoot;
@ -185,6 +186,7 @@ typedef struct _MADDRESS_SPACE
PUSHORT PageTableRefCountTable; PUSHORT PageTableRefCountTable;
ULONG PageTableRefCountTableSize; ULONG PageTableRefCountTableSize;
} MADDRESS_SPACE, *PMADDRESS_SPACE; } MADDRESS_SPACE, *PMADDRESS_SPACE;
#endif
typedef struct typedef struct
{ {

View file

@ -11,9 +11,6 @@
/* We are the Kernel */ /* We are the Kernel */
#define NTKERNELAPI #define NTKERNELAPI
/* include the ntoskrnl config.h file */
#include "config.h"
/* DDK/IFS/NDK Headers */ /* DDK/IFS/NDK Headers */
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <ddk/ntifs.h> #include <ddk/ntifs.h>
@ -37,6 +34,8 @@
#include <diskdump/diskdump.h> #include <diskdump/diskdump.h>
/* C Headers */ /* C Headers */
#include <stdio.h>
#include <ctype.h>
#include <malloc.h> #include <malloc.h>
#include <wchar.h> #include <wchar.h>
@ -48,3 +47,4 @@
/* Internal Headers */ /* Internal Headers */
#include "internal/ntoskrnl.h" #include "internal/ntoskrnl.h"
#include "config.h"

View file

@ -404,7 +404,7 @@ SeCaptureSecurityDescriptor(
sizeof(ULONG)); sizeof(ULONG));
if(DescriptorCopy.Control & SE_SELF_RELATIVE) if(DescriptorCopy.Control & SE_SELF_RELATIVE)
{ {
PSECURITY_DESCRIPTOR_RELATIVE RelSD = (PSECURITY_DESCRIPTOR_RELATIVE)OriginalSecurityDescriptor; PISECURITY_DESCRIPTOR_RELATIVE RelSD = (PISECURITY_DESCRIPTOR_RELATIVE)OriginalSecurityDescriptor;
DescriptorCopy.Owner = (PSID)RelSD->Owner; DescriptorCopy.Owner = (PSID)RelSD->Owner;
DescriptorCopy.Group = (PSID)RelSD->Group; DescriptorCopy.Group = (PSID)RelSD->Group;
@ -455,7 +455,7 @@ SeCaptureSecurityDescriptor(
sizeof(SECURITY_DESCRIPTOR_RELATIVE) : sizeof(SECURITY_DESCRIPTOR)); sizeof(SECURITY_DESCRIPTOR_RELATIVE) : sizeof(SECURITY_DESCRIPTOR));
if(DescriptorCopy.Control & SE_SELF_RELATIVE) if(DescriptorCopy.Control & SE_SELF_RELATIVE)
{ {
PSECURITY_DESCRIPTOR_RELATIVE RelSD = (PSECURITY_DESCRIPTOR_RELATIVE)OriginalSecurityDescriptor; PISECURITY_DESCRIPTOR_RELATIVE RelSD = (PISECURITY_DESCRIPTOR_RELATIVE)OriginalSecurityDescriptor;
DescriptorCopy.Owner = (PSID)RelSD->Owner; DescriptorCopy.Owner = (PSID)RelSD->Owner;
DescriptorCopy.Group = (PSID)RelSD->Group; DescriptorCopy.Group = (PSID)RelSD->Group;
@ -675,7 +675,7 @@ SeQuerySecurityDescriptorInfo(IN PSECURITY_INFORMATION SecurityInformation,
IN PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor OPTIONAL) IN PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor OPTIONAL)
{ {
PSECURITY_DESCRIPTOR ObjectSd; PSECURITY_DESCRIPTOR ObjectSd;
PSECURITY_DESCRIPTOR_RELATIVE RelSD; PISECURITY_DESCRIPTOR_RELATIVE RelSD;
PSID Owner = NULL; PSID Owner = NULL;
PSID Group = NULL; PSID Group = NULL;
PACL Dacl = NULL; PACL Dacl = NULL;
@ -688,7 +688,7 @@ SeQuerySecurityDescriptorInfo(IN PSECURITY_INFORMATION SecurityInformation,
ULONG_PTR Current; ULONG_PTR Current;
ULONG SdLength; ULONG SdLength;
RelSD = (PSECURITY_DESCRIPTOR_RELATIVE)SecurityDescriptor; RelSD = (PISECURITY_DESCRIPTOR_RELATIVE)SecurityDescriptor;
if (*ObjectsSecurityDescriptor == NULL) if (*ObjectsSecurityDescriptor == NULL)
{ {

View file

@ -29,6 +29,7 @@
#define UNICODE #define UNICODE
#include <stdio.h>
#include <windows.h> #include <windows.h>
#define NTOS_MODE_USER #define NTOS_MODE_USER
#include <ndk/ntndk.h> #include <ndk/ntndk.h>

View file

@ -1,4 +1,5 @@
/* PSDK/NDK Headers */ /* PSDK/NDK Headers */
#include <stdio.h>
#include <windows.h> #include <windows.h>
#define NTOS_MODE_USER #define NTOS_MODE_USER
#include <ndk/ntndk.h> #include <ndk/ntndk.h>

View file

@ -1,6 +1,7 @@
#ifndef _SMSS_H_INCLUDED_ #ifndef _SMSS_H_INCLUDED_
#define _SMSS_H_INCLUDED_ #define _SMSS_H_INCLUDED_
#include <stdio.h>
#include <windows.h> #include <windows.h>
#define NTOS_MODE_USER #define NTOS_MODE_USER
#include <ndk/ntndk.h> #include <ndk/ntndk.h>

View file

@ -27,6 +27,7 @@
/* INCLUDES *****************************************************************/ /* INCLUDES *****************************************************************/
#include <stdio.h>
#include <windows.h> #include <windows.h>
#define NTOS_MODE_USER #define NTOS_MODE_USER
#include <ndk/ntndk.h> #include <ndk/ntndk.h>

View file

@ -1,3 +1,4 @@
#include <stdio.h>
#include <windows.h> #include <windows.h>
#define NTOS_MODE_USER #define NTOS_MODE_USER
#include <ndk/ntndk.h> #include <ndk/ntndk.h>

View file

@ -3442,7 +3442,7 @@ NTSTATUS
NTAPI NTAPI
RtlAbsoluteToSelfRelativeSD ( RtlAbsoluteToSelfRelativeSD (
IN PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor, IN PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor,
IN OUT PSECURITY_DESCRIPTOR_RELATIVE SelfRelativeSecurityDescriptor, IN OUT PISECURITY_DESCRIPTOR_RELATIVE SelfRelativeSecurityDescriptor,
IN PULONG BufferLength IN PULONG BufferLength
); );

View file

@ -5640,7 +5640,7 @@ NTOSAPI
BOOLEAN BOOLEAN
DDKAPI DDKAPI
RtlValidRelativeSecurityDescriptor( RtlValidRelativeSecurityDescriptor(
IN PSECURITY_DESCRIPTOR_RELATIVE SecurityDescriptorInput, IN PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptorInput,
IN ULONG SecurityDescriptorLength, IN ULONG SecurityDescriptorLength,
IN SECURITY_INFORMATION RequiredInformation); IN SECURITY_INFORMATION RequiredInformation);

View file

@ -72,4 +72,5 @@ typedef struct _OBJECT_ATTRIBUTES {
#endif #endif
#define NOTHING #define NOTHING
#define RTL_CONSTANT_STRING(s) { sizeof(s)-sizeof((s)[0]), sizeof(s), s } #define RTL_CONSTANT_STRING(s) { sizeof(s)-sizeof((s)[0]), sizeof(s), s }
#define TYPE_ALIGNMENT( t ) FIELD_OFFSET( struct { char x; t test; }, test )
#endif /* _NTDEF_H */ #endif /* _NTDEF_H */

View file

@ -1,12 +1,15 @@
#ifndef _WINBASE_H #ifndef _WINBASE_
#define _WINBASE_H #define _WINBASE_
#if __GNUC__ >= 3 #if __GNUC__ >= 3
#pragma GCC system_header #pragma GCC system_header
#endif #endif
#ifndef WINBASEAPI #if !defined(_KERNEL32_)
#define WINBASEAPI DECLSPEC_IMPORT #define WINBASEAPI DECLSPEC_IMPORT
#else
#define WINBASEAPI
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif

View file

@ -44,6 +44,7 @@
#include <winresrc.h> #include <winresrc.h>
#else #else
#include <excpt.h>
#include <stdarg.h> #include <stdarg.h>
#include <windef.h> #include <windef.h>
#include <wincon.h> #include <wincon.h>

View file

@ -399,6 +399,7 @@ typedef DWORD FLONG;
* a SID_IDENTIFIER_AUTHORITY, eg. * a SID_IDENTIFIER_AUTHORITY, eg.
* SID_IDENTIFIER_AUTHORITY aNullSidAuthority = {SECURITY_NULL_SID_AUTHORITY}; * SID_IDENTIFIER_AUTHORITY aNullSidAuthority = {SECURITY_NULL_SID_AUTHORITY};
*/ */
#define SID_MAX_SUB_AUTHORITIES 15
#define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0} #define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0}
#define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1} #define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1}
#define SECURITY_LOCAL_SID_AUTHORITY {0,0,0,0,0,2} #define SECURITY_LOCAL_SID_AUTHORITY {0,0,0,0,0,2}
@ -2170,14 +2171,14 @@ typedef struct _SECURITY_DESCRIPTOR {
PACL Dacl; PACL Dacl;
} SECURITY_DESCRIPTOR, *PSECURITY_DESCRIPTOR, *PISECURITY_DESCRIPTOR; } SECURITY_DESCRIPTOR, *PSECURITY_DESCRIPTOR, *PISECURITY_DESCRIPTOR;
typedef struct _SECURITY_DESCRIPTOR_RELATIVE { typedef struct _SECURITY_DESCRIPTOR_RELATIVE {
UCHAR Revision; BYTE Revision;
UCHAR Sbz1; BYTE Sbz1;
SECURITY_DESCRIPTOR_CONTROL Control; SECURITY_DESCRIPTOR_CONTROL Control;
ULONG Owner; DWORD Owner;
ULONG Group; DWORD Group;
ULONG Sacl; DWORD Sacl;
ULONG Dacl; DWORD Dacl;
} SECURITY_DESCRIPTOR_RELATIVE, *PSECURITY_DESCRIPTOR_RELATIVE, *PISECURITY_DESCRIPTOR_RELATIVE; } SECURITY_DESCRIPTOR_RELATIVE, *PISECURITY_DESCRIPTOR_RELATIVE;
typedef enum _TOKEN_INFORMATION_CLASS { typedef enum _TOKEN_INFORMATION_CLASS {
TokenUser=1,TokenGroups,TokenPrivileges,TokenOwner, TokenUser=1,TokenGroups,TokenPrivileges,TokenOwner,
TokenPrimaryGroup,TokenDefaultDacl,TokenSource,TokenType, TokenPrimaryGroup,TokenDefaultDacl,TokenSource,TokenType,
@ -3021,6 +3022,13 @@ typedef union _FILE_SEGMENT_ELEMENT {
#define JOB_OBJECT_MSG_PROCESS_MEMORY_LIMIT 9 #define JOB_OBJECT_MSG_PROCESS_MEMORY_LIMIT 9
#define JOB_OBJECT_MSG_JOB_MEMORY_LIMIT 10 #define JOB_OBJECT_MSG_JOB_MEMORY_LIMIT 10
#define JOB_OBJECT_ASSIGN_PROCESS 1
#define JOB_OBJECT_SET_ATTRIBUTES 2
#define JOB_OBJECT_QUERY 4
#define JOB_OBJECT_TERMINATE 8
#define JOB_OBJECT_SET_SECURITY_ATTRIBUTES 16
#define JOB_OBJECT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|31)
typedef enum _JOBOBJECTINFOCLASS { typedef enum _JOBOBJECTINFOCLASS {
JobObjectBasicAccountingInformation = 1, JobObjectBasicAccountingInformation = 1,
JobObjectBasicLimitInformation, JobObjectBasicLimitInformation,
@ -3095,7 +3103,6 @@ typedef struct _JOBOBJECT_JOBSET_INFORMATION {
/* Fixme: Making these defines conditional on WINVER will break ddk includes */ /* Fixme: Making these defines conditional on WINVER will break ddk includes */
#if 1 /* (WINVER >= 0x0500) */ #if 1 /* (WINVER >= 0x0500) */
#include <pshpack4.h>
#define ES_SYSTEM_REQUIRED 0x00000001 #define ES_SYSTEM_REQUIRED 0x00000001
#define ES_DISPLAY_REQUIRED 0x00000002 #define ES_DISPLAY_REQUIRED 0x00000002
@ -3387,7 +3394,6 @@ typedef struct _ADMINISTRATOR_POWER_POLICY {
ULONG MinSpindownTimeout; ULONG MinSpindownTimeout;
ULONG MaxSpindownTimeout; ULONG MaxSpindownTimeout;
} ADMINISTRATOR_POWER_POLICY, *PADMINISTRATOR_POWER_POLICY; } ADMINISTRATOR_POWER_POLICY, *PADMINISTRATOR_POWER_POLICY;
#include <poppack.h>
#endif /* WINVER >= 0x0500 */ #endif /* WINVER >= 0x0500 */
typedef VOID (NTAPI *WAITORTIMERCALLBACKFUNC)(PVOID,BOOLEAN); typedef VOID (NTAPI *WAITORTIMERCALLBACKFUNC)(PVOID,BOOLEAN);
@ -3404,6 +3410,14 @@ typedef OSVERSIONINFOEXA OSVERSIONINFOEX,*POSVERSIONINFOEX,*LPOSVERSIONINFOEX;
ULONGLONG WINAPI VerSetConditionMask(ULONGLONG,DWORD,BYTE); ULONGLONG WINAPI VerSetConditionMask(ULONGLONG,DWORD,BYTE);
#endif #endif
SIZE_T
STDCALL
RtlCompareMemory (
const VOID *Source1,
const VOID *Source2,
SIZE_T Length
);
#if defined(__GNUC__) #if defined(__GNUC__)
static __inline__ PVOID GetCurrentFiber(void) static __inline__ PVOID GetCurrentFiber(void)