Author: sginsberg
Date: Wed Feb 22 20:58:20 2012
New Revision: 55813
URL:
http://svn.reactos.org/svn/reactos?rev=55813&view=rev
Log:
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.
Modified:
trunk/reactos/include/ddk/ndis.h
trunk/reactos/include/psdk/access.idl
trunk/reactos/include/psdk/usbioctl.h
trunk/reactos/include/psdk/winddi.h
trunk/reactos/include/psdk/winefs.h
trunk/reactos/include/reactos/wine/debug.h
trunk/reactos/include/reactos/wine/test.h
Modified: trunk/reactos/include/ddk/ndis.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ndis.h?rev=558…
==============================================================================
--- trunk/reactos/include/ddk/ndis.h [iso-8859-1] (original)
+++ trunk/reactos/include/ddk/ndis.h [iso-8859-1] Wed Feb 22 20:58:20 2012
@@ -3577,20 +3577,20 @@
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;
}
Modified: trunk/reactos/include/psdk/access.idl
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/access.idl?re…
==============================================================================
--- trunk/reactos/include/psdk/access.idl [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/access.idl [iso-8859-1] Wed Feb 22 20:58:20 2012
@@ -34,7 +34,7 @@
[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]
Modified: trunk/reactos/include/psdk/usbioctl.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/usbioctl.h?re…
==============================================================================
--- trunk/reactos/include/psdk/usbioctl.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/usbioctl.h [iso-8859-1] Wed Feb 22 20:58:20 2012
@@ -295,34 +295,34 @@
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 @@
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 @@
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_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 @@
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 @@
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 @@
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 {
Modified: trunk/reactos/include/psdk/winddi.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winddi.h?rev=…
==============================================================================
--- trunk/reactos/include/psdk/winddi.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/winddi.h [iso-8859-1] Wed Feb 22 20:58:20 2012
@@ -2075,7 +2075,7 @@
_In_reads_bytes_(cjInSize) PVOID pvIn,
_In_ ULONG cjInSize,
_Out_writes_bytes_(cjOutSize) PVOID pvOut,
- _Out_ ULONG cjOutSize);
+ _In_ ULONG cjOutSize);
WIN32KAPI
LARGE_INTEGER
Modified: trunk/reactos/include/psdk/winefs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winefs.h?rev=…
==============================================================================
--- trunk/reactos/include/psdk/winefs.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/winefs.h [iso-8859-1] Wed Feb 22 20:58:20 2012
@@ -48,8 +48,8 @@
);
BOOL WINAPI FileEncryptionStatus (
- LPCTSTR,
- LPDWORD
+ _In_ LPCTSTR,
+ _Out_ LPDWORD
);
DWORD WINAPI QueryUsersOnEncryptedFile (
Modified: trunk/reactos/include/reactos/wine/debug.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/debug…
==============================================================================
--- trunk/reactos/include/reactos/wine/debug.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/wine/debug.h [iso-8859-1] Wed Feb 22 20:58:20 2012
@@ -217,7 +217,7 @@
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 );
}
Modified: trunk/reactos/include/reactos/wine/test.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/test.…
==============================================================================
--- trunk/reactos/include/reactos/wine/test.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/wine/test.h [iso-8859-1] Wed Feb 22 20:58:20 2012
@@ -539,6 +539,11 @@
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 @@
return status;
}
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
/* Display usage and exit */
static void usage( const char *argv0 )