Index: buildtool/buildtool.c |
— | — | @@ -481,13 +481,13 @@ |
482 | 482 | puts("Skipping file signature.");
|
483 | 483 | return 0;
|
484 | 484 | }
|
485 | | - strcpy(&signpath, &signtoolsha1path);
|
486 | | - strcat(&signpath, "\"");
|
487 | | - strncat(&signpath, exefile, MAX_PATH);
|
488 | | - strcat(&signpath, "\"");
|
| 485 | + strcpy(signpath, signtoolsha1path);
|
| 486 | + strcat(signpath, "\"");
|
| 487 | + strncat(signpath, exefile, MAX_PATH);
|
| 488 | + strcat(signpath, "\"");
|
489 | 489 | ZeroMemory(&startinfo, sizeof(STARTUPINFOA));
|
490 | 490 | startinfo.cb = sizeof(STARTUPINFOA);
|
491 | | - if (CreateProcessA(NULL, &signpath, NULL, NULL, FALSE, 0, NULL, NULL, &startinfo, &process))
|
| 491 | + if (CreateProcessA(NULL, signpath, NULL, NULL, FALSE, 0, NULL, NULL, &startinfo, &process))
|
492 | 492 | {
|
493 | 493 | WaitForSingleObject(process.hProcess, INFINITE);
|
494 | 494 | CloseHandle(process.hProcess);
|
Index: cfgmgr/cfgmgr.c |
— | — | @@ -160,7 +160,7 @@ |
161 | 161 | {
|
162 | 162 | _tcscat(buffer, _T(" "));
|
163 | 163 | _tcscat(buffer, flag);
|
164 | | - error2 = RegSetValueEx(hKey, filename, 0, REG_SZ, (BYTE*)buffer, (_tcslen(buffer) + 1)*sizeof(TCHAR));
|
| 164 | + error2 = RegSetValueEx(hKey, filename, 0, REG_SZ, (BYTE*)buffer, (DWORD)(_tcslen(buffer) + 1)*sizeof(TCHAR));
|
165 | 165 | if (error2 == ERROR_SUCCESS) ShowRestartDialog();
|
166 | 166 | else
|
167 | 167 | {
|
— | — | @@ -171,7 +171,7 @@ |
172 | 172 | }
|
173 | 173 | else if (error2 == ERROR_FILE_NOT_FOUND)
|
174 | 174 | {
|
175 | | - error2 = RegSetValueEx(hKey, filename, 0, REG_SZ, (BYTE*)flag, (_tcslen(flag) + 1)*sizeof(TCHAR));
|
| 175 | + error2 = RegSetValueEx(hKey, filename, 0, REG_SZ, (BYTE*)flag, (DWORD)(_tcslen(flag) + 1)*sizeof(TCHAR));
|
176 | 176 | if (error2 == ERROR_SUCCESS) ShowRestartDialog();
|
177 | 177 | else
|
178 | 178 | {
|
— | — | @@ -225,7 +225,7 @@ |
226 | 226 | else error = RegOpenKeyEx(HKEY_LOCAL_MACHINE, writekey, 0, KEY_WRITE, &hKeyWrite);
|
227 | 227 | if (error == ERROR_SUCCESS)
|
228 | 228 | {
|
229 | | - error = RegSetValueEx(hKeyWrite, filename, 0, REG_SZ, (BYTE*)buffer, (_tcslen(bufferpos + _tcslen(flag)))*sizeof(TCHAR)+sizeof(TCHAR));
|
| 229 | + error = RegSetValueEx(hKeyWrite, filename, 0, REG_SZ, (BYTE*)buffer, (DWORD)(_tcslen(bufferpos + _tcslen(flag)))*sizeof(TCHAR)+sizeof(TCHAR));
|
230 | 230 | RegCloseKey(hKeyWrite);
|
231 | 231 | hKeyWrite = NULL;
|
232 | 232 | }
|
— | — | @@ -292,7 +292,7 @@ |
293 | 293 | error = RegOpenKeyEx(HKEY_CURRENT_USER, writekey, 0, KEY_WRITE, &hKeyWrite);
|
294 | 294 | if (error == ERROR_SUCCESS)
|
295 | 295 | {
|
296 | | - error = RegSetValueEx(hKeyWrite, filename, 0, REG_SZ, (BYTE*)buffer, (_tcslen(bufferpos + _tcslen(flag)))*sizeof(TCHAR)+sizeof(TCHAR));
|
| 296 | + error = RegSetValueEx(hKeyWrite, filename, 0, REG_SZ, (BYTE*)buffer, (DWORD)(_tcslen(bufferpos + _tcslen(flag)))*sizeof(TCHAR)+sizeof(TCHAR));
|
297 | 297 | RegCloseKey(hKeyWrite);
|
298 | 298 | hKeyWrite = NULL;
|
299 | 299 | }
|
— | — | @@ -352,8 +352,8 @@ |
353 | 353 |
|
354 | 354 | void GetDirFromPath(LPTSTR path)
|
355 | 355 | {
|
356 | | - int i;
|
357 | | - int len = _tcslen(path);
|
| 356 | + size_t i;
|
| 357 | + size_t len = _tcslen(path);
|
358 | 358 | for(i = len; i > 0; i--)
|
359 | 359 | {
|
360 | 360 | if((path[i] == '\\') || (path[i] == '/'))
|
— | — | @@ -710,7 +710,7 @@ |
711 | 711 | error = RegQueryValueEx(hKey,_T("InstallPath"),NULL,®sz,NULL,&sizeout);
|
712 | 712 | if(error == ERROR_FILE_NOT_FOUND)
|
713 | 713 | RegSetValueEx(hKey, _T("InstallPath"), 0, REG_SZ,
|
714 | | - (LPBYTE)path, _tcslen(path) * sizeof(TCHAR));
|
| 714 | + (LPBYTE)path, (DWORD)(_tcslen(path) * sizeof(TCHAR)));
|
715 | 715 | }
|
716 | 716 | if (global && !cfg->Windows8Detected)
|
717 | 717 | {
|
— | — | @@ -759,7 +759,7 @@ |
760 | 760 | }
|
761 | 761 | void WritePath(HKEY hKey, const TCHAR *path, const TCHAR *mask, LPCTSTR name)
|
762 | 762 | {
|
763 | | - if(mask[0]) RegSetValueEx(hKey,name,0,REG_SZ,(BYTE*)path,(_tcslen(path)+1)*sizeof(TCHAR));
|
| 763 | + if(mask[0]) RegSetValueEx(hKey,name,0,REG_SZ,(BYTE*)path,(DWORD)(_tcslen(path)+1)*sizeof(TCHAR));
|
764 | 764 | else RegDeleteValue(hKey,name);
|
765 | 765 | }
|
766 | 766 |
|
— | — | @@ -889,7 +889,7 @@ |
890 | 890 | _tcscpy(regkey, regkeybase);
|
891 | 891 | _tcscat(regkey, _T("Profiles\\"));
|
892 | 892 | _tcscpy(filename, path);
|
893 | | - for (i = _tcslen(filename); (i > 0) && (filename[i] != 92) && (filename[i] != 47); i--);
|
| 893 | + for (i = (int)_tcslen(filename); (i > 0) && (filename[i] != 92) && (filename[i] != 47); i--);
|
894 | 894 | i++;
|
895 | 895 | _tcscat(regkey, &filename[i]);
|
896 | 896 | _tcscat(regkey, _T("-"));
|
— | — | @@ -897,7 +897,7 @@ |
898 | 898 | filename[i] = 0;
|
899 | 899 | _tcslwr(filename);
|
900 | 900 | Sha256Initialise(&sha_context);
|
901 | | - Sha256Update(&sha_context, filename, _tcslen(filename));
|
| 901 | + Sha256Update(&sha_context, filename, (uint32_t)_tcslen(filename));
|
902 | 902 | Sha256Finalise(&sha_context, &sha256);
|
903 | 903 | for (i = 0; i < (256 / 8); i++)
|
904 | 904 | {
|
— | — | @@ -928,11 +928,11 @@ |
929 | 929 | TCHAR filename[MAX_PATH + 1];
|
930 | 930 | _tcsncpy(pathlwr, path, MAX_PATH);
|
931 | 931 | pathlwr[MAX_PATH] = 0;
|
932 | | - for (i = _tcslen(pathlwr); (i > 0) && (pathlwr[i] != 92) && (pathlwr[i] != 47); i--);
|
| 932 | + for (i = (int)_tcslen(pathlwr); (i > 0) && (pathlwr[i] != 92) && (pathlwr[i] != 47); i--);
|
933 | 933 | pathlwr[i] = 0;
|
934 | 934 | _tcslwr(pathlwr);
|
935 | 935 | Sha256Initialise(&sha_context);
|
936 | | - Sha256Update(&sha_context, pathlwr, _tcslen(pathlwr));
|
| 936 | + Sha256Update(&sha_context, pathlwr, (uint32_t)_tcslen(pathlwr));
|
937 | 937 | Sha256Finalise(&sha_context, &sha256);
|
938 | 938 | for (i = 0; i < (256 / 8); i++)
|
939 | 939 | {
|
— | — | @@ -943,7 +943,7 @@ |
944 | 944 | _tcscpy(regkey,regkeybase);
|
945 | 945 | _tcsncpy(filename,path,MAX_PATH);
|
946 | 946 | filename[MAX_PATH] = 0;
|
947 | | - for(i = _tcslen(filename); (i > 0) && (filename[i] != 92) && (filename[i] != 47); i--);
|
| 947 | + for(i = (int)_tcslen(filename); (i > 0) && (filename[i] != 92) && (filename[i] != 47); i--);
|
948 | 948 | i++;
|
949 | 949 | _tcscat(regkey, _T("Profiles\\"));
|
950 | 950 | _tcscat(regkey,&filename[i]);
|
— | — | @@ -1200,8 +1200,8 @@ |
1201 | 1201 | void SetINISection(HANDLE file, int section)
|
1202 | 1202 | {
|
1203 | 1203 | char buffer[32];
|
1204 | | - int buffersize;
|
1205 | | - int outsize;
|
| 1204 | + DWORD buffersize;
|
| 1205 | + DWORD outsize;
|
1206 | 1206 | if (section != ini_currentsection)
|
1207 | 1207 | {
|
1208 | 1208 | ini_currentsection = section;
|
— | — | @@ -1234,7 +1234,7 @@ |
1235 | 1235 | default:
|
1236 | 1236 | return;
|
1237 | 1237 | }
|
1238 | | - buffersize = strlen(buffer);
|
| 1238 | + buffersize = (DWORD)strlen(buffer);
|
1239 | 1239 | WriteFile(file, buffer, buffersize, &outsize, NULL);
|
1240 | 1240 | }
|
1241 | 1241 | }
|
— | — | @@ -1242,8 +1242,8 @@ |
1243 | 1243 | void INIWriteBool(HANDLE file, const char *name, BOOL value, BOOL mask, int section)
|
1244 | 1244 | {
|
1245 | 1245 | char buffer[256];
|
1246 | | - int buffersize;
|
1247 | | - int outsize;
|
| 1246 | + DWORD buffersize;
|
| 1247 | + DWORD outsize;
|
1248 | 1248 | if (mask)
|
1249 | 1249 | {
|
1250 | 1250 | SetINISection(file, section);
|
— | — | @@ -1252,7 +1252,7 @@ |
1253 | 1253 | if (value) strcat(buffer, "true");
|
1254 | 1254 | else strcat(buffer, "false");
|
1255 | 1255 | strcat(buffer, "\r\n");
|
1256 | | - buffersize = strlen(buffer);
|
| 1256 | + buffersize = (DWORD)strlen(buffer);
|
1257 | 1257 | WriteFile(file, buffer, buffersize, &outsize, NULL);
|
1258 | 1258 | }
|
1259 | 1259 | }
|
— | — | @@ -1261,8 +1261,8 @@ |
1262 | 1262 | {
|
1263 | 1263 | char buffer[256];
|
1264 | 1264 | char number[32];
|
1265 | | - int buffersize;
|
1266 | | - int outsize;
|
| 1265 | + DWORD buffersize;
|
| 1266 | + DWORD outsize;
|
1267 | 1267 | if (mask)
|
1268 | 1268 | {
|
1269 | 1269 | SetINISection(file, section);
|
— | — | @@ -1271,7 +1271,7 @@ |
1272 | 1272 | _itoa(value, number, 10);
|
1273 | 1273 | strcat(buffer, number);
|
1274 | 1274 | strcat(buffer, "\r\n");
|
1275 | | - buffersize = strlen(buffer);
|
| 1275 | + buffersize = (DWORD)strlen(buffer);
|
1276 | 1276 | WriteFile(file, buffer, buffersize, &outsize, NULL);
|
1277 | 1277 | }
|
1278 | 1278 | }
|
— | — | @@ -1280,8 +1280,8 @@ |
1281 | 1281 | {
|
1282 | 1282 | char buffer[256];
|
1283 | 1283 | char number[32];
|
1284 | | - int buffersize;
|
1285 | | - int outsize;
|
| 1284 | + DWORD buffersize;
|
| 1285 | + DWORD outsize;
|
1286 | 1286 | if (mask)
|
1287 | 1287 | {
|
1288 | 1288 | SetINISection(file, section);
|
— | — | @@ -1290,7 +1290,7 @@ |
1291 | 1291 | _itoa(value, number, 16);
|
1292 | 1292 | strcat(buffer, number);
|
1293 | 1293 | strcat(buffer, "\r\n");
|
1294 | | - buffersize = strlen(buffer);
|
| 1294 | + buffersize = (DWORD)strlen(buffer);
|
1295 | 1295 | WriteFile(file, buffer, buffersize, &outsize, NULL);
|
1296 | 1296 | }
|
1297 | 1297 | }
|
— | — | @@ -1300,8 +1300,8 @@ |
1301 | 1301 | char buffer[256];
|
1302 | 1302 | char number[32];
|
1303 | 1303 | char floatformat[16];
|
1304 | | - int buffersize;
|
1305 | | - int outsize;
|
| 1304 | + DWORD buffersize;
|
| 1305 | + DWORD outsize;
|
1306 | 1306 | if (mask)
|
1307 | 1307 | {
|
1308 | 1308 | SetINISection(file, section);
|
— | — | @@ -1315,7 +1315,7 @@ |
1316 | 1316 | number[31] = 0;
|
1317 | 1317 | strcat(buffer, number);
|
1318 | 1318 | strcat(buffer, "\r\n");
|
1319 | | - buffersize = strlen(buffer);
|
| 1319 | + buffersize = (DWORD)strlen(buffer);
|
1320 | 1320 | WriteFile(file, buffer, buffersize, &outsize, NULL);
|
1321 | 1321 | }
|
1322 | 1322 | }
|
— | — | @@ -1391,8 +1391,8 @@ |
1392 | 1392 | {
|
1393 | 1393 | char buffer[256];
|
1394 | 1394 | char number[32];
|
1395 | | - int buffersize;
|
1396 | | - int outsize;
|
| 1395 | + DWORD buffersize;
|
| 1396 | + DWORD outsize;
|
1397 | 1397 | if (mask)
|
1398 | 1398 | {
|
1399 | 1399 | SetINISection(file, section);
|
— | — | @@ -1401,7 +1401,7 @@ |
1402 | 1402 | FloatToAspectString(value,number);
|
1403 | 1403 | strcat(buffer, number);
|
1404 | 1404 | strcat(buffer, "\r\n");
|
1405 | | - buffersize = strlen(buffer);
|
| 1405 | + buffersize = (DWORD)strlen(buffer);
|
1406 | 1406 | WriteFile(file, buffer, buffersize, &outsize, NULL);
|
1407 | 1407 | }
|
1408 | 1408 | }
|
— | — | @@ -1409,8 +1409,8 @@ |
1410 | 1410 | void INIWriteString(HANDLE file, const char *name, const char *value, DWORD mask, int section)
|
1411 | 1411 | {
|
1412 | 1412 | char buffer[512];
|
1413 | | - int buffersize;
|
1414 | | - int outsize;
|
| 1413 | + DWORD buffersize;
|
| 1414 | + DWORD outsize;
|
1415 | 1415 | if (mask)
|
1416 | 1416 | {
|
1417 | 1417 | SetINISection(file, section);
|
— | — | @@ -1418,7 +1418,7 @@ |
1419 | 1419 | strcat(buffer, "=");
|
1420 | 1420 | strcat(buffer, value);
|
1421 | 1421 | strcat(buffer, "\r\n");
|
1422 | | - buffersize = strlen(buffer);
|
| 1422 | + buffersize = (DWORD)strlen(buffer);
|
1423 | 1423 | WriteFile(file, buffer, buffersize, &outsize, NULL);
|
1424 | 1424 | }
|
1425 | 1425 | }
|
— | — | @@ -1429,8 +1429,8 @@ |
1430 | 1430 | #ifdef _UNICODE
|
1431 | 1431 | char unicodebuffer[MAX_PATH + 1];
|
1432 | 1432 | #endif
|
1433 | | - int buffersize;
|
1434 | | - int outsize;
|
| 1433 | + DWORD buffersize;
|
| 1434 | + DWORD outsize;
|
1435 | 1435 | if (mask)
|
1436 | 1436 | {
|
1437 | 1437 | SetINISection(file, section);
|
— | — | @@ -1443,7 +1443,7 @@ |
1444 | 1444 | strcat(buffer, value);
|
1445 | 1445 | #endif
|
1446 | 1446 | strcat(buffer, "\r\n");
|
1447 | | - buffersize = strlen(buffer);
|
| 1447 | + buffersize = (DWORD)strlen(buffer);
|
1448 | 1448 | WriteFile(file, buffer, buffersize, &outsize, NULL);
|
1449 | 1449 | }
|
1450 | 1450 | }
|
— | — | @@ -1478,7 +1478,7 @@ |
1479 | 1479 | }
|
1480 | 1480 | ini_currentsection = INISECTION_NULL;
|
1481 | 1481 | strcpy(buffer, "; DXGL Configuration file\r\n; This file was generated by DXGL Config.\r\n");
|
1482 | | - WriteFile(file, buffer, strlen(buffer), &bytesread, NULL);
|
| 1482 | + WriteFile(file, buffer, (DWORD)strlen(buffer), &bytesread, NULL);
|
1483 | 1483 | // [system]
|
1484 | 1484 | if (cfg->NoWriteRegistry) INIWriteBool(file, "NoWriteRegistry", TRUE, TRUE, INISECTION_SYSTEM);
|
1485 | 1485 | if (cfg->OverrideDefaults) INIWriteBool(file, "OverrideDefaults", TRUE, TRUE, INISECTION_SYSTEM);
|
— | — | @@ -1508,7 +1508,7 @@ |
1509 | 1509 | sha256string[(i * 2) + 1] = hexdigit(sha256.bytes[i] & 0xF);
|
1510 | 1510 | }
|
1511 | 1511 | strcpy(buffer, "; Do not change the following value!\r\n");
|
1512 | | - WriteFile(file, buffer, strlen(buffer), &bytesread, NULL);
|
| 1512 | + WriteFile(file, buffer, (DWORD)strlen(buffer), &bytesread, NULL);
|
1513 | 1513 | INIWriteString(file, "BundledDDrawSHA256", sha256string, 1, INISECTION_SYSTEM);
|
1514 | 1514 | }
|
1515 | 1515 | else MessageBox(hWnd, _T("Cannot read ddraw.dll, skipping SHA-256 checksum"),
|
— | — | @@ -1603,7 +1603,7 @@ |
1604 | 1604 | TCHAR sha256string[65];
|
1605 | 1605 | TCHAR filename[MAX_PATH+1];
|
1606 | 1606 | TCHAR regkey[MAX_PATH + 80];
|
1607 | | - int i;
|
| 1607 | + size_t i;
|
1608 | 1608 | BOOL DPIAwarePM = FALSE;
|
1609 | 1609 | HMODULE hSHCore = NULL;
|
1610 | 1610 | HMODULE hUser32 = NULL;
|
— | — | @@ -1621,7 +1621,7 @@ |
1622 | 1622 | filename[i] = 0;
|
1623 | 1623 | _tcslwr(filename);
|
1624 | 1624 | Sha256Initialise(&sha_context);
|
1625 | | - Sha256Update(&sha_context, filename, _tcslen(filename));
|
| 1625 | + Sha256Update(&sha_context, filename, (uint32_t)_tcslen(filename));
|
1626 | 1626 | Sha256Finalise(&sha_context, &sha256);
|
1627 | 1627 | for (i = 0; i < (256 / 8); i++)
|
1628 | 1628 | {
|
— | — | @@ -1873,7 +1873,7 @@ |
1874 | 1874 | {
|
1875 | 1875 | _tcslwr(installpath);
|
1876 | 1876 | Sha256Initialise(&sha_context);
|
1877 | | - Sha256Update(&sha_context, installpath, _tcslen(installpath));
|
| 1877 | + Sha256Update(&sha_context, installpath, (uint32_t)_tcslen(installpath));
|
1878 | 1878 | Sha256Finalise(&sha_context, &sha256);
|
1879 | 1879 | for (i = 0; i < (256 / 8); i++)
|
1880 | 1880 | {
|
— | — | @@ -2150,7 +2150,7 @@ |
2151 | 2151 | }
|
2152 | 2152 | else oldkeys[oldconfigcount].exe_found = TRUE;
|
2153 | 2153 | Sha256Initialise(&sha_context);
|
2154 | | - Sha256Update(&sha_context, oldkeys[oldconfigcount].InstallPathLowercase, length);
|
| 2154 | + Sha256Update(&sha_context, oldkeys[oldconfigcount].InstallPathLowercase, (uint32_t)length);
|
2155 | 2155 | Sha256Finalise(&sha_context, &oldkeys[oldconfigcount].PathHash);
|
2156 | 2156 | for (i = 0; i < (256 / 8); i++)
|
2157 | 2157 | {
|
— | — | @@ -2229,7 +2229,7 @@ |
2230 | 2230 | numvalue++;
|
2231 | 2231 | } while (error == ERROR_SUCCESS);
|
2232 | 2232 | RegSetValueEx(hKeyDest, _T("InstallPath"), 0, REG_SZ, (BYTE*)oldkeys[i].InstallPath,
|
2233 | | - ((_tcslen(oldkeys[i].InstallPath) + 1) * sizeof(TCHAR)));
|
| 2233 | + (DWORD)((_tcslen(oldkeys[i].InstallPath) + 1) * sizeof(TCHAR)));
|
2234 | 2234 | RegCloseKey(hKeyDest);
|
2235 | 2235 | }
|
2236 | 2236 | RegCloseKey(hKeyProfile);
|
Index: dxglcfg/dxglcfg.cpp |
— | — | @@ -632,7 +632,7 @@ |
633 | 633 | *minor = 0;
|
634 | 634 | if (tristate)
|
635 | 635 | {
|
636 | | - position = SendDlgItemMessage(hWnd, DlgItem, CB_FINDSTRING, -1, (LPARAM)strdefault);
|
| 636 | + position = (int)SendDlgItemMessage(hWnd, DlgItem, CB_FINDSTRING, -1, (LPARAM)strdefault);
|
637 | 637 | *majormask = 0;
|
638 | 638 | *minormask = 0;
|
639 | 639 | }
|
— | — | @@ -762,7 +762,7 @@ |
763 | 763 |
|
764 | 764 | BOOL GetCheck(HWND hWnd, int DlgItem, BOOL *mask)
|
765 | 765 | {
|
766 | | - int check = SendDlgItemMessage(hWnd,DlgItem,BM_GETCHECK,0,0);
|
| 766 | + int check = (int)SendDlgItemMessage(hWnd,DlgItem,BM_GETCHECK,0,0);
|
767 | 767 | switch(check)
|
768 | 768 | {
|
769 | 769 | case BST_CHECKED:
|
— | — | @@ -780,7 +780,7 @@ |
781 | 781 |
|
782 | 782 | DWORD GetCombo(HWND hWnd, int DlgItem, DWORD *mask)
|
783 | 783 | {
|
784 | | - int value = SendDlgItemMessage(hWnd,DlgItem,CB_GETCURSEL,0,0);
|
| 784 | + int value = (int)SendDlgItemMessage(hWnd,DlgItem,CB_GETCURSEL,0,0);
|
785 | 785 | if(value == SendDlgItemMessage(hWnd,DlgItem,CB_FINDSTRING,-1,(LPARAM)strdefault))
|
786 | 786 | {
|
787 | 787 | *mask = 0;
|
— | — | @@ -795,7 +795,7 @@ |
796 | 796 |
|
797 | 797 | void GetGLCombo(HWND hWnd, int DlgItem, DWORD *major, DWORD *minor, DWORD *majormask, DWORD *minormask)
|
798 | 798 | {
|
799 | | - int value = SendDlgItemMessage(hWnd, DlgItem, CB_GETCURSEL, 0, 0);
|
| 799 | + int value = (int)SendDlgItemMessage(hWnd, DlgItem, CB_GETCURSEL, 0, 0);
|
800 | 800 | if (value == SendDlgItemMessage(hWnd, DlgItem, CB_FINDSTRING, -1, (LPARAM)strdefault))
|
801 | 801 | {
|
802 | 802 | *majormask = 0;
|
— | — | @@ -946,10 +946,10 @@ |
947 | 947 | void ProcessResolutionString(LPTSTR input)
|
948 | 948 | {
|
949 | 949 | TCHAR buffer[32];
|
950 | | - int ptr;
|
| 950 | + size_t ptr;
|
951 | 951 | int number[3];
|
952 | | - int length;
|
953 | | - int i;
|
| 952 | + size_t length;
|
| 953 | + size_t i;
|
954 | 954 | BOOL found = FALSE;
|
955 | 955 | BOOL skip = FALSE;
|
956 | 956 | length = _tcslen(input);
|
— | — | @@ -1172,7 +1172,7 @@ |
1173 | 1173 | {
|
1174 | 1174 | GetDlgItemText(hWnd,DlgItem,str,MAX_PATH+1);
|
1175 | 1175 | if(str[0] == 0) mask[0] = 0;
|
1176 | | - else mask[0] = 0xff;
|
| 1176 | + else mask[0] = (TCHAR)0xff;
|
1177 | 1177 | }
|
1178 | 1178 |
|
1179 | 1179 | void DrawCheck(HDC hdc, BOOL selected, BOOL checked, BOOL grayed, BOOL tristate, RECT *r)
|
— | — | @@ -1480,7 +1480,7 @@ |
1481 | 1481 | if(!cfgmask->AddColorDepths) _tcscpy(combotext, strdefault);
|
1482 | 1482 | else _tcscpy(combotext, colormodes[cfg->AddColorDepths & 31]);
|
1483 | 1483 | }
|
1484 | | - DrawText(drawitem->hDC, combotext, _tcslen(combotext), &drawitem->rcItem,
|
| 1484 | + DrawText(drawitem->hDC, combotext, (int)_tcslen(combotext), &drawitem->rcItem,
|
1485 | 1485 | DT_LEFT | DT_SINGLELINE | DT_VCENTER);
|
1486 | 1486 | SetTextColor(drawitem->hDC, OldTextColor);
|
1487 | 1487 | SetBkColor(drawitem->hDC, OldBackColor);
|
— | — | @@ -1560,7 +1560,7 @@ |
1561 | 1561 | }
|
1562 | 1562 | }
|
1563 | 1563 | }
|
1564 | | - DrawText(drawitem->hDC, combotext, _tcslen(combotext), &drawitem->rcItem,
|
| 1564 | + DrawText(drawitem->hDC, combotext, (int)_tcslen(combotext), &drawitem->rcItem,
|
1565 | 1565 | DT_LEFT | DT_SINGLELINE | DT_VCENTER);
|
1566 | 1566 | SetTextColor(drawitem->hDC, OldTextColor);
|
1567 | 1567 | SetBkColor(drawitem->hDC, OldBackColor);
|
— | — | @@ -1588,7 +1588,7 @@ |
1589 | 1589 | {
|
1590 | 1590 | if (ColorDepth_Dropdown)
|
1591 | 1591 | {
|
1592 | | - cursel = SendDlgItemMessage(hWnd, IDC_COLORDEPTH, CB_GETCURSEL, 0, 0);
|
| 1592 | + cursel = (DWORD)SendDlgItemMessage(hWnd, IDC_COLORDEPTH, CB_GETCURSEL, 0, 0);
|
1593 | 1593 | if (cursel == 5)
|
1594 | 1594 | {
|
1595 | 1595 | if (cfgmask->AddColorDepths) cfgmask->AddColorDepths = 0;
|
— | — | @@ -1620,7 +1620,7 @@ |
1621 | 1621 | {
|
1622 | 1622 | if (ExtraModes_Dropdown)
|
1623 | 1623 | {
|
1624 | | - cursel = SendDlgItemMessage(hWnd, IDC_EXTRAMODES, CB_GETCURSEL, 0, 0);
|
| 1624 | + cursel = (DWORD)SendDlgItemMessage(hWnd, IDC_EXTRAMODES, CB_GETCURSEL, 0, 0);
|
1625 | 1625 | if (cursel == 8)
|
1626 | 1626 | {
|
1627 | 1627 | if (cfgmask->AddModes) cfgmask->AddModes = 0;
|
— | — | @@ -2028,7 +2028,8 @@ |
2029 | 2029 | else if (error != ERROR_SUCCESS)
|
2030 | 2030 | {
|
2031 | 2031 | _tcscpy(errormsg, _T("Error writing .ini file:\r\n"));
|
2032 | | - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error, 0, errormsg + _tcslen(errormsg), 2048 - _tcslen(errormsg), NULL);
|
| 2032 | + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error, 0, errormsg + _tcslen(errormsg),
|
| 2033 | + (DWORD)(2048 - _tcslen(errormsg)), NULL);
|
2033 | 2034 | MessageBox(hWnd, errormsg, _T("Error"), MB_OK | MB_ICONERROR);
|
2034 | 2035 | }
|
2035 | 2036 | else
|
— | — | @@ -2329,7 +2330,7 @@ |
2330 | 2331 | case IDC_DEBUGLIST:
|
2331 | 2332 | if ((HIWORD(wParam) == LBN_SELCHANGE) || (HIWORD(wParam) == LBN_DBLCLK))
|
2332 | 2333 | {
|
2333 | | - item = SendDlgItemMessage(hWnd, IDC_DEBUGLIST, LB_GETCURSEL, 0, 0);
|
| 2334 | + item = (DWORD)SendDlgItemMessage(hWnd, IDC_DEBUGLIST, LB_GETCURSEL, 0, 0);
|
2334 | 2335 | ReadDebugItem(item, &debugvalue, &debugmask);
|
2335 | 2336 | if (tristate)
|
2336 | 2337 | {
|
— | — | @@ -2396,7 +2397,7 @@ |
2397 | 2398 | DrawCheck(drawitem->hDC, drawitem->itemState & ODS_SELECTED, debugvalue, FALSE, !debugmask, &r);
|
2398 | 2399 | drawitem->rcItem.left += GetSystemMetrics(SM_CXSMICON)+5;
|
2399 | 2400 | SendDlgItemMessage(hWnd, IDC_DEBUGLIST, LB_GETTEXT, drawitem->itemID, (LPARAM)str);
|
2400 | | - DrawText(drawitem->hDC, str, _tcslen(str), &drawitem->rcItem,
|
| 2401 | + DrawText(drawitem->hDC, str, (int)_tcslen(str), &drawitem->rcItem,
|
2401 | 2402 | DT_LEFT | DT_SINGLELINE | DT_VCENTER);
|
2402 | 2403 | drawitem->rcItem.left -= GetSystemMetrics(SM_CXSMICON)+5;
|
2403 | 2404 | if (drawitem->itemState & ODS_FOCUS) DrawFocusRect(drawitem->hDC, &drawitem->rcItem);
|
— | — | @@ -2570,7 +2571,7 @@ |
2571 | 2572 | default:
|
2572 | 2573 | str = strUnknown;
|
2573 | 2574 | }
|
2574 | | - DrawText(hdc, str, _tcslen(str), r, DT_LEFT | DT_SINGLELINE | DT_VCENTER);
|
| 2575 | + DrawText(hdc, str, (int)_tcslen(str), r, DT_LEFT | DT_SINGLELINE | DT_VCENTER);
|
2575 | 2576 | }
|
2576 | 2577 |
|
2577 | 2578 | LRESULT CALLBACK HacksTabCallback(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
— | — | @@ -2688,7 +2689,7 @@ |
2689 | 2690 | case IDC_HACKSLIST:
|
2690 | 2691 | if ((HIWORD(wParam) == LBN_SELCHANGE) || (HIWORD(wParam) == LBN_DBLCLK))
|
2691 | 2692 | {
|
2692 | | - hackstabitem = SendDlgItemMessage(hWnd, IDC_HACKSLIST, LB_GETCURSEL, 0, 0);
|
| 2693 | + hackstabitem = (DWORD)SendDlgItemMessage(hWnd, IDC_HACKSLIST, LB_GETCURSEL, 0, 0);
|
2693 | 2694 | SendDlgItemMessage(hWnd, IDC_HACKSLIST, LB_GETITEMRECT, hackstabitem, (LPARAM)&r2);
|
2694 | 2695 | if ((hackstabitem == 3) || (hackstabitem == 6))
|
2695 | 2696 | {
|
— | — | @@ -2740,7 +2741,7 @@ |
2741 | 2742 | r.right = r.left + GetSystemMetrics(SM_CXMENUCHECK);
|
2742 | 2743 | drawitem->rcItem.left += 1;
|
2743 | 2744 | SendDlgItemMessage(hWnd, IDC_HACKSLIST, LB_GETTEXT, drawitem->itemID, (LPARAM)str);
|
2744 | | - DrawText(drawitem->hDC, str, _tcslen(str), &drawitem->rcItem,
|
| 2745 | + DrawText(drawitem->hDC, str, (int)_tcslen(str), &drawitem->rcItem,
|
2745 | 2746 | DT_LEFT | DT_SINGLELINE | DT_VCENTER);
|
2746 | 2747 | drawitem->rcItem.left -= 1;
|
2747 | 2748 | if ((hackstabitem == 3) || (hackstabitem == 6))
|
— | — | @@ -3896,7 +3897,7 @@ |
3897 | 3898 | break;
|
3898 | 3899 | }
|
3899 | 3900 | // Get exe attributes
|
3900 | | - error = SHGetFileInfo(path, 0, &fileinfo, sizeof(SHFILEINFO), SHGFI_ICON | SHGFI_SMALLICON | SHGFI_ADDOVERLAYS);
|
| 3901 | + error = (LONG)SHGetFileInfo(path, 0, &fileinfo, sizeof(SHFILEINFO), SHGFI_ICON | SHGFI_SMALLICON | SHGFI_ADDOVERLAYS);
|
3901 | 3902 | apps[appcount - 1].icon = fileinfo.hIcon;
|
3902 | 3903 | apps[appcount - 1].icon_shared = FALSE;
|
3903 | 3904 | verinfosize = GetFileVersionInfoSize(path, NULL);
|
— | — | @@ -3994,7 +3995,7 @@ |
3995 | 3996 | nm = (LPNMHDR)lParam;
|
3996 | 3997 | if (nm->code == TCN_SELCHANGE)
|
3997 | 3998 | {
|
3998 | | - newtab = SendDlgItemMessage(hWnd, IDC_TABS, TCM_GETCURSEL, 0, 0);
|
| 3999 | + newtab = (int)SendDlgItemMessage(hWnd, IDC_TABS, TCM_GETCURSEL, 0, 0);
|
3999 | 4000 | if (newtab != tabopen)
|
4000 | 4001 | {
|
4001 | 4002 | ShowWindow(hTabs[tabopen], SW_HIDE);
|
— | — | @@ -4027,7 +4028,7 @@ |
4028 | 4029 | apps[drawitem->itemID].icon,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0,NULL,DI_NORMAL);
|
4029 | 4030 | drawitem->rcItem.left += GetSystemMetrics(SM_CXSMICON)+5;
|
4030 | 4031 | DrawText(drawitem->hDC,apps[drawitem->itemID].name,
|
4031 | | - _tcslen(apps[drawitem->itemID].name),&drawitem->rcItem,
|
| 4032 | + (int)_tcslen(apps[drawitem->itemID].name),&drawitem->rcItem,
|
4032 | 4033 | DT_LEFT|DT_SINGLELINE|DT_VCENTER);
|
4033 | 4034 | drawitem->rcItem.left -= GetSystemMetrics(SM_CXSMICON)+5;
|
4034 | 4035 | if (drawitem->itemState & ODS_FOCUS) DrawFocusRect(drawitem->hDC, &drawitem->rcItem);
|
— | — | @@ -4067,7 +4068,7 @@ |
4068 | 4069 | case IDC_APPS:
|
4069 | 4070 | if(HIWORD(wParam) == CBN_SELCHANGE)
|
4070 | 4071 | {
|
4071 | | - cursel = SendDlgItemMessage(hWnd,IDC_APPS,CB_GETCURSEL,0,0);
|
| 4072 | + cursel = (DWORD)SendDlgItemMessage(hWnd,IDC_APPS,CB_GETCURSEL,0,0);
|
4072 | 4073 | if(cursel == current_app) break;
|
4073 | 4074 | current_app = cursel;
|
4074 | 4075 | cfg = &apps[current_app].cfg;
|
— | — | @@ -4145,7 +4146,7 @@ |
4146 | 4147 | else
|
4147 | 4148 | {
|
4148 | 4149 | // Get exe attributes
|
4149 | | - error = SHGetFileInfo(path, 0, &fileinfo, sizeof(SHFILEINFO), SHGFI_ICON | SHGFI_SMALLICON | SHGFI_ADDOVERLAYS);
|
| 4150 | + error = (LONG)SHGetFileInfo(path, 0, &fileinfo, sizeof(SHFILEINFO), SHGFI_ICON | SHGFI_SMALLICON | SHGFI_ADDOVERLAYS);
|
4150 | 4151 | apps[appcount - 1].icon = fileinfo.hIcon;
|
4151 | 4152 | apps[appcount - 1].icon_shared = FALSE;
|
4152 | 4153 | verinfosize = GetFileVersionInfoSize(path, NULL);
|