mirror of
https://github.com/reactos/reactos.git
synced 2025-08-01 19:43:33 +00:00
[WIN32K] Add some validity checks in PDEVOBJ_vReference() and use it instead of explicitly manipulating ppdev->cPdevRefs.
This commit is contained in:
parent
acf689a973
commit
148e137b42
4 changed files with 21 additions and 10 deletions
|
@ -162,6 +162,24 @@ NTAPI
|
|||
EngpGetPDEV(
|
||||
_In_opt_ PUNICODE_STRING pustrDevice);
|
||||
|
||||
FORCEINLINE
|
||||
VOID
|
||||
PDEVOBJ_vReference(
|
||||
_In_ PPDEVOBJ ppdev)
|
||||
{
|
||||
ASSERT(ppdev);
|
||||
|
||||
/* Fail if the PDEV is being destroyed */
|
||||
if (ppdev->cPdevRefs == 0)
|
||||
{
|
||||
ASSERT(FALSE);
|
||||
return;
|
||||
}
|
||||
ASSERT(ppdev->cPdevRefs > 0);
|
||||
|
||||
InterlockedIncrement(&ppdev->cPdevRefs);
|
||||
}
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
PDEVOBJ_vRelease(
|
||||
|
@ -201,11 +219,4 @@ PDEVOBJ_pdmMatchDevMode(
|
|||
PPDEVOBJ ppdev,
|
||||
PDEVMODEW pdm);
|
||||
|
||||
FORCEINLINE
|
||||
VOID
|
||||
PDEVOBJ_vReference(PPDEVOBJ ppdev)
|
||||
{
|
||||
InterlockedIncrement(&ppdev->cPdevRefs);
|
||||
}
|
||||
|
||||
#endif /* !__WIN32K_PDEVOBJ_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue