home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / numega / sc501.exe / data1.cab / Data_Files / MFCERROR.TXT < prev    next >
Encoding:
Text File  |  1997-11-25  |  16.4 KB  |  357 lines

  1. NuMega Technologies, Inc, 1995 (c), MFC Supression File, Rev 001
  2.  
  3. SmartCheck is capable of detecting errors in third party libraries. This file
  4. documents the errors that SmartCheck finds in the Microsoft MFC library. These
  5. errors are also included in the MFC.SUP suppression file.
  6.  
  7. By including these errors in the MFC.SUP suppression file, SmartCheck will
  8. ignore these errors at run-time. This will reduce the number of errors that you
  9. have to review since you have little or no ability to correct them. If you want
  10. to be notified of every error in library, do not use the MFC.SUP suppression file.
  11.  
  12.  
  13. 1) MFC DLL initialization is attempting to load the appropriate
  14.    language-specific DLL. LoadLibrary may fail if the DLL is not present.
  15.  
  16.    ignore failure KERNEL32.DLL:LoadLibraryA in function MFC30D.DLL:DllMain
  17.  
  18.  
  19. 2) AfxFindResource is a low-level function to find a resource.
  20.    In general, it is legitimate to maybe not find it.
  21.  
  22.    ignore failure KERNEL32.DLL:FindResourceA in function MFC30D.DLL:AfxFindResource
  23.    ignore failure KERNEL32.DLL:FindResourceA in function EXE:AfxFindResource
  24.  
  25.  
  26. 3) MFC is attempting to find the main window's icon. It is legit if
  27.    none exists in the resource file (MFC will supply a default)
  28.  
  29.    ignore failure USER32.DLL:LoadIconA in file MFC30D.DLL:appinit.cpp
  30.    ignore failure USER32.DLL:LoadIconA in file EXE:appinit.cpp
  31.  
  32. 4) An application will usually have accelerators, but it is not a
  33.    requirement. If not, the accel table will be NULL, which is OK.
  34.  
  35.    ignore failure USER32.DLL:LoadAcceleratorsA in function MFC30D.DLL:CMultiDocTemplate::CMultiDocTemplate
  36.    ignore failure USER32.DLL:LoadAcceleratorsA in function EXE:CMultiDocTemplate::CMultiDocTemplate
  37.  
  38. 5) MFC checks to see if the class exists. Legitimate if not (MFC will register).
  39.  
  40.    ignore failure USER32.DLL:GetClassInfoA in function MFC30D.DLL:AfxRegisterWndClass
  41.    ignore failure USER32.DLL:GetClassInfoA in function EXE:AfxRegisterWndClass
  42.  
  43.  
  44. 6) MFC DestroyToolTip is destroying timer. (wrapper probelm)
  45.  
  46.    ignore failure USER32.DLL:KillTimer in function MFC30D.DLL:CWnd::KillTimer
  47.    ignore failure USER32.DLL:KillTimer in function EXE:CWnd::KillTimer
  48.  
  49.  
  50. 7) CWnd::GetDescendantWindow looks for a descendant child window with a
  51.    given ID. In general, it may not find one.
  52.  
  53.    ignore param 2 USER32.DLL:GetDlgItem in function MFC30D.DLL:CWnd::GetDescendantWindow
  54.    ignore failure USER32.DLL:GetDlgItem in function MFC30D.DLL:CWnd::GetDescendantWindow
  55.    ignore param 2 USER32.DLL:GetDlgItem in function EXE:CWnd::GetDescendantWindow
  56.    ignore failure USER32.DLL:GetDlgItem in function EXE:CWnd::GetDescendantWindow
  57.    ignore param 2 USER32.DLL:GetDlgItem in function MFC30D.DLL:CWnd::GetDlgItem
  58.    ignore failure USER32.DLL:GetDlgItem in function MFC30D.DLL:CWnd::GetDlgItem
  59.    ignore param 2 USER32.DLL:GetDlgItem in function EXE:CWnd::GetDlgItem
  60.    ignore failure USER32.DLL:GetDlgItem in function EXE:CWnd::GetDlgItem
  61.  
  62.  
  63. 8) Sometimes a control bar seems to have a control ID = 0. (variable)
  64.  
  65.    ignore failure USER32.DLL:GetDlgCtrlID in function MFC30D.DLL:CFrameWnd::GetControlBar
  66.    ignore failure USER32.DLL:GetDlgCtrlID in function EXE:CFrameWnd::GetControlBar
  67.  
  68. 9) MFC is storing the old window proc under the property "AfxOldWndProc".
  69.    For a newly subclassed window, this property should not be used, so
  70.    GetProp("AfxOldWndProc") should return NULL.
  71.  
  72.    ignore failure USER32.DLL:GetPropA in function MFC30D.DLL:_AfxStandardSubclass
  73.    ignore failure USER32.DLL:GetPropA in function EXE:_AfxStandardSubclass
  74.  
  75.  
  76. 10) If the special property "StayDisabled" is set, MFC will keep the window
  77.     disabled// otherwise enable as normal. This is used for MAPI support.
  78.  
  79.     ignore failure USER32.DLL:GetPropA in function MFC30D.DLL:CFrameWnd::OnEnable
  80.     ignore failure USER32.DLL:GetPropA in function EXE:CFrameWnd::OnEnable
  81.  
  82.  
  83. 12) MFC is calling the Windows DefFrameProc to handle WM_NCDESTROY
  84.     after the MFC client window (m_hWndMDIClient) has already been destroyed.
  85.     In other words, IsWindow(hWndMDIClient) would fail. This is OK as far as Windows is concerned.
  86.  
  87.     ignore param 2 USER32.DLL:DefFrameProcA in function MFC30D.DLL:CMDIFrameWnd::DefWindowProcA
  88.     ignore param 2 USER32.DLL:DefFrameProcA in function EXE:CMDIFrameWnd::DefWindowProcA
  89.  
  90.  
  91. 13) MFC relies on the fact that a window's menu is automatically destroyed
  92.     when the window itself is destroyed.
  93.  
  94.     ignore resource_leak LoadMenuA in function MFC30D.DLL:CFrameWnd::Create
  95.     ignore resource_leak LoadMenuA in function EXE:CFrameWnd::Create
  96.  
  97. 14) MFC is trying to close the pseudo-handle returned by GetCurrentThread,
  98.     which is the thread in the application object CWinApp. I am guessing that
  99.     this is not allowed.
  100.  
  101.     ignore param 1 KERNEL32.DLL:CloseHandle in function MFC30D.DLL:CWinThread::~CWinThread
  102.     ignore failure KERNEL32.DLL:CloseHandle in function MFC30D.DLL:CWinThread::~CWinThread
  103.     ignore param 1 KERNEL32.DLL:CloseHandle in function EXE:CWinThread::~CWinThread
  104.     ignore failure KERNEL32.DLL:CloseHandle in function EXE:CWinThread::~CWinThread
  105.  
  106. 15) MFC is trying to get the address of various functions in CTL3D32.DLL
  107.     by using the ordinal// but the version of the DLL may be wrong, in which
  108.     case some may not exist. If GetProcAddress returns NULL for any
  109.     function, MFC aborts, assuming the library couldn't be loaded.
  110.  
  111.     ignore failure KERNEL32.DLL:GetProcAddress in function MFC30D.DLL:CWinApp::Enable3dControls
  112.     ignore failure KERNEL32.DLL:GetProcAddress in function EXE:CWinApp::Enable3dControls
  113.  
  114.  
  115. 16)  MFC is trying to load "CTL3D32.DLL", which may not exist on the user's
  116.      system.
  117.  
  118.      ignore resource_leak LoadLibraryA in function MFC30D.DLL:CWinApp::Enable3dControls
  119.      ignore resource_leak LoadLibraryA in function EXE:CWinApp::Enable3dControls
  120.  
  121.  
  122. 17)  Wrapper Problem.
  123.  
  124.      ignore resource_leak TlsAlloc in function MFC30D.DLL:_AfxTlsAlloc
  125.      ignore resource_leak TlsAlloc in function EXE:_AfxTlsAlloc
  126.  
  127.  
  128. 18) MFC leaks strings it creates during initialization (e.g., m_pszExeName,
  129.      m_pszAppName, etc). *** Check for all _strdup ???
  130.  
  131.      ignore resource_leak __strdup in function MFC30D.DLL:CWinApp::SetCurrentHandles
  132.      ignore resource_leak __strdup in function EXE:CWinApp::SetCurrentHandles
  133.  
  134.  
  135. 19) AUTODRIV has failed because "AutoClik.Document.1" is not
  136.     registered, so the dialog fails to create and the error stands.
  137.  
  138.     ignore failure USER32.DLL:DialogBoxParamA in function EXE:CDialog::DoModal
  139.  
  140.     *** No idea. Also in SUPERPAD.
  141.     ignore bad_address(23,16) in module MFCANS32.dll
  142.  
  143.     // *** No idea, but happens frequently
  144.  
  145.     ignore resource_leak _malloc in function EXE:__lock
  146.     ignore resource_leak _malloc in function MFC30D.DLL:__lock
  147.  
  148.  
  149. 20) When a "File Save As" dialog is displayed, and you move the mouse
  150.     over one of the buttons in the dialog button bar, as Windows generates
  151.     tooltips for the button, it sends the dialog a TTN_NEEDTEXTA message
  152.     with 0 (zero) as the control ID. When OnNotify obtains this ID,
  153.     GetDlgCtrlID fails. Wrapper problem.
  154.  
  155.     ignore failure USER32.DLL:GetDlgCtrlID in function EXE:CWnd::OnNotify
  156.     ignore failure USER32.DLL:GetDlgCtrlID in function MFC30D.DLL:CWnd::OnNotify
  157.  
  158. 21) MFC is updating the recent file menu and deleting an item that
  159.     doesn't exist. No harm done.
  160.  
  161.     ignore failure USER32.DLL:DeleteMenu in function MFC30D.DLL:CMenu::DeleteMenu
  162.     ignore failure USER32.DLL:DeleteMenu in function EXE:CMenu::DeleteMenu
  163.  
  164. 22) MFC BUG in AfxOleRegisterServerClass:
  165.  
  166.         TCHAR szPathName[_MAX_PATH];
  167.         LPTSTR pszTemp = szPathName;
  168.         if (afxData.nWinVer >= 0x333)
  169.                 *pszTemp++ = '"';
  170.         ::GetModuleFileName(AfxGetInstanceHandle(), pszTemp, _MAX_PATH);
  171.  
  172.         pszTemp is incremented, so 3rd arg to GetModuleFileName should be _MAX_PATH - 1
  173.  
  174.      ignore overrun(14,2) in function MFCO30D.DLL:AfxOleRegisterServerClass
  175.      ignore overrun(14,2) in function EXE:AfxOleRegisterServerClass
  176.  
  177. 23) Wrapper problem. In updating the recent file menu, MFC may attempt to parse
  178.     a "bad" file name. This is harmless: AfxComparePath will fail.
  179.  
  180.     ignore failure KERNEL32.DLL:GetFullPathNameA in function EXE:AfxFullPath
  181.     ignore failure KERNEL32.DLL:GetFullPathNameA in function MFC30D.DLL:AfxFullPath
  182.  
  183.  
  184. 24) *** Something to do with database stuff. Check later?
  185.  
  186.     ignore overrun(14,2) in function EXE:CDatabase::Open
  187.     ignore overrun(14,2) in function MFC30D.DLL:CDatabase::Open
  188.     ignore failure KERNEL32.DLL:GetProcAddress in module DBNMPNTW.DLL
  189.  
  190.  
  191. 25) More wrapper problems.
  192.  
  193.     ignore resource_leak(20,0) CreateFileA in function EXE:CFile::Open
  194.     ignore resource_leak(20,0) CreateFileA in function MFC30D.DLL:CFile::Open
  195.  
  196. 26) Difficult to reproduce leak problem.
  197.  
  198.     ignore resource_leak(20,0) CreateDialogParamA in function EXE:CFormView::Create
  199.     ignore resource_leak(20,0) CreateDialogParamA in function MFC30D.DLL:CFormView::Create
  200.  
  201. 27) When doing Print Setup, BC complains at the end when MFC does GlobalFree
  202.     on device mode/name structures when ~CWinApp cleans up. Code looks OK
  203.     to me.
  204.  
  205.    ignore bad_address(15,0) in function MFC30D.DLL:CWinApp::~CWinApp
  206.    ignore bad_address(15,0) in function EXE:CWinApp::~CWinApp
  207.  
  208.  
  209. 28) MFC leaks   m_pszRegistryKey and    m_pszProfileName
  210.  
  211.     ignore resource_leak(19,0) __strdup in function EXE:CWinApp::SetRegistryKey
  212.     ignore resource_leak(19,0) __strdup in function MFC30D.DLL::CWinApp::SetRegistryKey
  213.  
  214.  
  215. 29) MFC uses GetFileAttributes to bot get attr and test if file exists
  216.  
  217.     ignore failure KERNEL32.DLL:GetFileAttributesA in function EXE:CDocument::DoFileSave
  218.     ignore failure KERNEL32.DLL:GetFileAttributesA in function MFC30D.DLL:CDocument::DoFileSave
  219.  
  220. 30) ??? Look at error file
  221.  
  222.     ignore resource_leak(20,0) VirtualAlloc in function EXE:__heap_term
  223.  
  224. 31) This is DLLHUSK-specific, not library
  225.  
  226.     ignore resource_leak(20,0) CreateDialogParamA in function MFC30D.DLL:CDialogBar::Create
  227.     ignore resource_leak(20,0) CreateDialogParamA in function EXE:CDialogBar::Create
  228.  
  229. 32) Like AfxRegisterWndClass, but for TRACER.DLL, part of app
  230.  
  231.     ignore failure USER32.DLL:GetClassInfoA in function TRACER.dll:AfxRegisterClass
  232.     ignore failure USER32.DLL:LoadIconA in function TRACER.dll:RegisterWithIcon
  233.     ignore failure KERNEL32.DLL:FindResourceA in function TRACER.dll:AfxFindResource
  234.     ignore param 2 USER32.DLL:GetDlgItem in function TRACER.dll:CWnd::GetDlgItem
  235.     ignore failure USER32.DLL:GetDlgItem in function TRACER.dll:CWnd::GetDlgItem
  236.     ignore param 1 KERNEL32.DLL:CloseHandle in function TRACER.dll:CWinThread::~CWinThread
  237.  
  238. 33) ??? MFC creates a window in the temporary map in FromHandle but is it ever destroyed?
  239.     In any case, this is app-specific., not lib
  240.  
  241.     ignore resource_leak(19,0) CObject::operator new in function TRACER.dll:CRuntimeClass::CreateObject
  242.     ignore resource_leak(19,0) CObject::operator new in function TRACER.dll:CRuntimeClass::CreateObject
  243.     ignore resource_leak(19,0) CObject::operator new in function TRACER.dll:CRuntimeClass::CreateObject
  244.     ignore resource_leak(19,0) CObject::operator new in function TRACER.dll:CRuntimeClass::CreateObject
  245.  
  246.  
  247. 34) MFC passes NULL to memcpy when size of copy is zero bytes
  248.  
  249.     ignore param 2 MSVCRT20.DLL:memcpy in function MFCO30D.DLL:CEnumFormatEtc::AddFormat
  250.     ignore param 2 MSVCRT20.DLL:memcpy in function EXE:CEnumFormatEtc::AddFormat
  251.  
  252.  
  253. 35) MFC loads acclerator table for embedding, but it may not exist
  254.  
  255.     ignore failure USER32.DLL:LoadAcceleratorsA in function EXE:CDocTemplate::SetServerInfo
  256.     ignore failure USER32.DLL:LoadAcceleratorsA in function MFCO30D.DLL:CDocTemplate::SetServerInfo
  257.  
  258. 36) Print preview is printing "Page 1" or "Pages n-m", so it calls wsprintf with 1st page #,
  259.     last page # even though the format string may be "Page %d"
  260.  
  261.     ignore param 2 USER32.DLL:wsprintfA in function EXE:CPreviewView::OnDisplayPageNumber
  262.     ignore param 2 USER32.DLL:wsprintfA in function MFCO30D.DLL:CPreviewView::OnDisplayPageNumber
  263.  
  264. 37) Cut/Copy/Paste in superpad
  265.  
  266.     ignore bad_address(15,0) in function EXE:CWinApp::UpdatePrinterSelection
  267.     ignore bad_address(15,0) in function EXE:CWinApp::UpdatePrinterSelection
  268.     ignore failure GDI32.DLL:GetTextMetricsA in function EXE:ClipLine
  269.     ignore failure GDI32.DLL:GetTextMetricsA in function EXE:ClipLine
  270.     ignore verbose_overrun(14,3) in module MFCANS32.dll
  271.     ignore bad_address(23,17) in module MFCANS32.dll
  272.     ignore bad_address(23,17) in module MFCANS32.dll
  273.     ignore bad_address(23,17) in module MFCANS32.dll
  274.     ignore bad_address(23,17) in function EXE:_AfxOleGetObjectDescriptorData
  275.     ignore bad_address(23,17) in function EXE:_AfxOleGetObjectDescriptorData
  276.     ignore failure GDI32.DLL:GetTextMetricsA in function EXE:ClipLine
  277.     ignore failure GDI32.DLL:GetTextMetricsA in function EXE:ClipLine
  278.     ignore failure GDI32.DLL:GetTextMetricsA in function EXE:ClipLine
  279.     ignore failure GDI32.DLL:GetTextMetricsA in function EXE:ClipLine
  280.     ignore bad_address(23,17) in module MFCANS32.dll
  281.     ignore verbose_overrun(14,3) in function EXE:COleDataSource::Empty
  282.     ignore verbose_overrun(14,3) in function EXE:COleDataSource::Empty
  283.     ignore verbose_overrun(14,3) in module MFCANS32.dll
  284.  
  285. 38) MFC CBitMap::LoadBitmap can fail (Seen in SurfBear).
  286.  
  287.     ignore failure USER32.DLL:LoadBitmapA in function MFC40D.DLL:CBitmap::LoadBitmapA
  288.  
  289. 39) MFC internal critical section (Seen in SurfBear)
  290.  
  291.     ignore resource_leak(20,0) InitializeCriticalSection in function MFC40D.DLL:AfxLockGlobals
  292.  
  293.  
  294. 40) MFC uses these functions throughout to perform sanity-checks.
  295.  
  296.     ignore api KERNEL32.DLL:GetLastError in everywhere
  297.     ignore api KERNEL32.DLL:IsBadReadPtr in everywhere
  298.     ignore api KERNEL32.DLL:IsBadWritePtr in everywhere
  299.     ignore api USER32.DLL:IsWindow in everywhere
  300.     ignore api KERNEL32.DLL:SetLastError in everywhere
  301.     ignore api KERNEL32.DLL:TlsGetValue in everywhere
  302.     ignore api KERNEL32.DLL:EnterCriticalSection in everywhere
  303.     ignore api KERNEL32.DLL:LeaveCriticalSection in everywhere
  304.  
  305. 41) For some reason, the call to GetSafeHwnd can return NULL here.
  306.  
  307.     ignore param 1 USER32.DLL:GetWindowLongA in file MFCO40D.DLL:occcont.cpp
  308.  
  309. 42) The usual FindResource failure, but it is in the OLE side of the house.
  310.  
  311.     ignore failure KERNEL32.DLL:FindResourceA in file MFCO40D.DLL:occmgr.cpp
  312.  
  313. 43) MFC passed NULL as the 5th parameter to IClassFactory2::CreateInstanceLic even through the
  314.     documentation says that it should not be NULL.
  315.  
  316.      ignore ole_param 5 IClassFactory2::CreateInstanceLic in file MFCO40D.DLL:olefact.cpp
  317.  
  318. 44) MFC can pass a bad menu handle to OleCreateMenuDescriptor if the container InsertMenus
  319.     returns something other than S_OK.
  320.  
  321.     ignore param 1 OLE32.DLL:OleCreateMenuDescriptor in file MFCO40D.DLL:ctlinplc.cpp
  322.  
  323. 45) A by-product of #44.  If it is true, then the thunk hook is called with a NULL parameter.
  324.  
  325.     ignore param 1 OLE32.DLL:OleCreateMenuDescriptor in file MFCO40D.DLL:oledata.cpp
  326.  
  327. 46) MFC does not follow the recomendations of the OLE documentation and passes a -1 to
  328.     the 5th parameter of IOleObject::DoVerb.  The documentation states:
  329.     "Some code samples pass a lindex value of -1 instead of zero. The value -1
  330.     works but should be avoided in favor of zero. The lindex parameter is a reserved parameter, and
  331.     for reasons of consistency Microsoft recommends assigning a zero value to all reserved
  332.     parameters."
  333.  
  334.     ignore ole_param 5 IOleObject::DoVerb in file MFCO40D.DLL:olecli3.cpp
  335.  
  336. 47) The pointer to the objects display rectangle can be NULL if the pView passed to
  337.     COleClientItem::Activate is NULL.
  338.  
  339.     ignore ole_param 7 IOleObject::DoVerb in file MFCO40D.DLL:olecli3.cpp
  340.  
  341. 48) When unhooking dispatch code, the hwndActiveObject can be NULL.
  342.  
  343.     ignore param 3 OLE32.DLL:OleSetMenuDescriptor in file MFCO40D.DLL:olecli2.cpp
  344.  
  345.  
  346. 49) It is perfectly reasonable for OleGetAutoConvert to fail.
  347.  
  348.     ignore failure OLE32.DLL:OleGetAutoConvert in file MFCO40D.DLL:oledata.cpp
  349.  
  350. 50) More memory and resource leaks specific to MFC 4.2.
  351.  
  352.     ignore resource_leak(19,0) operator_new in file MFC42D.DLL:"wincore.cpp"
  353.     ignore resource_leak(19,0) GlobalAlloc in function MFC42D.DLL:"AfxGetPropSheetFont"
  354.     ignore resource_leak(19,0) operator_new in file MFC42D.DLL:"wingdi.cpp"
  355.     ignore resource_leak(19,0) operator_new in file MFC42D.DLL:"winmenu.cpp"
  356.     ignore resource_leak(20,0) LoadBitmapA in function MFC42D.DLL:"CBitmap::LoadBitmapA"
  357.