diff --git a/dll/win32/setupapi/devclass.c b/dll/win32/setupapi/devclass.c index 2bb7fcebbc5..f6ad456d93b 100644 --- a/dll/win32/setupapi/devclass.c +++ b/dll/win32/setupapi/devclass.c @@ -262,7 +262,7 @@ SETUP_GetIconIndex( Buffer[dwLength / sizeof(WCHAR)] = 0; /* Transform icon value to a INT */ - *ImageIndex = atoiW(Buffer); + *ImageIndex = wcstol(Buffer, NULL, 10); ret = TRUE; cleanup: @@ -417,7 +417,7 @@ SETUP_GetClassIconInfo(IN CONST GUID *ClassGuid, OUT PINT OutIndex, OUT LPWSTR * SetLastError(ERROR_FILE_NOT_FOUND); goto cleanup; } - Comma = strchrW(Buffer, ','); + Comma = wcschr(Buffer, ','); if (!Comma) { SetLastError(ERROR_GEN_FAILURE); @@ -806,7 +806,7 @@ SetupDiInstallClassExW( hInf, ClassInstall32, SectionName, - MAX_PATH - strlenW(DotServices), + MAX_PATH - lstrlenW(DotServices), NULL, NULL); if (!ret) diff --git a/dll/win32/setupapi/devinst.c b/dll/win32/setupapi/devinst.c index 9dbabb48a32..93d83332f61 100644 --- a/dll/win32/setupapi/devinst.c +++ b/dll/win32/setupapi/devinst.c @@ -233,7 +233,7 @@ CheckSectionValid( } } /* Take care of first 2 fields */ - if (strncmpiW(Fields[0], ExtensionPlatformWindows, strlenW(ExtensionPlatformWindows)) == 0) + if (wcsnicmp(Fields[0], ExtensionPlatformWindows, lstrlenW(ExtensionPlatformWindows)) == 0) { if (PlatformInfo->Platform != VER_PLATFORM_WIN32_WINDOWS) { @@ -242,7 +242,7 @@ CheckSectionValid( } Fields[1] += wcslen(ExtensionPlatformWindows) - 1; } - else if (strncmpiW(Fields[0], ExtensionPlatformNT, strlenW(ExtensionPlatformNT)) == 0) + else if (wcsnicmp(Fields[0], ExtensionPlatformNT, lstrlenW(ExtensionPlatformNT)) == 0) { if (PlatformInfo->Platform != VER_PLATFORM_WIN32_NT) { @@ -256,12 +256,12 @@ CheckSectionValid( /* No platform specified */ *ScorePlatform |= 0x02; } - if (strcmpiW(Fields[1], ExtensionArchitectureNone) == 0) + if (wcsicmp(Fields[1], ExtensionArchitectureNone) == 0) { /* No architecture specified */ *ScorePlatform |= 0x01; } - else if (strcmpiW(Fields[1], pExtensionArchitecture) != 0) + else if (wcsicmp(Fields[1], pExtensionArchitecture) != 0) { TRACE("Mismatch on architecture field ('%s' and '%s')\n", debugstr_w(Fields[1]), debugstr_w(pExtensionArchitecture)); @@ -397,7 +397,7 @@ GetSectionCallback( goto done; bettersection: - strcpyW(info->BestSection, SectionName); + lstrcpyW(info->BestSection, SectionName); info->BestScore1 = Score1; info->BestScore2 = Score2; info->BestScore3 = Score3; @@ -477,13 +477,13 @@ SetupDiGetActualSectionToInstallExW( CallbackInfo.PlatformInfo = pPlatformInfo; CallbackInfo.ProductType = ProductType; CallbackInfo.SuiteMask = SuiteMask; - CallbackInfo.PrefixLength = strlenW(InfSectionName); + CallbackInfo.PrefixLength = lstrlenW(InfSectionName); CallbackInfo.BestScore1 = ULONG_MAX; CallbackInfo.BestScore2 = ULONG_MAX; CallbackInfo.BestScore3 = ULONG_MAX; CallbackInfo.BestScore4 = ULONG_MAX; CallbackInfo.BestScore5 = ULONG_MAX; - strcpyW(CallbackInfo.BestSection, InfSectionName); + lstrcpyW(CallbackInfo.BestSection, InfSectionName); TRACE("EnumerateSectionsStartingWith(InfSectionName = %S)\n", InfSectionName); if (!EnumerateSectionsStartingWith( InfHandle, @@ -507,7 +507,7 @@ SetupDiGetActualSectionToInstallExW( SetLastError(ERROR_INSUFFICIENT_BUFFER); goto done; } - strcpyW(InfSectionWithExt, CallbackInfo.BestSection); + lstrcpyW(InfSectionWithExt, CallbackInfo.BestSection); if (Extension) { DWORD dwLength = lstrlenW(InfSectionName); @@ -537,7 +537,7 @@ CreateDeviceInfo( *pDeviceInfo = NULL; - size = FIELD_OFFSET(struct DeviceInfo, Data) + (strlenW(InstancePath) + 1) * sizeof(WCHAR); + size = FIELD_OFFSET(struct DeviceInfo, Data) + (lstrlenW(InstancePath) + 1) * sizeof(WCHAR); deviceInfo = HeapAlloc(GetProcessHeap(), 0, size); if (!deviceInfo) { @@ -555,9 +555,9 @@ CreateDeviceInfo( deviceInfo->set = list; deviceInfo->InstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS_W); - strcpyW(deviceInfo->Data, InstancePath); + lstrcpyW(deviceInfo->Data, InstancePath); deviceInfo->instanceId = deviceInfo->Data; - deviceInfo->UniqueId = strrchrW(deviceInfo->Data, '\\'); + deviceInfo->UniqueId = wcsrchr(deviceInfo->Data, '\\'); deviceInfo->DeviceDescription = NULL; memcpy(&deviceInfo->ClassGuid, pClassGuid, sizeof(GUID)); deviceInfo->CreationFlags = 0; @@ -1005,7 +1005,7 @@ BOOL WINAPI SetupDiClassGuidsFromNameExW( { TRACE("Class name: %p\n", szClassName); - if (strcmpiW(szClassName, ClassName) == 0) + if (wcsicmp(szClassName, ClassName) == 0) { TRACE("Found matching class name\n"); @@ -1272,7 +1272,7 @@ SetupDiCreateDeviceInfoListExW(const GUID *ClassGuid, if (MachineName != NULL) { - SIZE_T len = strlenW(MachineName); + SIZE_T len = lstrlenW(MachineName); if (len >= SP_MAX_MACHINENAME_LENGTH - 4) { SetLastError(ERROR_INVALID_MACHINENAME); @@ -1315,7 +1315,7 @@ SetupDiCreateDeviceInfoListExW(const GUID *ClassGuid, } list->szData[0] = list->szData[1] = '\\'; - strcpyW(list->szData + 2, MachineName); + lstrcpyW(list->szData + 2, MachineName); list->MachineName = list->szData; } else @@ -2488,7 +2488,7 @@ BOOL WINAPI SetupDiGetDeviceInfoListDetailW( memcpy(&DevInfoData->ClassGuid, &set->ClassGuid, sizeof(GUID)); DevInfoData->RemoteMachineHandle = set->hMachine; if (set->MachineName) - strcpyW(DevInfoData->RemoteMachineName, set->MachineName + 2); + lstrcpyW(DevInfoData->RemoteMachineName, set->MachineName + 2); else DevInfoData->RemoteMachineName[0] = 0; @@ -3072,7 +3072,7 @@ BOOL WINAPI SetupDiGetDeviceInterfaceDetailW( } else { - strcpyW(DeviceInterfaceDetailData->DevicePath, devName); + lstrcpyW(DeviceInterfaceDetailData->DevicePath, devName); TRACE("DevicePath is %s\n", debugstr_w(DeviceInterfaceDetailData->DevicePath)); if (DeviceInfoData) { @@ -3295,7 +3295,7 @@ BOOL WINAPI SetupDiGetDeviceRegistryPropertyW( } else if (Property == SPDRP_PHYSICAL_DEVICE_OBJECT_NAME) { - size = (strlenW(devInfo->Data) + 1) * sizeof(WCHAR); + size = (lstrlenW(devInfo->Data) + 1) * sizeof(WCHAR); if (PropertyRegDataType) *PropertyRegDataType = REG_SZ; @@ -3303,7 +3303,7 @@ BOOL WINAPI SetupDiGetDeviceRegistryPropertyW( *RequiredSize = size; if (PropertyBufferSize >= size) { - strcpyW((LPWSTR)PropertyBuffer, devInfo->Data); + lstrcpyW((LPWSTR)PropertyBuffer, devInfo->Data); } else lError = ERROR_INSUFFICIENT_BUFFER; @@ -4167,7 +4167,7 @@ BOOL WINAPI SetupDiCallClassInstaller( if (rc == ERROR_SUCCESS) { LPWSTR ptr; - for (ptr = KeyBuffer; *ptr; ptr += strlenW(ptr) + 1) + for (ptr = KeyBuffer; *ptr; ptr += lstrlenW(ptr) + 1) { /* Add coinstaller to DeviceCoInstallersListHead list */ struct CoInstallerElement *coinstaller; @@ -4211,7 +4211,7 @@ BOOL WINAPI SetupDiCallClassInstaller( if (rc == ERROR_SUCCESS) { LPWSTR ptr; - for (ptr = KeyBuffer; *ptr; ptr += strlenW(ptr) + 1) + for (ptr = KeyBuffer; *ptr; ptr += lstrlenW(ptr) + 1) { /* Add coinstaller to ClassCoInstallersListHead list */ struct CoInstallerElement *coinstaller; @@ -5256,7 +5256,7 @@ SetupDiRegisterCoDeviceInstallers( SelectedDriver->InfFileDetails->hInf, SelectedDriver->Details.SectionName, SectionName, MAX_PATH, &SectionNameLength, NULL); - if (!Result || SectionNameLength > MAX_PATH - strlenW(DotCoInstallers) - 1) + if (!Result || SectionNameLength > MAX_PATH - lstrlenW(DotCoInstallers) - 1) goto cleanup; lstrcatW(SectionName, DotCoInstallers); @@ -5314,7 +5314,7 @@ InfIsFromOEMLocation( { PWCHAR last; - last = strrchrW(FullName, '\\'); + last = wcsrchr(FullName, '\\'); if (!last) { /* No directory specified */ @@ -5325,7 +5325,7 @@ InfIsFromOEMLocation( LPWSTR Windir; UINT ret; - Windir = MyMalloc((MAX_PATH + 1 + strlenW(InfDirectory)) * sizeof(WCHAR)); + Windir = MyMalloc((MAX_PATH + 1 + lstrlenW(InfDirectory)) * sizeof(WCHAR)); if (!Windir) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); @@ -5339,11 +5339,11 @@ InfIsFromOEMLocation( SetLastError(ERROR_GEN_FAILURE); return FALSE; } - if (*Windir && Windir[strlenW(Windir) - 1] != '\\') - strcatW(Windir, BackSlash); - strcatW(Windir, InfDirectory); + if (*Windir && Windir[lstrlenW(Windir) - 1] != '\\') + lstrcatW(Windir, BackSlash); + lstrcatW(Windir, InfDirectory); - if (strncmpiW(FullName, Windir, last - FullName) == 0) + if (wcsnicmp(FullName, Windir, last - FullName) == 0) { /* The path is %SYSTEMROOT%\Inf */ *IsOEMLocation = FALSE; @@ -5460,9 +5460,9 @@ SetupDiInstallDevice( SelectedDriver->InfFileDetails->hInf, SelectedDriver->Details.SectionName, SectionName, MAX_PATH, &SectionNameLength, NULL); - if (!Result || SectionNameLength > MAX_PATH - strlenW(DotServices)) + if (!Result || SectionNameLength > MAX_PATH - lstrlenW(DotServices)) goto cleanup; - pSectionName = &SectionName[strlenW(SectionName)]; + pSectionName = &SectionName[lstrlenW(SectionName)]; /* Get information from [Version] section */ if (!SetupDiGetINFClassW(SelectedDriver->Details.InfFileName, &ClassGuid, ClassName, MAX_CLASS_NAME_LEN, &RequiredSize)) @@ -5508,7 +5508,7 @@ SetupDiInstallDevice( goto cleanup; DereferenceInfFile(SelectedDriver->InfFileDetails); SelectedDriver->InfFileDetails = newInfFileDetails; - strcpyW(SelectedDriver->Details.InfFileName, NewFileName); + lstrcpyW(SelectedDriver->Details.InfFileName, NewFileName); } deviceInfo = (struct DeviceInfo *)DeviceInfoData->Reserved; @@ -5559,30 +5559,30 @@ SetupDiInstallDevice( TRACE("DriverVersion : '%ld.%ld.%lu.%ld'\n", fullVersion.HighPart >> 16, fullVersion.HighPart & 0xffff, fullVersion.LowPart >> 16, fullVersion.LowPart & 0xffff); TRACE("InfPath : '%s'\n", debugstr_w(SelectedDriver->InfFileDetails->FileName)); TRACE("InfSection : '%s'\n", debugstr_w(SelectedDriver->Details.SectionName)); - TRACE("InfSectionExt : '%s'\n", debugstr_w(&SectionName[strlenW(SelectedDriver->Details.SectionName)])); + TRACE("InfSectionExt : '%s'\n", debugstr_w(&SectionName[lstrlenW(SelectedDriver->Details.SectionName)])); TRACE("MatchingDeviceId: '%s'\n", debugstr_w(SelectedDriver->MatchingId)); TRACE("ProviderName : '%s'\n", debugstr_w(SelectedDriver->Info.ProviderName)); - sprintfW(Buffer, DateFormat, DriverDate.wMonth, DriverDate.wDay, DriverDate.wYear); - rc = RegSetValueExW(hKey, REGSTR_DRIVER_DATE, 0, REG_SZ, (const BYTE *)Buffer, (strlenW(Buffer) + 1) * sizeof(WCHAR)); + swprintf(Buffer, ARRAY_SIZE(Buffer), DateFormat, DriverDate.wMonth, DriverDate.wDay, DriverDate.wYear); + rc = RegSetValueExW(hKey, REGSTR_DRIVER_DATE, 0, REG_SZ, (const BYTE *)Buffer, (lstrlenW(Buffer) + 1) * sizeof(WCHAR)); if (rc == ERROR_SUCCESS) rc = RegSetValueExW(hKey, REGSTR_DRIVER_DATE_DATA, 0, REG_BINARY, (const BYTE *)&SelectedDriver->Info.DriverDate, sizeof(FILETIME)); if (rc == ERROR_SUCCESS) - rc = RegSetValueExW(hKey, REGSTR_VAL_DRVDESC, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.Description, (strlenW(SelectedDriver->Info.Description) + 1) * sizeof(WCHAR)); + rc = RegSetValueExW(hKey, REGSTR_VAL_DRVDESC, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.Description, (lstrlenW(SelectedDriver->Info.Description) + 1) * sizeof(WCHAR)); if (rc == ERROR_SUCCESS) { - sprintfW(Buffer, VersionFormat, fullVersion.HighPart >> 16, fullVersion.HighPart & 0xffff, fullVersion.LowPart >> 16, fullVersion.LowPart & 0xffff); - rc = RegSetValueExW(hKey, REGSTR_DRIVER_VERSION, 0, REG_SZ, (const BYTE *)Buffer, (strlenW(Buffer) + 1) * sizeof(WCHAR)); + swprintf(Buffer, ARRAY_SIZE(Buffer), VersionFormat, fullVersion.HighPart >> 16, fullVersion.HighPart & 0xffff, fullVersion.LowPart >> 16, fullVersion.LowPart & 0xffff); + rc = RegSetValueExW(hKey, REGSTR_DRIVER_VERSION, 0, REG_SZ, (const BYTE *)Buffer, (lstrlenW(Buffer) + 1) * sizeof(WCHAR)); } if (rc == ERROR_SUCCESS) - rc = RegSetValueExW(hKey, REGSTR_VAL_INFPATH, 0, REG_SZ, (const BYTE *)SelectedDriver->InfFileDetails->FileName, (strlenW(SelectedDriver->InfFileDetails->FileName) + 1) * sizeof(WCHAR)); + rc = RegSetValueExW(hKey, REGSTR_VAL_INFPATH, 0, REG_SZ, (const BYTE *)SelectedDriver->InfFileDetails->FileName, (lstrlenW(SelectedDriver->InfFileDetails->FileName) + 1) * sizeof(WCHAR)); if (rc == ERROR_SUCCESS) - rc = RegSetValueExW(hKey, REGSTR_VAL_INFSECTION, 0, REG_SZ, (const BYTE *)SelectedDriver->Details.SectionName, (strlenW(SelectedDriver->Details.SectionName) + 1) * sizeof(WCHAR)); + rc = RegSetValueExW(hKey, REGSTR_VAL_INFSECTION, 0, REG_SZ, (const BYTE *)SelectedDriver->Details.SectionName, (lstrlenW(SelectedDriver->Details.SectionName) + 1) * sizeof(WCHAR)); if (rc == ERROR_SUCCESS) - rc = RegSetValueExW(hKey, REGSTR_VAL_INFSECTIONEXT, 0, REG_SZ, (const BYTE *)&SectionName[strlenW(SelectedDriver->Details.SectionName)], (strlenW(SectionName) - strlenW(SelectedDriver->Details.SectionName) + 1) * sizeof(WCHAR)); + rc = RegSetValueExW(hKey, REGSTR_VAL_INFSECTIONEXT, 0, REG_SZ, (const BYTE *)&SectionName[lstrlenW(SelectedDriver->Details.SectionName)], (lstrlenW(SectionName) - lstrlenW(SelectedDriver->Details.SectionName) + 1) * sizeof(WCHAR)); if (rc == ERROR_SUCCESS) - rc = RegSetValueExW(hKey, REGSTR_VAL_MATCHINGDEVID, 0, REG_SZ, (const BYTE *)SelectedDriver->MatchingId, (strlenW(SelectedDriver->MatchingId) + 1) * sizeof(WCHAR)); + rc = RegSetValueExW(hKey, REGSTR_VAL_MATCHINGDEVID, 0, REG_SZ, (const BYTE *)SelectedDriver->MatchingId, (lstrlenW(SelectedDriver->MatchingId) + 1) * sizeof(WCHAR)); if (rc == ERROR_SUCCESS) - rc = RegSetValueExW(hKey, REGSTR_VAL_PROVIDER_NAME, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.ProviderName, (strlenW(SelectedDriver->Info.ProviderName) + 1) * sizeof(WCHAR)); + rc = RegSetValueExW(hKey, REGSTR_VAL_PROVIDER_NAME, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.ProviderName, (lstrlenW(SelectedDriver->Info.ProviderName) + 1) * sizeof(WCHAR)); if (rc != ERROR_SUCCESS) { SetLastError(rc); @@ -5594,7 +5594,7 @@ SetupDiInstallDevice( /* FIXME: Process .LogConfigOverride section */ /* Install .Services section */ - strcpyW(pSectionName, DotServices); + lstrcpyW(pSectionName, DotServices); Result = SetupInstallServicesFromInfSectionExW( SelectedDriver->InfFileDetails->hInf, SectionName, @@ -5621,7 +5621,7 @@ SetupDiInstallDevice( DoAction = 0; if (!(InstallParams.FlagsEx & DI_FLAGSEX_NO_DRVREG_MODIFY)) DoAction |= SPINST_REGISTRY; - strcpyW(pSectionName, DotHW); + lstrcpyW(pSectionName, DotHW); Result = SetupInstallFromInfSectionW(InstallParams.hwndParent, SelectedDriver->InfFileDetails->hInf, SectionName, DoAction, hKey, NULL, 0, @@ -5636,13 +5636,13 @@ SetupDiInstallDevice( TRACE("ClassGUID : '%s'\n", debugstr_w(lpFullGuidString)); TRACE("DeviceDesc : '%s'\n", debugstr_w(SelectedDriver->Info.Description)); TRACE("Mfg : '%s'\n", debugstr_w(SelectedDriver->Info.MfgName)); - rc = RegSetValueExW(hKey, REGSTR_VAL_CLASS, 0, REG_SZ, (const BYTE *)ClassName, (strlenW(ClassName) + 1) * sizeof(WCHAR)); + rc = RegSetValueExW(hKey, REGSTR_VAL_CLASS, 0, REG_SZ, (const BYTE *)ClassName, (lstrlenW(ClassName) + 1) * sizeof(WCHAR)); if (rc == ERROR_SUCCESS) - rc = RegSetValueExW(hKey, REGSTR_VAL_CLASSGUID, 0, REG_SZ, (const BYTE *)lpFullGuidString, (strlenW(lpFullGuidString) + 1) * sizeof(WCHAR)); + rc = RegSetValueExW(hKey, REGSTR_VAL_CLASSGUID, 0, REG_SZ, (const BYTE *)lpFullGuidString, (lstrlenW(lpFullGuidString) + 1) * sizeof(WCHAR)); if (rc == ERROR_SUCCESS) - rc = RegSetValueExW(hKey, REGSTR_VAL_DEVDESC, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.Description, (strlenW(SelectedDriver->Info.Description) + 1) * sizeof(WCHAR)); + rc = RegSetValueExW(hKey, REGSTR_VAL_DEVDESC, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.Description, (lstrlenW(SelectedDriver->Info.Description) + 1) * sizeof(WCHAR)); if (rc == ERROR_SUCCESS) - rc = RegSetValueExW(hKey, REGSTR_VAL_MFG, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.MfgName, (strlenW(SelectedDriver->Info.MfgName) + 1) * sizeof(WCHAR)); + rc = RegSetValueExW(hKey, REGSTR_VAL_MFG, 0, REG_SZ, (const BYTE *)SelectedDriver->Info.MfgName, (lstrlenW(SelectedDriver->Info.MfgName) + 1) * sizeof(WCHAR)); if (rc != ERROR_SUCCESS) { SetLastError(rc); @@ -5721,7 +5721,7 @@ HKEY SETUPDI_CreateDrvKey(HKEY RootKey, struct DeviceInfo *devInfo, UUID *ClassG goto cleanup; /* The driver key is in \System\CurrentControlSet\Control\Class\{GUID}\Index */ - DriverKey = HeapAlloc(GetProcessHeap(), 0, (strlenW(lpGuidString) + 7) * sizeof(WCHAR) + sizeof(UNICODE_NULL)); + DriverKey = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(lpGuidString) + 7) * sizeof(WCHAR) + sizeof(UNICODE_NULL)); if (!DriverKey) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); @@ -5729,8 +5729,8 @@ HKEY SETUPDI_CreateDrvKey(HKEY RootKey, struct DeviceInfo *devInfo, UUID *ClassG } DriverKey[0] = '{'; - strcpyW(&DriverKey[1], lpGuidString); - pDeviceInstance = &DriverKey[strlenW(DriverKey)]; + lstrcpyW(&DriverKey[1], lpGuidString); + pDeviceInstance = &DriverKey[lstrlenW(DriverKey)]; *pDeviceInstance++ = '}'; *pDeviceInstance++ = '\\'; @@ -5772,7 +5772,7 @@ HKEY SETUPDI_CreateDrvKey(HKEY RootKey, struct DeviceInfo *devInfo, UUID *ClassG } /* Write the new Driver value */ - rc = RegSetValueExW(hDeviceKey, REGSTR_VAL_DRIVER, 0, REG_SZ, (const BYTE *)DriverKey, (strlenW(DriverKey) + 1) * sizeof(WCHAR)); + rc = RegSetValueExW(hDeviceKey, REGSTR_VAL_DRIVER, 0, REG_SZ, (const BYTE *)DriverKey, (lstrlenW(DriverKey) + 1) * sizeof(WCHAR)); if (rc != ERROR_SUCCESS) { SetLastError(rc); diff --git a/dll/win32/setupapi/dialog.c b/dll/win32/setupapi/dialog.c index 42d2841fd50..17d468f0932 100644 --- a/dll/win32/setupapi/dialog.c +++ b/dll/win32/setupapi/dialog.c @@ -83,7 +83,7 @@ static void promptdisk_ok(HWND hwnd, struct promptdisk_params *params) int requiredSize; WCHAR aux[MAX_PATH]; GetWindowTextW(GetDlgItem(hwnd, IDC_PATH), aux, MAX_PATH); - requiredSize = strlenW(aux)+1; + requiredSize = lstrlenW(aux)+1; if(params->PathRequiredSize) { @@ -100,7 +100,7 @@ static void promptdisk_ok(HWND hwnd, struct promptdisk_params *params) EndDialog(hwnd, DPROMPT_BUFFERTOOSMALL); return; } - strcpyW(params->PathBuffer, aux); + lstrcpyW(params->PathBuffer, aux); TRACE("returning PathBuffer=%s\n", debugstr_w(params->PathBuffer)); EndDialog(hwnd, DPROMPT_SUCCESS); } @@ -118,11 +118,11 @@ static void promptdisk_browse(HWND hwnd, struct promptdisk_params *params) ofn.hwndOwner = hwnd; ofn.nMaxFile = MAX_PATH; ofn.lpstrFile = HeapAlloc(GetProcessHeap(), 0, MAX_PATH*sizeof(WCHAR)); - strcpyW(ofn.lpstrFile, params->FileSought); + lstrcpyW(ofn.lpstrFile, params->FileSought); if(GetOpenFileNameW(&ofn)) { - WCHAR* last_slash = strrchrW(ofn.lpstrFile, '\\'); + WCHAR* last_slash = wcsrchr(ofn.lpstrFile, '\\'); if (last_slash) *last_slash = 0; SetDlgItemTextW(hwnd, IDC_PATH, ofn.lpstrFile); } diff --git a/dll/win32/setupapi/dirid.c b/dll/win32/setupapi/dirid.c index c23eb7c8532..97eb54b72a7 100644 --- a/dll/win32/setupapi/dirid.c +++ b/dll/win32/setupapi/dirid.c @@ -46,10 +46,10 @@ static const WCHAR *get_unknown_dirid(void) if (!unknown_dirid) { - UINT len = GetSystemDirectoryW( NULL, 0 ) + strlenW(unknown_str); + UINT len = GetSystemDirectoryW( NULL, 0 ) + lstrlenW(unknown_str); if (!(unknown_dirid = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return NULL; GetSystemDirectoryW( unknown_dirid, len ); - strcatW( unknown_dirid, unknown_str ); + lstrcatW( unknown_dirid, unknown_str ); } return unknown_dirid; } @@ -86,23 +86,23 @@ static const WCHAR *create_system_dirid( int dirid ) break; case DIRID_DRIVERS: GetSystemDirectoryW( buffer, MAX_PATH ); - strcatW( buffer, Drivers ); + lstrcatW( buffer, Drivers ); break; case DIRID_INF: GetWindowsDirectoryW( buffer, MAX_PATH ); - strcatW( buffer, Inf ); + lstrcatW( buffer, Inf ); break; case DIRID_HELP: GetWindowsDirectoryW( buffer, MAX_PATH ); - strcatW( buffer, Help ); + lstrcatW( buffer, Help ); break; case DIRID_FONTS: GetWindowsDirectoryW( buffer, MAX_PATH ); - strcatW( buffer, Fonts ); + lstrcatW( buffer, Fonts ); break; case DIRID_VIEWERS: GetSystemDirectoryW( buffer, MAX_PATH ); - strcatW( buffer, Viewers ); + lstrcatW( buffer, Viewers ); break; case DIRID_APPS: return C_Root; /* FIXME */ @@ -113,12 +113,12 @@ static const WCHAR *create_system_dirid( int dirid ) return C_Root; /* FIXME */ case DIRID_SYSTEM16: GetWindowsDirectoryW( buffer, MAX_PATH ); - strcatW( buffer, System ); + lstrcatW( buffer, System ); break; case DIRID_SPOOL: case DIRID_SPOOLDRIVERS: /* FIXME */ GetWindowsDirectoryW( buffer, MAX_PATH ); - strcatW( buffer, Spool ); + lstrcatW( buffer, Spool ); break; case DIRID_USERPROFILE: if (GetEnvironmentVariableW( UserProfile, buffer, MAX_PATH )) break; @@ -137,7 +137,7 @@ static const WCHAR *create_system_dirid( int dirid ) FIXME( "unknown dirid %d\n", dirid ); return get_unknown_dirid(); } - len = (strlenW(buffer) + 1) * sizeof(WCHAR); + len = (lstrlenW(buffer) + 1) * sizeof(WCHAR); if ((str = HeapAlloc( GetProcessHeap(), 0, len ))) memcpy( str, buffer, len ); return str; } @@ -152,7 +152,7 @@ static const WCHAR *get_csidl_dir( DWORD csidl ) FIXME( "CSIDL %x not found\n", csidl ); return get_unknown_dirid(); } - len = (strlenW(buffer) + 1) * sizeof(WCHAR); + len = (lstrlenW(buffer) + 1) * sizeof(WCHAR); if ((str = HeapAlloc( GetProcessHeap(), 0, len ))) memcpy( str, buffer, len ); return str; } @@ -273,7 +273,7 @@ BOOL WINAPI SetupSetDirectoryIdW( HINF hinf, DWORD id, PCWSTR dir ) } /* duplicate the string */ - len = (strlenW(dir)+1) * sizeof(WCHAR); + len = (lstrlenW(dir)+1) * sizeof(WCHAR); if (!(str = HeapAlloc( GetProcessHeap(), 0, len ))) return FALSE; memcpy( str, dir, len ); return store_user_dirid( hinf, id, str ); diff --git a/dll/win32/setupapi/diskspace.c b/dll/win32/setupapi/diskspace.c index 32b80fb1d7f..01856a0f3c8 100644 --- a/dll/win32/setupapi/diskspace.c +++ b/dll/win32/setupapi/diskspace.c @@ -181,7 +181,7 @@ BOOL WINAPI SetupQuerySpaceRequiredOnDriveW(HDSKSPC DiskSpace, for (i = 0; i < list->dwDriveCount; i++) { TRACE("checking drive %s\n",debugstr_w(list->Drives[i].lpzName)); - if (lstrcmpW(driveW,list->Drives[i].lpzName)==0) + if (wcscmp(driveW,list->Drives[i].lpzName)==0) { rc = TRUE; *SpaceRequired = list->Drives[i].dwWantedSpace; diff --git a/dll/win32/setupapi/driver.c b/dll/win32/setupapi/driver.c index 3ead218522b..2c00bf2a052 100644 --- a/dll/win32/setupapi/driver.c +++ b/dll/win32/setupapi/driver.c @@ -60,7 +60,7 @@ CreateInfFileDetails( DWORD Needed; Needed = FIELD_OFFSET(struct InfFileDetails, szData) - + strlenW(FullInfFileName) * sizeof(WCHAR) + sizeof(UNICODE_NULL); + + lstrlenW(FullInfFileName) * sizeof(WCHAR) + sizeof(UNICODE_NULL); details = HeapAlloc(GetProcessHeap(), 0, Needed); if (!details) @@ -70,8 +70,8 @@ CreateInfFileDetails( } memset(details, 0, Needed); - strcpyW(details->szData, FullInfFileName); - last = strrchrW(details->szData, '\\'); + lstrcpyW(details->szData, FullInfFileName); + last = wcsrchr(details->szData, '\\'); if (last) { details->DirectoryName = details->szData; @@ -162,13 +162,13 @@ AddKnownDriverToList( /* Copy MatchingId information */ if (MatchingId) { - driverInfo->MatchingId = HeapAlloc(GetProcessHeap(), 0, (strlenW(MatchingId) + 1) * sizeof(WCHAR)); + driverInfo->MatchingId = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(MatchingId) + 1) * sizeof(WCHAR)); if (!driverInfo->MatchingId) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); goto cleanup; } - RtlCopyMemory(driverInfo->MatchingId, MatchingId, (strlenW(MatchingId) + 1) * sizeof(WCHAR)); + RtlCopyMemory(driverInfo->MatchingId, MatchingId, (lstrlenW(MatchingId) + 1) * sizeof(WCHAR)); } else driverInfo->MatchingId = NULL; @@ -397,7 +397,7 @@ GetVersionInformationFromInfFile( } /* Get driver date and driver version, by analyzing the "DriverVer" value */ - pComma = strchrW(DriverVer, ','); + pComma = wcschr(DriverVer, ','); if (pComma != NULL) { *pComma = UNICODE_NULL; @@ -405,7 +405,7 @@ GetVersionInformationFromInfFile( } /* Get driver date version. Invalid date = 00/00/00 */ memset(DriverDate, 0, sizeof(FILETIME)); - if (strlenW(DriverVer) == 10 + if (lstrlenW(DriverVer) == 10 && (DriverVer[2] == '-' || DriverVer[2] == '/') && (DriverVer[5] == '-' || DriverVer[5] == '/')) { @@ -424,26 +424,26 @@ GetVersionInformationFromInfFile( LPWSTR pMinor = NULL, pRevision = NULL, pBuild = NULL; LARGE_INTEGER fullVersion; - pMinor = strchrW(pVersion, '.'); + pMinor = wcschr(pVersion, '.'); if (pMinor) { *pMinor = 0; - pRevision = strchrW(++pMinor, '.'); - Minor = atoiW(pMinor); + pRevision = wcschr(++pMinor, '.'); + Minor = (WORD)wcstoul(pMinor, NULL, 10); } if (pRevision) { *pRevision = 0; - pBuild = strchrW(++pRevision, '.'); - Revision = atoiW(pRevision); + pBuild = wcschr(++pRevision, '.'); + Revision = (WORD)wcstoul(pRevision, NULL, 10); } if (pBuild) { *pBuild = 0; pBuild++; - Build = atoiW(pBuild); + Build = (WORD)wcstoul(pBuild, NULL, 10); } - Major = atoiW(pVersion); + Major = (WORD)wcstoul(pVersion, NULL, 10); fullVersion.u.HighPart = Major << 16 | Minor; fullVersion.u.LowPart = Revision << 16 | Build; memcpy(DriverVersion, &fullVersion, sizeof(LARGE_INTEGER)); @@ -803,22 +803,22 @@ SetupDiBuildDriverInfoList( RequiredSize = GetSystemWindowsDirectoryW(InfFileName, len); if (RequiredSize == 0 || RequiredSize >= len) goto done; - if (*InfFileName && InfFileName[strlenW(InfFileName) - 1] != '\\') - strcatW(InfFileName, BackSlash); - strcatW(InfFileName, InfDirectory); + if (*InfFileName && InfFileName[lstrlenW(InfFileName) - 1] != '\\') + lstrcatW(InfFileName, BackSlash); + lstrcatW(InfFileName, InfDirectory); /* Read some information from registry, before creating the driver structure */ hDriverKey = SETUPDI_OpenDrvKey(((struct DeviceInfoSet *)DeviceInfoSet)->HKLM, devInfo, KEY_QUERY_VALUE); if (hDriverKey == INVALID_HANDLE_VALUE) goto done; - RequiredSize = (len - strlenW(InfFileName)) * sizeof(WCHAR); + RequiredSize = (len - lstrlenW(InfFileName)) * sizeof(WCHAR); rc = RegGetValueW( hDriverKey, NULL, REGSTR_VAL_INFPATH, RRF_RT_REG_SZ, NULL, - &InfFileName[strlenW(InfFileName)], + &InfFileName[lstrlenW(InfFileName)], &RequiredSize); if (rc != ERROR_SUCCESS) { @@ -871,14 +871,14 @@ SetupDiBuildDriverInfoList( else if (InstallParams.Flags & DI_ENUMSINGLEINF) { /* InstallParams.DriverPath contains the name of a .inf file */ - RequiredSize = strlenW(InstallParams.DriverPath) + 2; + RequiredSize = lstrlenW(InstallParams.DriverPath) + 2; Buffer = HeapAlloc(GetProcessHeap(), 0, RequiredSize * sizeof(WCHAR)); if (!Buffer) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); goto done; } - strcpyW(Buffer, InstallParams.DriverPath); + lstrcpyW(Buffer, InstallParams.DriverPath); ((LPWSTR)Buffer)[RequiredSize - 1] = 0; Result = TRUE; } @@ -939,9 +939,9 @@ SetupDiBuildDriverInfoList( len = GetFullPathNameW(InstallParams.DriverPath, len, FullInfFileName, NULL); if (len == 0) goto done; - if (*FullInfFileName && FullInfFileName[strlenW(FullInfFileName) - 1] != '\\') - strcatW(FullInfFileName, BackSlash); - pFullFilename = &FullInfFileName[strlenW(FullInfFileName)]; + if (*FullInfFileName && FullInfFileName[lstrlenW(FullInfFileName) - 1] != '\\') + lstrcatW(FullInfFileName, BackSlash); + pFullFilename = &FullInfFileName[lstrlenW(FullInfFileName)]; } else { @@ -950,24 +950,24 @@ SetupDiBuildDriverInfoList( len = GetSystemWindowsDirectoryW(NULL, 0); if (len == 0) goto done; - FullInfFileName = HeapAlloc(GetProcessHeap(), 0, (len + 1 + strlenW(InfDirectory) + MAX_PATH) * sizeof(WCHAR)); + FullInfFileName = HeapAlloc(GetProcessHeap(), 0, (len + 1 + lstrlenW(InfDirectory) + MAX_PATH) * sizeof(WCHAR)); if (!FullInfFileName) goto done; len = GetSystemWindowsDirectoryW(FullInfFileName, len); if (len == 0) goto done; - if (*FullInfFileName && FullInfFileName[strlenW(FullInfFileName) - 1] != '\\') - strcatW(FullInfFileName, BackSlash); - strcatW(FullInfFileName, InfDirectory); - pFullFilename = &FullInfFileName[strlenW(FullInfFileName)]; + if (*FullInfFileName && FullInfFileName[lstrlenW(FullInfFileName) - 1] != '\\') + lstrcatW(FullInfFileName, BackSlash); + lstrcatW(FullInfFileName, InfDirectory); + pFullFilename = &FullInfFileName[lstrlenW(FullInfFileName)]; } - for (filename = (LPCWSTR)Buffer; *filename; filename += strlenW(filename) + 1) + for (filename = (LPCWSTR)Buffer; *filename; filename += lstrlenW(filename) + 1) { INFCONTEXT ContextManufacturer, ContextDevice; GUID ClassGuid; - strcpyW(pFullFilename, filename); + lstrcpyW(pFullFilename, filename); TRACE("Opening file %s\n", debugstr_w(FullInfFileName)); currentInfFileDetails = CreateInfFileDetails(FullInfFileName); @@ -1105,9 +1105,9 @@ SetupDiBuildDriverInfoList( DriverAlreadyAdded = FALSE; if (HardwareIDs) { - for (DriverRank = 0, currentId = (LPCWSTR)HardwareIDs; !DriverAlreadyAdded && *currentId; currentId += strlenW(currentId) + 1, DriverRank++) + for (DriverRank = 0, currentId = (LPCWSTR)HardwareIDs; !DriverAlreadyAdded && *currentId; currentId += lstrlenW(currentId) + 1, DriverRank++) { - if (strcmpiW(DeviceId, currentId) == 0) + if (wcsicmp(DeviceId, currentId) == 0) { AddDriverToList( pDriverListHead, @@ -1127,9 +1127,9 @@ SetupDiBuildDriverInfoList( } if (CompatibleIDs) { - for (DriverRank = 0, currentId = (LPCWSTR)CompatibleIDs; !DriverAlreadyAdded && *currentId; currentId += strlenW(currentId) + 1, DriverRank++) + for (DriverRank = 0, currentId = (LPCWSTR)CompatibleIDs; !DriverAlreadyAdded && *currentId; currentId += lstrlenW(currentId) + 1, DriverRank++) { - if (strcmpiW(DeviceId, currentId) == 0) + if (wcsicmp(DeviceId, currentId) == 0) { AddDriverToList( pDriverListHead, @@ -1643,8 +1643,8 @@ SetupDiSetSelectedDriverW( /* The caller wants to compare only DriverType, Description and ProviderName fields */ struct DriverInfoElement *driverInfo = CONTAINING_RECORD(ItemList, struct DriverInfoElement, ListEntry); if (driverInfo->Info.DriverType == DriverInfoData->DriverType - && strcmpW(driverInfo->Info.Description, DriverInfoData->Description) == 0 - && strcmpW(driverInfo->Info.ProviderName, DriverInfoData->ProviderName) == 0) + && wcscmp(driverInfo->Info.Description, DriverInfoData->Description) == 0 + && wcscmp(driverInfo->Info.ProviderName, DriverInfoData->ProviderName) == 0) { break; } @@ -2135,7 +2135,7 @@ SetupDiInstallDriverFiles( ret = SetupDiGetActualSectionToInstallW( SelectedDriver->InfFileDetails->hInf, SelectedDriver->Details.SectionName, - SectionName, MAX_PATH - strlenW(DotCoInstallers), &SectionNameLength, NULL); + SectionName, MAX_PATH - lstrlenW(DotCoInstallers), &SectionNameLength, NULL); if (!ret) goto done; diff --git a/dll/win32/setupapi/interface.c b/dll/win32/setupapi/interface.c index 09b84d519a4..5224e874b42 100644 --- a/dll/win32/setupapi/interface.c +++ b/dll/win32/setupapi/interface.c @@ -42,14 +42,14 @@ CreateDeviceInterface( *pDeviceInterface = NULL; deviceInterface = HeapAlloc(GetProcessHeap(), 0, - FIELD_OFFSET(struct DeviceInterface, SymbolicLink) + (strlenW(SymbolicLink) + 1) * sizeof(WCHAR)); + FIELD_OFFSET(struct DeviceInterface, SymbolicLink) + (lstrlenW(SymbolicLink) + 1) * sizeof(WCHAR)); if (!deviceInterface) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); return FALSE; } deviceInterface->DeviceInfo = deviceInfo; - strcpyW(deviceInterface->SymbolicLink, SymbolicLink); + lstrcpyW(deviceInterface->SymbolicLink, SymbolicLink); deviceInterface->Flags = 0; /* Flags will be updated later */ memcpy(&deviceInterface->InterfaceClassGuid, pInterfaceGuid, sizeof(GUID)); @@ -146,7 +146,7 @@ SETUP_CreateInterfaceList( if (DeviceInstanceW) { /* Check if device enumerator is not the right one */ - if (strcmpW(DeviceInstanceW, InstancePath) != 0) + if (wcscmp(DeviceInstanceW, InstancePath) != 0) continue; } @@ -467,9 +467,9 @@ SetupDiInstallDeviceInterfaces( SelectedDriver->InfFileDetails->hInf, SelectedDriver->Details.SectionName, SectionName, MAX_PATH, &SectionNameLength, NULL); - if (!Result || SectionNameLength > MAX_PATH - strlenW(DotInterfaces) - 1) + if (!Result || SectionNameLength > MAX_PATH - lstrlenW(DotInterfaces) - 1) goto cleanup; - strcatW(SectionName, DotInterfaces); + lstrcatW(SectionName, DotInterfaces); ret = TRUE; Result = SetupFindFirstLineW( @@ -482,7 +482,7 @@ SetupDiInstallDeviceInterfaces( ret = GetStringField(&ContextInterface, 1, &InterfaceGuidString); if (!ret) goto cleanup; - else if (strlenW(InterfaceGuidString) != MAX_GUID_STRING_LEN - 1) + else if (lstrlenW(InterfaceGuidString) != MAX_GUID_STRING_LEN - 1) { SetLastError(ERROR_INVALID_PARAMETER); ret = FALSE; diff --git a/dll/win32/setupapi/misc.c b/dll/win32/setupapi/misc.c index 857c64cca94..7255269f9c4 100644 --- a/dll/win32/setupapi/misc.c +++ b/dll/win32/setupapi/misc.c @@ -54,7 +54,7 @@ GetFunctionPointer( *ModulePointer = NULL; *FunctionPointer = NULL; - Comma = strchrW(InstallerName, ','); + Comma = wcschr(InstallerName, ','); if (!Comma) { rc = ERROR_INVALID_PARAMETER; @@ -72,7 +72,7 @@ GetFunctionPointer( } /* Skip comma spaces */ - while (*Comma == ',' || isspaceW(*Comma)) + while (*Comma == ',' || iswspace(*Comma)) Comma++; /* W->A conversion for function name */ diff --git a/dll/win32/setupapi/parser.c b/dll/win32/setupapi/parser.c index c7d0614732e..02297be7f44 100644 --- a/dll/win32/setupapi/parser.c +++ b/dll/win32/setupapi/parser.c @@ -160,7 +160,7 @@ static void *grow_array( void *array, unsigned int *count, size_t elem ) /* get the directory of the inf file (as counted string, not null-terminated) */ static const WCHAR *get_inf_dir( const struct inf_file *file, unsigned int *len ) { - const WCHAR *p = strrchrW( file->filename, '\\' ); + const WCHAR *p = wcsrchr( file->filename, '\\' ); *len = p ? (p + 1 - file->filename) : 0; return file->filename; } @@ -172,7 +172,7 @@ static int find_section( const struct inf_file *file, const WCHAR *name ) unsigned int i; for (i = 0; i < file->nb_sections; i++) - if (!strcmpiW( name, file->sections[i]->name )) return i; + if (!wcsicmp( name, file->sections[i]->name )) return i; return -1; } @@ -189,7 +189,7 @@ static struct line *find_line( struct inf_file *file, int section_index, const W for (i = 0, line = section->lines; i < section->nb_lines; i++, line++) { if (line->key_field == -1) continue; - if (!strcmpiW( name, file->fields[line->key_field].text )) return line; + if (!wcsicmp( name, file->fields[line->key_field].text )) return line; } return NULL; } @@ -292,7 +292,7 @@ static const WCHAR *get_dirid_subst( const struct inf_file *file, int dirid, uns if (dirid == DIRID_SRCPATH) return get_inf_dir( file, len ); ret = DIRID_get_string( dirid ); - if (ret) *len = strlenW(ret); + if (ret) *len = lstrlenW(ret); return ret; } @@ -324,7 +324,7 @@ static const WCHAR *get_string_subst( const struct inf_file *file, const WCHAR * for (j = 0, line = strings_section->lines; j < strings_section->nb_lines; j++, line++) { if (line->key_field == -1) continue; - if (strncmpiW( str, file->fields[line->key_field].text, *len )) continue; + if (wcsnicmp( str, file->fields[line->key_field].text, *len )) continue; if (!file->fields[line->key_field].text[*len]) break; } if (j == strings_section->nb_lines || !line->nb_fields) goto not_found; @@ -333,12 +333,12 @@ static const WCHAR *get_string_subst( const struct inf_file *file, const WCHAR * // get the current system locale for translated strings GetLocaleInfoW(LOCALE_SYSTEM_DEFAULT, LOCALE_ILANGUAGE, Lang, ARRAY_SIZE(Lang)); - strcpyW(StringLangId + 8, Lang + 2); + lstrcpyW(StringLangId + 8, Lang + 2); // now we have e.g. Strings.07 for german neutral translations for (i = 0; i < file->nb_sections; i++) // search in all sections { // if the section is a Strings.* section - if (!strcmpiW(file->sections[i]->name,StringLangId)) + if (!wcsicmp(file->sections[i]->name, StringLangId)) { // select this section for further use strings_section = file->sections[i]; @@ -346,7 +346,7 @@ static const WCHAR *get_string_subst( const struct inf_file *file, const WCHAR * for (j = 0, line = strings_section->lines; j < strings_section->nb_lines; j++, line++) { if (line->key_field == -1) continue; // if no key then skip - if (strncmpiW( str, file->fields[line->key_field].text, *len )) continue; // if wrong key name, then skip + if (wcsnicmp( str, file->fields[line->key_field].text, *len )) continue; // if wrong key name, then skip if (!file->fields[line->key_field].text[*len]) // if value exist { // then extract value and no more search necessary @@ -358,12 +358,12 @@ static const WCHAR *get_string_subst( const struct inf_file *file, const WCHAR * } // append the Language identifier from GetLocaleInfo - strcpyW(StringLangId + 8, Lang); + lstrcpyW(StringLangId + 8, Lang); // now we have e.g. Strings.0407 for german translations for (i = 0; i < file->nb_sections; i++) // search in all sections { // if the section is a Strings.* section - if (!strcmpiW(file->sections[i]->name,StringLangId)) + if (!wcsicmp(file->sections[i]->name, StringLangId)) { // select this section for further use strings_section = file->sections[i]; @@ -371,7 +371,7 @@ static const WCHAR *get_string_subst( const struct inf_file *file, const WCHAR * for (j = 0, line = strings_section->lines; j < strings_section->nb_lines; j++, line++) { if (line->key_field == -1) continue; // if no key then skip - if (strncmpiW( str, file->fields[line->key_field].text, *len )) continue; // if wrong key name, then skip + if (wcsnicmp( str, file->fields[line->key_field].text, *len )) continue; // if wrong key name, then skip if (!file->fields[line->key_field].text[*len]) // if value exist { // then extract value and no more search necessary @@ -381,7 +381,7 @@ static const WCHAR *get_string_subst( const struct inf_file *file, const WCHAR * } } } - *len = strlenW( field->text ); + *len = lstrlenW( field->text ); return field->text; // return the english or translated string not_found: /* check for integer id */ @@ -389,7 +389,7 @@ static const WCHAR *get_string_subst( const struct inf_file *file, const WCHAR * { memcpy( dirid_str, str, *len * sizeof(WCHAR) ); dirid_str[*len] = 0; - dirid = strtolW( dirid_str, &end, 10 ); + dirid = wcstol( dirid_str, &end, 10 ); if (!*end) ret = get_dirid_subst( file, dirid, len ); if (no_trailing_slash && ret && *len && ret[*len - 1] == '\\') *len -= 1; HeapFree( GetProcessHeap(), 0, dirid_str ); @@ -476,8 +476,8 @@ static unsigned int PARSER_string_substA( const struct inf_file *file, const WCH static WCHAR *push_string( struct inf_file *file, const WCHAR *string ) { WCHAR *ret = file->string_pos; - strcpyW( ret, string ); - file->string_pos += strlenW( ret ) + 1; + lstrcpyW( ret, string ); + file->string_pos += lstrlenW( ret ) + 1; return ret; } @@ -637,7 +637,7 @@ static const WCHAR *line_start_state( struct parser *parser, const WCHAR *pos ) set_state( parser, SECTION_NAME ); return p + 1; default: - if (isspaceW(*p)) break; + if (iswspace(*p)) break; if (parser->cur_section != -1) { parser->start = p; @@ -712,7 +712,7 @@ static const WCHAR *key_name_state( struct parser *parser, const WCHAR *pos ) set_state( parser, EOL_BACKSLASH ); return p; default: - if (!isspaceW(*p)) token_end = p + 1; + if (!iswspace(*p)) token_end = p + 1; else { push_token( parser, p ); @@ -764,7 +764,7 @@ static const WCHAR *value_name_state( struct parser *parser, const WCHAR *pos ) set_state( parser, EOL_BACKSLASH ); return p; default: - if (!isspaceW(*p)) token_end = p + 1; + if (!iswspace(*p)) token_end = p + 1; else { push_token( parser, p ); @@ -803,7 +803,7 @@ static const WCHAR *eol_backslash_state( struct parser *parser, const WCHAR *pos set_state( parser, COMMENT ); return p + 1; default: - if (isspaceW(*p)) continue; + if (iswspace(*p)) continue; push_token( parser, p ); pop_state( parser ); return p; @@ -858,7 +858,7 @@ static const WCHAR *leading_spaces_state( struct parser *parser, const WCHAR *po set_state( parser, EOL_BACKSLASH ); return p; } - if (!isspaceW(*p)) break; + if (!iswspace(*p)) break; } parser->start = p; pop_state( parser ); @@ -878,7 +878,7 @@ static const WCHAR *trailing_spaces_state( struct parser *parser, const WCHAR *p set_state( parser, EOL_BACKSLASH ); return p; } - if (!isspaceW(*p)) break; + if (!iswspace(*p)) break; } pop_state( parser ); return p; @@ -1057,9 +1057,9 @@ static struct inf_file *parse_file( HANDLE handle, UINT *error_line, DWORD style if (line && line->nb_fields > 0) { struct field *field = file->fields + line->first_field; - if (!strcmpiW( field->text, Chicago )) goto done; - if (!strcmpiW( field->text, WindowsNT )) goto done; - if (!strcmpiW( field->text, Windows95 )) goto done; + if (!wcsicmp( field->text, Chicago )) goto done; + if (!wcsicmp( field->text, WindowsNT )) goto done; + if (!wcsicmp( field->text, Windows95 )) goto done; } } if (error_line) *error_line = 0; @@ -1243,7 +1243,7 @@ HINF WINAPI SetupOpenInfFileW( PCWSTR name, PCWSTR class, DWORD style, UINT *err return (HINF)INVALID_HANDLE_VALUE; } - if (strchrW( name, '\\' ) || strchrW( name, '/' )) + if (wcschr( name, '\\' ) || wcschr( name, '/' )) { if (!(len = GetFullPathNameW( name, 0, NULL, NULL ))) return INVALID_HANDLE_VALUE; if (!(path = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) @@ -1259,21 +1259,21 @@ HINF WINAPI SetupOpenInfFileW( PCWSTR name, PCWSTR class, DWORD style, UINT *err static const WCHAR Inf[] = {'\\','i','n','f','\\',0}; static const WCHAR System32[] = {'\\','s','y','s','t','e','m','3','2','\\',0}; - len = GetWindowsDirectoryW( NULL, 0 ) + strlenW(name) + 12; + len = GetWindowsDirectoryW( NULL, 0 ) + lstrlenW(name) + 12; if (!(path = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) { SetLastError( ERROR_NOT_ENOUGH_MEMORY ); return INVALID_HANDLE_VALUE; } GetWindowsDirectoryW( path, len ); - p = path + strlenW(path); - strcpyW( p, Inf ); - strcatW( p, name ); + p = path + lstrlenW(path); + lstrcpyW( p, Inf ); + lstrcatW( p, name ); handle = CreateFileW( path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 ); if (handle == INVALID_HANDLE_VALUE) { - strcpyW( p, System32 ); - strcatW( p, name ); + lstrcpyW( p, System32 ); + lstrcatW( p, name ); handle = CreateFileW( path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 ); } } @@ -1294,7 +1294,7 @@ HINF WINAPI SetupOpenInfFileW( PCWSTR name, PCWSTR class, DWORD style, UINT *err if (class) { GUID ClassGuid; - LPWSTR ClassName = HeapAlloc(GetProcessHeap(), 0, (strlenW(class) + 1) * sizeof(WCHAR)); + LPWSTR ClassName = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(class) + 1) * sizeof(WCHAR)); if (!ClassName) { /* Not enough memory */ @@ -1302,7 +1302,7 @@ HINF WINAPI SetupOpenInfFileW( PCWSTR name, PCWSTR class, DWORD style, UINT *err SetupCloseInfFile((HINF)file); return INVALID_HANDLE_VALUE; } - else if (!PARSER_GetInfClassW((HINF)file, &ClassGuid, ClassName, strlenW(class) + 1, NULL)) + else if (!PARSER_GetInfClassW((HINF)file, &ClassGuid, ClassName, lstrlenW(class) + 1, NULL)) { /* Unable to get class name in .inf file */ HeapFree(GetProcessHeap(), 0, ClassName); @@ -1310,7 +1310,7 @@ HINF WINAPI SetupOpenInfFileW( PCWSTR name, PCWSTR class, DWORD style, UINT *err SetupCloseInfFile((HINF)file); return INVALID_HANDLE_VALUE; } - else if (strcmpW(class, ClassName) != 0) + else if (wcscmp(class, ClassName) != 0) { /* Provided name name is not the expected one */ HeapFree(GetProcessHeap(), 0, ClassName); @@ -1382,7 +1382,7 @@ HINF WINAPI SetupOpenMasterInf( VOID ) WCHAR Buffer[MAX_PATH]; GetWindowsDirectoryW( Buffer, MAX_PATH ); - strcatW( Buffer, Layout ); + lstrcatW( Buffer, Layout ); return SetupOpenInfFileW( Buffer, NULL, INF_STYLE_WIN4, NULL); } @@ -1447,7 +1447,7 @@ BOOL WINAPI SetupEnumInfSectionsW( HINF hinf, UINT index, PWSTR buffer, DWORD si { if (index < file->nb_sections) { - DWORD len = strlenW( file->sections[index]->name ) + 1; + DWORD len = lstrlenW( file->sections[index]->name ) + 1; if (need) *need = len; if (!buffer) { @@ -1711,7 +1711,7 @@ BOOL WINAPI SetupFindNextMatchLineW( PINFCONTEXT context_in, PCWSTR key, { if (line->key_field == -1) continue; PARSER_string_substW( file, file->fields[line->key_field].text, buffer, ARRAY_SIZE(buffer) ); - if (!strcmpiW( key, buffer )) + if (!wcsicmp( key, buffer )) { if (context_out != context_in) *context_out = *context_in; context_out->Line = i; @@ -1732,7 +1732,7 @@ BOOL WINAPI SetupFindNextMatchLineW( PINFCONTEXT context_in, PCWSTR key, for (i = 0, line = section->lines; i < section->nb_lines; i++, line++) { if (line->key_field == -1) continue; - if (!strcmpiW( key, file->fields[line->key_field].text )) + if (!wcsicmp( key, file->fields[line->key_field].text )) { context_out->Inf = context_in->Inf; context_out->CurrentInf = file; @@ -2000,7 +2000,7 @@ BOOL WINAPI SetupGetBinaryField( PINFCONTEXT context, DWORD index, BYTE *buffer, { const WCHAR *p; DWORD value = 0; - for (p = field->text; *p && isxdigitW(*p); p++) + for (p = field->text; *p && iswxdigit(*p); p++) { if ((value <<= 4) > 255) { @@ -2008,7 +2008,7 @@ BOOL WINAPI SetupGetBinaryField( PINFCONTEXT context, DWORD index, BYTE *buffer, return FALSE; } if (*p <= '9') value |= (*p - '0'); - else value |= (tolowerW(*p) - 'a' + 10); + else value |= (towlower(*p) - 'a' + 10); } buffer[i - index] = value; } @@ -2174,10 +2174,10 @@ SetupGetInfFileListW( /* Allocate memory for file filter */ if (DirectoryPath != NULL) /* "DirectoryPath\" form */ - len = strlenW(DirectoryPath) + 1 + 1; + len = lstrlenW(DirectoryPath) + 1 + 1; else /* "%SYSTEMROOT%\Inf\" form */ - len = MAX_PATH + 1 + strlenW(L"inf\\") + 1; + len = MAX_PATH + 1 + lstrlenW(L"inf\\") + 1; len += MAX_PATH; /* To contain file name or "*.inf" string */ pFullFileName = MyMalloc(len * sizeof(WCHAR)); if (pFullFileName == NULL) @@ -2189,23 +2189,23 @@ SetupGetInfFileListW( /* Fill file filter buffer */ if (DirectoryPath) { - strcpyW(pFullFileName, DirectoryPath); - if (*pFullFileName && pFullFileName[strlenW(pFullFileName) - 1] != '\\') - strcatW(pFullFileName, L"\\"); + lstrcpyW(pFullFileName, DirectoryPath); + if (*pFullFileName && pFullFileName[lstrlenW(pFullFileName) - 1] != '\\') + lstrcatW(pFullFileName, L"\\"); } else { len = GetSystemWindowsDirectoryW(pFullFileName, MAX_PATH); if (len == 0 || len > MAX_PATH) goto cleanup; - if (pFullFileName[strlenW(pFullFileName) - 1] != '\\') - strcatW(pFullFileName, L"\\"); - strcatW(pFullFileName, L"inf\\"); + if (pFullFileName[lstrlenW(pFullFileName) - 1] != '\\') + lstrcatW(pFullFileName, L"\\"); + lstrcatW(pFullFileName, L"inf\\"); } - pFileName = &pFullFileName[strlenW(pFullFileName)]; + pFileName = &pFullFileName[lstrlenW(pFullFileName)]; /* Search for the first file */ - strcpyW(pFileName, L"*.inf"); + lstrcpyW(pFileName, L"*.inf"); hSearch = FindFirstFileW(pFullFileName, &wfdFileInfo); if (hSearch == INVALID_HANDLE_VALUE) { @@ -2217,7 +2217,7 @@ SetupGetInfFileListW( { HINF hInf; - strcpyW(pFileName, wfdFileInfo.cFileName); + lstrcpyW(pFileName, wfdFileInfo.cFileName); hInf = SetupOpenInfFileW( pFullFileName, NULL, /* Inf class */ @@ -2234,11 +2234,11 @@ SetupGetInfFileListW( continue; } - len = strlenW(wfdFileInfo.cFileName) + 1; + len = lstrlenW(wfdFileInfo.cFileName) + 1; requiredSize += (DWORD)len; if (requiredSize <= ReturnBufferSize) { - strcpyW(pBuffer, wfdFileInfo.cFileName); + lstrcpyW(pBuffer, wfdFileInfo.cFileName); pBuffer = &pBuffer[len]; } SetupCloseInfFile(hInf); @@ -2390,12 +2390,12 @@ BOOL EnumerateSectionsStartingWith( IN PVOID Context) { struct inf_file *file = (struct inf_file *)hInf; - size_t len = strlenW(pStr); + size_t len = lstrlenW(pStr); unsigned int i; for (i = 0; i < file->nb_sections; i++) { - if (strncmpiW(pStr, file->sections[i]->name, len) == 0) + if (wcsnicmp(pStr, file->sections[i]->name, len) == 0) { if (!Callback(file->sections[i]->name, Context)) return FALSE; diff --git a/dll/win32/setupapi/query.c b/dll/win32/setupapi/query.c index f1a867552c6..4a398341f45 100644 --- a/dll/win32/setupapi/query.c +++ b/dll/win32/setupapi/query.c @@ -422,7 +422,7 @@ BOOL WINAPI SetupGetSourceFileLocationW( HINF hinf, PINFCONTEXT context, PCWSTR if (!(source_id_str = get_source_id( hinf, context, filename ))) return FALSE; - *source_id = strtolW( source_id_str, &end, 10 ); + *source_id = wcstol( source_id_str, &end, 10 ); if (end == source_id_str || *end) { HeapFree( GetProcessHeap(), 0, source_id_str ); @@ -508,7 +508,7 @@ BOOL WINAPI SetupGetSourceInfoW( HINF hinf, UINT source_id, UINT info, TRACE("%p, %d, %d, %p, %d, %p\n", hinf, source_id, info, buffer, buffer_size, required_size); - sprintfW( source_id_str, fmt, source_id ); + swprintf( source_id_str, ARRAY_SIZE(source_id_str), fmt, source_id ); #ifndef __WINESRC__ if (!SetupDiGetActualSectionToInstallW(hinf, source_disks_names, Section, ARRAY_SIZE(Section), NULL, NULL)) @@ -627,7 +627,7 @@ BOOL WINAPI SetupGetTargetPathW( HINF hinf, PINFCONTEXT context, PCWSTR section, GetSystemDirectoryW( systemdir, MAX_PATH ); dir = systemdir; } - size = strlenW( dir ) + 1; + size = lstrlenW( dir ) + 1; if (required_size) *required_size = size; if (buffer) @@ -724,11 +724,11 @@ BOOL WINAPI SetupQueryInfOriginalFileInformationW( * destination (copied) inf file, not the source (original) inf file. * to fix it properly would require building a .pnf file */ /* file name is stored in VersionData field of InfInformation */ - inf_name = strrchrW(inf_path, '\\'); + inf_name = wcsrchr(inf_path, '\\'); if (inf_name) inf_name++; else inf_name = inf_path; - strcpyW(OriginalFileInfo->OriginalInfName, inf_name); + lstrcpyW(OriginalFileInfo->OriginalInfName, inf_name); return TRUE; } diff --git a/dll/win32/setupapi/queue.c b/dll/win32/setupapi/queue.c index bff31982e29..83413cf63c7 100644 --- a/dll/win32/setupapi/queue.c +++ b/dll/win32/setupapi/queue.c @@ -122,8 +122,8 @@ static void concat_W( WCHAR *buffer, const WCHAR *src1, const WCHAR *src2, const *buffer = 0; if (src1 && *src1) { - strcpyW( buffer, src1 ); - buffer += strlenW(buffer ); + lstrcpyW( buffer, src1 ); + buffer += lstrlenW(buffer ); if (buffer[-1] != '\\') *buffer++ = '\\'; *buffer = 0; if (src2) while (*src2 == '\\') src2++; @@ -131,15 +131,15 @@ static void concat_W( WCHAR *buffer, const WCHAR *src1, const WCHAR *src2, const if (src2) { - strcpyW( buffer, src2 ); - buffer += strlenW(buffer ); + lstrcpyW( buffer, src2 ); + buffer += lstrlenW(buffer ); if (buffer[-1] != '\\') *buffer++ = '\\'; *buffer = 0; if (src3) while (*src3 == '\\') src3++; } if (src3) - strcpyW( buffer, src3 ); + lstrcpyW( buffer, src3 ); } @@ -153,11 +153,11 @@ static BOOL build_filepathsW( const struct file_op *op, FILEPATHS_W *paths ) unsigned int src_len = 1, dst_len = 1; WCHAR *source = (PWSTR)paths->Source, *target = (PWSTR)paths->Target; - if (op->media) src_len += strlenW(op->media->root) + 1; - if (op->src_path) src_len += strlenW(op->src_path) + 1; - if (op->src_file) src_len += strlenW(op->src_file) + 1; - if (op->dst_path) dst_len += strlenW(op->dst_path) + 1; - if (op->dst_file) dst_len += strlenW(op->dst_file) + 1; + if (op->media) src_len += lstrlenW(op->media->root) + 1; + if (op->src_path) src_len += lstrlenW(op->src_path) + 1; + if (op->src_file) src_len += lstrlenW(op->src_file) + 1; + if (op->dst_path) dst_len += lstrlenW(op->dst_path) + 1; + if (op->dst_file) dst_len += lstrlenW(op->dst_file) + 1; src_len *= sizeof(WCHAR); dst_len *= sizeof(WCHAR); @@ -357,7 +357,7 @@ static void get_src_file_info( HINF hinf, struct file_op *op, PWSTR* psrc_root, if (len) { SetupGetStringFieldW( &disk_ctx, 4, op->src_path, len, NULL ); - ptr = op->src_path + strlenW(op->src_path); + ptr = op->src_path + lstrlenW(op->src_path); if (len2 && ptr > op->src_path && ptr[-1] != '\\') *ptr++ = '\\'; } if (!SetupGetStringFieldW( &file_ctx, 2, ptr, len2, NULL )) *ptr = 0; @@ -400,11 +400,11 @@ static void get_source_info( HINF hinf, const WCHAR *src_file, SP_FILE_COPY_PARA SetupGetStringFieldW( &disk_ctx, 2, (WCHAR *)params->SourceTagfile, len, NULL ); if (SetupGetStringFieldW( &disk_ctx, 4, NULL, 0, &len ) && len > sizeof(WCHAR) - && len < MAX_PATH - strlenW( src_root ) - 1) + && len < MAX_PATH - lstrlenW( src_root ) - 1) { - strcatW( src_root, backslashW ); - SetupGetStringFieldW( &disk_ctx, 4, src_root + strlenW( src_root ), - MAX_PATH - strlenW( src_root ), NULL ); + lstrcatW( src_root, backslashW ); + SetupGetStringFieldW( &disk_ctx, 4, src_root + lstrlenW( src_root ), + MAX_PATH - lstrlenW( src_root ), NULL ); } if (SetupGetStringFieldW( &file_ctx, 2, NULL, 0, &len ) && len > sizeof(WCHAR) && len < MAX_PATH) @@ -454,7 +454,7 @@ static UINT WINAPI extract_cab_cb( void *arg, UINT message, UINT_PTR param1, UIN FILE_IN_CABINET_INFO_W *info = (FILE_IN_CABINET_INFO_W *)param1; const WCHAR *filename; - if ((filename = strrchrW( info->NameInCabinet, '\\' ))) + if ((filename = wcsrchr( info->NameInCabinet, '\\' ))) filename++; else filename = info->NameInCabinet; @@ -462,7 +462,7 @@ static UINT WINAPI extract_cab_cb( void *arg, UINT message, UINT_PTR param1, UIN if (lstrcmpiW( filename, ctx->src )) return FILEOP_SKIP; - strcpyW( info->FullTargetName, ctx->dst ); + lstrcpyW( info->FullTargetName, ctx->dst ); return FILEOP_DOIT; } case SPFILENOTIFY_FILEEXTRACTED: @@ -473,7 +473,7 @@ static UINT WINAPI extract_cab_cb( void *arg, UINT message, UINT_PTR param1, UIN case SPFILENOTIFY_NEEDNEWCABINET: { const CABINET_INFO_W *info = (const CABINET_INFO_W *)param1; - strcpyW( (WCHAR *)param2, info->CabinetPath ); + lstrcpyW( (WCHAR *)param2, info->CabinetPath ); return ERROR_SUCCESS; } case SPFILENOTIFY_CABINETINFO: @@ -503,13 +503,13 @@ static BOOL extract_cabinet_file( const WCHAR *cabinet, const WCHAR *root, TRACE("extract_cabinet_file(cab = '%s' ; root = '%s' ; src = '%s' ; dst = '%s')\n", debugstr_w(cabinet), debugstr_w(root), debugstr_w(src), debugstr_w(dst)); #else - int len = strlenW( cabinet ); + int len = lstrlenW( cabinet ); /* make sure the cabinet file has a .cab extension */ - if (len <= 4 || strcmpiW( cabinet + len - 4, extW )) return FALSE; + if (len <= 4 || wcsicmp( cabinet + len - 4, extW )) return FALSE; #endif - strcpyW(path, root); - strcatW(path, backslashW); - strcatW(path, cabinet); + lstrcpyW(path, root); + lstrcatW(path, backslashW); + lstrcatW(path, cabinet); return SetupIterateCabinetW( path, 0, extract_cab_cb, &ctx ); } @@ -596,7 +596,7 @@ BOOL WINAPI SetupQueueCopyIndirectA( SP_FILE_COPY_PARAMS_A *paramsA ) static BOOL equal_str(const WCHAR *a, const WCHAR *b) { - return (!a && !b) || (a && b && !strcmpW(a, b)); + return (!a && !b) || (a && b && !wcscmp(a, b)); } static struct source_media *get_source_media(struct file_queue *queue, @@ -606,7 +606,7 @@ static struct source_media *get_source_media(struct file_queue *queue, for (i = 0; i < queue->source_count; ++i) { - if (!strcmpW(root, queue->sources[i]->root) + if (!wcscmp(root, queue->sources[i]->root) && equal_str(desc, queue->sources[i]->desc) && equal_str(tag, queue->sources[i]->tag)) { @@ -616,7 +616,7 @@ static struct source_media *get_source_media(struct file_queue *queue, queue->sources = heap_realloc( queue->sources, ++queue->source_count * sizeof(*queue->sources) ); queue->sources[i] = heap_alloc( sizeof(*queue->sources[i]) ); - strcpyW(queue->sources[i]->root, root); + lstrcpyW(queue->sources[i]->root, root); queue->sources[i]->desc = strdupW(desc); queue->sources[i]->tag = strdupW(tag); queue->sources[i]->resolved = FALSE; @@ -793,7 +793,7 @@ BOOL WINAPI SetupQueueDefaultCopyW( HSPFILEQ queue, HINF hinf, PCWSTR src_root, #endif params.SecurityDescriptor = NULL; - strcpyW( src_root_buffer, src_root ); + lstrcpyW( src_root_buffer, src_root ); src_path[0] = 0; if (!(params.TargetDirectory = get_destination_dir( hinf, NULL ))) return FALSE; get_source_info( hinf, src_file, ¶ms, src_root_buffer, src_path ); @@ -935,14 +935,14 @@ BOOL WINAPI SetupQueueCopySectionW( HSPFILEQ queue, PCWSTR src_root, HINF hinf, #ifdef __REACTOS__ /* Check for .Security section */ - security_key = MyMalloc( (strlenW( section ) + strlenW( DotSecurity )) * sizeof(WCHAR) + sizeof(UNICODE_NULL) ); + security_key = MyMalloc( (lstrlenW( section ) + lstrlenW( DotSecurity )) * sizeof(WCHAR) + sizeof(UNICODE_NULL) ); if (!security_key) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); return FALSE; } - strcpyW( security_key, section ); - strcatW( security_key, DotSecurity ); + lstrcpyW( security_key, section ); + lstrcatW( security_key, DotSecurity ); ret = SetupFindFirstLineW( hinf, security_key, NULL, &security_context ); MyFree(security_key); if (ret) @@ -978,7 +978,7 @@ BOOL WINAPI SetupQueueCopySectionW( HSPFILEQ queue, PCWSTR src_root, HINF hinf, #endif params.SecurityDescriptor = security_descriptor; - strcpyW( src_root_buffer, src_root ); + lstrcpyW( src_root_buffer, src_root ); if (!hlist) hlist = hinf; if (!hinf) hinf = hlist; @@ -989,13 +989,13 @@ BOOL WINAPI SetupQueueCopySectionW( HSPFILEQ queue, PCWSTR src_root, HINF hinf, params.SourcePath = NULL; params.SourceDescription = NULL; params.SourceTagfile = NULL; - strcpyW( src_root_buffer, src_root ); + lstrcpyW( src_root_buffer, src_root ); src_path[0] = 0; if (!SetupGetStringFieldW( &context, 1, dst_file, ARRAY_SIZE( dst_file ), NULL )) goto end; if (!SetupGetStringFieldW( &context, 2, src_file, ARRAY_SIZE( src_file ), &len ) || len <= sizeof(WCHAR)) - strcpyW( src_file, dst_file ); + lstrcpyW( src_file, dst_file ); if (!SetupGetIntField( &context, 4, &flags )) flags = 0; /* FIXME */ @@ -1142,10 +1142,10 @@ static BOOL create_full_pathW(const WCHAR *path) int len; WCHAR *new_path; - new_path = HeapAlloc(GetProcessHeap(), 0, (strlenW(path) + 1) * sizeof(WCHAR)); - strcpyW(new_path, path); + new_path = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(path) + 1) * sizeof(WCHAR)); + lstrcpyW(new_path, path); - while((len = strlenW(new_path)) && new_path[len - 1] == '\\') + while((len = lstrlenW(new_path)) && new_path[len - 1] == '\\') new_path[len - 1] = 0; while(!CreateDirectoryW(new_path, NULL)) @@ -1162,7 +1162,7 @@ static BOOL create_full_pathW(const WCHAR *path) break; } - if(!(slash = strrchrW(new_path, '\\'))) + if(!(slash = wcsrchr(new_path, '\\'))) { ret = FALSE; break; @@ -1505,8 +1505,8 @@ BOOL WINAPI SetupInstallFileExW( HINF hinf, PINFCONTEXT inf_context, PCWSTR sour if ((dest_dir = get_destination_dir( hinf, NULL ))) { - strcpyW( dest_path, dest_dir ); - strcatW( dest_path, backslashW ); + lstrcpyW( dest_path, dest_dir ); + lstrcatW( dest_path, backslashW ); heap_free( dest_dir ); } } @@ -1516,8 +1516,8 @@ BOOL WINAPI SetupInstallFileExW( HINF hinf, PINFCONTEXT inf_context, PCWSTR sour return FALSE; } - len = strlenW( source ) + 1; - if (absolute) len += strlenW( root ) + 1; + len = lstrlenW( source ) + 1; + if (absolute) len += lstrlenW( root ) + 1; if (!(p = buffer = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) { @@ -1528,14 +1528,14 @@ BOOL WINAPI SetupInstallFileExW( HINF hinf, PINFCONTEXT inf_context, PCWSTR sour if (absolute) { - strcpyW( buffer, root ); - p += strlenW( buffer ); + lstrcpyW( buffer, root ); + p += lstrlenW( buffer ); if (p[-1] != '\\') *p++ = '\\'; } while (*source == '\\') source++; - strcpyW( p, source ); + lstrcpyW( p, source ); - strcatW( dest_path, dest ); + lstrcatW( dest_path, dest ); ret = do_file_copyW( buffer, dest_path, style, handler, context ); @@ -1666,8 +1666,8 @@ BOOL WINAPI SetupCommitFileQueueW( HWND owner, HSPFILEQ handle, PSP_FILE_CALLBAC op->src_path = NULL; if (src_path) { - strcatW(op->media->root, backslashW); - strcatW(op->media->root, src_path); + lstrcatW(op->media->root, backslashW); + lstrcatW(op->media->root, src_path); } for (;;) @@ -1688,7 +1688,7 @@ BOOL WINAPI SetupCommitFileQueueW( HWND owner, HSPFILEQ handle, PSP_FILE_CALLBAC else if (op_result == FILEOP_SKIP) break; else if (op_result == FILEOP_NEWPATH) - strcpyW(op->media->root, newpath); + lstrcpyW(op->media->root, newpath); else if (op_result != FILEOP_DOIT) FIXME("Unhandled return value %#x.\n", op_result); @@ -1705,8 +1705,8 @@ BOOL WINAPI SetupCommitFileQueueW( HWND owner, HSPFILEQ handle, PSP_FILE_CALLBAC { if (src_path && !op->media->cabinet) { - size_t root_len = strlenW(op->media->root), path_len = strlenW(src_path); - if (path_len <= root_len && !strncmpiW(op->media->root + root_len - path_len, src_path, path_len)) + size_t root_len = lstrlenW(op->media->root), path_len = lstrlenW(src_path); + if (path_len <= root_len && !wcsnicmp(op->media->root + root_len - path_len, src_path, path_len)) op->media->root[root_len - path_len - 1] = 0; heap_free( src_path ); } @@ -1748,7 +1748,7 @@ BOOL WINAPI SetupCommitFileQueueW( HWND owner, HSPFILEQ handle, PSP_FILE_CALLBAC goto done; else if (op_result == FILEOP_NEWPATH) { - strcpyW(op->media->root, newpath); + lstrcpyW(op->media->root, newpath); build_filepathsW(op, &paths); } else if (op_result != FILEOP_SKIP && op_result != FILEOP_DOIT) @@ -2092,7 +2092,7 @@ UINT WINAPI SetupDefaultQueueCallbackW( PVOID context, UINT notification, { const SOURCE_MEDIA_W *media = (const SOURCE_MEDIA_W *)param1; TRACE( "need media %s %s\n", debugstr_w(media->SourcePath), debugstr_w(media->SourceFile) ); - strcpyW( (WCHAR *)param2, media->SourcePath ); + lstrcpyW( (WCHAR *)param2, media->SourcePath ); return FILEOP_DOIT; } default: diff --git a/dll/win32/setupapi/setupcab.c b/dll/win32/setupapi/setupcab.c index efd150fd9ee..9fc7f940769 100644 --- a/dll/win32/setupapi/setupcab.c +++ b/dll/win32/setupapi/setupcab.c @@ -427,7 +427,7 @@ static INT_PTR CDECL sc_FNNOTIFY_W(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION p if (err == FILEOP_DOIT) { TRACE(" Callback specified filename: %s\n", debugstr_w(fici.FullTargetName)); if (fici.FullTargetName[0]) { - len = strlenW(fici.FullTargetName) + 1; + len = lstrlenW(fici.FullTargetName) + 1; if ((len > MAX_PATH ) || (len <= 1)) return 0; if (!WideCharToMultiByte(CP_ACP, 0, fici.FullTargetName, len, charbuf, MAX_PATH, 0, 0)) @@ -437,7 +437,7 @@ static INT_PTR CDECL sc_FNNOTIFY_W(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION p SetLastError(ERROR_PATH_NOT_FOUND); return -1; } - strcpyW( phsc->most_recent_target, fici.FullTargetName ); + lstrcpyW( phsc->most_recent_target, fici.FullTargetName ); return sc_cb_open(charbuf, _O_BINARY | _O_CREAT | _O_WRONLY, _S_IREAD | _S_IWRITE); } else { TRACE(" Callback skipped file.\n"); @@ -490,7 +490,7 @@ static INT_PTR CDECL sc_FNNOTIFY_W(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION p return -1; } else { if (mysterio[0]) { - len = strlenW(mysterio) + 1; + len = lstrlenW(mysterio) + 1; if ((len > 255) || (len <= 1)) return 0; if (!WideCharToMultiByte(CP_ACP, 0, mysterio, len, pfdin->psz3, 255, 0, 0)) @@ -602,13 +602,13 @@ BOOL WINAPI SetupIterateCabinetW(PCWSTR CabinetFile, DWORD Reserved, } if (p) { - strcpyW(my_hsc.most_recent_cabinet_name, p); + lstrcpyW(my_hsc.most_recent_cabinet_name, p); *p = 0; len = WideCharToMultiByte(CP_ACP, 0, pszCabPathW, -1, pszCabPath, MAX_PATH, 0, 0); if (!len) return FALSE; } else { - strcpyW(my_hsc.most_recent_cabinet_name, CabinetFile); + lstrcpyW(my_hsc.most_recent_cabinet_name, CabinetFile); pszCabPath[0] = '\0'; } diff --git a/dll/win32/setupapi/stringtable_wine.c b/dll/win32/setupapi/stringtable_wine.c index f51bb9e4ed8..cdcb07337c4 100644 --- a/dll/win32/setupapi/stringtable_wine.c +++ b/dll/win32/setupapi/stringtable_wine.c @@ -83,7 +83,7 @@ static inline DWORD get_string_hash(const WCHAR *str, BOOL case_sensitive) DWORD hash = 0; while (*str) { - WCHAR ch = case_sensitive ? *str : tolowerW(*str); + WCHAR ch = case_sensitive ? *str : towlower(*str); hash += ch; if (ch & ~0xff) hash |= 1; @@ -108,7 +108,7 @@ static inline char *get_extradata_ptr(struct stringtable *table, DWORD id) { WCHAR *ptrW = get_string_ptr(table, id); /* skip string itself */ - return (char*)(ptrW + strlenW(ptrW) + 1); + return (char*)(ptrW + lstrlenW(ptrW) + 1); } static inline BOOL is_valid_string_id(struct stringtable *table, DWORD id) @@ -320,7 +320,7 @@ DWORD WINAPI StringTableLookUpStringEx(HSTRING_TABLE hTable, LPWSTR string, DWOR while (1) { entry = (struct stringentry*)(table->data + offset); if (case_sensitive) - cmp = lstrcmpW(entry->data, string); + cmp = wcscmp(entry->data, string); else cmp = lstrcmpiW(entry->data, string); if (!cmp) { @@ -401,7 +401,7 @@ DWORD WINAPI StringTableAddStringEx(HSTRING_TABLE hTable, LPWSTR string, return id; /* needed space for new record */ - len = sizeof(DWORD) + (strlenW(string)+1)*sizeof(WCHAR) + table->max_extra_size; + len = sizeof(DWORD) + (lstrlenW(string)+1)*sizeof(WCHAR) + table->max_extra_size; if (table->nextoffset + len >= table->allocated) { table->allocated <<= 1; table->data = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, table->data, table->allocated); @@ -425,9 +425,9 @@ DWORD WINAPI StringTableAddStringEx(HSTRING_TABLE hTable, LPWSTR string, /* copy string */ ptrW = get_string_ptr(table, id); - strcpyW(ptrW, string); + lstrcpyW(ptrW, string); if (!case_sensitive) - strlwrW(ptrW); + wcslwr(ptrW); /* copy extra data */ if (extra) @@ -568,9 +568,9 @@ BOOL WINAPI StringTableStringFromIdEx(HSTRING_TABLE hTable, ULONG id, LPWSTR buf } ptrW = get_string_ptr(table, id); - len = (strlenW(ptrW) + 1)*sizeof(WCHAR); + len = (lstrlenW(ptrW) + 1)*sizeof(WCHAR); if (len <= *buflen) - strcpyW(buff, ptrW); + lstrcpyW(buff, ptrW); else ret = FALSE; diff --git a/sdk/tools/winesync/setupapi.cfg b/sdk/tools/winesync/setupapi.cfg index 8f8f7502b4a..902079c31a4 100644 --- a/sdk/tools/winesync/setupapi.cfg +++ b/sdk/tools/winesync/setupapi.cfg @@ -10,4 +10,4 @@ files: dlls/setupapi/setupcab.c: dll/win32/setupapi/setupcab.c dlls/setupapi/stringtable.c: dll/win32/setupapi/stringtable_wine.c tags: - wine: dae160ceda33598632597527cb56090acf58f60d + wine: 72d6759f3a86c24e2db0b6190f4d2fae642e487f