mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 19:55:41 +00:00
- 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. svn path=/trunk/; revision=42744
This commit is contained in:
parent
f145632ab6
commit
ac35e87724
4 changed files with 63 additions and 20 deletions
29
reactos/include/ddk/driverspecs.h
Normal file
29
reactos/include/ddk/driverspecs.h
Normal file
|
@ -0,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)
|
|
@ -32,9 +32,13 @@ extern "C" {
|
||||||
DEFINE_GUID(GUID_DEVINTERFACE_COMPORT,
|
DEFINE_GUID(GUID_DEVINTERFACE_COMPORT,
|
||||||
0x86e0d1e0L, 0x8089, 0x11d0, 0x9c, 0xe4, 0x08, 0x00, 0x3e, 0x30, 0x1f, 0x73);
|
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,
|
DEFINE_GUID(GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR,
|
||||||
0x4D36E978L, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18);
|
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 \
|
#define IOCTL_SERIAL_CLEAR_STATS \
|
||||||
CTL_CODE (FILE_DEVICE_SERIAL_PORT, 36, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
CTL_CODE (FILE_DEVICE_SERIAL_PORT, 36, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||||
#define IOCTL_SERIAL_CLR_DTR \
|
#define IOCTL_SERIAL_CLR_DTR \
|
||||||
|
|
|
@ -31,13 +31,9 @@
|
||||||
//
|
//
|
||||||
typedef unsigned long DWORD;
|
typedef unsigned long DWORD;
|
||||||
|
|
||||||
#ifndef UNIMPLEMENTED
|
|
||||||
#define UNIMPLEMENTED DbgPrint("WARNING: %s at %s:%d is UNIMPLEMENTED!\n",__FUNCTION__,__FILE__,__LINE__);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* PRIVATE FUNCTIONS *********************************************************/
|
/* PRIVATE FUNCTIONS *********************************************************/
|
||||||
|
|
||||||
FORCEINLINE
|
__inline
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlStringLengthWorkerA(IN PCHAR String,
|
RtlStringLengthWorkerA(IN PCHAR String,
|
||||||
|
@ -70,7 +66,7 @@ RtlStringLengthWorkerA(IN PCHAR String,
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
FORCEINLINE
|
__inline
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlStringValidateDestA(IN PCHAR Destination,
|
RtlStringValidateDestA(IN PCHAR Destination,
|
||||||
|
@ -99,7 +95,7 @@ RtlStringValidateDestA(IN PCHAR Destination,
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
FORCEINLINE
|
__inline
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlStringExValidateDestA(IN OUT PCHAR *Destination,
|
RtlStringExValidateDestA(IN OUT PCHAR *Destination,
|
||||||
|
@ -108,14 +104,14 @@ RtlStringExValidateDestA(IN OUT PCHAR *Destination,
|
||||||
IN SIZE_T MaxLength,
|
IN SIZE_T MaxLength,
|
||||||
IN DWORD Flags)
|
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,
|
return RtlStringValidateDestA(*Destination,
|
||||||
*DestinationLength,
|
*DestinationLength,
|
||||||
ReturnLength,
|
ReturnLength,
|
||||||
MaxLength);
|
MaxLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
FORCEINLINE
|
__inline
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlStringExValidateSrcA(IN OUT PCCHAR *Source OPTIONAL,
|
RtlStringExValidateSrcA(IN OUT PCCHAR *Source OPTIONAL,
|
||||||
|
@ -124,7 +120,7 @@ RtlStringExValidateSrcA(IN OUT PCCHAR *Source OPTIONAL,
|
||||||
IN DWORD Flags)
|
IN DWORD Flags)
|
||||||
{
|
{
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
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))
|
if ((ReturnLength) && (*ReturnLength >= MaxLength))
|
||||||
{
|
{
|
||||||
|
@ -134,7 +130,7 @@ RtlStringExValidateSrcA(IN OUT PCCHAR *Source OPTIONAL,
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
FORCEINLINE
|
__inline
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlStringVPrintfWorkerA(OUT PCHAR Destination,
|
RtlStringVPrintfWorkerA(OUT PCHAR Destination,
|
||||||
|
@ -175,7 +171,7 @@ RtlStringVPrintfWorkerA(OUT PCHAR Destination,
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
FORCEINLINE
|
__inline
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlStringCopyWorkerA(OUT PCHAR Destination,
|
RtlStringCopyWorkerA(OUT PCHAR Destination,
|
||||||
|
@ -212,6 +208,18 @@ RtlStringCopyWorkerA(OUT PCHAR Destination,
|
||||||
|
|
||||||
/* PUBLIC FUNCTIONS **********************************************************/
|
/* 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
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlStringCbPrintfA(OUT PCHAR Destination,
|
RtlStringCbPrintfA(OUT PCHAR Destination,
|
||||||
|
@ -241,6 +249,7 @@ RtlStringCbPrintfA(OUT PCHAR Destination,
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__inline
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlStringCbPrintfExA(OUT PCHAR Destination,
|
RtlStringCbPrintfExA(OUT PCHAR Destination,
|
||||||
|
@ -255,7 +264,7 @@ RtlStringCbPrintfExA(OUT PCHAR Destination,
|
||||||
SIZE_T CharLength = Length / sizeof(CHAR), Remaining, LocalNewLength = 0;
|
SIZE_T CharLength = Length / sizeof(CHAR), Remaining, LocalNewLength = 0;
|
||||||
PCHAR LocalDestinationEnd;
|
PCHAR LocalDestinationEnd;
|
||||||
va_list argList;
|
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,
|
Status = RtlStringExValidateDestA(&Destination,
|
||||||
&CharLength,
|
&CharLength,
|
||||||
|
@ -321,7 +330,7 @@ RtlStringCbPrintfExA(OUT PCHAR Destination,
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
FORCEINLINE
|
__inline
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlStringCbCopyExA(OUT PCHAR Destination,
|
RtlStringCbCopyExA(OUT PCHAR Destination,
|
||||||
|
@ -334,7 +343,7 @@ RtlStringCbCopyExA(OUT PCHAR Destination,
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
SIZE_T CharLength = Length / sizeof(CHAR), Copied = 0, Remaining;
|
SIZE_T CharLength = Length / sizeof(CHAR), Copied = 0, Remaining;
|
||||||
PCHAR LocalDestinationEnd;
|
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,
|
Status = RtlStringExValidateDestA(&Destination,
|
||||||
&Length,
|
&Length,
|
||||||
|
@ -398,7 +407,7 @@ RtlStringCbCopyExA(OUT PCHAR Destination,
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__inline
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlStringCbPrintfW(
|
RtlStringCbPrintfW(
|
||||||
|
@ -407,11 +416,11 @@ RtlStringCbPrintfW(
|
||||||
IN LPCWSTR pszFormat,
|
IN LPCWSTR pszFormat,
|
||||||
...)
|
...)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED
|
ASSERTMSG("RtlStringCbPrintfW is UNIMPLEMENTED!\n", FALSE);
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
FORCEINLINE
|
__inline
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlStringCbCatExA(IN OUT PCHAR Destination,
|
RtlStringCbCatExA(IN OUT PCHAR Destination,
|
||||||
|
@ -425,7 +434,7 @@ RtlStringCbCatExA(IN OUT PCHAR Destination,
|
||||||
SIZE_T CharLength = Length / sizeof(CHAR);
|
SIZE_T CharLength = Length / sizeof(CHAR);
|
||||||
SIZE_T DestinationLength, Remaining, Copied = 0;
|
SIZE_T DestinationLength, Remaining, Copied = 0;
|
||||||
PCHAR LocalDestinationEnd;
|
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,
|
Status = RtlStringExValidateDestA(&Destination,
|
||||||
&CharLength,
|
&CharLength,
|
||||||
|
@ -485,7 +494,7 @@ RtlStringCbCatExA(IN OUT PCHAR Destination,
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
FORCEINLINE
|
__inline
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlStringCbCopyA(OUT PCHAR Destination,
|
RtlStringCbCopyA(OUT PCHAR Destination,
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
/* GCC's incompetence strikes again */
|
/* GCC's incompetence strikes again */
|
||||||
|
__inline
|
||||||
VOID
|
VOID
|
||||||
sprintf_nt(IN PCHAR Buffer,
|
sprintf_nt(IN PCHAR Buffer,
|
||||||
IN PCHAR Format,
|
IN PCHAR Format,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue