diff --git a/reactos/dll/win32/kernel32/client/proc.c b/reactos/dll/win32/kernel32/client/proc.c index 0948f8bf94a..ebf1b34da72 100644 --- a/reactos/dll/win32/kernel32/client/proc.c +++ b/reactos/dll/win32/kernel32/client/proc.c @@ -1437,7 +1437,7 @@ GetStartupInfoA(IN LPSTARTUPINFOA lpStartupInfo) StartupInfo->lpTitle = TitleString.Buffer; /* We finished with the ANSI version, try to cache it */ - if (!InterlockedCompareExchangePointer(&BaseAnsiStartupInfo, + if (!InterlockedCompareExchangePointer((PVOID*)&BaseAnsiStartupInfo, StartupInfo, NULL)) { diff --git a/reactos/dll/win32/setupapi/stringtable.c b/reactos/dll/win32/setupapi/stringtable.c index bd1d3a7d288..e61cb9f424a 100644 --- a/reactos/dll/win32/setupapi/stringtable.c +++ b/reactos/dll/win32/setupapi/stringtable.c @@ -244,7 +244,7 @@ pSetupStringTableAddString(HSTRING_TABLE hStringTable, return (DWORD)-1; memset(&pNewSlots[pStringTable->dwMaxSlots], 0, sizeof(TABLE_SLOT) * (dwNewMaxSlots - pStringTable->dwMaxSlots)); memcpy(pNewSlots, pStringTable->pSlots, sizeof(TABLE_SLOT) * pStringTable->dwMaxSlots); - pNewSlots = InterlockedExchangePointer(&pStringTable->pSlots, pNewSlots); + pNewSlots = InterlockedExchangePointer((PVOID*)&pStringTable->pSlots, pNewSlots); MyFree(pNewSlots); pStringTable->dwMaxSlots = dwNewMaxSlots; diff --git a/reactos/drivers/bluetooth/fbtusb/fbtdev.c b/reactos/drivers/bluetooth/fbtusb/fbtdev.c index 9479e53bb8e..40327d0184f 100644 --- a/reactos/drivers/bluetooth/fbtusb/fbtdev.c +++ b/reactos/drivers/bluetooth/fbtusb/fbtdev.c @@ -1042,7 +1042,7 @@ IdleNotificationRequestComplete_Exit: idleCallbackInfo = DeviceExtension->IdleCallbackInfo; DeviceExtension->IdleCallbackInfo = NULL; - idleIrp = (PIRP) InterlockedExchangePointer(&DeviceExtension->PendingIdleIrp, NULL); + idleIrp = (PIRP) InterlockedExchangePointer((PVOID*)&DeviceExtension->PendingIdleIrp, NULL); InterlockedExchange(&DeviceExtension->IdleReqPend, 0); KeReleaseSpinLock(&DeviceExtension->IdleReqStateLock, oldIrql); @@ -1104,7 +1104,7 @@ VOID NTAPI CancelSelectSuspend(IN PDEVICE_EXTENSION DeviceExtension) if(!CanDeviceSuspend(DeviceExtension)) { FreeBT_DbgPrint(3, ("Device is not idle\n")); - irp = (PIRP) InterlockedExchangePointer(&DeviceExtension->PendingIdleIrp, NULL); + irp = (PIRP) InterlockedExchangePointer((PVOID*)&DeviceExtension->PendingIdleIrp, NULL); } @@ -1195,4 +1195,4 @@ VOID NTAPI WWIrpCompletionFunc(IN PDEVICE_OBJECT DeviceObject, IN UCHAR MinorFun return; -} \ No newline at end of file +} diff --git a/reactos/drivers/bluetooth/fbtusb/fbtpwr.c b/reactos/drivers/bluetooth/fbtusb/fbtpwr.c index ddc48c0d311..17561f8b777 100644 --- a/reactos/drivers/bluetooth/fbtusb/fbtpwr.c +++ b/reactos/drivers/bluetooth/fbtusb/fbtpwr.c @@ -926,7 +926,8 @@ VOID NTAPI CancelWaitWake(IN PDEVICE_EXTENSION DeviceExtension) FreeBT_DbgPrint(3, ("FBTUSB: CancelWaitWake: Entered\n")); - Irp = (PIRP) InterlockedExchangePointer(&DeviceExtension->WaitWakeIrp, NULL); + Irp = (PIRP) InterlockedExchangePointer((PVOID*)&DeviceExtension->WaitWakeIrp, + NULL); if(Irp) { IoCancelIrp(Irp); @@ -957,7 +958,7 @@ NTSTATUS NTAPI WaitWakeCompletionRoutine(IN PDEVICE_OBJECT DeviceObject, IN PIRP // Nullify the WaitWakeIrp pointer-the Irp is released // as part of the completion process. If it's already NULL, // avoid race with the CancelWaitWake routine. - if(InterlockedExchangePointer(&DeviceExtension->WaitWakeIrp, NULL)) + if(InterlockedExchangePointer((PVOID*)&DeviceExtension->WaitWakeIrp, NULL)) { PoStartNextPowerIrp(Irp); diff --git a/reactos/drivers/serial/serial/devctrl.c b/reactos/drivers/serial/serial/devctrl.c index b7f056dd600..189f97eba24 100644 --- a/reactos/drivers/serial/serial/devctrl.c +++ b/reactos/drivers/serial/serial/devctrl.c @@ -832,7 +832,7 @@ SerialDeviceControl( IoMarkIrpPending(Irp); WaitingIrp = InterlockedCompareExchangePointer( - &DeviceExtension->WaitOnMaskIrp, + (PVOID*)&DeviceExtension->WaitOnMaskIrp, Irp, NULL); diff --git a/reactos/drivers/storage/classpnp/autorun.c b/reactos/drivers/storage/classpnp/autorun.c index 3a328571570..b31042609e1 100644 --- a/reactos/drivers/storage/classpnp/autorun.c +++ b/reactos/drivers/storage/classpnp/autorun.c @@ -160,7 +160,7 @@ ClassSendEjectionNotification( // non-MMC-compliant devices also from sense codes. // - DBGTRACE(ClassDebugTrace, ("ClassSendEjectionNotification: media EJECT_REQUEST")); + DBGTRACE(ClassDebugTrace, ("ClassSendEjectionNotification: media EJECT_REQUEST")); ClasspSendNotification(FdoExtension, &GUID_IO_MEDIA_EJECT_REQUEST, 0, @@ -412,7 +412,7 @@ ClasspInterpretGesnData( &GUID_IO_GENERIC_GESN_EVENT, sizeof(NOTIFICATION_EVENT_STATUS_HEADER) + dataLength, Header) -*/ +*/ switch (Header->NotificationClass) { @@ -450,7 +450,7 @@ ClasspInterpretGesnData( KeQuerySystemTime(&(externalData.SystemTime)); externalData.SystemTime.QuadPart *= (LONGLONG)KeQueryTimeIncrement(); - DBGTRACE(ClassDebugTrace, ("ClasspInterpretGesnData: media DEVICE_EXTERNAL_REQUEST")); + DBGTRACE(ClassDebugTrace, ("ClasspInterpretGesnData: media DEVICE_EXTERNAL_REQUEST")); ClasspSendNotification(FdoExtension, &GUID_IO_DEVICE_EXTERNAL_REQUEST, sizeof(DEVICE_EVENT_EXTERNAL_REQUEST), @@ -541,7 +541,7 @@ ClasspInterpretGesnData( busyData.Estimated100msToReady )); - DBGTRACE(ClassDebugTrace, ("ClasspInterpretGesnData: media BECOMING_READY")); + DBGTRACE(ClassDebugTrace, ("ClasspInterpretGesnData: media BECOMING_READY")); ClasspSendNotification(FdoExtension, &GUID_IO_DEVICE_BECOMING_READY, sizeof(DEVICE_EVENT_BECOMING_READY), @@ -555,7 +555,7 @@ ClasspInterpretGesnData( } - } // end switch on notification class + } // end switch on notification class return; } @@ -660,7 +660,7 @@ ClasspInternalSetMediaChangeState( sizeof(ULONG), &data); - } + } else if (NewState == MediaNotPresent) { DBGTRACE(ClassDebugTrace, ("ClasspInternalSetMediaChangeState: media REMOVAL")); @@ -858,12 +858,12 @@ ClasspMediaChangeDetectionCompletion( PSENSE_DATA senseData = srb->SenseInfoBuffer; - if ((senseData->SenseKey == SCSI_SENSE_NOT_READY) && + if ((senseData->SenseKey == SCSI_SENSE_NOT_READY) && (senseData->AdditionalSenseCode == SCSI_ADSENSE_LUN_NOT_READY)){ srb->SrbStatus = SRB_STATUS_SUCCESS; } - } - + } + // // use ClassInterpretSenseInfo() to check for media state, and also @@ -882,7 +882,7 @@ ClasspMediaChangeDetectionCompletion( &status, NULL); - } + } else { fdoData->LoggedTURFailureSinceLastIO = FALSE; @@ -910,7 +910,7 @@ ClasspMediaChangeDetectionCompletion( status = STATUS_SUCCESS; } - if (!NT_SUCCESS(status)) { + if (!NT_SUCCESS(status)) { DBGTRACE(ClassDebugMCN, ("ClasspMediaChangeDetectionCompletion: GESN failed with status %x", status)); } else { @@ -1067,7 +1067,7 @@ ClasspPrepareMcnIrp( if (status == REMOVE_COMPLETE) { ASSERT(status != REMOVE_COMPLETE); return NULL; - } + } else if (status == REMOVE_PENDING) { ClassReleaseRemoveLock(FdoExtension->DeviceObject, irp); return NULL; @@ -3363,7 +3363,7 @@ ClasspFailurePredict( // InterlockedExchange((PLONG)&info->CountDown, info->Period); - workItem = InterlockedExchangePointer(&info->WorkQueueItem, NULL); + workItem = InterlockedExchangePointer((PVOID*)&info->WorkQueueItem, NULL); if (ClasspCanSendPollingIrp(fdoExtension)) { diff --git a/reactos/lib/3rdparty/libwine/debug_ros.c b/reactos/lib/3rdparty/libwine/debug_ros.c index 66904ba33e2..fd1e6775257 100644 --- a/reactos/lib/3rdparty/libwine/debug_ros.c +++ b/reactos/lib/3rdparty/libwine/debug_ros.c @@ -5,7 +5,6 @@ #define free libwine_free #define realloc libwine_realloc #define _strdup libwine__strdup -#define interlocked_xchg_add InterlockedExchangeAdd #include "debug.c" diff --git a/reactos/ntoskrnl/ke/ipi.c b/reactos/ntoskrnl/ke/ipi.c index 2778658c1f1..df68cafcd07 100644 --- a/reactos/ntoskrnl/ke/ipi.c +++ b/reactos/ntoskrnl/ke/ipi.c @@ -178,7 +178,7 @@ KiIpiServiceRoutine(IN PKTRAP_FRAME TrapFrame, { while (0 != InterlockedCompareExchangeUL(&Prcb->SignalDone->TargetSet, 0, 0)); } - (void)InterlockedExchangePointer(&Prcb->SignalDone, NULL); + (void)InterlockedExchangePointer((PVOID*)&Prcb->SignalDone, NULL); } #endif return TRUE; diff --git a/reactos/ntoskrnl/ps/kill.c b/reactos/ntoskrnl/ps/kill.c index f2093822f14..5fac03df551 100644 --- a/reactos/ntoskrnl/ps/kill.c +++ b/reactos/ntoskrnl/ps/kill.c @@ -177,7 +177,7 @@ PspReapRoutine(IN PVOID Context) do { /* Write magic value and return the next entry to process */ - NextEntry = InterlockedExchangePointer(&PspReaperListHead.Flink, + NextEntry = InterlockedExchangePointer((PVOID*)&PspReaperListHead.Flink, (PVOID)1); ASSERT((NextEntry != NULL) && (NextEntry != (PVOID)1)); @@ -200,7 +200,7 @@ PspReapRoutine(IN PVOID Context) } while ((NextEntry != NULL) && (NextEntry != (PVOID)1)); /* Remove magic value, keep looping if it got changed */ - } while (InterlockedCompareExchangePointer(&PspReaperListHead.Flink, + } while (InterlockedCompareExchangePointer((PVOID*)&PspReaperListHead.Flink, 0, (PVOID)1) != (PVOID)1); } diff --git a/reactos/ntoskrnl/ps/quota.c b/reactos/ntoskrnl/ps/quota.c index d5b30609941..09701ba2115 100644 --- a/reactos/ntoskrnl/ps/quota.c +++ b/reactos/ntoskrnl/ps/quota.c @@ -428,7 +428,7 @@ PspSetQuotaLimits( QuotaBlock->QuotaEntry[2].Limit = PspDefaultQuotaBlock.QuotaEntry[2].Limit; /* Try to exchange the quota block, if that failed, just drop it */ - OldQuotaBlock = InterlockedCompareExchangePointer(&Process->QuotaBlock, + OldQuotaBlock = InterlockedCompareExchangePointer((PVOID*)&Process->QuotaBlock, QuotaBlock, &PspDefaultQuotaBlock); if (OldQuotaBlock == &PspDefaultQuotaBlock) diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c index 36a944c2329..b4869d2ea06 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c @@ -797,7 +797,7 @@ GuiSetActiveScreenBuffer(IN OUT PFRONTEND This) EnterCriticalSection(&GuiData->Lock); GuiData->WindowSizeLock = TRUE; - InterlockedExchangePointer(&GuiData->ActiveBuffer, + InterlockedExchangePointer((PVOID*)&GuiData->ActiveBuffer, ConDrvGetActiveScreenBuffer(GuiData->Console)); GuiData->WindowSizeLock = FALSE; @@ -867,7 +867,7 @@ GuiReleaseScreenBuffer(IN OUT PFRONTEND This, EnterCriticalSection(&GuiData->Lock); GuiData->WindowSizeLock = TRUE; - InterlockedExchangePointer(&GuiData->ActiveBuffer, NULL); + InterlockedExchangePointer((PVOID*)&GuiData->ActiveBuffer, NULL); GuiData->WindowSizeLock = FALSE; LeaveCriticalSection(&GuiData->Lock);