mirror of
https://github.com/reactos/reactos
synced 2025-10-06 00:12:51 +02:00
Fix C4267 warnings in printing subsystem and add lwip suppression
Co-authored-by: tkreuzer <313067+tkreuzer@users.noreply.github.com>
This commit is contained in:
@@ -6,6 +6,12 @@ set(LWIP_INCLUDE_DIRS
|
|||||||
)
|
)
|
||||||
include(${LWIP_DIR}/src/Filelists.cmake)
|
include(${LWIP_DIR}/src/Filelists.cmake)
|
||||||
add_dependencies(lwipcore xdk)
|
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_subdirectory(ip)
|
||||||
|
|
||||||
add_definitions(
|
add_definitions(
|
||||||
|
@@ -347,7 +347,7 @@ GetPrinterDataExA(HANDLE hPrinter, LPCSTR pKeyName, LPCSTR pValueName, LPDWORD p
|
|||||||
if (pKeyName)
|
if (pKeyName)
|
||||||
{
|
{
|
||||||
// Convert pKeyName to a Unicode string pwszKeyName
|
// Convert pKeyName to a Unicode string pwszKeyName
|
||||||
cch = strlen(pKeyName);
|
cch = (DWORD)strlen(pKeyName);
|
||||||
|
|
||||||
pwszKeyName = HeapAlloc(hProcessHeap, 0, (cch + 1) * sizeof(WCHAR));
|
pwszKeyName = HeapAlloc(hProcessHeap, 0, (cch + 1) * sizeof(WCHAR));
|
||||||
if (!pwszKeyName)
|
if (!pwszKeyName)
|
||||||
@@ -363,7 +363,7 @@ GetPrinterDataExA(HANDLE hPrinter, LPCSTR pKeyName, LPCSTR pValueName, LPDWORD p
|
|||||||
if (pValueName)
|
if (pValueName)
|
||||||
{
|
{
|
||||||
// Convert pValueName to a Unicode string pwszValueName
|
// Convert pValueName to a Unicode string pwszValueName
|
||||||
cch = strlen(pValueName);
|
cch = (DWORD)strlen(pValueName);
|
||||||
|
|
||||||
pwszValueName = HeapAlloc(hProcessHeap, 0, (cch + 1) * sizeof(WCHAR));
|
pwszValueName = HeapAlloc(hProcessHeap, 0, (cch + 1) * sizeof(WCHAR));
|
||||||
if (!pwszValueName)
|
if (!pwszValueName)
|
||||||
@@ -561,7 +561,7 @@ SetPrinterDataExA(HANDLE hPrinter, LPCSTR pKeyName, LPCSTR pValueName, DWORD Typ
|
|||||||
if (pKeyName)
|
if (pKeyName)
|
||||||
{
|
{
|
||||||
// Convert pKeyName to a Unicode string pwszKeyName
|
// Convert pKeyName to a Unicode string pwszKeyName
|
||||||
cch = strlen(pKeyName);
|
cch = (DWORD)strlen(pKeyName);
|
||||||
|
|
||||||
pwszKeyName = HeapAlloc(hProcessHeap, 0, (cch + 1) * sizeof(WCHAR));
|
pwszKeyName = HeapAlloc(hProcessHeap, 0, (cch + 1) * sizeof(WCHAR));
|
||||||
if (!pwszKeyName)
|
if (!pwszKeyName)
|
||||||
@@ -577,7 +577,7 @@ SetPrinterDataExA(HANDLE hPrinter, LPCSTR pKeyName, LPCSTR pValueName, DWORD Typ
|
|||||||
if (pValueName)
|
if (pValueName)
|
||||||
{
|
{
|
||||||
// Convert pValueName to a Unicode string pwszValueName
|
// Convert pValueName to a Unicode string pwszValueName
|
||||||
cch = strlen(pValueName);
|
cch = (DWORD)strlen(pValueName);
|
||||||
|
|
||||||
pwszValueName = HeapAlloc(hProcessHeap, 0, (cch + 1) * sizeof(WCHAR));
|
pwszValueName = HeapAlloc(hProcessHeap, 0, (cch + 1) * sizeof(WCHAR));
|
||||||
if (!pwszValueName)
|
if (!pwszValueName)
|
||||||
|
@@ -45,7 +45,7 @@ _GetNonspooledPortName(PCWSTR pwszPortNameWithoutColon, PWSTR* ppwszNonspooledPo
|
|||||||
{
|
{
|
||||||
DWORD cchPortNameWithoutColon;
|
DWORD cchPortNameWithoutColon;
|
||||||
|
|
||||||
cchPortNameWithoutColon = wcslen(pwszPortNameWithoutColon);
|
cchPortNameWithoutColon = (DWORD)wcslen(pwszPortNameWithoutColon);
|
||||||
|
|
||||||
*ppwszNonspooledPortName = DllAllocSplMem((cchNonspooledPrefix + cchPortNameWithoutColon + 1) * sizeof(WCHAR));
|
*ppwszNonspooledPortName = DllAllocSplMem((cchNonspooledPrefix + cchPortNameWithoutColon + 1) * sizeof(WCHAR));
|
||||||
if (!*ppwszNonspooledPortName)
|
if (!*ppwszNonspooledPortName)
|
||||||
@@ -192,7 +192,7 @@ _CreateNonspooledPort(PLOCALMON_PORT pPort)
|
|||||||
goto Cleanup;
|
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.
|
// The spooler has usually remapped the legacy port to a named pipe of the format in wszSpoolerNamedPipe.
|
||||||
// Construct the device name of this pipe.
|
// Construct the device name of this pipe.
|
||||||
|
@@ -144,7 +144,7 @@ GetPortNameWithoutColon(PCWSTR pwszPortName, PWSTR* ppwszPortNameWithoutColon)
|
|||||||
DWORD cchPortNameWithoutColon;
|
DWORD cchPortNameWithoutColon;
|
||||||
|
|
||||||
// Compute the string length of pwszPortNameWithoutColon.
|
// 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.
|
// Check if pwszPortName really has a colon as the last character.
|
||||||
if (pwszPortName[cchPortNameWithoutColon] != L':')
|
if (pwszPortName[cchPortNameWithoutColon] != L':')
|
||||||
|
@@ -330,7 +330,7 @@ CreateJob(PLOCAL_PRINTER_HANDLE pPrinterHandle)
|
|||||||
goto Cleanup;
|
goto Cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
cchMachineName = wcslen(pwszMachineName);
|
cchMachineName = (DWORD)wcslen(pwszMachineName);
|
||||||
pJob->pwszMachineName = DllAllocSplMem((cchMachineName + cchDoubleBackslash + 1) * sizeof(WCHAR));
|
pJob->pwszMachineName = DllAllocSplMem((cchMachineName + cchDoubleBackslash + 1) * sizeof(WCHAR));
|
||||||
CopyMemory(pJob->pwszMachineName, wszDoubleBackslash, cchDoubleBackslash * sizeof(WCHAR));
|
CopyMemory(pJob->pwszMachineName, wszDoubleBackslash, cchDoubleBackslash * sizeof(WCHAR));
|
||||||
CopyMemory(&pJob->pwszMachineName[cchDoubleBackslash], pwszMachineName, (cchMachineName + 1) * sizeof(WCHAR));
|
CopyMemory(&pJob->pwszMachineName[cchDoubleBackslash], pwszMachineName, (cchMachineName + 1) * sizeof(WCHAR));
|
||||||
|
@@ -1465,7 +1465,7 @@ LocalOpenPrinter(PWSTR lpPrinterName, HANDLE* phPrinter, PPRINTER_DEFAULTSW pDef
|
|||||||
if (pwszSecondParameter)
|
if (pwszSecondParameter)
|
||||||
cchFirstParameter = pwszSecondParameter - p;
|
cchFirstParameter = pwszSecondParameter - p;
|
||||||
else
|
else
|
||||||
cchFirstParameter = wcslen(lpPrinterName);
|
cchFirstParameter = (DWORD)wcslen(lpPrinterName);
|
||||||
|
|
||||||
// We must have at least one parameter.
|
// We must have at least one parameter.
|
||||||
if (!cchFirstParameter && !pwszSecondParameter)
|
if (!cchFirstParameter && !pwszSecondParameter)
|
||||||
|
@@ -29,7 +29,7 @@ PrintingThreadProc(PLOCAL_JOB pJob)
|
|||||||
|
|
||||||
// Prepare the pPrinterName parameter.
|
// Prepare the pPrinterName parameter.
|
||||||
// This is the string for LocalOpenPrinter to open a port (e.g. "LPT1:, Port").
|
// 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));
|
pwszPrinterPort = DllAllocSplMem(cchPortName * sizeof(WCHAR) + sizeof(wszPortAppendix));
|
||||||
if (!pwszPrinterPort)
|
if (!pwszPrinterPort)
|
||||||
{
|
{
|
||||||
|
@@ -44,7 +44,7 @@ _OpenEnvironment(PCWSTR pEnvironment, PHKEY hKey)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Construct the registry key of the demanded environment.
|
// Construct the registry key of the demanded environment.
|
||||||
cchEnvironment = wcslen(pEnvironment);
|
cchEnvironment = (DWORD)wcslen(pEnvironment);
|
||||||
pwszEnvironmentKey = DllAllocSplMem((cchEnvironmentsKey + cchEnvironment + 1) * sizeof(WCHAR));
|
pwszEnvironmentKey = DllAllocSplMem((cchEnvironmentsKey + cchEnvironment + 1) * sizeof(WCHAR));
|
||||||
if (!pwszEnvironmentKey)
|
if (!pwszEnvironmentKey)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user