[RXCE]
authorPierre Schweitzer <pierre@reactos.org>
Sat, 27 May 2017 16:50:29 +0000 (16:50 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sat, 27 May 2017 16:50:29 +0000 (16:50 +0000)
Implement FCB refcounting

CORE-11327

svn path=/trunk/; revision=74682

reactos/sdk/lib/drivers/rxce/rxce.c

index c531409..ac355e8 100644 (file)
@@ -4367,12 +4367,25 @@ RxpDereferenceAndFinalizeNetFcb(
     return Freed;
 }
 
     return Freed;
 }
 
+/*
+ * @implemented
+ */
 LONG
 RxpDereferenceNetFcb(
    PFCB Fcb)
 {
 LONG
 RxpDereferenceNetFcb(
    PFCB Fcb)
 {
-    UNIMPLEMENTED;
-    return 0;
+    LONG NewCount;
+
+    PAGED_CODE();
+
+    ASSERT(NodeTypeIsFcb(Fcb));
+
+    NewCount = InterlockedDecrement((volatile long *)&Fcb->NodeReferenceCount);
+    ASSERT(NewCount >= 0);
+
+    PRINT_REF_COUNT(NETFCB, NewCount);
+
+    return NewCount;
 }
 
 /*
 }
 
 /*
@@ -4491,12 +4504,24 @@ RxPrefixTableLookupName(
     return Container;
 }
 
     return Container;
 }
 
+/*
+ * @implemented
+ */
 LONG
 RxpReferenceNetFcb(
    PFCB Fcb)
 {
 LONG
 RxpReferenceNetFcb(
    PFCB Fcb)
 {
-    UNIMPLEMENTED;
-    return 0;
+    LONG NewCount;
+
+    PAGED_CODE();
+
+    ASSERT(NodeTypeIsFcb(Fcb));
+
+    NewCount = InterlockedIncrement((volatile long *)&Fcb->NodeReferenceCount);
+
+    PRINT_REF_COUNT(NETFCB, Fcb->NodeReferenceCount);
+
+    return NewCount;
 }
 
 /*
 }
 
 /*