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
2fe7c110
Commit
2fe7c110
authored
Aug 15, 2001
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed win16drv initialisation.
parent
97ac9612
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
29 deletions
+39
-29
driver.c
dlls/gdi/driver.c
+13
-5
init.c
graphics/win16drv/init.c
+25
-23
win16drv.h
include/win16drv.h
+1
-1
No files found.
dlls/gdi/driver.c
View file @
2fe7c110
...
...
@@ -10,6 +10,7 @@
#include "ntddk.h"
#include "gdi.h"
#include "win16drv.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL
(
driver
);
...
...
@@ -25,6 +26,7 @@ struct graphics_driver
static
struct
graphics_driver
*
first_driver
;
static
struct
graphics_driver
*
display_driver
;
static
const
DC_FUNCTIONS
*
win16_driver
;
/**********************************************************************
...
...
@@ -230,8 +232,9 @@ const DC_FUNCTIONS *DRIVER_load_driver( LPCSTR name )
if
(
!
(
module
=
LoadLibraryA
(
name
)))
{
if
(
!
win16_driver
)
win16_driver
=
WIN16DRV_Init
();
RtlReleasePebLock
();
return
NULL
;
return
win16_driver
;
}
if
(
!
(
driver
=
create_driver
(
module
)))
...
...
@@ -257,10 +260,13 @@ const DC_FUNCTIONS *DRIVER_get_driver( const DC_FUNCTIONS *funcs )
struct
graphics_driver
*
driver
;
RtlAcquirePebLock
();
for
(
driver
=
first_driver
;
driver
;
driver
=
driver
->
next
)
if
(
&
driver
->
funcs
==
funcs
)
break
;
if
(
!
driver
)
ERR
(
"driver not found, trouble ahead
\n
"
);
driver
->
count
++
;
if
(
funcs
!=
win16_driver
)
{
for
(
driver
=
first_driver
;
driver
;
driver
=
driver
->
next
)
if
(
&
driver
->
funcs
==
funcs
)
break
;
if
(
!
driver
)
ERR
(
"driver not found, trouble ahead
\n
"
);
driver
->
count
++
;
}
RtlReleasePebLock
();
return
funcs
;
}
...
...
@@ -277,6 +283,8 @@ void DRIVER_release_driver( const DC_FUNCTIONS *funcs )
RtlAcquirePebLock
();
if
(
funcs
==
win16_driver
)
goto
done
;
for
(
driver
=
first_driver
;
driver
;
driver
=
driver
->
next
)
if
(
&
driver
->
funcs
==
funcs
)
break
;
...
...
graphics/win16drv/init.c
View file @
2fe7c110
...
...
@@ -146,16 +146,36 @@ static const DC_FUNCTIONS WIN16DRV_Funcs =
};
/* FIXME: this no longer works */
#if 0
/**********************************************************************
* WIN16DRV_Init
*/
BOOL
WIN16DRV_Init(void)
const
DC_FUNCTIONS
*
WIN16DRV_Init
(
void
)
{
return DRIVER_RegisterDriver( NULL /* generic driver */, &WIN16DRV_Funcs );
static
int
enabled
=
-
1
;
if
(
enabled
==
-
1
)
{
char
printerEnabled
[
20
];
HKEY
hkey
;
/* default value */
strcpy
(
printerEnabled
,
"off"
);
if
(
!
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
Wine
\\
Config
\\
wine"
,
&
hkey
))
{
DWORD
type
,
count
=
sizeof
(
printerEnabled
);
RegQueryValueExA
(
hkey
,
"printer"
,
0
,
&
type
,
printerEnabled
,
&
count
);
RegCloseKey
(
hkey
);
}
enabled
=
!
strcasecmp
(
printerEnabled
,
"on"
);
if
(
!
enabled
)
{
MESSAGE
(
"Printing disabled in wine.conf or .winerc file
\n
"
);
MESSAGE
(
"Use
\"
printer=on
\"
in the
\"
[wine]
\"
section to enable it.
\n
"
);
}
}
return
enabled
?
&
WIN16DRV_Funcs
:
NULL
;
}
#endif
/* Tempory functions, for initialising structures */
/* These values should be calculated, not hardcoded */
...
...
@@ -203,24 +223,6 @@ BOOL WIN16DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device, LPCSTR output,
int
nPDEVICEsize
;
PDEVICE_HEADER
*
pPDH
;
WIN16DRV_PDEVICE
*
physDev
;
char
printerEnabled
[
20
];
HKEY
hkey
;
/* default value */
strcpy
(
printerEnabled
,
"off"
);
if
(
!
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
Wine
\\
Config
\\
wine"
,
&
hkey
))
{
DWORD
type
,
count
=
sizeof
(
printerEnabled
);
RegQueryValueExA
(
hkey
,
"printer"
,
0
,
&
type
,
printerEnabled
,
&
count
);
RegCloseKey
(
hkey
);
}
if
(
strcasecmp
(
printerEnabled
,
"on"
))
{
MESSAGE
(
"Printing disabled in wine.conf or .winerc file
\n
"
);
MESSAGE
(
"Use
\"
printer=on
\"
in the
\"
[wine]
\"
section to enable it.
\n
"
);
return
FALSE
;
}
TRACE
(
"In creatdc for (%s,%s,%s) initData 0x%p
\n
"
,
driver
,
device
,
output
,
initData
);
...
...
include/win16drv.h
View file @
2fe7c110
...
...
@@ -240,7 +240,7 @@ extern WORD PRTDRV_GetCharWidth(LPPDEVICE lpDestDev, LPINT lpBuffer,
/* Wine driver functions */
extern
BOOL
WIN16DRV_Init
(
void
);
extern
const
DC_FUNCTIONS
*
WIN16DRV_Init
(
void
);
extern
BOOL
WIN16DRV_GetCharWidth
(
struct
tagDC
*
dc
,
UINT
firstChar
,
UINT
lastChar
,
LPINT
buffer
);
...
...
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