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
5c9eb190
Commit
5c9eb190
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 to write display settings.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ffa7c409
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
display.c
dlls/winemac.drv/display.c
+18
-16
No files found.
dlls/winemac.drv/display.c
View file @
5c9eb190
...
...
@@ -178,6 +178,14 @@ static BOOL read_registry_settings(const WCHAR *device_name, DEVMODEW *dm)
}
static
BOOL
set_setting_value
(
HKEY
hkey
,
const
char
*
name
,
DWORD
val
)
{
WCHAR
nameW
[
128
];
UNICODE_STRING
str
=
{
asciiz_to_unicode
(
nameW
,
name
)
-
sizeof
(
WCHAR
),
sizeof
(
nameW
),
nameW
};
return
!
NtSetValueKey
(
hkey
,
&
str
,
0
,
REG_DWORD
,
&
val
,
sizeof
(
val
));
}
static
BOOL
write_registry_settings
(
const
WCHAR
*
device_name
,
const
DEVMODEW
*
dm
)
{
WCHAR
wine_mac_reg_key
[
MAX_PATH
];
...
...
@@ -199,23 +207,17 @@ static BOOL write_registry_settings(const WCHAR *device_name, const DEVMODEW *dm
return
FALSE
;
}
#define set_value(name, data) \
if (RegSetValueExA(hkey, name, 0, REG_DWORD, (const BYTE*)(data), sizeof(DWORD))) \
ret = FALSE
ret
&=
set_setting_value
(
hkey
,
"DefaultSettings.BitsPerPel"
,
dm
->
dmBitsPerPel
);
ret
&=
set_setting_value
(
hkey
,
"DefaultSettings.XResolution"
,
dm
->
dmPelsWidth
);
ret
&=
set_setting_value
(
hkey
,
"DefaultSettings.YResolution"
,
dm
->
dmPelsHeight
);
ret
&=
set_setting_value
(
hkey
,
"DefaultSettings.VRefresh"
,
dm
->
dmDisplayFrequency
);
ret
&=
set_setting_value
(
hkey
,
"DefaultSettings.Flags"
,
dm
->
dmDisplayFlags
);
ret
&=
set_setting_value
(
hkey
,
"DefaultSettings.XPanning"
,
dm
->
dmPosition
.
x
);
ret
&=
set_setting_value
(
hkey
,
"DefaultSettings.YPanning"
,
dm
->
dmPosition
.
y
);
ret
&=
set_setting_value
(
hkey
,
"DefaultSettings.Orientation"
,
dm
->
dmDisplayOrientation
);
ret
&=
set_setting_value
(
hkey
,
"DefaultSettings.FixedOutput"
,
dm
->
dmDisplayFixedOutput
);
set_value
(
"DefaultSettings.BitsPerPel"
,
&
dm
->
dmBitsPerPel
);
set_value
(
"DefaultSettings.XResolution"
,
&
dm
->
dmPelsWidth
);
set_value
(
"DefaultSettings.YResolution"
,
&
dm
->
dmPelsHeight
);
set_value
(
"DefaultSettings.VRefresh"
,
&
dm
->
dmDisplayFrequency
);
set_value
(
"DefaultSettings.Flags"
,
&
dm
->
dmDisplayFlags
);
set_value
(
"DefaultSettings.XPanning"
,
&
dm
->
dmPosition
.
x
);
set_value
(
"DefaultSettings.YPanning"
,
&
dm
->
dmPosition
.
y
);
set_value
(
"DefaultSettings.Orientation"
,
&
dm
->
dmDisplayOrientation
);
set_value
(
"DefaultSettings.FixedOutput"
,
&
dm
->
dmDisplayFixedOutput
);
#undef set_value
RegCloseKey
(
hkey
);
NtClose
(
hkey
);
release_display_device_init_mutex
(
mutex
);
return
ret
;
}
...
...
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