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
0a136249
Commit
0a136249
authored
Feb 25, 2019
by
Hans Leidekker
Committed by
Alexandre Julliard
Feb 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mscms: Set last error on insufficient buffer in EnumColorProfilesA/W.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a48955a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
17 deletions
+28
-17
profile.c
dlls/mscms/profile.c
+10
-2
profile.c
dlls/mscms/tests/profile.c
+18
-15
No files found.
dlls/mscms/profile.c
View file @
0a136249
...
@@ -918,7 +918,11 @@ BOOL WINAPI EnumColorProfilesA( PCSTR machine, PENUMTYPEA record, PBYTE buffer,
...
@@ -918,7 +918,11 @@ BOOL WINAPI EnumColorProfilesA( PCSTR machine, PENUMTYPEA record, PBYTE buffer,
*
p
=
0
;
*
p
=
0
;
ret
=
TRUE
;
ret
=
TRUE
;
}
}
else
ret
=
FALSE
;
else
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
ret
=
FALSE
;
}
*
size
=
totalsize
;
*
size
=
totalsize
;
if
(
number
)
*
number
=
count
;
if
(
number
)
*
number
=
count
;
...
@@ -1044,7 +1048,11 @@ BOOL WINAPI EnumColorProfilesW( PCWSTR machine, PENUMTYPEW record, PBYTE buffer,
...
@@ -1044,7 +1048,11 @@ BOOL WINAPI EnumColorProfilesW( PCWSTR machine, PENUMTYPEW record, PBYTE buffer,
*
p
=
0
;
*
p
=
0
;
ret
=
TRUE
;
ret
=
TRUE
;
}
}
else
ret
=
FALSE
;
else
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
ret
=
FALSE
;
}
*
size
=
totalsize
;
*
size
=
totalsize
;
if
(
number
)
*
number
=
count
;
if
(
number
)
*
number
=
count
;
...
...
dlls/mscms/tests/profile.c
View file @
0a136249
...
@@ -660,35 +660,36 @@ static void test_EnumColorProfilesA( char *standardprofile )
...
@@ -660,35 +660,36 @@ static void test_EnumColorProfilesA( char *standardprofile )
record
.
dwDataColorSpace
=
SPACE_RGB
;
record
.
dwDataColorSpace
=
SPACE_RGB
;
total
=
0
;
total
=
0
;
SetLastError
(
0xdeadbeef
);
ret
=
pEnumColorProfilesA
(
NULL
,
&
record
,
NULL
,
&
total
,
&
number
);
ret
=
pEnumColorProfilesA
(
NULL
,
&
record
,
NULL
,
&
total
,
&
number
);
ok
(
!
ret
,
"EnumColorProfilesA() failed (%d)
\n
"
,
GetLastError
()
);
ok
(
!
ret
,
"EnumColorProfilesA succeeded
\n
"
);
if
(
have_color_profile
)
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"got %u
\n
"
,
GetLastError
()
);
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
total
);
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
total
);
size
=
total
;
size
=
total
;
ret
=
pEnumColorProfilesA
(
machine
,
&
record
,
buffer
,
&
size
,
&
number
);
ret
=
pEnumColorProfilesA
(
machine
,
&
record
,
buffer
,
&
size
,
&
number
);
ok
(
!
ret
,
"EnumColorProfilesA
() succeeded (%d)
\n
"
,
GetLastError
()
);
ok
(
!
ret
,
"EnumColorProfilesA
succeeded
\n
"
);
ret
=
pEnumColorProfilesA
(
NULL
,
NULL
,
buffer
,
&
size
,
&
number
);
ret
=
pEnumColorProfilesA
(
NULL
,
NULL
,
buffer
,
&
size
,
&
number
);
ok
(
!
ret
,
"EnumColorProfilesA
() succeeded (%d)
\n
"
,
GetLastError
()
);
ok
(
!
ret
,
"EnumColorProfilesA
succeeded
\n
"
);
ret
=
pEnumColorProfilesA
(
NULL
,
&
record
,
buffer
,
NULL
,
&
number
);
ret
=
pEnumColorProfilesA
(
NULL
,
&
record
,
buffer
,
NULL
,
&
number
);
ok
(
!
ret
,
"EnumColorProfilesA
() succeeded (%d)
\n
"
,
GetLastError
()
);
ok
(
!
ret
,
"EnumColorProfilesA
succeeded
\n
"
);
ret
=
pEnumColorProfilesA
(
NULL
,
&
record
,
buffer
,
&
size
,
&
number
);
ret
=
pEnumColorProfilesA
(
NULL
,
&
record
,
buffer
,
&
size
,
&
number
);
todo_wine_if
(
!
have_color_profile
)
todo_wine_if
(
!
have_color_profile
)
ok
(
ret
,
"EnumColorProfilesA
() failed (%d)
\n
"
,
GetLastError
()
);
ok
(
ret
,
"EnumColorProfilesA
failed %u
\n
"
,
GetLastError
()
);
size
=
0
;
size
=
0
;
ret
=
pEnumColorProfilesA
(
NULL
,
&
record
,
buffer
,
&
size
,
&
number
);
ret
=
pEnumColorProfilesA
(
NULL
,
&
record
,
buffer
,
&
size
,
&
number
);
ok
(
!
ret
,
"EnumColorProfilesA
() succeeded (%d)
\n
"
,
GetLastError
()
);
ok
(
!
ret
,
"EnumColorProfilesA
succeeded
\n
"
);
/* Functional checks */
/* Functional checks */
size
=
total
;
size
=
total
;
ret
=
pEnumColorProfilesA
(
NULL
,
&
record
,
buffer
,
&
size
,
&
number
);
ret
=
pEnumColorProfilesA
(
NULL
,
&
record
,
buffer
,
&
size
,
&
number
);
todo_wine_if
(
!
have_color_profile
)
todo_wine_if
(
!
have_color_profile
)
ok
(
ret
,
"EnumColorProfilesA
() failed (%d)
\n
"
,
GetLastError
()
);
ok
(
ret
,
"EnumColorProfilesA
failed %u
\n
"
,
GetLastError
()
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
}
}
...
@@ -710,34 +711,36 @@ static void test_EnumColorProfilesW( WCHAR *standardprofileW )
...
@@ -710,34 +711,36 @@ static void test_EnumColorProfilesW( WCHAR *standardprofileW )
record
.
dwDataColorSpace
=
SPACE_RGB
;
record
.
dwDataColorSpace
=
SPACE_RGB
;
total
=
0
;
total
=
0
;
SetLastError
(
0xdeadbeef
);
ret
=
pEnumColorProfilesW
(
NULL
,
&
record
,
NULL
,
&
total
,
&
number
);
ret
=
pEnumColorProfilesW
(
NULL
,
&
record
,
NULL
,
&
total
,
&
number
);
ok
(
!
ret
,
"EnumColorProfilesW() failed (%d)
\n
"
,
GetLastError
()
);
ok
(
!
ret
,
"EnumColorProfilesW succeeded
\n
"
);
if
(
have_color_profile
)
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"got %u
\n
"
,
GetLastError
()
);
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
total
*
sizeof
(
WCHAR
)
);
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
total
*
sizeof
(
WCHAR
)
);
size
=
total
;
size
=
total
;
ret
=
pEnumColorProfilesW
(
machineW
,
&
record
,
buffer
,
&
size
,
&
number
);
ret
=
pEnumColorProfilesW
(
machineW
,
&
record
,
buffer
,
&
size
,
&
number
);
ok
(
!
ret
,
"EnumColorProfilesW
() succeeded (%d)
\n
"
,
GetLastError
()
);
ok
(
!
ret
,
"EnumColorProfilesW
succeeded
\n
"
);
ret
=
pEnumColorProfilesW
(
NULL
,
NULL
,
buffer
,
&
size
,
&
number
);
ret
=
pEnumColorProfilesW
(
NULL
,
NULL
,
buffer
,
&
size
,
&
number
);
ok
(
!
ret
,
"EnumColorProfilesW
() succeeded (%d)
\n
"
,
GetLastError
()
);
ok
(
!
ret
,
"EnumColorProfilesW
succeeded
\n
"
);
ret
=
pEnumColorProfilesW
(
NULL
,
&
record
,
buffer
,
NULL
,
&
number
);
ret
=
pEnumColorProfilesW
(
NULL
,
&
record
,
buffer
,
NULL
,
&
number
);
ok
(
!
ret
,
"EnumColorProfilesW
() succeeded (%d)
\n
"
,
GetLastError
()
);
ok
(
!
ret
,
"EnumColorProfilesW
succeeded
\n
"
);
ret
=
pEnumColorProfilesW
(
NULL
,
&
record
,
buffer
,
&
size
,
&
number
);
ret
=
pEnumColorProfilesW
(
NULL
,
&
record
,
buffer
,
&
size
,
&
number
);
todo_wine_if
(
!
have_color_profile
)
todo_wine_if
(
!
have_color_profile
)
ok
(
ret
,
"EnumColorProfilesW
() failed (%d)
\n
"
,
GetLastError
()
);
ok
(
ret
,
"EnumColorProfilesW
failed %u
\n
"
,
GetLastError
()
);
size
=
0
;
size
=
0
;
ret
=
pEnumColorProfilesW
(
NULL
,
&
record
,
buffer
,
&
size
,
&
number
);
ret
=
pEnumColorProfilesW
(
NULL
,
&
record
,
buffer
,
&
size
,
&
number
);
ok
(
!
ret
,
"EnumColorProfilesW
() succeeded (%d)
\n
"
,
GetLastError
()
);
ok
(
!
ret
,
"EnumColorProfilesW
succeeded
\n
"
);
/* Functional checks */
/* Functional checks */
size
=
total
;
size
=
total
;
ret
=
pEnumColorProfilesW
(
NULL
,
&
record
,
buffer
,
&
size
,
&
number
);
ret
=
pEnumColorProfilesW
(
NULL
,
&
record
,
buffer
,
&
size
,
&
number
);
todo_wine_if
(
!
have_color_profile
)
todo_wine_if
(
!
have_color_profile
)
ok
(
ret
,
"EnumColorProfilesW
() failed (%d)
\n
"
,
GetLastError
()
);
ok
(
ret
,
"EnumColorProfilesW
failed %u
\n
"
,
GetLastError
()
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
}
}
...
...
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