Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
be367c72
Commit
be367c72
authored
May 30, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added wine_server_fd_to_handle to replace FILE_DupUnixHandle.
parent
9851f7a9
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
41 additions
and
33 deletions
+41
-33
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-0
x11drv_main.c
dlls/x11drv/x11drv_main.c
+8
-4
file.c
files/file.c
+0
-25
file.h
include/file.h
+0
-1
server.h
include/wine/server.h
+1
-0
client.c
scheduler/client.c
+24
-0
process.c
scheduler/process.c
+7
-3
No files found.
dlls/ntdll/ntdll.spec
View file @
be367c72
...
...
@@ -1023,6 +1023,7 @@ name ntdll
# Server interface
@ cdecl -norelay wine_server_call(ptr) wine_server_call
@ cdecl wine_server_fd_to_handle(long long long ptr) wine_server_fd_to_handle
@ cdecl wine_server_handle_to_fd(long long ptr ptr ptr) wine_server_handle_to_fd
# Codepages
...
...
dlls/x11drv/x11drv_main.c
View file @
be367c72
...
...
@@ -36,15 +36,15 @@
#include "wine/winbase16.h"
#include "winreg.h"
#include "wine/debug.h"
#include "gdi.h"
#include "file.h"
#include "user.h"
#include "win.h"
#include "wine_gl.h"
#include "x11drv.h"
#include "xvidmode.h"
#include "dga2.h"
#include "wine/server.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
x11drv
);
...
...
@@ -449,8 +449,12 @@ struct x11drv_thread_data *x11drv_init_thread_data(void)
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
),
GENERIC_READ
|
SYNCHRONIZE
,
FALSE
);
if
(
wine_server_fd_to_handle
(
ConnectionNumber
(
data
->
display
),
GENERIC_READ
|
SYNCHRONIZE
,
FALSE
,
&
data
->
display_fd
))
{
MESSAGE
(
"x11drv: Can't allocate handle for display fd
\n
"
);
ExitProcess
(
1
);
}
data
->
process_event_count
=
0
;
NtCurrentTeb
()
->
driver_data
=
data
;
return
data
;
...
...
files/file.c
View file @
be367c72
...
...
@@ -307,31 +307,6 @@ void FILE_SetDosError(void)
/***********************************************************************
* FILE_DupUnixHandle
*
* Duplicate a Unix handle into a task handle.
* Returns 0 on failure.
*/
HANDLE
FILE_DupUnixHandle
(
int
fd
,
DWORD
access
,
BOOL
inherit
)
{
HANDLE
ret
;
wine_server_send_fd
(
fd
);
SERVER_START_REQ
(
alloc_file_handle
)
{
req
->
access
=
access
;
req
->
inherit
=
inherit
;
req
->
fd
=
fd
;
wine_server_call
(
req
);
ret
=
reply
->
handle
;
}
SERVER_END_REQ
;
return
ret
;
}
/***********************************************************************
* FILE_GetUnixHandleType
*
* Retrieve the Unix handle corresponding to a file handle.
...
...
include/file.h
View file @
be367c72
...
...
@@ -69,7 +69,6 @@ extern mode_t FILE_umask;
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
);
...
...
include/wine/server.h
View file @
be367c72
...
...
@@ -51,6 +51,7 @@ struct __server_request_info
extern
unsigned
int
wine_server_call
(
void
*
req_ptr
);
extern
void
wine_server_send_fd
(
int
fd
);
extern
int
wine_server_fd_to_handle
(
int
fd
,
unsigned
int
access
,
int
inherit
,
obj_handle_t
*
handle
);
extern
int
wine_server_handle_to_fd
(
obj_handle_t
handle
,
unsigned
int
access
,
int
*
unix_fd
,
enum
fd_type
*
type
,
int
*
flags
);
...
...
scheduler/client.c
View file @
be367c72
...
...
@@ -365,6 +365,30 @@ inline static int store_cached_fd( int fd, obj_handle_t handle )
/***********************************************************************
* wine_server_fd_to_handle (NTDLL.@)
*
* Allocate a file handle for a Unix fd.
*/
int
wine_server_fd_to_handle
(
int
fd
,
unsigned
int
access
,
int
inherit
,
obj_handle_t
*
handle
)
{
int
ret
;
*
handle
=
0
;
wine_server_send_fd
(
fd
);
SERVER_START_REQ
(
alloc_file_handle
)
{
req
->
access
=
access
;
req
->
inherit
=
inherit
;
req
->
fd
=
fd
;
if
(
!
(
ret
=
wine_server_call
(
req
)))
*
handle
=
reply
->
handle
;
}
SERVER_END_REQ
;
return
ret
;
}
/***********************************************************************
* wine_server_handle_to_fd (NTDLL.@)
*
* Retrieve the Unix fd corresponding to a file handle.
...
...
scheduler/process.c
View file @
be367c72
...
...
@@ -403,9 +403,13 @@ static BOOL process_init( char *argv[] )
/* 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
));
HANDLE
handle
;
wine_server_fd_to_handle
(
0
,
GENERIC_READ
|
SYNCHRONIZE
,
TRUE
,
&
handle
);
SetStdHandle
(
STD_INPUT_HANDLE
,
handle
);
wine_server_fd_to_handle
(
1
,
GENERIC_WRITE
|
SYNCHRONIZE
,
TRUE
,
&
handle
);
SetStdHandle
(
STD_OUTPUT_HANDLE
,
handle
);
wine_server_fd_to_handle
(
1
,
GENERIC_WRITE
|
SYNCHRONIZE
,
TRUE
,
&
handle
);
SetStdHandle
(
STD_ERROR_HANDLE
,
handle
);
}
else
if
(
!
(
main_create_flags
&
(
DETACHED_PROCESS
|
CREATE_NEW_CONSOLE
)))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment