mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:35:43 +00:00
- Make NdisGeneratePartialCancelId safe by using Interlocked functions
svn path=/trunk/; revision=41443
This commit is contained in:
parent
f6a788b116
commit
e2662e4df0
2 changed files with 10 additions and 4 deletions
|
@ -21,6 +21,8 @@ ULONG DebugTraceLevel = MIN_TRACE;
|
|||
|
||||
#endif /* DBG */
|
||||
|
||||
UCHAR CancelId;
|
||||
|
||||
|
||||
VOID NTAPI MainUnload(
|
||||
PDRIVER_OBJECT DriverObject)
|
||||
|
@ -61,6 +63,8 @@ DriverEntry(
|
|||
|
||||
DriverObject->DriverUnload = MainUnload;
|
||||
|
||||
CancelId = 0;
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
#include "ndissys.h"
|
||||
|
||||
extern UCHAR CancelId;
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
|
@ -518,13 +520,13 @@ UCHAR
|
|||
EXPORT
|
||||
NdisGeneratePartialCancelId(VOID)
|
||||
{
|
||||
static UCHAR CancelId = 0;
|
||||
UCHAR PartialCancelId;
|
||||
|
||||
CancelId++;
|
||||
PartialCancelId = InterlockedIncrement((PLONG)&CancelId);
|
||||
|
||||
NDIS_DbgPrint(MAX_TRACE, ("Cancel ID %u\n", CancelId));
|
||||
NDIS_DbgPrint(MAX_TRACE, ("Cancel ID %u\n", PartialCancelId));
|
||||
|
||||
return CancelId;
|
||||
return PartialCancelId;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue