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
6ebe8d5a
Commit
6ebe8d5a
authored
Oct 08, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 08, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Use E_NOT_SUFFICIENT_BUFFER definition.
parent
730e744e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
13 deletions
+13
-13
ordinal.c
dlls/shlwapi/ordinal.c
+2
-2
ordinal.c
dlls/shlwapi/tests/ordinal.c
+9
-9
string.c
dlls/shlwapi/tests/string.c
+2
-2
No files found.
dlls/shlwapi/ordinal.c
View file @
6ebe8d5a
...
@@ -453,7 +453,7 @@ exit:
...
@@ -453,7 +453,7 @@ exit:
* Success: S_OK. langbuf is set to the language string found.
* Success: S_OK. langbuf is set to the language string found.
* Failure: E_FAIL, If any arguments are invalid, error occurred, or Explorer
* Failure: E_FAIL, If any arguments are invalid, error occurred, or Explorer
* does not contain the setting.
* does not contain the setting.
*
HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)
, If the buffer is not big enough
*
E_NOT_SUFFICIENT_BUFFER
, If the buffer is not big enough
*/
*/
HRESULT
WINAPI
GetAcceptLanguagesW
(
LPWSTR
langbuf
,
LPDWORD
buflen
)
HRESULT
WINAPI
GetAcceptLanguagesW
(
LPWSTR
langbuf
,
LPDWORD
buflen
)
{
{
...
@@ -506,7 +506,7 @@ HRESULT WINAPI GetAcceptLanguagesW( LPWSTR langbuf, LPDWORD buflen)
...
@@ -506,7 +506,7 @@ HRESULT WINAPI GetAcceptLanguagesW( LPWSTR langbuf, LPDWORD buflen)
}
}
*
buflen
=
0
;
*
buflen
=
0
;
return
__HRESULT_FROM_WIN32
(
ERROR_INSUFFICIENT_BUFFER
)
;
return
E_NOT_SUFFICIENT_BUFFER
;
}
}
/*************************************************************************
/*************************************************************************
...
...
dlls/shlwapi/tests/ordinal.c
View file @
6ebe8d5a
...
@@ -290,14 +290,14 @@ static void test_GetAcceptLanguagesA(void)
...
@@ -290,14 +290,14 @@ static void test_GetAcceptLanguagesA(void)
When the buffer is large enough, the default language is returned
When the buffer is large enough, the default language is returned
When the buffer is too small for that fallback, win7_32 and w2k8_64
When the buffer is too small for that fallback, win7_32 and w2k8_64
fail with
HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), win8 fails
fail with
E_NOT_SUFFICIENT_BUFFER, win8 fails with HRESULT_FROM_WIN32(ERROR_MORE_DATA),
with HRESULT_FROM_WIN32(ERROR_MORE_DATA), other versions succeed an
d
other versions succeed and return a partial result while older os succee
d
return a partial result while older os succeed
and overflow the buffer */
and overflow the buffer */
ok
(((
hr
==
E_INVALIDARG
)
&&
(
len
==
0
))
||
ok
(((
hr
==
E_INVALIDARG
)
&&
(
len
==
0
))
||
(((
hr
==
S_OK
)
&&
!
lstrcmpA
(
buffer
,
language
)
&&
(
len
==
lstrlenA
(
language
)))
||
(((
hr
==
S_OK
)
&&
!
lstrcmpA
(
buffer
,
language
)
&&
(
len
==
lstrlenA
(
language
)))
||
((
hr
==
S_OK
)
&&
!
memcmp
(
buffer
,
language
,
len
))
||
((
hr
==
S_OK
)
&&
!
memcmp
(
buffer
,
language
,
len
))
||
((
hr
==
__HRESULT_FROM_WIN32
(
ERROR_INSUFFICIENT_BUFFER
)
)
&&
!
len
)
||
((
hr
==
E_NOT_SUFFICIENT_BUFFER
)
&&
!
len
)
||
((
hr
==
__HRESULT_FROM_WIN32
(
ERROR_MORE_DATA
))
&&
len
==
exactsize
)),
((
hr
==
__HRESULT_FROM_WIN32
(
ERROR_MORE_DATA
))
&&
len
==
exactsize
)),
"==_#%d: got 0x%x with %d and %s
\n
"
,
i
,
hr
,
len
,
buffer
);
"==_#%d: got 0x%x with %d and %s
\n
"
,
i
,
hr
,
len
,
buffer
);
...
@@ -309,7 +309,7 @@ static void test_GetAcceptLanguagesA(void)
...
@@ -309,7 +309,7 @@ static void test_GetAcceptLanguagesA(void)
ok
(((
hr
==
E_INVALIDARG
)
&&
(
len
==
0
))
||
ok
(((
hr
==
E_INVALIDARG
)
&&
(
len
==
0
))
||
(((
hr
==
S_OK
)
&&
!
lstrcmpA
(
buffer
,
language
)
&&
(
len
==
lstrlenA
(
language
)))
||
(((
hr
==
S_OK
)
&&
!
lstrcmpA
(
buffer
,
language
)
&&
(
len
==
lstrlenA
(
language
)))
||
((
hr
==
S_OK
)
&&
!
memcmp
(
buffer
,
language
,
len
))
||
((
hr
==
S_OK
)
&&
!
memcmp
(
buffer
,
language
,
len
))
||
((
hr
==
__HRESULT_FROM_WIN32
(
ERROR_INSUFFICIENT_BUFFER
)
)
&&
!
len
)
||
((
hr
==
E_NOT_SUFFICIENT_BUFFER
)
&&
!
len
)
||
((
hr
==
__HRESULT_FROM_WIN32
(
ERROR_MORE_DATA
))
&&
len
==
exactsize
-
1
)),
((
hr
==
__HRESULT_FROM_WIN32
(
ERROR_MORE_DATA
))
&&
len
==
exactsize
-
1
)),
"-1_#%d: got 0x%x with %d and %s
\n
"
,
i
,
hr
,
len
,
buffer
);
"-1_#%d: got 0x%x with %d and %s
\n
"
,
i
,
hr
,
len
,
buffer
);
}
}
...
@@ -321,7 +321,7 @@ static void test_GetAcceptLanguagesA(void)
...
@@ -321,7 +321,7 @@ static void test_GetAcceptLanguagesA(void)
ok
(((
hr
==
E_INVALIDARG
)
&&
(
len
==
0
))
||
ok
(((
hr
==
E_INVALIDARG
)
&&
(
len
==
0
))
||
(((
hr
==
S_OK
)
&&
!
lstrcmpA
(
buffer
,
language
)
&&
(
len
==
lstrlenA
(
language
)))
||
(((
hr
==
S_OK
)
&&
!
lstrcmpA
(
buffer
,
language
)
&&
(
len
==
lstrlenA
(
language
)))
||
((
hr
==
S_OK
)
&&
!
memcmp
(
buffer
,
language
,
len
))
||
((
hr
==
S_OK
)
&&
!
memcmp
(
buffer
,
language
,
len
))
||
((
hr
==
__HRESULT_FROM_WIN32
(
ERROR_INSUFFICIENT_BUFFER
)
)
&&
!
len
)
||
((
hr
==
E_NOT_SUFFICIENT_BUFFER
)
&&
!
len
)
||
((
hr
==
__HRESULT_FROM_WIN32
(
ERROR_MORE_DATA
))
&&
len
==
1
)),
((
hr
==
__HRESULT_FROM_WIN32
(
ERROR_MORE_DATA
))
&&
len
==
1
)),
"=1_#%d: got 0x%x with %d and %s
\n
"
,
i
,
hr
,
len
,
buffer
);
"=1_#%d: got 0x%x with %d and %s
\n
"
,
i
,
hr
,
len
,
buffer
);
...
@@ -353,7 +353,7 @@ static void test_GetAcceptLanguagesA(void)
...
@@ -353,7 +353,7 @@ static void test_GetAcceptLanguagesA(void)
buffer
[
maxlen
]
=
0
;
buffer
[
maxlen
]
=
0
;
hr
=
pGetAcceptLanguagesA
(
buffer
,
&
len
);
hr
=
pGetAcceptLanguagesA
(
buffer
,
&
len
);
ok
(
(((
hr
==
S_OK
)
||
(
hr
==
E_INVALIDARG
))
&&
!
memcmp
(
buffer
,
language
,
len
))
||
ok
(
(((
hr
==
S_OK
)
||
(
hr
==
E_INVALIDARG
))
&&
!
memcmp
(
buffer
,
language
,
len
))
||
((
hr
==
__HRESULT_FROM_WIN32
(
ERROR_INSUFFICIENT_BUFFER
)
)
&&
!
len
)
||
((
hr
==
E_NOT_SUFFICIENT_BUFFER
)
&&
!
len
)
||
((
hr
==
__HRESULT_FROM_WIN32
(
ERROR_CANNOT_COPY
))
&&
!
len
),
((
hr
==
__HRESULT_FROM_WIN32
(
ERROR_CANNOT_COPY
))
&&
!
len
),
"=2: got 0x%x with %d and %s
\n
"
,
hr
,
len
,
buffer
);
"=2: got 0x%x with %d and %s
\n
"
,
hr
,
len
,
buffer
);
...
@@ -362,11 +362,11 @@ static void test_GetAcceptLanguagesA(void)
...
@@ -362,11 +362,11 @@ static void test_GetAcceptLanguagesA(void)
buffer
[
maxlen
]
=
0
;
buffer
[
maxlen
]
=
0
;
hr
=
pGetAcceptLanguagesA
(
buffer
,
&
len
);
hr
=
pGetAcceptLanguagesA
(
buffer
,
&
len
);
/* When the buffer is too small, win7_32 and w2k8_64 and above fail with
/* When the buffer is too small, win7_32 and w2k8_64 and above fail with
HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)
, win8 ERROR_CANNOT_COPY,
E_NOT_SUFFICIENT_BUFFER
, win8 ERROR_CANNOT_COPY,
other versions succeed and return a partial 0 terminated result while other versions
other versions succeed and return a partial 0 terminated result while other versions
fail with E_INVALIDARG and return a partial unterminated result */
fail with E_INVALIDARG and return a partial unterminated result */
ok
(
(((
hr
==
S_OK
)
||
(
hr
==
E_INVALIDARG
))
&&
!
memcmp
(
buffer
,
language
,
len
))
||
ok
(
(((
hr
==
S_OK
)
||
(
hr
==
E_INVALIDARG
))
&&
!
memcmp
(
buffer
,
language
,
len
))
||
((
hr
==
__HRESULT_FROM_WIN32
(
ERROR_INSUFFICIENT_BUFFER
)
)
&&
!
len
)
||
((
hr
==
E_NOT_SUFFICIENT_BUFFER
)
&&
!
len
)
||
((
hr
==
__HRESULT_FROM_WIN32
(
ERROR_CANNOT_COPY
))
&&
!
len
),
((
hr
==
__HRESULT_FROM_WIN32
(
ERROR_CANNOT_COPY
))
&&
!
len
),
"=1: got 0x%x with %d and %s
\n
"
,
hr
,
len
,
buffer
);
"=1: got 0x%x with %d and %s
\n
"
,
hr
,
len
,
buffer
);
...
...
dlls/shlwapi/tests/string.c
View file @
6ebe8d5a
...
@@ -1058,7 +1058,7 @@ if (0)
...
@@ -1058,7 +1058,7 @@ if (0)
memset
(
wbuf
,
0xbf
,
sizeof
(
wbuf
));
memset
(
wbuf
,
0xbf
,
sizeof
(
wbuf
));
strret
.
uType
=
STRRET_WSTR
;
strret
.
uType
=
STRRET_WSTR
;
U
(
strret
).
pOleStr
=
StrDupW
(
wstr1
);
U
(
strret
).
pOleStr
=
StrDupW
(
wstr1
);
expect_eq2
(
pStrRetToBufW
(
&
strret
,
NULL
,
wbuf
,
10
),
S_OK
,
HRESULT_FROM_WIN32
(
ERROR_INSUFFICIENT_BUFFER
)
/* Vista */
,
HRESULT
,
"%x"
);
expect_eq2
(
pStrRetToBufW
(
&
strret
,
NULL
,
wbuf
,
10
),
S_OK
,
E_NOT_SUFFICIENT_BUFFER
/* Vista */
,
HRESULT
,
"%x"
);
expect_eq
(
wbuf
[
9
],
0
,
WCHAR
,
"%x"
);
expect_eq
(
wbuf
[
9
],
0
,
WCHAR
,
"%x"
);
expect_eq
(
wbuf
[
10
],
(
WCHAR
)
0xbfbf
,
WCHAR
,
"%x"
);
expect_eq
(
wbuf
[
10
],
(
WCHAR
)
0xbfbf
,
WCHAR
,
"%x"
);
}
}
...
@@ -1070,7 +1070,7 @@ if (0)
...
@@ -1070,7 +1070,7 @@ if (0)
memset
(
buf
,
0xbf
,
sizeof
(
buf
));
memset
(
buf
,
0xbf
,
sizeof
(
buf
));
strret
.
uType
=
STRRET_CSTR
;
strret
.
uType
=
STRRET_CSTR
;
StrCpyNA
(
U
(
strret
).
cStr
,
str1
,
MAX_PATH
);
StrCpyNA
(
U
(
strret
).
cStr
,
str1
,
MAX_PATH
);
expect_eq2
(
pStrRetToBufA
(
&
strret
,
NULL
,
buf
,
10
),
S_OK
,
HRESULT_FROM_WIN32
(
ERROR_INSUFFICIENT_BUFFER
)
/* Vista */
,
HRESULT
,
"%x"
);
expect_eq2
(
pStrRetToBufA
(
&
strret
,
NULL
,
buf
,
10
),
S_OK
,
E_NOT_SUFFICIENT_BUFFER
/* Vista */
,
HRESULT
,
"%x"
);
expect_eq
(
buf
[
9
],
0
,
CHAR
,
"%x"
);
expect_eq
(
buf
[
9
],
0
,
CHAR
,
"%x"
);
expect_eq
(
buf
[
10
],
(
CHAR
)
0xbf
,
CHAR
,
"%x"
);
expect_eq
(
buf
[
10
],
(
CHAR
)
0xbf
,
CHAR
,
"%x"
);
}
}
...
...
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