Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gabriel Ivăncescu
wine
Commits
1f31fda0
Commit
1f31fda0
authored
2 years ago
by
Paul Gofman
Committed by
Alexandre Julliard
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
win32u: Get friendly monitor name from EDID in NtUserDisplayConfigGetDeviceInfo().
parent
f00dcb4b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/win32u/sysparams.c
+23
-2
23 additions, 2 deletions
dlls/win32u/sysparams.c
with
23 additions
and
2 deletions
dlls/win32u/sysparams.c
+
23
−
2
View file @
1f31fda0
...
...
@@ -220,12 +220,15 @@ struct adapter
};
#define MONITOR_INFO_HAS_MONITOR_ID 0x00000001
#define MONITOR_INFO_HAS_MONITOR_NAME 0x00000002
struct
edid_monitor_info
{
unsigned
int
flags
;
/* MONITOR_INFO_HAS_MONITOR_ID */
unsigned
short
manufacturer
,
product_code
;
char
monitor_id_string
[
8
];
/* MONITOR_INFO_HAS_MONITOR_NAME */
WCHAR
monitor_name
[
14
];
};
struct
monitor
...
...
@@ -451,9 +454,10 @@ C_ASSERT(sizeof(DEVMODEW) - offsetof(DEVMODEW, dmFields) == 0x94);
static
void
get_monitor_info_from_edid
(
struct
edid_monitor_info
*
info
,
const
unsigned
char
*
edid
,
unsigned
int
edid_len
)
{
unsigned
int
i
,
j
;
unsigned
short
w
;
unsigned
char
d
;
unsigned
int
i
;
const
char
*
s
;
info
->
flags
=
0
;
if
(
!
edid
||
edid_len
<
128
)
return
;
...
...
@@ -473,6 +477,19 @@ static void get_monitor_info_from_edid( struct edid_monitor_info *info, const un
sprintf
(
info
->
monitor_id_string
+
3
,
"%04X"
,
w
);
info
->
flags
=
MONITOR_INFO_HAS_MONITOR_ID
;
TRACE
(
"Monitor id %s.
\n
"
,
info
->
monitor_id_string
);
for
(
i
=
0
;
i
<
4
;
++
i
)
{
if
(
edid
[
54
+
i
*
18
+
3
]
!=
0xfc
)
continue
;
/* "Display name" ASCII descriptor. */
s
=
(
const
char
*
)
&
edid
[
54
+
i
*
18
+
5
];
for
(
j
=
0
;
s
[
j
]
&&
j
<
13
;
++
j
)
info
->
monitor_name
[
j
]
=
s
[
j
];
while
(
j
&&
isspace
(
s
[
j
-
1
]))
--
j
;
info
->
monitor_name
[
j
]
=
0
;
info
->
flags
|=
MONITOR_INFO_HAS_MONITOR_NAME
;
break
;
}
}
static
BOOL
write_adapter_mode
(
HKEY
adapter_key
,
UINT
index
,
const
DEVMODEW
*
mode
)
...
...
@@ -5731,7 +5748,6 @@ NTSTATUS WINAPI NtUserDisplayConfigGetDeviceInfo( DISPLAYCONFIG_DEVICE_INFO_HEAD
continue
;
target_name
->
outputTechnology
=
DISPLAYCONFIG_OUTPUT_TECHNOLOGY_INTERNAL
;
/* FIXME: get real monitor name. */
snprintf
(
buffer
,
ARRAY_SIZE
(
buffer
),
"Display%u"
,
monitor
->
output_id
+
1
);
asciiz_to_unicode
(
target_name
->
monitorFriendlyDeviceName
,
buffer
);
lstrcpyW
(
target_name
->
monitorDevicePath
,
monitor
->
dev
.
interface_name
);
...
...
@@ -5741,6 +5757,11 @@ NTSTATUS WINAPI NtUserDisplayConfigGetDeviceInfo( DISPLAYCONFIG_DEVICE_INFO_HEAD
target_name
->
edidProductCodeId
=
monitor
->
edid_info
.
product_code
;
target_name
->
flags
.
edidIdsValid
=
1
;
}
if
(
monitor
->
edid_info
.
flags
&
MONITOR_INFO_HAS_MONITOR_NAME
)
{
wcscpy
(
target_name
->
monitorFriendlyDeviceName
,
monitor
->
edid_info
.
monitor_name
);
target_name
->
flags
.
friendlyNameFromEdid
=
1
;
}
ret
=
STATUS_SUCCESS
;
break
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment