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 @@
...
@@ -35,6 +35,7 @@
#include "sysmetrics.h"
#include "sysmetrics.h"
#include "local.h"
#include "local.h"
#include "module.h"
#include "module.h"
#include "winternl.h"
#include "wine/debug.h"
#include "wine/debug.h"
WINE_DECLARE_DEBUG_CHANNEL
(
hook
);
WINE_DECLARE_DEBUG_CHANNEL
(
hook
);
...
@@ -337,17 +338,17 @@ LONG WINAPI ChangeDisplaySettingsExA(
...
@@ -337,17 +338,17 @@ LONG WINAPI ChangeDisplaySettingsExA(
}
}
/***********************************************************************
/***********************************************************************
* EnumDisplaySettings
A
(USER32.@)
* EnumDisplaySettings
W
(USER32.@)
* FIXME: Currently uses static list of modes.
* FIXME: Currently uses static list of modes.
*
*
* RETURNS
* 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
* FALSE if we do not have the nth setting
*/
*/
BOOL
WINAPI
EnumDisplaySettings
A
(
BOOL
WINAPI
EnumDisplaySettings
W
(
LPCSTR
name
,
/* [in] huh? */
LPC
W
STR
name
,
/* [in] huh? */
DWORD
n
,
/* [in] nth entry in display settings list*/
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 NRMODES 5
#define NRDEPTHS 4
#define NRDEPTHS 4
...
@@ -356,7 +357,7 @@ BOOL WINAPI EnumDisplaySettingsA(
...
@@ -356,7 +357,7 @@ BOOL WINAPI EnumDisplaySettingsA(
}
modes
[
NRMODES
]
=
{{
512
,
384
},{
640
,
400
},{
640
,
480
},{
800
,
600
},{
1024
,
768
}};
}
modes
[
NRMODES
]
=
{{
512
,
384
},{
640
,
400
},{
640
,
480
},{
800
,
600
},{
1024
,
768
}};
int
depths
[
4
]
=
{
8
,
16
,
24
,
32
};
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
->
dmDisplayFlags
=
0
;
devmode
->
dmDisplayFrequency
=
85
;
devmode
->
dmDisplayFrequency
=
85
;
if
(
n
==
0
||
n
==
(
DWORD
)
-
1
||
n
==
(
DWORD
)
-
2
)
{
if
(
n
==
0
||
n
==
(
DWORD
)
-
1
||
n
==
(
DWORD
)
-
2
)
{
...
@@ -375,27 +376,28 @@ BOOL WINAPI EnumDisplaySettingsA(
...
@@ -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
;
BOOL
ret
;
DWORD
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
name
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
UNICODE_STRING
nameW
;
LPSTR
nameA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
if
(
name
)
RtlCreateUnicodeStringFromAsciiz
(
&
nameW
,
name
);
else
nameW
.
Buffer
=
NULL
;
WideCharToMultiByte
(
CP_ACP
,
0
,
name
,
-
1
,
nameA
,
len
,
NULL
,
NULL
);
ret
=
EnumDisplaySettingsW
(
nameW
.
Buffer
,
n
,
&
devmodeW
);
ret
=
EnumDisplaySettingsA
(
nameA
,
n
,
&
devmodeA
);
if
(
ret
)
if
(
ret
)
{
{
devmode
->
dmBitsPerPel
=
devmode
A
.
dmBitsPerPel
;
devmode
->
dmBitsPerPel
=
devmode
W
.
dmBitsPerPel
;
devmode
->
dmPelsHeight
=
devmode
A
.
dmPelsHeight
;
devmode
->
dmPelsHeight
=
devmode
W
.
dmPelsHeight
;
devmode
->
dmPelsWidth
=
devmode
A
.
dmPelsWidth
;
devmode
->
dmPelsWidth
=
devmode
W
.
dmPelsWidth
;
devmode
->
dmDisplayFlags
=
devmode
A
.
dmDisplayFlags
;
devmode
->
dmDisplayFlags
=
devmode
W
.
dmDisplayFlags
;
devmode
->
dmDisplayFrequency
=
devmode
A
.
dmDisplayFrequency
;
devmode
->
dmDisplayFrequency
=
devmode
W
.
dmDisplayFrequency
;
/* FIXME: convert rest too, if they are ever returned */
/* FIXME: convert rest too, if they are ever returned */
}
}
HeapFree
(
GetProcessHeap
(),
0
,
nameA
);
RtlFreeUnicodeString
(
&
nameW
);
return
ret
;
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