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
1f31fda0
Commit
1f31fda0
authored
Feb 13, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
Feb 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Get friendly monitor name from EDID in NtUserDisplayConfigGetDeviceInfo().
parent
f00dcb4b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
sysparams.c
dlls/win32u/sysparams.c
+23
-2
No files found.
dlls/win32u/sysparams.c
View file @
1f31fda0
...
@@ -220,12 +220,15 @@ struct adapter
...
@@ -220,12 +220,15 @@ struct adapter
};
};
#define MONITOR_INFO_HAS_MONITOR_ID 0x00000001
#define MONITOR_INFO_HAS_MONITOR_ID 0x00000001
#define MONITOR_INFO_HAS_MONITOR_NAME 0x00000002
struct
edid_monitor_info
struct
edid_monitor_info
{
{
unsigned
int
flags
;
unsigned
int
flags
;
/* MONITOR_INFO_HAS_MONITOR_ID */
/* MONITOR_INFO_HAS_MONITOR_ID */
unsigned
short
manufacturer
,
product_code
;
unsigned
short
manufacturer
,
product_code
;
char
monitor_id_string
[
8
];
char
monitor_id_string
[
8
];
/* MONITOR_INFO_HAS_MONITOR_NAME */
WCHAR
monitor_name
[
14
];
};
};
struct
monitor
struct
monitor
...
@@ -451,9 +454,10 @@ C_ASSERT(sizeof(DEVMODEW) - offsetof(DEVMODEW, dmFields) == 0x94);
...
@@ -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
)
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
short
w
;
unsigned
char
d
;
unsigned
char
d
;
unsigned
int
i
;
const
char
*
s
;
info
->
flags
=
0
;
info
->
flags
=
0
;
if
(
!
edid
||
edid_len
<
128
)
return
;
if
(
!
edid
||
edid_len
<
128
)
return
;
...
@@ -473,6 +477,19 @@ static void get_monitor_info_from_edid( struct edid_monitor_info *info, const un
...
@@ -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
);
sprintf
(
info
->
monitor_id_string
+
3
,
"%04X"
,
w
);
info
->
flags
=
MONITOR_INFO_HAS_MONITOR_ID
;
info
->
flags
=
MONITOR_INFO_HAS_MONITOR_ID
;
TRACE
(
"Monitor id %s.
\n
"
,
info
->
monitor_id_string
);
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
)
static
BOOL
write_adapter_mode
(
HKEY
adapter_key
,
UINT
index
,
const
DEVMODEW
*
mode
)
...
@@ -5731,7 +5748,6 @@ NTSTATUS WINAPI NtUserDisplayConfigGetDeviceInfo( DISPLAYCONFIG_DEVICE_INFO_HEAD
...
@@ -5731,7 +5748,6 @@ NTSTATUS WINAPI NtUserDisplayConfigGetDeviceInfo( DISPLAYCONFIG_DEVICE_INFO_HEAD
continue
;
continue
;
target_name
->
outputTechnology
=
DISPLAYCONFIG_OUTPUT_TECHNOLOGY_INTERNAL
;
target_name
->
outputTechnology
=
DISPLAYCONFIG_OUTPUT_TECHNOLOGY_INTERNAL
;
/* FIXME: get real monitor name. */
snprintf
(
buffer
,
ARRAY_SIZE
(
buffer
),
"Display%u"
,
monitor
->
output_id
+
1
);
snprintf
(
buffer
,
ARRAY_SIZE
(
buffer
),
"Display%u"
,
monitor
->
output_id
+
1
);
asciiz_to_unicode
(
target_name
->
monitorFriendlyDeviceName
,
buffer
);
asciiz_to_unicode
(
target_name
->
monitorFriendlyDeviceName
,
buffer
);
lstrcpyW
(
target_name
->
monitorDevicePath
,
monitor
->
dev
.
interface_name
);
lstrcpyW
(
target_name
->
monitorDevicePath
,
monitor
->
dev
.
interface_name
);
...
@@ -5741,6 +5757,11 @@ NTSTATUS WINAPI NtUserDisplayConfigGetDeviceInfo( DISPLAYCONFIG_DEVICE_INFO_HEAD
...
@@ -5741,6 +5757,11 @@ NTSTATUS WINAPI NtUserDisplayConfigGetDeviceInfo( DISPLAYCONFIG_DEVICE_INFO_HEAD
target_name
->
edidProductCodeId
=
monitor
->
edid_info
.
product_code
;
target_name
->
edidProductCodeId
=
monitor
->
edid_info
.
product_code
;
target_name
->
flags
.
edidIdsValid
=
1
;
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
;
ret
=
STATUS_SUCCESS
;
break
;
break
;
}
}
...
...
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