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
88ba6a66
Commit
88ba6a66
authored
Feb 22, 2008
by
Hans Leidekker
Committed by
Alexandre Julliard
Feb 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mscms: Implement AssociateColorProfileWithDevice and DisassociateColorProfileFromDevice.
parent
92015ee4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
168 additions
and
30 deletions
+168
-30
Makefile.in
dlls/mscms/Makefile.in
+1
-1
profile.c
dlls/mscms/profile.c
+167
-1
stub.c
dlls/mscms/stub.c
+0
-28
No files found.
dlls/mscms/Makefile.in
View file @
88ba6a66
...
...
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
mscms.dll
IMPORTLIB
=
libmscms.
$(IMPLIBEXT)
IMPORTS
=
kernel32
IMPORTS
=
advapi32
kernel32
EXTRALIBS
=
@LCMSLIBS@
C_SRCS
=
\
...
...
dlls/mscms/profile.c
View file @
88ba6a66
/*
* MSCMS - Color Management System for Wine
*
* Copyright 2004, 2005, 2006 Hans Leidekker
* Copyright 2004, 2005, 2006
, 2008
Hans Leidekker
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -20,6 +20,7 @@
#include "config.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include <stdarg.h>
...
...
@@ -28,6 +29,7 @@
#include "winnls.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "icm.h"
#include "mscms_priv.h"
...
...
@@ -63,6 +65,170 @@ static const char *MSCMS_dbgstr_tag( DWORD tag )
WINE_DEFAULT_DEBUG_CHANNEL
(
mscms
);
/******************************************************************************
* AssociateColorProfileWithDeviceA [MSCMS.@]
*/
BOOL
WINAPI
AssociateColorProfileWithDeviceA
(
PCSTR
machine
,
PCSTR
profile
,
PCSTR
device
)
{
int
len
;
BOOL
ret
=
FALSE
;
WCHAR
*
profileW
,
*
deviceW
;
TRACE
(
"( %s, %s, %s )
\n
"
,
debugstr_a
(
machine
),
debugstr_a
(
profile
),
debugstr_a
(
device
)
);
if
(
!
profile
||
!
device
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
machine
)
{
SetLastError
(
ERROR_NOT_SUPPORTED
);
return
FALSE
;
}
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
profile
,
-
1
,
NULL
,
0
);
if
(
!
(
profileW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
return
FALSE
;
MultiByteToWideChar
(
CP_ACP
,
0
,
profile
,
-
1
,
profileW
,
len
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
device
,
-
1
,
NULL
,
0
);
if
((
deviceW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
{
MultiByteToWideChar
(
CP_ACP
,
0
,
device
,
-
1
,
deviceW
,
len
);
ret
=
AssociateColorProfileWithDeviceW
(
NULL
,
profileW
,
deviceW
);
}
HeapFree
(
GetProcessHeap
(),
0
,
profileW
);
HeapFree
(
GetProcessHeap
(),
0
,
deviceW
);
return
ret
;
}
static
BOOL
set_profile_device_key
(
PCWSTR
file
,
const
BYTE
*
value
,
DWORD
size
)
{
static
const
WCHAR
fmtW
[]
=
{
'%'
,
'c'
,
'%'
,
'c'
,
'%'
,
'c'
,
'%'
,
'c'
,
0
};
static
const
WCHAR
icmW
[]
=
{
'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'
,
0
};
PROFILEHEADER
header
;
PROFILE
profile
;
HPROFILE
handle
;
HKEY
icm_key
,
class_key
;
WCHAR
basenameW
[
MAX_PATH
],
classW
[
5
];
profile
.
dwType
=
PROFILE_FILENAME
;
profile
.
pProfileData
=
(
PVOID
)
file
;
profile
.
cbDataSize
=
(
lstrlenW
(
file
)
+
1
)
*
sizeof
(
WCHAR
);
/* FIXME is the profile installed? */
if
(
!
(
handle
=
OpenColorProfileW
(
&
profile
,
PROFILE_READ
,
0
,
OPEN_EXISTING
)))
{
SetLastError
(
ERROR_INVALID_PROFILE
);
return
FALSE
;
}
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
icmW
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
,
NULL
,
&
icm_key
,
NULL
);
GetColorProfileHeader
(
handle
,
&
header
);
MSCMS_basename
(
file
,
basenameW
);
sprintfW
(
classW
,
fmtW
,
(
header
.
phClass
>>
24
)
&
0xff
,
(
header
.
phClass
>>
16
)
&
0xff
,
(
header
.
phClass
>>
8
)
&
0xff
,
header
.
phClass
&
0xff
);
RegCreateKeyExW
(
icm_key
,
classW
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
,
NULL
,
&
class_key
,
NULL
);
if
(
value
)
RegSetValueExW
(
class_key
,
basenameW
,
0
,
REG_BINARY
,
value
,
size
);
else
RegDeleteValueW
(
class_key
,
basenameW
);
RegCloseKey
(
class_key
);
RegCloseKey
(
icm_key
);
CloseColorProfile
(
handle
);
return
TRUE
;
}
/******************************************************************************
* AssociateColorProfileWithDeviceW [MSCMS.@]
*/
BOOL
WINAPI
AssociateColorProfileWithDeviceW
(
PCWSTR
machine
,
PCWSTR
profile
,
PCWSTR
device
)
{
static
const
BYTE
dummy_value
[
12
];
TRACE
(
"( %s, %s, %s )
\n
"
,
debugstr_w
(
machine
),
debugstr_w
(
profile
),
debugstr_w
(
device
)
);
if
(
!
profile
||
!
device
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
machine
)
{
SetLastError
(
ERROR_NOT_SUPPORTED
);
return
FALSE
;
}
return
set_profile_device_key
(
profile
,
dummy_value
,
sizeof
(
dummy_value
)
);
}
/******************************************************************************
* DisassociateColorProfileFromDeviceA [MSCMS.@]
*/
BOOL
WINAPI
DisassociateColorProfileFromDeviceA
(
PCSTR
machine
,
PCSTR
profile
,
PCSTR
device
)
{
int
len
;
BOOL
ret
=
FALSE
;
WCHAR
*
profileW
,
*
deviceW
;
TRACE
(
"( %s, %s, %s )
\n
"
,
debugstr_a
(
machine
),
debugstr_a
(
profile
),
debugstr_a
(
device
)
);
if
(
!
profile
||
!
device
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
machine
)
{
SetLastError
(
ERROR_NOT_SUPPORTED
);
return
FALSE
;
}
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
profile
,
-
1
,
NULL
,
0
);
if
(
!
(
profileW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
return
FALSE
;
MultiByteToWideChar
(
CP_ACP
,
0
,
profile
,
-
1
,
profileW
,
len
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
device
,
-
1
,
NULL
,
0
);
if
((
deviceW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
{
MultiByteToWideChar
(
CP_ACP
,
0
,
device
,
-
1
,
deviceW
,
len
);
ret
=
DisassociateColorProfileFromDeviceW
(
NULL
,
profileW
,
deviceW
);
}
HeapFree
(
GetProcessHeap
(),
0
,
profileW
);
HeapFree
(
GetProcessHeap
(),
0
,
deviceW
);
return
ret
;
}
/******************************************************************************
* DisassociateColorProfileFromDeviceW [MSCMS.@]
*/
BOOL
WINAPI
DisassociateColorProfileFromDeviceW
(
PCWSTR
machine
,
PCWSTR
profile
,
PCWSTR
device
)
{
TRACE
(
"( %s, %s, %s )
\n
"
,
debugstr_w
(
machine
),
debugstr_w
(
profile
),
debugstr_w
(
device
)
);
if
(
!
profile
||
!
device
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
machine
)
{
SetLastError
(
ERROR_NOT_SUPPORTED
);
return
FALSE
;
}
return
set_profile_device_key
(
profile
,
NULL
,
0
);
}
/******************************************************************************
* GetColorDirectoryA [MSCMS.@]
*
* See GetColorDirectoryW.
...
...
dlls/mscms/stub.c
View file @
88ba6a66
...
...
@@ -31,20 +31,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
mscms
);
BOOL
WINAPI
AssociateColorProfileWithDeviceA
(
PCSTR
machine
,
PCSTR
profile
,
PCSTR
device
)
{
FIXME
(
"( %p, %p, %p ) stub
\n
"
,
machine
,
profile
,
device
);
return
TRUE
;
}
BOOL
WINAPI
AssociateColorProfileWithDeviceW
(
PCWSTR
machine
,
PCWSTR
profile
,
PCWSTR
device
)
{
FIXME
(
"( %p, %p, %p ) stub
\n
"
,
machine
,
profile
,
device
);
return
TRUE
;
}
BOOL
WINAPI
CheckBitmapBits
(
HTRANSFORM
transform
,
PVOID
srcbits
,
BMFORMAT
format
,
DWORD
width
,
DWORD
height
,
DWORD
stride
,
PBYTE
result
,
PBMCALLBACKFN
callback
,
LPARAM
data
)
...
...
@@ -100,20 +86,6 @@ BOOL WINAPI CreateProfileFromLogColorSpaceW( LPLOGCOLORSPACEW space, PBYTE *buff
return
FALSE
;
}
BOOL
WINAPI
DisassociateColorProfileFromDeviceA
(
PCSTR
machine
,
PCSTR
profile
,
PCSTR
device
)
{
FIXME
(
"( %p, %p, %p ) stub
\n
"
,
machine
,
profile
,
device
);
return
TRUE
;
}
BOOL
WINAPI
DisassociateColorProfileFromDeviceW
(
PCWSTR
machine
,
PCWSTR
profile
,
PCWSTR
device
)
{
FIXME
(
"( %p, %p, %p ) stub
\n
"
,
machine
,
profile
,
device
);
return
TRUE
;
}
DWORD
WINAPI
GenerateCopyFilePaths
(
LPCWSTR
printer
,
LPCWSTR
directory
,
LPBYTE
clientinfo
,
DWORD
level
,
LPWSTR
sourcedir
,
LPDWORD
sourcedirsize
,
LPWSTR
targetdir
,
LPDWORD
targetdirsize
,
DWORD
flags
)
...
...
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