Hallo,
appended patch exports FILE_DupUnixHandle() as wine_dup_unix_handle() from
kernel32. As FILE_DupUnixHandle uses it's own server-call, I thinks we need
it as wine-exported function.
Please comment if it is the right approach and apply if appropriate
Thanks
--
Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de
Free Software: If you contribute nothing, expect nothing
--
Index: wine/include/winbase.h
===================================================================
RCS file: /home/wine/wine/include/winbase.h,v
retrieving revision 1.142
diff -u -r1.142 winbase.h
--- wine/include/winbase.h 25 Apr 2002 21:34:24 -0000 1.142
+++ wine/include/winbase.h 9 May 2002 21:24:45 -0000
@@ -1747,7 +1747,7 @@
/* Wine internal functions */
BOOL WINAPI wine_get_unix_file_name( LPCSTR dos, LPSTR buffer, DWORD len );
-
+HANDLE WINAPI wine_dup_unix_handle( int fd, DWORD access, BOOL inherit );
/* a few optimizations for i386/gcc */
Index: wine/include/file.h
===================================================================
RCS file: /home/wine/wine/include/file.h,v
retrieving revision 1.41
diff -u -r1.41 file.h
--- wine/include/file.h 5 Apr 2002 22:53:57 -0000 1.41
+++ wine/include/file.h 9 May 2002 21:24:56 -0000
@@ -69,7 +69,6 @@
extern int FILE_strcasecmp( const char *str1, const char *str2 );
extern int FILE_strncasecmp( const char *str1, const char *str2, int len );
extern void FILE_SetDosError(void);
-extern HANDLE FILE_DupUnixHandle( int fd, DWORD access, BOOL inherit );
extern int FILE_GetUnixHandle( HANDLE handle, DWORD access );
extern BOOL FILE_Stat( LPCSTR unixName, BY_HANDLE_FILE_INFORMATION *info );
extern HFILE16 FILE_Dup2( HFILE16 hFile1, HFILE16 hFile2 );
Index: wine/dlls/kernel/kernel32.spec
===================================================================
RCS file: /home/wine/wine/dlls/kernel/kernel32.spec,v
retrieving revision 1.50
diff -u -r1.50 kernel32.spec
--- wine/dlls/kernel/kernel32.spec 9 May 2002 00:05:50 -0000 1.50
+++ wine/dlls/kernel/kernel32.spec 9 May 2002 21:25:50 -0000
@@ -1011,3 +1011,6 @@
# Unix files
@ stdcall wine_get_unix_file_name(str ptr long) wine_get_unix_file_name
+
+#Unix handles
+@ stdcall wine_dup_unix_handle(long long long) wine_dup_unix_handle
Index: wine/files/file.c
===================================================================
RCS file: /home/wine/wine/files/file.c,v
retrieving revision 1.145
diff -u -r1.145 file.c
--- wine/files/file.c 26 Apr 2002 18:31:19 -0000 1.145
+++ wine/files/file.c 9 May 2002 21:27:29 -0000
@@ -307,12 +307,12 @@
/***********************************************************************
- * FILE_DupUnixHandle
+ * wine_dup_unix_handle
*
* Duplicate a Unix handle into a task handle.
* Returns 0 on failure.
*/
-HANDLE FILE_DupUnixHandle( int fd, DWORD access, BOOL inherit )
+HANDLE WINAPI wine_dup_unix_handle( int fd, DWORD access, BOOL inherit )
{
HANDLE ret;
Index: wine/dlls/x11drv/x11drv_main.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/x11drv_main.c,v
retrieving revision 1.49
diff -u -r1.49 x11drv_main.c
--- wine/dlls/x11drv/x11drv_main.c 24 Apr 2002 21:32:11 -0000 1.49
+++ wine/dlls/x11drv/x11drv_main.c 9 May 2002 21:29:06 -0000
@@ -457,7 +457,7 @@
fcntl( ConnectionNumber(data->display), F_SETFD, 1 ); /* set close on exec flag */
if (synchronous) XSynchronize( data->display, True );
wine_tsx11_unlock();
- data->display_fd = FILE_DupUnixHandle( ConnectionNumber(data->display),
+ data->display_fd = wine_dup_unix_handle( ConnectionNumber(data->display),
GENERIC_READ | SYNCHRONIZE, FALSE );
data->process_event_count = 0;
NtCurrentTeb()->driver_data = data;
Index: wine/scheduler/process.c
===================================================================
RCS file: /home/wine/wine/scheduler/process.c,v
retrieving revision 1.179
diff -u -r1.179 process.c
--- wine/scheduler/process.c 29 Apr 2002 19:34:06 -0000 1.179
+++ wine/scheduler/process.c 9 May 2002 21:29:30 -0000
@@ -299,9 +299,9 @@
/* no parent, and no new console requested, create a simple console with bare handles to
* unix stdio input & output streams (aka simple console)
*/
- SetStdHandle( STD_INPUT_HANDLE, FILE_DupUnixHandle( 0, GENERIC_READ|SYNCHRONIZE, TRUE ));
- SetStdHandle( STD_OUTPUT_HANDLE, FILE_DupUnixHandle( 1, GENERIC_WRITE|SYNCHRONIZE, TRUE ));
- SetStdHandle( STD_ERROR_HANDLE, FILE_DupUnixHandle( 1, GENERIC_WRITE|SYNCHRONIZE, TRUE ));
+ SetStdHandle( STD_INPUT_HANDLE, wine_dup_unix_handle ( 0, GENERIC_READ|SYNCHRONIZE, TRUE ));
+ SetStdHandle( STD_OUTPUT_HANDLE, wine_dup_unix_handle ( 1, GENERIC_WRITE|SYNCHRONIZE, TRUE ));
+ SetStdHandle( STD_ERROR_HANDLE, wine_dup_unix_handle ( 1, GENERIC_WRITE|SYNCHRONIZE, TRUE ));
}
else if (!(main_create_flags & (DETACHED_PROCESS|CREATE_NEW_CONSOLE)))
{