CrossCallsWtoA

CrossCallsWtoA

  • We should not call ASCII functions from Unicode functions. The Unicode to ASCII conversion is lossy; moreover, with the shift to Unicode, it's actually slower to deal in ASCII than in Unicode, because of the additional conversions required. Although this may require static const WCHAR strings which are less trivial to type and take twice as much room that is a small price to pay for consistency. There are 25 cross calls from Unicode to ANSI as reported on June 1, 2009:

$ tools/winapi/winapi_check --none --progress --cross-call-unicode-ascii
  • dlls/imm32/imm.c: imm32: ImmConfigureIMEW: illegal call to strdupWtoA (Unicode -> ASCII)

  • dlls/imm32/imm.c: imm32: ImmEnumRegisterWordW: illegal call to strdupWtoA (Unicode -> ASCII)

  • dlls/imm32/imm.c: imm32: ImmGetConversionListW: illegal call to strdupWtoA (Unicode -> ASCII)

  • dlls/imm32/imm.c: imm32: ImmRegisterWordW: illegal call to strdupWtoA (Unicode -> ASCII)

  • dlls/imm32/imm.c: imm32: ImmSetCompositionStringW: illegal call to ImmSetCompositionStringA (Unicode -> ASCII)

  • dlls/imm32/imm.c: imm32: ImmUnregisterWordW: illegal call to strdupWtoA (Unicode -> ASCII)

  • dlls/kernel32/lzexpand.c: kernel32: LZOpenFileW: illegal call to LZOpenFileA (Unicode -> ASCII)

  • dlls/rpcrt4/rpc_binding.c: rpcrt4: RpcBindingToStringBindingW: illegal call to RpcBindingToStringBindingA (Unicode -> ASCII)

  • dlls/rpcrt4/rpc_binding.c: rpcrt4: RpcBindingToStringBindingW: illegal call to RpcStringFreeA (Unicode -> ASCII)

  • dlls/rpcrt4/rpc_epmap.c: rpcrt4: RpcEpRegisterW: illegal call to RPCRT4_strdupWtoA (Unicode -> ASCII)

  • dlls/rpcrt4/rpc_epmap.c: rpcrt4: RpcEpRegisterW: illegal call to RpcEpRegisterA (Unicode -> ASCII)

  • dlls/rpcrt4/rpc_server.c: rpcrt4: RpcServerUseProtseqEpExW: illegal call to RPCRT4_strdupWtoA (Unicode -> ASCII)

  • dlls/rpcrt4/rpc_server.c: rpcrt4: RpcServerUseProtseqW: illegal call to RPCRT4_strdupWtoA (Unicode -> ASCII)

  • dlls/shell32/shlfileop.c: shell32: SheGetDirW: illegal call to SetCurrentDirectoryA (Unicode -> ASCII)

  • dlls/user32/winhelp.c: user32: WinHelpW: illegal call to WinHelpA (Unicode -> ASCII)

  • dlls/version/install.c: version: VerInstallFileW: illegal call to VerInstallFileA (Unicode -> ASCII)

  • dlls/winspool.drv/info.c: winspool.drv: AddPrinterW: illegal call to DEVMODEdupWtoA (Unicode -> ASCII)

  • dlls/winspool.drv/info.c: winspool.drv: DeviceCapabilitiesW: illegal call to DEVMODEdupWtoA (Unicode -> ASCII)

  • dlls/winspool.drv/info.c: winspool.drv: DeviceCapabilitiesW: illegal call to DeviceCapabilitiesA (Unicode -> ASCII)

  • dlls/winspool.drv/info.c: winspool.drv: DeviceCapabilitiesW: illegal call to strdupWtoA (Unicode -> ASCII)

  • dlls/winspool.drv/info.c: winspool.drv: DocumentPropertiesW: illegal call to DEVMODEdupWtoA (Unicode -> ASCII)

  • dlls/winspool.drv/info.c: winspool.drv: DocumentPropertiesW: illegal call to DocumentPropertiesA (Unicode -> ASCII)

  • dlls/winspool.drv/info.c: winspool.drv: DocumentPropertiesW: illegal call to strdupWtoA (Unicode -> ASCII)

  • dlls/ws2_32/socket.c: ws2_32: GetAddrInfoW: illegal call to addrinfo_WtoA (Unicode -> ASCII)

  • dlls/ws2_32/socket.c: ws2_32: WSAStringToAddressW: illegal call to WSAStringToAddressA (Unicode -> ASCII)

  • {X} dlls/shell32/shellole.c: shell32: DragQueryFileW: illegal call to DragQueryFileA

  • {X} dlls/shlwapi/ordinal.c: shlwapi: SHCreateWorkerWindowW: illegal call to SHCreateWorkerWindowA

  • {X} dlls/shlwapi/string.c: shlwapi: StrRetToStrW: illegal call to SHStrDupA

  • {X} dlls/user32/winproc.c: user32: CallWindowProcW: illegal call to WINPROC_CallProc32WTo32A

  • {X} dlls/winmm/mmio.c: winmm: mmioRenameW: illegal call to mmioRenameA

  • {X} dlls/winmm/mmio.c: winmm: mmioStringToFOURCCW: illegal call to mmioStringToFOURCCA

Legend: {X} = invalid listing, the cross-call is OK.

Status

Most of the cross calls have been fixed, but there are a few left (listed above). We need volunteers to pick up the slack.

Workers: RolfKalbermatter, Stefan Leichter, MatthewDavison, Tony Lambregts, Dmitry Timoshkov, Eric Pouech, Alexandre Julliard, JustinChevrier, Ulrich Czekalla, Mike McCormack, Juan Lang, KevinKoltzau, James Hawkins, FilipNavara, JacekCaban, Vincent Béron, Detlef Riekenberg, Stefan Dösinger.


CrossCallsWtoA (last edited 2009-06-01 14:16:24 by AndreHentschel)