Author: sginsberg Date: Sun Aug 16 22:08:48 2009 New Revision: 42744
URL: http://svn.reactos.org/svn/reactos?rev=42744&view=rev Log: - Revert 32309 -- instead of removing FORCEINLINE to make GCC happy (it can't inline functions using va_list), use __inline to merely hint that the function should be inlined. This lets you use RtlStringCbPrintfA and RtlStringCbPrintfExA in multiple source files as the functions aren't static. - Moreover, there is no reason to forceinline all the RtlString* routines -- they are quite big and the compiler should be allowed to optimize here as it likes, so just use __inline. Also add RtlStringCchCopyA and re-enable ASSERTMSG and use it for the stubs. - Add missing GUID_CLASS_COMPORT and GUID_SERENUM_BUS_ENUMERATOR to ntddser.h - Add driverspecs.h to stub out Driver Verifier annotations - The WDK serenum source sample now compiles with our header set.
Added: trunk/reactos/include/ddk/driverspecs.h (with props) Modified: trunk/reactos/include/ddk/ntddser.h trunk/reactos/include/ddk/ntstrsafe.h trunk/reactos/ntoskrnl/mm/sysldr.c
Added: trunk/reactos/include/ddk/driverspecs.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/driverspecs.h?r... ============================================================================== --- trunk/reactos/include/ddk/driverspecs.h (added) +++ trunk/reactos/include/ddk/driverspecs.h [iso-8859-1] Sun Aug 16 22:08:48 2009 @@ -1,0 +1,29 @@ +/* + * PROJECT: ReactOS DDK + * COPYRIGHT: This file is in the Public Domain. + * FILE: driverspecs.h + * ABSTRACT: This header stubs out Driver Verifier annotations to + * allow drivers using them to compile with our header set. + */ + +// +// Stubs +// +#define __drv_dispatchType(x) +#define __drv_dispatchType_other + +// +// FIXME: These annotations are not driver-only and does not belong here +// +#define __in +#define __in_bcount(Size) +#define __in_ecount(Size) + +#define __out +#define __out_bcount(Size) +#define __out_bcount_part(Size, Length) +#define __out_ecount(Size) + +#define __inout + +#define __deref_out_ecount(Size)
Propchange: trunk/reactos/include/ddk/driverspecs.h ------------------------------------------------------------------------------ svn:eol-style = native
Modified: trunk/reactos/include/ddk/ntddser.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntddser.h?rev=4... ============================================================================== --- trunk/reactos/include/ddk/ntddser.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/ntddser.h [iso-8859-1] Sun Aug 16 22:08:48 2009 @@ -32,8 +32,12 @@ DEFINE_GUID(GUID_DEVINTERFACE_COMPORT, 0x86e0d1e0L, 0x8089, 0x11d0, 0x9c, 0xe4, 0x08, 0x00, 0x3e, 0x30, 0x1f, 0x73);
+#define GUID_CLASS_COMPORT GUID_DEVINTERFACE_COMPORT + DEFINE_GUID(GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR, 0x4D36E978L, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); + +#define GUID_SERENUM_BUS_ENUMERATOR GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR
#define IOCTL_SERIAL_CLEAR_STATS \ CTL_CODE (FILE_DEVICE_SERIAL_PORT, 36, METHOD_BUFFERED, FILE_ANY_ACCESS)
Modified: trunk/reactos/include/ddk/ntstrsafe.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntstrsafe.h?rev... ============================================================================== --- trunk/reactos/include/ddk/ntstrsafe.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/ntstrsafe.h [iso-8859-1] Sun Aug 16 22:08:48 2009 @@ -31,13 +31,9 @@ // typedef unsigned long DWORD;
-#ifndef UNIMPLEMENTED -#define UNIMPLEMENTED DbgPrint("WARNING: %s at %s:%d is UNIMPLEMENTED!\n",__FUNCTION__,__FILE__,__LINE__); -#endif - /* PRIVATE FUNCTIONS *********************************************************/
-FORCEINLINE +__inline NTSTATUS NTAPI RtlStringLengthWorkerA(IN PCHAR String, @@ -70,7 +66,7 @@ return Status; }
-FORCEINLINE +__inline NTSTATUS NTAPI RtlStringValidateDestA(IN PCHAR Destination, @@ -99,7 +95,7 @@ return Status; }
-FORCEINLINE +__inline NTSTATUS NTAPI RtlStringExValidateDestA(IN OUT PCHAR *Destination, @@ -108,14 +104,14 @@ IN SIZE_T MaxLength, IN DWORD Flags) { - //ASSERTMSG("We don't support Extended Flags yet!\n", Flags == 0); + ASSERTMSG("We don't support Extended Flags yet!\n", Flags == 0); return RtlStringValidateDestA(*Destination, *DestinationLength, ReturnLength, MaxLength); }
-FORCEINLINE +__inline NTSTATUS NTAPI RtlStringExValidateSrcA(IN OUT PCCHAR *Source OPTIONAL, @@ -124,7 +120,7 @@ IN DWORD Flags) { NTSTATUS Status = STATUS_SUCCESS; - //ASSERTMSG("We don't support Extended Flags yet!\n", Flags == 0); + ASSERTMSG("We don't support Extended Flags yet!\n", Flags == 0);
if ((ReturnLength) && (*ReturnLength >= MaxLength)) { @@ -134,7 +130,7 @@ return Status; }
-FORCEINLINE +__inline NTSTATUS NTAPI RtlStringVPrintfWorkerA(OUT PCHAR Destination, @@ -175,7 +171,7 @@ return Status; }
-FORCEINLINE +__inline NTSTATUS NTAPI RtlStringCopyWorkerA(OUT PCHAR Destination, @@ -212,6 +208,18 @@
/* PUBLIC FUNCTIONS **********************************************************/
+__inline +NTSTATUS +NTAPI +RtlStringCchCopyA(IN PCHAR Destination, + IN SIZE_T cchDest, + IN PCCHAR pszSrc) +{ + ASSERTMSG("RtlStringCchCopyA is UNIMPLEMENTED!\n", FALSE); + return STATUS_NOT_IMPLEMENTED; +} + +__inline NTSTATUS NTAPI RtlStringCbPrintfA(OUT PCHAR Destination, @@ -241,6 +249,7 @@ return Status; }
+__inline NTSTATUS NTAPI RtlStringCbPrintfExA(OUT PCHAR Destination, @@ -255,7 +264,7 @@ SIZE_T CharLength = Length / sizeof(CHAR), Remaining, LocalNewLength = 0; PCHAR LocalDestinationEnd; va_list argList; - //ASSERTMSG("We don't support Extended Flags yet!\n", Flags == 0); + ASSERTMSG("We don't support Extended Flags yet!\n", Flags == 0);
Status = RtlStringExValidateDestA(&Destination, &CharLength, @@ -321,7 +330,7 @@ return Status; }
-FORCEINLINE +__inline NTSTATUS NTAPI RtlStringCbCopyExA(OUT PCHAR Destination, @@ -334,7 +343,7 @@ NTSTATUS Status; SIZE_T CharLength = Length / sizeof(CHAR), Copied = 0, Remaining; PCHAR LocalDestinationEnd; - //ASSERTMSG("We don't support Extended Flags yet!\n", Flags == 0); + ASSERTMSG("We don't support Extended Flags yet!\n", Flags == 0);
Status = RtlStringExValidateDestA(&Destination, &Length, @@ -398,7 +407,7 @@ return Status; }
- +__inline NTSTATUS NTAPI RtlStringCbPrintfW( @@ -407,11 +416,11 @@ IN LPCWSTR pszFormat, ...) { - UNIMPLEMENTED + ASSERTMSG("RtlStringCbPrintfW is UNIMPLEMENTED!\n", FALSE); return STATUS_NOT_IMPLEMENTED; }
-FORCEINLINE +__inline NTSTATUS NTAPI RtlStringCbCatExA(IN OUT PCHAR Destination, @@ -425,7 +434,7 @@ SIZE_T CharLength = Length / sizeof(CHAR); SIZE_T DestinationLength, Remaining, Copied = 0; PCHAR LocalDestinationEnd; - //ASSERTMSG("We don't support Extended Flags yet!\n", Flags == 0); + ASSERTMSG("We don't support Extended Flags yet!\n", Flags == 0);
Status = RtlStringExValidateDestA(&Destination, &CharLength, @@ -485,7 +494,7 @@ return Status; }
-FORCEINLINE +__inline NTSTATUS NTAPI RtlStringCbCopyA(OUT PCHAR Destination,
Modified: trunk/reactos/ntoskrnl/mm/sysldr.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/sysldr.c?rev=42... ============================================================================== --- trunk/reactos/ntoskrnl/mm/sysldr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/sysldr.c [iso-8859-1] Sun Aug 16 22:08:48 2009 @@ -13,6 +13,7 @@ #include <debug.h>
/* GCC's incompetence strikes again */ +__inline VOID sprintf_nt(IN PCHAR Buffer, IN PCHAR Format,