diff --git a/drivers/network/tcpip/CMakeLists.txt b/drivers/network/tcpip/CMakeLists.txt index ce3712ddb0e..13c0ee43020 100644 --- a/drivers/network/tcpip/CMakeLists.txt +++ b/drivers/network/tcpip/CMakeLists.txt @@ -6,6 +6,12 @@ set(LWIP_INCLUDE_DIRS ) include(${LWIP_DIR}/src/Filelists.cmake) add_dependencies(lwipcore xdk) + +if(MSVC AND ARCH STREQUAL "amd64") + # lwip is 3rd party code - suppress C4267 warnings + target_compile_options(lwipcore PRIVATE "/wd4267") +endif() + add_subdirectory(ip) add_definitions( diff --git a/win32ss/printing/base/winspool/printerdata.c b/win32ss/printing/base/winspool/printerdata.c index c113cf4c840..a5b93166f61 100644 --- a/win32ss/printing/base/winspool/printerdata.c +++ b/win32ss/printing/base/winspool/printerdata.c @@ -347,7 +347,7 @@ GetPrinterDataExA(HANDLE hPrinter, LPCSTR pKeyName, LPCSTR pValueName, LPDWORD p if (pKeyName) { // Convert pKeyName to a Unicode string pwszKeyName - cch = strlen(pKeyName); + cch = (DWORD)strlen(pKeyName); pwszKeyName = HeapAlloc(hProcessHeap, 0, (cch + 1) * sizeof(WCHAR)); if (!pwszKeyName) @@ -363,7 +363,7 @@ GetPrinterDataExA(HANDLE hPrinter, LPCSTR pKeyName, LPCSTR pValueName, LPDWORD p if (pValueName) { // Convert pValueName to a Unicode string pwszValueName - cch = strlen(pValueName); + cch = (DWORD)strlen(pValueName); pwszValueName = HeapAlloc(hProcessHeap, 0, (cch + 1) * sizeof(WCHAR)); if (!pwszValueName) @@ -561,7 +561,7 @@ SetPrinterDataExA(HANDLE hPrinter, LPCSTR pKeyName, LPCSTR pValueName, DWORD Typ if (pKeyName) { // Convert pKeyName to a Unicode string pwszKeyName - cch = strlen(pKeyName); + cch = (DWORD)strlen(pKeyName); pwszKeyName = HeapAlloc(hProcessHeap, 0, (cch + 1) * sizeof(WCHAR)); if (!pwszKeyName) @@ -577,7 +577,7 @@ SetPrinterDataExA(HANDLE hPrinter, LPCSTR pKeyName, LPCSTR pValueName, DWORD Typ if (pValueName) { // Convert pValueName to a Unicode string pwszValueName - cch = strlen(pValueName); + cch = (DWORD)strlen(pValueName); pwszValueName = HeapAlloc(hProcessHeap, 0, (cch + 1) * sizeof(WCHAR)); if (!pwszValueName) diff --git a/win32ss/printing/monitors/localmon/ports.c b/win32ss/printing/monitors/localmon/ports.c index 47ebc61cf37..3b1909a2a07 100644 --- a/win32ss/printing/monitors/localmon/ports.c +++ b/win32ss/printing/monitors/localmon/ports.c @@ -45,7 +45,7 @@ _GetNonspooledPortName(PCWSTR pwszPortNameWithoutColon, PWSTR* ppwszNonspooledPo { DWORD cchPortNameWithoutColon; - cchPortNameWithoutColon = wcslen(pwszPortNameWithoutColon); + cchPortNameWithoutColon = (DWORD)wcslen(pwszPortNameWithoutColon); *ppwszNonspooledPortName = DllAllocSplMem((cchNonspooledPrefix + cchPortNameWithoutColon + 1) * sizeof(WCHAR)); if (!*ppwszNonspooledPortName) @@ -192,7 +192,7 @@ _CreateNonspooledPort(PLOCALMON_PORT pPort) goto Cleanup; } - cchPortNameWithoutColon = wcslen(pwszPortNameWithoutColon); + cchPortNameWithoutColon = (DWORD)wcslen(pwszPortNameWithoutColon); // The spooler has usually remapped the legacy port to a named pipe of the format in wszSpoolerNamedPipe. // Construct the device name of this pipe. diff --git a/win32ss/printing/monitors/localmon/tools.c b/win32ss/printing/monitors/localmon/tools.c index e4c15e81125..f430b4dd3bd 100644 --- a/win32ss/printing/monitors/localmon/tools.c +++ b/win32ss/printing/monitors/localmon/tools.c @@ -144,7 +144,7 @@ GetPortNameWithoutColon(PCWSTR pwszPortName, PWSTR* ppwszPortNameWithoutColon) DWORD cchPortNameWithoutColon; // Compute the string length of pwszPortNameWithoutColon. - cchPortNameWithoutColon = wcslen(pwszPortName) - 1; + cchPortNameWithoutColon = (DWORD)wcslen(pwszPortName) - 1; // Check if pwszPortName really has a colon as the last character. if (pwszPortName[cchPortNameWithoutColon] != L':') diff --git a/win32ss/printing/providers/localspl/jobs.c b/win32ss/printing/providers/localspl/jobs.c index 99e326ab815..630dbd41a0c 100644 --- a/win32ss/printing/providers/localspl/jobs.c +++ b/win32ss/printing/providers/localspl/jobs.c @@ -330,7 +330,7 @@ CreateJob(PLOCAL_PRINTER_HANDLE pPrinterHandle) goto Cleanup; } - cchMachineName = wcslen(pwszMachineName); + cchMachineName = (DWORD)wcslen(pwszMachineName); pJob->pwszMachineName = DllAllocSplMem((cchMachineName + cchDoubleBackslash + 1) * sizeof(WCHAR)); CopyMemory(pJob->pwszMachineName, wszDoubleBackslash, cchDoubleBackslash * sizeof(WCHAR)); CopyMemory(&pJob->pwszMachineName[cchDoubleBackslash], pwszMachineName, (cchMachineName + 1) * sizeof(WCHAR)); diff --git a/win32ss/printing/providers/localspl/printers.c b/win32ss/printing/providers/localspl/printers.c index f323599e3b0..04bf6f26599 100644 --- a/win32ss/printing/providers/localspl/printers.c +++ b/win32ss/printing/providers/localspl/printers.c @@ -1465,7 +1465,7 @@ LocalOpenPrinter(PWSTR lpPrinterName, HANDLE* phPrinter, PPRINTER_DEFAULTSW pDef if (pwszSecondParameter) cchFirstParameter = pwszSecondParameter - p; else - cchFirstParameter = wcslen(lpPrinterName); + cchFirstParameter = (DWORD)wcslen(lpPrinterName); // We must have at least one parameter. if (!cchFirstParameter && !pwszSecondParameter) diff --git a/win32ss/printing/providers/localspl/printingthread.c b/win32ss/printing/providers/localspl/printingthread.c index b29534b519d..b351aa73512 100644 --- a/win32ss/printing/providers/localspl/printingthread.c +++ b/win32ss/printing/providers/localspl/printingthread.c @@ -29,7 +29,7 @@ PrintingThreadProc(PLOCAL_JOB pJob) // Prepare the pPrinterName parameter. // This is the string for LocalOpenPrinter to open a port (e.g. "LPT1:, Port"). - cchPortName = wcslen(pJob->pPrinter->pPort->pwszName); + cchPortName = (DWORD)wcslen(pJob->pPrinter->pPort->pwszName); pwszPrinterPort = DllAllocSplMem(cchPortName * sizeof(WCHAR) + sizeof(wszPortAppendix)); if (!pwszPrinterPort) { diff --git a/win32ss/printing/providers/localspl/printprocessors.c b/win32ss/printing/providers/localspl/printprocessors.c index 3540b560e06..b36b8c5c657 100644 --- a/win32ss/printing/providers/localspl/printprocessors.c +++ b/win32ss/printing/providers/localspl/printprocessors.c @@ -44,7 +44,7 @@ _OpenEnvironment(PCWSTR pEnvironment, PHKEY hKey) } // Construct the registry key of the demanded environment. - cchEnvironment = wcslen(pEnvironment); + cchEnvironment = (DWORD)wcslen(pEnvironment); pwszEnvironmentKey = DllAllocSplMem((cchEnvironmentsKey + cchEnvironment + 1) * sizeof(WCHAR)); if (!pwszEnvironmentKey) {