winverbs: make PD derive from IWVOverlapped
[mirror/winof/.git] / core / winverbs / kernel / wv_pd.c
index d74402e..5ae2629 100644 (file)
@@ -191,6 +191,30 @@ out:
        WdfRequestComplete(Request, status);\r
 }\r
 \r
+void WvPdCancel(WV_PROVIDER *pProvider, WDFREQUEST Request)\r
+{\r
+       WV_PROTECTION_DOMAIN    *pd;\r
+       UINT64                                  *id;\r
+       NTSTATUS                                status;\r
+\r
+       status = WdfRequestRetrieveInputBuffer(Request, sizeof(UINT64), &id, NULL);\r
+       if (!NT_SUCCESS(status)) {\r
+               goto complete;\r
+       }\r
+\r
+       pd = WvPdAcquire(pProvider, *id);\r
+       if (pd == NULL) {\r
+               status = STATUS_NOT_FOUND;\r
+               goto complete;\r
+       }\r
+\r
+       // Registration is currently synchronous - nothing to do.\r
+       WvPdRelease(pd);\r
+\r
+complete:\r
+       WdfRequestComplete(Request, status);\r
+}\r
+\r
 void WvPdFree(WV_PROTECTION_DOMAIN *pPd)\r
 {\r
        WV_MEMORY_REGION        *mr;\r