Some misc fixes to Prefast.

[DDK]
- ndis.h Don't use local variables with the same name as function parameters.
[PSDK]
- access.idl Remove incorrect annotation
- usbioctl.h Not really a Prefast issue, but switch to use ANYSIZE_ARRAY like we do everywhere else.
- winddi.h EngQueryDeviceAttribute's 6th parameter is IN, not OUT
- winefs.h Fix FileEncryptionStatus to use annotations. Its definition in winbase.h already has them and this caused a conflict.
[WINE]
- debug.h Remove unnecessary check (in ReactOS) that made Prefast sad.
- test.h Disable a false-positive C28182.

svn path=/trunk/; revision=55813
This commit is contained in:
Stefan Ginsberg 2012-02-22 20:58:20 +00:00
parent 946cac440c
commit 0761804e03
7 changed files with 31 additions and 23 deletions

View file

@ -3577,20 +3577,20 @@ NdisQueryPacket(
UINT Offset;
UINT PacketLength;
PNDIS_BUFFER NdisBuffer;
UINT PhysicalBufferCount = 0;
UINT TotalPacketLength = 0;
UINT _PhysicalBufferCount = 0;
UINT _TotalPacketLength = 0;
UINT Count = 0;
for (NdisBuffer = Packet->Private.Head;
NdisBuffer != (PNDIS_BUFFER)NULL;
NdisBuffer = NdisBuffer->Next) {
PhysicalBufferCount += NDIS_BUFFER_TO_SPAN_PAGES(NdisBuffer);
_PhysicalBufferCount += NDIS_BUFFER_TO_SPAN_PAGES(NdisBuffer);
NdisQueryBufferOffset(NdisBuffer, &Offset, &PacketLength);
TotalPacketLength += PacketLength;
_TotalPacketLength += PacketLength;
Count++;
}
Packet->Private.PhysicalCount = PhysicalBufferCount;
Packet->Private.TotalLength = TotalPacketLength;
Packet->Private.PhysicalCount = _PhysicalBufferCount;
Packet->Private.TotalLength = _TotalPacketLength;
Packet->Private.Count = Count;
Packet->Private.ValidCounts = TRUE;
}

View file

@ -34,7 +34,7 @@ interface IAccessor : IUnknown
[call_as(AddRefAccessor)]
HRESULT RemoteAddRefAccessor([in] HACCESSOR hAccessor,
[in, out, unique, annotation("__out_opt")] DBREFCOUNT *pcRefCount,
[in, out, unique] DBREFCOUNT *pcRefCount,
[out] IErrorInfo **ppErrorInfoRem);
[local]

View file

