Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
27faf02e
Commit
27faf02e
authored
Nov 18, 2002
by
Stefan Leichter
Committed by
Alexandre Julliard
Nov 18, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved implementation of EnumDisplaySettings from ASCII to Unicode.
parent
997e2359
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
19 deletions
+21
-19
user.c
windows/user.c
+21
-19
No files found.
windows/user.c
View file @
27faf02e
...
...
@@ -35,6 +35,7 @@
#include "sysmetrics.h"
#include "local.h"
#include "module.h"
#include "winternl.h"
#include "wine/debug.h"
WINE_DECLARE_DEBUG_CHANNEL
(
hook
);
...
...
@@ -337,17 +338,17 @@ LONG WINAPI ChangeDisplaySettingsExA(
}
/***********************************************************************
* EnumDisplaySettings
A
(USER32.@)
* EnumDisplaySettings
W
(USER32.@)
* FIXME: Currently uses static list of modes.
*
* RETURNS
* TRUE if nth setting exists found (described in the LPDEVMODE
A
struct)
* TRUE if nth setting exists found (described in the LPDEVMODE
W
struct)
* FALSE if we do not have the nth setting
*/
BOOL
WINAPI
EnumDisplaySettings
A
(
LPCSTR
name
,
/* [in] huh? */
BOOL
WINAPI
EnumDisplaySettings
W
(
LPC
W
STR
name
,
/* [in] huh? */
DWORD
n
,
/* [in] nth entry in display settings list*/
LPDEVMODE
A
devmode
/* [out] devmode for that setting */
LPDEVMODE
W
devmode
/* [out] devmode for that setting */
)
{
#define NRMODES 5
#define NRDEPTHS 4
...
...
@@ -356,7 +357,7 @@ BOOL WINAPI EnumDisplaySettingsA(
}
modes
[
NRMODES
]
=
{{
512
,
384
},{
640
,
400
},{
640
,
480
},{
800
,
600
},{
1024
,
768
}};
int
depths
[
4
]
=
{
8
,
16
,
24
,
32
};
TRACE_
(
system
)(
"(%s,%ld,%p)
\n
"
,
name
,
n
,
devmode
);
TRACE_
(
system
)(
"(%s,%ld,%p)
\n
"
,
debugstr_w
(
name
)
,
n
,
devmode
);
devmode
->
dmDisplayFlags
=
0
;
devmode
->
dmDisplayFrequency
=
85
;
if
(
n
==
0
||
n
==
(
DWORD
)
-
1
||
n
==
(
DWORD
)
-
2
)
{
...
...
@@ -375,27 +376,28 @@ BOOL WINAPI EnumDisplaySettingsA(
}
/***********************************************************************
* EnumDisplaySettings
W
(USER32.@)
* EnumDisplaySettings
A
(USER32.@)
*/
BOOL
WINAPI
EnumDisplaySettings
W
(
LPCWSTR
name
,
DWORD
n
,
LPDEVMODEW
devmode
)
BOOL
WINAPI
EnumDisplaySettings
A
(
LPCSTR
name
,
DWORD
n
,
LPDEVMODEA
devmode
)
{
DEVMODE
A
devmodeA
;
DEVMODE
W
devmodeW
;
BOOL
ret
;
DWORD
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
name
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
LPSTR
nameA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
UNICODE_STRING
nameW
;
if
(
name
)
RtlCreateUnicodeStringFromAsciiz
(
&
nameW
,
name
);
else
nameW
.
Buffer
=
NULL
;
WideCharToMultiByte
(
CP_ACP
,
0
,
name
,
-
1
,
nameA
,
len
,
NULL
,
NULL
);
ret
=
EnumDisplaySettingsA
(
nameA
,
n
,
&
devmodeA
);
ret
=
EnumDisplaySettingsW
(
nameW
.
Buffer
,
n
,
&
devmodeW
);
if
(
ret
)
{
devmode
->
dmBitsPerPel
=
devmode
A
.
dmBitsPerPel
;
devmode
->
dmPelsHeight
=
devmode
A
.
dmPelsHeight
;
devmode
->
dmPelsWidth
=
devmode
A
.
dmPelsWidth
;
devmode
->
dmDisplayFlags
=
devmode
A
.
dmDisplayFlags
;
devmode
->
dmDisplayFrequency
=
devmode
A
.
dmDisplayFrequency
;
devmode
->
dmBitsPerPel
=
devmode
W
.
dmBitsPerPel
;
devmode
->
dmPelsHeight
=
devmode
W
.
dmPelsHeight
;
devmode
->
dmPelsWidth
=
devmode
W
.
dmPelsWidth
;
devmode
->
dmDisplayFlags
=
devmode
W
.
dmDisplayFlags
;
devmode
->
dmDisplayFrequency
=
devmode
W
.
dmDisplayFrequency
;
/* FIXME: convert rest too, if they are ever returned */
}
HeapFree
(
GetProcessHeap
(),
0
,
nameA
);
RtlFreeUnicodeString
(
&
nameW
);
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