Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
ffa7c409
Commit
ffa7c409
authored
May 13, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
May 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Directly use ntdll for querying display settings.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
718db043
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
20 deletions
+32
-20
display.c
dlls/winemac.drv/display.c
+26
-19
macdrv.h
dlls/winemac.drv/macdrv.h
+5
-0
macdrv_main.c
dlls/winemac.drv/macdrv_main.c
+1
-1
No files found.
dlls/winemac.drv/display.c
View file @
ffa7c409
...
@@ -117,12 +117,27 @@ static BOOL get_display_device_reg_key(const WCHAR *device_name, WCHAR *key, uns
...
@@ -117,12 +117,27 @@ static BOOL get_display_device_reg_key(const WCHAR *device_name, WCHAR *key, uns
}
}
static
BOOL
query_display_setting
(
HKEY
hkey
,
const
char
*
name
,
DWORD
*
ret
)
{
char
buffer
[
1024
];
WCHAR
nameW
[
128
];
KEY_VALUE_PARTIAL_INFORMATION
*
value
=
(
void
*
)
buffer
;
asciiz_to_unicode
(
nameW
,
name
);
if
(
query_reg_value
(
hkey
,
nameW
,
value
,
sizeof
(
buffer
))
!=
sizeof
(
DWORD
)
||
value
->
Type
!=
REG_DWORD
)
return
FALSE
;
*
ret
=
*
(
DWORD
*
)
value
->
Data
;
return
TRUE
;
}
static
BOOL
read_registry_settings
(
const
WCHAR
*
device_name
,
DEVMODEW
*
dm
)
static
BOOL
read_registry_settings
(
const
WCHAR
*
device_name
,
DEVMODEW
*
dm
)
{
{
WCHAR
wine_mac_reg_key
[
MAX_PATH
];
WCHAR
wine_mac_reg_key
[
MAX_PATH
];
HANDLE
mutex
;
HANDLE
mutex
;
HKEY
hkey
;
HKEY
hkey
;
DWORD
type
,
size
;
BOOL
ret
=
TRUE
;
BOOL
ret
=
TRUE
;
dm
->
dmFields
=
0
;
dm
->
dmFields
=
0
;
...
@@ -140,32 +155,24 @@ static BOOL read_registry_settings(const WCHAR *device_name, DEVMODEW *dm)
...
@@ -140,32 +155,24 @@ static BOOL read_registry_settings(const WCHAR *device_name, DEVMODEW *dm)
return
FALSE
;
return
FALSE
;
}
}
#define query_value(name, data) \
ret
&=
query_display_setting
(
hkey
,
"DefaultSettings.BitsPerPel"
,
&
dm
->
dmBitsPerPel
);
size = sizeof(DWORD); \
if (RegQueryValueExA(hkey, name, 0, &type, (LPBYTE)(data), &size) || \
type != REG_DWORD || size != sizeof(DWORD)) \
ret = FALSE
query_value
(
"DefaultSettings.BitsPerPel"
,
&
dm
->
dmBitsPerPel
);
dm
->
dmFields
|=
DM_BITSPERPEL
;
dm
->
dmFields
|=
DM_BITSPERPEL
;
query_value
(
"DefaultSettings.XResolution"
,
&
dm
->
dmPelsWidth
);
ret
&=
query_display_setting
(
hkey
,
"DefaultSettings.XResolution"
,
&
dm
->
dmPelsWidth
);
dm
->
dmFields
|=
DM_PELSWIDTH
;
dm
->
dmFields
|=
DM_PELSWIDTH
;
query_value
(
"DefaultSettings.YResolution"
,
&
dm
->
dmPelsHeight
);
ret
&=
query_display_setting
(
hkey
,
"DefaultSettings.YResolution"
,
&
dm
->
dmPelsHeight
);
dm
->
dmFields
|=
DM_PELSHEIGHT
;
dm
->
dmFields
|=
DM_PELSHEIGHT
;
query_value
(
"DefaultSettings.VRefresh"
,
&
dm
->
dmDisplayFrequency
);
ret
&=
query_display_setting
(
hkey
,
"DefaultSettings.VRefresh"
,
&
dm
->
dmDisplayFrequency
);
dm
->
dmFields
|=
DM_DISPLAYFREQUENCY
;
dm
->
dmFields
|=
DM_DISPLAYFREQUENCY
;
query_value
(
"DefaultSettings.Flags"
,
&
dm
->
dmDisplayFlags
);
ret
&=
query_display_setting
(
hkey
,
"DefaultSettings.Flags"
,
&
dm
->
dmDisplayFlags
);
dm
->
dmFields
|=
DM_DISPLAYFLAGS
;
dm
->
dmFields
|=
DM_DISPLAYFLAGS
;
query_value
(
"DefaultSettings.XPanning"
,
&
dm
->
dmPosition
.
x
);
ret
&=
query_display_setting
(
hkey
,
"DefaultSettings.XPanning"
,
(
DWORD
*
)
&
dm
->
dmPosition
.
x
);
query_value
(
"DefaultSettings.YPanning"
,
&
dm
->
dmPosition
.
y
);
ret
&=
query_display_setting
(
hkey
,
"DefaultSettings.YPanning"
,
(
DWORD
*
)
&
dm
->
dmPosition
.
y
);
dm
->
dmFields
|=
DM_POSITION
;
dm
->
dmFields
|=
DM_POSITION
;
query_value
(
"DefaultSettings.Orientation"
,
&
dm
->
dmDisplayOrientation
);
ret
&=
query_display_setting
(
hkey
,
"DefaultSettings.Orientation"
,
&
dm
->
dmDisplayOrientation
);
dm
->
dmFields
|=
DM_DISPLAYORIENTATION
;
dm
->
dmFields
|=
DM_DISPLAYORIENTATION
;
query_value
(
"DefaultSettings.FixedOutput"
,
&
dm
->
dmDisplayFixedOutput
);
ret
&=
query_display_setting
(
hkey
,
"DefaultSettings.FixedOutput"
,
&
dm
->
dmDisplayFixedOutput
);
#undef query_value
RegCloseKey
(
hkey
);
NtClose
(
hkey
);
release_display_device_init_mutex
(
mutex
);
release_display_device_init_mutex
(
mutex
);
return
ret
;
return
ret
;
}
}
...
...
dlls/winemac.drv/macdrv.h
View file @
ffa7c409
...
@@ -293,6 +293,11 @@ extern void macdrv_im_set_text(const macdrv_event *event) DECLSPEC_HIDDEN;
...
@@ -293,6 +293,11 @@ extern void macdrv_im_set_text(const macdrv_event *event) DECLSPEC_HIDDEN;
extern
void
macdrv_sent_text_input
(
const
macdrv_event
*
event
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_sent_text_input
(
const
macdrv_event
*
event
)
DECLSPEC_HIDDEN
;
extern
BOOL
query_ime_char_rect
(
macdrv_query
*
query
)
DECLSPEC_HIDDEN
;
extern
BOOL
query_ime_char_rect
(
macdrv_query
*
query
)
DECLSPEC_HIDDEN
;
/* registry helpers */
extern
ULONG
query_reg_value
(
HKEY
hkey
,
const
WCHAR
*
name
,
KEY_VALUE_PARTIAL_INFORMATION
*
info
,
ULONG
size
)
DECLSPEC_HIDDEN
;
/* string helpers */
/* string helpers */
static
inline
void
ascii_to_unicode
(
WCHAR
*
dst
,
const
char
*
src
,
size_t
len
)
static
inline
void
ascii_to_unicode
(
WCHAR
*
dst
,
const
char
*
src
,
size_t
len
)
...
...
dlls/winemac.drv/macdrv_main.c
View file @
ffa7c409
...
@@ -152,7 +152,7 @@ static HKEY open_hkcu_key(const char *name)
...
@@ -152,7 +152,7 @@ static HKEY open_hkcu_key(const char *name)
}
}
static
ULONG
query_reg_value
(
HKEY
hkey
,
const
WCHAR
*
name
,
KEY_VALUE_PARTIAL_INFORMATION
*
info
,
ULONG
size
)
ULONG
query_reg_value
(
HKEY
hkey
,
const
WCHAR
*
name
,
KEY_VALUE_PARTIAL_INFORMATION
*
info
,
ULONG
size
)
{
{
UNICODE_STRING
str
;
UNICODE_STRING
str
;
...
...
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