From 9c9992b6a52603a67c5d045f1dd11284934a8ded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Fri, 6 Jul 2007 22:47:39 +0000 Subject: [PATCH] Fix traces Do an unicode build svn path=/trunk/; revision=27439 --- reactos/dll/win32/newdev/newdev.c | 70 ++++++++++++----------- reactos/dll/win32/newdev/newdev.rbuild | 2 +- reactos/dll/win32/newdev/newdev_private.h | 2 +- reactos/dll/win32/newdev/wizard.c | 2 +- 4 files changed, 40 insertions(+), 36 deletions(-) diff --git a/reactos/dll/win32/newdev/newdev.c b/reactos/dll/win32/newdev/newdev.c index dbfc926f59e..94bfda79921 100644 --- a/reactos/dll/win32/newdev/newdev.c +++ b/reactos/dll/win32/newdev/newdev.c @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#define YDEBUG +//#define YDEBUG #include "newdev_private.h" WINE_DEFAULT_DEBUG_CHANNEL(newdev); @@ -54,8 +54,8 @@ UpdateDriverForPlugAndPlayDevicesW( DevInstData.hDevInfo = INVALID_HANDLE_VALUE; - TRACE("UpdateDriverForPlugAndPlayDevicesW(%p %S %S 0x%lx %p)\n", - hwndParent, HardwareId, FullInfPath, InstallFlags, bRebootRequired); + TRACE("UpdateDriverForPlugAndPlayDevicesW(%p %s %s 0x%x %p)\n", + hwndParent, debugstr_w(HardwareId), debugstr_w(FullInfPath), InstallFlags, bRebootRequired); /* FIXME: InstallFlags bRebootRequired ignored! */ @@ -78,7 +78,7 @@ UpdateDriverForPlugAndPlayDevicesW( { if (GetLastError() != ERROR_NO_MORE_ITEMS) { - TRACE("SetupDiEnumDeviceInfo() failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiEnumDeviceInfo() failed with error 0x%x\n", GetLastError()); goto cleanup; } /* This error was expected */ @@ -105,7 +105,7 @@ UpdateDriverForPlugAndPlayDevicesW( } else if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) { - TRACE("SetupDiGetDeviceRegistryPropertyW() failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiGetDeviceRegistryPropertyW() failed with error 0x%x\n", GetLastError()); goto cleanup; } /* This error was expected */ @@ -147,7 +147,7 @@ UpdateDriverForPlugAndPlayDevicesW( } else if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) { - TRACE("SetupDiGetDeviceInstanceIdW() failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiGetDeviceInstanceIdW() failed with error 0x%x\n", GetLastError()); goto cleanup; } else if ((Buffer = HeapAlloc(GetProcessHeap(), 0, BufferSize)) == NULL) @@ -158,15 +158,15 @@ UpdateDriverForPlugAndPlayDevicesW( } else if (!SetupDiGetDeviceInstanceIdW(DevInstData.hDevInfo, &DevInstData.devInfoData, Buffer, BufferSize, NULL)) { - TRACE("SetupDiGetDeviceInstanceIdW() failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiGetDeviceInstanceIdW() failed with error 0x%x\n", GetLastError()); goto cleanup; } - TRACE("Trying to update the driver of %S\n", Buffer); + TRACE("Trying to update the driver of %s\n", debugstr_w(Buffer)); /* Search driver in the specified .inf file */ if (!SearchDriver(&DevInstData, NULL, FullInfPath)) { - TRACE("SearchDriver() failed with error 0x%lx\n", GetLastError()); + TRACE("SearchDriver() failed with error 0x%x\n", GetLastError()); continue; } @@ -174,7 +174,7 @@ UpdateDriverForPlugAndPlayDevicesW( //if (!InstallCurrentDriver(&DevInstData)) if (!InstallCurrentDriver(&DevInstData) && GetLastError() != ERROR_PRIVILEGE_NOT_HELD) { - TRACE("InstallCurrentDriver() failed with error 0x%lx\n", GetLastError()); + TRACE("InstallCurrentDriver() failed with error 0x%x\n", GetLastError()); continue; } @@ -188,7 +188,7 @@ UpdateDriverForPlugAndPlayDevicesW( } else { - TRACE("No device found with HardwareID %S\n", HardwareId); + TRACE("No device found with HardwareID %s\n", debugstr_w(HardwareId)); SetLastError(ERROR_NO_SUCH_DEVINST); } @@ -259,7 +259,7 @@ SearchDriver( DevInstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS_W); if (!SetupDiGetDeviceInstallParamsW(DevInstData->hDevInfo, &DevInstData->devInfoData, &DevInstallParams)) { - TRACE("SetupDiGetDeviceInstallParams() failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiGetDeviceInstallParams() failed with error 0x%x\n", GetLastError()); return FALSE; } DevInstallParams.FlagsEx |= DI_FLAGSEX_ALLOWEXCLUDEDDRVS; @@ -286,7 +286,7 @@ SearchDriver( &DevInstallParams); if (!ret) { - TRACE("SetupDiSetDeviceInstallParams() failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiSetDeviceInstallParams() failed with error 0x%x\n", GetLastError()); return FALSE; } @@ -296,7 +296,7 @@ SearchDriver( SPDIT_COMPATDRIVER); if (!ret) { - TRACE("SetupDiBuildDriverInfoList() failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiBuildDriverInfoList() failed with error 0x%x\n", GetLastError()); return FALSE; } @@ -311,7 +311,7 @@ SearchDriver( { if (GetLastError() == ERROR_NO_MORE_ITEMS) return FALSE; - TRACE("SetupDiEnumDriverInfo() failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiEnumDriverInfo() failed with error 0x%x\n", GetLastError()); return FALSE; } @@ -425,7 +425,7 @@ ScanFoldersForDriver( LPCWSTR Path; for (Path = DevInstData->CustomSearchPath; *Path != '\0'; Path += wcslen(Path) + 1) { - TRACE("Search driver in %S\n", Path); + TRACE("Search driver in %s\n", debugstr_w(Path)); if (wcslen(Path) == 2 && Path[1] == ':') { if (SearchDriverRecursive(DevInstData, Path)) @@ -522,7 +522,9 @@ InstallCurrentDriver( { BOOL ret; - TRACE("Installing driver %s: %s\n", DevInstData->drvInfoData.MfgName, DevInstData->drvInfoData.Description); + TRACE("Installing driver %s: %s\n", + debugstr_w(DevInstData->drvInfoData.MfgName), + debugstr_w(DevInstData->drvInfoData.Description)); ret = SetupDiCallClassInstaller( DIF_SELECTBESTCOMPATDRV, @@ -530,7 +532,7 @@ InstallCurrentDriver( &DevInstData->devInfoData); if (!ret) { - TRACE("SetupDiCallClassInstaller(DIF_SELECTBESTCOMPATDRV) failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiCallClassInstaller(DIF_SELECTBESTCOMPATDRV) failed with error 0x%x\n", GetLastError()); return FALSE; } @@ -540,7 +542,7 @@ InstallCurrentDriver( &DevInstData->devInfoData); if (!ret) { - TRACE("SetupDiCallClassInstaller(DIF_ALLOW_INSTALL) failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiCallClassInstaller(DIF_ALLOW_INSTALL) failed with error 0x%x\n", GetLastError()); return FALSE; } @@ -550,7 +552,7 @@ InstallCurrentDriver( &DevInstData->devInfoData); if (!ret) { - TRACE("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_PREANALYZE) failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_PREANALYZE) failed with error 0x%x\n", GetLastError()); return FALSE; } @@ -560,7 +562,7 @@ InstallCurrentDriver( &DevInstData->devInfoData); if (!ret) { - TRACE("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_POSTANALYZE) failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_POSTANALYZE) failed with error 0x%x\n", GetLastError()); return FALSE; } @@ -570,7 +572,7 @@ InstallCurrentDriver( &DevInstData->devInfoData); if (!ret) { - TRACE("SetupDiCallClassInstaller(DIF_INSTALLDEVICEFILES) failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiCallClassInstaller(DIF_INSTALLDEVICEFILES) failed with error 0x%x\n", GetLastError()); return FALSE; } @@ -580,7 +582,7 @@ InstallCurrentDriver( &DevInstData->devInfoData); if (!ret) { - TRACE("SetupDiCallClassInstaller(DIF_REGISTER_COINSTALLERS) failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiCallClassInstaller(DIF_REGISTER_COINSTALLERS) failed with error 0x%x\n", GetLastError()); return FALSE; } @@ -590,7 +592,7 @@ InstallCurrentDriver( &DevInstData->devInfoData); if (!ret) { - TRACE("SetupDiCallClassInstaller(DIF_INSTALLINTERFACES) failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiCallClassInstaller(DIF_INSTALLINTERFACES) failed with error 0x%x\n", GetLastError()); return FALSE; } @@ -600,7 +602,7 @@ InstallCurrentDriver( &DevInstData->devInfoData); if (!ret) { - TRACE("SetupDiCallClassInstaller(DIF_INSTALLDEVICE) failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiCallClassInstaller(DIF_INSTALLDEVICE) failed with error 0x%x\n", GetLastError()); return FALSE; } @@ -610,7 +612,7 @@ InstallCurrentDriver( &DevInstData->devInfoData); if (!ret) { - TRACE("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_FINISHINSTALL) failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_FINISHINSTALL) failed with error 0x%x\n", GetLastError()); return FALSE; } @@ -620,7 +622,7 @@ InstallCurrentDriver( &DevInstData->devInfoData); if (!ret) { - TRACE("SetupDiCallClassInstaller(DIF_DESTROYPRIVATEDATA) failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiCallClassInstaller(DIF_DESTROYPRIVATEDATA) failed with error 0x%x\n", GetLastError()); return FALSE; } @@ -664,7 +666,7 @@ DevInstallW( DevInstData->hDevInfo = SetupDiCreateDeviceInfoListExW(NULL, NULL, NULL, NULL); if (DevInstData->hDevInfo == INVALID_HANDLE_VALUE) { - TRACE("SetupDiCreateDeviceInfoListExW() failed with error 0x%lx\n", GetLastError()); + TRACE("SetupDiCreateDeviceInfoListExW() failed with error 0x%x\n", GetLastError()); goto cleanup; } @@ -677,7 +679,8 @@ DevInstallW( &DevInstData->devInfoData); if (!ret) { - TRACE("SetupDiOpenDeviceInfoW() failed with error 0x%lx (InstanceId %S)\n", GetLastError(), InstanceId); + TRACE("SetupDiOpenDeviceInfoW() failed with error 0x%x (InstanceId %s)\n", + GetLastError(), debugstr_w(InstanceId)); DevInstData->devInfoData.cbSize = 0; goto cleanup; } @@ -701,7 +704,7 @@ DevInstallW( } else { - ret = SetupDiGetDeviceRegistryProperty( + ret = SetupDiGetDeviceRegistryPropertyW( DevInstData->hDevInfo, &DevInstData->devInfoData, SPDRP_DEVICEDESC, @@ -712,11 +715,12 @@ DevInstallW( } if (!ret) { - TRACE("SetupDiGetDeviceRegistryProperty() failed with error 0x%lx (InstanceId %S)\n", GetLastError(), InstanceId); + TRACE("SetupDiGetDeviceRegistryProperty() failed with error 0x%x (InstanceId %s)\n", + GetLastError(), debugstr_w(InstanceId)); goto cleanup; } - if (SetupDiGetDeviceRegistryProperty( + if (SetupDiGetDeviceRegistryPropertyW( DevInstData->hDevInfo, &DevInstData->devInfoData, SPDRP_CONFIGFLAGS, @@ -733,7 +737,7 @@ DevInstallW( } } - TRACE("Installing %s (%S)\n", DevInstData->buffer, InstanceId); + TRACE("Installing %s (%s)\n", debugstr_w((PCWSTR)DevInstData->buffer), debugstr_w(InstanceId)); /* Search driver in default location and removable devices */ if (!PrepareFoldersToScan(DevInstData, FALSE, FALSE, NULL)) diff --git a/reactos/dll/win32/newdev/newdev.rbuild b/reactos/dll/win32/newdev/newdev.rbuild index 790590c7062..910f54260b4 100644 --- a/reactos/dll/win32/newdev/newdev.rbuild +++ b/reactos/dll/win32/newdev/newdev.rbuild @@ -1,4 +1,4 @@ - + . 0x0600 diff --git a/reactos/dll/win32/newdev/newdev_private.h b/reactos/dll/win32/newdev/newdev_private.h index c31e98afcbf..09475d4e30a 100644 --- a/reactos/dll/win32/newdev/newdev_private.h +++ b/reactos/dll/win32/newdev/newdev_private.h @@ -27,7 +27,7 @@ typedef struct _DEVINSTDATA HWND hDialog; HDEVINFO hDevInfo; SP_DEVINFO_DATA devInfoData; - SP_DRVINFO_DATA drvInfoData; + SP_DRVINFO_DATA_W drvInfoData; LPWSTR CustomSearchPath; /* MULTI_SZ string */ } DEVINSTDATA, *PDEVINSTDATA; diff --git a/reactos/dll/win32/newdev/wizard.c b/reactos/dll/win32/newdev/wizard.c index 881b9941c73..ed1795f7999 100644 --- a/reactos/dll/win32/newdev/wizard.c +++ b/reactos/dll/win32/newdev/wizard.c @@ -205,7 +205,7 @@ FindDriverProc( NULL)) { config_flags |= CONFIGFLAG_FAILEDINSTALL; - SetupDiSetDeviceRegistryProperty( + SetupDiSetDeviceRegistryPropertyW( DevInstData->hDevInfo, &DevInstData->devInfoData, SPDRP_CONFIGFLAGS,