Fix MSVC/x64 warnings

svn path=/trunk/; revision=67148
This commit is contained in:
Timo Kreuzer 2015-04-11 08:17:03 +00:00
parent 5956c4372a
commit 1d742c54fb
7 changed files with 40 additions and 20 deletions

View file

@ -137,7 +137,7 @@ GdipGetSupportedFileExtensions(VOID)
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 @@ AddWallpapersFromDirectory(UINT uCounter, HWND hwndBackgroundList, BackgroundIte
}
PathRemoveExtension(backgroundItem->szDisplayName);
hr = StringCbCopy(backgroundItem->szFilename, sizeof(backgroundItem->szFilename), filename);
if (FAILED(hr))
{
@ -605,8 +605,8 @@ OnBrowseButton(HWND hwndDlg, PDATA pData)
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 @@ SetWallpaper(PDATA pData)
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);

View file

@ -29,7 +29,7 @@ DisplayClassInstaller(
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 @@ DisplayClassInstaller(
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 @@ DisplayClassInstaller(
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);

View file

@ -74,7 +74,7 @@ pCDevSettings_FreeString(PWCHAR *psz)
static PWSTR
pCDevSettings_AllocAndCopyString(const TCHAR *pszSrc)
{
INT c;
SIZE_T c;
PWSTR str;
c = _tcslen(pszSrc) + 1;
@ -556,7 +556,7 @@ CDevSettings_GetData(IDataObject* iface,
PCWSTR pszRet = NULL;
PWSTR pszBuf;
PCDevSettings This = impl_from_IDataObject(iface);
ZeroMemory(pmedium,
sizeof(STGMEDIUM));

View file

@ -57,7 +57,7 @@ DibLoadImage(LPTSTR lpFilename)
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;

View file

@ -529,7 +529,7 @@ MonSelGetMonitorRect(IN OUT PMONITORSELWND infoPtr,
{
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 @@ MonitorSelWndProc(IN HWND hwnd,
Index++;
}
if (infoPtr->SelectedMonitor < infoPtr->MonitorsCount)
if (infoPtr->SelectedMonitor < (INT)infoPtr->MonitorsCount)
{
MonSelSetCurSelMonitor(infoPtr,
Index,

View file

@ -528,12 +528,13 @@ SetScreenSaver(HWND hwndDlg, PDATA pData)
/* 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);
}

View file

@ -146,7 +146,7 @@ AddDisplayDevice(IN PDATA pData, IN const DISPLAY_DEVICE *DisplayDevice)
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;