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
72000726
Commit
72000726
authored
Sep 20, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 20, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mscms: Fix OpenColorProfile to handle relative file names.
parent
7c527199
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
2 deletions
+31
-2
Makefile.in
dlls/mscms/Makefile.in
+1
-1
profile.c
dlls/mscms/profile.c
+20
-1
profile.c
dlls/mscms/tests/profile.c
+10
-0
No files found.
dlls/mscms/Makefile.in
View file @
72000726
MODULE
=
mscms.dll
IMPORTLIB
=
mscms
IMPORTS
=
advapi32
IMPORTS
=
shlwapi
advapi32
EXTRALIBS
=
@LCMSLIBS@
C_SRCS
=
\
...
...
dlls/mscms/profile.c
View file @
72000726
...
...
@@ -30,6 +30,7 @@
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "shlwapi.h"
#include "icm.h"
#include "mscms_priv.h"
...
...
@@ -1470,7 +1471,25 @@ HPROFILE WINAPI OpenColorProfileW( PPROFILE profile, DWORD access, DWORD sharing
if
(
!
flags
)
return
NULL
;
if
(
!
sharing
)
sharing
=
FILE_SHARE_READ
;
handle
=
CreateFileW
(
profile
->
pProfileData
,
flags
,
sharing
,
NULL
,
creation
,
0
,
NULL
);
if
(
!
PathIsRelativeW
(
profile
->
pProfileData
))
handle
=
CreateFileW
(
profile
->
pProfileData
,
flags
,
sharing
,
NULL
,
creation
,
0
,
NULL
);
else
{
DWORD
size
;
WCHAR
*
path
;
if
(
!
GetColorDirectoryW
(
NULL
,
NULL
,
&
size
)
&&
GetLastError
()
==
ERROR_MORE_DATA
)
{
size
+=
(
strlenW
(
profile
->
pProfileData
)
+
2
)
*
sizeof
(
WCHAR
);
if
(
!
(
path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
return
NULL
;
GetColorDirectoryW
(
NULL
,
path
,
&
size
);
PathAddBackslashW
(
path
);
strcatW
(
path
,
profile
->
pProfileData
);
}
else
return
NULL
;
handle
=
CreateFileW
(
path
,
flags
,
sharing
,
NULL
,
creation
,
0
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
path
);
}
if
(
handle
==
INVALID_HANDLE_VALUE
)
{
WARN
(
"Unable to open color profile %u
\n
"
,
GetLastError
()
);
...
...
dlls/mscms/tests/profile.c
View file @
72000726
...
...
@@ -952,6 +952,16 @@ static void test_OpenColorProfileA(void)
ret
=
pCloseColorProfile
(
handle
);
ok
(
ret
,
"CloseColorProfile() failed (%d)
\n
"
,
GetLastError
()
);
profile
.
dwType
=
PROFILE_FILENAME
;
profile
.
pProfileData
=
(
void
*
)
"sRGB Color Space Profile.icm"
;
profile
.
cbDataSize
=
sizeof
(
"sRGB Color Space Profile.icm"
);
handle
=
pOpenColorProfileA
(
&
profile
,
PROFILE_READ
,
FILE_SHARE_READ
,
OPEN_EXISTING
);
ok
(
handle
!=
NULL
,
"OpenColorProfileA() failed (%d)
\n
"
,
GetLastError
()
);
ret
=
pCloseColorProfile
(
handle
);
ok
(
ret
,
"CloseColorProfile() failed (%d)
\n
"
,
GetLastError
()
);
}
}
...
...
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