[REACTOS]

Fix usage of interlocked[Compare]ExchangePointer. These functions take a PVOID* as first parameter and nothing else. In native headers they are inline functions, not macros.

svn path=/trunk/; revision=67171
This commit is contained in:
Timo Kreuzer
2015-04-12 12:24:01 +00:00
parent 38e1d11c51
commit c45766ee82
11 changed files with 28 additions and 28 deletions
+1 -1
View File
@@ -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))
{
+1 -1
View File
@@ -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;
+3 -3
View File
@@ -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;
}
}
+3 -2
View File
@@ -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);
+1 -1
View File
@@ -832,7 +832,7 @@ SerialDeviceControl(
IoMarkIrpPending(Irp);
WaitingIrp = InterlockedCompareExchangePointer(
&DeviceExtension->WaitOnMaskIrp,
(PVOID*)&DeviceExtension->WaitOnMaskIrp,
Irp,
NULL);
+13 -13
View File
@@ -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)) {
-1
View File
@@ -5,7 +5,6 @@
#define free libwine_free
#define realloc libwine_realloc
#define _strdup libwine__strdup
#define interlocked_xchg_add InterlockedExchangeAdd
#include "debug.c"
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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);
}
+1 -1
View File
@@ -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)
@@ -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);