@@ -139,22 +139,10 @@ win32_compute_revents (HANDLE h, int *p_sought)
139
139
INPUT_RECORD * irbuffer ;
140
140
DWORD avail , nbuffer ;
141
141
BOOL bRet ;
142
- IO_STATUS_BLOCK iosb ;
143
- FILE_PIPE_LOCAL_INFORMATION fpli ;
144
- static PNtQueryInformationFile NtQueryInformationFile ;
145
- static BOOL once_only ;
146
142
147
143
switch (GetFileType (h ))
148
144
{
149
145
case FILE_TYPE_PIPE :
150
- if (!once_only )
151
- {
152
- NtQueryInformationFile = (PNtQueryInformationFile )(void (* )(void ))
153
- GetProcAddress (GetModuleHandleW (L"ntdll.dll" ),
154
- "NtQueryInformationFile" );
155
- once_only = TRUE;
156
- }
157
-
158
146
happened = 0 ;
159
147
if (PeekNamedPipe (h , NULL , 0 , NULL , & avail , NULL ) != 0 )
160
148
{
@@ -166,22 +154,9 @@ win32_compute_revents (HANDLE h, int *p_sought)
166
154
167
155
else
168
156
{
169
- /* It was the write-end of the pipe. Check if it is writable.
170
- If NtQueryInformationFile fails, optimistically assume the pipe is
171
- writable. This could happen on Win9x, where NtQueryInformationFile
172
- is not available, or if we inherit a pipe that doesn't permit
173
- FILE_READ_ATTRIBUTES access on the write end (I think this should
174
- not happen since WinXP SP2; WINE seems fine too). Otherwise,
175
- ensure that enough space is available for atomic writes. */
176
- memset (& iosb , 0 , sizeof (iosb ));
177
- memset (& fpli , 0 , sizeof (fpli ));
178
-
179
- if (!NtQueryInformationFile
180
- || NtQueryInformationFile (h , & iosb , & fpli , sizeof (fpli ),
181
- FilePipeLocalInformation )
182
- || fpli .WriteQuotaAvailable >= PIPE_BUF
183
- || (fpli .OutboundQuota < PIPE_BUF &&
184
- fpli .WriteQuotaAvailable == fpli .OutboundQuota ))
157
+ /* It was the write-end of the pipe. Unfortunately there is no
158
+ reliable way of knowing if it can be written without blocking.
159
+ Just say that it's all good. */
185
160
happened |= * p_sought & (POLLOUT | POLLWRNORM | POLLWRBAND );
186
161
}
187
162
return happened ;
0 commit comments