Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
8320d678
Commit
8320d678
authored
Nov 22, 1998
by
Stephen Crowley
Committed by
Alexandre Julliard
Nov 22, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the DGA detection code in ddraw. You don't need root access,
having r+w access to /dev/mem is enough.
parent
1cd70566
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
8 deletions
+21
-8
ddraw.c
graphics/ddraw.c
+21
-8
No files found.
graphics/ddraw.c
View file @
8320d678
...
...
@@ -18,6 +18,7 @@
#include <assert.h>
#include "ts_xlib.h"
#include <sys/signal.h>
#include <fcntl.h>
#include "windows.h"
#include "winerror.h"
...
...
@@ -84,8 +85,15 @@ BOOL32
DDRAW_DGA_Available
()
{
#ifdef HAVE_LIBXXF86DGA
int
evbase
,
evret
;
return
(
getuid
()
==
0
)
&&
TSXF86DGAQueryExtension
(
display
,
&
evbase
,
&
evret
);
int
evbase
,
evret
,
fd
;
/* You don't have to be root to use DGA extensions. Simply having access to /dev/mem will do the trick */
/* This can be achieved by adding the user to the "kmem" group on Debian 2.x systems, don't know about */
/* others. --stephenc */
if
((
fd
=
open
(
"/dev/mem"
,
O_RDWR
))
!=
-
1
)
close
(
fd
);
return
(
fd
!=
-
1
)
&&
TSXF86DGAQueryExtension
(
display
,
&
evbase
,
&
evret
);
#else
/* defined(HAVE_LIBXXF86DGA) */
return
0
;
#endif
/* defined(HAVE_LIBXXF86DGA) */
...
...
@@ -2547,15 +2555,20 @@ HRESULT WINAPI DGA_DirectDrawCreate( LPDIRECTDRAW *lplpDD, LPUNKNOWN pUnkOuter)
#ifdef HAVE_LIBXXF86DGA
int
memsize
,
banksize
,
width
,
major
,
minor
,
flags
,
height
;
char
*
addr
;
int
fd
;
if
(
getuid
()
!=
0
)
{
MSG
(
"Must be root to use XF86DGA!
\n
"
);
MessageBox32A
(
0
,
"Using the XF86DGA extension requires the program to be run using UID 0."
,
"WINE DirectDraw"
,
MB_OK
|
MB_ICONSTOP
);
return
E_UNEXPECTED
;
/* Must be able to access /dev/mem for DGA extensions to work, root is not neccessary. --stephenc */
if
((
fd
=
open
(
"/dev/mem"
,
O_RDWR
))
!=
-
1
)
close
(
fd
);
if
(
fd
==
-
1
)
{
MSG
(
"Must be able to access /dev/mem to use XF86DGA!
\n
"
);
MessageBox32A
(
0
,
"Using the XF86DGA extension requires access to /dev/mem."
,
"WINE DirectDraw"
,
MB_OK
|
MB_ICONSTOP
);
return
E_UNEXPECTED
;
}
if
(
!
DDRAW_DGA_Available
())
{
TRACE
(
ddraw
,
"No XF86DGA detected.
\n
"
);
return
DDERR_GENERIC
;
TRACE
(
ddraw
,
"No XF86DGA detected.
\n
"
);
return
DDERR_GENERIC
;
}
*
lplpDD
=
(
LPDIRECTDRAW
)
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirectDraw
));
(
*
lplpDD
)
->
lpvtbl
=
&
dga_ddvt
;
...
...
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