2 * Copyright 1999, 2000 Juergen Schmied
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #include "wine/port.h"
30 #ifdef HAVE_SYS_ERRNO_H
31 #include <sys/errno.h>
33 #ifdef HAVE_LINUX_MAJOR_H
34 # include <linux/major.h>
36 #ifdef HAVE_SYS_STATVFS_H
37 # include <sys/statvfs.h>
39 #ifdef HAVE_SYS_PARAM_H
40 # include <sys/param.h>
42 #ifdef HAVE_SYS_TIME_H
43 # include <sys/time.h>
48 #ifdef STATFS_DEFINED_BY_SYS_VFS
51 # ifdef STATFS_DEFINED_BY_SYS_MOUNT
52 # include <sys/mount.h>
54 # ifdef STATFS_DEFINED_BY_SYS_STATFS
55 # include <sys/statfs.h>
60 #define NONAMELESSUNION
61 #define NONAMELESSSTRUCT
62 #include "wine/unicode.h"
63 #include "wine/debug.h"
64 #include "wine/server.h"
66 #include "ntdll_misc.h"
71 WINE_DEFAULT_DEBUG_CHANNEL(ntdll
);
73 mode_t FILE_umask
= 0;
75 #define SECSPERDAY 86400
76 #define SECS_1601_TO_1970 ((369 * 365 + 89) * (ULONGLONG)SECSPERDAY)
78 /**************************************************************************
79 * NtOpenFile [NTDLL.@]
80 * ZwOpenFile [NTDLL.@]
85 * handle [O] Variable that receives the file handle on return
86 * access [I] Access desired by the caller to the file
87 * attr [I] Structue describing the file to be opened
88 * io [O] Receives details about the result of the operation
89 * sharing [I] Type of shared access the caller requires
90 * options [I] Options for the file open
93 * Success: 0. FileHandle and IoStatusBlock are updated.
94 * Failure: An NTSTATUS error code describing the error.
96 NTSTATUS WINAPI
NtOpenFile( PHANDLE handle
, ACCESS_MASK access
,
97 POBJECT_ATTRIBUTES attr
, PIO_STATUS_BLOCK io
,
98 ULONG sharing
, ULONG options
)
100 return NtCreateFile( handle
, access
, attr
, io
, NULL
, 0,
101 sharing
, FILE_OPEN
, options
, NULL
, 0 );
104 /**************************************************************************
105 * NtCreateFile [NTDLL.@]
106 * ZwCreateFile [NTDLL.@]
108 * Either create a new file or directory, or open an existing file, device,
109 * directory or volume.
112 * handle [O] Points to a variable which receives the file handle on return
113 * access [I] Desired access to the file
114 * attr [I] Structure describing the file
115 * io [O] Receives information about the operation on return
116 * alloc_size [I] Initial size of the file in bytes
117 * attributes [I] Attributes to create the file with
118 * sharing [I] Type of shared access the caller would like to the file
119 * disposition [I] Specifies what to do, depending on whether the file already exists
120 * options [I] Options for creating a new file
121 * ea_buffer [I] Undocumented
122 * ea_length [I] Undocumented
125 * Success: 0. handle and io are updated.
126 * Failure: An NTSTATUS error code describing the error.
128 NTSTATUS WINAPI
NtCreateFile( PHANDLE handle
, ACCESS_MASK access
, POBJECT_ATTRIBUTES attr
,
129 PIO_STATUS_BLOCK io
, PLARGE_INTEGER alloc_size
,
130 ULONG attributes
, ULONG sharing
, ULONG disposition
,
131 ULONG options
, PVOID ea_buffer
, ULONG ea_length
)
133 ANSI_STRING unix_name
;
136 TRACE("handle=%p access=%08lx name=%s objattr=%08lx root=%p sec=%p io=%p alloc_size=%p\n"
137 "attr=%08lx sharing=%08lx disp=%ld options=%08lx ea=%p.0x%08lx\n",
138 handle
, access
, debugstr_us(attr
->ObjectName
), attr
->Attributes
,
139 attr
->RootDirectory
, attr
->SecurityDescriptor
, io
, alloc_size
,
140 attributes
, sharing
, disposition
, options
, ea_buffer
, ea_length
);
142 if (attr
->RootDirectory
)
144 FIXME( "RootDirectory %p not supported\n", attr
->RootDirectory
);
145 return STATUS_OBJECT_NAME_NOT_FOUND
;
147 if (alloc_size
) FIXME( "alloc_size not supported\n" );
149 io
->u
.Status
= wine_nt_to_unix_file_name( attr
->ObjectName
, &unix_name
, disposition
,
150 !(attr
->Attributes
& OBJ_CASE_INSENSITIVE
) );
152 if (io
->u
.Status
== STATUS_NO_SUCH_FILE
&&
153 disposition
!= FILE_OPEN
&& disposition
!= FILE_OVERWRITE
)
156 io
->u
.Status
= STATUS_SUCCESS
;
159 if (io
->u
.Status
== STATUS_SUCCESS
)
161 SERVER_START_REQ( create_file
)
163 req
->access
= access
;
164 req
->inherit
= (attr
->Attributes
& OBJ_INHERIT
) != 0;
165 req
->sharing
= sharing
;
166 req
->create
= disposition
;
167 req
->options
= options
;
168 req
->attrs
= attributes
;
169 wine_server_add_data( req
, unix_name
.Buffer
, unix_name
.Length
);
170 io
->u
.Status
= wine_server_call( req
);
171 *handle
= reply
->handle
;
174 RtlFreeAnsiString( &unix_name
);
176 else WARN("%s not found (%lx)\n", debugstr_us(attr
->ObjectName
), io
->u
.Status
);
178 if (io
->u
.Status
== STATUS_SUCCESS
)
180 if (created
) io
->Information
= FILE_CREATED
;
181 else switch(disposition
)
184 io
->Information
= FILE_SUPERSEDED
;
187 io
->Information
= FILE_CREATED
;
191 io
->Information
= FILE_OPENED
;
194 case FILE_OVERWRITE_IF
:
195 io
->Information
= FILE_OVERWRITTEN
;
203 /***********************************************************************
204 * Asynchronous file I/O *
206 static DWORD
fileio_get_async_count(const async_private
*ovp
);
207 static void CALLBACK
fileio_call_completion_func(ULONG_PTR data
);
208 static void fileio_async_cleanup(async_private
*ovp
);
210 static async_ops fileio_async_ops
=
212 fileio_get_async_count
, /* get_count */
213 fileio_call_completion_func
, /* call_completion */
214 fileio_async_cleanup
/* cleanup */
217 static async_ops fileio_nocomp_async_ops
=
219 fileio_get_async_count
, /* get_count */
220 NULL
, /* call_completion */
221 fileio_async_cleanup
/* cleanup */
224 typedef struct async_fileio
226 struct async_private async
;
231 unsigned long offset
;
232 enum fd_type fd_type
;
235 static DWORD
fileio_get_async_count(const struct async_private
*ovp
)
237 async_fileio
*fileio
= (async_fileio
*) ovp
;
239 if (fileio
->count
< fileio
->async
.iosb
->Information
)
241 return fileio
->count
- fileio
->async
.iosb
->Information
;
244 static void CALLBACK
fileio_call_completion_func(ULONG_PTR data
)
246 async_fileio
*ovp
= (async_fileio
*) data
;
247 TRACE("data: %p\n", ovp
);
249 ovp
->apc( ovp
->apc_user
, ovp
->async
.iosb
, ovp
->async
.iosb
->Information
);
251 fileio_async_cleanup( &ovp
->async
);
254 static void fileio_async_cleanup( struct async_private
*ovp
)
256 RtlFreeHeap( GetProcessHeap(), 0, ovp
);
259 /***********************************************************************
260 * FILE_GetNtStatus(void)
262 * Retrieve the Nt Status code from errno.
263 * Try to be consistent with FILE_SetDosError().
265 NTSTATUS
FILE_GetNtStatus(void)
269 TRACE( "errno = %d\n", errno
);
272 case EAGAIN
: return STATUS_SHARING_VIOLATION
;
273 case EBADF
: return STATUS_INVALID_HANDLE
;
274 case ENOSPC
: return STATUS_DISK_FULL
;
277 case EACCES
: return STATUS_ACCESS_DENIED
;
278 case ENOTDIR
: return STATUS_OBJECT_PATH_NOT_FOUND
;
279 case ENOENT
: return STATUS_OBJECT_NAME_NOT_FOUND
;
280 case EISDIR
: return STATUS_FILE_IS_A_DIRECTORY
;
282 case ENFILE
: return STATUS_TOO_MANY_OPENED_FILES
;
283 case EINVAL
: return STATUS_INVALID_PARAMETER
;
284 case ENOTEMPTY
: return STATUS_DIRECTORY_NOT_EMPTY
;
285 case EPIPE
: return STATUS_PIPE_BROKEN
;
286 case EIO
: return STATUS_DEVICE_NOT_READY
;
288 case ENOMEDIUM
: return STATUS_NO_MEDIA_IN_DEVICE
;
291 case EOPNOTSUPP
:return STATUS_NOT_SUPPORTED
;
292 case ENOEXEC
: /* ?? */
293 case ESPIPE
: /* ?? */
294 case EEXIST
: /* ?? */
296 FIXME( "Converting errno %d to STATUS_UNSUCCESSFUL\n", err
);
297 return STATUS_UNSUCCESSFUL
;
301 /***********************************************************************
302 * FILE_AsyncReadService (INTERNAL)
304 * This function is called while the client is waiting on the
305 * server, so we can't make any server calls here.
307 static void FILE_AsyncReadService(async_private
*ovp
)
309 async_fileio
*fileio
= (async_fileio
*) ovp
;
310 IO_STATUS_BLOCK
* io_status
= fileio
->async
.iosb
;
312 int already
= io_status
->Information
;
314 TRACE("%p %p\n", io_status
, fileio
->buffer
);
316 /* check to see if the data is ready (non-blocking) */
318 if ( fileio
->fd_type
== FD_TYPE_SOCKET
)
319 result
= read(ovp
->fd
, &fileio
->buffer
[already
], fileio
->count
- already
);
322 result
= pread(ovp
->fd
, &fileio
->buffer
[already
], fileio
->count
- already
,
323 fileio
->offset
+ already
);
324 if ((result
< 0) && (errno
== ESPIPE
))
325 result
= read(ovp
->fd
, &fileio
->buffer
[already
], fileio
->count
- already
);
328 if ((result
< 0) && ((errno
== EAGAIN
) || (errno
== EINTR
)))
330 TRACE("Deferred read %d\n",errno
);
331 io_status
->u
.Status
= STATUS_PENDING
;
335 /* check to see if the transfer is complete */
338 io_status
->u
.Status
= FILE_GetNtStatus();
341 else if (result
== 0)
343 io_status
->u
.Status
= io_status
->Information
? STATUS_SUCCESS
: STATUS_END_OF_FILE
;
347 io_status
->Information
+= result
;
348 if (io_status
->Information
>= fileio
->count
|| fileio
->fd_type
== FD_TYPE_SOCKET
)
349 io_status
->u
.Status
= STATUS_SUCCESS
;
351 io_status
->u
.Status
= STATUS_PENDING
;
353 TRACE("read %d more bytes %ld/%d so far\n",
354 result
, io_status
->Information
, fileio
->count
);
358 /******************************************************************************
359 * NtReadFile [NTDLL.@]
360 * ZwReadFile [NTDLL.@]
362 * Read from an open file handle.
365 * FileHandle [I] Handle returned from ZwOpenFile() or ZwCreateFile()
366 * Event [I] Event to signal upon completion (or NULL)
367 * ApcRoutine [I] Callback to call upon completion (or NULL)
368 * ApcContext [I] Context for ApcRoutine (or NULL)
369 * IoStatusBlock [O] Receives information about the operation on return
370 * Buffer [O] Destination for the data read
371 * Length [I] Size of Buffer
372 * ByteOffset [O] Destination for the new file pointer position (or NULL)
373 * Key [O] Function unknown (may be NULL)
376 * Success: 0. IoStatusBlock is updated, and the Information member contains
377 * The number of bytes read.
378 * Failure: An NTSTATUS error code describing the error.
380 NTSTATUS WINAPI
NtReadFile(HANDLE hFile
, HANDLE hEvent
,
381 PIO_APC_ROUTINE apc
, void* apc_user
,
382 PIO_STATUS_BLOCK io_status
, void* buffer
, ULONG length
,
383 PLARGE_INTEGER offset
, PULONG key
)
385 int unix_handle
, flags
;
388 TRACE("(%p,%p,%p,%p,%p,%p,0x%08lx,%p,%p),partial stub!\n",
389 hFile
,hEvent
,apc
,apc_user
,io_status
,buffer
,length
,offset
,key
);
391 io_status
->Information
= 0;
392 io_status
->u
.Status
= wine_server_handle_to_fd( hFile
, GENERIC_READ
, &unix_handle
, &type
, &flags
);
393 if (io_status
->u
.Status
) return io_status
->u
.Status
;
395 if (flags
& FD_FLAG_RECV_SHUTDOWN
)
397 wine_server_release_fd( hFile
, unix_handle
);
398 return STATUS_PIPE_DISCONNECTED
;
401 if (flags
& FD_FLAG_TIMEOUT
)
405 /* this shouldn't happen, but check it */
406 FIXME("NIY-hEvent\n");
407 wine_server_release_fd( hFile
, unix_handle
);
408 return STATUS_NOT_IMPLEMENTED
;
410 io_status
->u
.Status
= NtCreateEvent(&hEvent
, SYNCHRONIZE
, NULL
, 0, 0);
411 if (io_status
->u
.Status
)
413 wine_server_release_fd( hFile
, unix_handle
);
414 return io_status
->u
.Status
;
418 if (flags
& (FD_FLAG_OVERLAPPED
|FD_FLAG_TIMEOUT
))
423 if (!(ovp
= RtlAllocateHeap(GetProcessHeap(), 0, sizeof(async_fileio
))))
425 wine_server_release_fd( hFile
, unix_handle
);
426 return STATUS_NO_MEMORY
;
428 ovp
->async
.ops
= (apc
? &fileio_async_ops
: &fileio_nocomp_async_ops
);
429 ovp
->async
.handle
= hFile
;
430 ovp
->async
.fd
= unix_handle
; /* FIXME */
431 ovp
->async
.type
= ASYNC_TYPE_READ
;
432 ovp
->async
.func
= FILE_AsyncReadService
;
433 ovp
->async
.event
= hEvent
;
434 ovp
->async
.iosb
= io_status
;
436 if ( offset
== NULL
)
440 ovp
->offset
= offset
->u
.LowPart
;
441 if (offset
->u
.HighPart
) FIXME("NIY-high part\n");
444 ovp
->apc_user
= apc_user
;
445 ovp
->buffer
= buffer
;
448 io_status
->Information
= 0;
449 ret
= register_new_async(&ovp
->async
);
450 if (ret
!= STATUS_SUCCESS
)
452 if (flags
& FD_FLAG_TIMEOUT
)
454 NtWaitForSingleObject(hEvent
, TRUE
, NULL
);
459 LARGE_INTEGER timeout
;
461 /* let some APC be run, this will read some already pending data */
462 timeout
.u
.LowPart
= timeout
.u
.HighPart
= 0;
463 NtDelayExecution( TRUE
, &timeout
);
465 return io_status
->u
.Status
;
472 /* return SMB_ReadFile(hFile, unix_handle, buffer, length, io_status); */
473 wine_server_release_fd( hFile
, unix_handle
);
474 return STATUS_INVALID_HANDLE
;
476 case FD_TYPE_DEFAULT
:
477 /* normal unix file */
481 FIXME("Unsupported type of fd %d\n", type
);
482 wine_server_release_fd( hFile
, unix_handle
);
483 return STATUS_INVALID_HANDLE
;
488 FILE_POSITION_INFORMATION fpi
;
490 fpi
.CurrentByteOffset
= *offset
;
491 io_status
->u
.Status
= NtSetInformationFile(hFile
, io_status
, &fpi
, sizeof(fpi
),
492 FilePositionInformation
);
493 if (io_status
->u
.Status
)
495 wine_server_release_fd( hFile
, unix_handle
);
496 return io_status
->u
.Status
;
499 /* code for synchronous reads */
500 while ((io_status
->Information
= read( unix_handle
, buffer
, length
)) == -1)
502 if ((errno
== EAGAIN
) || (errno
== EINTR
)) continue;
503 if (errno
== EFAULT
) FIXME( "EFAULT handling broken for now\n" );
504 io_status
->u
.Status
= FILE_GetNtStatus();
507 wine_server_release_fd( hFile
, unix_handle
);
508 return io_status
->u
.Status
;
511 /***********************************************************************
512 * FILE_AsyncWriteService (INTERNAL)
514 * This function is called while the client is waiting on the
515 * server, so we can't make any server calls here.
517 static void FILE_AsyncWriteService(struct async_private
*ovp
)
519 async_fileio
*fileio
= (async_fileio
*) ovp
;
520 PIO_STATUS_BLOCK io_status
= fileio
->async
.iosb
;
522 int already
= io_status
->Information
;
524 TRACE("(%p %p)\n",io_status
,fileio
->buffer
);
526 /* write some data (non-blocking) */
528 if ( fileio
->fd_type
== FD_TYPE_SOCKET
)
529 result
= write(ovp
->fd
, &fileio
->buffer
[already
], fileio
->count
- already
);
532 result
= pwrite(ovp
->fd
, &fileio
->buffer
[already
], fileio
->count
- already
,
533 fileio
->offset
+ already
);
534 if ((result
< 0) && (errno
== ESPIPE
))
535 result
= write(ovp
->fd
, &fileio
->buffer
[already
], fileio
->count
- already
);
538 if ((result
< 0) && ((errno
== EAGAIN
) || (errno
== EINTR
)))
540 io_status
->u
.Status
= STATUS_PENDING
;
544 /* check to see if the transfer is complete */
547 io_status
->u
.Status
= FILE_GetNtStatus();
551 io_status
->Information
+= result
;
552 io_status
->u
.Status
= (io_status
->Information
< fileio
->count
) ? STATUS_PENDING
: STATUS_SUCCESS
;
553 TRACE("wrote %d more bytes %ld/%d so far\n",result
,io_status
->Information
,fileio
->count
);
556 /******************************************************************************
557 * NtWriteFile [NTDLL.@]
558 * ZwWriteFile [NTDLL.@]
560 * Write to an open file handle.
563 * FileHandle [I] Handle returned from ZwOpenFile() or ZwCreateFile()
564 * Event [I] Event to signal upon completion (or NULL)
565 * ApcRoutine [I] Callback to call upon completion (or NULL)
566 * ApcContext [I] Context for ApcRoutine (or NULL)
567 * IoStatusBlock [O] Receives information about the operation on return
568 * Buffer [I] Source for the data to write
569 * Length [I] Size of Buffer
570 * ByteOffset [O] Destination for the new file pointer position (or NULL)
571 * Key [O] Function unknown (may be NULL)
574 * Success: 0. IoStatusBlock is updated, and the Information member contains
575 * The number of bytes written.
576 * Failure: An NTSTATUS error code describing the error.
578 NTSTATUS WINAPI
NtWriteFile(HANDLE hFile
, HANDLE hEvent
,
579 PIO_APC_ROUTINE apc
, void* apc_user
,
580 PIO_STATUS_BLOCK io_status
,
581 const void* buffer
, ULONG length
,
582 PLARGE_INTEGER offset
, PULONG key
)
584 int unix_handle
, flags
;
587 TRACE("(%p,%p,%p,%p,%p,%p,0x%08lx,%p,%p)!\n",
588 hFile
,hEvent
,apc
,apc_user
,io_status
,buffer
,length
,offset
,key
);
590 TRACE("(%p,%p,%p,%p,%p,%p,0x%08lx,%p,%p),partial stub!\n",
591 hFile
,hEvent
,apc
,apc_user
,io_status
,buffer
,length
,offset
,key
);
593 io_status
->Information
= 0;
594 io_status
->u
.Status
= wine_server_handle_to_fd( hFile
, GENERIC_WRITE
, &unix_handle
, &type
, &flags
);
595 if (io_status
->u
.Status
) return io_status
->u
.Status
;
597 if (flags
& FD_FLAG_SEND_SHUTDOWN
)
599 wine_server_release_fd( hFile
, unix_handle
);
600 return STATUS_PIPE_DISCONNECTED
;
603 if (flags
& (FD_FLAG_OVERLAPPED
|FD_FLAG_TIMEOUT
))
608 if (!(ovp
= RtlAllocateHeap(GetProcessHeap(), 0, sizeof(async_fileio
))))
610 wine_server_release_fd( hFile
, unix_handle
);
611 return STATUS_NO_MEMORY
;
613 ovp
->async
.ops
= (apc
? &fileio_async_ops
: &fileio_nocomp_async_ops
);
614 ovp
->async
.handle
= hFile
;
615 ovp
->async
.fd
= unix_handle
; /* FIXME */
616 ovp
->async
.type
= ASYNC_TYPE_WRITE
;
617 ovp
->async
.func
= FILE_AsyncWriteService
;
618 ovp
->async
.event
= hEvent
;
619 ovp
->async
.iosb
= io_status
;
622 ovp
->offset
= offset
->u
.LowPart
;
623 if (offset
->u
.HighPart
) FIXME("NIY-high part\n");
628 ovp
->apc_user
= apc_user
;
629 ovp
->buffer
= (void*)buffer
;
632 io_status
->Information
= 0;
633 ret
= register_new_async(&ovp
->async
);
634 if (ret
!= STATUS_SUCCESS
)
636 if (flags
& FD_FLAG_TIMEOUT
)
638 NtWaitForSingleObject(hEvent
, TRUE
, NULL
);
643 LARGE_INTEGER timeout
;
645 /* let some APC be run, this will write as much data as possible */
646 timeout
.u
.LowPart
= timeout
.u
.HighPart
= 0;
647 NtDelayExecution( TRUE
, &timeout
);
649 return io_status
->u
.Status
;
655 wine_server_release_fd( hFile
, unix_handle
);
656 return STATUS_NOT_IMPLEMENTED
;
658 case FD_TYPE_DEFAULT
:
659 /* normal unix files */
660 if (unix_handle
== -1) return STATUS_INVALID_HANDLE
;
664 FIXME("Unsupported type of fd %d\n", type
);
665 wine_server_release_fd( hFile
, unix_handle
);
666 return STATUS_INVALID_HANDLE
;
671 FILE_POSITION_INFORMATION fpi
;
673 fpi
.CurrentByteOffset
= *offset
;
674 io_status
->u
.Status
= NtSetInformationFile(hFile
, io_status
, &fpi
, sizeof(fpi
),
675 FilePositionInformation
);
676 if (io_status
->u
.Status
)
678 wine_server_release_fd( hFile
, unix_handle
);
679 return io_status
->u
.Status
;
683 /* synchronous file write */
684 while ((io_status
->Information
= write( unix_handle
, buffer
, length
)) == -1)
686 if ((errno
== EAGAIN
) || (errno
== EINTR
)) continue;
687 if (errno
== EFAULT
) FIXME( "EFAULT handling broken for now\n" );
688 if (errno
== ENOSPC
) io_status
->u
.Status
= STATUS_DISK_FULL
;
689 else io_status
->u
.Status
= FILE_GetNtStatus();
692 wine_server_release_fd( hFile
, unix_handle
);
693 return io_status
->u
.Status
;
696 /**************************************************************************
697 * NtDeviceIoControlFile [NTDLL.@]
698 * ZwDeviceIoControlFile [NTDLL.@]
700 * Perform an I/O control operation on an open file handle.
703 * DeviceHandle [I] Handle returned from ZwOpenFile() or ZwCreateFile()
704 * Event [I] Event to signal upon completion (or NULL)
705 * ApcRoutine [I] Callback to call upon completion (or NULL)
706 * ApcContext [I] Context for ApcRoutine (or NULL)
707 * IoStatusBlock [O] Receives information about the operation on return
708 * IoControlCode [I] Control code for the operation to perform
709 * InputBuffer [I] Source for any input data required (or NULL)
710 * InputBufferSize [I] Size of InputBuffer
711 * OutputBuffer [O] Source for any output data returned (or NULL)
712 * OutputBufferSize [I] Size of OutputBuffer
715 * Success: 0. IoStatusBlock is updated.
716 * Failure: An NTSTATUS error code describing the error.
718 NTSTATUS WINAPI
NtDeviceIoControlFile(HANDLE DeviceHandle
, HANDLE hEvent
,
719 PIO_APC_ROUTINE UserApcRoutine
,
720 PVOID UserApcContext
,
721 PIO_STATUS_BLOCK IoStatusBlock
,
724 ULONG InputBufferSize
,
726 ULONG OutputBufferSize
)
728 TRACE("(%p,%p,%p,%p,%p,0x%08lx,%p,0x%08lx,%p,0x%08lx)\n",
729 DeviceHandle
, hEvent
, UserApcRoutine
, UserApcContext
,
730 IoStatusBlock
, IoControlCode
,
731 InputBuffer
, InputBufferSize
, OutputBuffer
, OutputBufferSize
);
733 if (CDROM_DeviceIoControl(DeviceHandle
, hEvent
,
734 UserApcRoutine
, UserApcContext
,
735 IoStatusBlock
, IoControlCode
,
736 InputBuffer
, InputBufferSize
,
737 OutputBuffer
, OutputBufferSize
) == STATUS_NO_SUCH_DEVICE
)
739 /* it wasn't a CDROM */
740 FIXME("Unimplemented dwIoControlCode=%08lx\n", IoControlCode
);
741 IoStatusBlock
->u
.Status
= STATUS_NOT_IMPLEMENTED
;
742 IoStatusBlock
->Information
= 0;
743 if (hEvent
) NtSetEvent(hEvent
, NULL
);
745 return IoStatusBlock
->u
.Status
;
748 /******************************************************************************
749 * NtFsControlFile [NTDLL.@]
750 * ZwFsControlFile [NTDLL.@]
752 NTSTATUS WINAPI
NtFsControlFile(
753 IN HANDLE DeviceHandle
,
754 IN HANDLE Event OPTIONAL
,
755 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL
,
756 IN PVOID ApcContext OPTIONAL
,
757 OUT PIO_STATUS_BLOCK IoStatusBlock
,
758 IN ULONG IoControlCode
,
759 IN PVOID InputBuffer
,
760 IN ULONG InputBufferSize
,
761 OUT PVOID OutputBuffer
,
762 IN ULONG OutputBufferSize
)
764 FIXME("(%p,%p,%p,%p,%p,0x%08lx,%p,0x%08lx,%p,0x%08lx): stub\n",
765 DeviceHandle
,Event
,ApcRoutine
,ApcContext
,IoStatusBlock
,IoControlCode
,
766 InputBuffer
,InputBufferSize
,OutputBuffer
,OutputBufferSize
);
770 /******************************************************************************
771 * NtSetVolumeInformationFile [NTDLL.@]
772 * ZwSetVolumeInformationFile [NTDLL.@]
774 * Set volume information for an open file handle.
777 * FileHandle [I] Handle returned from ZwOpenFile() or ZwCreateFile()
778 * IoStatusBlock [O] Receives information about the operation on return
779 * FsInformation [I] Source for volume information
780 * Length [I] Size of FsInformation
781 * FsInformationClass [I] Type of volume information to set
784 * Success: 0. IoStatusBlock is updated.
785 * Failure: An NTSTATUS error code describing the error.
787 NTSTATUS WINAPI
NtSetVolumeInformationFile(
788 IN HANDLE FileHandle
,
789 PIO_STATUS_BLOCK IoStatusBlock
,
792 FS_INFORMATION_CLASS FsInformationClass
)
794 FIXME("(%p,%p,%p,0x%08lx,0x%08x) stub\n",
795 FileHandle
,IoStatusBlock
,FsInformation
,Length
,FsInformationClass
);
799 /******************************************************************************
800 * NtQueryInformationFile [NTDLL.@]
801 * ZwQueryInformationFile [NTDLL.@]
803 * Get information about an open file handle.
806 * hFile [I] Handle returned from ZwOpenFile() or ZwCreateFile()
807 * io [O] Receives information about the operation on return
808 * ptr [O] Destination for file information
809 * len [I] Size of FileInformation
810 * class [I] Type of file information to get
813 * Success: 0. IoStatusBlock and FileInformation are updated.
814 * Failure: An NTSTATUS error code describing the error.
816 NTSTATUS WINAPI
NtQueryInformationFile( HANDLE hFile
, PIO_STATUS_BLOCK io
,
817 PVOID ptr
, LONG len
, FILE_INFORMATION_CLASS
class )
821 TRACE("(%p,%p,%p,0x%08lx,0x%08x)\n", hFile
, io
, ptr
, len
, class);
824 if ((io
->u
.Status
= wine_server_handle_to_fd( hFile
, 0, &fd
, NULL
, NULL
)))
829 case FileBasicInformation
:
831 FILE_BASIC_INFORMATION
*info
= ptr
;
833 if (len
< sizeof(*info
)) io
->u
.Status
= STATUS_INFO_LENGTH_MISMATCH
;
838 if (fstat( fd
, &st
) == -1)
839 io
->u
.Status
= FILE_GetNtStatus();
840 else if (!S_ISREG(st
.st_mode
) && !S_ISDIR(st
.st_mode
))
841 io
->u
.Status
= STATUS_INVALID_INFO_CLASS
;
844 if (S_ISDIR(st
.st_mode
)) info
->FileAttributes
= FILE_ATTRIBUTE_DIRECTORY
;
845 else info
->FileAttributes
= FILE_ATTRIBUTE_ARCHIVE
;
846 if (!(st
.st_mode
& S_IWUSR
)) info
->FileAttributes
|= FILE_ATTRIBUTE_READONLY
;
847 RtlSecondsSince1970ToTime( st
.st_mtime
, &info
->CreationTime
);
848 RtlSecondsSince1970ToTime( st
.st_mtime
, &info
->LastWriteTime
);
849 RtlSecondsSince1970ToTime( st
.st_ctime
, &info
->ChangeTime
);
850 RtlSecondsSince1970ToTime( st
.st_atime
, &info
->LastAccessTime
);
855 case FileStandardInformation
:
857 FILE_STANDARD_INFORMATION
*info
= ptr
;
859 if (len
< sizeof(*info
)) io
->u
.Status
= STATUS_INFO_LENGTH_MISMATCH
;
864 if (fstat( fd
, &st
) == -1) io
->u
.Status
= FILE_GetNtStatus();
867 if ((info
->Directory
= S_ISDIR(st
.st_mode
)))
869 info
->AllocationSize
.QuadPart
= 0;
870 info
->EndOfFile
.QuadPart
= 0;
871 info
->NumberOfLinks
= 1;
872 info
->DeletePending
= FALSE
;
876 info
->AllocationSize
.QuadPart
= (ULONGLONG
)st
.st_blocks
* 512;
877 info
->EndOfFile
.QuadPart
= st
.st_size
;
878 info
->NumberOfLinks
= st
.st_nlink
;
879 info
->DeletePending
= FALSE
; /* FIXME */
881 io
->Information
= sizeof(*info
);
886 case FilePositionInformation
:
888 FILE_POSITION_INFORMATION
*info
= ptr
;
890 if (len
< sizeof(*info
)) io
->u
.Status
= STATUS_INFO_LENGTH_MISMATCH
;
893 off_t res
= lseek( fd
, 0, SEEK_CUR
);
894 if (res
== (off_t
)-1) io
->u
.Status
= FILE_GetNtStatus();
897 info
->CurrentByteOffset
.QuadPart
= res
;
898 io
->Information
= sizeof(*info
);
904 FIXME("Unsupported class (%d)\n", class);
905 io
->u
.Status
= STATUS_NOT_IMPLEMENTED
;
908 wine_server_release_fd( hFile
, fd
);
912 /******************************************************************************
913 * NtSetInformationFile [NTDLL.@]
914 * ZwSetInformationFile [NTDLL.@]
916 * Set information about an open file handle.
919 * handle [I] Handle returned from ZwOpenFile() or ZwCreateFile()
920 * io [O] Receives information about the operation on return
921 * ptr [I] Source for file information
922 * len [I] Size of FileInformation
923 * class [I] Type of file information to set
926 * Success: 0. io is updated.
927 * Failure: An NTSTATUS error code describing the error.
929 NTSTATUS WINAPI
NtSetInformationFile(HANDLE handle
, PIO_STATUS_BLOCK io
,
930 PVOID ptr
, ULONG len
, FILE_INFORMATION_CLASS
class)
934 TRACE("(%p,%p,%p,0x%08lx,0x%08x)\n", handle
, io
, ptr
, len
, class);
936 if ((io
->u
.Status
= wine_server_handle_to_fd( handle
, 0, &fd
, NULL
, NULL
)))
939 io
->u
.Status
= STATUS_SUCCESS
;
942 case FileBasicInformation
:
943 if (len
>= sizeof(FILE_BASIC_INFORMATION
))
946 const FILE_BASIC_INFORMATION
*info
= ptr
;
949 if (info
->LastAccessTime
.QuadPart
|| info
->LastWriteTime
.QuadPart
)
952 struct timeval tv
[2];
954 if (!info
->LastAccessTime
.QuadPart
|| !info
->LastWriteTime
.QuadPart
)
957 tv
[0].tv_sec
= tv
[0].tv_usec
= 0;
958 tv
[1].tv_sec
= tv
[1].tv_usec
= 0;
959 if (!fstat( fd
, &st
))
961 tv
[0].tv_sec
= st
.st_atime
;
962 tv
[1].tv_sec
= st
.st_mtime
;
965 if (info
->LastAccessTime
.QuadPart
)
967 sec
= RtlLargeIntegerDivide( info
->LastAccessTime
.QuadPart
, 10000000, &nsec
);
968 tv
[0].tv_sec
= sec
- SECS_1601_TO_1970
;
969 tv
[0].tv_usec
= (UINT
)nsec
/ 10;
971 if (info
->LastWriteTime
.QuadPart
)
973 sec
= RtlLargeIntegerDivide( info
->LastWriteTime
.QuadPart
, 10000000, &nsec
);
974 tv
[1].tv_sec
= sec
- SECS_1601_TO_1970
;
975 tv
[1].tv_usec
= (UINT
)nsec
/ 10;
977 if (futimes( fd
, tv
) == -1) io
->u
.Status
= FILE_GetNtStatus();
979 #endif /* HAVE_FUTIMES */
980 if (io
->u
.Status
== STATUS_SUCCESS
&& info
->FileAttributes
)
982 if (fstat( fd
, &st
) == -1) io
->u
.Status
= FILE_GetNtStatus();
985 if (info
->FileAttributes
& FILE_ATTRIBUTE_READONLY
)
987 st
.st_mode
&= ~0222; /* clear write permission bits */
991 /* add write permission only where we already have read permission */
992 st
.st_mode
|= (0600 | ((st
.st_mode
& 044) >> 1)) & (~FILE_umask
);
994 if (fchmod( fd
, st
.st_mode
) == -1) io
->u
.Status
= FILE_GetNtStatus();
998 else io
->u
.Status
= STATUS_INVALID_PARAMETER_3
;
1001 case FilePositionInformation
:
1002 if (len
>= sizeof(FILE_POSITION_INFORMATION
))
1004 const FILE_POSITION_INFORMATION
*info
= ptr
;
1006 if (lseek( fd
, info
->CurrentByteOffset
.QuadPart
, SEEK_SET
) == (off_t
)-1)
1007 io
->u
.Status
= FILE_GetNtStatus();
1009 else io
->u
.Status
= STATUS_INVALID_PARAMETER_3
;
1013 FIXME("Unsupported class (%d)\n", class);
1014 io
->u
.Status
= STATUS_NOT_IMPLEMENTED
;
1017 wine_server_release_fd( handle
, fd
);
1018 io
->Information
= 0;
1019 return io
->u
.Status
;
1023 /******************************************************************************
1024 * NtQueryFullAttributesFile (NTDLL.@)
1026 NTSTATUS WINAPI
NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES
*attr
,
1027 FILE_NETWORK_OPEN_INFORMATION
*info
)
1029 ANSI_STRING unix_name
;
1032 if (!(status
= wine_nt_to_unix_file_name( attr
->ObjectName
, &unix_name
, FILE_OPEN
,
1033 !(attr
->Attributes
& OBJ_CASE_INSENSITIVE
) )))
1037 if (stat( unix_name
.Buffer
, &st
) == -1)
1038 status
= FILE_GetNtStatus();
1039 else if (!S_ISREG(st
.st_mode
) && !S_ISDIR(st
.st_mode
))
1040 status
= STATUS_INVALID_INFO_CLASS
;
1043 if (S_ISDIR(st
.st_mode
))
1045 info
->FileAttributes
= FILE_ATTRIBUTE_DIRECTORY
;
1046 info
->AllocationSize
.QuadPart
= 0;
1047 info
->EndOfFile
.QuadPart
= 0;
1051 info
->FileAttributes
= FILE_ATTRIBUTE_ARCHIVE
;
1052 info
->AllocationSize
.QuadPart
= (ULONGLONG
)st
.st_blocks
* 512;
1053 info
->EndOfFile
.QuadPart
= st
.st_size
;
1055 if (!(st
.st_mode
& S_IWUSR
)) info
->FileAttributes
|= FILE_ATTRIBUTE_READONLY
;
1056 RtlSecondsSince1970ToTime( st
.st_mtime
, &info
->CreationTime
);
1057 RtlSecondsSince1970ToTime( st
.st_mtime
, &info
->LastWriteTime
);
1058 RtlSecondsSince1970ToTime( st
.st_ctime
, &info
->ChangeTime
);
1059 RtlSecondsSince1970ToTime( st
.st_atime
, &info
->LastAccessTime
);
1060 if (DIR_is_hidden_file( attr
->ObjectName
))
1061 info
->FileAttributes
|= FILE_ATTRIBUTE_HIDDEN
;
1063 RtlFreeAnsiString( &unix_name
);
1065 else WARN("%s not found (%lx)\n", debugstr_us(attr
->ObjectName
), status
);
1070 /******************************************************************************
1071 * NtQueryAttributesFile (NTDLL.@)
1072 * ZwQueryAttributesFile (NTDLL.@)
1074 NTSTATUS WINAPI
NtQueryAttributesFile( const OBJECT_ATTRIBUTES
*attr
, FILE_BASIC_INFORMATION
*info
)
1076 FILE_NETWORK_OPEN_INFORMATION full_info
;
1079 if (!(status
= NtQueryFullAttributesFile( attr
, &full_info
)))
1081 info
->CreationTime
.QuadPart
= full_info
.CreationTime
.QuadPart
;
1082 info
->LastAccessTime
.QuadPart
= full_info
.LastAccessTime
.QuadPart
;
1083 info
->LastWriteTime
.QuadPart
= full_info
.LastWriteTime
.QuadPart
;
1084 info
->ChangeTime
.QuadPart
= full_info
.ChangeTime
.QuadPart
;
1085 info
->FileAttributes
= full_info
.FileAttributes
;
1091 /******************************************************************************
1092 * NtQueryVolumeInformationFile [NTDLL.@]
1093 * ZwQueryVolumeInformationFile [NTDLL.@]
1095 * Get volume information for an open file handle.
1098 * handle [I] Handle returned from ZwOpenFile() or ZwCreateFile()
1099 * io [O] Receives information about the operation on return
1100 * buffer [O] Destination for volume information
1101 * length [I] Size of FsInformation
1102 * info_class [I] Type of volume information to set
1105 * Success: 0. io and buffer are updated.
1106 * Failure: An NTSTATUS error code describing the error.
1108 NTSTATUS WINAPI
NtQueryVolumeInformationFile( HANDLE handle
, PIO_STATUS_BLOCK io
,
1109 PVOID buffer
, ULONG length
,
1110 FS_INFORMATION_CLASS info_class
)
1115 if ((io
->u
.Status
= wine_server_handle_to_fd( handle
, 0, &fd
, NULL
, NULL
)) != STATUS_SUCCESS
)
1116 return io
->u
.Status
;
1118 io
->u
.Status
= STATUS_NOT_IMPLEMENTED
;
1119 io
->Information
= 0;
1121 switch( info_class
)
1123 case FileFsVolumeInformation
:
1124 FIXME( "%p: volume info not supported\n", handle
);
1126 case FileFsLabelInformation
:
1127 FIXME( "%p: label info not supported\n", handle
);
1129 case FileFsSizeInformation
:
1130 if (length
< sizeof(FILE_FS_SIZE_INFORMATION
))
1131 io
->u
.Status
= STATUS_BUFFER_TOO_SMALL
;
1134 FILE_FS_SIZE_INFORMATION
*info
= buffer
;
1135 struct statvfs stvfs
;
1137 if (fstat( fd
, &st
) < 0)
1139 io
->u
.Status
= FILE_GetNtStatus();
1142 if (!S_ISREG(st
.st_mode
) && !S_ISDIR(st
.st_mode
))
1144 io
->u
.Status
= STATUS_INVALID_DEVICE_REQUEST
;
1147 if (fstatvfs( fd
, &stvfs
) < 0) io
->u
.Status
= FILE_GetNtStatus();
1150 info
->TotalAllocationUnits
.QuadPart
= stvfs
.f_blocks
;
1151 info
->AvailableAllocationUnits
.QuadPart
= stvfs
.f_bavail
;
1152 info
->SectorsPerAllocationUnit
= 1;
1153 info
->BytesPerSector
= stvfs
.f_frsize
;
1154 io
->Information
= sizeof(*info
);
1155 io
->u
.Status
= STATUS_SUCCESS
;
1159 case FileFsDeviceInformation
:
1160 if (length
< sizeof(FILE_FS_DEVICE_INFORMATION
))
1161 io
->u
.Status
= STATUS_BUFFER_TOO_SMALL
;
1164 FILE_FS_DEVICE_INFORMATION
*info
= buffer
;
1166 #if defined(linux) && defined(HAVE_FSTATFS)
1169 info
->Characteristics
= 0;
1171 if (fstat( fd
, &st
) < 0)
1173 io
->u
.Status
= FILE_GetNtStatus();
1176 if (S_ISCHR( st
.st_mode
))
1178 switch(major(st
.st_rdev
))
1181 info
->DeviceType
= FILE_DEVICE_NULL
;
1184 info
->DeviceType
= FILE_DEVICE_SERIAL_PORT
;
1187 info
->DeviceType
= FILE_DEVICE_PARALLEL_PORT
;
1190 info
->DeviceType
= FILE_DEVICE_UNKNOWN
;
1194 else if (S_ISBLK( st
.st_mode
))
1196 info
->DeviceType
= FILE_DEVICE_DISK
;
1198 else if (S_ISFIFO( st
.st_mode
) || S_ISSOCK( st
.st_mode
))
1200 info
->DeviceType
= FILE_DEVICE_NAMED_PIPE
;
1202 else /* regular file or directory */
1204 info
->Characteristics
|= FILE_DEVICE_IS_MOUNTED
;
1206 /* check for floppy disk */
1207 if (major(st
.st_dev
) == FLOPPY_MAJOR
)
1208 info
->Characteristics
|= FILE_REMOVABLE_MEDIA
;
1210 if (fstatfs( fd
, &stfs
) < 0) stfs
.f_type
= 0;
1211 switch (stfs
.f_type
)
1213 case 0x9660: /* iso9660 */
1214 case 0x15013346: /* udf */
1215 info
->DeviceType
= FILE_DEVICE_CD_ROM_FILE_SYSTEM
;
1216 info
->Characteristics
|= FILE_REMOVABLE_MEDIA
|FILE_READ_ONLY_DEVICE
;
1218 case 0x6969: /* nfs */
1219 case 0x517B: /* smbfs */
1220 case 0x564c: /* ncpfs */
1221 info
->DeviceType
= FILE_DEVICE_NETWORK_FILE_SYSTEM
;
1222 info
->Characteristics
|= FILE_REMOTE_DEVICE
;
1224 case 0x01021994: /* tmpfs */
1225 case 0x28cd3d45: /* cramfs */
1226 case 0x1373: /* devfs */
1227 case 0x9fa0: /* procfs */
1228 info
->DeviceType
= FILE_DEVICE_VIRTUAL_DISK
;
1231 info
->DeviceType
= FILE_DEVICE_DISK_FILE_SYSTEM
;
1237 if (!warned
++) FIXME( "device info not supported on this platform\n" );
1238 info
->DeviceType
= FILE_DEVICE_DISK_FILE_SYSTEM
;
1239 info
->Characteristics
= 0;
1241 io
->Information
= sizeof(*info
);
1242 io
->u
.Status
= STATUS_SUCCESS
;
1245 case FileFsAttributeInformation
:
1246 FIXME( "%p: attribute info not supported\n", handle
);
1248 case FileFsControlInformation
:
1249 FIXME( "%p: control info not supported\n", handle
);
1251 case FileFsFullSizeInformation
:
1252 FIXME( "%p: full size info not supported\n", handle
);
1254 case FileFsObjectIdInformation
:
1255 FIXME( "%p: object id info not supported\n", handle
);
1257 case FileFsMaximumInformation
:
1258 FIXME( "%p: maximum info not supported\n", handle
);
1261 io
->u
.Status
= STATUS_INVALID_PARAMETER
;
1264 wine_server_release_fd( handle
, fd
);
1265 return io
->u
.Status
;
1269 /******************************************************************
1270 * NtFlushBuffersFile (NTDLL.@)
1272 * Flush any buffered data on an open file handle.
1275 * FileHandle [I] Handle returned from ZwOpenFile() or ZwCreateFile()
1276 * IoStatusBlock [O] Receives information about the operation on return
1279 * Success: 0. IoStatusBlock is updated.
1280 * Failure: An NTSTATUS error code describing the error.
1282 NTSTATUS WINAPI
NtFlushBuffersFile( HANDLE hFile
, IO_STATUS_BLOCK
* IoStatusBlock
)
1285 HANDLE hEvent
= NULL
;
1287 SERVER_START_REQ( flush_file
)
1289 req
->handle
= hFile
;
1290 ret
= wine_server_call( req
);
1291 hEvent
= reply
->event
;
1296 ret
= NtWaitForSingleObject( hEvent
, FALSE
, NULL
);
1302 /******************************************************************
1303 * NtLockFile (NTDLL.@)
1307 NTSTATUS WINAPI
NtLockFile( HANDLE hFile
, HANDLE lock_granted_event
,
1308 PIO_APC_ROUTINE apc
, void* apc_user
,
1309 PIO_STATUS_BLOCK io_status
, PLARGE_INTEGER offset
,
1310 PLARGE_INTEGER count
, ULONG
* key
, BOOLEAN dont_wait
,
1317 if (apc
|| io_status
|| key
)
1319 FIXME("Unimplemented yet parameter\n");
1320 return STATUS_NOT_IMPLEMENTED
;
1325 SERVER_START_REQ( lock_file
)
1327 req
->handle
= hFile
;
1328 req
->offset_low
= offset
->u
.LowPart
;
1329 req
->offset_high
= offset
->u
.HighPart
;
1330 req
->count_low
= count
->u
.LowPart
;
1331 req
->count_high
= count
->u
.HighPart
;
1332 req
->shared
= !exclusive
;
1333 req
->wait
= !dont_wait
;
1334 ret
= wine_server_call( req
);
1335 handle
= reply
->handle
;
1336 async
= reply
->overlapped
;
1339 if (ret
!= STATUS_PENDING
)
1341 if (!ret
&& lock_granted_event
) NtSetEvent(lock_granted_event
, NULL
);
1347 FIXME( "Async I/O lock wait not implemented, might deadlock\n" );
1348 if (handle
) NtClose( handle
);
1349 return STATUS_PENDING
;
1353 NtWaitForSingleObject( handle
, FALSE
, NULL
);
1360 /* Unix lock conflict, sleep a bit and retry */
1361 time
.QuadPart
= 100 * (ULONGLONG
)10000;
1362 time
.QuadPart
= -time
.QuadPart
;
1363 NtDelayExecution( FALSE
, &time
);
1369 /******************************************************************
1370 * NtUnlockFile (NTDLL.@)
1374 NTSTATUS WINAPI
NtUnlockFile( HANDLE hFile
, PIO_STATUS_BLOCK io_status
,
1375 PLARGE_INTEGER offset
, PLARGE_INTEGER count
,
1380 TRACE( "%p %lx%08lx %lx%08lx\n",
1381 hFile
, offset
->u
.HighPart
, offset
->u
.LowPart
, count
->u
.HighPart
, count
->u
.LowPart
);
1383 if (io_status
|| key
)
1385 FIXME("Unimplemented yet parameter\n");
1386 return STATUS_NOT_IMPLEMENTED
;
1389 SERVER_START_REQ( unlock_file
)
1391 req
->handle
= hFile
;
1392 req
->offset_low
= offset
->u
.LowPart
;
1393 req
->offset_high
= offset
->u
.HighPart
;
1394 req
->count_low
= count
->u
.LowPart
;
1395 req
->count_high
= count
->u
.HighPart
;
1396 status
= wine_server_call( req
);