Author: sginsberg Date: Thu Feb 23 13:06:11 2012 New Revision: 55834
URL: http://svn.reactos.org/svn/reactos?rev=55834&view=rev Log: [CMAKE] - 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.
Modified: trunk/reactos/cmake/msvc.cmake trunk/reactos/dll/ntdll/ldr/ldrutils.c trunk/reactos/dll/win32/browseui/bandsite.cpp trunk/reactos/drivers/bus/pcix/pci/id.c trunk/reactos/include/ddk/ndis.h trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c
Modified: trunk/reactos/cmake/msvc.cmake URL: http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/msvc.cmake?rev=55834&... ============================================================================== --- trunk/reactos/cmake/msvc.cmake [iso-8859-1] (original) +++ trunk/reactos/cmake/msvc.cmake [iso-8859-1] Thu Feb 23 13:06:11 2012 @@ -20,6 +20,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)
Modified: trunk/reactos/dll/ntdll/ldr/ldrutils.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/ldrutils.c?re... ============================================================================== --- trunk/reactos/dll/ntdll/ldr/ldrutils.c [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/ldr/ldrutils.c [iso-8859-1] Thu Feb 23 13:06:11 2012 @@ -1860,7 +1860,9 @@
/* 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
Modified: trunk/reactos/dll/win32/browseui/bandsite.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/bandsite... ============================================================================== --- trunk/reactos/dll/win32/browseui/bandsite.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/bandsite.cpp [iso-8859-1] Thu Feb 23 13:06:11 2012 @@ -409,6 +409,7 @@ 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) {
Modified: trunk/reactos/drivers/bus/pcix/pci/id.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/pci/id.c?r... ============================================================================== --- trunk/reactos/drivers/bus/pcix/pci/id.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/pci/id.c [iso-8859-1] Thu Feb 23 13:06:11 2012 @@ -51,7 +51,7 @@
/* 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 @@ 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 {
Modified: trunk/reactos/include/ddk/ndis.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ndis.h?rev=5583... ============================================================================== --- trunk/reactos/include/ddk/ndis.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/ndis.h [iso-8859-1] Thu Feb 23 13:06:11 2012 @@ -3101,19 +3101,19 @@ #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; \ }
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c [iso-8859-1] Thu Feb 23 13:06:11 2012 @@ -134,7 +134,7 @@ { 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;