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
4b88fd84
Commit
4b88fd84
authored
Nov 08, 2006
by
Eric Pouech
Committed by
Alexandre Julliard
Nov 09, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mscms: GetColorDirectory: fixed incorrect A -> W conversions.
parent
f2ee10ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
21 deletions
+16
-21
profile.c
dlls/mscms/profile.c
+14
-13
profile.c
dlls/mscms/tests/profile.c
+2
-8
No files found.
dlls/mscms/profile.c
View file @
4b88fd84
...
...
@@ -91,14 +91,13 @@ BOOL WINAPI GetColorDirectoryA( PCSTR machine, PSTR buffer, PDWORD size )
if
(
bufferW
)
{
ret
=
GetColorDirectoryW
(
NULL
,
bufferW
,
&
sizeW
);
*
size
=
WideCharToMultiByte
(
CP_ACP
,
0
,
bufferW
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
ret
)
if
((
ret
=
GetColorDirectoryW
(
NULL
,
bufferW
,
&
sizeW
)))
{
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
bufferW
,
*
size
,
buffer
,
*
size
,
NULL
,
NULL
);
*
size
=
WideCharToMultiByte
(
CP_ACP
,
0
,
bufferW
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
bufferW
,
-
1
,
buffer
,
*
size
,
NULL
,
NULL
);
if
(
!
len
)
ret
=
FALSE
;
}
else
*
size
=
sizeW
/
sizeof
(
WCHAR
);
HeapFree
(
GetProcessHeap
(),
0
,
bufferW
);
}
...
...
@@ -132,13 +131,14 @@ BOOL WINAPI GetColorDirectoryW( PCWSTR machine, PWSTR buffer, PDWORD size )
len
=
lstrlenW
(
colordir
)
*
sizeof
(
WCHAR
);
if
(
len
<=
*
size
&&
buffer
)
if
(
buffer
&&
len
<=
*
size
)
{
lstrcpyW
(
buffer
,
colordir
);
*
size
=
len
;
return
TRUE
;
}
SetLastError
(
ERROR_MORE_DATA
);
*
size
=
len
;
return
FALSE
;
}
...
...
@@ -389,14 +389,13 @@ BOOL WINAPI GetStandardColorSpaceProfileA( PCSTR machine, DWORD id, PSTR profile
if
(
profileW
)
{
ret
=
GetStandardColorSpaceProfileW
(
NULL
,
id
,
profileW
,
&
sizeW
);
*
size
=
WideCharToMultiByte
(
CP_ACP
,
0
,
profileW
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
ret
)
if
((
ret
=
GetStandardColorSpaceProfileW
(
NULL
,
id
,
profileW
,
&
sizeW
)))
{
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
profileW
,
*
size
,
profile
,
*
size
,
NULL
,
NULL
);
*
size
=
WideCharToMultiByte
(
CP_ACP
,
0
,
profileW
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
profileW
,
-
1
,
profile
,
*
size
,
NULL
,
NULL
);
if
(
!
len
)
ret
=
FALSE
;
}
else
*
size
=
sizeW
/
sizeof
(
WCHAR
);
HeapFree
(
GetProcessHeap
(),
0
,
profileW
);
}
...
...
@@ -451,20 +450,22 @@ BOOL WINAPI GetStandardColorSpaceProfileW( PCWSTR machine, DWORD id, PWSTR profi
switch
(
id
)
{
case
0x52474220
:
/* 'RGB ' */
case
SPACE_RGB
:
/* 'RGB ' */
lstrcatW
(
rgbprofile
,
rgbprofilefile
);
len
=
lstrlenW
(
rgbprofile
)
*
sizeof
(
WCHAR
);
if
(
*
size
<
len
||
!
profile
)
{
*
size
=
len
;
return
TRUE
;
SetLastError
(
ERROR_MORE_DATA
);
return
FALSE
;
}
lstrcpyW
(
profile
,
rgbprofile
);
break
;
default:
SetLastError
(
ERROR_FILE_NOT_FOUND
);
return
FALSE
;
}
return
TRUE
;
...
...
dlls/mscms/tests/profile.c
View file @
4b88fd84
...
...
@@ -597,7 +597,6 @@ static void test_GetStandardColorSpaceProfileA(void)
SetLastError
(
0xfaceabee
);
/* 2nd param, */
ret
=
pGetStandardColorSpaceProfileA
(
NULL
,
(
DWORD
)
-
1
,
newprofile
,
&
sizeP
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"GetStandardColorSpaceProfileA() returns %d (GLE=%d)
\n
"
,
ret
,
GetLastError
()
);
SetLastError
(
0xfaceabee
);
/* 4th param, */
...
...
@@ -612,17 +611,14 @@ static void test_GetStandardColorSpaceProfileA(void)
SetLastError
(
0xfaceabee
);
/* dereferenced 4th param, */
ret
=
pGetStandardColorSpaceProfileA
(
NULL
,
SPACE_RGB
,
newprofile
,
&
zero
);
todo_wine
ok
(
!
ret
&&
(
GetLastError
()
==
ERROR_MORE_DATA
||
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
),
"GetStandardColorSpaceProfileA() returns %d (GLE=%d)
\n
"
,
ret
,
GetLastError
()
);
}
else
{
SetLastError
(
0xfaceabee
);
/* 3rd param, */
ret
=
pGetStandardColorSpaceProfileA
(
NULL
,
SPACE_RGB
,
NULL
,
&
sizeP
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"GetStandardColorSpaceProfileA() returns %d (GLE=%d)
\n
"
,
ret
,
GetLastError
()
);
SetLastError
(
0xfaceabee
);
/* dereferenced 4th param. */
ret
=
pGetStandardColorSpaceProfileA
(
NULL
,
SPACE_RGB
,
newprofile
,
&
sizeP
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"GetStandardColorSpaceProfileA() returns %d (GLE=%d)
\n
"
,
ret
,
GetLastError
()
);
}
...
...
@@ -642,7 +638,7 @@ static void test_GetStandardColorSpaceProfileA(void)
SetLastError
(
0xfaceabee
);
/* maybe 2nd param. */
ret
=
pGetStandardColorSpaceProfileA
(
NULL
,
0
,
newprofile
,
&
sizeP
);
if
(
!
ret
)
todo_wine
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"GetStandardColorSpaceProfileA() returns %d (GLE=%d)
\n
"
,
ret
,
GetLastError
()
);
if
(
!
ret
)
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"GetStandardColorSpaceProfileA() returns %d (GLE=%d)
\n
"
,
ret
,
GetLastError
()
);
else
ok
(
!
lstrcmpiA
(
newprofile
,
emptyA
)
&&
GetLastError
()
==
0xfaceabee
,
"GetStandardColorSpaceProfileA() returns %d (GLE=%d)
\n
"
,
ret
,
GetLastError
()
);
/* Functional checks */
...
...
@@ -689,7 +685,6 @@ static void test_GetStandardColorSpaceProfileW(void)
SetLastError
(
0xfaceabee
);
/* 2nd param, */
ret
=
pGetStandardColorSpaceProfileW
(
NULL
,
(
DWORD
)
-
1
,
newprofile
,
&
sizeP
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"GetStandardColorSpaceProfileW() returns %d (GLE=%d)
\n
"
,
ret
,
GetLastError
()
);
SetLastError
(
0xfaceabee
);
/* 3th param, */
...
...
@@ -702,7 +697,6 @@ static void test_GetStandardColorSpaceProfileW(void)
SetLastError
(
0xfaceabee
);
/* dereferenced 4th param. */
ret
=
pGetStandardColorSpaceProfileW
(
NULL
,
SPACE_RGB
,
newprofile
,
&
zero
);
todo_wine
ok
(
!
ret
&&
(
GetLastError
()
==
ERROR_MORE_DATA
||
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
),
"GetStandardColorSpaceProfileW() returns %d (GLE=%d)
\n
"
,
ret
,
GetLastError
()
);
/* Several invalid parameter checks: */
...
...
@@ -721,7 +715,7 @@ static void test_GetStandardColorSpaceProfileW(void)
SetLastError
(
0xfaceabee
);
/* maybe 2nd param. */
ret
=
pGetStandardColorSpaceProfileW
(
NULL
,
0
,
newprofile
,
&
sizeP
);
if
(
!
ret
)
todo_wine
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"GetStandardColorSpaceProfileW() returns %d (GLE=%d)
\n
"
,
ret
,
GetLastError
()
);
if
(
!
ret
)
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"GetStandardColorSpaceProfileW() returns %d (GLE=%d)
\n
"
,
ret
,
GetLastError
()
);
else
ok
(
!
lstrcmpiW
(
newprofile
,
emptyW
)
&&
GetLastError
()
==
0xfaceabee
,
"GetStandardColorSpaceProfileW() returns %d (GLE=%d)
\n
"
,
ret
,
GetLastError
()
);
/* Functional checks */
...
...
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