Author: tkreuzer Date: Sat Apr 11 08:17:03 2015 New Revision: 67148
URL: http://svn.reactos.org/svn/reactos?rev=67148&view=rev Log: [DESK] Fix MSVC/x64 warnings
Modified: trunk/reactos/dll/cpl/desk/background.c trunk/reactos/dll/cpl/desk/classinst.c trunk/reactos/dll/cpl/desk/devsett.c trunk/reactos/dll/cpl/desk/dibitmap.c trunk/reactos/dll/cpl/desk/monslctl.c trunk/reactos/dll/cpl/desk/screensaver.c trunk/reactos/dll/cpl/desk/settings.c
Modified: trunk/reactos/dll/cpl/desk/background.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/background.c?r... ============================================================================== --- trunk/reactos/dll/cpl/desk/background.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/background.c [iso-8859-1] Sat Apr 11 08:17:03 2015 @@ -137,7 +137,7 @@ size = 0; for (i = 0; i < num; ++i) { - size = size + wcslen(codecInfo[i].FilenameExtension) + 1; + size = size + (UINT)wcslen(codecInfo[i].FilenameExtension) + 1; }
size = (size + 1) * sizeof(WCHAR); @@ -238,7 +238,7 @@ }
PathRemoveExtension(backgroundItem->szDisplayName); - + hr = StringCbCopy(backgroundItem->szFilename, sizeof(backgroundItem->szFilename), filename); if (FAILED(hr)) { @@ -605,8 +605,8 @@ HRESULT hr; TCHAR filterdesc[MAX_PATH]; TCHAR *c; - UINT sizeRemain; - DWORD buffersize; + size_t sizeRemain; + SIZE_T buffersize; BOOL success;
hwndBackgroundList = GetDlgItem(hwndDlg, IDC_BACKGROUND_LIST); @@ -975,12 +975,22 @@
if (SUCCEEDED(StringCchLength(pData->backgroundItems[pData->backgroundSelection].szFilename, MAX_PATH, &length))) { - RegSetValueEx(regKey, TEXT("ConvertedWallpaper"), 0, REG_SZ, (BYTE*)pData->backgroundItems[pData->backgroundSelection].szFilename, (length + 1) * sizeof(TCHAR)); + RegSetValueEx(regKey, + TEXT("ConvertedWallpaper"), + 0, + REG_SZ, + (BYTE*)pData->backgroundItems[pData->backgroundSelection].szFilename, + (DWORD)((length + 1) * sizeof(TCHAR))); }
if (SUCCEEDED(StringCchLength(szWallpaper, MAX_PATH, &length))) { - RegSetValueEx(regKey, TEXT("OriginalWallpaper"), 0, REG_SZ, (BYTE *)szWallpaper, (length + 1) * sizeof(TCHAR)); + RegSetValueEx(regKey, + TEXT("OriginalWallpaper"), + 0, + REG_SZ, + (BYTE *)szWallpaper, + (DWORD)((length + 1) * sizeof(TCHAR))); }
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, szWallpaper, SPIF_UPDATEINIFILE);
Modified: trunk/reactos/dll/cpl/desk/classinst.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/classinst.c?re... ============================================================================== --- trunk/reactos/dll/cpl/desk/classinst.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/classinst.c [iso-8859-1] Sat Apr 11 08:17:03 2015 @@ -29,7 +29,7 @@ HKEY hServicesKey = NULL; HKEY hServiceKey = NULL; HKEY hDeviceSubKey = NULL; - DWORD disposition; + DWORD disposition, cchMax, cbData; BOOL result; LONG rc; HRESULT hr; @@ -96,9 +96,13 @@ goto cleanup; }
- result = SetupDiGetActualSectionToInstall( - hInf, DriverInfoDetailData.SectionName, - SectionName, MAX_PATH - _tcslen(_T(".SoftwareSettings")), NULL, NULL); + cchMax = MAX_PATH - (sizeof(_T(".SoftwareSettings")) / sizeof(TCHAR)); + result = SetupDiGetActualSectionToInstall(hInf, + DriverInfoDetailData.SectionName, + SectionName, + cchMax, + NULL, + NULL); if (!result) { rc = GetLastError(); @@ -211,10 +215,15 @@ DPRINT("SetupInstallFromInfSection() failed with error 0x%lx\n", rc); goto cleanup; } + /* Add Device Description string */ - rc = RegSetValueEx(hDeviceSubKey, _T("Device Description"), 0, - REG_SZ, (const BYTE*)DriverInfoData.Description, - (_tcslen(DriverInfoData.Description) + 1) * sizeof(TCHAR)); + cbData = (DWORD)(_tcslen(DriverInfoData.Description) + 1) * sizeof(TCHAR); + rc = RegSetValueEx(hDeviceSubKey, + _T("Device Description"), + 0, + REG_SZ, + (const BYTE*)DriverInfoData.Description, + cbData); if (rc != ERROR_SUCCESS) { DPRINT("RegSetValueEx() failed with error 0x%lx\n", rc);
Modified: trunk/reactos/dll/cpl/desk/devsett.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/devsett.c?rev=... ============================================================================== --- trunk/reactos/dll/cpl/desk/devsett.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/devsett.c [iso-8859-1] Sat Apr 11 08:17:03 2015 @@ -74,7 +74,7 @@ static PWSTR pCDevSettings_AllocAndCopyString(const TCHAR *pszSrc) { - INT c; + SIZE_T c; PWSTR str;
c = _tcslen(pszSrc) + 1; @@ -556,7 +556,7 @@ PCWSTR pszRet = NULL; PWSTR pszBuf; PCDevSettings This = impl_from_IDataObject(iface); - + ZeroMemory(pmedium, sizeof(STGMEDIUM));
Modified: trunk/reactos/dll/cpl/desk/dibitmap.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/dibitmap.c?rev... ============================================================================== --- trunk/reactos/dll/cpl/desk/dibitmap.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/dibitmap.c [iso-8859-1] Sat Apr 11 08:17:03 2015 @@ -57,7 +57,7 @@ ZeroMemory(lpBitmap->info, sizeof(BITMAPINFO)); lpBitmap->info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); lpBitmap->info->bmiHeader.biWidth = lpBitmap->width; - lpBitmap->info->bmiHeader.biHeight = -lpBitmap->height; + lpBitmap->info->bmiHeader.biHeight = -(INT)lpBitmap->height; lpBitmap->info->bmiHeader.biPlanes = 1; lpBitmap->info->bmiHeader.biBitCount = 32; lpBitmap->info->bmiHeader.biCompression = BI_RGB;
Modified: trunk/reactos/dll/cpl/desk/monslctl.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/monslctl.c?rev... ============================================================================== --- trunk/reactos/dll/cpl/desk/monslctl.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/monslctl.c [iso-8859-1] Sat Apr 11 08:17:03 2015 @@ -529,7 +529,7 @@ { RECT rc, rcClient;
- if (Index < 0 || Index >= infoPtr->MonitorsCount) + if (Index < 0 || (UINT)Index >= infoPtr->MonitorsCount) return -1;
if (!infoPtr->CanDisplay) @@ -1459,7 +1459,7 @@ Index++; }
- if (infoPtr->SelectedMonitor < infoPtr->MonitorsCount) + if (infoPtr->SelectedMonitor < (INT)infoPtr->MonitorsCount) { MonSelSetCurSelMonitor(infoPtr, Index,
Modified: trunk/reactos/dll/cpl/desk/screensaver.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/screensaver.c?... ============================================================================== --- trunk/reactos/dll/cpl/desk/screensaver.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/screensaver.c [iso-8859-1] Sat Apr 11 08:17:03 2015 @@ -528,12 +528,13 @@ /* Set the screensaver */ if (pData->ScreenSaverItems[pData->Selection].bIsScreenSaver) { + SIZE_T Length = _tcslen(pData->ScreenSaverItems[pData->Selection].szFilename) * sizeof(TCHAR); RegSetValueEx(regKey, _T("SCRNSAVE.EXE"), 0, REG_SZ, (PBYTE)pData->ScreenSaverItems[pData->Selection].szFilename, - _tcslen(pData->ScreenSaverItems[pData->Selection].szFilename) * sizeof(TCHAR)); + (DWORD)Length);
SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, TRUE, 0, SPIF_UPDATEINIFILE); }
Modified: trunk/reactos/dll/cpl/desk/settings.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/settings.c?rev... ============================================================================== --- trunk/reactos/dll/cpl/desk/settings.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/settings.c [iso-8859-1] Sat Apr 11 08:17:03 2015 @@ -146,7 +146,7 @@ LPTSTR name = NULL; LPTSTR key = NULL; LPTSTR devid = NULL; - DWORD descriptionSize, nameSize, keySize, devidSize; + SIZE_T descriptionSize, nameSize, keySize, devidSize; PSETTINGS_ENTRY Current; DWORD ResolutionsCount = 1; DWORD i;