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
898a4cfa
Commit
898a4cfa
authored
Oct 26, 2010
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 26, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Implement EnumICMProfiles.
parent
0839dabd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
11 deletions
+66
-11
graphics.c
dlls/winex11.drv/graphics.c
+65
-11
winex11.drv.spec
dlls/winex11.drv/winex11.drv.spec
+1
-0
No files found.
dlls/winex11.drv/graphics.c
View file @
898a4cfa
...
...
@@ -1508,35 +1508,35 @@ extern void WINAPI A_SHAInit( sha_ctx * );
extern
void
WINAPI
A_SHAUpdate
(
sha_ctx
*
,
const
unsigned
char
*
,
unsigned
int
);
extern
void
WINAPI
A_SHAFinal
(
sha_ctx
*
,
unsigned
char
*
);
static
const
WCHAR
mntr_key
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
' '
,
'N'
,
'T'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'\\'
,
'I'
,
'C'
,
'M'
,
'\\'
,
'm'
,
'n'
,
't'
,
'r'
,
0
};
static
const
WCHAR
color_path
[]
=
{
'\\'
,
's'
,
'p'
,
'o'
,
'o'
,
'l'
,
'\\'
,
'd'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
's'
,
'\\'
,
'c'
,
'o'
,
'l'
,
'o'
,
'r'
,
'\\'
,
0
};
/***********************************************************************
* GetICMProfile (X11DRV.@)
*/
BOOL
CDECL
X11DRV_GetICMProfile
(
X11DRV_PDEVICE
*
physDev
,
LPDWORD
size
,
LPWSTR
filename
)
{
static
const
WCHAR
path
[]
=
{
'\\'
,
's'
,
'p'
,
'o'
,
'o'
,
'l'
,
'\\'
,
'd'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
's'
,
'\\'
,
'c'
,
'o'
,
'l'
,
'o'
,
'r'
,
'\\'
,
0
};
static
const
WCHAR
srgb
[]
=
{
's'
,
'R'
,
'G'
,
'B'
,
' '
,
'C'
,
'o'
,
'l'
,
'o'
,
'r'
,
' '
,
'S'
,
'p'
,
'a'
,
'c'
,
'e'
,
' '
,
'P'
,
'r'
,
'o'
,
'f'
,
'i'
,
'l'
,
'e'
,
'.'
,
'i'
,
'c'
,
'm'
,
0
};
static
const
WCHAR
mntr
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
' '
,
'N'
,
'T'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'\\'
,
'I'
,
'C'
,
'M'
,
'\\'
,
'm'
,
'n'
,
't'
,
'r'
,
0
};
HKEY
hkey
;
DWORD
required
,
len
;
WCHAR
profile
[
MAX_PATH
],
fullname
[
2
*
MAX_PATH
+
sizeof
(
path
)
/
sizeof
(
WCHAR
)];
WCHAR
profile
[
MAX_PATH
],
fullname
[
2
*
MAX_PATH
+
sizeof
(
color_
path
)
/
sizeof
(
WCHAR
)];
unsigned
char
*
buffer
;
unsigned
long
buflen
;
if
(
!
size
)
return
FALSE
;
GetSystemDirectoryW
(
fullname
,
MAX_PATH
);
strcatW
(
fullname
,
path
);
strcatW
(
fullname
,
color_
path
);
len
=
sizeof
(
profile
)
/
sizeof
(
WCHAR
);
if
(
!
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
mntr
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
,
NULL
,
&
hkey
,
NULL
)
&&
if
(
!
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
mntr
_key
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
,
NULL
,
&
hkey
,
NULL
)
&&
!
RegEnumValueW
(
hkey
,
0
,
profile
,
&
len
,
NULL
,
NULL
,
NULL
,
NULL
))
/* FIXME handle multiple values */
{
strcatW
(
fullname
,
profile
);
...
...
@@ -1589,3 +1589,57 @@ BOOL CDECL X11DRV_GetICMProfile( X11DRV_PDEVICE *physDev, LPDWORD size, LPWSTR f
*
size
=
required
;
return
TRUE
;
}
/***********************************************************************
* EnumICMProfiles (X11DRV.@)
*/
INT
CDECL
X11DRV_EnumICMProfiles
(
X11DRV_PDEVICE
*
physDev
,
ICMENUMPROCW
proc
,
LPARAM
lparam
)
{
HKEY
hkey
;
DWORD
len_sysdir
,
len_path
,
len
,
index
=
0
;
WCHAR
sysdir
[
MAX_PATH
],
*
profile
;
LONG
res
;
INT
ret
;
TRACE
(
"%p, %p, %ld
\n
"
,
physDev
,
proc
,
lparam
);
if
(
RegOpenKeyExW
(
HKEY_LOCAL_MACHINE
,
mntr_key
,
0
,
KEY_ALL_ACCESS
,
&
hkey
))
return
-
1
;
len_sysdir
=
GetSystemDirectoryW
(
sysdir
,
MAX_PATH
);
len_path
=
len_sysdir
+
sizeof
(
color_path
)
/
sizeof
(
color_path
[
0
])
-
1
;
len
=
64
;
for
(;;)
{
if
(
!
(
profile
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len_path
+
len
)
*
sizeof
(
WCHAR
)
)))
{
RegCloseKey
(
hkey
);
return
-
1
;
}
res
=
RegEnumValueW
(
hkey
,
index
,
profile
+
len_path
,
&
len
,
NULL
,
NULL
,
NULL
,
NULL
);
while
(
res
==
ERROR_MORE_DATA
)
{
len
*=
2
;
HeapFree
(
GetProcessHeap
(),
0
,
profile
);
if
(
!
(
profile
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len_path
+
len
)
*
sizeof
(
WCHAR
)
)))
{
RegCloseKey
(
hkey
);
return
-
1
;
}
res
=
RegEnumValueW
(
hkey
,
index
,
profile
+
len_path
,
&
len
,
NULL
,
NULL
,
NULL
,
NULL
);
}
if
(
res
!=
ERROR_SUCCESS
)
{
HeapFree
(
GetProcessHeap
(),
0
,
profile
);
break
;
}
memcpy
(
profile
,
sysdir
,
len_sysdir
*
sizeof
(
WCHAR
)
);
memcpy
(
profile
+
len_sysdir
,
color_path
,
sizeof
(
color_path
)
-
sizeof
(
WCHAR
)
);
ret
=
proc
(
profile
,
lparam
);
HeapFree
(
GetProcessHeap
(),
0
,
profile
);
if
(
!
ret
)
break
;
index
++
;
}
RegCloseKey
(
hkey
);
return
-
1
;
}
dlls/winex11.drv/winex11.drv.spec
View file @
898a4cfa
...
...
@@ -12,6 +12,7 @@
@ cdecl DescribePixelFormat(ptr long long ptr) X11DRV_DescribePixelFormat
@ cdecl Ellipse(ptr long long long long) X11DRV_Ellipse
@ cdecl EnumDeviceFonts(ptr ptr ptr long) X11DRV_EnumDeviceFonts
@ cdecl EnumICMProfiles(ptr ptr long) X11DRV_EnumICMProfiles
@ cdecl ExtEscape(ptr long long ptr long ptr) X11DRV_ExtEscape
@ cdecl ExtFloodFill(ptr long long long long) X11DRV_ExtFloodFill
@ cdecl ExtTextOut(ptr long long long ptr ptr long ptr) X11DRV_ExtTextOut
...
...
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