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
eea31097
Commit
eea31097
authored
Jul 05, 2005
by
Hans Leidekker
Committed by
Alexandre Julliard
Jul 05, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix color directory handling.
parent
e1d2852d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
39 deletions
+34
-39
profile.c
dlls/mscms/profile.c
+7
-13
profile.c
dlls/mscms/tests/profile.c
+27
-26
No files found.
dlls/mscms/profile.c
View file @
eea31097
...
...
@@ -44,11 +44,6 @@ static void MSCMS_basename( LPCWSTR path, LPWSTR name )
lstrcpyW
(
name
,
&
path
[
i
]
);
}
/* FIXME: Get this directory from the registry? */
static
const
WCHAR
colorsubdir
[]
=
{
'\\'
,
's'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'3'
,
'2'
,
'\\'
,
's'
,
'p'
,
'o'
,
'o'
,
'l'
,
'\\'
,
'd'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
's'
,
'\\'
,
'c'
,
'o'
,
'l'
,
'o'
,
'r'
,
0
};
WINE_DEFAULT_DEBUG_CHANNEL
(
mscms
);
/******************************************************************************
...
...
@@ -109,13 +104,14 @@ BOOL WINAPI GetColorDirectoryA( PCSTR machine, PSTR buffer, PDWORD size )
BOOL
WINAPI
GetColorDirectoryW
(
PCWSTR
machine
,
PWSTR
buffer
,
PDWORD
size
)
{
WCHAR
colordir
[
MAX_PATH
];
static
const
WCHAR
colorsubdir
[]
=
{
'\\'
,
'c'
,
'o'
,
'l'
,
'o'
,
'r'
,
0
};
DWORD
len
;
TRACE
(
"( %p, %p )
\n
"
,
buffer
,
size
);
if
(
machine
||
!
size
)
return
FALSE
;
Get
Windows
DirectoryW
(
colordir
,
sizeof
(
colordir
)
/
sizeof
(
WCHAR
)
);
Get
System
DirectoryW
(
colordir
,
sizeof
(
colordir
)
/
sizeof
(
WCHAR
)
);
lstrcatW
(
colordir
,
colorsubdir
);
len
=
lstrlenW
(
colordir
)
*
sizeof
(
WCHAR
);
...
...
@@ -399,23 +395,22 @@ BOOL WINAPI GetStandardColorSpaceProfileA( PCSTR machine, DWORD id, PSTR profile
*/
BOOL
WINAPI
GetStandardColorSpaceProfileW
(
PCWSTR
machine
,
DWORD
id
,
PWSTR
profile
,
PDWORD
size
)
{
static
const
WCHAR
rgbprofilefile
[]
=
{
'\\'
,
's'
,
'r'
,
'g'
,
'b'
,
' '
,
'c'
,
'o'
,
'l'
,
'o'
,
'r'
,
' '
,
static
const
WCHAR
rgbprofilefile
[]
=
{
'\\'
,
'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
};
WCHAR
rgbprofile
[
MAX_PATH
];
DWORD
len
;
DWORD
len
=
sizeof
(
rgbprofile
)
;
TRACE
(
"( 0x%08lx, %p, %p )
\n
"
,
id
,
profile
,
size
);
if
(
machine
||
!
size
)
return
FALSE
;
GetColorDirectoryW
(
machine
,
rgbprofile
,
&
len
);
switch
(
id
)
{
case
0x52474220
:
/* 'RGB ' */
GetWindowsDirectoryW
(
rgbprofile
,
sizeof
(
rgbprofile
)
/
sizeof
(
WCHAR
)
);
lstrcatW
(
rgbprofile
,
colorsubdir
);
lstrcatW
(
rgbprofile
,
rgbprofilefile
);
len
=
lstrlenW
(
rgbprofile
)
*
sizeof
(
WCHAR
);
len
=
lstrlenW
(
rgbprofile
)
*
sizeof
(
WCHAR
);
if
(
*
size
<
len
||
!
profile
)
{
...
...
@@ -429,7 +424,6 @@ BOOL WINAPI GetStandardColorSpaceProfileW( PCWSTR machine, DWORD id, PWSTR profi
default:
return
FALSE
;
}
return
TRUE
;
}
...
...
dlls/mscms/tests/profile.c
View file @
eea31097
...
...
@@ -41,18 +41,21 @@ static const WCHAR machineW[] = { 'd','u','m','m','y',0 };
* http://download.microsoft.com/download/whistler/hwdev1/1.0/wxp/en-us/ColorProfile.exe
*/
/* Two common places to find the standard color space profile */
static
const
char
profilefile
[]
=
/* Two common places to find the standard color space profile, relative
* to the system directory.
*/
static
const
char
profile1
[]
=
"
\\
color
\\
srgb color space profile.icm"
;
static
const
char
profile
subdir
[]
=
"
\\
s
ystem32
\\
spool
\\
drivers
"
;
static
const
char
profile
2
[]
=
"
\\
s
pool
\\
drivers
\\
color
\\
srgb color space profile.icm
"
;
static
const
WCHAR
profile
file
W
[]
=
static
const
WCHAR
profile
1
W
[]
=
{
'\\'
,
'c'
,
'o'
,
'l'
,
'o'
,
'r'
,
'\\'
,
'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
profilesubdirW
[]
=
{
'\\'
,
's'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'3'
,
'2'
,
'\\'
,
's'
,
'p'
,
'o'
,
'o'
,
'l'
,
'\\'
,
'd'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
's'
,
0
};
static
const
WCHAR
profile2W
[]
=
{
'\\'
,
's'
,
'p'
,
'o'
,
'o'
,
'l'
,
'\\'
,
'd'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
's'
,
'\\'
,
'c'
,
'o'
,
'l'
,
'o'
,
'r'
,
'\\'
,
'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
unsigned
char
rgbheader
[]
=
{
0x48
,
0x0c
,
0x00
,
0x00
,
0x6f
,
0x6e
,
0x69
,
0x4c
,
0x00
,
0x00
,
0x10
,
0x02
,
...
...
@@ -940,36 +943,34 @@ START_TEST(profile)
UINT
len
;
HANDLE
handle
;
char
path
[
MAX_PATH
],
file
[
MAX_PATH
];
char
profile
1
[
MAX_PATH
],
pro
file2
[
MAX_PATH
];
WCHAR
profile
1W
[
MAX_PATH
],
pro
file2W
[
MAX_PATH
];
char
profile
file1
[
MAX_PATH
],
profile
file2
[
MAX_PATH
];
WCHAR
profile
file1W
[
MAX_PATH
],
profile
file2W
[
MAX_PATH
];
WCHAR
fileW
[
MAX_PATH
];
/* See if we can find the standard color profile */
GetSystemDirectoryA
(
profile
1
,
sizeof
(
pro
file1
)
);
GetSystemDirectoryW
(
profile
1W
,
sizeof
(
pro
file1W
)
/
sizeof
(
WCHAR
)
);
strcat
(
profile1
,
profilefile
);
lstrcatW
(
profile
1W
,
profilefile
W
);
handle
=
CreateFileA
(
profile1
,
0
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
GetSystemDirectoryA
(
profile
file1
,
sizeof
(
profile
file1
)
);
GetSystemDirectoryW
(
profile
file1W
,
sizeof
(
profile
file1W
)
/
sizeof
(
WCHAR
)
);
lstrcatA
(
profilefile1
,
profile1
);
lstrcatW
(
profile
file1W
,
profile1
W
);
handle
=
CreateFileA
(
profile
file
1
,
0
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
if
(
handle
!=
INVALID_HANDLE_VALUE
)
{
standardprofile
=
profile1
;
standardprofileW
=
profile1W
;
standardprofile
=
profile
file
1
;
standardprofileW
=
profile
file
1W
;
CloseHandle
(
handle
);
}
GetWindowsDirectoryA
(
profile2
,
sizeof
(
profile2
)
);
GetWindowsDirectoryW
(
profile2W
,
sizeof
(
profile2W
)
/
sizeof
(
WCHAR
)
);
strcat
(
profile2
,
profilesubdir
);
lstrcatW
(
profile2W
,
profilesubdirW
);
strcat
(
profile2
,
profilefile
);
lstrcatW
(
profile2W
,
profilefileW
);
handle
=
CreateFileA
(
profile2
,
0
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
GetSystemDirectoryA
(
profilefile2
,
sizeof
(
profilefile2
)
);
GetSystemDirectoryW
(
profilefile2W
,
sizeof
(
profilefile2W
)
/
sizeof
(
WCHAR
)
);
lstrcatA
(
profilefile2
,
profile2
);
lstrcatW
(
profilefile2W
,
profile2W
);
handle
=
CreateFileA
(
profilefile2
,
0
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
if
(
handle
!=
INVALID_HANDLE_VALUE
)
{
standardprofile
=
profile2
;
standardprofileW
=
profile2W
;
standardprofile
=
profile
file
2
;
standardprofileW
=
profile
file
2W
;
CloseHandle
(
handle
);
}
...
...
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