GetEventFileDescriptor return handle internal event.
authorArmin Novak <armin.novak@thincast.com>
Wed, 2 Oct 2019 12:58:32 +0000 (14:58 +0200)
committerArmin Novak <armin.novak@thincast.com>
Wed, 2 Oct 2019 12:58:32 +0000 (14:58 +0200)
winpr/libwinpr/synch/event.c

index 1b4d5c0..ac41273 100644 (file)
@@ -412,30 +412,7 @@ HANDLE CreateWaitObjectEvent(LPSECURITY_ATTRIBUTES lpEventAttributes,
 int GetEventFileDescriptor(HANDLE hEvent)
 {
 #ifndef _WIN32
-       ULONG Type;
-       WINPR_HANDLE* Object;
-       WINPR_EVENT* event;
-
-       if (!winpr_Handle_GetInfo(hEvent, &Type, &Object))
-               return -1;
-
-       event = (WINPR_EVENT*) Object;
-
-       if (Type == HANDLE_TYPE_NAMED_PIPE)
-       {
-               WINPR_NAMED_PIPE* named = (WINPR_NAMED_PIPE*)hEvent;
-
-               if (named->ServerMode)
-               {
-                       return named->serverfd;
-               }
-               else
-               {
-                       return named->clientfd;
-               }
-       }
-
-       return event->pipe_fd[0];
+       return winpr_Handle_getFd(hEvent);
 #else
        return -1;
 #endif