Merge pull request #5633 from akallabeth/event_fd_fix
GetEventFileDescriptor return handle internal event.
This commit is contained in:
commit
b3e2c5020e
@ -412,30 +412,7 @@ HANDLE CreateWaitObjectEvent(LPSECURITY_ATTRIBUTES lpEventAttributes,
|
|||||||
int GetEventFileDescriptor(HANDLE hEvent)
|
int GetEventFileDescriptor(HANDLE hEvent)
|
||||||
{
|
{
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
ULONG Type;
|
return winpr_Handle_getFd(hEvent);
|
||||||
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];
|
|
||||||
#else
|
#else
|
||||||
return -1;
|
return -1;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user