diff --git a/base/ctf/msctf/CMakeLists.txt b/base/ctf/msctf/CMakeLists.txt index 5c6f3b8b089..6a141d9d912 100644 --- a/base/ctf/msctf/CMakeLists.txt +++ b/base/ctf/msctf/CMakeLists.txt @@ -28,6 +28,11 @@ add_library(msctf MODULE version.rc ${CMAKE_CURRENT_BINARY_DIR}/msctf.def) +if(MSVC) + # Disable C5286: implicit conversion from enum type 'x' to enum type 'y'; + target_compile_options(msctf PRIVATE /wd5286) +endif() + set_module_type(msctf win32dll UNICODE) target_link_libraries(msctf uuid wine cicero) add_importlibs(msctf user32 advapi32 advapi32_vista msvcrt kernel32 ntdll) diff --git a/dll/directx/wine/d3d8/CMakeLists.txt b/dll/directx/wine/d3d8/CMakeLists.txt index 23733120067..7eb93971ec9 100644 --- a/dll/directx/wine/d3d8/CMakeLists.txt +++ b/dll/directx/wine/d3d8/CMakeLists.txt @@ -26,6 +26,11 @@ add_library(d3d8 MODULE version.rc ${CMAKE_CURRENT_BINARY_DIR}/d3d8.def) +if(MSVC) + # Disable C5286: implicit conversion from enum type 'x' to enum type 'y'; + target_compile_options(d3d8 PRIVATE /wd5286) +endif() + set_module_type(d3d8 win32dll UNICODE) target_link_libraries(d3d8 uuid wine) add_importlibs(d3d8 d3dwine msvcrt kernel32 ntdll) diff --git a/dll/directx/wine/d3d9/CMakeLists.txt b/dll/directx/wine/d3d9/CMakeLists.txt index e4f063ad1f9..4813118e1d0 100644 --- a/dll/directx/wine/d3d9/CMakeLists.txt +++ b/dll/directx/wine/d3d9/CMakeLists.txt @@ -28,6 +28,11 @@ add_library(d3d9 MODULE ${CMAKE_CURRENT_BINARY_DIR}/d3d9_stubs.c ${CMAKE_CURRENT_BINARY_DIR}/d3d9.def) +if(MSVC) + # Disable C5286: implicit conversion from enum type 'x' to enum type 'y'; + target_compile_options(d3d9 PRIVATE /wd5286) +endif() + set_module_type(d3d9 win32dll UNICODE) target_link_libraries(d3d9 wine) add_importlibs(d3d9 d3dwine user32 msvcrt kernel32 ntdll) diff --git a/dll/directx/wine/ddraw/CMakeLists.txt b/dll/directx/wine/ddraw/CMakeLists.txt index 073e35c43db..eb9c828ec6c 100644 --- a/dll/directx/wine/ddraw/CMakeLists.txt +++ b/dll/directx/wine/ddraw/CMakeLists.txt @@ -32,6 +32,11 @@ add_library(ddraw MODULE ddraw.rc ${CMAKE_CURRENT_BINARY_DIR}/ddraw.def) +if(MSVC) + # Disable C5286: implicit conversion from enum type 'x' to enum type 'y'; + target_compile_options(ddraw PRIVATE /wd5286) +endif() + set_module_type(ddraw win32dll) target_link_libraries(ddraw wine uuid dxguid ${PSEH_LIB}) add_importlibs(ddraw advapi32 gdi32 user32 d3dwine msvcrt kernel32 ntdll) diff --git a/dll/win32/gdiplus/CMakeLists.txt b/dll/win32/gdiplus/CMakeLists.txt index 3fd65cbe460..6f68cc62f0e 100644 --- a/dll/win32/gdiplus/CMakeLists.txt +++ b/dll/win32/gdiplus/CMakeLists.txt @@ -34,7 +34,8 @@ add_library(gdiplus MODULE if(MSVC) # Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned # Disable warning C4305: '=': truncation from 'double' to 'REAL' - target_compile_options(gdiplus PRIVATE /wd4146 /wd4305) + # Disable warning C5286: implicit conversion from enum type 'x' to enum type 'y'; + target_compile_options(gdiplus PRIVATE /wd4146 /wd4305 /wd5286) endif() set_module_type(gdiplus win32dll) diff --git a/drivers/bus/pcix/pdo.c b/drivers/bus/pcix/pdo.c index 6946fcd9e8a..cedf8e79524 100644 --- a/drivers/bus/pcix/pdo.c +++ b/drivers/bus/pcix/pdo.c @@ -570,7 +570,7 @@ PciPdoCreate(IN PPCI_FDO_EXTENSION DeviceExtension, PdoExtension->IrpDispatchTable = &PciPdoDispatchTable; PdoExtension->PhysicalDeviceObject = DeviceObject; PdoExtension->Slot = Slot; - PdoExtension->PowerState.CurrentSystemState = PowerDeviceD0; + PdoExtension->PowerState.CurrentSystemState = PowerSystemWorking; PdoExtension->PowerState.CurrentDeviceState = PowerDeviceD0; PdoExtension->ParentFdoExtension = DeviceExtension; diff --git a/drivers/filesystems/nfs/nfs41_driver.c b/drivers/filesystems/nfs/nfs41_driver.c index 86e8b594a9b..b7f48734fed 100644 --- a/drivers/filesystems/nfs/nfs41_driver.c +++ b/drivers/filesystems/nfs/nfs41_driver.c @@ -4579,10 +4579,13 @@ NTSTATUS nfs41_QueryVolumeInformation( status = STATUS_SUCCESS; goto out; } +#ifndef __REACTOS__ + // FileAccessInformation isn't the correct enum type! + // It has the value 8, which is FileFsObjectIdInformation case FileAccessInformation: status = STATUS_NOT_SUPPORTED; goto out; - +#endif case FileFsAttributeInformation: if (RxContext->Info.LengthRemaining < FS_ATTR_LEN) { RxContext->InformationToReturn = FS_ATTR_LEN; diff --git a/drivers/network/ndis/ndis/io.c b/drivers/network/ndis/ndis/io.c index 489d8db21ea..3aab42d8aa0 100644 --- a/drivers/network/ndis/ndis/io.c +++ b/drivers/network/ndis/ndis/io.c @@ -333,7 +333,7 @@ NdisMAllocateMapRegisters( Description.Master = TRUE; /* implied by calling this function */ Description.ScatterGather = TRUE; /* XXX UNTRUE: All BM DMA are S/G (ms seems to do this) */ Description.BusNumber = Adapter->NdisMiniportBlock.BusNumber; - Description.InterfaceType = Adapter->NdisMiniportBlock.BusType; + Description.InterfaceType = (INTERFACE_TYPE)Adapter->NdisMiniportBlock.BusType; Description.DmaChannel = DmaChannel; Description.MaximumLength = MaximumBufferSize; @@ -883,7 +883,7 @@ NdisMRegisterDmaChannel( DeviceDesc.Dma64BitAddresses = FALSE; DeviceDesc.BusNumber = Adapter->NdisMiniportBlock.BusNumber; DeviceDesc.DmaChannel = DmaDescription->DmaChannel; - DeviceDesc.InterfaceType = Adapter->NdisMiniportBlock.BusType; + DeviceDesc.InterfaceType = (INTERFACE_TYPE)Adapter->NdisMiniportBlock.BusType; DeviceDesc.DmaWidth = DmaDescription->DmaWidth; DeviceDesc.DmaSpeed = DmaDescription->DmaSpeed; DeviceDesc.MaximumLength = MaximumLength; @@ -1196,7 +1196,7 @@ NdisMInitializeScatterGatherDma( DeviceDesc.Dma32BitAddresses = TRUE; // All callers support 32-bit addresses DeviceDesc.Dma64BitAddresses = Dma64BitAddresses; DeviceDesc.BusNumber = Adapter->NdisMiniportBlock.BusNumber; - DeviceDesc.InterfaceType = Adapter->NdisMiniportBlock.BusType; + DeviceDesc.InterfaceType = (INTERFACE_TYPE)Adapter->NdisMiniportBlock.BusType; DeviceDesc.MaximumLength = MaximumPhysicalMapping; Adapter->NdisMiniportBlock.SystemAdapterObject = diff --git a/drivers/network/ndis/ndis/miniport.c b/drivers/network/ndis/ndis/miniport.c index ad5f7741e6c..b77652d3891 100644 --- a/drivers/network/ndis/ndis/miniport.c +++ b/drivers/network/ndis/ndis/miniport.c @@ -2028,7 +2028,7 @@ NdisIPnPStartDevice( if (NdisStatus == NDIS_STATUS_SUCCESS) Adapter->NdisMiniportBlock.BusType = ConfigParam->ParameterData.IntegerData; else - Adapter->NdisMiniportBlock.BusType = Isa; + Adapter->NdisMiniportBlock.BusType = NdisInterfaceIsa; } Status = IoGetDeviceProperty(Adapter->NdisMiniportBlock.PhysicalDeviceObject, diff --git a/drivers/storage/class/cdrom/ioctl.c b/drivers/storage/class/cdrom/ioctl.c index e9971a7ee8d..3440ed17429 100644 --- a/drivers/storage/class/cdrom/ioctl.c +++ b/drivers/storage/class/cdrom/ioctl.c @@ -412,7 +412,7 @@ Return Value: mediaTypes->MediaInfoCount += 1; mediaInfo++; - mediaInfo->DeviceSpecific.RemovableDiskInfo.MediaType = RemovableMedia; + mediaInfo->DeviceSpecific.RemovableDiskInfo.MediaType = (STORAGE_MEDIA_TYPE)RemovableMedia; mediaInfo->DeviceSpecific.RemovableDiskInfo.NumberMediaSides = 1; mediaInfo->DeviceSpecific.RemovableDiskInfo.MediaCharacteristics = MEDIA_READ_WRITE; mediaInfo->DeviceSpecific.RemovableDiskInfo.Cylinders.QuadPart = DeviceExtension->DiskGeometry.Cylinders.QuadPart; diff --git a/drivers/storage/class/disk/disk.c b/drivers/storage/class/disk/disk.c index 3aee7640418..1ea8474dc22 100644 --- a/drivers/storage/class/disk/disk.c +++ b/drivers/storage/class/disk/disk.c @@ -714,7 +714,7 @@ Return Value: mediaTypes->MediaInfoCount = 1; mediaInfo->DeviceSpecific.DiskInfo.Cylinders.QuadPart = fdoExtension->DiskGeometry.Cylinders.QuadPart; - mediaInfo->DeviceSpecific.DiskInfo.MediaType = FixedMedia; + mediaInfo->DeviceSpecific.DiskInfo.MediaType = (STORAGE_MEDIA_TYPE)FixedMedia; mediaInfo->DeviceSpecific.DiskInfo.TracksPerCylinder = fdoExtension->DiskGeometry.TracksPerCylinder; mediaInfo->DeviceSpecific.DiskInfo.SectorsPerTrack = fdoExtension->DiskGeometry.SectorsPerTrack; mediaInfo->DeviceSpecific.DiskInfo.BytesPerSector = fdoExtension->DiskGeometry.BytesPerSector; @@ -906,7 +906,7 @@ SkipTable: mediaTypes->MediaInfoCount = 1; mediaInfo->DeviceSpecific.RemovableDiskInfo.Cylinders.QuadPart = fdoExtension->DiskGeometry.Cylinders.QuadPart; - mediaInfo->DeviceSpecific.RemovableDiskInfo.MediaType = RemovableMedia; + mediaInfo->DeviceSpecific.RemovableDiskInfo.MediaType = (STORAGE_MEDIA_TYPE)RemovableMedia; mediaInfo->DeviceSpecific.RemovableDiskInfo.TracksPerCylinder = fdoExtension->DiskGeometry.TracksPerCylinder; mediaInfo->DeviceSpecific.RemovableDiskInfo.SectorsPerTrack = fdoExtension->DiskGeometry.SectorsPerTrack; mediaInfo->DeviceSpecific.RemovableDiskInfo.BytesPerSector = fdoExtension->DiskGeometry.BytesPerSector; diff --git a/modules/rostests/winetests/msi/CMakeLists.txt b/modules/rostests/winetests/msi/CMakeLists.txt index 0d6215e659f..59f23bd3710 100644 --- a/modules/rostests/winetests/msi/CMakeLists.txt +++ b/modules/rostests/winetests/msi/CMakeLists.txt @@ -50,6 +50,11 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU") target_compile_options(msi_custom PRIVATE -Wno-format) endif() +if (MSVC) + # Disable warning C5287: operands are different enum types + target_compile_options(msi_winetest PRIVATE /wd5287) +endif() + # msi_winetest.rc: let rc.exe find custom.dll in its subdirectory, i.e. Debug. if (MSVC_IDE) target_include_directories(msi_winetest PRIVATE $<$:$>) diff --git a/sdk/lib/fast486/extraops.c b/sdk/lib/fast486/extraops.c index 2a4c6bae941..80073853fd1 100644 --- a/sdk/lib/fast486/extraops.c +++ b/sdk/lib/fast486/extraops.c @@ -622,7 +622,7 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeLoadControlReg) /* Get the value */ Value = State->GeneralRegs[ModRegRm.SecondRegister].Long; - if (ModRegRm.Register == (INT)FAST486_REG_CR0) + if (ModRegRm.Register == (FAST486_GEN_REGS)FAST486_REG_CR0) { /* CR0 checks */ @@ -640,7 +640,7 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeLoadControlReg) State->PrefetchValid = FALSE; #endif - if (ModRegRm.Register == (INT)FAST486_REG_CR3) + if (ModRegRm.Register == (FAST486_GEN_REGS)FAST486_REG_CR3) { /* Flush the TLB */ Fast486FlushTlb(State); @@ -688,12 +688,12 @@ FAST486_OPCODE_HANDLER(Fast486ExtOpcodeLoadDebugReg) /* Load a value to the debug register */ State->DebugRegisters[ModRegRm.Register] = State->GeneralRegs[ModRegRm.SecondRegister].Long; - if (ModRegRm.Register == (INT)FAST486_REG_DR4) + if (ModRegRm.Register == (FAST486_GEN_REGS)FAST486_REG_DR4) { /* The reserved bits are 1 */ State->DebugRegisters[ModRegRm.Register] |= FAST486_DR4_RESERVED; } - else if (ModRegRm.Register == (INT)FAST486_REG_DR5) + else if (ModRegRm.Register == (FAST486_GEN_REGS)FAST486_REG_DR5) { /* The reserved bits are 0 */ State->DebugRegisters[ModRegRm.Register] &= ~FAST486_DR5_RESERVED;