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
d6bb9e76
Commit
d6bb9e76
authored
Feb 27, 2008
by
Hans Leidekker
Committed by
Alexandre Julliard
Feb 28, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Return registered monitor profile from GetICMProfile.
parent
eaea28e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
9 deletions
+25
-9
icm.c
dlls/gdi32/icm.c
+25
-9
No files found.
dlls/gdi32/icm.c
View file @
d6bb9e76
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include "winbase.h"
#include "winbase.h"
#include "wingdi.h"
#include "wingdi.h"
#include "winnls.h"
#include "winnls.h"
#include "winreg.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "wine/unicode.h"
...
@@ -96,20 +97,37 @@ BOOL WINAPI GetICMProfileA(HDC hdc, LPDWORD size, LPSTR filename)
...
@@ -96,20 +97,37 @@ BOOL WINAPI GetICMProfileA(HDC hdc, LPDWORD size, LPSTR filename)
*/
*/
BOOL
WINAPI
GetICMProfileW
(
HDC
hdc
,
LPDWORD
size
,
LPWSTR
filename
)
BOOL
WINAPI
GetICMProfileW
(
HDC
hdc
,
LPDWORD
size
,
LPWSTR
filename
)
{
{
HKEY
hkey
;
DWORD
required
;
DWORD
required
;
WCHAR
systemdir
[
MAX_PATH
];
WCHAR
profile
[
MAX_PATH
],
fullname
[
MAX_PATH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
"
,
hdc
,
size
,
filename
);
TRACE
(
"%p, %p, %p
\n
"
,
hdc
,
size
,
filename
);
if
(
!
hdc
||
!
size
)
return
FALSE
;
if
(
!
hdc
||
!
size
)
return
FALSE
;
required
=
GetSystemDirectoryW
(
systemdir
,
MAX_PATH
);
strcpyW
(
profile
,
srgb
);
required
+=
sizeof
(
profile
)
/
sizeof
(
WCHAR
);
if
(
!
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
mntr
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
,
NULL
,
&
hkey
,
NULL
))
{
DWORD
size
=
sizeof
(
profile
)
/
sizeof
(
WCHAR
);
/* FIXME handle multiple values */
RegEnumValueW
(
hkey
,
0
,
profile
,
&
size
,
NULL
,
NULL
,
NULL
,
NULL
);
RegCloseKey
(
hkey
);
}
GetSystemDirectoryW
(
fullname
,
MAX_PATH
);
strcatW
(
fullname
,
path
);
strcatW
(
fullname
,
profile
);
required
=
strlenW
(
fullname
)
+
1
;
if
(
*
size
<
required
)
if
(
*
size
<
required
)
{
{
*
size
=
required
;
*
size
=
required
;
...
@@ -118,9 +136,7 @@ BOOL WINAPI GetICMProfileW(HDC hdc, LPDWORD size, LPWSTR filename)
...
@@ -118,9 +136,7 @@ BOOL WINAPI GetICMProfileW(HDC hdc, LPDWORD size, LPWSTR filename)
}
}
if
(
filename
)
if
(
filename
)
{
{
strcpyW
(
filename
,
systemdir
);
strcpyW
(
filename
,
fullname
);
strcatW
(
filename
,
profile
);
if
(
GetFileAttributesW
(
filename
)
==
INVALID_FILE_ATTRIBUTES
)
if
(
GetFileAttributesW
(
filename
)
==
INVALID_FILE_ATTRIBUTES
)
WARN
(
"color profile not found
\n
"
);
WARN
(
"color profile not found
\n
"
);
}
}
...
...
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