I played a bit with smatch and Wine (after reading http://people.redhat.com/mstefani/wine/smatch/), to try to get over what I mentionned in my last email (regarding winapi_check and cross-calls in parenthesis).
I attach the smatch script to generate the results I have. It's still not perfect (the listview.c references are wrong, for example), but as it's tied to gcc it can detect some calls which otherwise would not be caught. For example, the calls to GetWindowLongA in header.c are in a macro.
Not all of them are bugs: caution is needed when checking, although reducing the number of false positive would likely be welcome (either by modifying the script or patches).
Vincent
Vincent Béron wrote:
I played a bit with smatch and Wine (after reading http://people.redhat.com/mstefani/wine/smatch/), to try to get over what I mentionned in my last email (regarding winapi_check and cross-calls in parenthesis).
I attach the smatch script to generate the results I have. It's still not perfect (the listview.c references are wrong, for example), but as it's tied to gcc it can detect some calls which otherwise would not be caught. For example, the calls to GetWindowLongA in header.c are in a macro.
If you retest with current CVS some of those GetWindowLongA calls may have disappeared.
Rob
Le mer 25/08/2004 à 14:03, Robert Shearman a écrit :
Vincent Béron wrote:
I played a bit with smatch and Wine (after reading http://people.redhat.com/mstefani/wine/smatch/), to try to get over what I mentionned in my last email (regarding winapi_check and cross-calls in parenthesis).
I attach the smatch script to generate the results I have. It's still not perfect (the listview.c references are wrong, for example), but as it's tied to gcc it can detect some calls which otherwise would not be caught. For example, the calls to GetWindowLongA in header.c are in a macro.
If you retest with current CVS some of those GetWindowLongA calls may have disappeared.
That was with current CVS, before Alexandre last commits :) Yes, they did disappear. Attached is a revised log.
Vincent
On Wed, Aug 25, 2004 at 02:17:22PM -0400, Vincent Béron wrote:
That was with current CVS, before Alexandre last commits :) Yes, they did disappear. Attached is a revised log.
Here is a somewhat cleaned up list. It's not too bad it seems, at 144 entries:
crypt.c 514 CryptAcquireContextW: call to CryptAcquireContextA crypt.c 1136 CryptEnumProviderTypesW: call to CryptEnumProviderTypesA crypt.c 1299 CryptGetDefaultProviderW: call to CryptGetDefaultProviderA crypt.c 1754 CryptSetProviderExW: call to CryptSetProviderExA string.c 630 StrRStrIW: call to COMCTL32_ChrCmpIA tooltips.c 1044 TOOLTIPS_AddToolW: call to SendMessageA colordlg.c 1292 ChooseColorW: call to FindResourceA filedlg.c 481 GetFileDialog95W: call to GetCurrentDirectoryA filedlg.c 501 GetFileDialog95W: call to SetCurrentDirectoryA filedlg.c 3668 GetFileName31W: call to GetWindowLongA fontdlg.c 1135 FormatCharDlgProcW: call to GetPropA printdlg.c 165 PRINTDLG_SetUpPrinterListComboW: call to GetDefaultPrinterA printdlg.c 167 PRINTDLG_SetUpPrinterListComboW: call to SendDlgItemMessageA printdlg.c 384 PRINTDLG_UpdatePrintDlgW: call to LoadStringA printdlg.c 387 PRINTDLG_UpdatePrintDlgW: call to LoadStringA printdlg.c 389 PRINTDLG_UpdatePrintDlgW: call to MessageBoxA printdlg.c 684 PRINTDLG_SetUpPaperComboBoxW: call to SendDlgItemMessageA printdlg.c 691 PRINTDLG_SetUpPaperComboBoxW: call to SendDlgItemMessageA printdlg.c 748 PRINTDLG_SetUpPaperComboBoxW: call to SendDlgItemMessageA printdlg.c 763 PRINTDLG_SetUpPaperComboBoxW: call to SendDlgItemMessageA printdlg.c 768 PRINTDLG_SetUpPaperComboBoxW: call to SendDlgItemMessageA printdlg.c 1101 PRINTDLG_ChangePrinterW: call to LoadStringA printdlg.c 1103 PRINTDLG_ChangePrinterW: call to SendDlgItemMessageA printdlg.c 1112 PRINTDLG_ChangePrinterW: call to SendDlgItemMessageA printdlg.c 1116 PRINTDLG_ChangePrinterW: call to SendDlgItemMessageA printdlg.c 1169 PRINTDLG_ChangePrinterW: call to SendDlgItemMessageA printdlg.c 1305 PRINTDLG_WMInitDialogW: call to LoadImageA printdlg.c 1307 PRINTDLG_WMInitDialogW: call to LoadImageA printdlg.c 1311 PRINTDLG_WMInitDialogW: call to LoadIconA printdlg.c 1313 PRINTDLG_WMInitDialogW: call to LoadIconA printdlg.c 1317 PRINTDLG_WMInitDialogW: call to SendDlgItemMessageA printdlg.c 1334 PRINTDLG_WMInitDialogW: call to RegisterWindowMessageA printdlg.c 1612 PRINTDLG_WMCommandW: call to SendDlgItemMessageA printdlg.c 1615 PRINTDLG_WMCommandW: call to SendDlgItemMessageA printdlg.c 1667 PRINTDLG_WMCommandW: call to SendDlgItemMessageA printdlg.c 1676 PRINTDLG_WMCommandW: call to SendDlgItemMessageA printdlg.c 1696 PRINTDLG_WMCommandW: call to SendDlgItemMessageA printdlg.c 1700 PRINTDLG_WMCommandW: call to SendDlgItemMessageA printdlg.c 1706 PRINTDLG_WMCommandW: call to SendDlgItemMessageA printdlg.c 1723 PRINTDLG_WMCommandW: call to SendDlgItemMessageA printdlg.c 1726 PRINTDLG_WMCommandW: call to SendDlgItemMessageA printdlg.c 1733 PRINTDLG_WMCommandW: call to SendDlgItemMessageA printdlg.c 1736 PRINTDLG_WMCommandW: call to SendDlgItemMessageA printdlg.c 2507 PRINTDLG_PS_UpdateDlgStructW: call to GetDlgItemTextA printdlg.c 2508 PRINTDLG_PS_UpdateDlgStructW: call to GetDlgItemTextA printdlg.c 2509 PRINTDLG_PS_UpdateDlgStructW: call to GetDlgItemTextA printdlg.c 2510 PRINTDLG_PS_UpdateDlgStructW: call to GetDlgItemTextA printdlg.c 2712 PageDlgProcW: call to SetPropA printdlg.c 2744 PageDlgProcW: call to SetDlgItemTextA printdlg.c 2746 PageDlgProcW: call to SetDlgItemTextA printdlg.c 2748 PageDlgProcW: call to SetDlgItemTextA printdlg.c 2750 PageDlgProcW: call to SetDlgItemTextA printdlg.c 2756 PageDlgProcW: call to SetDlgItemTextA printdlg.c 2757 PageDlgProcW: call to SetDlgItemTextA printdlg.c 2758 PageDlgProcW: call to SetDlgItemTextA printdlg.c 2759 PageDlgProcW: call to SetDlgItemTextA printdlg.c 2768 PageDlgProcW: call to GetPropA main.c 245 DirectDrawEnumerateExW: call to DirectDrawEnumerateExA font.c 242 FONT_EnumLogFontExWToA)(pointer_type(parm_decl(fontW: call to FONT_LogFontWToA font.c 314 FONT_NewTextMetricExWToA)(pointer_type(parm_decl(ptmW: call to FONT_TextMetricWToA printdrv.c 99 StartDocW: call to HEAP_strdupWtoA printdrv.c 101 StartDocW: call to HEAP_strdupWtoA printdrv.c 103 StartDocW: call to HEAP_strdupWtoA printdrv.c 106 StartDocW: call to StartDocA comm.c 2161 CommConfigDialogW: call to HEAP_strdupWtoA comm.c 2164 CommConfigDialogW: call to CommConfigDialogA comm.c 2286 SetDefaultCommConfigW: call to HEAP_strdupWtoA comm.c 2289 SetDefaultCommConfigW: call to SetDefaultCommConfigA resource.c 235 FindResourceExW: call to get_res_name_type_WtoA lzexpand_main.c 313 GetExpandedNameW: call to GetExpandedNameA lzexpand_main.c 564 LZOpenFileW: call to LZOpenFileA rpc_binding.c 335 RPCRT4_CreateBindingW: call to RPCRT4_strdupWtoA rpc_binding.c 367 RPCRT4_CompleteBindingW: call to RPCRT4_strdupWtoA rpc_binding.c 370 RPCRT4_CompleteBindingW: call to RPCRT4_strdupWtoA rpc_binding.c 372 RPCRT4_CompleteBindingW: call to RPCRT4_strndupA rpc_binding.c 1032 RpcBindingToStringBindingW: call to RpcBindingToStringBindingA rpc_binding.c 1034 RpcBindingToStringBindingW: call to RpcStringFreeA rpc_server.c 707 RpcServerUseProtseqEpExW: call to RPCRT4_strdupWtoA rpc_server.c 708 RpcServerUseProtseqEpExW: call to RPCRT4_strdupWtoA shell32_main.c 845 ShellAboutW: call to FindResourceA shellole.c 771 DragQueryFileW: call to DragQueryFileA systray.c 393 Shell_NotifyIconW: call to Shell_NotifyIconA ordinal.c 661 SHStringFromGUIDW: call to SHStringFromGUIDA ordinal.c 2681 SHCreateWorkerWindowW: call to SHCreateWorkerWindowA ordinal.c 2690 SHCreateWorkerWindowW: call to LoadCursorA ordinal.c 2703 SHCreateWorkerWindowW: call to SetWindowLongA ordinal.c 2706 SHCreateWorkerWindowW: call to SetWindowLongA ordinal.c 2859 PlaySoundWrapW: call to LoadLibraryA ordinal.c 2912 ExtTextOutWrapW: call to LoadLibraryA ordinal.c 2924 SHGetFileInfoWrapW: call to LoadLibraryA ordinal.c 2935 DragQueryFileWrapW: call to LoadLibraryA ordinal.c 2946 SHBrowseForFolderWrapW: call to LoadLibraryA ordinal.c 2957 SHGetPathFromIDListWrapW: call to LoadLibraryA ordinal.c 2968 ShellExecuteExWrapW: call to LoadLibraryA ordinal.c 2979 SHFileOperationWrapW: call to LoadLibraryA ordinal.c 2991 ExtractIconExWrapW: call to LoadLibraryA ordinal.c 3028 GetFileVersionInfoSizeWrapW: call to LoadLibraryA ordinal.c 3044 GetFileVersionInfoWrapW: call to LoadLibraryA ordinal.c 3059 VerQueryValueWrapW: call to LoadLibraryA ordinal.c 3121 SHGetNewLinkInfoWrapW: call to LoadLibraryA ordinal.c 3133 SHDefExtractIconWrapW: call to LoadLibraryA ordinal.c 3210 ExtractIconWrapW: call to LoadLibraryA ordinal.c 3340 GetSaveFileNameWrapW: call to LoadLibraryA ordinal.c 3351 WNetRestoreConnectionWrapW: call to LoadLibraryA ordinal.c 3363 WNetGetLastErrorWrapW: call to LoadLibraryA ordinal.c 3374 PageSetupDlgWrapW: call to LoadLibraryA ordinal.c 3385 PrintDlgWrapW: call to LoadLibraryA ordinal.c 3396 GetOpenFileNameWrapW: call to LoadLibraryA path.c 3568 PathIsNetworkPathW: call to LoadLibraryA string.c 602 StrRStrIW: call to ChrCmpIA string.c 1469 StrRetToStrW: call to SHStrDupA string.c 1473 StrRetToStrW: call to SHStrDupA string.c 2189 StrCmpLogicalW: call to SHLWAPI_ChrCmpHelperA string.c 2321 StrFormatByteSizeW: call to StrFormatByteSize64A url.c 378 ParseURLW: call to lstrlenA url.c 378 ParseURLW: call to lstrlenA ../../windows/clipboard.c 261 RegisterClipboardFormatW: call to HEAP_strdupWtoA ../../windows/clipboard.c 262 RegisterClipboardFormatW: call to RegisterClipboardFormatA ../../windows/clipboard.c 304 GetClipboardFormatNameW: call to GetClipboardFormatNameA ../../windows/cursoricon.c 130 map_fileW: call to CreateFileMappingA ../../windows/defwnd.c 299 DEFWND_ImmIsUIMessageW: call to GetModuleHandleA message.c 2284 PeekMessageW: call to GetClassLongA ../../windows/winhelp.c 172 WinHelpW: call to WinHelpA ../../windows/winhelp.c 178 WinHelpW: call to WinHelpA ../../windows/winproc.c 676 WINPROC_MapMsg32ATo32W: call to GetWindowLongA ../../windows/winproc.c 861 WINPROC_UnmapMsg32ATo32W: call to GetWindowLongA ../../windows/winproc.c 1693 WINPROC_MapMsg16To32W: call to STRUCT32_CREATESTRUCT16to32A ../../windows/winproc.c 1708 WINPROC_MapMsg16To32W: call to STRUCT32_MDICREATESTRUCT16to32A ../../windows/winproc.c 1725 WINPROC_MapMsg16To32W: call to STRUCT32_MDICREATESTRUCT16to32A ../../windows/winproc.c 1780 WINPROC_MapMsg16To32W: call to WINPROC_MapMsg16To32A ../../windows/winproc.c 1842 WINPROC_UnmapMsg16To32W: call to WINPROC_UnmapMsg16To32A ../../windows/winproc.c 3163 CallWindowProcW: call to WINPROC_CallProc32WTo32A install.c 567 VerInstallFileW: call to VerInstallFileA internet.c 2127 InternetCheckConnectionW: call to InternetCheckConnectionA driver.c 369 OpenDriverW: call to OpenDriverA joystick.c 159 joyGetDevCapsW: call to joyGetDevCapsA mci.c 1089 mciSendStringW: call to mciSendStringA mmio.c 1088 mmioStringToFOURCCW: call to mmioStringToFOURCCA mmio.c 1384 mmioRenameW: call to mmioRenameA winmm.c 294 mixerGetDevCapsW: call to mixerGetDevCapsA winmm.c 422 mixerGetControlDetailsW: call to mixerGetControlDetailsA winmm.c 438 mixerGetControlDetailsW: call to mixerGetControlDetailsA winmm.c 511 mixerGetLineControlsW: call to mixerGetLineControlsA winmm.c 605 mixerGetLineInfoW: call to mixerGetLineInfoA winmm.c 683 auxGetDevCapsW: call to auxGetDevCapsA winmm.c 761 mciGetErrorStringW: call to mciGetErrorStringA winmm.c 1067 mciSendCommandW: call to MCI_MapMsgWtoA winmm.c 1073 mciSendCommandW: call to mciSendCommandA winmm.c 1075 mciSendCommandW: call to MCI_UnmapMsgWtoA winmm.c 1238 midiOutGetDevCapsW: call to midiOutGetDevCapsA winmm.c 1618 midiInGetDevCapsW: call to midiInGetDevCapsA winmm.c 2586 waveOutGetDevCapsW: call to waveOutGetDevCapsA winmm.c 2981 waveInGetDevCapsW: call to waveInGetDevCapsA info.c 753 DeviceCapabilitiesW: call to DEVMODEdupWtoA info.c 754 DeviceCapabilitiesW: call to HEAP_strdupWtoA info.c 755 DeviceCapabilitiesW: call to HEAP_strdupWtoA info.c 765 DeviceCapabilitiesW: call to DeviceCapabilitiesA info.c 779 DeviceCapabilitiesW: call to DeviceCapabilitiesA info.c 786 DeviceCapabilitiesW: call to DeviceCapabilitiesA info.c 848 DocumentPropertiesW: call to HEAP_strdupWtoA info.c 849 DocumentPropertiesW: call to DEVMODEdupWtoA info.c 857 DocumentPropertiesW: call to DocumentPropertiesA info.c 862 DocumentPropertiesW: call to DocumentPropertiesA info.c 924 OpenPrinterW: call to RegCreateKeyA info.c 1182 AddPrinterW: call to RegCreateKeyA info.c 1187 AddPrinterW: call to RegQueryValueA info.c 1227 AddPrinterW: call to RegSetValueExA info.c 1269 AddPrinterW: call to DEVMODEdupWtoA info.c 1271 AddPrinterW: call to RegSetValueExA info.c 1285 AddPrinterW: call to RegSetValueExA info.c 1289 AddPrinterW: call to RegSetValueExA info.c 1291 AddPrinterW: call to RegSetValueExA info.c 1293 AddPrinterW: call to RegSetValueExA secur32.c 635 SECUR32_findPackageW: call to _makeFnTableA thunks.c 79 thunk_AcquireCredentialsHandleW: call to AcquireCredentialsHandleA thunks.c 900 thunk_ImportSecurityContextW: call to ImportSecurityContextA hhctrl.c 40 HtmlHelpW: call to MessageBoxA winedbg.c 114 dbg_outputW: call to dbg_outputA
On Mon, Sep 13, 2004 at 12:57:57AM -0400, Dimitrie O. Paun wrote:
On Wed, Aug 25, 2004 at 02:17:22PM -0400, Vincent Béron wrote:
That was with current CVS, before Alexandre last commits :) Yes, they did disappear. Attached is a revised log.
Here is a somewhat cleaned up list. It's not too bad it seems, at 144 entries:
crypt.c 514 CryptAcquireContextW: call to CryptAcquireContextA crypt.c 1136 CryptEnumProviderTypesW: call to CryptEnumProviderTypesA crypt.c 1299 CryptGetDefaultProviderW: call to CryptGetDefaultProviderA
[snip] How did you generated this list? By manualy working through the list generated by Vincent's smatch script or by modifying the script directly? I'm asking cause i planned to have a look at the script to minimze the false positives and don't want to duplicate any work.
bye michael
On Tue, Sep 14, 2004 at 11:22:46PM +0200, Michael Stefaniuc wrote:
How did you generated this list? By manualy working through the list generated by Vincent's smatch script or by modifying the script directly?
By manually working through the list, yes.
On Tue, Sep 14, 2004 at 05:43:46PM -0400, Dimitrie O. Paun wrote:
On Tue, Sep 14, 2004 at 11:22:46PM +0200, Michael Stefaniuc wrote:
How did you generated this list? By manualy working through the list generated by Vincent's smatch script or by modifying the script directly?
By manually working through the list, yes.
Ok, attached is a modified wine_crosscalls.pl script which use smatch's abilities better. Also it includes an easy way to check for false positives. At the moment output from the wine tests is ignored. Also *AW functions are allowed to call *A funtions so those are excluded too. On tests done with the wine-20040914 release we get following results: old crosscalls script: 275 lines new crosscalls script: 234 lines Dimi's hand edited list: 178 lines I couldn't see any other obvious rule Dimi used to get the number down and was too lazy to bring both lists to a form where they could get diffed to see the reason. But I attached the my list (i know some of those bugs where fixed and the patches comitted but i wanted to use a stable reference for tests).
bye michael