Index: trunk/src/VBox/Runtime/r0drv/nt/semevent-r0drv-nt.cpp
===================================================================
--- trunk/src/VBox/Runtime/r0drv/nt/semevent-r0drv-nt.cpp	(revision 25714)
+++ trunk/src/VBox/Runtime/r0drv/nt/semevent-r0drv-nt.cpp	(revision 25717)
@@ -59,32 +59,37 @@
 
 
-RTDECL(int)  RTSemEventCreate(PRTSEMEVENT pEventSem)
+RTDECL(int)  RTSemEventCreate(PRTSEMEVENT phEventSem)
 {
-    Assert(sizeof(RTSEMEVENTINTERNAL) > sizeof(void *));
-    PRTSEMEVENTINTERNAL pThis = (PRTSEMEVENTINTERNAL)RTMemAlloc(sizeof(*pThis));
-    if (pThis)
-    {
-        pThis->u32Magic = RTSEMEVENT_MAGIC;
-        KeInitializeEvent(&pThis->Event, SynchronizationEvent, FALSE);
-        *pEventSem = pThis;
-        return VINF_SUCCESS;
-    }
-    return VERR_NO_MEMORY;
+    return RTSemEventCreateEx(phEventSem, 0 /*fFlags*/, NIL_RTLOCKVALCLASS, NULL);
 }
 
 
-RTDECL(int)  RTSemEventDestroy(RTSEMEVENT EventSem)
+RTDECL(int)  RTSemEventCreateEx(PRTSEMEVENT phEventSem, uint32_t fFlags, RTLOCKVALCLASS hClass, const char *pszNameFmt, ...)
+{
+    AssertReturn(!(fFlags & ~RTSEMEVENT_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER);
+    AssertCompile(sizeof(RTSEMEVENTINTERNAL) > sizeof(void *));
+
+    PRTSEMEVENTINTERNAL pThis = (PRTSEMEVENTINTERNAL)RTMemAlloc(sizeof(*pThis));
+    if (!pThis)
+        return VERR_NO_MEMORY;
+
+    pThis->u32Magic = RTSEMEVENT_MAGIC;
+    KeInitializeEvent(&pThis->Event, SynchronizationEvent, FALSE);
+
+    *phEventSem = pThis;
+    return VINF_SUCCESS;
+}
+
+
+RTDECL(int)  RTSemEventDestroy(RTSEMEVENT hEventSem)
 {
     /*
      * Validate input.
      */
-    PRTSEMEVENTINTERNAL pThis = (PRTSEMEVENTINTERNAL)EventSem;
-    if (!pThis)
-        return VERR_INVALID_PARAMETER;
-    if (pThis->u32Magic != RTSEMEVENT_MAGIC)
-    {
-        AssertMsgFailed(("pThis->u32Magic=%RX32 pThis=%p\n", pThis->u32Magic, pThis));
-        return VERR_INVALID_PARAMETER;
-    }
+    PRTSEMEVENTINTERNAL pThis = hEventSem;
+    if (pThis == NIL_RTSEMEVENT)
+        return VINF_SUCCESS;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertMsgReturn(pThis->u32Magic == RTSEMEVENT_MAGIC, ("pThis->u32Magic=%RX32 pThis=%p\n", pThis->u32Magic, pThis), VERR_INVALID_HANDLE);
 
     /*
@@ -98,18 +103,12 @@
 
 
-RTDECL(int)  RTSemEventSignal(RTSEMEVENT EventSem)
+RTDECL(int)  RTSemEventSignal(RTSEMEVENT hEventSem)
 {
     /*
      * Validate input.
      */
-    PRTSEMEVENTINTERNAL pThis = (PRTSEMEVENTINTERNAL)EventSem;
-    if (!pThis)
-        return VERR_INVALID_PARAMETER;
-    if (    !pThis
-        ||  pThis->u32Magic != RTSEMEVENT_MAGIC)
-    {
-        AssertMsgFailed(("pThis->u32Magic=%RX32 pThis=%p\n", pThis ? pThis->u32Magic : 0, pThis));
-        return VERR_INVALID_PARAMETER;
-    }
+    PRTSEMEVENTINTERNAL pThis = (PRTSEMEVENTINTERNAL)hEventSem;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertMsgReturn(pThis->u32Magic == RTSEMEVENT_MAGIC, ("pThis->u32Magic=%RX32 pThis=%p\n", pThis->u32Magic, pThis), VERR_INVALID_HANDLE);
 
     /*
@@ -121,18 +120,12 @@
 
 
-static int rtSemEventWait(RTSEMEVENT EventSem, unsigned cMillies, bool fInterruptible)
+static int rtSemEventWait(RTSEMEVENT hEventSem, unsigned cMillies, bool fInterruptible)
 {
     /*
      * Validate input.
      */
-    PRTSEMEVENTINTERNAL pThis = (PRTSEMEVENTINTERNAL)EventSem;
-    if (!pThis)
-        return VERR_INVALID_PARAMETER;
-    if (    !pThis
-        ||  pThis->u32Magic != RTSEMEVENT_MAGIC)
-    {
-        AssertMsgFailed(("pThis->u32Magic=%RX32 pThis=%p\n", pThis ? pThis->u32Magic : 0, pThis));
-        return VERR_INVALID_PARAMETER;
-    }
+    PRTSEMEVENTINTERNAL pThis = (PRTSEMEVENTINTERNAL)hEventSem;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertMsgReturn(pThis->u32Magic == RTSEMEVENT_MAGIC, ("pThis->u32Magic=%RX32 pThis=%p\n", pThis->u32Magic, pThis), VERR_INVALID_HANDLE);
 
     /*
@@ -170,13 +163,13 @@
 
 
-RTDECL(int)  RTSemEventWait(RTSEMEVENT EventSem, unsigned cMillies)
+RTDECL(int)  RTSemEventWait(RTSEMEVENT hEventSem, unsigned cMillies)
 {
-    return rtSemEventWait(EventSem, cMillies, false /* fInterruptible */);
+    return rtSemEventWait(hEventSem, cMillies, false /* fInterruptible */);
 }
 
 
-RTDECL(int)  RTSemEventWaitNoResume(RTSEMEVENT EventSem, unsigned cMillies)
+RTDECL(int)  RTSemEventWaitNoResume(RTSEMEVENT hEventSem, unsigned cMillies)
 {
-    return rtSemEventWait(EventSem, cMillies, true /* fInterruptible */);
+    return rtSemEventWait(hEventSem, cMillies, true /* fInterruptible */);
 }
 
