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
81bda71e
Commit
81bda71e
authored
Apr 11, 2005
by
Vincent Béron
Committed by
Alexandre Julliard
Apr 11, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't reference c:\windows directly.
parent
27712187
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
29 deletions
+42
-29
profile.c
dlls/mscms/profile.c
+16
-11
profile.c
dlls/mscms/tests/profile.c
+26
-18
No files found.
dlls/mscms/profile.c
View file @
81bda71e
...
...
@@ -44,11 +44,10 @@ static void MSCMS_basename( LPCWSTR path, LPWSTR name )
lstrcpyW
(
name
,
&
path
[
i
]
);
}
static
const
WCHAR
rgbprofile
[]
=
{
'c'
,
':'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
'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'
,
'\\'
,
'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
};
/* 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,17 +108,16 @@ BOOL WINAPI GetColorDirectoryA( PCSTR machine, PSTR buffer, PDWORD size )
*/
BOOL
WINAPI
GetColorDirectoryW
(
PCWSTR
machine
,
PWSTR
buffer
,
PDWORD
size
)
{
/* FIXME: Get this directory from the registry? */
static
const
WCHAR
colordir
[]
=
{
'c'
,
':'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
'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
};
WCHAR
colordir
[
MAX_PATH
];
DWORD
len
;
TRACE
(
"( %p, %p )
\n
"
,
buffer
,
size
);
if
(
machine
||
!
size
)
return
FALSE
;
GetWindowsDirectoryW
(
colordir
,
sizeof
(
colordir
)
/
sizeof
(
WCHAR
)
);
lstrcatW
(
colordir
,
colorsubdir
);
len
=
lstrlenW
(
colordir
)
*
sizeof
(
WCHAR
);
if
(
len
<=
*
size
&&
buffer
)
...
...
@@ -401,6 +399,9 @@ 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'
,
' '
,
's'
,
'p'
,
'a'
,
'c'
,
'e'
,
' '
,
'p'
,
'r'
,
'o'
,
'f'
,
'i'
,
'l'
,
'e'
,
'.'
,
'i'
,
'c'
,
'm'
,
0
};
WCHAR
rgbprofile
[
MAX_PATH
];
DWORD
len
;
TRACE
(
"( 0x%08lx, %p, %p )
\n
"
,
id
,
profile
,
size
);
...
...
@@ -410,7 +411,11 @@ BOOL WINAPI GetStandardColorSpaceProfileW( PCWSTR machine, DWORD id, PWSTR profi
switch
(
id
)
{
case
0x52474220
:
/* 'RGB ' */
len
=
sizeof
(
rgbprofile
);
GetWindowsDirectoryW
(
rgbprofile
,
sizeof
(
rgbprofile
)
/
sizeof
(
WCHAR
)
);
lstrcatW
(
rgbprofile
,
colorsubdir
);
lstrcatW
(
rgbprofile
,
rgbprofilefile
);
len
=
lstrlenW
(
rgbprofile
)
*
sizeof
(
WCHAR
);
if
(
*
size
<
len
||
!
profile
)
{
...
...
dlls/mscms/tests/profile.c
View file @
81bda71e
...
...
@@ -42,20 +42,17 @@ static const WCHAR machineW[] = { 'd','u','m','m','y',0 };
*/
/* Two common places to find the standard color space profile */
static
const
char
profile1
[]
=
"c:
\\
windows
\\
system
\\
color
\\
srgb color space profile.icm"
;
static
const
char
profile2
[]
=
"c:
\\
windows
\\
system32
\\
spool
\\
drivers
\\
color
\\
srgb color space profile.icm"
;
static
const
WCHAR
profile1W
[]
=
{
'c'
,
':'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
's'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'\\'
,
'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
profile2W
[]
=
{
'c'
,
':'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
'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'
,
'\\'
,
's'
,
'r'
,
'g'
,
'b'
,
' '
,
'c'
,
'o'
,
'l'
,
'o'
,
'r'
,
' '
,
static
const
char
profilefile
[]
=
"
\\
color
\\
srgb color space profile.icm"
;
static
const
char
profilesubdir
[]
=
"
\\
system32
\\
spool
\\
drivers"
;
static
const
WCHAR
profilefileW
[]
=
{
'\\'
,
'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
unsigned
char
rgbheader
[]
=
{
0x48
,
0x0c
,
0x00
,
0x00
,
0x6f
,
0x6e
,
0x69
,
0x4c
,
0x00
,
0x00
,
0x10
,
0x02
,
...
...
@@ -160,7 +157,6 @@ static void test_GetColorDirectoryW()
ret
=
GetColorDirectoryW
(
NULL
,
buffer
,
&
size
);
ok
(
ret
&&
size
>
0
,
"GetColorDirectoryW() failed (%ld)
\n
"
,
GetLastError
()
);
ret
=
GetColorDirectoryW
(
NULL
,
buffer
,
&
size
);
}
static
void
test_GetColorProfileElement
()
...
...
@@ -944,24 +940,36 @@ START_TEST(profile)
UINT
len
;
HANDLE
handle
;
char
path
[
MAX_PATH
],
file
[
MAX_PATH
];
char
profile1
[
MAX_PATH
],
profile2
[
MAX_PATH
];
WCHAR
profile1W
[
MAX_PATH
],
profile2W
[
MAX_PATH
];
WCHAR
fileW
[
MAX_PATH
];
/* See if we can find the standard color profile */
GetSystemDirectoryA
(
profile1
,
sizeof
(
profile1
)
);
GetSystemDirectoryW
(
profile1W
,
sizeof
(
profile1W
)
/
sizeof
(
WCHAR
)
);
strcat
(
profile1
,
profilefile
);
lstrcatW
(
profile1W
,
profilefileW
);
handle
=
CreateFileA
(
profile1
,
0
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
if
(
handle
!=
INVALID_HANDLE_VALUE
)
{
standardprofile
=
(
LPSTR
)
&
profile1
;
standardprofileW
=
(
LPWSTR
)
&
profile1W
;
standardprofile
=
profile1
;
standardprofileW
=
profile1W
;
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
);
if
(
handle
!=
INVALID_HANDLE_VALUE
)
{
standardprofile
=
(
LPSTR
)
&
profile2
;
standardprofileW
=
(
LPWSTR
)
&
profile2W
;
standardprofile
=
profile2
;
standardprofileW
=
profile2W
;
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