@ -295,34 +295,34 @@ typedef struct _USB_NODE_CONNECTION_INFORMATION {
USHORT DeviceAddress;
ULONG NumberOfOpenPipes;
USB_CONNECTION_STATUS ConnectionStatus;
USB_PIPE_INFO PipeList[0];
USB_PIPE_INFO PipeList[ANYSIZE_ARRAY];
} USB_NODE_CONNECTION_INFORMATION, *PUSB_NODE_CONNECTION_INFORMATION;
typedef struct _USB_NODE_CONNECTION_DRIVERKEY_NAME {
ULONG ConnectionIndex;
ULONG ActualLength;
WCHAR DriverKeyName[1];
WCHAR DriverKeyName[ANYSIZE_ARRAY];
} USB_NODE_CONNECTION_DRIVERKEY_NAME, *PUSB_NODE_CONNECTION_DRIVERKEY_NAME;
typedef struct _USB_NODE_CONNECTION_NAME {
ULONG ConnectionIndex;
ULONG ActualLength;
WCHAR NodeName[1];
WCHAR NodeName[ANYSIZE_ARRAY];
} USB_NODE_CONNECTION_NAME, *PUSB_NODE_CONNECTION_NAME;
typedef struct _USB_HUB_NAME {
ULONG ActualLength;
WCHAR HubName[1];
WCHAR HubName[ANYSIZE_ARRAY];
} USB_HUB_NAME, *PUSB_HUB_NAME;
typedef struct _USB_ROOT_HUB_NAME {
ULONG ActualLength;
WCHAR RootHubName[1];
WCHAR RootHubName[ANYSIZE_ARRAY];
} USB_ROOT_HUB_NAME, *PUSB_ROOT_HUB_NAME;
typedef struct _USB_HCD_DRIVERKEY_NAME {
ULONG ActualLength;
WCHAR DriverKeyName[1];
WCHAR DriverKeyName[ANYSIZE_ARRAY];
} USB_HCD_DRIVERKEY_NAME, *PUSB_HCD_DRIVERKEY_NAME;
typedef struct _USB_DESCRIPTOR_REQUEST {
@ -334,7 +334,7 @@ typedef struct _USB_DESCRIPTOR_REQUEST {
USHORT wIndex;
USHORT wLength;
} SetupPacket;
UCHAR Data[0];
UCHAR Data[ANYSIZE_ARRAY];
} USB_DESCRIPTOR_REQUEST, *PUSB_DESCRIPTOR_REQUEST;
#if (_WIN32_WINNT >= 0x0501)
@ -358,7 +358,7 @@ typedef struct _USB_NODE_CONNECTION_INFORMATION_EX {
USHORT DeviceAddress;
ULONG NumberOfOpenPipes;
USB_CONNECTION_STATUS ConnectionStatus;
USB_PIPE_INFO PipeList[0];
USB_PIPE_INFO PipeList[ANYSIZE_ARRAY];
} USB_NODE_CONNECTION_INFORMATION_EX, *PUSB_NODE_CONNECTION_INFORMATION_EX;
C_ASSERT(sizeof(USB_NODE_CONNECTION_INFORMATION_EX) == sizeof(USB_NODE_CONNECTION_INFORMATION));
@ -542,7 +542,7 @@ typedef struct _USB_BUS_NOTIFICATION {
typedef struct _USB_ACQUIRE_INFO {
USB_NOTIFICATION_TYPE NotificationType;
ULONG TotalSize;
WCHAR Buffer[1];
WCHAR Buffer[ANYSIZE_ARRAY];
} USB_ACQUIRE_INFO, *PUSB_ACQUIRE_INFO;
#if (_WIN32_WINNT >= 0x0600)
@ -577,7 +577,7 @@ typedef struct _USB_HUB_DEVICE_INFO {
BOOLEAN HubIsRootHub;
USB_HUB_CAPABILITIES HubCapabilities;
ULONG NumberOfHubPorts;
USB_HUB_PORT_INFORMATION PortInfo[1];
USB_HUB_PORT_INFORMATION PortInfo[ANYSIZE_ARRAY];
} USB_HUB_DEVICE_INFO, *PUSB_HUB_DEVICE_INFO;
typedef struct _USB_COMPOSITE_FUNCTION_INFO {
@ -592,7 +592,7 @@ typedef struct _USB_COMPOSITE_DEVICE_INFO {
USB_CONFIGURATION_DESCRIPTOR CurrentConfigDescriptor;
UCHAR CurrentConfigurationValue;
UCHAR NumberOfFunctions;
USB_COMPOSITE_FUNCTION_INFO FunctionInfo[1];
USB_COMPOSITE_FUNCTION_INFO FunctionInfo[ANYSIZE_ARRAY];
} USB_COMPOSITE_DEVICE_INFO, *PUSB_COMPOSITE_DEVICE_INFO;
typedef struct _USB_CONTROLLER_DEVICE_INFO {
@ -617,7 +617,7 @@ typedef struct _USB_DEVICE_INFO {
WCHAR SerialNumberId[128];
WCHAR PnpDeviceDescription[128];
ULONG NumberOfOpenPipes;
USB_PIPE_INFO PipeList[1];
USB_PIPE_INFO PipeList[ANYSIZE_ARRAY];
} USB_DEVICE_INFO, *PUSB_DEVICE_INFO;
typedef struct _USB_DEVICE_NODE_INFO {

View file

@ -2075,7 +2075,7 @@ EngQueryDeviceAttribute(
_In_reads_bytes_(cjInSize) PVOID pvIn,
_In_ ULONG cjInSize,
_Out_writes_bytes_(cjOutSize) PVOID pvOut,
_Out_ ULONG cjOutSize);
_In_ ULONG cjOutSize);
WIN32KAPI
LARGE_INTEGER

View file

@ -48,8 +48,8 @@ BOOL WINAPI EncryptionDisable (
);
BOOL WINAPI FileEncryptionStatus (
LPCTSTR,
LPDWORD
_In_ LPCTSTR,
_Out_ LPDWORD
);
DWORD WINAPI QueryUsersOnEncryptedFile (

View file

@ -217,7 +217,7 @@ static __inline const char *wine_dbgstr_rect( const RECT *rect )
static __inline const char *wine_dbgstr_longlong( ULONGLONG ll )
{
if (sizeof(ll) > sizeof(unsigned long) && ll >> 32)
if (/*sizeof(ll) > sizeof(unsigned long) &&*/ ll >> 32) /* ULONGLONG is always > long in ReactOS */
return wine_dbg_sprintf( "%lx%08lx", (unsigned long)(ll >> 32), (unsigned long)ll );
else return wine_dbg_sprintf( "%lx", (unsigned long)ll );
}

View file

@ -539,6 +539,11 @@ static void list_tests(void)
for (test = winetest_testlist; test->name; test++) fprintf( stdout, " %s\n", test->name );
}
/* Disable false-positive claiming "test" would be NULL-dereferenced */
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:28182)
#endif
/* Run a named test, and return exit status */
static int run_test( const char *name )
@ -569,6 +574,9 @@ static int run_test( const char *name )
return status;
}
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
/* Display usage and exit */
static void usage( const char *argv0 )