home *** CD-ROM | disk | FTP | other *** search
- NuMega Technologies, Inc, 1995 (c), MFC Supression File, Rev 001
-
- SmartCheck is capable of detecting errors in third party libraries. This file
- documents the errors that SmartCheck finds in the Microsoft MFC library. These
- errors are also included in the MFC.SUP suppression file.
-
- By including these errors in the MFC.SUP suppression file, SmartCheck will
- ignore these errors at run-time. This will reduce the number of errors that you
- have to review since you have little or no ability to correct them. If you want
- to be notified of every error in library, do not use the MFC.SUP suppression file.
-
-
- 1) MFC DLL initialization is attempting to load the appropriate
- language-specific DLL. LoadLibrary may fail if the DLL is not present.
-
- ignore failure KERNEL32.DLL:LoadLibraryA in function MFC30D.DLL:DllMain
-
-
- 2) AfxFindResource is a low-level function to find a resource.
- In general, it is legitimate to maybe not find it.
-
- ignore failure KERNEL32.DLL:FindResourceA in function MFC30D.DLL:AfxFindResource
- ignore failure KERNEL32.DLL:FindResourceA in function EXE:AfxFindResource
-
-
- 3) MFC is attempting to find the main window's icon. It is legit if
- none exists in the resource file (MFC will supply a default)
-
- ignore failure USER32.DLL:LoadIconA in file MFC30D.DLL:appinit.cpp
- ignore failure USER32.DLL:LoadIconA in file EXE:appinit.cpp
-
- 4) An application will usually have accelerators, but it is not a
- requirement. If not, the accel table will be NULL, which is OK.
-
- ignore failure USER32.DLL:LoadAcceleratorsA in function MFC30D.DLL:CMultiDocTemplate::CMultiDocTemplate
- ignore failure USER32.DLL:LoadAcceleratorsA in function EXE:CMultiDocTemplate::CMultiDocTemplate
-
- 5) MFC checks to see if the class exists. Legitimate if not (MFC will register).
-
- ignore failure USER32.DLL:GetClassInfoA in function MFC30D.DLL:AfxRegisterWndClass
- ignore failure USER32.DLL:GetClassInfoA in function EXE:AfxRegisterWndClass
-
-
- 6) MFC DestroyToolTip is destroying timer. (wrapper probelm)
-
- ignore failure USER32.DLL:KillTimer in function MFC30D.DLL:CWnd::KillTimer
- ignore failure USER32.DLL:KillTimer in function EXE:CWnd::KillTimer
-
-
- 7) CWnd::GetDescendantWindow looks for a descendant child window with a
- given ID. In general, it may not find one.
-
- ignore param 2 USER32.DLL:GetDlgItem in function MFC30D.DLL:CWnd::GetDescendantWindow
- ignore failure USER32.DLL:GetDlgItem in function MFC30D.DLL:CWnd::GetDescendantWindow
- ignore param 2 USER32.DLL:GetDlgItem in function EXE:CWnd::GetDescendantWindow
- ignore failure USER32.DLL:GetDlgItem in function EXE:CWnd::GetDescendantWindow
- ignore param 2 USER32.DLL:GetDlgItem in function MFC30D.DLL:CWnd::GetDlgItem
- ignore failure USER32.DLL:GetDlgItem in function MFC30D.DLL:CWnd::GetDlgItem
- ignore param 2 USER32.DLL:GetDlgItem in function EXE:CWnd::GetDlgItem
- ignore failure USER32.DLL:GetDlgItem in function EXE:CWnd::GetDlgItem
-
-
- 8) Sometimes a control bar seems to have a control ID = 0. (variable)
-
- ignore failure USER32.DLL:GetDlgCtrlID in function MFC30D.DLL:CFrameWnd::GetControlBar
- ignore failure USER32.DLL:GetDlgCtrlID in function EXE:CFrameWnd::GetControlBar
-
- 9) MFC is storing the old window proc under the property "AfxOldWndProc".
- For a newly subclassed window, this property should not be used, so
- GetProp("AfxOldWndProc") should return NULL.
-
- ignore failure USER32.DLL:GetPropA in function MFC30D.DLL:_AfxStandardSubclass
- ignore failure USER32.DLL:GetPropA in function EXE:_AfxStandardSubclass
-
-
- 10) If the special property "StayDisabled" is set, MFC will keep the window
- disabled// otherwise enable as normal. This is used for MAPI support.
-
- ignore failure USER32.DLL:GetPropA in function MFC30D.DLL:CFrameWnd::OnEnable
- ignore failure USER32.DLL:GetPropA in function EXE:CFrameWnd::OnEnable
-
-
- 12) MFC is calling the Windows DefFrameProc to handle WM_NCDESTROY
- after the MFC client window (m_hWndMDIClient) has already been destroyed.
- In other words, IsWindow(hWndMDIClient) would fail. This is OK as far as Windows is concerned.
-
- ignore param 2 USER32.DLL:DefFrameProcA in function MFC30D.DLL:CMDIFrameWnd::DefWindowProcA
- ignore param 2 USER32.DLL:DefFrameProcA in function EXE:CMDIFrameWnd::DefWindowProcA
-
-
- 13) MFC relies on the fact that a window's menu is automatically destroyed
- when the window itself is destroyed.
-
- ignore resource_leak LoadMenuA in function MFC30D.DLL:CFrameWnd::Create
- ignore resource_leak LoadMenuA in function EXE:CFrameWnd::Create
-
- 14) MFC is trying to close the pseudo-handle returned by GetCurrentThread,
- which is the thread in the application object CWinApp. I am guessing that
- this is not allowed.
-
- ignore param 1 KERNEL32.DLL:CloseHandle in function MFC30D.DLL:CWinThread::~CWinThread
- ignore failure KERNEL32.DLL:CloseHandle in function MFC30D.DLL:CWinThread::~CWinThread
- ignore param 1 KERNEL32.DLL:CloseHandle in function EXE:CWinThread::~CWinThread
- ignore failure KERNEL32.DLL:CloseHandle in function EXE:CWinThread::~CWinThread
-
- 15) MFC is trying to get the address of various functions in CTL3D32.DLL
- by using the ordinal// but the version of the DLL may be wrong, in which
- case some may not exist. If GetProcAddress returns NULL for any
- function, MFC aborts, assuming the library couldn't be loaded.
-
- ignore failure KERNEL32.DLL:GetProcAddress in function MFC30D.DLL:CWinApp::Enable3dControls
- ignore failure KERNEL32.DLL:GetProcAddress in function EXE:CWinApp::Enable3dControls
-
-
- 16) MFC is trying to load "CTL3D32.DLL", which may not exist on the user's
- system.
-
- ignore resource_leak LoadLibraryA in function MFC30D.DLL:CWinApp::Enable3dControls
- ignore resource_leak LoadLibraryA in function EXE:CWinApp::Enable3dControls
-
-
- 17) Wrapper Problem.
-
- ignore resource_leak TlsAlloc in function MFC30D.DLL:_AfxTlsAlloc
- ignore resource_leak TlsAlloc in function EXE:_AfxTlsAlloc
-
-
- 18) MFC leaks strings it creates during initialization (e.g., m_pszExeName,
- m_pszAppName, etc). *** Check for all _strdup ???
-
- ignore resource_leak __strdup in function MFC30D.DLL:CWinApp::SetCurrentHandles
- ignore resource_leak __strdup in function EXE:CWinApp::SetCurrentHandles
-
-
- 19) AUTODRIV has failed because "AutoClik.Document.1" is not
- registered, so the dialog fails to create and the error stands.
-
- ignore failure USER32.DLL:DialogBoxParamA in function EXE:CDialog::DoModal
-
- *** No idea. Also in SUPERPAD.
- ignore bad_address(23,16) in module MFCANS32.dll
-
- // *** No idea, but happens frequently
-
- ignore resource_leak _malloc in function EXE:__lock
- ignore resource_leak _malloc in function MFC30D.DLL:__lock
-
-
- 20) When a "File Save As" dialog is displayed, and you move the mouse
- over one of the buttons in the dialog button bar, as Windows generates
- tooltips for the button, it sends the dialog a TTN_NEEDTEXTA message
- with 0 (zero) as the control ID. When OnNotify obtains this ID,
- GetDlgCtrlID fails. Wrapper problem.
-
- ignore failure USER32.DLL:GetDlgCtrlID in function EXE:CWnd::OnNotify
- ignore failure USER32.DLL:GetDlgCtrlID in function MFC30D.DLL:CWnd::OnNotify
-
- 21) MFC is updating the recent file menu and deleting an item that
- doesn't exist. No harm done.
-
- ignore failure USER32.DLL:DeleteMenu in function MFC30D.DLL:CMenu::DeleteMenu
- ignore failure USER32.DLL:DeleteMenu in function EXE:CMenu::DeleteMenu
-
- 22) MFC BUG in AfxOleRegisterServerClass:
-
- TCHAR szPathName[_MAX_PATH];
- LPTSTR pszTemp = szPathName;
- if (afxData.nWinVer >= 0x333)
- *pszTemp++ = '"';
- ::GetModuleFileName(AfxGetInstanceHandle(), pszTemp, _MAX_PATH);
-
- pszTemp is incremented, so 3rd arg to GetModuleFileName should be _MAX_PATH - 1
-
- ignore overrun(14,2) in function MFCO30D.DLL:AfxOleRegisterServerClass
- ignore overrun(14,2) in function EXE:AfxOleRegisterServerClass
-
- 23) Wrapper problem. In updating the recent file menu, MFC may attempt to parse
- a "bad" file name. This is harmless: AfxComparePath will fail.
-
- ignore failure KERNEL32.DLL:GetFullPathNameA in function EXE:AfxFullPath
- ignore failure KERNEL32.DLL:GetFullPathNameA in function MFC30D.DLL:AfxFullPath
-
-
- 24) *** Something to do with database stuff. Check later?
-
- ignore overrun(14,2) in function EXE:CDatabase::Open
- ignore overrun(14,2) in function MFC30D.DLL:CDatabase::Open
- ignore failure KERNEL32.DLL:GetProcAddress in module DBNMPNTW.DLL
-
-
- 25) More wrapper problems.
-
- ignore resource_leak(20,0) CreateFileA in function EXE:CFile::Open
- ignore resource_leak(20,0) CreateFileA in function MFC30D.DLL:CFile::Open
-
- 26) Difficult to reproduce leak problem.
-
- ignore resource_leak(20,0) CreateDialogParamA in function EXE:CFormView::Create
- ignore resource_leak(20,0) CreateDialogParamA in function MFC30D.DLL:CFormView::Create
-
- 27) When doing Print Setup, BC complains at the end when MFC does GlobalFree
- on device mode/name structures when ~CWinApp cleans up. Code looks OK
- to me.
-
- ignore bad_address(15,0) in function MFC30D.DLL:CWinApp::~CWinApp
- ignore bad_address(15,0) in function EXE:CWinApp::~CWinApp
-
-
- 28) MFC leaks m_pszRegistryKey and m_pszProfileName
-
- ignore resource_leak(19,0) __strdup in function EXE:CWinApp::SetRegistryKey
- ignore resource_leak(19,0) __strdup in function MFC30D.DLL::CWinApp::SetRegistryKey
-
-
- 29) MFC uses GetFileAttributes to bot get attr and test if file exists
-
- ignore failure KERNEL32.DLL:GetFileAttributesA in function EXE:CDocument::DoFileSave
- ignore failure KERNEL32.DLL:GetFileAttributesA in function MFC30D.DLL:CDocument::DoFileSave
-
- 30) ??? Look at error file
-
- ignore resource_leak(20,0) VirtualAlloc in function EXE:__heap_term
-
- 31) This is DLLHUSK-specific, not library
-
- ignore resource_leak(20,0) CreateDialogParamA in function MFC30D.DLL:CDialogBar::Create
- ignore resource_leak(20,0) CreateDialogParamA in function EXE:CDialogBar::Create
-
- 32) Like AfxRegisterWndClass, but for TRACER.DLL, part of app
-
- ignore failure USER32.DLL:GetClassInfoA in function TRACER.dll:AfxRegisterClass
- ignore failure USER32.DLL:LoadIconA in function TRACER.dll:RegisterWithIcon
- ignore failure KERNEL32.DLL:FindResourceA in function TRACER.dll:AfxFindResource
- ignore param 2 USER32.DLL:GetDlgItem in function TRACER.dll:CWnd::GetDlgItem
- ignore failure USER32.DLL:GetDlgItem in function TRACER.dll:CWnd::GetDlgItem
- ignore param 1 KERNEL32.DLL:CloseHandle in function TRACER.dll:CWinThread::~CWinThread
-
- 33) ??? MFC creates a window in the temporary map in FromHandle but is it ever destroyed?
- In any case, this is app-specific., not lib
-
- ignore resource_leak(19,0) CObject::operator new in function TRACER.dll:CRuntimeClass::CreateObject
- ignore resource_leak(19,0) CObject::operator new in function TRACER.dll:CRuntimeClass::CreateObject
- ignore resource_leak(19,0) CObject::operator new in function TRACER.dll:CRuntimeClass::CreateObject
- ignore resource_leak(19,0) CObject::operator new in function TRACER.dll:CRuntimeClass::CreateObject
-
-
- 34) MFC passes NULL to memcpy when size of copy is zero bytes
-
- ignore param 2 MSVCRT20.DLL:memcpy in function MFCO30D.DLL:CEnumFormatEtc::AddFormat
- ignore param 2 MSVCRT20.DLL:memcpy in function EXE:CEnumFormatEtc::AddFormat
-
-
- 35) MFC loads acclerator table for embedding, but it may not exist
-
- ignore failure USER32.DLL:LoadAcceleratorsA in function EXE:CDocTemplate::SetServerInfo
- ignore failure USER32.DLL:LoadAcceleratorsA in function MFCO30D.DLL:CDocTemplate::SetServerInfo
-
- 36) Print preview is printing "Page 1" or "Pages n-m", so it calls wsprintf with 1st page #,
- last page # even though the format string may be "Page %d"
-
- ignore param 2 USER32.DLL:wsprintfA in function EXE:CPreviewView::OnDisplayPageNumber
- ignore param 2 USER32.DLL:wsprintfA in function MFCO30D.DLL:CPreviewView::OnDisplayPageNumber
-
- 37) Cut/Copy/Paste in superpad
-
- ignore bad_address(15,0) in function EXE:CWinApp::UpdatePrinterSelection
- ignore bad_address(15,0) in function EXE:CWinApp::UpdatePrinterSelection
- ignore failure GDI32.DLL:GetTextMetricsA in function EXE:ClipLine
- ignore failure GDI32.DLL:GetTextMetricsA in function EXE:ClipLine
- ignore verbose_overrun(14,3) in module MFCANS32.dll
- ignore bad_address(23,17) in module MFCANS32.dll
- ignore bad_address(23,17) in module MFCANS32.dll
- ignore bad_address(23,17) in module MFCANS32.dll
- ignore bad_address(23,17) in function EXE:_AfxOleGetObjectDescriptorData
- ignore bad_address(23,17) in function EXE:_AfxOleGetObjectDescriptorData
- ignore failure GDI32.DLL:GetTextMetricsA in function EXE:ClipLine
- ignore failure GDI32.DLL:GetTextMetricsA in function EXE:ClipLine
- ignore failure GDI32.DLL:GetTextMetricsA in function EXE:ClipLine
- ignore failure GDI32.DLL:GetTextMetricsA in function EXE:ClipLine
- ignore bad_address(23,17) in module MFCANS32.dll
- ignore verbose_overrun(14,3) in function EXE:COleDataSource::Empty
- ignore verbose_overrun(14,3) in function EXE:COleDataSource::Empty
- ignore verbose_overrun(14,3) in module MFCANS32.dll
-
- 38) MFC CBitMap::LoadBitmap can fail (Seen in SurfBear).
-
- ignore failure USER32.DLL:LoadBitmapA in function MFC40D.DLL:CBitmap::LoadBitmapA
-
- 39) MFC internal critical section (Seen in SurfBear)
-
- ignore resource_leak(20,0) InitializeCriticalSection in function MFC40D.DLL:AfxLockGlobals
-
-
- 40) MFC uses these functions throughout to perform sanity-checks.
-
- ignore api KERNEL32.DLL:GetLastError in everywhere
- ignore api KERNEL32.DLL:IsBadReadPtr in everywhere
- ignore api KERNEL32.DLL:IsBadWritePtr in everywhere
- ignore api USER32.DLL:IsWindow in everywhere
- ignore api KERNEL32.DLL:SetLastError in everywhere
- ignore api KERNEL32.DLL:TlsGetValue in everywhere
- ignore api KERNEL32.DLL:EnterCriticalSection in everywhere
- ignore api KERNEL32.DLL:LeaveCriticalSection in everywhere
-
- 41) For some reason, the call to GetSafeHwnd can return NULL here.
-
- ignore param 1 USER32.DLL:GetWindowLongA in file MFCO40D.DLL:occcont.cpp
-
- 42) The usual FindResource failure, but it is in the OLE side of the house.
-
- ignore failure KERNEL32.DLL:FindResourceA in file MFCO40D.DLL:occmgr.cpp
-
- 43) MFC passed NULL as the 5th parameter to IClassFactory2::CreateInstanceLic even through the
- documentation says that it should not be NULL.
-
- ignore ole_param 5 IClassFactory2::CreateInstanceLic in file MFCO40D.DLL:olefact.cpp
-
- 44) MFC can pass a bad menu handle to OleCreateMenuDescriptor if the container InsertMenus
- returns something other than S_OK.
-
- ignore param 1 OLE32.DLL:OleCreateMenuDescriptor in file MFCO40D.DLL:ctlinplc.cpp
-
- 45) A by-product of #44. If it is true, then the thunk hook is called with a NULL parameter.
-
- ignore param 1 OLE32.DLL:OleCreateMenuDescriptor in file MFCO40D.DLL:oledata.cpp
-
- 46) MFC does not follow the recomendations of the OLE documentation and passes a -1 to
- the 5th parameter of IOleObject::DoVerb. The documentation states:
- "Some code samples pass a lindex value of -1 instead of zero. The value -1
- works but should be avoided in favor of zero. The lindex parameter is a reserved parameter, and
- for reasons of consistency Microsoft recommends assigning a zero value to all reserved
- parameters."
-
- ignore ole_param 5 IOleObject::DoVerb in file MFCO40D.DLL:olecli3.cpp
-
- 47) The pointer to the objects display rectangle can be NULL if the pView passed to
- COleClientItem::Activate is NULL.
-
- ignore ole_param 7 IOleObject::DoVerb in file MFCO40D.DLL:olecli3.cpp
-
- 48) When unhooking dispatch code, the hwndActiveObject can be NULL.
-
- ignore param 3 OLE32.DLL:OleSetMenuDescriptor in file MFCO40D.DLL:olecli2.cpp
-
-
- 49) It is perfectly reasonable for OleGetAutoConvert to fail.
-
- ignore failure OLE32.DLL:OleGetAutoConvert in file MFCO40D.DLL:oledata.cpp
-
- 50) More memory and resource leaks specific to MFC 4.2.
-
- ignore resource_leak(19,0) operator_new in file MFC42D.DLL:"wincore.cpp"
- ignore resource_leak(19,0) GlobalAlloc in function MFC42D.DLL:"AfxGetPropSheetFont"
- ignore resource_leak(19,0) operator_new in file MFC42D.DLL:"wingdi.cpp"
- ignore resource_leak(19,0) operator_new in file MFC42D.DLL:"winmenu.cpp"
- ignore resource_leak(20,0) LoadBitmapA in function MFC42D.DLL:"CBitmap::LoadBitmapA"
-