- Specify C4700 (uninitialized variable usage) to cause an error on compile as this is very likely to result in broken code.
[NTDLL]
- Disable ASSERT in LdrpSearchPath that could be reading an uninitialized variable. The routine is not fully implemented so this should likely be re-enabled once it is.
[BROWSEUI]
- Add missing call to BuildRebarBandInfo, or we would end up with an unitialized variable sent to SendMessage.
[PCIX]
- Fix broken ASSERT
- Fix usage of wrong (and uninitialized) variable in the Unicode case for PciGetDescriptionMessage.
[DDK]
- Prepend "_" to local variable of NdisChainBufferAtBack. Fixes code in ndisuio that called this using the same name as the macro's variable (which resulted in NdisChainBufferAtBack assigning the variable to itself).
[WIN32K]
- Fix WinPosShowIconTitle that checked if a variable was NULL before assigning it to anything.

svn path=/trunk/; revision=55834
This commit is contained in:
Stefan Ginsberg 2012-02-23 13:06:11 +00:00
parent e14f67f95d
commit cd616fb1b2
6 changed files with 15 additions and 9 deletions

View file

@ -21,6 +21,9 @@ add_definitions(/Dinline=__inline /D__STDC__=1)
add_compile_flags("/X /GR- /GS- /Zl /W3")
# C4700 is almost always likely to result in broken code, so mark it as an error
add_compile_flags("/we4700")
# Debugging
if(${CMAKE_BUILD_TYPE} MATCHES Debug)
if(NOT _PREFAST_)

View file

@ -1860,7 +1860,9 @@ LdrpSearchPath(IN PWCHAR *SearchPath,
/* Sanity check */
TestName.Length = (USHORT)ALIGN_DOWN((BufEnd - Buffer), WCHAR);
#if 0
ASSERT(TestName.Length < TestName.MaximumLength);
#endif
/* Check if the file exists */
#if 0

View file

@ -409,6 +409,7 @@ HRESULT STDMETHODCALLTYPE CBandSiteBase::AddBand(IUnknown *punk)
WARN("IBandSite::AddBand(): Call to IDeskBand::SetSite() failed: %x\n", hRet);
/* Remove the band from the ReBar control */
BuildRebarBandInfo(NewBand, &rbi);
uBand = (UINT)SendMessageW(fRebarWindow, RB_IDTOINDEX, (WPARAM)rbi.wID, 0);
if (uBand != (UINT)-1)
{

View file

@ -51,7 +51,7 @@ PciGetDescriptionMessage(IN ULONG Identifier,
/* Validate valid message length, ending with a newline character */
ASSERT(TextLength > 1);
ASSERT(Description[TextLength / sizeof(WCHAR) == L'\n']);
ASSERT(Description[TextLength / sizeof(WCHAR)] == L'\n');
/* Allocate the buffer to hold the message string */
Buffer = ExAllocatePoolWithTag(PagedPool, TextLength, 'BicP');
@ -61,8 +61,8 @@ PciGetDescriptionMessage(IN ULONG Identifier,
RtlCopyMemory(Buffer, Entry->Text, TextLength - 1);
Buffer[TextLength / sizeof(WCHAR)] = UNICODE_NULL;
/* Return the length to the caller */
if (Length) *Length = UnicodeString.Length;
/* Return the length to the caller, minus the terminating NULL */
if (Length) *Length = TextLength - 1;
}
else
{

View file

@ -3101,19 +3101,19 @@ NdisGetFirstBufferFromPacket(
#define NdisChainBufferAtBack(Packet, \
Buffer) \
{ \
PNDIS_BUFFER NdisBuffer = (Buffer); \
PNDIS_BUFFER _NdisBuffer = (Buffer); \
\
while (NdisBuffer->Next != NULL) \
NdisBuffer = NdisBuffer->Next; \
while (_NdisBuffer->Next != NULL) \
_NdisBuffer = _NdisBuffer->Next; \
\
NdisBuffer->Next = NULL; \
_NdisBuffer->Next = NULL; \
\
if ((Packet)->Private.Head != NULL) \
(Packet)->Private.Tail->Next = (Buffer); \
else \
(Packet)->Private.Head = (Buffer); \
\
(Packet)->Private.Tail = NdisBuffer; \
(Packet)->Private.Tail = _NdisBuffer; \
(Packet)->Private.ValidCounts = FALSE; \
}

View file

@ -134,7 +134,7 @@ WinPosShowIconTitle( PWND pWnd, BOOL bShow )
{
HICON hIcon;
if (!pWnd->pcls || pWnd->fnid == FNID_DESKTOP) return FALSE;
if (!hIcon) hIcon = pWnd->pcls->hIconSm;
hIcon = pWnd->pcls->hIconSm;
if (!hIcon) hIcon = pWnd->pcls->hIcon;
if (!hIcon) return FALSE;